@treasuredata/tdx 2026.3.54 → 2026.3.55
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +27 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +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.d.ts +10 -0
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +61 -3
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +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/agent/types/agent-def.d.ts +43 -0
- package/dist/sdk/agent/types/agent-def.d.ts.map +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.d.ts +73 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +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.d.ts +28 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +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.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +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.d.ts +2 -2
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +158 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workflow.d.ts +26 -0
- package/dist/sdk/types/workflow.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +22 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +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/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.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.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x54edc0=a54_0xccde;(function(_0x879e37,_0x2ecedf){const _0x3774dd=a54_0xccde,_0x52ee58=_0x879e37();while(!![]){try{const _0xe8d569=parseInt(_0x3774dd(0x149))/0x1*(-parseInt(_0x3774dd(0x19a))/0x2)+parseInt(_0x3774dd(0x27e))/0x3+parseInt(_0x3774dd(0x134))/0x4*(parseInt(_0x3774dd(0x280))/0x5)+-parseInt(_0x3774dd(0x299))/0x6*(parseInt(_0x3774dd(0x2b6))/0x7)+-parseInt(_0x3774dd(0x2bf))/0x8*(parseInt(_0x3774dd(0x2b2))/0x9)+parseInt(_0x3774dd(0x2ae))/0xa*(-parseInt(_0x3774dd(0x197))/0xb)+parseInt(_0x3774dd(0x18e))/0xc*(parseInt(_0x3774dd(0x13f))/0xd);if(_0xe8d569===_0x2ecedf)break;else _0x52ee58['push'](_0x52ee58['shift']());}catch(_0xd22bc){_0x52ee58['push'](_0x52ee58['shift']());}}}(a54_0x11ab,0xdb0f3));import a54_0x26125e from'chalk';function a54_0xccde(_0x5aebd0,_0x5a266d){_0x5aebd0=_0x5aebd0-0x11c;const _0x11ab96=a54_0x11ab();let _0xccded9=_0x11ab96[_0x5aebd0];return _0xccded9;}import{existsSync}from'fs';import a54_0x1db018 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x1aee3d from'prompts';function getAttemptStatusDisplay(_0x16f32b){const _0x300276=a54_0xccde;if(!_0x16f32b)return{'icon':'⏳','text':''};const {done:_0x562d4c,success:_0x1b7f6b,cancelRequested:_0x5ddda5}=_0x16f32b;if(!_0x562d4c)return _0x5ddda5?{'icon':'🛑','text':a54_0x26125e[_0x300276(0x21c)](_0x300276(0x17d))}:{'icon':'🔄','text':a54_0x26125e['blue'](_0x300276(0x187))};if(_0x1b7f6b)return{'icon':'✅','text':a54_0x26125e[_0x300276(0x208)](_0x300276(0x2bb))};return{'icon':'❌','text':a54_0x26125e[_0x300276(0x16f)](_0x300276(0x279))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x54edc0(0x2bd)](_0xba37e5,_0x4b0a8b,_0x109fce=0x0){const _0x963863=a54_0x54edc0;return _0xba37e5[_0x109fce]||_0x4b0a8b[_0x963863(0x198)];}['requireProject'](_0x18aec7,_0x12d0bd,_0x496b72=0x0){const _0x4154c4=a54_0x54edc0,_0x87a9a0=this[_0x4154c4(0x2bd)](_0x18aec7,_0x12d0bd,_0x496b72);if(!_0x87a9a0)return console[_0x4154c4(0x279)](a54_0x26125e['red'](_0x4154c4(0x14e)),'Project\x20name\x20is\x20required'),console['error'](a54_0x26125e['dim'](_0x4154c4(0x1eb))),null;return _0x87a9a0;}[a54_0x54edc0(0x124)](_0x19fb18,_0x1a664f){const _0x3f6029=a54_0x54edc0;if(_0x19fb18[0x0]){const _0x5d5194=_0x19fb18[0x0][_0x3f6029(0x210)]('.');if(_0x5d5194[_0x3f6029(0x274)]===0x1)return{'projectName':_0x5d5194[0x0],'workflowName':undefined};else return _0x5d5194['length']===0x2?{'projectName':_0x5d5194[0x0],'workflowName':_0x5d5194[0x1]}:(console['error'](a54_0x26125e[_0x3f6029(0x16f)](_0x3f6029(0x14e)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x1a664f[_0x3f6029(0x198)],'workflowName':undefined};}[a54_0x54edc0(0x1a1)](_0x249237,_0x585c6d,_0x55da15=0x0){const _0x1df6f8=a54_0x54edc0;if(_0x249237[_0x55da15])return _0x249237[_0x55da15];if(_0x585c6d[_0x1df6f8(0x198)]){const _0x2aab6c=a54_0x1db018['join'](process['cwd'](),_0x1df6f8(0x189),_0x585c6d['workflowProject']);if(existsSync(a54_0x1db018[_0x1df6f8(0x2a6)](_0x2aab6c,'tdx.json')))return _0x2aab6c;}return undefined;}async[a54_0x54edc0(0x140)](_0x43b851,_0x376d6d,_0x891256){const _0x474518=a54_0x54edc0;try{const _0x1f1c68=await _0x43b851['workflow'][_0x474518(0x189)](_0x376d6d,{'limit':0x1});if(_0x1f1c68[_0x474518(0x274)]>0x0){const _0x570d0d=_0x1f1c68[0x0]['id'],_0x44140e=getWorkflowUrl(_0x891256,_0x570d0d);console['error'](_0x474518(0x15e)+a54_0x26125e['cyan'](_0x44140e));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:use';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1b7);async[a54_0x54edc0(0x256)](_0x325fa8){const _0x567bdf=a54_0x54edc0,{options:_0x5ba579,args:_0x4b8548,tdx:_0x11dcae}=_0x325fa8,_0x512c72=_0x4b8548[0x0],_0x39f81a=_0x5ba579[_0x567bdf(0x23d)];if(_0x39f81a)return saveSessionContext({'workflow_project':undefined},_0x5ba579[_0x567bdf(0x27d)]),console[_0x567bdf(0x25d)](a54_0x26125e['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x512c72)return console['error'](a54_0x26125e[_0x567bdf(0x16f)](_0x567bdf(0x14e)),_0x567bdf(0x2c0)),console[_0x567bdf(0x279)](a54_0x26125e[_0x567bdf(0x13e)](_0x567bdf(0x2c8))),console[_0x567bdf(0x279)](a54_0x26125e[_0x567bdf(0x13e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x30621b=await withSpinner(_0x567bdf(0x1fd)+_0x512c72+_0x567bdf(0x216),()=>_0x11dcae[_0x567bdf(0x169)][_0x567bdf(0x192)](_0x512c72),{'verbose':_0x5ba579[_0x567bdf(0x1f9)]}),{name:_0x322ae8}=_0x30621b['data'];return saveSessionContext({'workflow_project':_0x322ae8},_0x5ba579[_0x567bdf(0x27d)]),console[_0x567bdf(0x25d)](a54_0x26125e[_0x567bdf(0x208)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x26125e['cyan'](_0x322ae8))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:projects';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x25f);async['execute'](_0x5de221){const _0x1460ef=a54_0x54edc0,{options:_0x3d3e54,args:_0x5a72d6,tdx:_0x3f4742}=_0x5de221,_0x569776=_0x5a72d6[0x0];_0x3d3e54[_0x1460ef(0x1f9)]&&_0x569776&&console[_0x1460ef(0x279)](_0x1460ef(0x1ac)+_0x569776);const _0x27fab8=await withSpinner(_0x1460ef(0x138),()=>_0x3f4742[_0x1460ef(0x169)][_0x1460ef(0x262)](_0x569776,{'limit':_0x3d3e54[_0x1460ef(0x21e)]}),{'verbose':_0x3d3e54['verbose']});let _0x3977ea=_0x27fab8[_0x1460ef(0x199)];_0x3977ea[_0x1460ef(0x1f8)]((_0x4d0658,_0x4f7518)=>_0x4d0658['name'][_0x1460ef(0x267)](_0x4f7518['name']));const _0x408c03=_0x3d3e54[_0x1460ef(0x21e)]||0x64,_0x3224c3=_0x3977ea[_0x1460ef(0x274)]>=_0x408c03?a54_0x26125e[_0x1460ef(0x13e)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1460ef(0x279)](_0x1460ef(0x272)+_0x3977ea[_0x1460ef(0x274)]+_0x1460ef(0x243)+(_0x3977ea['length']!==0x1?'s':'')+_0x3224c3);if(_0x3d3e54['format']===_0x1460ef(0x11d)||_0x3d3e54[_0x1460ef(0x185)]===_0x1460ef(0x245)||_0x3d3e54[_0x1460ef(0x185)]==='table')await handleSDKOutput(_0x3977ea,_0x3d3e54);else{if(_0x3977ea['length']===0x0)_0x569776?console[_0x1460ef(0x25d)](_0x1460ef(0x273)+_0x569776):console[_0x1460ef(0x25d)]('No\x20workflow\x20projects\x20found');else{const _0x4e7bc3=_0x3977ea[_0x1460ef(0x136)](_0x4ffa30=>{const _0x575aec=_0x1460ef,_0x55c8ec=_0x4ffa30['metadata']?.['some'](_0x2d398d=>_0x2d398d[_0x575aec(0x254)]===_0x575aec(0x23f)),_0x19e6ef=_0x55c8ec?a54_0x26125e[_0x575aec(0x13e)](_0x575aec(0x230)):'';return _0x575aec(0x2b1)+_0x4ffa30[_0x575aec(0x231)]+_0x19e6ef;});await writeOutput(_0x4e7bc3['join']('\x0a'),_0x3d3e54[_0x1460ef(0x2c5)],_0x1460ef(0x222));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:workflows';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x181);async[a54_0x54edc0(0x256)](_0x2855f3){const _0x326b34=a54_0x54edc0,{options:_0x451172,args:_0x5a6fd7,tdx:_0x46edac}=_0x2855f3,_0x26c44d=this['resolveProject'](_0x5a6fd7,_0x451172);_0x451172[_0x326b34(0x1f9)]&&_0x26c44d&&console['error']('Project\x20filter:\x20'+_0x26c44d);const _0x2a756a=await withSpinner(_0x326b34(0x295),()=>_0x46edac[_0x326b34(0x169)]['workflows'](_0x26c44d,{'limit':_0x451172['limit']}),{'verbose':_0x451172['verbose']});let _0x130b00=_0x2a756a[_0x326b34(0x199)];_0x130b00[_0x326b34(0x1f8)]((_0x2332dc,_0x25c143)=>{const _0x228061=_0x326b34,_0xc8176=_0x2332dc[_0x228061(0x231)]['localeCompare'](_0x25c143[_0x228061(0x231)]);if(_0xc8176!==0x0)return _0xc8176;return(_0x2332dc[_0x228061(0x21d)]?.[_0x228061(0x231)]||'')[_0x228061(0x267)](_0x25c143['project']?.[_0x228061(0x231)]||'');});const _0x2b748c=_0x451172[_0x326b34(0x21e)]||0x64,_0x1b5a3f=_0x130b00[_0x326b34(0x274)]>=_0x2b748c?a54_0x26125e[_0x326b34(0x13e)](_0x326b34(0x24b)):'';console[_0x326b34(0x279)](_0x326b34(0x272)+_0x130b00['length']+_0x326b34(0x238)+(_0x130b00['length']!==0x1?'s':'')+_0x1b5a3f);if(_0x451172[_0x326b34(0x185)]==='json'||_0x451172['format']===_0x326b34(0x245)||_0x451172[_0x326b34(0x185)]===_0x326b34(0x1c2))await handleSDKOutput(_0x130b00,_0x451172);else{if(_0x130b00[_0x326b34(0x274)]===0x0)_0x26c44d?console[_0x326b34(0x25d)](_0x326b34(0x294)+_0x26c44d):console[_0x326b34(0x25d)]('No\x20workflows\x20found');else{const _0x2789ba=_0x451172[_0x326b34(0x232)],_0x41f0a1=_0x130b00['map'](_0x47616c=>{const _0x211c2a=_0x326b34,_0x1c7724=a54_0x26125e[_0x211c2a(0x13e)]('#'+_0x47616c['id']),_0x2b237a=hyperlink(_0x1c7724,getWorkflowUrl(_0x2789ba,_0x47616c['id'])),_0x343c0f=_0x47616c['project']?.[_0x211c2a(0x231)]?a54_0x26125e[_0x211c2a(0x13e)]('\x20('+_0x47616c[_0x211c2a(0x21d)][_0x211c2a(0x231)]+')'):'';return _0x211c2a(0x288)+_0x2b237a+'\x20'+_0x47616c[_0x211c2a(0x231)]+_0x343c0f;});await writeOutput(_0x41f0a1[_0x326b34(0x2a6)]('\x0a'),_0x451172['output'],_0x326b34(0x222));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:sessions';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x15b);async[a54_0x54edc0(0x256)](_0x3c65aa){const _0x5e4ba4=a54_0x54edc0,{options:_0x4e4cdb,args:_0x1c00e6,tdx:_0x8f4fde}=_0x3c65aa,_0x4d548a=this[_0x5e4ba4(0x124)](_0x1c00e6,_0x4e4cdb);if(!_0x4d548a)return 0x1;const {projectName:_0x276c11,workflowName:_0x3de4da}=_0x4d548a;if(_0x4e4cdb[_0x5e4ba4(0x1f9)]){if(_0x276c11&&_0x3de4da)console[_0x5e4ba4(0x279)](_0x5e4ba4(0x2a7)+_0x276c11+'.'+_0x3de4da);else _0x276c11&&console[_0x5e4ba4(0x279)](_0x5e4ba4(0x22e)+_0x276c11);const _0x31e9a1=_0x4e4cdb[_0x5e4ba4(0x156)];_0x31e9a1&&console[_0x5e4ba4(0x279)](_0x5e4ba4(0x19b)+_0x31e9a1);}let _0x5b569b=0x28;if(process['stdout']['isTTY']&&!_0x4e4cdb[_0x5e4ba4(0x2c5)]&&!_0x4e4cdb[_0x5e4ba4(0x185)]){const _0x4ea3c0=process['stdout'][_0x5e4ba4(0x20b)]||0x28;_0x5b569b=Math[_0x5e4ba4(0x224)](0x14,Math[_0x5e4ba4(0x287)](_0x4ea3c0*0x2/0x3));}const _0x24a9e4=_0x4e4cdb[_0x5e4ba4(0x21e)]||_0x5b569b,_0x49db2b=await withSpinner(_0x5e4ba4(0x2a0),()=>_0x8f4fde[_0x5e4ba4(0x169)][_0x5e4ba4(0x173)]({'projectName':_0x276c11,'workflowName':_0x3de4da,'status':_0x4e4cdb['status'],'fromTime':_0x4e4cdb[_0x5e4ba4(0x213)],'toTime':_0x4e4cdb['to'],'limit':_0x24a9e4}),{'verbose':_0x4e4cdb[_0x5e4ba4(0x1f9)]}),_0x3a5f61=_0x49db2b['data'];_0x3a5f61[_0x5e4ba4(0x1f8)]((_0x1e806e,_0x21a2e6)=>{const _0x158ab3=_0x5e4ba4,_0x2ce1eb=_0x1e806e[_0x158ab3(0x2b9)]||'',_0x6210db=_0x21a2e6['sessionTime']||'';return _0x6210db[_0x158ab3(0x267)](_0x2ce1eb);});_0x3a5f61[_0x5e4ba4(0x274)]>=_0x24a9e4?console[_0x5e4ba4(0x279)]('✔\x20Showing\x20'+_0x3a5f61[_0x5e4ba4(0x274)]+'\x20sessions\x20'+a54_0x26125e[_0x5e4ba4(0x13e)](_0x5e4ba4(0x201))):console[_0x5e4ba4(0x279)](_0x5e4ba4(0x272)+_0x3a5f61[_0x5e4ba4(0x274)]+_0x5e4ba4(0x1ab)+(_0x3a5f61['length']!==0x1?'s':''));if(_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x11d)||_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x245)||_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x1c2))await handleSDKOutput(_0x3a5f61,_0x4e4cdb);else{if(!process[_0x5e4ba4(0x1ce)][_0x5e4ba4(0x170)]||_0x4e4cdb['output']){if(_0x3a5f61['length']===0x0){if(_0x276c11&&_0x3de4da)console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x13a)+_0x276c11+'.'+_0x3de4da);else _0x276c11?console[_0x5e4ba4(0x25d)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x276c11):console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x2ca));}else{const _0x487e7c=_0x4e4cdb[_0x5e4ba4(0x232)],_0xd5845b=this[_0x5e4ba4(0x1d6)](_0x3a5f61,_0x487e7c);_0x4e4cdb[_0x5e4ba4(0x2c5)]?await writeOutput(_0xd5845b,_0x4e4cdb[_0x5e4ba4(0x2c5)],_0x5e4ba4(0x222)):console['log'](_0xd5845b);}!_0x276c11&&(console[_0x5e4ba4(0x279)](''),console[_0x5e4ba4(0x279)](a54_0x26125e['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x5e4ba4(0x279)](a54_0x26125e['dim'](_0x5e4ba4(0x25a))+'or'+a54_0x26125e['dim'](_0x5e4ba4(0x20c))));}else{if(_0x3a5f61['length']===0x0){if(_0x276c11&&_0x3de4da)console['log'](_0x5e4ba4(0x13a)+_0x276c11+'.'+_0x3de4da);else _0x276c11?console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x21a)+_0x276c11):console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x2ca));}else await this[_0x5e4ba4(0x1d5)](_0x3a5f61,_0x3c65aa,_0x276c11);}}return 0x0;}[a54_0x54edc0(0x1d6)](_0x234331,_0x3d59f1){const _0x30797e=a54_0x54edc0,_0x47e623=[],_0x163d7b=new Map();let _0x35d81d=Infinity,_0xaa2251=-Infinity;for(const _0x505d7f of _0x234331){if(_0x505d7f['lastAttempt']?.['createdAt']){const _0x2595e5=new Date(_0x505d7f[_0x30797e(0x2b7)][_0x30797e(0x145)])[_0x30797e(0x284)](),_0x41ff5f=_0x505d7f[_0x30797e(0x2b7)][_0x30797e(0x16e)]?new Date(_0x505d7f['lastAttempt'][_0x30797e(0x16e)])['getTime']():Date[_0x30797e(0x2be)](),_0x5eccb8=_0x505d7f[_0x30797e(0x21d)]?.[_0x30797e(0x231)]||'(unknown)';!_0x163d7b[_0x30797e(0x2aa)](_0x5eccb8)&&_0x163d7b['set'](_0x5eccb8,[]),_0x163d7b['get'](_0x5eccb8)[_0x30797e(0x167)]({'session':_0x505d7f,'startTime':_0x2595e5,'endTime':_0x41ff5f,'duration':_0x41ff5f-_0x2595e5}),_0x35d81d=Math[_0x30797e(0x121)](_0x35d81d,_0x2595e5),_0xaa2251=Math[_0x30797e(0x224)](_0xaa2251,_0x41ff5f);}}if(_0x163d7b[_0x30797e(0x1da)]===0x0)return _0x30797e(0x241);const _0x2aedaa=process['stdout'][_0x30797e(0x2c3)]||0x78,_0x18a317=0x1e,_0x593c4d=0x32,_0x6dfdd8=0x4,_0x27a2f4=Math[_0x30797e(0x121)](_0x593c4d,Math['max'](_0x18a317,Math['floor'](_0x2aedaa*0.3))),_0x38f266=_0x2aedaa-_0x27a2f4-TIMELINE_CONFIG['GUTTER']-0x3-_0x6dfdd8,_0x1572af=_0xaa2251-_0x35d81d,_0xf99a2c=_0x1572af/_0x27a2f4,_0x4251af=renderTimeAxis({'startTime':_0x35d81d,'endTime':_0xaa2251,'durationMs':_0x1572af,'msPerChar':_0xf99a2c},_0x27a2f4),_0x23e5bf=[];for(const _0x272302 of _0x163d7b[_0x30797e(0x211)]()){_0x23e5bf[_0x30797e(0x167)](..._0x272302);}_0x23e5bf[_0x30797e(0x1f8)]((_0x32eea1,_0x4c71b8)=>_0x4c71b8[_0x30797e(0x1fa)]-_0x32eea1[_0x30797e(0x1fa)]);const _0x3b87b1=new Date(_0x35d81d),_0x909add=formatDate(_0x3b87b1),_0x2d9b82=_0x6dfdd8+TIMELINE_CONFIG[_0x30797e(0x162)]+TIMELINE_CONFIG[_0x30797e(0x1b1)]+_0x38f266,_0x5b47b0='\x20'[_0x30797e(0x258)](_0x2d9b82-_0x909add[_0x30797e(0x274)]),_0x55a1a4=_0x5b47b0+a54_0x26125e['dim'](_0x909add)+'\x20'+_0x4251af;_0x47e623[_0x30797e(0x167)](_0x55a1a4);const _0x8ab5b3=0x16;let _0x1c6c09=0x0;for(const _0x288176 of _0x23e5bf){const _0x35cdc6=_0x288176[_0x30797e(0x27d)][_0x30797e(0x21d)]?.[_0x30797e(0x231)]||'?',_0x6625d6=Math[_0x30797e(0x121)](stringWidth(_0x35cdc6),_0x8ab5b3);_0x1c6c09=Math[_0x30797e(0x224)](_0x1c6c09,_0x6625d6);}for(const _0x2f48c3 of _0x23e5bf){const {session:_0xcc2ec0,startTime:_0x4fa765,endTime:_0x3c6116,duration:_0x5581c3}=_0x2f48c3,_0x4d6f27=_0xcc2ec0[_0x30797e(0x21d)]?.['id'],_0x2cc2f3=_0xcc2ec0['id'],_0x1be73c=_0xcc2ec0[_0x30797e(0x21d)]?.['name']||'?',_0x4f345c=_0xcc2ec0[_0x30797e(0x169)]?.[_0x30797e(0x231)]||'?';let _0x49f365,_0x3f41b4;if(_0xcc2ec0['lastAttempt']){const _0xf8fb4e=_0xcc2ec0[_0x30797e(0x2b7)];!_0xf8fb4e['done']?(_0x49f365=_0xf8fb4e[_0x30797e(0x1f3)]?'🛑':'🔄',_0x3f41b4=_0xf8fb4e[_0x30797e(0x1f3)]?a54_0x26125e[_0x30797e(0x21c)]:a54_0x26125e[_0x30797e(0x154)]):(_0x49f365=_0xf8fb4e[_0x30797e(0x2bb)]?'✅':'❌',_0x3f41b4=_0xf8fb4e['success']?a54_0x26125e[_0x30797e(0x208)]:a54_0x26125e[_0x30797e(0x16f)]);}else _0x49f365='⏳',_0x3f41b4=a54_0x26125e[_0x30797e(0x13e)];const _0x63860e='#'+_0x2cc2f3,_0x3c5783=_0x4d6f27?hyperlink(_0x63860e,getWorkflowSessionUrl(_0x3d59f1,_0x4d6f27,_0x2cc2f3)):_0x63860e;let _0x15c7da=_0x1be73c;stringWidth(_0x1be73c)>_0x8ab5b3&&(_0x15c7da=_0x1be73c['slice'](0x0,_0x8ab5b3-0x1)+'…');const _0x1cba9f=a54_0x26125e['dim'](_0x15c7da),_0xb84d2b=stringWidth(_0x15c7da),_0x4f89fa='\x20'[_0x30797e(0x258)](_0x1c6c09-stringWidth(_0x15c7da)+0x2),_0x2eb65c='('+formatElapsed(_0x5581c3)+')',_0x1f107f=stringWidth(_0x2eb65c),_0xfaf3f8=stringWidth(_0x63860e),_0x5de900=_0xfaf3f8+0x1+_0xb84d2b+_0x4f89fa['length'],_0x566537=_0x38f266-_0x5de900-_0x1f107f-0x1-0x8;let _0x3be978=_0x4f345c;stringWidth(_0x3be978)>_0x566537&&(_0x3be978=_0x3be978[_0x30797e(0x12d)](0x0,_0x566537-0x1)+'…');const _0x35ff3b=_0x3c5783+'\x20'+_0x1cba9f+_0x4f89fa+_0x3be978,_0x1bb947=stringWidth(_0x35ff3b),_0x1b46ce=_0x38f266-_0x1bb947-_0x1f107f,_0x23585f=_0x35ff3b+'\x20'[_0x30797e(0x258)](Math[_0x30797e(0x224)](0x1,_0x1b46ce))+a54_0x26125e[_0x30797e(0x13e)](_0x2eb65c),_0x16be0e=Math[_0x30797e(0x287)]((_0x4fa765-_0x35d81d)/_0xf99a2c),_0x22e14e=Math[_0x30797e(0x287)]((_0x3c6116-_0x35d81d)/_0xf99a2c),_0x188467=Math[_0x30797e(0x224)](_0x16be0e+0x1,_0x22e14e),_0x4fc81d=new Array(_0x27a2f4)[_0x30797e(0x28b)]('\x20');for(let _0x52245a=_0x16be0e;_0x52245a<Math[_0x30797e(0x121)](_0x188467,_0x27a2f4);_0x52245a++){_0x4fc81d[_0x52245a]='─';}const _0x66e72c=_0x4fc81d[_0x30797e(0x136)](_0x290202=>_0x290202==='\x20'?'\x20':_0x3f41b4(_0x290202))['join']('');_0x47e623[_0x30797e(0x167)](_0x49f365+'\x20'+_0x23585f+'│'+_0x66e72c+'│');}return _0x47e623[_0x30797e(0x2a6)]('\x0a');}async[a54_0x54edc0(0x1d5)](_0x711a8c,_0x12cc86,_0x49326e){const _0x41b9bc=a54_0x54edc0,{options:_0x243956,tdx:_0x5ae6fc}=_0x12cc86,_0x1265fa=_0x243956['site'],{timelineRows:_0x6ce810,timeAxisHeader:_0x3d1ddf}=this[_0x41b9bc(0x195)](_0x711a8c,_0x1265fa),_0x5d0f46=_0x6ce810[_0x41b9bc(0x217)](_0x5e2759=>_0x5e2759['attemptId']);if(_0x5d0f46[_0x41b9bc(0x274)]===0x0){const _0x458f34=this[_0x41b9bc(0x1d6)](_0x711a8c,_0x1265fa);console[_0x41b9bc(0x25d)](_0x458f34);!_0x49326e&&(console[_0x41b9bc(0x279)](''),console[_0x41b9bc(0x279)](a54_0x26125e['dim'](_0x41b9bc(0x2c1))),console[_0x41b9bc(0x279)](a54_0x26125e['dim'](_0x41b9bc(0x25a))+'or'+a54_0x26125e['dim'](_0x41b9bc(0x20c))));return;}_0x3d1ddf&&console['log'](_0x3d1ddf);const _0x295619=_0x6ce810[_0x41b9bc(0x217)](_0x28674f=>_0x28674f[_0x41b9bc(0x28e)])[_0x41b9bc(0x136)](_0x24a6bd=>({'title':_0x24a6bd[_0x41b9bc(0x1d3)],'value':_0x24a6bd[_0x41b9bc(0x28e)]})),_0x2258bb=process[_0x41b9bc(0x1ce)][_0x41b9bc(0x20b)]||0x3c,_0x44d998=Math[_0x41b9bc(0x224)](0x28,Math[_0x41b9bc(0x287)](_0x2258bb*0x2/0x3)),_0x202088=await a54_0x1aee3d({'type':_0x41b9bc(0x250),'name':_0x41b9bc(0x28e),'message':_0x41b9bc(0x1c4),'choices':_0x295619,'initial':-0x1,'limit':_0x44d998,'clearFirst':!![],'fallback':{'title':_0x41b9bc(0x130),'value':null},'suggest':(_0x333e2d,_0x3ec979)=>{const _0x58cb7a=_0x41b9bc;if(!_0x333e2d)return Promise[_0x58cb7a(0x236)](_0x3ec979);const _0x4e81b4=_0x3ec979['filter'](_0x291a8d=>{const _0x3bdc1e=_0x58cb7a,_0x72439c=_0x291a8d;return _0x72439c[_0x3bdc1e(0x228)]['toLowerCase']()[_0x3bdc1e(0x183)](_0x333e2d[_0x3bdc1e(0x286)]());});return Promise[_0x58cb7a(0x236)](_0x4e81b4);}}),_0x32ed9d=()=>{const _0x2447a9=_0x41b9bc;process[_0x2447a9(0x1ce)]['write'](_0x2447a9(0x1d2)),process[_0x2447a9(0x1ce)][_0x2447a9(0x15c)](_0x2447a9(0x1d2)),process[_0x2447a9(0x1ce)][_0x2447a9(0x15c)](_0x2447a9(0x1d2));},_0x38995a=_0x202088&&_0x202088[_0x41b9bc(0x28e)]&&_0x202088[_0x41b9bc(0x28e)]!==null&&_0x202088[_0x41b9bc(0x28e)][_0x41b9bc(0x234)]()!=='';if(!_0x38995a){_0x32ed9d(),console['log'](a54_0x26125e['dim'](_0x41b9bc(0x1cf)));return;}_0x32ed9d();const _0x18ce0f=_0x711a8c[_0x41b9bc(0x1b0)](_0x231f73=>_0x231f73[_0x41b9bc(0x2b7)]?.['id']===_0x202088['attemptId']);if(_0x18ce0f){const _0x4ca4f1=_0x18ce0f[_0x41b9bc(0x21d)]?.['name']||'?',_0x5b65c5=_0x18ce0f[_0x41b9bc(0x169)]?.[_0x41b9bc(0x231)]||'?';console[_0x41b9bc(0x25d)](_0x41b9bc(0x1e6)+a54_0x26125e['dim'](_0x4ca4f1)+',\x20Workflow:\x20'+a54_0x26125e['dim'](_0x5b65c5));}const _0x76427e=new WorkflowTimelineCommand();await _0x76427e[_0x41b9bc(0x256)]({'args':[],'options':{..._0x243956,'attemptId':_0x202088[_0x41b9bc(0x28e)]},'tdx':_0x5ae6fc});}[a54_0x54edc0(0x195)](_0x37cbe7,_0x495b3a){const _0x44658d=a54_0x54edc0,_0x6d4b2d=new Map();for(const _0x513733 of _0x37cbe7){_0x513733['id']&&_0x513733['lastAttempt']?.['id']&&_0x6d4b2d[_0x44658d(0x11e)](_0x513733['id'],_0x513733['lastAttempt']['id']);}const _0x3930a8=[];let _0x13220f='';const _0x25cf8d=this['renderSessionsTimeline'](_0x37cbe7,_0x495b3a),_0x138877=_0x25cf8d['split']('\x0a');for(const _0x3048c1 of _0x138877){if(_0x3048c1[_0x44658d(0x2b0)](_0x44658d(0x1b5))||_0x3048c1[_0x44658d(0x153)](/^\s+\d{4}-\d{2}-\d{2}/))_0x13220f=_0x3048c1;else{if(_0x3048c1['match'](/^[✅❌🔄🛑⏳]/)){const _0x587f07=_0x3048c1[_0x44658d(0x153)](/#(\d+)/),_0x1eb19b=_0x587f07?_0x587f07[0x1]:null,_0x2791c8=_0x1eb19b?_0x6d4b2d[_0x44658d(0x298)](_0x1eb19b)||null:null,_0x1da8d0=_0x37cbe7[_0x44658d(0x1b0)](_0xd3a951=>_0xd3a951['id']===_0x1eb19b),_0x42baaa=_0x1da8d0?.[_0x44658d(0x21d)]?.['name']||'';_0x3930a8['push']({'displayLine':_0x3048c1,'attemptId':_0x2791c8,'projectName':_0x42baaa});}}}return{'timelineRows':_0x3930a8,'timeAxisHeader':_0x13220f};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a54_0x54edc0(0x26a)]='List\x20workflow\x20attempts';async[a54_0x54edc0(0x256)](_0x1bdd1a){const _0x2a773b=a54_0x54edc0,{options:_0x3b9be3,args:_0x3eadf1,tdx:_0x3ff8dc}=_0x1bdd1a,_0x3fa731=this[_0x2a773b(0x124)](_0x3eadf1,_0x3b9be3);if(!_0x3fa731)return 0x1;const {projectName:_0x5d5783,workflowName:_0x265dc5}=_0x3fa731,_0x5aee57=_0x3b9be3[_0x2a773b(0x1d4)];if(_0x3b9be3[_0x2a773b(0x1f9)]){if(_0x5d5783&&_0x265dc5)console[_0x2a773b(0x279)](_0x2a773b(0x2a7)+_0x5d5783+'.'+_0x265dc5);else _0x5d5783&&console[_0x2a773b(0x279)](_0x2a773b(0x22e)+_0x5d5783);_0x5aee57&&console['error'](_0x2a773b(0x158));}const _0x56d522=await withSpinner(_0x2a773b(0x22b),()=>_0x3ff8dc[_0x2a773b(0x169)][_0x2a773b(0x283)]({'projectName':_0x5d5783,'workflowName':_0x265dc5,'includeRetried':_0x5aee57,'limit':_0x3b9be3['limit']}),{'verbose':_0x3b9be3[_0x2a773b(0x1f9)]}),_0x31fb1e=_0x56d522[_0x2a773b(0x199)],_0x192321=_0x3b9be3['limit']||0x64,_0x1aed8f=_0x31fb1e[_0x2a773b(0x274)]>=_0x192321?a54_0x26125e['dim'](_0x2a773b(0x24b)):'';console[_0x2a773b(0x279)](_0x2a773b(0x272)+_0x31fb1e[_0x2a773b(0x274)]+_0x2a773b(0x221)+(_0x31fb1e[_0x2a773b(0x274)]!==0x1?'s':'')+_0x1aed8f);if(_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x11d)||_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x245)||_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x1c2))await handleSDKOutput(_0x31fb1e,_0x3b9be3);else{if(_0x31fb1e['length']===0x0){if(_0x5d5783&&_0x265dc5)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x5d5783+'.'+_0x265dc5);else _0x5d5783?console[_0x2a773b(0x25d)](_0x2a773b(0x126)+_0x5d5783):console[_0x2a773b(0x25d)](_0x2a773b(0x1df));}else{const _0x391173=_0x3b9be3[_0x2a773b(0x232)],_0x42f063=_0x31fb1e['map'](_0x82a4b=>{const _0x5b9e29=_0x2a773b,_0x4e3fe1=a54_0x26125e[_0x5b9e29(0x13e)]('#'+_0x82a4b['id']),_0x305432=_0x82a4b[_0x5b9e29(0x21d)]?.['id'],_0x11c8d7=_0x82a4b[_0x5b9e29(0x1cd)]||_0x82a4b[_0x5b9e29(0x1fe)],_0x460016=_0x305432&&_0x11c8d7?hyperlink(_0x4e3fe1,getWorkflowAttemptUrl(_0x391173,_0x305432,_0x11c8d7,_0x82a4b['id'])):_0x4e3fe1,{icon:_0x23efc9,text:_0x1b3ba6}=getAttemptStatusDisplay(_0x82a4b),_0x144f12=(_0x82a4b[_0x5b9e29(0x21d)]?.[_0x5b9e29(0x231)]||'?')+'.'+(_0x82a4b['workflow']?.[_0x5b9e29(0x231)]||'?'),_0x150ecb=_0x82a4b[_0x5b9e29(0x2b9)]?a54_0x26125e[_0x5b9e29(0x13e)](_0x82a4b[_0x5b9e29(0x2b9)]):'';return(_0x460016+'\x20'+_0x23efc9+(_0x1b3ba6?'\x20'+_0x1b3ba6:'')+'\x20'+_0x144f12+'\x20'+_0x150ecb)[_0x5b9e29(0x14f)]();});await writeOutput(_0x42f063[_0x2a773b(0x2a6)]('\x0a'),_0x3b9be3[_0x2a773b(0x2c5)],_0x2a773b(0x222));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x265);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x28f);async[a54_0x54edc0(0x256)](_0x10c8e5){const _0x1033b5=a54_0x54edc0,{options:_0x5e9ed7,args:_0xc853cf,tdx:_0x87972d}=_0x10c8e5,_0x3d0c46=_0xc853cf[0x0];if(!_0x3d0c46)return console[_0x1033b5(0x279)](_0x1033b5(0x1bd)),0x1;_0x5e9ed7[_0x1033b5(0x1f9)]&&console[_0x1033b5(0x279)]('Attempt\x20ID:\x20'+_0x3d0c46);const _0x56c9e5=await withSpinner(_0x1033b5(0x1b4),()=>_0x87972d[_0x1033b5(0x169)][_0x1033b5(0x164)](_0x3d0c46),{'verbose':_0x5e9ed7[_0x1033b5(0x1f9)]}),_0x2f0931=_0x56c9e5[_0x1033b5(0x199)];let _0x3fc289;!_0x2f0931['done']?_0x3fc289=_0x2f0931[_0x1033b5(0x1f3)]?_0x1033b5(0x17d):_0x1033b5(0x187):_0x3fc289=_0x2f0931[_0x1033b5(0x2bb)]?_0x1033b5(0x2bb):'error';let _0x132d0b;if(_0x2f0931['createdAt']&&_0x2f0931[_0x1033b5(0x16e)]){const _0x11119a=new Date(_0x2f0931[_0x1033b5(0x145)])[_0x1033b5(0x284)](),_0x950d0b=new Date(_0x2f0931['finishedAt'])[_0x1033b5(0x284)]();_0x132d0b=Math['round']((_0x950d0b-_0x11119a)/0x3e8);}const _0x3ddb97={'attempt_id':_0x2f0931['id'],'status':_0x3fc289,..._0x2f0931[_0x1033b5(0x1e5)]!==undefined&&{'index':_0x2f0931[_0x1033b5(0x1e5)]},..._0x2f0931[_0x1033b5(0x21d)]&&{'project':_0x2f0931[_0x1033b5(0x21d)][_0x1033b5(0x231)]},..._0x2f0931[_0x1033b5(0x169)]&&{'workflow':_0x2f0931[_0x1033b5(0x169)][_0x1033b5(0x231)]},..._0x2f0931[_0x1033b5(0x1fe)]&&{'session_id':_0x2f0931[_0x1033b5(0x1fe)]},..._0x2f0931[_0x1033b5(0x2b9)]&&{'session_time':_0x2f0931[_0x1033b5(0x2b9)]},..._0x2f0931['retryAttemptName']&&{'retry_attempt':_0x2f0931['retryAttemptName']},..._0x132d0b!==undefined&&{'duration_sec':_0x132d0b},..._0x2f0931[_0x1033b5(0x145)]&&{'created_at':_0x2f0931[_0x1033b5(0x145)]},..._0x2f0931[_0x1033b5(0x16e)]&&{'finished_at':_0x2f0931['finishedAt']},...Object[_0x1033b5(0x257)](_0x2f0931[_0x1033b5(0x29a)])[_0x1033b5(0x274)]>0x0&&{'params':_0x2f0931[_0x1033b5(0x29a)]}};return await handleSingleObjectOutput(_0x3ddb97,_0x5e9ed7),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x1a2);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x2ad);async[a54_0x54edc0(0x256)](_0x1bf582){const _0x24a480=a54_0x54edc0,{options:_0x38fc54,args:_0x27615f,tdx:_0x3dcbe4}=_0x1bf582,_0x33ed06=_0x27615f[0x0];if(!_0x33ed06)return console['error'](_0x24a480(0x1bd)),0x1;const _0x27f08c=_0x38fc54[_0x24a480(0x141)];_0x38fc54[_0x24a480(0x1f9)]&&(console[_0x24a480(0x279)](_0x24a480(0x123)+_0x33ed06),_0x27f08c&&console['error'](_0x24a480(0x251)));const _0x515f64=await withSpinner(_0x24a480(0x1e3),()=>_0x3dcbe4['workflow'][_0x24a480(0x1a3)](_0x33ed06,_0x27f08c||![]),{'verbose':_0x38fc54[_0x24a480(0x1f9)]}),_0x552726=_0x515f64[_0x24a480(0x199)];return console[_0x24a480(0x279)](_0x24a480(0x272)+_0x552726[_0x24a480(0x274)]+_0x24a480(0x1bb)+(_0x552726[_0x24a480(0x274)]!==0x1?'s':'')),await handleSDKOutput(_0x552726,_0x38fc54),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:logs';['description']=a54_0x54edc0(0x171);async[a54_0x54edc0(0x256)](_0x37526d){const _0x3cd8b5=a54_0x54edc0,{options:_0x37e9e2,args:_0x336e44,tdx:_0x59d221}=_0x37526d,_0x54a338=_0x336e44[0x0];let _0x4db88e=_0x336e44[0x1];if(!_0x54a338)return console[_0x3cd8b5(0x279)](_0x3cd8b5(0x1bd)),0x1;_0x37e9e2[_0x3cd8b5(0x1f9)]&&(console[_0x3cd8b5(0x279)](_0x3cd8b5(0x123)+_0x54a338),_0x4db88e&&console[_0x3cd8b5(0x279)](_0x3cd8b5(0x220)+_0x4db88e));const _0x26037e=await withSpinner(_0x3cd8b5(0x165),()=>_0x59d221[_0x3cd8b5(0x169)][_0x3cd8b5(0x1bf)](_0x54a338,_0x4db88e),{'verbose':_0x37e9e2[_0x3cd8b5(0x1f9)]}),_0x340360=_0x26037e['data'];if(_0x340360[_0x3cd8b5(0x274)]===0x0)return console[_0x3cd8b5(0x279)](_0x3cd8b5(0x26f)),0x0;if(!_0x4db88e&&(_0x37e9e2[_0x3cd8b5(0x11d)]||_0x37e9e2[_0x3cd8b5(0x185)]))return await handleSDKOutput(_0x340360,_0x37e9e2),0x0;if(!_0x4db88e){const _0x38a27d=_0x340360[_0x3cd8b5(0x136)](_0x27a32e=>({'title':_0x27a32e[_0x3cd8b5(0x14a)]+'\x20('+formatBytes(_0x27a32e[_0x3cd8b5(0x28d)])+')','value':_0x27a32e['taskName']})),_0x4a2cdf=await a54_0x1aee3d({'type':_0x3cd8b5(0x1b3),'name':_0x3cd8b5(0x14c),'message':_0x3cd8b5(0x27b),'choices':_0x38a27d});if(!_0x4a2cdf['task'])return console['error']('Cancelled'),0x0;_0x4db88e=_0x4a2cdf[_0x3cd8b5(0x14c)];}const _0x262f64=await withSpinner(_0x3cd8b5(0x268),()=>_0x59d221['workflow'][_0x3cd8b5(0x229)](_0x54a338,_0x4db88e),{'verbose':_0x37e9e2[_0x3cd8b5(0x1f9)]}),_0x220f05=_0x262f64[_0x3cd8b5(0x199)];return _0x220f05?console[_0x3cd8b5(0x25d)](_0x220f05):console['error'](_0x3cd8b5(0x131)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:kill';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1c9);async[a54_0x54edc0(0x256)](_0x124def){const _0x10d25a=a54_0x54edc0,{options:_0x4be135,args:_0x1a1a7f,tdx:_0x3b99df}=_0x124def,_0x23c271=_0x1a1a7f[0x0];if(!_0x23c271)return console[_0x10d25a(0x279)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x359755=_0x4be135[_0x10d25a(0x25b)];_0x4be135['verbose']&&(console['error'](_0x10d25a(0x123)+_0x23c271),_0x359755&&console[_0x10d25a(0x279)]('Reason:\x20'+_0x359755));if(!_0x4be135['yes']){if(!isInteractive())return console[_0x10d25a(0x279)](a54_0x26125e[_0x10d25a(0x16f)](_0x10d25a(0x186)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x26125e[_0x10d25a(0x13e)](_0x10d25a(0x2b3))),0x1;const _0x25d733=await confirmKey(_0x10d25a(0x23e)+_0x23c271+'?');if(!_0x25d733)return console[_0x10d25a(0x279)](a54_0x26125e['yellow'](_0x10d25a(0x1cf))),0x1;}const _0x493e01=await withSpinner('Killing\x20attempt...',()=>_0x3b99df[_0x10d25a(0x169)][_0x10d25a(0x18f)](_0x23c271,_0x359755),{'verbose':_0x4be135[_0x10d25a(0x1f9)]}),_0x2975db=_0x493e01[_0x10d25a(0x199)];return console['error']('✔\x20'+_0x2975db),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x24a);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x24e);async[a54_0x54edc0(0x256)](_0x38acc7){const _0x237497=a54_0x54edc0,{options:_0xdc28dc,args:_0x1172e6,tdx:_0x3a4250}=_0x38acc7,_0x1768a2=_0x1172e6[0x0];if(!_0x1768a2)return console[_0x237497(0x279)](_0x237497(0x176)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x507c0b=![],_0x8fa100=_0x1768a2;if(_0x1768a2[_0x237497(0x2b0)](_0x237497(0x178)))_0x507c0b=!![],_0x8fa100=_0x1768a2[_0x237497(0x1a4)](0x8);else{if(_0x1768a2[_0x237497(0x2b0)]('attempt:'))_0x507c0b=![],_0x8fa100=_0x1768a2['substring'](0x8);else return console[_0x237497(0x279)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x237497(0x137)),0x1;}const _0x3d8120=_0xdc28dc[_0x237497(0x25c)],_0x21f957=_0xdc28dc[_0x237497(0x135)],_0x14dc03=_0xdc28dc[_0x237497(0x29a)],_0x2b8e2c=_0xdc28dc[_0x237497(0x1c3)];_0xdc28dc[_0x237497(0x1f9)]&&(console[_0x237497(0x279)](_0x237497(0x144)+(_0x507c0b?_0x237497(0x27d):_0x237497(0x164))+'\x20'+_0x8fa100),_0x3d8120&&console[_0x237497(0x279)]('From\x20task:\x20'+_0x3d8120),_0x21f957&&console[_0x237497(0x279)](_0x237497(0x260)+_0x21f957),_0x14dc03&&console[_0x237497(0x279)](_0x237497(0x155)+_0x14dc03),_0x2b8e2c&&console[_0x237497(0x279)](_0x237497(0x296)));let _0x43820e;if(_0x14dc03)try{if(_0x14dc03['startsWith']('@')){const _0x549993=await import(_0x237497(0x248)),_0x176fb6=_0x14dc03[_0x237497(0x1a4)](0x1),_0x5d915e=await _0x549993[_0x237497(0x151)](_0x176fb6,_0x237497(0x21f));_0x43820e=JSON[_0x237497(0x26d)](_0x5d915e);}else _0x43820e=JSON[_0x237497(0x26d)](_0x14dc03);}catch{return console[_0x237497(0x279)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0xdc28dc['yes']){if(!isInteractive())return console[_0x237497(0x279)](a54_0x26125e[_0x237497(0x16f)](_0x237497(0x186)),_0x237497(0x269)),console[_0x237497(0x279)](a54_0x26125e[_0x237497(0x13e)](_0x237497(0x2b3))),0x1;const _0x127166=await confirmKey(_0x237497(0x207)+(_0x507c0b?_0x237497(0x27d):_0x237497(0x164))+'\x20'+_0x8fa100+'?');if(!_0x127166)return console['error'](a54_0x26125e[_0x237497(0x21c)]('Cancelled')),0x1;}let _0x4e5923;_0x507c0b?_0x4e5923=await withSpinner(_0x237497(0x2a9),()=>_0x3a4250['workflow']['retrySession'](_0x8fa100,{'fromTask':_0x3d8120,'retryParams':_0x43820e}),{'verbose':_0xdc28dc[_0x237497(0x1f9)]}):_0x4e5923=await withSpinner(_0x237497(0x1ea),()=>_0x3a4250[_0x237497(0x169)]['retryAttempt'](_0x8fa100,{'resumeFrom':_0x21f957,'retryParams':_0x43820e,'force':_0x2b8e2c}),{'verbose':_0xdc28dc[_0x237497(0x1f9)]});const _0x1a708b=_0x4e5923['data'];return console[_0x237497(0x279)](_0x237497(0x247)),console[_0x237497(0x279)](_0x237497(0x29d)+_0x1a708b[_0x237497(0x28e)]),console[_0x237497(0x279)]('\x20\x20Session\x20ID:\x20'+_0x1a708b['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22f);[a54_0x54edc0(0x26a)]='Start\x20a\x20workflow\x20run';async[a54_0x54edc0(0x256)](_0x1e3329){const _0x56627c=a54_0x54edc0,{options:_0x1c502a,args:_0x25a428,tdx:_0x3a85cb}=_0x1e3329;let _0x438196=_0x25a428[0x0];if(!_0x438196){const _0x263f13=this[_0x56627c(0x2bd)]([],_0x1c502a),_0x184e07=await withSpinner(_0x56627c(0x1e4),()=>_0x3a85cb[_0x56627c(0x169)][_0x56627c(0x189)](_0x263f13,{'limit':_0x1c502a[_0x56627c(0x21e)]}),{'verbose':_0x1c502a[_0x56627c(0x1f9)]}),_0x30e2df=_0x184e07[_0x56627c(0x199)];if(_0x30e2df[_0x56627c(0x274)]===0x0)return console[_0x56627c(0x279)]('No\x20workflows\x20found'),!_0x263f13&&console[_0x56627c(0x279)](a54_0x26125e['dim'](_0x56627c(0x1eb))),0x1;const _0x687d9d=_0x30e2df[_0x56627c(0x136)](_0x13c8c4=>({'title':_0x13c8c4['project']?.[_0x56627c(0x231)]+'.'+_0x13c8c4['name'],'value':_0x13c8c4[_0x56627c(0x21d)]?.[_0x56627c(0x231)]+'.'+_0x13c8c4[_0x56627c(0x231)],'description':_0x13c8c4[_0x56627c(0x235)]?_0x56627c(0x205)+_0x13c8c4[_0x56627c(0x235)]:undefined})),_0x54543b=await a54_0x1aee3d({'type':_0x56627c(0x1b3),'name':_0x56627c(0x169),'message':_0x56627c(0x17e),'choices':_0x687d9d});if(!_0x54543b[_0x56627c(0x169)])return 0x1;_0x438196=_0x54543b[_0x56627c(0x169)];}if(!_0x438196[_0x56627c(0x183)]('.')){const _0x109bb7=this[_0x56627c(0x2bd)]([],_0x1c502a);if(_0x109bb7)_0x438196=_0x109bb7+'.'+_0x438196;else return console['error'](a54_0x26125e[_0x56627c(0x16f)](_0x56627c(0x14e)),_0x56627c(0x275)),console[_0x56627c(0x279)](a54_0x26125e[_0x56627c(0x13e)](_0x56627c(0x1eb))),0x1;}const _0x1e7785=_0x1c502a[_0x56627c(0x271)],_0x44cd83=_0x1c502a[_0x56627c(0x2b9)],_0x1d37b9={};if(_0x1e7785&&Array[_0x56627c(0x16c)](_0x1e7785))for(const _0x1c64dc of _0x1e7785){const _0x5186ce=_0x1c64dc[_0x56627c(0x2b5)]('=');if(_0x5186ce===-0x1)return console[_0x56627c(0x279)](_0x56627c(0x1f4)+_0x1c64dc),console[_0x56627c(0x279)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1d563c=_0x1c64dc[_0x56627c(0x1a4)](0x0,_0x5186ce),_0x398349=_0x1c64dc[_0x56627c(0x1a4)](_0x5186ce+0x1);try{_0x1d37b9[_0x1d563c]=JSON[_0x56627c(0x26d)](_0x398349);}catch{_0x1d37b9[_0x1d563c]=_0x398349;}}_0x1c502a[_0x56627c(0x1f9)]&&(console[_0x56627c(0x279)](_0x56627c(0x12a)+_0x438196),Object[_0x56627c(0x257)](_0x1d37b9)['length']>0x0&&console[_0x56627c(0x279)](_0x56627c(0x1b8)+JSON['stringify'](_0x1d37b9)),_0x44cd83&&console[_0x56627c(0x279)](_0x56627c(0x13c)+_0x44cd83));const _0x52fcac=await withSpinner(_0x56627c(0x297),()=>_0x3a85cb[_0x56627c(0x169)]['run'](_0x438196,_0x1d37b9,{'sessionTime':_0x44cd83}),{'verbose':_0x1c502a[_0x56627c(0x1f9)]}),_0x39ba60=_0x52fcac[_0x56627c(0x199)];console['error'](_0x56627c(0x20a)),console[_0x56627c(0x279)]('\x20\x20Attempt\x20ID:\x20'+_0x39ba60['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x39ba60[_0x56627c(0x1fe)]),console[_0x56627c(0x279)](_0x56627c(0x29b)+_0x39ba60[_0x56627c(0x21d)]?.['name']),console[_0x56627c(0x279)](_0x56627c(0x14b)+_0x39ba60[_0x56627c(0x169)]?.[_0x56627c(0x231)]);if(_0x39ba60[_0x56627c(0x21d)]?.['id']&&_0x39ba60['sessionId']&&_0x39ba60['id']){const _0x504816=_0x1c502a['site'],_0x198b7f=getConsoleUrl(_0x504816,_0x56627c(0x1e0)+_0x39ba60[_0x56627c(0x21d)]['id']+_0x56627c(0x194)+_0x39ba60[_0x56627c(0x1fe)]+_0x56627c(0x179)+_0x39ba60['id']);console[_0x56627c(0x279)](_0x56627c(0x15e)+a54_0x26125e['cyan'](_0x198b7f));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x21b);['description']=a54_0x54edc0(0x19c);async[a54_0x54edc0(0x256)](_0x22a6e4){const _0x4557f5=a54_0x54edc0,{options:_0x4a7912,args:_0x50df57,tdx:_0x46239c}=_0x22a6e4,_0x55f420=_0x50df57[0x0],_0x2f39a6=_0x50df57[0x1]||'.';if(!_0x55f420)return console[_0x4557f5(0x279)](_0x4557f5(0x175)),console['error'](_0x4557f5(0x1ef)),0x1;const _0x34efac=_0x4a7912['revision'];_0x4a7912['verbose']&&(console[_0x4557f5(0x279)](_0x4557f5(0x1e6)+_0x55f420),console[_0x4557f5(0x279)](_0x4557f5(0x219)+_0x2f39a6),_0x34efac&&console['error'](_0x4557f5(0x26b)+_0x34efac));const _0x326726=await withSpinner(_0x4557f5(0x1d0)+_0x55f420+_0x4557f5(0x1aa),()=>_0x46239c[_0x4557f5(0x169)][_0x4557f5(0x1f2)](_0x55f420,_0x2f39a6,{'revision':_0x34efac}),{'verbose':_0x4a7912[_0x4557f5(0x1f9)]}),_0x42a283=_0x326726[_0x4557f5(0x199)];return console[_0x4557f5(0x279)](_0x4557f5(0x1dc)+_0x42a283[_0x4557f5(0x1d7)]),console['error'](_0x4557f5(0x143)+_0x42a283['revision']),console['error']('\x20\x20Files\x20extracted:\x20'+_0x42a283[_0x4557f5(0x17c)]),console['error'](_0x4557f5(0x223)+_0x2f39a6+'/'+_0x42a283['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22c);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x125);async['execute'](_0x5f3070){const _0x3a2b6d=a54_0x54edc0,{options:_0x261b15,args:_0x5edb2d,tdx:_0x3cdfe7}=_0x5f3070;let _0x343ee1='.',_0x5aae34=_0x261b15['name'];if(_0x5edb2d[0x0]){const {promises:_0x17e4b9}=await import('fs');try{const _0xa728fd=await _0x17e4b9[_0x3a2b6d(0x1a7)](_0x5edb2d[0x0]);if(_0xa728fd[_0x3a2b6d(0x23a)]())_0x343ee1=_0x5edb2d[0x0];else return console[_0x3a2b6d(0x279)](_0x3a2b6d(0x12c)+_0x5edb2d[0x0]+_0x3a2b6d(0x290)),0x1;}catch{_0x5aae34=_0x5edb2d[0x0],_0x343ee1='.';}}const _0xdd216=_0x261b15[_0x3a2b6d(0x235)],_0x1655e2=_0x261b15[_0x3a2b6d(0x129)];_0x261b15[_0x3a2b6d(0x1f9)]&&(console['error'](_0x3a2b6d(0x2c4)+_0x343ee1),_0x5aae34&&console[_0x3a2b6d(0x279)](_0x3a2b6d(0x27a)+_0x5aae34),_0xdd216&&console['error'](_0x3a2b6d(0x26b)+_0xdd216),_0x1655e2&&console[_0x3a2b6d(0x279)](_0x3a2b6d(0x174)));const _0xc80a4d=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x3cdfe7[_0x3a2b6d(0x169)][_0x3a2b6d(0x167)](_0x343ee1,{'projectName':_0x5aae34,'revision':_0xdd216,'skipValidation':_0x1655e2}),{'verbose':_0x261b15['verbose']}),_0x31d758=_0xc80a4d[_0x3a2b6d(0x199)];return console[_0x3a2b6d(0x279)](_0x3a2b6d(0x166)+_0x31d758[_0x3a2b6d(0x1d7)]),console[_0x3a2b6d(0x279)](_0x3a2b6d(0x2b8)+_0x31d758['projectId']),console[_0x3a2b6d(0x279)]('\x20\x20Revision:\x20'+_0x31d758['revision']),await this[_0x3a2b6d(0x140)](_0x3cdfe7,_0x31d758[_0x3a2b6d(0x1d7)],_0x261b15[_0x3a2b6d(0x232)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0x54edc0(0x132);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x29f);async[a54_0x54edc0(0x256)](_0x41b0fd){const _0x51a30f=a54_0x54edc0,{options:_0x88a115,args:_0x29ad5b,tdx:_0x5bcf6b}=_0x41b0fd,_0x276015=_0x29ad5b[0x0],_0xec7cb0=_0x29ad5b[0x1];if(!_0x276015)return console[_0x51a30f(0x279)](a54_0x26125e['red'](_0x51a30f(0x14e)),_0x51a30f(0x2c0)),console['error'](a54_0x26125e[_0x51a30f(0x13e)](_0x51a30f(0x1c6))),0x1;const _0x3e4755=_0x88a115[_0x51a30f(0x235)];_0x88a115[_0x51a30f(0x1f9)]&&(console[_0x51a30f(0x279)](_0x51a30f(0x1e6)+_0x276015),_0xec7cb0&&console[_0x51a30f(0x279)](_0x51a30f(0x1a5)+_0xec7cb0),_0x3e4755&&console['error'](_0x51a30f(0x26b)+_0x3e4755),_0x88a115[_0x51a30f(0x200)]&&console['error']('Dry\x20run:\x20yes'));const _0x21db55=await withSpinner('Pulling\x20project\x20'+_0x276015+_0x51a30f(0x1aa),()=>_0x5bcf6b[_0x51a30f(0x169)][_0x51a30f(0x1fb)](_0x276015,{'targetDir':_0xec7cb0,'revision':_0x3e4755}),{'verbose':_0x88a115['verbose']}),_0x52265c=_0x21db55[_0x51a30f(0x199)];_0x52265c[_0x51a30f(0x24f)]?console['error'](_0x51a30f(0x1c5)+_0x52265c[_0x51a30f(0x1d7)]):console[_0x51a30f(0x279)]('→\x20Project:\x20'+_0x52265c['projectName']);console[_0x51a30f(0x279)](_0x51a30f(0x143)+_0x52265c[_0x51a30f(0x235)]),console[_0x51a30f(0x279)](_0x51a30f(0x19d)+(a54_0x1db018[_0x51a30f(0x184)](process[_0x51a30f(0x2a2)](),_0x52265c[_0x51a30f(0x120)])||'.')),console[_0x51a30f(0x279)](_0x51a30f(0x2a8)+a54_0x26125e[_0x51a30f(0x208)]('+'+_0x52265c[_0x51a30f(0x163)][_0x51a30f(0x237)]+_0x51a30f(0x291))+',\x20'+(a54_0x26125e['yellow']('~'+_0x52265c['summary'][_0x51a30f(0x142)]+_0x51a30f(0x1d8))+',\x20')+(a54_0x26125e['red']('-'+_0x52265c[_0x51a30f(0x163)][_0x51a30f(0x277)]+_0x51a30f(0x160))+',\x20')+(''+a54_0x26125e[_0x51a30f(0x13e)](_0x52265c['summary'][_0x51a30f(0x1ed)]+_0x51a30f(0x1a8))));for(const _0x8f73dd of _0x52265c[_0x51a30f(0x2c6)]){_0x8f73dd[_0x51a30f(0x266)]===_0x51a30f(0x142)&&_0x8f73dd[_0x51a30f(0x1e8)]&&(console[_0x51a30f(0x279)]('\x0a'+a54_0x26125e[_0x51a30f(0x1ca)]('---\x20'+_0x8f73dd['path'])),console[_0x51a30f(0x279)](_0x8f73dd[_0x51a30f(0x1e8)]));}if(!_0x52265c[_0x51a30f(0x202)])return saveSessionContext({'workflow_project':_0x52265c['projectName']},_0x88a115[_0x51a30f(0x27d)]),console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x208)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x51a30f(0x279)](a54_0x26125e['dim'](_0x51a30f(0x1f7)+_0x52265c[_0x51a30f(0x1d7)])),0x0;if(_0x88a115[_0x51a30f(0x200)])return console['error'](a54_0x26125e[_0x51a30f(0x21c)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x88a115['yes']){if(!isInteractive())return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x16f)](_0x51a30f(0x186)),_0x51a30f(0x269)),console[_0x51a30f(0x279)](a54_0x26125e['dim'](_0x51a30f(0x2b3))),0x1;const _0x212ae2=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x212ae2)return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x21c)](_0x51a30f(0x1cf)),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x5bcf6b[_0x51a30f(0x169)][_0x51a30f(0x1e1)](_0x52265c,{'revision':_0x3e4755}),{'verbose':_0x88a115['verbose']}),saveSessionContext({'workflow_project':_0x52265c['projectName']},_0x88a115[_0x51a30f(0x27d)]),console['error'](a54_0x26125e[_0x51a30f(0x208)]('✔\x20Pull\x20complete'));const _0x94af49=a54_0x1db018[_0x51a30f(0x184)](process[_0x51a30f(0x2a2)](),_0x52265c[_0x51a30f(0x120)])||'.';return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x13e)](_0x51a30f(0x223)+_0x94af49)),console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x13e)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x52265c['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a54_0x54edc0(0x182);['description']=a54_0x54edc0(0x2c7);async[a54_0x54edc0(0x256)](_0x354964){const _0x2262a3=a54_0x54edc0,{options:_0x4d5eff,args:_0x289ba1,tdx:_0x3ef46b}=_0x354964,_0x1a7cc2=this[_0x2262a3(0x1a1)](_0x289ba1,_0x4d5eff),_0x2aa01a=_0x4d5eff[_0x2262a3(0x235)],_0x56e2c9=_0x4d5eff['skipValidation'];_0x4d5eff[_0x2262a3(0x1f9)]&&(_0x1a7cc2&&console[_0x2262a3(0x279)](_0x2262a3(0x17f)+_0x1a7cc2),_0x2aa01a&&console['error'](_0x2262a3(0x26b)+_0x2aa01a),_0x4d5eff[_0x2262a3(0x200)]&&console[_0x2262a3(0x279)](_0x2262a3(0x15f)),_0x56e2c9&&console[_0x2262a3(0x279)]('Validation:\x20skipped'));let _0x3c5b64;try{_0x3c5b64=await withSpinner(_0x2262a3(0x147),()=>_0x3ef46b['workflow']['preparePushProject']({'sourceDir':_0x1a7cc2,'revision':_0x2aa01a,'skipValidation':_0x56e2c9}),{'verbose':_0x4d5eff[_0x2262a3(0x1f9)]});}catch(_0x205496){if(_0x205496 instanceof Error&&_0x205496[_0x2262a3(0x276)][_0x2262a3(0x183)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x16f)](_0x2262a3(0x14e)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4d5eff[_0x2262a3(0x198)]?console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)](_0x2262a3(0x12e)+_0x4d5eff['workflowProject']+_0x2262a3(0x2ba)+_0x4d5eff[_0x2262a3(0x198)]+'\x27')):console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)](_0x2262a3(0x261))),0x1;throw _0x205496;}const _0x3baf87=_0x3c5b64[_0x2262a3(0x199)];console['error'](_0x2262a3(0x270)+_0x3baf87[_0x2262a3(0x1d7)]),console[_0x2262a3(0x279)](_0x2262a3(0x12b)+_0x3baf87[_0x2262a3(0x206)]),console[_0x2262a3(0x279)](_0x2262a3(0x143)+_0x3baf87['revision']),console['error'](_0x2262a3(0x2a8)+a54_0x26125e[_0x2262a3(0x208)]('+'+_0x3baf87['summary'][_0x2262a3(0x237)]+_0x2262a3(0x291))+',\x20'+(a54_0x26125e[_0x2262a3(0x21c)]('~'+_0x3baf87['summary'][_0x2262a3(0x142)]+_0x2262a3(0x1d8))+',\x20')+(a54_0x26125e[_0x2262a3(0x16f)]('-'+_0x3baf87['summary'][_0x2262a3(0x277)]+_0x2262a3(0x160))+',\x20')+(''+a54_0x26125e[_0x2262a3(0x13e)](_0x3baf87[_0x2262a3(0x163)]['unchanged']+_0x2262a3(0x1a8))));for(const _0x3ac2e8 of _0x3baf87[_0x2262a3(0x2c6)]){_0x3ac2e8[_0x2262a3(0x266)]===_0x2262a3(0x142)&&_0x3ac2e8[_0x2262a3(0x1e8)]&&(console[_0x2262a3(0x279)]('\x0a'+a54_0x26125e[_0x2262a3(0x1ca)](_0x2262a3(0x1c7)+_0x3ac2e8['path'])),console[_0x2262a3(0x279)](_0x3ac2e8[_0x2262a3(0x1e8)]));}if(!_0x3baf87['hasChanges'])return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x208)](_0x2262a3(0x193))),await this[_0x2262a3(0x140)](_0x3ef46b,_0x3baf87['projectName'],_0x4d5eff[_0x2262a3(0x232)]),0x0;if(_0x4d5eff[_0x2262a3(0x200)])return console[_0x2262a3(0x279)](a54_0x26125e['yellow'](_0x2262a3(0x2a3))),0x0;if(!_0x4d5eff[_0x2262a3(0x13d)]){if(!isInteractive())return console[_0x2262a3(0x279)](a54_0x26125e['red'](_0x2262a3(0x186)),_0x2262a3(0x269)),console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x16f02e=await confirmKey(_0x2262a3(0x1dd));if(!_0x16f02e)return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x21c)]('Cancelled'),_0x2262a3(0x13b)),0x1;}const _0x4cc613=await withSpinner('Pushing\x20project...',()=>_0x3ef46b[_0x2262a3(0x169)][_0x2262a3(0x18b)](_0x3baf87),{'verbose':_0x4d5eff[_0x2262a3(0x1f9)]}),_0x27883d=_0x4cc613[_0x2262a3(0x199)];return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x208)](_0x2262a3(0x1bc))),console[_0x2262a3(0x279)]('\x20\x20Project\x20ID:\x20'+_0x27883d[_0x2262a3(0x152)]),console[_0x2262a3(0x279)](_0x2262a3(0x143)+_0x27883d[_0x2262a3(0x235)]),await this[_0x2262a3(0x140)](_0x3ef46b,_0x27883d[_0x2262a3(0x1d7)],_0x4d5eff[_0x2262a3(0x232)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22d);[a54_0x54edc0(0x26a)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x54edc0(0x256)](_0x3b0f75){const _0x38746d=a54_0x54edc0,{options:_0x4e8c58,args:_0x420cba,tdx:_0x46799b}=_0x3b0f75,_0x43742f=this[_0x38746d(0x1a1)](_0x420cba,_0x4e8c58),_0x442f08=_0x4e8c58[_0x38746d(0x231)],_0x3baa72=_0x4e8c58[_0x38746d(0x235)],_0x4dd0c7=_0x4e8c58[_0x38746d(0x129)];if(!_0x43742f)return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x16f)](_0x38746d(0x14e)),_0x38746d(0x1f5)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x1c8))),console['error'](a54_0x26125e[_0x38746d(0x13e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x442f08)return console[_0x38746d(0x279)](a54_0x26125e['red']('Error:'),_0x38746d(0x1f0)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x1c8))),0x1;_0x4e8c58['verbose']&&(console['error'](_0x38746d(0x17f)+_0x43742f),console['error'](_0x38746d(0x1ff)+_0x442f08),_0x3baa72&&console[_0x38746d(0x279)](_0x38746d(0x26b)+_0x3baa72),_0x4e8c58[_0x38746d(0x200)]&&console[_0x38746d(0x279)](_0x38746d(0x15f)),_0x4dd0c7&&console[_0x38746d(0x279)](_0x38746d(0x174)));const _0x50730f=await withSpinner('Analyzing\x20project...',()=>_0x46799b[_0x38746d(0x169)][_0x38746d(0x253)](_0x43742f,_0x442f08,{'revision':_0x3baa72,'skipValidation':_0x4dd0c7}),{'verbose':_0x4e8c58[_0x38746d(0x1f9)]}),_0x35979e=_0x50730f['data'];console[_0x38746d(0x279)](_0x38746d(0x1af)+_0x35979e['sourceDir']);_0x35979e['sourceProjectName']&&console[_0x38746d(0x279)]('Source\x20project:\x20'+_0x35979e['sourceProjectName']);console[_0x38746d(0x279)](_0x38746d(0x1ff)+_0x35979e['newProjectName']),console[_0x38746d(0x279)](_0x38746d(0x26b)+_0x35979e[_0x38746d(0x235)]),console[_0x38746d(0x279)](_0x38746d(0x2b4)+_0x35979e['fileCount']);_0x35979e['targetExists']&&(console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x21c)]('\x0a⚠\x20Project\x20\x22'+_0x35979e['newProjectName']+_0x38746d(0x1b9)+_0x35979e[_0x38746d(0x2af)]+')')),console[_0x38746d(0x279)](a54_0x26125e['yellow'](_0x38746d(0x259))));if(_0x4e8c58[_0x38746d(0x200)])return console['error'](a54_0x26125e['yellow'](_0x38746d(0x24d))),0x0;if(!_0x4e8c58['yes']){if(!isInteractive())return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x16f)](_0x38746d(0x186)),_0x38746d(0x269)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x2b3))),0x1;const _0x441a15=_0x35979e['sourceProjectName']||a54_0x1db018[_0x38746d(0x289)](_0x43742f),_0x44a106=_0x35979e[_0x38746d(0x177)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x442f08+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x441a15+_0x38746d(0x212)+_0x442f08+'\x22?',_0x578ec1=await confirmKey(_0x44a106);if(!_0x578ec1)return console['error'](a54_0x26125e['yellow']('Cancelled')),0x1;}const _0x1192a9=await withSpinner(_0x35979e[_0x38746d(0x177)]?_0x38746d(0x1c0)+_0x442f08+_0x38746d(0x1aa):_0x38746d(0x1e2)+_0x442f08+'...',()=>_0x46799b[_0x38746d(0x169)]['executeCloneProject'](_0x35979e),{'verbose':_0x4e8c58[_0x38746d(0x1f9)]}),_0x1252e4=_0x1192a9[_0x38746d(0x199)];return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x208)](_0x35979e[_0x38746d(0x177)]?_0x38746d(0x191):_0x38746d(0x11c))),console['error'](_0x38746d(0x29b)+_0x1252e4['newProjectName']),console[_0x38746d(0x279)]('\x20\x20Project\x20ID:\x20'+_0x1252e4[_0x38746d(0x18c)]),console[_0x38746d(0x279)]('\x20\x20Revision:\x20'+_0x1252e4['revision']),await this[_0x38746d(0x140)](_0x46799b,_0x1252e4[_0x38746d(0x1b2)],_0x4e8c58[_0x38746d(0x232)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:delete';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x252);async[a54_0x54edc0(0x256)](_0xe7e749){const _0x5aacc4=a54_0x54edc0,{options:_0x2a126d,args:_0x4c1c4b,tdx:_0xe8cefb}=_0xe7e749,_0xf6ca25=_0x4c1c4b[0x0];if(!_0xf6ca25)return console[_0x5aacc4(0x279)](_0x5aacc4(0x1ec)),console[_0x5aacc4(0x279)](_0x5aacc4(0x1fc)),0x1;_0x2a126d[_0x5aacc4(0x1f9)]&&console[_0x5aacc4(0x279)]('Project:\x20'+_0xf6ca25);if(!_0x2a126d[_0x5aacc4(0x13d)]){if(!isInteractive())return console[_0x5aacc4(0x279)](a54_0x26125e[_0x5aacc4(0x16f)]('\x0aError:'),_0x5aacc4(0x269)),console[_0x5aacc4(0x279)](a54_0x26125e['dim'](_0x5aacc4(0x2b3))),0x1;const _0x3b4a50=await confirmKey(_0x5aacc4(0x1f1)+_0xf6ca25+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x3b4a50)return console[_0x5aacc4(0x279)](a54_0x26125e[_0x5aacc4(0x21c)](_0x5aacc4(0x1cf))),0x1;}const _0x425285=await withSpinner(_0x5aacc4(0x1d1)+_0xf6ca25+_0x5aacc4(0x1aa),()=>_0xe8cefb[_0x5aacc4(0x169)][_0x5aacc4(0x1c1)](_0xf6ca25),{'verbose':_0x2a126d[_0x5aacc4(0x1f9)]}),_0x514590=_0x425285[_0x5aacc4(0x199)];return console['error'](_0x5aacc4(0x1de)+_0x514590[_0x5aacc4(0x1d7)]),console[_0x5aacc4(0x279)](_0x5aacc4(0x2b8)+_0x514590['projectId']),0x0;}}export function parseKeyValue(_0xa58a3e){const _0x6d1ae0=a54_0x54edc0,_0x53a1a0=_0xa58a3e[_0x6d1ae0(0x2b5)]('=');if(_0x53a1a0===-0x1)throw new Error(_0x6d1ae0(0x281)+_0xa58a3e+_0x6d1ae0(0x19f));const _0x349085=_0xa58a3e[_0x6d1ae0(0x1a4)](0x0,_0x53a1a0),_0x473d7c=_0xa58a3e[_0x6d1ae0(0x1a4)](_0x53a1a0+0x1);if(!_0x349085)throw new Error(_0x6d1ae0(0x285));return{'key':_0x349085,'value':_0x473d7c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:secrets:list';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x146);async['execute'](_0x3eb655){const _0x27b9f3=a54_0x54edc0,{options:_0x5c106c,args:_0x37accf,tdx:_0x5f0dbc}=_0x3eb655,_0x2f958c=this[_0x27b9f3(0x1ad)](_0x37accf,_0x5c106c);if(!_0x2f958c)return 0x1;_0x5c106c[_0x27b9f3(0x1f9)]&&console[_0x27b9f3(0x279)]('Project:\x20'+_0x2f958c);const _0x44a014=await withSpinner(_0x27b9f3(0x1ee),()=>_0x5f0dbc[_0x27b9f3(0x169)][_0x27b9f3(0x2ab)](_0x2f958c),{'verbose':_0x5c106c['verbose']}),{secrets:_0x51fa24}=_0x44a014['data'];return console[_0x27b9f3(0x279)]('✔\x20Found\x20'+_0x51fa24['length']+_0x27b9f3(0x1f6)+(_0x51fa24[_0x27b9f3(0x274)]!==0x1?'s':'')),await handleSDKOutput(_0x51fa24,_0x5c106c),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x27f);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1ba);async[a54_0x54edc0(0x256)](_0x469658){const _0x55860b=a54_0x54edc0,{options:_0x4928e6,args:_0x5a842d,tdx:_0x1b1a28}=_0x469658;let _0x131394,_0x24b7a0;if(_0x5a842d['length']>=0x1&&!_0x5a842d[0x0][_0x55860b(0x183)]('='))_0x131394=_0x5a842d[0x0],_0x24b7a0=_0x5a842d[_0x55860b(0x12d)](0x1);else{if(_0x5a842d['length']>=0x1&&_0x4928e6[_0x55860b(0x198)])_0x131394=_0x4928e6['workflowProject'],_0x24b7a0=_0x5a842d;else return _0x5a842d[_0x55860b(0x274)]>=0x1?(console[_0x55860b(0x279)](_0x55860b(0x175)),console[_0x55860b(0x279)](_0x55860b(0x1eb)),0x1):(console[_0x55860b(0x279)](_0x55860b(0x159)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x24b7a0[_0x55860b(0x274)]===0x0)return console[_0x55860b(0x279)](_0x55860b(0x159)),console['error'](_0x55860b(0x23c)),0x1;const _0x4e5307={};try{for(const _0x2a2c83 of _0x24b7a0){const {key:_0x43a718,value:_0x14be33}=parseKeyValue(_0x2a2c83);_0x4e5307[_0x43a718]=_0x14be33;}}catch(_0x58fee3){return _0x58fee3 instanceof Error&&console['error'](a54_0x26125e[_0x55860b(0x16f)](_0x55860b(0x14e)),_0x58fee3[_0x55860b(0x276)]),0x1;}const _0x2124c4=Object['keys'](_0x4e5307);_0x4928e6['verbose']&&(console[_0x55860b(0x279)](_0x55860b(0x1e6)+_0x131394),console[_0x55860b(0x279)](_0x55860b(0x204)+_0x2124c4[_0x55860b(0x2a6)](',\x20')));const _0x46cbcf=await withSpinner(_0x2124c4[_0x55860b(0x274)]===0x1?_0x55860b(0x17b):_0x55860b(0x255)+_0x2124c4[_0x55860b(0x274)]+_0x55860b(0x28c),()=>_0x1b1a28[_0x55860b(0x169)][_0x55860b(0x172)](_0x131394,_0x4e5307),{'verbose':_0x4928e6[_0x55860b(0x1f9)]}),_0x34fd5a=_0x46cbcf[_0x55860b(0x199)];return console[_0x55860b(0x279)](_0x2124c4[_0x55860b(0x274)]===0x1?_0x55860b(0x22a)+_0x34fd5a['keys'][0x0]+_0x55860b(0x20e)+_0x34fd5a[_0x55860b(0x1d7)]+'\x27':'✔\x20'+_0x34fd5a[_0x55860b(0x257)][_0x55860b(0x274)]+_0x55860b(0x29e)+_0x34fd5a[_0x55860b(0x1d7)]+'\x27'),(_0x4928e6[_0x55860b(0x11d)]||_0x4928e6[_0x55860b(0x245)])&&await handleSingleObjectOutput(_0x34fd5a,_0x4928e6),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x1db);['description']=a54_0x54edc0(0x20d);async[a54_0x54edc0(0x256)](_0x25a6fc){const _0x599d91=a54_0x54edc0,{options:_0x4a0646,args:_0x5dace2,tdx:_0x9903cd}=_0x25a6fc;let _0x26663c,_0x23eb8f;if(_0x5dace2[_0x599d91(0x274)]>=0x2)_0x26663c=_0x5dace2[0x0],_0x23eb8f=_0x5dace2[0x1];else{if(_0x5dace2[_0x599d91(0x274)]===0x1&&_0x4a0646['workflowProject'])_0x26663c=_0x4a0646[_0x599d91(0x198)],_0x23eb8f=_0x5dace2[0x0];else return _0x5dace2[_0x599d91(0x274)]===0x1?(console['error'](_0x599d91(0x175)),console[_0x599d91(0x279)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x599d91(0x279)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x599d91(0x279)](_0x599d91(0x233)),0x1);}_0x4a0646[_0x599d91(0x1f9)]&&(console[_0x599d91(0x279)](_0x599d91(0x1e6)+_0x26663c),console['error'](_0x599d91(0x157)+_0x23eb8f));if(!_0x4a0646[_0x599d91(0x13d)]){if(!isInteractive())return console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x16f)](_0x599d91(0x186)),_0x599d91(0x269)),console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x13e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5070cb=await confirmKey(_0x599d91(0x14d)+_0x23eb8f+'\x27\x20from\x20project\x20\x27'+_0x26663c+'\x27?');if(!_0x5070cb)return console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x21c)]('Cancelled')),0x1;}const _0x35498a=await withSpinner(_0x599d91(0x127),()=>_0x9903cd[_0x599d91(0x169)][_0x599d91(0x282)](_0x26663c,_0x23eb8f),{'verbose':_0x4a0646['verbose']}),_0x4aa4b2=_0x35498a[_0x599d91(0x199)];return console['error'](_0x599d91(0x22a)+_0x4aa4b2[_0x599d91(0x254)]+_0x599d91(0x24c)+_0x4aa4b2[_0x599d91(0x1d7)]+'\x27'),(_0x4a0646['json']||_0x4a0646[_0x599d91(0x245)])&&await handleSingleObjectOutput(_0x4aa4b2,_0x4a0646),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(_0xf1b246){const _0xa85092=a54_0x54edc0,_0x32571b=Math[_0xa85092(0x287)](_0xf1b246/0x3e8),_0x5eaa31=Math[_0xa85092(0x287)](_0x32571b/0x3c),_0x295777=Math['floor'](_0x5eaa31/0x3c),_0x1e37f9=Math[_0xa85092(0x287)](_0x295777/0x18);if(_0x1e37f9>0x0){const _0xda107e=_0x295777%0x18;return _0xda107e>0x0?_0x1e37f9+'d\x20'+_0xda107e+'h':_0x1e37f9+'d';}else{if(_0x295777>0x0){const _0x5e71f3=_0x5eaa31%0x3c;return _0x5e71f3>0x0?_0x295777+'h\x20'+_0x5e71f3+'m':_0x295777+'h';}else{if(_0x5eaa31>0x0){const _0x5dd69b=_0x32571b%0x3c;return _0x5dd69b>0x0?_0x5eaa31+'m\x20'+_0x5dd69b+'s':_0x5eaa31+'m';}else return _0x32571b+'s';}}}function formatTimestamp(_0x3a9fec,_0x14cb9d){const _0x17c3e1=a54_0x54edc0,_0x223656=new Date(_0x3a9fec),_0xa625c5=String(_0x223656['getHours']())[_0x17c3e1(0x1d9)](0x2,'0'),_0x3ba516=String(_0x223656[_0x17c3e1(0x148)]())[_0x17c3e1(0x1d9)](0x2,'0'),_0x5f36a5=_0xa625c5+':'+_0x3ba516,_0x59d45d=_0x223656[_0x17c3e1(0x1e9)]()===_0x14cb9d[_0x17c3e1(0x1e9)]()&&_0x223656[_0x17c3e1(0x2a5)]()===_0x14cb9d['getMonth']()&&_0x223656['getDate']()===_0x14cb9d['getDate']();if(_0x59d45d)return _0x5f36a5;else{const _0x1245db=String(_0x223656[_0x17c3e1(0x2a5)]()+0x1)[_0x17c3e1(0x1d9)](0x2,'0'),_0x9327b0=String(_0x223656[_0x17c3e1(0x2ac)]())[_0x17c3e1(0x1d9)](0x2,'0');return _0x1245db+'-'+_0x9327b0+'\x20'+_0x5f36a5;}}function formatDate(_0x4da9fb){const _0x5cf475=a54_0x54edc0,_0x4eeceb=_0x4da9fb['getFullYear'](),_0x4a33e7=String(_0x4da9fb[_0x5cf475(0x2a5)]()+0x1)['padStart'](0x2,'0'),_0x2197fd=String(_0x4da9fb[_0x5cf475(0x2ac)]())[_0x5cf475(0x1d9)](0x2,'0');return _0x4eeceb+'-'+_0x4a33e7+'-'+_0x2197fd;}function getTaskStateIcon(_0x155e63){const _0x3cb651={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3cb651[_0x155e63]||'⚪';}function getBarChar(_0x5295fa){const _0x291f48=a54_0x54edc0;return _0x5295fa===_0x291f48(0x279)||_0x5295fa===_0x291f48(0x1cc)?'×':'─';}function getBarColor(_0x3af35b){const _0xaa4b8=a54_0x54edc0,_0x262b93={'success':a54_0x26125e[_0xaa4b8(0x208)],'error':a54_0x26125e[_0xaa4b8(0x16f)],'group_error':a54_0x26125e[_0xaa4b8(0x16f)],'running':a54_0x26125e[_0xaa4b8(0x154)],'blocked':a54_0x26125e[_0xaa4b8(0x21c)],'planned':a54_0x26125e[_0xaa4b8(0x13e)],'canceling':a54_0x26125e[_0xaa4b8(0x21c)]};return _0x262b93[_0x3af35b]||a54_0x26125e['white'];}function parseTaskName(_0x3294db){const _0x1ecc7e=a54_0x54edc0;let _0x170d5e=_0x3294db[_0x1ecc7e(0x249)](/^\++/,'');const _0x49e5d6=_0x170d5e[_0x1ecc7e(0x210)]('+'),_0x3ad7aa=_0x49e5d6[_0x1ecc7e(0x274)]>0x1?_0x49e5d6[_0x1ecc7e(0x274)]-0x2:0x0,_0x1b99c9=_0x49e5d6[_0x49e5d6[_0x1ecc7e(0x274)]-0x1]||_0x170d5e;return{'level':_0x3ad7aa,'name':'+'+_0x1b99c9};}function truncateTaskName(_0x48014a,_0x31ba96){const _0x3ae546=a54_0x54edc0,_0x5867d5=stringWidth(_0x48014a);if(_0x5867d5<=_0x31ba96)return _0x48014a;let _0x25cf80=_0x48014a;while(stringWidth(_0x25cf80+'…')>_0x31ba96&&_0x25cf80['length']>0x0){_0x25cf80=_0x25cf80[_0x3ae546(0x12d)](0x0,-0x1);}return _0x25cf80+'…';}function a54_0x11ab(){const _0x4bc28d=['No\x20sessions\x20with\x20timing\x20information','pollTimeline','\x20project','MAX_TASKS_DISPLAY','jsonl','updatedAt','✔\x20Retry\x20started','fs/promises','replace','workflow:retry','\x20(use\x20--limit\x20to\x20show\x20more)','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0aDry\x20run\x20-\x20no\x20project\x20created','Retry\x20a\x20session\x20or\x20attempt','isNewProject','autocomplete','Including\x20subtasks:\x20yes','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','prepareCloneProject','key','Setting\x20','execute','keys','repeat','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','reason','fromTask','log','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','List\x20all\x20workflow\x20projects','Resume\x20from:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','projects','\x20logs','Auto-selected\x20latest\x20session:\x20','workflow:attempt','type','localeCompare','Downloading\x20logs...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','description','Revision:\x20','MIN_LABEL_COUNT','parse','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20log\x20files\x20found\x20for\x20this\x20attempt','✔\x20Project:\x20','param','✔\x20Found\x20','No\x20projects\x20match\x20pattern:\x20','length','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','message','deleted','duration','error','Project\x20name:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','Warning:','session','3382008dDMdcx','workflow:secrets:set','120AgmVZC','Invalid\x20format:\x20','deleteSecret','attempts','getTime','Key\x20cannot\x20be\x20empty','toLowerCase','floor','📋\x20','basename','Failed\x20to\x20fetch\x20attempt\x20data','fill','\x20secrets...','fileSize','attemptId','Show\x20specific\x20attempt\x20details','\x20is\x20not\x20a\x20directory','\x20new','MAX_LABEL_COUNT','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflows\x20found\x20in\x20project:\x20','Listing\x20workflows...','Force:\x20yes','Starting\x20workflow\x20run...','get','6211542goQydR','params','\x20\x20Project:\x20','Total:\x20','\x20\x20New\x20attempt\x20ID:\x20','\x20secrets\x20set\x20for\x20project\x20\x27','Pull\x20workflow\x20project\x20to\x20local\x20folder','Listing\x20workflow\x20sessions...','msPerChar','cwd','\x0aDry\x20run\x20-\x20nothing\x20pushed','TASK_NAME_WIDTH','getMonth','join','Filter:\x20','\x20\x20Changes:\x20','Retrying\x20session...','has','listSecrets','getDate','Show\x20tasks\x20for\x20an\x20attempt','27420VJsTkm','existingProjectId','startsWith','📁\x20','260694maaxJv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Files\x20to\x20upload:\x20','indexOf','7qHdGgQ','lastAttempt','\x20\x20Project\x20ID:\x20','sessionTime','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','success','window','resolveProject','now','40WyvFSI','Project\x20name\x20is\x20required','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20-\x20','columns','Project\x20directory:\x20','output','changes','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Usage:\x20tdx\x20wf\x20use\x20<project>','context','No\x20sessions\x20found','✔\x20Clone\x20complete','json','set','\x20from\x20session\x20','targetDir','min','renderSingleTimeline','Attempt\x20ID:\x20','parseProjectWorkflowPattern','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','No\x20attempts\x20found\x20in\x20project:\x20','Deleting\x20secret...','buildTimelineData','skipValidation','Workflow:\x20','\x20\x20Source:\x20','Error:\x20','slice','Tip:\x20cd\x20to\x20workflows/','renderTimeline','No\x20matching\x20sessions\x20found','No\x20log\x20content\x20found','workflow:pull','MIN_TIMELINE_WIDTH','108272UmcDlN','resumeFrom','map','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Listing\x20workflow\x20projects...','toISOString','No\x20sessions\x20found\x20for:\x20','-\x20nothing\x20pushed','Session\x20time:\x20','yes','dim','13OEJKyF','showWorkflowConsoleUrl','includeSubtasks','modified','\x20\x20Revision:\x20','Target:\x20','createdAt','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Analyzing\x20changes...','getMinutes','731296xwfCGG','taskName','\x20\x20Workflow:\x20','task','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Error:','trimEnd','Loading\x20session...','readFile','projectId','match','blue','Params:\x20','status','Key:\x20','Include\x20retried:\x20yes','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x20of\x20','List\x20workflow\x20execution\x20sessions','write','\x20tasks','\x20\x20Console:\x20','Dry\x20run:\x20yes','\x20deleted','planned','ICON_WIDTH','summary','attempt','Fetching\x20log\x20files...','✔\x20Pushed\x20','push','all','workflow','fullName','follow','isArray','state','finishedAt','red','isTTY','Show\x20logs\x20for\x20a\x20workflow\x20attempt','setSecrets','sessions','Validation:\x20skipped','Error:\x20Project\x20name\x20is\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','targetExists','session:','/attempt/','No\x20workflow\x20sessions\x20found','Setting\x20secret...','filesExtracted','canceling','Select\x20a\x20workflow\x20to\x20run','Source\x20directory:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','List\x20workflows','workflow:push','includes','relative','format','\x0aError:','running','done','workflows','💡\x20Tip:\x20Use\x20','executePushProject','newProjectId','MAX_POLL_ITERATIONS','30576096WHWMqy','kill','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','✔\x20Project\x20updated','resolveProjectId','\x0a✔\x20No\x20changes\x20to\x20push','/sessions/','generateSessionTimelineRows','Using\x20attempt\x20','6083lreGkV','workflowProject','data','2uieVZP','Status:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Target:\x20','end','.\x20Expected\x20format:\x20KEY=VALUE','\x20to\x20see\x20detailed\x20logs','resolveProjectDir','workflow:tasks','tasks','substring','Target\x20directory:\x20','pending','stat','\x20unchanged','\x0aFailed\x20to\x20fetch\x20attempt\x20data','...','\x20session','Pattern:\x20','requireProject','startedAt','Source:\x20','find','ICON_SPACING','newProjectName','select','Getting\x20attempt\x20details...','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','icon','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Parameters:\x20','\x22\x20already\x20exists\x20(ID:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20task','✔\x20Push\x20complete','Error:\x20Attempt\x20ID\x20is\x20required','workflowName','logFiles','Updating\x20','delete','table','force','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','→\x20New\x20project:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','---\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Kill\x20a\x20running\x20attempt','cyan','Select\x20a\x20session\x20to\x20view\x20timeline:','group_error','session_id','stdout','Cancelled','Downloading\x20project\x20','Deleting\x20project\x20','\x1b[1A\x1b[2K','displayLine','includeRetried','navigateSessionsInteractive','renderSessionsTimeline','projectName','\x20modified','padStart','size','workflow:secrets:delete','✔\x20Downloaded\x20','\x0aPush\x20these\x20changes?','✔\x20Deleted\x20project\x20','No\x20attempts\x20found','/app/workflows/','applyPullProject','Cloning\x20to\x20','Getting\x20attempt\x20tasks...','Loading\x20workflows...','index','Project:\x20','text','diff','getFullYear','Retrying\x20attempt...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','unchanged','Listing\x20secrets...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','download','cancelRequested','Error:\x20Invalid\x20parameter\x20format:\x20','Source\x20directory\x20is\x20required','\x20secret','\x20\x20Session\x20context\x20set\x20to:\x20','sort','verbose','startTime','pullProject','Usage:\x20workflow:delete\x20<project-name-or-id>','Resolving\x20project\x20\x27','sessionId','New\x20project\x20name:\x20','dryRun','(use\x20--limit\x20to\x20see\x20more)','hasChanges','\x0aPolling...\x20(','Secrets\x20to\x20set:\x20','revision:\x20','sourceDir','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','green','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','✔\x20Workflow\x20run\x20started','rows','\x20\x20tdx\x20wf\x20use\x20<project>','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','MAX_TIMELINE_WIDTH','split','values','\x22\x20to\x20new\x20project\x20\x22','from','unknown','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x27...','filter','start','Output\x20directory:\x20','No\x20sessions\x20found\x20in\x20project:\x20','workflow:download','yellow','project','limit','utf-8','Task\x20name:\x20','\x20attempt','list','\x20\x20Location:\x20','max','durationMs','Latest\x20session\x20has\x20no\x20attempt','every','title','logs','✔\x20Secret\x20\x27','Listing\x20workflow\x20attempts...','workflow:upload','workflow:clone','Filter:\x20project=','workflow:run','\x20(system)','name','site','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','trim','revision','resolve','new','\x20workflow','splice','isDirectory','\x0a✔\x20Attempt\x20complete','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','clear','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','sys','⚠\x20Showing\x20first\x20'];a54_0x11ab=function(){return _0x4bc28d;};return a54_0x11ab();}function calculateTimeScale(_0x2cd2b4,_0x2baed1){const _0x427eb4=a54_0x54edc0;return{'startTime':_0x2cd2b4['start'],'endTime':_0x2cd2b4['end'],'durationMs':_0x2cd2b4['duration'],'msPerChar':_0x2cd2b4[_0x427eb4(0x278)]/_0x2baed1};}function timeToPosition(_0x5e73bb,_0x50e390,_0x24362e){const _0x46cb67=a54_0x54edc0,_0x49ad19=_0x5e73bb-_0x50e390['startTime'],_0x3e63ca=Math[_0x46cb67(0x287)](_0x49ad19/_0x50e390[_0x46cb67(0x2a1)]);return Math[_0x46cb67(0x224)](0x0,Math['min'](_0x3e63ca,_0x24362e));}function renderTimeAxis(_0x537da9,_0x307343){const _0x5c49cd=a54_0x54edc0,_0x53b249=Math[_0x5c49cd(0x121)](TIMELINE_CONFIG[_0x5c49cd(0x292)],Math[_0x5c49cd(0x224)](TIMELINE_CONFIG[_0x5c49cd(0x26c)],Math[_0x5c49cd(0x287)](_0x307343/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x42ca88=_0x537da9[_0x5c49cd(0x225)]/(_0x53b249-0x1),_0x175462=new Date(_0x537da9[_0x5c49cd(0x1fa)]),_0x569ea4=[];for(let _0x10caf4=0x0;_0x10caf4<_0x53b249;_0x10caf4++){const _0x1a8f29=_0x537da9['startTime']+_0x10caf4*_0x42ca88,_0x298204=timeToPosition(_0x1a8f29,_0x537da9,_0x307343),_0x31b4b5=formatTimestamp(_0x1a8f29,_0x175462);_0x569ea4[_0x5c49cd(0x167)]({'pos':_0x298204,'text':_0x31b4b5});}const _0x5b38f9=new Array(_0x307343)[_0x5c49cd(0x28b)]('\x20');let _0x314bdc=-0x1;for(const {pos:_0xbec1e4,text:_0x33b354}of _0x569ea4){let _0x186ae4=Math['max'](0x0,_0xbec1e4-Math[_0x5c49cd(0x287)](_0x33b354[_0x5c49cd(0x274)]/0x2));_0x186ae4<=_0x314bdc+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x186ae4=_0x314bdc+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x186ae4+_0x33b354['length']>_0x307343&&(_0x186ae4=_0x307343-_0x33b354['length']);if(_0x186ae4>=0x0&&_0x186ae4+_0x33b354[_0x5c49cd(0x274)]<=_0x307343&&_0x186ae4>_0x314bdc){for(let _0x421de3=0x0;_0x421de3<_0x33b354[_0x5c49cd(0x274)];_0x421de3++){_0x5b38f9[_0x186ae4+_0x421de3]=_0x33b354[_0x421de3];}_0x314bdc=_0x186ae4+_0x33b354[_0x5c49cd(0x274)]-0x1;}}return _0x5b38f9[_0x5c49cd(0x2a6)]('');}function renderTaskRow(_0x9c78fd,_0x363876,_0x3a7aa9,_0x547e8f){const _0x2bf97f=a54_0x54edc0,{level:_0x7fb029,name:_0x54ced3}=parseTaskName(_0x9c78fd[_0x2bf97f(0x231)]),_0xa4a1a5='\x20'[_0x2bf97f(0x258)](_0x7fb029),_0x5e6f5e=_0x9c78fd[_0x2bf97f(0x2bc)]?'('+formatElapsed(_0x9c78fd[_0x2bf97f(0x2bc)][_0x2bf97f(0x278)])+')':'',_0x310eac=stringWidth(_0x5e6f5e),_0x33886b=_0x7fb029*0x1,_0x21db54=_0x547e8f-_0x33886b-_0x310eac-0x1,_0x13b399=truncateTaskName(_0x54ced3,_0x21db54),_0x7fcf2a=_0xa4a1a5+_0x13b399,_0xd07a2a=stringWidth(_0x7fcf2a),_0x39ded4=_0x547e8f-_0xd07a2a-_0x310eac,_0x54a427=_0x7fcf2a+'\x20'[_0x2bf97f(0x258)](Math['max'](0x1,_0x39ded4))+a54_0x26125e['dim'](_0x5e6f5e),_0x1f74af=getTaskStateIcon(_0x9c78fd[_0x2bf97f(0x16d)]),_0x21e461=new Array(_0x3a7aa9)[_0x2bf97f(0x28b)]('\x20');if(_0x9c78fd['window']){const _0xb5cfb0=timeToPosition(_0x9c78fd[_0x2bf97f(0x2bc)]['start'],_0x363876,_0x3a7aa9),_0x5cc4e4=timeToPosition(_0x9c78fd['window'][_0x2bf97f(0x19e)],_0x363876,_0x3a7aa9),_0x439a40=getBarChar(_0x9c78fd['state']),_0xcf5dbd=Math[_0x2bf97f(0x224)](_0xb5cfb0+0x1,_0x5cc4e4);for(let _0x3bb19e=_0xb5cfb0;_0x3bb19e<Math[_0x2bf97f(0x121)](_0xcf5dbd,_0x3a7aa9);_0x3bb19e++){_0x21e461[_0x3bb19e]=_0x439a40;}}const _0x17cc1b=getBarColor(_0x9c78fd[_0x2bf97f(0x16d)]),_0x30a268=_0x21e461[_0x2bf97f(0x136)](_0x59b302=>_0x59b302==='\x20'?'\x20':_0x17cc1b(_0x59b302))['join']('');return _0x1f74af+'\x20'+_0x54a427+'│'+_0x30a268+'│';}function calculateStats(_0x58f735){const _0x1e565d=a54_0x54edc0,_0x8eb6ca={'total':_0x58f735[_0x1e565d(0x274)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2bfc67 of _0x58f735){if(_0x2bfc67['state']===_0x1e565d(0x2bb))_0x8eb6ca['success']++;else{if(_0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x279)||_0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x1cc))_0x8eb6ca[_0x1e565d(0x279)]++;else _0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x187)?_0x8eb6ca[_0x1e565d(0x187)]++:_0x8eb6ca[_0x1e565d(0x1a6)]++;}}return _0x8eb6ca;}function formatStats(_0x580882){const _0x3b3773=a54_0x54edc0;return[_0x3b3773(0x29c)+_0x580882['total'],'✅\x20'+_0x580882[_0x3b3773(0x2bb)],'❌\x20'+_0x580882[_0x3b3773(0x279)],'🔄\x20'+_0x580882[_0x3b3773(0x187)],'⏳\x20'+_0x580882[_0x3b3773(0x1a6)]][_0x3b3773(0x2a6)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:timeline';['description']=a54_0x54edc0(0x293);async['execute'](_0x20f606){const _0x150fc0=a54_0x54edc0,{options:_0x428b3e,args:_0x266855,tdx:_0x34fc41}=_0x20f606;let _0xd49f4d,_0x1db12,_0x506bc2=![];if(_0x266855[0x0]){if(_0x266855[0x0][_0x150fc0(0x183)]('.')){const _0x3bf6d7=this[_0x150fc0(0x124)](_0x266855,_0x428b3e);if(!_0x3bf6d7)return 0x1;_0xd49f4d=_0x3bf6d7[_0x150fc0(0x1d7)],_0x1db12=_0x3bf6d7[_0x150fc0(0x1be)];}else{_0x1db12=_0x266855[0x0],_0xd49f4d=_0x428b3e[_0x150fc0(0x198)];if(!_0xd49f4d)return console[_0x150fc0(0x279)](a54_0x26125e[_0x150fc0(0x16f)]('Error:'),_0x150fc0(0x180)),0x1;_0x506bc2=!![];}}else{const _0x135ece=this[_0x150fc0(0x124)](_0x266855,_0x428b3e);if(!_0x135ece)return 0x1;_0xd49f4d=_0x135ece['projectName'],_0x1db12=_0x135ece['workflowName'];}if(_0x428b3e['verbose']){if(_0xd49f4d&&_0x1db12)console['error']('Filter:\x20'+_0xd49f4d+'.'+_0x1db12);else _0xd49f4d&&console[_0x150fc0(0x279)](_0x150fc0(0x22e)+_0xd49f4d);}const _0x162520=_0x428b3e[_0x150fc0(0x28e)],_0x25cc4d=_0x428b3e[_0x150fc0(0x1fe)];if(_0x162520){_0x25cc4d&&console[_0x150fc0(0x279)](a54_0x26125e[_0x150fc0(0x21c)](_0x150fc0(0x27c)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x5435fa=_0x428b3e[_0x150fc0(0x16b)];return _0x5435fa?await this[_0x150fc0(0x242)](_0x20f606,_0x162520):await this[_0x150fc0(0x122)](_0x20f606,_0x162520,_0x428b3e),0x0;}if(_0x25cc4d){const _0x187707=await withSpinner(_0x150fc0(0x150),()=>_0x34fc41['workflow'][_0x150fc0(0x173)]({'projectName':_0xd49f4d,'workflowName':_0x1db12,'limit':0x64}),{'verbose':_0x428b3e[_0x150fc0(0x1f9)]}),_0x5b5074=_0x187707[_0x150fc0(0x199)][_0x150fc0(0x1b0)](_0x2082f2=>_0x2082f2['id']===_0x25cc4d);if(!_0x5b5074)return console['error'](a54_0x26125e['red'](_0x150fc0(0x14e)),'Session\x20not\x20found:\x20'+_0x25cc4d),0x1;if(!_0x5b5074[_0x150fc0(0x2b7)]?.['id'])return console['error'](a54_0x26125e['red'](_0x150fc0(0x14e)),'Session\x20'+_0x25cc4d+'\x20has\x20no\x20attempts'),0x1;const _0x54fc18=_0x5b5074[_0x150fc0(0x2b7)]['id'];_0x428b3e[_0x150fc0(0x1f9)]&&console[_0x150fc0(0x279)](_0x150fc0(0x196)+_0x54fc18+_0x150fc0(0x11f)+_0x25cc4d);const _0x2b2bd1=_0x428b3e[_0x150fc0(0x16b)];return _0x2b2bd1?await this[_0x150fc0(0x242)](_0x20f606,_0x54fc18):await this['renderSingleTimeline'](_0x20f606,_0x54fc18,_0x428b3e),0x0;}const _0x42ebdc=await withSpinner('Loading\x20sessions...',()=>_0x34fc41['workflow']['sessions']({'projectName':_0xd49f4d,'workflowName':_0x1db12,'limit':_0x428b3e[_0x150fc0(0x21e)]||0x32}),{'verbose':_0x428b3e[_0x150fc0(0x1f9)]}),_0x3885a6=_0x42ebdc[_0x150fc0(0x199)];if(_0x3885a6[_0x150fc0(0x274)]===0x0){if(_0xd49f4d&&_0x1db12)console[_0x150fc0(0x279)](_0x150fc0(0x13a)+_0xd49f4d+'.'+_0x1db12);else _0xd49f4d?console[_0x150fc0(0x279)](_0x150fc0(0x21a)+_0xd49f4d):(console[_0x150fc0(0x279)](_0x150fc0(0x17a)),console[_0x150fc0(0x279)](a54_0x26125e['dim'](_0x150fc0(0x26e))));return 0x0;}_0x3885a6[_0x150fc0(0x1f8)]((_0x3c6153,_0x11f9f2)=>{const _0x1997c0=_0x150fc0,_0x1e8cc3=_0x3c6153[_0x1997c0(0x2b9)]||'',_0x26b20f=_0x11f9f2['sessionTime']||'';return _0x26b20f[_0x1997c0(0x267)](_0x1e8cc3);});if(_0x428b3e[_0x150fc0(0x11d)]||_0x428b3e[_0x150fc0(0x245)])return await handleSDKOutput(_0x3885a6,_0x428b3e),0x0;let _0x85c937;if(_0x506bc2){const _0x31fadb=_0x3885a6[0x0];if(!_0x31fadb[_0x150fc0(0x2b7)]?.['id'])return console[_0x150fc0(0x279)](_0x150fc0(0x226)),0x0;_0x85c937=_0x31fadb['lastAttempt']['id'],_0x428b3e[_0x150fc0(0x1f9)]&&console[_0x150fc0(0x279)](_0x150fc0(0x264)+_0x31fadb[_0x150fc0(0x2b9)]);}else{const _0x123a5b=_0x3885a6[_0x150fc0(0x136)](_0x3ab303=>{const _0x3f30b0=_0x150fc0,_0x2d6049=getAttemptStatusDisplay(_0x3ab303[_0x3f30b0(0x2b7)]);return{'title':_0x3ab303[_0x3f30b0(0x21d)]?.[_0x3f30b0(0x231)]+'.'+_0x3ab303['workflow']?.[_0x3f30b0(0x231)]+_0x3f30b0(0x2c2)+_0x3ab303[_0x3f30b0(0x2b9)]+'\x20'+_0x2d6049[_0x3f30b0(0x1b6)],'value':_0x3ab303[_0x3f30b0(0x2b7)]?.['id']||'','description':_0x2d6049[_0x3f30b0(0x1e7)]};}),_0x3d79d5=await a54_0x1aee3d({'type':_0x150fc0(0x1b3),'name':_0x150fc0(0x28e),'message':_0x150fc0(0x1cb),'choices':_0x123a5b[_0x150fc0(0x217)](_0x493c47=>_0x493c47['value']!=='')});if(!_0x3d79d5[_0x150fc0(0x28e)])return 0x0;_0x85c937=_0x3d79d5['attemptId'];}const _0x376301=_0x428b3e['follow'];return _0x376301?await this[_0x150fc0(0x242)](_0x20f606,_0x85c937):await this[_0x150fc0(0x122)](_0x20f606,_0x85c937,_0x428b3e),0x0;}async[a54_0x54edc0(0x122)](_0x282666,_0x40e88b,_0xdf6253){const _0x44617d=a54_0x54edc0,{tdx:_0x1559ff}=_0x282666;let _0x3cf730,_0xf523c4;try{[_0x3cf730,_0xf523c4]=await Promise[_0x44617d(0x168)]([_0x1559ff['workflow']['attempt'](_0x40e88b),_0x1559ff[_0x44617d(0x169)][_0x44617d(0x1a3)](_0x40e88b,![])]);}catch(_0x11af50){console[_0x44617d(0x279)](a54_0x26125e[_0x44617d(0x16f)](_0x44617d(0x28a)));_0xdf6253[_0x44617d(0x1f9)]&&console[_0x44617d(0x279)](_0x11af50);throw _0x11af50;}if(_0xdf6253[_0x44617d(0x11d)]||_0xdf6253[_0x44617d(0x245)]){const _0x32e177=this[_0x44617d(0x128)](_0x3cf730,_0xf523c4);await handleSDKOutput([_0x32e177],_0xdf6253);return;}const _0x470d91=_0x1559ff[_0x44617d(0x2c9)]['site'],_0x4f62c8=this[_0x44617d(0x12f)](_0x3cf730,_0xf523c4,_0x470d91);console['log'](_0x4f62c8);}async[a54_0x54edc0(0x242)](_0xb08079,_0x190dfc){const _0x1ef838=a54_0x54edc0,{tdx:_0x3f17a1}=_0xb08079,_0x2ee38f=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1f07ac=TIMELINE_CONFIG[_0x1ef838(0x18d)];let _0x576d5f=0x0;while(_0x576d5f<_0x1f07ac){process[_0x1ef838(0x1ce)]['isTTY']&&process[_0x1ef838(0x1ce)][_0x1ef838(0x15c)]('\x1bc');let _0x4a15f2,_0xf689b4;try{[_0x4a15f2,_0xf689b4]=await Promise[_0x1ef838(0x168)]([_0x3f17a1[_0x1ef838(0x169)][_0x1ef838(0x164)](_0x190dfc),_0x3f17a1['workflow'][_0x1ef838(0x1a3)](_0x190dfc,![])]);}catch(_0x65ef01){console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x16f)](_0x1ef838(0x1a9)));_0x576d5f>0x0&&console[_0x1ef838(0x279)](a54_0x26125e['dim'](_0x1ef838(0x190)+_0x576d5f));throw _0x65ef01;}const _0x189557=_0x3f17a1[_0x1ef838(0x2c9)][_0x1ef838(0x232)],_0x5e3621=this[_0x1ef838(0x12f)](_0x4a15f2,_0xf689b4,_0x189557);console[_0x1ef838(0x25d)](_0x5e3621);const _0xd94f6f=_0x4a15f2[_0x1ef838(0x188)]&&_0xf689b4[_0x1ef838(0x227)](_0x167c4f=>_0x167c4f[_0x1ef838(0x16d)]!==_0x1ef838(0x187)&&_0x167c4f[_0x1ef838(0x16d)]!=='planned');if(_0xd94f6f){console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x208)](_0x1ef838(0x23b)));break;}console['error'](a54_0x26125e[_0x1ef838(0x13e)](_0x1ef838(0x203)+_0x576d5f*0x2+_0x1ef838(0x215))),await new Promise(_0x567d6c=>setTimeout(_0x567d6c,_0x2ee38f)),_0x576d5f++;}_0x576d5f>=_0x1f07ac&&console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x21c)](_0x1ef838(0x209)));}[a54_0x54edc0(0x12f)](_0x1ba4a1,_0x12874f,_0x5655f2){const _0xadec5=a54_0x54edc0,_0x5c7da7=[],_0x4c9f62=TIMELINE_CONFIG[_0xadec5(0x2a4)],_0x2be1d3=0x5,_0x2dff32=process[_0xadec5(0x1ce)][_0xadec5(0x2c3)]||0x78,_0x447349=_0x2dff32-_0x4c9f62-_0x2be1d3,_0x36633e=Math[_0xadec5(0x224)](TIMELINE_CONFIG[_0xadec5(0x133)],Math[_0xadec5(0x121)](_0x447349,TIMELINE_CONFIG[_0xadec5(0x20f)])),_0x444847=new Date(_0x1ba4a1[_0xadec5(0x145)])[_0xadec5(0x284)](),_0x4da4e5=_0x1ba4a1['finishedAt']?new Date(_0x1ba4a1[_0xadec5(0x16e)])[_0xadec5(0x284)]():Date['now'](),_0x57a84f={'start':_0x444847,'end':_0x4da4e5,'duration':_0x4da4e5-_0x444847},_0x5a7f44=new Map(),_0x34bc42=[];for(const _0x4b2eb0 of _0x12874f){if(_0x4b2eb0[_0xadec5(0x1ae)]){const _0x3e83ad=new Date(_0x4b2eb0[_0xadec5(0x1ae)])[_0xadec5(0x284)](),_0x2de10b=_0x4b2eb0['updatedAt']?new Date(_0x4b2eb0[_0xadec5(0x246)])[_0xadec5(0x284)]():Date['now'](),_0x542989={'start':_0x3e83ad,'end':_0x2de10b,'duration':_0x2de10b-_0x3e83ad};_0x5a7f44[_0xadec5(0x11e)](_0x4b2eb0['id'],_0x542989),_0x34bc42[_0xadec5(0x167)]({'name':_0x4b2eb0[_0xadec5(0x16a)],'state':_0x4b2eb0['state']||_0xadec5(0x214),'window':_0x542989});}else _0x34bc42['push']({'name':_0x4b2eb0[_0xadec5(0x16a)],'state':_0x4b2eb0['state']||_0xadec5(0x161),'window':undefined});}_0x34bc42['sort']((_0x56e277,_0x183d7e)=>{const _0xa8d7af=_0xadec5;if(!_0x56e277[_0xa8d7af(0x2bc)])return 0x1;if(!_0x183d7e[_0xa8d7af(0x2bc)])return-0x1;return _0x56e277[_0xa8d7af(0x2bc)]['start']-_0x183d7e[_0xa8d7af(0x2bc)][_0xa8d7af(0x218)];});const _0x5cddeb=_0x34bc42[_0xadec5(0x274)],_0x57fe38=_0x5cddeb>TIMELINE_CONFIG[_0xadec5(0x244)];_0x57fe38&&_0x34bc42[_0xadec5(0x239)](TIMELINE_CONFIG[_0xadec5(0x244)]);const _0x13460d=calculateTimeScale(_0x57a84f,_0x36633e),_0x5d3954=_0x1ba4a1[_0xadec5(0x188)]?_0x1ba4a1[_0xadec5(0x2bb)]?a54_0x26125e[_0xadec5(0x208)](_0xadec5(0x2bb)):a54_0x26125e[_0xadec5(0x16f)](_0xadec5(0x279)):a54_0x26125e[_0xadec5(0x154)]('running'),_0x3eaaa1=_0x1ba4a1['project']?.['id'],_0x4236e4=_0x1ba4a1['sessionId'];let _0x5c5eb0;if(_0x3eaaa1&&_0x4236e4){const _0x20fab7=getWorkflowAttemptUrl(_0x5655f2,_0x3eaaa1,_0x4236e4,_0x1ba4a1['id']);_0x5c5eb0=hyperlink(a54_0x26125e['dim'](_0x1ba4a1['id']),_0x20fab7);}else _0x5c5eb0=a54_0x26125e[_0xadec5(0x13e)](_0x1ba4a1['id']);_0x5c7da7[_0xadec5(0x167)]('Attempt:\x20'+_0x5c5eb0+_0xadec5(0x2c2)+_0x5d3954+_0xadec5(0x2c2)+formatElapsed(_0x57a84f['duration']));if(_0x34bc42['length']>0x0){const _0x29bdd4=renderTimeAxis(_0x13460d,_0x36633e),_0xa7a550=new Date(_0x57a84f['start']),_0x3cc83f=formatDate(_0xa7a550),_0x2113ac=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x4c9f62,_0x482c2c=_0x3cc83f[_0xadec5(0x1d9)](_0x2113ac),_0x2e5d22=a54_0x26125e[_0xadec5(0x13e)](_0x482c2c);_0x5c7da7[_0xadec5(0x167)](_0x2e5d22+'\x20'+_0x29bdd4);for(const _0x4739a5 of _0x34bc42){_0x5c7da7['push'](renderTaskRow(_0x4739a5,_0x13460d,_0x36633e,_0x4c9f62));}const _0x18c420=calculateStats(_0x34bc42);_0x5c7da7['push'](formatStats(_0x18c420)),_0x57fe38&&_0x5c7da7[_0xadec5(0x167)](a54_0x26125e['yellow'](_0xadec5(0x240)+TIMELINE_CONFIG[_0xadec5(0x244)]+_0xadec5(0x15a)+_0x5cddeb+_0xadec5(0x15d))),_0x5c7da7[_0xadec5(0x167)](''),_0x5c7da7[_0xadec5(0x167)](a54_0x26125e['dim'](_0xadec5(0x18a))+('tdx\x20wf\x20attempt\x20'+_0x1ba4a1['id']+_0xadec5(0x263))+a54_0x26125e[_0xadec5(0x13e)](_0xadec5(0x1a0)));}else _0x5c7da7['push'](_0xadec5(0x25e));return _0x5c7da7[_0xadec5(0x2a6)]('\x0a');}[a54_0x54edc0(0x128)](_0x3a7a12,_0x3c7ec1){const _0x52f8c0=a54_0x54edc0,_0x5b2ee2=new Date(_0x3a7a12[_0x52f8c0(0x145)])[_0x52f8c0(0x284)](),_0x20e7df=_0x3a7a12[_0x52f8c0(0x16e)]?new Date(_0x3a7a12[_0x52f8c0(0x16e)])['getTime']():Date[_0x52f8c0(0x2be)](),_0xf51666=_0x20e7df-_0x5b2ee2,_0x462639=[];for(const _0x3acb20 of _0x3c7ec1){if(_0x3acb20[_0x52f8c0(0x1ae)]){const _0x645683=new Date(_0x3acb20[_0x52f8c0(0x1ae)])[_0x52f8c0(0x284)](),_0x29e97c=_0x3acb20[_0x52f8c0(0x246)]?new Date(_0x3acb20[_0x52f8c0(0x246)])[_0x52f8c0(0x284)]():Date[_0x52f8c0(0x2be)]();_0x462639['push']({'name':_0x3acb20[_0x52f8c0(0x16a)],'state':_0x3acb20[_0x52f8c0(0x16d)]||_0x52f8c0(0x214),'window':{'start':_0x645683,'end':_0x29e97c,'duration':_0x29e97c-_0x645683}});}else _0x462639[_0x52f8c0(0x167)]({'name':_0x3acb20['fullName'],'state':_0x3acb20[_0x52f8c0(0x16d)]||_0x52f8c0(0x161),'window':undefined});}const _0x20110c=calculateStats(_0x462639);return{'attempt':{'id':_0x3a7a12['id'],'status':_0x3a7a12[_0x52f8c0(0x188)]?_0x3a7a12['success']?'success':_0x52f8c0(0x279):_0x52f8c0(0x187),'createdAt':_0x3a7a12[_0x52f8c0(0x145)],'finishedAt':_0x3a7a12['finishedAt'],'duration_ms':_0xf51666},'tasks':_0x462639[_0x52f8c0(0x136)](_0x12bca8=>({'name':_0x12bca8['name'],'state':_0x12bca8['state'],'startedAt':_0x12bca8[_0x52f8c0(0x2bc)]?new Date(_0x12bca8[_0x52f8c0(0x2bc)][_0x52f8c0(0x218)])['toISOString']():null,'updatedAt':_0x12bca8[_0x52f8c0(0x2bc)]?new Date(_0x12bca8[_0x52f8c0(0x2bc)]['end'])[_0x52f8c0(0x139)]():null,'duration_ms':_0x12bca8[_0x52f8c0(0x2bc)]?.[_0x52f8c0(0x278)]||null})),'stats':_0x20110c};}}
|
|
1
|
+
function a54_0x597d(_0x3be6d8,_0x4f7ef0){_0x3be6d8=_0x3be6d8-0x165;const _0x1b76e9=a54_0x1b76();let _0x597dfe=_0x1b76e9[_0x3be6d8];return _0x597dfe;}const a54_0x5bba2d=a54_0x597d;(function(_0x168f04,_0x4b432a){const _0x201bd4=a54_0x597d,_0x1e624b=_0x168f04();while(!![]){try{const _0xdcd6dc=-parseInt(_0x201bd4(0x2fd))/0x1+parseInt(_0x201bd4(0x210))/0x2*(parseInt(_0x201bd4(0x207))/0x3)+parseInt(_0x201bd4(0x2f3))/0x4*(parseInt(_0x201bd4(0x2c3))/0x5)+-parseInt(_0x201bd4(0x1f7))/0x6*(-parseInt(_0x201bd4(0x1e3))/0x7)+parseInt(_0x201bd4(0x1b7))/0x8+-parseInt(_0x201bd4(0x2fb))/0x9+-parseInt(_0x201bd4(0x1aa))/0xa;if(_0xdcd6dc===_0x4b432a)break;else _0x1e624b['push'](_0x1e624b['shift']());}catch(_0x44ace3){_0x1e624b['push'](_0x1e624b['shift']());}}}(a54_0x1b76,0x3fc89));import a54_0x425391 from'chalk';import{existsSync}from'fs';import a54_0x55dc3e 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_0x2e7bce from'prompts';function getAttemptStatusDisplay(_0x5af573){const _0x441e9e=a54_0x597d;if(!_0x5af573)return{'icon':'⏳','text':''};const {done:_0x5884a0,success:_0x4677e1,cancelRequested:_0x2525ce}=_0x5af573;if(!_0x5884a0)return _0x2525ce?{'icon':'🛑','text':a54_0x425391[_0x441e9e(0x1f9)](_0x441e9e(0x227))}:{'icon':'🔄','text':a54_0x425391[_0x441e9e(0x1b8)](_0x441e9e(0x1d5))};if(_0x4677e1)return{'icon':'✅','text':a54_0x425391[_0x441e9e(0x2b6)]('success')};return{'icon':'❌','text':a54_0x425391['red'](_0x441e9e(0x28c))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x5bba2d(0x1d0)](_0x37b534,_0x30c3d9,_0x4c9dd0=0x0){const _0x73f563=a54_0x5bba2d;return _0x37b534[_0x4c9dd0]||_0x30c3d9[_0x73f563(0x2eb)];}[a54_0x5bba2d(0x1c6)](_0xfa0ba5,_0xbd5680,_0x44470=0x0){const _0x255c7f=a54_0x5bba2d,_0xa65b78=this[_0x255c7f(0x1d0)](_0xfa0ba5,_0xbd5680,_0x44470);if(!_0xa65b78)return console[_0x255c7f(0x28c)](a54_0x425391[_0x255c7f(0x28b)](_0x255c7f(0x1f0)),_0x255c7f(0x1e6)),console[_0x255c7f(0x28c)](a54_0x425391[_0x255c7f(0x1af)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0xa65b78;}[a54_0x5bba2d(0x1df)](_0x424dfc,_0x1fe6e0){const _0x1a86d9=a54_0x5bba2d;if(_0x424dfc[0x0]){const _0x5168ea=_0x424dfc[0x0][_0x1a86d9(0x195)]('.');if(_0x5168ea[_0x1a86d9(0x2c0)]===0x1)return{'projectName':_0x5168ea[0x0],'workflowName':undefined};else return _0x5168ea[_0x1a86d9(0x2c0)]===0x2?{'projectName':_0x5168ea[0x0],'workflowName':_0x5168ea[0x1]}:(console[_0x1a86d9(0x28c)](a54_0x425391[_0x1a86d9(0x28b)](_0x1a86d9(0x1f0)),_0x1a86d9(0x179)),null);}return{'projectName':_0x1fe6e0[_0x1a86d9(0x2eb)],'workflowName':undefined};}[a54_0x5bba2d(0x266)](_0x552dce,_0xa23db4,_0x4541ea=0x0){const _0xcbc134=a54_0x5bba2d;if(_0x552dce[_0x4541ea])return _0x552dce[_0x4541ea];if(_0xa23db4[_0xcbc134(0x2eb)]){const _0x1eaf52=a54_0x55dc3e[_0xcbc134(0x18a)](process['cwd'](),'workflows',_0xa23db4['workflowProject']);if(existsSync(a54_0x55dc3e[_0xcbc134(0x18a)](_0x1eaf52,_0xcbc134(0x1e8))))return _0x1eaf52;}return undefined;}async['showWorkflowConsoleUrl'](_0x416ed9,_0x54b550,_0x3fc7d1){const _0x2f8579=a54_0x5bba2d;try{const _0x57d6bc=await _0x416ed9[_0x2f8579(0x2ba)][_0x2f8579(0x203)](_0x54b550,{'limit':0x1});if(_0x57d6bc[_0x2f8579(0x2c0)]>0x0){const _0x4e71e8=_0x57d6bc[0x0]['id'],_0x2c0b3d=getWorkflowUrl(_0x3fc7d1,_0x4e71e8);console[_0x2f8579(0x28c)]('\x20\x20Console:\x20'+a54_0x425391[_0x2f8579(0x183)](_0x2c0b3d));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1bf);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x1b2);async['execute'](_0x1b4007){const _0x3ca223=a54_0x5bba2d,{options:_0x41ab41,args:_0x3e1507,tdx:_0x5b9efa}=_0x1b4007,_0x3c6c85=_0x3e1507[0x0],_0x59a124=_0x41ab41[_0x3ca223(0x243)];if(_0x59a124)return saveSessionContext({'workflow_project':undefined},_0x41ab41[_0x3ca223(0x2d6)]),console[_0x3ca223(0x26b)](a54_0x425391[_0x3ca223(0x2b6)](_0x3ca223(0x2b4))),0x0;if(!_0x3c6c85)return console[_0x3ca223(0x28c)](a54_0x425391[_0x3ca223(0x28b)](_0x3ca223(0x1f0)),_0x3ca223(0x1e6)),console[_0x3ca223(0x28c)](a54_0x425391['dim'](_0x3ca223(0x1b4))),console[_0x3ca223(0x28c)](a54_0x425391[_0x3ca223(0x1af)](_0x3ca223(0x27a))),0x1;const _0x2eeb6c=await withSpinner('Resolving\x20project\x20\x27'+_0x3c6c85+'\x27...',()=>_0x5b9efa['workflow'][_0x3ca223(0x298)](_0x3c6c85),{'verbose':_0x41ab41[_0x3ca223(0x26a)]}),{name:_0x3111c1}=_0x2eeb6c[_0x3ca223(0x197)];return saveSessionContext({'workflow_project':_0x3111c1},_0x41ab41[_0x3ca223(0x2d6)]),console['log'](a54_0x425391['green'](_0x3ca223(0x238)+a54_0x425391[_0x3ca223(0x183)](_0x3111c1))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x5bba2d(0x310)]='workflow:projects';['description']='List\x20all\x20workflow\x20projects';async[a54_0x5bba2d(0x321)](_0x305272){const _0x191b3c=a54_0x5bba2d,{options:_0x4b162e,args:_0x4cbd3b,tdx:_0x3c08dd}=_0x305272,_0x5c5ba4=_0x4cbd3b[0x0];_0x4b162e[_0x191b3c(0x26a)]&&_0x5c5ba4&&console[_0x191b3c(0x28c)]('Pattern:\x20'+_0x5c5ba4);const _0x165c7a=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x3c08dd['workflow'][_0x191b3c(0x2e1)](_0x5c5ba4,{'limit':_0x4b162e[_0x191b3c(0x2d9)]}),{'verbose':_0x4b162e['verbose']});let _0x205500=_0x165c7a[_0x191b3c(0x197)];_0x205500[_0x191b3c(0x29f)]((_0x20ec29,_0x1674de)=>_0x20ec29[_0x191b3c(0x310)]['localeCompare'](_0x1674de['name']));const _0x4617e1=_0x4b162e[_0x191b3c(0x2d9)]||0x64,_0x72b1ff=_0x205500['length']>=_0x4617e1?a54_0x425391[_0x191b3c(0x1af)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x191b3c(0x28c)](_0x191b3c(0x1ff)+_0x205500[_0x191b3c(0x2c0)]+'\x20project'+(_0x205500[_0x191b3c(0x2c0)]!==0x1?'s':'')+_0x72b1ff);if(_0x4b162e[_0x191b3c(0x24d)]===_0x191b3c(0x257)||_0x4b162e[_0x191b3c(0x24d)]===_0x191b3c(0x242)||_0x4b162e[_0x191b3c(0x24d)]===_0x191b3c(0x293))await handleSDKOutput(_0x205500,_0x4b162e);else{if(_0x205500[_0x191b3c(0x2c0)]===0x0)_0x5c5ba4?console[_0x191b3c(0x26b)](_0x191b3c(0x18b)+_0x5c5ba4):console[_0x191b3c(0x26b)]('No\x20workflow\x20projects\x20found');else{const _0x3dcf76=_0x205500[_0x191b3c(0x318)](_0x4fe486=>{const _0x3f7002=_0x191b3c,_0x5f0014=_0x4fe486[_0x3f7002(0x1ab)]?.[_0x3f7002(0x2ae)](_0x2fddda=>_0x2fddda[_0x3f7002(0x30b)]===_0x3f7002(0x2b0)),_0x2c85b6=_0x5f0014?a54_0x425391['dim'](_0x3f7002(0x29a)):'';return _0x3f7002(0x255)+_0x4fe486[_0x3f7002(0x310)]+_0x2c85b6;});await writeOutput(_0x3dcf76[_0x191b3c(0x18a)]('\x0a'),_0x4b162e[_0x191b3c(0x1cd)],_0x191b3c(0x29d));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x240);async[a54_0x5bba2d(0x321)](_0x32a2e6){const _0x1856e6=a54_0x5bba2d,{options:_0x1c5d3b,args:_0x4b9861,tdx:_0x1cd913}=_0x32a2e6,_0x550c59=this[_0x1856e6(0x1d0)](_0x4b9861,_0x1c5d3b);_0x1c5d3b[_0x1856e6(0x26a)]&&_0x550c59&&console[_0x1856e6(0x28c)](_0x1856e6(0x261)+_0x550c59);const _0x26ee72=await withSpinner(_0x1856e6(0x1e1),()=>_0x1cd913[_0x1856e6(0x2ba)][_0x1856e6(0x203)](_0x550c59,{'limit':_0x1c5d3b[_0x1856e6(0x2d9)]}),{'verbose':_0x1c5d3b[_0x1856e6(0x26a)]});let _0x588fef=_0x26ee72['data'];_0x588fef[_0x1856e6(0x29f)]((_0x1945af,_0x33c6c1)=>{const _0x378608=_0x1856e6,_0x5a6683=_0x1945af[_0x378608(0x310)][_0x378608(0x23d)](_0x33c6c1[_0x378608(0x310)]);if(_0x5a6683!==0x0)return _0x5a6683;return(_0x1945af[_0x378608(0x22a)]?.[_0x378608(0x310)]||'')[_0x378608(0x23d)](_0x33c6c1['project']?.[_0x378608(0x310)]||'');});const _0x2079c6=_0x1c5d3b['limit']||0x64,_0x2092c1=_0x588fef[_0x1856e6(0x2c0)]>=_0x2079c6?a54_0x425391[_0x1856e6(0x1af)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x1856e6(0x1ff)+_0x588fef[_0x1856e6(0x2c0)]+_0x1856e6(0x27e)+(_0x588fef[_0x1856e6(0x2c0)]!==0x1?'s':'')+_0x2092c1);if(_0x1c5d3b[_0x1856e6(0x24d)]==='json'||_0x1c5d3b[_0x1856e6(0x24d)]==='jsonl'||_0x1c5d3b[_0x1856e6(0x24d)]===_0x1856e6(0x293))await handleSDKOutput(_0x588fef,_0x1c5d3b);else{if(_0x588fef[_0x1856e6(0x2c0)]===0x0)_0x550c59?console[_0x1856e6(0x26b)](_0x1856e6(0x1d6)+_0x550c59):console[_0x1856e6(0x26b)](_0x1856e6(0x2d1));else{const _0x155b45=_0x1c5d3b[_0x1856e6(0x20b)],_0x523914=_0x588fef[_0x1856e6(0x318)](_0xc38280=>{const _0x2aa138=_0x1856e6,_0xfe7a26=a54_0x425391['dim']('#'+_0xc38280['id']),_0x31259b=hyperlink(_0xfe7a26,getWorkflowUrl(_0x155b45,_0xc38280['id'])),_0x152828=_0xc38280[_0x2aa138(0x22a)]?.[_0x2aa138(0x310)]?a54_0x425391['dim']('\x20('+_0xc38280[_0x2aa138(0x22a)][_0x2aa138(0x310)]+')'):'';return _0x2aa138(0x2bd)+_0x31259b+'\x20'+_0xc38280[_0x2aa138(0x310)]+_0x152828;});await writeOutput(_0x523914[_0x1856e6(0x18a)]('\x0a'),_0x1c5d3b[_0x1856e6(0x1cd)],_0x1856e6(0x29d));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1c2);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x189);async['execute'](_0xe34f8d){const _0x551155=a54_0x5bba2d,{options:_0x34abdd,args:_0x1448a8,tdx:_0x564820}=_0xe34f8d,_0x115949=this[_0x551155(0x1df)](_0x1448a8,_0x34abdd);if(!_0x115949)return 0x1;const {projectName:_0x2deae0,workflowName:_0x2904b9}=_0x115949;if(_0x34abdd['verbose']){if(_0x2deae0&&_0x2904b9)console['error'](_0x551155(0x28a)+_0x2deae0+'.'+_0x2904b9);else _0x2deae0&&console[_0x551155(0x28c)](_0x551155(0x30f)+_0x2deae0);const _0x13804a=_0x34abdd[_0x551155(0x27b)];_0x13804a&&console[_0x551155(0x28c)](_0x551155(0x315)+_0x13804a);}let _0x45786d=0x28;if(process[_0x551155(0x2a4)][_0x551155(0x1f3)]&&!_0x34abdd[_0x551155(0x1cd)]&&!_0x34abdd[_0x551155(0x24d)]){const _0x21ca40=process['stdout'][_0x551155(0x254)]||0x28;_0x45786d=Math[_0x551155(0x307)](0x14,Math[_0x551155(0x1b0)](_0x21ca40*0x2/0x3));}const _0x53d486=_0x34abdd[_0x551155(0x2d9)]||_0x45786d,_0x7bf841=await withSpinner(_0x551155(0x2a6),()=>_0x564820[_0x551155(0x2ba)][_0x551155(0x2ce)]({'projectName':_0x2deae0,'workflowName':_0x2904b9,'status':_0x34abdd[_0x551155(0x27b)],'fromTime':_0x34abdd[_0x551155(0x23e)],'toTime':_0x34abdd['to'],'limit':_0x53d486}),{'verbose':_0x34abdd[_0x551155(0x26a)]}),_0x7dc51f=_0x7bf841[_0x551155(0x197)];_0x7dc51f['sort']((_0x33d9c4,_0x25e326)=>{const _0x15f11b=_0x551155,_0x1c6672=_0x33d9c4[_0x15f11b(0x24c)]||'',_0x1f5ed8=_0x25e326[_0x15f11b(0x24c)]||'';return _0x1f5ed8[_0x15f11b(0x23d)](_0x1c6672);});_0x7dc51f[_0x551155(0x2c0)]>=_0x53d486?console[_0x551155(0x28c)](_0x551155(0x2d0)+_0x7dc51f[_0x551155(0x2c0)]+_0x551155(0x17a)+a54_0x425391[_0x551155(0x1af)](_0x551155(0x2e8))):console['error'](_0x551155(0x1ff)+_0x7dc51f[_0x551155(0x2c0)]+_0x551155(0x22b)+(_0x7dc51f[_0x551155(0x2c0)]!==0x1?'s':''));if(_0x34abdd[_0x551155(0x24d)]===_0x551155(0x257)||_0x34abdd['format']==='jsonl'||_0x34abdd[_0x551155(0x24d)]===_0x551155(0x293))await handleSDKOutput(_0x7dc51f,_0x34abdd);else{if(!process['stdout'][_0x551155(0x1f3)]||_0x34abdd['output']){if(_0x7dc51f[_0x551155(0x2c0)]===0x0){if(_0x2deae0&&_0x2904b9)console[_0x551155(0x26b)](_0x551155(0x2c4)+_0x2deae0+'.'+_0x2904b9);else _0x2deae0?console['log'](_0x551155(0x288)+_0x2deae0):console['log'](_0x551155(0x20c));}else{const _0x18f91a=_0x34abdd[_0x551155(0x20b)],_0x17d62c=this[_0x551155(0x191)](_0x7dc51f,_0x18f91a);_0x34abdd['output']?await writeOutput(_0x17d62c,_0x34abdd[_0x551155(0x1cd)],'list'):console['log'](_0x17d62c);}!_0x2deae0&&(console['error'](''),console[_0x551155(0x28c)](a54_0x425391['dim'](_0x551155(0x249))),console[_0x551155(0x28c)](a54_0x425391[_0x551155(0x1af)](_0x551155(0x244))+'or'+a54_0x425391['dim'](_0x551155(0x18f))));}else{if(_0x7dc51f[_0x551155(0x2c0)]===0x0){if(_0x2deae0&&_0x2904b9)console[_0x551155(0x26b)]('No\x20sessions\x20found\x20for:\x20'+_0x2deae0+'.'+_0x2904b9);else _0x2deae0?console[_0x551155(0x26b)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2deae0):console[_0x551155(0x26b)](_0x551155(0x20c));}else await this['navigateSessionsInteractive'](_0x7dc51f,_0xe34f8d,_0x2deae0);}}return 0x0;}[a54_0x5bba2d(0x191)](_0x121c65,_0x22b55c){const _0x1586f6=a54_0x5bba2d,_0x20025f=[],_0x1781a2=new Map();let _0x45d44c=Infinity,_0x1da45b=-Infinity;for(const _0x316f86 of _0x121c65){if(_0x316f86['lastAttempt']?.[_0x1586f6(0x17f)]){const _0x34047e=new Date(_0x316f86[_0x1586f6(0x305)][_0x1586f6(0x17f)])['getTime'](),_0x5781a5=_0x316f86[_0x1586f6(0x305)]['finishedAt']?new Date(_0x316f86[_0x1586f6(0x305)]['finishedAt'])[_0x1586f6(0x2ef)]():Date['now'](),_0x420ee7=_0x316f86['project']?.[_0x1586f6(0x310)]||'(unknown)';!_0x1781a2['has'](_0x420ee7)&&_0x1781a2[_0x1586f6(0x323)](_0x420ee7,[]),_0x1781a2[_0x1586f6(0x31c)](_0x420ee7)[_0x1586f6(0x234)]({'session':_0x316f86,'startTime':_0x34047e,'endTime':_0x5781a5,'duration':_0x5781a5-_0x34047e}),_0x45d44c=Math[_0x1586f6(0x19a)](_0x45d44c,_0x34047e),_0x1da45b=Math[_0x1586f6(0x307)](_0x1da45b,_0x5781a5);}}if(_0x1781a2[_0x1586f6(0x190)]===0x0)return _0x1586f6(0x21e);const _0x26699f=process[_0x1586f6(0x2a4)][_0x1586f6(0x30c)]||0x78,_0x1e1cfc=0x1e,_0x34cc8f=0x32,_0x2c3f74=0x4,_0x5af2e0=Math[_0x1586f6(0x19a)](_0x34cc8f,Math[_0x1586f6(0x307)](_0x1e1cfc,Math[_0x1586f6(0x1b0)](_0x26699f*0.3))),_0x5aa7d9=_0x26699f-_0x5af2e0-TIMELINE_CONFIG[_0x1586f6(0x25a)]-0x3-_0x2c3f74,_0x19f75d=_0x1da45b-_0x45d44c,_0x1b62a3=_0x19f75d/_0x5af2e0,_0xd1bda0=renderTimeAxis({'startTime':_0x45d44c,'endTime':_0x1da45b,'durationMs':_0x19f75d,'msPerChar':_0x1b62a3},_0x5af2e0),_0x5168bf=[];for(const _0xffbaf6 of _0x1781a2['values']()){_0x5168bf[_0x1586f6(0x234)](..._0xffbaf6);}_0x5168bf[_0x1586f6(0x29f)]((_0x5430db,_0x2423fd)=>_0x2423fd[_0x1586f6(0x30d)]-_0x5430db[_0x1586f6(0x30d)]);const _0x3975ad=new Date(_0x45d44c),_0x41fcae=formatDate(_0x3975ad),_0x2986b4=_0x2c3f74+TIMELINE_CONFIG[_0x1586f6(0x2de)]+TIMELINE_CONFIG[_0x1586f6(0x1c4)]+_0x5aa7d9,_0x1cd6c7='\x20'['repeat'](_0x2986b4-_0x41fcae['length']),_0x2d73ad=_0x1cd6c7+a54_0x425391[_0x1586f6(0x1af)](_0x41fcae)+'\x20'+_0xd1bda0;_0x20025f[_0x1586f6(0x234)](_0x2d73ad);const _0x5734b9=0x16;let _0x24e3ba=0x0;for(const _0x494a0e of _0x5168bf){const _0x4fb5f8=_0x494a0e[_0x1586f6(0x2d6)][_0x1586f6(0x22a)]?.['name']||'?',_0x57e107=Math[_0x1586f6(0x19a)](stringWidth(_0x4fb5f8),_0x5734b9);_0x24e3ba=Math[_0x1586f6(0x307)](_0x24e3ba,_0x57e107);}for(const _0x43bba4 of _0x5168bf){const {session:_0x4728b7,startTime:_0x33747d,endTime:_0x1487f8,duration:_0x3a3b58}=_0x43bba4,_0xee4f11=_0x4728b7[_0x1586f6(0x22a)]?.['id'],_0xbd8666=_0x4728b7['id'],_0x25b35f=_0x4728b7[_0x1586f6(0x22a)]?.['name']||'?',_0x41204a=_0x4728b7[_0x1586f6(0x2ba)]?.[_0x1586f6(0x310)]||'?';let _0x4edf45,_0x451867;if(_0x4728b7[_0x1586f6(0x305)]){const _0x260129=_0x4728b7['lastAttempt'];!_0x260129[_0x1586f6(0x182)]?(_0x4edf45=_0x260129['cancelRequested']?'🛑':'🔄',_0x451867=_0x260129[_0x1586f6(0x1fd)]?a54_0x425391[_0x1586f6(0x1f9)]:a54_0x425391['blue']):(_0x4edf45=_0x260129[_0x1586f6(0x2e3)]?'✅':'❌',_0x451867=_0x260129[_0x1586f6(0x2e3)]?a54_0x425391[_0x1586f6(0x2b6)]:a54_0x425391[_0x1586f6(0x28b)]);}else _0x4edf45='⏳',_0x451867=a54_0x425391[_0x1586f6(0x1af)];const _0x3a9b37='#'+_0xbd8666,_0x1d7af7=_0xee4f11?hyperlink(_0x3a9b37,getWorkflowSessionUrl(_0x22b55c,_0xee4f11,_0xbd8666)):_0x3a9b37;let _0x17a4e4=_0x25b35f;stringWidth(_0x25b35f)>_0x5734b9&&(_0x17a4e4=_0x25b35f['slice'](0x0,_0x5734b9-0x1)+'…');const _0x18724a=a54_0x425391['dim'](_0x17a4e4),_0x18f3c9=stringWidth(_0x17a4e4),_0xc6522a='\x20'[_0x1586f6(0x1c8)](_0x24e3ba-stringWidth(_0x17a4e4)+0x2),_0x441b3f='('+formatElapsed(_0x3a3b58)+')',_0x4f58d4=stringWidth(_0x441b3f),_0x3db4bc=stringWidth(_0x3a9b37),_0x56f9b7=_0x3db4bc+0x1+_0x18f3c9+_0xc6522a[_0x1586f6(0x2c0)],_0x3b9f8c=_0x5aa7d9-_0x56f9b7-_0x4f58d4-0x1-0x8;let _0x4df616=_0x41204a;stringWidth(_0x4df616)>_0x3b9f8c&&(_0x4df616=_0x4df616[_0x1586f6(0x30e)](0x0,_0x3b9f8c-0x1)+'…');const _0x372570=_0x1d7af7+'\x20'+_0x18724a+_0xc6522a+_0x4df616,_0x5de7f6=stringWidth(_0x372570),_0x133ab4=_0x5aa7d9-_0x5de7f6-_0x4f58d4,_0x162bb7=_0x372570+'\x20'[_0x1586f6(0x1c8)](Math[_0x1586f6(0x307)](0x1,_0x133ab4))+a54_0x425391['dim'](_0x441b3f),_0x2778bc=Math[_0x1586f6(0x1b0)]((_0x33747d-_0x45d44c)/_0x1b62a3),_0x5443cc=Math[_0x1586f6(0x1b0)]((_0x1487f8-_0x45d44c)/_0x1b62a3),_0x5f233d=Math[_0x1586f6(0x307)](_0x2778bc+0x1,_0x5443cc),_0x2c3b27=new Array(_0x5af2e0)['fill']('\x20');for(let _0x52769d=_0x2778bc;_0x52769d<Math[_0x1586f6(0x19a)](_0x5f233d,_0x5af2e0);_0x52769d++){_0x2c3b27[_0x52769d]='─';}const _0x23b115=_0x2c3b27[_0x1586f6(0x318)](_0x2752b0=>_0x2752b0==='\x20'?'\x20':_0x451867(_0x2752b0))[_0x1586f6(0x18a)]('');_0x20025f[_0x1586f6(0x234)](_0x4edf45+'\x20'+_0x162bb7+'│'+_0x23b115+'│');}return _0x20025f['join']('\x0a');}async['navigateSessionsInteractive'](_0x292424,_0x2362e1,_0x28594d){const _0x16714b=a54_0x5bba2d,{options:_0x341c84,tdx:_0x4ad461}=_0x2362e1,_0x456d32=_0x341c84[_0x16714b(0x20b)],{timelineRows:_0x173c2a,timeAxisHeader:_0x37c22f}=this['generateSessionTimelineRows'](_0x292424,_0x456d32),_0x42efe7=_0x173c2a[_0x16714b(0x30a)](_0x562fcf=>_0x562fcf['attemptId']);if(_0x42efe7[_0x16714b(0x2c0)]===0x0){const _0x17456e=this[_0x16714b(0x191)](_0x292424,_0x456d32);console['log'](_0x17456e);!_0x28594d&&(console[_0x16714b(0x28c)](''),console[_0x16714b(0x28c)](a54_0x425391['dim'](_0x16714b(0x249))),console[_0x16714b(0x28c)](a54_0x425391['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x425391[_0x16714b(0x1af)](_0x16714b(0x18f))));return;}_0x37c22f&&console[_0x16714b(0x26b)](_0x37c22f);const _0x5221d4=_0x173c2a[_0x16714b(0x30a)](_0x1d628c=>_0x1d628c['attemptId'])[_0x16714b(0x318)](_0x28c1d0=>({'title':_0x28c1d0['displayLine'],'value':_0x28c1d0[_0x16714b(0x194)]})),_0x2d08b0=process[_0x16714b(0x2a4)][_0x16714b(0x254)]||0x3c,_0x24a332=Math['max'](0x28,Math[_0x16714b(0x1b0)](_0x2d08b0*0x2/0x3)),_0x5faed1=await a54_0x2e7bce({'type':'autocomplete','name':_0x16714b(0x194),'message':_0x16714b(0x1de),'choices':_0x5221d4,'initial':-0x1,'limit':_0x24a332,'clearFirst':!![],'fallback':{'title':_0x16714b(0x231),'value':null},'suggest':(_0x501b8b,_0x54b283)=>{const _0x49be04=_0x16714b;if(!_0x501b8b)return Promise[_0x49be04(0x1ce)](_0x54b283);const _0x5b52f8=_0x54b283['filter'](_0x2a4dd8=>{const _0xf87e96=_0x49be04,_0x44131b=_0x2a4dd8;return _0x44131b[_0xf87e96(0x224)]['toLowerCase']()[_0xf87e96(0x1a4)](_0x501b8b['toLowerCase']());});return Promise[_0x49be04(0x1ce)](_0x5b52f8);}}),_0x2735aa=()=>{const _0x5e06fb=_0x16714b;process[_0x5e06fb(0x2a4)][_0x5e06fb(0x196)](_0x5e06fb(0x22c)),process[_0x5e06fb(0x2a4)][_0x5e06fb(0x196)](_0x5e06fb(0x22c)),process[_0x5e06fb(0x2a4)][_0x5e06fb(0x196)](_0x5e06fb(0x22c));},_0x3e432d=_0x5faed1&&_0x5faed1[_0x16714b(0x194)]&&_0x5faed1[_0x16714b(0x194)]!==null&&_0x5faed1[_0x16714b(0x194)][_0x16714b(0x311)]()!=='';if(!_0x3e432d){_0x2735aa(),console[_0x16714b(0x26b)](a54_0x425391[_0x16714b(0x1af)](_0x16714b(0x1fb)));return;}_0x2735aa();const _0x509455=_0x292424[_0x16714b(0x248)](_0x5d5762=>_0x5d5762[_0x16714b(0x305)]?.['id']===_0x5faed1[_0x16714b(0x194)]);if(_0x509455){const _0x4a76e4=_0x509455[_0x16714b(0x22a)]?.['name']||'?',_0x4302e9=_0x509455[_0x16714b(0x2ba)]?.[_0x16714b(0x310)]||'?';console[_0x16714b(0x26b)](_0x16714b(0x1e7)+a54_0x425391[_0x16714b(0x1af)](_0x4a76e4)+',\x20Workflow:\x20'+a54_0x425391['dim'](_0x4302e9));}const _0x9bfa1a=new WorkflowTimelineCommand();await _0x9bfa1a[_0x16714b(0x321)]({'args':[],'options':{..._0x341c84,'attemptId':_0x5faed1[_0x16714b(0x194)]},'tdx':_0x4ad461});}[a54_0x5bba2d(0x168)](_0x26f0f6,_0xeedecf){const _0xebfaa5=a54_0x5bba2d,_0x224656=new Map();for(const _0x2a918f of _0x26f0f6){_0x2a918f['id']&&_0x2a918f[_0xebfaa5(0x305)]?.['id']&&_0x224656[_0xebfaa5(0x323)](_0x2a918f['id'],_0x2a918f[_0xebfaa5(0x305)]['id']);}const _0x56e25e=[];let _0x2939ed='';const _0x48bca7=this['renderSessionsTimeline'](_0x26f0f6,_0xeedecf),_0x338cbc=_0x48bca7[_0xebfaa5(0x195)]('\x0a');for(const _0x1174e4 of _0x338cbc){if(_0x1174e4[_0xebfaa5(0x303)](_0xebfaa5(0x2d4))||_0x1174e4[_0xebfaa5(0x1cc)](/^\s+\d{4}-\d{2}-\d{2}/))_0x2939ed=_0x1174e4;else{if(_0x1174e4[_0xebfaa5(0x1cc)](/^[✅❌🔄🛑⏳]/)){const _0x51d705=_0x1174e4[_0xebfaa5(0x1cc)](/#(\d+)/),_0x5ea850=_0x51d705?_0x51d705[0x1]:null,_0x1ca79e=_0x5ea850?_0x224656[_0xebfaa5(0x31c)](_0x5ea850)||null:null,_0x49eaf7=_0x26f0f6[_0xebfaa5(0x248)](_0x5932a5=>_0x5932a5['id']===_0x5ea850),_0x3051e8=_0x49eaf7?.[_0xebfaa5(0x22a)]?.[_0xebfaa5(0x310)]||'';_0x56e25e[_0xebfaa5(0x234)]({'displayLine':_0x1174e4,'attemptId':_0x1ca79e,'projectName':_0x3051e8});}}}return{'timelineRows':_0x56e25e,'timeAxisHeader':_0x2939ed};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1f6);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x2ca);async[a54_0x5bba2d(0x321)](_0x39c19b){const _0x566838=a54_0x5bba2d,{options:_0x1f1342,args:_0xfb5b94,tdx:_0x51359e}=_0x39c19b,_0x2511e3=this['parseProjectWorkflowPattern'](_0xfb5b94,_0x1f1342);if(!_0x2511e3)return 0x1;const {projectName:_0x3791e1,workflowName:_0x4d5bc0}=_0x2511e3,_0xf6bdcf=_0x1f1342[_0x566838(0x250)];if(_0x1f1342['verbose']){if(_0x3791e1&&_0x4d5bc0)console[_0x566838(0x28c)](_0x566838(0x28a)+_0x3791e1+'.'+_0x4d5bc0);else _0x3791e1&&console[_0x566838(0x28c)](_0x566838(0x30f)+_0x3791e1);_0xf6bdcf&&console[_0x566838(0x28c)]('Include\x20retried:\x20yes');}const _0x351b13=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x51359e['workflow'][_0x566838(0x2ab)]({'projectName':_0x3791e1,'workflowName':_0x4d5bc0,'includeRetried':_0xf6bdcf,'limit':_0x1f1342[_0x566838(0x2d9)]}),{'verbose':_0x1f1342[_0x566838(0x26a)]}),_0x3e131d=_0x351b13[_0x566838(0x197)],_0xc8bee2=_0x1f1342[_0x566838(0x2d9)]||0x64,_0xb308fd=_0x3e131d[_0x566838(0x2c0)]>=_0xc8bee2?a54_0x425391[_0x566838(0x1af)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x566838(0x28c)](_0x566838(0x1ff)+_0x3e131d['length']+_0x566838(0x237)+(_0x3e131d[_0x566838(0x2c0)]!==0x1?'s':'')+_0xb308fd);if(_0x1f1342['format']==='json'||_0x1f1342[_0x566838(0x24d)]==='jsonl'||_0x1f1342[_0x566838(0x24d)]===_0x566838(0x293))await handleSDKOutput(_0x3e131d,_0x1f1342);else{if(_0x3e131d[_0x566838(0x2c0)]===0x0){if(_0x3791e1&&_0x4d5bc0)console['log'](_0x566838(0x292)+_0x3791e1+'.'+_0x4d5bc0);else _0x3791e1?console[_0x566838(0x26b)](_0x566838(0x286)+_0x3791e1):console[_0x566838(0x26b)](_0x566838(0x20e));}else{const _0x136830=_0x1f1342[_0x566838(0x20b)],_0x34e3e0=_0x3e131d[_0x566838(0x318)](_0x45c541=>{const _0x3fe065=_0x566838,_0x52b0d3=a54_0x425391[_0x3fe065(0x1af)]('#'+_0x45c541['id']),_0x384a31=_0x45c541[_0x3fe065(0x22a)]?.['id'],_0x5d1452=_0x45c541['session_id']||_0x45c541[_0x3fe065(0x326)],_0xa78995=_0x384a31&&_0x5d1452?hyperlink(_0x52b0d3,getWorkflowAttemptUrl(_0x136830,_0x384a31,_0x5d1452,_0x45c541['id'])):_0x52b0d3,{icon:_0x1fd32e,text:_0x26d766}=getAttemptStatusDisplay(_0x45c541),_0x56229e=(_0x45c541[_0x3fe065(0x22a)]?.['name']||'?')+'.'+(_0x45c541['workflow']?.[_0x3fe065(0x310)]||'?'),_0x95a4f4=_0x45c541[_0x3fe065(0x24c)]?a54_0x425391[_0x3fe065(0x1af)](_0x45c541[_0x3fe065(0x24c)]):'';return(_0xa78995+'\x20'+_0x1fd32e+(_0x26d766?'\x20'+_0x26d766:'')+'\x20'+_0x56229e+'\x20'+_0x95a4f4)[_0x3fe065(0x214)]();});await writeOutput(_0x34e3e0[_0x566838(0x18a)]('\x0a'),_0x1f1342['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1c0);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x304);async['execute'](_0x4fcae3){const _0x350812=a54_0x5bba2d,{options:_0x29576a,args:_0x15a5d3,tdx:_0x17a293}=_0x4fcae3,_0x2967a9=_0x15a5d3[0x0];if(!_0x2967a9)return console[_0x350812(0x28c)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x29576a['verbose']&&console[_0x350812(0x28c)](_0x350812(0x178)+_0x2967a9);const _0x20c583=await withSpinner(_0x350812(0x27c),()=>_0x17a293[_0x350812(0x2ba)]['attempt'](_0x2967a9),{'verbose':_0x29576a[_0x350812(0x26a)]}),_0x1e22d6=_0x20c583['data'];let _0x34130f;!_0x1e22d6[_0x350812(0x182)]?_0x34130f=_0x1e22d6[_0x350812(0x1fd)]?_0x350812(0x227):'running':_0x34130f=_0x1e22d6[_0x350812(0x2e3)]?_0x350812(0x2e3):_0x350812(0x28c);let _0x45aea1;if(_0x1e22d6[_0x350812(0x17f)]&&_0x1e22d6['finishedAt']){const _0x236a49=new Date(_0x1e22d6[_0x350812(0x17f)])[_0x350812(0x2ef)](),_0x3e920f=new Date(_0x1e22d6['finishedAt'])[_0x350812(0x2ef)]();_0x45aea1=Math['round']((_0x3e920f-_0x236a49)/0x3e8);}const _0x355f19={'attempt_id':_0x1e22d6['id'],'status':_0x34130f,..._0x1e22d6[_0x350812(0x19c)]!==undefined&&{'index':_0x1e22d6[_0x350812(0x19c)]},..._0x1e22d6['project']&&{'project':_0x1e22d6[_0x350812(0x22a)][_0x350812(0x310)]},..._0x1e22d6[_0x350812(0x2ba)]&&{'workflow':_0x1e22d6[_0x350812(0x2ba)][_0x350812(0x310)]},..._0x1e22d6['sessionId']&&{'session_id':_0x1e22d6[_0x350812(0x326)]},..._0x1e22d6[_0x350812(0x24c)]&&{'session_time':_0x1e22d6[_0x350812(0x24c)]},..._0x1e22d6[_0x350812(0x187)]&&{'retry_attempt':_0x1e22d6[_0x350812(0x187)]},..._0x45aea1!==undefined&&{'duration_sec':_0x45aea1},..._0x1e22d6[_0x350812(0x17f)]&&{'created_at':_0x1e22d6[_0x350812(0x17f)]},..._0x1e22d6[_0x350812(0x31f)]&&{'finished_at':_0x1e22d6[_0x350812(0x31f)]},...Object[_0x350812(0x325)](_0x1e22d6[_0x350812(0x177)])[_0x350812(0x2c0)]>0x0&&{'params':_0x1e22d6[_0x350812(0x177)]}};return await handleSingleObjectOutput(_0x355f19,_0x29576a),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x2bc);async['execute'](_0x8c0556){const _0x94314=a54_0x5bba2d,{options:_0x205388,args:_0x56f352,tdx:_0x1b2ced}=_0x8c0556,_0x4f69c0=_0x56f352[0x0];if(!_0x4f69c0)return console[_0x94314(0x28c)](_0x94314(0x253)),0x1;const _0x2a64e7=_0x205388[_0x94314(0x21a)];_0x205388[_0x94314(0x26a)]&&(console['error'](_0x94314(0x178)+_0x4f69c0),_0x2a64e7&&console['error'](_0x94314(0x278)));const _0x18e16b=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x1b2ced[_0x94314(0x2ba)]['tasks'](_0x4f69c0,_0x2a64e7||![]),{'verbose':_0x205388['verbose']}),_0x4fd047=_0x18e16b[_0x94314(0x197)];return console[_0x94314(0x28c)](_0x94314(0x1ff)+_0x4fd047[_0x94314(0x2c0)]+_0x94314(0x2bb)+(_0x4fd047[_0x94314(0x2c0)]!==0x1?'s':'')),await handleSDKOutput(_0x4fd047,_0x205388),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a54_0x5bba2d(0x26d);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x2e6);async[a54_0x5bba2d(0x321)](_0x120078){const _0xd28bec=a54_0x5bba2d,{options:_0x36515e,args:_0x445e2f,tdx:_0x1e00a8}=_0x120078,_0x43d9bb=_0x445e2f[0x0];let _0xc0273d=_0x445e2f[0x1];if(!_0x43d9bb)return console[_0xd28bec(0x28c)](_0xd28bec(0x253)),0x1;_0x36515e[_0xd28bec(0x26a)]&&(console[_0xd28bec(0x28c)](_0xd28bec(0x178)+_0x43d9bb),_0xc0273d&&console[_0xd28bec(0x28c)](_0xd28bec(0x1a3)+_0xc0273d));const _0x39e898=await withSpinner(_0xd28bec(0x2d8),()=>_0x1e00a8[_0xd28bec(0x2ba)][_0xd28bec(0x205)](_0x43d9bb,_0xc0273d),{'verbose':_0x36515e[_0xd28bec(0x26a)]}),_0x51e67a=_0x39e898[_0xd28bec(0x197)];if(_0x51e67a[_0xd28bec(0x2c0)]===0x0)return console[_0xd28bec(0x28c)](_0xd28bec(0x258)),0x0;if(!_0xc0273d&&(_0x36515e['json']||_0x36515e['format']))return await handleSDKOutput(_0x51e67a,_0x36515e),0x0;if(!_0xc0273d){const _0x489dcf=_0x51e67a['map'](_0x428c80=>({'title':_0x428c80['taskName']+'\x20('+formatBytes(_0x428c80[_0xd28bec(0x1db)])+')','value':_0x428c80[_0xd28bec(0x2f9)]})),_0x4a6b25=await a54_0x2e7bce({'type':_0xd28bec(0x21d),'name':_0xd28bec(0x1a8),'message':_0xd28bec(0x317),'choices':_0x489dcf});if(!_0x4a6b25[_0xd28bec(0x1a8)])return console[_0xd28bec(0x28c)](_0xd28bec(0x1fb)),0x0;_0xc0273d=_0x4a6b25[_0xd28bec(0x1a8)];}const _0x51edc2=await withSpinner(_0xd28bec(0x213),()=>_0x1e00a8[_0xd28bec(0x2ba)][_0xd28bec(0x169)](_0x43d9bb,_0xc0273d),{'verbose':_0x36515e[_0xd28bec(0x26a)]}),_0x111dbe=_0x51edc2[_0xd28bec(0x197)];return _0x111dbe?console[_0xd28bec(0x26b)](_0x111dbe):console[_0xd28bec(0x28c)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x17b);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x2f8);async[a54_0x5bba2d(0x321)](_0x31515a){const _0xe2d0f0=a54_0x5bba2d,{options:_0xc4867b,args:_0x183069,tdx:_0x3b916e}=_0x31515a,_0x355d1e=_0x183069[0x0];if(!_0x355d1e)return console[_0xe2d0f0(0x28c)](_0xe2d0f0(0x253)),0x1;const _0x28915a=_0xc4867b[_0xe2d0f0(0x316)];_0xc4867b[_0xe2d0f0(0x26a)]&&(console[_0xe2d0f0(0x28c)](_0xe2d0f0(0x178)+_0x355d1e),_0x28915a&&console[_0xe2d0f0(0x28c)]('Reason:\x20'+_0x28915a));if(!_0xc4867b[_0xe2d0f0(0x2a8)]){if(!isInteractive())return console[_0xe2d0f0(0x28c)](a54_0x425391['red'](_0xe2d0f0(0x319)),_0xe2d0f0(0x1ac)),console['error'](a54_0x425391[_0xe2d0f0(0x1af)](_0xe2d0f0(0x2d7))),0x1;const _0xa5875=await confirmKey(_0xe2d0f0(0x16f)+_0x355d1e+'?');if(!_0xa5875)return console['error'](a54_0x425391[_0xe2d0f0(0x1f9)]('Cancelled')),0x1;}const _0x2a8615=await withSpinner(_0xe2d0f0(0x287),()=>_0x3b916e[_0xe2d0f0(0x2ba)]['kill'](_0x355d1e,_0x28915a),{'verbose':_0xc4867b[_0xe2d0f0(0x26a)]}),_0x1f0ada=_0x2a8615[_0xe2d0f0(0x197)];return console['error']('✔\x20'+_0x1f0ada),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x20a);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x324);async[a54_0x5bba2d(0x321)](_0x6fe55e){const _0x584e86=a54_0x5bba2d,{options:_0x55b796,args:_0x1d7093,tdx:_0x483660}=_0x6fe55e,_0x27cfca=_0x1d7093[0x0];if(!_0x27cfca)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x584e86(0x28c)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x5b88d3=![],_0x33482d=_0x27cfca;if(_0x27cfca[_0x584e86(0x303)](_0x584e86(0x1ec)))_0x5b88d3=!![],_0x33482d=_0x27cfca[_0x584e86(0x251)](0x8);else{if(_0x27cfca['startsWith'](_0x584e86(0x181)))_0x5b88d3=![],_0x33482d=_0x27cfca['substring'](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x584e86(0x301)),0x1;}const _0x26d029=_0x55b796[_0x584e86(0x1e5)],_0x57dda2=_0x55b796[_0x584e86(0x193)],_0x589709=_0x55b796[_0x584e86(0x177)],_0x5ef484=_0x55b796[_0x584e86(0x216)];_0x55b796['verbose']&&(console[_0x584e86(0x28c)](_0x584e86(0x312)+(_0x5b88d3?_0x584e86(0x2d6):_0x584e86(0x18d))+'\x20'+_0x33482d),_0x26d029&&console[_0x584e86(0x28c)](_0x584e86(0x2b3)+_0x26d029),_0x57dda2&&console[_0x584e86(0x28c)](_0x584e86(0x1bc)+_0x57dda2),_0x589709&&console['error'](_0x584e86(0x1b3)+_0x589709),_0x5ef484&&console[_0x584e86(0x28c)](_0x584e86(0x294)));let _0x31c241;if(_0x589709)try{if(_0x589709[_0x584e86(0x303)]('@')){const _0x3592e1=await import('fs/promises'),_0xcaa65c=_0x589709[_0x584e86(0x251)](0x1),_0x110e0a=await _0x3592e1[_0x584e86(0x221)](_0xcaa65c,_0x584e86(0x26e));_0x31c241=JSON[_0x584e86(0x21f)](_0x110e0a);}else _0x31c241=JSON[_0x584e86(0x21f)](_0x589709);}catch{return console[_0x584e86(0x28c)](_0x584e86(0x239)),0x1;}if(!_0x55b796[_0x584e86(0x2a8)]){if(!isInteractive())return console[_0x584e86(0x28c)](a54_0x425391[_0x584e86(0x28b)](_0x584e86(0x319)),_0x584e86(0x1ac)),console[_0x584e86(0x28c)](a54_0x425391[_0x584e86(0x1af)](_0x584e86(0x2d7))),0x1;const _0x5a9c74=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x5b88d3?_0x584e86(0x2d6):_0x584e86(0x18d))+'\x20'+_0x33482d+'?');if(!_0x5a9c74)return console[_0x584e86(0x28c)](a54_0x425391[_0x584e86(0x1f9)]('Cancelled')),0x1;}let _0x8f7fd0;_0x5b88d3?_0x8f7fd0=await withSpinner(_0x584e86(0x222),()=>_0x483660[_0x584e86(0x2ba)][_0x584e86(0x24e)](_0x33482d,{'fromTask':_0x26d029,'retryParams':_0x31c241}),{'verbose':_0x55b796[_0x584e86(0x26a)]}):_0x8f7fd0=await withSpinner('Retrying\x20attempt...',()=>_0x483660[_0x584e86(0x2ba)][_0x584e86(0x217)](_0x33482d,{'resumeFrom':_0x57dda2,'retryParams':_0x31c241,'force':_0x5ef484}),{'verbose':_0x55b796['verbose']});const _0x42d18b=_0x8f7fd0[_0x584e86(0x197)];return console[_0x584e86(0x28c)](_0x584e86(0x219)),console[_0x584e86(0x28c)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x42d18b[_0x584e86(0x194)]),console['error'](_0x584e86(0x263)+_0x42d18b[_0x584e86(0x326)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x208);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x1ed);async[a54_0x5bba2d(0x321)](_0xcc72bf){const _0x5a8514=a54_0x5bba2d,{options:_0x32f174,args:_0x2eb0e8,tdx:_0x32a49b}=_0xcc72bf;let _0x2ae3a0=_0x2eb0e8[0x0];if(!_0x2ae3a0){const _0x57977e=this['resolveProject']([],_0x32f174),_0x241482=await withSpinner(_0x5a8514(0x291),()=>_0x32a49b[_0x5a8514(0x2ba)][_0x5a8514(0x203)](_0x57977e,{'limit':_0x32f174[_0x5a8514(0x2d9)]}),{'verbose':_0x32f174['verbose']}),_0x5f33dd=_0x241482[_0x5a8514(0x197)];if(_0x5f33dd[_0x5a8514(0x2c0)]===0x0)return console[_0x5a8514(0x28c)]('No\x20workflows\x20found'),!_0x57977e&&console[_0x5a8514(0x28c)](a54_0x425391[_0x5a8514(0x1af)](_0x5a8514(0x2f4))),0x1;const _0x2d9eb4=_0x5f33dd[_0x5a8514(0x318)](_0x563cdc=>({'title':_0x563cdc[_0x5a8514(0x22a)]?.[_0x5a8514(0x310)]+'.'+_0x563cdc['name'],'value':_0x563cdc[_0x5a8514(0x22a)]?.[_0x5a8514(0x310)]+'.'+_0x563cdc[_0x5a8514(0x310)],'description':_0x563cdc[_0x5a8514(0x2cf)]?_0x5a8514(0x1eb)+_0x563cdc[_0x5a8514(0x2cf)]:undefined})),_0x128f76=await a54_0x2e7bce({'type':_0x5a8514(0x21d),'name':'workflow','message':_0x5a8514(0x289),'choices':_0x2d9eb4});if(!_0x128f76['workflow'])return 0x1;_0x2ae3a0=_0x128f76[_0x5a8514(0x2ba)];}if(!_0x2ae3a0['includes']('.')){const _0x46c719=this[_0x5a8514(0x1d0)]([],_0x32f174);if(_0x46c719)_0x2ae3a0=_0x46c719+'.'+_0x2ae3a0;else return console[_0x5a8514(0x28c)](a54_0x425391[_0x5a8514(0x28b)](_0x5a8514(0x1f0)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x5a8514(0x28c)](a54_0x425391[_0x5a8514(0x1af)](_0x5a8514(0x2f4))),0x1;}const _0x2e1acf=_0x32f174['param'],_0x2cf43f=_0x32f174[_0x5a8514(0x24c)],_0x2b93f7={};if(_0x2e1acf&&Array[_0x5a8514(0x1b1)](_0x2e1acf))for(const _0x4613bf of _0x2e1acf){const _0x20714d=_0x4613bf['indexOf']('=');if(_0x20714d===-0x1)return console[_0x5a8514(0x28c)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4613bf),console[_0x5a8514(0x28c)](_0x5a8514(0x19d)),0x1;const _0x50b743=_0x4613bf[_0x5a8514(0x251)](0x0,_0x20714d),_0x422950=_0x4613bf[_0x5a8514(0x251)](_0x20714d+0x1);try{_0x2b93f7[_0x50b743]=JSON['parse'](_0x422950);}catch{_0x2b93f7[_0x50b743]=_0x422950;}}_0x32f174[_0x5a8514(0x26a)]&&(console[_0x5a8514(0x28c)](_0x5a8514(0x225)+_0x2ae3a0),Object[_0x5a8514(0x325)](_0x2b93f7)[_0x5a8514(0x2c0)]>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x2b93f7)),_0x2cf43f&&console['error']('Session\x20time:\x20'+_0x2cf43f));const _0x190a1e=await withSpinner(_0x5a8514(0x267),()=>_0x32a49b['workflow'][_0x5a8514(0x1a9)](_0x2ae3a0,_0x2b93f7,{'sessionTime':_0x2cf43f}),{'verbose':_0x32f174['verbose']}),_0x4b22fb=_0x190a1e[_0x5a8514(0x197)];console[_0x5a8514(0x28c)](_0x5a8514(0x230)),console[_0x5a8514(0x28c)](_0x5a8514(0x26f)+_0x4b22fb['id']),console['error'](_0x5a8514(0x263)+_0x4b22fb[_0x5a8514(0x326)]),console[_0x5a8514(0x28c)](_0x5a8514(0x170)+_0x4b22fb['project']?.[_0x5a8514(0x310)]),console['error'](_0x5a8514(0x1cf)+_0x4b22fb[_0x5a8514(0x2ba)]?.['name']);if(_0x4b22fb['project']?.['id']&&_0x4b22fb[_0x5a8514(0x326)]&&_0x4b22fb['id']){const _0x2f5bc9=_0x32f174[_0x5a8514(0x20b)],_0x438508=getConsoleUrl(_0x2f5bc9,_0x5a8514(0x18e)+_0x4b22fb[_0x5a8514(0x22a)]['id']+_0x5a8514(0x2fa)+_0x4b22fb[_0x5a8514(0x326)]+_0x5a8514(0x2f5)+_0x4b22fb['id']);console[_0x5a8514(0x28c)]('\x20\x20Console:\x20'+a54_0x425391['cyan'](_0x438508));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x2cb);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x236);async[a54_0x5bba2d(0x321)](_0x501bec){const _0x3e7b19=a54_0x5bba2d,{options:_0x592521,args:_0x4d2baa,tdx:_0x4b51b7}=_0x501bec,_0x5f000f=_0x4d2baa[0x0],_0x65916e=_0x4d2baa[0x1]||'.';if(!_0x5f000f)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x3e7b19(0x1b6)),0x1;const _0x219932=_0x592521['revision'];_0x592521['verbose']&&(console[_0x3e7b19(0x28c)](_0x3e7b19(0x1e7)+_0x5f000f),console['error'](_0x3e7b19(0x166)+_0x65916e),_0x219932&&console[_0x3e7b19(0x28c)](_0x3e7b19(0x2b1)+_0x219932));const _0x38a26a=await withSpinner(_0x3e7b19(0x2e7)+_0x5f000f+_0x3e7b19(0x1ef),()=>_0x4b51b7['workflow'][_0x3e7b19(0x2dc)](_0x5f000f,_0x65916e,{'revision':_0x219932}),{'verbose':_0x592521[_0x3e7b19(0x26a)]}),_0x55adf1=_0x38a26a[_0x3e7b19(0x197)];return console[_0x3e7b19(0x28c)](_0x3e7b19(0x23c)+_0x55adf1[_0x3e7b19(0x2c6)]),console[_0x3e7b19(0x28c)]('\x20\x20Revision:\x20'+_0x55adf1['revision']),console[_0x3e7b19(0x28c)](_0x3e7b19(0x306)+_0x55adf1[_0x3e7b19(0x2ec)]),console[_0x3e7b19(0x28c)](_0x3e7b19(0x2f2)+_0x65916e+'/'+_0x55adf1['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x2af);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x202);async['execute'](_0x4c7387){const _0x29eb7f=a54_0x5bba2d,{options:_0x4d77ac,args:_0x162cc2,tdx:_0x5af8c3}=_0x4c7387;let _0x5e75a3='.',_0x3628c0=_0x4d77ac[_0x29eb7f(0x310)];if(_0x162cc2[0x0]){const {promises:_0x38f7c4}=await import('fs');try{const _0x533d41=await _0x38f7c4[_0x29eb7f(0x27d)](_0x162cc2[0x0]);if(_0x533d41['isDirectory']())_0x5e75a3=_0x162cc2[0x0];else return console['error']('Error:\x20'+_0x162cc2[0x0]+_0x29eb7f(0x31e)),0x1;}catch{_0x3628c0=_0x162cc2[0x0],_0x5e75a3='.';}}const _0x46172a=_0x4d77ac[_0x29eb7f(0x2cf)],_0x5c14dd=_0x4d77ac[_0x29eb7f(0x223)];_0x4d77ac[_0x29eb7f(0x26a)]&&(console[_0x29eb7f(0x28c)](_0x29eb7f(0x281)+_0x5e75a3),_0x3628c0&&console['error'](_0x29eb7f(0x174)+_0x3628c0),_0x46172a&&console[_0x29eb7f(0x28c)](_0x29eb7f(0x2b1)+_0x46172a),_0x5c14dd&&console['error'](_0x29eb7f(0x1c7)));const _0x3cf2d6=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x5af8c3['workflow']['push'](_0x5e75a3,{'projectName':_0x3628c0,'revision':_0x46172a,'skipValidation':_0x5c14dd}),{'verbose':_0x4d77ac[_0x29eb7f(0x26a)]}),_0x1de10a=_0x3cf2d6[_0x29eb7f(0x197)];return console[_0x29eb7f(0x28c)]('✔\x20Pushed\x20'+_0x1de10a['projectName']),console[_0x29eb7f(0x28c)](_0x29eb7f(0x283)+_0x1de10a['projectId']),console[_0x29eb7f(0x28c)]('\x20\x20Revision:\x20'+_0x1de10a[_0x29eb7f(0x2cf)]),await this[_0x29eb7f(0x2d2)](_0x5af8c3,_0x1de10a[_0x29eb7f(0x2c6)],_0x4d77ac['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1f2);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a54_0x5bba2d(0x321)](_0x44e52a){const _0x318b9e=a54_0x5bba2d,{options:_0xf2502,args:_0x45c238,tdx:_0x6bcc58}=_0x44e52a,_0x5dcc77=_0x45c238[0x0],_0x27aebd=_0x45c238[0x1];if(!_0x5dcc77)return console['error'](a54_0x425391[_0x318b9e(0x28b)](_0x318b9e(0x1f0)),_0x318b9e(0x1e6)),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1af)](_0x318b9e(0x1d2))),0x1;const _0xd314=_0xf2502[_0x318b9e(0x2cf)];_0xf2502[_0x318b9e(0x26a)]&&(console['error'](_0x318b9e(0x1e7)+_0x5dcc77),_0x27aebd&&console[_0x318b9e(0x28c)](_0x318b9e(0x192)+_0x27aebd),_0xd314&&console[_0x318b9e(0x28c)](_0x318b9e(0x2b1)+_0xd314),_0xf2502[_0x318b9e(0x1f1)]&&console[_0x318b9e(0x28c)](_0x318b9e(0x1e9)));const _0x5864e5=await withSpinner(_0x318b9e(0x2ac)+_0x5dcc77+'...',()=>_0x6bcc58[_0x318b9e(0x2ba)][_0x318b9e(0x2ee)](_0x5dcc77,{'targetDir':_0x27aebd,'revision':_0xd314}),{'verbose':_0xf2502[_0x318b9e(0x26a)]}),_0x2bbd48=_0x5864e5[_0x318b9e(0x197)];_0x2bbd48[_0x318b9e(0x260)]?console['error'](_0x318b9e(0x165)+_0x2bbd48[_0x318b9e(0x2c6)]):console[_0x318b9e(0x28c)](_0x318b9e(0x1c9)+_0x2bbd48[_0x318b9e(0x2c6)]);console[_0x318b9e(0x28c)](_0x318b9e(0x29e)+_0x2bbd48[_0x318b9e(0x2cf)]),console[_0x318b9e(0x28c)](_0x318b9e(0x220)+(a54_0x55dc3e[_0x318b9e(0x2ea)](process['cwd'](),_0x2bbd48['targetDir'])||'.')),console['error'](_0x318b9e(0x1b9)+a54_0x425391[_0x318b9e(0x2b6)]('+'+_0x2bbd48[_0x318b9e(0x16b)][_0x318b9e(0x19f)]+_0x318b9e(0x1d1))+',\x20'+(a54_0x425391[_0x318b9e(0x1f9)]('~'+_0x2bbd48[_0x318b9e(0x16b)][_0x318b9e(0x2db)]+_0x318b9e(0x2c8))+',\x20')+(a54_0x425391[_0x318b9e(0x28b)]('-'+_0x2bbd48[_0x318b9e(0x16b)]['deleted']+'\x20deleted')+',\x20')+(''+a54_0x425391[_0x318b9e(0x1af)](_0x2bbd48[_0x318b9e(0x16b)]['unchanged']+'\x20unchanged')));for(const _0x2a7edf of _0x2bbd48[_0x318b9e(0x280)]){_0x2a7edf['type']===_0x318b9e(0x2db)&&_0x2a7edf[_0x318b9e(0x2a1)]&&(console[_0x318b9e(0x28c)]('\x0a'+a54_0x425391[_0x318b9e(0x183)](_0x318b9e(0x175)+_0x2a7edf[_0x318b9e(0x17e)])),console[_0x318b9e(0x28c)](_0x2a7edf[_0x318b9e(0x2a1)]));}if(!_0x2bbd48[_0x318b9e(0x25c)])return saveSessionContext({'workflow_project':_0x2bbd48['projectName']},_0xf2502[_0x318b9e(0x2d6)]),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x2b6)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x318b9e(0x28c)](a54_0x425391['dim'](_0x318b9e(0x188)+_0x2bbd48[_0x318b9e(0x2c6)])),0x0;if(_0xf2502[_0x318b9e(0x1f1)])return console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1f9)](_0x318b9e(0x1a6))),0x0;if(!_0xf2502[_0x318b9e(0x2a8)]){if(!isInteractive())return console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x28b)]('\x0aError:'),_0x318b9e(0x1ac)),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1af)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4deb15=await confirmKey(_0x318b9e(0x198));if(!_0x4deb15)return console['error'](a54_0x425391[_0x318b9e(0x1f9)](_0x318b9e(0x1fb)),_0x318b9e(0x211)),0x1;}await withSpinner(_0x318b9e(0x1bb),()=>_0x6bcc58[_0x318b9e(0x2ba)][_0x318b9e(0x299)](_0x2bbd48,{'revision':_0xd314}),{'verbose':_0xf2502[_0x318b9e(0x26a)]}),saveSessionContext({'workflow_project':_0x2bbd48[_0x318b9e(0x2c6)]},_0xf2502[_0x318b9e(0x2d6)]),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x2b6)](_0x318b9e(0x245)));const _0x48e5f5=a54_0x55dc3e[_0x318b9e(0x2ea)](process[_0x318b9e(0x2e9)](),_0x2bbd48['targetDir'])||'.';return console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1af)](_0x318b9e(0x2f2)+_0x48e5f5)),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1af)](_0x318b9e(0x188)+_0x2bbd48['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';['description']='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a54_0x5bba2d(0x321)](_0x3fd9b6){const _0x475ce7=a54_0x5bba2d,{options:_0x2dc29e,args:_0x2b0151,tdx:_0x29d11a}=_0x3fd9b6,_0x4f6dcb=this[_0x475ce7(0x266)](_0x2b0151,_0x2dc29e),_0x52caa7=_0x2dc29e[_0x475ce7(0x2cf)],_0x2e71c9=_0x2dc29e[_0x475ce7(0x223)];_0x2dc29e[_0x475ce7(0x26a)]&&(_0x4f6dcb&&console[_0x475ce7(0x28c)](_0x475ce7(0x31b)+_0x4f6dcb),_0x52caa7&&console[_0x475ce7(0x28c)](_0x475ce7(0x2b1)+_0x52caa7),_0x2dc29e[_0x475ce7(0x1f1)]&&console[_0x475ce7(0x28c)](_0x475ce7(0x1e9)),_0x2e71c9&&console['error'](_0x475ce7(0x1c7)));let _0xb26d29;try{_0xb26d29=await withSpinner(_0x475ce7(0x172),()=>_0x29d11a['workflow'][_0x475ce7(0x167)]({'sourceDir':_0x4f6dcb,'revision':_0x52caa7,'skipValidation':_0x2e71c9}),{'verbose':_0x2dc29e[_0x475ce7(0x26a)]});}catch(_0x34e44a){if(_0x34e44a instanceof Error&&_0x34e44a[_0x475ce7(0x1c1)][_0x475ce7(0x1a4)](_0x475ce7(0x2fe)))return console['error'](a54_0x425391['red']('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2dc29e[_0x475ce7(0x2eb)]?console[_0x475ce7(0x28c)](a54_0x425391['dim'](_0x475ce7(0x233)+_0x2dc29e[_0x475ce7(0x2eb)]+_0x475ce7(0x2b9)+_0x2dc29e[_0x475ce7(0x2eb)]+'\x27')):console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x1af)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x34e44a;}const _0x180b2b=_0xb26d29[_0x475ce7(0x197)];console[_0x475ce7(0x28c)](_0x475ce7(0x17d)+_0x180b2b[_0x475ce7(0x2c6)]),console['error'](_0x475ce7(0x19b)+_0x180b2b[_0x475ce7(0x176)]),console[_0x475ce7(0x28c)](_0x475ce7(0x29e)+_0x180b2b[_0x475ce7(0x2cf)]),console[_0x475ce7(0x28c)]('\x20\x20Changes:\x20'+a54_0x425391[_0x475ce7(0x2b6)]('+'+_0x180b2b[_0x475ce7(0x16b)][_0x475ce7(0x19f)]+'\x20new')+',\x20'+(a54_0x425391[_0x475ce7(0x1f9)]('~'+_0x180b2b[_0x475ce7(0x16b)][_0x475ce7(0x2db)]+_0x475ce7(0x2c8))+',\x20')+(a54_0x425391[_0x475ce7(0x28b)]('-'+_0x180b2b[_0x475ce7(0x16b)][_0x475ce7(0x241)]+_0x475ce7(0x1f8))+',\x20')+(''+a54_0x425391[_0x475ce7(0x1af)](_0x180b2b[_0x475ce7(0x16b)]['unchanged']+'\x20unchanged')));for(const _0xb4cd90 of _0x180b2b[_0x475ce7(0x280)]){_0xb4cd90['type']===_0x475ce7(0x2db)&&_0xb4cd90[_0x475ce7(0x2a1)]&&(console['error']('\x0a'+a54_0x425391[_0x475ce7(0x183)](_0x475ce7(0x175)+_0xb4cd90[_0x475ce7(0x17e)])),console[_0x475ce7(0x28c)](_0xb4cd90[_0x475ce7(0x2a1)]));}if(!_0x180b2b[_0x475ce7(0x25c)])return console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x2b6)](_0x475ce7(0x2f6))),await this[_0x475ce7(0x2d2)](_0x29d11a,_0x180b2b[_0x475ce7(0x2c6)],_0x2dc29e[_0x475ce7(0x20b)]),0x0;if(_0x2dc29e[_0x475ce7(0x1f1)])return console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x1f9)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2dc29e[_0x475ce7(0x2a8)]){if(!isInteractive())return console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x28b)](_0x475ce7(0x319)),_0x475ce7(0x1ac)),console[_0x475ce7(0x28c)](a54_0x425391['dim'](_0x475ce7(0x2d7))),0x1;const _0x44ba0e=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x44ba0e)return console['error'](a54_0x425391['yellow']('Cancelled'),_0x475ce7(0x204)),0x1;}const _0x5b3cb9=await withSpinner(_0x475ce7(0x1dc),()=>_0x29d11a[_0x475ce7(0x2ba)][_0x475ce7(0x1f5)](_0x180b2b),{'verbose':_0x2dc29e[_0x475ce7(0x26a)]}),_0x1ed791=_0x5b3cb9['data'];return console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x2b6)]('✔\x20Push\x20complete')),console[_0x475ce7(0x28c)](_0x475ce7(0x283)+_0x1ed791[_0x475ce7(0x282)]),console['error'](_0x475ce7(0x29e)+_0x1ed791[_0x475ce7(0x2cf)]),await this[_0x475ce7(0x2d2)](_0x29d11a,_0x1ed791[_0x475ce7(0x2c6)],_0x2dc29e[_0x475ce7(0x20b)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x271);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x25d);async[a54_0x5bba2d(0x321)](_0x2de32e){const _0x4f216c=a54_0x5bba2d,{options:_0xa01396,args:_0x2cec4f,tdx:_0x4d1b1f}=_0x2de32e,_0x59afda=this[_0x4f216c(0x266)](_0x2cec4f,_0xa01396),_0x281397=_0xa01396['name'],_0x2a6600=_0xa01396[_0x4f216c(0x2cf)],_0x5e7972=_0xa01396[_0x4f216c(0x223)];if(!_0x59afda)return console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x28b)]('Error:'),_0x4f216c(0x313)),console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x1af)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x1af)](_0x4f216c(0x20f))),0x1;if(!_0x281397)return console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x28b)](_0x4f216c(0x1f0)),_0x4f216c(0x25b)),console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x1af)](_0x4f216c(0x2bf))),0x1;_0xa01396[_0x4f216c(0x26a)]&&(console[_0x4f216c(0x28c)](_0x4f216c(0x31b)+_0x59afda),console[_0x4f216c(0x28c)](_0x4f216c(0x295)+_0x281397),_0x2a6600&&console[_0x4f216c(0x28c)](_0x4f216c(0x2b1)+_0x2a6600),_0xa01396[_0x4f216c(0x1f1)]&&console[_0x4f216c(0x28c)](_0x4f216c(0x1e9)),_0x5e7972&&console[_0x4f216c(0x28c)]('Validation:\x20skipped'));const _0x2e8694=await withSpinner('Analyzing\x20project...',()=>_0x4d1b1f[_0x4f216c(0x2ba)]['prepareCloneProject'](_0x59afda,_0x281397,{'revision':_0x2a6600,'skipValidation':_0x5e7972}),{'verbose':_0xa01396[_0x4f216c(0x26a)]}),_0x25d9be=_0x2e8694[_0x4f216c(0x197)];console[_0x4f216c(0x28c)](_0x4f216c(0x2ff)+_0x25d9be['sourceDir']);_0x25d9be[_0x4f216c(0x2c2)]&&console[_0x4f216c(0x28c)](_0x4f216c(0x206)+_0x25d9be[_0x4f216c(0x2c2)]);console[_0x4f216c(0x28c)](_0x4f216c(0x295)+_0x25d9be[_0x4f216c(0x1ea)]),console[_0x4f216c(0x28c)](_0x4f216c(0x2b1)+_0x25d9be[_0x4f216c(0x2cf)]),console[_0x4f216c(0x28c)](_0x4f216c(0x308)+_0x25d9be[_0x4f216c(0x2f0)]);_0x25d9be[_0x4f216c(0x1da)]&&(console['error'](a54_0x425391[_0x4f216c(0x1f9)](_0x4f216c(0x275)+_0x25d9be[_0x4f216c(0x1ea)]+_0x4f216c(0x185)+_0x25d9be[_0x4f216c(0x2e5)]+')')),console['error'](a54_0x425391[_0x4f216c(0x1f9)](_0x4f216c(0x2dd))));if(_0xa01396[_0x4f216c(0x1f1)])return console['error'](a54_0x425391['yellow'](_0x4f216c(0x1a1))),0x0;if(!_0xa01396[_0x4f216c(0x2a8)]){if(!isInteractive())return console['error'](a54_0x425391[_0x4f216c(0x28b)](_0x4f216c(0x319)),_0x4f216c(0x1ac)),console[_0x4f216c(0x28c)](a54_0x425391['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3020d2=_0x25d9be['sourceProjectName']||a54_0x55dc3e[_0x4f216c(0x302)](_0x59afda),_0x442860=_0x25d9be[_0x4f216c(0x1da)]?_0x4f216c(0x2c5)+_0x281397+_0x4f216c(0x27f):'\x0aClone\x20\x22'+_0x3020d2+_0x4f216c(0x31d)+_0x281397+'\x22?',_0x43138b=await confirmKey(_0x442860);if(!_0x43138b)return console['error'](a54_0x425391[_0x4f216c(0x1f9)](_0x4f216c(0x1fb))),0x1;}const _0xec048e=await withSpinner(_0x25d9be[_0x4f216c(0x1da)]?_0x4f216c(0x290)+_0x281397+_0x4f216c(0x1ef):_0x4f216c(0x2fc)+_0x281397+_0x4f216c(0x1ef),()=>_0x4d1b1f[_0x4f216c(0x2ba)][_0x4f216c(0x2ad)](_0x25d9be),{'verbose':_0xa01396[_0x4f216c(0x26a)]}),_0x440b21=_0xec048e[_0x4f216c(0x197)];return console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x2b6)](_0x25d9be['targetExists']?'✔\x20Project\x20updated':_0x4f216c(0x1a7))),console[_0x4f216c(0x28c)](_0x4f216c(0x170)+_0x440b21[_0x4f216c(0x1ea)]),console['error'](_0x4f216c(0x283)+_0x440b21[_0x4f216c(0x2a7)]),console['error'](_0x4f216c(0x29e)+_0x440b21[_0x4f216c(0x2cf)]),await this[_0x4f216c(0x2d2)](_0x4d1b1f,_0x440b21[_0x4f216c(0x1ea)],_0xa01396[_0x4f216c(0x20b)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x5bba2d(0x310)]='workflow:delete';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x1bd);async[a54_0x5bba2d(0x321)](_0x457286){const _0x5dd150=a54_0x5bba2d,{options:_0x140b2e,args:_0xbdafda,tdx:_0x40f08e}=_0x457286,_0x39bb70=_0xbdafda[0x0];if(!_0x39bb70)return console[_0x5dd150(0x28c)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x5dd150(0x28c)](_0x5dd150(0x272)),0x1;_0x140b2e[_0x5dd150(0x26a)]&&console['error'](_0x5dd150(0x1e7)+_0x39bb70);if(!_0x140b2e[_0x5dd150(0x2a8)]){if(!isInteractive())return console[_0x5dd150(0x28c)](a54_0x425391['red'](_0x5dd150(0x319)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5dd150(0x28c)](a54_0x425391[_0x5dd150(0x1af)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xadae25=await confirmKey(_0x5dd150(0x232)+_0x39bb70+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0xadae25)return console['error'](a54_0x425391[_0x5dd150(0x1f9)](_0x5dd150(0x1fb))),0x1;}const _0x1eb1cb=await withSpinner('Deleting\x20project\x20'+_0x39bb70+_0x5dd150(0x1ef),()=>_0x40f08e[_0x5dd150(0x2ba)]['delete'](_0x39bb70),{'verbose':_0x140b2e[_0x5dd150(0x26a)]}),_0x239add=_0x1eb1cb[_0x5dd150(0x197)];return console[_0x5dd150(0x28c)](_0x5dd150(0x2cd)+_0x239add[_0x5dd150(0x2c6)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x239add[_0x5dd150(0x282)]),0x0;}}export function parseKeyValue(_0x20f7b3){const _0xbf8265=a54_0x5bba2d,_0x160924=_0x20f7b3[_0xbf8265(0x2e4)]('=');if(_0x160924===-0x1)throw new Error(_0xbf8265(0x16c)+_0x20f7b3+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x157206=_0x20f7b3['substring'](0x0,_0x160924),_0x22d48e=_0x20f7b3[_0xbf8265(0x251)](_0x160924+0x1);if(!_0x157206)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x157206,'value':_0x22d48e};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a54_0x5bba2d(0x2c7);['description']=a54_0x5bba2d(0x229);async[a54_0x5bba2d(0x321)](_0x235223){const _0x322ba5=a54_0x5bba2d,{options:_0x5cbc67,args:_0x22b938,tdx:_0x22747c}=_0x235223,_0x5296ba=this[_0x322ba5(0x1c6)](_0x22b938,_0x5cbc67);if(!_0x5296ba)return 0x1;_0x5cbc67[_0x322ba5(0x26a)]&&console[_0x322ba5(0x28c)](_0x322ba5(0x1e7)+_0x5296ba);const _0x1564e7=await withSpinner(_0x322ba5(0x19e),()=>_0x22747c[_0x322ba5(0x2ba)][_0x322ba5(0x23b)](_0x5296ba),{'verbose':_0x5cbc67['verbose']}),{secrets:_0x42dcf2}=_0x1564e7[_0x322ba5(0x197)];return console[_0x322ba5(0x28c)](_0x322ba5(0x1ff)+_0x42dcf2['length']+'\x20secret'+(_0x42dcf2['length']!==0x1?'s':'')),await handleSDKOutput(_0x42dcf2,_0x5cbc67),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1d8);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x16a);async[a54_0x5bba2d(0x321)](_0x2b2228){const _0x1e6df6=a54_0x5bba2d,{options:_0x5f3a26,args:_0x5a8af7,tdx:_0x21375c}=_0x2b2228;let _0x2f9c2c,_0x58176d;if(_0x5a8af7[_0x1e6df6(0x2c0)]>=0x1&&!_0x5a8af7[0x0][_0x1e6df6(0x1a4)]('='))_0x2f9c2c=_0x5a8af7[0x0],_0x58176d=_0x5a8af7[_0x1e6df6(0x30e)](0x1);else{if(_0x5a8af7[_0x1e6df6(0x2c0)]>=0x1&&_0x5f3a26['workflowProject'])_0x2f9c2c=_0x5f3a26[_0x1e6df6(0x2eb)],_0x58176d=_0x5a8af7;else return _0x5a8af7[_0x1e6df6(0x2c0)]>=0x1?(console[_0x1e6df6(0x28c)](_0x1e6df6(0x22f)),console[_0x1e6df6(0x28c)](_0x1e6df6(0x2f4)),0x1):(console['error'](_0x1e6df6(0x277)),console['error'](_0x1e6df6(0x1a5)),0x1);}if(_0x58176d['length']===0x0)return console[_0x1e6df6(0x28c)](_0x1e6df6(0x277)),console['error'](_0x1e6df6(0x1a5)),0x1;const _0x27015e={};try{for(const _0x47542f of _0x58176d){const {key:_0x30dc12,value:_0x53cabf}=parseKeyValue(_0x47542f);_0x27015e[_0x30dc12]=_0x53cabf;}}catch(_0x145103){return _0x145103 instanceof Error&&console[_0x1e6df6(0x28c)](a54_0x425391[_0x1e6df6(0x28b)](_0x1e6df6(0x1f0)),_0x145103['message']),0x1;}const _0x1156a1=Object[_0x1e6df6(0x325)](_0x27015e);_0x5f3a26[_0x1e6df6(0x26a)]&&(console['error'](_0x1e6df6(0x1e7)+_0x2f9c2c),console['error'](_0x1e6df6(0x2cc)+_0x1156a1[_0x1e6df6(0x18a)](',\x20')));const _0x2e9e20=await withSpinner(_0x1156a1[_0x1e6df6(0x2c0)]===0x1?_0x1e6df6(0x1c3):_0x1e6df6(0x29b)+_0x1156a1[_0x1e6df6(0x2c0)]+_0x1e6df6(0x1d3),()=>_0x21375c[_0x1e6df6(0x2ba)]['setSecrets'](_0x2f9c2c,_0x27015e),{'verbose':_0x5f3a26[_0x1e6df6(0x26a)]}),_0x19fd8a=_0x2e9e20[_0x1e6df6(0x197)];return console['error'](_0x1156a1[_0x1e6df6(0x2c0)]===0x1?_0x1e6df6(0x1ae)+_0x19fd8a[_0x1e6df6(0x325)][0x0]+_0x1e6df6(0x1fe)+_0x19fd8a[_0x1e6df6(0x2c6)]+'\x27':'✔\x20'+_0x19fd8a[_0x1e6df6(0x325)][_0x1e6df6(0x2c0)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x19fd8a[_0x1e6df6(0x2c6)]+'\x27'),(_0x5f3a26['json']||_0x5f3a26[_0x1e6df6(0x242)])&&await handleSingleObjectOutput(_0x19fd8a,_0x5f3a26),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]='workflow:secrets:delete';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x1c5);async[a54_0x5bba2d(0x321)](_0x578341){const _0x38202f=a54_0x5bba2d,{options:_0x1b5ed8,args:_0x4ea316,tdx:_0x1a4053}=_0x578341;let _0x26acc4,_0x51ff38;if(_0x4ea316[_0x38202f(0x2c0)]>=0x2)_0x26acc4=_0x4ea316[0x0],_0x51ff38=_0x4ea316[0x1];else{if(_0x4ea316['length']===0x1&&_0x1b5ed8[_0x38202f(0x2eb)])_0x26acc4=_0x1b5ed8[_0x38202f(0x2eb)],_0x51ff38=_0x4ea316[0x0];else return _0x4ea316[_0x38202f(0x2c0)]===0x1?(console[_0x38202f(0x28c)](_0x38202f(0x22f)),console[_0x38202f(0x28c)](_0x38202f(0x2f4)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console['error']('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x1b5ed8['verbose']&&(console[_0x38202f(0x28c)]('Project:\x20'+_0x26acc4),console['error']('Key:\x20'+_0x51ff38));if(!_0x1b5ed8['yes']){if(!isInteractive())return console['error'](a54_0x425391[_0x38202f(0x28b)](_0x38202f(0x319)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x425391['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x57c0b8=await confirmKey(_0x38202f(0x28f)+_0x51ff38+'\x27\x20from\x20project\x20\x27'+_0x26acc4+'\x27?');if(!_0x57c0b8)return console['error'](a54_0x425391[_0x38202f(0x1f9)](_0x38202f(0x1fb))),0x1;}const _0x1b0cf4=await withSpinner(_0x38202f(0x1e2),()=>_0x1a4053[_0x38202f(0x2ba)][_0x38202f(0x22d)](_0x26acc4,_0x51ff38),{'verbose':_0x1b5ed8[_0x38202f(0x26a)]}),_0x118c3d=_0x1b0cf4['data'];return console[_0x38202f(0x28c)](_0x38202f(0x1ae)+_0x118c3d[_0x38202f(0x30b)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x118c3d['projectName']+'\x27'),(_0x1b5ed8[_0x38202f(0x257)]||_0x1b5ed8[_0x38202f(0x242)])&&await handleSingleObjectOutput(_0x118c3d,_0x1b5ed8),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(_0x4d1054){const _0x10a87c=a54_0x5bba2d,_0x2716eb=Math['floor'](_0x4d1054/0x3e8),_0x1b70f8=Math[_0x10a87c(0x1b0)](_0x2716eb/0x3c),_0x62f763=Math[_0x10a87c(0x1b0)](_0x1b70f8/0x3c),_0x16cf55=Math['floor'](_0x62f763/0x18);if(_0x16cf55>0x0){const _0x3b831c=_0x62f763%0x18;return _0x3b831c>0x0?_0x16cf55+'d\x20'+_0x3b831c+'h':_0x16cf55+'d';}else{if(_0x62f763>0x0){const _0x55440b=_0x1b70f8%0x3c;return _0x55440b>0x0?_0x62f763+'h\x20'+_0x55440b+'m':_0x62f763+'h';}else{if(_0x1b70f8>0x0){const _0x436a2f=_0x2716eb%0x3c;return _0x436a2f>0x0?_0x1b70f8+'m\x20'+_0x436a2f+'s':_0x1b70f8+'m';}else return _0x2716eb+'s';}}}function formatTimestamp(_0x98952,_0x3aa889){const _0x97b328=a54_0x5bba2d,_0x8bd101=new Date(_0x98952),_0x2bd5f9=String(_0x8bd101[_0x97b328(0x1a2)]())[_0x97b328(0x2a5)](0x2,'0'),_0x70ce21=String(_0x8bd101[_0x97b328(0x268)]())[_0x97b328(0x2a5)](0x2,'0'),_0x257140=_0x2bd5f9+':'+_0x70ce21,_0x304fe7=_0x8bd101[_0x97b328(0x2f7)]()===_0x3aa889[_0x97b328(0x2f7)]()&&_0x8bd101[_0x97b328(0x1e0)]()===_0x3aa889[_0x97b328(0x1e0)]()&&_0x8bd101['getDate']()===_0x3aa889[_0x97b328(0x1fa)]();if(_0x304fe7)return _0x257140;else{const _0x1bde3e=String(_0x8bd101[_0x97b328(0x1e0)]()+0x1)[_0x97b328(0x2a5)](0x2,'0'),_0x553784=String(_0x8bd101[_0x97b328(0x1fa)]())[_0x97b328(0x2a5)](0x2,'0');return _0x1bde3e+'-'+_0x553784+'\x20'+_0x257140;}}function formatDate(_0x41a9b8){const _0x3e8b3d=a54_0x5bba2d,_0x2290ba=_0x41a9b8[_0x3e8b3d(0x2f7)](),_0x444876=String(_0x41a9b8['getMonth']()+0x1)[_0x3e8b3d(0x2a5)](0x2,'0'),_0x1726eb=String(_0x41a9b8['getDate']())[_0x3e8b3d(0x2a5)](0x2,'0');return _0x2290ba+'-'+_0x444876+'-'+_0x1726eb;}function getTaskStateIcon(_0x535b2f){const _0x3a007d={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3a007d[_0x535b2f]||'⚪';}function getBarChar(_0x44ce73){const _0x3edfdc=a54_0x5bba2d;return _0x44ce73===_0x3edfdc(0x28c)||_0x44ce73===_0x3edfdc(0x273)?'×':'─';}function getBarColor(_0x881705){const _0x42e290=a54_0x5bba2d,_0x2e1ed7={'success':a54_0x425391[_0x42e290(0x2b6)],'error':a54_0x425391['red'],'group_error':a54_0x425391['red'],'running':a54_0x425391[_0x42e290(0x1b8)],'blocked':a54_0x425391[_0x42e290(0x1f9)],'planned':a54_0x425391[_0x42e290(0x1af)],'canceling':a54_0x425391[_0x42e290(0x1f9)]};return _0x2e1ed7[_0x881705]||a54_0x425391[_0x42e290(0x21c)];}function parseTaskName(_0x55ab19){const _0x3def30=a54_0x5bba2d;let _0x39ee2e=_0x55ab19[_0x3def30(0x1a0)](/^\++/,'');const _0x41b90e=_0x39ee2e[_0x3def30(0x195)]('+'),_0x42cb99=_0x41b90e[_0x3def30(0x2c0)]>0x1?_0x41b90e[_0x3def30(0x2c0)]-0x2:0x0,_0x21821b=_0x41b90e[_0x41b90e['length']-0x1]||_0x39ee2e;return{'level':_0x42cb99,'name':'+'+_0x21821b};}function truncateTaskName(_0xf825d5,_0x474ca2){const _0x45773a=a54_0x5bba2d,_0x34ca60=stringWidth(_0xf825d5);if(_0x34ca60<=_0x474ca2)return _0xf825d5;let _0x512358=_0xf825d5;while(stringWidth(_0x512358+'…')>_0x474ca2&&_0x512358[_0x45773a(0x2c0)]>0x0){_0x512358=_0x512358['slice'](0x0,-0x1);}return _0x512358+'…';}function a54_0x1b76(){const _0x1d9dd0=['\x20\x20Project\x20ID:\x20','window','now','No\x20attempts\x20found\x20in\x20project:\x20','Killing\x20attempt...','No\x20sessions\x20found\x20in\x20project:\x20','Select\x20a\x20workflow\x20to\x20run','Filter:\x20','red','error','splice','nextRunTime','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Updating\x20','Loading\x20workflows...','No\x20attempts\x20found\x20for:\x20','table','Force:\x20yes','New\x20project\x20name:\x20','icon','enableSchedule','resolveProjectId','applyPullProject','\x20(system)','Setting\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','list','\x20\x20Revision:\x20','sort','toLocaleString','diff','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','MAX_LABEL_COUNT','stdout','padStart','Listing\x20workflow\x20sessions...','newProjectId','yes','context','\x20-\x20','attempts','Pulling\x20project\x20','executeCloneProject','some','workflow:upload','sys','Revision:\x20','end','From\x20task:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','Listing\x20schedules...','green','listSchedules','\x20logs','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','workflow','\x20task','Show\x20tasks\x20for\x20an\x20attempt','📋\x20','Auto-selected\x20latest\x20session:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','length','MAX_TIMELINE_WIDTH','sourceProjectName','118205KPWrmc','No\x20sessions\x20found\x20for:\x20','\x0aUpdate\x20existing\x20project\x20\x22','projectName','workflow:secrets:list','\x20modified','fullName','List\x20workflow\x20attempts','workflow:download','Secrets\x20to\x20set:\x20','✔\x20Deleted\x20project\x20','sessions','revision','✔\x20Showing\x20','No\x20workflows\x20found','showWorkflowConsoleUrl','Enabling\x20schedule\x20#','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','List\x20workflow\x20schedules','session','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Fetching\x20log\x20files...','limit','Latest\x20session\x20has\x20no\x20attempt','modified','download','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','ICON_WIDTH','startedAt','disableSchedule','projects','pollTimeline','success','indexOf','existingProjectId','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Downloading\x20project\x20','(use\x20--limit\x20to\x20see\x20more)','cwd','relative','workflowProject','filesExtracted','pending','pullProject','getTime','fileCount','workflow:schedule:disable','\x20\x20Location:\x20','24akrmNd','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','/attempt/','\x0a✔\x20No\x20changes\x20to\x20push','getFullYear','Kill\x20a\x20running\x20attempt','taskName','/sessions/','4006143lUqjNT','Cloning\x20to\x20','303698epmiTS','No\x20workflow\x20tdx.json\x20found','Source:\x20','all','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','basename','startsWith','Show\x20specific\x20attempt\x20details','lastAttempt','\x20\x20Files\x20extracted:\x20','max','Files\x20to\x20upload:\x20','Disable\x20a\x20workflow\x20schedule','filter','key','columns','startTime','slice','Filter:\x20project=','name','trim','Target:\x20','Source\x20directory\x20is\x20required','\x20(disabled)','Status:\x20','reason','Select\x20a\x20task\x20to\x20view\x20logs:','map','\x0aError:','description','Source\x20directory:\x20','get','\x22\x20to\x20new\x20project\x20\x22','\x20is\x20not\x20a\x20directory','finishedAt','Session\x20','execute','Select\x20a\x20session\x20to\x20view\x20timeline:','set','Retry\x20a\x20session\x20or\x20attempt','keys','sessionId','→\x20New\x20project:\x20','Output\x20directory:\x20','preparePushProject','generateSessionTimelineRows','logs','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','summary','Invalid\x20format:\x20','workflow:timeline','buildTimelineData','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20Project:\x20','MAX_POLL_ITERATIONS','Analyzing\x20changes...','msPerChar','Project\x20name:\x20','---\x20','sourceDir','params','Attempt\x20ID:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','\x20sessions\x20','workflow:kill','No\x20workflow\x20sessions\x20found','✔\x20Project:\x20','path','createdAt','duration','attempt:','done','cyan','total','\x22\x20already\x20exists\x20(ID:\x20','Disabling\x20schedule\x20#','retryAttemptName','\x20\x20Session\x20context\x20set\x20to:\x20','List\x20workflow\x20execution\x20sessions','join','No\x20projects\x20match\x20pattern:\x20','🔄\x20','attempt','/app/workflows/','\x20\x20tdx\x20wf\x20use\x20<project>','size','renderSessionsTimeline','Target\x20directory:\x20','resumeFrom','attemptId','split','write','data','\x0aApply\x20these\x20changes?','TASK_NAME_WIDTH','min','\x20\x20Source:\x20','index','Expected\x20format:\x20--param\x20key=value','Listing\x20secrets...','new','replace','\x0aDry\x20run\x20-\x20no\x20project\x20created','getHours','Task\x20name:\x20','includes','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x0aDry\x20run\x20-\x20no\x20files\x20written','✔\x20Clone\x20complete','task','run','3656700DlkBBO','metadata','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20to\x20see\x20detailed\x20logs','✔\x20Secret\x20\x27','dim','floor','isArray','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Params:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','3431144OBFNwW','blue','\x20\x20Changes:\x20','Schedule\x20ID\x20is\x20required','Writing\x20files...','Resume\x20from:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','every','workflow:use','workflow:attempt','message','workflow:sessions','Setting\x20secret...','ICON_SPACING','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','requireProject','Validation:\x20skipped','repeat','→\x20Project:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','\x20from\x20session\x20','match','output','resolve','\x20\x20Workflow:\x20','resolveProject','\x20new','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20secrets...','Total:\x20','running','No\x20workflows\x20found\x20in\x20project:\x20','Using\x20attempt\x20','workflow:secrets:set','renderSingleTimeline','targetExists','fileSize','Pushing\x20project...','MAX_TASKS_DISPLAY','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','parseProjectWorkflowPattern','getMonth','Listing\x20workflows...','Deleting\x20secret...','7bTGIpD','planned','fromTask','Project\x20name\x20is\x20required','Project:\x20','tdx.json','Dry\x20run:\x20yes','newProjectName','revision:\x20','session:','Start\x20a\x20workflow\x20run','unknown','...','Error:','dryRun','workflow:pull','isTTY','\x20of\x20','executePushProject','workflow:attempts','1864746tPVoIi','\x20deleted','yellow','getDate','Cancelled','state','cancelRequested','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','✔\x20Found\x20','Session\x20not\x20found:\x20','POLL_INTERVAL_MS','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflows','-\x20nothing\x20pushed','logFiles','Source\x20project:\x20','24306QFEoYv','workflow:run','renderTimeline','workflow:retry','site','No\x20sessions\x20found','text','No\x20attempts\x20found','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','122VXbttW','-\x20no\x20files\x20written','\x20schedule','Downloading\x20logs...','trimEnd','\x20next:\x20','force','retryAttempt','\x0a✔\x20Attempt\x20complete','✔\x20Retry\x20started','includeSubtasks','tdx\x20wf\x20attempt\x20','white','select','No\x20sessions\x20with\x20timing\x20information','parse','\x20\x20Target:\x20','readFile','Retrying\x20session...','skipValidation','title','Workflow:\x20','(unknown)','canceling','start','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','project','\x20session','\x1b[1A\x1b[2K','deleteSecret','LABEL_MIN_SPACING','Error:\x20Project\x20name\x20is\x20required','✔\x20Workflow\x20run\x20started','No\x20matching\x20sessions\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Tip:\x20cd\x20to\x20workflows/','push','Loading\x20sessions...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20attempt','✔\x20Workflow\x20project\x20set\x20to:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','\x0aPolling...\x20(','listSecrets','✔\x20Downloaded\x20','localeCompare','from','updatedAt','List\x20workflows','deleted','jsonl','clear','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Pull\x20complete','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','✔\x20Schedule\x20#','find','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Enable\x20a\x20workflow\x20schedule','follow','sessionTime','format','retrySession','\x20disabled\x20(','includeRetried','substring','\x20tasks','Error:\x20Attempt\x20ID\x20is\x20required','rows','📁\x20','MIN_TIMELINE_WIDTH','json','No\x20log\x20files\x20found\x20for\x20this\x20attempt','toISOString','GUTTER','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','hasChanges','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','📅\x20#','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','isNewProject','Project\x20filter:\x20','durationMs','\x20\x20Session\x20ID:\x20','\x20has\x20no\x20attempts','tasks','resolveProjectDir','Starting\x20workflow\x20run...','getMinutes','fill','verbose','log','\x20\x20Next\x20run:\x20','workflow:logs','utf-8','\x20\x20Attempt\x20ID:\x20','LABEL_WIDTH_DIVISOR','workflow:clone','Usage:\x20workflow:delete\x20<project-name-or-id>','group_error','Failed\x20to\x20fetch\x20attempt\x20data','\x0a⚠\x20Project\x20\x22','workflowName','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Including\x20subtasks:\x20yes','Warning:','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','status','Getting\x20attempt\x20details...','stat','\x20workflow','\x22\x20with\x20new\x20revision?','changes','Project\x20directory:\x20','projectId'];a54_0x1b76=function(){return _0x1d9dd0;};return a54_0x1b76();}function calculateTimeScale(_0x19d30a,_0x2e2faa){const _0x12e8dc=a54_0x5bba2d;return{'startTime':_0x19d30a[_0x12e8dc(0x228)],'endTime':_0x19d30a['end'],'durationMs':_0x19d30a[_0x12e8dc(0x180)],'msPerChar':_0x19d30a['duration']/_0x2e2faa};}function timeToPosition(_0x2944e9,_0x1f2314,_0xee9f19){const _0x31e99e=a54_0x5bba2d,_0x2adf3a=_0x2944e9-_0x1f2314[_0x31e99e(0x30d)],_0x3d05fc=Math[_0x31e99e(0x1b0)](_0x2adf3a/_0x1f2314[_0x31e99e(0x173)]);return Math[_0x31e99e(0x307)](0x0,Math['min'](_0x3d05fc,_0xee9f19));}function renderTimeAxis(_0x64235,_0x266799){const _0x22c275=a54_0x5bba2d,_0x38d334=Math[_0x22c275(0x19a)](TIMELINE_CONFIG[_0x22c275(0x2a3)],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x22c275(0x1b0)](_0x266799/TIMELINE_CONFIG[_0x22c275(0x270)]))),_0x2b955a=_0x64235[_0x22c275(0x262)]/(_0x38d334-0x1),_0x3b40ec=new Date(_0x64235[_0x22c275(0x30d)]),_0x369446=[];for(let _0x42d0db=0x0;_0x42d0db<_0x38d334;_0x42d0db++){const _0x548a08=_0x64235[_0x22c275(0x30d)]+_0x42d0db*_0x2b955a,_0xfee039=timeToPosition(_0x548a08,_0x64235,_0x266799),_0x4cc41a=formatTimestamp(_0x548a08,_0x3b40ec);_0x369446[_0x22c275(0x234)]({'pos':_0xfee039,'text':_0x4cc41a});}const _0x1d41f2=new Array(_0x266799)[_0x22c275(0x269)]('\x20');let _0x528436=-0x1;for(const {pos:_0x242586,text:_0x47b1c7}of _0x369446){let _0x24c164=Math[_0x22c275(0x307)](0x0,_0x242586-Math[_0x22c275(0x1b0)](_0x47b1c7[_0x22c275(0x2c0)]/0x2));_0x24c164<=_0x528436+TIMELINE_CONFIG[_0x22c275(0x22e)]&&(_0x24c164=_0x528436+TIMELINE_CONFIG[_0x22c275(0x22e)]+0x1);_0x24c164+_0x47b1c7['length']>_0x266799&&(_0x24c164=_0x266799-_0x47b1c7[_0x22c275(0x2c0)]);if(_0x24c164>=0x0&&_0x24c164+_0x47b1c7[_0x22c275(0x2c0)]<=_0x266799&&_0x24c164>_0x528436){for(let _0x5038eb=0x0;_0x5038eb<_0x47b1c7[_0x22c275(0x2c0)];_0x5038eb++){_0x1d41f2[_0x24c164+_0x5038eb]=_0x47b1c7[_0x5038eb];}_0x528436=_0x24c164+_0x47b1c7[_0x22c275(0x2c0)]-0x1;}}return _0x1d41f2[_0x22c275(0x18a)]('');}function renderTaskRow(_0x3ac1fe,_0xd77bf0,_0xfbe683,_0x305ec4){const _0x9922b2=a54_0x5bba2d,{level:_0x3f3ee7,name:_0x59ea90}=parseTaskName(_0x3ac1fe['name']),_0x527af9='\x20'[_0x9922b2(0x1c8)](_0x3f3ee7),_0x417798=_0x3ac1fe[_0x9922b2(0x284)]?'('+formatElapsed(_0x3ac1fe[_0x9922b2(0x284)]['duration'])+')':'',_0x4848fc=stringWidth(_0x417798),_0x2dde31=_0x3f3ee7*0x1,_0x581497=_0x305ec4-_0x2dde31-_0x4848fc-0x1,_0x374d03=truncateTaskName(_0x59ea90,_0x581497),_0x31c3ec=_0x527af9+_0x374d03,_0x212e34=stringWidth(_0x31c3ec),_0x5ead1d=_0x305ec4-_0x212e34-_0x4848fc,_0x9744cb=_0x31c3ec+'\x20'[_0x9922b2(0x1c8)](Math['max'](0x1,_0x5ead1d))+a54_0x425391['dim'](_0x417798),_0x3ba094=getTaskStateIcon(_0x3ac1fe[_0x9922b2(0x1fc)]),_0x3c155c=new Array(_0xfbe683)[_0x9922b2(0x269)]('\x20');if(_0x3ac1fe['window']){const _0x5aac3c=timeToPosition(_0x3ac1fe[_0x9922b2(0x284)][_0x9922b2(0x228)],_0xd77bf0,_0xfbe683),_0x4c6129=timeToPosition(_0x3ac1fe[_0x9922b2(0x284)]['end'],_0xd77bf0,_0xfbe683),_0x4bb914=getBarChar(_0x3ac1fe[_0x9922b2(0x1fc)]),_0x2369f4=Math[_0x9922b2(0x307)](_0x5aac3c+0x1,_0x4c6129);for(let _0x3d5389=_0x5aac3c;_0x3d5389<Math[_0x9922b2(0x19a)](_0x2369f4,_0xfbe683);_0x3d5389++){_0x3c155c[_0x3d5389]=_0x4bb914;}}const _0x312dee=getBarColor(_0x3ac1fe['state']),_0x20206a=_0x3c155c[_0x9922b2(0x318)](_0x21ea2b=>_0x21ea2b==='\x20'?'\x20':_0x312dee(_0x21ea2b))[_0x9922b2(0x18a)]('');return _0x3ba094+'\x20'+_0x9744cb+'│'+_0x20206a+'│';}function calculateStats(_0x39572e){const _0x4c7731=a54_0x5bba2d,_0x6817e0={'total':_0x39572e['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1d7ca1 of _0x39572e){if(_0x1d7ca1[_0x4c7731(0x1fc)]===_0x4c7731(0x2e3))_0x6817e0[_0x4c7731(0x2e3)]++;else{if(_0x1d7ca1[_0x4c7731(0x1fc)]===_0x4c7731(0x28c)||_0x1d7ca1[_0x4c7731(0x1fc)]===_0x4c7731(0x273))_0x6817e0['error']++;else _0x1d7ca1[_0x4c7731(0x1fc)]===_0x4c7731(0x1d5)?_0x6817e0[_0x4c7731(0x1d5)]++:_0x6817e0['pending']++;}}return _0x6817e0;}function formatStats(_0x549609){const _0x5085ce=a54_0x5bba2d;return[_0x5085ce(0x1d4)+_0x549609[_0x5085ce(0x184)],'✅\x20'+_0x549609[_0x5085ce(0x2e3)],'❌\x20'+_0x549609[_0x5085ce(0x28c)],_0x5085ce(0x18c)+_0x549609[_0x5085ce(0x1d5)],'⏳\x20'+_0x549609[_0x5085ce(0x2ed)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x16d);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x5bba2d(0x321)](_0x4ed672){const _0x306adf=a54_0x5bba2d,{options:_0x665413,args:_0x191a47,tdx:_0xbefbbb}=_0x4ed672;let _0x300703,_0x4a199a,_0x117d9d=![];if(_0x191a47[0x0]){if(_0x191a47[0x0]['includes']('.')){const _0x65d6a=this[_0x306adf(0x1df)](_0x191a47,_0x665413);if(!_0x65d6a)return 0x1;_0x300703=_0x65d6a[_0x306adf(0x2c6)],_0x4a199a=_0x65d6a[_0x306adf(0x276)];}else{_0x4a199a=_0x191a47[0x0],_0x300703=_0x665413[_0x306adf(0x2eb)];if(!_0x300703)return console[_0x306adf(0x28c)](a54_0x425391[_0x306adf(0x28b)](_0x306adf(0x1f0)),_0x306adf(0x246)),0x1;_0x117d9d=!![];}}else{const _0x4704ef=this[_0x306adf(0x1df)](_0x191a47,_0x665413);if(!_0x4704ef)return 0x1;_0x300703=_0x4704ef[_0x306adf(0x2c6)],_0x4a199a=_0x4704ef['workflowName'];}if(_0x665413[_0x306adf(0x26a)]){if(_0x300703&&_0x4a199a)console[_0x306adf(0x28c)](_0x306adf(0x28a)+_0x300703+'.'+_0x4a199a);else _0x300703&&console[_0x306adf(0x28c)](_0x306adf(0x30f)+_0x300703);}const _0x42b264=_0x665413[_0x306adf(0x194)],_0x2dc9b5=_0x665413[_0x306adf(0x326)];if(_0x42b264){_0x2dc9b5&&console['error'](a54_0x425391['yellow'](_0x306adf(0x279)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x71e703=_0x665413[_0x306adf(0x24b)];return _0x71e703?await this[_0x306adf(0x2e2)](_0x4ed672,_0x42b264):await this['renderSingleTimeline'](_0x4ed672,_0x42b264,_0x665413),0x0;}if(_0x2dc9b5){const _0x280776=await withSpinner('Loading\x20session...',()=>_0xbefbbb[_0x306adf(0x2ba)][_0x306adf(0x2ce)]({'projectName':_0x300703,'workflowName':_0x4a199a,'limit':0x64}),{'verbose':_0x665413[_0x306adf(0x26a)]}),_0x256dbd=_0x280776[_0x306adf(0x197)][_0x306adf(0x248)](_0x14b620=>_0x14b620['id']===_0x2dc9b5);if(!_0x256dbd)return console[_0x306adf(0x28c)](a54_0x425391[_0x306adf(0x28b)](_0x306adf(0x1f0)),_0x306adf(0x200)+_0x2dc9b5),0x1;if(!_0x256dbd[_0x306adf(0x305)]?.['id'])return console[_0x306adf(0x28c)](a54_0x425391[_0x306adf(0x28b)](_0x306adf(0x1f0)),_0x306adf(0x320)+_0x2dc9b5+_0x306adf(0x264)),0x1;const _0x7d15aa=_0x256dbd[_0x306adf(0x305)]['id'];_0x665413['verbose']&&console[_0x306adf(0x28c)](_0x306adf(0x1d7)+_0x7d15aa+_0x306adf(0x1cb)+_0x2dc9b5);const _0x5cacea=_0x665413[_0x306adf(0x24b)];return _0x5cacea?await this['pollTimeline'](_0x4ed672,_0x7d15aa):await this[_0x306adf(0x1d9)](_0x4ed672,_0x7d15aa,_0x665413),0x0;}const _0x490c5b=await withSpinner(_0x306adf(0x235),()=>_0xbefbbb[_0x306adf(0x2ba)][_0x306adf(0x2ce)]({'projectName':_0x300703,'workflowName':_0x4a199a,'limit':_0x665413[_0x306adf(0x2d9)]||0x32}),{'verbose':_0x665413['verbose']}),_0x2d2ce5=_0x490c5b[_0x306adf(0x197)];if(_0x2d2ce5[_0x306adf(0x2c0)]===0x0){if(_0x300703&&_0x4a199a)console[_0x306adf(0x28c)](_0x306adf(0x2c4)+_0x300703+'.'+_0x4a199a);else _0x300703?console[_0x306adf(0x28c)](_0x306adf(0x288)+_0x300703):(console[_0x306adf(0x28c)](_0x306adf(0x17c)),console[_0x306adf(0x28c)](a54_0x425391[_0x306adf(0x1af)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x2d2ce5['sort']((_0xb8d5fc,_0x5e1cca)=>{const _0x4e84fe=_0x306adf,_0x579e66=_0xb8d5fc[_0x4e84fe(0x24c)]||'',_0x2b6791=_0x5e1cca[_0x4e84fe(0x24c)]||'';return _0x2b6791[_0x4e84fe(0x23d)](_0x579e66);});if(_0x665413['json']||_0x665413[_0x306adf(0x242)])return await handleSDKOutput(_0x2d2ce5,_0x665413),0x0;let _0x230686;if(_0x117d9d){const _0x5b18f7=_0x2d2ce5[0x0];if(!_0x5b18f7['lastAttempt']?.['id'])return console[_0x306adf(0x28c)](_0x306adf(0x2da)),0x0;_0x230686=_0x5b18f7[_0x306adf(0x305)]['id'],_0x665413[_0x306adf(0x26a)]&&console[_0x306adf(0x28c)](_0x306adf(0x2be)+_0x5b18f7[_0x306adf(0x24c)]);}else{const _0x21b8ec=_0x2d2ce5[_0x306adf(0x318)](_0x27d505=>{const _0x5aada6=_0x306adf,_0x4f5b11=getAttemptStatusDisplay(_0x27d505['lastAttempt']);return{'title':_0x27d505['project']?.['name']+'.'+_0x27d505[_0x5aada6(0x2ba)]?.[_0x5aada6(0x310)]+_0x5aada6(0x2aa)+_0x27d505['sessionTime']+'\x20'+_0x4f5b11[_0x5aada6(0x296)],'value':_0x27d505[_0x5aada6(0x305)]?.['id']||'','description':_0x4f5b11[_0x5aada6(0x20d)]};}),_0x1f4891=await a54_0x2e7bce({'type':_0x306adf(0x21d),'name':_0x306adf(0x194),'message':_0x306adf(0x322),'choices':_0x21b8ec[_0x306adf(0x30a)](_0x14f0cb=>_0x14f0cb['value']!=='')});if(!_0x1f4891[_0x306adf(0x194)])return 0x0;_0x230686=_0x1f4891[_0x306adf(0x194)];}const _0x5e5ed5=_0x665413[_0x306adf(0x24b)];return _0x5e5ed5?await this[_0x306adf(0x2e2)](_0x4ed672,_0x230686):await this['renderSingleTimeline'](_0x4ed672,_0x230686,_0x665413),0x0;}async[a54_0x5bba2d(0x1d9)](_0x20d94d,_0x3f2ecb,_0x25a4ee){const _0x5d97d0=a54_0x5bba2d,{tdx:_0x19c408}=_0x20d94d;let _0x52e0b9,_0x5bdc16;try{[_0x52e0b9,_0x5bdc16]=await Promise[_0x5d97d0(0x300)]([_0x19c408[_0x5d97d0(0x2ba)][_0x5d97d0(0x18d)](_0x3f2ecb),_0x19c408[_0x5d97d0(0x2ba)][_0x5d97d0(0x265)](_0x3f2ecb,![])]);}catch(_0x500c2b){console[_0x5d97d0(0x28c)](a54_0x425391['red'](_0x5d97d0(0x274)));_0x25a4ee[_0x5d97d0(0x26a)]&&console['error'](_0x500c2b);throw _0x500c2b;}if(_0x25a4ee[_0x5d97d0(0x257)]||_0x25a4ee['jsonl']){const _0x515d66=this[_0x5d97d0(0x16e)](_0x52e0b9,_0x5bdc16);await handleSDKOutput([_0x515d66],_0x25a4ee);return;}const _0x45f246=_0x19c408[_0x5d97d0(0x2a9)][_0x5d97d0(0x20b)],_0x4f20ef=this[_0x5d97d0(0x209)](_0x52e0b9,_0x5bdc16,_0x45f246);console[_0x5d97d0(0x26b)](_0x4f20ef);}async['pollTimeline'](_0x5870ef,_0x785a83){const _0x510f6e=a54_0x5bba2d,{tdx:_0x3b27d7}=_0x5870ef,_0x294e35=TIMELINE_CONFIG[_0x510f6e(0x201)],_0x2bfde0=TIMELINE_CONFIG[_0x510f6e(0x171)];let _0x1f4ddc=0x0;while(_0x1f4ddc<_0x2bfde0){process[_0x510f6e(0x2a4)]['isTTY']&&process[_0x510f6e(0x2a4)][_0x510f6e(0x196)]('\x1bc');let _0x4c4074,_0x356378;try{[_0x4c4074,_0x356378]=await Promise[_0x510f6e(0x300)]([_0x3b27d7[_0x510f6e(0x2ba)][_0x510f6e(0x18d)](_0x785a83),_0x3b27d7[_0x510f6e(0x2ba)][_0x510f6e(0x265)](_0x785a83,![])]);}catch(_0x4dede7){console[_0x510f6e(0x28c)](a54_0x425391[_0x510f6e(0x28b)](_0x510f6e(0x1b5)));_0x1f4ddc>0x0&&console[_0x510f6e(0x28c)](a54_0x425391[_0x510f6e(0x1af)](_0x510f6e(0x25f)+_0x1f4ddc));throw _0x4dede7;}const _0x268d0c=_0x3b27d7[_0x510f6e(0x2a9)]['site'],_0x4aba74=this[_0x510f6e(0x209)](_0x4c4074,_0x356378,_0x268d0c);console[_0x510f6e(0x26b)](_0x4aba74);const _0xe493ab=_0x4c4074[_0x510f6e(0x182)]&&_0x356378[_0x510f6e(0x1be)](_0x150c2f=>_0x150c2f[_0x510f6e(0x1fc)]!==_0x510f6e(0x1d5)&&_0x150c2f['state']!=='planned');if(_0xe493ab){console[_0x510f6e(0x28c)](a54_0x425391[_0x510f6e(0x2b6)](_0x510f6e(0x218)));break;}console[_0x510f6e(0x28c)](a54_0x425391['dim'](_0x510f6e(0x23a)+_0x1f4ddc*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x2764bd=>setTimeout(_0x2764bd,_0x294e35)),_0x1f4ddc++;}_0x1f4ddc>=_0x2bfde0&&console[_0x510f6e(0x28c)](a54_0x425391[_0x510f6e(0x1f9)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x5bba2d(0x209)](_0x2586a7,_0x3d362c,_0x1b54c9){const _0x2d0a2b=a54_0x5bba2d,_0x571177=[],_0x41b1b4=TIMELINE_CONFIG[_0x2d0a2b(0x199)],_0x4d0fd8=0x5,_0x5b0517=process[_0x2d0a2b(0x2a4)][_0x2d0a2b(0x30c)]||0x78,_0xdaf774=_0x5b0517-_0x41b1b4-_0x4d0fd8,_0x4fc280=Math[_0x2d0a2b(0x307)](TIMELINE_CONFIG[_0x2d0a2b(0x256)],Math['min'](_0xdaf774,TIMELINE_CONFIG[_0x2d0a2b(0x2c1)])),_0x20e45e=new Date(_0x2586a7[_0x2d0a2b(0x17f)])[_0x2d0a2b(0x2ef)](),_0x3e693e=_0x2586a7[_0x2d0a2b(0x31f)]?new Date(_0x2586a7[_0x2d0a2b(0x31f)])[_0x2d0a2b(0x2ef)]():Date[_0x2d0a2b(0x285)](),_0x1700db={'start':_0x20e45e,'end':_0x3e693e,'duration':_0x3e693e-_0x20e45e},_0x37db4c=new Map(),_0x2152c3=[];for(const _0x16354e of _0x3d362c){if(_0x16354e[_0x2d0a2b(0x2df)]){const _0xa08215=new Date(_0x16354e[_0x2d0a2b(0x2df)])[_0x2d0a2b(0x2ef)](),_0x5c2528=_0x16354e[_0x2d0a2b(0x23f)]?new Date(_0x16354e[_0x2d0a2b(0x23f)])[_0x2d0a2b(0x2ef)]():Date[_0x2d0a2b(0x285)](),_0x2f4ce9={'start':_0xa08215,'end':_0x5c2528,'duration':_0x5c2528-_0xa08215};_0x37db4c[_0x2d0a2b(0x323)](_0x16354e['id'],_0x2f4ce9),_0x2152c3[_0x2d0a2b(0x234)]({'name':_0x16354e[_0x2d0a2b(0x2c9)],'state':_0x16354e[_0x2d0a2b(0x1fc)]||_0x2d0a2b(0x1ee),'window':_0x2f4ce9});}else _0x2152c3[_0x2d0a2b(0x234)]({'name':_0x16354e[_0x2d0a2b(0x2c9)],'state':_0x16354e[_0x2d0a2b(0x1fc)]||_0x2d0a2b(0x1e4),'window':undefined});}_0x2152c3['sort']((_0x561014,_0x131397)=>{const _0x33e1df=_0x2d0a2b;if(!_0x561014[_0x33e1df(0x284)])return 0x1;if(!_0x131397['window'])return-0x1;return _0x561014[_0x33e1df(0x284)][_0x33e1df(0x228)]-_0x131397['window'][_0x33e1df(0x228)];});const _0x25e48c=_0x2152c3[_0x2d0a2b(0x2c0)],_0x549e35=_0x25e48c>TIMELINE_CONFIG[_0x2d0a2b(0x1dd)];_0x549e35&&_0x2152c3[_0x2d0a2b(0x28d)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x2685d3=calculateTimeScale(_0x1700db,_0x4fc280),_0x54dd35=_0x2586a7[_0x2d0a2b(0x182)]?_0x2586a7[_0x2d0a2b(0x2e3)]?a54_0x425391['green']('success'):a54_0x425391[_0x2d0a2b(0x28b)]('error'):a54_0x425391['blue'](_0x2d0a2b(0x1d5)),_0x34dd57=_0x2586a7[_0x2d0a2b(0x22a)]?.['id'],_0x2efe7f=_0x2586a7[_0x2d0a2b(0x326)];let _0xb22582;if(_0x34dd57&&_0x2efe7f){const _0x5e86f6=getWorkflowAttemptUrl(_0x1b54c9,_0x34dd57,_0x2efe7f,_0x2586a7['id']);_0xb22582=hyperlink(a54_0x425391[_0x2d0a2b(0x1af)](_0x2586a7['id']),_0x5e86f6);}else _0xb22582=a54_0x425391['dim'](_0x2586a7['id']);_0x571177[_0x2d0a2b(0x234)]('Attempt:\x20'+_0xb22582+_0x2d0a2b(0x2aa)+_0x54dd35+_0x2d0a2b(0x2aa)+formatElapsed(_0x1700db[_0x2d0a2b(0x180)]));if(_0x2152c3[_0x2d0a2b(0x2c0)]>0x0){const _0x53e528=renderTimeAxis(_0x2685d3,_0x4fc280),_0x3d649b=new Date(_0x1700db[_0x2d0a2b(0x228)]),_0x39107d=formatDate(_0x3d649b),_0x5eb569=TIMELINE_CONFIG[_0x2d0a2b(0x2de)]+TIMELINE_CONFIG[_0x2d0a2b(0x1c4)]+_0x41b1b4,_0x475120=_0x39107d[_0x2d0a2b(0x2a5)](_0x5eb569),_0x35252e=a54_0x425391[_0x2d0a2b(0x1af)](_0x475120);_0x571177[_0x2d0a2b(0x234)](_0x35252e+'\x20'+_0x53e528);for(const _0x42f96e of _0x2152c3){_0x571177[_0x2d0a2b(0x234)](renderTaskRow(_0x42f96e,_0x2685d3,_0x4fc280,_0x41b1b4));}const _0x1fe064=calculateStats(_0x2152c3);_0x571177[_0x2d0a2b(0x234)](formatStats(_0x1fe064)),_0x549e35&&_0x571177[_0x2d0a2b(0x234)](a54_0x425391['yellow']('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x2d0a2b(0x1dd)]+_0x2d0a2b(0x1f4)+_0x25e48c+_0x2d0a2b(0x252))),_0x571177[_0x2d0a2b(0x234)](''),_0x571177[_0x2d0a2b(0x234)](a54_0x425391[_0x2d0a2b(0x1af)]('💡\x20Tip:\x20Use\x20')+(_0x2d0a2b(0x21b)+_0x2586a7['id']+_0x2d0a2b(0x2b8))+a54_0x425391[_0x2d0a2b(0x1af)](_0x2d0a2b(0x1ad)));}else _0x571177[_0x2d0a2b(0x234)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x571177[_0x2d0a2b(0x18a)]('\x0a');}[a54_0x5bba2d(0x16e)](_0x5ae951,_0x2e8a35){const _0x1dde16=a54_0x5bba2d,_0x6e18c2=new Date(_0x5ae951[_0x1dde16(0x17f)])['getTime'](),_0x33ae34=_0x5ae951[_0x1dde16(0x31f)]?new Date(_0x5ae951['finishedAt'])[_0x1dde16(0x2ef)]():Date[_0x1dde16(0x285)](),_0x24f9bd=_0x33ae34-_0x6e18c2,_0xb1382c=[];for(const _0x2b37d7 of _0x2e8a35){if(_0x2b37d7['startedAt']){const _0x22bcd8=new Date(_0x2b37d7['startedAt'])[_0x1dde16(0x2ef)](),_0x30f498=_0x2b37d7['updatedAt']?new Date(_0x2b37d7[_0x1dde16(0x23f)])[_0x1dde16(0x2ef)]():Date['now']();_0xb1382c['push']({'name':_0x2b37d7['fullName'],'state':_0x2b37d7[_0x1dde16(0x1fc)]||_0x1dde16(0x1ee),'window':{'start':_0x22bcd8,'end':_0x30f498,'duration':_0x30f498-_0x22bcd8}});}else _0xb1382c[_0x1dde16(0x234)]({'name':_0x2b37d7['fullName'],'state':_0x2b37d7['state']||_0x1dde16(0x1e4),'window':undefined});}const _0x41d5a5=calculateStats(_0xb1382c);return{'attempt':{'id':_0x5ae951['id'],'status':_0x5ae951[_0x1dde16(0x182)]?_0x5ae951[_0x1dde16(0x2e3)]?_0x1dde16(0x2e3):'error':_0x1dde16(0x1d5),'createdAt':_0x5ae951[_0x1dde16(0x17f)],'finishedAt':_0x5ae951[_0x1dde16(0x31f)],'duration_ms':_0x24f9bd},'tasks':_0xb1382c[_0x1dde16(0x318)](_0x14f930=>({'name':_0x14f930[_0x1dde16(0x310)],'state':_0x14f930['state'],'startedAt':_0x14f930[_0x1dde16(0x284)]?new Date(_0x14f930[_0x1dde16(0x284)][_0x1dde16(0x228)])[_0x1dde16(0x259)]():null,'updatedAt':_0x14f930[_0x1dde16(0x284)]?new Date(_0x14f930['window'][_0x1dde16(0x2b2)])[_0x1dde16(0x259)]():null,'duration_ms':_0x14f930[_0x1dde16(0x284)]?.['duration']||null})),'stats':_0x41d5a5};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x5bba2d(0x310)]='workflow:schedules';['description']=a54_0x5bba2d(0x2d5);async[a54_0x5bba2d(0x321)](_0x30d501){const _0x57fd97=a54_0x5bba2d,{options:_0x311029,tdx:_0x28d61e}=_0x30d501,_0xc11700=await withSpinner(_0x57fd97(0x2b5),()=>_0x28d61e[_0x57fd97(0x2ba)][_0x57fd97(0x2b7)](),{'verbose':_0x311029['verbose']}),_0x33b68c=_0xc11700[_0x57fd97(0x197)];console[_0x57fd97(0x28c)](_0x57fd97(0x1ff)+_0x33b68c['length']+_0x57fd97(0x212)+(_0x33b68c[_0x57fd97(0x2c0)]!==0x1?'s':''));if(isStructuredFormat(_0x311029))await handleSDKOutput(_0x33b68c,_0x311029);else{if(_0x33b68c[_0x57fd97(0x2c0)]===0x0)console[_0x57fd97(0x26b)]('No\x20schedules\x20found');else for(const _0x2ae756 of _0x33b68c){const _0x40fac3=_0x2ae756['disabledAt']?a54_0x425391[_0x57fd97(0x1f9)](_0x57fd97(0x314)):'',_0x279d0f=_0x2ae756['project']?.[_0x57fd97(0x310)]?a54_0x425391[_0x57fd97(0x1af)]('\x20['+_0x2ae756[_0x57fd97(0x22a)]['name']+']'):'',_0x4e00b8=_0x2ae756[_0x57fd97(0x28e)]?a54_0x425391[_0x57fd97(0x1af)](_0x57fd97(0x215)+new Date(_0x2ae756[_0x57fd97(0x28e)])[_0x57fd97(0x2a0)]()):'';console[_0x57fd97(0x26b)](_0x57fd97(0x25e)+_0x2ae756['id']+'\x20'+(_0x2ae756['workflow']?.[_0x57fd97(0x310)]||_0x57fd97(0x226))+_0x279d0f+_0x40fac3+_0x4e00b8);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']='workflow:schedule:enable';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x24a);async[a54_0x5bba2d(0x321)](_0x224239){const _0x17ede0=a54_0x5bba2d,{options:_0x5038b6,args:_0x2fc6ff,tdx:_0x142fd3}=_0x224239,_0x30296e=_0x2fc6ff[0x0];if(!_0x30296e)return console[_0x17ede0(0x28c)](a54_0x425391[_0x17ede0(0x28b)](_0x17ede0(0x1f0)),_0x17ede0(0x1ba)),console[_0x17ede0(0x28c)](a54_0x425391[_0x17ede0(0x1af)](_0x17ede0(0x1ca))),console[_0x17ede0(0x28c)](a54_0x425391[_0x17ede0(0x1af)](_0x17ede0(0x29c))),0x1;const _0x328892=await withSpinner(_0x17ede0(0x2d3)+_0x30296e+_0x17ede0(0x1ef),()=>_0x142fd3[_0x17ede0(0x2ba)][_0x17ede0(0x297)](_0x30296e),{'verbose':_0x5038b6[_0x17ede0(0x26a)]}),_0xd1d5db=_0x328892[_0x17ede0(0x197)];return isStructuredFormat(_0x5038b6)?await handleSingleObjectOutput(_0xd1d5db,_0x5038b6):(console['log'](_0x17ede0(0x247)+_0x30296e+'\x20enabled\x20('+(_0xd1d5db[_0x17ede0(0x2ba)]?.[_0x17ede0(0x310)]||'unknown')+')'),_0xd1d5db[_0x17ede0(0x28e)]&&console[_0x17ede0(0x26b)](a54_0x425391[_0x17ede0(0x1af)](_0x17ede0(0x26c)+new Date(_0xd1d5db[_0x17ede0(0x28e)])[_0x17ede0(0x2a0)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x2f1);['description']=a54_0x5bba2d(0x309);async[a54_0x5bba2d(0x321)](_0x12009c){const _0x5b9b58=a54_0x5bba2d,{options:_0x21ada4,args:_0x5f2431,tdx:_0x2e3973}=_0x12009c,_0x2e7efa=_0x5f2431[0x0];if(!_0x2e7efa)return console['error'](a54_0x425391[_0x5b9b58(0x28b)](_0x5b9b58(0x1f0)),_0x5b9b58(0x1ba)),console['error'](a54_0x425391[_0x5b9b58(0x1af)](_0x5b9b58(0x2a2))),console[_0x5b9b58(0x28c)](a54_0x425391['dim'](_0x5b9b58(0x29c))),0x1;const _0x334c9d=await withSpinner(_0x5b9b58(0x186)+_0x2e7efa+'...',()=>_0x2e3973[_0x5b9b58(0x2ba)][_0x5b9b58(0x2e0)](_0x2e7efa),{'verbose':_0x21ada4[_0x5b9b58(0x26a)]}),_0x474cd5=_0x334c9d[_0x5b9b58(0x197)];return isStructuredFormat(_0x21ada4)?await handleSingleObjectOutput(_0x474cd5,_0x21ada4):console[_0x5b9b58(0x26b)](_0x5b9b58(0x247)+_0x2e7efa+_0x5b9b58(0x24f)+(_0x474cd5[_0x5b9b58(0x2ba)]?.[_0x5b9b58(0x310)]||_0x5b9b58(0x1ee))+')'),0x0;}}
|