@treasuredata/tdx 0.28.2 → 0.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/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.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-utils.js.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/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/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a46_0x350b3f=a46_0x13d0;(function(_0x507edc,_0x5a72bd){const _0x40530e=a46_0x13d0,_0x2a23fe=_0x507edc();while(!![]){try{const _0x20595d=-parseInt(_0x40530e(0x16e))/0x1*(parseInt(_0x40530e(0x96))/0x2)+parseInt(_0x40530e(0x10e))/0x3*(-parseInt(_0x40530e(0x14e))/0x4)+parseInt(_0x40530e(0x22b))/0x5+-parseInt(_0x40530e(0x149))/0x6+parseInt(_0x40530e(0x8e))/0x7+-parseInt(_0x40530e(0x178))/0x8+parseInt(_0x40530e(0x1f8))/0x9;if(_0x20595d===_0x5a72bd)break;else _0x2a23fe['push'](_0x2a23fe['shift']());}catch(_0x9e4411){_0x2a23fe['push'](_0x2a23fe['shift']());}}}(a46_0x5827,0x19902));import a46_0x41c3a5 from'chalk';import{existsSync}from'fs';import a46_0x418c9f from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a46_0x443862 from'prompts';function getAttemptStatusDisplay(_0x1c8120){const _0x12ebee=a46_0x13d0;if(!_0x1c8120)return{'icon':'⏳','text':''};const {done:_0x36607b,success:_0x3f1133,cancelRequested:_0xd6d7db}=_0x1c8120;if(!_0x36607b)return _0xd6d7db?{'icon':'🛑','text':a46_0x41c3a5['yellow'](_0x12ebee(0x1c9))}:{'icon':'🔄','text':a46_0x41c3a5[_0x12ebee(0x211)](_0x12ebee(0x108))};if(_0x3f1133)return{'icon':'✅','text':a46_0x41c3a5[_0x12ebee(0x103)](_0x12ebee(0x1a1))};return{'icon':'❌','text':a46_0x41c3a5['red'](_0x12ebee(0xe6))};}export class WorkflowBaseCommand extends BaseCommand{[a46_0x350b3f(0x20c)](_0x2b531b,_0x4e32a7,_0x35f08d=0x0){const _0x2af8c5=a46_0x350b3f;return _0x2b531b[_0x35f08d]||_0x4e32a7[_0x2af8c5(0x151)];}[a46_0x350b3f(0x17c)](_0x477b3c,_0x9d1d65,_0x195351=0x0){const _0x598ccb=a46_0x350b3f,_0x3a6291=this[_0x598ccb(0x20c)](_0x477b3c,_0x9d1d65,_0x195351);if(!_0x3a6291)return console[_0x598ccb(0xe6)](a46_0x41c3a5[_0x598ccb(0xb4)](_0x598ccb(0xe5)),_0x598ccb(0x120)),console['error'](a46_0x41c3a5[_0x598ccb(0x1c2)](_0x598ccb(0xf5))),null;return _0x3a6291;}[a46_0x350b3f(0x199)](_0xfe206,_0x666338){const _0xf547e9=a46_0x350b3f;if(_0xfe206[0x0]){const _0x3047c4=_0xfe206[0x0][_0xf547e9(0xa4)]('.');if(_0x3047c4[_0xf547e9(0xbe)]===0x1)return{'projectName':_0x3047c4[0x0],'workflowName':undefined};else return _0x3047c4[_0xf547e9(0xbe)]===0x2?{'projectName':_0x3047c4[0x0],'workflowName':_0x3047c4[0x1]}:(console[_0xf547e9(0xe6)](a46_0x41c3a5[_0xf547e9(0xb4)](_0xf547e9(0xe5)),_0xf547e9(0xaa)),null);}return{'projectName':_0x666338[_0xf547e9(0x151)],'workflowName':undefined};}['resolveProjectDir'](_0x2cb68a,_0x492710,_0x85f93a=0x0){const _0x5296e6=a46_0x350b3f;if(_0x2cb68a[_0x85f93a])return _0x2cb68a[_0x85f93a];if(_0x492710[_0x5296e6(0x151)]){const _0x165ea2=a46_0x418c9f[_0x5296e6(0x99)](process[_0x5296e6(0x11d)](),_0x5296e6(0x235),_0x492710[_0x5296e6(0x151)]);if(existsSync(a46_0x418c9f[_0x5296e6(0x99)](_0x165ea2,_0x5296e6(0x1c0))))return _0x165ea2;}return undefined;}async[a46_0x350b3f(0x1a7)](_0xbb52fc,_0x1eb494,_0x27c00c){const _0x544f7d=a46_0x350b3f;try{const _0x3dad10=await _0xbb52fc[_0x544f7d(0xa9)][_0x544f7d(0x235)](_0x1eb494,{'limit':0x1});if(_0x3dad10[_0x544f7d(0xbe)]>0x0){const _0x4524aa=_0x3dad10[0x0]['id'],_0x1310ab=getWorkflowUrl(_0x27c00c,_0x4524aa);console[_0x544f7d(0xe6)](_0x544f7d(0x1ce)+a46_0x41c3a5[_0x544f7d(0x1a0)](_0x1310ab));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x172);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x21e);async[a46_0x350b3f(0x17f)](_0x5351cd){const _0x14cca4=a46_0x350b3f,{options:_0x40c693,args:_0x4cbf2c,tdx:_0x1342cb}=_0x5351cd,_0xdf7d0b=_0x4cbf2c[0x0],_0x50b5ae=_0x40c693[_0x14cca4(0x231)];if(_0x50b5ae)return saveSessionContext({'workflow_project':undefined},_0x40c693[_0x14cca4(0x21d)]),console[_0x14cca4(0x15d)](a46_0x41c3a5['green'](_0x14cca4(0x1fc))),0x0;if(!_0xdf7d0b)return console[_0x14cca4(0xe6)](a46_0x41c3a5[_0x14cca4(0xb4)]('Error:'),_0x14cca4(0x120)),console[_0x14cca4(0xe6)](a46_0x41c3a5[_0x14cca4(0x1c2)](_0x14cca4(0x1ba))),console[_0x14cca4(0xe6)](a46_0x41c3a5['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5c4dd6=await withSpinner(_0x14cca4(0x206)+_0xdf7d0b+_0x14cca4(0x156),()=>_0x1342cb[_0x14cca4(0xa9)][_0x14cca4(0x18c)](_0xdf7d0b),{'verbose':_0x40c693[_0x14cca4(0x15f)]}),{name:_0x3e4b47}=_0x5c4dd6[_0x14cca4(0xa2)];return saveSessionContext({'workflow_project':_0x3e4b47},_0x40c693[_0x14cca4(0x21d)]),console['log'](a46_0x41c3a5[_0x14cca4(0x103)](_0x14cca4(0x1de)+a46_0x41c3a5[_0x14cca4(0x1a0)](_0x3e4b47))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x93);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x1ec);async[a46_0x350b3f(0x17f)](_0x47e18a){const _0x11ee04=a46_0x350b3f,{options:_0x401966,args:_0x455e21,tdx:_0x88ff13}=_0x47e18a,_0xcab743=_0x455e21[0x0];_0x401966['verbose']&&_0xcab743&&console[_0x11ee04(0xe6)](_0x11ee04(0x16a)+_0xcab743);const _0x3dd380=await withSpinner(_0x11ee04(0x167),()=>_0x88ff13[_0x11ee04(0xa9)][_0x11ee04(0xcb)](_0xcab743,{'limit':_0x401966[_0x11ee04(0x188)]}),{'verbose':_0x401966[_0x11ee04(0x15f)]});let _0x3fd9c1=_0x3dd380[_0x11ee04(0xa2)];_0x3fd9c1[_0x11ee04(0x14d)]((_0x5eb2dc,_0x208a29)=>_0x5eb2dc[_0x11ee04(0xea)]['localeCompare'](_0x208a29[_0x11ee04(0xea)]));const _0x5dc6c2=_0x401966['limit']||0x64,_0x5dd630=_0x3fd9c1[_0x11ee04(0xbe)]>=_0x5dc6c2?a46_0x41c3a5[_0x11ee04(0x1c2)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x11ee04(0xe6)]('✔\x20Found\x20'+_0x3fd9c1[_0x11ee04(0xbe)]+'\x20project'+(_0x3fd9c1[_0x11ee04(0xbe)]!==0x1?'s':'')+_0x5dd630);if(_0x401966['format']===_0x11ee04(0x227)||_0x401966['format']===_0x11ee04(0x128)||_0x401966['format']===_0x11ee04(0x1d2))await handleSDKOutput(_0x3fd9c1,_0x401966);else{if(_0x3fd9c1['length']===0x0)_0xcab743?console[_0x11ee04(0x15d)]('No\x20projects\x20match\x20pattern:\x20'+_0xcab743):console[_0x11ee04(0x15d)](_0x11ee04(0x1b2));else{const _0x7f9f4b=_0x3fd9c1[_0x11ee04(0x123)](_0x3a9b7f=>{const _0x90aad9=_0x11ee04,_0x581c2c=_0x3a9b7f['metadata']?.[_0x90aad9(0x14f)](_0x103dc3=>_0x103dc3['key']==='sys'),_0x289b75=_0x581c2c?a46_0x41c3a5['dim'](_0x90aad9(0x138)):'';return _0x90aad9(0x15b)+_0x3a9b7f[_0x90aad9(0xea)]+_0x289b75;});await writeOutput(_0x7f9f4b[_0x11ee04(0x99)]('\x0a'),_0x401966[_0x11ee04(0x121)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a46_0x350b3f(0x125)]=a46_0x350b3f(0x155);async[a46_0x350b3f(0x17f)](_0x13ae7d){const _0x65b05d=a46_0x350b3f,{options:_0x4ece25,args:_0x5c5a6a,tdx:_0xfb5755}=_0x13ae7d,_0x3c0224=this[_0x65b05d(0x20c)](_0x5c5a6a,_0x4ece25);_0x4ece25[_0x65b05d(0x15f)]&&_0x3c0224&&console[_0x65b05d(0xe6)]('Project\x20filter:\x20'+_0x3c0224);const _0x57469c=await withSpinner(_0x65b05d(0x1e5),()=>_0xfb5755[_0x65b05d(0xa9)][_0x65b05d(0x235)](_0x3c0224,{'limit':_0x4ece25[_0x65b05d(0x188)]}),{'verbose':_0x4ece25[_0x65b05d(0x15f)]});let _0x42e135=_0x57469c['data'];_0x42e135[_0x65b05d(0x14d)]((_0x5245be,_0x45cb6e)=>{const _0x257936=_0x65b05d,_0x3fcfe4=_0x5245be['name'][_0x257936(0x21c)](_0x45cb6e[_0x257936(0xea)]);if(_0x3fcfe4!==0x0)return _0x3fcfe4;return(_0x5245be['project']?.[_0x257936(0xea)]||'')[_0x257936(0x21c)](_0x45cb6e[_0x257936(0x229)]?.[_0x257936(0xea)]||'');});const _0x5cda4c=_0x4ece25[_0x65b05d(0x188)]||0x64,_0x3fec8e=_0x42e135[_0x65b05d(0xbe)]>=_0x5cda4c?a46_0x41c3a5[_0x65b05d(0x1c2)](_0x65b05d(0x1cf)):'';console[_0x65b05d(0xe6)](_0x65b05d(0x122)+_0x42e135[_0x65b05d(0xbe)]+_0x65b05d(0x163)+(_0x42e135[_0x65b05d(0xbe)]!==0x1?'s':'')+_0x3fec8e);if(_0x4ece25[_0x65b05d(0x193)]===_0x65b05d(0x227)||_0x4ece25['format']==='jsonl'||_0x4ece25['format']===_0x65b05d(0x1d2))await handleSDKOutput(_0x42e135,_0x4ece25);else{if(_0x42e135['length']===0x0)_0x3c0224?console[_0x65b05d(0x15d)](_0x65b05d(0x223)+_0x3c0224):console[_0x65b05d(0x15d)](_0x65b05d(0x115));else{const _0x5e731e=_0x4ece25['site'],_0x5b0720=_0x42e135['map'](_0x5873a2=>{const _0x42fb13=_0x65b05d,_0x5f53d2=a46_0x41c3a5['dim']('#'+_0x5873a2['id']),_0x5cc38a=hyperlink(_0x5f53d2,getWorkflowUrl(_0x5e731e,_0x5873a2['id'])),_0x172971=_0x5873a2['project']?.['name']?a46_0x41c3a5[_0x42fb13(0x1c2)]('\x20('+_0x5873a2['project'][_0x42fb13(0xea)]+')'):'';return'📋\x20'+_0x5cc38a+'\x20'+_0x5873a2[_0x42fb13(0xea)]+_0x172971;});await writeOutput(_0x5b0720[_0x65b05d(0x99)]('\x0a'),_0x4ece25[_0x65b05d(0x121)],_0x65b05d(0x189));}}return 0x0;}}function a46_0x13d0(_0x31b560,_0x972f29){_0x31b560=_0x31b560-0x8c;const _0x5827d8=a46_0x5827();let _0x13d02d=_0x5827d8[_0x31b560];return _0x13d02d;}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1fa);[a46_0x350b3f(0x125)]='List\x20workflow\x20execution\x20sessions';async[a46_0x350b3f(0x17f)](_0x4d554b){const _0x4fde3d=a46_0x350b3f,{options:_0x3649cc,args:_0xf22f67,tdx:_0x273b15}=_0x4d554b,_0x124dfa=this[_0x4fde3d(0x199)](_0xf22f67,_0x3649cc);if(!_0x124dfa)return 0x1;const {projectName:_0x5aa1ad,workflowName:_0x4959f5}=_0x124dfa;if(_0x3649cc['verbose']){if(_0x5aa1ad&&_0x4959f5)console[_0x4fde3d(0xe6)](_0x4fde3d(0x124)+_0x5aa1ad+'.'+_0x4959f5);else _0x5aa1ad&&console[_0x4fde3d(0xe6)](_0x4fde3d(0x1d1)+_0x5aa1ad);const _0xc589e3=_0x3649cc[_0x4fde3d(0xb6)];_0xc589e3&&console['error'](_0x4fde3d(0x13c)+_0xc589e3);}let _0x161118=0x28;if(process['stdout'][_0x4fde3d(0x1f6)]&&!_0x3649cc['output']&&!_0x3649cc[_0x4fde3d(0x193)]){const _0x2eba49=process[_0x4fde3d(0xe1)]['rows']||0x28;_0x161118=Math[_0x4fde3d(0xe2)](0x14,Math[_0x4fde3d(0x171)](_0x2eba49*0x2/0x3));}const _0x1b8674=_0x3649cc[_0x4fde3d(0x188)]||_0x161118,_0x515476=await withSpinner(_0x4fde3d(0x196),()=>_0x273b15[_0x4fde3d(0xa9)][_0x4fde3d(0xae)]({'projectName':_0x5aa1ad,'workflowName':_0x4959f5,'status':_0x3649cc['status'],'fromTime':_0x3649cc[_0x4fde3d(0xf0)],'toTime':_0x3649cc['to'],'limit':_0x1b8674}),{'verbose':_0x3649cc['verbose']}),_0x526380=_0x515476['data'];_0x526380[_0x4fde3d(0x14d)]((_0xd52fb2,_0x3c1eae)=>{const _0x2b99db=_0x4fde3d,_0x4b4724=_0xd52fb2[_0x2b99db(0x1b7)]||'',_0x346ff5=_0x3c1eae[_0x2b99db(0x1b7)]||'';return _0x346ff5[_0x2b99db(0x21c)](_0x4b4724);});_0x526380['length']>=_0x1b8674?console[_0x4fde3d(0xe6)](_0x4fde3d(0x157)+_0x526380[_0x4fde3d(0xbe)]+_0x4fde3d(0xd1)+a46_0x41c3a5['dim'](_0x4fde3d(0xee))):console['error'](_0x4fde3d(0x122)+_0x526380[_0x4fde3d(0xbe)]+_0x4fde3d(0x226)+(_0x526380[_0x4fde3d(0xbe)]!==0x1?'s':''));if(_0x3649cc[_0x4fde3d(0x193)]===_0x4fde3d(0x227)||_0x3649cc['format']===_0x4fde3d(0x128)||_0x3649cc[_0x4fde3d(0x193)]===_0x4fde3d(0x1d2))await handleSDKOutput(_0x526380,_0x3649cc);else{if(!process[_0x4fde3d(0xe1)]['isTTY']||_0x3649cc[_0x4fde3d(0x121)]){if(_0x526380[_0x4fde3d(0xbe)]===0x0){if(_0x5aa1ad&&_0x4959f5)console['log'](_0x4fde3d(0x102)+_0x5aa1ad+'.'+_0x4959f5);else _0x5aa1ad?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x5aa1ad):console[_0x4fde3d(0x15d)](_0x4fde3d(0x195));}else{const _0x18237b=_0x3649cc['site'],_0x578956=this['renderSessionsTimeline'](_0x526380,_0x18237b);_0x3649cc['output']?await writeOutput(_0x578956,_0x3649cc[_0x4fde3d(0x121)],_0x4fde3d(0x189)):console[_0x4fde3d(0x15d)](_0x578956);}!_0x5aa1ad&&(console['error'](''),console[_0x4fde3d(0xe6)](a46_0x41c3a5['dim'](_0x4fde3d(0x1ad))),console['error'](a46_0x41c3a5[_0x4fde3d(0x1c2)](_0x4fde3d(0x144))+'or'+a46_0x41c3a5[_0x4fde3d(0x1c2)](_0x4fde3d(0x213))));}else{if(_0x526380[_0x4fde3d(0xbe)]===0x0){if(_0x5aa1ad&&_0x4959f5)console['log'](_0x4fde3d(0x102)+_0x5aa1ad+'.'+_0x4959f5);else _0x5aa1ad?console['log'](_0x4fde3d(0xc0)+_0x5aa1ad):console[_0x4fde3d(0x15d)](_0x4fde3d(0x195));}else await this[_0x4fde3d(0x101)](_0x526380,_0x4d554b,_0x5aa1ad);}}return 0x0;}['renderSessionsTimeline'](_0xd5c562,_0x467e78){const _0x3c58b0=a46_0x350b3f,_0x43ac0e=[],_0x1874ff=new Map();let _0x40ab4e=Infinity,_0x505731=-Infinity;for(const _0x518dcf of _0xd5c562){if(_0x518dcf['lastAttempt']?.['createdAt']){const _0x3c778d=new Date(_0x518dcf[_0x3c58b0(0xd7)][_0x3c58b0(0xfa)])[_0x3c58b0(0x10f)](),_0xe32bca=_0x518dcf[_0x3c58b0(0xd7)]['finishedAt']?new Date(_0x518dcf['lastAttempt'][_0x3c58b0(0x180)])[_0x3c58b0(0x10f)]():Date[_0x3c58b0(0x186)](),_0x35b1bf=_0x518dcf[_0x3c58b0(0x229)]?.[_0x3c58b0(0xea)]||_0x3c58b0(0x15e);!_0x1874ff['has'](_0x35b1bf)&&_0x1874ff[_0x3c58b0(0x14c)](_0x35b1bf,[]),_0x1874ff[_0x3c58b0(0x194)](_0x35b1bf)['push']({'session':_0x518dcf,'startTime':_0x3c778d,'endTime':_0xe32bca,'duration':_0xe32bca-_0x3c778d}),_0x40ab4e=Math[_0x3c58b0(0x214)](_0x40ab4e,_0x3c778d),_0x505731=Math[_0x3c58b0(0xe2)](_0x505731,_0xe32bca);}}if(_0x1874ff[_0x3c58b0(0x19a)]===0x0)return _0x3c58b0(0x1d8);const _0x151c3b=process[_0x3c58b0(0xe1)][_0x3c58b0(0x141)]||0x78,_0x3d8a29=0x1e,_0x55d526=0x32,_0xeb236e=0x4,_0x15401f=Math[_0x3c58b0(0x214)](_0x55d526,Math[_0x3c58b0(0xe2)](_0x3d8a29,Math[_0x3c58b0(0x171)](_0x151c3b*0.3))),_0x21c4d9=_0x151c3b-_0x15401f-TIMELINE_CONFIG[_0x3c58b0(0xec)]-0x3-_0xeb236e,_0x131a9b=_0x505731-_0x40ab4e,_0x55e466=_0x131a9b/_0x15401f,_0x3fcce9=renderTimeAxis({'startTime':_0x40ab4e,'endTime':_0x505731,'durationMs':_0x131a9b,'msPerChar':_0x55e466},_0x15401f),_0x8b35ac=[];for(const _0x3a59e8 of _0x1874ff[_0x3c58b0(0x1fe)]()){_0x8b35ac[_0x3c58b0(0x17e)](..._0x3a59e8);}_0x8b35ac[_0x3c58b0(0x14d)]((_0x1d8258,_0x52f6a6)=>_0x52f6a6[_0x3c58b0(0x1b4)]-_0x1d8258['startTime']);const _0x3f2f90=new Date(_0x40ab4e),_0x54119a=formatDate(_0x3f2f90),_0x20e897=_0xeb236e+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x3c58b0(0x146)]+_0x21c4d9,_0x424b72='\x20'[_0x3c58b0(0x15a)](_0x20e897-_0x54119a[_0x3c58b0(0xbe)]),_0x3ab657=_0x424b72+a46_0x41c3a5[_0x3c58b0(0x1c2)](_0x54119a)+'\x20'+_0x3fcce9;_0x43ac0e[_0x3c58b0(0x17e)](_0x3ab657);const _0x256297=0x16;let _0x4e0864=0x0;for(const _0x2a6fc1 of _0x8b35ac){const _0x593957=_0x2a6fc1[_0x3c58b0(0x21d)]['project']?.[_0x3c58b0(0xea)]||'?',_0x5a008b=Math[_0x3c58b0(0x214)](stringWidth(_0x593957),_0x256297);_0x4e0864=Math[_0x3c58b0(0xe2)](_0x4e0864,_0x5a008b);}for(const _0x274f6f of _0x8b35ac){const {session:_0xdc64b5,startTime:_0x51f207,endTime:_0x1777be,duration:_0x3ffaf8}=_0x274f6f,_0x2c1d3b=_0xdc64b5[_0x3c58b0(0x229)]?.['id'],_0x21fcb9=_0xdc64b5['id'],_0x461eb9=_0xdc64b5[_0x3c58b0(0x229)]?.[_0x3c58b0(0xea)]||'?',_0x5a09c4=_0xdc64b5[_0x3c58b0(0xa9)]?.[_0x3c58b0(0xea)]||'?';let _0x52ee23,_0x33a5d0;if(_0xdc64b5[_0x3c58b0(0xd7)]){const _0x1816d4=_0xdc64b5['lastAttempt'];!_0x1816d4['done']?(_0x52ee23=_0x1816d4[_0x3c58b0(0x198)]?'🛑':'🔄',_0x33a5d0=_0x1816d4['cancelRequested']?a46_0x41c3a5[_0x3c58b0(0x222)]:a46_0x41c3a5[_0x3c58b0(0x211)]):(_0x52ee23=_0x1816d4[_0x3c58b0(0x1a1)]?'✅':'❌',_0x33a5d0=_0x1816d4[_0x3c58b0(0x1a1)]?a46_0x41c3a5[_0x3c58b0(0x103)]:a46_0x41c3a5[_0x3c58b0(0xb4)]);}else _0x52ee23='⏳',_0x33a5d0=a46_0x41c3a5[_0x3c58b0(0x1c2)];const _0x54f07f='#'+_0x21fcb9,_0x1e7c6a=_0x2c1d3b?hyperlink(_0x54f07f,getWorkflowSessionUrl(_0x467e78,_0x2c1d3b,_0x21fcb9)):_0x54f07f;let _0x36c526=_0x461eb9;stringWidth(_0x461eb9)>_0x256297&&(_0x36c526=_0x461eb9['slice'](0x0,_0x256297-0x1)+'…');const _0x2c0570=a46_0x41c3a5[_0x3c58b0(0x1c2)](_0x36c526),_0x332c31=stringWidth(_0x36c526),_0x353d8d='\x20'[_0x3c58b0(0x15a)](_0x4e0864-stringWidth(_0x36c526)+0x2),_0x57c427='('+formatElapsed(_0x3ffaf8)+')',_0x10b54b=stringWidth(_0x57c427),_0x430326=stringWidth(_0x54f07f),_0x2adae0=_0x430326+0x1+_0x332c31+_0x353d8d[_0x3c58b0(0xbe)],_0x592eae=_0x21c4d9-_0x2adae0-_0x10b54b-0x1-0x8;let _0x5a5aa8=_0x5a09c4;stringWidth(_0x5a5aa8)>_0x592eae&&(_0x5a5aa8=_0x5a5aa8[_0x3c58b0(0x109)](0x0,_0x592eae-0x1)+'…');const _0x49abeb=_0x1e7c6a+'\x20'+_0x2c0570+_0x353d8d+_0x5a5aa8,_0x326c92=stringWidth(_0x49abeb),_0x21a9e5=_0x21c4d9-_0x326c92-_0x10b54b,_0x1b6a9f=_0x49abeb+'\x20'[_0x3c58b0(0x15a)](Math[_0x3c58b0(0xe2)](0x1,_0x21a9e5))+a46_0x41c3a5['dim'](_0x57c427),_0x38e7fb=Math[_0x3c58b0(0x171)]((_0x51f207-_0x40ab4e)/_0x55e466),_0x5559da=Math[_0x3c58b0(0x171)]((_0x1777be-_0x40ab4e)/_0x55e466),_0x4fd88d=Math['max'](_0x38e7fb+0x1,_0x5559da),_0x4a7c41=new Array(_0x15401f)[_0x3c58b0(0x1c3)]('\x20');for(let _0x459627=_0x38e7fb;_0x459627<Math[_0x3c58b0(0x214)](_0x4fd88d,_0x15401f);_0x459627++){_0x4a7c41[_0x459627]='─';}const _0xa1e97a=_0x4a7c41[_0x3c58b0(0x123)](_0x3f6df1=>_0x3f6df1==='\x20'?'\x20':_0x33a5d0(_0x3f6df1))[_0x3c58b0(0x99)]('');_0x43ac0e[_0x3c58b0(0x17e)](_0x52ee23+'\x20'+_0x1b6a9f+'│'+_0xa1e97a+'│');}return _0x43ac0e['join']('\x0a');}async[a46_0x350b3f(0x101)](_0xc6e57,_0x3b02b1,_0x443391){const _0x357726=a46_0x350b3f,{options:_0x2adaa2,tdx:_0x323554}=_0x3b02b1,_0x540571=_0x2adaa2[_0x357726(0xd5)],{timelineRows:_0xeff5a3,timeAxisHeader:_0xbd6d66}=this['generateSessionTimelineRows'](_0xc6e57,_0x540571),_0x263fde=_0xeff5a3[_0x357726(0x233)](_0x6c1aab=>_0x6c1aab[_0x357726(0x1f3)]);if(_0x263fde[_0x357726(0xbe)]===0x0){const _0x52af85=this['renderSessionsTimeline'](_0xc6e57,_0x540571);console[_0x357726(0x15d)](_0x52af85);!_0x443391&&(console[_0x357726(0xe6)](''),console[_0x357726(0xe6)](a46_0x41c3a5[_0x357726(0x1c2)](_0x357726(0x1ad))),console[_0x357726(0xe6)](a46_0x41c3a5['dim'](_0x357726(0x144))+'or'+a46_0x41c3a5[_0x357726(0x1c2)](_0x357726(0x213))));return;}_0xbd6d66&&console['log'](_0xbd6d66);const _0x27c8f8=_0xeff5a3[_0x357726(0x233)](_0x4a8e4f=>_0x4a8e4f['attemptId'])[_0x357726(0x123)](_0x244181=>({'title':_0x244181[_0x357726(0x22f)],'value':_0x244181[_0x357726(0x1f3)]})),_0x15b894=process[_0x357726(0xe1)]['rows']||0x3c,_0x2c39b7=Math[_0x357726(0xe2)](0x28,Math[_0x357726(0x171)](_0x15b894*0x2/0x3)),_0x4d024b=await a46_0x443862({'type':_0x357726(0x1ee),'name':_0x357726(0x1f3),'message':_0x357726(0x10b),'choices':_0x27c8f8,'initial':-0x1,'limit':_0x2c39b7,'clearFirst':!![],'fallback':{'title':_0x357726(0x1e7),'value':null},'suggest':(_0x14fe3e,_0x3224fd)=>{const _0x2cb5e3=_0x357726;if(!_0x14fe3e)return Promise['resolve'](_0x3224fd);const _0x11a304=_0x3224fd[_0x2cb5e3(0x233)](_0x15cd33=>{const _0x1135a3=_0x2cb5e3,_0x32e45c=_0x15cd33;return _0x32e45c[_0x1135a3(0xb3)][_0x1135a3(0x1b1)]()['includes'](_0x14fe3e['toLowerCase']());});return Promise['resolve'](_0x11a304);}}),_0x46d0e3=()=>{const _0x19d823=_0x357726;process['stdout']['write']('\x1b[1A\x1b[2K'),process[_0x19d823(0xe1)]['write'](_0x19d823(0x10c)),process[_0x19d823(0xe1)][_0x19d823(0x1a6)](_0x19d823(0x10c));},_0x57ad09=_0x4d024b&&_0x4d024b[_0x357726(0x1f3)]&&_0x4d024b['attemptId']!==null&&_0x4d024b[_0x357726(0x1f3)]['trim']()!=='';if(!_0x57ad09){_0x46d0e3(),console[_0x357726(0x15d)](a46_0x41c3a5[_0x357726(0x1c2)](_0x357726(0x1ed)));return;}_0x46d0e3();const _0x562beb=_0xc6e57[_0x357726(0x12c)](_0xa290d4=>_0xa290d4[_0x357726(0xd7)]?.['id']===_0x4d024b[_0x357726(0x1f3)]);if(_0x562beb){const _0x76e19f=_0x562beb[_0x357726(0x229)]?.['name']||'?',_0x70f1f5=_0x562beb[_0x357726(0xa9)]?.[_0x357726(0xea)]||'?';console[_0x357726(0x15d)]('Project:\x20'+a46_0x41c3a5[_0x357726(0x1c2)](_0x76e19f)+',\x20Workflow:\x20'+a46_0x41c3a5[_0x357726(0x1c2)](_0x70f1f5));}const _0x1422f9=new WorkflowTimelineCommand();await _0x1422f9[_0x357726(0x17f)]({'args':[],'options':{..._0x2adaa2,'attemptId':_0x4d024b[_0x357726(0x1f3)]},'tdx':_0x323554});}[a46_0x350b3f(0x153)](_0x2a8ecf,_0x2371e7){const _0x20449f=a46_0x350b3f,_0x4793cd=new Map();for(const _0x9942a1 of _0x2a8ecf){_0x9942a1['id']&&_0x9942a1[_0x20449f(0xd7)]?.['id']&&_0x4793cd[_0x20449f(0x14c)](_0x9942a1['id'],_0x9942a1[_0x20449f(0xd7)]['id']);}const _0x2f87e2=[];let _0x24b0da='';const _0xe2ab40=this[_0x20449f(0xe0)](_0x2a8ecf,_0x2371e7),_0x5a7fb3=_0xe2ab40[_0x20449f(0xa4)]('\x0a');for(const _0x3e2754 of _0x5a7fb3){if(_0x3e2754[_0x20449f(0x218)](_0x20449f(0x1c5))||_0x3e2754[_0x20449f(0x179)](/^\s+\d{4}-\d{2}-\d{2}/))_0x24b0da=_0x3e2754;else{if(_0x3e2754[_0x20449f(0x179)](/^[✅❌🔄🛑⏳]/)){const _0x73457f=_0x3e2754[_0x20449f(0x179)](/#(\d+)/),_0x316bc2=_0x73457f?_0x73457f[0x1]:null,_0x346560=_0x316bc2?_0x4793cd[_0x20449f(0x194)](_0x316bc2)||null:null,_0x593c56=_0x2a8ecf[_0x20449f(0x12c)](_0x4828cd=>_0x4828cd['id']===_0x316bc2),_0x189c53=_0x593c56?.[_0x20449f(0x229)]?.[_0x20449f(0xea)]||'';_0x2f87e2[_0x20449f(0x17e)]({'displayLine':_0x3e2754,'attemptId':_0x346560,'projectName':_0x189c53});}}}return{'timelineRows':_0x2f87e2,'timeAxisHeader':_0x24b0da};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0xdc);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xd8);async[a46_0x350b3f(0x17f)](_0x25a94a){const _0x178c3c=a46_0x350b3f,{options:_0x917981,args:_0x2986f9,tdx:_0x3024dc}=_0x25a94a,_0x50eef1=this[_0x178c3c(0x199)](_0x2986f9,_0x917981);if(!_0x50eef1)return 0x1;const {projectName:_0x3f6cbb,workflowName:_0x9ffcfb}=_0x50eef1,_0x5a72d2=_0x917981['includeRetried'];if(_0x917981[_0x178c3c(0x15f)]){if(_0x3f6cbb&&_0x9ffcfb)console[_0x178c3c(0xe6)](_0x178c3c(0x124)+_0x3f6cbb+'.'+_0x9ffcfb);else _0x3f6cbb&&console[_0x178c3c(0xe6)](_0x178c3c(0x1d1)+_0x3f6cbb);_0x5a72d2&&console[_0x178c3c(0xe6)]('Include\x20retried:\x20yes');}const _0x5fad61=await withSpinner(_0x178c3c(0xc5),()=>_0x3024dc[_0x178c3c(0xa9)][_0x178c3c(0x1b9)]({'projectName':_0x3f6cbb,'workflowName':_0x9ffcfb,'includeRetried':_0x5a72d2,'limit':_0x917981[_0x178c3c(0x188)]}),{'verbose':_0x917981[_0x178c3c(0x15f)]}),_0x246e34=_0x5fad61[_0x178c3c(0xa2)],_0x100acc=_0x917981[_0x178c3c(0x188)]||0x64,_0x488e1d=_0x246e34[_0x178c3c(0xbe)]>=_0x100acc?a46_0x41c3a5['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x178c3c(0x122)+_0x246e34[_0x178c3c(0xbe)]+_0x178c3c(0xd3)+(_0x246e34[_0x178c3c(0xbe)]!==0x1?'s':'')+_0x488e1d);if(_0x917981[_0x178c3c(0x193)]===_0x178c3c(0x227)||_0x917981[_0x178c3c(0x193)]===_0x178c3c(0x128)||_0x917981[_0x178c3c(0x193)]===_0x178c3c(0x1d2))await handleSDKOutput(_0x246e34,_0x917981);else{if(_0x246e34[_0x178c3c(0xbe)]===0x0){if(_0x3f6cbb&&_0x9ffcfb)console[_0x178c3c(0x15d)](_0x178c3c(0x127)+_0x3f6cbb+'.'+_0x9ffcfb);else _0x3f6cbb?console[_0x178c3c(0x15d)](_0x178c3c(0xd0)+_0x3f6cbb):console[_0x178c3c(0x15d)]('No\x20attempts\x20found');}else{const _0x83cbaa=_0x917981[_0x178c3c(0xd5)],_0x3446ff=_0x246e34['map'](_0x1938af=>{const _0x3fc6d5=_0x178c3c,_0x391594=a46_0x41c3a5[_0x3fc6d5(0x1c2)]('#'+_0x1938af['id']),_0x5ed3ce=_0x1938af[_0x3fc6d5(0x229)]?.['id'],_0x4c286e=_0x1938af[_0x3fc6d5(0xfb)]||_0x1938af['sessionId'],_0x18eb37=_0x5ed3ce&&_0x4c286e?hyperlink(_0x391594,getWorkflowAttemptUrl(_0x83cbaa,_0x5ed3ce,_0x4c286e,_0x1938af['id'])):_0x391594,{icon:_0x32827b,text:_0x26c472}=getAttemptStatusDisplay(_0x1938af),_0x39e557=(_0x1938af[_0x3fc6d5(0x229)]?.[_0x3fc6d5(0xea)]||'?')+'.'+(_0x1938af[_0x3fc6d5(0xa9)]?.[_0x3fc6d5(0xea)]||'?'),_0x17ce53=_0x1938af[_0x3fc6d5(0x1b7)]?a46_0x41c3a5['dim'](_0x1938af[_0x3fc6d5(0x1b7)]):'';return(_0x18eb37+'\x20'+_0x32827b+(_0x26c472?'\x20'+_0x26c472:'')+'\x20'+_0x39e557+'\x20'+_0x17ce53)[_0x3fc6d5(0x1bc)]();});await writeOutput(_0x3446ff[_0x178c3c(0x99)]('\x0a'),_0x917981[_0x178c3c(0x121)],_0x178c3c(0x189));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0xaf);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x1c8);async[a46_0x350b3f(0x17f)](_0x4f362e){const _0x56c86e=a46_0x350b3f,{options:_0x1c6300,args:_0x412e6e,tdx:_0x183410}=_0x4f362e,_0x31b15b=_0x412e6e[0x0];if(!_0x31b15b)return console[_0x56c86e(0xe6)](_0x56c86e(0xc6)),0x1;_0x1c6300[_0x56c86e(0x15f)]&&console[_0x56c86e(0xe6)](_0x56c86e(0x183)+_0x31b15b);const _0x4d0ac8=await withSpinner('Getting\x20attempt\x20details...',()=>_0x183410[_0x56c86e(0xa9)][_0x56c86e(0x1f2)](_0x31b15b),{'verbose':_0x1c6300[_0x56c86e(0x15f)]}),_0x4dc6d4=_0x4d0ac8[_0x56c86e(0xa2)];let _0x486eb8;!_0x4dc6d4[_0x56c86e(0x13a)]?_0x486eb8=_0x4dc6d4[_0x56c86e(0x198)]?'canceling':_0x56c86e(0x108):_0x486eb8=_0x4dc6d4[_0x56c86e(0x1a1)]?_0x56c86e(0x1a1):'error';let _0x46151a;if(_0x4dc6d4[_0x56c86e(0xfa)]&&_0x4dc6d4[_0x56c86e(0x180)]){const _0x18e8e9=new Date(_0x4dc6d4[_0x56c86e(0xfa)])[_0x56c86e(0x10f)](),_0xa90f4b=new Date(_0x4dc6d4[_0x56c86e(0x180)])[_0x56c86e(0x10f)]();_0x46151a=Math[_0x56c86e(0xb8)]((_0xa90f4b-_0x18e8e9)/0x3e8);}const _0x4116aa={'attempt_id':_0x4dc6d4['id'],'status':_0x486eb8,..._0x4dc6d4['index']!==undefined&&{'index':_0x4dc6d4[_0x56c86e(0xcd)]},..._0x4dc6d4[_0x56c86e(0x229)]&&{'project':_0x4dc6d4[_0x56c86e(0x229)][_0x56c86e(0xea)]},..._0x4dc6d4['workflow']&&{'workflow':_0x4dc6d4[_0x56c86e(0xa9)][_0x56c86e(0xea)]},..._0x4dc6d4[_0x56c86e(0x12b)]&&{'session_id':_0x4dc6d4[_0x56c86e(0x12b)]},..._0x4dc6d4[_0x56c86e(0x1b7)]&&{'session_time':_0x4dc6d4['sessionTime']},..._0x4dc6d4[_0x56c86e(0x1d0)]&&{'retry_attempt':_0x4dc6d4[_0x56c86e(0x1d0)]},..._0x46151a!==undefined&&{'duration_sec':_0x46151a},..._0x4dc6d4[_0x56c86e(0xfa)]&&{'created_at':_0x4dc6d4['createdAt']},..._0x4dc6d4[_0x56c86e(0x180)]&&{'finished_at':_0x4dc6d4[_0x56c86e(0x180)]},...Object[_0x56c86e(0x212)](_0x4dc6d4[_0x56c86e(0x12d)])[_0x56c86e(0xbe)]>0x0&&{'params':_0x4dc6d4[_0x56c86e(0x12d)]}};return await handleSingleObjectOutput(_0x4116aa,_0x1c6300),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x18b);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x1d7);async[a46_0x350b3f(0x17f)](_0x52f2ad){const _0x111a3e=a46_0x350b3f,{options:_0x33ee4c,args:_0x57af41,tdx:_0x2dc435}=_0x52f2ad,_0x1c5abf=_0x57af41[0x0];if(!_0x1c5abf)return console[_0x111a3e(0xe6)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x461467=_0x33ee4c[_0x111a3e(0x1ca)];_0x33ee4c[_0x111a3e(0x15f)]&&(console[_0x111a3e(0xe6)](_0x111a3e(0x183)+_0x1c5abf),_0x461467&&console['error'](_0x111a3e(0x15c)));const _0x11f9eb=await withSpinner(_0x111a3e(0x158),()=>_0x2dc435[_0x111a3e(0xa9)][_0x111a3e(0x11e)](_0x1c5abf,_0x461467||![]),{'verbose':_0x33ee4c['verbose']}),_0x179f71=_0x11f9eb[_0x111a3e(0xa2)];return console['error'](_0x111a3e(0x122)+_0x179f71[_0x111a3e(0xbe)]+_0x111a3e(0x100)+(_0x179f71[_0x111a3e(0xbe)]!==0x1?'s':'')),await handleSDKOutput(_0x179f71,_0x33ee4c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x133);[a46_0x350b3f(0x125)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a46_0x350b3f(0x17f)](_0x3dbad3){const _0xf89fbc=a46_0x350b3f,{options:_0x38e9f4,args:_0x390ab6,tdx:_0x257906}=_0x3dbad3,_0x1c164a=_0x390ab6[0x0];let _0x43b5ae=_0x390ab6[0x1];if(!_0x1c164a)return console['error'](_0xf89fbc(0xc6)),0x1;_0x38e9f4['verbose']&&(console[_0xf89fbc(0xe6)]('Attempt\x20ID:\x20'+_0x1c164a),_0x43b5ae&&console['error'](_0xf89fbc(0x152)+_0x43b5ae));const _0x20c93d=await withSpinner(_0xf89fbc(0x18e),()=>_0x257906[_0xf89fbc(0xa9)][_0xf89fbc(0x205)](_0x1c164a,_0x43b5ae),{'verbose':_0x38e9f4['verbose']}),_0xc9a22f=_0x20c93d[_0xf89fbc(0xa2)];if(_0xc9a22f[_0xf89fbc(0xbe)]===0x0)return console['error'](_0xf89fbc(0x142)),0x0;if(!_0x43b5ae&&(_0x38e9f4[_0xf89fbc(0x227)]||_0x38e9f4[_0xf89fbc(0x193)]))return await handleSDKOutput(_0xc9a22f,_0x38e9f4),0x0;if(!_0x43b5ae){const _0x2671f4=_0xc9a22f[_0xf89fbc(0x123)](_0xd5f8e4=>({'title':_0xd5f8e4[_0xf89fbc(0x20b)]+'\x20('+formatBytes(_0xd5f8e4[_0xf89fbc(0x116)])+')','value':_0xd5f8e4[_0xf89fbc(0x20b)]})),_0x5986e9=await a46_0x443862({'type':_0xf89fbc(0x9c),'name':_0xf89fbc(0xa5),'message':_0xf89fbc(0x1d3),'choices':_0x2671f4});if(!_0x5986e9[_0xf89fbc(0xa5)])return console[_0xf89fbc(0xe6)](_0xf89fbc(0x1ed)),0x0;_0x43b5ae=_0x5986e9[_0xf89fbc(0xa5)];}const _0x388285=await withSpinner(_0xf89fbc(0xf7),()=>_0x257906[_0xf89fbc(0xa9)][_0xf89fbc(0x92)](_0x1c164a,_0x43b5ae),{'verbose':_0x38e9f4['verbose']}),_0x40b030=_0x388285[_0xf89fbc(0xa2)];return _0x40b030?console['log'](_0x40b030):console['error'](_0xf89fbc(0x12e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1c1);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x174);async[a46_0x350b3f(0x17f)](_0x5e3407){const _0x5bc4ec=a46_0x350b3f,{options:_0x2f2af8,args:_0x3fbace,tdx:_0x26d0d7}=_0x5e3407,_0x8ea867=_0x3fbace[0x0];if(!_0x8ea867)return console['error'](_0x5bc4ec(0xc6)),0x1;const _0x21cb1a=_0x2f2af8[_0x5bc4ec(0xc3)];_0x2f2af8[_0x5bc4ec(0x15f)]&&(console['error'](_0x5bc4ec(0x183)+_0x8ea867),_0x21cb1a&&console[_0x5bc4ec(0xe6)](_0x5bc4ec(0xb9)+_0x21cb1a));if(!_0x2f2af8[_0x5bc4ec(0x1bd)]){if(!isInteractive())return console[_0x5bc4ec(0xe6)](a46_0x41c3a5['red']('\x0aError:'),_0x5bc4ec(0x1f0)),console[_0x5bc4ec(0xe6)](a46_0x41c3a5['dim'](_0x5bc4ec(0x220))),0x1;const _0x121bbc=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x8ea867+'?');if(!_0x121bbc)return console['error'](a46_0x41c3a5['yellow'](_0x5bc4ec(0x1ed))),0x1;}const _0x106c4a=await withSpinner('Killing\x20attempt...',()=>_0x26d0d7[_0x5bc4ec(0xa9)]['kill'](_0x8ea867,_0x21cb1a),{'verbose':_0x2f2af8[_0x5bc4ec(0x15f)]}),_0x274973=_0x106c4a['data'];return console['error']('✔\x20'+_0x274973),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x113);['description']=a46_0x350b3f(0x21a);async[a46_0x350b3f(0x17f)](_0x95dbe9){const _0x374129=a46_0x350b3f,{options:_0x4053c2,args:_0x4bd6ae,tdx:_0x161000}=_0x95dbe9,_0x5c5e11=_0x4bd6ae[0x0];if(!_0x5c5e11)return console[_0x374129(0xe6)](_0x374129(0xd2)),console[_0x374129(0xe6)](_0x374129(0xb5)),0x1;let _0x2f61dd=![],_0xadec1c=_0x5c5e11;if(_0x5c5e11[_0x374129(0x218)]('session:'))_0x2f61dd=!![],_0xadec1c=_0x5c5e11[_0x374129(0x90)](0x8);else{if(_0x5c5e11['startsWith'](_0x374129(0x20d)))_0x2f61dd=![],_0xadec1c=_0x5c5e11[_0x374129(0x90)](0x8);else return console[_0x374129(0xe6)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x374129(0xe6)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x119a2a=_0x4053c2[_0x374129(0xed)],_0x30c81f=_0x4053c2[_0x374129(0x130)],_0x18ca0b=_0x4053c2[_0x374129(0x12d)],_0x1ea9ac=_0x4053c2[_0x374129(0x9a)];_0x4053c2['verbose']&&(console['error'](_0x374129(0x1cd)+(_0x2f61dd?'session':_0x374129(0x1f2))+'\x20'+_0xadec1c),_0x119a2a&&console[_0x374129(0xe6)]('From\x20task:\x20'+_0x119a2a),_0x30c81f&&console[_0x374129(0xe6)]('Resume\x20from:\x20'+_0x30c81f),_0x18ca0b&&console[_0x374129(0xe6)](_0x374129(0xa1)+_0x18ca0b),_0x1ea9ac&&console[_0x374129(0xe6)]('Force:\x20yes'));let _0xce25a2;if(_0x18ca0b)try{if(_0x18ca0b[_0x374129(0x218)]('@')){const _0x3a1033=await import(_0x374129(0x1cb)),_0x38c37c=_0x18ca0b['substring'](0x1),_0x3cdeb8=await _0x3a1033[_0x374129(0x1e2)](_0x38c37c,_0x374129(0x1b6));_0xce25a2=JSON['parse'](_0x3cdeb8);}else _0xce25a2=JSON[_0x374129(0x14b)](_0x18ca0b);}catch{return console[_0x374129(0xe6)](_0x374129(0x1e9)),0x1;}if(!_0x4053c2[_0x374129(0x1bd)]){if(!isInteractive())return console[_0x374129(0xe6)](a46_0x41c3a5[_0x374129(0xb4)](_0x374129(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x374129(0xe6)](a46_0x41c3a5[_0x374129(0x1c2)](_0x374129(0x220))),0x1;const _0x3e298a=await confirmKey(_0x374129(0x192)+(_0x2f61dd?'session':'attempt')+'\x20'+_0xadec1c+'?');if(!_0x3e298a)return console[_0x374129(0xe6)](a46_0x41c3a5[_0x374129(0x222)](_0x374129(0x1ed))),0x1;}let _0x488ddd;_0x2f61dd?_0x488ddd=await withSpinner(_0x374129(0x1d6),()=>_0x161000[_0x374129(0xa9)][_0x374129(0x1fd)](_0xadec1c,{'fromTask':_0x119a2a,'retryParams':_0xce25a2}),{'verbose':_0x4053c2['verbose']}):_0x488ddd=await withSpinner(_0x374129(0x209),()=>_0x161000['workflow']['retryAttempt'](_0xadec1c,{'resumeFrom':_0x30c81f,'retryParams':_0xce25a2,'force':_0x1ea9ac}),{'verbose':_0x4053c2[_0x374129(0x15f)]});const _0x243daf=_0x488ddd[_0x374129(0xa2)];return console[_0x374129(0xe6)](_0x374129(0x162)),console['error'](_0x374129(0xd4)+_0x243daf[_0x374129(0x1f3)]),console[_0x374129(0xe6)](_0x374129(0x131)+_0x243daf['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a46_0x350b3f(0x20a);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xf3);async[a46_0x350b3f(0x17f)](_0x46a911){const _0x213723=a46_0x350b3f,{options:_0x1db938,args:_0x17eda6,tdx:_0x54749f}=_0x46a911;let _0x5c2d59=_0x17eda6[0x0];if(!_0x5c2d59){const _0xf6fbf2=this['resolveProject']([],_0x1db938),_0x21c95b=await withSpinner(_0x213723(0x160),()=>_0x54749f[_0x213723(0xa9)]['workflows'](_0xf6fbf2,{'limit':_0x1db938[_0x213723(0x188)]}),{'verbose':_0x1db938[_0x213723(0x15f)]}),_0x383ccf=_0x21c95b['data'];if(_0x383ccf[_0x213723(0xbe)]===0x0)return console[_0x213723(0xe6)](_0x213723(0x115)),!_0xf6fbf2&&console[_0x213723(0xe6)](a46_0x41c3a5['dim'](_0x213723(0xf5))),0x1;const _0x593293=_0x383ccf[_0x213723(0x123)](_0x1942a9=>({'title':_0x1942a9[_0x213723(0x229)]?.[_0x213723(0xea)]+'.'+_0x1942a9[_0x213723(0xea)],'value':_0x1942a9[_0x213723(0x229)]?.[_0x213723(0xea)]+'.'+_0x1942a9['name'],'description':_0x1942a9[_0x213723(0x1c4)]?_0x213723(0x11b)+_0x1942a9[_0x213723(0x1c4)]:undefined})),_0x475349=await a46_0x443862({'type':'select','name':_0x213723(0xa9),'message':_0x213723(0xdd),'choices':_0x593293});if(!_0x475349[_0x213723(0xa9)])return 0x1;_0x5c2d59=_0x475349[_0x213723(0xa9)];}if(!_0x5c2d59[_0x213723(0x17b)]('.')){const _0x9af016=this[_0x213723(0x20c)]([],_0x1db938);if(_0x9af016)_0x5c2d59=_0x9af016+'.'+_0x5c2d59;else return console['error'](a46_0x41c3a5['red'](_0x213723(0xe5)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x213723(0xe6)](a46_0x41c3a5[_0x213723(0x1c2)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x1c8a25=_0x1db938['param'],_0x5eda08=_0x1db938[_0x213723(0x1b7)],_0x228a56={};if(_0x1c8a25&&Array['isArray'](_0x1c8a25))for(const _0x1597a7 of _0x1c8a25){const _0x4879ad=_0x1597a7[_0x213723(0x111)]('=');if(_0x4879ad===-0x1)return console[_0x213723(0xe6)](_0x213723(0xde)+_0x1597a7),console['error'](_0x213723(0xbd)),0x1;const _0x26f995=_0x1597a7['substring'](0x0,_0x4879ad),_0x756301=_0x1597a7[_0x213723(0x90)](_0x4879ad+0x1);try{_0x228a56[_0x26f995]=JSON[_0x213723(0x14b)](_0x756301);}catch{_0x228a56[_0x26f995]=_0x756301;}}_0x1db938[_0x213723(0x15f)]&&(console[_0x213723(0xe6)]('Workflow:\x20'+_0x5c2d59),Object['keys'](_0x228a56)[_0x213723(0xbe)]>0x0&&console[_0x213723(0xe6)](_0x213723(0x13b)+JSON['stringify'](_0x228a56)),_0x5eda08&&console['error']('Session\x20time:\x20'+_0x5eda08));const _0x20a88e=await withSpinner(_0x213723(0x150),()=>_0x54749f['workflow']['run'](_0x5c2d59,_0x228a56,{'sessionTime':_0x5eda08}),{'verbose':_0x1db938[_0x213723(0x15f)]}),_0x58019d=_0x20a88e[_0x213723(0xa2)];console[_0x213723(0xe6)](_0x213723(0xc9)),console[_0x213723(0xe6)](_0x213723(0xca)+_0x58019d['id']),console[_0x213723(0xe6)](_0x213723(0x131)+_0x58019d[_0x213723(0x12b)]),console[_0x213723(0xe6)]('\x20\x20Project:\x20'+_0x58019d['project']?.[_0x213723(0xea)]),console[_0x213723(0xe6)]('\x20\x20Workflow:\x20'+_0x58019d[_0x213723(0xa9)]?.['name']);if(_0x58019d[_0x213723(0x229)]?.['id']&&_0x58019d[_0x213723(0x12b)]&&_0x58019d['id']){const _0x484a2b=_0x1db938[_0x213723(0xd5)],_0x2de6e3=getConsoleUrl(_0x484a2b,_0x213723(0xb0)+_0x58019d[_0x213723(0x229)]['id']+'/sessions/'+_0x58019d['sessionId']+'/attempt/'+_0x58019d['id']);console[_0x213723(0xe6)](_0x213723(0x1ce)+a46_0x41c3a5[_0x213723(0x1a0)](_0x2de6e3));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1a9);[a46_0x350b3f(0x125)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a46_0x350b3f(0x17f)](_0x499bbe){const _0x47237f=a46_0x350b3f,{options:_0x4a45a3,args:_0x39dec1,tdx:_0x15aad6}=_0x499bbe,_0x354bf2=_0x39dec1[0x0],_0x5afdd0=_0x39dec1[0x1]||'.';if(!_0x354bf2)return console[_0x47237f(0xe6)](_0x47237f(0x236)),console[_0x47237f(0xe6)](_0x47237f(0x166)),0x1;const _0x2f063e=_0x4a45a3[_0x47237f(0x1c4)];_0x4a45a3[_0x47237f(0x15f)]&&(console[_0x47237f(0xe6)](_0x47237f(0x208)+_0x354bf2),console['error'](_0x47237f(0x182)+_0x5afdd0),_0x2f063e&&console['error']('Revision:\x20'+_0x2f063e));const _0x394c1e=await withSpinner(_0x47237f(0x185)+_0x354bf2+_0x47237f(0x1f1),()=>_0x15aad6[_0x47237f(0xa9)]['download'](_0x354bf2,_0x5afdd0,{'revision':_0x2f063e}),{'verbose':_0x4a45a3[_0x47237f(0x15f)]}),_0x10059e=_0x394c1e[_0x47237f(0xa2)];return console[_0x47237f(0xe6)](_0x47237f(0x1bb)+_0x10059e['projectName']),console[_0x47237f(0xe6)](_0x47237f(0x1af)+_0x10059e[_0x47237f(0x1c4)]),console[_0x47237f(0xe6)]('\x20\x20Files\x20extracted:\x20'+_0x10059e['filesExtracted']),console[_0x47237f(0xe6)](_0x47237f(0x106)+_0x5afdd0+'/'+_0x10059e[_0x47237f(0x1dc)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a46_0x350b3f(0x1bf);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xf4);async[a46_0x350b3f(0x17f)](_0x151b4d){const _0x3ad330=a46_0x350b3f,{options:_0xa0cdd9,args:_0x10ff1c,tdx:_0x211d72}=_0x151b4d;let _0x38533e='.',_0x164e23=_0xa0cdd9['name'];if(_0x10ff1c[0x0]){const {promises:_0x2fc68d}=await import('fs');try{const _0x20310b=await _0x2fc68d[_0x3ad330(0xad)](_0x10ff1c[0x0]);if(_0x20310b[_0x3ad330(0x91)]())_0x38533e=_0x10ff1c[0x0];else return console[_0x3ad330(0xe6)]('Error:\x20'+_0x10ff1c[0x0]+_0x3ad330(0x1e1)),0x1;}catch{_0x164e23=_0x10ff1c[0x0],_0x38533e='.';}}const _0x11aa99=_0xa0cdd9[_0x3ad330(0x1c4)],_0x339c68=_0xa0cdd9[_0x3ad330(0x22e)];_0xa0cdd9[_0x3ad330(0x15f)]&&(console[_0x3ad330(0xe6)]('Project\x20directory:\x20'+_0x38533e),_0x164e23&&console[_0x3ad330(0xe6)](_0x3ad330(0xa0)+_0x164e23),_0x11aa99&&console['error']('Revision:\x20'+_0x11aa99),_0x339c68&&console[_0x3ad330(0xe6)]('Validation:\x20skipped'));const _0x5affaf=await withSpinner(_0x3ad330(0x11f),()=>_0x211d72[_0x3ad330(0xa9)]['push'](_0x38533e,{'projectName':_0x164e23,'revision':_0x11aa99,'skipValidation':_0x339c68}),{'verbose':_0xa0cdd9[_0x3ad330(0x15f)]}),_0xe94802=_0x5affaf[_0x3ad330(0xa2)];return console[_0x3ad330(0xe6)]('✔\x20Pushed\x20'+_0xe94802[_0x3ad330(0x1dc)]),console[_0x3ad330(0xe6)](_0x3ad330(0x1aa)+_0xe94802[_0x3ad330(0x1fb)]),console[_0x3ad330(0xe6)](_0x3ad330(0x1af)+_0xe94802[_0x3ad330(0x1c4)]),await this[_0x3ad330(0x1a7)](_0x211d72,_0xe94802['projectName'],_0xa0cdd9[_0x3ad330(0xd5)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x104);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xf2);async[a46_0x350b3f(0x17f)](_0x2c9398){const _0x2dc910=a46_0x350b3f,{options:_0x34a44e,args:_0x39f987,tdx:_0x3f4a1f}=_0x2c9398,_0x488c11=_0x39f987[0x0],_0x137753=_0x39f987[0x1];if(!_0x488c11)return console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0xb4)](_0x2dc910(0xe5)),_0x2dc910(0x120)),console[_0x2dc910(0xe6)](a46_0x41c3a5['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x593abf=_0x34a44e[_0x2dc910(0x1c4)];_0x34a44e[_0x2dc910(0x15f)]&&(console['error'](_0x2dc910(0x208)+_0x488c11),_0x137753&&console['error'](_0x2dc910(0x1e4)+_0x137753),_0x593abf&&console[_0x2dc910(0xe6)]('Revision:\x20'+_0x593abf),_0x34a44e[_0x2dc910(0x12a)]&&console[_0x2dc910(0xe6)](_0x2dc910(0x1a2)));const _0x52dec7=await withSpinner(_0x2dc910(0x19e)+_0x488c11+'...',()=>_0x3f4a1f[_0x2dc910(0xa9)][_0x2dc910(0xdb)](_0x488c11,{'targetDir':_0x137753,'revision':_0x593abf}),{'verbose':_0x34a44e[_0x2dc910(0x15f)]}),_0x13627b=_0x52dec7[_0x2dc910(0xa2)];_0x13627b[_0x2dc910(0x210)]?console[_0x2dc910(0xe6)](_0x2dc910(0x16b)+_0x13627b[_0x2dc910(0x1dc)]):console[_0x2dc910(0xe6)](_0x2dc910(0xd9)+_0x13627b['projectName']);console['error']('\x20\x20Revision:\x20'+_0x13627b[_0x2dc910(0x1c4)]),console[_0x2dc910(0xe6)](_0x2dc910(0x19c)+(a46_0x418c9f[_0x2dc910(0xcc)](process['cwd'](),_0x13627b[_0x2dc910(0x11c)])||'.')),console[_0x2dc910(0xe6)]('\x20\x20Changes:\x20'+a46_0x41c3a5[_0x2dc910(0x103)]('+'+_0x13627b[_0x2dc910(0x221)][_0x2dc910(0x11a)]+'\x20new')+',\x20'+(a46_0x41c3a5['yellow']('~'+_0x13627b[_0x2dc910(0x221)][_0x2dc910(0x1be)]+_0x2dc910(0x177))+',\x20')+(a46_0x41c3a5[_0x2dc910(0xb4)]('-'+_0x13627b[_0x2dc910(0x221)][_0x2dc910(0xab)]+_0x2dc910(0xeb))+',\x20')+(''+a46_0x41c3a5[_0x2dc910(0x1c2)](_0x13627b[_0x2dc910(0x221)][_0x2dc910(0x1f5)]+'\x20unchanged')));for(const _0x5e1fa0 of _0x13627b['changes']){_0x5e1fa0[_0x2dc910(0x176)]==='modified'&&_0x5e1fa0['diff']&&(console[_0x2dc910(0xe6)]('\x0a'+a46_0x41c3a5[_0x2dc910(0x1a0)](_0x2dc910(0x147)+_0x5e1fa0[_0x2dc910(0xf1)])),console[_0x2dc910(0xe6)](_0x5e1fa0[_0x2dc910(0xf6)]));}if(!_0x13627b[_0x2dc910(0x9e)])return saveSessionContext({'workflow_project':_0x13627b[_0x2dc910(0x1dc)]},_0x34a44e[_0x2dc910(0x21d)]),console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0x103)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a46_0x41c3a5[_0x2dc910(0x1c2)](_0x2dc910(0xc2)+_0x13627b['projectName'])),0x0;if(_0x34a44e[_0x2dc910(0x12a)])return console[_0x2dc910(0xe6)](a46_0x41c3a5['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x34a44e[_0x2dc910(0x1bd)]){if(!isInteractive())return console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0xb4)](_0x2dc910(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a46_0x41c3a5[_0x2dc910(0x1c2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1b662f=await confirmKey(_0x2dc910(0xfe));if(!_0x1b662f)return console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0x222)](_0x2dc910(0x1ed)),_0x2dc910(0xc7)),0x1;}await withSpinner(_0x2dc910(0xc4),()=>_0x3f4a1f[_0x2dc910(0xa9)][_0x2dc910(0x97)](_0x13627b,{'revision':_0x593abf}),{'verbose':_0x34a44e['verbose']}),saveSessionContext({'workflow_project':_0x13627b[_0x2dc910(0x1dc)]},_0x34a44e['session']),console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0x103)](_0x2dc910(0xb1)));const _0x1d86ae=a46_0x418c9f[_0x2dc910(0xcc)](process[_0x2dc910(0x11d)](),_0x13627b[_0x2dc910(0x11c)])||'.';return console[_0x2dc910(0xe6)](a46_0x41c3a5['dim'](_0x2dc910(0x106)+_0x1d86ae)),console[_0x2dc910(0xe6)](a46_0x41c3a5['dim'](_0x2dc910(0xc2)+_0x13627b['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0xb2);['description']=a46_0x350b3f(0x1e0);async[a46_0x350b3f(0x17f)](_0x4c6c0d){const _0x59e048=a46_0x350b3f,{options:_0x414d95,args:_0xdc0471,tdx:_0x2e31cb}=_0x4c6c0d,_0x37fa5a=this[_0x59e048(0x10a)](_0xdc0471,_0x414d95),_0x354d15=_0x414d95[_0x59e048(0x1c4)],_0x7f4f3f=_0x414d95[_0x59e048(0x22e)];_0x414d95['verbose']&&(_0x37fa5a&&console[_0x59e048(0xe6)](_0x59e048(0x1e3)+_0x37fa5a),_0x354d15&&console['error'](_0x59e048(0x1c6)+_0x354d15),_0x414d95['dryRun']&&console[_0x59e048(0xe6)]('Dry\x20run:\x20yes'),_0x7f4f3f&&console[_0x59e048(0xe6)](_0x59e048(0xef)));let _0x517c22;try{_0x517c22=await withSpinner(_0x59e048(0x184),()=>_0x2e31cb['workflow'][_0x59e048(0x22c)]({'sourceDir':_0x37fa5a,'revision':_0x354d15,'skipValidation':_0x7f4f3f}),{'verbose':_0x414d95[_0x59e048(0x15f)]});}catch(_0x3c1a2c){if(_0x3c1a2c instanceof Error&&_0x3c1a2c['message'][_0x59e048(0x17b)](_0x59e048(0x204)))return console[_0x59e048(0xe6)](a46_0x41c3a5['red'](_0x59e048(0xe5)),_0x59e048(0x16c)),_0x414d95[_0x59e048(0x151)]?console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0x1c2)](_0x59e048(0xbf)+_0x414d95[_0x59e048(0x151)]+_0x59e048(0x1f9)+_0x414d95[_0x59e048(0x151)]+'\x27')):console['error'](a46_0x41c3a5[_0x59e048(0x1c2)](_0x59e048(0x197))),0x1;throw _0x3c1a2c;}const _0x30255b=_0x517c22[_0x59e048(0xa2)];console['error'](_0x59e048(0x154)+_0x30255b['projectName']),console[_0x59e048(0xe6)](_0x59e048(0x18d)+_0x30255b['sourceDir']),console[_0x59e048(0xe6)](_0x59e048(0x1af)+_0x30255b['revision']),console[_0x59e048(0xe6)]('\x20\x20Changes:\x20'+a46_0x41c3a5[_0x59e048(0x103)]('+'+_0x30255b[_0x59e048(0x221)]['new']+_0x59e048(0x19d))+',\x20'+(a46_0x41c3a5[_0x59e048(0x222)]('~'+_0x30255b[_0x59e048(0x221)][_0x59e048(0x1be)]+'\x20modified')+',\x20')+(a46_0x41c3a5[_0x59e048(0xb4)]('-'+_0x30255b['summary']['deleted']+_0x59e048(0xeb))+',\x20')+(''+a46_0x41c3a5[_0x59e048(0x1c2)](_0x30255b[_0x59e048(0x221)][_0x59e048(0x1f5)]+_0x59e048(0xe9))));for(const _0x523862 of _0x30255b[_0x59e048(0x18f)]){_0x523862[_0x59e048(0x176)]===_0x59e048(0x1be)&&_0x523862[_0x59e048(0xf6)]&&(console[_0x59e048(0xe6)]('\x0a'+a46_0x41c3a5['cyan'](_0x59e048(0x147)+_0x523862['path'])),console[_0x59e048(0xe6)](_0x523862[_0x59e048(0xf6)]));}if(!_0x30255b[_0x59e048(0x9e)])return console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0x103)](_0x59e048(0x134))),await this[_0x59e048(0x1a7)](_0x2e31cb,_0x30255b['projectName'],_0x414d95['site']),0x0;if(_0x414d95[_0x59e048(0x12a)])return console['error'](a46_0x41c3a5['yellow'](_0x59e048(0x200))),0x0;if(!_0x414d95[_0x59e048(0x1bd)]){if(!isInteractive())return console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0xb4)](_0x59e048(0x140)),_0x59e048(0x1f0)),console['error'](a46_0x41c3a5[_0x59e048(0x1c2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x564c23=await confirmKey(_0x59e048(0x132));if(!_0x564c23)return console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0x222)](_0x59e048(0x1ed)),_0x59e048(0x1db)),0x1;}const _0x3b8329=await withSpinner('Pushing\x20project...',()=>_0x2e31cb[_0x59e048(0xa9)]['executePushProject'](_0x30255b),{'verbose':_0x414d95['verbose']}),_0x5a775c=_0x3b8329['data'];return console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0x103)](_0x59e048(0x234))),console[_0x59e048(0xe6)](_0x59e048(0x1aa)+_0x5a775c[_0x59e048(0x1fb)]),console[_0x59e048(0xe6)](_0x59e048(0x1af)+_0x5a775c[_0x59e048(0x1c4)]),await this[_0x59e048(0x1a7)](_0x2e31cb,_0x5a775c[_0x59e048(0x1dc)],_0x414d95[_0x59e048(0xd5)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]='workflow:clone';[a46_0x350b3f(0x125)]=a46_0x350b3f(0x1e6);async[a46_0x350b3f(0x17f)](_0x3d95e5){const _0x1c7e7a=a46_0x350b3f,{options:_0x2ae6f5,args:_0x350734,tdx:_0x3e970e}=_0x3d95e5,_0x1c33e8=this[_0x1c7e7a(0x10a)](_0x350734,_0x2ae6f5),_0x1a3e87=_0x2ae6f5[_0x1c7e7a(0xea)],_0x538da9=_0x2ae6f5[_0x1c7e7a(0x1c4)],_0x24615c=_0x2ae6f5[_0x1c7e7a(0x22e)];if(!_0x1c33e8)return console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0xb4)]('Error:'),_0x1c7e7a(0xb7)),console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x1c2)](_0x1c7e7a(0x20f))),console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x1c2)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x1a3e87)return console['error'](a46_0x41c3a5[_0x1c7e7a(0xb4)](_0x1c7e7a(0xe5)),_0x1c7e7a(0x114)),console['error'](a46_0x41c3a5[_0x1c7e7a(0x1c2)](_0x1c7e7a(0x20f))),0x1;_0x2ae6f5['verbose']&&(console[_0x1c7e7a(0xe6)]('Source\x20directory:\x20'+_0x1c33e8),console['error'](_0x1c7e7a(0x21f)+_0x1a3e87),_0x538da9&&console['error'](_0x1c7e7a(0x1c6)+_0x538da9),_0x2ae6f5[_0x1c7e7a(0x12a)]&&console['error'](_0x1c7e7a(0x1a2)),_0x24615c&&console[_0x1c7e7a(0xe6)](_0x1c7e7a(0xef)));const _0x694e82=await withSpinner(_0x1c7e7a(0xa6),()=>_0x3e970e['workflow'][_0x1c7e7a(0x94)](_0x1c33e8,_0x1a3e87,{'revision':_0x538da9,'skipValidation':_0x24615c}),{'verbose':_0x2ae6f5[_0x1c7e7a(0x15f)]}),_0x4da8cf=_0x694e82[_0x1c7e7a(0xa2)];console[_0x1c7e7a(0xe6)]('Source:\x20'+_0x4da8cf[_0x1c7e7a(0x9d)]);_0x4da8cf['sourceProjectName']&&console[_0x1c7e7a(0xe6)](_0x1c7e7a(0xfc)+_0x4da8cf[_0x1c7e7a(0xa3)]);console[_0x1c7e7a(0xe6)](_0x1c7e7a(0x21f)+_0x4da8cf[_0x1c7e7a(0x1b8)]),console['error']('Revision:\x20'+_0x4da8cf['revision']),console[_0x1c7e7a(0xe6)](_0x1c7e7a(0x18a)+_0x4da8cf['fileCount']);_0x4da8cf[_0x1c7e7a(0xc8)]&&(console[_0x1c7e7a(0xe6)](a46_0x41c3a5['yellow'](_0x1c7e7a(0xc1)+_0x4da8cf[_0x1c7e7a(0x1b8)]+_0x1c7e7a(0x98)+_0x4da8cf['existingProjectId']+')')),console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x222)](_0x1c7e7a(0x105))));if(_0x2ae6f5[_0x1c7e7a(0x12a)])return console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x222)](_0x1c7e7a(0x161))),0x0;if(!_0x2ae6f5[_0x1c7e7a(0x1bd)]){if(!isInteractive())return console['error'](a46_0x41c3a5[_0x1c7e7a(0xb4)](_0x1c7e7a(0x140)),_0x1c7e7a(0x1f0)),console['error'](a46_0x41c3a5[_0x1c7e7a(0x1c2)](_0x1c7e7a(0x220))),0x1;const _0x3fb250=_0x4da8cf[_0x1c7e7a(0xa3)]||a46_0x418c9f[_0x1c7e7a(0x1a5)](_0x1c33e8),_0x2cf288=_0x4da8cf['targetExists']?_0x1c7e7a(0x148)+_0x1a3e87+'\x22\x20with\x20new\x20revision?':_0x1c7e7a(0x20e)+_0x3fb250+_0x1c7e7a(0xbc)+_0x1a3e87+'\x22?',_0x1e3c31=await confirmKey(_0x2cf288);if(!_0x1e3c31)return console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x222)]('Cancelled')),0x1;}const _0x17b286=await withSpinner(_0x4da8cf[_0x1c7e7a(0xc8)]?_0x1c7e7a(0x169)+_0x1a3e87+_0x1c7e7a(0x1f1):_0x1c7e7a(0xf8)+_0x1a3e87+_0x1c7e7a(0x1f1),()=>_0x3e970e[_0x1c7e7a(0xa9)]['executeCloneProject'](_0x4da8cf),{'verbose':_0x2ae6f5[_0x1c7e7a(0x15f)]}),_0x43a99b=_0x17b286[_0x1c7e7a(0xa2)];return console[_0x1c7e7a(0xe6)](a46_0x41c3a5['green'](_0x4da8cf[_0x1c7e7a(0xc8)]?_0x1c7e7a(0x1da):_0x1c7e7a(0x118))),console[_0x1c7e7a(0xe6)](_0x1c7e7a(0x217)+_0x43a99b[_0x1c7e7a(0x1b8)]),console[_0x1c7e7a(0xe6)]('\x20\x20Project\x20ID:\x20'+_0x43a99b[_0x1c7e7a(0x1df)]),console['error'](_0x1c7e7a(0x1af)+_0x43a99b[_0x1c7e7a(0x1c4)]),await this[_0x1c7e7a(0x1a7)](_0x3e970e,_0x43a99b[_0x1c7e7a(0x1b8)],_0x2ae6f5['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a46_0x350b3f(0x1f7);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xdf);async['execute'](_0x3f33cd){const _0x51db34=a46_0x350b3f,{options:_0x2dd941,args:_0x3bd392,tdx:_0x14ed28}=_0x3f33cd,_0xc97be6=_0x3bd392[0x0];if(!_0xc97be6)return console['error'](_0x51db34(0x1ae)),console['error'](_0x51db34(0x1b5)),0x1;_0x2dd941[_0x51db34(0x15f)]&&console[_0x51db34(0xe6)](_0x51db34(0x208)+_0xc97be6);if(!_0x2dd941['yes']){if(!isInteractive())return console[_0x51db34(0xe6)](a46_0x41c3a5[_0x51db34(0xb4)](_0x51db34(0x140)),_0x51db34(0x1f0)),console[_0x51db34(0xe6)](a46_0x41c3a5[_0x51db34(0x1c2)](_0x51db34(0x220))),0x1;const _0x56015a=await confirmKey(_0x51db34(0x1dd)+_0xc97be6+_0x51db34(0x1d4));if(!_0x56015a)return console[_0x51db34(0xe6)](a46_0x41c3a5[_0x51db34(0x222)](_0x51db34(0x1ed))),0x1;}const _0x2a113f=await withSpinner('Deleting\x20project\x20'+_0xc97be6+_0x51db34(0x1f1),()=>_0x14ed28[_0x51db34(0xa9)][_0x51db34(0x9b)](_0xc97be6),{'verbose':_0x2dd941[_0x51db34(0x15f)]}),_0x15295c=_0x2a113f[_0x51db34(0xa2)];return console[_0x51db34(0xe6)]('✔\x20Deleted\x20project\x20'+_0x15295c[_0x51db34(0x1dc)]),console[_0x51db34(0xe6)](_0x51db34(0x1aa)+_0x15295c[_0x51db34(0x1fb)]),0x0;}}export function parseKeyValue(_0x44094c){const _0x236fed=a46_0x350b3f,_0x361feb=_0x44094c[_0x236fed(0x111)]('=');if(_0x361feb===-0x1)throw new Error(_0x236fed(0xba)+_0x44094c+_0x236fed(0xe3));const _0x3362f2=_0x44094c[_0x236fed(0x90)](0x0,_0x361feb),_0x291c3e=_0x44094c['substring'](_0x361feb+0x1);if(!_0x3362f2)throw new Error(_0x236fed(0x159));return{'key':_0x3362f2,'value':_0x291c3e};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1ea);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x170);async['execute'](_0x25517e){const _0x7b1938=a46_0x350b3f,{options:_0xa14e79,args:_0x5f33c1,tdx:_0x371cc6}=_0x25517e,_0x45ca6f=this[_0x7b1938(0x17c)](_0x5f33c1,_0xa14e79);if(!_0x45ca6f)return 0x1;_0xa14e79[_0x7b1938(0x15f)]&&console[_0x7b1938(0xe6)](_0x7b1938(0x208)+_0x45ca6f);const _0x4afeed=await withSpinner('Listing\x20secrets...',()=>_0x371cc6[_0x7b1938(0xa9)][_0x7b1938(0xa8)](_0x45ca6f),{'verbose':_0xa14e79[_0x7b1938(0x15f)]}),{secrets:_0x29298c}=_0x4afeed[_0x7b1938(0xa2)];return console[_0x7b1938(0xe6)]('✔\x20Found\x20'+_0x29298c[_0x7b1938(0xbe)]+_0x7b1938(0x230)+(_0x29298c[_0x7b1938(0xbe)]!==0x1?'s':'')),await handleSDKOutput(_0x29298c,_0xa14e79),0x0;}}function a46_0x5827(){const _0x370af4=['end','createdAt','session_id','Source\x20project:\x20','\x0a✔\x20Attempt\x20complete','\x0aApply\x20these\x20changes?','getFullYear','\x20task','navigateSessionsInteractive','No\x20sessions\x20found\x20for:\x20','green','workflow:pull','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20Location:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','running','slice','resolveProjectDir','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x1b[1A\x1b[2K','pending','126AFVYbq','getTime','workflow:secrets:set','indexOf','\x20-\x20','workflow:retry','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20workflows\x20found','fileSize','message','✔\x20Clone\x20complete','\x0aFailed\x20to\x20fetch\x20attempt\x20data','new','revision:\x20','targetDir','cwd','tasks','Pushing\x20workflow\x20project...','Project\x20name\x20is\x20required','output','✔\x20Found\x20','map','Filter:\x20','description','fullName','No\x20attempts\x20found\x20for:\x20','jsonl','MAX_TIMELINE_WIDTH','dryRun','sessionId','find','params','No\x20log\x20content\x20found','\x20to\x20see\x20detailed\x20logs','resumeFrom','\x20\x20Session\x20ID:\x20','\x0aPush\x20these\x20changes?','workflow:logs','\x0a✔\x20No\x20changes\x20to\x20push','buildTimelineData','icon','getDate','\x20(system)','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','done','Parameters:\x20','Status:\x20','setSecret','\x20of\x20','replace','\x0aError:','columns','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Attempt:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','ICON_SPACING','---\x20','\x0aUpdate\x20existing\x20project\x20\x22','716484osBHwG','MAX_LABEL_COUNT','parse','set','sort','956EWbvhP','some','Starting\x20workflow\x20run...','workflowProject','Task\x20name:\x20','generateSessionTimelineRows','✔\x20Project:\x20','List\x20workflows','\x27...','✔\x20Showing\x20','Getting\x20attempt\x20tasks...','Key\x20cannot\x20be\x20empty','repeat','📁\x20','Including\x20subtasks:\x20yes','log','(unknown)','verbose','Loading\x20workflows...','\x0aDry\x20run\x20-\x20no\x20project\x20created','✔\x20Retry\x20started','\x20workflow','Session\x20','\x20has\x20no\x20attempts','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Listing\x20workflow\x20projects...','ICON_WIDTH','Updating\x20','Pattern:\x20','→\x20New\x20project:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x20from\x20session\x20','108KCWCol','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','floor','workflow:use','\x27\x20from\x20project\x20\x27','Kill\x20a\x20running\x20attempt','renderTimeline','type','\x20modified','175872oyUCHU','match','\x20tasks','includes','requireProject','✔\x20Secret\x20\x27','push','execute','finishedAt','padStart','Output\x20directory:\x20','Attempt\x20ID:\x20','Analyzing\x20changes...','Downloading\x20project\x20','now','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','limit','list','Files\x20to\x20upload:\x20','workflow:tasks','resolveProjectId','\x20\x20Source:\x20','Fetching\x20log\x20files...','changes','every','state','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','format','get','No\x20sessions\x20found','Listing\x20workflow\x20sessions...','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','cancelRequested','parseProjectWorkflowPattern','size','duration','\x20\x20Target:\x20','\x20new','Pulling\x20project\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','cyan','success','Dry\x20run:\x20yes','startedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','basename','write','showWorkflowConsoleUrl','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:download','\x20\x20Project\x20ID:\x20','splice','Auto-selected\x20latest\x20session:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Revision:\x20','workflow:timeline','toLowerCase','No\x20workflow\x20projects\x20found','MAX_TASKS_DISPLAY','startTime','Usage:\x20workflow:delete\x20<project-name-or-id>','utf-8','sessionTime','newProjectName','attempts','Usage:\x20tdx\x20wf\x20use\x20<project>','✔\x20Downloaded\x20','trimEnd','yes','modified','workflow:upload','tdx.json','workflow:kill','dim','fill','revision','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Revision:\x20','getMonth','Show\x20specific\x20attempt\x20details','canceling','includeSubtasks','fs/promises','Loading\x20session...','Target:\x20','\x20\x20Console:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','retryAttemptName','Filter:\x20project=','table','Select\x20a\x20task\x20to\x20view\x20logs:','\x22?\x20This\x20cannot\x20be\x20undone.','window','Retrying\x20session...','Show\x20tasks\x20for\x20an\x20attempt','No\x20sessions\x20with\x20timing\x20information','white','✔\x20Project\x20updated','-\x20nothing\x20pushed','projectName','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','newProjectId','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x20is\x20not\x20a\x20directory','readFile','Source\x20directory:\x20','Target\x20directory:\x20','Listing\x20workflows...','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','No\x20matching\x20sessions\x20found','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','workflow:secrets:list','Deleting\x20secret...','List\x20all\x20workflow\x20projects','Cancelled','autocomplete','key','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','...','attempt','attemptId','getHours','unchanged','isTTY','workflow:delete','1548342FzgFEC','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','workflow:sessions','projectId','✔\x20Workflow\x20project\x20context\x20cleared.','retrySession','values','context','\x0aDry\x20run\x20-\x20nothing\x20pushed','Session\x20not\x20found:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Error:\x20Secret\x20key\x20is\x20required','No\x20workflow\x20tdx.json\x20found','logFiles','Resolving\x20project\x20\x27','💡\x20Tip:\x20Use\x20','Project:\x20','Retrying\x20attempt...','workflow:run','taskName','resolveProject','attempt:','\x0aClone\x20\x22','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','isNewProject','blue','keys','\x20\x20tdx\x20wf\x20use\x20<project>','min','Latest\x20session\x20has\x20no\x20attempt','value','\x20\x20Project:\x20','startsWith','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Retry\x20a\x20session\x20or\x20attempt','updatedAt','localeCompare','session','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','New\x20project\x20name:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','summary','yellow','No\x20workflows\x20found\x20in\x20project:\x20','Loading\x20sessions...','deleteSecret','\x20session','json','tdx\x20wf\x20attempt\x20','project','POLL_INTERVAL_MS','1002070pAqZpY','preparePushProject','planned','skipValidation','displayLine','\x20secret','clear','unknown','filter','✔\x20Push\x20complete','workflows','Error:\x20Project\x20name\x20is\x20required','msPerChar','Key:\x20','139902SETuuw','toISOString','substring','isDirectory','logs','workflow:projects','prepareCloneProject','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','2524TWBLuV','applyPullProject','\x22\x20already\x20exists\x20(ID:\x20','join','force','delete','select','sourceDir','hasChanges','\x20logs','Project\x20name:\x20','Params:\x20','data','sourceProjectName','split','task','Analyzing\x20project...','Warning:','listSecrets','workflow','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','deleted','group_error','stat','sessions','workflow:attempt','/app/workflows/','✔\x20Pull\x20complete','workflow:push','title','red','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','status','Source\x20directory\x20is\x20required','round','Reason:\x20','Invalid\x20format:\x20','follow','\x22\x20to\x20new\x20project\x20\x22','Expected\x20format:\x20--param\x20key=value','length','Tip:\x20cd\x20to\x20workflows/','No\x20sessions\x20found\x20in\x20project:\x20','\x0a⚠\x20Project\x20\x22','\x20\x20Session\x20context\x20set\x20to:\x20','reason','Writing\x20files...','Listing\x20workflow\x20attempts...','Error:\x20Attempt\x20ID\x20is\x20required','-\x20no\x20files\x20written','targetExists','✔\x20Workflow\x20run\x20started','\x20\x20Attempt\x20ID:\x20','projects','relative','index','MIN_TIMELINE_WIDTH','start','No\x20attempts\x20found\x20in\x20project:\x20','\x20sessions\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20attempt','\x20\x20New\x20attempt\x20ID:\x20','site','renderSingleTimeline','lastAttempt','List\x20workflow\x20attempts','→\x20Project:\x20','LABEL_MIN_SPACING','pullProject','workflow:attempts','Select\x20a\x20workflow\x20to\x20run','Error:\x20Invalid\x20parameter\x20format:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','renderSessionsTimeline','stdout','max','.\x20Expected\x20format:\x20KEY=VALUE','workflowName','Error:','error','all','pollTimeline','\x20unchanged','name','\x20deleted','GUTTER','fromTask','(use\x20--limit\x20to\x20see\x20more)','Validation:\x20skipped','from','path','Pull\x20workflow\x20project\x20to\x20local\x20folder','Start\x20a\x20workflow\x20run','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','diff','Downloading\x20logs...','Cloning\x20to\x20'];a46_0x5827=function(){return _0x370af4;};return a46_0x5827();}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x110);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x187);async['execute'](_0x5c2ce4){const _0x4b775a=a46_0x350b3f,{options:_0x1f68d3,args:_0x375dcc,tdx:_0x4def85}=_0x5c2ce4;let _0x28d628,_0x2c12a8;if(_0x375dcc[_0x4b775a(0xbe)]>=0x2)_0x28d628=_0x375dcc[0x0],_0x2c12a8=_0x375dcc[0x1];else{if(_0x375dcc[_0x4b775a(0xbe)]===0x1&&_0x1f68d3[_0x4b775a(0x151)])_0x28d628=_0x1f68d3['workflowProject'],_0x2c12a8=_0x375dcc[0x0];else return _0x375dcc['length']===0x1?(console[_0x4b775a(0xe6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4b775a(0xe6)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x4b775a(0xe6)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x4b775a(0xe6)](_0x4b775a(0x19f)),0x1);}let _0x4de5cd,_0x1c5fa8;try{({key:_0x4de5cd,value:_0x1c5fa8}=parseKeyValue(_0x2c12a8));}catch(_0x340c86){return _0x340c86 instanceof Error&&console[_0x4b775a(0xe6)](a46_0x41c3a5[_0x4b775a(0xb4)](_0x4b775a(0xe5)),_0x340c86[_0x4b775a(0x117)]),0x1;}_0x1f68d3[_0x4b775a(0x15f)]&&(console[_0x4b775a(0xe6)](_0x4b775a(0x208)+_0x28d628),console['error'](_0x4b775a(0x8d)+_0x4de5cd));const _0x5f5653=await withSpinner('Setting\x20secret...',()=>_0x4def85[_0x4b775a(0xa9)][_0x4b775a(0x13d)](_0x28d628,_0x4de5cd,_0x1c5fa8),{'verbose':_0x1f68d3[_0x4b775a(0x15f)]}),_0x1e0231=_0x5f5653[_0x4b775a(0xa2)];return console[_0x4b775a(0xe6)](_0x4b775a(0x17d)+_0x1e0231['key']+_0x4b775a(0x107)+_0x1e0231[_0x4b775a(0x1dc)]+'\x27'),(_0x1f68d3[_0x4b775a(0x227)]||_0x1f68d3[_0x4b775a(0x128)])&&await handleSingleObjectOutput(_0x1e0231,_0x1f68d3),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]='workflow:secrets:delete';['description']=a46_0x350b3f(0x95);async[a46_0x350b3f(0x17f)](_0x485b47){const _0x597ed9=a46_0x350b3f,{options:_0x11d9ce,args:_0x47c711,tdx:_0x4a7b88}=_0x485b47;let _0xba5040,_0x3ba92c;if(_0x47c711[_0x597ed9(0xbe)]>=0x2)_0xba5040=_0x47c711[0x0],_0x3ba92c=_0x47c711[0x1];else{if(_0x47c711[_0x597ed9(0xbe)]===0x1&&_0x11d9ce['workflowProject'])_0xba5040=_0x11d9ce[_0x597ed9(0x151)],_0x3ba92c=_0x47c711[0x0];else return _0x47c711[_0x597ed9(0xbe)]===0x1?(console[_0x597ed9(0xe6)](_0x597ed9(0x236)),console[_0x597ed9(0xe6)](_0x597ed9(0xf5)),0x1):(console[_0x597ed9(0xe6)](_0x597ed9(0x203)),console[_0x597ed9(0xe6)](_0x597ed9(0x202)),0x1);}_0x11d9ce['verbose']&&(console[_0x597ed9(0xe6)](_0x597ed9(0x208)+_0xba5040),console[_0x597ed9(0xe6)]('Key:\x20'+_0x3ba92c));if(!_0x11d9ce[_0x597ed9(0x1bd)]){if(!isInteractive())return console[_0x597ed9(0xe6)](a46_0x41c3a5['red'](_0x597ed9(0x140)),_0x597ed9(0x1f0)),console[_0x597ed9(0xe6)](a46_0x41c3a5[_0x597ed9(0x1c2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3506e6=await confirmKey(_0x597ed9(0x1a4)+_0x3ba92c+_0x597ed9(0x173)+_0xba5040+'\x27?');if(!_0x3506e6)return console[_0x597ed9(0xe6)](a46_0x41c3a5[_0x597ed9(0x222)]('Cancelled')),0x1;}const _0x500162=await withSpinner(_0x597ed9(0x1eb),()=>_0x4a7b88[_0x597ed9(0xa9)][_0x597ed9(0x225)](_0xba5040,_0x3ba92c),{'verbose':_0x11d9ce[_0x597ed9(0x15f)]}),_0x2f2d50=_0x500162[_0x597ed9(0xa2)];return console['error'](_0x597ed9(0x17d)+_0x2f2d50[_0x597ed9(0x1ef)]+_0x597ed9(0x139)+_0x2f2d50[_0x597ed9(0x1dc)]+'\x27'),(_0x11d9ce[_0x597ed9(0x227)]||_0x11d9ce[_0x597ed9(0x128)])&&await handleSingleObjectOutput(_0x2f2d50,_0x11d9ce),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x480696){const _0x19a265=a46_0x350b3f,_0x3a7a4b=Math[_0x19a265(0x171)](_0x480696/0x3e8),_0x859c7d=Math[_0x19a265(0x171)](_0x3a7a4b/0x3c),_0x58cde5=Math['floor'](_0x859c7d/0x3c),_0x225da8=Math[_0x19a265(0x171)](_0x58cde5/0x18);if(_0x225da8>0x0){const _0x234682=_0x58cde5%0x18;return _0x234682>0x0?_0x225da8+'d\x20'+_0x234682+'h':_0x225da8+'d';}else{if(_0x58cde5>0x0){const _0x1520bc=_0x859c7d%0x3c;return _0x1520bc>0x0?_0x58cde5+'h\x20'+_0x1520bc+'m':_0x58cde5+'h';}else{if(_0x859c7d>0x0){const _0x1333c2=_0x3a7a4b%0x3c;return _0x1333c2>0x0?_0x859c7d+'m\x20'+_0x1333c2+'s':_0x859c7d+'m';}else return _0x3a7a4b+'s';}}}function formatTimestamp(_0x4e1161,_0x111783){const _0x4108f6=a46_0x350b3f,_0x4c7afa=new Date(_0x4e1161),_0x51cd11=String(_0x4c7afa[_0x4108f6(0x1f4)]())[_0x4108f6(0x181)](0x2,'0'),_0x153d21=String(_0x4c7afa['getMinutes']())[_0x4108f6(0x181)](0x2,'0'),_0x4fc7ce=_0x51cd11+':'+_0x153d21,_0xa9d2e4=_0x4c7afa[_0x4108f6(0xff)]()===_0x111783[_0x4108f6(0xff)]()&&_0x4c7afa[_0x4108f6(0x1c7)]()===_0x111783['getMonth']()&&_0x4c7afa[_0x4108f6(0x137)]()===_0x111783['getDate']();if(_0xa9d2e4)return _0x4fc7ce;else{const _0x2aad80=String(_0x4c7afa['getMonth']()+0x1)[_0x4108f6(0x181)](0x2,'0'),_0x163982=String(_0x4c7afa['getDate']())[_0x4108f6(0x181)](0x2,'0');return _0x2aad80+'-'+_0x163982+'\x20'+_0x4fc7ce;}}function formatDate(_0x13cc82){const _0x2ca1a=a46_0x350b3f,_0x58d4ec=_0x13cc82[_0x2ca1a(0xff)](),_0x111ff2=String(_0x13cc82[_0x2ca1a(0x1c7)]()+0x1)['padStart'](0x2,'0'),_0x50be66=String(_0x13cc82[_0x2ca1a(0x137)]())[_0x2ca1a(0x181)](0x2,'0');return _0x58d4ec+'-'+_0x111ff2+'-'+_0x50be66;}function getTaskStateIcon(_0x650d00){const _0xf06e8b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0xf06e8b[_0x650d00]||'⚪';}function getBarChar(_0x34593c){const _0x12106c=a46_0x350b3f;return _0x34593c===_0x12106c(0xe6)||_0x34593c===_0x12106c(0xac)?'×':'─';}function getBarColor(_0x5e3d5b){const _0x4c8d36=a46_0x350b3f,_0x12e83f={'success':a46_0x41c3a5['green'],'error':a46_0x41c3a5[_0x4c8d36(0xb4)],'group_error':a46_0x41c3a5[_0x4c8d36(0xb4)],'running':a46_0x41c3a5[_0x4c8d36(0x211)],'blocked':a46_0x41c3a5[_0x4c8d36(0x222)],'planned':a46_0x41c3a5[_0x4c8d36(0x1c2)],'canceling':a46_0x41c3a5[_0x4c8d36(0x222)]};return _0x12e83f[_0x5e3d5b]||a46_0x41c3a5[_0x4c8d36(0x1d9)];}function parseTaskName(_0x1aad21){const _0x4b7dfe=a46_0x350b3f;let _0x1e0c4d=_0x1aad21[_0x4b7dfe(0x13f)](/^\++/,'');const _0x3c3a75=_0x1e0c4d[_0x4b7dfe(0xa4)]('+'),_0x37664e=_0x3c3a75[_0x4b7dfe(0xbe)]>0x1?_0x3c3a75[_0x4b7dfe(0xbe)]-0x2:0x0,_0x4b4319=_0x3c3a75[_0x3c3a75[_0x4b7dfe(0xbe)]-0x1]||_0x1e0c4d;return{'level':_0x37664e,'name':'+'+_0x4b4319};}function truncateTaskName(_0x10e62a,_0x59ad72){const _0xb5a89c=a46_0x350b3f,_0x240fe5=stringWidth(_0x10e62a);if(_0x240fe5<=_0x59ad72)return _0x10e62a;let _0x5d1c97=_0x10e62a;while(stringWidth(_0x5d1c97+'…')>_0x59ad72&&_0x5d1c97[_0xb5a89c(0xbe)]>0x0){_0x5d1c97=_0x5d1c97[_0xb5a89c(0x109)](0x0,-0x1);}return _0x5d1c97+'…';}function calculateTimeScale(_0x5867e0,_0x1d4aff){const _0x225bd7=a46_0x350b3f;return{'startTime':_0x5867e0[_0x225bd7(0xcf)],'endTime':_0x5867e0[_0x225bd7(0xf9)],'durationMs':_0x5867e0[_0x225bd7(0x19b)],'msPerChar':_0x5867e0[_0x225bd7(0x19b)]/_0x1d4aff};}function timeToPosition(_0x44faf6,_0x4de2d3,_0x471d3b){const _0x179028=a46_0x350b3f,_0x415726=_0x44faf6-_0x4de2d3[_0x179028(0x1b4)],_0x5751f1=Math[_0x179028(0x171)](_0x415726/_0x4de2d3[_0x179028(0x8c)]);return Math['max'](0x0,Math[_0x179028(0x214)](_0x5751f1,_0x471d3b));}function renderTimeAxis(_0x55993f,_0x17620e){const _0x289898=a46_0x350b3f,_0x5882cb=Math[_0x289898(0x214)](TIMELINE_CONFIG[_0x289898(0x14a)],Math[_0x289898(0xe2)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x289898(0x171)](_0x17620e/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x11ba4d=_0x55993f['durationMs']/(_0x5882cb-0x1),_0x907a2=new Date(_0x55993f['startTime']),_0x12c55c=[];for(let _0xffd6dc=0x0;_0xffd6dc<_0x5882cb;_0xffd6dc++){const _0x1f1a06=_0x55993f[_0x289898(0x1b4)]+_0xffd6dc*_0x11ba4d,_0x1a8bb2=timeToPosition(_0x1f1a06,_0x55993f,_0x17620e),_0x5e4e1a=formatTimestamp(_0x1f1a06,_0x907a2);_0x12c55c['push']({'pos':_0x1a8bb2,'text':_0x5e4e1a});}const _0x490341=new Array(_0x17620e)[_0x289898(0x1c3)]('\x20');let _0xc4700b=-0x1;for(const {pos:_0x28c50,text:_0x3f99d6}of _0x12c55c){let _0x39fc8a=Math[_0x289898(0xe2)](0x0,_0x28c50-Math[_0x289898(0x171)](_0x3f99d6[_0x289898(0xbe)]/0x2));_0x39fc8a<=_0xc4700b+TIMELINE_CONFIG[_0x289898(0xda)]&&(_0x39fc8a=_0xc4700b+TIMELINE_CONFIG[_0x289898(0xda)]+0x1);_0x39fc8a+_0x3f99d6['length']>_0x17620e&&(_0x39fc8a=_0x17620e-_0x3f99d6[_0x289898(0xbe)]);if(_0x39fc8a>=0x0&&_0x39fc8a+_0x3f99d6[_0x289898(0xbe)]<=_0x17620e&&_0x39fc8a>_0xc4700b){for(let _0x30d9ca=0x0;_0x30d9ca<_0x3f99d6[_0x289898(0xbe)];_0x30d9ca++){_0x490341[_0x39fc8a+_0x30d9ca]=_0x3f99d6[_0x30d9ca];}_0xc4700b=_0x39fc8a+_0x3f99d6['length']-0x1;}}return _0x490341[_0x289898(0x99)]('');}function renderTaskRow(_0x193342,_0x1626a6,_0x25c161,_0x3c8586){const _0x2cacb0=a46_0x350b3f,{level:_0x4b065e,name:_0x917e68}=parseTaskName(_0x193342[_0x2cacb0(0xea)]),_0xb73f2f='\x20'[_0x2cacb0(0x15a)](_0x4b065e),_0x4b5547=_0x193342[_0x2cacb0(0x1d5)]?'('+formatElapsed(_0x193342[_0x2cacb0(0x1d5)][_0x2cacb0(0x19b)])+')':'',_0x3bb081=stringWidth(_0x4b5547),_0x3ba765=_0x4b065e*0x1,_0x2b4b2e=_0x3c8586-_0x3ba765-_0x3bb081-0x1,_0x115b4c=truncateTaskName(_0x917e68,_0x2b4b2e),_0x4af005=_0xb73f2f+_0x115b4c,_0x4e4571=stringWidth(_0x4af005),_0x4af125=_0x3c8586-_0x4e4571-_0x3bb081,_0x375294=_0x4af005+'\x20'[_0x2cacb0(0x15a)](Math[_0x2cacb0(0xe2)](0x1,_0x4af125))+a46_0x41c3a5['dim'](_0x4b5547),_0x540ec2=getTaskStateIcon(_0x193342['state']),_0x282861=new Array(_0x25c161)[_0x2cacb0(0x1c3)]('\x20');if(_0x193342[_0x2cacb0(0x1d5)]){const _0x7dac00=timeToPosition(_0x193342['window']['start'],_0x1626a6,_0x25c161),_0x4d8a2a=timeToPosition(_0x193342[_0x2cacb0(0x1d5)][_0x2cacb0(0xf9)],_0x1626a6,_0x25c161),_0x3e964e=getBarChar(_0x193342[_0x2cacb0(0x191)]),_0x22fe42=Math[_0x2cacb0(0xe2)](_0x7dac00+0x1,_0x4d8a2a);for(let _0x566051=_0x7dac00;_0x566051<Math['min'](_0x22fe42,_0x25c161);_0x566051++){_0x282861[_0x566051]=_0x3e964e;}}const _0x552aff=getBarColor(_0x193342[_0x2cacb0(0x191)]),_0x512a4e=_0x282861[_0x2cacb0(0x123)](_0x413a38=>_0x413a38==='\x20'?'\x20':_0x552aff(_0x413a38))[_0x2cacb0(0x99)]('');return _0x540ec2+'\x20'+_0x375294+'│'+_0x512a4e+'│';}function calculateStats(_0x3f1b33){const _0x23469b=a46_0x350b3f,_0x413bec={'total':_0x3f1b33[_0x23469b(0xbe)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1b2a36 of _0x3f1b33){if(_0x1b2a36[_0x23469b(0x191)]===_0x23469b(0x1a1))_0x413bec[_0x23469b(0x1a1)]++;else{if(_0x1b2a36[_0x23469b(0x191)]===_0x23469b(0xe6)||_0x1b2a36[_0x23469b(0x191)]===_0x23469b(0xac))_0x413bec[_0x23469b(0xe6)]++;else _0x1b2a36[_0x23469b(0x191)]===_0x23469b(0x108)?_0x413bec[_0x23469b(0x108)]++:_0x413bec[_0x23469b(0x10d)]++;}}return _0x413bec;}function formatStats(_0x58876e){const _0x441a6d=a46_0x350b3f;return['Total:\x20'+_0x58876e['total'],'✅\x20'+_0x58876e[_0x441a6d(0x1a1)],'❌\x20'+_0x58876e[_0x441a6d(0xe6)],'🔄\x20'+_0x58876e[_0x441a6d(0x108)],'⏳\x20'+_0x58876e[_0x441a6d(0x10d)]][_0x441a6d(0x99)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1b0);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x145);async[a46_0x350b3f(0x17f)](_0x57718c){const _0x475f63=a46_0x350b3f,{options:_0x2bc946,args:_0x5af896,tdx:_0x2b9949}=_0x57718c;let _0x3ec38a,_0x3321c2,_0x5f467f=![];if(_0x5af896[0x0]){if(_0x5af896[0x0][_0x475f63(0x17b)]('.')){const _0x3b9a1e=this[_0x475f63(0x199)](_0x5af896,_0x2bc946);if(!_0x3b9a1e)return 0x1;_0x3ec38a=_0x3b9a1e[_0x475f63(0x1dc)],_0x3321c2=_0x3b9a1e['workflowName'];}else{_0x3321c2=_0x5af896[0x0],_0x3ec38a=_0x2bc946[_0x475f63(0x151)];if(!_0x3ec38a)return console[_0x475f63(0xe6)](a46_0x41c3a5[_0x475f63(0xb4)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x5f467f=!![];}}else{const _0x1e2db1=this[_0x475f63(0x199)](_0x5af896,_0x2bc946);if(!_0x1e2db1)return 0x1;_0x3ec38a=_0x1e2db1[_0x475f63(0x1dc)],_0x3321c2=_0x1e2db1[_0x475f63(0xe4)];}if(_0x2bc946['verbose']){if(_0x3ec38a&&_0x3321c2)console['error'](_0x475f63(0x124)+_0x3ec38a+'.'+_0x3321c2);else _0x3ec38a&&console['error'](_0x475f63(0x1d1)+_0x3ec38a);}const _0x51d06b=_0x2bc946[_0x475f63(0x1f3)],_0x585c66=_0x2bc946[_0x475f63(0x12b)];if(_0x51d06b){_0x585c66&&console['error'](a46_0x41c3a5[_0x475f63(0x222)](_0x475f63(0xa7)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x2fd286=_0x2bc946['follow'];return _0x2fd286?await this[_0x475f63(0xe8)](_0x57718c,_0x51d06b):await this[_0x475f63(0xd6)](_0x57718c,_0x51d06b,_0x2bc946),0x0;}if(_0x585c66){const _0x1d4ab4=await withSpinner(_0x475f63(0x1cc),()=>_0x2b9949[_0x475f63(0xa9)][_0x475f63(0xae)]({'projectName':_0x3ec38a,'workflowName':_0x3321c2,'limit':0x64}),{'verbose':_0x2bc946[_0x475f63(0x15f)]}),_0x5af832=_0x1d4ab4[_0x475f63(0xa2)][_0x475f63(0x12c)](_0x27f54a=>_0x27f54a['id']===_0x585c66);if(!_0x5af832)return console[_0x475f63(0xe6)](a46_0x41c3a5[_0x475f63(0xb4)](_0x475f63(0xe5)),_0x475f63(0x201)+_0x585c66),0x1;if(!_0x5af832[_0x475f63(0xd7)]?.['id'])return console[_0x475f63(0xe6)](a46_0x41c3a5[_0x475f63(0xb4)]('Error:'),_0x475f63(0x164)+_0x585c66+_0x475f63(0x165)),0x1;const _0x178b51=_0x5af832[_0x475f63(0xd7)]['id'];_0x2bc946[_0x475f63(0x15f)]&&console[_0x475f63(0xe6)]('Using\x20attempt\x20'+_0x178b51+_0x475f63(0x16d)+_0x585c66);const _0x2e9fa5=_0x2bc946[_0x475f63(0xbb)];return _0x2e9fa5?await this['pollTimeline'](_0x57718c,_0x178b51):await this[_0x475f63(0xd6)](_0x57718c,_0x178b51,_0x2bc946),0x0;}const _0x135444=await withSpinner(_0x475f63(0x224),()=>_0x2b9949['workflow'][_0x475f63(0xae)]({'projectName':_0x3ec38a,'workflowName':_0x3321c2,'limit':_0x2bc946[_0x475f63(0x188)]||0x32}),{'verbose':_0x2bc946['verbose']}),_0x5e4344=_0x135444['data'];if(_0x5e4344[_0x475f63(0xbe)]===0x0){if(_0x3ec38a&&_0x3321c2)console[_0x475f63(0xe6)](_0x475f63(0x102)+_0x3ec38a+'.'+_0x3321c2);else _0x3ec38a?console[_0x475f63(0xe6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x3ec38a):(console[_0x475f63(0xe6)]('No\x20workflow\x20sessions\x20found'),console[_0x475f63(0xe6)](a46_0x41c3a5[_0x475f63(0x1c2)](_0x475f63(0x16f))));return 0x0;}_0x5e4344['sort']((_0x5534ca,_0x10abfc)=>{const _0x3936e3=_0x475f63,_0x586ef1=_0x5534ca[_0x3936e3(0x1b7)]||'',_0x21514e=_0x10abfc[_0x3936e3(0x1b7)]||'';return _0x21514e[_0x3936e3(0x21c)](_0x586ef1);});if(_0x2bc946[_0x475f63(0x227)]||_0x2bc946['jsonl'])return await handleSDKOutput(_0x5e4344,_0x2bc946),0x0;let _0xa1cd2d;if(_0x5f467f){const _0x19c39e=_0x5e4344[0x0];if(!_0x19c39e[_0x475f63(0xd7)]?.['id'])return console['error'](_0x475f63(0x215)),0x0;_0xa1cd2d=_0x19c39e[_0x475f63(0xd7)]['id'],_0x2bc946['verbose']&&console[_0x475f63(0xe6)](_0x475f63(0x1ac)+_0x19c39e[_0x475f63(0x1b7)]);}else{const _0x24b305=_0x5e4344[_0x475f63(0x123)](_0x217c0e=>{const _0x3bab11=_0x475f63,_0x499806=getAttemptStatusDisplay(_0x217c0e['lastAttempt']);return{'title':_0x217c0e['project']?.['name']+'.'+_0x217c0e[_0x3bab11(0xa9)]?.[_0x3bab11(0xea)]+'\x20-\x20'+_0x217c0e[_0x3bab11(0x1b7)]+'\x20'+_0x499806[_0x3bab11(0x136)],'value':_0x217c0e[_0x3bab11(0xd7)]?.['id']||'','description':_0x499806['text']};}),_0x28c592=await a46_0x443862({'type':_0x475f63(0x9c),'name':_0x475f63(0x1f3),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x24b305[_0x475f63(0x233)](_0x1bcbe7=>_0x1bcbe7[_0x475f63(0x216)]!=='')});if(!_0x28c592[_0x475f63(0x1f3)])return 0x0;_0xa1cd2d=_0x28c592[_0x475f63(0x1f3)];}const _0x2e9ece=_0x2bc946['follow'];return _0x2e9ece?await this['pollTimeline'](_0x57718c,_0xa1cd2d):await this[_0x475f63(0xd6)](_0x57718c,_0xa1cd2d,_0x2bc946),0x0;}async[a46_0x350b3f(0xd6)](_0x19f54c,_0x3f4fb5,_0x2a9047){const _0x3777e7=a46_0x350b3f,{tdx:_0x2af65c}=_0x19f54c;let _0x30cca1,_0x5c7f0a;try{[_0x30cca1,_0x5c7f0a]=await Promise[_0x3777e7(0xe7)]([_0x2af65c[_0x3777e7(0xa9)]['attempt'](_0x3f4fb5),_0x2af65c[_0x3777e7(0xa9)]['tasks'](_0x3f4fb5,![])]);}catch(_0x4ba3ad){console['error'](a46_0x41c3a5[_0x3777e7(0xb4)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x2a9047['verbose']&&console[_0x3777e7(0xe6)](_0x4ba3ad);throw _0x4ba3ad;}if(_0x2a9047[_0x3777e7(0x227)]||_0x2a9047[_0x3777e7(0x128)]){const _0x5a6605=this[_0x3777e7(0x135)](_0x30cca1,_0x5c7f0a);await handleSDKOutput([_0x5a6605],_0x2a9047);return;}const _0x3beefe=_0x2af65c['context']['site'],_0x1b6440=this[_0x3777e7(0x175)](_0x30cca1,_0x5c7f0a,_0x3beefe);console['log'](_0x1b6440);}async[a46_0x350b3f(0xe8)](_0x2dec6a,_0x4af781){const _0x3db3fe=a46_0x350b3f,{tdx:_0x48b160}=_0x2dec6a,_0x351c56=TIMELINE_CONFIG[_0x3db3fe(0x22a)],_0x4b329b=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x206101=0x0;while(_0x206101<_0x4b329b){process['stdout'][_0x3db3fe(0x1f6)]&&process[_0x3db3fe(0xe1)][_0x3db3fe(0x1a6)]('\x1bc');let _0x4f64cd,_0x175168;try{[_0x4f64cd,_0x175168]=await Promise['all']([_0x48b160['workflow'][_0x3db3fe(0x1f2)](_0x4af781),_0x48b160[_0x3db3fe(0xa9)][_0x3db3fe(0x11e)](_0x4af781,![])]);}catch(_0x1e580e){console['error'](a46_0x41c3a5[_0x3db3fe(0xb4)](_0x3db3fe(0x119)));_0x206101>0x0&&console[_0x3db3fe(0xe6)](a46_0x41c3a5[_0x3db3fe(0x1c2)](_0x3db3fe(0x1e8)+_0x206101));throw _0x1e580e;}const _0x5e8d7e=_0x48b160[_0x3db3fe(0x1ff)][_0x3db3fe(0xd5)],_0x8422a9=this['renderTimeline'](_0x4f64cd,_0x175168,_0x5e8d7e);console[_0x3db3fe(0x15d)](_0x8422a9);const _0x45bb7d=_0x4f64cd[_0x3db3fe(0x13a)]&&_0x175168[_0x3db3fe(0x190)](_0x129e8d=>_0x129e8d[_0x3db3fe(0x191)]!==_0x3db3fe(0x108)&&_0x129e8d[_0x3db3fe(0x191)]!==_0x3db3fe(0x22d));if(_0x45bb7d){console[_0x3db3fe(0xe6)](a46_0x41c3a5[_0x3db3fe(0x103)](_0x3db3fe(0xfd)));break;}console[_0x3db3fe(0xe6)](a46_0x41c3a5[_0x3db3fe(0x1c2)]('\x0aPolling...\x20('+_0x206101*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x36c44c=>setTimeout(_0x36c44c,_0x351c56)),_0x206101++;}_0x206101>=_0x4b329b&&console[_0x3db3fe(0xe6)](a46_0x41c3a5[_0x3db3fe(0x222)](_0x3db3fe(0x219)));}[a46_0x350b3f(0x175)](_0x2b9f5a,_0x426297,_0x22168d){const _0x446a49=a46_0x350b3f,_0x67cd22=[],_0x8259b9=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x284be7=0x5,_0x5f1556=process[_0x446a49(0xe1)][_0x446a49(0x141)]||0x78,_0x3c856a=_0x5f1556-_0x8259b9-_0x284be7,_0x416bae=Math['max'](TIMELINE_CONFIG[_0x446a49(0xce)],Math[_0x446a49(0x214)](_0x3c856a,TIMELINE_CONFIG[_0x446a49(0x129)])),_0x345df8=new Date(_0x2b9f5a[_0x446a49(0xfa)])[_0x446a49(0x10f)](),_0xc673f8=_0x2b9f5a['finishedAt']?new Date(_0x2b9f5a[_0x446a49(0x180)])[_0x446a49(0x10f)]():Date[_0x446a49(0x186)](),_0x21f556={'start':_0x345df8,'end':_0xc673f8,'duration':_0xc673f8-_0x345df8},_0x2542b0=new Map(),_0x138a2c=[];for(const _0x58c964 of _0x426297){if(_0x58c964[_0x446a49(0x1a3)]){const _0xbc2614=new Date(_0x58c964['startedAt'])[_0x446a49(0x10f)](),_0x4a3eb3=_0x58c964['updatedAt']?new Date(_0x58c964[_0x446a49(0x21b)])['getTime']():Date[_0x446a49(0x186)](),_0x23d286={'start':_0xbc2614,'end':_0x4a3eb3,'duration':_0x4a3eb3-_0xbc2614};_0x2542b0[_0x446a49(0x14c)](_0x58c964['id'],_0x23d286),_0x138a2c[_0x446a49(0x17e)]({'name':_0x58c964['fullName'],'state':_0x58c964[_0x446a49(0x191)]||_0x446a49(0x232),'window':_0x23d286});}else _0x138a2c[_0x446a49(0x17e)]({'name':_0x58c964[_0x446a49(0x126)],'state':_0x58c964[_0x446a49(0x191)]||'planned','window':undefined});}_0x138a2c['sort']((_0x27ac18,_0x544235)=>{const _0x461942=_0x446a49;if(!_0x27ac18[_0x461942(0x1d5)])return 0x1;if(!_0x544235[_0x461942(0x1d5)])return-0x1;return _0x27ac18[_0x461942(0x1d5)][_0x461942(0xcf)]-_0x544235[_0x461942(0x1d5)]['start'];});const _0x51fed1=_0x138a2c['length'],_0x14d12f=_0x51fed1>TIMELINE_CONFIG[_0x446a49(0x1b3)];_0x14d12f&&_0x138a2c[_0x446a49(0x1ab)](TIMELINE_CONFIG[_0x446a49(0x1b3)]);const _0x2a8d54=calculateTimeScale(_0x21f556,_0x416bae),_0x33e23e=_0x2b9f5a[_0x446a49(0x13a)]?_0x2b9f5a[_0x446a49(0x1a1)]?a46_0x41c3a5['green'](_0x446a49(0x1a1)):a46_0x41c3a5[_0x446a49(0xb4)](_0x446a49(0xe6)):a46_0x41c3a5[_0x446a49(0x211)](_0x446a49(0x108)),_0x5a8d7b=_0x2b9f5a['project']?.['id'],_0x1dc64f=_0x2b9f5a['sessionId'];let _0x3fd730;if(_0x5a8d7b&&_0x1dc64f){const _0x25aca5=getWorkflowAttemptUrl(_0x22168d,_0x5a8d7b,_0x1dc64f,_0x2b9f5a['id']);_0x3fd730=hyperlink(a46_0x41c3a5[_0x446a49(0x1c2)](_0x2b9f5a['id']),_0x25aca5);}else _0x3fd730=a46_0x41c3a5['dim'](_0x2b9f5a['id']);_0x67cd22[_0x446a49(0x17e)](_0x446a49(0x143)+_0x3fd730+_0x446a49(0x112)+_0x33e23e+'\x20-\x20'+formatElapsed(_0x21f556[_0x446a49(0x19b)]));if(_0x138a2c[_0x446a49(0xbe)]>0x0){const _0x322006=renderTimeAxis(_0x2a8d54,_0x416bae),_0x1e0fed=new Date(_0x21f556[_0x446a49(0xcf)]),_0x47db7e=formatDate(_0x1e0fed),_0x431b4e=TIMELINE_CONFIG[_0x446a49(0x168)]+TIMELINE_CONFIG['ICON_SPACING']+_0x8259b9,_0x2b9276=_0x47db7e['padStart'](_0x431b4e),_0x2e63d6=a46_0x41c3a5[_0x446a49(0x1c2)](_0x2b9276);_0x67cd22[_0x446a49(0x17e)](_0x2e63d6+'\x20'+_0x322006);for(const _0x1c5cad of _0x138a2c){_0x67cd22[_0x446a49(0x17e)](renderTaskRow(_0x1c5cad,_0x2a8d54,_0x416bae,_0x8259b9));}const _0xdc899a=calculateStats(_0x138a2c);_0x67cd22[_0x446a49(0x17e)](formatStats(_0xdc899a)),_0x14d12f&&_0x67cd22[_0x446a49(0x17e)](a46_0x41c3a5[_0x446a49(0x222)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x446a49(0x1b3)]+_0x446a49(0x13e)+_0x51fed1+_0x446a49(0x17a))),_0x67cd22[_0x446a49(0x17e)](''),_0x67cd22[_0x446a49(0x17e)](a46_0x41c3a5[_0x446a49(0x1c2)](_0x446a49(0x207))+(_0x446a49(0x228)+_0x2b9f5a['id']+_0x446a49(0x9f))+a46_0x41c3a5[_0x446a49(0x1c2)](_0x446a49(0x12f)));}else _0x67cd22[_0x446a49(0x17e)](_0x446a49(0x1a8));return _0x67cd22[_0x446a49(0x99)]('\x0a');}['buildTimelineData'](_0x1b9eb6,_0x34c994){const _0x35ed85=a46_0x350b3f,_0x486f2d=new Date(_0x1b9eb6[_0x35ed85(0xfa)])[_0x35ed85(0x10f)](),_0x2ef187=_0x1b9eb6[_0x35ed85(0x180)]?new Date(_0x1b9eb6[_0x35ed85(0x180)])[_0x35ed85(0x10f)]():Date[_0x35ed85(0x186)](),_0x39a81a=_0x2ef187-_0x486f2d,_0x270f44=[];for(const _0x30795f of _0x34c994){if(_0x30795f[_0x35ed85(0x1a3)]){const _0x187da9=new Date(_0x30795f['startedAt'])[_0x35ed85(0x10f)](),_0x2adcfa=_0x30795f[_0x35ed85(0x21b)]?new Date(_0x30795f[_0x35ed85(0x21b)])[_0x35ed85(0x10f)]():Date[_0x35ed85(0x186)]();_0x270f44['push']({'name':_0x30795f[_0x35ed85(0x126)],'state':_0x30795f[_0x35ed85(0x191)]||_0x35ed85(0x232),'window':{'start':_0x187da9,'end':_0x2adcfa,'duration':_0x2adcfa-_0x187da9}});}else _0x270f44['push']({'name':_0x30795f[_0x35ed85(0x126)],'state':_0x30795f['state']||_0x35ed85(0x22d),'window':undefined});}const _0x50cefc=calculateStats(_0x270f44);return{'attempt':{'id':_0x1b9eb6['id'],'status':_0x1b9eb6[_0x35ed85(0x13a)]?_0x1b9eb6[_0x35ed85(0x1a1)]?_0x35ed85(0x1a1):_0x35ed85(0xe6):'running','createdAt':_0x1b9eb6[_0x35ed85(0xfa)],'finishedAt':_0x1b9eb6[_0x35ed85(0x180)],'duration_ms':_0x39a81a},'tasks':_0x270f44[_0x35ed85(0x123)](_0x57e412=>({'name':_0x57e412[_0x35ed85(0xea)],'state':_0x57e412['state'],'startedAt':_0x57e412[_0x35ed85(0x1d5)]?new Date(_0x57e412[_0x35ed85(0x1d5)][_0x35ed85(0xcf)])[_0x35ed85(0x8f)]():null,'updatedAt':_0x57e412[_0x35ed85(0x1d5)]?new Date(_0x57e412[_0x35ed85(0x1d5)][_0x35ed85(0xf9)])[_0x35ed85(0x8f)]():null,'duration_ms':_0x57e412[_0x35ed85(0x1d5)]?.[_0x35ed85(0x19b)]||null})),'stats':_0x50cefc};}}
|
|
1
|
+
const a46_0x38b2ab=a46_0x300c;(function(_0x2b161f,_0x250016){const _0x6be64f=a46_0x300c,_0x3a5972=_0x2b161f();while(!![]){try{const _0x53246f=parseInt(_0x6be64f(0x1e2))/0x1+parseInt(_0x6be64f(0x145))/0x2*(-parseInt(_0x6be64f(0x27f))/0x3)+-parseInt(_0x6be64f(0x258))/0x4+parseInt(_0x6be64f(0x1b8))/0x5+-parseInt(_0x6be64f(0x203))/0x6+-parseInt(_0x6be64f(0x14e))/0x7*(parseInt(_0x6be64f(0x217))/0x8)+parseInt(_0x6be64f(0x1a3))/0x9;if(_0x53246f===_0x250016)break;else _0x3a5972['push'](_0x3a5972['shift']());}catch(_0x19c137){_0x3a5972['push'](_0x3a5972['shift']());}}}(a46_0x15f6,0x2e1ca));import a46_0x5b905a from'chalk';import{existsSync}from'fs';function a46_0x300c(_0x9213b2,_0x55c310){_0x9213b2=_0x9213b2-0x112;const _0x15f62b=a46_0x15f6();let _0x300c8b=_0x15f62b[_0x9213b2];return _0x300c8b;}import a46_0x985414 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a46_0x15f6(){const _0x2caaf2=['resolveProject','parse','name','No\x20attempts\x20found','🔄\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','\x20workflow','\x0aPolling...\x20(','\x20logs','getTime','json','length','Error:\x20Invalid\x20JSON\x20in\x20--params','803425hPMMwk','startedAt','(use\x20--limit\x20to\x20see\x20more)','Listing\x20workflows...','changes','state','window','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Select\x20a\x20session\x20to\x20view\x20timeline:','Killing\x20attempt...','getDate','Invalid\x20format:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','fileCount','sessionTime','workflow:sessions','map','cancelRequested','projects','pollTimeline','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','logs','task','revision','end','title','Source\x20directory\x20is\x20required','Project\x20directory:\x20','\x0a✔\x20Already\x20up\x20to\x20date','Source\x20directory:\x20','Target\x20directory:\x20','project','format','parseProjectWorkflowPattern','(unknown)','updatedAt','kill','workflows','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','get','metadata','128458BXedZk','workflow:pull','isNewProject','GUTTER','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','hasChanges','output','stat','rows','✔\x20Downloaded\x20','attempt','every','start','Error:\x20','message','cyan','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','\x20modified','isTTY','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20log\x20content\x20found','Analyzing\x20project...','table','getHours','trimEnd','✔\x20Pull\x20complete','getMonth','success','\x22\x20to\x20new\x20project\x20\x22','max','\x20\x20New\x20attempt\x20ID:\x20','modified','red','1023516pzmIyu','resolve','attempt:','Workflow:\x20','summary','targetExists','Filter:\x20project=','Fetching\x20log\x20files...','values','data','Listing\x20secrets...','showWorkflowConsoleUrl','Pulling\x20project\x20','renderSessionsTimeline','replace','Session\x20not\x20found:\x20','skipValidation','blue','Usage:\x20tdx\x20wf\x20use\x20<project>','limit','44168BFNGak','No\x20attempts\x20found\x20for:\x20','error','workflow:delete','verbose','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','context','Retrying\x20attempt...','has','Setting\x20secret...','No\x20sessions\x20with\x20timing\x20information','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x22?\x20This\x20cannot\x20be\x20undone.','execute','sessionId','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','newProjectId','stringify','path','MAX_LABEL_COUNT','Failed\x20to\x20fetch\x20attempt\x20data','Using\x20attempt\x20','requireProject','sys','List\x20all\x20workflow\x20projects','\x20\x20Changes:\x20','Error:\x20Attempt\x20ID\x20is\x20required','Dry\x20run:\x20yes','Reason:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','deleted','List\x20workflows','run','workflow:secrets:delete','isDirectory','fileSize','Filter:\x20','buildTimelineData','sourceDir','\x20\x20Target:\x20','canceling','workflow:secrets:list','✔\x20Deleted\x20project\x20','retryAttemptName','Pushing\x20workflow\x20project...','yellow','\x20\x20tdx\x20wf\x20use\x20<project>','match','logFiles','Listing\x20workflow\x20attempts...','Project\x20filter:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','setSecret','startsWith','all','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Pattern:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','sort','prepareCloneProject','No\x20sessions\x20found\x20for:\x20','session:','\x0aPush\x20these\x20changes?','💡\x20Tip:\x20Use\x20','List\x20workflow\x20execution\x20sessions','1319320ZvidRX','Validation:\x20skipped','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','No\x20matching\x20sessions\x20found','\x20\x20Revision:\x20','\x20tasks','✔\x20Showing\x20','Error:','Params:\x20','\x20\x20Location:\x20','Attempt:\x20','getMinutes','padStart','readFile','getFullYear','Resume\x20from:\x20','navigateSessionsInteractive','Analyzing\x20changes...','Project:\x20','Project\x20name:\x20','From\x20task:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:projects','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','index','ICON_WIDTH','Downloading\x20project\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Error:\x20Project\x20name\x20is\x20required','type','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','session','\x20task','\x20\x20Source:\x20','workflowProject','fromTask',',\x20Workflow:\x20','Deleting\x20project\x20','diff','401550vTIGPs','group_error','/attempt/','executeCloneProject','tasks','fs/promises','No\x20sessions\x20found\x20in\x20project:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','projectId','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Error:\x20Secret\x20key\x20is\x20required','white','push','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','⚠\x20Showing\x20first\x20','workflow:download','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Tip:\x20cd\x20to\x20workflows/','Cancelled','key','fill','\x20sessions\x20','preparePushProject','yes','\x20new','\x20\x20Session\x20ID:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','params','\x20secret','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','indexOf','log','filter','Error:\x20KEY=VALUE\x20is\x20required','Auto-selected\x20latest\x20session:\x20','total','\x20\x20Workflow:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','localeCompare','isArray','workflow:run','targetDir','Getting\x20attempt\x20tasks...','\x0a⚠\x20Project\x20\x22','Writing\x20files...','floor','Status:\x20','attemptId','join','sourceProjectName','Select\x20a\x20task\x20to\x20view\x20logs:','Loading\x20sessions...','-\x20nothing\x20pushed','\x20-\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','newProjectName','resolveProjectDir','delete','durationMs','No\x20workflows\x20found\x20in\x20project:\x20','cwd','\x20\x20Console:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Key:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','✔\x20Workflow\x20project\x20set\x20to:\x20','---\x20','listSecrets','\x20from\x20session\x20','finishedAt','duration','fullName','split','Loading\x20workflows...','List\x20workflow\x20attempts','applyPullProject','executePushProject','→\x20New\x20project:\x20','renderSingleTimeline','LABEL_MIN_SPACING','session_id','planned','autocomplete','follow','new','dim','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','status','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x20\x20Project\x20ID:\x20','size','projectName','\x0aError:','✔\x20Found\x20','No\x20workflows\x20found','\x20is\x20not\x20a\x20directory','\x27...','Deleting\x20secret...','toISOString','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','workflowName','min','Listing\x20workflow\x20projects...','Usage:\x20workflow:delete\x20<project-name-or-id>','clear','lastAttempt','renderTimeline','select','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20projects\x20match\x20pattern:\x20','\x20unchanged','Source\x20project:\x20','✔\x20Clone\x20complete','\x20attempt','existingProjectId','param','running','find','\x22\x20already\x20exists\x20(ID:\x20','done','columns','Warning:','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','stdout','Source:\x20','dryRun','generateSessionTimelineRows','Latest\x20session\x20has\x20no\x20attempt','2gweqVL','/sessions/','jsonl','relative','tdx.json','basename','No\x20sessions\x20found','toLowerCase','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','91yPNbDS','Session\x20time:\x20','No\x20attempts\x20found\x20in\x20project:\x20','Start\x20a\x20workflow\x20run','workflow:push','/app/workflows/','\x20(use\x20--limit\x20to\x20show\x20more)','green','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','splice','\x20deleted','Output\x20directory:\x20','...','\x20(system)','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','✔\x20Secret\x20\x27','-\x20no\x20files\x20written','icon','repeat','📋\x20','TASK_NAME_WIDTH','Parameters:\x20','workflow','\x20\x20Session\x20context\x20set\x20to:\x20','Target:\x20','Expected\x20format:\x20--param\x20key=value','unchanged','attempts','list','workflow:kill','\x20to\x20see\x20detailed\x20logs','Include\x20retried:\x20yes','MAX_TASKS_DISPLAY','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','pending','Resolving\x20project\x20\x27','workflow:timeline','\x20session','some','Listing\x20workflow\x20sessions...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:logs','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','write','text','MAX_TIMELINE_WIDTH','sessions','retrySession','startTime','Key\x20cannot\x20be\x20empty','\x1b[1A\x1b[2K','msPerChar','utf-8','taskName','Cloning\x20to\x20','\x20\x20Files\x20extracted:\x20','tdx\x20wf\x20attempt\x20','✔\x20Pushed\x20','unknown','Force:\x20yes','Show\x20specific\x20attempt\x20details','description','Loading\x20session...','set','\x20\x20Project:\x20','New\x20project\x20name:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','round','✔\x20Project:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Show\x20tasks\x20for\x20an\x20attempt','Revision:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x0aApply\x20these\x20changes?','MAX_POLL_ITERATIONS','\x22\x20with\x20new\x20revision?','now','workflow:secrets:set','\x20of\x20','✔\x20Project\x20updated','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','substring','Starting\x20workflow\x20run...','site','createdAt','5451930ocQCoS','Attempt\x20ID:\x20','workflow:tasks','✔\x20Workflow\x20run\x20started','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','includes','keys','Downloading\x20logs...'];a46_0x15f6=function(){return _0x2caaf2;};return a46_0x15f6();}import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a46_0x143713 from'prompts';function getAttemptStatusDisplay(_0x4aa250){const _0x19fcbf=a46_0x300c;if(!_0x4aa250)return{'icon':'⏳','text':''};const {done:_0xace168,success:_0x5a5208,cancelRequested:_0x34e452}=_0x4aa250;if(!_0xace168)return _0x34e452?{'icon':'🛑','text':a46_0x5b905a['yellow'](_0x19fcbf(0x23f))}:{'icon':'🔄','text':a46_0x5b905a[_0x19fcbf(0x214)](_0x19fcbf(0x139))};if(_0x5a5208)return{'icon':'✅','text':a46_0x5b905a['green'](_0x19fcbf(0x1fd))};return{'icon':'❌','text':a46_0x5b905a['red'](_0x19fcbf(0x219))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x267581,_0xe0f50b,_0x48df1b=0x0){const _0x434506=a46_0x300c;return _0x267581[_0x48df1b]||_0xe0f50b[_0x434506(0x27a)];}[a46_0x38b2ab(0x22d)](_0x13d697,_0x15ee18,_0x51c00d=0x0){const _0x366264=a46_0x38b2ab,_0x274f11=this[_0x366264(0x1ab)](_0x13d697,_0x15ee18,_0x51c00d);if(!_0x274f11)return console['error'](a46_0x5b905a['red'](_0x366264(0x25f)),'Project\x20name\x20is\x20required'),console[_0x366264(0x219)](a46_0x5b905a['dim'](_0x366264(0x299))),null;return _0x274f11;}['parseProjectWorkflowPattern'](_0x28a95f,_0x175bcd){const _0x314f96=a46_0x38b2ab;if(_0x28a95f[0x0]){const _0x1dbd22=_0x28a95f[0x0][_0x314f96(0x2c8)]('.');if(_0x1dbd22[_0x314f96(0x1b6)]===0x1)return{'projectName':_0x1dbd22[0x0],'workflowName':undefined};else return _0x1dbd22[_0x314f96(0x1b6)]===0x2?{'projectName':_0x1dbd22[0x0],'workflowName':_0x1dbd22[0x1]}:(console['error'](a46_0x5b905a['red']('Error:'),_0x314f96(0x16f)),null);}return{'projectName':_0x175bcd[_0x314f96(0x27a)],'workflowName':undefined};}[a46_0x38b2ab(0x2b8)](_0x5ba07d,_0x5df96b,_0x2bfb57=0x0){const _0x3ddcb4=a46_0x38b2ab;if(_0x5ba07d[_0x2bfb57])return _0x5ba07d[_0x2bfb57];if(_0x5df96b[_0x3ddcb4(0x27a)]){const _0x18271e=a46_0x985414[_0x3ddcb4(0x2af)](process['cwd'](),_0x3ddcb4(0x1de),_0x5df96b[_0x3ddcb4(0x27a)]);if(existsSync(a46_0x985414[_0x3ddcb4(0x2af)](_0x18271e,_0x3ddcb4(0x149))))return _0x18271e;}return undefined;}async['showWorkflowConsoleUrl'](_0x39cfc3,_0x4091af,_0x6688eb){const _0x1b1b16=a46_0x38b2ab;try{const _0x48ca35=await _0x39cfc3[_0x1b1b16(0x164)][_0x1b1b16(0x1de)](_0x4091af,{'limit':0x1});if(_0x48ca35[_0x1b1b16(0x1b6)]>0x0){const _0x42ee25=_0x48ca35[0x0]['id'],_0x1d86f4=getWorkflowUrl(_0x6688eb,_0x42ee25);console[_0x1b1b16(0x219)](_0x1b1b16(0x2bd)+a46_0x5b905a[_0x1b1b16(0x1f1)](_0x1d86f4));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';['description']=a46_0x38b2ab(0x25a);async[a46_0x38b2ab(0x224)](_0x1fa8b1){const _0x4e50f9=a46_0x38b2ab,{options:_0xd6a95f,args:_0x307c35,tdx:_0x280fb2}=_0x1fa8b1,_0x547dda=_0x307c35[0x0],_0x45aadd=_0xd6a95f[_0x4e50f9(0x12d)];if(_0x45aadd)return saveSessionContext({'workflow_project':undefined},_0xd6a95f[_0x4e50f9(0x277)]),console['log'](a46_0x5b905a['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x547dda)return console[_0x4e50f9(0x219)](a46_0x5b905a['red'](_0x4e50f9(0x25f)),'Project\x20name\x20is\x20required'),console[_0x4e50f9(0x219)](a46_0x5b905a[_0x4e50f9(0x11a)](_0x4e50f9(0x215))),console[_0x4e50f9(0x219)](a46_0x5b905a[_0x4e50f9(0x11a)](_0x4e50f9(0x13f))),0x1;const _0x2c6e76=await withSpinner(_0x4e50f9(0x171)+_0x547dda+_0x4e50f9(0x125),()=>_0x280fb2[_0x4e50f9(0x164)]['resolveProjectId'](_0x547dda),{'verbose':_0xd6a95f[_0x4e50f9(0x21b)]}),{name:_0x4850e5}=_0x2c6e76['data'];return saveSessionContext({'workflow_project':_0x4850e5},_0xd6a95f['session']),console[_0x4e50f9(0x29e)](a46_0x5b905a['green'](_0x4e50f9(0x2c1)+a46_0x5b905a['cyan'](_0x4850e5))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x26e);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x22f);async['execute'](_0x21d8d3){const _0x149990=a46_0x38b2ab,{options:_0x2af486,args:_0x50e9cd,tdx:_0xa0e999}=_0x21d8d3,_0x643111=_0x50e9cd[0x0];_0x2af486[_0x149990(0x21b)]&&_0x643111&&console['error'](_0x149990(0x24f)+_0x643111);const _0x47c0a0=await withSpinner(_0x149990(0x12b),()=>_0xa0e999[_0x149990(0x164)][_0x149990(0x1ca)](_0x643111,{'limit':_0x2af486[_0x149990(0x216)]}),{'verbose':_0x2af486[_0x149990(0x21b)]});let _0x829b47=_0x47c0a0[_0x149990(0x20c)];_0x829b47['sort']((_0x1a8a53,_0x3b977f)=>_0x1a8a53['name']['localeCompare'](_0x3b977f[_0x149990(0x1ad)]));const _0x10258a=_0x2af486[_0x149990(0x216)]||0x64,_0x22836b=_0x829b47[_0x149990(0x1b6)]>=_0x10258a?a46_0x5b905a['dim'](_0x149990(0x154)):'';console[_0x149990(0x219)](_0x149990(0x122)+_0x829b47['length']+'\x20project'+(_0x829b47[_0x149990(0x1b6)]!==0x1?'s':'')+_0x22836b);if(_0x2af486[_0x149990(0x1d9)]==='json'||_0x2af486[_0x149990(0x1d9)]===_0x149990(0x147)||_0x2af486[_0x149990(0x1d9)]===_0x149990(0x1f8))await handleSDKOutput(_0x829b47,_0x2af486);else{if(_0x829b47['length']===0x0)_0x643111?console[_0x149990(0x29e)](_0x149990(0x132)+_0x643111):console['log']('No\x20workflow\x20projects\x20found');else{const _0x346ead=_0x829b47[_0x149990(0x1c8)](_0x3a590d=>{const _0x4943ac=_0x149990,_0x26287=_0x3a590d[_0x4943ac(0x1e1)]?.[_0x4943ac(0x174)](_0x33ce70=>_0x33ce70[_0x4943ac(0x292)]===_0x4943ac(0x22e)),_0x5503f2=_0x26287?a46_0x5b905a[_0x4943ac(0x11a)](_0x4943ac(0x15b)):'';return'📁\x20'+_0x3a590d['name']+_0x5503f2;});await writeOutput(_0x346ead['join']('\x0a'),_0x2af486['output'],_0x149990(0x16a));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]='workflow:workflows';['description']=a46_0x38b2ab(0x236);async[a46_0x38b2ab(0x224)](_0x14587e){const _0x3e25ee=a46_0x38b2ab,{options:_0xc343b,args:_0x347ca3,tdx:_0x412d46}=_0x14587e,_0x20ca60=this[_0x3e25ee(0x1ab)](_0x347ca3,_0xc343b);_0xc343b['verbose']&&_0x20ca60&&console['error'](_0x3e25ee(0x249)+_0x20ca60);const _0x5f3bd0=await withSpinner(_0x3e25ee(0x1bb),()=>_0x412d46[_0x3e25ee(0x164)]['workflows'](_0x20ca60,{'limit':_0xc343b[_0x3e25ee(0x216)]}),{'verbose':_0xc343b[_0x3e25ee(0x21b)]});let _0x7aa73a=_0x5f3bd0[_0x3e25ee(0x20c)];_0x7aa73a[_0x3e25ee(0x251)]((_0x4434e8,_0x11c10d)=>{const _0x339a2c=_0x3e25ee,_0x25a476=_0x4434e8[_0x339a2c(0x1ad)]['localeCompare'](_0x11c10d[_0x339a2c(0x1ad)]);if(_0x25a476!==0x0)return _0x25a476;return(_0x4434e8[_0x339a2c(0x1d8)]?.[_0x339a2c(0x1ad)]||'')[_0x339a2c(0x2a5)](_0x11c10d['project']?.[_0x339a2c(0x1ad)]||'');});const _0x5c43b7=_0xc343b[_0x3e25ee(0x216)]||0x64,_0x5e0099=_0x7aa73a[_0x3e25ee(0x1b6)]>=_0x5c43b7?a46_0x5b905a[_0x3e25ee(0x11a)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3e25ee(0x219)](_0x3e25ee(0x122)+_0x7aa73a[_0x3e25ee(0x1b6)]+_0x3e25ee(0x1b1)+(_0x7aa73a['length']!==0x1?'s':'')+_0x5e0099);if(_0xc343b[_0x3e25ee(0x1d9)]===_0x3e25ee(0x1b5)||_0xc343b[_0x3e25ee(0x1d9)]===_0x3e25ee(0x147)||_0xc343b[_0x3e25ee(0x1d9)]==='table')await handleSDKOutput(_0x7aa73a,_0xc343b);else{if(_0x7aa73a[_0x3e25ee(0x1b6)]===0x0)_0x20ca60?console[_0x3e25ee(0x29e)](_0x3e25ee(0x2bb)+_0x20ca60):console['log'](_0x3e25ee(0x123));else{const _0x2169fd=_0xc343b[_0x3e25ee(0x1a1)],_0x4e474e=_0x7aa73a[_0x3e25ee(0x1c8)](_0x3b760d=>{const _0x55a9f1=_0x3e25ee,_0x17a6b2=a46_0x5b905a[_0x55a9f1(0x11a)]('#'+_0x3b760d['id']),_0x33a793=hyperlink(_0x17a6b2,getWorkflowUrl(_0x2169fd,_0x3b760d['id'])),_0x3d24f5=_0x3b760d[_0x55a9f1(0x1d8)]?.[_0x55a9f1(0x1ad)]?a46_0x5b905a[_0x55a9f1(0x11a)]('\x20('+_0x3b760d[_0x55a9f1(0x1d8)][_0x55a9f1(0x1ad)]+')'):'';return _0x55a9f1(0x161)+_0x33a793+'\x20'+_0x3b760d['name']+_0x3d24f5;});await writeOutput(_0x4e474e['join']('\x0a'),_0xc343b[_0x3e25ee(0x1e8)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x1c7);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x257);async[a46_0x38b2ab(0x224)](_0x5672f5){const _0x13c212=a46_0x38b2ab,{options:_0x212b51,args:_0x46fb78,tdx:_0x32d232}=_0x5672f5,_0x206bdc=this[_0x13c212(0x1da)](_0x46fb78,_0x212b51);if(!_0x206bdc)return 0x1;const {projectName:_0x1c9da6,workflowName:_0x3ef121}=_0x206bdc;if(_0x212b51[_0x13c212(0x21b)]){if(_0x1c9da6&&_0x3ef121)console['error'](_0x13c212(0x23b)+_0x1c9da6+'.'+_0x3ef121);else _0x1c9da6&&console[_0x13c212(0x219)]('Filter:\x20project='+_0x1c9da6);const _0x5c6b5d=_0x212b51[_0x13c212(0x11c)];_0x5c6b5d&&console[_0x13c212(0x219)](_0x13c212(0x2ad)+_0x5c6b5d);}let _0x3caf2e=0x28;if(process['stdout'][_0x13c212(0x1f4)]&&!_0x212b51[_0x13c212(0x1e8)]&&!_0x212b51['format']){const _0x416c85=process[_0x13c212(0x140)][_0x13c212(0x1ea)]||0x28;_0x3caf2e=Math['max'](0x14,Math['floor'](_0x416c85*0x2/0x3));}const _0x290e68=_0x212b51[_0x13c212(0x216)]||_0x3caf2e,_0x5bbe26=await withSpinner(_0x13c212(0x175),()=>_0x32d232['workflow'][_0x13c212(0x17c)]({'projectName':_0x1c9da6,'workflowName':_0x3ef121,'status':_0x212b51[_0x13c212(0x11c)],'fromTime':_0x212b51['from'],'toTime':_0x212b51['to'],'limit':_0x290e68}),{'verbose':_0x212b51[_0x13c212(0x21b)]}),_0x1acb27=_0x5bbe26['data'];_0x1acb27[_0x13c212(0x251)]((_0x1ce5e0,_0x10cf66)=>{const _0x5d9f64=_0x13c212,_0x5d2a76=_0x1ce5e0[_0x5d9f64(0x1c6)]||'',_0x3e20de=_0x10cf66['sessionTime']||'';return _0x3e20de['localeCompare'](_0x5d2a76);});_0x1acb27[_0x13c212(0x1b6)]>=_0x290e68?console[_0x13c212(0x219)](_0x13c212(0x25e)+_0x1acb27[_0x13c212(0x1b6)]+_0x13c212(0x294)+a46_0x5b905a[_0x13c212(0x11a)](_0x13c212(0x1ba))):console[_0x13c212(0x219)]('✔\x20Found\x20'+_0x1acb27['length']+_0x13c212(0x173)+(_0x1acb27[_0x13c212(0x1b6)]!==0x1?'s':''));if(_0x212b51[_0x13c212(0x1d9)]===_0x13c212(0x1b5)||_0x212b51[_0x13c212(0x1d9)]==='jsonl'||_0x212b51[_0x13c212(0x1d9)]===_0x13c212(0x1f8))await handleSDKOutput(_0x1acb27,_0x212b51);else{if(!process[_0x13c212(0x140)][_0x13c212(0x1f4)]||_0x212b51['output']){if(_0x1acb27['length']===0x0){if(_0x1c9da6&&_0x3ef121)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x1c9da6+'.'+_0x3ef121);else _0x1c9da6?console['log'](_0x13c212(0x285)+_0x1c9da6):console['log'](_0x13c212(0x14b));}else{const _0x5a7fa2=_0x212b51[_0x13c212(0x1a1)],_0x33c6c2=this[_0x13c212(0x210)](_0x1acb27,_0x5a7fa2);_0x212b51['output']?await writeOutput(_0x33c6c2,_0x212b51[_0x13c212(0x1e8)],'list'):console['log'](_0x33c6c2);}!_0x1c9da6&&(console['error'](''),console[_0x13c212(0x219)](a46_0x5b905a[_0x13c212(0x11a)](_0x13c212(0x1c4))),console[_0x13c212(0x219)](a46_0x5b905a[_0x13c212(0x11a)](_0x13c212(0x178))+'or'+a46_0x5b905a[_0x13c212(0x11a)](_0x13c212(0x245))));}else{if(_0x1acb27[_0x13c212(0x1b6)]===0x0){if(_0x1c9da6&&_0x3ef121)console[_0x13c212(0x29e)]('No\x20sessions\x20found\x20for:\x20'+_0x1c9da6+'.'+_0x3ef121);else _0x1c9da6?console['log'](_0x13c212(0x285)+_0x1c9da6):console[_0x13c212(0x29e)]('No\x20sessions\x20found');}else await this[_0x13c212(0x268)](_0x1acb27,_0x5672f5,_0x1c9da6);}}return 0x0;}[a46_0x38b2ab(0x210)](_0x168743,_0x561643){const _0x432bc1=a46_0x38b2ab,_0x1211ab=[],_0x3be263=new Map();let _0x4f79d1=Infinity,_0x1057d7=-Infinity;for(const _0x5e5de5 of _0x168743){if(_0x5e5de5[_0x432bc1(0x12e)]?.[_0x432bc1(0x1a2)]){const _0x47bcc7=new Date(_0x5e5de5[_0x432bc1(0x12e)][_0x432bc1(0x1a2)])[_0x432bc1(0x1b4)](),_0x1e2198=_0x5e5de5[_0x432bc1(0x12e)][_0x432bc1(0x2c5)]?new Date(_0x5e5de5[_0x432bc1(0x12e)][_0x432bc1(0x2c5)])[_0x432bc1(0x1b4)]():Date[_0x432bc1(0x19a)](),_0x2e423b=_0x5e5de5[_0x432bc1(0x1d8)]?.['name']||_0x432bc1(0x1db);!_0x3be263[_0x432bc1(0x21f)](_0x2e423b)&&_0x3be263[_0x432bc1(0x18d)](_0x2e423b,[]),_0x3be263[_0x432bc1(0x1e0)](_0x2e423b)[_0x432bc1(0x28b)]({'session':_0x5e5de5,'startTime':_0x47bcc7,'endTime':_0x1e2198,'duration':_0x1e2198-_0x47bcc7}),_0x4f79d1=Math[_0x432bc1(0x12a)](_0x4f79d1,_0x47bcc7),_0x1057d7=Math[_0x432bc1(0x1ff)](_0x1057d7,_0x1e2198);}}if(_0x3be263[_0x432bc1(0x11f)]===0x0)return _0x432bc1(0x221);const _0x5daa6c=process['stdout']['columns']||0x78,_0x18a4d6=0x1e,_0x2d45d7=0x32,_0x3dcd92=0x4,_0x5faacb=Math[_0x432bc1(0x12a)](_0x2d45d7,Math[_0x432bc1(0x1ff)](_0x18a4d6,Math[_0x432bc1(0x2ac)](_0x5daa6c*0.3))),_0xdc10d5=_0x5daa6c-_0x5faacb-TIMELINE_CONFIG[_0x432bc1(0x1e5)]-0x3-_0x3dcd92,_0x1d5ff7=_0x1057d7-_0x4f79d1,_0x47afac=_0x1d5ff7/_0x5faacb,_0x1a7146=renderTimeAxis({'startTime':_0x4f79d1,'endTime':_0x1057d7,'durationMs':_0x1d5ff7,'msPerChar':_0x47afac},_0x5faacb),_0x2799ad=[];for(const _0x2e5744 of _0x3be263[_0x432bc1(0x20b)]()){_0x2799ad['push'](..._0x2e5744);}_0x2799ad[_0x432bc1(0x251)]((_0x36cfd8,_0x550e6d)=>_0x550e6d['startTime']-_0x36cfd8['startTime']);const _0x498da2=new Date(_0x4f79d1),_0x31ca38=formatDate(_0x498da2),_0x36c06b=_0x3dcd92+TIMELINE_CONFIG[_0x432bc1(0x271)]+TIMELINE_CONFIG['ICON_SPACING']+_0xdc10d5,_0x38229f='\x20'[_0x432bc1(0x160)](_0x36c06b-_0x31ca38['length']),_0x361552=_0x38229f+a46_0x5b905a[_0x432bc1(0x11a)](_0x31ca38)+'\x20'+_0x1a7146;_0x1211ab[_0x432bc1(0x28b)](_0x361552);const _0x2579c3=0x16;let _0x1704f1=0x0;for(const _0x38a876 of _0x2799ad){const _0xc8ac2b=_0x38a876[_0x432bc1(0x277)][_0x432bc1(0x1d8)]?.[_0x432bc1(0x1ad)]||'?',_0x2d67fc=Math['min'](stringWidth(_0xc8ac2b),_0x2579c3);_0x1704f1=Math[_0x432bc1(0x1ff)](_0x1704f1,_0x2d67fc);}for(const _0x13f8fa of _0x2799ad){const {session:_0x159569,startTime:_0x333b,endTime:_0x91bfb8,duration:_0x3f33b1}=_0x13f8fa,_0x48b8ba=_0x159569[_0x432bc1(0x1d8)]?.['id'],_0x441813=_0x159569['id'],_0x1c0c06=_0x159569['project']?.[_0x432bc1(0x1ad)]||'?',_0x3511d8=_0x159569[_0x432bc1(0x164)]?.[_0x432bc1(0x1ad)]||'?';let _0x3990ce,_0x8c938b;if(_0x159569[_0x432bc1(0x12e)]){const _0x4931ad=_0x159569[_0x432bc1(0x12e)];!_0x4931ad[_0x432bc1(0x13c)]?(_0x3990ce=_0x4931ad[_0x432bc1(0x1c9)]?'🛑':'🔄',_0x8c938b=_0x4931ad[_0x432bc1(0x1c9)]?a46_0x5b905a['yellow']:a46_0x5b905a[_0x432bc1(0x214)]):(_0x3990ce=_0x4931ad[_0x432bc1(0x1fd)]?'✅':'❌',_0x8c938b=_0x4931ad[_0x432bc1(0x1fd)]?a46_0x5b905a['green']:a46_0x5b905a[_0x432bc1(0x202)]);}else _0x3990ce='⏳',_0x8c938b=a46_0x5b905a['dim'];const _0x252be3='#'+_0x441813,_0x44d723=_0x48b8ba?hyperlink(_0x252be3,getWorkflowSessionUrl(_0x561643,_0x48b8ba,_0x441813)):_0x252be3;let _0x462e39=_0x1c0c06;stringWidth(_0x1c0c06)>_0x2579c3&&(_0x462e39=_0x1c0c06['slice'](0x0,_0x2579c3-0x1)+'…');const _0x3aa87b=a46_0x5b905a[_0x432bc1(0x11a)](_0x462e39),_0x88004f=stringWidth(_0x462e39),_0x45c00d='\x20'[_0x432bc1(0x160)](_0x1704f1-stringWidth(_0x462e39)+0x2),_0x133bd0='('+formatElapsed(_0x3f33b1)+')',_0x53ad00=stringWidth(_0x133bd0),_0x429d4a=stringWidth(_0x252be3),_0x35dd82=_0x429d4a+0x1+_0x88004f+_0x45c00d[_0x432bc1(0x1b6)],_0x21a117=_0xdc10d5-_0x35dd82-_0x53ad00-0x1-0x8;let _0x1accbf=_0x3511d8;stringWidth(_0x1accbf)>_0x21a117&&(_0x1accbf=_0x1accbf['slice'](0x0,_0x21a117-0x1)+'…');const _0x1a63c1=_0x44d723+'\x20'+_0x3aa87b+_0x45c00d+_0x1accbf,_0x59484e=stringWidth(_0x1a63c1),_0x1729ee=_0xdc10d5-_0x59484e-_0x53ad00,_0x1a525b=_0x1a63c1+'\x20'[_0x432bc1(0x160)](Math[_0x432bc1(0x1ff)](0x1,_0x1729ee))+a46_0x5b905a[_0x432bc1(0x11a)](_0x133bd0),_0x638550=Math[_0x432bc1(0x2ac)]((_0x333b-_0x4f79d1)/_0x47afac),_0x3a3115=Math[_0x432bc1(0x2ac)]((_0x91bfb8-_0x4f79d1)/_0x47afac),_0x5b4c95=Math['max'](_0x638550+0x1,_0x3a3115),_0x366fb9=new Array(_0x5faacb)[_0x432bc1(0x293)]('\x20');for(let _0x3b8b9e=_0x638550;_0x3b8b9e<Math['min'](_0x5b4c95,_0x5faacb);_0x3b8b9e++){_0x366fb9[_0x3b8b9e]='─';}const _0x5c091a=_0x366fb9[_0x432bc1(0x1c8)](_0x15a835=>_0x15a835==='\x20'?'\x20':_0x8c938b(_0x15a835))['join']('');_0x1211ab['push'](_0x3990ce+'\x20'+_0x1a525b+'│'+_0x5c091a+'│');}return _0x1211ab[_0x432bc1(0x2af)]('\x0a');}async[a46_0x38b2ab(0x268)](_0x2ea3cc,_0x1384f7,_0x59e073){const _0x46fc65=a46_0x38b2ab,{options:_0x5a63e6,tdx:_0x36ebac}=_0x1384f7,_0x36a505=_0x5a63e6[_0x46fc65(0x1a1)],{timelineRows:_0x38fa6b,timeAxisHeader:_0x37ba21}=this[_0x46fc65(0x143)](_0x2ea3cc,_0x36a505),_0x4a6021=_0x38fa6b[_0x46fc65(0x29f)](_0x125d64=>_0x125d64[_0x46fc65(0x2ae)]);if(_0x4a6021[_0x46fc65(0x1b6)]===0x0){const _0x5e8b41=this[_0x46fc65(0x210)](_0x2ea3cc,_0x36a505);console[_0x46fc65(0x29e)](_0x5e8b41);!_0x59e073&&(console[_0x46fc65(0x219)](''),console[_0x46fc65(0x219)](a46_0x5b905a[_0x46fc65(0x11a)](_0x46fc65(0x1c4))),console[_0x46fc65(0x219)](a46_0x5b905a[_0x46fc65(0x11a)](_0x46fc65(0x178))+'or'+a46_0x5b905a[_0x46fc65(0x11a)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x37ba21&&console[_0x46fc65(0x29e)](_0x37ba21);const _0x1e92a3=_0x38fa6b[_0x46fc65(0x29f)](_0x3ebac8=>_0x3ebac8[_0x46fc65(0x2ae)])[_0x46fc65(0x1c8)](_0x226743=>({'title':_0x226743['displayLine'],'value':_0x226743['attemptId']})),_0x56f3d5=process[_0x46fc65(0x140)][_0x46fc65(0x1ea)]||0x3c,_0x535aeb=Math[_0x46fc65(0x1ff)](0x28,Math[_0x46fc65(0x2ac)](_0x56f3d5*0x2/0x3)),_0x2a265c=await a46_0x143713({'type':_0x46fc65(0x117),'name':_0x46fc65(0x2ae),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x1e92a3,'initial':-0x1,'limit':_0x535aeb,'clearFirst':!![],'fallback':{'title':_0x46fc65(0x25b),'value':null},'suggest':(_0x235ebb,_0x15a9e8)=>{const _0x5edbce=_0x46fc65;if(!_0x235ebb)return Promise[_0x5edbce(0x204)](_0x15a9e8);const _0x4c539f=_0x15a9e8[_0x5edbce(0x29f)](_0x3323a0=>{const _0x27500d=_0x5edbce,_0x207518=_0x3323a0;return _0x207518[_0x27500d(0x1d2)][_0x27500d(0x14c)]()[_0x27500d(0x1a8)](_0x235ebb[_0x27500d(0x14c)]());});return Promise['resolve'](_0x4c539f);}}),_0x282cab=()=>{const _0x529c45=_0x46fc65;process[_0x529c45(0x140)][_0x529c45(0x179)](_0x529c45(0x180)),process[_0x529c45(0x140)][_0x529c45(0x179)](_0x529c45(0x180)),process['stdout']['write'](_0x529c45(0x180));},_0x3288f4=_0x2a265c&&_0x2a265c[_0x46fc65(0x2ae)]&&_0x2a265c[_0x46fc65(0x2ae)]!==null&&_0x2a265c[_0x46fc65(0x2ae)]['trim']()!=='';if(!_0x3288f4){_0x282cab(),console['log'](a46_0x5b905a['dim'](_0x46fc65(0x291)));return;}_0x282cab();const _0x4e7427=_0x2ea3cc[_0x46fc65(0x13a)](_0x2ce1b5=>_0x2ce1b5[_0x46fc65(0x12e)]?.['id']===_0x2a265c[_0x46fc65(0x2ae)]);if(_0x4e7427){const _0x235d85=_0x4e7427[_0x46fc65(0x1d8)]?.[_0x46fc65(0x1ad)]||'?',_0x5ac9b2=_0x4e7427[_0x46fc65(0x164)]?.[_0x46fc65(0x1ad)]||'?';console[_0x46fc65(0x29e)](_0x46fc65(0x26a)+a46_0x5b905a[_0x46fc65(0x11a)](_0x235d85)+_0x46fc65(0x27c)+a46_0x5b905a[_0x46fc65(0x11a)](_0x5ac9b2));}const _0x5077ea=new WorkflowTimelineCommand();await _0x5077ea[_0x46fc65(0x224)]({'args':[],'options':{..._0x5a63e6,'attemptId':_0x2a265c['attemptId']},'tdx':_0x36ebac});}[a46_0x38b2ab(0x143)](_0x22cf25,_0x23495c){const _0x2fed7b=a46_0x38b2ab,_0x2bfb42=new Map();for(const _0x4b24ee of _0x22cf25){_0x4b24ee['id']&&_0x4b24ee[_0x2fed7b(0x12e)]?.['id']&&_0x2bfb42[_0x2fed7b(0x18d)](_0x4b24ee['id'],_0x4b24ee['lastAttempt']['id']);}const _0x2647f6=[];let _0x15e4e5='';const _0x571afb=this[_0x2fed7b(0x210)](_0x22cf25,_0x23495c),_0x497aaf=_0x571afb[_0x2fed7b(0x2c8)]('\x0a');for(const _0x3be696 of _0x497aaf){if(_0x3be696['startsWith'](_0x2fed7b(0x156))||_0x3be696[_0x2fed7b(0x246)](/^\s+\d{4}-\d{2}-\d{2}/))_0x15e4e5=_0x3be696;else{if(_0x3be696[_0x2fed7b(0x246)](/^[✅❌🔄🛑⏳]/)){const _0x7b3e3a=_0x3be696['match'](/#(\d+)/),_0x181012=_0x7b3e3a?_0x7b3e3a[0x1]:null,_0x58454c=_0x181012?_0x2bfb42[_0x2fed7b(0x1e0)](_0x181012)||null:null,_0x30e9f4=_0x22cf25['find'](_0x329219=>_0x329219['id']===_0x181012),_0x5eca9a=_0x30e9f4?.[_0x2fed7b(0x1d8)]?.[_0x2fed7b(0x1ad)]||'';_0x2647f6['push']({'displayLine':_0x3be696,'attemptId':_0x58454c,'projectName':_0x5eca9a});}}}return{'timelineRows':_0x2647f6,'timeAxisHeader':_0x15e4e5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]='workflow:attempts';[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x2ca);async[a46_0x38b2ab(0x224)](_0x13224f){const _0x598467=a46_0x38b2ab,{options:_0x2e400c,args:_0x4edd3b,tdx:_0x4e2543}=_0x13224f,_0x13784e=this[_0x598467(0x1da)](_0x4edd3b,_0x2e400c);if(!_0x13784e)return 0x1;const {projectName:_0x1e31bb,workflowName:_0x12bbcc}=_0x13784e,_0x4cb483=_0x2e400c['includeRetried'];if(_0x2e400c['verbose']){if(_0x1e31bb&&_0x12bbcc)console['error'](_0x598467(0x23b)+_0x1e31bb+'.'+_0x12bbcc);else _0x1e31bb&&console['error'](_0x598467(0x209)+_0x1e31bb);_0x4cb483&&console[_0x598467(0x219)](_0x598467(0x16d));}const _0x1195ae=await withSpinner(_0x598467(0x248),()=>_0x4e2543[_0x598467(0x164)][_0x598467(0x169)]({'projectName':_0x1e31bb,'workflowName':_0x12bbcc,'includeRetried':_0x4cb483,'limit':_0x2e400c[_0x598467(0x216)]}),{'verbose':_0x2e400c[_0x598467(0x21b)]}),_0xe91dba=_0x1195ae['data'],_0x59beff=_0x2e400c['limit']||0x64,_0x134791=_0xe91dba[_0x598467(0x1b6)]>=_0x59beff?a46_0x5b905a[_0x598467(0x11a)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x598467(0x219)](_0x598467(0x122)+_0xe91dba[_0x598467(0x1b6)]+_0x598467(0x136)+(_0xe91dba[_0x598467(0x1b6)]!==0x1?'s':'')+_0x134791);if(_0x2e400c['format']===_0x598467(0x1b5)||_0x2e400c[_0x598467(0x1d9)]===_0x598467(0x147)||_0x2e400c[_0x598467(0x1d9)]===_0x598467(0x1f8))await handleSDKOutput(_0xe91dba,_0x2e400c);else{if(_0xe91dba[_0x598467(0x1b6)]===0x0){if(_0x1e31bb&&_0x12bbcc)console['log'](_0x598467(0x218)+_0x1e31bb+'.'+_0x12bbcc);else _0x1e31bb?console[_0x598467(0x29e)](_0x598467(0x150)+_0x1e31bb):console[_0x598467(0x29e)](_0x598467(0x1ae));}else{const _0x3d1e3c=_0x2e400c['site'],_0x2bb1a7=_0xe91dba['map'](_0x374573=>{const _0x5e6545=_0x598467,_0x50ddbd=a46_0x5b905a[_0x5e6545(0x11a)]('#'+_0x374573['id']),_0x4c816c=_0x374573['project']?.['id'],_0x29f334=_0x374573[_0x5e6545(0x115)]||_0x374573[_0x5e6545(0x225)],_0xaa958d=_0x4c816c&&_0x29f334?hyperlink(_0x50ddbd,getWorkflowAttemptUrl(_0x3d1e3c,_0x4c816c,_0x29f334,_0x374573['id'])):_0x50ddbd,{icon:_0x548d2a,text:_0x54dbaa}=getAttemptStatusDisplay(_0x374573),_0x2ba958=(_0x374573[_0x5e6545(0x1d8)]?.['name']||'?')+'.'+(_0x374573[_0x5e6545(0x164)]?.[_0x5e6545(0x1ad)]||'?'),_0x2215bc=_0x374573[_0x5e6545(0x1c6)]?a46_0x5b905a[_0x5e6545(0x11a)](_0x374573[_0x5e6545(0x1c6)]):'';return(_0xaa958d+'\x20'+_0x548d2a+(_0x54dbaa?'\x20'+_0x54dbaa:'')+'\x20'+_0x2ba958+'\x20'+_0x2215bc)[_0x5e6545(0x1fa)]();});await writeOutput(_0x2bb1a7['join']('\x0a'),_0x2e400c[_0x598467(0x1e8)],_0x598467(0x16a));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x18a);async[a46_0x38b2ab(0x224)](_0xe099fc){const _0x275cd5=a46_0x38b2ab,{options:_0x4cb301,args:_0x43320d,tdx:_0x11484a}=_0xe099fc,_0x27ffc5=_0x43320d[0x0];if(!_0x27ffc5)return console[_0x275cd5(0x219)](_0x275cd5(0x231)),0x1;_0x4cb301[_0x275cd5(0x21b)]&&console[_0x275cd5(0x219)]('Attempt\x20ID:\x20'+_0x27ffc5);const _0x452955=await withSpinner('Getting\x20attempt\x20details...',()=>_0x11484a['workflow'][_0x275cd5(0x1ec)](_0x27ffc5),{'verbose':_0x4cb301[_0x275cd5(0x21b)]}),_0x35d74d=_0x452955[_0x275cd5(0x20c)];let _0x5da7e3;!_0x35d74d['done']?_0x5da7e3=_0x35d74d[_0x275cd5(0x1c9)]?'canceling':_0x275cd5(0x139):_0x5da7e3=_0x35d74d['success']?_0x275cd5(0x1fd):_0x275cd5(0x219);let _0xb6dd9b;if(_0x35d74d[_0x275cd5(0x1a2)]&&_0x35d74d[_0x275cd5(0x2c5)]){const _0x198837=new Date(_0x35d74d[_0x275cd5(0x1a2)])[_0x275cd5(0x1b4)](),_0x5c5ade=new Date(_0x35d74d[_0x275cd5(0x2c5)])[_0x275cd5(0x1b4)]();_0xb6dd9b=Math[_0x275cd5(0x191)]((_0x5c5ade-_0x198837)/0x3e8);}const _0x195b34={'attempt_id':_0x35d74d['id'],'status':_0x5da7e3,..._0x35d74d['index']!==undefined&&{'index':_0x35d74d[_0x275cd5(0x270)]},..._0x35d74d['project']&&{'project':_0x35d74d['project'][_0x275cd5(0x1ad)]},..._0x35d74d[_0x275cd5(0x164)]&&{'workflow':_0x35d74d[_0x275cd5(0x164)][_0x275cd5(0x1ad)]},..._0x35d74d[_0x275cd5(0x225)]&&{'session_id':_0x35d74d[_0x275cd5(0x225)]},..._0x35d74d[_0x275cd5(0x1c6)]&&{'session_time':_0x35d74d[_0x275cd5(0x1c6)]},..._0x35d74d['retryAttemptName']&&{'retry_attempt':_0x35d74d[_0x275cd5(0x242)]},..._0xb6dd9b!==undefined&&{'duration_sec':_0xb6dd9b},..._0x35d74d['createdAt']&&{'created_at':_0x35d74d['createdAt']},..._0x35d74d[_0x275cd5(0x2c5)]&&{'finished_at':_0x35d74d[_0x275cd5(0x2c5)]},...Object[_0x275cd5(0x1a9)](_0x35d74d[_0x275cd5(0x29a)])[_0x275cd5(0x1b6)]>0x0&&{'params':_0x35d74d['params']}};return await handleSingleObjectOutput(_0x195b34,_0x4cb301),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a46_0x38b2ab(0x1a5);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x194);async[a46_0x38b2ab(0x224)](_0x1dcc9d){const _0x405791=a46_0x38b2ab,{options:_0x136cac,args:_0x363648,tdx:_0x21ca89}=_0x1dcc9d,_0x41e80f=_0x363648[0x0];if(!_0x41e80f)return console[_0x405791(0x219)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x1ff247=_0x136cac['includeSubtasks'];_0x136cac[_0x405791(0x21b)]&&(console['error']('Attempt\x20ID:\x20'+_0x41e80f),_0x1ff247&&console[_0x405791(0x219)]('Including\x20subtasks:\x20yes'));const _0x38d279=await withSpinner(_0x405791(0x2a9),()=>_0x21ca89[_0x405791(0x164)][_0x405791(0x283)](_0x41e80f,_0x1ff247||![]),{'verbose':_0x136cac[_0x405791(0x21b)]}),_0x1939ed=_0x38d279[_0x405791(0x20c)];return console[_0x405791(0x219)](_0x405791(0x122)+_0x1939ed[_0x405791(0x1b6)]+_0x405791(0x278)+(_0x1939ed['length']!==0x1?'s':'')),await handleSDKOutput(_0x1939ed,_0x136cac),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x177);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x28f);async[a46_0x38b2ab(0x224)](_0xa999f5){const _0x359259=a46_0x38b2ab,{options:_0x25c39b,args:_0xe871e7,tdx:_0x2d417e}=_0xa999f5,_0x275670=_0xe871e7[0x0];let _0x28631f=_0xe871e7[0x1];if(!_0x275670)return console[_0x359259(0x219)](_0x359259(0x231)),0x1;_0x25c39b['verbose']&&(console[_0x359259(0x219)](_0x359259(0x1a4)+_0x275670),_0x28631f&&console[_0x359259(0x219)]('Task\x20name:\x20'+_0x28631f));const _0x1f044d=await withSpinner(_0x359259(0x20a),()=>_0x2d417e['workflow'][_0x359259(0x247)](_0x275670,_0x28631f),{'verbose':_0x25c39b[_0x359259(0x21b)]}),_0x5045e7=_0x1f044d[_0x359259(0x20c)];if(_0x5045e7[_0x359259(0x1b6)]===0x0)return console[_0x359259(0x219)](_0x359259(0x2a4)),0x0;if(!_0x28631f&&(_0x25c39b[_0x359259(0x1b5)]||_0x25c39b[_0x359259(0x1d9)]))return await handleSDKOutput(_0x5045e7,_0x25c39b),0x0;if(!_0x28631f){const _0x2fdcc8=_0x5045e7['map'](_0x404aa3=>({'title':_0x404aa3['taskName']+'\x20('+formatBytes(_0x404aa3[_0x359259(0x23a)])+')','value':_0x404aa3[_0x359259(0x183)]})),_0x24781d=await a46_0x143713({'type':_0x359259(0x130),'name':'task','message':_0x359259(0x2b1),'choices':_0x2fdcc8});if(!_0x24781d[_0x359259(0x1cf)])return console[_0x359259(0x219)]('Cancelled'),0x0;_0x28631f=_0x24781d['task'];}const _0x128412=await withSpinner(_0x359259(0x1aa),()=>_0x2d417e[_0x359259(0x164)][_0x359259(0x1ce)](_0x275670,_0x28631f),{'verbose':_0x25c39b[_0x359259(0x21b)]}),_0x4797e4=_0x128412[_0x359259(0x20c)];return _0x4797e4?console[_0x359259(0x29e)](_0x4797e4):console[_0x359259(0x219)](_0x359259(0x1f6)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a46_0x38b2ab(0x16b);['description']='Kill\x20a\x20running\x20attempt';async['execute'](_0x533849){const _0x45ff90=a46_0x38b2ab,{options:_0x5a69b3,args:_0xdd4a1b,tdx:_0x489e12}=_0x533849,_0x5d53cd=_0xdd4a1b[0x0];if(!_0x5d53cd)return console[_0x45ff90(0x219)](_0x45ff90(0x231)),0x1;const _0x4d936a=_0x5a69b3['reason'];_0x5a69b3[_0x45ff90(0x21b)]&&(console[_0x45ff90(0x219)](_0x45ff90(0x1a4)+_0x5d53cd),_0x4d936a&&console[_0x45ff90(0x219)](_0x45ff90(0x233)+_0x4d936a));if(!_0x5a69b3[_0x45ff90(0x296)]){if(!isInteractive())return console[_0x45ff90(0x219)](a46_0x5b905a[_0x45ff90(0x202)](_0x45ff90(0x121)),_0x45ff90(0x128)),console[_0x45ff90(0x219)](a46_0x5b905a[_0x45ff90(0x11a)](_0x45ff90(0x2be))),0x1;const _0x1062ec=await confirmKey(_0x45ff90(0x24e)+_0x5d53cd+'?');if(!_0x1062ec)return console[_0x45ff90(0x219)](a46_0x5b905a[_0x45ff90(0x244)](_0x45ff90(0x291))),0x1;}const _0x10e0b7=await withSpinner(_0x45ff90(0x1c1),()=>_0x489e12[_0x45ff90(0x164)][_0x45ff90(0x1dd)](_0x5d53cd,_0x4d936a),{'verbose':_0x5a69b3[_0x45ff90(0x21b)]}),_0x248973=_0x10e0b7[_0x45ff90(0x20c)];return console[_0x45ff90(0x219)]('✔\x20'+_0x248973),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';[a46_0x38b2ab(0x18b)]='Retry\x20a\x20session\x20or\x20attempt';async[a46_0x38b2ab(0x224)](_0x272b1b){const _0x1fcec6=a46_0x38b2ab,{options:_0x5e4f26,args:_0x2e1b0a,tdx:_0x57cd02}=_0x272b1b,_0x3aee40=_0x2e1b0a[0x0];if(!_0x3aee40)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x1fcec6(0x219)](_0x1fcec6(0x288)),0x1;let _0x14d267=![],_0x4bcde1=_0x3aee40;if(_0x3aee40['startsWith'](_0x1fcec6(0x254)))_0x14d267=!![],_0x4bcde1=_0x3aee40[_0x1fcec6(0x19f)](0x8);else{if(_0x3aee40[_0x1fcec6(0x24c)](_0x1fcec6(0x205)))_0x14d267=![],_0x4bcde1=_0x3aee40['substring'](0x8);else return console[_0x1fcec6(0x219)](_0x1fcec6(0x1cd)),console[_0x1fcec6(0x219)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x2b3074=_0x5e4f26[_0x1fcec6(0x27b)],_0x1964fa=_0x5e4f26['resumeFrom'],_0x31a4cf=_0x5e4f26[_0x1fcec6(0x29a)],_0x3a12d8=_0x5e4f26['force'];_0x5e4f26[_0x1fcec6(0x21b)]&&(console['error'](_0x1fcec6(0x166)+(_0x14d267?'session':'attempt')+'\x20'+_0x4bcde1),_0x2b3074&&console[_0x1fcec6(0x219)](_0x1fcec6(0x26c)+_0x2b3074),_0x1964fa&&console[_0x1fcec6(0x219)](_0x1fcec6(0x267)+_0x1964fa),_0x31a4cf&&console['error'](_0x1fcec6(0x260)+_0x31a4cf),_0x3a12d8&&console[_0x1fcec6(0x219)](_0x1fcec6(0x189)));let _0x489077;if(_0x31a4cf)try{if(_0x31a4cf[_0x1fcec6(0x24c)]('@')){const _0x20c808=await import(_0x1fcec6(0x284)),_0x590e1f=_0x31a4cf['substring'](0x1),_0x3c54e8=await _0x20c808[_0x1fcec6(0x265)](_0x590e1f,_0x1fcec6(0x182));_0x489077=JSON[_0x1fcec6(0x1ac)](_0x3c54e8);}else _0x489077=JSON[_0x1fcec6(0x1ac)](_0x31a4cf);}catch{return console[_0x1fcec6(0x219)](_0x1fcec6(0x1b7)),0x1;}if(!_0x5e4f26[_0x1fcec6(0x296)]){if(!isInteractive())return console[_0x1fcec6(0x219)](a46_0x5b905a[_0x1fcec6(0x202)](_0x1fcec6(0x121)),_0x1fcec6(0x128)),console[_0x1fcec6(0x219)](a46_0x5b905a['dim'](_0x1fcec6(0x2be))),0x1;const _0x1cf749=await confirmKey(_0x1fcec6(0x1df)+(_0x14d267?_0x1fcec6(0x277):_0x1fcec6(0x1ec))+'\x20'+_0x4bcde1+'?');if(!_0x1cf749)return console[_0x1fcec6(0x219)](a46_0x5b905a[_0x1fcec6(0x244)](_0x1fcec6(0x291))),0x1;}let _0x32cb51;_0x14d267?_0x32cb51=await withSpinner('Retrying\x20session...',()=>_0x57cd02[_0x1fcec6(0x164)][_0x1fcec6(0x17d)](_0x4bcde1,{'fromTask':_0x2b3074,'retryParams':_0x489077}),{'verbose':_0x5e4f26[_0x1fcec6(0x21b)]}):_0x32cb51=await withSpinner(_0x1fcec6(0x21e),()=>_0x57cd02[_0x1fcec6(0x164)]['retryAttempt'](_0x4bcde1,{'resumeFrom':_0x1964fa,'retryParams':_0x489077,'force':_0x3a12d8}),{'verbose':_0x5e4f26['verbose']});const _0x3fe0f9=_0x32cb51['data'];return console[_0x1fcec6(0x219)]('✔\x20Retry\x20started'),console[_0x1fcec6(0x219)](_0x1fcec6(0x200)+_0x3fe0f9[_0x1fcec6(0x2ae)]),console[_0x1fcec6(0x219)](_0x1fcec6(0x298)+_0x3fe0f9[_0x1fcec6(0x225)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x2a7);['description']=a46_0x38b2ab(0x151);async[a46_0x38b2ab(0x224)](_0x469104){const _0x162c74=a46_0x38b2ab,{options:_0x21d0e1,args:_0x5ee1ea,tdx:_0x46cc7a}=_0x469104;let _0x2fc3a8=_0x5ee1ea[0x0];if(!_0x2fc3a8){const _0x5e6069=this[_0x162c74(0x1ab)]([],_0x21d0e1),_0x566ca8=await withSpinner(_0x162c74(0x2c9),()=>_0x46cc7a['workflow'][_0x162c74(0x1de)](_0x5e6069,{'limit':_0x21d0e1['limit']}),{'verbose':_0x21d0e1[_0x162c74(0x21b)]}),_0x51e8d2=_0x566ca8[_0x162c74(0x20c)];if(_0x51e8d2[_0x162c74(0x1b6)]===0x0)return console[_0x162c74(0x219)](_0x162c74(0x123)),!_0x5e6069&&console[_0x162c74(0x219)](a46_0x5b905a['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x48bd24=_0x51e8d2[_0x162c74(0x1c8)](_0x210c99=>({'title':_0x210c99[_0x162c74(0x1d8)]?.[_0x162c74(0x1ad)]+'.'+_0x210c99[_0x162c74(0x1ad)],'value':_0x210c99['project']?.[_0x162c74(0x1ad)]+'.'+_0x210c99[_0x162c74(0x1ad)],'description':_0x210c99['revision']?'revision:\x20'+_0x210c99[_0x162c74(0x1d0)]:undefined})),_0x53c667=await a46_0x143713({'type':'select','name':_0x162c74(0x164),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x48bd24});if(!_0x53c667['workflow'])return 0x1;_0x2fc3a8=_0x53c667[_0x162c74(0x164)];}if(!_0x2fc3a8['includes']('.')){const _0x12a3eb=this[_0x162c74(0x1ab)]([],_0x21d0e1);if(_0x12a3eb)_0x2fc3a8=_0x12a3eb+'.'+_0x2fc3a8;else return console['error'](a46_0x5b905a[_0x162c74(0x202)](_0x162c74(0x25f)),_0x162c74(0x176)),console[_0x162c74(0x219)](a46_0x5b905a['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x1a608b=_0x21d0e1[_0x162c74(0x138)],_0x1a7ea2=_0x21d0e1[_0x162c74(0x1c6)],_0x193ae3={};if(_0x1a608b&&Array[_0x162c74(0x2a6)](_0x1a608b))for(const _0x4dc155 of _0x1a608b){const _0x274ab2=_0x4dc155['indexOf']('=');if(_0x274ab2===-0x1)return console[_0x162c74(0x219)](_0x162c74(0x250)+_0x4dc155),console[_0x162c74(0x219)](_0x162c74(0x167)),0x1;const _0xe655a2=_0x4dc155[_0x162c74(0x19f)](0x0,_0x274ab2),_0x31c447=_0x4dc155['substring'](_0x274ab2+0x1);try{_0x193ae3[_0xe655a2]=JSON[_0x162c74(0x1ac)](_0x31c447);}catch{_0x193ae3[_0xe655a2]=_0x31c447;}}_0x21d0e1['verbose']&&(console[_0x162c74(0x219)](_0x162c74(0x206)+_0x2fc3a8),Object[_0x162c74(0x1a9)](_0x193ae3)['length']>0x0&&console['error'](_0x162c74(0x163)+JSON[_0x162c74(0x228)](_0x193ae3)),_0x1a7ea2&&console[_0x162c74(0x219)](_0x162c74(0x14f)+_0x1a7ea2));const _0x5f0a66=await withSpinner(_0x162c74(0x1a0),()=>_0x46cc7a[_0x162c74(0x164)][_0x162c74(0x237)](_0x2fc3a8,_0x193ae3,{'sessionTime':_0x1a7ea2}),{'verbose':_0x21d0e1[_0x162c74(0x21b)]}),_0x38c7be=_0x5f0a66['data'];console[_0x162c74(0x219)](_0x162c74(0x1a6)),console[_0x162c74(0x219)]('\x20\x20Attempt\x20ID:\x20'+_0x38c7be['id']),console[_0x162c74(0x219)](_0x162c74(0x298)+_0x38c7be['sessionId']),console[_0x162c74(0x219)]('\x20\x20Project:\x20'+_0x38c7be[_0x162c74(0x1d8)]?.['name']),console[_0x162c74(0x219)](_0x162c74(0x2a3)+_0x38c7be[_0x162c74(0x164)]?.[_0x162c74(0x1ad)]);if(_0x38c7be['project']?.['id']&&_0x38c7be[_0x162c74(0x225)]&&_0x38c7be['id']){const _0x19f1b8=_0x21d0e1[_0x162c74(0x1a1)],_0xb9824f=getConsoleUrl(_0x19f1b8,_0x162c74(0x153)+_0x38c7be[_0x162c74(0x1d8)]['id']+_0x162c74(0x146)+_0x38c7be['sessionId']+_0x162c74(0x281)+_0x38c7be['id']);console[_0x162c74(0x219)](_0x162c74(0x2bd)+a46_0x5b905a[_0x162c74(0x1f1)](_0xb9824f));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x28e);['description']=a46_0x38b2ab(0x1f5);async[a46_0x38b2ab(0x224)](_0xdea84c){const _0x5b6483=a46_0x38b2ab,{options:_0x16f66e,args:_0x3f0d29,tdx:_0x501975}=_0xdea84c,_0xc21b09=_0x3f0d29[0x0],_0x31228a=_0x3f0d29[0x1]||'.';if(!_0xc21b09)return console[_0x5b6483(0x219)](_0x5b6483(0x274)),console['error'](_0x5b6483(0x28c)),0x1;const _0x26ac96=_0x16f66e['revision'];_0x16f66e[_0x5b6483(0x21b)]&&(console[_0x5b6483(0x219)](_0x5b6483(0x26a)+_0xc21b09),console[_0x5b6483(0x219)](_0x5b6483(0x159)+_0x31228a),_0x26ac96&&console['error'](_0x5b6483(0x195)+_0x26ac96));const _0x2ec214=await withSpinner(_0x5b6483(0x272)+_0xc21b09+_0x5b6483(0x15a),()=>_0x501975[_0x5b6483(0x164)]['download'](_0xc21b09,_0x31228a,{'revision':_0x26ac96}),{'verbose':_0x16f66e[_0x5b6483(0x21b)]}),_0x578161=_0x2ec214[_0x5b6483(0x20c)];return console[_0x5b6483(0x219)](_0x5b6483(0x1eb)+_0x578161['projectName']),console[_0x5b6483(0x219)](_0x5b6483(0x25c)+_0x578161[_0x5b6483(0x1d0)]),console[_0x5b6483(0x219)](_0x5b6483(0x185)+_0x578161['filesExtracted']),console[_0x5b6483(0x219)](_0x5b6483(0x261)+_0x31228a+'/'+_0x578161[_0x5b6483(0x120)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]='workflow:upload';[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x1f2);async[a46_0x38b2ab(0x224)](_0x35a5bc){const _0x32a4fc=a46_0x38b2ab,{options:_0x5aa5b5,args:_0x2f3528,tdx:_0x5ea001}=_0x35a5bc;let _0x524799='.',_0x5b4caa=_0x5aa5b5['name'];if(_0x2f3528[0x0]){const {promises:_0xecdf12}=await import('fs');try{const _0x15ffed=await _0xecdf12[_0x32a4fc(0x1e9)](_0x2f3528[0x0]);if(_0x15ffed[_0x32a4fc(0x239)]())_0x524799=_0x2f3528[0x0];else return console['error'](_0x32a4fc(0x1ef)+_0x2f3528[0x0]+_0x32a4fc(0x124)),0x1;}catch{_0x5b4caa=_0x2f3528[0x0],_0x524799='.';}}const _0x560897=_0x5aa5b5[_0x32a4fc(0x1d0)],_0x30bb25=_0x5aa5b5['skipValidation'];_0x5aa5b5[_0x32a4fc(0x21b)]&&(console['error'](_0x32a4fc(0x1d4)+_0x524799),_0x5b4caa&&console[_0x32a4fc(0x219)](_0x32a4fc(0x26b)+_0x5b4caa),_0x560897&&console['error'](_0x32a4fc(0x195)+_0x560897),_0x30bb25&&console[_0x32a4fc(0x219)](_0x32a4fc(0x259)));const _0x28d93f=await withSpinner(_0x32a4fc(0x243),()=>_0x5ea001[_0x32a4fc(0x164)]['push'](_0x524799,{'projectName':_0x5b4caa,'revision':_0x560897,'skipValidation':_0x30bb25}),{'verbose':_0x5aa5b5[_0x32a4fc(0x21b)]}),_0x1b640c=_0x28d93f[_0x32a4fc(0x20c)];return console[_0x32a4fc(0x219)](_0x32a4fc(0x187)+_0x1b640c[_0x32a4fc(0x120)]),console[_0x32a4fc(0x219)](_0x32a4fc(0x11e)+_0x1b640c[_0x32a4fc(0x287)]),console[_0x32a4fc(0x219)](_0x32a4fc(0x25c)+_0x1b640c[_0x32a4fc(0x1d0)]),await this[_0x32a4fc(0x20e)](_0x5ea001,_0x1b640c[_0x32a4fc(0x120)],_0x5aa5b5[_0x32a4fc(0x1a1)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x1e3);[a46_0x38b2ab(0x18b)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a46_0x38b2ab(0x224)](_0x3b6a1a){const _0x66e239=a46_0x38b2ab,{options:_0x36684c,args:_0x2536c6,tdx:_0x1d2d1b}=_0x3b6a1a,_0x467c85=_0x2536c6[0x0],_0x499feb=_0x2536c6[0x1];if(!_0x467c85)return console[_0x66e239(0x219)](a46_0x5b905a[_0x66e239(0x202)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x66e239(0x219)](a46_0x5b905a[_0x66e239(0x11a)](_0x66e239(0x286))),0x1;const _0x50337d=_0x36684c[_0x66e239(0x1d0)];_0x36684c[_0x66e239(0x21b)]&&(console['error']('Project:\x20'+_0x467c85),_0x499feb&&console[_0x66e239(0x219)](_0x66e239(0x1d7)+_0x499feb),_0x50337d&&console[_0x66e239(0x219)](_0x66e239(0x195)+_0x50337d),_0x36684c[_0x66e239(0x142)]&&console['error']('Dry\x20run:\x20yes'));const _0x1dff53=await withSpinner(_0x66e239(0x20f)+_0x467c85+_0x66e239(0x15a),()=>_0x1d2d1b['workflow']['pullProject'](_0x467c85,{'targetDir':_0x499feb,'revision':_0x50337d}),{'verbose':_0x36684c[_0x66e239(0x21b)]}),_0x4fc261=_0x1dff53[_0x66e239(0x20c)];_0x4fc261[_0x66e239(0x1e4)]?console['error'](_0x66e239(0x112)+_0x4fc261['projectName']):console[_0x66e239(0x219)]('→\x20Project:\x20'+_0x4fc261[_0x66e239(0x120)]);console['error']('\x20\x20Revision:\x20'+_0x4fc261['revision']),console[_0x66e239(0x219)](_0x66e239(0x23e)+(a46_0x985414[_0x66e239(0x148)](process[_0x66e239(0x2bc)](),_0x4fc261[_0x66e239(0x2a8)])||'.')),console[_0x66e239(0x219)]('\x20\x20Changes:\x20'+a46_0x5b905a[_0x66e239(0x155)]('+'+_0x4fc261[_0x66e239(0x207)]['new']+_0x66e239(0x297))+',\x20'+(a46_0x5b905a[_0x66e239(0x244)]('~'+_0x4fc261['summary']['modified']+'\x20modified')+',\x20')+(a46_0x5b905a[_0x66e239(0x202)]('-'+_0x4fc261[_0x66e239(0x207)][_0x66e239(0x235)]+'\x20deleted')+',\x20')+(''+a46_0x5b905a['dim'](_0x4fc261[_0x66e239(0x207)][_0x66e239(0x168)]+'\x20unchanged')));for(const _0x50939b of _0x4fc261[_0x66e239(0x1bc)]){_0x50939b[_0x66e239(0x275)]===_0x66e239(0x201)&&_0x50939b[_0x66e239(0x27e)]&&(console[_0x66e239(0x219)]('\x0a'+a46_0x5b905a[_0x66e239(0x1f1)](_0x66e239(0x2c2)+_0x50939b[_0x66e239(0x229)])),console[_0x66e239(0x219)](_0x50939b[_0x66e239(0x27e)]));}if(!_0x4fc261[_0x66e239(0x1e7)])return saveSessionContext({'workflow_project':_0x4fc261['projectName']},_0x36684c['session']),console[_0x66e239(0x219)](a46_0x5b905a[_0x66e239(0x155)](_0x66e239(0x1d5))),console[_0x66e239(0x219)](a46_0x5b905a['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x4fc261[_0x66e239(0x120)])),0x0;if(_0x36684c[_0x66e239(0x142)])return console[_0x66e239(0x219)](a46_0x5b905a[_0x66e239(0x244)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x36684c[_0x66e239(0x296)]){if(!isInteractive())return console[_0x66e239(0x219)](a46_0x5b905a[_0x66e239(0x202)](_0x66e239(0x121)),_0x66e239(0x128)),console[_0x66e239(0x219)](a46_0x5b905a[_0x66e239(0x11a)](_0x66e239(0x2be))),0x1;const _0x10838d=await confirmKey(_0x66e239(0x197));if(!_0x10838d)return console[_0x66e239(0x219)](a46_0x5b905a['yellow'](_0x66e239(0x291)),_0x66e239(0x15e)),0x1;}await withSpinner(_0x66e239(0x2ab),()=>_0x1d2d1b[_0x66e239(0x164)][_0x66e239(0x2cb)](_0x4fc261,{'revision':_0x50337d}),{'verbose':_0x36684c[_0x66e239(0x21b)]}),saveSessionContext({'workflow_project':_0x4fc261['projectName']},_0x36684c[_0x66e239(0x277)]),console[_0x66e239(0x219)](a46_0x5b905a[_0x66e239(0x155)](_0x66e239(0x1fb)));const _0x42294e=a46_0x985414['relative'](process[_0x66e239(0x2bc)](),_0x4fc261[_0x66e239(0x2a8)])||'.';return console[_0x66e239(0x219)](a46_0x5b905a[_0x66e239(0x11a)](_0x66e239(0x261)+_0x42294e)),console['error'](a46_0x5b905a[_0x66e239(0x11a)](_0x66e239(0x165)+_0x4fc261[_0x66e239(0x120)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x152);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x2b5);async[a46_0x38b2ab(0x224)](_0x5b38e4){const _0x364756=a46_0x38b2ab,{options:_0x588499,args:_0x197ac6,tdx:_0x465893}=_0x5b38e4,_0x188c08=this[_0x364756(0x2b8)](_0x197ac6,_0x588499),_0xbca01f=_0x588499[_0x364756(0x1d0)],_0xa9dc5e=_0x588499[_0x364756(0x213)];_0x588499[_0x364756(0x21b)]&&(_0x188c08&&console[_0x364756(0x219)](_0x364756(0x1d6)+_0x188c08),_0xbca01f&&console[_0x364756(0x219)](_0x364756(0x195)+_0xbca01f),_0x588499[_0x364756(0x142)]&&console[_0x364756(0x219)](_0x364756(0x232)),_0xa9dc5e&&console[_0x364756(0x219)](_0x364756(0x259)));let _0x458464;try{_0x458464=await withSpinner(_0x364756(0x269),()=>_0x465893[_0x364756(0x164)][_0x364756(0x295)]({'sourceDir':_0x188c08,'revision':_0xbca01f,'skipValidation':_0xa9dc5e}),{'verbose':_0x588499[_0x364756(0x21b)]});}catch(_0x417d16){if(_0x417d16 instanceof Error&&_0x417d16[_0x364756(0x1f0)][_0x364756(0x1a8)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x364756(0x219)](a46_0x5b905a[_0x364756(0x202)](_0x364756(0x25f)),_0x364756(0x1bf)),_0x588499[_0x364756(0x27a)]?console[_0x364756(0x219)](a46_0x5b905a[_0x364756(0x11a)](_0x364756(0x290)+_0x588499['workflowProject']+_0x364756(0x226)+_0x588499['workflowProject']+'\x27')):console['error'](a46_0x5b905a[_0x364756(0x11a)](_0x364756(0x193))),0x1;throw _0x417d16;}const _0x5738c9=_0x458464[_0x364756(0x20c)];console['error'](_0x364756(0x192)+_0x5738c9[_0x364756(0x120)]),console[_0x364756(0x219)](_0x364756(0x279)+_0x5738c9[_0x364756(0x23d)]),console[_0x364756(0x219)](_0x364756(0x25c)+_0x5738c9[_0x364756(0x1d0)]),console[_0x364756(0x219)](_0x364756(0x230)+a46_0x5b905a['green']('+'+_0x5738c9[_0x364756(0x207)][_0x364756(0x119)]+_0x364756(0x297))+',\x20'+(a46_0x5b905a[_0x364756(0x244)]('~'+_0x5738c9['summary'][_0x364756(0x201)]+_0x364756(0x1f3))+',\x20')+(a46_0x5b905a['red']('-'+_0x5738c9[_0x364756(0x207)]['deleted']+_0x364756(0x158))+',\x20')+(''+a46_0x5b905a['dim'](_0x5738c9[_0x364756(0x207)][_0x364756(0x168)]+_0x364756(0x133))));for(const _0x18dd3e of _0x5738c9[_0x364756(0x1bc)]){_0x18dd3e['type']===_0x364756(0x201)&&_0x18dd3e['diff']&&(console['error']('\x0a'+a46_0x5b905a[_0x364756(0x1f1)]('---\x20'+_0x18dd3e[_0x364756(0x229)])),console['error'](_0x18dd3e['diff']));}if(!_0x5738c9[_0x364756(0x1e7)])return console['error'](a46_0x5b905a['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x364756(0x20e)](_0x465893,_0x5738c9[_0x364756(0x120)],_0x588499[_0x364756(0x1a1)]),0x0;if(_0x588499[_0x364756(0x142)])return console[_0x364756(0x219)](a46_0x5b905a[_0x364756(0x244)](_0x364756(0x24a))),0x0;if(!_0x588499['yes']){if(!isInteractive())return console['error'](a46_0x5b905a[_0x364756(0x202)](_0x364756(0x121)),_0x364756(0x128)),console[_0x364756(0x219)](a46_0x5b905a[_0x364756(0x11a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x172cd8=await confirmKey(_0x364756(0x255));if(!_0x172cd8)return console[_0x364756(0x219)](a46_0x5b905a[_0x364756(0x244)]('Cancelled'),_0x364756(0x2b3)),0x1;}const _0x5a80e5=await withSpinner('Pushing\x20project...',()=>_0x465893[_0x364756(0x164)][_0x364756(0x2cc)](_0x5738c9),{'verbose':_0x588499[_0x364756(0x21b)]}),_0x467912=_0x5a80e5[_0x364756(0x20c)];return console[_0x364756(0x219)](a46_0x5b905a['green']('✔\x20Push\x20complete')),console[_0x364756(0x219)](_0x364756(0x11e)+_0x467912['projectId']),console[_0x364756(0x219)]('\x20\x20Revision:\x20'+_0x467912['revision']),await this[_0x364756(0x20e)](_0x465893,_0x467912[_0x364756(0x120)],_0x588499[_0x364756(0x1a1)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]='workflow:clone';[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x1a7);async[a46_0x38b2ab(0x224)](_0x2af158){const _0xb28794=a46_0x38b2ab,{options:_0x2ab5ed,args:_0x75a026,tdx:_0x17670b}=_0x2af158,_0xb99e2a=this[_0xb28794(0x2b8)](_0x75a026,_0x2ab5ed),_0x231bea=_0x2ab5ed[_0xb28794(0x1ad)],_0x51651f=_0x2ab5ed[_0xb28794(0x1d0)],_0x4871b9=_0x2ab5ed['skipValidation'];if(!_0xb99e2a)return console[_0xb28794(0x219)](a46_0x5b905a['red']('Error:'),_0xb28794(0x1d3)),console[_0xb28794(0x219)](a46_0x5b905a[_0xb28794(0x11a)](_0xb28794(0x15c))),console[_0xb28794(0x219)](a46_0x5b905a[_0xb28794(0x11a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x231bea)return console[_0xb28794(0x219)](a46_0x5b905a[_0xb28794(0x202)](_0xb28794(0x25f)),_0xb28794(0x2b6)),console['error'](a46_0x5b905a[_0xb28794(0x11a)](_0xb28794(0x15c))),0x1;_0x2ab5ed[_0xb28794(0x21b)]&&(console[_0xb28794(0x219)](_0xb28794(0x1d6)+_0xb99e2a),console[_0xb28794(0x219)](_0xb28794(0x18f)+_0x231bea),_0x51651f&&console[_0xb28794(0x219)](_0xb28794(0x195)+_0x51651f),_0x2ab5ed[_0xb28794(0x142)]&&console[_0xb28794(0x219)](_0xb28794(0x232)),_0x4871b9&&console[_0xb28794(0x219)](_0xb28794(0x259)));const _0xd8f067=await withSpinner(_0xb28794(0x1f7),()=>_0x17670b[_0xb28794(0x164)][_0xb28794(0x252)](_0xb99e2a,_0x231bea,{'revision':_0x51651f,'skipValidation':_0x4871b9}),{'verbose':_0x2ab5ed[_0xb28794(0x21b)]}),_0xda66c=_0xd8f067[_0xb28794(0x20c)];console['error'](_0xb28794(0x141)+_0xda66c[_0xb28794(0x23d)]);_0xda66c[_0xb28794(0x2b0)]&&console[_0xb28794(0x219)](_0xb28794(0x134)+_0xda66c[_0xb28794(0x2b0)]);console[_0xb28794(0x219)](_0xb28794(0x18f)+_0xda66c[_0xb28794(0x2b7)]),console[_0xb28794(0x219)](_0xb28794(0x195)+_0xda66c[_0xb28794(0x1d0)]),console[_0xb28794(0x219)]('Files\x20to\x20upload:\x20'+_0xda66c[_0xb28794(0x1c5)]);_0xda66c['targetExists']&&(console[_0xb28794(0x219)](a46_0x5b905a[_0xb28794(0x244)](_0xb28794(0x2aa)+_0xda66c[_0xb28794(0x2b7)]+_0xb28794(0x13b)+_0xda66c[_0xb28794(0x137)]+')')),console['error'](a46_0x5b905a[_0xb28794(0x244)](_0xb28794(0x19e))));if(_0x2ab5ed['dryRun'])return console[_0xb28794(0x219)](a46_0x5b905a['yellow'](_0xb28794(0x2c0))),0x0;if(!_0x2ab5ed[_0xb28794(0x296)]){if(!isInteractive())return console[_0xb28794(0x219)](a46_0x5b905a[_0xb28794(0x202)](_0xb28794(0x121)),_0xb28794(0x128)),console[_0xb28794(0x219)](a46_0x5b905a['dim'](_0xb28794(0x2be))),0x1;const _0x558455=_0xda66c[_0xb28794(0x2b0)]||a46_0x985414[_0xb28794(0x14a)](_0xb99e2a),_0x2373f5=_0xda66c['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x231bea+_0xb28794(0x199):'\x0aClone\x20\x22'+_0x558455+_0xb28794(0x1fe)+_0x231bea+'\x22?',_0x44c4ec=await confirmKey(_0x2373f5);if(!_0x44c4ec)return console[_0xb28794(0x219)](a46_0x5b905a[_0xb28794(0x244)](_0xb28794(0x291))),0x1;}const _0x3bdaaa=await withSpinner(_0xda66c[_0xb28794(0x208)]?'Updating\x20'+_0x231bea+_0xb28794(0x15a):_0xb28794(0x184)+_0x231bea+_0xb28794(0x15a),()=>_0x17670b[_0xb28794(0x164)][_0xb28794(0x282)](_0xda66c),{'verbose':_0x2ab5ed['verbose']}),_0x42d3a7=_0x3bdaaa['data'];return console[_0xb28794(0x219)](a46_0x5b905a['green'](_0xda66c[_0xb28794(0x208)]?_0xb28794(0x19d):_0xb28794(0x135))),console['error'](_0xb28794(0x18e)+_0x42d3a7['newProjectName']),console[_0xb28794(0x219)]('\x20\x20Project\x20ID:\x20'+_0x42d3a7[_0xb28794(0x227)]),console[_0xb28794(0x219)]('\x20\x20Revision:\x20'+_0x42d3a7[_0xb28794(0x1d0)]),await this[_0xb28794(0x20e)](_0x17670b,_0x42d3a7[_0xb28794(0x2b7)],_0x2ab5ed['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x21a);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x234);async[a46_0x38b2ab(0x224)](_0xa49b6c){const _0x57badf=a46_0x38b2ab,{options:_0x2aed2e,args:_0x58c0da,tdx:_0x414387}=_0xa49b6c,_0x13ed49=_0x58c0da[0x0];if(!_0x13ed49)return console[_0x57badf(0x219)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x57badf(0x219)](_0x57badf(0x12c)),0x1;_0x2aed2e[_0x57badf(0x21b)]&&console[_0x57badf(0x219)](_0x57badf(0x26a)+_0x13ed49);if(!_0x2aed2e['yes']){if(!isInteractive())return console['error'](a46_0x5b905a[_0x57badf(0x202)](_0x57badf(0x121)),_0x57badf(0x128)),console[_0x57badf(0x219)](a46_0x5b905a[_0x57badf(0x11a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1bcd29=await confirmKey(_0x57badf(0x14d)+_0x13ed49+_0x57badf(0x223));if(!_0x1bcd29)return console[_0x57badf(0x219)](a46_0x5b905a[_0x57badf(0x244)](_0x57badf(0x291))),0x1;}const _0x3fa240=await withSpinner(_0x57badf(0x27d)+_0x13ed49+_0x57badf(0x15a),()=>_0x414387[_0x57badf(0x164)][_0x57badf(0x2b9)](_0x13ed49),{'verbose':_0x2aed2e[_0x57badf(0x21b)]}),_0x114e74=_0x3fa240[_0x57badf(0x20c)];return console[_0x57badf(0x219)](_0x57badf(0x241)+_0x114e74[_0x57badf(0x120)]),console[_0x57badf(0x219)](_0x57badf(0x11e)+_0x114e74['projectId']),0x0;}}export function parseKeyValue(_0x9ff542){const _0x1b0df5=a46_0x38b2ab,_0x577b08=_0x9ff542[_0x1b0df5(0x29d)]('=');if(_0x577b08===-0x1)throw new Error(_0x1b0df5(0x1c3)+_0x9ff542+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x2f2112=_0x9ff542[_0x1b0df5(0x19f)](0x0,_0x577b08),_0x144485=_0x9ff542['substring'](_0x577b08+0x1);if(!_0x2f2112)throw new Error(_0x1b0df5(0x17f));return{'key':_0x2f2112,'value':_0x144485};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x240);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x21c);async[a46_0x38b2ab(0x224)](_0x3671aa){const _0x5581b0=a46_0x38b2ab,{options:_0x129d69,args:_0x45459f,tdx:_0x53633e}=_0x3671aa,_0x5bf80e=this[_0x5581b0(0x22d)](_0x45459f,_0x129d69);if(!_0x5bf80e)return 0x1;_0x129d69[_0x5581b0(0x21b)]&&console['error'](_0x5581b0(0x26a)+_0x5bf80e);const _0x59e73b=await withSpinner(_0x5581b0(0x20d),()=>_0x53633e[_0x5581b0(0x164)][_0x5581b0(0x2c3)](_0x5bf80e),{'verbose':_0x129d69[_0x5581b0(0x21b)]}),{secrets:_0xf08204}=_0x59e73b['data'];return console[_0x5581b0(0x219)]('✔\x20Found\x20'+_0xf08204[_0x5581b0(0x1b6)]+_0x5581b0(0x29b)+(_0xf08204['length']!==0x1?'s':'')),await handleSDKOutput(_0xf08204,_0x129d69),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x19b);['description']=a46_0x38b2ab(0x29c);async[a46_0x38b2ab(0x224)](_0x52ed58){const _0x13a217=a46_0x38b2ab,{options:_0x2c07d1,args:_0x53db7c,tdx:_0x44f2c1}=_0x52ed58;let _0x5dc353,_0x2979a0;if(_0x53db7c[_0x13a217(0x1b6)]>=0x2)_0x5dc353=_0x53db7c[0x0],_0x2979a0=_0x53db7c[0x1];else{if(_0x53db7c[_0x13a217(0x1b6)]===0x1&&_0x2c07d1[_0x13a217(0x27a)])_0x5dc353=_0x2c07d1[_0x13a217(0x27a)],_0x2979a0=_0x53db7c[0x0];else return _0x53db7c[_0x13a217(0x1b6)]===0x1?(console[_0x13a217(0x219)](_0x13a217(0x274)),console[_0x13a217(0x219)](_0x13a217(0x299)),0x1):(console['error'](_0x13a217(0x2a0)),console['error'](_0x13a217(0x1b0)),0x1);}let _0xdc22ab,_0x4d0af5;try{({key:_0xdc22ab,value:_0x4d0af5}=parseKeyValue(_0x2979a0));}catch(_0x1efaf5){return _0x1efaf5 instanceof Error&&console[_0x13a217(0x219)](a46_0x5b905a['red'](_0x13a217(0x25f)),_0x1efaf5[_0x13a217(0x1f0)]),0x1;}_0x2c07d1[_0x13a217(0x21b)]&&(console[_0x13a217(0x219)](_0x13a217(0x26a)+_0x5dc353),console[_0x13a217(0x219)](_0x13a217(0x2bf)+_0xdc22ab));const _0x491e5e=await withSpinner(_0x13a217(0x220),()=>_0x44f2c1['workflow'][_0x13a217(0x24b)](_0x5dc353,_0xdc22ab,_0x4d0af5),{'verbose':_0x2c07d1['verbose']}),_0x56f0d5=_0x491e5e[_0x13a217(0x20c)];return console['error'](_0x13a217(0x15d)+_0x56f0d5[_0x13a217(0x292)]+_0x13a217(0x222)+_0x56f0d5['projectName']+'\x27'),(_0x2c07d1['json']||_0x2c07d1[_0x13a217(0x147)])&&await handleSingleObjectOutput(_0x56f0d5,_0x2c07d1),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x238);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x273);async[a46_0x38b2ab(0x224)](_0x48fbeb){const _0x307dab=a46_0x38b2ab,{options:_0x2812a9,args:_0x5501c2,tdx:_0xa5b7ff}=_0x48fbeb;let _0xaf366b,_0x30e51d;if(_0x5501c2[_0x307dab(0x1b6)]>=0x2)_0xaf366b=_0x5501c2[0x0],_0x30e51d=_0x5501c2[0x1];else{if(_0x5501c2['length']===0x1&&_0x2812a9[_0x307dab(0x27a)])_0xaf366b=_0x2812a9[_0x307dab(0x27a)],_0x30e51d=_0x5501c2[0x0];else return _0x5501c2['length']===0x1?(console[_0x307dab(0x219)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x307dab(0x299)),0x1):(console[_0x307dab(0x219)](_0x307dab(0x289)),console['error'](_0x307dab(0x11d)),0x1);}_0x2812a9[_0x307dab(0x21b)]&&(console[_0x307dab(0x219)](_0x307dab(0x26a)+_0xaf366b),console['error'](_0x307dab(0x2bf)+_0x30e51d));if(!_0x2812a9[_0x307dab(0x296)]){if(!isInteractive())return console['error'](a46_0x5b905a[_0x307dab(0x202)](_0x307dab(0x121)),_0x307dab(0x128)),console[_0x307dab(0x219)](a46_0x5b905a[_0x307dab(0x11a)](_0x307dab(0x2be))),0x1;const _0x4c5fed=await confirmKey(_0x307dab(0x276)+_0x30e51d+'\x27\x20from\x20project\x20\x27'+_0xaf366b+'\x27?');if(!_0x4c5fed)return console[_0x307dab(0x219)](a46_0x5b905a[_0x307dab(0x244)](_0x307dab(0x291))),0x1;}const _0x58130b=await withSpinner(_0x307dab(0x126),()=>_0xa5b7ff[_0x307dab(0x164)]['deleteSecret'](_0xaf366b,_0x30e51d),{'verbose':_0x2812a9['verbose']}),_0x5010d1=_0x58130b[_0x307dab(0x20c)];return console[_0x307dab(0x219)](_0x307dab(0x15d)+_0x5010d1[_0x307dab(0x292)]+_0x307dab(0x1cc)+_0x5010d1[_0x307dab(0x120)]+'\x27'),(_0x2812a9[_0x307dab(0x1b5)]||_0x2812a9[_0x307dab(0x147)])&&await handleSingleObjectOutput(_0x5010d1,_0x2812a9),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x489cf9){const _0x16eea1=a46_0x38b2ab,_0x25d40f=Math[_0x16eea1(0x2ac)](_0x489cf9/0x3e8),_0x2f4624=Math[_0x16eea1(0x2ac)](_0x25d40f/0x3c),_0x6829ec=Math['floor'](_0x2f4624/0x3c),_0x3d56d2=Math[_0x16eea1(0x2ac)](_0x6829ec/0x18);if(_0x3d56d2>0x0){const _0x41b1b7=_0x6829ec%0x18;return _0x41b1b7>0x0?_0x3d56d2+'d\x20'+_0x41b1b7+'h':_0x3d56d2+'d';}else{if(_0x6829ec>0x0){const _0x476302=_0x2f4624%0x3c;return _0x476302>0x0?_0x6829ec+'h\x20'+_0x476302+'m':_0x6829ec+'h';}else{if(_0x2f4624>0x0){const _0x330ee6=_0x25d40f%0x3c;return _0x330ee6>0x0?_0x2f4624+'m\x20'+_0x330ee6+'s':_0x2f4624+'m';}else return _0x25d40f+'s';}}}function formatTimestamp(_0xf9f5d5,_0x3fa7aa){const _0x280b13=a46_0x38b2ab,_0x483b68=new Date(_0xf9f5d5),_0x381a30=String(_0x483b68[_0x280b13(0x1f9)]())[_0x280b13(0x264)](0x2,'0'),_0x47ee3c=String(_0x483b68[_0x280b13(0x263)]())[_0x280b13(0x264)](0x2,'0'),_0x5cbff6=_0x381a30+':'+_0x47ee3c,_0x51c8fa=_0x483b68['getFullYear']()===_0x3fa7aa[_0x280b13(0x266)]()&&_0x483b68['getMonth']()===_0x3fa7aa[_0x280b13(0x1fc)]()&&_0x483b68[_0x280b13(0x1c2)]()===_0x3fa7aa[_0x280b13(0x1c2)]();if(_0x51c8fa)return _0x5cbff6;else{const _0x3c455b=String(_0x483b68[_0x280b13(0x1fc)]()+0x1)[_0x280b13(0x264)](0x2,'0'),_0xb074a9=String(_0x483b68[_0x280b13(0x1c2)]())['padStart'](0x2,'0');return _0x3c455b+'-'+_0xb074a9+'\x20'+_0x5cbff6;}}function formatDate(_0x1f4af5){const _0x26658c=a46_0x38b2ab,_0x4f94ec=_0x1f4af5['getFullYear'](),_0x145dc6=String(_0x1f4af5[_0x26658c(0x1fc)]()+0x1)[_0x26658c(0x264)](0x2,'0'),_0x1f7454=String(_0x1f4af5[_0x26658c(0x1c2)]())[_0x26658c(0x264)](0x2,'0');return _0x4f94ec+'-'+_0x145dc6+'-'+_0x1f7454;}function getTaskStateIcon(_0x51ae31){const _0x147de6={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x147de6[_0x51ae31]||'⚪';}function getBarChar(_0x26f21d){const _0x292968=a46_0x38b2ab;return _0x26f21d===_0x292968(0x219)||_0x26f21d===_0x292968(0x280)?'×':'─';}function getBarColor(_0x2a8e9d){const _0x45c5aa=a46_0x38b2ab,_0x204ec3={'success':a46_0x5b905a[_0x45c5aa(0x155)],'error':a46_0x5b905a[_0x45c5aa(0x202)],'group_error':a46_0x5b905a[_0x45c5aa(0x202)],'running':a46_0x5b905a[_0x45c5aa(0x214)],'blocked':a46_0x5b905a[_0x45c5aa(0x244)],'planned':a46_0x5b905a[_0x45c5aa(0x11a)],'canceling':a46_0x5b905a[_0x45c5aa(0x244)]};return _0x204ec3[_0x2a8e9d]||a46_0x5b905a[_0x45c5aa(0x28a)];}function parseTaskName(_0x27e698){const _0x18026a=a46_0x38b2ab;let _0x42df6b=_0x27e698[_0x18026a(0x211)](/^\++/,'');const _0x2e715e=_0x42df6b[_0x18026a(0x2c8)]('+'),_0x14a20f=_0x2e715e[_0x18026a(0x1b6)]>0x1?_0x2e715e[_0x18026a(0x1b6)]-0x2:0x0,_0x19d484=_0x2e715e[_0x2e715e[_0x18026a(0x1b6)]-0x1]||_0x42df6b;return{'level':_0x14a20f,'name':'+'+_0x19d484};}function truncateTaskName(_0x2879e2,_0xcb2db3){const _0x213474=stringWidth(_0x2879e2);if(_0x213474<=_0xcb2db3)return _0x2879e2;let _0x2ac12d=_0x2879e2;while(stringWidth(_0x2ac12d+'…')>_0xcb2db3&&_0x2ac12d['length']>0x0){_0x2ac12d=_0x2ac12d['slice'](0x0,-0x1);}return _0x2ac12d+'…';}function calculateTimeScale(_0xa6ad0e,_0x4f2225){const _0x40c454=a46_0x38b2ab;return{'startTime':_0xa6ad0e[_0x40c454(0x1ee)],'endTime':_0xa6ad0e[_0x40c454(0x1d1)],'durationMs':_0xa6ad0e[_0x40c454(0x2c6)],'msPerChar':_0xa6ad0e[_0x40c454(0x2c6)]/_0x4f2225};}function timeToPosition(_0x1ed0a5,_0x2a9176,_0x47b743){const _0x4e8e9b=a46_0x38b2ab,_0x114cd7=_0x1ed0a5-_0x2a9176[_0x4e8e9b(0x17e)],_0x4be156=Math[_0x4e8e9b(0x2ac)](_0x114cd7/_0x2a9176[_0x4e8e9b(0x181)]);return Math[_0x4e8e9b(0x1ff)](0x0,Math[_0x4e8e9b(0x12a)](_0x4be156,_0x47b743));}function renderTimeAxis(_0x12150a,_0x1ce8d2){const _0x281cfe=a46_0x38b2ab,_0x2543de=Math[_0x281cfe(0x12a)](TIMELINE_CONFIG[_0x281cfe(0x22a)],Math[_0x281cfe(0x1ff)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x281cfe(0x2ac)](_0x1ce8d2/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x451c4b=_0x12150a[_0x281cfe(0x2ba)]/(_0x2543de-0x1),_0xfef750=new Date(_0x12150a[_0x281cfe(0x17e)]),_0x14b711=[];for(let _0x1ef61a=0x0;_0x1ef61a<_0x2543de;_0x1ef61a++){const _0x1f2bda=_0x12150a[_0x281cfe(0x17e)]+_0x1ef61a*_0x451c4b,_0x1b7188=timeToPosition(_0x1f2bda,_0x12150a,_0x1ce8d2),_0x103765=formatTimestamp(_0x1f2bda,_0xfef750);_0x14b711[_0x281cfe(0x28b)]({'pos':_0x1b7188,'text':_0x103765});}const _0x16eaa8=new Array(_0x1ce8d2)[_0x281cfe(0x293)]('\x20');let _0x6004cd=-0x1;for(const {pos:_0x20c349,text:_0x53e55a}of _0x14b711){let _0x2f3bb7=Math[_0x281cfe(0x1ff)](0x0,_0x20c349-Math[_0x281cfe(0x2ac)](_0x53e55a['length']/0x2));_0x2f3bb7<=_0x6004cd+TIMELINE_CONFIG[_0x281cfe(0x114)]&&(_0x2f3bb7=_0x6004cd+TIMELINE_CONFIG[_0x281cfe(0x114)]+0x1);_0x2f3bb7+_0x53e55a['length']>_0x1ce8d2&&(_0x2f3bb7=_0x1ce8d2-_0x53e55a[_0x281cfe(0x1b6)]);if(_0x2f3bb7>=0x0&&_0x2f3bb7+_0x53e55a[_0x281cfe(0x1b6)]<=_0x1ce8d2&&_0x2f3bb7>_0x6004cd){for(let _0x25cd63=0x0;_0x25cd63<_0x53e55a[_0x281cfe(0x1b6)];_0x25cd63++){_0x16eaa8[_0x2f3bb7+_0x25cd63]=_0x53e55a[_0x25cd63];}_0x6004cd=_0x2f3bb7+_0x53e55a[_0x281cfe(0x1b6)]-0x1;}}return _0x16eaa8[_0x281cfe(0x2af)]('');}function renderTaskRow(_0x707918,_0x317e29,_0x1e8f74,_0x125ea4){const _0x59e29d=a46_0x38b2ab,{level:_0x48b935,name:_0x23cc07}=parseTaskName(_0x707918[_0x59e29d(0x1ad)]),_0x28f22d='\x20'[_0x59e29d(0x160)](_0x48b935),_0x36e1e1=_0x707918['window']?'('+formatElapsed(_0x707918[_0x59e29d(0x1be)][_0x59e29d(0x2c6)])+')':'',_0x21070c=stringWidth(_0x36e1e1),_0x3e8c14=_0x48b935*0x1,_0x128351=_0x125ea4-_0x3e8c14-_0x21070c-0x1,_0xfbf862=truncateTaskName(_0x23cc07,_0x128351),_0x284a8f=_0x28f22d+_0xfbf862,_0x34a4a4=stringWidth(_0x284a8f),_0x4526eb=_0x125ea4-_0x34a4a4-_0x21070c,_0x545453=_0x284a8f+'\x20'[_0x59e29d(0x160)](Math[_0x59e29d(0x1ff)](0x1,_0x4526eb))+a46_0x5b905a[_0x59e29d(0x11a)](_0x36e1e1),_0xe19b05=getTaskStateIcon(_0x707918[_0x59e29d(0x1bd)]),_0x5704c8=new Array(_0x1e8f74)[_0x59e29d(0x293)]('\x20');if(_0x707918[_0x59e29d(0x1be)]){const _0x209372=timeToPosition(_0x707918[_0x59e29d(0x1be)][_0x59e29d(0x1ee)],_0x317e29,_0x1e8f74),_0x3fc773=timeToPosition(_0x707918[_0x59e29d(0x1be)][_0x59e29d(0x1d1)],_0x317e29,_0x1e8f74),_0x56dd5c=getBarChar(_0x707918[_0x59e29d(0x1bd)]),_0x47cda9=Math[_0x59e29d(0x1ff)](_0x209372+0x1,_0x3fc773);for(let _0x50142e=_0x209372;_0x50142e<Math[_0x59e29d(0x12a)](_0x47cda9,_0x1e8f74);_0x50142e++){_0x5704c8[_0x50142e]=_0x56dd5c;}}const _0x3f49e9=getBarColor(_0x707918[_0x59e29d(0x1bd)]),_0x52661f=_0x5704c8['map'](_0x477fd1=>_0x477fd1==='\x20'?'\x20':_0x3f49e9(_0x477fd1))['join']('');return _0xe19b05+'\x20'+_0x545453+'│'+_0x52661f+'│';}function calculateStats(_0x4d74b6){const _0x2b91fd=a46_0x38b2ab,_0x2ca943={'total':_0x4d74b6[_0x2b91fd(0x1b6)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4f7651 of _0x4d74b6){if(_0x4f7651[_0x2b91fd(0x1bd)]==='success')_0x2ca943[_0x2b91fd(0x1fd)]++;else{if(_0x4f7651[_0x2b91fd(0x1bd)]==='error'||_0x4f7651[_0x2b91fd(0x1bd)]==='group_error')_0x2ca943[_0x2b91fd(0x219)]++;else _0x4f7651[_0x2b91fd(0x1bd)]===_0x2b91fd(0x139)?_0x2ca943[_0x2b91fd(0x139)]++:_0x2ca943['pending']++;}}return _0x2ca943;}function formatStats(_0x83cb38){const _0x42a9f7=a46_0x38b2ab;return['Total:\x20'+_0x83cb38[_0x42a9f7(0x2a2)],'✅\x20'+_0x83cb38['success'],'❌\x20'+_0x83cb38[_0x42a9f7(0x219)],_0x42a9f7(0x1af)+_0x83cb38[_0x42a9f7(0x139)],'⏳\x20'+_0x83cb38[_0x42a9f7(0x170)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a46_0x38b2ab(0x1ad)]=a46_0x38b2ab(0x172);[a46_0x38b2ab(0x18b)]=a46_0x38b2ab(0x196);async[a46_0x38b2ab(0x224)](_0x3d23de){const _0x5bfb6f=a46_0x38b2ab,{options:_0x52b669,args:_0x1eced1,tdx:_0x582ae6}=_0x3d23de;let _0x493d3e,_0x3804d,_0x2d65de=![];if(_0x1eced1[0x0]){if(_0x1eced1[0x0][_0x5bfb6f(0x1a8)]('.')){const _0x5290b5=this[_0x5bfb6f(0x1da)](_0x1eced1,_0x52b669);if(!_0x5290b5)return 0x1;_0x493d3e=_0x5290b5[_0x5bfb6f(0x120)],_0x3804d=_0x5290b5['workflowName'];}else{_0x3804d=_0x1eced1[0x0],_0x493d3e=_0x52b669[_0x5bfb6f(0x27a)];if(!_0x493d3e)return console[_0x5bfb6f(0x219)](a46_0x5b905a[_0x5bfb6f(0x202)](_0x5bfb6f(0x25f)),_0x5bfb6f(0x131)),0x1;_0x2d65de=!![];}}else{const _0x31004f=this[_0x5bfb6f(0x1da)](_0x1eced1,_0x52b669);if(!_0x31004f)return 0x1;_0x493d3e=_0x31004f['projectName'],_0x3804d=_0x31004f[_0x5bfb6f(0x129)];}if(_0x52b669[_0x5bfb6f(0x21b)]){if(_0x493d3e&&_0x3804d)console['error'](_0x5bfb6f(0x23b)+_0x493d3e+'.'+_0x3804d);else _0x493d3e&&console[_0x5bfb6f(0x219)](_0x5bfb6f(0x209)+_0x493d3e);}const _0x49ce6a=_0x52b669[_0x5bfb6f(0x2ae)],_0x4d2da9=_0x52b669['sessionId'];if(_0x49ce6a){_0x4d2da9&&console[_0x5bfb6f(0x219)](a46_0x5b905a[_0x5bfb6f(0x244)](_0x5bfb6f(0x13e)),_0x5bfb6f(0x26f));const _0x5a8a93=_0x52b669[_0x5bfb6f(0x118)];return _0x5a8a93?await this[_0x5bfb6f(0x1cb)](_0x3d23de,_0x49ce6a):await this[_0x5bfb6f(0x113)](_0x3d23de,_0x49ce6a,_0x52b669),0x0;}if(_0x4d2da9){const _0x28a541=await withSpinner(_0x5bfb6f(0x18c),()=>_0x582ae6[_0x5bfb6f(0x164)][_0x5bfb6f(0x17c)]({'projectName':_0x493d3e,'workflowName':_0x3804d,'limit':0x64}),{'verbose':_0x52b669['verbose']}),_0x418bde=_0x28a541['data'][_0x5bfb6f(0x13a)](_0x4fe204=>_0x4fe204['id']===_0x4d2da9);if(!_0x418bde)return console[_0x5bfb6f(0x219)](a46_0x5b905a[_0x5bfb6f(0x202)](_0x5bfb6f(0x25f)),_0x5bfb6f(0x212)+_0x4d2da9),0x1;if(!_0x418bde['lastAttempt']?.['id'])return console[_0x5bfb6f(0x219)](a46_0x5b905a[_0x5bfb6f(0x202)](_0x5bfb6f(0x25f)),'Session\x20'+_0x4d2da9+'\x20has\x20no\x20attempts'),0x1;const _0x46b87a=_0x418bde[_0x5bfb6f(0x12e)]['id'];_0x52b669['verbose']&&console[_0x5bfb6f(0x219)](_0x5bfb6f(0x22c)+_0x46b87a+_0x5bfb6f(0x2c4)+_0x4d2da9);const _0x87faf2=_0x52b669['follow'];return _0x87faf2?await this[_0x5bfb6f(0x1cb)](_0x3d23de,_0x46b87a):await this[_0x5bfb6f(0x113)](_0x3d23de,_0x46b87a,_0x52b669),0x0;}const _0x9e87af=await withSpinner(_0x5bfb6f(0x2b2),()=>_0x582ae6['workflow'][_0x5bfb6f(0x17c)]({'projectName':_0x493d3e,'workflowName':_0x3804d,'limit':_0x52b669['limit']||0x32}),{'verbose':_0x52b669[_0x5bfb6f(0x21b)]}),_0x51856e=_0x9e87af[_0x5bfb6f(0x20c)];if(_0x51856e[_0x5bfb6f(0x1b6)]===0x0){if(_0x493d3e&&_0x3804d)console[_0x5bfb6f(0x219)](_0x5bfb6f(0x253)+_0x493d3e+'.'+_0x3804d);else _0x493d3e?console[_0x5bfb6f(0x219)](_0x5bfb6f(0x285)+_0x493d3e):(console[_0x5bfb6f(0x219)]('No\x20workflow\x20sessions\x20found'),console[_0x5bfb6f(0x219)](a46_0x5b905a['dim'](_0x5bfb6f(0x1e6))));return 0x0;}_0x51856e[_0x5bfb6f(0x251)]((_0x3e2142,_0x3aab8a)=>{const _0x5aafb5=_0x5bfb6f,_0x4a5ef2=_0x3e2142[_0x5aafb5(0x1c6)]||'',_0x3f5c2c=_0x3aab8a[_0x5aafb5(0x1c6)]||'';return _0x3f5c2c[_0x5aafb5(0x2a5)](_0x4a5ef2);});if(_0x52b669[_0x5bfb6f(0x1b5)]||_0x52b669[_0x5bfb6f(0x147)])return await handleSDKOutput(_0x51856e,_0x52b669),0x0;let _0xe64efa;if(_0x2d65de){const _0x950d6=_0x51856e[0x0];if(!_0x950d6[_0x5bfb6f(0x12e)]?.['id'])return console[_0x5bfb6f(0x219)](_0x5bfb6f(0x144)),0x0;_0xe64efa=_0x950d6[_0x5bfb6f(0x12e)]['id'],_0x52b669[_0x5bfb6f(0x21b)]&&console[_0x5bfb6f(0x219)](_0x5bfb6f(0x2a1)+_0x950d6[_0x5bfb6f(0x1c6)]);}else{const _0x32fc93=_0x51856e[_0x5bfb6f(0x1c8)](_0x2c2b9c=>{const _0x4cb119=_0x5bfb6f,_0x562e35=getAttemptStatusDisplay(_0x2c2b9c[_0x4cb119(0x12e)]);return{'title':_0x2c2b9c[_0x4cb119(0x1d8)]?.[_0x4cb119(0x1ad)]+'.'+_0x2c2b9c[_0x4cb119(0x164)]?.[_0x4cb119(0x1ad)]+_0x4cb119(0x2b4)+_0x2c2b9c[_0x4cb119(0x1c6)]+'\x20'+_0x562e35[_0x4cb119(0x15f)],'value':_0x2c2b9c['lastAttempt']?.['id']||'','description':_0x562e35[_0x4cb119(0x17a)]};}),_0x538949=await a46_0x143713({'type':_0x5bfb6f(0x130),'name':_0x5bfb6f(0x2ae),'message':_0x5bfb6f(0x1c0),'choices':_0x32fc93['filter'](_0x198868=>_0x198868['value']!=='')});if(!_0x538949[_0x5bfb6f(0x2ae)])return 0x0;_0xe64efa=_0x538949['attemptId'];}const _0x4167e8=_0x52b669[_0x5bfb6f(0x118)];return _0x4167e8?await this[_0x5bfb6f(0x1cb)](_0x3d23de,_0xe64efa):await this[_0x5bfb6f(0x113)](_0x3d23de,_0xe64efa,_0x52b669),0x0;}async[a46_0x38b2ab(0x113)](_0x5a46ba,_0x54ae72,_0x262f1b){const _0x51e397=a46_0x38b2ab,{tdx:_0xf20cf3}=_0x5a46ba;let _0x166d86,_0x58167e;try{[_0x166d86,_0x58167e]=await Promise[_0x51e397(0x24d)]([_0xf20cf3[_0x51e397(0x164)][_0x51e397(0x1ec)](_0x54ae72),_0xf20cf3['workflow']['tasks'](_0x54ae72,![])]);}catch(_0x4ab31b){console[_0x51e397(0x219)](a46_0x5b905a[_0x51e397(0x202)](_0x51e397(0x22b)));_0x262f1b[_0x51e397(0x21b)]&&console[_0x51e397(0x219)](_0x4ab31b);throw _0x4ab31b;}if(_0x262f1b['json']||_0x262f1b[_0x51e397(0x147)]){const _0x2c6025=this[_0x51e397(0x23c)](_0x166d86,_0x58167e);await handleSDKOutput([_0x2c6025],_0x262f1b);return;}const _0x2c29dd=_0xf20cf3[_0x51e397(0x21d)][_0x51e397(0x1a1)],_0x3ebfd8=this['renderTimeline'](_0x166d86,_0x58167e,_0x2c29dd);console[_0x51e397(0x29e)](_0x3ebfd8);}async[a46_0x38b2ab(0x1cb)](_0x137191,_0x49c3fe){const _0x5d6488=a46_0x38b2ab,{tdx:_0x3adc59}=_0x137191,_0xebb3a5=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x38d8aa=TIMELINE_CONFIG[_0x5d6488(0x198)];let _0x4e6ed2=0x0;while(_0x4e6ed2<_0x38d8aa){process[_0x5d6488(0x140)][_0x5d6488(0x1f4)]&&process[_0x5d6488(0x140)][_0x5d6488(0x179)]('\x1bc');let _0x35f3c7,_0x1da39c;try{[_0x35f3c7,_0x1da39c]=await Promise[_0x5d6488(0x24d)]([_0x3adc59[_0x5d6488(0x164)][_0x5d6488(0x1ec)](_0x49c3fe),_0x3adc59['workflow'][_0x5d6488(0x283)](_0x49c3fe,![])]);}catch(_0x5f2b3f){console['error'](a46_0x5b905a['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x4e6ed2>0x0&&console[_0x5d6488(0x219)](a46_0x5b905a[_0x5d6488(0x11a)](_0x5d6488(0x190)+_0x4e6ed2));throw _0x5f2b3f;}const _0x4f4826=_0x3adc59[_0x5d6488(0x21d)][_0x5d6488(0x1a1)],_0x1dc540=this['renderTimeline'](_0x35f3c7,_0x1da39c,_0x4f4826);console[_0x5d6488(0x29e)](_0x1dc540);const _0x3d4876=_0x35f3c7[_0x5d6488(0x13c)]&&_0x1da39c[_0x5d6488(0x1ed)](_0x48dc3e=>_0x48dc3e[_0x5d6488(0x1bd)]!==_0x5d6488(0x139)&&_0x48dc3e[_0x5d6488(0x1bd)]!=='planned');if(_0x3d4876){console[_0x5d6488(0x219)](a46_0x5b905a[_0x5d6488(0x155)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x5d6488(0x219)](a46_0x5b905a[_0x5d6488(0x11a)](_0x5d6488(0x1b2)+_0x4e6ed2*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x42927b=>setTimeout(_0x42927b,_0xebb3a5)),_0x4e6ed2++;}_0x4e6ed2>=_0x38d8aa&&console[_0x5d6488(0x219)](a46_0x5b905a[_0x5d6488(0x244)](_0x5d6488(0x11b)));}[a46_0x38b2ab(0x12f)](_0x37a6ae,_0x14fa41,_0x2d2a8e){const _0x3f5ed7=a46_0x38b2ab,_0x2d20a4=[],_0x3e3b87=TIMELINE_CONFIG[_0x3f5ed7(0x162)],_0x105e12=0x5,_0x13bcf3=process[_0x3f5ed7(0x140)][_0x3f5ed7(0x13d)]||0x78,_0x6bfa39=_0x13bcf3-_0x3e3b87-_0x105e12,_0x1bd73f=Math[_0x3f5ed7(0x1ff)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math['min'](_0x6bfa39,TIMELINE_CONFIG[_0x3f5ed7(0x17b)])),_0x42f055=new Date(_0x37a6ae[_0x3f5ed7(0x1a2)])[_0x3f5ed7(0x1b4)](),_0xad3f11=_0x37a6ae[_0x3f5ed7(0x2c5)]?new Date(_0x37a6ae[_0x3f5ed7(0x2c5)])[_0x3f5ed7(0x1b4)]():Date[_0x3f5ed7(0x19a)](),_0x12ee6b={'start':_0x42f055,'end':_0xad3f11,'duration':_0xad3f11-_0x42f055},_0x3a2b80=new Map(),_0x5897e9=[];for(const _0x130f42 of _0x14fa41){if(_0x130f42[_0x3f5ed7(0x1b9)]){const _0x26d20f=new Date(_0x130f42[_0x3f5ed7(0x1b9)])[_0x3f5ed7(0x1b4)](),_0xc17a43=_0x130f42['updatedAt']?new Date(_0x130f42['updatedAt'])['getTime']():Date[_0x3f5ed7(0x19a)](),_0x4325f4={'start':_0x26d20f,'end':_0xc17a43,'duration':_0xc17a43-_0x26d20f};_0x3a2b80[_0x3f5ed7(0x18d)](_0x130f42['id'],_0x4325f4),_0x5897e9[_0x3f5ed7(0x28b)]({'name':_0x130f42[_0x3f5ed7(0x2c7)],'state':_0x130f42['state']||_0x3f5ed7(0x188),'window':_0x4325f4});}else _0x5897e9[_0x3f5ed7(0x28b)]({'name':_0x130f42[_0x3f5ed7(0x2c7)],'state':_0x130f42['state']||_0x3f5ed7(0x116),'window':undefined});}_0x5897e9[_0x3f5ed7(0x251)]((_0x187d27,_0x1b3186)=>{const _0x7c99f1=_0x3f5ed7;if(!_0x187d27[_0x7c99f1(0x1be)])return 0x1;if(!_0x1b3186[_0x7c99f1(0x1be)])return-0x1;return _0x187d27[_0x7c99f1(0x1be)]['start']-_0x1b3186[_0x7c99f1(0x1be)][_0x7c99f1(0x1ee)];});const _0x4fdc05=_0x5897e9['length'],_0x14c7d4=_0x4fdc05>TIMELINE_CONFIG[_0x3f5ed7(0x16e)];_0x14c7d4&&_0x5897e9[_0x3f5ed7(0x157)](TIMELINE_CONFIG[_0x3f5ed7(0x16e)]);const _0x5861a8=calculateTimeScale(_0x12ee6b,_0x1bd73f),_0x11a4c5=_0x37a6ae[_0x3f5ed7(0x13c)]?_0x37a6ae[_0x3f5ed7(0x1fd)]?a46_0x5b905a['green']('success'):a46_0x5b905a[_0x3f5ed7(0x202)]('error'):a46_0x5b905a[_0x3f5ed7(0x214)](_0x3f5ed7(0x139)),_0x3b68f8=_0x37a6ae[_0x3f5ed7(0x1d8)]?.['id'],_0x52c827=_0x37a6ae['sessionId'];let _0x27e587;if(_0x3b68f8&&_0x52c827){const _0x16a58a=getWorkflowAttemptUrl(_0x2d2a8e,_0x3b68f8,_0x52c827,_0x37a6ae['id']);_0x27e587=hyperlink(a46_0x5b905a[_0x3f5ed7(0x11a)](_0x37a6ae['id']),_0x16a58a);}else _0x27e587=a46_0x5b905a[_0x3f5ed7(0x11a)](_0x37a6ae['id']);_0x2d20a4[_0x3f5ed7(0x28b)](_0x3f5ed7(0x262)+_0x27e587+'\x20-\x20'+_0x11a4c5+_0x3f5ed7(0x2b4)+formatElapsed(_0x12ee6b[_0x3f5ed7(0x2c6)]));if(_0x5897e9[_0x3f5ed7(0x1b6)]>0x0){const _0x589937=renderTimeAxis(_0x5861a8,_0x1bd73f),_0x3ba472=new Date(_0x12ee6b[_0x3f5ed7(0x1ee)]),_0x3e733a=formatDate(_0x3ba472),_0x253f0a=TIMELINE_CONFIG[_0x3f5ed7(0x271)]+TIMELINE_CONFIG['ICON_SPACING']+_0x3e3b87,_0x349627=_0x3e733a[_0x3f5ed7(0x264)](_0x253f0a),_0xe46f4b=a46_0x5b905a['dim'](_0x349627);_0x2d20a4[_0x3f5ed7(0x28b)](_0xe46f4b+'\x20'+_0x589937);for(const _0x1cb8ac of _0x5897e9){_0x2d20a4[_0x3f5ed7(0x28b)](renderTaskRow(_0x1cb8ac,_0x5861a8,_0x1bd73f,_0x3e3b87));}const _0x25fec5=calculateStats(_0x5897e9);_0x2d20a4[_0x3f5ed7(0x28b)](formatStats(_0x25fec5)),_0x14c7d4&&_0x2d20a4['push'](a46_0x5b905a[_0x3f5ed7(0x244)](_0x3f5ed7(0x28d)+TIMELINE_CONFIG[_0x3f5ed7(0x16e)]+_0x3f5ed7(0x19c)+_0x4fdc05+_0x3f5ed7(0x25d))),_0x2d20a4['push'](''),_0x2d20a4['push'](a46_0x5b905a[_0x3f5ed7(0x11a)](_0x3f5ed7(0x256))+(_0x3f5ed7(0x186)+_0x37a6ae['id']+_0x3f5ed7(0x1b3))+a46_0x5b905a[_0x3f5ed7(0x11a)](_0x3f5ed7(0x16c)));}else _0x2d20a4[_0x3f5ed7(0x28b)](_0x3f5ed7(0x26d));return _0x2d20a4[_0x3f5ed7(0x2af)]('\x0a');}['buildTimelineData'](_0x1dc31d,_0x422680){const _0x289862=a46_0x38b2ab,_0x35467e=new Date(_0x1dc31d[_0x289862(0x1a2)])[_0x289862(0x1b4)](),_0x3f2693=_0x1dc31d[_0x289862(0x2c5)]?new Date(_0x1dc31d['finishedAt'])[_0x289862(0x1b4)]():Date[_0x289862(0x19a)](),_0x42a7dc=_0x3f2693-_0x35467e,_0x56d7d2=[];for(const _0x2f825e of _0x422680){if(_0x2f825e['startedAt']){const _0x16cb86=new Date(_0x2f825e[_0x289862(0x1b9)])[_0x289862(0x1b4)](),_0x3a8537=_0x2f825e[_0x289862(0x1dc)]?new Date(_0x2f825e[_0x289862(0x1dc)])['getTime']():Date[_0x289862(0x19a)]();_0x56d7d2[_0x289862(0x28b)]({'name':_0x2f825e[_0x289862(0x2c7)],'state':_0x2f825e[_0x289862(0x1bd)]||_0x289862(0x188),'window':{'start':_0x16cb86,'end':_0x3a8537,'duration':_0x3a8537-_0x16cb86}});}else _0x56d7d2[_0x289862(0x28b)]({'name':_0x2f825e[_0x289862(0x2c7)],'state':_0x2f825e[_0x289862(0x1bd)]||_0x289862(0x116),'window':undefined});}const _0x5b0d80=calculateStats(_0x56d7d2);return{'attempt':{'id':_0x1dc31d['id'],'status':_0x1dc31d[_0x289862(0x13c)]?_0x1dc31d[_0x289862(0x1fd)]?_0x289862(0x1fd):_0x289862(0x219):'running','createdAt':_0x1dc31d['createdAt'],'finishedAt':_0x1dc31d[_0x289862(0x2c5)],'duration_ms':_0x42a7dc},'tasks':_0x56d7d2[_0x289862(0x1c8)](_0x3c0a41=>({'name':_0x3c0a41['name'],'state':_0x3c0a41['state'],'startedAt':_0x3c0a41['window']?new Date(_0x3c0a41[_0x289862(0x1be)][_0x289862(0x1ee)])[_0x289862(0x127)]():null,'updatedAt':_0x3c0a41[_0x289862(0x1be)]?new Date(_0x3c0a41['window'][_0x289862(0x1d1)])[_0x289862(0x127)]():null,'duration_ms':_0x3c0a41[_0x289862(0x1be)]?.['duration']||null})),'stats':_0x5b0d80};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15fb5a,_0x4f4aa3){const _0x1e5a7d=a47_0x3a4d,_0x5c2847=_0x15fb5a();while(!![]){try{const _0x423981=parseInt(_0x1e5a7d(0x1e5))/0x1+-parseInt(_0x1e5a7d(0x1e3))/0x2*(parseInt(_0x1e5a7d(0x1e9))/0x3)+parseInt(_0x1e5a7d(0x1ef))/0x4+parseInt(_0x1e5a7d(0x1f4))/0x5*(-parseInt(_0x1e5a7d(0x1f1))/0x6)+parseInt(_0x1e5a7d(0x1f2))/0x7+-parseInt(_0x1e5a7d(0x1ed))/0x8*(-parseInt(_0x1e5a7d(0x1f6))/0x9)+-parseInt(_0x1e5a7d(0x1e7))/0xa;if(_0x423981===_0x4f4aa3)break;else _0x5c2847['push'](_0x5c2847['shift']());}catch(_0x37e9cb){_0x5c2847['push'](_0x5c2847['shift']());}}}(a47_0x317e,0x9b9c1));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 _0x1693d0=a47_0x3a4d,_0x2e682f=getVersion(),_0xbba5e=platform(),_0x4cdd56=process[_0x1693d0(0x1f0)][_0x1693d0(0x1f3)]('v','');return _0x1693d0(0x1f5)+_0x2e682f+'\x20('+_0xbba5e+_0x1693d0(0x1ec)+_0x4cdd56+')';}function a47_0x3a4d(_0x4ef3d5,_0x5531ba){_0x4ef3d5=_0x4ef3d5-0x1e3;const _0x317ebe=a47_0x317e();let _0x3a4d7e=_0x317ebe[_0x4ef3d5];return _0x3a4d7e;}export function getAuthHeaders(_0x19ecbe,_0x410ea3){const _0x33b1c6=a47_0x3a4d,_0x232dbc=getVersion(),_0x5c2488={'User-Agent':getUserAgent(),'X-TD-Client':_0x33b1c6(0x1eb),'X-TD-Client-Version':_0x232dbc};return _0x410ea3&&(_0x5c2488[_0x33b1c6(0x1e8)]=_0x33b1c6(0x1e6)+_0x410ea3),_0x5c2488;}export function toHeaderRecord(_0x1df4c1){const _0x2840d5=a47_0x3a4d,_0x21d04c={};for(const [_0x5746c6,_0x32545d]of Object[_0x2840d5(0x1e4)](_0x1df4c1)){_0x32545d!==undefined&&(_0x21d04c[_0x5746c6]=_0x32545d);}return _0x21d04c;}export function getTrinoHeaders(_0x3be850,_0x32c837){const _0xf85ff7=a47_0x3a4d,_0x4dd202=getAuthHeaders(_0x3be850,_0x32c837),_0x21a5c1=toHeaderRecord(_0x4dd202);return delete _0x21a5c1[_0xf85ff7(0x1e8)],_0x32c837&&(_0x21a5c1[_0xf85ff7(0x1ea)]=_0x32c837),_0x21a5c1;}function a47_0x317e(){const _0x1882c8=['entries','1208795EZtqNF','TD1\x20','12613730NOvdlW','Authorization','6huHuve','X-Trino-User','tdx',';\x20node/','24CTqtwY','length','2340416qKsHLL','version','22434cdYbYk','4482142NmpHar','replace','385caguXL','tdx/','2940930NahYHP','1227862bslCSf'];a47_0x317e=function(){return _0x1882c8;};return a47_0x317e();}export function hasAPIKey(_0x506498){const _0x1700a9=a47_0x3a4d,_0x4d5d07=getAPIKey();return _0x4d5d07!==undefined&&_0x4d5d07[_0x1700a9(0x1ee)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4fa05a,_0x31210f){const _0x5bb9b3=a48_0x532e,_0x2c1a3c=_0x4fa05a();while(!![]){try{const _0x2ce56c=-parseInt(_0x5bb9b3(0x1c0))/0x1+-parseInt(_0x5bb9b3(0x1d7))/0x2*(parseInt(_0x5bb9b3(0x1db))/0x3)+-parseInt(_0x5bb9b3(0x1d1))/0x4+parseInt(_0x5bb9b3(0x1d0))/0x5*(-parseInt(_0x5bb9b3(0x1e1))/0x6)+-parseInt(_0x5bb9b3(0x1e2))/0x7*(parseInt(_0x5bb9b3(0x1cc))/0x8)+parseInt(_0x5bb9b3(0x1b2))/0x9*(parseInt(_0x5bb9b3(0x1a6))/0xa)+parseInt(_0x5bb9b3(0x1c5))/0xb;if(_0x2ce56c===_0x31210f)break;else _0x2c1a3c['push'](_0x2c1a3c['shift']());}catch(_0x5de1c7){_0x2c1a3c['push'](_0x2c1a3c['shift']());}}}(a48_0x1165,0xeb909));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 a48_0x52a5df from'chalk';function a48_0x1165(){const _0x298c60=['3890AasbKP','table','spawn','color','─┴─','stringify','limit','string','cmdout','varchar','isTTY','debug','17937XBhhHh','close','entries','error','trim','[Object]','log','inherit','max','length','[query]','[params]','red','[logs]','1398733itRQLo','boolean','format','noColor','list','67750353bMwFhj','bold','sdk-result','stderr','filter','object','rule','56HRdGet','stdout','pipe','double','15GldPrd','5429024CaASGK','output','push','query','params','stdin','3074654xbzGMA','number','bigint','json','3ktQCDA','-FXRSn','keys','Results\x20saved\x20to\x20','yellow','padEnd','836202ahsCBK','1258110NWizOt','tsv','jsonl','FINISHED','resolve','repeat','map','─┬─','forEach','split','[error]','join'];a48_0x1165=function(){return _0x298c60;};return a48_0x1165();}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x43023c){const _0x523437=a48_0x532e;return _0x43023c[_0x523437(0x1c2)]===_0x523437(0x1da)||_0x43023c['format']===_0x523437(0x1e4)||_0x43023c['format']===_0x523437(0x1e3)||_0x43023c[_0x523437(0x1c2)]==='table'||_0x43023c[_0x523437(0x1da)]===!![]||_0x43023c['jsonl']===!![]||_0x43023c['tsv']===!![]||_0x43023c[_0x523437(0x1a7)]===!![];}export function parseOutputOptions(_0xa16147){const _0x12ed74=a48_0x532e;return{'format':_0xa16147[_0x12ed74(0x1c2)]||_0x12ed74(0x1a7),'output':_0xa16147[_0x12ed74(0x1d2)]||'','limit':_0xa16147[_0x12ed74(0x1ac)],'color':_0xa16147[_0x12ed74(0x1a9)],'noColor':_0xa16147[_0x12ed74(0x1c3)]};}function convertSDKResultToQueryResult(_0x34ab16){const _0x3521cb=a48_0x532e,_0x41304c=[];if(_0x34ab16[_0x3521cb(0x1bb)]>0x0){const _0x3a7316=_0x34ab16[0x0];for(const [_0x552056,_0x1dbb56]of Object[_0x3521cb(0x1b4)](_0x3a7316)){let _0x1572d2=_0x3521cb(0x1af);if(typeof _0x1dbb56===_0x3521cb(0x1d8))_0x1572d2=Number['isInteger'](_0x1dbb56)?_0x3521cb(0x1d9):_0x3521cb(0x1cf);else{if(typeof _0x1dbb56===_0x3521cb(0x1c1))_0x1572d2=_0x3521cb(0x1c1);else _0x1dbb56===null&&(_0x1572d2='varchar');}_0x41304c['push']({'name':_0x552056,'type':_0x1572d2});}}return{'queryId':_0x3521cb(0x1c7),'columns':_0x41304c,'data':_0x34ab16,'stats':{'state':_0x3521cb(0x1e5),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x34ab16['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3f327e,_0x4042d1){const _0x4aba83=convertSDKResultToQueryResult(_0x3f327e);return formatQueryOutput(_0x4aba83,_0x4042d1);}export async function formatQueryOutput(_0x5bb614,_0x2e9a1a){const _0x3c59ca=a48_0x532e,{format:_0x2b939f,limit:_0x2e7c11,output:_0x4d1b7b,color:_0x34a2f9,noColor:_0x1305bf}=_0x2e9a1a,_0xf5f41e=Boolean(_0x4d1b7b)&&!_0x34a2f9,_0x4adda4={'color':_0x34a2f9,'noColor':_0x1305bf||_0xf5f41e};if(_0x2b939f===_0x3c59ca(0x1a7)){const _0x5b0375=shouldUseLess(_0x2b939f,_0x4d1b7b);return formatAsTable(_0x5bb614,_0x2e7c11,_0x5b0375,_0x4adda4);}else{if(_0x2b939f===_0x3c59ca(0x1da))return formatAsJSON(_0x5bb614,_0x4adda4);else return _0x2b939f==='jsonl'?formatAsJSONL(_0x5bb614,_0x4adda4):formatQueryResult(_0x5bb614,_0x2b939f);}}function a48_0x532e(_0x551dd8,_0x190c7b){_0x551dd8=_0x551dd8-0x1a1;const _0x11654c=a48_0x1165();let _0x532e67=_0x11654c[_0x551dd8];return _0x532e67;}function shouldUseLess(_0x4e3e96,_0x277bc9){const _0x309225=a48_0x532e;return(_0x4e3e96==='table'||_0x4e3e96===_0x309225(0x1c4))&&process[_0x309225(0x1cd)][_0x309225(0x1b0)]&&!_0x277bc9;}export function resolveOutputOptions(_0x573b3e){const _0x1a461c=a48_0x532e,_0x54c14e=resolveOutputFormat(_0x573b3e['format'],_0x573b3e[_0x1a461c(0x1d2)],_0x1a461c(0x1a7));let _0x589f23=typeof _0x573b3e[_0x1a461c(0x1ac)]===_0x1a461c(0x1d8)?_0x573b3e[_0x1a461c(0x1ac)]:parseInt(_0x573b3e[_0x1a461c(0x1ac)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x179d5a=_0x573b3e[_0x1a461c(0x1d2)]||'';return shouldUseLess(_0x54c14e,_0x179d5a)&&(_0x589f23=Infinity),{'format':_0x54c14e,'output':_0x179d5a,'limit':_0x589f23,'color':_0x573b3e[_0x1a461c(0x1a9)],'noColor':_0x573b3e[_0x1a461c(0x1c3)]};}export function writeOutput(_0x2d906e,_0x307a2e,_0x36b242){const _0x50caf2=a48_0x532e;return _0x307a2e?(writeFileSync(_0x307a2e,_0x2d906e),console[_0x50caf2(0x1b5)](_0x50caf2(0x1de)+_0x307a2e),Promise['resolve']()):shouldUseLess(_0x36b242||'','')?new Promise(_0x393e38=>{const _0xa8fb97=_0x50caf2,_0x4fc946=spawn('less',[_0xa8fb97(0x1dc)],{'stdio':[_0xa8fb97(0x1ce),'inherit',_0xa8fb97(0x1b9)]});let _0x2a47df=![];_0x4fc946['on']('error',()=>{const _0x152fe8=_0xa8fb97;!_0x2a47df&&(_0x2a47df=!![],console[_0x152fe8(0x1b8)](_0x2d906e),_0x393e38());}),_0x4fc946['on'](_0xa8fb97(0x1b3),()=>{!_0x2a47df&&(_0x2a47df=!![],_0x393e38());}),_0x4fc946['on'](_0xa8fb97(0x1a8),()=>{const _0x383502=_0xa8fb97;!_0x2a47df&&_0x4fc946['stdin']&&(_0x4fc946[_0x383502(0x1d6)]['on']('error',()=>{}),_0x4fc946[_0x383502(0x1d6)]['write'](_0x2d906e),_0x4fc946[_0x383502(0x1d6)]['end']());}),!_0x4fc946[_0xa8fb97(0x1d6)]&&(!_0x2a47df&&(_0x2a47df=!![],console[_0xa8fb97(0x1b8)](_0x2d906e),_0x393e38()));}):(console['log'](_0x2d906e),Promise[_0x50caf2(0x1e6)]());}export async function handleSDKOutput(_0x225886,_0x385aa0){const _0x429da6=a48_0x532e,_0x102f6a=resolveOutputOptions(_0x385aa0),_0x4a3a61=await formatSDKOutput(_0x225886,_0x102f6a);await writeOutput(_0x4a3a61,_0x102f6a['output']||undefined,_0x102f6a[_0x429da6(0x1c2)]);}export async function handleQueryOutput(_0x34efe4,_0x43c026){const _0x2218aa=a48_0x532e,_0x5a7319=resolveOutputOptions(_0x43c026),_0x2be868=await formatQueryOutput(_0x34efe4,_0x5a7319);await writeOutput(_0x2be868,_0x5a7319[_0x2218aa(0x1d2)]||undefined,_0x5a7319[_0x2218aa(0x1c2)]);}async function formatSingleObject(_0x41142c,_0x538e36){const _0x23180f=a48_0x532e,{format:_0x4bfa53,color:_0x55e129,noColor:_0x1459e3}=_0x538e36,_0x4f1fc4={'color':_0x55e129,'noColor':_0x1459e3};if(_0x4bfa53===_0x23180f(0x1da)){if(shouldUseColor(_0x4f1fc4))return colorizeJSON(_0x41142c,_0x4f1fc4);return JSON['stringify'](_0x41142c,null,0x2);}else{if(_0x4bfa53===_0x23180f(0x1e4)){if(shouldUseColor(_0x4f1fc4))return colorizeJSONCompact(_0x41142c,_0x4f1fc4);return JSON['stringify'](_0x41142c);}else{if(_0x4bfa53===_0x23180f(0x1e3))return Object[_0x23180f(0x1b4)](_0x41142c)[_0x23180f(0x1e8)](([_0x225002,_0x2cdbc9])=>_0x225002+'\x09'+_0x2cdbc9)[_0x23180f(0x1a5)]('\x0a');else{const _0x2d6357=Object['entries'](_0x41142c);if(_0x2d6357[_0x23180f(0x1bb)]===0x0)return'No\x20data';const _0x181fd7=_0x41142c[_0x23180f(0x1b1)],_0xc1e61f=_0x41142c[_0x23180f(0x1d4)],_0x3d9496=_0x41142c[_0x23180f(0x1d5)],_0x4b5d34=_0x41142c[_0x23180f(0x1cb)],_0x558041=_0xc1e61f?typeof _0xc1e61f===_0x23180f(0x1ad)?_0xc1e61f:JSON['stringify'](_0xc1e61f,null,0x2):undefined,_0x23cdcf=_0x3d9496&&Object['keys'](_0x3d9496)[_0x23180f(0x1bb)]>0x0?JSON[_0x23180f(0x1ab)](_0x3d9496,null,0x2):undefined,_0x3342fd=_0x4b5d34&&Object[_0x23180f(0x1dd)](_0x4b5d34)['length']>0x0?JSON[_0x23180f(0x1ab)](_0x4b5d34,null,0x2):undefined,_0xa8037c=_0x2d6357[_0x23180f(0x1c9)](([_0x15c95d])=>_0x15c95d!==_0x23180f(0x1b1)&&_0x15c95d!==_0x23180f(0x1d4)&&_0x15c95d!=='params'&&_0x15c95d!==_0x23180f(0x1cb)),_0x2230ee=Math[_0x23180f(0x1ba)](..._0xa8037c['map'](([_0xf11fb])=>_0xf11fb[_0x23180f(0x1bb)])),_0x2ea220=Math[_0x23180f(0x1ba)](..._0xa8037c['map'](([,_0x50dcee])=>{const _0x360706=_0x23180f;try{const _0x56ae6c=_0x50dcee===null||_0x50dcee===undefined?'':typeof _0x50dcee===_0x360706(0x1ca)?JSON[_0x360706(0x1ab)](_0x50dcee):String(_0x50dcee),_0x4e76a2=_0x56ae6c[_0x360706(0x1a3)]('\x0a');return Math[_0x360706(0x1ba)](..._0x4e76a2[_0x360706(0x1e8)](_0x26e96a=>_0x26e96a[_0x360706(0x1bb)]),0x0);}catch{return 0x0;}}),0x14),_0x4970ed=[];_0x4970ed[_0x23180f(0x1d3)](colorBorder('┌─'+'─'[_0x23180f(0x1e7)](_0x2230ee)+_0x23180f(0x1a1)+'─'[_0x23180f(0x1e7)](_0x2ea220)+'─┐',_0x4f1fc4)),_0xa8037c[_0x23180f(0x1a2)](([_0x4d9a04,_0x250d91])=>{const _0x5d9244=_0x23180f;let _0x305ea7;try{_0x305ea7=_0x250d91===null||_0x250d91===undefined?'':typeof _0x250d91===_0x5d9244(0x1ca)?JSON[_0x5d9244(0x1ab)](_0x250d91):String(_0x250d91);}catch{_0x305ea7=_0x5d9244(0x1b7);}const _0xbea50a=_0x4d9a04[_0x5d9244(0x1e0)](_0x2230ee),_0x2bfcaf=_0x305ea7[_0x5d9244(0x1a3)]('\x0a');_0x2bfcaf[_0x5d9244(0x1a2)]((_0x53ebb1,_0x14095b)=>{const _0x3f2d2=_0x5d9244,_0x1fa758=colorBorder('│',_0x4f1fc4);_0x14095b===0x0?_0x4970ed['push'](_0x1fa758+'\x20'+_0xbea50a+'\x20'+_0x1fa758+'\x20'+_0x53ebb1[_0x3f2d2(0x1e0)](_0x2ea220)+'\x20'+_0x1fa758):_0x4970ed[_0x3f2d2(0x1d3)](_0x1fa758+'\x20'+'\x20'[_0x3f2d2(0x1e7)](_0x2230ee)+'\x20'+_0x1fa758+'\x20'+_0x53ebb1['padEnd'](_0x2ea220)+'\x20'+_0x1fa758);});}),_0x4970ed[_0x23180f(0x1d3)](colorBorder('└─'+'─'[_0x23180f(0x1e7)](_0x2230ee)+_0x23180f(0x1aa)+'─'[_0x23180f(0x1e7)](_0x2ea220)+'─┘',_0x4f1fc4));_0x558041&&(_0x4970ed[_0x23180f(0x1d3)](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df[_0x23180f(0x1df)][_0x23180f(0x1c6)](_0x23180f(0x1bc)))),_0x4970ed[_0x23180f(0x1d3)](_0x558041));_0x23cdcf&&(_0x4970ed['push'](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df['blue'][_0x23180f(0x1c6)](_0x23180f(0x1bd)))),_0x4970ed[_0x23180f(0x1d3)](_0x23cdcf));_0x3342fd&&(_0x4970ed[_0x23180f(0x1d3)](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df['magenta'][_0x23180f(0x1c6)]('[rule]'))),_0x4970ed[_0x23180f(0x1d3)](_0x3342fd));if(_0x181fd7){if(_0x181fd7['stderr']){_0x4970ed[_0x23180f(0x1d3)](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df[_0x23180f(0x1be)][_0x23180f(0x1c6)](_0x23180f(0x1a4))));const _0x3ea7a8=_0x181fd7[_0x23180f(0x1c8)][_0x23180f(0x1a3)]('\x0a');_0x3ea7a8[_0x23180f(0x1a2)](_0x5bab12=>{const _0x5d62cb=_0x23180f;_0x5bab12['trim']()&&_0x4970ed[_0x5d62cb(0x1d3)](_0x5bab12);});}if(_0x181fd7['cmdout']){_0x4970ed[_0x23180f(0x1d3)](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df['cyan'][_0x23180f(0x1c6)](_0x23180f(0x1bf))));const _0x22c920=_0x181fd7[_0x23180f(0x1ae)][_0x23180f(0x1a3)]('\x0a');_0x22c920[_0x23180f(0x1a2)](_0x2fe82e=>{const _0x30d40b=_0x23180f;_0x2fe82e[_0x30d40b(0x1b6)]()&&_0x4970ed[_0x30d40b(0x1d3)](_0x2fe82e);});}}return _0x4970ed[_0x23180f(0x1a5)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2a9d67,_0x1e6f41){const _0x4b13a1=a48_0x532e;if(_0x1e6f41[_0x4b13a1(0x1c2)]===_0x4b13a1(0x1a7)){await handleSDKOutput([_0x2a9d67],_0x1e6f41);return;}const _0x39df6b=resolveOutputOptions(_0x1e6f41),_0x373493=await formatSingleObject(_0x2a9d67,_0x39df6b);await writeOutput(_0x373493,_0x39df6b[_0x4b13a1(0x1d2)]||undefined,_0x39df6b[_0x4b13a1(0x1c2)]);}
|
|
1
|
+
(function(_0x267476,_0x2a183d){const _0x4322f0=a48_0x3012,_0x4dfe9e=_0x267476();while(!![]){try{const _0x36a8f1=-parseInt(_0x4322f0(0x170))/0x1*(parseInt(_0x4322f0(0x172))/0x2)+parseInt(_0x4322f0(0x191))/0x3+-parseInt(_0x4322f0(0x176))/0x4+-parseInt(_0x4322f0(0x180))/0x5+parseInt(_0x4322f0(0x192))/0x6+parseInt(_0x4322f0(0x188))/0x7+-parseInt(_0x4322f0(0x1a8))/0x8;if(_0x36a8f1===_0x2a183d)break;else _0x4dfe9e['push'](_0x4dfe9e['shift']());}catch(_0x1e3247){_0x4dfe9e['push'](_0x4dfe9e['shift']());}}}(a48_0x3353,0xbbd1b));import{writeFileSync}from'fs';function a48_0x3012(_0x1a4396,_0x1a9114){_0x1a4396=_0x1a4396-0x165;const _0x33534c=a48_0x3353();let _0x3012bc=_0x33534c[_0x1a4396];return _0x3012bc;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a48_0x3353(){const _0x16f308=['split','forEach','debug','4992288UhcIkN','output','isInteger','bold','rule','map','color','FINISHED','[params]','[error]','2533525FAwyex','─┴─','max','stderr','close','limit','bigint','number','8202089yDkoAk','stdin','yellow','log','-FXRSn','padEnd','less','resolve','join','3838758yFVuLC','6907650zkpweg','No\x20data','push','tsv','end','sdk-result','[logs]','keys','cmdout','red','table','magenta','stringify','[rule]','double','repeat','params','blue','pipe','json','error','noColor','6627752ohqYfS','filter','trim','Results\x20saved\x20to\x20','format','inherit','isTTY','length','jsonl','spawn','boolean','query','entries','395sEmWVV','varchar','1266mCMTjM'];a48_0x3353=function(){return _0x16f308;};return a48_0x3353();}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a48_0x32c3a3 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1d6426){const _0x4b3327=a48_0x3012;return _0x1d6426[_0x4b3327(0x167)]===_0x4b3327(0x1a5)||_0x1d6426[_0x4b3327(0x167)]===_0x4b3327(0x16b)||_0x1d6426[_0x4b3327(0x167)]===_0x4b3327(0x195)||_0x1d6426[_0x4b3327(0x167)]===_0x4b3327(0x19c)||_0x1d6426[_0x4b3327(0x1a5)]===!![]||_0x1d6426['jsonl']===!![]||_0x1d6426['tsv']===!![]||_0x1d6426['table']===!![];}export function parseOutputOptions(_0x2759d2){const _0x48b625=a48_0x3012;return{'format':_0x2759d2[_0x48b625(0x167)]||_0x48b625(0x19c),'output':_0x2759d2[_0x48b625(0x177)]||'','limit':_0x2759d2[_0x48b625(0x185)],'color':_0x2759d2['color'],'noColor':_0x2759d2['noColor']};}function convertSDKResultToQueryResult(_0x21d70c){const _0x55e389=a48_0x3012,_0x5ee511=[];if(_0x21d70c[_0x55e389(0x16a)]>0x0){const _0xa6f8fe=_0x21d70c[0x0];for(const [_0x2cee46,_0x1baa7a]of Object['entries'](_0xa6f8fe)){let _0x1a98e4=_0x55e389(0x171);if(typeof _0x1baa7a===_0x55e389(0x187))_0x1a98e4=Number[_0x55e389(0x178)](_0x1baa7a)?_0x55e389(0x186):_0x55e389(0x1a0);else{if(typeof _0x1baa7a===_0x55e389(0x16d))_0x1a98e4='boolean';else _0x1baa7a===null&&(_0x1a98e4='varchar');}_0x5ee511[_0x55e389(0x194)]({'name':_0x2cee46,'type':_0x1a98e4});}}return{'queryId':_0x55e389(0x197),'columns':_0x5ee511,'data':_0x21d70c,'stats':{'state':_0x55e389(0x17d),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x21d70c[_0x55e389(0x16a)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x454060,_0x3013b1){const _0x2ab286=convertSDKResultToQueryResult(_0x454060);return formatQueryOutput(_0x2ab286,_0x3013b1);}export async function formatQueryOutput(_0x34d62d,_0x598124){const _0x4bd51b=a48_0x3012,{format:_0x33f91b,limit:_0x5d9bf9,output:_0x441c06,color:_0x56babb,noColor:_0x202eef}=_0x598124,_0x22f5eb=Boolean(_0x441c06)&&!_0x56babb,_0x431f8a={'color':_0x56babb,'noColor':_0x202eef||_0x22f5eb};if(_0x33f91b===_0x4bd51b(0x19c)){const _0x5ac11e=shouldUseLess(_0x33f91b,_0x441c06);return formatAsTable(_0x34d62d,_0x5d9bf9,_0x5ac11e,_0x431f8a);}else{if(_0x33f91b===_0x4bd51b(0x1a5))return formatAsJSON(_0x34d62d,_0x431f8a);else return _0x33f91b===_0x4bd51b(0x16b)?formatAsJSONL(_0x34d62d,_0x431f8a):formatQueryResult(_0x34d62d,_0x33f91b);}}function shouldUseLess(_0x139260,_0x5635d4){const _0x5dadee=a48_0x3012;return(_0x139260==='table'||_0x139260==='list')&&process['stdout'][_0x5dadee(0x169)]&&!_0x5635d4;}export function resolveOutputOptions(_0x13c004){const _0x28e832=a48_0x3012,_0x35a297=resolveOutputFormat(_0x13c004[_0x28e832(0x167)],_0x13c004[_0x28e832(0x177)],'table');let _0x1de244=typeof _0x13c004[_0x28e832(0x185)]===_0x28e832(0x187)?_0x13c004['limit']:parseInt(_0x13c004['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x378950=_0x13c004[_0x28e832(0x177)]||'';return shouldUseLess(_0x35a297,_0x378950)&&(_0x1de244=Infinity),{'format':_0x35a297,'output':_0x378950,'limit':_0x1de244,'color':_0x13c004[_0x28e832(0x17c)],'noColor':_0x13c004[_0x28e832(0x1a7)]};}export function writeOutput(_0xada613,_0xa12da7,_0x58a8ea){const _0x3ac295=a48_0x3012;return _0xa12da7?(writeFileSync(_0xa12da7,_0xada613),console[_0x3ac295(0x1a6)](_0x3ac295(0x166)+_0xa12da7),Promise[_0x3ac295(0x18f)]()):shouldUseLess(_0x58a8ea||'','')?new Promise(_0x383ee6=>{const _0x545480=_0x3ac295,_0x38c2f3=spawn(_0x545480(0x18e),[_0x545480(0x18c)],{'stdio':[_0x545480(0x1a4),_0x545480(0x168),'inherit']});let _0x29f872=![];_0x38c2f3['on'](_0x545480(0x1a6),()=>{const _0x1f47e3=_0x545480;!_0x29f872&&(_0x29f872=!![],console[_0x1f47e3(0x18b)](_0xada613),_0x383ee6());}),_0x38c2f3['on'](_0x545480(0x184),()=>{!_0x29f872&&(_0x29f872=!![],_0x383ee6());}),_0x38c2f3['on'](_0x545480(0x16c),()=>{const _0x53e215=_0x545480;!_0x29f872&&_0x38c2f3['stdin']&&(_0x38c2f3[_0x53e215(0x189)]['on'](_0x53e215(0x1a6),()=>{}),_0x38c2f3[_0x53e215(0x189)]['write'](_0xada613),_0x38c2f3[_0x53e215(0x189)][_0x53e215(0x196)]());}),!_0x38c2f3[_0x545480(0x189)]&&(!_0x29f872&&(_0x29f872=!![],console['log'](_0xada613),_0x383ee6()));}):(console[_0x3ac295(0x18b)](_0xada613),Promise[_0x3ac295(0x18f)]());}export async function handleSDKOutput(_0x3a619e,_0x352b23){const _0x54cfaa=a48_0x3012,_0x4fa105=resolveOutputOptions(_0x352b23),_0x59ae46=await formatSDKOutput(_0x3a619e,_0x4fa105);await writeOutput(_0x59ae46,_0x4fa105[_0x54cfaa(0x177)]||undefined,_0x4fa105[_0x54cfaa(0x167)]);}export async function handleQueryOutput(_0x289bf7,_0x2cd4b9){const _0x2df46b=a48_0x3012,_0x5941f6=resolveOutputOptions(_0x2cd4b9),_0x1b2d11=await formatQueryOutput(_0x289bf7,_0x5941f6);await writeOutput(_0x1b2d11,_0x5941f6[_0x2df46b(0x177)]||undefined,_0x5941f6[_0x2df46b(0x167)]);}async function formatSingleObject(_0x5bb71f,_0x70fbc7){const _0xf17be5=a48_0x3012,{format:_0x2fb190,color:_0x277df0,noColor:_0x22e36e}=_0x70fbc7,_0x4793f6={'color':_0x277df0,'noColor':_0x22e36e};if(_0x2fb190===_0xf17be5(0x1a5)){if(shouldUseColor(_0x4793f6))return colorizeJSON(_0x5bb71f,_0x4793f6);return JSON[_0xf17be5(0x19e)](_0x5bb71f,null,0x2);}else{if(_0x2fb190===_0xf17be5(0x16b)){if(shouldUseColor(_0x4793f6))return colorizeJSONCompact(_0x5bb71f,_0x4793f6);return JSON[_0xf17be5(0x19e)](_0x5bb71f);}else{if(_0x2fb190===_0xf17be5(0x195))return Object[_0xf17be5(0x16f)](_0x5bb71f)[_0xf17be5(0x17b)](([_0x321145,_0xcca80c])=>_0x321145+'\x09'+_0xcca80c)[_0xf17be5(0x190)]('\x0a');else{const _0x5a09af=Object['entries'](_0x5bb71f);if(_0x5a09af[_0xf17be5(0x16a)]===0x0)return _0xf17be5(0x193);const _0x4f18dc=_0x5bb71f[_0xf17be5(0x175)],_0x4aeeb1=_0x5bb71f[_0xf17be5(0x16e)],_0x4cef4a=_0x5bb71f[_0xf17be5(0x1a2)],_0x150ee2=_0x5bb71f[_0xf17be5(0x17a)],_0x4c1649=_0x4aeeb1?typeof _0x4aeeb1==='string'?_0x4aeeb1:JSON[_0xf17be5(0x19e)](_0x4aeeb1,null,0x2):undefined,_0x40a555=_0x4cef4a&&Object[_0xf17be5(0x199)](_0x4cef4a)[_0xf17be5(0x16a)]>0x0?JSON['stringify'](_0x4cef4a,null,0x2):undefined,_0x3ce4c6=_0x150ee2&&Object[_0xf17be5(0x199)](_0x150ee2)[_0xf17be5(0x16a)]>0x0?JSON[_0xf17be5(0x19e)](_0x150ee2,null,0x2):undefined,_0x1c56f6=_0x5a09af[_0xf17be5(0x1a9)](([_0x1318ba])=>_0x1318ba!==_0xf17be5(0x175)&&_0x1318ba!==_0xf17be5(0x16e)&&_0x1318ba!==_0xf17be5(0x1a2)&&_0x1318ba!==_0xf17be5(0x17a)),_0x59d59b=Math[_0xf17be5(0x182)](..._0x1c56f6[_0xf17be5(0x17b)](([_0x3c54ee])=>_0x3c54ee[_0xf17be5(0x16a)])),_0x1e3421=Math[_0xf17be5(0x182)](..._0x1c56f6[_0xf17be5(0x17b)](([,_0x13f22e])=>{const _0x53d865=_0xf17be5;try{const _0xbb0e2e=_0x13f22e===null||_0x13f22e===undefined?'':typeof _0x13f22e==='object'?JSON[_0x53d865(0x19e)](_0x13f22e):String(_0x13f22e),_0xbe8e7c=_0xbb0e2e[_0x53d865(0x173)]('\x0a');return Math[_0x53d865(0x182)](..._0xbe8e7c['map'](_0x3cf0b2=>_0x3cf0b2[_0x53d865(0x16a)]),0x0);}catch{return 0x0;}}),0x14),_0x151dca=[];_0x151dca[_0xf17be5(0x194)](colorBorder('┌─'+'─'['repeat'](_0x59d59b)+'─┬─'+'─'[_0xf17be5(0x1a1)](_0x1e3421)+'─┐',_0x4793f6)),_0x1c56f6['forEach'](([_0x12edad,_0x33060b])=>{const _0x2d6116=_0xf17be5;let _0x21df85;try{_0x21df85=_0x33060b===null||_0x33060b===undefined?'':typeof _0x33060b==='object'?JSON[_0x2d6116(0x19e)](_0x33060b):String(_0x33060b);}catch{_0x21df85='[Object]';}const _0x554f50=_0x12edad[_0x2d6116(0x18d)](_0x59d59b),_0x4fb923=_0x21df85[_0x2d6116(0x173)]('\x0a');_0x4fb923[_0x2d6116(0x174)]((_0x10efc7,_0x1ab813)=>{const _0x5434fa=_0x2d6116,_0x164f37=colorBorder('│',_0x4793f6);_0x1ab813===0x0?_0x151dca[_0x5434fa(0x194)](_0x164f37+'\x20'+_0x554f50+'\x20'+_0x164f37+'\x20'+_0x10efc7[_0x5434fa(0x18d)](_0x1e3421)+'\x20'+_0x164f37):_0x151dca[_0x5434fa(0x194)](_0x164f37+'\x20'+'\x20'[_0x5434fa(0x1a1)](_0x59d59b)+'\x20'+_0x164f37+'\x20'+_0x10efc7[_0x5434fa(0x18d)](_0x1e3421)+'\x20'+_0x164f37);});}),_0x151dca['push'](colorBorder('└─'+'─'[_0xf17be5(0x1a1)](_0x59d59b)+_0xf17be5(0x181)+'─'[_0xf17be5(0x1a1)](_0x1e3421)+'─┘',_0x4793f6));_0x4c1649&&(_0x151dca[_0xf17be5(0x194)](''),_0x151dca[_0xf17be5(0x194)](String(a48_0x32c3a3[_0xf17be5(0x18a)][_0xf17be5(0x179)]('[query]'))),_0x151dca['push'](_0x4c1649));_0x40a555&&(_0x151dca[_0xf17be5(0x194)](''),_0x151dca[_0xf17be5(0x194)](String(a48_0x32c3a3[_0xf17be5(0x1a3)]['bold'](_0xf17be5(0x17e)))),_0x151dca[_0xf17be5(0x194)](_0x40a555));_0x3ce4c6&&(_0x151dca[_0xf17be5(0x194)](''),_0x151dca[_0xf17be5(0x194)](String(a48_0x32c3a3[_0xf17be5(0x19d)][_0xf17be5(0x179)](_0xf17be5(0x19f)))),_0x151dca[_0xf17be5(0x194)](_0x3ce4c6));if(_0x4f18dc){if(_0x4f18dc['stderr']){_0x151dca['push'](''),_0x151dca['push'](String(a48_0x32c3a3[_0xf17be5(0x19b)][_0xf17be5(0x179)](_0xf17be5(0x17f))));const _0x4d8100=_0x4f18dc[_0xf17be5(0x183)][_0xf17be5(0x173)]('\x0a');_0x4d8100[_0xf17be5(0x174)](_0x213cc0=>{const _0x508584=_0xf17be5;_0x213cc0[_0x508584(0x165)]()&&_0x151dca[_0x508584(0x194)](_0x213cc0);});}if(_0x4f18dc[_0xf17be5(0x19a)]){_0x151dca[_0xf17be5(0x194)](''),_0x151dca[_0xf17be5(0x194)](String(a48_0x32c3a3['cyan'][_0xf17be5(0x179)](_0xf17be5(0x198))));const _0x48ff40=_0x4f18dc['cmdout'][_0xf17be5(0x173)]('\x0a');_0x48ff40[_0xf17be5(0x174)](_0x404730=>{const _0x3ab8b7=_0xf17be5;_0x404730[_0x3ab8b7(0x165)]()&&_0x151dca[_0x3ab8b7(0x194)](_0x404730);});}}return _0x151dca['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x21ead1,_0x309919){const _0x596c95=a48_0x3012;if(_0x309919[_0x596c95(0x167)]===_0x596c95(0x19c)){await handleSDKOutput([_0x21ead1],_0x309919);return;}const _0x3161b3=resolveOutputOptions(_0x309919),_0x29024d=await formatSingleObject(_0x21ead1,_0x3161b3);await writeOutput(_0x29024d,_0x3161b3[_0x596c95(0x177)]||undefined,_0x3161b3[_0x596c95(0x167)]);}
|