@treasuredata/tdx 2026.4.8 → 2026.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.d.ts +2 -0
- package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/access-tracker.js.map +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.d.ts +52 -0
- package/dist/sdk/workspace/git.d.ts.map +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/git.js.map +1 -1
- package/dist/sdk/workspace/index.d.ts +16 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts +3 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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.d.ts +10 -2
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x361fe1=a54_0x4e54;(function(_0x4abefe,_0x3999e6){const _0x581a56=a54_0x4e54,_0x155957=_0x4abefe();while(!![]){try{const _0xa34869=-parseInt(_0x581a56(0x1ba))/0x1*(-parseInt(_0x581a56(0x1a2))/0x2)+-parseInt(_0x581a56(0x21d))/0x3+-parseInt(_0x581a56(0x217))/0x4+parseInt(_0x581a56(0x241))/0x5*(-parseInt(_0x581a56(0x19f))/0x6)+-parseInt(_0x581a56(0x253))/0x7*(-parseInt(_0x581a56(0x336))/0x8)+parseInt(_0x581a56(0x1cd))/0x9+-parseInt(_0x581a56(0x1ac))/0xa*(-parseInt(_0x581a56(0x2e6))/0xb);if(_0xa34869===_0x3999e6)break;else _0x155957['push'](_0x155957['shift']());}catch(_0x1d0c8){_0x155957['push'](_0x155957['shift']());}}}(a54_0x1a1a,0x421b1));import a54_0x6e3482 from'chalk';import{existsSync}from'fs';import a54_0x31407d from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,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';function a54_0x4e54(_0x2f4fa7,_0x1e19f1){_0x2f4fa7=_0x2f4fa7-0x19a;const _0x1a1a08=a54_0x1a1a();let _0x4e5463=_0x1a1a08[_0x2f4fa7];return _0x4e5463;}import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x15ced4 from'prompts';function getAttemptStatusDisplay(_0x506910){const _0x49ebac=a54_0x4e54;if(!_0x506910)return{'icon':'⏳','text':''};const {done:_0x137955,success:_0x882f19,cancelRequested:_0x414718}=_0x506910;if(!_0x137955)return _0x414718?{'icon':'🛑','text':a54_0x6e3482[_0x49ebac(0x259)](_0x49ebac(0x321))}:{'icon':'🔄','text':a54_0x6e3482['blue'](_0x49ebac(0x33e))};if(_0x882f19)return{'icon':'✅','text':a54_0x6e3482[_0x49ebac(0x1d6)](_0x49ebac(0x19a))};return{'icon':'❌','text':a54_0x6e3482[_0x49ebac(0x1d0)](_0x49ebac(0x349))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x361fe1(0x2a6)](_0x5604b1,_0x2a8a81,_0x1d46d7=0x0){const _0x1d0b96=a54_0x361fe1;return _0x5604b1[_0x1d46d7]||_0x2a8a81[_0x1d0b96(0x33b)];}[a54_0x361fe1(0x19d)](_0xff017,_0x2abc43,_0x2a7141=0x0){const _0x6e9efc=a54_0x361fe1,_0x244739=this[_0x6e9efc(0x2a6)](_0xff017,_0x2abc43,_0x2a7141);if(!_0x244739)return console['error'](a54_0x6e3482[_0x6e9efc(0x1d0)]('Error:'),_0x6e9efc(0x2ee)),console[_0x6e9efc(0x349)](a54_0x6e3482[_0x6e9efc(0x22b)](_0x6e9efc(0x224))),null;return _0x244739;}[a54_0x361fe1(0x1f1)](_0x3b584c,_0x4bcf9c){const _0x131656=a54_0x361fe1;if(_0x3b584c[0x0]){const _0xc58c8b=_0x3b584c[0x0][_0x131656(0x332)]('.');if(_0xc58c8b['length']===0x1)return{'projectName':_0xc58c8b[0x0],'workflowName':undefined};else return _0xc58c8b[_0x131656(0x344)]===0x2?{'projectName':_0xc58c8b[0x0],'workflowName':_0xc58c8b[0x1]}:(console[_0x131656(0x349)](a54_0x6e3482[_0x131656(0x1d0)](_0x131656(0x2ad)),_0x131656(0x1e3)),null);}return{'projectName':_0x4bcf9c[_0x131656(0x33b)],'workflowName':undefined};}[a54_0x361fe1(0x1eb)](_0x15a8e9,_0x443565,_0x3093aa=0x0){const _0xc23272=a54_0x361fe1;if(_0x15a8e9[_0x3093aa])return _0x15a8e9[_0x3093aa];if(_0x443565[_0xc23272(0x33b)]){const _0x15d9cf=a54_0x31407d[_0xc23272(0x2f7)](process['cwd'](),_0xc23272(0x251),_0x443565[_0xc23272(0x33b)]);if(existsSync(a54_0x31407d[_0xc23272(0x2f7)](_0x15d9cf,_0xc23272(0x238))))return _0x15d9cf;}return undefined;}async[a54_0x361fe1(0x2c4)](_0x2ab3d5,_0x3ea563,_0x43c059){const _0x2f498d=a54_0x361fe1;try{const _0x5dbd0d=await _0x2ab3d5[_0x2f498d(0x1c2)]['workflows'](_0x3ea563,{'limit':0x1});if(_0x5dbd0d['length']>0x0){const _0x8f5f36=_0x5dbd0d[0x0]['id'],_0xea869=getWorkflowUrl(_0x43c059,_0x8f5f36);console[_0x2f498d(0x349)](_0x2f498d(0x1e7)+a54_0x6e3482[_0x2f498d(0x2c7)](_0xea869));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x2fb);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x1ed);async[a54_0x361fe1(0x1ef)](_0x2dbe45){const _0x31f774=a54_0x361fe1,{options:_0xabc649,args:_0x297550,tdx:_0x17dd50}=_0x2dbe45,_0x1bb6ac=_0x297550[0x0],_0x445ed0=_0xabc649['clear'];if(_0x445ed0)return saveSessionContext({'workflow_project':undefined},_0xabc649[_0x31f774(0x277)]),console[_0x31f774(0x31e)](a54_0x6e3482[_0x31f774(0x1d6)](_0x31f774(0x32f))),0x0;if(!_0x1bb6ac)return console[_0x31f774(0x349)](a54_0x6e3482['red']('Error:'),_0x31f774(0x2ee)),console['error'](a54_0x6e3482[_0x31f774(0x22b)](_0x31f774(0x1f7))),console[_0x31f774(0x349)](a54_0x6e3482['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x370dc6=await withSpinner(_0x31f774(0x273)+_0x1bb6ac+'\x27...',()=>_0x17dd50[_0x31f774(0x1c2)][_0x31f774(0x30d)](_0x1bb6ac),{'verbose':_0xabc649[_0x31f774(0x303)]}),{name:_0x579ab0}=_0x370dc6['data'];return saveSessionContext({'workflow_project':_0x579ab0},_0xabc649['session']),console[_0x31f774(0x31e)](a54_0x6e3482[_0x31f774(0x1d6)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x6e3482['cyan'](_0x579ab0))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x21c);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x295);async[a54_0x361fe1(0x1ef)](_0x4ccb20){const _0x4b2f91=a54_0x361fe1,{options:_0x4bce77,args:_0x75d0b,tdx:_0x288ff1}=_0x4ccb20,_0x371503=_0x75d0b[0x0];_0x4bce77[_0x4b2f91(0x303)]&&_0x371503&&console[_0x4b2f91(0x349)](_0x4b2f91(0x1f2)+_0x371503);const _0x54c616=await withSpinner(_0x4b2f91(0x228),()=>_0x288ff1[_0x4b2f91(0x1c2)]['projects'](_0x371503,{'limit':_0x4bce77['limit']}),{'verbose':_0x4bce77[_0x4b2f91(0x303)]});let _0x368581=_0x54c616[_0x4b2f91(0x1a3)];_0x368581[_0x4b2f91(0x2a5)]((_0x264414,_0x35b541)=>_0x264414['name'][_0x4b2f91(0x269)](_0x35b541['name']));const _0x4b993a=_0x4bce77[_0x4b2f91(0x1bc)]||0x64,_0x2866ef=_0x368581[_0x4b2f91(0x344)]>=_0x4b993a?a54_0x6e3482['dim'](_0x4b2f91(0x230)):'';console['error']('✔\x20Found\x20'+_0x368581[_0x4b2f91(0x344)]+_0x4b2f91(0x21e)+(_0x368581[_0x4b2f91(0x344)]!==0x1?'s':'')+_0x2866ef);if(_0x4bce77[_0x4b2f91(0x2ba)]===_0x4b2f91(0x2d0)||_0x4bce77[_0x4b2f91(0x2ba)]===_0x4b2f91(0x1ca)||_0x4bce77[_0x4b2f91(0x2ba)]===_0x4b2f91(0x252))await handleSDKOutput(_0x368581,_0x4bce77);else{if(_0x368581[_0x4b2f91(0x344)]===0x0)_0x371503?console['log'](_0x4b2f91(0x1bd)+_0x371503):console[_0x4b2f91(0x31e)](_0x4b2f91(0x29d));else{const _0x29d629=_0x368581[_0x4b2f91(0x2fc)](_0x143f80=>{const _0x463ff5=_0x4b2f91,_0x4645e0=_0x143f80['metadata']?.['some'](_0x4ecfab=>_0x4ecfab['key']==='sys'),_0x36d610=_0x4645e0?a54_0x6e3482[_0x463ff5(0x22b)]('\x20(system)'):'';return _0x463ff5(0x2a3)+_0x143f80[_0x463ff5(0x222)]+_0x36d610;});await writeOutput(_0x29d629[_0x4b2f91(0x2f7)]('\x0a'),_0x4bce77['output'],_0x4b2f91(0x20e));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x28e);['description']=a54_0x361fe1(0x29f);async[a54_0x361fe1(0x1ef)](_0x43f057){const _0x554a02=a54_0x361fe1,{options:_0x24e389,args:_0x5b6446,tdx:_0x209fd8}=_0x43f057,_0x49dde1=this[_0x554a02(0x2a6)](_0x5b6446,_0x24e389);_0x24e389[_0x554a02(0x303)]&&_0x49dde1&&console['error'](_0x554a02(0x249)+_0x49dde1);const _0x13a9f7=await withSpinner(_0x554a02(0x211),()=>_0x209fd8['workflow'][_0x554a02(0x251)](_0x49dde1,{'limit':_0x24e389['limit']}),{'verbose':_0x24e389['verbose']});let _0x263ac6=_0x13a9f7[_0x554a02(0x1a3)];_0x263ac6[_0x554a02(0x2a5)]((_0x2af2ce,_0x14ee6e)=>{const _0x2afe07=_0x554a02,_0x1cc057=_0x2af2ce['name'][_0x2afe07(0x269)](_0x14ee6e['name']);if(_0x1cc057!==0x0)return _0x1cc057;return(_0x2af2ce[_0x2afe07(0x34b)]?.[_0x2afe07(0x222)]||'')['localeCompare'](_0x14ee6e[_0x2afe07(0x34b)]?.['name']||'');});const _0x220ca0=_0x24e389[_0x554a02(0x1bc)]||0x64,_0x3a525b=_0x263ac6['length']>=_0x220ca0?a54_0x6e3482[_0x554a02(0x22b)](_0x554a02(0x230)):'';console[_0x554a02(0x349)](_0x554a02(0x346)+_0x263ac6[_0x554a02(0x344)]+'\x20workflow'+(_0x263ac6[_0x554a02(0x344)]!==0x1?'s':'')+_0x3a525b);if(_0x24e389[_0x554a02(0x2ba)]===_0x554a02(0x2d0)||_0x24e389[_0x554a02(0x2ba)]===_0x554a02(0x1ca)||_0x24e389['format']==='table')await handleSDKOutput(_0x263ac6,_0x24e389);else{if(_0x263ac6[_0x554a02(0x344)]===0x0)_0x49dde1?console[_0x554a02(0x31e)](_0x554a02(0x1ce)+_0x49dde1):console[_0x554a02(0x31e)](_0x554a02(0x347));else{const _0x491483=_0x24e389[_0x554a02(0x278)],_0x3ba993=_0x263ac6[_0x554a02(0x2fc)](_0x4829af=>{const _0x2045c5=_0x554a02,_0x3a2014=a54_0x6e3482[_0x2045c5(0x22b)]('#'+_0x4829af['id']),_0x41f1d0=hyperlink(_0x3a2014,getWorkflowUrl(_0x491483,_0x4829af['id'])),_0x5905b0=_0x4829af[_0x2045c5(0x34b)]?.['name']?a54_0x6e3482[_0x2045c5(0x22b)]('\x20('+_0x4829af[_0x2045c5(0x34b)][_0x2045c5(0x222)]+')'):'';return _0x2045c5(0x254)+_0x41f1d0+'\x20'+_0x4829af['name']+_0x5905b0;});await writeOutput(_0x3ba993[_0x554a02(0x2f7)]('\x0a'),_0x24e389[_0x554a02(0x34e)],_0x554a02(0x20e));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x287);[a54_0x361fe1(0x200)]='List\x20workflow\x20execution\x20sessions';async[a54_0x361fe1(0x1ef)](_0x144801){const _0x5813f6=a54_0x361fe1,{options:_0x56a366,args:_0x4c08d1,tdx:_0x31a99a}=_0x144801,_0xc71edf=this['parseProjectWorkflowPattern'](_0x4c08d1,_0x56a366);if(!_0xc71edf)return 0x1;const {projectName:_0x37631e,workflowName:_0xbefdd0}=_0xc71edf;if(_0x56a366[_0x5813f6(0x303)]){if(_0x37631e&&_0xbefdd0)console[_0x5813f6(0x349)](_0x5813f6(0x204)+_0x37631e+'.'+_0xbefdd0);else _0x37631e&&console['error'](_0x5813f6(0x2d7)+_0x37631e);const _0x149a6a=_0x56a366['status'];_0x149a6a&&console[_0x5813f6(0x349)](_0x5813f6(0x288)+_0x149a6a);}let _0x3f1553=0x28;if(process['stdout'][_0x5813f6(0x286)]&&!_0x56a366[_0x5813f6(0x34e)]&&!_0x56a366[_0x5813f6(0x2ba)]){const _0x27638c=process[_0x5813f6(0x2ec)][_0x5813f6(0x2ce)]||0x28;_0x3f1553=Math[_0x5813f6(0x27b)](0x14,Math[_0x5813f6(0x2d2)](_0x27638c*0x2/0x3));}const _0x2b2599=_0x56a366[_0x5813f6(0x1bc)]||_0x3f1553,_0x2d8951=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x31a99a[_0x5813f6(0x1c2)][_0x5813f6(0x214)]({'projectName':_0x37631e,'workflowName':_0xbefdd0,'status':_0x56a366[_0x5813f6(0x330)],'fromTime':_0x56a366[_0x5813f6(0x225)],'toTime':_0x56a366['to'],'limit':_0x2b2599}),{'verbose':_0x56a366[_0x5813f6(0x303)]}),_0x2db8b1=_0x2d8951[_0x5813f6(0x1a3)];_0x2db8b1[_0x5813f6(0x2a5)]((_0x2463d6,_0x4b84d4)=>{const _0x5f4e6c=_0x5813f6,_0x3e53a4=_0x2463d6[_0x5f4e6c(0x1b9)]||'',_0xfdbf69=_0x4b84d4[_0x5f4e6c(0x1b9)]||'';return _0xfdbf69[_0x5f4e6c(0x269)](_0x3e53a4);});_0x2db8b1['length']>=_0x2b2599?console[_0x5813f6(0x349)](_0x5813f6(0x2d5)+_0x2db8b1[_0x5813f6(0x344)]+_0x5813f6(0x227)+a54_0x6e3482[_0x5813f6(0x22b)](_0x5813f6(0x1dc))):console['error']('✔\x20Found\x20'+_0x2db8b1[_0x5813f6(0x344)]+_0x5813f6(0x213)+(_0x2db8b1[_0x5813f6(0x344)]!==0x1?'s':''));if(_0x56a366[_0x5813f6(0x2ba)]==='json'||_0x56a366['format']===_0x5813f6(0x1ca)||_0x56a366['format']===_0x5813f6(0x252))await handleSDKOutput(_0x2db8b1,_0x56a366);else{if(!process['stdout'][_0x5813f6(0x286)]||_0x56a366[_0x5813f6(0x34e)]){if(_0x2db8b1[_0x5813f6(0x344)]===0x0){if(_0x37631e&&_0xbefdd0)console[_0x5813f6(0x31e)](_0x5813f6(0x2aa)+_0x37631e+'.'+_0xbefdd0);else _0x37631e?console[_0x5813f6(0x31e)](_0x5813f6(0x29e)+_0x37631e):console[_0x5813f6(0x31e)]('No\x20sessions\x20found');}else{const _0xf2cd49=_0x56a366['site'],_0x1eab7a=this[_0x5813f6(0x299)](_0x2db8b1,_0xf2cd49);_0x56a366[_0x5813f6(0x34e)]?await writeOutput(_0x1eab7a,_0x56a366[_0x5813f6(0x34e)],_0x5813f6(0x20e)):console[_0x5813f6(0x31e)](_0x1eab7a);}!_0x37631e&&(console['error'](''),console['error'](a54_0x6e3482[_0x5813f6(0x22b)](_0x5813f6(0x32c))),console['error'](a54_0x6e3482['dim'](_0x5813f6(0x1c3))+'or'+a54_0x6e3482[_0x5813f6(0x22b)](_0x5813f6(0x337))));}else{if(_0x2db8b1[_0x5813f6(0x344)]===0x0){if(_0x37631e&&_0xbefdd0)console[_0x5813f6(0x31e)](_0x5813f6(0x2aa)+_0x37631e+'.'+_0xbefdd0);else _0x37631e?console[_0x5813f6(0x31e)](_0x5813f6(0x29e)+_0x37631e):console[_0x5813f6(0x31e)](_0x5813f6(0x29c));}else await this[_0x5813f6(0x2be)](_0x2db8b1,_0x144801,_0x37631e);}}return 0x0;}[a54_0x361fe1(0x299)](_0x5bc687,_0x3abdd8){const _0x56a6d9=a54_0x361fe1,_0x1f0201=[],_0x82652e=new Map();let _0x20782f=Infinity,_0x14929c=-Infinity;for(const _0x152497 of _0x5bc687){if(_0x152497[_0x56a6d9(0x20c)]?.['createdAt']){const _0x59da9c=new Date(_0x152497[_0x56a6d9(0x20c)]['createdAt'])[_0x56a6d9(0x246)](),_0x4eaeb2=_0x152497[_0x56a6d9(0x20c)]['finishedAt']?new Date(_0x152497['lastAttempt'][_0x56a6d9(0x1f8)])['getTime']():Date[_0x56a6d9(0x25c)](),_0x3c8393=_0x152497[_0x56a6d9(0x34b)]?.['name']||_0x56a6d9(0x1a0);!_0x82652e[_0x56a6d9(0x312)](_0x3c8393)&&_0x82652e[_0x56a6d9(0x31d)](_0x3c8393,[]),_0x82652e[_0x56a6d9(0x247)](_0x3c8393)['push']({'session':_0x152497,'startTime':_0x59da9c,'endTime':_0x4eaeb2,'duration':_0x4eaeb2-_0x59da9c}),_0x20782f=Math[_0x56a6d9(0x1aa)](_0x20782f,_0x59da9c),_0x14929c=Math['max'](_0x14929c,_0x4eaeb2);}}if(_0x82652e[_0x56a6d9(0x22a)]===0x0)return _0x56a6d9(0x2bd);const _0x41ec9=process[_0x56a6d9(0x2ec)][_0x56a6d9(0x1a6)]||0x78,_0x4468cb=0x1e,_0x52c793=0x32,_0x431035=0x4,_0x47994b=Math['min'](_0x52c793,Math[_0x56a6d9(0x27b)](_0x4468cb,Math['floor'](_0x41ec9*0.3))),_0x14025c=_0x41ec9-_0x47994b-TIMELINE_CONFIG[_0x56a6d9(0x207)]-0x3-_0x431035,_0xf15ca5=_0x14929c-_0x20782f,_0x5a3076=_0xf15ca5/_0x47994b,_0x45d1a5=renderTimeAxis({'startTime':_0x20782f,'endTime':_0x14929c,'durationMs':_0xf15ca5,'msPerChar':_0x5a3076},_0x47994b),_0x4e1c66=[];for(const _0x2e576f of _0x82652e[_0x56a6d9(0x26f)]()){_0x4e1c66[_0x56a6d9(0x201)](..._0x2e576f);}_0x4e1c66[_0x56a6d9(0x2a5)]((_0x3cb5b3,_0x49eda8)=>_0x49eda8[_0x56a6d9(0x19e)]-_0x3cb5b3['startTime']);const _0x1ae893=new Date(_0x20782f),_0x1517bc=formatDate(_0x1ae893),_0x1d0ae4=_0x431035+TIMELINE_CONFIG[_0x56a6d9(0x324)]+TIMELINE_CONFIG[_0x56a6d9(0x306)]+_0x14025c,_0x539353='\x20'['repeat'](_0x1d0ae4-_0x1517bc[_0x56a6d9(0x344)]),_0x5e4bb7=_0x539353+a54_0x6e3482['dim'](_0x1517bc)+'\x20'+_0x45d1a5;_0x1f0201['push'](_0x5e4bb7);const _0x449dee=0x16;let _0x2a62dc=0x0;for(const _0x8e477f of _0x4e1c66){const _0x2a5dbd=_0x8e477f[_0x56a6d9(0x277)][_0x56a6d9(0x34b)]?.[_0x56a6d9(0x222)]||'?',_0x55d694=Math[_0x56a6d9(0x1aa)](stringWidth(_0x2a5dbd),_0x449dee);_0x2a62dc=Math['max'](_0x2a62dc,_0x55d694);}for(const _0xf3bfb1 of _0x4e1c66){const {session:_0xfa03e7,startTime:_0x5a77ff,endTime:_0x1eece8,duration:_0x173ee4}=_0xf3bfb1,_0x32dd65=_0xfa03e7[_0x56a6d9(0x34b)]?.['id'],_0x517865=_0xfa03e7['id'],_0x2d2f73=_0xfa03e7[_0x56a6d9(0x34b)]?.[_0x56a6d9(0x222)]||'?',_0x18e1fd=_0xfa03e7['workflow']?.[_0x56a6d9(0x222)]||'?';let _0x271789,_0x5542c8;if(_0xfa03e7[_0x56a6d9(0x20c)]){const _0x2bac06=_0xfa03e7['lastAttempt'];!_0x2bac06['done']?(_0x271789=_0x2bac06['cancelRequested']?'🛑':'🔄',_0x5542c8=_0x2bac06[_0x56a6d9(0x262)]?a54_0x6e3482[_0x56a6d9(0x259)]:a54_0x6e3482[_0x56a6d9(0x209)]):(_0x271789=_0x2bac06[_0x56a6d9(0x19a)]?'✅':'❌',_0x5542c8=_0x2bac06[_0x56a6d9(0x19a)]?a54_0x6e3482[_0x56a6d9(0x1d6)]:a54_0x6e3482[_0x56a6d9(0x1d0)]);}else _0x271789='⏳',_0x5542c8=a54_0x6e3482[_0x56a6d9(0x22b)];const _0x1fe275='#'+_0x517865,_0x412c4c=_0x32dd65?hyperlink(_0x1fe275,getWorkflowSessionUrl(_0x3abdd8,_0x32dd65,_0x517865)):_0x1fe275;let _0x41812d=_0x2d2f73;stringWidth(_0x2d2f73)>_0x449dee&&(_0x41812d=_0x2d2f73[_0x56a6d9(0x1f9)](0x0,_0x449dee-0x1)+'…');const _0x1e6b1d=a54_0x6e3482[_0x56a6d9(0x22b)](_0x41812d),_0x44663a=stringWidth(_0x41812d),_0xdd55c3='\x20'[_0x56a6d9(0x31a)](_0x2a62dc-stringWidth(_0x41812d)+0x2),_0x2bf487='('+formatElapsed(_0x173ee4)+')',_0x3d4817=stringWidth(_0x2bf487),_0x10dbf9=stringWidth(_0x1fe275),_0x3ecb9b=_0x10dbf9+0x1+_0x44663a+_0xdd55c3[_0x56a6d9(0x344)],_0x525fc6=_0x14025c-_0x3ecb9b-_0x3d4817-0x1-0x8;let _0x21490c=_0x18e1fd;stringWidth(_0x21490c)>_0x525fc6&&(_0x21490c=_0x21490c[_0x56a6d9(0x1f9)](0x0,_0x525fc6-0x1)+'…');const _0x42946f=_0x412c4c+'\x20'+_0x1e6b1d+_0xdd55c3+_0x21490c,_0x3b3bc1=stringWidth(_0x42946f),_0x2a921b=_0x14025c-_0x3b3bc1-_0x3d4817,_0x1930b8=_0x42946f+'\x20'[_0x56a6d9(0x31a)](Math[_0x56a6d9(0x27b)](0x1,_0x2a921b))+a54_0x6e3482[_0x56a6d9(0x22b)](_0x2bf487),_0x5b8630=Math[_0x56a6d9(0x2d2)]((_0x5a77ff-_0x20782f)/_0x5a3076),_0x2f74f8=Math[_0x56a6d9(0x2d2)]((_0x1eece8-_0x20782f)/_0x5a3076),_0x4c1a59=Math['max'](_0x5b8630+0x1,_0x2f74f8),_0x45477d=new Array(_0x47994b)[_0x56a6d9(0x1b8)]('\x20');for(let _0x4d7de4=_0x5b8630;_0x4d7de4<Math[_0x56a6d9(0x1aa)](_0x4c1a59,_0x47994b);_0x4d7de4++){_0x45477d[_0x4d7de4]='─';}const _0x11f113=_0x45477d[_0x56a6d9(0x2fc)](_0x59fcc9=>_0x59fcc9==='\x20'?'\x20':_0x5542c8(_0x59fcc9))[_0x56a6d9(0x2f7)]('');_0x1f0201[_0x56a6d9(0x201)](_0x271789+'\x20'+_0x1930b8+'│'+_0x11f113+'│');}return _0x1f0201[_0x56a6d9(0x2f7)]('\x0a');}async['navigateSessionsInteractive'](_0x4e0b50,_0x307e3c,_0x192487){const _0x111283=a54_0x361fe1,{options:_0x264388,tdx:_0x565cf6}=_0x307e3c,_0x213a68=_0x264388[_0x111283(0x278)],{timelineRows:_0x2a0670,timeAxisHeader:_0x258b90}=this['generateSessionTimelineRows'](_0x4e0b50,_0x213a68),_0x1d995a=_0x2a0670[_0x111283(0x316)](_0x47a479=>_0x47a479['attemptId']);if(_0x1d995a[_0x111283(0x344)]===0x0){const _0x4c9773=this[_0x111283(0x299)](_0x4e0b50,_0x213a68);console[_0x111283(0x31e)](_0x4c9773);!_0x192487&&(console[_0x111283(0x349)](''),console[_0x111283(0x349)](a54_0x6e3482[_0x111283(0x22b)](_0x111283(0x32c))),console[_0x111283(0x349)](a54_0x6e3482[_0x111283(0x22b)](_0x111283(0x1c3))+'or'+a54_0x6e3482[_0x111283(0x22b)](_0x111283(0x337))));return;}_0x258b90&&console[_0x111283(0x31e)](_0x258b90);const _0x11cb00=_0x2a0670['filter'](_0x16bfb7=>_0x16bfb7[_0x111283(0x2ef)])[_0x111283(0x2fc)](_0x40719c=>({'title':_0x40719c[_0x111283(0x244)],'value':_0x40719c['attemptId']})),_0x542bec=process[_0x111283(0x2ec)]['rows']||0x3c,_0x28576a=Math['max'](0x28,Math[_0x111283(0x2d2)](_0x542bec*0x2/0x3)),_0x322319=await a54_0x15ced4({'type':_0x111283(0x208),'name':_0x111283(0x2ef),'message':_0x111283(0x22c),'choices':_0x11cb00,'initial':-0x1,'limit':_0x28576a,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x27b5b8,_0x4e3c11)=>{const _0x2ed7d9=_0x111283;if(!_0x27b5b8)return Promise['resolve'](_0x4e3c11);const _0x3e9bb7=_0x4e3c11[_0x2ed7d9(0x316)](_0x4c5cff=>{const _0x58d0a1=_0x2ed7d9,_0x38f8b6=_0x4c5cff;return _0x38f8b6['title'][_0x58d0a1(0x22f)]()[_0x58d0a1(0x237)](_0x27b5b8[_0x58d0a1(0x22f)]());});return Promise[_0x2ed7d9(0x258)](_0x3e9bb7);}}),_0x5038af=()=>{const _0xaa6d1c=_0x111283;process[_0xaa6d1c(0x2ec)][_0xaa6d1c(0x301)](_0xaa6d1c(0x30c)),process[_0xaa6d1c(0x2ec)][_0xaa6d1c(0x301)]('\x1b[1A\x1b[2K'),process[_0xaa6d1c(0x2ec)][_0xaa6d1c(0x301)](_0xaa6d1c(0x30c));},_0x336c82=_0x322319&&_0x322319[_0x111283(0x2ef)]&&_0x322319[_0x111283(0x2ef)]!==null&&_0x322319[_0x111283(0x2ef)][_0x111283(0x23f)]()!=='';if(!_0x336c82){_0x5038af(),console[_0x111283(0x31e)](a54_0x6e3482[_0x111283(0x22b)](_0x111283(0x2c2)));return;}_0x5038af();const _0x30ed22=_0x4e0b50[_0x111283(0x2bf)](_0x433484=>_0x433484[_0x111283(0x20c)]?.['id']===_0x322319[_0x111283(0x2ef)]);if(_0x30ed22){const _0x7e4922=_0x30ed22['project']?.[_0x111283(0x222)]||'?',_0x2dd00e=_0x30ed22[_0x111283(0x1c2)]?.[_0x111283(0x222)]||'?';console[_0x111283(0x31e)](_0x111283(0x32b)+a54_0x6e3482[_0x111283(0x22b)](_0x7e4922)+_0x111283(0x220)+a54_0x6e3482['dim'](_0x2dd00e));}const _0x1d8b00=new WorkflowTimelineCommand();await _0x1d8b00[_0x111283(0x1ef)]({'args':[],'options':{..._0x264388,'attemptId':_0x322319[_0x111283(0x2ef)]},'tdx':_0x565cf6});}[a54_0x361fe1(0x266)](_0x52bb36,_0x4c2064){const _0x3d1a9a=a54_0x361fe1,_0x56af7a=new Map();for(const _0x53ad67 of _0x52bb36){_0x53ad67['id']&&_0x53ad67['lastAttempt']?.['id']&&_0x56af7a[_0x3d1a9a(0x31d)](_0x53ad67['id'],_0x53ad67[_0x3d1a9a(0x20c)]['id']);}const _0x1a381f=[];let _0xc14f54='';const _0x48d859=this['renderSessionsTimeline'](_0x52bb36,_0x4c2064),_0x4661c3=_0x48d859[_0x3d1a9a(0x332)]('\x0a');for(const _0x3672e0 of _0x4661c3){if(_0x3672e0[_0x3d1a9a(0x1b1)](_0x3d1a9a(0x24a))||_0x3672e0[_0x3d1a9a(0x1e0)](/^\s+\d{4}-\d{2}-\d{2}/))_0xc14f54=_0x3672e0;else{if(_0x3672e0['match'](/^[✅❌🔄🛑⏳]/)){const _0x1257f1=_0x3672e0[_0x3d1a9a(0x1e0)](/#(\d+)/),_0x1c4d9a=_0x1257f1?_0x1257f1[0x1]:null,_0x183e52=_0x1c4d9a?_0x56af7a[_0x3d1a9a(0x247)](_0x1c4d9a)||null:null,_0x575020=_0x52bb36[_0x3d1a9a(0x2bf)](_0x89087b=>_0x89087b['id']===_0x1c4d9a),_0x169e8e=_0x575020?.['project']?.['name']||'';_0x1a381f[_0x3d1a9a(0x201)]({'displayLine':_0x3672e0,'attemptId':_0x183e52,'projectName':_0x169e8e});}}}return{'timelineRows':_0x1a381f,'timeAxisHeader':_0xc14f54};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]='workflow:attempts';[a54_0x361fe1(0x200)]=a54_0x361fe1(0x1a4);async[a54_0x361fe1(0x1ef)](_0x156e54){const _0x23f4ff=a54_0x361fe1,{options:_0x298363,args:_0x52fbcb,tdx:_0x2f9ae7}=_0x156e54,_0x5b5c48=this[_0x23f4ff(0x1f1)](_0x52fbcb,_0x298363);if(!_0x5b5c48)return 0x1;const {projectName:_0x5d5b5c,workflowName:_0x22174a}=_0x5b5c48,_0x35b968=_0x298363[_0x23f4ff(0x283)];if(_0x298363[_0x23f4ff(0x303)]){if(_0x5d5b5c&&_0x22174a)console[_0x23f4ff(0x349)]('Filter:\x20'+_0x5d5b5c+'.'+_0x22174a);else _0x5d5b5c&&console['error'](_0x23f4ff(0x2d7)+_0x5d5b5c);_0x35b968&&console['error'](_0x23f4ff(0x243));}const _0x4cb2e4=await withSpinner(_0x23f4ff(0x257),()=>_0x2f9ae7[_0x23f4ff(0x1c2)]['attempts']({'projectName':_0x5d5b5c,'workflowName':_0x22174a,'includeRetried':_0x35b968,'limit':_0x298363['limit']}),{'verbose':_0x298363['verbose']}),_0x4aef9d=_0x4cb2e4[_0x23f4ff(0x1a3)],_0x1aa2b9=_0x298363['limit']||0x64,_0x3630dc=_0x4aef9d['length']>=_0x1aa2b9?a54_0x6e3482[_0x23f4ff(0x22b)](_0x23f4ff(0x230)):'';console[_0x23f4ff(0x349)](_0x23f4ff(0x346)+_0x4aef9d[_0x23f4ff(0x344)]+_0x23f4ff(0x308)+(_0x4aef9d[_0x23f4ff(0x344)]!==0x1?'s':'')+_0x3630dc);if(_0x298363[_0x23f4ff(0x2ba)]==='json'||_0x298363['format']==='jsonl'||_0x298363[_0x23f4ff(0x2ba)]==='table')await handleSDKOutput(_0x4aef9d,_0x298363);else{if(_0x4aef9d[_0x23f4ff(0x344)]===0x0){if(_0x5d5b5c&&_0x22174a)console[_0x23f4ff(0x31e)](_0x23f4ff(0x263)+_0x5d5b5c+'.'+_0x22174a);else _0x5d5b5c?console[_0x23f4ff(0x31e)](_0x23f4ff(0x32d)+_0x5d5b5c):console['log'](_0x23f4ff(0x2f8));}else{const _0xa9ab4c=_0x298363[_0x23f4ff(0x278)],_0x282af5=_0x4aef9d[_0x23f4ff(0x2fc)](_0x4b3038=>{const _0xbd75b4=_0x23f4ff,_0x44c840=a54_0x6e3482['dim']('#'+_0x4b3038['id']),_0x319ec5=_0x4b3038[_0xbd75b4(0x34b)]?.['id'],_0x2e5a0d=_0x4b3038['session_id']||_0x4b3038['sessionId'],_0x3134de=_0x319ec5&&_0x2e5a0d?hyperlink(_0x44c840,getWorkflowAttemptUrl(_0xa9ab4c,_0x319ec5,_0x2e5a0d,_0x4b3038['id'])):_0x44c840,{icon:_0x30df42,text:_0x3cb3db}=getAttemptStatusDisplay(_0x4b3038),_0x371992=(_0x4b3038['project']?.[_0xbd75b4(0x222)]||'?')+'.'+(_0x4b3038['workflow']?.['name']||'?'),_0x14b844=_0x4b3038[_0xbd75b4(0x1b9)]?a54_0x6e3482[_0xbd75b4(0x22b)](_0x4b3038[_0xbd75b4(0x1b9)]):'';return(_0x3134de+'\x20'+_0x30df42+(_0x3cb3db?'\x20'+_0x3cb3db:'')+'\x20'+_0x371992+'\x20'+_0x14b844)['trimEnd']();});await writeOutput(_0x282af5[_0x23f4ff(0x2f7)]('\x0a'),_0x298363[_0x23f4ff(0x34e)],_0x23f4ff(0x20e));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x361fe1(0x222)]='workflow:attempt';['description']=a54_0x361fe1(0x1a9);async[a54_0x361fe1(0x1ef)](_0x536da1){const _0x283fc0=a54_0x361fe1,{options:_0x515c63,args:_0xcbe5dd,tdx:_0x4e486a}=_0x536da1,_0x3fa554=_0xcbe5dd[0x0];if(!_0x3fa554)return console[_0x283fc0(0x349)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x515c63[_0x283fc0(0x303)]&&console[_0x283fc0(0x349)](_0x283fc0(0x1fd)+_0x3fa554);const _0x3a7aeb=await withSpinner(_0x283fc0(0x1b2),()=>_0x4e486a[_0x283fc0(0x1c2)][_0x283fc0(0x2d4)](_0x3fa554),{'verbose':_0x515c63[_0x283fc0(0x303)]}),_0xaaae5e=_0x3a7aeb[_0x283fc0(0x1a3)];let _0x8c323b;!_0xaaae5e[_0x283fc0(0x234)]?_0x8c323b=_0xaaae5e['cancelRequested']?'canceling':_0x283fc0(0x33e):_0x8c323b=_0xaaae5e[_0x283fc0(0x19a)]?'success':_0x283fc0(0x349);let _0x42a1ba;if(_0xaaae5e[_0x283fc0(0x1ec)]&&_0xaaae5e[_0x283fc0(0x1f8)]){const _0x3079f8=new Date(_0xaaae5e['createdAt'])[_0x283fc0(0x246)](),_0x49d37b=new Date(_0xaaae5e[_0x283fc0(0x1f8)])[_0x283fc0(0x246)]();_0x42a1ba=Math[_0x283fc0(0x215)]((_0x49d37b-_0x3079f8)/0x3e8);}const _0x85a7ad={'attempt_id':_0xaaae5e['id'],'status':_0x8c323b,..._0xaaae5e[_0x283fc0(0x23d)]!==undefined&&{'index':_0xaaae5e['index']},..._0xaaae5e['project']&&{'project':_0xaaae5e['project'][_0x283fc0(0x222)]},..._0xaaae5e[_0x283fc0(0x1c2)]&&{'workflow':_0xaaae5e[_0x283fc0(0x1c2)]['name']},..._0xaaae5e[_0x283fc0(0x31f)]&&{'session_id':_0xaaae5e[_0x283fc0(0x31f)]},..._0xaaae5e[_0x283fc0(0x1b9)]&&{'session_time':_0xaaae5e['sessionTime']},..._0xaaae5e['retryAttemptName']&&{'retry_attempt':_0xaaae5e[_0x283fc0(0x25a)]},..._0x42a1ba!==undefined&&{'duration_sec':_0x42a1ba},..._0xaaae5e['createdAt']&&{'created_at':_0xaaae5e[_0x283fc0(0x1ec)]},..._0xaaae5e[_0x283fc0(0x1f8)]&&{'finished_at':_0xaaae5e['finishedAt']},...Object[_0x283fc0(0x1be)](_0xaaae5e['params'])[_0x283fc0(0x344)]>0x0&&{'params':_0xaaae5e[_0x283fc0(0x334)]}};return await handleSingleObjectOutput(_0x85a7ad,_0x515c63),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x361fe1(0x1a5);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x1ee);async[a54_0x361fe1(0x1ef)](_0x1246e2){const _0x312b28=a54_0x361fe1,{options:_0x3f3886,args:_0xe21764,tdx:_0x2fba23}=_0x1246e2,_0x533a9b=_0xe21764[0x0];if(!_0x533a9b)return console[_0x312b28(0x349)](_0x312b28(0x1cb)),0x1;const _0x62951=_0x3f3886[_0x312b28(0x291)];_0x3f3886[_0x312b28(0x303)]&&(console[_0x312b28(0x349)]('Attempt\x20ID:\x20'+_0x533a9b),_0x62951&&console[_0x312b28(0x349)](_0x312b28(0x1cc)));const _0x3dd57c=await withSpinner(_0x312b28(0x2b6),()=>_0x2fba23[_0x312b28(0x1c2)]['tasks'](_0x533a9b,_0x62951||![]),{'verbose':_0x3f3886[_0x312b28(0x303)]}),_0x349334=_0x3dd57c[_0x312b28(0x1a3)];return console[_0x312b28(0x349)](_0x312b28(0x346)+_0x349334[_0x312b28(0x344)]+_0x312b28(0x2cc)+(_0x349334[_0x312b28(0x344)]!==0x1?'s':'')),await handleSDKOutput(_0x349334,_0x3f3886),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x1db);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x2dc);async[a54_0x361fe1(0x1ef)](_0x588d48){const _0x2939a9=a54_0x361fe1,{options:_0x3d03fd,args:_0x504e85,tdx:_0x42806a}=_0x588d48,_0x1a1af1=_0x504e85[0x0];let _0x59d058=_0x504e85[0x1];if(!_0x1a1af1)return console[_0x2939a9(0x349)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3d03fd['verbose']&&(console[_0x2939a9(0x349)](_0x2939a9(0x1fd)+_0x1a1af1),_0x59d058&&console['error'](_0x2939a9(0x26b)+_0x59d058));const _0x20103a=await withSpinner(_0x2939a9(0x1bf),()=>_0x42806a[_0x2939a9(0x1c2)]['logFiles'](_0x1a1af1,_0x59d058),{'verbose':_0x3d03fd[_0x2939a9(0x303)]}),_0x2e71f2=_0x20103a[_0x2939a9(0x1a3)];if(_0x2e71f2[_0x2939a9(0x344)]===0x0)return console[_0x2939a9(0x349)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x59d058&&(_0x3d03fd[_0x2939a9(0x2d0)]||_0x3d03fd[_0x2939a9(0x2ba)]))return await handleSDKOutput(_0x2e71f2,_0x3d03fd),0x0;if(!_0x59d058){const _0x2a9dc6=_0x2e71f2['map'](_0x4f1247=>({'title':_0x4f1247['taskName']+'\x20('+formatBytes(_0x4f1247['fileSize'])+')','value':_0x4f1247[_0x2939a9(0x255)]})),_0x1b796b=await a54_0x15ced4({'type':_0x2939a9(0x206),'name':_0x2939a9(0x314),'message':_0x2939a9(0x2ff),'choices':_0x2a9dc6});if(!_0x1b796b[_0x2939a9(0x314)])return console['error']('Cancelled'),0x0;_0x59d058=_0x1b796b[_0x2939a9(0x314)];}const _0x39d271=await withSpinner(_0x2939a9(0x1b6),()=>_0x42806a[_0x2939a9(0x1c2)][_0x2939a9(0x280)](_0x1a1af1,_0x59d058),{'verbose':_0x3d03fd[_0x2939a9(0x303)]}),_0x283859=_0x39d271[_0x2939a9(0x1a3)];return _0x283859?console[_0x2939a9(0x31e)](_0x283859):console[_0x2939a9(0x349)](_0x2939a9(0x1ad)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x264);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x34a);async[a54_0x361fe1(0x1ef)](_0x2354e3){const _0x3a5524=a54_0x361fe1,{options:_0x13a96b,args:_0x4ba381,tdx:_0x3d111a}=_0x2354e3,_0x1984e6=_0x4ba381[0x0];if(!_0x1984e6)return console[_0x3a5524(0x349)](_0x3a5524(0x1cb)),0x1;const _0xa2248f=_0x13a96b[_0x3a5524(0x260)];_0x13a96b[_0x3a5524(0x303)]&&(console[_0x3a5524(0x349)](_0x3a5524(0x1fd)+_0x1984e6),_0xa2248f&&console[_0x3a5524(0x349)](_0x3a5524(0x274)+_0xa2248f));if(!_0x13a96b['yes']){if(!isInteractive())return console[_0x3a5524(0x349)](a54_0x6e3482[_0x3a5524(0x1d0)](_0x3a5524(0x22e)),_0x3a5524(0x2e3)),console[_0x3a5524(0x349)](a54_0x6e3482[_0x3a5524(0x22b)](_0x3a5524(0x315))),0x1;const _0x58047f=await confirmKey(_0x3a5524(0x1c8)+_0x1984e6+'?');if(!_0x58047f)return console['error'](a54_0x6e3482[_0x3a5524(0x259)]('Cancelled')),0x1;}const _0x317435=await withSpinner('Killing\x20attempt...',()=>_0x3d111a[_0x3a5524(0x1c2)]['kill'](_0x1984e6,_0xa2248f),{'verbose':_0x13a96b[_0x3a5524(0x303)]}),_0xfd6e9b=_0x317435['data'];return console[_0x3a5524(0x349)]('✔\x20'+_0xfd6e9b),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';[a54_0x361fe1(0x200)]=a54_0x361fe1(0x2a1);async['execute'](_0x477877){const _0x53c7b3=a54_0x361fe1,{options:_0x21e06e,args:_0x2f6818,tdx:_0x365a62}=_0x477877,_0x9cd1e2=_0x2f6818[0x0];if(!_0x9cd1e2)return console[_0x53c7b3(0x349)](_0x53c7b3(0x33d)),console[_0x53c7b3(0x349)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x4667db=![],_0x10ac0a=_0x9cd1e2;if(_0x9cd1e2[_0x53c7b3(0x1b1)]('session:'))_0x4667db=!![],_0x10ac0a=_0x9cd1e2[_0x53c7b3(0x2cf)](0x8);else{if(_0x9cd1e2[_0x53c7b3(0x1b1)](_0x53c7b3(0x1f5)))_0x4667db=![],_0x10ac0a=_0x9cd1e2[_0x53c7b3(0x2cf)](0x8);else return console[_0x53c7b3(0x349)](_0x53c7b3(0x339)),console[_0x53c7b3(0x349)](_0x53c7b3(0x331)),0x1;}const _0x558eb5=_0x21e06e[_0x53c7b3(0x1af)],_0x7b9a6a=_0x21e06e[_0x53c7b3(0x342)],_0x1a3c6e=_0x21e06e['params'],_0x26224a=_0x21e06e[_0x53c7b3(0x23a)];_0x21e06e['verbose']&&(console[_0x53c7b3(0x349)](_0x53c7b3(0x2d6)+(_0x4667db?_0x53c7b3(0x277):_0x53c7b3(0x2d4))+'\x20'+_0x10ac0a),_0x558eb5&&console['error'](_0x53c7b3(0x2ae)+_0x558eb5),_0x7b9a6a&&console[_0x53c7b3(0x349)](_0x53c7b3(0x250)+_0x7b9a6a),_0x1a3c6e&&console[_0x53c7b3(0x349)](_0x53c7b3(0x231)+_0x1a3c6e),_0x26224a&&console[_0x53c7b3(0x349)](_0x53c7b3(0x1f3)));let _0x46ff01;if(_0x1a3c6e)try{if(_0x1a3c6e[_0x53c7b3(0x1b1)]('@')){const _0x1675d8=await import('fs/promises'),_0x2babce=_0x1a3c6e['substring'](0x1),_0x5dd6f1=await _0x1675d8[_0x53c7b3(0x2b2)](_0x2babce,_0x53c7b3(0x27a));_0x46ff01=JSON['parse'](_0x5dd6f1);}else _0x46ff01=JSON[_0x53c7b3(0x2c5)](_0x1a3c6e);}catch{return console['error'](_0x53c7b3(0x2f2)),0x1;}if(!_0x21e06e['yes']){if(!isInteractive())return console[_0x53c7b3(0x349)](a54_0x6e3482[_0x53c7b3(0x1d0)]('\x0aError:'),_0x53c7b3(0x2e3)),console[_0x53c7b3(0x349)](a54_0x6e3482[_0x53c7b3(0x22b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x28fd91=await confirmKey(_0x53c7b3(0x1b7)+(_0x4667db?_0x53c7b3(0x277):_0x53c7b3(0x2d4))+'\x20'+_0x10ac0a+'?');if(!_0x28fd91)return console['error'](a54_0x6e3482['yellow'](_0x53c7b3(0x2c2))),0x1;}let _0x378fbc;_0x4667db?_0x378fbc=await withSpinner(_0x53c7b3(0x2e4),()=>_0x365a62[_0x53c7b3(0x1c2)][_0x53c7b3(0x1c6)](_0x10ac0a,{'fromTask':_0x558eb5,'retryParams':_0x46ff01}),{'verbose':_0x21e06e['verbose']}):_0x378fbc=await withSpinner(_0x53c7b3(0x2d8),()=>_0x365a62[_0x53c7b3(0x1c2)][_0x53c7b3(0x24c)](_0x10ac0a,{'resumeFrom':_0x7b9a6a,'retryParams':_0x46ff01,'force':_0x26224a}),{'verbose':_0x21e06e['verbose']});const _0x35bd7d=_0x378fbc[_0x53c7b3(0x1a3)];return console['error']('✔\x20Retry\x20started'),console[_0x53c7b3(0x349)](_0x53c7b3(0x33a)+_0x35bd7d[_0x53c7b3(0x2ef)]),console['error'](_0x53c7b3(0x27d)+_0x35bd7d[_0x53c7b3(0x31f)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x216);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x271);async['execute'](_0x29d769){const _0x1990e4=a54_0x361fe1,{options:_0x3bfafa,args:_0x457162,tdx:_0x407140}=_0x29d769;let _0x128b2f=_0x457162[0x0];if(!_0x128b2f){const _0x39a747=this[_0x1990e4(0x2a6)]([],_0x3bfafa),_0x1b4494=await withSpinner(_0x1990e4(0x2a0),()=>_0x407140[_0x1990e4(0x1c2)][_0x1990e4(0x251)](_0x39a747,{'limit':_0x3bfafa['limit']}),{'verbose':_0x3bfafa[_0x1990e4(0x303)]}),_0x31cb3c=_0x1b4494[_0x1990e4(0x1a3)];if(_0x31cb3c[_0x1990e4(0x344)]===0x0)return console[_0x1990e4(0x349)](_0x1990e4(0x347)),!_0x39a747&&console[_0x1990e4(0x349)](a54_0x6e3482['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x2f1331=_0x31cb3c[_0x1990e4(0x2fc)](_0x43ab9b=>({'title':_0x43ab9b['project']?.[_0x1990e4(0x222)]+'.'+_0x43ab9b['name'],'value':_0x43ab9b[_0x1990e4(0x34b)]?.[_0x1990e4(0x222)]+'.'+_0x43ab9b[_0x1990e4(0x222)],'description':_0x43ab9b[_0x1990e4(0x2f9)]?'revision:\x20'+_0x43ab9b['revision']:undefined})),_0x27a4a8=await a54_0x15ced4({'type':'select','name':'workflow','message':_0x1990e4(0x23e),'choices':_0x2f1331});if(!_0x27a4a8[_0x1990e4(0x1c2)])return 0x1;_0x128b2f=_0x27a4a8[_0x1990e4(0x1c2)];}if(!_0x128b2f[_0x1990e4(0x237)]('.')){const _0x54ba07=this[_0x1990e4(0x2a6)]([],_0x3bfafa);if(_0x54ba07)_0x128b2f=_0x54ba07+'.'+_0x128b2f;else return console[_0x1990e4(0x349)](a54_0x6e3482['red']('Error:'),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x1990e4(0x349)](a54_0x6e3482[_0x1990e4(0x22b)](_0x1990e4(0x224))),0x1;}const _0x1b0e69=_0x3bfafa[_0x1990e4(0x284)],_0x46f995=_0x3bfafa[_0x1990e4(0x1b9)],_0x10b920={};if(_0x1b0e69&&Array[_0x1990e4(0x2c0)](_0x1b0e69))for(const _0x2a2a24 of _0x1b0e69){const _0x2eada4=_0x2a2a24[_0x1990e4(0x296)]('=');if(_0x2eada4===-0x1)return console[_0x1990e4(0x349)](_0x1990e4(0x233)+_0x2a2a24),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x40e4e7=_0x2a2a24[_0x1990e4(0x2cf)](0x0,_0x2eada4),_0xb0a41c=_0x2a2a24[_0x1990e4(0x2cf)](_0x2eada4+0x1);try{_0x10b920[_0x40e4e7]=JSON[_0x1990e4(0x2c5)](_0xb0a41c);}catch{_0x10b920[_0x40e4e7]=_0xb0a41c;}}_0x3bfafa[_0x1990e4(0x303)]&&(console[_0x1990e4(0x349)]('Workflow:\x20'+_0x128b2f),Object[_0x1990e4(0x1be)](_0x10b920)[_0x1990e4(0x344)]>0x0&&console['error'](_0x1990e4(0x2b8)+JSON[_0x1990e4(0x1d7)](_0x10b920)),_0x46f995&&console['error'](_0x1990e4(0x1a1)+_0x46f995));const _0x48b12f=await withSpinner('Starting\x20workflow\x20run...',()=>_0x407140[_0x1990e4(0x1c2)]['run'](_0x128b2f,_0x10b920,{'sessionTime':_0x46f995}),{'verbose':_0x3bfafa['verbose']}),_0x518fbc=_0x48b12f['data'];console[_0x1990e4(0x349)](_0x1990e4(0x309)),console[_0x1990e4(0x349)](_0x1990e4(0x2e1)+_0x518fbc['id']),console[_0x1990e4(0x349)](_0x1990e4(0x27d)+_0x518fbc[_0x1990e4(0x31f)]),console['error'](_0x1990e4(0x304)+_0x518fbc[_0x1990e4(0x34b)]?.['name']),console['error'](_0x1990e4(0x2c3)+_0x518fbc['workflow']?.[_0x1990e4(0x222)]);if(_0x518fbc[_0x1990e4(0x34b)]?.['id']&&_0x518fbc[_0x1990e4(0x31f)]&&_0x518fbc['id']){const _0x2059d=_0x3bfafa['site'],_0x4c6161=getConsoleUrl(_0x2059d,_0x1990e4(0x311)+_0x518fbc[_0x1990e4(0x34b)]['id']+'/sessions/'+_0x518fbc[_0x1990e4(0x31f)]+_0x1990e4(0x2f5)+_0x518fbc['id']);console[_0x1990e4(0x349)](_0x1990e4(0x1e7)+a54_0x6e3482[_0x1990e4(0x2c7)](_0x4c6161));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x221);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x232);async['execute'](_0x2d6966){const _0x12d7fa=a54_0x361fe1,{options:_0x17d6eb,args:_0x57d230,tdx:_0x384fdc}=_0x2d6966,_0x194917=_0x57d230[0x0],_0x96d014=_0x57d230[0x1]||'.';if(!_0x194917)return console[_0x12d7fa(0x349)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x12d7fa(0x349)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x633b35=_0x17d6eb['revision'];_0x17d6eb[_0x12d7fa(0x303)]&&(console['error']('Project:\x20'+_0x194917),console['error'](_0x12d7fa(0x305)+_0x96d014),_0x633b35&&console[_0x12d7fa(0x349)]('Revision:\x20'+_0x633b35));const _0x39a07e=await withSpinner('Downloading\x20project\x20'+_0x194917+_0x12d7fa(0x1ea),()=>_0x384fdc[_0x12d7fa(0x1c2)]['download'](_0x194917,_0x96d014,{'revision':_0x633b35}),{'verbose':_0x17d6eb['verbose']}),_0x2406fc=_0x39a07e[_0x12d7fa(0x1a3)];return console[_0x12d7fa(0x349)]('✔\x20Downloaded\x20'+_0x2406fc['projectName']),console['error'](_0x12d7fa(0x2fe)+_0x2406fc[_0x12d7fa(0x2f9)]),console[_0x12d7fa(0x349)]('\x20\x20Files\x20extracted:\x20'+_0x2406fc[_0x12d7fa(0x24d)]),console[_0x12d7fa(0x349)](_0x12d7fa(0x24e)+_0x96d014+'/'+_0x2406fc[_0x12d7fa(0x1e9)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x1cf);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x1bb);async[a54_0x361fe1(0x1ef)](_0x51e636){const _0xc6490f=a54_0x361fe1,{options:_0x292044,args:_0x3ac694,tdx:_0xac6488}=_0x51e636;let _0xc1c0ec='.',_0x3d427a=_0x292044[_0xc6490f(0x222)];if(_0x3ac694[0x0]){const {promises:_0x496380}=await import('fs');try{const _0x2c2b85=await _0x496380[_0xc6490f(0x338)](_0x3ac694[0x0]);if(_0x2c2b85[_0xc6490f(0x343)]())_0xc1c0ec=_0x3ac694[0x0];else return console[_0xc6490f(0x349)](_0xc6490f(0x210)+_0x3ac694[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x3d427a=_0x3ac694[0x0],_0xc1c0ec='.';}}const _0x4a3100=_0x292044['revision'],_0x29c1d2=_0x292044[_0xc6490f(0x2b5)];_0x292044['verbose']&&(console[_0xc6490f(0x349)](_0xc6490f(0x2f4)+_0xc1c0ec),_0x3d427a&&console['error'](_0xc6490f(0x285)+_0x3d427a),_0x4a3100&&console[_0xc6490f(0x349)]('Revision:\x20'+_0x4a3100),_0x29c1d2&&console[_0xc6490f(0x349)](_0xc6490f(0x270)));const _0x26ebae=await withSpinner('Pushing\x20workflow\x20project...',()=>_0xac6488[_0xc6490f(0x1c2)][_0xc6490f(0x201)](_0xc1c0ec,{'projectName':_0x3d427a,'revision':_0x4a3100,'skipValidation':_0x29c1d2}),{'verbose':_0x292044['verbose']}),_0x31225b=_0x26ebae['data'];return console['error'](_0xc6490f(0x248)+_0x31225b[_0xc6490f(0x1e9)]),console[_0xc6490f(0x349)](_0xc6490f(0x275)+_0x31225b[_0xc6490f(0x203)]),console[_0xc6490f(0x349)](_0xc6490f(0x2fe)+_0x31225b[_0xc6490f(0x2f9)]),await this[_0xc6490f(0x2c4)](_0xac6488,_0x31225b['projectName'],_0x292044[_0xc6490f(0x278)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x32a);['description']=a54_0x361fe1(0x1f4);async['execute'](_0x2e152a){const _0x578679=a54_0x361fe1,{options:_0x3c6725,args:_0x32156b,tdx:_0x2b97ad}=_0x2e152a,_0x408ed6=_0x32156b[0x0],_0x2b6cb8=_0x32156b[0x1];if(!_0x408ed6)return console[_0x578679(0x349)](a54_0x6e3482[_0x578679(0x1d0)]('Error:'),_0x578679(0x2ee)),console[_0x578679(0x349)](a54_0x6e3482[_0x578679(0x22b)](_0x578679(0x1b4))),0x1;const _0x55e5e0=_0x3c6725[_0x578679(0x2f9)];_0x3c6725['verbose']&&(console[_0x578679(0x349)](_0x578679(0x32b)+_0x408ed6),_0x2b6cb8&&console[_0x578679(0x349)]('Target\x20directory:\x20'+_0x2b6cb8),_0x55e5e0&&console[_0x578679(0x349)](_0x578679(0x1ae)+_0x55e5e0),_0x3c6725[_0x578679(0x1c9)]&&console[_0x578679(0x349)](_0x578679(0x265)));const _0x26eec6=await withSpinner('Pulling\x20project\x20'+_0x408ed6+_0x578679(0x1ea),()=>_0x2b97ad[_0x578679(0x1c2)]['pullProject'](_0x408ed6,{'targetDir':_0x2b6cb8,'revision':_0x55e5e0}),{'verbose':_0x3c6725[_0x578679(0x303)]}),_0x2e1657=_0x26eec6[_0x578679(0x1a3)];_0x2e1657[_0x578679(0x1d3)]?console[_0x578679(0x349)](_0x578679(0x1e5)+_0x2e1657[_0x578679(0x1e9)]):console['error'](_0x578679(0x28c)+_0x2e1657[_0x578679(0x1e9)]);console[_0x578679(0x349)]('\x20\x20Revision:\x20'+_0x2e1657[_0x578679(0x2f9)]),console['error'](_0x578679(0x2c1)+(a54_0x31407d[_0x578679(0x23b)](process[_0x578679(0x29a)](),_0x2e1657[_0x578679(0x317)])||'.')),console[_0x578679(0x349)](_0x578679(0x282)+a54_0x6e3482[_0x578679(0x1d6)]('+'+_0x2e1657[_0x578679(0x2e9)][_0x578679(0x1d8)]+'\x20new')+',\x20'+(a54_0x6e3482['yellow']('~'+_0x2e1657[_0x578679(0x2e9)][_0x578679(0x327)]+'\x20modified')+',\x20')+(a54_0x6e3482[_0x578679(0x1d0)]('-'+_0x2e1657['summary'][_0x578679(0x2e8)]+'\x20deleted')+',\x20')+(''+a54_0x6e3482['dim'](_0x2e1657[_0x578679(0x2e9)]['unchanged']+_0x578679(0x2e5))));for(const _0x5a9372 of _0x2e1657[_0x578679(0x2e2)]){_0x5a9372[_0x578679(0x21f)]===_0x578679(0x327)&&_0x5a9372[_0x578679(0x27c)]&&(console[_0x578679(0x349)]('\x0a'+a54_0x6e3482['cyan'](_0x578679(0x25b)+_0x5a9372[_0x578679(0x313)])),console[_0x578679(0x349)](_0x5a9372['diff']));}if(!_0x2e1657[_0x578679(0x20a)])return saveSessionContext({'workflow_project':_0x2e1657[_0x578679(0x1e9)]},_0x3c6725[_0x578679(0x277)]),console[_0x578679(0x349)](a54_0x6e3482[_0x578679(0x1d6)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x578679(0x349)](a54_0x6e3482[_0x578679(0x22b)](_0x578679(0x1fe)+_0x2e1657[_0x578679(0x1e9)])),0x0;if(_0x3c6725[_0x578679(0x1c9)])return console[_0x578679(0x349)](a54_0x6e3482['yellow'](_0x578679(0x28f))),0x0;if(!_0x3c6725[_0x578679(0x1c1)]){if(!isInteractive())return console[_0x578679(0x349)](a54_0x6e3482[_0x578679(0x1d0)](_0x578679(0x22e)),_0x578679(0x2e3)),console[_0x578679(0x349)](a54_0x6e3482[_0x578679(0x22b)](_0x578679(0x315))),0x1;const _0x45e3ee=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x45e3ee)return console['error'](a54_0x6e3482['yellow']('Cancelled'),_0x578679(0x205)),0x1;}await withSpinner(_0x578679(0x294),()=>_0x2b97ad['workflow'][_0x578679(0x329)](_0x2e1657,{'revision':_0x55e5e0}),{'verbose':_0x3c6725[_0x578679(0x303)]}),saveSessionContext({'workflow_project':_0x2e1657['projectName']},_0x3c6725[_0x578679(0x277)]),console[_0x578679(0x349)](a54_0x6e3482[_0x578679(0x1d6)]('✔\x20Pull\x20complete'));const _0x3ae014=a54_0x31407d[_0x578679(0x23b)](process[_0x578679(0x29a)](),_0x2e1657['targetDir'])||'.';return console[_0x578679(0x349)](a54_0x6e3482[_0x578679(0x22b)]('\x20\x20Location:\x20'+_0x3ae014)),console['error'](a54_0x6e3482['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x2e1657[_0x578679(0x1e9)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]='workflow:push';[a54_0x361fe1(0x200)]=a54_0x361fe1(0x32e);async[a54_0x361fe1(0x1ef)](_0xe11357){const _0x11d739=a54_0x361fe1,{options:_0x4fee7f,args:_0x2f2eb1,tdx:_0x522d53}=_0xe11357,_0x55be09=this[_0x11d739(0x1eb)](_0x2f2eb1,_0x4fee7f),_0x30e462=_0x4fee7f[_0x11d739(0x2f9)],_0x5c822b=_0x4fee7f[_0x11d739(0x2b5)];_0x4fee7f['verbose']&&(_0x55be09&&console[_0x11d739(0x349)](_0x11d739(0x2a7)+_0x55be09),_0x30e462&&console['error'](_0x11d739(0x1ae)+_0x30e462),_0x4fee7f[_0x11d739(0x1c9)]&&console[_0x11d739(0x349)](_0x11d739(0x265)),_0x5c822b&&console['error'](_0x11d739(0x270)));let _0x131aa1;try{_0x131aa1=await withSpinner('Analyzing\x20changes...',()=>_0x522d53['workflow'][_0x11d739(0x325)]({'sourceDir':_0x55be09,'revision':_0x30e462,'skipValidation':_0x5c822b}),{'verbose':_0x4fee7f['verbose']});}catch(_0x156aa2){if(_0x156aa2 instanceof Error&&_0x156aa2[_0x11d739(0x341)]['includes'](_0x11d739(0x2b4)))return console['error'](a54_0x6e3482['red']('Error:'),_0x11d739(0x2c9)),_0x4fee7f[_0x11d739(0x33b)]?console['error'](a54_0x6e3482[_0x11d739(0x22b)](_0x11d739(0x2ca)+_0x4fee7f[_0x11d739(0x33b)]+_0x11d739(0x242)+_0x4fee7f[_0x11d739(0x33b)]+'\x27')):console['error'](a54_0x6e3482[_0x11d739(0x22b)](_0x11d739(0x348))),0x1;throw _0x156aa2;}const _0x421993=_0x131aa1[_0x11d739(0x1a3)];console[_0x11d739(0x349)](_0x11d739(0x202)+_0x421993[_0x11d739(0x1e9)]),console['error'](_0x11d739(0x328)+_0x421993['sourceDir']),console[_0x11d739(0x349)](_0x11d739(0x2fe)+_0x421993['revision']),console[_0x11d739(0x349)](_0x11d739(0x282)+a54_0x6e3482[_0x11d739(0x1d6)]('+'+_0x421993[_0x11d739(0x2e9)][_0x11d739(0x1d8)]+_0x11d739(0x289))+',\x20'+(a54_0x6e3482[_0x11d739(0x259)]('~'+_0x421993[_0x11d739(0x2e9)][_0x11d739(0x327)]+_0x11d739(0x2df))+',\x20')+(a54_0x6e3482[_0x11d739(0x1d0)]('-'+_0x421993[_0x11d739(0x2e9)][_0x11d739(0x2e8)]+_0x11d739(0x1fa))+',\x20')+(''+a54_0x6e3482[_0x11d739(0x22b)](_0x421993[_0x11d739(0x2e9)][_0x11d739(0x2b9)]+_0x11d739(0x2e5))));for(const _0x28c113 of _0x421993['changes']){_0x28c113[_0x11d739(0x21f)]===_0x11d739(0x327)&&_0x28c113['diff']&&(console['error']('\x0a'+a54_0x6e3482['cyan'](_0x11d739(0x25b)+_0x28c113['path'])),console[_0x11d739(0x349)](_0x28c113[_0x11d739(0x27c)]));}if(!_0x421993['hasChanges'])return console[_0x11d739(0x349)](a54_0x6e3482[_0x11d739(0x1d6)](_0x11d739(0x2b0))),await this['showWorkflowConsoleUrl'](_0x522d53,_0x421993['projectName'],_0x4fee7f['site']),0x0;if(_0x4fee7f['dryRun'])return console[_0x11d739(0x349)](a54_0x6e3482[_0x11d739(0x259)](_0x11d739(0x281))),0x0;if(!_0x4fee7f[_0x11d739(0x1c1)]){if(!isInteractive())return console[_0x11d739(0x349)](a54_0x6e3482[_0x11d739(0x1d0)](_0x11d739(0x22e)),_0x11d739(0x2e3)),console[_0x11d739(0x349)](a54_0x6e3482[_0x11d739(0x22b)](_0x11d739(0x315))),0x1;const _0x38f598=await confirmKey(_0x11d739(0x30a));if(!_0x38f598)return console[_0x11d739(0x349)](a54_0x6e3482['yellow'](_0x11d739(0x2c2)),_0x11d739(0x307)),0x1;}const _0x5b8e27=await withSpinner('Pushing\x20project...',()=>_0x522d53['workflow'][_0x11d739(0x300)](_0x421993),{'verbose':_0x4fee7f['verbose']}),_0x3edd31=_0x5b8e27[_0x11d739(0x1a3)];return console['error'](a54_0x6e3482[_0x11d739(0x1d6)](_0x11d739(0x276))),console['error'](_0x11d739(0x275)+_0x3edd31['projectId']),console[_0x11d739(0x349)](_0x11d739(0x2fe)+_0x3edd31[_0x11d739(0x2f9)]),await this[_0x11d739(0x2c4)](_0x522d53,_0x3edd31[_0x11d739(0x1e9)],_0x4fee7f['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x361fe1(0x340);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x320);async['execute'](_0x588d80){const _0x344bc4=a54_0x361fe1,{options:_0x2063bc,args:_0x5069ff,tdx:_0x7bb568}=_0x588d80,_0x4a1fb4=this['resolveProjectDir'](_0x5069ff,_0x2063bc),_0x4b265d=_0x2063bc[_0x344bc4(0x222)],_0x55e994=_0x2063bc[_0x344bc4(0x2f9)],_0x25adab=_0x2063bc[_0x344bc4(0x2b5)];if(!_0x4a1fb4)return console['error'](a54_0x6e3482[_0x344bc4(0x1d0)](_0x344bc4(0x2ad)),_0x344bc4(0x319)),console[_0x344bc4(0x349)](a54_0x6e3482['dim'](_0x344bc4(0x2d3))),console[_0x344bc4(0x349)](a54_0x6e3482[_0x344bc4(0x22b)](_0x344bc4(0x23c))),0x1;if(!_0x4b265d)return console['error'](a54_0x6e3482['red'](_0x344bc4(0x2ad)),_0x344bc4(0x25d)),console[_0x344bc4(0x349)](a54_0x6e3482[_0x344bc4(0x22b)](_0x344bc4(0x2d3))),0x1;_0x2063bc['verbose']&&(console[_0x344bc4(0x349)]('Source\x20directory:\x20'+_0x4a1fb4),console[_0x344bc4(0x349)](_0x344bc4(0x20b)+_0x4b265d),_0x55e994&&console[_0x344bc4(0x349)](_0x344bc4(0x1ae)+_0x55e994),_0x2063bc['dryRun']&&console[_0x344bc4(0x349)](_0x344bc4(0x265)),_0x25adab&&console[_0x344bc4(0x349)]('Validation:\x20skipped'));const _0x2ad74d=await withSpinner('Analyzing\x20project...',()=>_0x7bb568[_0x344bc4(0x1c2)]['prepareCloneProject'](_0x4a1fb4,_0x4b265d,{'revision':_0x55e994,'skipValidation':_0x25adab}),{'verbose':_0x2063bc[_0x344bc4(0x303)]}),_0x1cfe72=_0x2ad74d['data'];console['error'](_0x344bc4(0x2ed)+_0x1cfe72[_0x344bc4(0x2af)]);_0x1cfe72[_0x344bc4(0x30f)]&&console[_0x344bc4(0x349)](_0x344bc4(0x26d)+_0x1cfe72[_0x344bc4(0x30f)]);console[_0x344bc4(0x349)](_0x344bc4(0x20b)+_0x1cfe72['newProjectName']),console[_0x344bc4(0x349)](_0x344bc4(0x1ae)+_0x1cfe72['revision']),console[_0x344bc4(0x349)]('Files\x20to\x20upload:\x20'+_0x1cfe72[_0x344bc4(0x21b)]);_0x1cfe72[_0x344bc4(0x24b)]&&(console[_0x344bc4(0x349)](a54_0x6e3482[_0x344bc4(0x259)]('\x0a⚠\x20Project\x20\x22'+_0x1cfe72[_0x344bc4(0x1e1)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x1cfe72[_0x344bc4(0x1c4)]+')')),console[_0x344bc4(0x349)](a54_0x6e3482[_0x344bc4(0x259)](_0x344bc4(0x31c))));if(_0x2063bc[_0x344bc4(0x1c9)])return console[_0x344bc4(0x349)](a54_0x6e3482[_0x344bc4(0x259)](_0x344bc4(0x24f))),0x0;if(!_0x2063bc[_0x344bc4(0x1c1)]){if(!isInteractive())return console[_0x344bc4(0x349)](a54_0x6e3482[_0x344bc4(0x1d0)]('\x0aError:'),_0x344bc4(0x2e3)),console[_0x344bc4(0x349)](a54_0x6e3482[_0x344bc4(0x22b)](_0x344bc4(0x315))),0x1;const _0x14b8df=_0x1cfe72[_0x344bc4(0x30f)]||a54_0x31407d['basename'](_0x4a1fb4),_0x5217fa=_0x1cfe72[_0x344bc4(0x24b)]?_0x344bc4(0x268)+_0x4b265d+_0x344bc4(0x240):'\x0aClone\x20\x22'+_0x14b8df+_0x344bc4(0x34d)+_0x4b265d+'\x22?',_0x6f5dee=await confirmKey(_0x5217fa);if(!_0x6f5dee)return console[_0x344bc4(0x349)](a54_0x6e3482[_0x344bc4(0x259)](_0x344bc4(0x2c2))),0x1;}const _0x320a88=await withSpinner(_0x1cfe72[_0x344bc4(0x24b)]?'Updating\x20'+_0x4b265d+'...':_0x344bc4(0x2b1)+_0x4b265d+_0x344bc4(0x1ea),()=>_0x7bb568['workflow'][_0x344bc4(0x2a4)](_0x1cfe72),{'verbose':_0x2063bc[_0x344bc4(0x303)]}),_0x57a595=_0x320a88[_0x344bc4(0x1a3)];return console[_0x344bc4(0x349)](a54_0x6e3482['green'](_0x1cfe72['targetExists']?'✔\x20Project\x20updated':_0x344bc4(0x2ac))),console[_0x344bc4(0x349)]('\x20\x20Project:\x20'+_0x57a595['newProjectName']),console[_0x344bc4(0x349)](_0x344bc4(0x275)+_0x57a595['newProjectId']),console[_0x344bc4(0x349)](_0x344bc4(0x2fe)+_0x57a595[_0x344bc4(0x2f9)]),await this[_0x344bc4(0x2c4)](_0x7bb568,_0x57a595[_0x344bc4(0x1e1)],_0x2063bc[_0x344bc4(0x278)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x318);[a54_0x361fe1(0x200)]=a54_0x361fe1(0x1e8);async[a54_0x361fe1(0x1ef)](_0x27dd04){const _0x2fedd6=a54_0x361fe1,{options:_0x118442,args:_0x3d8bfa,tdx:_0x3f9d94}=_0x27dd04,_0x52fe3c=_0x3d8bfa[0x0];if(!_0x52fe3c)return console[_0x2fedd6(0x349)](_0x2fedd6(0x19b)),console[_0x2fedd6(0x349)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x118442[_0x2fedd6(0x303)]&&console[_0x2fedd6(0x349)](_0x2fedd6(0x32b)+_0x52fe3c);if(!_0x118442[_0x2fedd6(0x1c1)]){if(!isInteractive())return console[_0x2fedd6(0x349)](a54_0x6e3482[_0x2fedd6(0x1d0)](_0x2fedd6(0x22e)),_0x2fedd6(0x2e3)),console[_0x2fedd6(0x349)](a54_0x6e3482[_0x2fedd6(0x22b)](_0x2fedd6(0x315))),0x1;const _0x1bfafa=await confirmKey(_0x2fedd6(0x261)+_0x52fe3c+_0x2fedd6(0x2da));if(!_0x1bfafa)return console['error'](a54_0x6e3482[_0x2fedd6(0x259)]('Cancelled')),0x1;}const _0x3797c2=await withSpinner('Deleting\x20project\x20'+_0x52fe3c+_0x2fedd6(0x1ea),()=>_0x3f9d94[_0x2fedd6(0x1c2)][_0x2fedd6(0x323)](_0x52fe3c),{'verbose':_0x118442[_0x2fedd6(0x303)]}),_0x50a685=_0x3797c2[_0x2fedd6(0x1a3)];return console[_0x2fedd6(0x349)](_0x2fedd6(0x2bb)+_0x50a685[_0x2fedd6(0x1e9)]),console[_0x2fedd6(0x349)](_0x2fedd6(0x275)+_0x50a685[_0x2fedd6(0x203)]),0x0;}}export function parseKeyValue(_0x43e68e){const _0x53f93c=a54_0x361fe1,_0x1324f2=_0x43e68e['indexOf']('=');if(_0x1324f2===-0x1)throw new Error(_0x53f93c(0x1e2)+_0x43e68e+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x99aa5c=_0x43e68e['substring'](0x0,_0x1324f2),_0x42212d=_0x43e68e['substring'](_0x1324f2+0x1);if(!_0x99aa5c)throw new Error(_0x53f93c(0x333));return{'key':_0x99aa5c,'value':_0x42212d};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x22d);[a54_0x361fe1(0x200)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a54_0x361fe1(0x1ef)](_0x254b64){const _0x189264=a54_0x361fe1,{options:_0x372bca,args:_0x482b79,tdx:_0x14bb87}=_0x254b64,_0x287fe4=this['requireProject'](_0x482b79,_0x372bca);if(!_0x287fe4)return 0x1;_0x372bca['verbose']&&console[_0x189264(0x349)](_0x189264(0x32b)+_0x287fe4);const _0x37ff0c=await withSpinner('Listing\x20secrets...',()=>_0x14bb87['workflow'][_0x189264(0x2ea)](_0x287fe4),{'verbose':_0x372bca['verbose']}),{secrets:_0x4766a3}=_0x37ff0c[_0x189264(0x1a3)];return console[_0x189264(0x349)](_0x189264(0x346)+_0x4766a3[_0x189264(0x344)]+_0x189264(0x236)+(_0x4766a3[_0x189264(0x344)]!==0x1?'s':'')),await handleSDKOutput(_0x4766a3,_0x372bca),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]='workflow:secrets:set';['description']=a54_0x361fe1(0x30b);async[a54_0x361fe1(0x1ef)](_0x467e03){const _0x33f829=a54_0x361fe1,{options:_0x14bcfe,args:_0x30483e,tdx:_0x3e0dda}=_0x467e03;let _0x42a48b,_0x53fc90;if(_0x30483e['length']>=0x1&&!_0x30483e[0x0][_0x33f829(0x237)]('='))_0x42a48b=_0x30483e[0x0],_0x53fc90=_0x30483e['slice'](0x1);else{if(_0x30483e[_0x33f829(0x344)]>=0x1&&_0x14bcfe['workflowProject'])_0x42a48b=_0x14bcfe[_0x33f829(0x33b)],_0x53fc90=_0x30483e;else return _0x30483e[_0x33f829(0x344)]>=0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x33f829(0x224)),0x1):(console[_0x33f829(0x349)](_0x33f829(0x31b)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x53fc90[_0x33f829(0x344)]===0x0)return console['error'](_0x33f829(0x31b)),console[_0x33f829(0x349)](_0x33f829(0x279)),0x1;const _0x1384de={};try{for(const _0x3ba2d3 of _0x53fc90){const {key:_0x1145f8,value:_0x55298b}=parseKeyValue(_0x3ba2d3);_0x1384de[_0x1145f8]=_0x55298b;}}catch(_0x5b1df3){return _0x5b1df3 instanceof Error&&console[_0x33f829(0x349)](a54_0x6e3482[_0x33f829(0x1d0)](_0x33f829(0x2ad)),_0x5b1df3[_0x33f829(0x341)]),0x1;}const _0x310876=Object['keys'](_0x1384de);_0x14bcfe['verbose']&&(console['error']('Project:\x20'+_0x42a48b),console['error'](_0x33f829(0x345)+_0x310876['join'](',\x20')));const _0x2162c1=await withSpinner(_0x310876[_0x33f829(0x344)]===0x1?'Setting\x20secret...':'Setting\x20'+_0x310876[_0x33f829(0x344)]+_0x33f829(0x2bc),()=>_0x3e0dda['workflow'][_0x33f829(0x2f3)](_0x42a48b,_0x1384de),{'verbose':_0x14bcfe[_0x33f829(0x303)]}),_0xb4f2ae=_0x2162c1['data'];return console[_0x33f829(0x349)](_0x310876['length']===0x1?'✔\x20Secret\x20\x27'+_0xb4f2ae[_0x33f829(0x1be)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0xb4f2ae[_0x33f829(0x1e9)]+'\x27':'✔\x20'+_0xb4f2ae[_0x33f829(0x1be)][_0x33f829(0x344)]+_0x33f829(0x2a2)+_0xb4f2ae['projectName']+'\x27'),(_0x14bcfe[_0x33f829(0x2d0)]||_0x14bcfe[_0x33f829(0x1ca)])&&await handleSingleObjectOutput(_0xb4f2ae,_0x14bcfe),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]='workflow:secrets:delete';['description']=a54_0x361fe1(0x1dd);async['execute'](_0x13e097){const _0x2bea3a=a54_0x361fe1,{options:_0x5c54ba,args:_0x43495f,tdx:_0x23c48d}=_0x13e097;let _0x2eb2bc,_0x848b24;if(_0x43495f[_0x2bea3a(0x344)]>=0x2)_0x2eb2bc=_0x43495f[0x0],_0x848b24=_0x43495f[0x1];else{if(_0x43495f[_0x2bea3a(0x344)]===0x1&&_0x5c54ba[_0x2bea3a(0x33b)])_0x2eb2bc=_0x5c54ba['workflowProject'],_0x848b24=_0x43495f[0x0];else return _0x43495f[_0x2bea3a(0x344)]===0x1?(console[_0x2bea3a(0x349)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x2bea3a(0x349)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x2bea3a(0x349)](_0x2bea3a(0x1fb)),console[_0x2bea3a(0x349)](_0x2bea3a(0x1b3)),0x1);}_0x5c54ba[_0x2bea3a(0x303)]&&(console['error'](_0x2bea3a(0x32b)+_0x2eb2bc),console[_0x2bea3a(0x349)]('Key:\x20'+_0x848b24));if(!_0x5c54ba[_0x2bea3a(0x1c1)]){if(!isInteractive())return console[_0x2bea3a(0x349)](a54_0x6e3482['red']('\x0aError:'),_0x2bea3a(0x2e3)),console['error'](a54_0x6e3482[_0x2bea3a(0x22b)](_0x2bea3a(0x315))),0x1;const _0x1d3cf3=await confirmKey(_0x2bea3a(0x1c5)+_0x848b24+'\x27\x20from\x20project\x20\x27'+_0x2eb2bc+'\x27?');if(!_0x1d3cf3)return console['error'](a54_0x6e3482[_0x2bea3a(0x259)](_0x2bea3a(0x2c2))),0x1;}const _0x30d0ba=await withSpinner(_0x2bea3a(0x1d2),()=>_0x23c48d[_0x2bea3a(0x1c2)][_0x2bea3a(0x2f0)](_0x2eb2bc,_0x848b24),{'verbose':_0x5c54ba[_0x2bea3a(0x303)]}),_0x557914=_0x30d0ba['data'];return console[_0x2bea3a(0x349)](_0x2bea3a(0x1de)+_0x557914[_0x2bea3a(0x290)]+_0x2bea3a(0x1a7)+_0x557914['projectName']+'\x27'),(_0x5c54ba[_0x2bea3a(0x2d0)]||_0x5c54ba[_0x2bea3a(0x1ca)])&&await handleSingleObjectOutput(_0x557914,_0x5c54ba),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(_0x59519b){const _0x59644e=a54_0x361fe1,_0x272e54=Math[_0x59644e(0x2d2)](_0x59519b/0x3e8),_0x205963=Math[_0x59644e(0x2d2)](_0x272e54/0x3c),_0x35975a=Math[_0x59644e(0x2d2)](_0x205963/0x3c),_0x2ec242=Math[_0x59644e(0x2d2)](_0x35975a/0x18);if(_0x2ec242>0x0){const _0x5e7705=_0x35975a%0x18;return _0x5e7705>0x0?_0x2ec242+'d\x20'+_0x5e7705+'h':_0x2ec242+'d';}else{if(_0x35975a>0x0){const _0x40998c=_0x205963%0x3c;return _0x40998c>0x0?_0x35975a+'h\x20'+_0x40998c+'m':_0x35975a+'h';}else{if(_0x205963>0x0){const _0x3bfaed=_0x272e54%0x3c;return _0x3bfaed>0x0?_0x205963+'m\x20'+_0x3bfaed+'s':_0x205963+'m';}else return _0x272e54+'s';}}}function formatTimestamp(_0x156525,_0x1bd9d9){const _0x6d49dc=a54_0x361fe1,_0x3320ad=new Date(_0x156525),_0x415cfb=String(_0x3320ad[_0x6d49dc(0x2db)]())['padStart'](0x2,'0'),_0x4d4945=String(_0x3320ad['getMinutes']())[_0x6d49dc(0x30e)](0x2,'0'),_0x284778=_0x415cfb+':'+_0x4d4945,_0x174e2=_0x3320ad[_0x6d49dc(0x2d1)]()===_0x1bd9d9[_0x6d49dc(0x2d1)]()&&_0x3320ad['getMonth']()===_0x1bd9d9['getMonth']()&&_0x3320ad[_0x6d49dc(0x1a8)]()===_0x1bd9d9['getDate']();if(_0x174e2)return _0x284778;else{const _0x464525=String(_0x3320ad[_0x6d49dc(0x1c7)]()+0x1)[_0x6d49dc(0x30e)](0x2,'0'),_0x2572fc=String(_0x3320ad[_0x6d49dc(0x1a8)]())[_0x6d49dc(0x30e)](0x2,'0');return _0x464525+'-'+_0x2572fc+'\x20'+_0x284778;}}function formatDate(_0x1bd445){const _0x2ff649=a54_0x361fe1,_0x593bf3=_0x1bd445[_0x2ff649(0x2d1)](),_0x2989be=String(_0x1bd445[_0x2ff649(0x1c7)]()+0x1)[_0x2ff649(0x30e)](0x2,'0'),_0x158415=String(_0x1bd445[_0x2ff649(0x1a8)]())[_0x2ff649(0x30e)](0x2,'0');return _0x593bf3+'-'+_0x2989be+'-'+_0x158415;}function getTaskStateIcon(_0xa63969){const _0x5196cf={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5196cf[_0xa63969]||'⚪';}function getBarChar(_0x232400){return _0x232400==='error'||_0x232400==='group_error'?'×':'─';}function getBarColor(_0x5d0099){const _0x66f54c=a54_0x361fe1,_0x2e9b25={'success':a54_0x6e3482['green'],'error':a54_0x6e3482[_0x66f54c(0x1d0)],'group_error':a54_0x6e3482[_0x66f54c(0x1d0)],'running':a54_0x6e3482[_0x66f54c(0x209)],'blocked':a54_0x6e3482[_0x66f54c(0x259)],'planned':a54_0x6e3482['dim'],'canceling':a54_0x6e3482[_0x66f54c(0x259)]};return _0x2e9b25[_0x5d0099]||a54_0x6e3482['white'];}function parseTaskName(_0x170695){const _0x178061=a54_0x361fe1;let _0x5adea2=_0x170695[_0x178061(0x1e4)](/^\++/,'');const _0x1366fc=_0x5adea2[_0x178061(0x332)]('+'),_0x579c90=_0x1366fc[_0x178061(0x344)]>0x1?_0x1366fc['length']-0x2:0x0,_0x536229=_0x1366fc[_0x1366fc['length']-0x1]||_0x5adea2;return{'level':_0x579c90,'name':'+'+_0x536229};}function truncateTaskName(_0x53937b,_0x12083b){const _0x4021fe=a54_0x361fe1,_0x651a17=stringWidth(_0x53937b);if(_0x651a17<=_0x12083b)return _0x53937b;let _0x2add72=_0x53937b;while(stringWidth(_0x2add72+'…')>_0x12083b&&_0x2add72[_0x4021fe(0x344)]>0x0){_0x2add72=_0x2add72[_0x4021fe(0x1f9)](0x0,-0x1);}return _0x2add72+'…';}function calculateTimeScale(_0x2a8abd,_0x5a764a){const _0x7052eb=a54_0x361fe1;return{'startTime':_0x2a8abd[_0x7052eb(0x1d1)],'endTime':_0x2a8abd[_0x7052eb(0x2f1)],'durationMs':_0x2a8abd[_0x7052eb(0x33c)],'msPerChar':_0x2a8abd[_0x7052eb(0x33c)]/_0x5a764a};}function timeToPosition(_0x47279c,_0x3f2d55,_0x34ffa8){const _0xddcb9d=a54_0x361fe1,_0x57e09a=_0x47279c-_0x3f2d55[_0xddcb9d(0x19e)],_0x3a6088=Math['floor'](_0x57e09a/_0x3f2d55['msPerChar']);return Math[_0xddcb9d(0x27b)](0x0,Math[_0xddcb9d(0x1aa)](_0x3a6088,_0x34ffa8));}function renderTimeAxis(_0x106b87,_0x54f4a1){const _0x5e45e3=a54_0x361fe1,_0x4bf061=Math['min'](TIMELINE_CONFIG[_0x5e45e3(0x1d4)],Math[_0x5e45e3(0x27b)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x5e45e3(0x2d2)](_0x54f4a1/TIMELINE_CONFIG[_0x5e45e3(0x2c8)]))),_0x4f75a5=_0x106b87[_0x5e45e3(0x34c)]/(_0x4bf061-0x1),_0x4695fb=new Date(_0x106b87[_0x5e45e3(0x19e)]),_0x487eb5=[];for(let _0x84eaa2=0x0;_0x84eaa2<_0x4bf061;_0x84eaa2++){const _0x13240d=_0x106b87[_0x5e45e3(0x19e)]+_0x84eaa2*_0x4f75a5,_0x765af4=timeToPosition(_0x13240d,_0x106b87,_0x54f4a1),_0x4ac5ed=formatTimestamp(_0x13240d,_0x4695fb);_0x487eb5[_0x5e45e3(0x201)]({'pos':_0x765af4,'text':_0x4ac5ed});}const _0x6261c6=new Array(_0x54f4a1)[_0x5e45e3(0x1b8)]('\x20');let _0x24795a=-0x1;for(const {pos:_0x44f0dd,text:_0xb09247}of _0x487eb5){let _0x446e7f=Math['max'](0x0,_0x44f0dd-Math['floor'](_0xb09247[_0x5e45e3(0x344)]/0x2));_0x446e7f<=_0x24795a+TIMELINE_CONFIG[_0x5e45e3(0x310)]&&(_0x446e7f=_0x24795a+TIMELINE_CONFIG[_0x5e45e3(0x310)]+0x1);_0x446e7f+_0xb09247[_0x5e45e3(0x344)]>_0x54f4a1&&(_0x446e7f=_0x54f4a1-_0xb09247['length']);if(_0x446e7f>=0x0&&_0x446e7f+_0xb09247[_0x5e45e3(0x344)]<=_0x54f4a1&&_0x446e7f>_0x24795a){for(let _0x264a26=0x0;_0x264a26<_0xb09247['length'];_0x264a26++){_0x6261c6[_0x446e7f+_0x264a26]=_0xb09247[_0x264a26];}_0x24795a=_0x446e7f+_0xb09247[_0x5e45e3(0x344)]-0x1;}}return _0x6261c6[_0x5e45e3(0x2f7)]('');}function renderTaskRow(_0x318280,_0x40c243,_0x3b46cc,_0x19050d){const _0x3a1e95=a54_0x361fe1,{level:_0x491346,name:_0x1dff6b}=parseTaskName(_0x318280[_0x3a1e95(0x222)]),_0x5b5414='\x20'['repeat'](_0x491346),_0x2fa132=_0x318280[_0x3a1e95(0x2ab)]?'('+formatElapsed(_0x318280['window']['duration'])+')':'',_0x4eb21a=stringWidth(_0x2fa132),_0x471209=_0x491346*0x1,_0x143cc7=_0x19050d-_0x471209-_0x4eb21a-0x1,_0x27212b=truncateTaskName(_0x1dff6b,_0x143cc7),_0x2347ad=_0x5b5414+_0x27212b,_0x58cdd4=stringWidth(_0x2347ad),_0x4af893=_0x19050d-_0x58cdd4-_0x4eb21a,_0x13ff5b=_0x2347ad+'\x20'[_0x3a1e95(0x31a)](Math[_0x3a1e95(0x27b)](0x1,_0x4af893))+a54_0x6e3482[_0x3a1e95(0x22b)](_0x2fa132),_0x27cf27=getTaskStateIcon(_0x318280[_0x3a1e95(0x2b7)]),_0x11da9a=new Array(_0x3b46cc)[_0x3a1e95(0x1b8)]('\x20');if(_0x318280['window']){const _0x2af6ae=timeToPosition(_0x318280[_0x3a1e95(0x2ab)][_0x3a1e95(0x1d1)],_0x40c243,_0x3b46cc),_0x1ba536=timeToPosition(_0x318280[_0x3a1e95(0x2ab)][_0x3a1e95(0x2f1)],_0x40c243,_0x3b46cc),_0x115fce=getBarChar(_0x318280[_0x3a1e95(0x2b7)]),_0x3141ed=Math[_0x3a1e95(0x27b)](_0x2af6ae+0x1,_0x1ba536);for(let _0x4a2f2d=_0x2af6ae;_0x4a2f2d<Math['min'](_0x3141ed,_0x3b46cc);_0x4a2f2d++){_0x11da9a[_0x4a2f2d]=_0x115fce;}}const _0x245044=getBarColor(_0x318280[_0x3a1e95(0x2b7)]),_0x4558c1=_0x11da9a[_0x3a1e95(0x2fc)](_0x3b296e=>_0x3b296e==='\x20'?'\x20':_0x245044(_0x3b296e))[_0x3a1e95(0x2f7)]('');return _0x27cf27+'\x20'+_0x13ff5b+'│'+_0x4558c1+'│';}function calculateStats(_0x3c6504){const _0x6d9da5=a54_0x361fe1,_0x296c3d={'total':_0x3c6504[_0x6d9da5(0x344)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x44a315 of _0x3c6504){if(_0x44a315[_0x6d9da5(0x2b7)]===_0x6d9da5(0x19a))_0x296c3d['success']++;else{if(_0x44a315[_0x6d9da5(0x2b7)]===_0x6d9da5(0x349)||_0x44a315['state']==='group_error')_0x296c3d['error']++;else _0x44a315[_0x6d9da5(0x2b7)]===_0x6d9da5(0x33e)?_0x296c3d[_0x6d9da5(0x33e)]++:_0x296c3d[_0x6d9da5(0x298)]++;}}return _0x296c3d;}function formatStats(_0x44f9ec){const _0x2432b1=a54_0x361fe1;return[_0x2432b1(0x326)+_0x44f9ec[_0x2432b1(0x1df)],'✅\x20'+_0x44f9ec[_0x2432b1(0x19a)],'❌\x20'+_0x44f9ec[_0x2432b1(0x349)],_0x2432b1(0x219)+_0x44f9ec[_0x2432b1(0x33e)],'⏳\x20'+_0x44f9ec[_0x2432b1(0x298)]][_0x2432b1(0x2f7)]('\x20\x20');}function a54_0x1a1a(){const _0x33556a=['resolveProject','Source\x20directory:\x20','renderTimeline','\x20-\x20','No\x20sessions\x20found\x20for:\x20','window','✔\x20Clone\x20complete','Error:','From\x20task:\x20','sourceDir','\x0a✔\x20No\x20changes\x20to\x20push','Cloning\x20to\x20','readFile','\x20of\x20','No\x20workflow\x20tdx.json\x20found','skipValidation','Getting\x20attempt\x20tasks...','state','Parameters:\x20','unchanged','format','✔\x20Deleted\x20project\x20','\x20secrets...','No\x20sessions\x20with\x20timing\x20information','navigateSessionsInteractive','find','isArray','\x20\x20Target:\x20','Cancelled','\x20\x20Workflow:\x20','showWorkflowConsoleUrl','parse','listSchedules','cyan','LABEL_WIDTH_DIVISOR','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Tip:\x20cd\x20to\x20workflows/','\x20from\x20session\x20','\x20task','Select\x20a\x20session\x20to\x20view\x20timeline:','rows','substring','json','getFullYear','floor','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','attempt','✔\x20Showing\x20','Target:\x20','Filter:\x20project=','Retrying\x20attempt...','context','\x22?\x20This\x20cannot\x20be\x20undone.','getHours','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Loading\x20sessions...','MAX_POLL_ITERATIONS','\x20modified','nextRunTime','\x20\x20Attempt\x20ID:\x20','changes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Retrying\x20session...','\x20unchanged','33pkGgjQ','✔\x20Schedule\x20#','deleted','summary','listSecrets','📅\x20#','stdout','Source:\x20','Project\x20name\x20is\x20required','attemptId','deleteSecret','end','Error:\x20Invalid\x20JSON\x20in\x20--params','setSecrets','Project\x20directory:\x20','/attempt/','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','join','No\x20attempts\x20found','revision','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:use','map','\x0a✔\x20Attempt\x20complete','\x20\x20Revision:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','executePushProject','write','text','verbose','\x20\x20Project:\x20','Output\x20directory:\x20','ICON_SPACING','-\x20nothing\x20pushed','\x20attempt','✔\x20Workflow\x20run\x20started','\x0aPush\x20these\x20changes?','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x1b[1A\x1b[2K','resolveProjectId','padStart','sourceProjectName','LABEL_MIN_SPACING','/app/workflows/','has','path','task','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','filter','targetDir','workflow:delete','Source\x20directory\x20is\x20required','repeat','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','set','log','sessionId','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','canceling','\x0aFailed\x20to\x20fetch\x20attempt\x20data','delete','ICON_WIDTH','preparePushProject','Total:\x20','modified','\x20\x20Source:\x20','applyPullProject','workflow:pull','Project:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','No\x20attempts\x20found\x20in\x20project:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','✔\x20Workflow\x20project\x20context\x20cleared.','status','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','split','Key\x20cannot\x20be\x20empty','params','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','8tfOkyC','\x20\x20tdx\x20wf\x20use\x20<project>','stat','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20New\x20attempt\x20ID:\x20','workflowProject','duration','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','running','unknown','workflow:clone','message','resumeFrom','isDirectory','length','Secrets\x20to\x20set:\x20','✔\x20Found\x20','No\x20workflows\x20found','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','error','Kill\x20a\x20running\x20attempt','project','durationMs','\x22\x20to\x20new\x20project\x20\x22','output','success','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','planned','requireProject','startTime','30XwqFKC','(unknown)','Session\x20time:\x20','5174huqOSl','data','List\x20workflow\x20attempts','workflow:tasks','columns','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','getDate','Show\x20specific\x20attempt\x20details','min','enableSchedule','453980HRWVaZ','No\x20log\x20content\x20found','Revision:\x20','fromTask','buildTimelineData','startsWith','Getting\x20attempt\x20details...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Downloading\x20logs...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','fill','sessionTime','72wQuFSX','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','limit','No\x20projects\x20match\x20pattern:\x20','keys','Fetching\x20log\x20files...','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','yes','workflow','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','existingProjectId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','retrySession','getMonth','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','dryRun','jsonl','Error:\x20Attempt\x20ID\x20is\x20required','Including\x20subtasks:\x20yes','1983726sEPjlx','No\x20workflows\x20found\x20in\x20project:\x20','workflow:upload','red','start','Deleting\x20secret...','isNewProject','MAX_LABEL_COUNT','workflow:timeline','green','stringify','new','toLocaleString','List\x20workflow\x20schedules','workflow:logs','(use\x20--limit\x20to\x20see\x20more)','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','✔\x20Secret\x20\x27','total','match','newProjectName','Invalid\x20format:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','replace','→\x20New\x20project:\x20','every','\x20\x20Console:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','projectName','...','resolveProjectDir','createdAt','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Show\x20tasks\x20for\x20an\x20attempt','execute','workflowName','parseProjectWorkflowPattern','Pattern:\x20','Force:\x20yes','Pull\x20workflow\x20project\x20to\x20local\x20folder','attempt:','Enabling\x20schedule\x20#','Usage:\x20tdx\x20wf\x20use\x20<project>','finishedAt','slice','\x20deleted','Error:\x20Secret\x20key\x20is\x20required','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Attempt\x20ID:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','Schedule\x20ID\x20is\x20required','description','push','✔\x20Project:\x20','projectId','Filter:\x20','-\x20no\x20files\x20written','select','GUTTER','autocomplete','blue','hasChanges','New\x20project\x20name:\x20','lastAttempt','\x20next:\x20','list','fullName','Error:\x20','Listing\x20workflows...','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20session','sessions','round','workflow:run','700152BEOAne','\x20to\x20see\x20detailed\x20logs','🔄\x20','💡\x20Tip:\x20Use\x20','fileCount','workflow:projects','604515mciwWo','\x20project','type',',\x20Workflow:\x20','workflow:download','name','value','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','from','Latest\x20session\x20has\x20no\x20attempt','\x20sessions\x20','Listing\x20workflow\x20projects...','Failed\x20to\x20fetch\x20attempt\x20data','size','dim','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','workflow:secrets:list','\x0aError:','toLowerCase','\x20(use\x20--limit\x20to\x20show\x20more)','Params:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Invalid\x20parameter\x20format:\x20','done','toISOString','\x20secret','includes','tdx.json','startedAt','force','relative','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','index','Select\x20a\x20workflow\x20to\x20run','trim','\x22\x20with\x20new\x20revision?','391225uyNkUL','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Include\x20retried:\x20yes','displayLine','follow','getTime','get','✔\x20Pushed\x20','Project\x20filter:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','targetExists','retryAttempt','filesExtracted','\x20\x20Location:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','Resume\x20from:\x20','workflows','table','3469655BnIxJD','📋\x20','taskName','Disabling\x20schedule\x20#','Listing\x20workflow\x20attempts...','resolve','yellow','retryAttemptName','---\x20','now','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20schedules\x20found','⚠\x20Showing\x20first\x20','reason','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','cancelRequested','No\x20attempts\x20found\x20for:\x20','workflow:kill','Dry\x20run:\x20yes','generateSessionTimelineRows','renderSingleTimeline','\x0aUpdate\x20existing\x20project\x20\x22','localeCompare','\x20tasks','Task\x20name:\x20','Warning:','Source\x20project:\x20','workflow:schedules','values','Validation:\x20skipped','Start\x20a\x20workflow\x20run','Attempt:\x20','Resolving\x20project\x20\x27','Reason:\x20','\x20\x20Project\x20ID:\x20','✔\x20Push\x20complete','session','site','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','utf-8','max','diff','\x20\x20Session\x20ID:\x20','tasks','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','logs','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20\x20Changes:\x20','includeRetried','param','Project\x20name:\x20','isTTY','workflow:sessions','Status:\x20','\x20new','POLL_INTERVAL_MS','pollTimeline','→\x20Project:\x20','splice','workflow:workflows','\x0aDry\x20run\x20-\x20no\x20files\x20written','key','includeSubtasks','disableSchedule','Listing\x20schedules...','Writing\x20files...','List\x20all\x20workflow\x20projects','indexOf','updatedAt','pending','renderSessionsTimeline','cwd','\x20enabled\x20(','No\x20sessions\x20found','No\x20workflow\x20projects\x20found','No\x20sessions\x20found\x20in\x20project:\x20','List\x20workflows','Loading\x20workflows...','Retry\x20a\x20session\x20or\x20attempt','\x20secrets\x20set\x20for\x20project\x20\x27','📁\x20','executeCloneProject','sort'];a54_0x1a1a=function(){return _0x33556a;};return a54_0x1a1a();}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x361fe1(0x222)]=a54_0x361fe1(0x1d5);[a54_0x361fe1(0x200)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x361fe1(0x1ef)](_0x40fd9e){const _0x28f2fe=a54_0x361fe1,{options:_0x25d1c7,args:_0x2c7656,tdx:_0x486829}=_0x40fd9e;let _0x544994,_0x390c18,_0x3b9f68=![];if(_0x2c7656[0x0]){if(_0x2c7656[0x0][_0x28f2fe(0x237)]('.')){const _0x48276b=this['parseProjectWorkflowPattern'](_0x2c7656,_0x25d1c7);if(!_0x48276b)return 0x1;_0x544994=_0x48276b['projectName'],_0x390c18=_0x48276b[_0x28f2fe(0x1f0)];}else{_0x390c18=_0x2c7656[0x0],_0x544994=_0x25d1c7[_0x28f2fe(0x33b)];if(!_0x544994)return console[_0x28f2fe(0x349)](a54_0x6e3482[_0x28f2fe(0x1d0)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x3b9f68=!![];}}else{const _0x434f71=this[_0x28f2fe(0x1f1)](_0x2c7656,_0x25d1c7);if(!_0x434f71)return 0x1;_0x544994=_0x434f71['projectName'],_0x390c18=_0x434f71['workflowName'];}if(_0x25d1c7[_0x28f2fe(0x303)]){if(_0x544994&&_0x390c18)console[_0x28f2fe(0x349)]('Filter:\x20'+_0x544994+'.'+_0x390c18);else _0x544994&&console[_0x28f2fe(0x349)](_0x28f2fe(0x2d7)+_0x544994);}const _0xc42021=_0x25d1c7[_0x28f2fe(0x2ef)],_0x5bc061=_0x25d1c7[_0x28f2fe(0x31f)];if(_0xc42021){_0x5bc061&&console[_0x28f2fe(0x349)](a54_0x6e3482['yellow'](_0x28f2fe(0x26c)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x5d289d=_0x25d1c7['follow'];return _0x5d289d?await this[_0x28f2fe(0x28b)](_0x40fd9e,_0xc42021):await this[_0x28f2fe(0x267)](_0x40fd9e,_0xc42021,_0x25d1c7),0x0;}if(_0x5bc061){const _0x5599e0=await withSpinner('Loading\x20session...',()=>_0x486829[_0x28f2fe(0x1c2)][_0x28f2fe(0x214)]({'projectName':_0x544994,'workflowName':_0x390c18,'limit':0x64}),{'verbose':_0x25d1c7[_0x28f2fe(0x303)]}),_0x3c5f4d=_0x5599e0[_0x28f2fe(0x1a3)][_0x28f2fe(0x2bf)](_0xd30e7b=>_0xd30e7b['id']===_0x5bc061);if(!_0x3c5f4d)return console[_0x28f2fe(0x349)](a54_0x6e3482[_0x28f2fe(0x1d0)](_0x28f2fe(0x2ad)),'Session\x20not\x20found:\x20'+_0x5bc061),0x1;if(!_0x3c5f4d[_0x28f2fe(0x20c)]?.['id'])return console['error'](a54_0x6e3482['red'](_0x28f2fe(0x2ad)),'Session\x20'+_0x5bc061+'\x20has\x20no\x20attempts'),0x1;const _0x2bf8fd=_0x3c5f4d[_0x28f2fe(0x20c)]['id'];_0x25d1c7[_0x28f2fe(0x303)]&&console['error']('Using\x20attempt\x20'+_0x2bf8fd+_0x28f2fe(0x2cb)+_0x5bc061);const _0x186ea4=_0x25d1c7[_0x28f2fe(0x245)];return _0x186ea4?await this[_0x28f2fe(0x28b)](_0x40fd9e,_0x2bf8fd):await this[_0x28f2fe(0x267)](_0x40fd9e,_0x2bf8fd,_0x25d1c7),0x0;}const _0x9972a7=await withSpinner(_0x28f2fe(0x2dd),()=>_0x486829['workflow'][_0x28f2fe(0x214)]({'projectName':_0x544994,'workflowName':_0x390c18,'limit':_0x25d1c7[_0x28f2fe(0x1bc)]||0x32}),{'verbose':_0x25d1c7['verbose']}),_0x3c2ebc=_0x9972a7['data'];if(_0x3c2ebc[_0x28f2fe(0x344)]===0x0){if(_0x544994&&_0x390c18)console['error'](_0x28f2fe(0x2aa)+_0x544994+'.'+_0x390c18);else _0x544994?console[_0x28f2fe(0x349)](_0x28f2fe(0x29e)+_0x544994):(console[_0x28f2fe(0x349)]('No\x20workflow\x20sessions\x20found'),console[_0x28f2fe(0x349)](a54_0x6e3482[_0x28f2fe(0x22b)](_0x28f2fe(0x1c0))));return 0x0;}_0x3c2ebc['sort']((_0x4e3668,_0x37e7d8)=>{const _0x35331f=_0x28f2fe,_0xf0be98=_0x4e3668[_0x35331f(0x1b9)]||'',_0x5bcaeb=_0x37e7d8[_0x35331f(0x1b9)]||'';return _0x5bcaeb[_0x35331f(0x269)](_0xf0be98);});if(_0x25d1c7['json']||_0x25d1c7[_0x28f2fe(0x1ca)])return await handleSDKOutput(_0x3c2ebc,_0x25d1c7),0x0;let _0x1cd493;if(_0x3b9f68){const _0x578222=_0x3c2ebc[0x0];if(!_0x578222[_0x28f2fe(0x20c)]?.['id'])return console[_0x28f2fe(0x349)](_0x28f2fe(0x226)),0x0;_0x1cd493=_0x578222[_0x28f2fe(0x20c)]['id'],_0x25d1c7[_0x28f2fe(0x303)]&&console['error']('Auto-selected\x20latest\x20session:\x20'+_0x578222[_0x28f2fe(0x1b9)]);}else{const _0x31c15b=_0x3c2ebc[_0x28f2fe(0x2fc)](_0x4878ee=>{const _0x225e52=_0x28f2fe,_0x2a3536=getAttemptStatusDisplay(_0x4878ee['lastAttempt']);return{'title':_0x4878ee['project']?.[_0x225e52(0x222)]+'.'+_0x4878ee[_0x225e52(0x1c2)]?.[_0x225e52(0x222)]+_0x225e52(0x2a9)+_0x4878ee['sessionTime']+'\x20'+_0x2a3536['icon'],'value':_0x4878ee['lastAttempt']?.['id']||'','description':_0x2a3536[_0x225e52(0x302)]};}),_0x2c8966=await a54_0x15ced4({'type':_0x28f2fe(0x206),'name':'attemptId','message':_0x28f2fe(0x2cd),'choices':_0x31c15b[_0x28f2fe(0x316)](_0x31da35=>_0x31da35[_0x28f2fe(0x223)]!=='')});if(!_0x2c8966[_0x28f2fe(0x2ef)])return 0x0;_0x1cd493=_0x2c8966[_0x28f2fe(0x2ef)];}const _0x5a797c=_0x25d1c7[_0x28f2fe(0x245)];return _0x5a797c?await this[_0x28f2fe(0x28b)](_0x40fd9e,_0x1cd493):await this[_0x28f2fe(0x267)](_0x40fd9e,_0x1cd493,_0x25d1c7),0x0;}async[a54_0x361fe1(0x267)](_0x319b5d,_0x326db9,_0x160e56){const _0x3ec228=a54_0x361fe1,{tdx:_0x54ecc4}=_0x319b5d;let _0x450ff0,_0x21141b;try{[_0x450ff0,_0x21141b]=await Promise['all']([_0x54ecc4[_0x3ec228(0x1c2)]['attempt'](_0x326db9),_0x54ecc4[_0x3ec228(0x1c2)][_0x3ec228(0x27e)](_0x326db9,![])]);}catch(_0x224bc8){console[_0x3ec228(0x349)](a54_0x6e3482[_0x3ec228(0x1d0)](_0x3ec228(0x229)));_0x160e56['verbose']&&console['error'](_0x224bc8);throw _0x224bc8;}if(_0x160e56[_0x3ec228(0x2d0)]||_0x160e56['jsonl']){const _0x2f9e24=this['buildTimelineData'](_0x450ff0,_0x21141b);await handleSDKOutput([_0x2f9e24],_0x160e56);return;}const _0x994766=_0x54ecc4[_0x3ec228(0x2d9)][_0x3ec228(0x278)],_0x2280a5=this[_0x3ec228(0x2a8)](_0x450ff0,_0x21141b,_0x994766);console[_0x3ec228(0x31e)](_0x2280a5);}async['pollTimeline'](_0x3f01cb,_0x3846c6){const _0xb4b580=a54_0x361fe1,{tdx:_0x514ff6}=_0x3f01cb,_0xf5d641=TIMELINE_CONFIG[_0xb4b580(0x28a)],_0x17e3db=TIMELINE_CONFIG[_0xb4b580(0x2de)];let _0x2a2f0c=0x0;while(_0x2a2f0c<_0x17e3db){process['stdout'][_0xb4b580(0x286)]&&process[_0xb4b580(0x2ec)][_0xb4b580(0x301)]('\x1bc');let _0x34ca79,_0x4e5197;try{[_0x34ca79,_0x4e5197]=await Promise['all']([_0x514ff6['workflow'][_0xb4b580(0x2d4)](_0x3846c6),_0x514ff6['workflow'][_0xb4b580(0x27e)](_0x3846c6,![])]);}catch(_0x53947e){console[_0xb4b580(0x349)](a54_0x6e3482[_0xb4b580(0x1d0)](_0xb4b580(0x322)));_0x2a2f0c>0x0&&console[_0xb4b580(0x349)](a54_0x6e3482[_0xb4b580(0x22b)](_0xb4b580(0x1b5)+_0x2a2f0c));throw _0x53947e;}const _0x7e892=_0x514ff6[_0xb4b580(0x2d9)][_0xb4b580(0x278)],_0x3912f2=this[_0xb4b580(0x2a8)](_0x34ca79,_0x4e5197,_0x7e892);console[_0xb4b580(0x31e)](_0x3912f2);const _0x116800=_0x34ca79['done']&&_0x4e5197[_0xb4b580(0x1e6)](_0x3910a2=>_0x3910a2[_0xb4b580(0x2b7)]!==_0xb4b580(0x33e)&&_0x3910a2[_0xb4b580(0x2b7)]!==_0xb4b580(0x19c));if(_0x116800){console[_0xb4b580(0x349)](a54_0x6e3482[_0xb4b580(0x1d6)](_0xb4b580(0x2fd)));break;}console['error'](a54_0x6e3482[_0xb4b580(0x22b)]('\x0aPolling...\x20('+_0x2a2f0c*0x2+_0xb4b580(0x212))),await new Promise(_0x357dc4=>setTimeout(_0x357dc4,_0xf5d641)),_0x2a2f0c++;}_0x2a2f0c>=_0x17e3db&&console[_0xb4b580(0x349)](a54_0x6e3482['yellow'](_0xb4b580(0x1fc)));}[a54_0x361fe1(0x2a8)](_0x1d4ce3,_0x4d2d0c,_0x29f840){const _0x387116=a54_0x361fe1,_0x5c0c62=[],_0x4987a0=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x470bed=0x5,_0xebdf0c=process[_0x387116(0x2ec)]['columns']||0x78,_0x2309f2=_0xebdf0c-_0x4987a0-_0x470bed,_0x1605dd=Math['max'](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x387116(0x1aa)](_0x2309f2,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x100cf7=new Date(_0x1d4ce3[_0x387116(0x1ec)])[_0x387116(0x246)](),_0x2adc83=_0x1d4ce3[_0x387116(0x1f8)]?new Date(_0x1d4ce3[_0x387116(0x1f8)])[_0x387116(0x246)]():Date[_0x387116(0x25c)](),_0x4479e9={'start':_0x100cf7,'end':_0x2adc83,'duration':_0x2adc83-_0x100cf7},_0x2122d3=new Map(),_0x4bf7a5=[];for(const _0x3dbd32 of _0x4d2d0c){if(_0x3dbd32[_0x387116(0x239)]){const _0x481555=new Date(_0x3dbd32[_0x387116(0x239)])[_0x387116(0x246)](),_0x20c0ee=_0x3dbd32[_0x387116(0x297)]?new Date(_0x3dbd32[_0x387116(0x297)])[_0x387116(0x246)]():Date['now'](),_0x11d654={'start':_0x481555,'end':_0x20c0ee,'duration':_0x20c0ee-_0x481555};_0x2122d3[_0x387116(0x31d)](_0x3dbd32['id'],_0x11d654),_0x4bf7a5[_0x387116(0x201)]({'name':_0x3dbd32[_0x387116(0x20f)],'state':_0x3dbd32[_0x387116(0x2b7)]||_0x387116(0x33f),'window':_0x11d654});}else _0x4bf7a5[_0x387116(0x201)]({'name':_0x3dbd32[_0x387116(0x20f)],'state':_0x3dbd32[_0x387116(0x2b7)]||_0x387116(0x19c),'window':undefined});}_0x4bf7a5[_0x387116(0x2a5)]((_0x2cc5f1,_0x16008e)=>{const _0x4566a5=_0x387116;if(!_0x2cc5f1['window'])return 0x1;if(!_0x16008e[_0x4566a5(0x2ab)])return-0x1;return _0x2cc5f1['window'][_0x4566a5(0x1d1)]-_0x16008e[_0x4566a5(0x2ab)][_0x4566a5(0x1d1)];});const _0x1cc1d7=_0x4bf7a5[_0x387116(0x344)],_0x341614=_0x1cc1d7>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x341614&&_0x4bf7a5[_0x387116(0x28d)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x2d1e4b=calculateTimeScale(_0x4479e9,_0x1605dd),_0xf1e910=_0x1d4ce3[_0x387116(0x234)]?_0x1d4ce3[_0x387116(0x19a)]?a54_0x6e3482['green'](_0x387116(0x19a)):a54_0x6e3482[_0x387116(0x1d0)](_0x387116(0x349)):a54_0x6e3482[_0x387116(0x209)](_0x387116(0x33e)),_0x272482=_0x1d4ce3[_0x387116(0x34b)]?.['id'],_0x5f7e=_0x1d4ce3[_0x387116(0x31f)];let _0x235694;if(_0x272482&&_0x5f7e){const _0x47ee51=getWorkflowAttemptUrl(_0x29f840,_0x272482,_0x5f7e,_0x1d4ce3['id']);_0x235694=hyperlink(a54_0x6e3482['dim'](_0x1d4ce3['id']),_0x47ee51);}else _0x235694=a54_0x6e3482[_0x387116(0x22b)](_0x1d4ce3['id']);_0x5c0c62['push'](_0x387116(0x272)+_0x235694+_0x387116(0x2a9)+_0xf1e910+'\x20-\x20'+formatElapsed(_0x4479e9[_0x387116(0x33c)]));if(_0x4bf7a5[_0x387116(0x344)]>0x0){const _0x51e575=renderTimeAxis(_0x2d1e4b,_0x1605dd),_0x55b477=new Date(_0x4479e9[_0x387116(0x1d1)]),_0x5bdf4f=formatDate(_0x55b477),_0xb793b5=TIMELINE_CONFIG[_0x387116(0x324)]+TIMELINE_CONFIG[_0x387116(0x306)]+_0x4987a0,_0x4fbada=_0x5bdf4f['padStart'](_0xb793b5),_0x4fe83e=a54_0x6e3482[_0x387116(0x22b)](_0x4fbada);_0x5c0c62[_0x387116(0x201)](_0x4fe83e+'\x20'+_0x51e575);for(const _0xe6c80e of _0x4bf7a5){_0x5c0c62[_0x387116(0x201)](renderTaskRow(_0xe6c80e,_0x2d1e4b,_0x1605dd,_0x4987a0));}const _0x15ef45=calculateStats(_0x4bf7a5);_0x5c0c62[_0x387116(0x201)](formatStats(_0x15ef45)),_0x341614&&_0x5c0c62[_0x387116(0x201)](a54_0x6e3482[_0x387116(0x259)](_0x387116(0x25f)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x387116(0x2b3)+_0x1cc1d7+_0x387116(0x26a))),_0x5c0c62['push'](''),_0x5c0c62[_0x387116(0x201)](a54_0x6e3482['dim'](_0x387116(0x21a))+('tdx\x20wf\x20attempt\x20'+_0x1d4ce3['id']+'\x20logs')+a54_0x6e3482[_0x387116(0x22b)](_0x387116(0x218)));}else _0x5c0c62[_0x387116(0x201)](_0x387116(0x2fa));return _0x5c0c62['join']('\x0a');}[a54_0x361fe1(0x1b0)](_0x57096d,_0x438330){const _0x3fd701=a54_0x361fe1,_0x34c0f5=new Date(_0x57096d[_0x3fd701(0x1ec)])[_0x3fd701(0x246)](),_0x3a1724=_0x57096d[_0x3fd701(0x1f8)]?new Date(_0x57096d['finishedAt'])[_0x3fd701(0x246)]():Date['now'](),_0x218b10=_0x3a1724-_0x34c0f5,_0x49eec1=[];for(const _0x3781f8 of _0x438330){if(_0x3781f8[_0x3fd701(0x239)]){const _0x129d4c=new Date(_0x3781f8[_0x3fd701(0x239)])['getTime'](),_0xa59b1a=_0x3781f8[_0x3fd701(0x297)]?new Date(_0x3781f8['updatedAt'])[_0x3fd701(0x246)]():Date[_0x3fd701(0x25c)]();_0x49eec1[_0x3fd701(0x201)]({'name':_0x3781f8[_0x3fd701(0x20f)],'state':_0x3781f8[_0x3fd701(0x2b7)]||_0x3fd701(0x33f),'window':{'start':_0x129d4c,'end':_0xa59b1a,'duration':_0xa59b1a-_0x129d4c}});}else _0x49eec1[_0x3fd701(0x201)]({'name':_0x3781f8['fullName'],'state':_0x3781f8['state']||_0x3fd701(0x19c),'window':undefined});}const _0x2d7866=calculateStats(_0x49eec1);return{'attempt':{'id':_0x57096d['id'],'status':_0x57096d[_0x3fd701(0x234)]?_0x57096d[_0x3fd701(0x19a)]?_0x3fd701(0x19a):_0x3fd701(0x349):'running','createdAt':_0x57096d['createdAt'],'finishedAt':_0x57096d[_0x3fd701(0x1f8)],'duration_ms':_0x218b10},'tasks':_0x49eec1[_0x3fd701(0x2fc)](_0x309632=>({'name':_0x309632[_0x3fd701(0x222)],'state':_0x309632[_0x3fd701(0x2b7)],'startedAt':_0x309632[_0x3fd701(0x2ab)]?new Date(_0x309632[_0x3fd701(0x2ab)]['start'])[_0x3fd701(0x235)]():null,'updatedAt':_0x309632[_0x3fd701(0x2ab)]?new Date(_0x309632[_0x3fd701(0x2ab)][_0x3fd701(0x2f1)])[_0x3fd701(0x235)]():null,'duration_ms':_0x309632[_0x3fd701(0x2ab)]?.[_0x3fd701(0x33c)]||null})),'stats':_0x2d7866};}}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x361fe1(0x26e);['description']=a54_0x361fe1(0x1da);async[a54_0x361fe1(0x1ef)](_0x37e923){const _0x2a7a2e=a54_0x361fe1,{options:_0x147f59,tdx:_0x694f65}=_0x37e923,_0xa9cc46=await withSpinner(_0x2a7a2e(0x293),()=>_0x694f65['workflow'][_0x2a7a2e(0x2c6)](),{'verbose':_0x147f59['verbose']}),_0x4ff902=_0xa9cc46[_0x2a7a2e(0x1a3)];console['error'](_0x2a7a2e(0x346)+_0x4ff902['length']+'\x20schedule'+(_0x4ff902[_0x2a7a2e(0x344)]!==0x1?'s':''));if(isStructuredFormat(_0x147f59))await handleSDKOutput(_0x4ff902,_0x147f59);else{if(_0x4ff902[_0x2a7a2e(0x344)]===0x0)console[_0x2a7a2e(0x31e)](_0x2a7a2e(0x25e));else for(const _0x2b9e8f of _0x4ff902){const _0x13f0df=_0x2b9e8f['disabledAt']?a54_0x6e3482['yellow']('\x20(disabled)'):'',_0x387769=_0x2b9e8f[_0x2a7a2e(0x34b)]?.[_0x2a7a2e(0x222)]?a54_0x6e3482[_0x2a7a2e(0x22b)]('\x20['+_0x2b9e8f[_0x2a7a2e(0x34b)][_0x2a7a2e(0x222)]+']'):'',_0x3b5a6f=_0x2b9e8f['nextRunTime']?a54_0x6e3482[_0x2a7a2e(0x22b)](_0x2a7a2e(0x20d)+new Date(_0x2b9e8f[_0x2a7a2e(0x2e0)])['toLocaleString']()):'';console[_0x2a7a2e(0x31e)](_0x2a7a2e(0x2eb)+_0x2b9e8f['id']+'\x20'+(_0x2b9e8f[_0x2a7a2e(0x1c2)]?.[_0x2a7a2e(0x222)]||_0x2a7a2e(0x1a0))+_0x387769+_0x13f0df+_0x3b5a6f);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']='workflow:schedule:enable';[a54_0x361fe1(0x200)]='Enable\x20a\x20workflow\x20schedule';async[a54_0x361fe1(0x1ef)](_0xb15f31){const _0x355100=a54_0x361fe1,{options:_0x15b5ab,args:_0x50bae4,tdx:_0x1bf2e9}=_0xb15f31,_0x41947d=_0x50bae4[0x0];if(!_0x41947d)return console['error'](a54_0x6e3482['red'](_0x355100(0x2ad)),'Schedule\x20ID\x20is\x20required'),console[_0x355100(0x349)](a54_0x6e3482['dim'](_0x355100(0x27f))),console[_0x355100(0x349)](a54_0x6e3482[_0x355100(0x22b)](_0x355100(0x2f6))),0x1;const _0x122bb9=await withSpinner(_0x355100(0x1f6)+_0x41947d+_0x355100(0x1ea),()=>_0x1bf2e9[_0x355100(0x1c2)][_0x355100(0x1ab)](_0x41947d),{'verbose':_0x15b5ab['verbose']}),_0x24bd08=_0x122bb9[_0x355100(0x1a3)];return isStructuredFormat(_0x15b5ab)?await handleSingleObjectOutput(_0x24bd08,_0x15b5ab):(console[_0x355100(0x31e)]('✔\x20Schedule\x20#'+_0x41947d+_0x355100(0x29b)+(_0x24bd08[_0x355100(0x1c2)]?.[_0x355100(0x222)]||'unknown')+')'),_0x24bd08[_0x355100(0x2e0)]&&console[_0x355100(0x31e)](a54_0x6e3482[_0x355100(0x22b)]('\x20\x20Next\x20run:\x20'+new Date(_0x24bd08['nextRunTime'])[_0x355100(0x1d9)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x361fe1(0x222)]='workflow:schedule:disable';[a54_0x361fe1(0x200)]='Disable\x20a\x20workflow\x20schedule';async[a54_0x361fe1(0x1ef)](_0x531cf6){const _0x3a5a56=a54_0x361fe1,{options:_0x3d6441,args:_0x8f823,tdx:_0x5866b2}=_0x531cf6,_0x6a39a3=_0x8f823[0x0];if(!_0x6a39a3)return console[_0x3a5a56(0x349)](a54_0x6e3482['red'](_0x3a5a56(0x2ad)),_0x3a5a56(0x1ff)),console['error'](a54_0x6e3482[_0x3a5a56(0x22b)](_0x3a5a56(0x335))),console[_0x3a5a56(0x349)](a54_0x6e3482[_0x3a5a56(0x22b)](_0x3a5a56(0x2f6))),0x1;const _0x420f15=await withSpinner(_0x3a5a56(0x256)+_0x6a39a3+'...',()=>_0x5866b2[_0x3a5a56(0x1c2)][_0x3a5a56(0x292)](_0x6a39a3),{'verbose':_0x3d6441['verbose']}),_0x5bbfc6=_0x420f15[_0x3a5a56(0x1a3)];return isStructuredFormat(_0x3d6441)?await handleSingleObjectOutput(_0x5bbfc6,_0x3d6441):console['log'](_0x3a5a56(0x2e7)+_0x6a39a3+'\x20disabled\x20('+(_0x5bbfc6[_0x3a5a56(0x1c2)]?.[_0x3a5a56(0x222)]||'unknown')+')'),0x0;}}
|
|
1
|
+
const a54_0x2a0943=a54_0x5ebb;(function(_0xf7ee2f,_0x24fdf7){const _0x49e936=a54_0x5ebb,_0x4a5c98=_0xf7ee2f();while(!![]){try{const _0x429980=-parseInt(_0x49e936(0x349))/0x1*(-parseInt(_0x49e936(0x344))/0x2)+-parseInt(_0x49e936(0x324))/0x3*(-parseInt(_0x49e936(0x1f6))/0x4)+-parseInt(_0x49e936(0x2f4))/0x5*(parseInt(_0x49e936(0x2b6))/0x6)+parseInt(_0x49e936(0x302))/0x7+parseInt(_0x49e936(0x2ce))/0x8+-parseInt(_0x49e936(0x28d))/0x9+-parseInt(_0x49e936(0x25f))/0xa;if(_0x429980===_0x24fdf7)break;else _0x4a5c98['push'](_0x4a5c98['shift']());}catch(_0x41ed50){_0x4a5c98['push'](_0x4a5c98['shift']());}}}(a54_0x2768,0x18a8a));import a54_0x13943d from'chalk';import{existsSync}from'fs';import a54_0x4c5432 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,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 a54_0x1b2330 from'prompts';function getAttemptStatusDisplay(_0x237b08){const _0x2a9055=a54_0x5ebb;if(!_0x237b08)return{'icon':'⏳','text':''};const {done:_0x51bb11,success:_0x3b75a5,cancelRequested:_0x5394ff}=_0x237b08;if(!_0x51bb11)return _0x5394ff?{'icon':'🛑','text':a54_0x13943d[_0x2a9055(0x2f5)](_0x2a9055(0x27c))}:{'icon':'🔄','text':a54_0x13943d[_0x2a9055(0x258)](_0x2a9055(0x2ea))};if(_0x3b75a5)return{'icon':'✅','text':a54_0x13943d['green']('success')};return{'icon':'❌','text':a54_0x13943d[_0x2a9055(0x1fc)](_0x2a9055(0x2ae))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x2a0943(0x1d4)](_0x3c5ae0,_0x443b93,_0x1987f0=0x0){const _0x30ebfd=a54_0x2a0943;return _0x3c5ae0[_0x1987f0]||_0x443b93[_0x30ebfd(0x2fb)];}[a54_0x2a0943(0x240)](_0x160bdf,_0x479379,_0x1354d0=0x0){const _0x5c76bb=a54_0x2a0943,_0x5ee826=this[_0x5c76bb(0x1d4)](_0x160bdf,_0x479379,_0x1354d0);if(!_0x5ee826)return console[_0x5c76bb(0x2ae)](a54_0x13943d[_0x5c76bb(0x1fc)](_0x5c76bb(0x33f)),_0x5c76bb(0x24c)),console['error'](a54_0x13943d[_0x5c76bb(0x31c)](_0x5c76bb(0x362))),null;return _0x5ee826;}[a54_0x2a0943(0x228)](_0x1c7874,_0x989f86){const _0x2450e8=a54_0x2a0943;if(_0x1c7874[0x0]){const _0x1f12af=_0x1c7874[0x0][_0x2450e8(0x2ca)]('.');if(_0x1f12af[_0x2450e8(0x2c2)]===0x1)return{'projectName':_0x1f12af[0x0],'workflowName':undefined};else return _0x1f12af[_0x2450e8(0x2c2)]===0x2?{'projectName':_0x1f12af[0x0],'workflowName':_0x1f12af[0x1]}:(console[_0x2450e8(0x2ae)](a54_0x13943d['red']('Error:'),_0x2450e8(0x2c5)),null);}return{'projectName':_0x989f86['workflowProject'],'workflowName':undefined};}['resolveProjectDir'](_0x53d13f,_0x176f0e,_0x126834=0x0){const _0x7b14df=a54_0x2a0943;if(_0x53d13f[_0x126834])return _0x53d13f[_0x126834];if(_0x176f0e['workflowProject']){const _0x70b7c5=a54_0x4c5432['join'](process['cwd'](),'workflows',_0x176f0e['workflowProject']);if(existsSync(a54_0x4c5432[_0x7b14df(0x219)](_0x70b7c5,'tdx.json')))return _0x70b7c5;}return undefined;}async[a54_0x2a0943(0x388)](_0x5b4900,_0x5a58d2,_0x329422){const _0x104a95=a54_0x2a0943;try{const _0xabac4b=await _0x5b4900['workflow']['workflows'](_0x5a58d2,{'limit':0x1});if(_0xabac4b[_0x104a95(0x2c2)]>0x0){const _0x3044aa=_0xabac4b[0x0]['id'],_0x4f7c9c=getWorkflowUrl(_0x329422,_0x3044aa);console[_0x104a95(0x2ae)](_0x104a95(0x2fd)+a54_0x13943d[_0x104a95(0x38a)](_0x4f7c9c));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c0);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x203);async[a54_0x2a0943(0x295)](_0x180536){const _0x2b13f3=a54_0x2a0943,{options:_0x4401af,args:_0x1c36f0,tdx:_0x46e025}=_0x180536,_0x234586=_0x1c36f0[0x0],_0x4c749e=_0x4401af[_0x2b13f3(0x213)];if(_0x4c749e)return saveSessionContext({'workflow_project':undefined},_0x4401af[_0x2b13f3(0x229)]),console[_0x2b13f3(0x31e)](a54_0x13943d[_0x2b13f3(0x211)](_0x2b13f3(0x31b))),0x0;if(!_0x234586)return console[_0x2b13f3(0x2ae)](a54_0x13943d['red'](_0x2b13f3(0x33f)),_0x2b13f3(0x24c)),console[_0x2b13f3(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x2b13f3(0x2ae)](a54_0x13943d[_0x2b13f3(0x31c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3cde08=await withSpinner(_0x2b13f3(0x2ac)+_0x234586+'\x27...',()=>_0x46e025[_0x2b13f3(0x2f9)][_0x2b13f3(0x260)](_0x234586),{'verbose':_0x4401af['verbose']}),{name:_0x48561f}=_0x3cde08[_0x2b13f3(0x2c0)];return saveSessionContext({'workflow_project':_0x48561f},_0x4401af['session']),console['log'](a54_0x13943d[_0x2b13f3(0x211)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x13943d[_0x2b13f3(0x38a)](_0x48561f))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0x2a0943(0x366);['description']=a54_0x2a0943(0x37b);async[a54_0x2a0943(0x295)](_0x10f5e5){const _0x3e8c90=a54_0x2a0943,{options:_0x53d205,args:_0x4e4fc6,tdx:_0x335114}=_0x10f5e5,_0x58bd13=_0x4e4fc6[0x0];_0x53d205[_0x3e8c90(0x31f)]&&_0x58bd13&&console['error'](_0x3e8c90(0x1f3)+_0x58bd13);const _0x3ca647=await withSpinner(_0x3e8c90(0x387),()=>_0x335114['workflow'][_0x3e8c90(0x2d3)](_0x58bd13,{'limit':_0x53d205[_0x3e8c90(0x34d)]}),{'verbose':_0x53d205[_0x3e8c90(0x31f)]});let _0x5261f5=_0x3ca647['data'];_0x5261f5[_0x3e8c90(0x2ba)]((_0x372a24,_0x201975)=>_0x372a24[_0x3e8c90(0x1c3)][_0x3e8c90(0x351)](_0x201975[_0x3e8c90(0x1c3)]));const _0x1c9233=_0x53d205[_0x3e8c90(0x34d)]||0x64,_0x28492d=_0x5261f5['length']>=_0x1c9233?a54_0x13943d[_0x3e8c90(0x31c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3e8c90(0x2ae)]('✔\x20Found\x20'+_0x5261f5[_0x3e8c90(0x2c2)]+_0x3e8c90(0x1ec)+(_0x5261f5[_0x3e8c90(0x2c2)]!==0x1?'s':'')+_0x28492d);if(_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x200)||_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x291)||_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x311))await handleSDKOutput(_0x5261f5,_0x53d205);else{if(_0x5261f5[_0x3e8c90(0x2c2)]===0x0)_0x58bd13?console[_0x3e8c90(0x31e)](_0x3e8c90(0x265)+_0x58bd13):console[_0x3e8c90(0x31e)](_0x3e8c90(0x243));else{const _0x1d7085=_0x5261f5[_0x3e8c90(0x285)](_0x3443c6=>{const _0x4bb3f1=_0x3e8c90,_0x5f54df=_0x3443c6[_0x4bb3f1(0x379)]?.[_0x4bb3f1(0x2f0)](_0x3aced6=>_0x3aced6[_0x4bb3f1(0x1d2)]===_0x4bb3f1(0x244)),_0x18d800=_0x5f54df?a54_0x13943d['dim'](_0x4bb3f1(0x325)):'';return'📁\x20'+_0x3443c6[_0x4bb3f1(0x1c3)]+_0x18d800;});await writeOutput(_0x1d7085[_0x3e8c90(0x219)]('\x0a'),_0x53d205['output'],_0x3e8c90(0x354));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1ee);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2bb);async[a54_0x2a0943(0x295)](_0x4f8c99){const _0x500944=a54_0x2a0943,{options:_0x36d714,args:_0x33c6c6,tdx:_0x1ed505}=_0x4f8c99,_0x24f3f6=this[_0x500944(0x1d4)](_0x33c6c6,_0x36d714);_0x36d714[_0x500944(0x31f)]&&_0x24f3f6&&console[_0x500944(0x2ae)](_0x500944(0x23b)+_0x24f3f6);const _0x3c40d2=await withSpinner(_0x500944(0x2b8),()=>_0x1ed505[_0x500944(0x2f9)][_0x500944(0x1d5)](_0x24f3f6,{'limit':_0x36d714[_0x500944(0x34d)]}),{'verbose':_0x36d714[_0x500944(0x31f)]});let _0x4615fa=_0x3c40d2['data'];_0x4615fa[_0x500944(0x2ba)]((_0x77ed16,_0x58c195)=>{const _0x1ffc44=_0x500944,_0x18a598=_0x77ed16[_0x1ffc44(0x1c3)][_0x1ffc44(0x351)](_0x58c195[_0x1ffc44(0x1c3)]);if(_0x18a598!==0x0)return _0x18a598;return(_0x77ed16[_0x1ffc44(0x330)]?.[_0x1ffc44(0x1c3)]||'')[_0x1ffc44(0x351)](_0x58c195['project']?.[_0x1ffc44(0x1c3)]||'');});const _0x3547f5=_0x36d714[_0x500944(0x34d)]||0x64,_0xdb6455=_0x4615fa[_0x500944(0x2c2)]>=_0x3547f5?a54_0x13943d[_0x500944(0x31c)](_0x500944(0x2e5)):'';console[_0x500944(0x2ae)](_0x500944(0x37e)+_0x4615fa[_0x500944(0x2c2)]+_0x500944(0x316)+(_0x4615fa[_0x500944(0x2c2)]!==0x1?'s':'')+_0xdb6455);if(_0x36d714[_0x500944(0x352)]===_0x500944(0x200)||_0x36d714['format']==='jsonl'||_0x36d714[_0x500944(0x352)]===_0x500944(0x311))await handleSDKOutput(_0x4615fa,_0x36d714);else{if(_0x4615fa[_0x500944(0x2c2)]===0x0)_0x24f3f6?console[_0x500944(0x31e)](_0x500944(0x232)+_0x24f3f6):console[_0x500944(0x31e)](_0x500944(0x293));else{const _0x4c6b1b=_0x36d714[_0x500944(0x1e2)],_0x3e995d=_0x4615fa[_0x500944(0x285)](_0x58110f=>{const _0x5edf10=_0x500944,_0x59e75e=a54_0x13943d[_0x5edf10(0x31c)]('#'+_0x58110f['id']),_0x4ff677=hyperlink(_0x59e75e,getWorkflowUrl(_0x4c6b1b,_0x58110f['id'])),_0x20daf6=_0x58110f[_0x5edf10(0x330)]?.[_0x5edf10(0x1c3)]?a54_0x13943d[_0x5edf10(0x31c)]('\x20('+_0x58110f[_0x5edf10(0x330)][_0x5edf10(0x1c3)]+')'):'';return _0x5edf10(0x381)+_0x4ff677+'\x20'+_0x58110f[_0x5edf10(0x1c3)]+_0x20daf6;});await writeOutput(_0x3e995d[_0x500944(0x219)]('\x0a'),_0x36d714[_0x500944(0x1bb)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2a8);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x375);async[a54_0x2a0943(0x295)](_0x249da0){const _0x25f139=a54_0x2a0943,{options:_0x40dfbf,args:_0x5f0405,tdx:_0x150a8c}=_0x249da0,_0x33b2ef=this[_0x25f139(0x228)](_0x5f0405,_0x40dfbf);if(!_0x33b2ef)return 0x1;const {projectName:_0x13371e,workflowName:_0x56e521}=_0x33b2ef;if(_0x40dfbf['verbose']){if(_0x13371e&&_0x56e521)console['error'](_0x25f139(0x24f)+_0x13371e+'.'+_0x56e521);else _0x13371e&&console[_0x25f139(0x2ae)](_0x25f139(0x2d5)+_0x13371e);const _0x573065=_0x40dfbf[_0x25f139(0x2ec)];_0x573065&&console[_0x25f139(0x2ae)](_0x25f139(0x346)+_0x573065);}let _0x78ff48=0x28;if(process['stdout'][_0x25f139(0x2aa)]&&!_0x40dfbf[_0x25f139(0x1bb)]&&!_0x40dfbf['format']){const _0x2fbcea=process[_0x25f139(0x2fc)][_0x25f139(0x1fd)]||0x28;_0x78ff48=Math[_0x25f139(0x26c)](0x14,Math[_0x25f139(0x2bc)](_0x2fbcea*0x2/0x3));}const _0x253a20=_0x40dfbf[_0x25f139(0x34d)]||_0x78ff48,_0x405813=await withSpinner(_0x25f139(0x2cf),()=>_0x150a8c['workflow'][_0x25f139(0x296)]({'projectName':_0x13371e,'workflowName':_0x56e521,'status':_0x40dfbf[_0x25f139(0x2ec)],'fromTime':_0x40dfbf[_0x25f139(0x365)],'toTime':_0x40dfbf['to'],'limit':_0x253a20}),{'verbose':_0x40dfbf[_0x25f139(0x31f)]}),_0x2105cf=_0x405813[_0x25f139(0x2c0)];_0x2105cf[_0x25f139(0x2ba)]((_0x12ad63,_0x6dbe06)=>{const _0x415684=_0x25f139,_0x510ef1=_0x12ad63['sessionTime']||'',_0x48ccac=_0x6dbe06[_0x415684(0x36a)]||'';return _0x48ccac[_0x415684(0x351)](_0x510ef1);});_0x2105cf[_0x25f139(0x2c2)]>=_0x253a20?console[_0x25f139(0x2ae)](_0x25f139(0x2f1)+_0x2105cf[_0x25f139(0x2c2)]+_0x25f139(0x29d)+a54_0x13943d['dim'](_0x25f139(0x364))):console['error']('✔\x20Found\x20'+_0x2105cf[_0x25f139(0x2c2)]+_0x25f139(0x284)+(_0x2105cf['length']!==0x1?'s':''));if(_0x40dfbf[_0x25f139(0x352)]==='json'||_0x40dfbf[_0x25f139(0x352)]===_0x25f139(0x291)||_0x40dfbf[_0x25f139(0x352)]==='table')await handleSDKOutput(_0x2105cf,_0x40dfbf);else{if(!process[_0x25f139(0x2fc)][_0x25f139(0x2aa)]||_0x40dfbf['output']){if(_0x2105cf[_0x25f139(0x2c2)]===0x0){if(_0x13371e&&_0x56e521)console[_0x25f139(0x31e)](_0x25f139(0x234)+_0x13371e+'.'+_0x56e521);else _0x13371e?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x13371e):console[_0x25f139(0x31e)](_0x25f139(0x334));}else{const _0x27072e=_0x40dfbf[_0x25f139(0x1e2)],_0x423812=this[_0x25f139(0x227)](_0x2105cf,_0x27072e);_0x40dfbf[_0x25f139(0x1bb)]?await writeOutput(_0x423812,_0x40dfbf['output'],'list'):console[_0x25f139(0x31e)](_0x423812);}!_0x13371e&&(console[_0x25f139(0x2ae)](''),console[_0x25f139(0x2ae)](a54_0x13943d['dim'](_0x25f139(0x34c))),console[_0x25f139(0x2ae)](a54_0x13943d[_0x25f139(0x31c)](_0x25f139(0x2d8))+'or'+a54_0x13943d[_0x25f139(0x31c)](_0x25f139(0x264))));}else{if(_0x2105cf[_0x25f139(0x2c2)]===0x0){if(_0x13371e&&_0x56e521)console[_0x25f139(0x31e)](_0x25f139(0x234)+_0x13371e+'.'+_0x56e521);else _0x13371e?console['log'](_0x25f139(0x372)+_0x13371e):console[_0x25f139(0x31e)](_0x25f139(0x334));}else await this[_0x25f139(0x36c)](_0x2105cf,_0x249da0,_0x13371e);}}return 0x0;}[a54_0x2a0943(0x227)](_0x66f4da,_0x2ffd70){const _0x39407f=a54_0x2a0943,_0x2c6c5f=[],_0x1e155e=new Map();let _0x45787e=Infinity,_0x2e4428=-Infinity;for(const _0x3ee661 of _0x66f4da){if(_0x3ee661[_0x39407f(0x363)]?.['createdAt']){const _0xac8301=new Date(_0x3ee661['lastAttempt'][_0x39407f(0x34e)])[_0x39407f(0x29c)](),_0x24f7fc=_0x3ee661[_0x39407f(0x363)][_0x39407f(0x2e0)]?new Date(_0x3ee661['lastAttempt'][_0x39407f(0x2e0)])[_0x39407f(0x29c)]():Date[_0x39407f(0x22e)](),_0x4277c7=_0x3ee661[_0x39407f(0x330)]?.[_0x39407f(0x1c3)]||_0x39407f(0x1d8);!_0x1e155e[_0x39407f(0x383)](_0x4277c7)&&_0x1e155e[_0x39407f(0x2a7)](_0x4277c7,[]),_0x1e155e[_0x39407f(0x1bf)](_0x4277c7)[_0x39407f(0x377)]({'session':_0x3ee661,'startTime':_0xac8301,'endTime':_0x24f7fc,'duration':_0x24f7fc-_0xac8301}),_0x45787e=Math['min'](_0x45787e,_0xac8301),_0x2e4428=Math['max'](_0x2e4428,_0x24f7fc);}}if(_0x1e155e[_0x39407f(0x1e5)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x29e5d8=process[_0x39407f(0x2fc)][_0x39407f(0x34a)]||0x78,_0x299122=0x1e,_0x17ce2=0x32,_0x467ab6=0x4,_0x15202c=Math[_0x39407f(0x294)](_0x17ce2,Math['max'](_0x299122,Math[_0x39407f(0x2bc)](_0x29e5d8*0.3))),_0x4fddc6=_0x29e5d8-_0x15202c-TIMELINE_CONFIG['GUTTER']-0x3-_0x467ab6,_0xa3994f=_0x2e4428-_0x45787e,_0x509a76=_0xa3994f/_0x15202c,_0x43c7a2=renderTimeAxis({'startTime':_0x45787e,'endTime':_0x2e4428,'durationMs':_0xa3994f,'msPerChar':_0x509a76},_0x15202c),_0x3f98d7=[];for(const _0x1b92de of _0x1e155e[_0x39407f(0x34f)]()){_0x3f98d7[_0x39407f(0x377)](..._0x1b92de);}_0x3f98d7[_0x39407f(0x2ba)]((_0x1006db,_0x2fd758)=>_0x2fd758[_0x39407f(0x2c3)]-_0x1006db[_0x39407f(0x2c3)]);const _0x8e450e=new Date(_0x45787e),_0x26aaac=formatDate(_0x8e450e),_0x221479=_0x467ab6+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x4fddc6,_0x4352ab='\x20'[_0x39407f(0x297)](_0x221479-_0x26aaac[_0x39407f(0x2c2)]),_0x144798=_0x4352ab+a54_0x13943d[_0x39407f(0x31c)](_0x26aaac)+'\x20'+_0x43c7a2;_0x2c6c5f[_0x39407f(0x377)](_0x144798);const _0x3339e1=0x16;let _0x52e3b1=0x0;for(const _0x447c7b of _0x3f98d7){const _0x4cfbd7=_0x447c7b['session']['project']?.[_0x39407f(0x1c3)]||'?',_0xe8bf25=Math[_0x39407f(0x294)](stringWidth(_0x4cfbd7),_0x3339e1);_0x52e3b1=Math[_0x39407f(0x26c)](_0x52e3b1,_0xe8bf25);}for(const _0x35460b of _0x3f98d7){const {session:_0x195f02,startTime:_0xd431cc,endTime:_0x8b8e67,duration:_0x370413}=_0x35460b,_0x35ecc9=_0x195f02['project']?.['id'],_0x435ac9=_0x195f02['id'],_0x54318f=_0x195f02[_0x39407f(0x330)]?.[_0x39407f(0x1c3)]||'?',_0x2aea14=_0x195f02[_0x39407f(0x2f9)]?.[_0x39407f(0x1c3)]||'?';let _0x240654,_0x1283df;if(_0x195f02[_0x39407f(0x363)]){const _0x986773=_0x195f02['lastAttempt'];!_0x986773[_0x39407f(0x20a)]?(_0x240654=_0x986773['cancelRequested']?'🛑':'🔄',_0x1283df=_0x986773['cancelRequested']?a54_0x13943d[_0x39407f(0x2f5)]:a54_0x13943d[_0x39407f(0x258)]):(_0x240654=_0x986773[_0x39407f(0x204)]?'✅':'❌',_0x1283df=_0x986773[_0x39407f(0x204)]?a54_0x13943d[_0x39407f(0x211)]:a54_0x13943d[_0x39407f(0x1fc)]);}else _0x240654='⏳',_0x1283df=a54_0x13943d[_0x39407f(0x31c)];const _0x5cff45='#'+_0x435ac9,_0x2e9856=_0x35ecc9?hyperlink(_0x5cff45,getWorkflowSessionUrl(_0x2ffd70,_0x35ecc9,_0x435ac9)):_0x5cff45;let _0x4ff1f3=_0x54318f;stringWidth(_0x54318f)>_0x3339e1&&(_0x4ff1f3=_0x54318f['slice'](0x0,_0x3339e1-0x1)+'…');const _0x55817d=a54_0x13943d[_0x39407f(0x31c)](_0x4ff1f3),_0x5f6ca4=stringWidth(_0x4ff1f3),_0x52d5b6='\x20'[_0x39407f(0x297)](_0x52e3b1-stringWidth(_0x4ff1f3)+0x2),_0x442fef='('+formatElapsed(_0x370413)+')',_0x35ee77=stringWidth(_0x442fef),_0x2ddb15=stringWidth(_0x5cff45),_0x1ddb60=_0x2ddb15+0x1+_0x5f6ca4+_0x52d5b6[_0x39407f(0x2c2)],_0x4214eb=_0x4fddc6-_0x1ddb60-_0x35ee77-0x1-0x8;let _0x28b3be=_0x2aea14;stringWidth(_0x28b3be)>_0x4214eb&&(_0x28b3be=_0x28b3be['slice'](0x0,_0x4214eb-0x1)+'…');const _0x52e7e6=_0x2e9856+'\x20'+_0x55817d+_0x52d5b6+_0x28b3be,_0x176e42=stringWidth(_0x52e7e6),_0x5833fd=_0x4fddc6-_0x176e42-_0x35ee77,_0x2c1b1a=_0x52e7e6+'\x20'[_0x39407f(0x297)](Math[_0x39407f(0x26c)](0x1,_0x5833fd))+a54_0x13943d[_0x39407f(0x31c)](_0x442fef),_0x5900b3=Math[_0x39407f(0x2bc)]((_0xd431cc-_0x45787e)/_0x509a76),_0x4ee2ed=Math[_0x39407f(0x2bc)]((_0x8b8e67-_0x45787e)/_0x509a76),_0x286230=Math[_0x39407f(0x26c)](_0x5900b3+0x1,_0x4ee2ed),_0x1436ce=new Array(_0x15202c)['fill']('\x20');for(let _0x4deb3e=_0x5900b3;_0x4deb3e<Math[_0x39407f(0x294)](_0x286230,_0x15202c);_0x4deb3e++){_0x1436ce[_0x4deb3e]='─';}const _0x556149=_0x1436ce[_0x39407f(0x285)](_0x4fc93d=>_0x4fc93d==='\x20'?'\x20':_0x1283df(_0x4fc93d))[_0x39407f(0x219)]('');_0x2c6c5f[_0x39407f(0x377)](_0x240654+'\x20'+_0x2c1b1a+'│'+_0x556149+'│');}return _0x2c6c5f[_0x39407f(0x219)]('\x0a');}async['navigateSessionsInteractive'](_0x1cb770,_0x4ec489,_0xa6d679){const _0x305c9c=a54_0x2a0943,{options:_0x699f4e,tdx:_0x5ee484}=_0x4ec489,_0x5ad973=_0x699f4e[_0x305c9c(0x1e2)],{timelineRows:_0x47cb95,timeAxisHeader:_0x2db2f9}=this[_0x305c9c(0x389)](_0x1cb770,_0x5ad973),_0x3b188b=_0x47cb95['filter'](_0x26dec7=>_0x26dec7[_0x305c9c(0x20b)]);if(_0x3b188b[_0x305c9c(0x2c2)]===0x0){const _0x3addf3=this[_0x305c9c(0x227)](_0x1cb770,_0x5ad973);console[_0x305c9c(0x31e)](_0x3addf3);!_0xa6d679&&(console[_0x305c9c(0x2ae)](''),console[_0x305c9c(0x2ae)](a54_0x13943d['dim'](_0x305c9c(0x34c))),console['error'](a54_0x13943d[_0x305c9c(0x31c)](_0x305c9c(0x2d8))+'or'+a54_0x13943d['dim'](_0x305c9c(0x264))));return;}_0x2db2f9&&console[_0x305c9c(0x31e)](_0x2db2f9);const _0x16c9d3=_0x47cb95[_0x305c9c(0x2ed)](_0x5496d5=>_0x5496d5[_0x305c9c(0x20b)])[_0x305c9c(0x285)](_0x45c37d=>({'title':_0x45c37d[_0x305c9c(0x2b9)],'value':_0x45c37d['attemptId']})),_0x2397bd=process['stdout'][_0x305c9c(0x1fd)]||0x3c,_0x54ab0e=Math[_0x305c9c(0x26c)](0x28,Math[_0x305c9c(0x2bc)](_0x2397bd*0x2/0x3)),_0x44c8eb=await a54_0x1b2330({'type':_0x305c9c(0x214),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x16c9d3,'initial':-0x1,'limit':_0x54ab0e,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x3f551f,_0x13bb16)=>{const _0x26379a=_0x305c9c;if(!_0x3f551f)return Promise[_0x26379a(0x223)](_0x13bb16);const _0x5855dd=_0x13bb16['filter'](_0x8b1d02=>{const _0x2b7e91=_0x26379a,_0x489ffd=_0x8b1d02;return _0x489ffd['title'][_0x2b7e91(0x1ea)]()[_0x2b7e91(0x2c6)](_0x3f551f[_0x2b7e91(0x1ea)]());});return Promise[_0x26379a(0x223)](_0x5855dd);}}),_0x3e54dd=()=>{const _0x4c0835=_0x305c9c;process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)](_0x4c0835(0x2b2)),process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)]('\x1b[1A\x1b[2K'),process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)](_0x4c0835(0x2b2));},_0x196f26=_0x44c8eb&&_0x44c8eb[_0x305c9c(0x20b)]&&_0x44c8eb['attemptId']!==null&&_0x44c8eb[_0x305c9c(0x20b)][_0x305c9c(0x2c9)]()!=='';if(!_0x196f26){_0x3e54dd(),console[_0x305c9c(0x31e)](a54_0x13943d['dim']('Cancelled'));return;}_0x3e54dd();const _0x985979=_0x1cb770['find'](_0x2a5804=>_0x2a5804[_0x305c9c(0x363)]?.['id']===_0x44c8eb[_0x305c9c(0x20b)]);if(_0x985979){const _0x152590=_0x985979['project']?.[_0x305c9c(0x1c3)]||'?',_0x1ea567=_0x985979[_0x305c9c(0x2f9)]?.[_0x305c9c(0x1c3)]||'?';console[_0x305c9c(0x31e)](_0x305c9c(0x30e)+a54_0x13943d[_0x305c9c(0x31c)](_0x152590)+_0x305c9c(0x22a)+a54_0x13943d[_0x305c9c(0x31c)](_0x1ea567));}const _0x4a83f6=new WorkflowTimelineCommand();await _0x4a83f6[_0x305c9c(0x295)]({'args':[],'options':{..._0x699f4e,'attemptId':_0x44c8eb[_0x305c9c(0x20b)]},'tdx':_0x5ee484});}['generateSessionTimelineRows'](_0x3b0bc7,_0x1508fa){const _0x2e91c0=a54_0x2a0943,_0x1d3678=new Map();for(const _0x1f2ed5 of _0x3b0bc7){_0x1f2ed5['id']&&_0x1f2ed5[_0x2e91c0(0x363)]?.['id']&&_0x1d3678['set'](_0x1f2ed5['id'],_0x1f2ed5[_0x2e91c0(0x363)]['id']);}const _0x2b0afa=[];let _0x3eb66d='';const _0x2bc52e=this['renderSessionsTimeline'](_0x3b0bc7,_0x1508fa),_0x31e85e=_0x2bc52e[_0x2e91c0(0x2ca)]('\x0a');for(const _0x1bf963 of _0x31e85e){if(_0x1bf963['startsWith'](_0x2e91c0(0x350))||_0x1bf963[_0x2e91c0(0x2d4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3eb66d=_0x1bf963;else{if(_0x1bf963['match'](/^[✅❌🔄🛑⏳]/)){const _0x649a6b=_0x1bf963[_0x2e91c0(0x2d4)](/#(\d+)/),_0x77203d=_0x649a6b?_0x649a6b[0x1]:null,_0x56f129=_0x77203d?_0x1d3678[_0x2e91c0(0x1bf)](_0x77203d)||null:null,_0x39f0f8=_0x3b0bc7[_0x2e91c0(0x331)](_0x1824a3=>_0x1824a3['id']===_0x77203d),_0x477ee2=_0x39f0f8?.['project']?.[_0x2e91c0(0x1c3)]||'';_0x2b0afa[_0x2e91c0(0x377)]({'displayLine':_0x1bf963,'attemptId':_0x56f129,'projectName':_0x477ee2});}}}return{'timelineRows':_0x2b0afa,'timeAxisHeader':_0x3eb66d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x2b5);['description']=a54_0x2a0943(0x1d9);async[a54_0x2a0943(0x295)](_0x5a96c5){const _0x5eb72f=a54_0x2a0943,{options:_0x48e602,args:_0x349fc2,tdx:_0x56b2fc}=_0x5a96c5,_0x37ba8d=this['parseProjectWorkflowPattern'](_0x349fc2,_0x48e602);if(!_0x37ba8d)return 0x1;const {projectName:_0x406218,workflowName:_0x1c5053}=_0x37ba8d,_0xf4840b=_0x48e602['includeRetried'];if(_0x48e602[_0x5eb72f(0x31f)]){if(_0x406218&&_0x1c5053)console[_0x5eb72f(0x2ae)](_0x5eb72f(0x24f)+_0x406218+'.'+_0x1c5053);else _0x406218&&console[_0x5eb72f(0x2ae)](_0x5eb72f(0x2d5)+_0x406218);_0xf4840b&&console[_0x5eb72f(0x2ae)](_0x5eb72f(0x2e7));}const _0x1eb104=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x56b2fc[_0x5eb72f(0x2f9)]['attempts']({'projectName':_0x406218,'workflowName':_0x1c5053,'includeRetried':_0xf4840b,'limit':_0x48e602[_0x5eb72f(0x34d)]}),{'verbose':_0x48e602[_0x5eb72f(0x31f)]}),_0x267641=_0x1eb104[_0x5eb72f(0x2c0)],_0x3ed299=_0x48e602[_0x5eb72f(0x34d)]||0x64,_0x26c7f2=_0x267641['length']>=_0x3ed299?a54_0x13943d[_0x5eb72f(0x31c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x5eb72f(0x2ae)]('✔\x20Found\x20'+_0x267641[_0x5eb72f(0x2c2)]+_0x5eb72f(0x212)+(_0x267641[_0x5eb72f(0x2c2)]!==0x1?'s':'')+_0x26c7f2);if(_0x48e602['format']===_0x5eb72f(0x200)||_0x48e602[_0x5eb72f(0x352)]===_0x5eb72f(0x291)||_0x48e602['format']===_0x5eb72f(0x311))await handleSDKOutput(_0x267641,_0x48e602);else{if(_0x267641[_0x5eb72f(0x2c2)]===0x0){if(_0x406218&&_0x1c5053)console['log'](_0x5eb72f(0x28a)+_0x406218+'.'+_0x1c5053);else _0x406218?console[_0x5eb72f(0x31e)](_0x5eb72f(0x1dd)+_0x406218):console[_0x5eb72f(0x31e)](_0x5eb72f(0x368));}else{const _0x52f395=_0x48e602[_0x5eb72f(0x1e2)],_0x29fde9=_0x267641[_0x5eb72f(0x285)](_0x1a715e=>{const _0x3273ce=_0x5eb72f,_0x5ccce1=a54_0x13943d[_0x3273ce(0x31c)]('#'+_0x1a715e['id']),_0x14fac3=_0x1a715e[_0x3273ce(0x330)]?.['id'],_0xe46731=_0x1a715e[_0x3273ce(0x1f8)]||_0x1a715e['sessionId'],_0x1eb4e0=_0x14fac3&&_0xe46731?hyperlink(_0x5ccce1,getWorkflowAttemptUrl(_0x52f395,_0x14fac3,_0xe46731,_0x1a715e['id'])):_0x5ccce1,{icon:_0x4a42b8,text:_0x3c3abb}=getAttemptStatusDisplay(_0x1a715e),_0x580766=(_0x1a715e[_0x3273ce(0x330)]?.['name']||'?')+'.'+(_0x1a715e[_0x3273ce(0x2f9)]?.[_0x3273ce(0x1c3)]||'?'),_0x3edb0c=_0x1a715e[_0x3273ce(0x36a)]?a54_0x13943d[_0x3273ce(0x31c)](_0x1a715e[_0x3273ce(0x36a)]):'';return(_0x1eb4e0+'\x20'+_0x4a42b8+(_0x3c3abb?'\x20'+_0x3c3abb:'')+'\x20'+_0x580766+'\x20'+_0x3edb0c)['trimEnd']();});await writeOutput(_0x29fde9[_0x5eb72f(0x219)]('\x0a'),_0x48e602['output'],_0x5eb72f(0x354));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c2);['description']='Show\x20specific\x20attempt\x20details';async['execute'](_0x3a3a83){const _0x10189d=a54_0x2a0943,{options:_0x5e1a10,args:_0x20c12d,tdx:_0x4b412c}=_0x3a3a83,_0x2c3234=_0x20c12d[0x0];if(!_0x2c3234)return console[_0x10189d(0x2ae)](_0x10189d(0x231)),0x1;_0x5e1a10['verbose']&&console[_0x10189d(0x2ae)](_0x10189d(0x310)+_0x2c3234);const _0x499f81=await withSpinner(_0x10189d(0x2f3),()=>_0x4b412c['workflow'][_0x10189d(0x1ff)](_0x2c3234),{'verbose':_0x5e1a10[_0x10189d(0x31f)]}),_0x1d2b73=_0x499f81[_0x10189d(0x2c0)];let _0x4d70dd;!_0x1d2b73['done']?_0x4d70dd=_0x1d2b73[_0x10189d(0x2a9)]?_0x10189d(0x27c):_0x10189d(0x2ea):_0x4d70dd=_0x1d2b73['success']?_0x10189d(0x204):_0x10189d(0x2ae);let _0x112131;if(_0x1d2b73[_0x10189d(0x34e)]&&_0x1d2b73[_0x10189d(0x2e0)]){const _0x4f9067=new Date(_0x1d2b73['createdAt'])['getTime'](),_0x120122=new Date(_0x1d2b73[_0x10189d(0x2e0)])[_0x10189d(0x29c)]();_0x112131=Math[_0x10189d(0x277)]((_0x120122-_0x4f9067)/0x3e8);}const _0x20712b={'attempt_id':_0x1d2b73['id'],'status':_0x4d70dd,..._0x1d2b73['index']!==undefined&&{'index':_0x1d2b73[_0x10189d(0x2bf)]},..._0x1d2b73[_0x10189d(0x330)]&&{'project':_0x1d2b73[_0x10189d(0x330)]['name']},..._0x1d2b73[_0x10189d(0x2f9)]&&{'workflow':_0x1d2b73[_0x10189d(0x2f9)]['name']},..._0x1d2b73[_0x10189d(0x1fe)]&&{'session_id':_0x1d2b73[_0x10189d(0x1fe)]},..._0x1d2b73[_0x10189d(0x36a)]&&{'session_time':_0x1d2b73[_0x10189d(0x36a)]},..._0x1d2b73[_0x10189d(0x358)]&&{'retry_attempt':_0x1d2b73[_0x10189d(0x358)]},..._0x112131!==undefined&&{'duration_sec':_0x112131},..._0x1d2b73[_0x10189d(0x34e)]&&{'created_at':_0x1d2b73[_0x10189d(0x34e)]},..._0x1d2b73['finishedAt']&&{'finished_at':_0x1d2b73[_0x10189d(0x2e0)]},...Object[_0x10189d(0x1c9)](_0x1d2b73[_0x10189d(0x253)])[_0x10189d(0x2c2)]>0x0&&{'params':_0x1d2b73[_0x10189d(0x253)]}};return await handleSingleObjectOutput(_0x20712b,_0x5e1a10),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x2a0943(0x23d);[a54_0x2a0943(0x337)]='Show\x20tasks\x20for\x20an\x20attempt';async[a54_0x2a0943(0x295)](_0x5d5f0b){const _0x3b4b8e=a54_0x2a0943,{options:_0x1d8e9d,args:_0x238534,tdx:_0x1fc44c}=_0x5d5f0b,_0x341448=_0x238534[0x0];if(!_0x341448)return console[_0x3b4b8e(0x2ae)](_0x3b4b8e(0x231)),0x1;const _0x40ddff=_0x1d8e9d[_0x3b4b8e(0x209)];_0x1d8e9d[_0x3b4b8e(0x31f)]&&(console[_0x3b4b8e(0x2ae)](_0x3b4b8e(0x310)+_0x341448),_0x40ddff&&console['error'](_0x3b4b8e(0x359)));const _0x2d1053=await withSpinner(_0x3b4b8e(0x371),()=>_0x1fc44c[_0x3b4b8e(0x2f9)]['tasks'](_0x341448,_0x40ddff||![]),{'verbose':_0x1d8e9d[_0x3b4b8e(0x31f)]}),_0x169f81=_0x2d1053['data'];return console[_0x3b4b8e(0x2ae)]('✔\x20Found\x20'+_0x169f81['length']+_0x3b4b8e(0x1de)+(_0x169f81['length']!==0x1?'s':'')),await handleSDKOutput(_0x169f81,_0x1d8e9d),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a54_0x2a0943(0x1c4);['description']=a54_0x2a0943(0x283);async[a54_0x2a0943(0x295)](_0x4483d1){const _0x472c3d=a54_0x2a0943,{options:_0x571506,args:_0xe8eb53,tdx:_0x3bdc4c}=_0x4483d1,_0x22aeae=_0xe8eb53[0x0];let _0x36ff36=_0xe8eb53[0x1];if(!_0x22aeae)return console['error'](_0x472c3d(0x231)),0x1;_0x571506['verbose']&&(console[_0x472c3d(0x2ae)](_0x472c3d(0x310)+_0x22aeae),_0x36ff36&&console[_0x472c3d(0x2ae)](_0x472c3d(0x308)+_0x36ff36));const _0x4a377f=await withSpinner(_0x472c3d(0x30c),()=>_0x3bdc4c['workflow'][_0x472c3d(0x286)](_0x22aeae,_0x36ff36),{'verbose':_0x571506[_0x472c3d(0x31f)]}),_0x47c28c=_0x4a377f[_0x472c3d(0x2c0)];if(_0x47c28c['length']===0x0)return console['error'](_0x472c3d(0x2a0)),0x0;if(!_0x36ff36&&(_0x571506[_0x472c3d(0x200)]||_0x571506['format']))return await handleSDKOutput(_0x47c28c,_0x571506),0x0;if(!_0x36ff36){const _0x114fe9=_0x47c28c['map'](_0x249ec2=>({'title':_0x249ec2[_0x472c3d(0x343)]+'\x20('+formatBytes(_0x249ec2[_0x472c3d(0x369)])+')','value':_0x249ec2[_0x472c3d(0x343)]})),_0x20716e=await a54_0x1b2330({'type':_0x472c3d(0x336),'name':_0x472c3d(0x27e),'message':_0x472c3d(0x236),'choices':_0x114fe9});if(!_0x20716e[_0x472c3d(0x27e)])return console[_0x472c3d(0x2ae)](_0x472c3d(0x22c)),0x0;_0x36ff36=_0x20716e[_0x472c3d(0x27e)];}const _0x21dd97=await withSpinner(_0x472c3d(0x1c5),()=>_0x3bdc4c[_0x472c3d(0x2f9)][_0x472c3d(0x1d1)](_0x22aeae,_0x36ff36),{'verbose':_0x571506[_0x472c3d(0x31f)]}),_0x308e06=_0x21dd97['data'];return _0x308e06?console[_0x472c3d(0x31e)](_0x308e06):console[_0x472c3d(0x2ae)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x386);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x24d);async[a54_0x2a0943(0x295)](_0xc63e18){const _0x1192f2=a54_0x2a0943,{options:_0x2d2927,args:_0x5b5d5a,tdx:_0x292140}=_0xc63e18,_0xd145ee=_0x5b5d5a[0x0];if(!_0xd145ee)return console[_0x1192f2(0x2ae)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x39eff5=_0x2d2927[_0x1192f2(0x254)];_0x2d2927[_0x1192f2(0x31f)]&&(console['error'](_0x1192f2(0x310)+_0xd145ee),_0x39eff5&&console[_0x1192f2(0x2ae)](_0x1192f2(0x2bd)+_0x39eff5));if(!_0x2d2927['yes']){if(!isInteractive())return console[_0x1192f2(0x2ae)](a54_0x13943d['red'](_0x1192f2(0x252)),_0x1192f2(0x2e4)),console[_0x1192f2(0x2ae)](a54_0x13943d[_0x1192f2(0x31c)](_0x1192f2(0x25d))),0x1;const _0x543766=await confirmKey(_0x1192f2(0x29b)+_0xd145ee+'?');if(!_0x543766)return console['error'](a54_0x13943d['yellow'](_0x1192f2(0x22c))),0x1;}const _0x4f132f=await withSpinner('Killing\x20attempt...',()=>_0x292140[_0x1192f2(0x2f9)][_0x1192f2(0x1f5)](_0xd145ee,_0x39eff5),{'verbose':_0x2d2927[_0x1192f2(0x31f)]}),_0x395540=_0x4f132f[_0x1192f2(0x2c0)];return console['error']('✔\x20'+_0x395540),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]='workflow:retry';['description']=a54_0x2a0943(0x255);async[a54_0x2a0943(0x295)](_0x2ec92c){const _0xcfac80=a54_0x2a0943,{options:_0x198308,args:_0x39c043,tdx:_0x306e7e}=_0x2ec92c,_0x31478a=_0x39c043[0x0];if(!_0x31478a)return console[_0xcfac80(0x2ae)](_0xcfac80(0x270)),console[_0xcfac80(0x2ae)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x14d630=![],_0x30a302=_0x31478a;if(_0x31478a[_0xcfac80(0x37d)](_0xcfac80(0x22f)))_0x14d630=!![],_0x30a302=_0x31478a[_0xcfac80(0x259)](0x8);else{if(_0x31478a[_0xcfac80(0x37d)](_0xcfac80(0x241)))_0x14d630=![],_0x30a302=_0x31478a['substring'](0x8);else return console['error'](_0xcfac80(0x342)),console[_0xcfac80(0x2ae)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x5dfb3e=_0x198308['fromTask'],_0x4945d4=_0x198308[_0xcfac80(0x220)],_0x31103b=_0x198308[_0xcfac80(0x253)],_0x2c6504=_0x198308[_0xcfac80(0x328)];_0x198308[_0xcfac80(0x31f)]&&(console[_0xcfac80(0x2ae)]('Target:\x20'+(_0x14d630?'session':_0xcfac80(0x1ff))+'\x20'+_0x30a302),_0x5dfb3e&&console[_0xcfac80(0x2ae)](_0xcfac80(0x35c)+_0x5dfb3e),_0x4945d4&&console[_0xcfac80(0x2ae)]('Resume\x20from:\x20'+_0x4945d4),_0x31103b&&console[_0xcfac80(0x2ae)]('Params:\x20'+_0x31103b),_0x2c6504&&console[_0xcfac80(0x2ae)](_0xcfac80(0x303)));let _0xf981ed;if(_0x31103b)try{if(_0x31103b[_0xcfac80(0x37d)]('@')){const _0x300e5c=await import(_0xcfac80(0x1f1)),_0x56a708=_0x31103b[_0xcfac80(0x259)](0x1),_0x19207c=await _0x300e5c[_0xcfac80(0x2e2)](_0x56a708,'utf-8');_0xf981ed=JSON['parse'](_0x19207c);}else _0xf981ed=JSON[_0xcfac80(0x1bd)](_0x31103b);}catch{return console[_0xcfac80(0x2ae)](_0xcfac80(0x24b)),0x1;}if(!_0x198308[_0xcfac80(0x340)]){if(!isInteractive())return console[_0xcfac80(0x2ae)](a54_0x13943d[_0xcfac80(0x1fc)](_0xcfac80(0x252)),_0xcfac80(0x2e4)),console[_0xcfac80(0x2ae)](a54_0x13943d['dim'](_0xcfac80(0x25d))),0x1;const _0x4f1441=await confirmKey(_0xcfac80(0x35b)+(_0x14d630?_0xcfac80(0x229):_0xcfac80(0x1ff))+'\x20'+_0x30a302+'?');if(!_0x4f1441)return console['error'](a54_0x13943d[_0xcfac80(0x2f5)](_0xcfac80(0x22c))),0x1;}let _0x928dec;_0x14d630?_0x928dec=await withSpinner(_0xcfac80(0x25b),()=>_0x306e7e[_0xcfac80(0x2f9)]['retrySession'](_0x30a302,{'fromTask':_0x5dfb3e,'retryParams':_0xf981ed}),{'verbose':_0x198308['verbose']}):_0x928dec=await withSpinner('Retrying\x20attempt...',()=>_0x306e7e[_0xcfac80(0x2f9)][_0xcfac80(0x281)](_0x30a302,{'resumeFrom':_0x4945d4,'retryParams':_0xf981ed,'force':_0x2c6504}),{'verbose':_0x198308[_0xcfac80(0x31f)]});const _0x597602=_0x928dec[_0xcfac80(0x2c0)];return console[_0xcfac80(0x2ae)](_0xcfac80(0x306)),console[_0xcfac80(0x2ae)](_0xcfac80(0x2d1)+_0x597602['attemptId']),console[_0xcfac80(0x2ae)]('\x20\x20Session\x20ID:\x20'+_0x597602[_0xcfac80(0x1fe)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x333);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2ad);async[a54_0x2a0943(0x295)](_0x4aee00){const _0x331a3b=a54_0x2a0943,{options:_0x28eac7,args:_0x2679aa,tdx:_0x2dad9a}=_0x4aee00;let _0x44c783=_0x2679aa[0x0];if(!_0x44c783){const _0x3361c1=this[_0x331a3b(0x1d4)]([],_0x28eac7),_0x9a86fb=await withSpinner(_0x331a3b(0x341),()=>_0x2dad9a[_0x331a3b(0x2f9)][_0x331a3b(0x1d5)](_0x3361c1,{'limit':_0x28eac7[_0x331a3b(0x34d)]}),{'verbose':_0x28eac7['verbose']}),_0x96bd32=_0x9a86fb[_0x331a3b(0x2c0)];if(_0x96bd32[_0x331a3b(0x2c2)]===0x0)return console[_0x331a3b(0x2ae)](_0x331a3b(0x293)),!_0x3361c1&&console['error'](a54_0x13943d[_0x331a3b(0x31c)](_0x331a3b(0x362))),0x1;const _0xa1f094=_0x96bd32[_0x331a3b(0x285)](_0x4a8968=>({'title':_0x4a8968['project']?.[_0x331a3b(0x1c3)]+'.'+_0x4a8968[_0x331a3b(0x1c3)],'value':_0x4a8968[_0x331a3b(0x330)]?.[_0x331a3b(0x1c3)]+'.'+_0x4a8968[_0x331a3b(0x1c3)],'description':_0x4a8968['revision']?_0x331a3b(0x26b)+_0x4a8968[_0x331a3b(0x271)]:undefined})),_0x51a273=await a54_0x1b2330({'type':_0x331a3b(0x336),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0xa1f094});if(!_0x51a273[_0x331a3b(0x2f9)])return 0x1;_0x44c783=_0x51a273[_0x331a3b(0x2f9)];}if(!_0x44c783[_0x331a3b(0x2c6)]('.')){const _0x58ea46=this[_0x331a3b(0x1d4)]([],_0x28eac7);if(_0x58ea46)_0x44c783=_0x58ea46+'.'+_0x44c783;else return console['error'](a54_0x13943d[_0x331a3b(0x1fc)](_0x331a3b(0x33f)),_0x331a3b(0x376)),console[_0x331a3b(0x2ae)](a54_0x13943d['dim'](_0x331a3b(0x362))),0x1;}const _0xfd6e51=_0x28eac7[_0x331a3b(0x21e)],_0x43ad2a=_0x28eac7[_0x331a3b(0x36a)],_0x401b11={};if(_0xfd6e51&&Array['isArray'](_0xfd6e51))for(const _0x2f60c7 of _0xfd6e51){const _0x2c4698=_0x2f60c7['indexOf']('=');if(_0x2c4698===-0x1)return console[_0x331a3b(0x2ae)](_0x331a3b(0x27f)+_0x2f60c7),console[_0x331a3b(0x2ae)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1b5193=_0x2f60c7[_0x331a3b(0x259)](0x0,_0x2c4698),_0x30b29f=_0x2f60c7[_0x331a3b(0x259)](_0x2c4698+0x1);try{_0x401b11[_0x1b5193]=JSON[_0x331a3b(0x1bd)](_0x30b29f);}catch{_0x401b11[_0x1b5193]=_0x30b29f;}}_0x28eac7[_0x331a3b(0x31f)]&&(console['error'](_0x331a3b(0x27a)+_0x44c783),Object[_0x331a3b(0x1c9)](_0x401b11)['length']>0x0&&console[_0x331a3b(0x2ae)]('Parameters:\x20'+JSON[_0x331a3b(0x327)](_0x401b11)),_0x43ad2a&&console['error'](_0x331a3b(0x20d)+_0x43ad2a));const _0x151614=await withSpinner(_0x331a3b(0x22b),()=>_0x2dad9a['workflow'][_0x331a3b(0x28b)](_0x44c783,_0x401b11,{'sessionTime':_0x43ad2a}),{'verbose':_0x28eac7[_0x331a3b(0x31f)]}),_0x41c3fa=_0x151614[_0x331a3b(0x2c0)];console['error'](_0x331a3b(0x29e)),console[_0x331a3b(0x2ae)](_0x331a3b(0x2b7)+_0x41c3fa['id']),console['error'](_0x331a3b(0x256)+_0x41c3fa[_0x331a3b(0x1fe)]),console[_0x331a3b(0x2ae)](_0x331a3b(0x33b)+_0x41c3fa['project']?.[_0x331a3b(0x1c3)]),console['error'](_0x331a3b(0x35e)+_0x41c3fa[_0x331a3b(0x2f9)]?.['name']);if(_0x41c3fa[_0x331a3b(0x330)]?.['id']&&_0x41c3fa[_0x331a3b(0x1fe)]&&_0x41c3fa['id']){const _0x5ca5ae=_0x28eac7[_0x331a3b(0x1e2)],_0x4fe8cd=getConsoleUrl(_0x5ca5ae,_0x331a3b(0x33a)+_0x41c3fa[_0x331a3b(0x330)]['id']+_0x331a3b(0x1cd)+_0x41c3fa[_0x331a3b(0x1fe)]+_0x331a3b(0x2d0)+_0x41c3fa['id']);console[_0x331a3b(0x2ae)](_0x331a3b(0x2fd)+a54_0x13943d['cyan'](_0x4fe8cd));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2be);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2df);async[a54_0x2a0943(0x295)](_0x248ed9){const _0x453fa1=a54_0x2a0943,{options:_0x4410bf,args:_0x28b482,tdx:_0xa9dc0e}=_0x248ed9,_0x59629d=_0x28b482[0x0],_0x5a42d8=_0x28b482[0x1]||'.';if(!_0x59629d)return console[_0x453fa1(0x2ae)](_0x453fa1(0x21c)),console['error'](_0x453fa1(0x24a)),0x1;const _0x54d193=_0x4410bf[_0x453fa1(0x271)];_0x4410bf['verbose']&&(console['error']('Project:\x20'+_0x59629d),console[_0x453fa1(0x2ae)](_0x453fa1(0x36e)+_0x5a42d8),_0x54d193&&console[_0x453fa1(0x2ae)](_0x453fa1(0x20c)+_0x54d193));const _0x3cd632=await withSpinner(_0x453fa1(0x1ce)+_0x59629d+_0x453fa1(0x320),()=>_0xa9dc0e[_0x453fa1(0x2f9)][_0x453fa1(0x224)](_0x59629d,_0x5a42d8,{'revision':_0x54d193}),{'verbose':_0x4410bf[_0x453fa1(0x31f)]}),_0x128565=_0x3cd632[_0x453fa1(0x2c0)];return console[_0x453fa1(0x2ae)](_0x453fa1(0x32a)+_0x128565[_0x453fa1(0x282)]),console[_0x453fa1(0x2ae)](_0x453fa1(0x1f0)+_0x128565['revision']),console[_0x453fa1(0x2ae)](_0x453fa1(0x250)+_0x128565[_0x453fa1(0x2d6)]),console[_0x453fa1(0x2ae)](_0x453fa1(0x21b)+_0x5a42d8+'/'+_0x128565[_0x453fa1(0x282)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x357);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x1da);async[a54_0x2a0943(0x295)](_0x321086){const _0x14f715=a54_0x2a0943,{options:_0x1813d6,args:_0x11cf39,tdx:_0x3a3753}=_0x321086;let _0x407471='.',_0x36373c=_0x1813d6[_0x14f715(0x1c3)];if(_0x11cf39[0x0]){const {promises:_0x1a246c}=await import('fs');try{const _0x58b509=await _0x1a246c['stat'](_0x11cf39[0x0]);if(_0x58b509[_0x14f715(0x2af)]())_0x407471=_0x11cf39[0x0];else return console[_0x14f715(0x2ae)](_0x14f715(0x2cb)+_0x11cf39[0x0]+_0x14f715(0x276)),0x1;}catch{_0x36373c=_0x11cf39[0x0],_0x407471='.';}}const _0x3b4970=_0x1813d6[_0x14f715(0x271)],_0x410452=_0x1813d6[_0x14f715(0x251)];_0x1813d6['verbose']&&(console[_0x14f715(0x2ae)](_0x14f715(0x28c)+_0x407471),_0x36373c&&console[_0x14f715(0x2ae)](_0x14f715(0x345)+_0x36373c),_0x3b4970&&console[_0x14f715(0x2ae)](_0x14f715(0x20c)+_0x3b4970),_0x410452&&console['error'](_0x14f715(0x2e8)));const _0x15f00b=await withSpinner(_0x14f715(0x1c7),()=>_0x3a3753[_0x14f715(0x2f9)]['push'](_0x407471,{'projectName':_0x36373c,'revision':_0x3b4970,'skipValidation':_0x410452}),{'verbose':_0x1813d6[_0x14f715(0x31f)]}),_0x8ba727=_0x15f00b['data'];return console['error'](_0x14f715(0x25a)+_0x8ba727[_0x14f715(0x282)]),console[_0x14f715(0x2ae)](_0x14f715(0x2db)+_0x8ba727[_0x14f715(0x360)]),console[_0x14f715(0x2ae)]('\x20\x20Revision:\x20'+_0x8ba727[_0x14f715(0x271)]),await this[_0x14f715(0x388)](_0x3a3753,_0x8ba727['projectName'],_0x1813d6[_0x14f715(0x1e2)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2c8);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2fe);async['execute'](_0x49d05f){const _0x31e613=a54_0x2a0943,{options:_0x4eeb45,args:_0xf0d337,tdx:_0x2c0d0a}=_0x49d05f,_0x2014f7=_0xf0d337[0x0],_0x395c51=_0xf0d337[0x1];if(!_0x2014f7)return console['error'](a54_0x13943d[_0x31e613(0x1fc)](_0x31e613(0x33f)),_0x31e613(0x24c)),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x207))),0x1;const _0x5c4ff3=_0x4eeb45[_0x31e613(0x271)];_0x4eeb45['verbose']&&(console[_0x31e613(0x2ae)]('Project:\x20'+_0x2014f7),_0x395c51&&console[_0x31e613(0x2ae)]('Target\x20directory:\x20'+_0x395c51),_0x5c4ff3&&console[_0x31e613(0x2ae)]('Revision:\x20'+_0x5c4ff3),_0x4eeb45[_0x31e613(0x21f)]&&console[_0x31e613(0x2ae)](_0x31e613(0x329)));const _0x15c4c7=await withSpinner(_0x31e613(0x272)+_0x2014f7+_0x31e613(0x320),()=>_0x2c0d0a[_0x31e613(0x2f9)][_0x31e613(0x1db)](_0x2014f7,{'targetDir':_0x395c51,'revision':_0x5c4ff3}),{'verbose':_0x4eeb45[_0x31e613(0x31f)]}),_0xa2dc45=_0x15c4c7['data'];_0xa2dc45['isNewProject']?console[_0x31e613(0x2ae)](_0x31e613(0x237)+_0xa2dc45[_0x31e613(0x282)]):console[_0x31e613(0x2ae)](_0x31e613(0x20f)+_0xa2dc45[_0x31e613(0x282)]);console['error'](_0x31e613(0x1f0)+_0xa2dc45[_0x31e613(0x271)]),console[_0x31e613(0x2ae)](_0x31e613(0x2cc)+(a54_0x4c5432[_0x31e613(0x1fa)](process['cwd'](),_0xa2dc45[_0x31e613(0x1c8)])||'.')),console[_0x31e613(0x2ae)](_0x31e613(0x2e3)+a54_0x13943d[_0x31e613(0x211)]('+'+_0xa2dc45['summary'][_0x31e613(0x384)]+_0x31e613(0x30a))+',\x20'+(a54_0x13943d[_0x31e613(0x2f5)]('~'+_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1cb)]+_0x31e613(0x378))+',\x20')+(a54_0x13943d[_0x31e613(0x1fc)]('-'+_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1e1)]+_0x31e613(0x29a))+',\x20')+(''+a54_0x13943d[_0x31e613(0x31c)](_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1dc)]+_0x31e613(0x1d0))));for(const _0x1c826d of _0xa2dc45[_0x31e613(0x2e1)]){_0x1c826d[_0x31e613(0x275)]===_0x31e613(0x1cb)&&_0x1c826d[_0x31e613(0x27b)]&&(console[_0x31e613(0x2ae)]('\x0a'+a54_0x13943d[_0x31e613(0x38a)](_0x31e613(0x2d7)+_0x1c826d[_0x31e613(0x26e)])),console['error'](_0x1c826d['diff']));}if(!_0xa2dc45['hasChanges'])return saveSessionContext({'workflow_project':_0xa2dc45[_0x31e613(0x282)]},_0x4eeb45[_0x31e613(0x229)]),console[_0x31e613(0x2ae)](a54_0x13943d['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x31e613(0x2ae)](a54_0x13943d['dim'](_0x31e613(0x380)+_0xa2dc45['projectName'])),0x0;if(_0x4eeb45['dryRun'])return console[_0x31e613(0x2ae)](a54_0x13943d['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x4eeb45['yes']){if(!isInteractive())return console['error'](a54_0x13943d[_0x31e613(0x1fc)](_0x31e613(0x252)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x25d))),0x1;const _0x303dc1=await confirmKey(_0x31e613(0x206));if(!_0x303dc1)return console['error'](a54_0x13943d[_0x31e613(0x2f5)](_0x31e613(0x22c)),_0x31e613(0x2eb)),0x1;}await withSpinner('Writing\x20files...',()=>_0x2c0d0a['workflow'][_0x31e613(0x1b9)](_0xa2dc45,{'revision':_0x5c4ff3}),{'verbose':_0x4eeb45['verbose']}),saveSessionContext({'workflow_project':_0xa2dc45[_0x31e613(0x282)]},_0x4eeb45[_0x31e613(0x229)]),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x211)](_0x31e613(0x353)));const _0x3562af=a54_0x4c5432[_0x31e613(0x1fa)](process[_0x31e613(0x239)](),_0xa2dc45['targetDir'])||'.';return console['error'](a54_0x13943d[_0x31e613(0x31c)]('\x20\x20Location:\x20'+_0x3562af)),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x380)+_0xa2dc45[_0x31e613(0x282)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2f8);['description']=a54_0x2a0943(0x2ef);async['execute'](_0x33e279){const _0x417029=a54_0x2a0943,{options:_0x538de4,args:_0x8a2a78,tdx:_0x307cc4}=_0x33e279,_0x4f7bfd=this['resolveProjectDir'](_0x8a2a78,_0x538de4),_0x2467a0=_0x538de4[_0x417029(0x271)],_0x4af9d7=_0x538de4[_0x417029(0x251)];_0x538de4['verbose']&&(_0x4f7bfd&&console[_0x417029(0x2ae)](_0x417029(0x2a5)+_0x4f7bfd),_0x2467a0&&console[_0x417029(0x2ae)](_0x417029(0x20c)+_0x2467a0),_0x538de4[_0x417029(0x21f)]&&console['error'](_0x417029(0x329)),_0x4af9d7&&console[_0x417029(0x2ae)](_0x417029(0x2e8)));let _0xbb5d5c;try{_0xbb5d5c=await withSpinner(_0x417029(0x37c),()=>_0x307cc4['workflow']['preparePushProject']({'sourceDir':_0x4f7bfd,'revision':_0x2467a0,'skipValidation':_0x4af9d7}),{'verbose':_0x538de4[_0x417029(0x31f)]});}catch(_0x24f935){if(_0x24f935 instanceof Error&&_0x24f935[_0x417029(0x266)][_0x417029(0x2c6)](_0x417029(0x208)))return console['error'](a54_0x13943d[_0x417029(0x1fc)](_0x417029(0x33f)),_0x417029(0x278)),_0x538de4[_0x417029(0x2fb)]?console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x31c)](_0x417029(0x2a4)+_0x538de4[_0x417029(0x2fb)]+_0x417029(0x247)+_0x538de4[_0x417029(0x2fb)]+'\x27')):console[_0x417029(0x2ae)](a54_0x13943d['dim'](_0x417029(0x210))),0x1;throw _0x24f935;}const _0x26df14=_0xbb5d5c[_0x417029(0x2c0)];console[_0x417029(0x2ae)](_0x417029(0x35a)+_0x26df14['projectName']),console[_0x417029(0x2ae)]('\x20\x20Source:\x20'+_0x26df14[_0x417029(0x1f2)]),console[_0x417029(0x2ae)]('\x20\x20Revision:\x20'+_0x26df14[_0x417029(0x271)]),console['error'](_0x417029(0x2e3)+a54_0x13943d['green']('+'+_0x26df14[_0x417029(0x301)]['new']+'\x20new')+',\x20'+(a54_0x13943d[_0x417029(0x2f5)]('~'+_0x26df14[_0x417029(0x301)][_0x417029(0x1cb)]+_0x417029(0x378))+',\x20')+(a54_0x13943d[_0x417029(0x1fc)]('-'+_0x26df14[_0x417029(0x301)][_0x417029(0x1e1)]+_0x417029(0x29a))+',\x20')+(''+a54_0x13943d[_0x417029(0x31c)](_0x26df14[_0x417029(0x301)]['unchanged']+_0x417029(0x1d0))));for(const _0x26c166 of _0x26df14['changes']){_0x26c166[_0x417029(0x275)]==='modified'&&_0x26c166[_0x417029(0x27b)]&&(console[_0x417029(0x2ae)]('\x0a'+a54_0x13943d['cyan'](_0x417029(0x2d7)+_0x26c166[_0x417029(0x26e)])),console[_0x417029(0x2ae)](_0x26c166['diff']));}if(!_0x26df14[_0x417029(0x25c)])return console['error'](a54_0x13943d[_0x417029(0x211)](_0x417029(0x249))),await this[_0x417029(0x388)](_0x307cc4,_0x26df14[_0x417029(0x282)],_0x538de4[_0x417029(0x1e2)]),0x0;if(_0x538de4[_0x417029(0x21f)])return console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x2f5)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x538de4[_0x417029(0x340)]){if(!isInteractive())return console['error'](a54_0x13943d[_0x417029(0x1fc)]('\x0aError:'),_0x417029(0x2e4)),console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x31c)](_0x417029(0x25d))),0x1;const _0x5a9b28=await confirmKey(_0x417029(0x21d));if(!_0x5a9b28)return console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x2f5)](_0x417029(0x22c)),_0x417029(0x36d)),0x1;}const _0x36fbb6=await withSpinner(_0x417029(0x262),()=>_0x307cc4['workflow'][_0x417029(0x2b0)](_0x26df14),{'verbose':_0x538de4[_0x417029(0x31f)]}),_0x1e7828=_0x36fbb6[_0x417029(0x2c0)];return console['error'](a54_0x13943d[_0x417029(0x211)](_0x417029(0x292))),console['error'](_0x417029(0x2db)+_0x1e7828[_0x417029(0x360)]),console[_0x417029(0x2ae)](_0x417029(0x1f0)+_0x1e7828[_0x417029(0x271)]),await this[_0x417029(0x388)](_0x307cc4,_0x1e7828[_0x417029(0x282)],_0x538de4[_0x417029(0x1e2)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x2f6);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x323);async[a54_0x2a0943(0x295)](_0x361acd){const _0x1cd8de=a54_0x2a0943,{options:_0x5ed3e8,args:_0x3df2d8,tdx:_0x31c5e5}=_0x361acd,_0x50dccf=this['resolveProjectDir'](_0x3df2d8,_0x5ed3e8),_0x29dafb=_0x5ed3e8[_0x1cd8de(0x1c3)],_0xab1196=_0x5ed3e8[_0x1cd8de(0x271)],_0x5509ac=_0x5ed3e8[_0x1cd8de(0x251)];if(!_0x50dccf)return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x1fc)]('Error:'),_0x1cd8de(0x385)),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim'](_0x1cd8de(0x280))),0x1;if(!_0x29dafb)return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x1fc)](_0x1cd8de(0x33f)),_0x1cd8de(0x290)),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5ed3e8['verbose']&&(console['error'](_0x1cd8de(0x2a5)+_0x50dccf),console[_0x1cd8de(0x2ae)]('New\x20project\x20name:\x20'+_0x29dafb),_0xab1196&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x20c)+_0xab1196),_0x5ed3e8['dryRun']&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x329)),_0x5509ac&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x2e8)));const _0x3cffbf=await withSpinner(_0x1cd8de(0x2b3),()=>_0x31c5e5[_0x1cd8de(0x2f9)][_0x1cd8de(0x319)](_0x50dccf,_0x29dafb,{'revision':_0xab1196,'skipValidation':_0x5509ac}),{'verbose':_0x5ed3e8['verbose']}),_0x79d7cc=_0x3cffbf[_0x1cd8de(0x2c0)];console[_0x1cd8de(0x2ae)](_0x1cd8de(0x335)+_0x79d7cc['sourceDir']);_0x79d7cc[_0x1cd8de(0x2c7)]&&console[_0x1cd8de(0x2ae)]('Source\x20project:\x20'+_0x79d7cc[_0x1cd8de(0x2c7)]);console[_0x1cd8de(0x2ae)](_0x1cd8de(0x307)+_0x79d7cc[_0x1cd8de(0x1e7)]),console['error'](_0x1cd8de(0x20c)+_0x79d7cc[_0x1cd8de(0x271)]),console[_0x1cd8de(0x2ae)](_0x1cd8de(0x1e8)+_0x79d7cc[_0x1cd8de(0x24e)]);_0x79d7cc[_0x1cd8de(0x34b)]&&(console['error'](a54_0x13943d[_0x1cd8de(0x2f5)](_0x1cd8de(0x2a2)+_0x79d7cc[_0x1cd8de(0x1e7)]+_0x1cd8de(0x317)+_0x79d7cc[_0x1cd8de(0x202)]+')')),console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x2f5)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5ed3e8[_0x1cd8de(0x21f)])return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x2f5)](_0x1cd8de(0x1bc))),0x0;if(!_0x5ed3e8[_0x1cd8de(0x340)]){if(!isInteractive())return console['error'](a54_0x13943d['red'](_0x1cd8de(0x252)),_0x1cd8de(0x2e4)),console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x31c)](_0x1cd8de(0x25d))),0x1;const _0x417e40=_0x79d7cc[_0x1cd8de(0x2c7)]||a54_0x4c5432[_0x1cd8de(0x32d)](_0x50dccf),_0x26769f=_0x79d7cc[_0x1cd8de(0x34b)]?_0x1cd8de(0x35f)+_0x29dafb+_0x1cd8de(0x2fa):_0x1cd8de(0x289)+_0x417e40+_0x1cd8de(0x2f2)+_0x29dafb+'\x22?',_0x527df8=await confirmKey(_0x26769f);if(!_0x527df8)return console[_0x1cd8de(0x2ae)](a54_0x13943d['yellow'](_0x1cd8de(0x22c))),0x1;}const _0x48cfe9=await withSpinner(_0x79d7cc['targetExists']?_0x1cd8de(0x205)+_0x29dafb+_0x1cd8de(0x320):_0x1cd8de(0x23e)+_0x29dafb+_0x1cd8de(0x320),()=>_0x31c5e5[_0x1cd8de(0x2f9)]['executeCloneProject'](_0x79d7cc),{'verbose':_0x5ed3e8[_0x1cd8de(0x31f)]}),_0x34b1f6=_0x48cfe9['data'];return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x211)](_0x79d7cc['targetExists']?_0x1cd8de(0x35d):'✔\x20Clone\x20complete')),console['error'](_0x1cd8de(0x33b)+_0x34b1f6['newProjectName']),console[_0x1cd8de(0x2ae)](_0x1cd8de(0x2db)+_0x34b1f6[_0x1cd8de(0x37f)]),console['error'](_0x1cd8de(0x1f0)+_0x34b1f6['revision']),await this['showWorkflowConsoleUrl'](_0x31c5e5,_0x34b1f6['newProjectName'],_0x5ed3e8['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x267);['description']=a54_0x2a0943(0x201);async['execute'](_0x87e2e6){const _0x2c4b1b=a54_0x2a0943,{options:_0x4aad55,args:_0x392a2d,tdx:_0x5b2b5a}=_0x87e2e6,_0x263a8d=_0x392a2d[0x0];if(!_0x263a8d)return console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x26d)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x4aad55[_0x2c4b1b(0x31f)]&&console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x30e)+_0x263a8d);if(!_0x4aad55['yes']){if(!isInteractive())return console['error'](a54_0x13943d[_0x2c4b1b(0x1fc)](_0x2c4b1b(0x252)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2c4b1b(0x2ae)](a54_0x13943d[_0x2c4b1b(0x31c)](_0x2c4b1b(0x25d))),0x1;const _0x52dbc4=await confirmKey(_0x2c4b1b(0x25e)+_0x263a8d+_0x2c4b1b(0x2a3));if(!_0x52dbc4)return console[_0x2c4b1b(0x2ae)](a54_0x13943d[_0x2c4b1b(0x2f5)](_0x2c4b1b(0x22c))),0x1;}const _0x486ead=await withSpinner(_0x2c4b1b(0x1df)+_0x263a8d+_0x2c4b1b(0x320),()=>_0x5b2b5a[_0x2c4b1b(0x2f9)]['delete'](_0x263a8d),{'verbose':_0x4aad55[_0x2c4b1b(0x31f)]}),_0x5ec44c=_0x486ead[_0x2c4b1b(0x2c0)];return console['error'](_0x2c4b1b(0x30b)+_0x5ec44c[_0x2c4b1b(0x282)]),console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x2db)+_0x5ec44c[_0x2c4b1b(0x360)]),0x0;}}export function parseKeyValue(_0x188d85){const _0x53e662=a54_0x2a0943,_0x3f29c3=_0x188d85[_0x53e662(0x2dc)]('=');if(_0x3f29c3===-0x1)throw new Error(_0x53e662(0x309)+_0x188d85+_0x53e662(0x36f));const _0x1eff98=_0x188d85[_0x53e662(0x259)](0x0,_0x3f29c3),_0x25fd0f=_0x188d85[_0x53e662(0x259)](_0x3f29c3+0x1);if(!_0x1eff98)throw new Error(_0x53e662(0x2ff));return{'key':_0x1eff98,'value':_0x25fd0f};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x373);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x287);async[a54_0x2a0943(0x295)](_0x4bd9ca){const _0x8379d4=a54_0x2a0943,{options:_0xd55625,args:_0x2a5171,tdx:_0x1f91d4}=_0x4bd9ca,_0x159300=this[_0x8379d4(0x240)](_0x2a5171,_0xd55625);if(!_0x159300)return 0x1;_0xd55625[_0x8379d4(0x31f)]&&console['error']('Project:\x20'+_0x159300);const _0x45a4ce=await withSpinner(_0x8379d4(0x1cf),()=>_0x1f91d4[_0x8379d4(0x2f9)]['listSecrets'](_0x159300),{'verbose':_0xd55625['verbose']}),{secrets:_0x35c5ba}=_0x45a4ce[_0x8379d4(0x2c0)];return console[_0x8379d4(0x2ae)](_0x8379d4(0x37e)+_0x35c5ba[_0x8379d4(0x2c2)]+'\x20secret'+(_0x35c5ba[_0x8379d4(0x2c2)]!==0x1?'s':'')),await handleSDKOutput(_0x35c5ba,_0xd55625),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x31a);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2ee);async[a54_0x2a0943(0x295)](_0x43399f){const _0x4aadcd=a54_0x2a0943,{options:_0x26314b,args:_0x3f9b52,tdx:_0x3e777d}=_0x43399f;let _0x4723ef,_0x44cac3;if(_0x3f9b52[_0x4aadcd(0x2c2)]>=0x1&&!_0x3f9b52[0x0][_0x4aadcd(0x2c6)]('='))_0x4723ef=_0x3f9b52[0x0],_0x44cac3=_0x3f9b52['slice'](0x1);else{if(_0x3f9b52['length']>=0x1&&_0x26314b['workflowProject'])_0x4723ef=_0x26314b[_0x4aadcd(0x2fb)],_0x44cac3=_0x3f9b52;else return _0x3f9b52[_0x4aadcd(0x2c2)]>=0x1?(console[_0x4aadcd(0x2ae)](_0x4aadcd(0x21c)),console[_0x4aadcd(0x2ae)](_0x4aadcd(0x362)),0x1):(console['error'](_0x4aadcd(0x32b)),console[_0x4aadcd(0x2ae)](_0x4aadcd(0x32c)),0x1);}if(_0x44cac3['length']===0x0)return console[_0x4aadcd(0x2ae)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x4aadcd(0x2ae)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x5e803e={};try{for(const _0x3a6cc7 of _0x44cac3){const {key:_0x2968c8,value:_0x34e61d}=parseKeyValue(_0x3a6cc7);_0x5e803e[_0x2968c8]=_0x34e61d;}}catch(_0x20cecc){return _0x20cecc instanceof Error&&console['error'](a54_0x13943d[_0x4aadcd(0x1fc)](_0x4aadcd(0x33f)),_0x20cecc[_0x4aadcd(0x266)]),0x1;}const _0x4d851e=Object[_0x4aadcd(0x1c9)](_0x5e803e);_0x26314b[_0x4aadcd(0x31f)]&&(console[_0x4aadcd(0x2ae)]('Project:\x20'+_0x4723ef),console[_0x4aadcd(0x2ae)]('Secrets\x20to\x20set:\x20'+_0x4d851e[_0x4aadcd(0x219)](',\x20')));const _0x33845e=await withSpinner(_0x4d851e[_0x4aadcd(0x2c2)]===0x1?_0x4aadcd(0x28e):_0x4aadcd(0x1e6)+_0x4d851e[_0x4aadcd(0x2c2)]+_0x4aadcd(0x332),()=>_0x3e777d['workflow'][_0x4aadcd(0x242)](_0x4723ef,_0x5e803e),{'verbose':_0x26314b[_0x4aadcd(0x31f)]}),_0x282326=_0x33845e[_0x4aadcd(0x2c0)];return console[_0x4aadcd(0x2ae)](_0x4d851e['length']===0x1?'✔\x20Secret\x20\x27'+_0x282326[_0x4aadcd(0x1c9)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x282326[_0x4aadcd(0x282)]+'\x27':'✔\x20'+_0x282326[_0x4aadcd(0x1c9)][_0x4aadcd(0x2c2)]+_0x4aadcd(0x1eb)+_0x282326[_0x4aadcd(0x282)]+'\x27'),(_0x26314b['json']||_0x26314b[_0x4aadcd(0x291)])&&await handleSingleObjectOutput(_0x282326,_0x26314b),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x274);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x33c);async[a54_0x2a0943(0x295)](_0x4f1eaf){const _0x45b39b=a54_0x2a0943,{options:_0xb4501,args:_0x593655,tdx:_0x31cce8}=_0x4f1eaf;let _0xdfc62b,_0x1f550f;if(_0x593655[_0x45b39b(0x2c2)]>=0x2)_0xdfc62b=_0x593655[0x0],_0x1f550f=_0x593655[0x1];else{if(_0x593655[_0x45b39b(0x2c2)]===0x1&&_0xb4501[_0x45b39b(0x2fb)])_0xdfc62b=_0xb4501['workflowProject'],_0x1f550f=_0x593655[0x0];else return _0x593655['length']===0x1?(console[_0x45b39b(0x2ae)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x45b39b(0x2ae)](_0x45b39b(0x362)),0x1):(console[_0x45b39b(0x2ae)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x45b39b(0x2ae)](_0x45b39b(0x288)),0x1);}_0xb4501['verbose']&&(console['error'](_0x45b39b(0x30e)+_0xdfc62b),console['error']('Key:\x20'+_0x1f550f));if(!_0xb4501[_0x45b39b(0x340)]){if(!isInteractive())return console[_0x45b39b(0x2ae)](a54_0x13943d[_0x45b39b(0x1fc)](_0x45b39b(0x252)),_0x45b39b(0x2e4)),console['error'](a54_0x13943d[_0x45b39b(0x31c)](_0x45b39b(0x25d))),0x1;const _0xe74587=await confirmKey(_0x45b39b(0x2d9)+_0x1f550f+_0x45b39b(0x32f)+_0xdfc62b+'\x27?');if(!_0xe74587)return console[_0x45b39b(0x2ae)](a54_0x13943d[_0x45b39b(0x2f5)](_0x45b39b(0x22c))),0x1;}const _0x50f93c=await withSpinner('Deleting\x20secret...',()=>_0x31cce8[_0x45b39b(0x2f9)][_0x45b39b(0x33e)](_0xdfc62b,_0x1f550f),{'verbose':_0xb4501[_0x45b39b(0x31f)]}),_0x2a4d09=_0x50f93c[_0x45b39b(0x2c0)];return console[_0x45b39b(0x2ae)](_0x45b39b(0x304)+_0x2a4d09[_0x45b39b(0x1d2)]+_0x45b39b(0x20e)+_0x2a4d09[_0x45b39b(0x282)]+'\x27'),(_0xb4501[_0x45b39b(0x200)]||_0xb4501['jsonl'])&&await handleSingleObjectOutput(_0x2a4d09,_0xb4501),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(_0xd7b3a){const _0x1e4820=a54_0x2a0943,_0x1e1ba5=Math[_0x1e4820(0x2bc)](_0xd7b3a/0x3e8),_0x32b4a3=Math[_0x1e4820(0x2bc)](_0x1e1ba5/0x3c),_0xf07283=Math[_0x1e4820(0x2bc)](_0x32b4a3/0x3c),_0x197587=Math[_0x1e4820(0x2bc)](_0xf07283/0x18);if(_0x197587>0x0){const _0xbf2b49=_0xf07283%0x18;return _0xbf2b49>0x0?_0x197587+'d\x20'+_0xbf2b49+'h':_0x197587+'d';}else{if(_0xf07283>0x0){const _0x4d84ac=_0x32b4a3%0x3c;return _0x4d84ac>0x0?_0xf07283+'h\x20'+_0x4d84ac+'m':_0xf07283+'h';}else{if(_0x32b4a3>0x0){const _0x493e57=_0x1e1ba5%0x3c;return _0x493e57>0x0?_0x32b4a3+'m\x20'+_0x493e57+'s':_0x32b4a3+'m';}else return _0x1e1ba5+'s';}}}function formatTimestamp(_0x2e32f4,_0x4a3a2f){const _0x37b67e=a54_0x2a0943,_0x23dc13=new Date(_0x2e32f4),_0x522812=String(_0x23dc13[_0x37b67e(0x37a)]())[_0x37b67e(0x299)](0x2,'0'),_0x3943ec=String(_0x23dc13[_0x37b67e(0x27d)]())[_0x37b67e(0x299)](0x2,'0'),_0x5b244f=_0x522812+':'+_0x3943ec,_0x56344e=_0x23dc13['getFullYear']()===_0x4a3a2f['getFullYear']()&&_0x23dc13[_0x37b67e(0x30f)]()===_0x4a3a2f[_0x37b67e(0x30f)]()&&_0x23dc13[_0x37b67e(0x30d)]()===_0x4a3a2f['getDate']();if(_0x56344e)return _0x5b244f;else{const _0x8321e4=String(_0x23dc13[_0x37b67e(0x30f)]()+0x1)[_0x37b67e(0x299)](0x2,'0'),_0x35cbd2=String(_0x23dc13[_0x37b67e(0x30d)]())[_0x37b67e(0x299)](0x2,'0');return _0x8321e4+'-'+_0x35cbd2+'\x20'+_0x5b244f;}}function formatDate(_0x3b1e30){const _0x3b9c46=a54_0x2a0943,_0x33d973=_0x3b1e30[_0x3b9c46(0x1f4)](),_0x40c1de=String(_0x3b1e30[_0x3b9c46(0x30f)]()+0x1)[_0x3b9c46(0x299)](0x2,'0'),_0x29490f=String(_0x3b1e30[_0x3b9c46(0x30d)]())[_0x3b9c46(0x299)](0x2,'0');return _0x33d973+'-'+_0x40c1de+'-'+_0x29490f;}function a54_0x5ebb(_0x5da824,_0x212514){_0x5da824=_0x5da824-0x1b9;const _0x2768a6=a54_0x2768();let _0x5ebbc7=_0x2768a6[_0x5da824];return _0x5ebbc7;}function getTaskStateIcon(_0x15811b){const _0x7c925={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x7c925[_0x15811b]||'⚪';}function getBarChar(_0x386d2c){const _0xc9f643=a54_0x2a0943;return _0x386d2c===_0xc9f643(0x2ae)||_0x386d2c===_0xc9f643(0x1f9)?'×':'─';}function getBarColor(_0xf491c4){const _0x3f58a7=a54_0x2a0943,_0x47cc1a={'success':a54_0x13943d[_0x3f58a7(0x211)],'error':a54_0x13943d[_0x3f58a7(0x1fc)],'group_error':a54_0x13943d[_0x3f58a7(0x1fc)],'running':a54_0x13943d[_0x3f58a7(0x258)],'blocked':a54_0x13943d[_0x3f58a7(0x2f5)],'planned':a54_0x13943d['dim'],'canceling':a54_0x13943d[_0x3f58a7(0x2f5)]};return _0x47cc1a[_0xf491c4]||a54_0x13943d[_0x3f58a7(0x305)];}function parseTaskName(_0x3a2452){const _0x3b3eeb=a54_0x2a0943;let _0x5e057e=_0x3a2452[_0x3b3eeb(0x23f)](/^\++/,'');const _0x374383=_0x5e057e[_0x3b3eeb(0x2ca)]('+'),_0x10bbd3=_0x374383[_0x3b3eeb(0x2c2)]>0x1?_0x374383[_0x3b3eeb(0x2c2)]-0x2:0x0,_0x3bbf89=_0x374383[_0x374383[_0x3b3eeb(0x2c2)]-0x1]||_0x5e057e;return{'level':_0x10bbd3,'name':'+'+_0x3bbf89};}function truncateTaskName(_0x2f410c,_0x2c9748){const _0x342749=a54_0x2a0943,_0x3c2e41=stringWidth(_0x2f410c);if(_0x3c2e41<=_0x2c9748)return _0x2f410c;let _0x5e21f7=_0x2f410c;while(stringWidth(_0x5e21f7+'…')>_0x2c9748&&_0x5e21f7[_0x342749(0x2c2)]>0x0){_0x5e21f7=_0x5e21f7['slice'](0x0,-0x1);}return _0x5e21f7+'…';}function calculateTimeScale(_0x244b8c,_0x4e62d6){const _0x5a895b=a54_0x2a0943;return{'startTime':_0x244b8c['start'],'endTime':_0x244b8c[_0x5a895b(0x313)],'durationMs':_0x244b8c[_0x5a895b(0x298)],'msPerChar':_0x244b8c['duration']/_0x4e62d6};}function timeToPosition(_0x40bc4e,_0x3006fb,_0x5c9ab2){const _0x15e3f8=a54_0x2a0943,_0x4de0bc=_0x40bc4e-_0x3006fb[_0x15e3f8(0x2c3)],_0x37cd8c=Math[_0x15e3f8(0x2bc)](_0x4de0bc/_0x3006fb[_0x15e3f8(0x33d)]);return Math[_0x15e3f8(0x26c)](0x0,Math[_0x15e3f8(0x294)](_0x37cd8c,_0x5c9ab2));}function renderTimeAxis(_0x3c9608,_0x2d4ea2){const _0x435f96=a54_0x2a0943,_0x39bede=Math[_0x435f96(0x294)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x435f96(0x26c)](TIMELINE_CONFIG[_0x435f96(0x355)],Math[_0x435f96(0x2bc)](_0x2d4ea2/TIMELINE_CONFIG[_0x435f96(0x374)]))),_0x1932a6=_0x3c9608['durationMs']/(_0x39bede-0x1),_0x1bd023=new Date(_0x3c9608[_0x435f96(0x2c3)]),_0x56380f=[];for(let _0x4bd5c5=0x0;_0x4bd5c5<_0x39bede;_0x4bd5c5++){const _0x5b0289=_0x3c9608[_0x435f96(0x2c3)]+_0x4bd5c5*_0x1932a6,_0x35c2d2=timeToPosition(_0x5b0289,_0x3c9608,_0x2d4ea2),_0x458279=formatTimestamp(_0x5b0289,_0x1bd023);_0x56380f[_0x435f96(0x377)]({'pos':_0x35c2d2,'text':_0x458279});}const _0x14d98f=new Array(_0x2d4ea2)['fill']('\x20');let _0x56a80a=-0x1;for(const {pos:_0x211e87,text:_0x2e07ee}of _0x56380f){let _0x635068=Math['max'](0x0,_0x211e87-Math[_0x435f96(0x2bc)](_0x2e07ee[_0x435f96(0x2c2)]/0x2));_0x635068<=_0x56a80a+TIMELINE_CONFIG[_0x435f96(0x2c4)]&&(_0x635068=_0x56a80a+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x635068+_0x2e07ee[_0x435f96(0x2c2)]>_0x2d4ea2&&(_0x635068=_0x2d4ea2-_0x2e07ee[_0x435f96(0x2c2)]);if(_0x635068>=0x0&&_0x635068+_0x2e07ee[_0x435f96(0x2c2)]<=_0x2d4ea2&&_0x635068>_0x56a80a){for(let _0x21aba5=0x0;_0x21aba5<_0x2e07ee[_0x435f96(0x2c2)];_0x21aba5++){_0x14d98f[_0x635068+_0x21aba5]=_0x2e07ee[_0x21aba5];}_0x56a80a=_0x635068+_0x2e07ee[_0x435f96(0x2c2)]-0x1;}}return _0x14d98f[_0x435f96(0x219)]('');}function renderTaskRow(_0x5b9ae4,_0x95d3ac,_0x42bbd7,_0x569f94){const _0x2c46e2=a54_0x2a0943,{level:_0x2f8397,name:_0x28386b}=parseTaskName(_0x5b9ae4[_0x2c46e2(0x1c3)]),_0x5db911='\x20'[_0x2c46e2(0x297)](_0x2f8397),_0x750038=_0x5b9ae4['window']?'('+formatElapsed(_0x5b9ae4[_0x2c46e2(0x261)][_0x2c46e2(0x298)])+')':'',_0x40a193=stringWidth(_0x750038),_0x2c7b21=_0x2f8397*0x1,_0xd7906e=_0x569f94-_0x2c7b21-_0x40a193-0x1,_0x555026=truncateTaskName(_0x28386b,_0xd7906e),_0x3bbc29=_0x5db911+_0x555026,_0x443199=stringWidth(_0x3bbc29),_0x221de1=_0x569f94-_0x443199-_0x40a193,_0x535caa=_0x3bbc29+'\x20'[_0x2c46e2(0x297)](Math[_0x2c46e2(0x26c)](0x1,_0x221de1))+a54_0x13943d[_0x2c46e2(0x31c)](_0x750038),_0x4a7545=getTaskStateIcon(_0x5b9ae4['state']),_0x4982c5=new Array(_0x42bbd7)[_0x2c46e2(0x26a)]('\x20');if(_0x5b9ae4[_0x2c46e2(0x261)]){const _0x1b3d2d=timeToPosition(_0x5b9ae4[_0x2c46e2(0x261)][_0x2c46e2(0x273)],_0x95d3ac,_0x42bbd7),_0x51d019=timeToPosition(_0x5b9ae4[_0x2c46e2(0x261)]['end'],_0x95d3ac,_0x42bbd7),_0x3de04f=getBarChar(_0x5b9ae4['state']),_0x5a964b=Math[_0x2c46e2(0x26c)](_0x1b3d2d+0x1,_0x51d019);for(let _0x1bcdc8=_0x1b3d2d;_0x1bcdc8<Math['min'](_0x5a964b,_0x42bbd7);_0x1bcdc8++){_0x4982c5[_0x1bcdc8]=_0x3de04f;}}const _0x853598=getBarColor(_0x5b9ae4[_0x2c46e2(0x233)]),_0x6c7287=_0x4982c5['map'](_0x2e684e=>_0x2e684e==='\x20'?'\x20':_0x853598(_0x2e684e))['join']('');return _0x4a7545+'\x20'+_0x535caa+'│'+_0x6c7287+'│';}function a54_0x2768(){const _0x1524af=['getFullYear','kill','1248TaKfvg','MAX_TIMELINE_WIDTH','session_id','group_error','relative','value','red','rows','sessionId','attempt','json','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','existingProjectId','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','success','Updating\x20','\x0aApply\x20these\x20changes?','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','No\x20workflow\x20tdx.json\x20found','includeSubtasks','done','attemptId','Revision:\x20','Session\x20time:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','→\x20Project:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','green','\x20attempt','clear','autocomplete','renderTimeline','📅\x20#','all','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','join','context','\x20\x20Location:\x20','Error:\x20Project\x20name\x20is\x20required','\x0aPush\x20these\x20changes?','param','dryRun','resumeFrom','pending','Disable\x20a\x20workflow\x20schedule','resolve','download','updatedAt','listSchedules','renderSessionsTimeline','parseProjectWorkflowPattern','session',',\x20Workflow:\x20','Starting\x20workflow\x20run...','Cancelled','ICON_SPACING','now','session:','\x20to\x20see\x20detailed\x20logs','Error:\x20Attempt\x20ID\x20is\x20required','No\x20workflows\x20found\x20in\x20project:\x20','state','No\x20sessions\x20found\x20for:\x20','ICON_WIDTH','Select\x20a\x20task\x20to\x20view\x20logs:','→\x20New\x20project:\x20','\x20(disabled)','cwd','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Project\x20filter:\x20','\x20\x20Next\x20run:\x20','workflow:tasks','Cloning\x20to\x20','replace','requireProject','attempt:','setSecrets','No\x20workflow\x20projects\x20found','sys','renderSingleTimeline','\x20disabled\x20(','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Session\x20not\x20found:\x20','\x0a✔\x20No\x20changes\x20to\x20push','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Error:\x20Invalid\x20JSON\x20in\x20--params','Project\x20name\x20is\x20required','Kill\x20a\x20running\x20attempt','fileCount','Filter:\x20','\x20\x20Files\x20extracted:\x20','skipValidation','\x0aError:','params','reason','Retry\x20a\x20session\x20or\x20attempt','\x20\x20Session\x20ID:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','blue','substring','✔\x20Pushed\x20','Retrying\x20session...','hasChanges','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','3657380tVpBQz','resolveProjectId','window','Pushing\x20project...','unknown','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20projects\x20match\x20pattern:\x20','message','workflow:delete','Select\x20a\x20session\x20to\x20view\x20timeline:','\x20enabled\x20(','fill','revision:\x20','max','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','path','Schedule\x20ID\x20is\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','revision','Pulling\x20project\x20','start','workflow:secrets:delete','type','\x20is\x20not\x20a\x20directory','round','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Workflow:\x20','diff','canceling','getMinutes','task','Error:\x20Invalid\x20parameter\x20format:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','retryAttempt','projectName','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20session','map','logFiles','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aClone\x20\x22','No\x20attempts\x20found\x20for:\x20','run','Project\x20directory:\x20','979866RJuRzs','Setting\x20secret...','⚠\x20Showing\x20first\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','jsonl','✔\x20Push\x20complete','No\x20workflows\x20found','min','execute','sessions','repeat','duration','padStart','\x20deleted','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','getTime','\x20sessions\x20','✔\x20Workflow\x20run\x20started','disabledAt','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Failed\x20to\x20fetch\x20attempt\x20data','\x0a⚠\x20Project\x20\x22','\x22?\x20This\x20cannot\x20be\x20undone.','Tip:\x20cd\x20to\x20workflows/','Source\x20directory:\x20','Listing\x20schedules...','set','workflow:sessions','cancelRequested','isTTY','enableSchedule','Resolving\x20project\x20\x27','Start\x20a\x20workflow\x20run','error','isDirectory','executePushProject','🔄\x20','\x1b[1A\x1b[2K','Analyzing\x20project...','\x20next:\x20','workflow:attempts','13116hHoiJL','\x20\x20Attempt\x20ID:\x20','Listing\x20workflows...','displayLine','sort','List\x20workflows','floor','Reason:\x20','workflow:download','index','data','List\x20workflow\x20schedules','length','startTime','LABEL_MIN_SPACING','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','includes','sourceProjectName','workflow:pull','trim','split','Error:\x20','\x20\x20Target:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','1476568kTRZIo','Listing\x20workflow\x20sessions...','/attempt/','\x20\x20New\x20attempt\x20ID:\x20','tasks','projects','match','Filter:\x20project=','filesExtracted','---\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x0aPolling...\x20(','\x20\x20Project\x20ID:\x20','indexOf','Loading\x20session...','\x20of\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','finishedAt','changes','readFile','\x20\x20Changes:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20(use\x20--limit\x20to\x20show\x20more)','pollTimeline','Include\x20retried:\x20yes','Validation:\x20skipped','MIN_TIMELINE_WIDTH','running','-\x20no\x20files\x20written','status','filter','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','some','✔\x20Showing\x20','\x22\x20to\x20new\x20project\x20\x22','Getting\x20attempt\x20details...','90pWCMxM','yellow','workflow:clone','Auto-selected\x20latest\x20session:\x20','workflow:push','workflow','\x22\x20with\x20new\x20revision?','workflowProject','stdout','\x20\x20Console:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','Key\x20cannot\x20be\x20empty','✔\x20Schedule\x20#','summary','468286ZVRJYk','Force:\x20yes','✔\x20Secret\x20\x27','white','✔\x20Retry\x20started','New\x20project\x20name:\x20','Task\x20name:\x20','Invalid\x20format:\x20','\x20new','✔\x20Deleted\x20project\x20','Fetching\x20log\x20files...','getDate','Project:\x20','getMonth','Attempt\x20ID:\x20','table','Latest\x20session\x20has\x20no\x20attempt','end','follow','workflowName','\x20workflow','\x22\x20already\x20exists\x20(ID:\x20','text','prepareCloneProject','workflow:secrets:set','✔\x20Workflow\x20project\x20context\x20cleared.','dim','workflow:schedules','log','verbose','...','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflow\x20sessions\x20found','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','1929UjJnrx','\x20(system)','buildTimelineData','stringify','force','Dry\x20run:\x20yes','✔\x20Downloaded\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','basename','Disabling\x20schedule\x20#','\x27\x20from\x20project\x20\x27','project','find','\x20secrets...','workflow:run','No\x20sessions\x20found','Source:\x20','select','description','\x20has\x20no\x20attempts','Session\x20','/app/workflows/','\x20\x20Project:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','msPerChar','deleteSecret','Error:','yes','Loading\x20workflows...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','taskName','325754OajneB','Project\x20name:\x20','Status:\x20','MAX_TASKS_DISPLAY','\x20-\x20','1aEWiBp','columns','targetExists','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','limit','createdAt','values','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','localeCompare','format','✔\x20Pull\x20complete','list','MIN_LABEL_COUNT','Attempt:\x20','workflow:upload','retryAttemptName','Including\x20subtasks:\x20yes','✔\x20Project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','From\x20task:\x20','✔\x20Project\x20updated','\x20\x20Workflow:\x20','\x0aUpdate\x20existing\x20project\x20\x22','projectId','planned','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','lastAttempt','(use\x20--limit\x20to\x20see\x20more)','from','workflow:projects','Enable\x20a\x20workflow\x20schedule','No\x20attempts\x20found','fileSize','sessionTime','workflow:schedule:disable','navigateSessionsInteractive','-\x20nothing\x20pushed','Output\x20directory:\x20','.\x20Expected\x20format:\x20KEY=VALUE','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Getting\x20attempt\x20tasks...','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:list','LABEL_WIDTH_DIVISOR','List\x20workflow\x20execution\x20sessions','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','push','\x20modified','metadata','getHours','List\x20all\x20workflow\x20projects','Analyzing\x20changes...','startsWith','✔\x20Found\x20','newProjectId','\x20\x20Session\x20context\x20set\x20to:\x20','📋\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','has','new','Source\x20directory\x20is\x20required','workflow:kill','Listing\x20workflow\x20projects...','showWorkflowConsoleUrl','generateSessionTimelineRows','cyan','applyPullProject','tdx\x20wf\x20attempt\x20','output','\x0aDry\x20run\x20-\x20no\x20project\x20created','parse','\x20from\x20session\x20','get','workflow:use','workflow:timeline','workflow:attempt','name','workflow:logs','Downloading\x20logs...','POLL_INTERVAL_MS','Pushing\x20workflow\x20project...','targetDir','keys','fullName','modified','💡\x20Tip:\x20Use\x20','/sessions/','Downloading\x20project\x20','Listing\x20secrets...','\x20unchanged','logs','key','nextRunTime','resolveProject','workflows','write','Loading\x20sessions...','(unknown)','List\x20workflow\x20attempts','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','pullProject','unchanged','No\x20attempts\x20found\x20in\x20project:\x20','\x20task','Deleting\x20project\x20','Enabling\x20schedule\x20#','deleted','site','toISOString','toLocaleString','size','Setting\x20','newProjectName','Files\x20to\x20upload:\x20','startedAt','toLowerCase','\x20secrets\x20set\x20for\x20project\x20\x27','\x20project','every','workflow:workflows','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x20\x20Revision:\x20','fs/promises','sourceDir','Pattern:\x20'];a54_0x2768=function(){return _0x1524af;};return a54_0x2768();}function calculateStats(_0x4d33b6){const _0x5b03db=a54_0x2a0943,_0x426611={'total':_0x4d33b6['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x433a91 of _0x4d33b6){if(_0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x204))_0x426611[_0x5b03db(0x204)]++;else{if(_0x433a91[_0x5b03db(0x233)]==='error'||_0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x1f9))_0x426611[_0x5b03db(0x2ae)]++;else _0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x2ea)?_0x426611[_0x5b03db(0x2ea)]++:_0x426611[_0x5b03db(0x221)]++;}}return _0x426611;}function formatStats(_0x2d839b){const _0x282149=a54_0x2a0943;return['Total:\x20'+_0x2d839b['total'],'✅\x20'+_0x2d839b['success'],'❌\x20'+_0x2d839b['error'],_0x282149(0x2b1)+_0x2d839b[_0x282149(0x2ea)],'⏳\x20'+_0x2d839b[_0x282149(0x221)]][_0x282149(0x219)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c1);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x321);async[a54_0x2a0943(0x295)](_0x4904f4){const _0x45bc85=a54_0x2a0943,{options:_0x219e52,args:_0x87ca29,tdx:_0x366f38}=_0x4904f4;let _0x10a600,_0x4b4d74,_0x2c5e66=![];if(_0x87ca29[0x0]){if(_0x87ca29[0x0][_0x45bc85(0x2c6)]('.')){const _0x28f7dd=this['parseProjectWorkflowPattern'](_0x87ca29,_0x219e52);if(!_0x28f7dd)return 0x1;_0x10a600=_0x28f7dd[_0x45bc85(0x282)],_0x4b4d74=_0x28f7dd['workflowName'];}else{_0x4b4d74=_0x87ca29[0x0],_0x10a600=_0x219e52[_0x45bc85(0x2fb)];if(!_0x10a600)return console['error'](a54_0x13943d[_0x45bc85(0x1fc)](_0x45bc85(0x33f)),_0x45bc85(0x218)),0x1;_0x2c5e66=!![];}}else{const _0x310b3b=this[_0x45bc85(0x228)](_0x87ca29,_0x219e52);if(!_0x310b3b)return 0x1;_0x10a600=_0x310b3b[_0x45bc85(0x282)],_0x4b4d74=_0x310b3b[_0x45bc85(0x315)];}if(_0x219e52[_0x45bc85(0x31f)]){if(_0x10a600&&_0x4b4d74)console[_0x45bc85(0x2ae)](_0x45bc85(0x24f)+_0x10a600+'.'+_0x4b4d74);else _0x10a600&&console[_0x45bc85(0x2ae)](_0x45bc85(0x2d5)+_0x10a600);}const _0x21069e=_0x219e52[_0x45bc85(0x20b)],_0x4ab1ef=_0x219e52[_0x45bc85(0x1fe)];if(_0x21069e){_0x4ab1ef&&console[_0x45bc85(0x2ae)](a54_0x13943d[_0x45bc85(0x2f5)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x49dc99=_0x219e52['follow'];return _0x49dc99?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x21069e):await this[_0x45bc85(0x245)](_0x4904f4,_0x21069e,_0x219e52),0x0;}if(_0x4ab1ef){const _0x2cd299=await withSpinner(_0x45bc85(0x2dd),()=>_0x366f38[_0x45bc85(0x2f9)][_0x45bc85(0x296)]({'projectName':_0x10a600,'workflowName':_0x4b4d74,'limit':0x64}),{'verbose':_0x219e52[_0x45bc85(0x31f)]}),_0x283b65=_0x2cd299[_0x45bc85(0x2c0)][_0x45bc85(0x331)](_0x3b095d=>_0x3b095d['id']===_0x4ab1ef);if(!_0x283b65)return console['error'](a54_0x13943d[_0x45bc85(0x1fc)](_0x45bc85(0x33f)),_0x45bc85(0x248)+_0x4ab1ef),0x1;if(!_0x283b65['lastAttempt']?.['id'])return console[_0x45bc85(0x2ae)](a54_0x13943d[_0x45bc85(0x1fc)]('Error:'),_0x45bc85(0x339)+_0x4ab1ef+_0x45bc85(0x338)),0x1;const _0x552d2e=_0x283b65[_0x45bc85(0x363)]['id'];_0x219e52['verbose']&&console[_0x45bc85(0x2ae)]('Using\x20attempt\x20'+_0x552d2e+_0x45bc85(0x1be)+_0x4ab1ef);const _0x553c28=_0x219e52[_0x45bc85(0x314)];return _0x553c28?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x552d2e):await this[_0x45bc85(0x245)](_0x4904f4,_0x552d2e,_0x219e52),0x0;}const _0x3145d5=await withSpinner(_0x45bc85(0x1d7),()=>_0x366f38[_0x45bc85(0x2f9)]['sessions']({'projectName':_0x10a600,'workflowName':_0x4b4d74,'limit':_0x219e52[_0x45bc85(0x34d)]||0x32}),{'verbose':_0x219e52['verbose']}),_0x5a031e=_0x3145d5[_0x45bc85(0x2c0)];if(_0x5a031e[_0x45bc85(0x2c2)]===0x0){if(_0x10a600&&_0x4b4d74)console[_0x45bc85(0x2ae)]('No\x20sessions\x20found\x20for:\x20'+_0x10a600+'.'+_0x4b4d74);else _0x10a600?console[_0x45bc85(0x2ae)](_0x45bc85(0x372)+_0x10a600):(console[_0x45bc85(0x2ae)](_0x45bc85(0x322)),console['error'](a54_0x13943d['dim'](_0x45bc85(0x279))));return 0x0;}_0x5a031e[_0x45bc85(0x2ba)]((_0x451fff,_0x435b91)=>{const _0x100e18=_0x45bc85,_0x161623=_0x451fff['sessionTime']||'',_0x157664=_0x435b91[_0x100e18(0x36a)]||'';return _0x157664['localeCompare'](_0x161623);});if(_0x219e52[_0x45bc85(0x200)]||_0x219e52[_0x45bc85(0x291)])return await handleSDKOutput(_0x5a031e,_0x219e52),0x0;let _0x15f997;if(_0x2c5e66){const _0x33611c=_0x5a031e[0x0];if(!_0x33611c[_0x45bc85(0x363)]?.['id'])return console['error'](_0x45bc85(0x312)),0x0;_0x15f997=_0x33611c[_0x45bc85(0x363)]['id'],_0x219e52[_0x45bc85(0x31f)]&&console['error'](_0x45bc85(0x2f7)+_0x33611c['sessionTime']);}else{const _0x3ec5dd=_0x5a031e[_0x45bc85(0x285)](_0x167c82=>{const _0xee57bd=_0x45bc85,_0x54c205=getAttemptStatusDisplay(_0x167c82['lastAttempt']);return{'title':_0x167c82[_0xee57bd(0x330)]?.['name']+'.'+_0x167c82[_0xee57bd(0x2f9)]?.[_0xee57bd(0x1c3)]+'\x20-\x20'+_0x167c82['sessionTime']+'\x20'+_0x54c205['icon'],'value':_0x167c82[_0xee57bd(0x363)]?.['id']||'','description':_0x54c205[_0xee57bd(0x318)]};}),_0x577981=await a54_0x1b2330({'type':'select','name':_0x45bc85(0x20b),'message':_0x45bc85(0x268),'choices':_0x3ec5dd[_0x45bc85(0x2ed)](_0x386de9=>_0x386de9[_0x45bc85(0x1fb)]!=='')});if(!_0x577981['attemptId'])return 0x0;_0x15f997=_0x577981['attemptId'];}const _0x2a7056=_0x219e52[_0x45bc85(0x314)];return _0x2a7056?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x15f997):await this[_0x45bc85(0x245)](_0x4904f4,_0x15f997,_0x219e52),0x0;}async[a54_0x2a0943(0x245)](_0x54d9bb,_0x504dac,_0x589595){const _0x3d97cc=a54_0x2a0943,{tdx:_0x3da4d1}=_0x54d9bb;let _0x54706a,_0x293598;try{[_0x54706a,_0x293598]=await Promise['all']([_0x3da4d1[_0x3d97cc(0x2f9)][_0x3d97cc(0x1ff)](_0x504dac),_0x3da4d1[_0x3d97cc(0x2f9)][_0x3d97cc(0x2d2)](_0x504dac,![])]);}catch(_0x365a1b){console[_0x3d97cc(0x2ae)](a54_0x13943d[_0x3d97cc(0x1fc)](_0x3d97cc(0x2a1)));_0x589595[_0x3d97cc(0x31f)]&&console[_0x3d97cc(0x2ae)](_0x365a1b);throw _0x365a1b;}if(_0x589595[_0x3d97cc(0x200)]||_0x589595['jsonl']){const _0x36473f=this[_0x3d97cc(0x326)](_0x54706a,_0x293598);await handleSDKOutput([_0x36473f],_0x589595);return;}const _0x5c0f69=_0x3da4d1[_0x3d97cc(0x21a)][_0x3d97cc(0x1e2)],_0x950c1c=this[_0x3d97cc(0x215)](_0x54706a,_0x293598,_0x5c0f69);console[_0x3d97cc(0x31e)](_0x950c1c);}async['pollTimeline'](_0x23e5d7,_0xdfbc3){const _0xd75e61=a54_0x2a0943,{tdx:_0x19df3c}=_0x23e5d7,_0x2f9685=TIMELINE_CONFIG[_0xd75e61(0x1c6)],_0x363a78=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x2fa3e3=0x0;while(_0x2fa3e3<_0x363a78){process[_0xd75e61(0x2fc)][_0xd75e61(0x2aa)]&&process[_0xd75e61(0x2fc)][_0xd75e61(0x1d6)]('\x1bc');let _0x3cc12f,_0x3bc1ff;try{[_0x3cc12f,_0x3bc1ff]=await Promise[_0xd75e61(0x217)]([_0x19df3c[_0xd75e61(0x2f9)]['attempt'](_0xdfbc3),_0x19df3c[_0xd75e61(0x2f9)][_0xd75e61(0x2d2)](_0xdfbc3,![])]);}catch(_0x56823d){console['error'](a54_0x13943d[_0xd75e61(0x1fc)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x2fa3e3>0x0&&console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x31c)](_0xd75e61(0x370)+_0x2fa3e3));throw _0x56823d;}const _0xf1c96d=_0x19df3c[_0xd75e61(0x21a)][_0xd75e61(0x1e2)],_0x3ae908=this['renderTimeline'](_0x3cc12f,_0x3bc1ff,_0xf1c96d);console[_0xd75e61(0x31e)](_0x3ae908);const _0x59179c=_0x3cc12f[_0xd75e61(0x20a)]&&_0x3bc1ff[_0xd75e61(0x1ed)](_0x37256e=>_0x37256e['state']!==_0xd75e61(0x2ea)&&_0x37256e[_0xd75e61(0x233)]!==_0xd75e61(0x361));if(_0x59179c){console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x211)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x31c)](_0xd75e61(0x2da)+_0x2fa3e3*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x3ee7f7=>setTimeout(_0x3ee7f7,_0x2f9685)),_0x2fa3e3++;}_0x2fa3e3>=_0x363a78&&console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x2f5)](_0xd75e61(0x1ef)));}[a54_0x2a0943(0x215)](_0x4faa26,_0x817377,_0x4ba71d){const _0x5267ba=a54_0x2a0943,_0x1145d1=[],_0x1e9a31=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5f36d9=0x5,_0x3badfb=process['stdout'][_0x5267ba(0x34a)]||0x78,_0x28acc8=_0x3badfb-_0x1e9a31-_0x5f36d9,_0x42151d=Math['max'](TIMELINE_CONFIG[_0x5267ba(0x2e9)],Math[_0x5267ba(0x294)](_0x28acc8,TIMELINE_CONFIG[_0x5267ba(0x1f7)])),_0x3c5586=new Date(_0x4faa26['createdAt'])[_0x5267ba(0x29c)](),_0x148b8c=_0x4faa26[_0x5267ba(0x2e0)]?new Date(_0x4faa26[_0x5267ba(0x2e0)])[_0x5267ba(0x29c)]():Date[_0x5267ba(0x22e)](),_0x130f0f={'start':_0x3c5586,'end':_0x148b8c,'duration':_0x148b8c-_0x3c5586},_0x1ee08a=new Map(),_0x94aa97=[];for(const _0x25a3f0 of _0x817377){if(_0x25a3f0['startedAt']){const _0x1871cc=new Date(_0x25a3f0[_0x5267ba(0x1e9)])['getTime'](),_0x30fd62=_0x25a3f0[_0x5267ba(0x225)]?new Date(_0x25a3f0[_0x5267ba(0x225)])[_0x5267ba(0x29c)]():Date[_0x5267ba(0x22e)](),_0x399a29={'start':_0x1871cc,'end':_0x30fd62,'duration':_0x30fd62-_0x1871cc};_0x1ee08a[_0x5267ba(0x2a7)](_0x25a3f0['id'],_0x399a29),_0x94aa97['push']({'name':_0x25a3f0[_0x5267ba(0x1ca)],'state':_0x25a3f0[_0x5267ba(0x233)]||_0x5267ba(0x263),'window':_0x399a29});}else _0x94aa97[_0x5267ba(0x377)]({'name':_0x25a3f0[_0x5267ba(0x1ca)],'state':_0x25a3f0['state']||_0x5267ba(0x361),'window':undefined});}_0x94aa97[_0x5267ba(0x2ba)]((_0x690f61,_0x39c56d)=>{const _0x527c97=_0x5267ba;if(!_0x690f61['window'])return 0x1;if(!_0x39c56d[_0x527c97(0x261)])return-0x1;return _0x690f61['window'][_0x527c97(0x273)]-_0x39c56d[_0x527c97(0x261)][_0x527c97(0x273)];});const _0x4867b3=_0x94aa97['length'],_0xaaf960=_0x4867b3>TIMELINE_CONFIG[_0x5267ba(0x347)];_0xaaf960&&_0x94aa97['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x3ede6a=calculateTimeScale(_0x130f0f,_0x42151d),_0x5ab640=_0x4faa26[_0x5267ba(0x20a)]?_0x4faa26['success']?a54_0x13943d['green'](_0x5267ba(0x204)):a54_0x13943d[_0x5267ba(0x1fc)]('error'):a54_0x13943d[_0x5267ba(0x258)](_0x5267ba(0x2ea)),_0x5417de=_0x4faa26[_0x5267ba(0x330)]?.['id'],_0xf83000=_0x4faa26[_0x5267ba(0x1fe)];let _0x10fd4a;if(_0x5417de&&_0xf83000){const _0x2822e8=getWorkflowAttemptUrl(_0x4ba71d,_0x5417de,_0xf83000,_0x4faa26['id']);_0x10fd4a=hyperlink(a54_0x13943d[_0x5267ba(0x31c)](_0x4faa26['id']),_0x2822e8);}else _0x10fd4a=a54_0x13943d[_0x5267ba(0x31c)](_0x4faa26['id']);_0x1145d1[_0x5267ba(0x377)](_0x5267ba(0x356)+_0x10fd4a+_0x5267ba(0x348)+_0x5ab640+'\x20-\x20'+formatElapsed(_0x130f0f[_0x5267ba(0x298)]));if(_0x94aa97['length']>0x0){const _0x3ceeeb=renderTimeAxis(_0x3ede6a,_0x42151d),_0x429bbe=new Date(_0x130f0f[_0x5267ba(0x273)]),_0x3eb942=formatDate(_0x429bbe),_0x6dde4d=TIMELINE_CONFIG[_0x5267ba(0x235)]+TIMELINE_CONFIG[_0x5267ba(0x22d)]+_0x1e9a31,_0x44fcaf=_0x3eb942['padStart'](_0x6dde4d),_0x38fba6=a54_0x13943d['dim'](_0x44fcaf);_0x1145d1['push'](_0x38fba6+'\x20'+_0x3ceeeb);for(const _0x2fb8b0 of _0x94aa97){_0x1145d1[_0x5267ba(0x377)](renderTaskRow(_0x2fb8b0,_0x3ede6a,_0x42151d,_0x1e9a31));}const _0x1fdba2=calculateStats(_0x94aa97);_0x1145d1[_0x5267ba(0x377)](formatStats(_0x1fdba2)),_0xaaf960&&_0x1145d1[_0x5267ba(0x377)](a54_0x13943d['yellow'](_0x5267ba(0x28f)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x5267ba(0x2de)+_0x4867b3+'\x20tasks')),_0x1145d1[_0x5267ba(0x377)](''),_0x1145d1[_0x5267ba(0x377)](a54_0x13943d[_0x5267ba(0x31c)](_0x5267ba(0x1cc))+(_0x5267ba(0x1ba)+_0x4faa26['id']+'\x20logs')+a54_0x13943d[_0x5267ba(0x31c)](_0x5267ba(0x230)));}else _0x1145d1[_0x5267ba(0x377)](_0x5267ba(0x257));return _0x1145d1[_0x5267ba(0x219)]('\x0a');}['buildTimelineData'](_0x5b2aa3,_0x36ba3a){const _0xd128cc=a54_0x2a0943,_0x290d6e=new Date(_0x5b2aa3['createdAt'])[_0xd128cc(0x29c)](),_0xe7debf=_0x5b2aa3['finishedAt']?new Date(_0x5b2aa3['finishedAt'])[_0xd128cc(0x29c)]():Date[_0xd128cc(0x22e)](),_0x2a8e4e=_0xe7debf-_0x290d6e,_0xae8e97=[];for(const _0x345bca of _0x36ba3a){if(_0x345bca[_0xd128cc(0x1e9)]){const _0x3e08a7=new Date(_0x345bca['startedAt'])['getTime'](),_0x1eed71=_0x345bca[_0xd128cc(0x225)]?new Date(_0x345bca[_0xd128cc(0x225)])['getTime']():Date['now']();_0xae8e97[_0xd128cc(0x377)]({'name':_0x345bca['fullName'],'state':_0x345bca[_0xd128cc(0x233)]||_0xd128cc(0x263),'window':{'start':_0x3e08a7,'end':_0x1eed71,'duration':_0x1eed71-_0x3e08a7}});}else _0xae8e97[_0xd128cc(0x377)]({'name':_0x345bca['fullName'],'state':_0x345bca[_0xd128cc(0x233)]||'planned','window':undefined});}const _0x2c67cd=calculateStats(_0xae8e97);return{'attempt':{'id':_0x5b2aa3['id'],'status':_0x5b2aa3[_0xd128cc(0x20a)]?_0x5b2aa3['success']?_0xd128cc(0x204):_0xd128cc(0x2ae):_0xd128cc(0x2ea),'createdAt':_0x5b2aa3[_0xd128cc(0x34e)],'finishedAt':_0x5b2aa3[_0xd128cc(0x2e0)],'duration_ms':_0x2a8e4e},'tasks':_0xae8e97[_0xd128cc(0x285)](_0x3c0215=>({'name':_0x3c0215['name'],'state':_0x3c0215['state'],'startedAt':_0x3c0215[_0xd128cc(0x261)]?new Date(_0x3c0215[_0xd128cc(0x261)][_0xd128cc(0x273)])[_0xd128cc(0x1e3)]():null,'updatedAt':_0x3c0215[_0xd128cc(0x261)]?new Date(_0x3c0215[_0xd128cc(0x261)]['end'])[_0xd128cc(0x1e3)]():null,'duration_ms':_0x3c0215[_0xd128cc(0x261)]?.[_0xd128cc(0x298)]||null})),'stats':_0x2c67cd};}}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x2a0943(0x31d);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2c1);async['execute'](_0x2b70a4){const _0x13ac2d=a54_0x2a0943,{options:_0x32cf6b,tdx:_0x5f2035}=_0x2b70a4,_0x33a6cd=await withSpinner(_0x13ac2d(0x2a6),()=>_0x5f2035[_0x13ac2d(0x2f9)][_0x13ac2d(0x226)](),{'verbose':_0x32cf6b['verbose']}),_0x4ae562=_0x33a6cd[_0x13ac2d(0x2c0)];console[_0x13ac2d(0x2ae)]('✔\x20Found\x20'+_0x4ae562[_0x13ac2d(0x2c2)]+'\x20schedule'+(_0x4ae562[_0x13ac2d(0x2c2)]!==0x1?'s':''));if(isStructuredFormat(_0x32cf6b))await handleSDKOutput(_0x4ae562,_0x32cf6b);else{if(_0x4ae562[_0x13ac2d(0x2c2)]===0x0)console['log']('No\x20schedules\x20found');else for(const _0x5bad7c of _0x4ae562){const _0x36b644=_0x5bad7c[_0x13ac2d(0x29f)]?a54_0x13943d['yellow'](_0x13ac2d(0x238)):'',_0xf6d701=_0x5bad7c[_0x13ac2d(0x330)]?.['name']?a54_0x13943d[_0x13ac2d(0x31c)]('\x20['+_0x5bad7c[_0x13ac2d(0x330)]['name']+']'):'',_0x3c3c73=_0x5bad7c['nextRunTime']?a54_0x13943d['dim'](_0x13ac2d(0x2b4)+new Date(_0x5bad7c['nextRunTime'])[_0x13ac2d(0x1e4)]()):'';console['log'](_0x13ac2d(0x216)+_0x5bad7c['id']+'\x20'+(_0x5bad7c[_0x13ac2d(0x2f9)]?.[_0x13ac2d(0x1c3)]||'(unknown)')+_0xf6d701+_0x36b644+_0x3c3c73);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]='workflow:schedule:enable';['description']=a54_0x2a0943(0x367);async[a54_0x2a0943(0x295)](_0x1f52aa){const _0x1ef387=a54_0x2a0943,{options:_0x5e3975,args:_0x5153c8,tdx:_0x24a8ba}=_0x1f52aa,_0x57df67=_0x5153c8[0x0];if(!_0x57df67)return console[_0x1ef387(0x2ae)](a54_0x13943d[_0x1ef387(0x1fc)](_0x1ef387(0x33f)),_0x1ef387(0x26f)),console['error'](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x2cd))),console['error'](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x382))),0x1;const _0x108dd3=await withSpinner(_0x1ef387(0x1e0)+_0x57df67+_0x1ef387(0x320),()=>_0x24a8ba[_0x1ef387(0x2f9)][_0x1ef387(0x2ab)](_0x57df67),{'verbose':_0x5e3975[_0x1ef387(0x31f)]}),_0x3df794=_0x108dd3['data'];return isStructuredFormat(_0x5e3975)?await handleSingleObjectOutput(_0x3df794,_0x5e3975):(console['log']('✔\x20Schedule\x20#'+_0x57df67+_0x1ef387(0x269)+(_0x3df794[_0x1ef387(0x2f9)]?.[_0x1ef387(0x1c3)]||_0x1ef387(0x263))+')'),_0x3df794['nextRunTime']&&console[_0x1ef387(0x31e)](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x23c)+new Date(_0x3df794[_0x1ef387(0x1d3)])[_0x1ef387(0x1e4)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x36b);['description']=a54_0x2a0943(0x222);async['execute'](_0x350c4f){const _0x4e22fc=a54_0x2a0943,{options:_0x2c1a79,args:_0x5113f5,tdx:_0x573e81}=_0x350c4f,_0x4b573c=_0x5113f5[0x0];if(!_0x4b573c)return console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x1fc)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x31c)](_0x4e22fc(0x23a))),console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x31c)](_0x4e22fc(0x382))),0x1;const _0x398386=await withSpinner(_0x4e22fc(0x32e)+_0x4b573c+'...',()=>_0x573e81[_0x4e22fc(0x2f9)]['disableSchedule'](_0x4b573c),{'verbose':_0x2c1a79['verbose']}),_0x4488fb=_0x398386[_0x4e22fc(0x2c0)];return isStructuredFormat(_0x2c1a79)?await handleSingleObjectOutput(_0x4488fb,_0x2c1a79):console[_0x4e22fc(0x31e)](_0x4e22fc(0x300)+_0x4b573c+_0x4e22fc(0x246)+(_0x4488fb['workflow']?.[_0x4e22fc(0x1c3)]||'unknown')+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43ae43,_0x2a6f45){const _0x3e0589=a55_0x1c45,_0x4e9595=_0x43ae43();while(!![]){try{const _0x2dc303=parseInt(_0x3e0589(0x67))/0x1*(-parseInt(_0x3e0589(0x6c))/0x2)+parseInt(_0x3e0589(0x73))/0x3+-parseInt(_0x3e0589(0x72))/0x4+-parseInt(_0x3e0589(0x70))/0x5*(parseInt(_0x3e0589(0x68))/0x6)+parseInt(_0x3e0589(0x6d))/0x7+parseInt(_0x3e0589(0x6b))/0x8+parseInt(_0x3e0589(0x6a))/0x9;if(_0x2dc303===_0x2a6f45)break;else _0x4e9595['push'](_0x4e9595['shift']());}catch(_0x355468){_0x4e9595['push'](_0x4e9595['shift']());}}}(a55_0xd09a,0x99378));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x1c45(_0xe201b9,_0x271a6d){_0xe201b9=_0xe201b9-0x67;const _0xd09a8b=a55_0xd09a();let _0x1c451d=_0xd09a8b[_0xe201b9];return _0x1c451d;}export function getUserAgent(){const _0x475930=a55_0x1c45,_0x48033a=getVersion(),_0xdec034=platform(),_0x429402=process[_0x475930(0x6f)][_0x475930(0x69)]('v','');return'tdx/'+_0x48033a+'\x20('+_0xdec034+';\x20node/'+_0x429402+')';}export function getAuthHeaders(_0x26c989,_0x419546,_0x2ee35e){const _0x4d91c8=a55_0x1c45,_0x56a71e=getVersion(),_0x54b9c8={'User-Agent':getUserAgent(),'X-TD-Client':_0x4d91c8(0x6e),'X-TD-Client-Version':_0x56a71e};if(_0x2ee35e)_0x54b9c8[_0x4d91c8(0x74)]=_0x4d91c8(0x75)+_0x2ee35e;else _0x419546&&(_0x54b9c8['Authorization']='TD1\x20'+_0x419546);return _0x54b9c8;}export function toHeaderRecord(_0x424f33){const _0x1e0ce1={};for(const [_0x289dfb,_0x5079b9]of Object['entries'](_0x424f33)){_0x5079b9!==undefined&&(_0x1e0ce1[_0x289dfb]=_0x5079b9);}return _0x1e0ce1;}export function getTrinoHeaders(_0x58064d,_0x46f0bc,_0x49cc1b){const _0x24a754=a55_0x1c45,_0x1bde29=getAuthHeaders(_0x58064d),_0x5024a8=toHeaderRecord(_0x1bde29);if(_0x49cc1b)_0x5024a8[_0x24a754(0x74)]=_0x24a754(0x75)+_0x49cc1b;else _0x46f0bc&&(_0x5024a8[_0x24a754(0x71)]=_0x46f0bc);return _0x5024a8;}export function hasAPIKey(_0x99a94c){const _0x3d6fe8=getAPIKey();return _0x3d6fe8!==undefined&&_0x3d6fe8['length']>0x0;}function a55_0xd09a(){const _0x2ea6ca=['3006426CUiBEP','replace','8744544yDJWxZ','4809216FzxVIh','16fJwPhA','6643014QQQDrH','tdx','version','10QoGgUU','X-Trino-User','1607032hmNCtr','1093614rsMVTu','Authorization','Bearer\x20','106854CWdgQz'];a55_0xd09a=function(){return _0x2ea6ca;};return a55_0xd09a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4858ae,_0x1e77aa){const _0x188e6b=a56_0x4dd4,_0x3967ff=_0x4858ae();while(!![]){try{const _0x39f1c9=-parseInt(_0x188e6b(0x177))/0x1+-parseInt(_0x188e6b(0x19f))/0x2+-parseInt(_0x188e6b(0x1a8))/0x3+parseInt(_0x188e6b(0x1b7))/0x4+parseInt(_0x188e6b(0x18c))/0x5+parseInt(_0x188e6b(0x16d))/0x6+parseInt(_0x188e6b(0x179))/0x7*(parseInt(_0x188e6b(0x1ab))/0x8);if(_0x39f1c9===_0x1e77aa)break;else _0x3967ff['push'](_0x3967ff['shift']());}catch(_0x2a2bf7){_0x3967ff['push'](_0x3967ff['shift']());}}}(a56_0x1f22,0x3acc2));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';function a56_0x1f22(){const _0x172461=['length','number','slice','cmdout','inherit','query','data','keys','141054xWcybn','bigint','[logs]','56aVdnyk','boolean','error','write','─┬─','FINISHED','join','jsonl','noColor','isFinite','tsv','─┴─','107976wYYCQL','isInteger','map','entries','734436gtZtvv','json','log','rule','cyan','object','spawn','format','[error]','stdout','36740zfayEv','Results\x20saved\x20to\x20','102445VUfHDq','varchar','padEnd','isTTY','params','output','push','sdk-result','table','limitStructuredFormats','bold','magenta','forEach','trim','red','No\x20data','[Object]','stdin','[query]','857960QZzVrR','close','max','debug','repeat','pipe','stringify','string','split','yellow','resolve','[rule]','limit','blue','color','double','stderr','[params]','-FXRSn','197690JlIsON'];a56_0x1f22=function(){return _0x172461;};return a56_0x1f22();}import a56_0x2289b7 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x30d77e){const _0x316f34=a56_0x4dd4;return _0x30d77e[_0x316f34(0x174)]===_0x316f34(0x16e)||_0x30d77e[_0x316f34(0x174)]===_0x316f34(0x1b2)||_0x30d77e[_0x316f34(0x174)]===_0x316f34(0x1b5)||_0x30d77e[_0x316f34(0x174)]===_0x316f34(0x181)||_0x30d77e[_0x316f34(0x16e)]===!![]||_0x30d77e[_0x316f34(0x1b2)]===!![]||_0x30d77e[_0x316f34(0x1b5)]===!![]||_0x30d77e['table']===!![];}export function parseOutputOptions(_0x51cd55){const _0x53d1ba=a56_0x4dd4;return{'format':_0x51cd55[_0x53d1ba(0x174)]||'table','output':_0x51cd55[_0x53d1ba(0x17e)]||'','limit':_0x51cd55[_0x53d1ba(0x198)],'limitStructuredFormats':_0x51cd55[_0x53d1ba(0x182)],'color':_0x51cd55[_0x53d1ba(0x19a)],'noColor':_0x51cd55[_0x53d1ba(0x1b3)]};}function convertSDKResultToQueryResult(_0x185738){const _0x36e566=a56_0x4dd4,_0x46cc3f=[];if(_0x185738[_0x36e566(0x1a0)]>0x0){const _0x48674b=_0x185738[0x0];for(const [_0x138c42,_0x391093]of Object[_0x36e566(0x1ba)](_0x48674b)){let _0x3cd565=_0x36e566(0x17a);if(typeof _0x391093===_0x36e566(0x1a1))_0x3cd565=Number[_0x36e566(0x1b8)](_0x391093)?_0x36e566(0x1a9):_0x36e566(0x19b);else{if(typeof _0x391093===_0x36e566(0x1ac))_0x3cd565='boolean';else _0x391093===null&&(_0x3cd565='varchar');}_0x46cc3f[_0x36e566(0x17f)]({'name':_0x138c42,'type':_0x3cd565});}}return{'queryId':_0x36e566(0x180),'columns':_0x46cc3f,'data':_0x185738,'stats':{'state':_0x36e566(0x1b0),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x185738['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x51040f,_0x41dca5){const _0x25bd35=convertSDKResultToQueryResult(_0x51040f);return formatQueryOutput(_0x25bd35,_0x41dca5);}export async function formatQueryOutput(_0x23594f,_0x266f12){const _0x4b09a1=a56_0x4dd4,{format:_0x51589a,limit:_0x37e19a,output:_0x550c27,color:_0x51a3f2,noColor:_0x1ea989,limitStructuredFormats:_0x1ddfbc}=_0x266f12,_0x2efd33=Boolean(_0x550c27)&&!_0x51a3f2,_0x536bcc={'color':_0x51a3f2,'noColor':_0x1ea989||_0x2efd33};if(_0x51589a==='table'){const _0x4d6ae9=shouldUseLess(_0x51589a,_0x550c27);return formatAsTable(_0x23594f,_0x37e19a,_0x4d6ae9,_0x536bcc);}const _0x342151=_0x1ddfbc&&Number[_0x4b09a1(0x1b4)](_0x37e19a)&&_0x23594f[_0x4b09a1(0x1a6)][_0x4b09a1(0x1a0)]>_0x37e19a?{..._0x23594f,'data':_0x23594f[_0x4b09a1(0x1a6)][_0x4b09a1(0x1a2)](0x0,_0x37e19a)}:_0x23594f;if(_0x51589a===_0x4b09a1(0x16e))return formatAsJSON(_0x342151,_0x536bcc);else return _0x51589a===_0x4b09a1(0x1b2)?formatAsJSONL(_0x342151,_0x536bcc):formatQueryResult(_0x342151,_0x51589a);}function shouldUseLess(_0x1b28e1,_0x30b522){const _0x48f367=a56_0x4dd4;return(_0x1b28e1===_0x48f367(0x181)||_0x1b28e1==='list')&&process[_0x48f367(0x176)][_0x48f367(0x17c)]&&!_0x30b522;}export function resolveOutputOptions(_0x14a889){const _0x1a82bb=a56_0x4dd4,_0x2c6853=_0x14a889[_0x1a82bb(0x17e)]||'',_0x1ee3fc=resolveOutputFormat(_0x14a889['format'],_0x2c6853,_0x1a82bb(0x181));let _0x57801d=typeof _0x14a889['limit']===_0x1a82bb(0x1a1)?_0x14a889[_0x1a82bb(0x198)]:parseInt(_0x14a889[_0x1a82bb(0x198)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x14a889[_0x1a82bb(0x198)]===undefined&&shouldUseLess(_0x1ee3fc,_0x2c6853)&&(_0x57801d=Infinity),{'format':_0x1ee3fc,'output':_0x2c6853,'limit':_0x57801d,'limitStructuredFormats':_0x14a889['limitStructuredFormats'],'color':_0x14a889[_0x1a82bb(0x19a)],'noColor':_0x14a889[_0x1a82bb(0x1b3)]};}function a56_0x4dd4(_0x350615,_0x5396d5){_0x350615=_0x350615-0x16d;const _0x1f225c=a56_0x1f22();let _0x4dd477=_0x1f225c[_0x350615];return _0x4dd477;}export function writeOutput(_0x23d383,_0x418d1d,_0x54a447){const _0x57d59a=a56_0x4dd4;return _0x418d1d?(writeFileSync(_0x418d1d,_0x23d383),console[_0x57d59a(0x1ad)](_0x57d59a(0x178)+_0x418d1d),Promise['resolve']()):shouldUseLess(_0x54a447||'','')?new Promise(_0x587830=>{const _0x357dff=_0x57d59a,_0xb227e2=spawn('less',[_0x357dff(0x19e)],{'stdio':[_0x357dff(0x191),_0x357dff(0x1a4),_0x357dff(0x1a4)]});let _0x571035=![];_0xb227e2['on']('error',()=>{const _0x323194=_0x357dff;!_0x571035&&(_0x571035=!![],console[_0x323194(0x16f)](_0x23d383),_0x587830());}),_0xb227e2['on'](_0x357dff(0x18d),()=>{!_0x571035&&(_0x571035=!![],_0x587830());}),_0xb227e2['on'](_0x357dff(0x173),()=>{const _0x2d8ec3=_0x357dff;!_0x571035&&_0xb227e2[_0x2d8ec3(0x18a)]&&(_0xb227e2[_0x2d8ec3(0x18a)]['on'](_0x2d8ec3(0x1ad),()=>{}),_0xb227e2[_0x2d8ec3(0x18a)][_0x2d8ec3(0x1ae)](_0x23d383),_0xb227e2['stdin']['end']());}),!_0xb227e2['stdin']&&(!_0x571035&&(_0x571035=!![],console[_0x357dff(0x16f)](_0x23d383),_0x587830()));}):(console[_0x57d59a(0x16f)](_0x23d383),Promise[_0x57d59a(0x196)]());}export async function handleSDKOutput(_0x42a8cd,_0x267593){const _0x42e36e=a56_0x4dd4,_0x41d1ba=resolveOutputOptions(_0x267593),_0x2e9dad=await formatSDKOutput(_0x42a8cd,_0x41d1ba);await writeOutput(_0x2e9dad,_0x41d1ba['output']||undefined,_0x41d1ba[_0x42e36e(0x174)]);}export async function handleQueryOutput(_0x4f2b34,_0xd2b4af){const _0x231dbf=a56_0x4dd4,_0x579e1b=resolveOutputOptions(_0xd2b4af),_0x26cd22=await formatQueryOutput(_0x4f2b34,_0x579e1b);await writeOutput(_0x26cd22,_0x579e1b[_0x231dbf(0x17e)]||undefined,_0x579e1b['format']);}async function formatSingleObject(_0x4f5994,_0x2e9b34){const _0x5c02af=a56_0x4dd4,{format:_0x107fe8,color:_0x37e7b3,noColor:_0x36d5ff}=_0x2e9b34,_0xf37af4={'color':_0x37e7b3,'noColor':_0x36d5ff};if(_0x107fe8===_0x5c02af(0x16e)){if(shouldUseColor(_0xf37af4))return colorizeJSON(_0x4f5994,_0xf37af4);return JSON[_0x5c02af(0x192)](_0x4f5994,null,0x2);}else{if(_0x107fe8===_0x5c02af(0x1b2)){if(shouldUseColor(_0xf37af4))return colorizeJSONCompact(_0x4f5994,_0xf37af4);return JSON[_0x5c02af(0x192)](_0x4f5994);}else{if(_0x107fe8===_0x5c02af(0x1b5))return Object[_0x5c02af(0x1ba)](_0x4f5994)[_0x5c02af(0x1b9)](([_0x1822e7,_0x1414f0])=>_0x1822e7+'\x09'+_0x1414f0)[_0x5c02af(0x1b1)]('\x0a');else{const _0xbd7b60=Object['entries'](_0x4f5994);if(_0xbd7b60['length']===0x0)return _0x5c02af(0x188);const _0x50edaa=_0x4f5994['debug'],_0x5d58ce=_0x4f5994['query'],_0x107b59=_0x4f5994[_0x5c02af(0x17d)],_0x3b0e27=_0x4f5994[_0x5c02af(0x170)],_0x6b4f3f=_0x5d58ce?typeof _0x5d58ce===_0x5c02af(0x193)?_0x5d58ce:JSON[_0x5c02af(0x192)](_0x5d58ce,null,0x2):undefined,_0x5bd916=_0x107b59&&Object['keys'](_0x107b59)[_0x5c02af(0x1a0)]>0x0?JSON[_0x5c02af(0x192)](_0x107b59,null,0x2):undefined,_0x5ef1a0=_0x3b0e27&&Object[_0x5c02af(0x1a7)](_0x3b0e27)['length']>0x0?JSON[_0x5c02af(0x192)](_0x3b0e27,null,0x2):undefined,_0x38d64b=_0xbd7b60['filter'](([_0xcd6fd4])=>_0xcd6fd4!==_0x5c02af(0x18f)&&_0xcd6fd4!==_0x5c02af(0x1a5)&&_0xcd6fd4!==_0x5c02af(0x17d)&&_0xcd6fd4!==_0x5c02af(0x170)),_0x24f0e1=Math[_0x5c02af(0x18e)](..._0x38d64b[_0x5c02af(0x1b9)](([_0x494064])=>_0x494064[_0x5c02af(0x1a0)])),_0x5c0c74=Math['max'](..._0x38d64b[_0x5c02af(0x1b9)](([,_0x668b4b])=>{const _0x2fcf23=_0x5c02af;try{const _0x2622cc=_0x668b4b===null||_0x668b4b===undefined?'':typeof _0x668b4b===_0x2fcf23(0x172)?JSON[_0x2fcf23(0x192)](_0x668b4b):String(_0x668b4b),_0x5b35ee=_0x2622cc[_0x2fcf23(0x194)]('\x0a');return Math['max'](..._0x5b35ee[_0x2fcf23(0x1b9)](_0xa15948=>_0xa15948[_0x2fcf23(0x1a0)]),0x0);}catch{return 0x0;}}),0x14),_0x18cc2b=[];_0x18cc2b[_0x5c02af(0x17f)](colorBorder('┌─'+'─'[_0x5c02af(0x190)](_0x24f0e1)+_0x5c02af(0x1af)+'─'[_0x5c02af(0x190)](_0x5c0c74)+'─┐',_0xf37af4)),_0x38d64b[_0x5c02af(0x185)](([_0x3603d8,_0x1301cd])=>{const _0x5218ba=_0x5c02af;let _0x1209f7;try{_0x1209f7=_0x1301cd===null||_0x1301cd===undefined?'':typeof _0x1301cd===_0x5218ba(0x172)?JSON[_0x5218ba(0x192)](_0x1301cd):String(_0x1301cd);}catch{_0x1209f7=_0x5218ba(0x189);}const _0x1e7839=_0x3603d8['padEnd'](_0x24f0e1),_0x5c0e6a=_0x1209f7['split']('\x0a');_0x5c0e6a[_0x5218ba(0x185)]((_0xe0919b,_0x23fd72)=>{const _0x4a4a0a=_0x5218ba,_0x58c423=colorBorder('│',_0xf37af4);_0x23fd72===0x0?_0x18cc2b[_0x4a4a0a(0x17f)](_0x58c423+'\x20'+_0x1e7839+'\x20'+_0x58c423+'\x20'+_0xe0919b[_0x4a4a0a(0x17b)](_0x5c0c74)+'\x20'+_0x58c423):_0x18cc2b[_0x4a4a0a(0x17f)](_0x58c423+'\x20'+'\x20'[_0x4a4a0a(0x190)](_0x24f0e1)+'\x20'+_0x58c423+'\x20'+_0xe0919b[_0x4a4a0a(0x17b)](_0x5c0c74)+'\x20'+_0x58c423);});}),_0x18cc2b[_0x5c02af(0x17f)](colorBorder('└─'+'─'[_0x5c02af(0x190)](_0x24f0e1)+_0x5c02af(0x1b6)+'─'['repeat'](_0x5c0c74)+'─┘',_0xf37af4));_0x6b4f3f&&(_0x18cc2b['push'](''),_0x18cc2b[_0x5c02af(0x17f)](String(a56_0x2289b7[_0x5c02af(0x195)]['bold'](_0x5c02af(0x18b)))),_0x18cc2b[_0x5c02af(0x17f)](_0x6b4f3f));_0x5bd916&&(_0x18cc2b['push'](''),_0x18cc2b['push'](String(a56_0x2289b7[_0x5c02af(0x199)]['bold'](_0x5c02af(0x19d)))),_0x18cc2b[_0x5c02af(0x17f)](_0x5bd916));_0x5ef1a0&&(_0x18cc2b['push'](''),_0x18cc2b[_0x5c02af(0x17f)](String(a56_0x2289b7[_0x5c02af(0x184)][_0x5c02af(0x183)](_0x5c02af(0x197)))),_0x18cc2b[_0x5c02af(0x17f)](_0x5ef1a0));if(_0x50edaa){if(_0x50edaa[_0x5c02af(0x19c)]){_0x18cc2b[_0x5c02af(0x17f)](''),_0x18cc2b[_0x5c02af(0x17f)](String(a56_0x2289b7[_0x5c02af(0x187)][_0x5c02af(0x183)](_0x5c02af(0x175))));const _0x171244=_0x50edaa[_0x5c02af(0x19c)][_0x5c02af(0x194)]('\x0a');_0x171244[_0x5c02af(0x185)](_0x37df6e=>{const _0x11efd6=_0x5c02af;_0x37df6e['trim']()&&_0x18cc2b[_0x11efd6(0x17f)](_0x37df6e);});}if(_0x50edaa[_0x5c02af(0x1a3)]){_0x18cc2b['push'](''),_0x18cc2b[_0x5c02af(0x17f)](String(a56_0x2289b7[_0x5c02af(0x171)][_0x5c02af(0x183)](_0x5c02af(0x1aa))));const _0x402485=_0x50edaa[_0x5c02af(0x1a3)][_0x5c02af(0x194)]('\x0a');_0x402485[_0x5c02af(0x185)](_0x2de686=>{const _0x56b897=_0x5c02af;_0x2de686[_0x56b897(0x186)]()&&_0x18cc2b[_0x56b897(0x17f)](_0x2de686);});}}return _0x18cc2b[_0x5c02af(0x1b1)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x595486,_0x254308){const _0x56307e=a56_0x4dd4;if(_0x254308[_0x56307e(0x174)]===_0x56307e(0x181)){await handleSDKOutput([_0x595486],_0x254308);return;}const _0x4a5986=resolveOutputOptions(_0x254308),_0x55a8c9=await formatSingleObject(_0x595486,_0x4a5986);await writeOutput(_0x55a8c9,_0x4a5986[_0x56307e(0x17e)]||undefined,_0x4a5986[_0x56307e(0x174)]);}
|
|
1
|
+
(function(_0x5618e4,_0xaea572){const _0x8981cd=a56_0x3663,_0x277f83=_0x5618e4();while(!![]){try{const _0x3f0e7d=parseInt(_0x8981cd(0x93))/0x1*(parseInt(_0x8981cd(0xc0))/0x2)+-parseInt(_0x8981cd(0xb9))/0x3+parseInt(_0x8981cd(0xb3))/0x4*(-parseInt(_0x8981cd(0xa4))/0x5)+-parseInt(_0x8981cd(0xc1))/0x6+parseInt(_0x8981cd(0x9d))/0x7*(-parseInt(_0x8981cd(0xa0))/0x8)+-parseInt(_0x8981cd(0xb2))/0x9*(parseInt(_0x8981cd(0xbb))/0xa)+parseInt(_0x8981cd(0x91))/0xb;if(_0x3f0e7d===_0xaea572)break;else _0x277f83['push'](_0x277f83['shift']());}catch(_0x44b52b){_0x277f83['push'](_0x277f83['shift']());}}}(a56_0xbfa4,0x67841));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';function a56_0x3663(_0x3aebf4,_0x52ead9){_0x3aebf4=_0x3aebf4-0x8d;const _0xbfa40=a56_0xbfa4();let _0x366382=_0xbfa40[_0x3aebf4];return _0x366382;}import a56_0x5babab from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x35ee6e){const _0x8d2e9a=a56_0x3663;return _0x35ee6e['format']===_0x8d2e9a(0xa3)||_0x35ee6e[_0x8d2e9a(0x9e)]==='jsonl'||_0x35ee6e[_0x8d2e9a(0x9e)]===_0x8d2e9a(0xbe)||_0x35ee6e['format']===_0x8d2e9a(0xb7)||_0x35ee6e['json']===!![]||_0x35ee6e[_0x8d2e9a(0xce)]===!![]||_0x35ee6e[_0x8d2e9a(0xbe)]===!![]||_0x35ee6e[_0x8d2e9a(0xb7)]===!![];}export function parseOutputOptions(_0x42dc04){const _0x20f920=a56_0x3663;return{'format':_0x42dc04[_0x20f920(0x9e)]||_0x20f920(0xb7),'output':_0x42dc04[_0x20f920(0xcb)]||'','limit':_0x42dc04['limit'],'limitStructuredFormats':_0x42dc04[_0x20f920(0xd5)],'color':_0x42dc04[_0x20f920(0xa6)],'noColor':_0x42dc04['noColor']};}function convertSDKResultToQueryResult(_0x4f8f4d){const _0x1af600=a56_0x3663,_0x502e26=[];if(_0x4f8f4d[_0x1af600(0xa9)]>0x0){const _0x3b6af1=_0x4f8f4d[0x0];for(const [_0x10bb11,_0x1b61c2]of Object['entries'](_0x3b6af1)){let _0x9e1028=_0x1af600(0xc2);if(typeof _0x1b61c2==='number')_0x9e1028=Number[_0x1af600(0xd3)](_0x1b61c2)?_0x1af600(0xc8):_0x1af600(0xd7);else{if(typeof _0x1b61c2===_0x1af600(0xac))_0x9e1028='boolean';else _0x1b61c2===null&&(_0x9e1028=_0x1af600(0xc2));}_0x502e26[_0x1af600(0x96)]({'name':_0x10bb11,'type':_0x9e1028});}}return{'queryId':_0x1af600(0x90),'columns':_0x502e26,'data':_0x4f8f4d,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4f8f4d[_0x1af600(0xa9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2556c8,_0x59dcb7){const _0x4b06f7=convertSDKResultToQueryResult(_0x2556c8);return formatQueryOutput(_0x4b06f7,_0x59dcb7);}export async function formatQueryOutput(_0x148b1d,_0x73b2f2){const _0x2051b0=a56_0x3663,{format:_0x269399,limit:_0x23c94c,output:_0xb454af,color:_0x8a947e,noColor:_0x509bf0,limitStructuredFormats:_0x59848c}=_0x73b2f2,_0x3356cd=Boolean(_0xb454af)&&!_0x8a947e,_0x534ba2={'color':_0x8a947e,'noColor':_0x509bf0||_0x3356cd};if(_0x269399===_0x2051b0(0xb7)){const _0x120a2c=shouldUseLess(_0x269399,_0xb454af);return formatAsTable(_0x148b1d,_0x23c94c,_0x120a2c,_0x534ba2);}const _0x1a242b=_0x59848c&&Number[_0x2051b0(0xcf)](_0x23c94c)&&_0x148b1d[_0x2051b0(0xad)][_0x2051b0(0xa9)]>_0x23c94c?{..._0x148b1d,'data':_0x148b1d[_0x2051b0(0xad)][_0x2051b0(0xaf)](0x0,_0x23c94c)}:_0x148b1d;if(_0x269399===_0x2051b0(0xa3))return formatAsJSON(_0x1a242b,_0x534ba2);else return _0x269399==='jsonl'?formatAsJSONL(_0x1a242b,_0x534ba2):formatQueryResult(_0x1a242b,_0x269399);}function shouldUseLess(_0x2a5207,_0x1fcf58){const _0x351d6f=a56_0x3663;return(_0x2a5207===_0x351d6f(0xb7)||_0x2a5207===_0x351d6f(0xc6))&&process[_0x351d6f(0xb5)][_0x351d6f(0xa1)]&&!_0x1fcf58;}export function resolveOutputOptions(_0x22fbb5){const _0xf1688d=a56_0x3663,_0x120ddd=_0x22fbb5[_0xf1688d(0xcb)]||'',_0x3ca5dd=resolveOutputFormat(_0x22fbb5['format'],_0x120ddd,_0xf1688d(0xb7));let _0x42237d=typeof _0x22fbb5[_0xf1688d(0xa5)]===_0xf1688d(0xc9)?_0x22fbb5['limit']:parseInt(_0x22fbb5[_0xf1688d(0xa5)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x22fbb5[_0xf1688d(0xa5)]===undefined&&shouldUseLess(_0x3ca5dd,_0x120ddd)&&(_0x42237d=Infinity),{'format':_0x3ca5dd,'output':_0x120ddd,'limit':_0x42237d,'limitStructuredFormats':_0x22fbb5[_0xf1688d(0xd5)],'color':_0x22fbb5[_0xf1688d(0xa6)],'noColor':_0x22fbb5[_0xf1688d(0xa2)]};}export function writeOutput(_0x1f5b70,_0x5da70a,_0xbaf941){const _0x84c103=a56_0x3663;return _0x5da70a?(writeFileSync(_0x5da70a,_0x1f5b70),console[_0x84c103(0xd8)](_0x84c103(0xa7)+_0x5da70a),Promise['resolve']()):shouldUseLess(_0xbaf941||'','')?new Promise(_0x431529=>{const _0x15dc37=_0x84c103,_0x43ac3c=spawn(_0x15dc37(0xd9),[_0x15dc37(0xbd)],{'stdio':['pipe',_0x15dc37(0xd6),_0x15dc37(0xd6)]});let _0x246f93=![];_0x43ac3c['on']('error',()=>{const _0x41bec2=_0x15dc37;!_0x246f93&&(_0x246f93=!![],console[_0x41bec2(0xb8)](_0x1f5b70),_0x431529());}),_0x43ac3c['on'](_0x15dc37(0x9b),()=>{!_0x246f93&&(_0x246f93=!![],_0x431529());}),_0x43ac3c['on'](_0x15dc37(0xc7),()=>{const _0x23bd34=_0x15dc37;!_0x246f93&&_0x43ac3c['stdin']&&(_0x43ac3c[_0x23bd34(0x9c)]['on'](_0x23bd34(0xd8),()=>{}),_0x43ac3c['stdin'][_0x23bd34(0xd1)](_0x1f5b70),_0x43ac3c[_0x23bd34(0x9c)]['end']());}),!_0x43ac3c['stdin']&&(!_0x246f93&&(_0x246f93=!![],console[_0x15dc37(0xb8)](_0x1f5b70),_0x431529()));}):(console[_0x84c103(0xb8)](_0x1f5b70),Promise[_0x84c103(0x8f)]());}export async function handleSDKOutput(_0x15392e,_0x42d06e){const _0x36dd74=a56_0x3663,_0x54347c=resolveOutputOptions(_0x42d06e),_0x55bcdd=await formatSDKOutput(_0x15392e,_0x54347c);await writeOutput(_0x55bcdd,_0x54347c[_0x36dd74(0xcb)]||undefined,_0x54347c[_0x36dd74(0x9e)]);}export async function handleQueryOutput(_0x37cf51,_0x2a360b){const _0x1ecdb8=a56_0x3663,_0x53106b=resolveOutputOptions(_0x2a360b),_0x85350c=await formatQueryOutput(_0x37cf51,_0x53106b);await writeOutput(_0x85350c,_0x53106b[_0x1ecdb8(0xcb)]||undefined,_0x53106b[_0x1ecdb8(0x9e)]);}function a56_0xbfa4(){const _0x3aca5e=['─┴─','table','log','1386558AIGnla','[params]','30TFBnjG','filter','-FXRSn','tsv','cyan','2sGNAvY','4686516PQtptx','varchar','debug','─┬─','cmdout','list','spawn','bigint','number','entries','output','[Object]','blue','jsonl','isFinite','query','write','magenta','isInteger','trim','limitStructuredFormats','inherit','double','error','less','repeat','string','resolve','sdk-result','20269733SSVtIT','object','441293JxVTap','keys','bold','push','rule','[error]','split','forEach','close','stdin','42wmUXHV','format','stderr','81744YuDBJo','isTTY','noColor','json','308110sQEvvE','limit','color','Results\x20saved\x20to\x20','[logs]','length','stringify','map','boolean','data','red','slice','params','padEnd','741915VueuAz','20SkMzzX','max','stdout'];a56_0xbfa4=function(){return _0x3aca5e;};return a56_0xbfa4();}async function formatSingleObject(_0x360309,_0x554280){const _0x357f85=a56_0x3663,{format:_0x4d3b21,color:_0x34b718,noColor:_0x164824}=_0x554280,_0x43e337={'color':_0x34b718,'noColor':_0x164824};if(_0x4d3b21===_0x357f85(0xa3)){if(shouldUseColor(_0x43e337))return colorizeJSON(_0x360309,_0x43e337);return JSON[_0x357f85(0xaa)](_0x360309,null,0x2);}else{if(_0x4d3b21===_0x357f85(0xce)){if(shouldUseColor(_0x43e337))return colorizeJSONCompact(_0x360309,_0x43e337);return JSON[_0x357f85(0xaa)](_0x360309);}else{if(_0x4d3b21===_0x357f85(0xbe))return Object[_0x357f85(0xca)](_0x360309)[_0x357f85(0xab)](([_0x2e29c4,_0x18a687])=>_0x2e29c4+'\x09'+_0x18a687)['join']('\x0a');else{const _0x68fb91=Object[_0x357f85(0xca)](_0x360309);if(_0x68fb91[_0x357f85(0xa9)]===0x0)return'No\x20data';const _0x384523=_0x360309[_0x357f85(0xc3)],_0x1517d3=_0x360309[_0x357f85(0xd0)],_0x47cdcb=_0x360309[_0x357f85(0xb0)],_0xa2a8c9=_0x360309[_0x357f85(0x97)],_0x2f5706=_0x1517d3?typeof _0x1517d3===_0x357f85(0x8e)?_0x1517d3:JSON['stringify'](_0x1517d3,null,0x2):undefined,_0x1be428=_0x47cdcb&&Object[_0x357f85(0x94)](_0x47cdcb)[_0x357f85(0xa9)]>0x0?JSON[_0x357f85(0xaa)](_0x47cdcb,null,0x2):undefined,_0x51ce06=_0xa2a8c9&&Object[_0x357f85(0x94)](_0xa2a8c9)[_0x357f85(0xa9)]>0x0?JSON[_0x357f85(0xaa)](_0xa2a8c9,null,0x2):undefined,_0x71c480=_0x68fb91[_0x357f85(0xbc)](([_0x2f7d15])=>_0x2f7d15!==_0x357f85(0xc3)&&_0x2f7d15!=='query'&&_0x2f7d15!==_0x357f85(0xb0)&&_0x2f7d15!==_0x357f85(0x97)),_0x1eb905=Math[_0x357f85(0xb4)](..._0x71c480['map'](([_0x10df30])=>_0x10df30[_0x357f85(0xa9)])),_0x5b5f7a=Math[_0x357f85(0xb4)](..._0x71c480['map'](([,_0x42a589])=>{const _0x21c939=_0x357f85;try{const _0x10f0d4=_0x42a589===null||_0x42a589===undefined?'':typeof _0x42a589===_0x21c939(0x92)?JSON[_0x21c939(0xaa)](_0x42a589):String(_0x42a589),_0x2f945=_0x10f0d4['split']('\x0a');return Math[_0x21c939(0xb4)](..._0x2f945[_0x21c939(0xab)](_0x4c3b61=>_0x4c3b61[_0x21c939(0xa9)]),0x0);}catch{return 0x0;}}),0x14),_0x5b1fc2=[];_0x5b1fc2['push'](colorBorder('┌─'+'─'[_0x357f85(0x8d)](_0x1eb905)+_0x357f85(0xc4)+'─'[_0x357f85(0x8d)](_0x5b5f7a)+'─┐',_0x43e337)),_0x71c480[_0x357f85(0x9a)](([_0x2b366b,_0x3e5571])=>{const _0x14e35b=_0x357f85;let _0x5e7cbc;try{_0x5e7cbc=_0x3e5571===null||_0x3e5571===undefined?'':typeof _0x3e5571===_0x14e35b(0x92)?JSON[_0x14e35b(0xaa)](_0x3e5571):String(_0x3e5571);}catch{_0x5e7cbc=_0x14e35b(0xcc);}const _0x493e74=_0x2b366b['padEnd'](_0x1eb905),_0x396800=_0x5e7cbc[_0x14e35b(0x99)]('\x0a');_0x396800[_0x14e35b(0x9a)]((_0x10424d,_0x52c106)=>{const _0x48ae22=_0x14e35b,_0x592110=colorBorder('│',_0x43e337);_0x52c106===0x0?_0x5b1fc2[_0x48ae22(0x96)](_0x592110+'\x20'+_0x493e74+'\x20'+_0x592110+'\x20'+_0x10424d[_0x48ae22(0xb1)](_0x5b5f7a)+'\x20'+_0x592110):_0x5b1fc2['push'](_0x592110+'\x20'+'\x20'[_0x48ae22(0x8d)](_0x1eb905)+'\x20'+_0x592110+'\x20'+_0x10424d[_0x48ae22(0xb1)](_0x5b5f7a)+'\x20'+_0x592110);});}),_0x5b1fc2[_0x357f85(0x96)](colorBorder('└─'+'─'[_0x357f85(0x8d)](_0x1eb905)+_0x357f85(0xb6)+'─'[_0x357f85(0x8d)](_0x5b5f7a)+'─┘',_0x43e337));_0x2f5706&&(_0x5b1fc2['push'](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab['yellow']['bold']('[query]'))),_0x5b1fc2[_0x357f85(0x96)](_0x2f5706));_0x1be428&&(_0x5b1fc2['push'](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xcd)][_0x357f85(0x95)](_0x357f85(0xba)))),_0x5b1fc2[_0x357f85(0x96)](_0x1be428));_0x51ce06&&(_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xd2)]['bold']('[rule]'))),_0x5b1fc2[_0x357f85(0x96)](_0x51ce06));if(_0x384523){if(_0x384523['stderr']){_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xae)][_0x357f85(0x95)](_0x357f85(0x98))));const _0xf7601e=_0x384523[_0x357f85(0x9f)][_0x357f85(0x99)]('\x0a');_0xf7601e[_0x357f85(0x9a)](_0x1d18d7=>{const _0x22e8f2=_0x357f85;_0x1d18d7[_0x22e8f2(0xd4)]()&&_0x5b1fc2['push'](_0x1d18d7);});}if(_0x384523[_0x357f85(0xc5)]){_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xbf)][_0x357f85(0x95)](_0x357f85(0xa8))));const _0x4b4970=_0x384523['cmdout'][_0x357f85(0x99)]('\x0a');_0x4b4970[_0x357f85(0x9a)](_0x59c3dd=>{const _0x1d4889=_0x357f85;_0x59c3dd['trim']()&&_0x5b1fc2[_0x1d4889(0x96)](_0x59c3dd);});}}return _0x5b1fc2['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x5b91c6,_0x3721c5){const _0x1b5349=a56_0x3663;if(_0x3721c5[_0x1b5349(0x9e)]===_0x1b5349(0xb7)){await handleSDKOutput([_0x5b91c6],_0x3721c5);return;}const _0x4ab00f=resolveOutputOptions(_0x3721c5),_0x58eae8=await formatSingleObject(_0x5b91c6,_0x4ab00f);await writeOutput(_0x58eae8,_0x4ab00f[_0x1b5349(0xcb)]||undefined,_0x4ab00f[_0x1b5349(0x9e)]);}
|