@treasuredata/tdx 2026.4.21 → 2026.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/passthrough-server.d.ts +17 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +33 -9
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.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.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x3dd44c=a54_0x2242;(function(_0x2f6a77,_0x229ce5){const _0x1b741d=a54_0x2242,_0x36dac0=_0x2f6a77();while(!![]){try{const _0x352fc7=-parseInt(_0x1b741d(0x293))/0x1*(parseInt(_0x1b741d(0x11d))/0x2)+parseInt(_0x1b741d(0x1b4))/0x3*(parseInt(_0x1b741d(0x130))/0x4)+parseInt(_0x1b741d(0x1b5))/0x5+parseInt(_0x1b741d(0x26e))/0x6*(-parseInt(_0x1b741d(0x1ce))/0x7)+parseInt(_0x1b741d(0x183))/0x8+parseInt(_0x1b741d(0x1a2))/0x9*(parseInt(_0x1b741d(0xf2))/0xa)+-parseInt(_0x1b741d(0x1e1))/0xb*(parseInt(_0x1b741d(0xf8))/0xc);if(_0x352fc7===_0x229ce5)break;else _0x36dac0['push'](_0x36dac0['shift']());}catch(_0x434e34){_0x36dac0['push'](_0x36dac0['shift']());}}}(a54_0x550a,0xbf7cd));import a54_0x33d044 from'chalk';function a54_0x2242(_0x28fa53,_0x1d63e2){_0x28fa53=_0x28fa53-0xdc;const _0x550a34=a54_0x550a();let _0x22425b=_0x550a34[_0x28fa53];return _0x22425b;}import{existsSync}from'fs';import a54_0x3af23b 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{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a54_0x2596be from'prompts';function getAttemptStatusDisplay(_0x45054e){const _0x451896=a54_0x2242;if(!_0x45054e)return{'icon':'⏳','text':''};const {done:_0x36c377,success:_0x1a7257,cancelRequested:_0x1dbed5}=_0x45054e;if(!_0x36c377)return _0x1dbed5?{'icon':'🛑','text':a54_0x33d044[_0x451896(0x114)]('canceling')}:{'icon':'🔄','text':a54_0x33d044[_0x451896(0x246)](_0x451896(0x21c))};if(_0x1a7257)return{'icon':'✅','text':a54_0x33d044[_0x451896(0xfd)](_0x451896(0x1ee))};return{'icon':'❌','text':a54_0x33d044[_0x451896(0xf6)](_0x451896(0x125))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x54e511,_0x532a58,_0x3f53ef=0x0){const _0x43852c=a54_0x2242;return _0x54e511[_0x3f53ef]||_0x532a58[_0x43852c(0x1d5)];}[a54_0x3dd44c(0x140)](_0x14ecfd,_0x53f824,_0x4652b5=0x0){const _0x4f5b6e=a54_0x3dd44c,_0x331a3d=this[_0x4f5b6e(0x25a)](_0x14ecfd,_0x53f824,_0x4652b5);if(!_0x331a3d)return console[_0x4f5b6e(0x125)](a54_0x33d044[_0x4f5b6e(0xf6)](_0x4f5b6e(0x1ab)),_0x4f5b6e(0x1bc)),console[_0x4f5b6e(0x125)](a54_0x33d044['dim'](_0x4f5b6e(0x257))),null;return _0x331a3d;}[a54_0x3dd44c(0x251)](_0x15ed87,_0xa82a77){const _0x4eca95=a54_0x3dd44c;if(_0x15ed87[0x0]){const _0x326fc1=_0x15ed87[0x0][_0x4eca95(0x29e)]('.');if(_0x326fc1[_0x4eca95(0x1d0)]===0x1)return{'projectName':_0x326fc1[0x0],'workflowName':undefined};else return _0x326fc1[_0x4eca95(0x1d0)]===0x2?{'projectName':_0x326fc1[0x0],'workflowName':_0x326fc1[0x1]}:(console[_0x4eca95(0x125)](a54_0x33d044['red'](_0x4eca95(0x1ab)),_0x4eca95(0x16e)),null);}return{'projectName':_0xa82a77['workflowProject'],'workflowName':undefined};}[a54_0x3dd44c(0x1f3)](_0x466531,_0x3d4da8,_0x261526=0x0){const _0x61f2dd=a54_0x3dd44c;if(_0x466531[_0x261526])return _0x466531[_0x261526];if(_0x3d4da8['workflowProject']){const _0x584544=a54_0x3af23b[_0x61f2dd(0x227)](process[_0x61f2dd(0x2a0)](),_0x61f2dd(0x2a6),_0x3d4da8['workflowProject']);if(existsSync(a54_0x3af23b[_0x61f2dd(0x227)](_0x584544,_0x61f2dd(0x131))))return _0x584544;}return undefined;}async['showWorkflowConsoleUrl'](_0x58b821,_0x4243ca,_0x16d912){const _0x13b52d=a54_0x3dd44c;try{const _0x5192e7=await _0x58b821[_0x13b52d(0x1f2)][_0x13b52d(0x2a6)](_0x4243ca,{'limit':0x1});if(_0x5192e7[_0x13b52d(0x1d0)]>0x0){const _0x5d8603=_0x5192e7[0x0]['id'],_0x5eb26b=getWorkflowUrl(_0x16d912,_0x5d8603);console[_0x13b52d(0x125)](_0x13b52d(0x205)+a54_0x33d044[_0x13b52d(0x210)](_0x5eb26b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x22f);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x29a);async['execute'](_0x3e97ec){const _0x4cb97b=a54_0x3dd44c,{options:_0x1aa059,args:_0x213f38,tdx:_0x220712}=_0x3e97ec,_0x47da2e=_0x213f38[0x0],_0x97abaf=_0x1aa059[_0x4cb97b(0x21a)];if(_0x97abaf)return saveSessionContext({'workflow_project':undefined},_0x1aa059['session']),console[_0x4cb97b(0x2a7)](a54_0x33d044[_0x4cb97b(0xfd)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x47da2e)return console[_0x4cb97b(0x125)](a54_0x33d044[_0x4cb97b(0xf6)]('Error:'),_0x4cb97b(0x1bc)),console[_0x4cb97b(0x125)](a54_0x33d044[_0x4cb97b(0x146)](_0x4cb97b(0x11f))),console['error'](a54_0x33d044[_0x4cb97b(0x146)](_0x4cb97b(0x291))),0x1;const _0x2551ff=await withSpinner(_0x4cb97b(0x218)+_0x47da2e+'\x27...',()=>_0x220712[_0x4cb97b(0x1f2)][_0x4cb97b(0x26d)](_0x47da2e),{'verbose':_0x1aa059[_0x4cb97b(0x1e5)]}),{name:_0x57fd54}=_0x2551ff['data'];return saveSessionContext({'workflow_project':_0x57fd54},_0x1aa059[_0x4cb97b(0x25c)]),console[_0x4cb97b(0x2a7)](a54_0x33d044[_0x4cb97b(0xfd)](_0x4cb97b(0x209)+a54_0x33d044[_0x4cb97b(0x210)](_0x57fd54))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x1bf);['description']='List\x20all\x20workflow\x20projects';async[a54_0x3dd44c(0x1ff)](_0xbe035a){const _0x3d585d=a54_0x3dd44c,{options:_0x11e8d9,args:_0x10c3ef,tdx:_0x40da32}=_0xbe035a,_0x33d007=_0x10c3ef[0x0];_0x11e8d9[_0x3d585d(0x1e5)]&&_0x33d007&&console['error']('Pattern:\x20'+_0x33d007);const _0x3e8dc0=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x40da32[_0x3d585d(0x1f2)][_0x3d585d(0x15b)](_0x33d007,{'limit':_0x11e8d9[_0x3d585d(0x22e)]}),{'verbose':_0x11e8d9[_0x3d585d(0x1e5)]});let _0x430c98=_0x3e8dc0[_0x3d585d(0x193)];_0x430c98[_0x3d585d(0x236)]((_0x21b20d,_0x2ee96f)=>_0x21b20d[_0x3d585d(0x237)]['localeCompare'](_0x2ee96f[_0x3d585d(0x237)]));const _0x15b0ee=_0x11e8d9['limit']||0x64,_0x2c08b9=_0x430c98[_0x3d585d(0x1d0)]>=_0x15b0ee?a54_0x33d044['dim'](_0x3d585d(0x253)):'';console[_0x3d585d(0x125)](_0x3d585d(0x274)+_0x430c98[_0x3d585d(0x1d0)]+_0x3d585d(0x1a3)+(_0x430c98['length']!==0x1?'s':'')+_0x2c08b9);if(_0x11e8d9[_0x3d585d(0x1d8)]===_0x3d585d(0x252)||_0x11e8d9[_0x3d585d(0x1d8)]===_0x3d585d(0x25f)||_0x11e8d9[_0x3d585d(0x1d8)]===_0x3d585d(0x228))await handleSDKOutput(_0x430c98,_0x11e8d9);else{if(_0x430c98[_0x3d585d(0x1d0)]===0x0)_0x33d007?console[_0x3d585d(0x2a7)](_0x3d585d(0x297)+_0x33d007):console['log'](_0x3d585d(0x1ef));else{const _0x1582b1=_0x430c98[_0x3d585d(0x23c)](_0x5188b5=>{const _0x25356b=_0x3d585d,_0x2ad191=_0x5188b5[_0x25356b(0x16c)]?.['some'](_0x26a904=>_0x26a904['key']==='sys'),_0x462ef1=_0x2ad191?a54_0x33d044['dim'](_0x25356b(0x188)):'';return _0x25356b(0x16d)+_0x5188b5[_0x25356b(0x237)]+_0x462ef1;});await writeOutput(_0x1582b1['join']('\x0a'),_0x11e8d9[_0x3d585d(0x27e)],_0x3d585d(0x230));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x150);['description']=a54_0x3dd44c(0x173);async[a54_0x3dd44c(0x1ff)](_0x180641){const _0x35aa1f=a54_0x3dd44c,{options:_0x21f3dd,args:_0x4c4691,tdx:_0x49235f}=_0x180641,_0x181b89=this[_0x35aa1f(0x25a)](_0x4c4691,_0x21f3dd);_0x21f3dd['verbose']&&_0x181b89&&console[_0x35aa1f(0x125)](_0x35aa1f(0xef)+_0x181b89);const _0x1faab7=await withSpinner(_0x35aa1f(0x22c),()=>_0x49235f[_0x35aa1f(0x1f2)]['workflows'](_0x181b89,{'limit':_0x21f3dd[_0x35aa1f(0x22e)]}),{'verbose':_0x21f3dd['verbose']});let _0x2d9783=_0x1faab7[_0x35aa1f(0x193)];_0x2d9783[_0x35aa1f(0x236)]((_0x25aa30,_0x592605)=>{const _0x81f287=_0x35aa1f,_0x19a6a7=_0x25aa30[_0x81f287(0x237)][_0x81f287(0x1d6)](_0x592605[_0x81f287(0x237)]);if(_0x19a6a7!==0x0)return _0x19a6a7;return(_0x25aa30['project']?.['name']||'')[_0x81f287(0x1d6)](_0x592605[_0x81f287(0x104)]?.[_0x81f287(0x237)]||'');});const _0x290498=_0x21f3dd[_0x35aa1f(0x22e)]||0x64,_0x5607d4=_0x2d9783['length']>=_0x290498?a54_0x33d044[_0x35aa1f(0x146)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x2d9783[_0x35aa1f(0x1d0)]+_0x35aa1f(0x23a)+(_0x2d9783['length']!==0x1?'s':'')+_0x5607d4);if(_0x21f3dd[_0x35aa1f(0x1d8)]===_0x35aa1f(0x252)||_0x21f3dd[_0x35aa1f(0x1d8)]===_0x35aa1f(0x25f)||_0x21f3dd[_0x35aa1f(0x1d8)]===_0x35aa1f(0x228))await handleSDKOutput(_0x2d9783,_0x21f3dd);else{if(_0x2d9783[_0x35aa1f(0x1d0)]===0x0)_0x181b89?console[_0x35aa1f(0x2a7)](_0x35aa1f(0x1fa)+_0x181b89):console[_0x35aa1f(0x2a7)](_0x35aa1f(0x249));else{const _0x3c8901=_0x21f3dd['site'],_0xa2d1fb=_0x2d9783[_0x35aa1f(0x23c)](_0x5babe7=>{const _0x870ad2=_0x35aa1f,_0x150517=a54_0x33d044[_0x870ad2(0x146)]('#'+_0x5babe7['id']),_0x7c3c4b=hyperlink(_0x150517,getWorkflowUrl(_0x3c8901,_0x5babe7['id'])),_0x5110d4=_0x5babe7['project']?.[_0x870ad2(0x237)]?a54_0x33d044['dim']('\x20('+_0x5babe7[_0x870ad2(0x104)][_0x870ad2(0x237)]+')'):'';return _0x870ad2(0x24d)+_0x7c3c4b+'\x20'+_0x5babe7['name']+_0x5110d4;});await writeOutput(_0xa2d1fb[_0x35aa1f(0x227)]('\x0a'),_0x21f3dd[_0x35aa1f(0x27e)],_0x35aa1f(0x230));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x24e);['description']='List\x20workflow\x20execution\x20sessions';async['execute'](_0x1e17a4){const _0x20d50b=a54_0x3dd44c,{options:_0x358595,args:_0x4504f5,tdx:_0x4fa2a9}=_0x1e17a4,_0x5bb343=this[_0x20d50b(0x251)](_0x4504f5,_0x358595);if(!_0x5bb343)return 0x1;const {projectName:_0x783d42,workflowName:_0x5c3f7e}=_0x5bb343;if(_0x358595[_0x20d50b(0x1e5)]){if(_0x783d42&&_0x5c3f7e)console['error']('Filter:\x20'+_0x783d42+'.'+_0x5c3f7e);else _0x783d42&&console[_0x20d50b(0x125)](_0x20d50b(0x11c)+_0x783d42);const _0x3519ac=_0x358595[_0x20d50b(0x1fd)];_0x3519ac&&console[_0x20d50b(0x125)](_0x20d50b(0x1e2)+_0x3519ac);}let _0x21dbb0=0x28;if(process[_0x20d50b(0x1ed)][_0x20d50b(0x26b)]&&!_0x358595[_0x20d50b(0x27e)]&&!_0x358595[_0x20d50b(0x1d8)]){const _0x1c15f4=process['stdout'][_0x20d50b(0x200)]||0x28;_0x21dbb0=Math['max'](0x14,Math['floor'](_0x1c15f4*0x2/0x3));}const _0x3b0042=_0x358595['limit']||_0x21dbb0,_0x239092=await withSpinner(_0x20d50b(0x141),()=>_0x4fa2a9[_0x20d50b(0x1f2)][_0x20d50b(0x172)]({'projectName':_0x783d42,'workflowName':_0x5c3f7e,'status':_0x358595[_0x20d50b(0x1fd)],'fromTime':_0x358595[_0x20d50b(0x276)],'toTime':_0x358595['to'],'limit':_0x3b0042}),{'verbose':_0x358595[_0x20d50b(0x1e5)]}),_0x7a68ec=_0x239092[_0x20d50b(0x193)];_0x7a68ec[_0x20d50b(0x236)]((_0x66418a,_0x2a900e)=>{const _0x559b2c=_0x20d50b,_0x2569ba=_0x66418a[_0x559b2c(0x12a)]||'',_0x551e74=_0x2a900e[_0x559b2c(0x12a)]||'';return _0x551e74[_0x559b2c(0x1d6)](_0x2569ba);});_0x7a68ec[_0x20d50b(0x1d0)]>=_0x3b0042?console[_0x20d50b(0x125)](_0x20d50b(0x214)+_0x7a68ec['length']+_0x20d50b(0x12b)+a54_0x33d044[_0x20d50b(0x146)](_0x20d50b(0x196))):console[_0x20d50b(0x125)](_0x20d50b(0x274)+_0x7a68ec['length']+_0x20d50b(0x1a6)+(_0x7a68ec[_0x20d50b(0x1d0)]!==0x1?'s':''));if(_0x358595[_0x20d50b(0x1d8)]===_0x20d50b(0x252)||_0x358595[_0x20d50b(0x1d8)]===_0x20d50b(0x25f)||_0x358595['format']===_0x20d50b(0x228))await handleSDKOutput(_0x7a68ec,_0x358595);else{if(!process['stdout'][_0x20d50b(0x26b)]||_0x358595['output']){if(_0x7a68ec[_0x20d50b(0x1d0)]===0x0){if(_0x783d42&&_0x5c3f7e)console[_0x20d50b(0x2a7)](_0x20d50b(0x211)+_0x783d42+'.'+_0x5c3f7e);else _0x783d42?console['log'](_0x20d50b(0x263)+_0x783d42):console[_0x20d50b(0x2a7)](_0x20d50b(0xf4));}else{const _0x1d8d8d=_0x358595['site'],_0x4c19cd=this[_0x20d50b(0x124)](_0x7a68ec,_0x1d8d8d);_0x358595[_0x20d50b(0x27e)]?await writeOutput(_0x4c19cd,_0x358595[_0x20d50b(0x27e)],_0x20d50b(0x230)):console[_0x20d50b(0x2a7)](_0x4c19cd);}!_0x783d42&&(console[_0x20d50b(0x125)](''),console[_0x20d50b(0x125)](a54_0x33d044[_0x20d50b(0x146)](_0x20d50b(0x111))),console[_0x20d50b(0x125)](a54_0x33d044[_0x20d50b(0x146)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x33d044[_0x20d50b(0x146)](_0x20d50b(0xfc))));}else{if(_0x7a68ec[_0x20d50b(0x1d0)]===0x0){if(_0x783d42&&_0x5c3f7e)console[_0x20d50b(0x2a7)](_0x20d50b(0x211)+_0x783d42+'.'+_0x5c3f7e);else _0x783d42?console['log'](_0x20d50b(0x263)+_0x783d42):console[_0x20d50b(0x2a7)]('No\x20sessions\x20found');}else await this[_0x20d50b(0x29b)](_0x7a68ec,_0x1e17a4,_0x783d42);}}return 0x0;}['renderSessionsTimeline'](_0x46afc5,_0x443d6d){const _0x216d75=a54_0x3dd44c,_0x363d16=[],_0x465284=new Map();let _0x3d8fc2=Infinity,_0x42b729=-Infinity;for(const _0xacdc35 of _0x46afc5){if(_0xacdc35[_0x216d75(0x1ea)]?.[_0x216d75(0xe7)]){const _0x17d6c8=new Date(_0xacdc35[_0x216d75(0x1ea)]['createdAt'])[_0x216d75(0x1b1)](),_0x562464=_0xacdc35[_0x216d75(0x1ea)][_0x216d75(0x2a4)]?new Date(_0xacdc35['lastAttempt'][_0x216d75(0x2a4)])['getTime']():Date[_0x216d75(0x272)](),_0xa35ab5=_0xacdc35['project']?.[_0x216d75(0x237)]||_0x216d75(0x1de);!_0x465284[_0x216d75(0x10a)](_0xa35ab5)&&_0x465284[_0x216d75(0x22a)](_0xa35ab5,[]),_0x465284[_0x216d75(0x192)](_0xa35ab5)[_0x216d75(0x1e8)]({'session':_0xacdc35,'startTime':_0x17d6c8,'endTime':_0x562464,'duration':_0x562464-_0x17d6c8}),_0x3d8fc2=Math['min'](_0x3d8fc2,_0x17d6c8),_0x42b729=Math[_0x216d75(0x25d)](_0x42b729,_0x562464);}}if(_0x465284[_0x216d75(0x1a9)]===0x0)return _0x216d75(0x19d);const _0x52a493=process[_0x216d75(0x1ed)][_0x216d75(0x2ad)]||0x78,_0x6f254e=0x1e,_0x322f79=0x32,_0x3e1307=0x4,_0x18734b=Math[_0x216d75(0x21b)](_0x322f79,Math[_0x216d75(0x25d)](_0x6f254e,Math[_0x216d75(0x16f)](_0x52a493*0.3))),_0x24a374=_0x52a493-_0x18734b-TIMELINE_CONFIG[_0x216d75(0x2a5)]-0x3-_0x3e1307,_0x32371d=_0x42b729-_0x3d8fc2,_0x30ba34=_0x32371d/_0x18734b,_0x42aa9d=renderTimeAxis({'startTime':_0x3d8fc2,'endTime':_0x42b729,'durationMs':_0x32371d,'msPerChar':_0x30ba34},_0x18734b),_0xf9c92=[];for(const _0x3bc339 of _0x465284['values']()){_0xf9c92[_0x216d75(0x1e8)](..._0x3bc339);}_0xf9c92[_0x216d75(0x236)]((_0x4b1fd5,_0x3c03e8)=>_0x3c03e8[_0x216d75(0x21f)]-_0x4b1fd5['startTime']);const _0x27eb91=new Date(_0x3d8fc2),_0x2ea081=formatDate(_0x27eb91),_0x1a23a2=_0x3e1307+TIMELINE_CONFIG[_0x216d75(0x269)]+TIMELINE_CONFIG[_0x216d75(0x170)]+_0x24a374,_0x3f527a='\x20'[_0x216d75(0x10c)](_0x1a23a2-_0x2ea081[_0x216d75(0x1d0)]),_0x434ec6=_0x3f527a+a54_0x33d044[_0x216d75(0x146)](_0x2ea081)+'\x20'+_0x42aa9d;_0x363d16[_0x216d75(0x1e8)](_0x434ec6);const _0x1f5632=0x16;let _0x394ea7=0x0;for(const _0x5ba19c of _0xf9c92){const _0x45c37d=_0x5ba19c[_0x216d75(0x25c)][_0x216d75(0x104)]?.[_0x216d75(0x237)]||'?',_0x1aba27=Math[_0x216d75(0x21b)](stringWidth(_0x45c37d),_0x1f5632);_0x394ea7=Math['max'](_0x394ea7,_0x1aba27);}for(const _0x4e0794 of _0xf9c92){const {session:_0xbca2d8,startTime:_0x4c932b,endTime:_0x4a9030,duration:_0x54f64b}=_0x4e0794,_0x480978=_0xbca2d8['project']?.['id'],_0x4d2b0b=_0xbca2d8['id'],_0x3985ea=_0xbca2d8[_0x216d75(0x104)]?.[_0x216d75(0x237)]||'?',_0x5692ad=_0xbca2d8[_0x216d75(0x1f2)]?.[_0x216d75(0x237)]||'?';let _0x5ca940,_0x528c62;if(_0xbca2d8[_0x216d75(0x1ea)]){const _0x2264f3=_0xbca2d8[_0x216d75(0x1ea)];!_0x2264f3[_0x216d75(0x10d)]?(_0x5ca940=_0x2264f3['cancelRequested']?'🛑':'🔄',_0x528c62=_0x2264f3[_0x216d75(0x280)]?a54_0x33d044['yellow']:a54_0x33d044[_0x216d75(0x246)]):(_0x5ca940=_0x2264f3['success']?'✅':'❌',_0x528c62=_0x2264f3[_0x216d75(0x1ee)]?a54_0x33d044[_0x216d75(0xfd)]:a54_0x33d044[_0x216d75(0xf6)]);}else _0x5ca940='⏳',_0x528c62=a54_0x33d044['dim'];const _0x2b86bb='#'+_0x4d2b0b,_0x362968=_0x480978?hyperlink(_0x2b86bb,getWorkflowSessionUrl(_0x443d6d,_0x480978,_0x4d2b0b)):_0x2b86bb;let _0x4aa554=_0x3985ea;stringWidth(_0x3985ea)>_0x1f5632&&(_0x4aa554=_0x3985ea['slice'](0x0,_0x1f5632-0x1)+'…');const _0x4326b9=a54_0x33d044[_0x216d75(0x146)](_0x4aa554),_0x106fb2=stringWidth(_0x4aa554),_0x2f6ae8='\x20'[_0x216d75(0x10c)](_0x394ea7-stringWidth(_0x4aa554)+0x2),_0x27a79='('+formatElapsed(_0x54f64b)+')',_0x909601=stringWidth(_0x27a79),_0x19bad3=stringWidth(_0x2b86bb),_0x5135ff=_0x19bad3+0x1+_0x106fb2+_0x2f6ae8[_0x216d75(0x1d0)],_0x1011e9=_0x24a374-_0x5135ff-_0x909601-0x1-0x8;let _0x297820=_0x5692ad;stringWidth(_0x297820)>_0x1011e9&&(_0x297820=_0x297820[_0x216d75(0x121)](0x0,_0x1011e9-0x1)+'…');const _0x610a8c=_0x362968+'\x20'+_0x4326b9+_0x2f6ae8+_0x297820,_0xfa38e5=stringWidth(_0x610a8c),_0xde31e=_0x24a374-_0xfa38e5-_0x909601,_0x36618c=_0x610a8c+'\x20'[_0x216d75(0x10c)](Math[_0x216d75(0x25d)](0x1,_0xde31e))+a54_0x33d044[_0x216d75(0x146)](_0x27a79),_0x2ec66f=Math[_0x216d75(0x16f)]((_0x4c932b-_0x3d8fc2)/_0x30ba34),_0x707fdd=Math[_0x216d75(0x16f)]((_0x4a9030-_0x3d8fc2)/_0x30ba34),_0xcb3047=Math['max'](_0x2ec66f+0x1,_0x707fdd),_0x53e9fa=new Array(_0x18734b)['fill']('\x20');for(let _0x23d320=_0x2ec66f;_0x23d320<Math[_0x216d75(0x21b)](_0xcb3047,_0x18734b);_0x23d320++){_0x53e9fa[_0x23d320]='─';}const _0x186ac9=_0x53e9fa['map'](_0x274c54=>_0x274c54==='\x20'?'\x20':_0x528c62(_0x274c54))['join']('');_0x363d16[_0x216d75(0x1e8)](_0x5ca940+'\x20'+_0x36618c+'│'+_0x186ac9+'│');}return _0x363d16[_0x216d75(0x227)]('\x0a');}async[a54_0x3dd44c(0x29b)](_0x1bc014,_0x4ffcd6,_0x303a15){const _0x15e3b=a54_0x3dd44c,{options:_0x4b60bd,tdx:_0x37452e}=_0x4ffcd6,_0x1059b2=_0x4b60bd[_0x15e3b(0x283)],{timelineRows:_0x3082d8,timeAxisHeader:_0xd7f27e}=this[_0x15e3b(0x1fb)](_0x1bc014,_0x1059b2),_0x5a5b2b=_0x3082d8[_0x15e3b(0x14d)](_0xf69cf6=>_0xf69cf6[_0x15e3b(0x18a)]);if(_0x5a5b2b[_0x15e3b(0x1d0)]===0x0){const _0x229e10=this[_0x15e3b(0x124)](_0x1bc014,_0x1059b2);console[_0x15e3b(0x2a7)](_0x229e10);!_0x303a15&&(console[_0x15e3b(0x125)](''),console['error'](a54_0x33d044['dim'](_0x15e3b(0x111))),console[_0x15e3b(0x125)](a54_0x33d044[_0x15e3b(0x146)](_0x15e3b(0x20e))+'or'+a54_0x33d044[_0x15e3b(0x146)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xd7f27e&&console[_0x15e3b(0x2a7)](_0xd7f27e);const _0x27e756=_0x3082d8['filter'](_0x17ffc2=>_0x17ffc2[_0x15e3b(0x18a)])['map'](_0x4c9c3a=>({'title':_0x4c9c3a['displayLine'],'value':_0x4c9c3a[_0x15e3b(0x18a)]})),_0x3dd8ee=process[_0x15e3b(0x1ed)][_0x15e3b(0x200)]||0x3c,_0x2ed523=Math[_0x15e3b(0x25d)](0x28,Math['floor'](_0x3dd8ee*0x2/0x3)),_0x6287c=await a54_0x2596be({'type':_0x15e3b(0x17d),'name':_0x15e3b(0x18a),'message':_0x15e3b(0x182),'choices':_0x27e756,'initial':-0x1,'limit':_0x2ed523,'clearFirst':!![],'fallback':{'title':_0x15e3b(0x151),'value':null},'suggest':(_0x119c1a,_0x1f6108)=>{const _0x47eeb8=_0x15e3b;if(!_0x119c1a)return Promise[_0x47eeb8(0x1f5)](_0x1f6108);const _0x262b4d=_0x1f6108['filter'](_0x38f340=>{const _0x430f41=_0x47eeb8,_0x50c833=_0x38f340;return _0x50c833[_0x430f41(0x20b)][_0x430f41(0x12d)]()[_0x430f41(0xfa)](_0x119c1a[_0x430f41(0x12d)]());});return Promise[_0x47eeb8(0x1f5)](_0x262b4d);}}),_0x111cc2=()=>{const _0x5e8971=_0x15e3b;process[_0x5e8971(0x1ed)][_0x5e8971(0x12c)](_0x5e8971(0x115)),process['stdout'][_0x5e8971(0x12c)](_0x5e8971(0x115)),process['stdout'][_0x5e8971(0x12c)]('\x1b[1A\x1b[2K');},_0x5616f6=_0x6287c&&_0x6287c[_0x15e3b(0x18a)]&&_0x6287c[_0x15e3b(0x18a)]!==null&&_0x6287c[_0x15e3b(0x18a)]['trim']()!=='';if(!_0x5616f6){_0x111cc2(),console['log'](a54_0x33d044[_0x15e3b(0x146)]('Cancelled'));return;}_0x111cc2();const _0x2b22e1=_0x1bc014['find'](_0x1aef5a=>_0x1aef5a[_0x15e3b(0x1ea)]?.['id']===_0x6287c[_0x15e3b(0x18a)]);if(_0x2b22e1){const _0x51691a=_0x2b22e1['project']?.[_0x15e3b(0x237)]||'?',_0x521680=_0x2b22e1['workflow']?.[_0x15e3b(0x237)]||'?';console['log'](_0x15e3b(0x118)+a54_0x33d044['dim'](_0x51691a)+_0x15e3b(0x264)+a54_0x33d044[_0x15e3b(0x146)](_0x521680));}const _0x5fee34=new WorkflowTimelineCommand();await _0x5fee34[_0x15e3b(0x1ff)]({'args':[],'options':{..._0x4b60bd,'attemptId':_0x6287c['attemptId']},'tdx':_0x37452e});}['generateSessionTimelineRows'](_0x2c387b,_0x2f2397){const _0x493d6d=a54_0x3dd44c,_0x20edbb=new Map();for(const _0x4f6af0 of _0x2c387b){_0x4f6af0['id']&&_0x4f6af0[_0x493d6d(0x1ea)]?.['id']&&_0x20edbb[_0x493d6d(0x22a)](_0x4f6af0['id'],_0x4f6af0[_0x493d6d(0x1ea)]['id']);}const _0x4aab12=[];let _0x410a02='';const _0x43b1d6=this[_0x493d6d(0x124)](_0x2c387b,_0x2f2397),_0x25c1e3=_0x43b1d6[_0x493d6d(0x29e)]('\x0a');for(const _0x8dde3d of _0x25c1e3){if(_0x8dde3d[_0x493d6d(0x223)](_0x493d6d(0x178))||_0x8dde3d['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x410a02=_0x8dde3d;else{if(_0x8dde3d[_0x493d6d(0x17b)](/^[✅❌🔄🛑⏳]/)){const _0x2d1f71=_0x8dde3d[_0x493d6d(0x17b)](/#(\d+)/),_0x662aaa=_0x2d1f71?_0x2d1f71[0x1]:null,_0x227e0c=_0x662aaa?_0x20edbb['get'](_0x662aaa)||null:null,_0x3f7c69=_0x2c387b[_0x493d6d(0x198)](_0x3a6e19=>_0x3a6e19['id']===_0x662aaa),_0x229380=_0x3f7c69?.['project']?.['name']||'';_0x4aab12[_0x493d6d(0x1e8)]({'displayLine':_0x8dde3d,'attemptId':_0x227e0c,'projectName':_0x229380});}}}return{'timelineRows':_0x4aab12,'timeAxisHeader':_0x410a02};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]='workflow:attempts';[a54_0x3dd44c(0x1c0)]='List\x20workflow\x20attempts';async[a54_0x3dd44c(0x1ff)](_0x34279f){const _0x3998b2=a54_0x3dd44c,{options:_0x1daf52,args:_0x17158f,tdx:_0x3a9c1e}=_0x34279f,_0x2c2eee=this['parseProjectWorkflowPattern'](_0x17158f,_0x1daf52);if(!_0x2c2eee)return 0x1;const {projectName:_0x23fe94,workflowName:_0x27f557}=_0x2c2eee,_0x10d900=_0x1daf52[_0x3998b2(0x19f)];if(_0x1daf52[_0x3998b2(0x1e5)]){if(_0x23fe94&&_0x27f557)console['error'](_0x3998b2(0x143)+_0x23fe94+'.'+_0x27f557);else _0x23fe94&&console[_0x3998b2(0x125)](_0x3998b2(0x11c)+_0x23fe94);_0x10d900&&console[_0x3998b2(0x125)](_0x3998b2(0x145));}const _0x1d8394=await withSpinner(_0x3998b2(0x231),()=>_0x3a9c1e[_0x3998b2(0x1f2)][_0x3998b2(0x144)]({'projectName':_0x23fe94,'workflowName':_0x27f557,'includeRetried':_0x10d900,'limit':_0x1daf52['limit']}),{'verbose':_0x1daf52['verbose']}),_0x56cd99=_0x1d8394[_0x3998b2(0x193)],_0x5b4ed5=_0x1daf52[_0x3998b2(0x22e)]||0x64,_0x374546=_0x56cd99[_0x3998b2(0x1d0)]>=_0x5b4ed5?a54_0x33d044[_0x3998b2(0x146)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x3998b2(0x274)+_0x56cd99[_0x3998b2(0x1d0)]+'\x20attempt'+(_0x56cd99['length']!==0x1?'s':'')+_0x374546);if(_0x1daf52[_0x3998b2(0x1d8)]===_0x3998b2(0x252)||_0x1daf52[_0x3998b2(0x1d8)]===_0x3998b2(0x25f)||_0x1daf52[_0x3998b2(0x1d8)]==='table')await handleSDKOutput(_0x56cd99,_0x1daf52);else{if(_0x56cd99[_0x3998b2(0x1d0)]===0x0){if(_0x23fe94&&_0x27f557)console[_0x3998b2(0x2a7)]('No\x20attempts\x20found\x20for:\x20'+_0x23fe94+'.'+_0x27f557);else _0x23fe94?console[_0x3998b2(0x2a7)](_0x3998b2(0x292)+_0x23fe94):console[_0x3998b2(0x2a7)]('No\x20attempts\x20found');}else{const _0x3a4bb3=_0x1daf52[_0x3998b2(0x283)],_0x54be11=_0x56cd99[_0x3998b2(0x23c)](_0x591dda=>{const _0x334fc8=_0x3998b2,_0x34ecff=a54_0x33d044[_0x334fc8(0x146)]('#'+_0x591dda['id']),_0x3aea51=_0x591dda['project']?.['id'],_0x4bd28d=_0x591dda['session_id']||_0x591dda[_0x334fc8(0x233)],_0x4c54dd=_0x3aea51&&_0x4bd28d?hyperlink(_0x34ecff,getWorkflowAttemptUrl(_0x3a4bb3,_0x3aea51,_0x4bd28d,_0x591dda['id'])):_0x34ecff,{icon:_0x25ed8d,text:_0xca7267}=getAttemptStatusDisplay(_0x591dda),_0x4162bb=(_0x591dda[_0x334fc8(0x104)]?.[_0x334fc8(0x237)]||'?')+'.'+(_0x591dda[_0x334fc8(0x1f2)]?.[_0x334fc8(0x237)]||'?'),_0x380985=_0x591dda[_0x334fc8(0x12a)]?a54_0x33d044[_0x334fc8(0x146)](_0x591dda['sessionTime']):'';return(_0x4c54dd+'\x20'+_0x25ed8d+(_0xca7267?'\x20'+_0xca7267:'')+'\x20'+_0x4162bb+'\x20'+_0x380985)['trimEnd']();});await writeOutput(_0x54be11[_0x3998b2(0x227)]('\x0a'),_0x1daf52[_0x3998b2(0x27e)],_0x3998b2(0x230));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x26c);[a54_0x3dd44c(0x1c0)]='Show\x20specific\x20attempt\x20details';async['execute'](_0x8236f7){const _0x5877cf=a54_0x3dd44c,{options:_0x41f489,args:_0x17bc51,tdx:_0x3021f5}=_0x8236f7,_0x4695de=_0x17bc51[0x0];if(!_0x4695de)return console[_0x5877cf(0x125)](_0x5877cf(0x17a)),0x1;_0x41f489['verbose']&&console[_0x5877cf(0x125)](_0x5877cf(0x1a1)+_0x4695de);const _0x13a293=await withSpinner(_0x5877cf(0x2ac),()=>_0x3021f5['workflow'][_0x5877cf(0x1e7)](_0x4695de),{'verbose':_0x41f489[_0x5877cf(0x1e5)]}),_0x56cf7f=_0x13a293[_0x5877cf(0x193)];let _0x56732d;!_0x56cf7f[_0x5877cf(0x10d)]?_0x56732d=_0x56cf7f[_0x5877cf(0x280)]?_0x5877cf(0x279):_0x5877cf(0x21c):_0x56732d=_0x56cf7f[_0x5877cf(0x1ee)]?'success':_0x5877cf(0x125);let _0x468f6d;if(_0x56cf7f[_0x5877cf(0xe7)]&&_0x56cf7f['finishedAt']){const _0x5002b9=new Date(_0x56cf7f[_0x5877cf(0xe7)])[_0x5877cf(0x1b1)](),_0x5db1bd=new Date(_0x56cf7f[_0x5877cf(0x2a4)])['getTime']();_0x468f6d=Math[_0x5877cf(0x185)]((_0x5db1bd-_0x5002b9)/0x3e8);}const _0x44fefe={'attempt_id':_0x56cf7f['id'],'status':_0x56732d,..._0x56cf7f[_0x5877cf(0x288)]!==undefined&&{'index':_0x56cf7f[_0x5877cf(0x288)]},..._0x56cf7f['project']&&{'project':_0x56cf7f[_0x5877cf(0x104)][_0x5877cf(0x237)]},..._0x56cf7f['workflow']&&{'workflow':_0x56cf7f[_0x5877cf(0x1f2)][_0x5877cf(0x237)]},..._0x56cf7f['sessionId']&&{'session_id':_0x56cf7f['sessionId']},..._0x56cf7f[_0x5877cf(0x12a)]&&{'session_time':_0x56cf7f[_0x5877cf(0x12a)]},..._0x56cf7f[_0x5877cf(0x186)]&&{'retry_attempt':_0x56cf7f['retryAttemptName']},..._0x468f6d!==undefined&&{'duration_sec':_0x468f6d},..._0x56cf7f['createdAt']&&{'created_at':_0x56cf7f['createdAt']},..._0x56cf7f['finishedAt']&&{'finished_at':_0x56cf7f[_0x5877cf(0x2a4)]},...Object['keys'](_0x56cf7f[_0x5877cf(0x20a)])[_0x5877cf(0x1d0)]>0x0&&{'params':_0x56cf7f[_0x5877cf(0x20a)]}};return await handleSingleObjectOutput(_0x44fefe,_0x41f489),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x1f6);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0xe8);async['execute'](_0x56c533){const _0x1d5d53=a54_0x3dd44c,{options:_0xaa34c5,args:_0x9465b,tdx:_0xd7902c}=_0x56c533,_0x1165b2=_0x9465b[0x0];if(!_0x1165b2)return console[_0x1d5d53(0x125)](_0x1d5d53(0x17a)),0x1;const _0x24e96f=_0xaa34c5[_0x1d5d53(0x273)];_0xaa34c5[_0x1d5d53(0x1e5)]&&(console['error'](_0x1d5d53(0x1a1)+_0x1165b2),_0x24e96f&&console['error'](_0x1d5d53(0x1f8)));const _0x25571a=await withSpinner(_0x1d5d53(0x290),()=>_0xd7902c[_0x1d5d53(0x1f2)][_0x1d5d53(0x2a9)](_0x1165b2,_0x24e96f||![]),{'verbose':_0xaa34c5['verbose']}),_0x356e23=_0x25571a[_0x1d5d53(0x193)];return console['error'](_0x1d5d53(0x274)+_0x356e23[_0x1d5d53(0x1d0)]+_0x1d5d53(0x29d)+(_0x356e23[_0x1d5d53(0x1d0)]!==0x1?'s':'')),await handleSDKOutput(_0x356e23,_0xaa34c5),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x1a8);[a54_0x3dd44c(0x1c0)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a54_0x3dd44c(0x1ff)](_0x309bb9){const _0x167b89=a54_0x3dd44c,{options:_0x24c77a,args:_0x1db6aa,tdx:_0x191044}=_0x309bb9,_0x69adbc=_0x1db6aa[0x0];let _0x3af80c=_0x1db6aa[0x1];if(!_0x69adbc)return console[_0x167b89(0x125)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x24c77a[_0x167b89(0x1e5)]&&(console[_0x167b89(0x125)](_0x167b89(0x1a1)+_0x69adbc),_0x3af80c&&console[_0x167b89(0x125)]('Task\x20name:\x20'+_0x3af80c));const _0x20be60=await withSpinner(_0x167b89(0x256),()=>_0x191044[_0x167b89(0x1f2)][_0x167b89(0x168)](_0x69adbc,_0x3af80c),{'verbose':_0x24c77a[_0x167b89(0x1e5)]}),_0x431164=_0x20be60['data'];if(_0x431164[_0x167b89(0x1d0)]===0x0)return console[_0x167b89(0x125)](_0x167b89(0x155)),0x0;if(!_0x3af80c&&(_0x24c77a[_0x167b89(0x252)]||_0x24c77a[_0x167b89(0x1d8)]))return await handleSDKOutput(_0x431164,_0x24c77a),0x0;if(!_0x3af80c){const _0x2417ef=_0x431164[_0x167b89(0x23c)](_0x4e262e=>({'title':_0x4e262e[_0x167b89(0x26a)]+'\x20('+formatBytes(_0x4e262e[_0x167b89(0x255)])+')','value':_0x4e262e[_0x167b89(0x26a)]})),_0x433456=await a54_0x2596be({'type':'select','name':_0x167b89(0x216),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x2417ef});if(!_0x433456[_0x167b89(0x216)])return console[_0x167b89(0x125)](_0x167b89(0x241)),0x0;_0x3af80c=_0x433456[_0x167b89(0x216)];}const _0x46f9c7=await withSpinner(_0x167b89(0x1cc),()=>_0x191044[_0x167b89(0x1f2)][_0x167b89(0x20c)](_0x69adbc,_0x3af80c),{'verbose':_0x24c77a['verbose']}),_0x29e83d=_0x46f9c7[_0x167b89(0x193)];return _0x29e83d?console[_0x167b89(0x2a7)](_0x29e83d):console[_0x167b89(0x125)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x17c);['description']=a54_0x3dd44c(0x1a4);async['execute'](_0x26ad27){const _0x4cf73f=a54_0x3dd44c,{options:_0x2d2e11,args:_0x4d30f0,tdx:_0x1e0a71}=_0x26ad27,_0x8c9bda=_0x4d30f0[0x0];if(!_0x8c9bda)return console[_0x4cf73f(0x125)](_0x4cf73f(0x17a)),0x1;const _0x14e1bc=_0x2d2e11[_0x4cf73f(0x282)];_0x2d2e11[_0x4cf73f(0x1e5)]&&(console['error'](_0x4cf73f(0x1a1)+_0x8c9bda),_0x14e1bc&&console[_0x4cf73f(0x125)](_0x4cf73f(0x19c)+_0x14e1bc));if(!_0x2d2e11[_0x4cf73f(0x202)]){if(!isInteractive())return console[_0x4cf73f(0x125)](a54_0x33d044[_0x4cf73f(0xf6)]('\x0aError:'),_0x4cf73f(0x103)),console[_0x4cf73f(0x125)](a54_0x33d044[_0x4cf73f(0x146)](_0x4cf73f(0x1c2))),0x1;const _0x38f422=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x8c9bda+'?');if(!_0x38f422)return console[_0x4cf73f(0x125)](a54_0x33d044[_0x4cf73f(0x114)](_0x4cf73f(0x241))),0x1;}const _0x5270cf=await withSpinner(_0x4cf73f(0x166),()=>_0x1e0a71[_0x4cf73f(0x1f2)][_0x4cf73f(0x23b)](_0x8c9bda,_0x14e1bc),{'verbose':_0x2d2e11[_0x4cf73f(0x1e5)]}),_0x5da078=_0x5270cf['data'];return console[_0x4cf73f(0x125)]('✔\x20'+_0x5da078),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';['description']='Retry\x20a\x20session\x20or\x20attempt';async[a54_0x3dd44c(0x1ff)](_0x523019){const _0x1fa77f=a54_0x3dd44c,{options:_0x113c76,args:_0x6d433d,tdx:_0x1319dd}=_0x523019,_0x38a627=_0x6d433d[0x0];if(!_0x38a627)return console['error'](_0x1fa77f(0x1c5)),console[_0x1fa77f(0x125)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2e64fc=![],_0x24a670=_0x38a627;if(_0x38a627['startsWith'](_0x1fa77f(0x275)))_0x2e64fc=!![],_0x24a670=_0x38a627['substring'](0x8);else{if(_0x38a627[_0x1fa77f(0x223)]('attempt:'))_0x2e64fc=![],_0x24a670=_0x38a627['substring'](0x8);else return console[_0x1fa77f(0x125)](_0x1fa77f(0x18f)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x130eeb=_0x113c76[_0x1fa77f(0x134)],_0x298ca2=_0x113c76[_0x1fa77f(0x181)],_0x3108b8=_0x113c76[_0x1fa77f(0x20a)],_0x4e55ce=_0x113c76['force'];_0x113c76[_0x1fa77f(0x1e5)]&&(console['error']('Target:\x20'+(_0x2e64fc?_0x1fa77f(0x25c):_0x1fa77f(0x1e7))+'\x20'+_0x24a670),_0x130eeb&&console[_0x1fa77f(0x125)](_0x1fa77f(0x110)+_0x130eeb),_0x298ca2&&console[_0x1fa77f(0x125)](_0x1fa77f(0xea)+_0x298ca2),_0x3108b8&&console[_0x1fa77f(0x125)]('Params:\x20'+_0x3108b8),_0x4e55ce&&console[_0x1fa77f(0x125)]('Force:\x20yes'));let _0x2f6a09;if(_0x3108b8)try{if(_0x3108b8['startsWith']('@')){const _0x56296b=await import(_0x1fa77f(0x29f)),_0x5f1f5a=_0x3108b8[_0x1fa77f(0x1f7)](0x1),_0x249353=await _0x56296b[_0x1fa77f(0x270)](_0x5f1f5a,'utf-8');_0x2f6a09=JSON[_0x1fa77f(0x21e)](_0x249353);}else _0x2f6a09=JSON[_0x1fa77f(0x21e)](_0x3108b8);}catch{return console[_0x1fa77f(0x125)](_0x1fa77f(0x226)),0x1;}if(!_0x113c76[_0x1fa77f(0x202)]){if(!isInteractive())return console[_0x1fa77f(0x125)](a54_0x33d044[_0x1fa77f(0xf6)]('\x0aError:'),_0x1fa77f(0x103)),console[_0x1fa77f(0x125)](a54_0x33d044[_0x1fa77f(0x146)](_0x1fa77f(0x1c2))),0x1;const _0x31a341=await confirmKey(_0x1fa77f(0x161)+(_0x2e64fc?'session':_0x1fa77f(0x1e7))+'\x20'+_0x24a670+'?');if(!_0x31a341)return console[_0x1fa77f(0x125)](a54_0x33d044[_0x1fa77f(0x114)](_0x1fa77f(0x241))),0x1;}let _0x5ea892;_0x2e64fc?_0x5ea892=await withSpinner('Retrying\x20session...',()=>_0x1319dd[_0x1fa77f(0x1f2)][_0x1fa77f(0x190)](_0x24a670,{'fromTask':_0x130eeb,'retryParams':_0x2f6a09}),{'verbose':_0x113c76[_0x1fa77f(0x1e5)]}):_0x5ea892=await withSpinner(_0x1fa77f(0xe0),()=>_0x1319dd[_0x1fa77f(0x1f2)][_0x1fa77f(0x244)](_0x24a670,{'resumeFrom':_0x298ca2,'retryParams':_0x2f6a09,'force':_0x4e55ce}),{'verbose':_0x113c76[_0x1fa77f(0x1e5)]});const _0x3b8a2a=_0x5ea892[_0x1fa77f(0x193)];return console[_0x1fa77f(0x125)](_0x1fa77f(0x234)),console[_0x1fa77f(0x125)](_0x1fa77f(0x212)+_0x3b8a2a[_0x1fa77f(0x18a)]),console[_0x1fa77f(0x125)](_0x1fa77f(0x266)+_0x3b8a2a[_0x1fa77f(0x233)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x281);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x207);async[a54_0x3dd44c(0x1ff)](_0x10367b){const _0x5d5e25=a54_0x3dd44c,{options:_0x15190f,args:_0x36ef6d,tdx:_0x18b880}=_0x10367b;let _0x29642a=_0x36ef6d[0x0];if(!_0x29642a){const _0x2d7ac2=this[_0x5d5e25(0x25a)]([],_0x15190f),_0x2f0ead=await withSpinner(_0x5d5e25(0x27f),()=>_0x18b880[_0x5d5e25(0x1f2)]['workflows'](_0x2d7ac2,{'limit':_0x15190f[_0x5d5e25(0x22e)]}),{'verbose':_0x15190f[_0x5d5e25(0x1e5)]}),_0x1586b8=_0x2f0ead[_0x5d5e25(0x193)];if(_0x1586b8[_0x5d5e25(0x1d0)]===0x0)return console['error'](_0x5d5e25(0x249)),!_0x2d7ac2&&console[_0x5d5e25(0x125)](a54_0x33d044[_0x5d5e25(0x146)](_0x5d5e25(0x257))),0x1;const _0x4b7643=_0x1586b8[_0x5d5e25(0x23c)](_0x552f51=>({'title':_0x552f51[_0x5d5e25(0x104)]?.[_0x5d5e25(0x237)]+'.'+_0x552f51[_0x5d5e25(0x237)],'value':_0x552f51[_0x5d5e25(0x104)]?.[_0x5d5e25(0x237)]+'.'+_0x552f51[_0x5d5e25(0x237)],'description':_0x552f51[_0x5d5e25(0x149)]?_0x5d5e25(0x176)+_0x552f51['revision']:undefined})),_0x5dd432=await a54_0x2596be({'type':_0x5d5e25(0x199),'name':'workflow','message':_0x5d5e25(0x1b7),'choices':_0x4b7643});if(!_0x5dd432[_0x5d5e25(0x1f2)])return 0x1;_0x29642a=_0x5dd432[_0x5d5e25(0x1f2)];}if(!_0x29642a[_0x5d5e25(0xfa)]('.')){const _0x20f07e=this[_0x5d5e25(0x25a)]([],_0x15190f);if(_0x20f07e)_0x29642a=_0x20f07e+'.'+_0x29642a;else return console['error'](a54_0x33d044['red'](_0x5d5e25(0x1ab)),_0x5d5e25(0xe9)),console[_0x5d5e25(0x125)](a54_0x33d044['dim'](_0x5d5e25(0x257))),0x1;}const _0x19082e=_0x15190f[_0x5d5e25(0x1cb)],_0x4dd70e=_0x15190f[_0x5d5e25(0x12a)],_0x2d6534={};if(_0x19082e&&Array[_0x5d5e25(0xeb)](_0x19082e))for(const _0x164a11 of _0x19082e){const _0x3f667e=_0x164a11[_0x5d5e25(0x277)]('=');if(_0x3f667e===-0x1)return console[_0x5d5e25(0x125)](_0x5d5e25(0x113)+_0x164a11),console[_0x5d5e25(0x125)](_0x5d5e25(0x175)),0x1;const _0x458844=_0x164a11['substring'](0x0,_0x3f667e),_0x1ab315=_0x164a11[_0x5d5e25(0x1f7)](_0x3f667e+0x1);try{_0x2d6534[_0x458844]=JSON[_0x5d5e25(0x21e)](_0x1ab315);}catch{_0x2d6534[_0x458844]=_0x1ab315;}}_0x15190f[_0x5d5e25(0x1e5)]&&(console[_0x5d5e25(0x125)](_0x5d5e25(0x1f1)+_0x29642a),Object[_0x5d5e25(0x2a2)](_0x2d6534)[_0x5d5e25(0x1d0)]>0x0&&console['error'](_0x5d5e25(0x259)+JSON[_0x5d5e25(0xff)](_0x2d6534)),_0x4dd70e&&console[_0x5d5e25(0x125)](_0x5d5e25(0xf0)+_0x4dd70e));if(_0x15190f[_0x5d5e25(0x2a3)])return await this[_0x5d5e25(0x15f)](_0x10367b,_0x29642a,_0x2d6534,_0x4dd70e);const _0x4c32d4=await withSpinner(_0x5d5e25(0x147),()=>_0x18b880[_0x5d5e25(0x1f2)][_0x5d5e25(0x165)](_0x29642a,_0x2d6534,{'sessionTime':_0x4dd70e}),{'verbose':_0x15190f[_0x5d5e25(0x1e5)]}),_0x13b4a9=_0x4c32d4[_0x5d5e25(0x193)];console[_0x5d5e25(0x125)](_0x5d5e25(0x28b)),console[_0x5d5e25(0x125)](_0x5d5e25(0x112)+_0x13b4a9['id']),console[_0x5d5e25(0x125)](_0x5d5e25(0x266)+_0x13b4a9[_0x5d5e25(0x233)]),console[_0x5d5e25(0x125)]('\x20\x20Project:\x20'+_0x13b4a9[_0x5d5e25(0x104)]?.['name']),console[_0x5d5e25(0x125)](_0x5d5e25(0x242)+_0x13b4a9[_0x5d5e25(0x1f2)]?.[_0x5d5e25(0x237)]);if(_0x13b4a9[_0x5d5e25(0x104)]?.['id']&&_0x13b4a9[_0x5d5e25(0x233)]&&_0x13b4a9['id']){const _0x55962f=_0x15190f[_0x5d5e25(0x283)],_0x440609=getConsoleUrl(_0x55962f,'/app/workflows/'+_0x13b4a9['project']['id']+'/sessions/'+_0x13b4a9[_0x5d5e25(0x233)]+_0x5d5e25(0x1d4)+_0x13b4a9['id']);console['error'](_0x5d5e25(0x205)+a54_0x33d044[_0x5d5e25(0x210)](_0x440609));}return 0x0;}async[a54_0x3dd44c(0x15f)](_0x147533,_0x34d52b,_0x57690f,_0x32b646){const _0xb08b4c=a54_0x3dd44c,{options:_0x166ef5,tdx:_0x6aca5b}=_0x147533,_0x26ec87=await withSpinner(_0xb08b4c(0x179)+_0x34d52b+_0xb08b4c(0x123),()=>_0x6aca5b[_0xb08b4c(0x1f2)][_0xb08b4c(0x245)](_0x34d52b),{'verbose':_0x166ef5['verbose']}),_0x43e82d=_0x26ec87[_0xb08b4c(0x193)],_0x2d3dff=_0x32b646??new Date()[_0xb08b4c(0x1b2)]();console[_0xb08b4c(0x2a7)](a54_0x33d044['bold'](_0xb08b4c(0x187)),_0x34d52b),console[_0xb08b4c(0x2a7)](a54_0x33d044['bold']('Session\x20time:'),_0x2d3dff),console['log'](a54_0x33d044['bold'](_0xb08b4c(0x1bd)),JSON[_0xb08b4c(0xff)](_0x57690f)),console[_0xb08b4c(0x2a7)](''),console[_0xb08b4c(0x2a7)](a54_0x33d044[_0xb08b4c(0x15d)](_0xb08b4c(0x102)));const _0x481393=parseTaskGraph(_0x43e82d[_0xb08b4c(0x27c)]??null);if(_0x481393[_0xb08b4c(0x1d0)]===0x0)console[_0xb08b4c(0x2a7)](a54_0x33d044['dim']('\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)'));else for(const _0x4e909e of formatTaskGraph(_0x481393)){console[_0xb08b4c(0x2a7)](_0x4e909e);}const _0x1d8a1d=summarizeTaskGraph(_0x481393),_0xd7e87f=formatWarningSummary(_0x1d8a1d);return _0xd7e87f&&(console[_0xb08b4c(0x2a7)](''),console[_0xb08b4c(0x2a7)](a54_0x33d044[_0xb08b4c(0x114)](_0xd7e87f))),console['log'](a54_0x33d044[_0xb08b4c(0x114)](_0xb08b4c(0x1dd))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x3dd44c(0xfe);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x221);async[a54_0x3dd44c(0x1ff)](_0x2e8317){const _0xf383dc=a54_0x3dd44c,{options:_0x12abcc,args:_0x406eaa,tdx:_0x28d222}=_0x2e8317,_0x1bbdb4=_0x406eaa[0x0],_0x46721a=_0x406eaa[0x1]||'.';if(!_0x1bbdb4)return console['error'](_0xf383dc(0x28a)),console[_0xf383dc(0x125)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x5874da=_0x12abcc[_0xf383dc(0x149)];_0x12abcc[_0xf383dc(0x1e5)]&&(console[_0xf383dc(0x125)](_0xf383dc(0x118)+_0x1bbdb4),console[_0xf383dc(0x125)](_0xf383dc(0x136)+_0x46721a),_0x5874da&&console[_0xf383dc(0x125)](_0xf383dc(0x1ac)+_0x5874da));const _0x5b976e=await withSpinner('Downloading\x20project\x20'+_0x1bbdb4+_0xf383dc(0x123),()=>_0x28d222['workflow']['download'](_0x1bbdb4,_0x46721a,{'revision':_0x5874da}),{'verbose':_0x12abcc['verbose']}),_0x4fe055=_0x5b976e[_0xf383dc(0x193)];return console[_0xf383dc(0x125)](_0xf383dc(0x215)+_0x4fe055[_0xf383dc(0x139)]),console[_0xf383dc(0x125)](_0xf383dc(0x1db)+_0x4fe055[_0xf383dc(0x149)]),console[_0xf383dc(0x125)]('\x20\x20Files\x20extracted:\x20'+_0x4fe055[_0xf383dc(0x18c)]),console[_0xf383dc(0x125)](_0xf383dc(0x18b)+_0x46721a+'/'+_0x4fe055[_0xf383dc(0x139)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x171);[a54_0x3dd44c(0x1c0)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a54_0x3dd44c(0x1ff)](_0x313e81){const _0x8375fd=a54_0x3dd44c,{options:_0x502016,args:_0x5798a4,tdx:_0x437cd8}=_0x313e81;let _0x1622b4='.',_0x1f5508=_0x502016[_0x8375fd(0x237)];if(_0x5798a4[0x0]){const {promises:_0x4ff98e}=await import('fs');try{const _0x4f5c39=await _0x4ff98e[_0x8375fd(0x232)](_0x5798a4[0x0]);if(_0x4f5c39[_0x8375fd(0x159)]())_0x1622b4=_0x5798a4[0x0];else return console['error'](_0x8375fd(0x18d)+_0x5798a4[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x1f5508=_0x5798a4[0x0],_0x1622b4='.';}}const _0x37682b=_0x502016[_0x8375fd(0x149)],_0x569e70=_0x502016[_0x8375fd(0x19b)];_0x502016[_0x8375fd(0x1e5)]&&(console['error']('Project\x20directory:\x20'+_0x1622b4),_0x1f5508&&console[_0x8375fd(0x125)](_0x8375fd(0x13c)+_0x1f5508),_0x37682b&&console['error'](_0x8375fd(0x1ac)+_0x37682b),_0x569e70&&console[_0x8375fd(0x125)](_0x8375fd(0x191)));const _0x236599=await withSpinner(_0x8375fd(0x261),()=>_0x437cd8['workflow']['push'](_0x1622b4,{'projectName':_0x1f5508,'revision':_0x37682b,'skipValidation':_0x569e70}),{'verbose':_0x502016[_0x8375fd(0x1e5)]}),_0x2c3038=_0x236599[_0x8375fd(0x193)];return console[_0x8375fd(0x125)](_0x8375fd(0x16b)+_0x2c3038[_0x8375fd(0x139)]),console[_0x8375fd(0x125)](_0x8375fd(0x169)+_0x2c3038[_0x8375fd(0x1be)]),console[_0x8375fd(0x125)]('\x20\x20Revision:\x20'+_0x2c3038[_0x8375fd(0x149)]),await this['showWorkflowConsoleUrl'](_0x437cd8,_0x2c3038[_0x8375fd(0x139)],_0x502016['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0x3dd44c(0x1a7);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0xde);async[a54_0x3dd44c(0x1ff)](_0x16d09c){const _0x559cdf=a54_0x3dd44c,{options:_0x2f4acd,args:_0x524c61,tdx:_0x462097}=_0x16d09c,_0x2cd6cf=_0x524c61[0x0],_0x4dfa0d=_0x524c61[0x1];if(!_0x2cd6cf)return console[_0x559cdf(0x125)](a54_0x33d044[_0x559cdf(0xf6)]('Error:'),_0x559cdf(0x1bc)),console[_0x559cdf(0x125)](a54_0x33d044[_0x559cdf(0x146)](_0x559cdf(0x204))),0x1;const _0x107711=_0x2f4acd[_0x559cdf(0x149)];_0x2f4acd[_0x559cdf(0x1e5)]&&(console[_0x559cdf(0x125)](_0x559cdf(0x118)+_0x2cd6cf),_0x4dfa0d&&console[_0x559cdf(0x125)](_0x559cdf(0x152)+_0x4dfa0d),_0x107711&&console[_0x559cdf(0x125)]('Revision:\x20'+_0x107711),_0x2f4acd[_0x559cdf(0x2a3)]&&console[_0x559cdf(0x125)](_0x559cdf(0x14c)));const _0x29aedc=await withSpinner(_0x559cdf(0x2a1)+_0x2cd6cf+_0x559cdf(0x123),()=>_0x462097[_0x559cdf(0x1f2)]['pullProject'](_0x2cd6cf,{'targetDir':_0x4dfa0d,'revision':_0x107711}),{'verbose':_0x2f4acd[_0x559cdf(0x1e5)]}),_0x492df3=_0x29aedc[_0x559cdf(0x193)];_0x492df3[_0x559cdf(0x160)]?console['error'](_0x559cdf(0x294)+_0x492df3[_0x559cdf(0x139)]):console[_0x559cdf(0x125)](_0x559cdf(0x1e9)+_0x492df3[_0x559cdf(0x139)]);console[_0x559cdf(0x125)](_0x559cdf(0x1db)+_0x492df3[_0x559cdf(0x149)]),console[_0x559cdf(0x125)](_0x559cdf(0x10f)+(a54_0x3af23b[_0x559cdf(0x21d)](process[_0x559cdf(0x2a0)](),_0x492df3[_0x559cdf(0x298)])||'.')),console['error'](_0x559cdf(0x13a)+a54_0x33d044[_0x559cdf(0xfd)]('+'+_0x492df3[_0x559cdf(0x2aa)][_0x559cdf(0x20f)]+'\x20new')+',\x20'+(a54_0x33d044[_0x559cdf(0x114)]('~'+_0x492df3[_0x559cdf(0x2aa)]['modified']+_0x559cdf(0x1b6))+',\x20')+(a54_0x33d044[_0x559cdf(0xf6)]('-'+_0x492df3['summary'][_0x559cdf(0x19e)]+'\x20deleted')+',\x20')+(''+a54_0x33d044[_0x559cdf(0x146)](_0x492df3['summary']['unchanged']+'\x20unchanged')));for(const _0x56e977 of _0x492df3[_0x559cdf(0x25e)]){_0x56e977[_0x559cdf(0x220)]===_0x559cdf(0x267)&&_0x56e977['diff']&&(console[_0x559cdf(0x125)]('\x0a'+a54_0x33d044['cyan']('---\x20'+_0x56e977['path'])),console[_0x559cdf(0x125)](_0x56e977[_0x559cdf(0x28c)]));}if(!_0x492df3[_0x559cdf(0x219)])return saveSessionContext({'workflow_project':_0x492df3['projectName']},_0x2f4acd[_0x559cdf(0x25c)]),console['error'](a54_0x33d044[_0x559cdf(0xfd)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x559cdf(0x125)](a54_0x33d044['dim'](_0x559cdf(0x137)+_0x492df3['projectName'])),0x0;if(_0x2f4acd[_0x559cdf(0x2a3)])return console[_0x559cdf(0x125)](a54_0x33d044['yellow'](_0x559cdf(0x15e))),0x0;if(!_0x2f4acd['yes']){if(!isInteractive())return console[_0x559cdf(0x125)](a54_0x33d044[_0x559cdf(0xf6)]('\x0aError:'),_0x559cdf(0x103)),console['error'](a54_0x33d044[_0x559cdf(0x146)](_0x559cdf(0x1c2))),0x1;const _0x37120f=await confirmKey(_0x559cdf(0x2af));if(!_0x37120f)return console['error'](a54_0x33d044[_0x559cdf(0x114)](_0x559cdf(0x241)),_0x559cdf(0x26f)),0x1;}await withSpinner(_0x559cdf(0x28e),()=>_0x462097['workflow'][_0x559cdf(0x17e)](_0x492df3,{'revision':_0x107711}),{'verbose':_0x2f4acd[_0x559cdf(0x1e5)]}),saveSessionContext({'workflow_project':_0x492df3[_0x559cdf(0x139)]},_0x2f4acd[_0x559cdf(0x25c)]),console[_0x559cdf(0x125)](a54_0x33d044[_0x559cdf(0xfd)](_0x559cdf(0x1c1)));const _0x921dda=a54_0x3af23b['relative'](process['cwd'](),_0x492df3['targetDir'])||'.';return console['error'](a54_0x33d044[_0x559cdf(0x146)]('\x20\x20Location:\x20'+_0x921dda)),console['error'](a54_0x33d044[_0x559cdf(0x146)](_0x559cdf(0x137)+_0x492df3[_0x559cdf(0x139)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x1c7);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x180);async[a54_0x3dd44c(0x1ff)](_0x1b45d2){const _0x1525d3=a54_0x3dd44c,{options:_0x268efb,args:_0x1b0e08,tdx:_0xfe5132}=_0x1b45d2,_0x791d9b=this[_0x1525d3(0x1f3)](_0x1b0e08,_0x268efb),_0x1b3d6a=_0x268efb[_0x1525d3(0x149)],_0x165d57=_0x268efb[_0x1525d3(0x19b)];_0x268efb['verbose']&&(_0x791d9b&&console[_0x1525d3(0x125)]('Source\x20directory:\x20'+_0x791d9b),_0x1b3d6a&&console['error']('Revision:\x20'+_0x1b3d6a),_0x268efb[_0x1525d3(0x2a3)]&&console[_0x1525d3(0x125)](_0x1525d3(0x14c)),_0x165d57&&console['error'](_0x1525d3(0x191)));let _0x3d95fd;try{_0x3d95fd=await withSpinner(_0x1525d3(0x162),()=>_0xfe5132[_0x1525d3(0x1f2)][_0x1525d3(0x248)]({'sourceDir':_0x791d9b,'revision':_0x1b3d6a,'skipValidation':_0x165d57}),{'verbose':_0x268efb[_0x1525d3(0x1e5)]});}catch(_0x508a84){if(_0x508a84 instanceof Error&&_0x508a84[_0x1525d3(0x1eb)]['includes'](_0x1525d3(0x296)))return console['error'](a54_0x33d044[_0x1525d3(0xf6)]('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x268efb[_0x1525d3(0x1d5)]?console['error'](a54_0x33d044[_0x1525d3(0x146)](_0x1525d3(0xf5)+_0x268efb[_0x1525d3(0x1d5)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x268efb[_0x1525d3(0x1d5)]+'\x27')):console['error'](a54_0x33d044['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x508a84;}const _0xa8e4a9=_0x3d95fd[_0x1525d3(0x193)];console[_0x1525d3(0x125)](_0x1525d3(0x284)+_0xa8e4a9[_0x1525d3(0x139)]),console[_0x1525d3(0x125)](_0x1525d3(0x156)+_0xa8e4a9['sourceDir']),console[_0x1525d3(0x125)](_0x1525d3(0x1db)+_0xa8e4a9['revision']),console[_0x1525d3(0x125)](_0x1525d3(0x13a)+a54_0x33d044[_0x1525d3(0xfd)]('+'+_0xa8e4a9[_0x1525d3(0x2aa)]['new']+_0x1525d3(0x154))+',\x20'+(a54_0x33d044[_0x1525d3(0x114)]('~'+_0xa8e4a9[_0x1525d3(0x2aa)][_0x1525d3(0x267)]+_0x1525d3(0x1b6))+',\x20')+(a54_0x33d044['red']('-'+_0xa8e4a9[_0x1525d3(0x2aa)][_0x1525d3(0x19e)]+_0x1525d3(0x299))+',\x20')+(''+a54_0x33d044[_0x1525d3(0x146)](_0xa8e4a9['summary'][_0x1525d3(0xe3)]+_0x1525d3(0x1ba))));for(const _0xbb29ad of _0xa8e4a9[_0x1525d3(0x25e)]){_0xbb29ad['type']===_0x1525d3(0x267)&&_0xbb29ad[_0x1525d3(0x28c)]&&(console[_0x1525d3(0x125)]('\x0a'+a54_0x33d044[_0x1525d3(0x210)](_0x1525d3(0x222)+_0xbb29ad['path'])),console[_0x1525d3(0x125)](_0xbb29ad['diff']));}if(!_0xa8e4a9[_0x1525d3(0x219)])return console[_0x1525d3(0x125)](a54_0x33d044['green'](_0x1525d3(0x184))),await this['showWorkflowConsoleUrl'](_0xfe5132,_0xa8e4a9[_0x1525d3(0x139)],_0x268efb[_0x1525d3(0x283)]),0x0;if(_0x268efb[_0x1525d3(0x2a3)])return console['error'](a54_0x33d044[_0x1525d3(0x114)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x268efb[_0x1525d3(0x202)]){if(!isInteractive())return console[_0x1525d3(0x125)](a54_0x33d044[_0x1525d3(0xf6)](_0x1525d3(0x278)),_0x1525d3(0x103)),console[_0x1525d3(0x125)](a54_0x33d044[_0x1525d3(0x146)](_0x1525d3(0x1c2))),0x1;const _0x4ca541=await confirmKey(_0x1525d3(0x106));if(!_0x4ca541)return console['error'](a54_0x33d044['yellow'](_0x1525d3(0x241)),_0x1525d3(0x19a)),0x1;}const _0x42d5ec=await withSpinner(_0x1525d3(0x2ab),()=>_0xfe5132[_0x1525d3(0x1f2)][_0x1525d3(0x240)](_0xa8e4a9),{'verbose':_0x268efb['verbose']}),_0x2702b7=_0x42d5ec[_0x1525d3(0x193)];return console[_0x1525d3(0x125)](a54_0x33d044['green'](_0x1525d3(0x17f))),console[_0x1525d3(0x125)]('\x20\x20Project\x20ID:\x20'+_0x2702b7[_0x1525d3(0x1be)]),console[_0x1525d3(0x125)]('\x20\x20Revision:\x20'+_0x2702b7[_0x1525d3(0x149)]),await this['showWorkflowConsoleUrl'](_0xfe5132,_0x2702b7[_0x1525d3(0x139)],_0x268efb[_0x1525d3(0x283)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x254);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x120);async[a54_0x3dd44c(0x1ff)](_0xd7b540){const _0x41e8ca=a54_0x3dd44c,{options:_0x65ed80,args:_0x3352ba,tdx:_0x5a76f4}=_0xd7b540,_0x1f6bf5=this[_0x41e8ca(0x1f3)](_0x3352ba,_0x65ed80),_0x57d98d=_0x65ed80[_0x41e8ca(0x237)],_0x2b3e84=_0x65ed80[_0x41e8ca(0x149)],_0xfc5d1b=_0x65ed80[_0x41e8ca(0x19b)];if(!_0x1f6bf5)return console[_0x41e8ca(0x125)](a54_0x33d044[_0x41e8ca(0xf6)](_0x41e8ca(0x1ab)),_0x41e8ca(0x1fc)),console[_0x41e8ca(0x125)](a54_0x33d044[_0x41e8ca(0x146)](_0x41e8ca(0x1e3))),console[_0x41e8ca(0x125)](a54_0x33d044['dim'](_0x41e8ca(0x24b))),0x1;if(!_0x57d98d)return console[_0x41e8ca(0x125)](a54_0x33d044['red'](_0x41e8ca(0x1ab)),_0x41e8ca(0x177)),console[_0x41e8ca(0x125)](a54_0x33d044['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x65ed80[_0x41e8ca(0x1e5)]&&(console['error'](_0x41e8ca(0x158)+_0x1f6bf5),console[_0x41e8ca(0x125)](_0x41e8ca(0x11a)+_0x57d98d),_0x2b3e84&&console['error'](_0x41e8ca(0x1ac)+_0x2b3e84),_0x65ed80[_0x41e8ca(0x2a3)]&&console[_0x41e8ca(0x125)](_0x41e8ca(0x14c)),_0xfc5d1b&&console[_0x41e8ca(0x125)](_0x41e8ca(0x191)));const _0x1892a3=await withSpinner(_0x41e8ca(0x126),()=>_0x5a76f4['workflow']['prepareCloneProject'](_0x1f6bf5,_0x57d98d,{'revision':_0x2b3e84,'skipValidation':_0xfc5d1b}),{'verbose':_0x65ed80[_0x41e8ca(0x1e5)]}),_0x3edafe=_0x1892a3[_0x41e8ca(0x193)];console[_0x41e8ca(0x125)]('Source:\x20'+_0x3edafe[_0x41e8ca(0xf1)]);_0x3edafe[_0x41e8ca(0x25b)]&&console['error'](_0x41e8ca(0x15c)+_0x3edafe[_0x41e8ca(0x25b)]);console[_0x41e8ca(0x125)](_0x41e8ca(0x11a)+_0x3edafe[_0x41e8ca(0x12e)]),console[_0x41e8ca(0x125)](_0x41e8ca(0x1ac)+_0x3edafe[_0x41e8ca(0x149)]),console[_0x41e8ca(0x125)]('Files\x20to\x20upload:\x20'+_0x3edafe[_0x41e8ca(0x164)]);_0x3edafe[_0x41e8ca(0xdc)]&&(console['error'](a54_0x33d044[_0x41e8ca(0x114)](_0x41e8ca(0x12f)+_0x3edafe[_0x41e8ca(0x12e)]+_0x41e8ca(0x289)+_0x3edafe['existingProjectId']+')')),console['error'](a54_0x33d044[_0x41e8ca(0x114)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x65ed80['dryRun'])return console[_0x41e8ca(0x125)](a54_0x33d044[_0x41e8ca(0x114)](_0x41e8ca(0xf3))),0x0;if(!_0x65ed80['yes']){if(!isInteractive())return console[_0x41e8ca(0x125)](a54_0x33d044['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x33d044[_0x41e8ca(0x146)](_0x41e8ca(0x1c2))),0x1;const _0x494347=_0x3edafe[_0x41e8ca(0x25b)]||a54_0x3af23b[_0x41e8ca(0x262)](_0x1f6bf5),_0x59d79f=_0x3edafe['targetExists']?_0x41e8ca(0xed)+_0x57d98d+'\x22\x20with\x20new\x20revision?':_0x41e8ca(0x174)+_0x494347+'\x22\x20to\x20new\x20project\x20\x22'+_0x57d98d+'\x22?',_0x13f19b=await confirmKey(_0x59d79f);if(!_0x13f19b)return console[_0x41e8ca(0x125)](a54_0x33d044[_0x41e8ca(0x114)](_0x41e8ca(0x241))),0x1;}const _0x10dc76=await withSpinner(_0x3edafe['targetExists']?_0x41e8ca(0x128)+_0x57d98d+_0x41e8ca(0x123):_0x41e8ca(0x119)+_0x57d98d+_0x41e8ca(0x123),()=>_0x5a76f4['workflow'][_0x41e8ca(0x197)](_0x3edafe),{'verbose':_0x65ed80[_0x41e8ca(0x1e5)]}),_0x44bb41=_0x10dc76[_0x41e8ca(0x193)];return console[_0x41e8ca(0x125)](a54_0x33d044[_0x41e8ca(0xfd)](_0x3edafe[_0x41e8ca(0xdc)]?'✔\x20Project\x20updated':_0x41e8ca(0x18e))),console[_0x41e8ca(0x125)]('\x20\x20Project:\x20'+_0x44bb41[_0x41e8ca(0x12e)]),console[_0x41e8ca(0x125)](_0x41e8ca(0x169)+_0x44bb41[_0x41e8ca(0x229)]),console['error'](_0x41e8ca(0x1db)+_0x44bb41[_0x41e8ca(0x149)]),await this[_0x41e8ca(0x1aa)](_0x5a76f4,_0x44bb41[_0x41e8ca(0x12e)],_0x65ed80[_0x41e8ca(0x283)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x208);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x157);async[a54_0x3dd44c(0x1ff)](_0x44c52d){const _0xaae390=a54_0x3dd44c,{options:_0x22b00e,args:_0x460ed6,tdx:_0x5e6520}=_0x44c52d,_0x39f0af=_0x460ed6[0x0];if(!_0x39f0af)return console[_0xaae390(0x125)](_0xaae390(0x1d1)),console['error'](_0xaae390(0x109)),0x1;_0x22b00e[_0xaae390(0x1e5)]&&console[_0xaae390(0x125)](_0xaae390(0x118)+_0x39f0af);if(!_0x22b00e[_0xaae390(0x202)]){if(!isInteractive())return console[_0xaae390(0x125)](a54_0x33d044[_0xaae390(0xf6)](_0xaae390(0x278)),_0xaae390(0x103)),console[_0xaae390(0x125)](a54_0x33d044[_0xaae390(0x146)](_0xaae390(0x1c2))),0x1;const _0x955dd3=await confirmKey(_0xaae390(0x1d7)+_0x39f0af+_0xaae390(0x1b0));if(!_0x955dd3)return console[_0xaae390(0x125)](a54_0x33d044['yellow'](_0xaae390(0x241))),0x1;}const _0xcfe6b7=await withSpinner(_0xaae390(0x22b)+_0x39f0af+'...',()=>_0x5e6520['workflow'][_0xaae390(0x148)](_0x39f0af),{'verbose':_0x22b00e[_0xaae390(0x1e5)]}),_0x227ec4=_0xcfe6b7[_0xaae390(0x193)];return console[_0xaae390(0x125)](_0xaae390(0x1f9)+_0x227ec4['projectName']),console[_0xaae390(0x125)](_0xaae390(0x169)+_0x227ec4[_0xaae390(0x1be)]),0x0;}}export function parseKeyValue(_0x14443c){const _0x11d4d1=a54_0x3dd44c,_0x3f386b=_0x14443c['indexOf']('=');if(_0x3f386b===-0x1)throw new Error(_0x11d4d1(0x1b9)+_0x14443c+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x494701=_0x14443c[_0x11d4d1(0x1f7)](0x0,_0x3f386b),_0xe87e77=_0x14443c[_0x11d4d1(0x1f7)](_0x3f386b+0x1);if(!_0x494701)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x494701,'value':_0xe87e77};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a54_0x3dd44c(0x203);['description']=a54_0x3dd44c(0x268);async[a54_0x3dd44c(0x1ff)](_0x443afb){const _0x48086f=a54_0x3dd44c,{options:_0x31df5b,args:_0x5e9d8f,tdx:_0x6225b6}=_0x443afb,_0x3e673c=this['requireProject'](_0x5e9d8f,_0x31df5b);if(!_0x3e673c)return 0x1;_0x31df5b['verbose']&&console[_0x48086f(0x125)](_0x48086f(0x118)+_0x3e673c);const _0xbf0919=await withSpinner('Listing\x20secrets...',()=>_0x6225b6[_0x48086f(0x1f2)]['listSecrets'](_0x3e673c),{'verbose':_0x31df5b[_0x48086f(0x1e5)]}),{secrets:_0x2a868a}=_0xbf0919[_0x48086f(0x193)];return console[_0x48086f(0x125)](_0x48086f(0x274)+_0x2a868a[_0x48086f(0x1d0)]+_0x48086f(0x14f)+(_0x2a868a[_0x48086f(0x1d0)]!==0x1?'s':'')),await handleSDKOutput(_0x2a868a,_0x31df5b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a54_0x3dd44c(0x27b);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x1c9);async[a54_0x3dd44c(0x1ff)](_0x3a9940){const _0x13690c=a54_0x3dd44c,{options:_0x2e16ff,args:_0x40be68,tdx:_0x488037}=_0x3a9940;let _0x135ad2,_0x44a4b9;if(_0x40be68[_0x13690c(0x1d0)]>=0x1&&!_0x40be68[0x0][_0x13690c(0xfa)]('='))_0x135ad2=_0x40be68[0x0],_0x44a4b9=_0x40be68[_0x13690c(0x121)](0x1);else{if(_0x40be68[_0x13690c(0x1d0)]>=0x1&&_0x2e16ff[_0x13690c(0x1d5)])_0x135ad2=_0x2e16ff['workflowProject'],_0x44a4b9=_0x40be68;else return _0x40be68[_0x13690c(0x1d0)]>=0x1?(console[_0x13690c(0x125)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x13690c(0x257)),0x1):(console[_0x13690c(0x125)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x13690c(0x265)),0x1);}if(_0x44a4b9[_0x13690c(0x1d0)]===0x0)return console[_0x13690c(0x125)](_0x13690c(0x101)),console[_0x13690c(0x125)](_0x13690c(0x265)),0x1;const _0x2a3ddb={};try{for(const _0x3071f of _0x44a4b9){const {key:_0x5f2130,value:_0x299c4f}=parseKeyValue(_0x3071f);_0x2a3ddb[_0x5f2130]=_0x299c4f;}}catch(_0x210feb){return _0x210feb instanceof Error&&console[_0x13690c(0x125)](a54_0x33d044[_0x13690c(0xf6)](_0x13690c(0x1ab)),_0x210feb[_0x13690c(0x1eb)]),0x1;}const _0x20fd29=Object['keys'](_0x2a3ddb);_0x2e16ff[_0x13690c(0x1e5)]&&(console['error']('Project:\x20'+_0x135ad2),console[_0x13690c(0x125)](_0x13690c(0x1b3)+_0x20fd29[_0x13690c(0x227)](',\x20')));const _0x2bce6d=await withSpinner(_0x20fd29[_0x13690c(0x1d0)]===0x1?_0x13690c(0x258):_0x13690c(0xe4)+_0x20fd29['length']+_0x13690c(0x250),()=>_0x488037[_0x13690c(0x1f2)][_0x13690c(0x100)](_0x135ad2,_0x2a3ddb),{'verbose':_0x2e16ff[_0x13690c(0x1e5)]}),_0x46a619=_0x2bce6d[_0x13690c(0x193)];return console[_0x13690c(0x125)](_0x20fd29['length']===0x1?_0x13690c(0x13d)+_0x46a619[_0x13690c(0x2a2)][0x0]+_0x13690c(0xec)+_0x46a619[_0x13690c(0x139)]+'\x27':'✔\x20'+_0x46a619['keys'][_0x13690c(0x1d0)]+_0x13690c(0x1da)+_0x46a619[_0x13690c(0x139)]+'\x27'),(_0x2e16ff['json']||_0x2e16ff[_0x13690c(0x25f)])&&await handleSingleObjectOutput(_0x46a619,_0x2e16ff),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x1ca);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x11b);async[a54_0x3dd44c(0x1ff)](_0x48d9f7){const _0x31bd7a=a54_0x3dd44c,{options:_0x5dcb6a,args:_0x1a5145,tdx:_0x4fbed5}=_0x48d9f7;let _0x42172f,_0x891ab6;if(_0x1a5145['length']>=0x2)_0x42172f=_0x1a5145[0x0],_0x891ab6=_0x1a5145[0x1];else{if(_0x1a5145[_0x31bd7a(0x1d0)]===0x1&&_0x5dcb6a[_0x31bd7a(0x1d5)])_0x42172f=_0x5dcb6a[_0x31bd7a(0x1d5)],_0x891ab6=_0x1a5145[0x0];else return _0x1a5145[_0x31bd7a(0x1d0)]===0x1?(console[_0x31bd7a(0x125)](_0x31bd7a(0x28a)),console[_0x31bd7a(0x125)](_0x31bd7a(0x257)),0x1):(console[_0x31bd7a(0x125)](_0x31bd7a(0x14a)),console['error'](_0x31bd7a(0x142)),0x1);}_0x5dcb6a[_0x31bd7a(0x1e5)]&&(console[_0x31bd7a(0x125)](_0x31bd7a(0x118)+_0x42172f),console[_0x31bd7a(0x125)]('Key:\x20'+_0x891ab6));if(!_0x5dcb6a[_0x31bd7a(0x202)]){if(!isInteractive())return console[_0x31bd7a(0x125)](a54_0x33d044[_0x31bd7a(0xf6)](_0x31bd7a(0x278)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x31bd7a(0x125)](a54_0x33d044[_0x31bd7a(0x146)](_0x31bd7a(0x1c2))),0x1;const _0x49ad8f=await confirmKey(_0x31bd7a(0x14e)+_0x891ab6+_0x31bd7a(0x1ad)+_0x42172f+'\x27?');if(!_0x49ad8f)return console[_0x31bd7a(0x125)](a54_0x33d044[_0x31bd7a(0x114)]('Cancelled')),0x1;}const _0x55b389=await withSpinner(_0x31bd7a(0x285),()=>_0x4fbed5['workflow'][_0x31bd7a(0x11e)](_0x42172f,_0x891ab6),{'verbose':_0x5dcb6a['verbose']}),_0x4116d8=_0x55b389[_0x31bd7a(0x193)];return console[_0x31bd7a(0x125)](_0x31bd7a(0x13d)+_0x4116d8[_0x31bd7a(0x1a0)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x4116d8['projectName']+'\x27'),(_0x5dcb6a[_0x31bd7a(0x252)]||_0x5dcb6a['jsonl'])&&await handleSingleObjectOutput(_0x4116d8,_0x5dcb6a),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(_0x5333a2){const _0x2642a0=a54_0x3dd44c,_0x307351=Math[_0x2642a0(0x16f)](_0x5333a2/0x3e8),_0x18f2a8=Math[_0x2642a0(0x16f)](_0x307351/0x3c),_0x2a38a4=Math[_0x2642a0(0x16f)](_0x18f2a8/0x3c),_0x2c9dc3=Math['floor'](_0x2a38a4/0x18);if(_0x2c9dc3>0x0){const _0x1d75f2=_0x2a38a4%0x18;return _0x1d75f2>0x0?_0x2c9dc3+'d\x20'+_0x1d75f2+'h':_0x2c9dc3+'d';}else{if(_0x2a38a4>0x0){const _0x45da85=_0x18f2a8%0x3c;return _0x45da85>0x0?_0x2a38a4+'h\x20'+_0x45da85+'m':_0x2a38a4+'h';}else{if(_0x18f2a8>0x0){const _0x162a22=_0x307351%0x3c;return _0x162a22>0x0?_0x18f2a8+'m\x20'+_0x162a22+'s':_0x18f2a8+'m';}else return _0x307351+'s';}}}function formatTimestamp(_0x265639,_0x1c32b1){const _0x1513a7=a54_0x3dd44c,_0x4c451d=new Date(_0x265639),_0x4e7299=String(_0x4c451d[_0x1513a7(0x195)]())[_0x1513a7(0x10b)](0x2,'0'),_0x39ca0a=String(_0x4c451d[_0x1513a7(0xf7)]())[_0x1513a7(0x10b)](0x2,'0'),_0x29df10=_0x4e7299+':'+_0x39ca0a,_0x1798dd=_0x4c451d[_0x1513a7(0x20d)]()===_0x1c32b1[_0x1513a7(0x20d)]()&&_0x4c451d[_0x1513a7(0x27a)]()===_0x1c32b1['getMonth']()&&_0x4c451d[_0x1513a7(0x127)]()===_0x1c32b1[_0x1513a7(0x127)]();if(_0x1798dd)return _0x29df10;else{const _0x10df0b=String(_0x4c451d[_0x1513a7(0x27a)]()+0x1)['padStart'](0x2,'0'),_0x19d797=String(_0x4c451d[_0x1513a7(0x127)]())['padStart'](0x2,'0');return _0x10df0b+'-'+_0x19d797+'\x20'+_0x29df10;}}function formatDate(_0x3b14a4){const _0x569135=a54_0x3dd44c,_0x4686b6=_0x3b14a4[_0x569135(0x20d)](),_0x59d3bf=String(_0x3b14a4[_0x569135(0x27a)]()+0x1)['padStart'](0x2,'0'),_0x4dae3d=String(_0x3b14a4[_0x569135(0x127)]())[_0x569135(0x10b)](0x2,'0');return _0x4686b6+'-'+_0x59d3bf+'-'+_0x4dae3d;}function getTaskStateIcon(_0x465bba){const _0x2d232b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2d232b[_0x465bba]||'⚪';}function getBarChar(_0x29cfa1){const _0x3ae7da=a54_0x3dd44c;return _0x29cfa1===_0x3ae7da(0x125)||_0x29cfa1===_0x3ae7da(0x1c4)?'×':'─';}function a54_0x550a(){const _0xe2274b=['Expected\x20format:\x20--param\x20key=value','revision:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Fetching\x20workflow\x20','Error:\x20Attempt\x20ID\x20is\x20required','match','workflow:kill','autocomplete','applyPullProject','✔\x20Push\x20complete','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','resumeFrom','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','2609968AZDcyF','\x0a✔\x20No\x20changes\x20to\x20push','round','retryAttemptName','Workflow:','\x20(system)','startedAt','attemptId','\x20\x20Location:\x20','filesExtracted','Error:\x20','✔\x20Clone\x20complete','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','retrySession','Validation:\x20skipped','get','data','updatedAt','getHours','(use\x20--limit\x20to\x20see\x20more)','executeCloneProject','find','select','-\x20nothing\x20pushed','skipValidation','Reason:\x20','No\x20sessions\x20with\x20timing\x20information','deleted','includeRetried','key','Attempt\x20ID:\x20','5067tiCRLd','\x20project','Kill\x20a\x20running\x20attempt','workflow:schedule:enable','\x20session','workflow:pull','workflow:logs','size','showWorkflowConsoleUrl','Error:','Revision:\x20','\x27\x20from\x20project\x20\x27','tdx\x20wf\x20attempt\x20','⚠\x20Showing\x20first\x20','\x22?\x20This\x20cannot\x20be\x20undone.','getTime','toISOString','Secrets\x20to\x20set:\x20','82803LZiYEL','7131890shCdwj','\x20modified','Select\x20a\x20workflow\x20to\x20run','enableSchedule','Invalid\x20format:\x20','\x20unchanged','Disable\x20a\x20workflow\x20schedule','Project\x20name\x20is\x20required','Parameters:','projectId','workflow:projects','description','✔\x20Pull\x20complete','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','renderSingleTimeline','group_error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20-\x20','workflow:push','Listing\x20schedules...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','workflow:secrets:delete','param','Downloading\x20logs...','POLL_INTERVAL_MS','6510406Blxvaj','value','length','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20next:\x20','workflowName','/attempt/','workflowProject','localeCompare','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','format','fullName','\x20secrets\x20set\x20for\x20project\x20\x27','\x20\x20Revision:\x20','buildTimelineData','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','(unknown)','text','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','491689KNPHGI','Status:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Attempt:\x20','verbose','white','attempt','push','→\x20Project:\x20','lastAttempt','message','workflow:schedule:disable','stdout','success','No\x20workflow\x20projects\x20found','every','Workflow:\x20','workflow','resolveProjectDir','\x20of\x20','resolve','workflow:tasks','substring','Including\x20subtasks:\x20yes','✔\x20Deleted\x20project\x20','No\x20workflows\x20found\x20in\x20project:\x20','generateSessionTimelineRows','Source\x20directory\x20is\x20required','status','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','execute','rows','Failed\x20to\x20fetch\x20attempt\x20data','yes','workflow:secrets:list','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20\x20Console:\x20','MAX_TASKS_DISPLAY','Start\x20a\x20workflow\x20run','workflow:delete','✔\x20Workflow\x20project\x20set\x20to:\x20','params','title','logs','getFullYear','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','new','cyan','No\x20sessions\x20found\x20for:\x20','\x20\x20New\x20attempt\x20ID:\x20','toLocaleString','✔\x20Showing\x20','✔\x20Downloaded\x20','task','Enable\x20a\x20workflow\x20schedule','Resolving\x20project\x20\x27','hasChanges','clear','min','running','relative','parse','startTime','type','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','---\x20','startsWith','nextRunTime','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Error:\x20Invalid\x20JSON\x20in\x20--params','join','table','newProjectId','set','Deleting\x20project\x20','Listing\x20workflows...','state','limit','workflow:use','list','Listing\x20workflow\x20attempts...','stat','sessionId','✔\x20Retry\x20started','LABEL_MIN_SPACING','sort','name','replace','unknown','\x20workflow','kill','map','💡\x20Tip:\x20Use\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','TASK_NAME_WIDTH','executePushProject','Cancelled','\x20\x20Workflow:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','retryAttempt','getWorkflow','blue','follow','preparePushProject','No\x20workflows\x20found','renderTimeline','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','MAX_TIMELINE_WIDTH','📋\x20','workflow:sessions','window','\x20secrets...','parseProjectWorkflowPattern','json','\x20(use\x20--limit\x20to\x20show\x20more)','workflow:clone','fileSize','Fetching\x20log\x20files...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Setting\x20secret...','Parameters:\x20','resolveProject','sourceProjectName','session','max','changes','jsonl','listSchedules','Pushing\x20workflow\x20project...','basename','No\x20sessions\x20found\x20in\x20project:\x20',',\x20Workflow:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x20\x20Session\x20ID:\x20','modified','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','ICON_WIDTH','taskName','isTTY','workflow:attempt','resolveProjectId','6hDzWXF','-\x20no\x20files\x20written','readFile','Loading\x20sessions...','now','includeSubtasks','✔\x20Found\x20','session:','from','indexOf','\x0aError:','canceling','getMonth','workflow:secrets:set','config','workflow:timeline','output','Loading\x20workflows...','cancelRequested','workflow:run','reason','site','✔\x20Project:\x20','Deleting\x20secret...','total','\x20enabled\x20(','index','\x22\x20already\x20exists\x20(ID:\x20','Error:\x20Project\x20name\x20is\x20required','✔\x20Workflow\x20run\x20started','diff','🔄\x20','Writing\x20files...','planned','Getting\x20attempt\x20tasks...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','No\x20attempts\x20found\x20in\x20project:\x20','15542hNzcCq','→\x20New\x20project:\x20','start','No\x20workflow\x20tdx.json\x20found','No\x20projects\x20match\x20pattern:\x20','targetDir','\x20deleted','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','navigateSessionsInteractive','Schedule\x20ID\x20is\x20required','\x20task','split','fs/promises','cwd','Pulling\x20project\x20','keys','dryRun','finishedAt','GUTTER','workflows','log','\x20from\x20session\x20','tasks','summary','Pushing\x20project...','Getting\x20attempt\x20details...','columns','No\x20workflow\x20sessions\x20found','\x0aApply\x20these\x20changes?','targetExists','pollTimeline','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x20\x20Next\x20run:\x20','Retrying\x20attempt...','icon','Disabling\x20schedule\x20#','unchanged','Setting\x20','end','all','createdAt','Show\x20tasks\x20for\x20an\x20attempt','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Resume\x20from:\x20','isArray','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x0aUpdate\x20existing\x20project\x20\x22','disabledAt','Project\x20filter:\x20','Session\x20time:\x20','sourceDir','21050EaFRXB','\x0aDry\x20run\x20-\x20no\x20project\x20created','No\x20sessions\x20found','Tip:\x20cd\x20to\x20workflows/','red','getMinutes','540gvKsyv','Loading\x20session...','includes','pending','\x20\x20tdx\x20wf\x20use\x20<project>','green','workflow:download','stringify','setSecrets','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Task\x20graph:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','project','Auto-selected\x20latest\x20session:\x20','\x0aPush\x20these\x20changes?','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','duration','Usage:\x20workflow:delete\x20<project-name-or-id>','has','padStart','repeat','done','\x0a✔\x20Attempt\x20complete','\x20\x20Target:\x20','From\x20task:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20Attempt\x20ID:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','yellow','\x1b[1A\x1b[2K','MIN_LABEL_COUNT','✔\x20Schedule\x20#','Project:\x20','Cloning\x20to\x20','New\x20project\x20name:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Filter:\x20project=','30SGugCZ','deleteSecret','Usage:\x20tdx\x20wf\x20use\x20<project>','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','slice','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','...','renderSessionsTimeline','error','Analyzing\x20project...','getDate','Updating\x20','splice','sessionTime','\x20sessions\x20','write','toLowerCase','newProjectName','\x0a⚠\x20Project\x20\x22','148QHSucg','tdx.json','\x20logs','MAX_LABEL_COUNT','fromTask','\x20(disabled)','Output\x20directory:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','msPerChar','projectName','\x20\x20Changes:\x20','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Project\x20name:\x20','✔\x20Secret\x20\x27','\x20tasks','fill','requireProject','Listing\x20workflow\x20sessions...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Filter:\x20','attempts','Include\x20retried:\x20yes','dim','Starting\x20workflow\x20run...','delete','revision','Error:\x20Secret\x20key\x20is\x20required','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Dry\x20run:\x20yes','filter','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20secret','workflow:workflows','No\x20matching\x20sessions\x20found','Target\x20directory:\x20','durationMs','\x20new','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20\x20Source:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Source\x20directory:\x20','isDirectory','Enabling\x20schedule\x20#','projects','Source\x20project:\x20','bold','\x0aDry\x20run\x20-\x20no\x20files\x20written','executeDryRun','isNewProject','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Analyzing\x20changes...','disableSchedule','fileCount','run','Killing\x20attempt...','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','logFiles','\x20\x20Project\x20ID:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','✔\x20Pushed\x20','metadata','📁\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','floor','ICON_SPACING','workflow:upload','sessions','List\x20workflows','\x0aClone\x20\x22'];a54_0x550a=function(){return _0xe2274b;};return a54_0x550a();}function getBarColor(_0x5635ba){const _0x309303=a54_0x3dd44c,_0xf94c97={'success':a54_0x33d044[_0x309303(0xfd)],'error':a54_0x33d044['red'],'group_error':a54_0x33d044[_0x309303(0xf6)],'running':a54_0x33d044[_0x309303(0x246)],'blocked':a54_0x33d044[_0x309303(0x114)],'planned':a54_0x33d044[_0x309303(0x146)],'canceling':a54_0x33d044[_0x309303(0x114)]};return _0xf94c97[_0x5635ba]||a54_0x33d044[_0x309303(0x1e6)];}function parseTaskName(_0x57291c){const _0x3c148f=a54_0x3dd44c;let _0x3bf837=_0x57291c[_0x3c148f(0x238)](/^\++/,'');const _0x272fc2=_0x3bf837[_0x3c148f(0x29e)]('+'),_0x4a0df6=_0x272fc2[_0x3c148f(0x1d0)]>0x1?_0x272fc2['length']-0x2:0x0,_0x51c9d0=_0x272fc2[_0x272fc2[_0x3c148f(0x1d0)]-0x1]||_0x3bf837;return{'level':_0x4a0df6,'name':'+'+_0x51c9d0};}function truncateTaskName(_0x2b8dd5,_0x2c7332){const _0x30ccf8=a54_0x3dd44c,_0x30d392=stringWidth(_0x2b8dd5);if(_0x30d392<=_0x2c7332)return _0x2b8dd5;let _0x4b8d1c=_0x2b8dd5;while(stringWidth(_0x4b8d1c+'…')>_0x2c7332&&_0x4b8d1c[_0x30ccf8(0x1d0)]>0x0){_0x4b8d1c=_0x4b8d1c['slice'](0x0,-0x1);}return _0x4b8d1c+'…';}function calculateTimeScale(_0x5b25fd,_0x53eeef){const _0x5515cd=a54_0x3dd44c;return{'startTime':_0x5b25fd[_0x5515cd(0x295)],'endTime':_0x5b25fd[_0x5515cd(0xe5)],'durationMs':_0x5b25fd[_0x5515cd(0x108)],'msPerChar':_0x5b25fd[_0x5515cd(0x108)]/_0x53eeef};}function timeToPosition(_0x239f3b,_0x287538,_0x4dadef){const _0x2d8671=a54_0x3dd44c,_0x7d9418=_0x239f3b-_0x287538['startTime'],_0x1cf08e=Math['floor'](_0x7d9418/_0x287538[_0x2d8671(0x138)]);return Math[_0x2d8671(0x25d)](0x0,Math['min'](_0x1cf08e,_0x4dadef));}function renderTimeAxis(_0x8a1076,_0x2c22cb){const _0xb75c23=a54_0x3dd44c,_0x508a81=Math[_0xb75c23(0x21b)](TIMELINE_CONFIG[_0xb75c23(0x133)],Math[_0xb75c23(0x25d)](TIMELINE_CONFIG[_0xb75c23(0x116)],Math['floor'](_0x2c22cb/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x33f974=_0x8a1076[_0xb75c23(0x153)]/(_0x508a81-0x1),_0x16bb30=new Date(_0x8a1076['startTime']),_0x2ba943=[];for(let _0xa24e29=0x0;_0xa24e29<_0x508a81;_0xa24e29++){const _0x44b165=_0x8a1076['startTime']+_0xa24e29*_0x33f974,_0x2ffced=timeToPosition(_0x44b165,_0x8a1076,_0x2c22cb),_0x37af60=formatTimestamp(_0x44b165,_0x16bb30);_0x2ba943[_0xb75c23(0x1e8)]({'pos':_0x2ffced,'text':_0x37af60});}const _0x3c7a3=new Array(_0x2c22cb)[_0xb75c23(0x13f)]('\x20');let _0x3350ee=-0x1;for(const {pos:_0x36719a,text:_0x1fccb1}of _0x2ba943){let _0x388696=Math[_0xb75c23(0x25d)](0x0,_0x36719a-Math[_0xb75c23(0x16f)](_0x1fccb1[_0xb75c23(0x1d0)]/0x2));_0x388696<=_0x3350ee+TIMELINE_CONFIG[_0xb75c23(0x235)]&&(_0x388696=_0x3350ee+TIMELINE_CONFIG[_0xb75c23(0x235)]+0x1);_0x388696+_0x1fccb1['length']>_0x2c22cb&&(_0x388696=_0x2c22cb-_0x1fccb1[_0xb75c23(0x1d0)]);if(_0x388696>=0x0&&_0x388696+_0x1fccb1[_0xb75c23(0x1d0)]<=_0x2c22cb&&_0x388696>_0x3350ee){for(let _0x493268=0x0;_0x493268<_0x1fccb1[_0xb75c23(0x1d0)];_0x493268++){_0x3c7a3[_0x388696+_0x493268]=_0x1fccb1[_0x493268];}_0x3350ee=_0x388696+_0x1fccb1[_0xb75c23(0x1d0)]-0x1;}}return _0x3c7a3[_0xb75c23(0x227)]('');}function renderTaskRow(_0xdc0584,_0x352dfe,_0x4a585d,_0x2a95d5){const _0x480a00=a54_0x3dd44c,{level:_0x59ad97,name:_0x58ab4e}=parseTaskName(_0xdc0584[_0x480a00(0x237)]),_0x4b5176='\x20'[_0x480a00(0x10c)](_0x59ad97),_0x2fd464=_0xdc0584[_0x480a00(0x24f)]?'('+formatElapsed(_0xdc0584[_0x480a00(0x24f)][_0x480a00(0x108)])+')':'',_0x2f3fd1=stringWidth(_0x2fd464),_0x202b8a=_0x59ad97*0x1,_0x5b76fc=_0x2a95d5-_0x202b8a-_0x2f3fd1-0x1,_0x1b9fc7=truncateTaskName(_0x58ab4e,_0x5b76fc),_0x44d14d=_0x4b5176+_0x1b9fc7,_0xa9e52=stringWidth(_0x44d14d),_0x27c072=_0x2a95d5-_0xa9e52-_0x2f3fd1,_0x2a4817=_0x44d14d+'\x20'[_0x480a00(0x10c)](Math[_0x480a00(0x25d)](0x1,_0x27c072))+a54_0x33d044[_0x480a00(0x146)](_0x2fd464),_0x1e706f=getTaskStateIcon(_0xdc0584[_0x480a00(0x22d)]),_0x5f03ce=new Array(_0x4a585d)[_0x480a00(0x13f)]('\x20');if(_0xdc0584[_0x480a00(0x24f)]){const _0x1c7e1d=timeToPosition(_0xdc0584['window'][_0x480a00(0x295)],_0x352dfe,_0x4a585d),_0x45f18e=timeToPosition(_0xdc0584['window']['end'],_0x352dfe,_0x4a585d),_0x1c8f83=getBarChar(_0xdc0584[_0x480a00(0x22d)]),_0x29c572=Math[_0x480a00(0x25d)](_0x1c7e1d+0x1,_0x45f18e);for(let _0x2a6668=_0x1c7e1d;_0x2a6668<Math[_0x480a00(0x21b)](_0x29c572,_0x4a585d);_0x2a6668++){_0x5f03ce[_0x2a6668]=_0x1c8f83;}}const _0x28e2cc=getBarColor(_0xdc0584[_0x480a00(0x22d)]),_0x1c9c87=_0x5f03ce[_0x480a00(0x23c)](_0xb75e5e=>_0xb75e5e==='\x20'?'\x20':_0x28e2cc(_0xb75e5e))['join']('');return _0x1e706f+'\x20'+_0x2a4817+'│'+_0x1c9c87+'│';}function calculateStats(_0x11aa85){const _0x49643d=a54_0x3dd44c,_0x297274={'total':_0x11aa85['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3d08f6 of _0x11aa85){if(_0x3d08f6[_0x49643d(0x22d)]===_0x49643d(0x1ee))_0x297274['success']++;else{if(_0x3d08f6[_0x49643d(0x22d)]===_0x49643d(0x125)||_0x3d08f6['state']==='group_error')_0x297274['error']++;else _0x3d08f6[_0x49643d(0x22d)]===_0x49643d(0x21c)?_0x297274[_0x49643d(0x21c)]++:_0x297274[_0x49643d(0xfb)]++;}}return _0x297274;}function formatStats(_0x20989d){const _0x17ce4b=a54_0x3dd44c;return['Total:\x20'+_0x20989d[_0x17ce4b(0x286)],'✅\x20'+_0x20989d[_0x17ce4b(0x1ee)],'❌\x20'+_0x20989d['error'],_0x17ce4b(0x28d)+_0x20989d[_0x17ce4b(0x21c)],'⏳\x20'+_0x20989d['pending']][_0x17ce4b(0x227)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x27d);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x167);async[a54_0x3dd44c(0x1ff)](_0xc69402){const _0x1ed663=a54_0x3dd44c,{options:_0x2f39fb,args:_0x5db93e,tdx:_0x284823}=_0xc69402;let _0x3256e6,_0x1c5aab,_0x362c7c=![];if(_0x5db93e[0x0]){if(_0x5db93e[0x0]['includes']('.')){const _0x500dee=this[_0x1ed663(0x251)](_0x5db93e,_0x2f39fb);if(!_0x500dee)return 0x1;_0x3256e6=_0x500dee[_0x1ed663(0x139)],_0x1c5aab=_0x500dee[_0x1ed663(0x1d3)];}else{_0x1c5aab=_0x5db93e[0x0],_0x3256e6=_0x2f39fb['workflowProject'];if(!_0x3256e6)return console[_0x1ed663(0x125)](a54_0x33d044['red'](_0x1ed663(0x1ab)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x362c7c=!![];}}else{const _0x59e1a2=this[_0x1ed663(0x251)](_0x5db93e,_0x2f39fb);if(!_0x59e1a2)return 0x1;_0x3256e6=_0x59e1a2[_0x1ed663(0x139)],_0x1c5aab=_0x59e1a2['workflowName'];}if(_0x2f39fb[_0x1ed663(0x1e5)]){if(_0x3256e6&&_0x1c5aab)console['error'](_0x1ed663(0x143)+_0x3256e6+'.'+_0x1c5aab);else _0x3256e6&&console[_0x1ed663(0x125)](_0x1ed663(0x11c)+_0x3256e6);}const _0x155cba=_0x2f39fb[_0x1ed663(0x18a)],_0x567a88=_0x2f39fb[_0x1ed663(0x233)];if(_0x155cba){_0x567a88&&console[_0x1ed663(0x125)](a54_0x33d044[_0x1ed663(0x114)]('Warning:'),_0x1ed663(0x225));const _0x337a31=_0x2f39fb['follow'];return _0x337a31?await this[_0x1ed663(0xdd)](_0xc69402,_0x155cba):await this[_0x1ed663(0x1c3)](_0xc69402,_0x155cba,_0x2f39fb),0x0;}if(_0x567a88){const _0x58fcb7=await withSpinner(_0x1ed663(0xf9),()=>_0x284823[_0x1ed663(0x1f2)][_0x1ed663(0x172)]({'projectName':_0x3256e6,'workflowName':_0x1c5aab,'limit':0x64}),{'verbose':_0x2f39fb['verbose']}),_0x4f9e01=_0x58fcb7[_0x1ed663(0x193)][_0x1ed663(0x198)](_0x3c8378=>_0x3c8378['id']===_0x567a88);if(!_0x4f9e01)return console[_0x1ed663(0x125)](a54_0x33d044[_0x1ed663(0xf6)](_0x1ed663(0x1ab)),'Session\x20not\x20found:\x20'+_0x567a88),0x1;if(!_0x4f9e01['lastAttempt']?.['id'])return console[_0x1ed663(0x125)](a54_0x33d044[_0x1ed663(0xf6)](_0x1ed663(0x1ab)),'Session\x20'+_0x567a88+'\x20has\x20no\x20attempts'),0x1;const _0x42869d=_0x4f9e01[_0x1ed663(0x1ea)]['id'];_0x2f39fb['verbose']&&console['error']('Using\x20attempt\x20'+_0x42869d+_0x1ed663(0x2a8)+_0x567a88);const _0x40240f=_0x2f39fb[_0x1ed663(0x247)];return _0x40240f?await this[_0x1ed663(0xdd)](_0xc69402,_0x42869d):await this[_0x1ed663(0x1c3)](_0xc69402,_0x42869d,_0x2f39fb),0x0;}const _0xdf6a94=await withSpinner(_0x1ed663(0x271),()=>_0x284823[_0x1ed663(0x1f2)][_0x1ed663(0x172)]({'projectName':_0x3256e6,'workflowName':_0x1c5aab,'limit':_0x2f39fb['limit']||0x32}),{'verbose':_0x2f39fb[_0x1ed663(0x1e5)]}),_0x20257e=_0xdf6a94['data'];if(_0x20257e[_0x1ed663(0x1d0)]===0x0){if(_0x3256e6&&_0x1c5aab)console[_0x1ed663(0x125)](_0x1ed663(0x211)+_0x3256e6+'.'+_0x1c5aab);else _0x3256e6?console['error'](_0x1ed663(0x263)+_0x3256e6):(console[_0x1ed663(0x125)](_0x1ed663(0x2ae)),console[_0x1ed663(0x125)](a54_0x33d044[_0x1ed663(0x146)](_0x1ed663(0x1fe))));return 0x0;}_0x20257e['sort']((_0x28ed35,_0x4de2ff)=>{const _0xd66789=_0x1ed663,_0x172dc3=_0x28ed35[_0xd66789(0x12a)]||'',_0x46b1ba=_0x4de2ff[_0xd66789(0x12a)]||'';return _0x46b1ba[_0xd66789(0x1d6)](_0x172dc3);});if(_0x2f39fb[_0x1ed663(0x252)]||_0x2f39fb[_0x1ed663(0x25f)])return await handleSDKOutput(_0x20257e,_0x2f39fb),0x0;let _0x376300;if(_0x362c7c){const _0x5a5bbd=_0x20257e[0x0];if(!_0x5a5bbd[_0x1ed663(0x1ea)]?.['id'])return console[_0x1ed663(0x125)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x376300=_0x5a5bbd[_0x1ed663(0x1ea)]['id'],_0x2f39fb['verbose']&&console[_0x1ed663(0x125)](_0x1ed663(0x105)+_0x5a5bbd[_0x1ed663(0x12a)]);}else{const _0x1a92b7=_0x20257e['map'](_0x5b33fb=>{const _0x27ed4f=_0x1ed663,_0xfd0c94=getAttemptStatusDisplay(_0x5b33fb[_0x27ed4f(0x1ea)]);return{'title':_0x5b33fb[_0x27ed4f(0x104)]?.[_0x27ed4f(0x237)]+'.'+_0x5b33fb[_0x27ed4f(0x1f2)]?.['name']+_0x27ed4f(0x1c6)+_0x5b33fb['sessionTime']+'\x20'+_0xfd0c94[_0x27ed4f(0xe1)],'value':_0x5b33fb[_0x27ed4f(0x1ea)]?.['id']||'','description':_0xfd0c94[_0x27ed4f(0x1df)]};}),_0x275a6d=await a54_0x2596be({'type':_0x1ed663(0x199),'name':_0x1ed663(0x18a),'message':_0x1ed663(0x23e),'choices':_0x1a92b7[_0x1ed663(0x14d)](_0x5122e1=>_0x5122e1[_0x1ed663(0x1cf)]!=='')});if(!_0x275a6d['attemptId'])return 0x0;_0x376300=_0x275a6d[_0x1ed663(0x18a)];}const _0x5c1afc=_0x2f39fb[_0x1ed663(0x247)];return _0x5c1afc?await this[_0x1ed663(0xdd)](_0xc69402,_0x376300):await this[_0x1ed663(0x1c3)](_0xc69402,_0x376300,_0x2f39fb),0x0;}async[a54_0x3dd44c(0x1c3)](_0x230fbd,_0x5e72cf,_0x3ae11f){const _0x4798de=a54_0x3dd44c,{tdx:_0x3d1d9b}=_0x230fbd;let _0x5b7df6,_0x192b37;try{[_0x5b7df6,_0x192b37]=await Promise[_0x4798de(0xe6)]([_0x3d1d9b['workflow'][_0x4798de(0x1e7)](_0x5e72cf),_0x3d1d9b[_0x4798de(0x1f2)][_0x4798de(0x2a9)](_0x5e72cf,![])]);}catch(_0x5e5b8c){console[_0x4798de(0x125)](a54_0x33d044['red'](_0x4798de(0x201)));_0x3ae11f[_0x4798de(0x1e5)]&&console[_0x4798de(0x125)](_0x5e5b8c);throw _0x5e5b8c;}if(_0x3ae11f['json']||_0x3ae11f[_0x4798de(0x25f)]){const _0x864b09=this[_0x4798de(0x1dc)](_0x5b7df6,_0x192b37);await handleSDKOutput([_0x864b09],_0x3ae11f);return;}const _0x6a8d42=_0x3d1d9b['context'][_0x4798de(0x283)],_0x5d5b3d=this[_0x4798de(0x24a)](_0x5b7df6,_0x192b37,_0x6a8d42);console[_0x4798de(0x2a7)](_0x5d5b3d);}async[a54_0x3dd44c(0xdd)](_0x16461a,_0x230974){const _0xba310c=a54_0x3dd44c,{tdx:_0x1e2937}=_0x16461a,_0x1654a7=TIMELINE_CONFIG[_0xba310c(0x1cd)],_0x510ec5=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x5c587e=0x0;while(_0x5c587e<_0x510ec5){process[_0xba310c(0x1ed)][_0xba310c(0x26b)]&&process['stdout'][_0xba310c(0x12c)]('\x1bc');let _0x634f62,_0x142af2;try{[_0x634f62,_0x142af2]=await Promise[_0xba310c(0xe6)]([_0x1e2937[_0xba310c(0x1f2)][_0xba310c(0x1e7)](_0x230974),_0x1e2937[_0xba310c(0x1f2)][_0xba310c(0x2a9)](_0x230974,![])]);}catch(_0x588db9){console[_0xba310c(0x125)](a54_0x33d044['red'](_0xba310c(0x243)));_0x5c587e>0x0&&console['error'](a54_0x33d044['dim']('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x5c587e));throw _0x588db9;}const _0x56b15c=_0x1e2937['context'][_0xba310c(0x283)],_0x3135db=this['renderTimeline'](_0x634f62,_0x142af2,_0x56b15c);console[_0xba310c(0x2a7)](_0x3135db);const _0x4ac15f=_0x634f62[_0xba310c(0x10d)]&&_0x142af2[_0xba310c(0x1f0)](_0x4f9072=>_0x4f9072[_0xba310c(0x22d)]!==_0xba310c(0x21c)&&_0x4f9072[_0xba310c(0x22d)]!=='planned');if(_0x4ac15f){console['error'](a54_0x33d044[_0xba310c(0xfd)](_0xba310c(0x10e)));break;}console[_0xba310c(0x125)](a54_0x33d044[_0xba310c(0x146)]('\x0aPolling...\x20('+_0x5c587e*0x2+_0xba310c(0x122))),await new Promise(_0x157921=>setTimeout(_0x157921,_0x1654a7)),_0x5c587e++;}_0x5c587e>=_0x510ec5&&console[_0xba310c(0x125)](a54_0x33d044['yellow'](_0xba310c(0x1e0)));}[a54_0x3dd44c(0x24a)](_0x440a9b,_0xed2abc,_0x57c10d){const _0x430f1e=a54_0x3dd44c,_0x80f925=[],_0x253465=TIMELINE_CONFIG[_0x430f1e(0x23f)],_0x495c54=0x5,_0x30a933=process['stdout']['columns']||0x78,_0x4a4f65=_0x30a933-_0x253465-_0x495c54,_0x390da7=Math[_0x430f1e(0x25d)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x430f1e(0x21b)](_0x4a4f65,TIMELINE_CONFIG[_0x430f1e(0x24c)])),_0x4331a9=new Date(_0x440a9b[_0x430f1e(0xe7)])[_0x430f1e(0x1b1)](),_0x15144a=_0x440a9b[_0x430f1e(0x2a4)]?new Date(_0x440a9b[_0x430f1e(0x2a4)])['getTime']():Date[_0x430f1e(0x272)](),_0x1b4a47={'start':_0x4331a9,'end':_0x15144a,'duration':_0x15144a-_0x4331a9},_0x415621=new Map(),_0x54bc2b=[];for(const _0x3587bb of _0xed2abc){if(_0x3587bb['startedAt']){const _0x2676b3=new Date(_0x3587bb['startedAt'])[_0x430f1e(0x1b1)](),_0x5ad2b3=_0x3587bb[_0x430f1e(0x194)]?new Date(_0x3587bb[_0x430f1e(0x194)])[_0x430f1e(0x1b1)]():Date['now'](),_0x3c5b3b={'start':_0x2676b3,'end':_0x5ad2b3,'duration':_0x5ad2b3-_0x2676b3};_0x415621[_0x430f1e(0x22a)](_0x3587bb['id'],_0x3c5b3b),_0x54bc2b['push']({'name':_0x3587bb[_0x430f1e(0x1d9)],'state':_0x3587bb[_0x430f1e(0x22d)]||_0x430f1e(0x239),'window':_0x3c5b3b});}else _0x54bc2b[_0x430f1e(0x1e8)]({'name':_0x3587bb['fullName'],'state':_0x3587bb[_0x430f1e(0x22d)]||_0x430f1e(0x28f),'window':undefined});}_0x54bc2b['sort']((_0x530603,_0x5353f6)=>{const _0x5dbefe=_0x430f1e;if(!_0x530603['window'])return 0x1;if(!_0x5353f6[_0x5dbefe(0x24f)])return-0x1;return _0x530603['window']['start']-_0x5353f6['window'][_0x5dbefe(0x295)];});const _0x3d6136=_0x54bc2b[_0x430f1e(0x1d0)],_0x138256=_0x3d6136>TIMELINE_CONFIG[_0x430f1e(0x206)];_0x138256&&_0x54bc2b[_0x430f1e(0x129)](TIMELINE_CONFIG[_0x430f1e(0x206)]);const _0x134bee=calculateTimeScale(_0x1b4a47,_0x390da7),_0x1f83d1=_0x440a9b[_0x430f1e(0x10d)]?_0x440a9b['success']?a54_0x33d044[_0x430f1e(0xfd)]('success'):a54_0x33d044[_0x430f1e(0xf6)](_0x430f1e(0x125)):a54_0x33d044['blue'](_0x430f1e(0x21c)),_0x3ce734=_0x440a9b['project']?.['id'],_0x1cd19b=_0x440a9b[_0x430f1e(0x233)];let _0x3430a9;if(_0x3ce734&&_0x1cd19b){const _0x5f4d6f=getWorkflowAttemptUrl(_0x57c10d,_0x3ce734,_0x1cd19b,_0x440a9b['id']);_0x3430a9=hyperlink(a54_0x33d044[_0x430f1e(0x146)](_0x440a9b['id']),_0x5f4d6f);}else _0x3430a9=a54_0x33d044[_0x430f1e(0x146)](_0x440a9b['id']);_0x80f925[_0x430f1e(0x1e8)](_0x430f1e(0x1e4)+_0x3430a9+_0x430f1e(0x1c6)+_0x1f83d1+_0x430f1e(0x1c6)+formatElapsed(_0x1b4a47[_0x430f1e(0x108)]));if(_0x54bc2b[_0x430f1e(0x1d0)]>0x0){const _0x5db6f3=renderTimeAxis(_0x134bee,_0x390da7),_0x140e42=new Date(_0x1b4a47[_0x430f1e(0x295)]),_0x5ca79a=formatDate(_0x140e42),_0x5a140c=TIMELINE_CONFIG[_0x430f1e(0x269)]+TIMELINE_CONFIG[_0x430f1e(0x170)]+_0x253465,_0x47b2ac=_0x5ca79a[_0x430f1e(0x10b)](_0x5a140c),_0x30cb98=a54_0x33d044['dim'](_0x47b2ac);_0x80f925['push'](_0x30cb98+'\x20'+_0x5db6f3);for(const _0x5df183 of _0x54bc2b){_0x80f925[_0x430f1e(0x1e8)](renderTaskRow(_0x5df183,_0x134bee,_0x390da7,_0x253465));}const _0x20d845=calculateStats(_0x54bc2b);_0x80f925[_0x430f1e(0x1e8)](formatStats(_0x20d845)),_0x138256&&_0x80f925[_0x430f1e(0x1e8)](a54_0x33d044[_0x430f1e(0x114)](_0x430f1e(0x1af)+TIMELINE_CONFIG[_0x430f1e(0x206)]+_0x430f1e(0x1f4)+_0x3d6136+_0x430f1e(0x13e))),_0x80f925['push'](''),_0x80f925[_0x430f1e(0x1e8)](a54_0x33d044[_0x430f1e(0x146)](_0x430f1e(0x23d))+(_0x430f1e(0x1ae)+_0x440a9b['id']+_0x430f1e(0x132))+a54_0x33d044[_0x430f1e(0x146)]('\x20to\x20see\x20detailed\x20logs'));}else _0x80f925[_0x430f1e(0x1e8)](_0x430f1e(0x16a));return _0x80f925['join']('\x0a');}[a54_0x3dd44c(0x1dc)](_0x20c3c4,_0x4ca381){const _0x216c8a=a54_0x3dd44c,_0x1c7c23=new Date(_0x20c3c4[_0x216c8a(0xe7)])[_0x216c8a(0x1b1)](),_0x267dc=_0x20c3c4[_0x216c8a(0x2a4)]?new Date(_0x20c3c4[_0x216c8a(0x2a4)])[_0x216c8a(0x1b1)]():Date[_0x216c8a(0x272)](),_0x1b1b9e=_0x267dc-_0x1c7c23,_0x3b2221=[];for(const _0x7bc1ac of _0x4ca381){if(_0x7bc1ac[_0x216c8a(0x189)]){const _0x4bc646=new Date(_0x7bc1ac['startedAt'])[_0x216c8a(0x1b1)](),_0xacece7=_0x7bc1ac[_0x216c8a(0x194)]?new Date(_0x7bc1ac[_0x216c8a(0x194)])[_0x216c8a(0x1b1)]():Date[_0x216c8a(0x272)]();_0x3b2221[_0x216c8a(0x1e8)]({'name':_0x7bc1ac[_0x216c8a(0x1d9)],'state':_0x7bc1ac['state']||_0x216c8a(0x239),'window':{'start':_0x4bc646,'end':_0xacece7,'duration':_0xacece7-_0x4bc646}});}else _0x3b2221[_0x216c8a(0x1e8)]({'name':_0x7bc1ac[_0x216c8a(0x1d9)],'state':_0x7bc1ac[_0x216c8a(0x22d)]||'planned','window':undefined});}const _0x49dae4=calculateStats(_0x3b2221);return{'attempt':{'id':_0x20c3c4['id'],'status':_0x20c3c4[_0x216c8a(0x10d)]?_0x20c3c4['success']?_0x216c8a(0x1ee):_0x216c8a(0x125):_0x216c8a(0x21c),'createdAt':_0x20c3c4[_0x216c8a(0xe7)],'finishedAt':_0x20c3c4['finishedAt'],'duration_ms':_0x1b1b9e},'tasks':_0x3b2221['map'](_0x55f22e=>({'name':_0x55f22e[_0x216c8a(0x237)],'state':_0x55f22e[_0x216c8a(0x22d)],'startedAt':_0x55f22e[_0x216c8a(0x24f)]?new Date(_0x55f22e['window'][_0x216c8a(0x295)])[_0x216c8a(0x1b2)]():null,'updatedAt':_0x55f22e[_0x216c8a(0x24f)]?new Date(_0x55f22e[_0x216c8a(0x24f)][_0x216c8a(0xe5)])[_0x216c8a(0x1b2)]():null,'duration_ms':_0x55f22e[_0x216c8a(0x24f)]?.[_0x216c8a(0x108)]||null})),'stats':_0x49dae4};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x3dd44c(0x237)]='workflow:schedules';[a54_0x3dd44c(0x1c0)]='List\x20workflow\x20schedules';async['execute'](_0x5ac704){const _0x63c1ec=a54_0x3dd44c,{options:_0x41111b,tdx:_0x3bea65}=_0x5ac704,_0xc23ab7=await withSpinner(_0x63c1ec(0x1c8),()=>_0x3bea65['workflow'][_0x63c1ec(0x260)](),{'verbose':_0x41111b[_0x63c1ec(0x1e5)]}),_0x2807fe=_0xc23ab7[_0x63c1ec(0x193)];console[_0x63c1ec(0x125)](_0x63c1ec(0x274)+_0x2807fe[_0x63c1ec(0x1d0)]+'\x20schedule'+(_0x2807fe[_0x63c1ec(0x1d0)]!==0x1?'s':''));if(isStructuredFormat(_0x41111b))await handleSDKOutput(_0x2807fe,_0x41111b);else{if(_0x2807fe[_0x63c1ec(0x1d0)]===0x0)console[_0x63c1ec(0x2a7)]('No\x20schedules\x20found');else for(const _0x5381f9 of _0x2807fe){const _0x324e4a=_0x5381f9[_0x63c1ec(0xee)]?a54_0x33d044[_0x63c1ec(0x114)](_0x63c1ec(0x135)):'',_0x3148f9=_0x5381f9[_0x63c1ec(0x104)]?.[_0x63c1ec(0x237)]?a54_0x33d044[_0x63c1ec(0x146)]('\x20['+_0x5381f9[_0x63c1ec(0x104)][_0x63c1ec(0x237)]+']'):'',_0x1959d9=_0x5381f9[_0x63c1ec(0x224)]?a54_0x33d044[_0x63c1ec(0x146)](_0x63c1ec(0x1d2)+new Date(_0x5381f9[_0x63c1ec(0x224)])['toLocaleString']()):'';console[_0x63c1ec(0x2a7)]('📅\x20#'+_0x5381f9['id']+'\x20'+(_0x5381f9[_0x63c1ec(0x1f2)]?.['name']||_0x63c1ec(0x1de))+_0x3148f9+_0x324e4a+_0x1959d9);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']=a54_0x3dd44c(0x1a5);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x217);async[a54_0x3dd44c(0x1ff)](_0x51610c){const _0x1ba160=a54_0x3dd44c,{options:_0x1c14d5,args:_0x4f1de6,tdx:_0x58d663}=_0x51610c,_0x1526b8=_0x4f1de6[0x0];if(!_0x1526b8)return console['error'](a54_0x33d044[_0x1ba160(0xf6)](_0x1ba160(0x1ab)),_0x1ba160(0x29c)),console[_0x1ba160(0x125)](a54_0x33d044[_0x1ba160(0x146)](_0x1ba160(0x107))),console[_0x1ba160(0x125)](a54_0x33d044[_0x1ba160(0x146)](_0x1ba160(0x14b))),0x1;const _0x5ea00d=await withSpinner(_0x1ba160(0x15a)+_0x1526b8+_0x1ba160(0x123),()=>_0x58d663['workflow'][_0x1ba160(0x1b8)](_0x1526b8),{'verbose':_0x1c14d5['verbose']}),_0x568aec=_0x5ea00d[_0x1ba160(0x193)];return isStructuredFormat(_0x1c14d5)?await handleSingleObjectOutput(_0x568aec,_0x1c14d5):(console['log'](_0x1ba160(0x117)+_0x1526b8+_0x1ba160(0x287)+(_0x568aec['workflow']?.[_0x1ba160(0x237)]||_0x1ba160(0x239))+')'),_0x568aec[_0x1ba160(0x224)]&&console[_0x1ba160(0x2a7)](a54_0x33d044[_0x1ba160(0x146)](_0x1ba160(0xdf)+new Date(_0x568aec[_0x1ba160(0x224)])[_0x1ba160(0x213)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x3dd44c(0x237)]=a54_0x3dd44c(0x1ec);[a54_0x3dd44c(0x1c0)]=a54_0x3dd44c(0x1bb);async[a54_0x3dd44c(0x1ff)](_0x14a056){const _0x132c77=a54_0x3dd44c,{options:_0x2304de,args:_0x24d2f0,tdx:_0x47365a}=_0x14a056,_0x85f39b=_0x24d2f0[0x0];if(!_0x85f39b)return console[_0x132c77(0x125)](a54_0x33d044[_0x132c77(0xf6)](_0x132c77(0x1ab)),_0x132c77(0x29c)),console[_0x132c77(0x125)](a54_0x33d044[_0x132c77(0x146)](_0x132c77(0x13b))),console[_0x132c77(0x125)](a54_0x33d044[_0x132c77(0x146)](_0x132c77(0x14b))),0x1;const _0x574cf8=await withSpinner(_0x132c77(0xe2)+_0x85f39b+_0x132c77(0x123),()=>_0x47365a[_0x132c77(0x1f2)][_0x132c77(0x163)](_0x85f39b),{'verbose':_0x2304de[_0x132c77(0x1e5)]}),_0x74e0c3=_0x574cf8['data'];return isStructuredFormat(_0x2304de)?await handleSingleObjectOutput(_0x74e0c3,_0x2304de):console[_0x132c77(0x2a7)](_0x132c77(0x117)+_0x85f39b+'\x20disabled\x20('+(_0x74e0c3[_0x132c77(0x1f2)]?.[_0x132c77(0x237)]||_0x132c77(0x239))+')'),0x0;}}
|
|
1
|
+
const a54_0x176df0=a54_0xbbfc;(function(_0x372d5b,_0x2df6af){const _0x2b3264=a54_0xbbfc,_0x436fa9=_0x372d5b();while(!![]){try{const _0x1f60b1=parseInt(_0x2b3264(0x276))/0x1*(-parseInt(_0x2b3264(0x1d5))/0x2)+parseInt(_0x2b3264(0x19f))/0x3+-parseInt(_0x2b3264(0x307))/0x4*(-parseInt(_0x2b3264(0x293))/0x5)+parseInt(_0x2b3264(0x2f9))/0x6*(-parseInt(_0x2b3264(0x2f1))/0x7)+parseInt(_0x2b3264(0x267))/0x8*(-parseInt(_0x2b3264(0x230))/0x9)+-parseInt(_0x2b3264(0x1d7))/0xa*(parseInt(_0x2b3264(0x264))/0xb)+-parseInt(_0x2b3264(0x288))/0xc*(-parseInt(_0x2b3264(0x32c))/0xd);if(_0x1f60b1===_0x2df6af)break;else _0x436fa9['push'](_0x436fa9['shift']());}catch(_0x259b4d){_0x436fa9['push'](_0x436fa9['shift']());}}}(a54_0x1983,0xda2d7));import a54_0x1d136b from'chalk';import{existsSync}from'fs';import a54_0x31ab49 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{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a54_0x3a0313 from'prompts';function getAttemptStatusDisplay(_0xde150f){const _0x4a25a5=a54_0xbbfc;if(!_0xde150f)return{'icon':'⏳','text':''};const {done:_0x864192,success:_0x5b4ffa,cancelRequested:_0x4792c1}=_0xde150f;if(!_0x864192)return _0x4792c1?{'icon':'🛑','text':a54_0x1d136b[_0x4a25a5(0x2ef)](_0x4a25a5(0x2ba))}:{'icon':'🔄','text':a54_0x1d136b[_0x4a25a5(0x2b4)](_0x4a25a5(0x24d))};if(_0x5b4ffa)return{'icon':'✅','text':a54_0x1d136b[_0x4a25a5(0x248)](_0x4a25a5(0x23f))};return{'icon':'❌','text':a54_0x1d136b[_0x4a25a5(0x1f8)](_0x4a25a5(0x300))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x176df0(0x26b)](_0x3418cc,_0x22e462,_0xeb317a=0x0){const _0x3d2176=a54_0x176df0;return _0x3418cc[_0xeb317a]||_0x22e462[_0x3d2176(0x25d)];}[a54_0x176df0(0x258)](_0x201b29,_0x373ea9,_0x1ed8cf=0x0){const _0x178add=a54_0x176df0,_0x485856=this[_0x178add(0x26b)](_0x201b29,_0x373ea9,_0x1ed8cf);if(!_0x485856)return console[_0x178add(0x300)](a54_0x1d136b[_0x178add(0x1f8)](_0x178add(0x231)),_0x178add(0x1e7)),console['error'](a54_0x1d136b['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x485856;}[a54_0x176df0(0x348)](_0x2d19b2,_0x3b1207){const _0x3ca62e=a54_0x176df0;if(_0x2d19b2[0x0]){const _0x4cc623=_0x2d19b2[0x0]['split']('.');if(_0x4cc623[_0x3ca62e(0x24a)]===0x1)return{'projectName':_0x4cc623[0x0],'workflowName':undefined};else return _0x4cc623[_0x3ca62e(0x24a)]===0x2?{'projectName':_0x4cc623[0x0],'workflowName':_0x4cc623[0x1]}:(console[_0x3ca62e(0x300)](a54_0x1d136b[_0x3ca62e(0x1f8)](_0x3ca62e(0x231)),_0x3ca62e(0x2c7)),null);}return{'projectName':_0x3b1207[_0x3ca62e(0x25d)],'workflowName':undefined};}['resolveProjectDir'](_0x4939b3,_0x44dd33,_0x145cb2=0x0){const _0x303d58=a54_0x176df0;if(_0x4939b3[_0x145cb2])return _0x4939b3[_0x145cb2];if(_0x44dd33[_0x303d58(0x25d)]){const _0x5c295d=a54_0x31ab49[_0x303d58(0x1fc)](process[_0x303d58(0x1d8)](),_0x303d58(0x23e),_0x44dd33[_0x303d58(0x25d)]);if(existsSync(a54_0x31ab49[_0x303d58(0x1fc)](_0x5c295d,_0x303d58(0x275))))return _0x5c295d;}return undefined;}async[a54_0x176df0(0x1b8)](_0x512e16,_0x845527,_0x1b7a40){const _0x1288ee=a54_0x176df0;try{const _0x3c3dc4=await _0x512e16[_0x1288ee(0x25a)][_0x1288ee(0x23e)](_0x845527,{'limit':0x1});if(_0x3c3dc4['length']>0x0){const _0x78664a=_0x3c3dc4[0x0]['id'],_0x427e98=getWorkflowUrl(_0x1b7a40,_0x78664a);console[_0x1288ee(0x300)](_0x1288ee(0x19a)+a54_0x1d136b['cyan'](_0x427e98));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x176df0(0x2e3)]='workflow:use';[a54_0x176df0(0x2a7)]=a54_0x176df0(0x32b);async['execute'](_0x5479ce){const _0x305b0a=a54_0x176df0,{options:_0x403803,args:_0x49b34c,tdx:_0x20be3e}=_0x5479ce,_0x3cee0c=_0x49b34c[0x0],_0x4a0232=_0x403803[_0x305b0a(0x21c)];if(_0x4a0232)return saveSessionContext({'workflow_project':undefined},_0x403803[_0x305b0a(0x297)]),console[_0x305b0a(0x2bd)](a54_0x1d136b['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x3cee0c)return console['error'](a54_0x1d136b[_0x305b0a(0x1f8)]('Error:'),_0x305b0a(0x1e7)),console[_0x305b0a(0x300)](a54_0x1d136b[_0x305b0a(0x2c5)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x305b0a(0x300)](a54_0x1d136b['dim'](_0x305b0a(0x18a))),0x1;const _0x441f20=await withSpinner(_0x305b0a(0x28a)+_0x3cee0c+_0x305b0a(0x199),()=>_0x20be3e['workflow'][_0x305b0a(0x190)](_0x3cee0c),{'verbose':_0x403803['verbose']}),{name:_0x5294d7}=_0x441f20[_0x305b0a(0x2f2)];return saveSessionContext({'workflow_project':_0x5294d7},_0x403803[_0x305b0a(0x297)]),console[_0x305b0a(0x2bd)](a54_0x1d136b['green'](_0x305b0a(0x23b)+a54_0x1d136b[_0x305b0a(0x1d6)](_0x5294d7))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x176df0(0x2e3)]='workflow:projects';[a54_0x176df0(0x2a7)]='List\x20all\x20workflow\x20projects';async[a54_0x176df0(0x2dd)](_0xdc6b0f){const _0x403a5e=a54_0x176df0,{options:_0x4ba44c,args:_0x3d718e,tdx:_0x48029f}=_0xdc6b0f,_0x2d6e86=_0x3d718e[0x0];_0x4ba44c[_0x403a5e(0x1ac)]&&_0x2d6e86&&console[_0x403a5e(0x300)](_0x403a5e(0x1cc)+_0x2d6e86);const _0x280c5d=await withSpinner(_0x403a5e(0x33c),()=>_0x48029f[_0x403a5e(0x25a)]['projects'](_0x2d6e86,{'limit':_0x4ba44c[_0x403a5e(0x29d)]}),{'verbose':_0x4ba44c[_0x403a5e(0x1ac)]});let _0x3dc1cf=_0x280c5d[_0x403a5e(0x2f2)];_0x3dc1cf[_0x403a5e(0x2c2)]((_0x5badf1,_0x326f29)=>_0x5badf1[_0x403a5e(0x2e3)][_0x403a5e(0x189)](_0x326f29['name']));const _0x2467f0=_0x4ba44c[_0x403a5e(0x29d)]||0x64,_0x956d56=_0x3dc1cf[_0x403a5e(0x24a)]>=_0x2467f0?a54_0x1d136b[_0x403a5e(0x2c5)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x403a5e(0x300)](_0x403a5e(0x254)+_0x3dc1cf['length']+'\x20project'+(_0x3dc1cf['length']!==0x1?'s':'')+_0x956d56);if(_0x4ba44c[_0x403a5e(0x1c5)]==='json'||_0x4ba44c[_0x403a5e(0x1c5)]===_0x403a5e(0x274)||_0x4ba44c['format']===_0x403a5e(0x2e2))await handleSDKOutput(_0x3dc1cf,_0x4ba44c);else{if(_0x3dc1cf[_0x403a5e(0x24a)]===0x0)_0x2d6e86?console[_0x403a5e(0x2bd)](_0x403a5e(0x1e6)+_0x2d6e86):console[_0x403a5e(0x2bd)](_0x403a5e(0x1fa));else{const _0x322024=_0x3dc1cf['map'](_0x10f53b=>{const _0x3b1f99=_0x403a5e,_0x3c60de=_0x10f53b[_0x3b1f99(0x18e)]?.[_0x3b1f99(0x2d8)](_0x218499=>_0x218499['key']===_0x3b1f99(0x251)),_0x57536c=_0x3c60de?a54_0x1d136b[_0x3b1f99(0x2c5)]('\x20(system)'):'';return _0x3b1f99(0x324)+_0x10f53b['name']+_0x57536c;});await writeOutput(_0x322024[_0x403a5e(0x1fc)]('\x0a'),_0x4ba44c[_0x403a5e(0x347)],_0x403a5e(0x335));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x328);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x1ef);async[a54_0x176df0(0x2dd)](_0x9e9140){const _0xb61974=a54_0x176df0,{options:_0x5624de,args:_0x5d8ddc,tdx:_0x50138c}=_0x9e9140,_0xcb6c8a=this[_0xb61974(0x26b)](_0x5d8ddc,_0x5624de);_0x5624de[_0xb61974(0x1ac)]&&_0xcb6c8a&&console[_0xb61974(0x300)]('Project\x20filter:\x20'+_0xcb6c8a);const _0x191351=await withSpinner(_0xb61974(0x27d),()=>_0x50138c[_0xb61974(0x25a)]['workflows'](_0xcb6c8a,{'limit':_0x5624de[_0xb61974(0x29d)]}),{'verbose':_0x5624de[_0xb61974(0x1ac)]});let _0x196b62=_0x191351[_0xb61974(0x2f2)];_0x196b62[_0xb61974(0x2c2)]((_0x57d063,_0x46faca)=>{const _0x1b98fc=_0xb61974,_0x1443c6=_0x57d063['name']['localeCompare'](_0x46faca['name']);if(_0x1443c6!==0x0)return _0x1443c6;return(_0x57d063[_0x1b98fc(0x26d)]?.[_0x1b98fc(0x2e3)]||'')[_0x1b98fc(0x189)](_0x46faca[_0x1b98fc(0x26d)]?.[_0x1b98fc(0x2e3)]||'');});const _0x1bb820=_0x5624de[_0xb61974(0x29d)]||0x64,_0x5910c0=_0x196b62[_0xb61974(0x24a)]>=_0x1bb820?a54_0x1d136b[_0xb61974(0x2c5)](_0xb61974(0x1d2)):'';console[_0xb61974(0x300)](_0xb61974(0x254)+_0x196b62[_0xb61974(0x24a)]+_0xb61974(0x2db)+(_0x196b62['length']!==0x1?'s':'')+_0x5910c0);if(_0x5624de[_0xb61974(0x1c5)]===_0xb61974(0x277)||_0x5624de[_0xb61974(0x1c5)]===_0xb61974(0x274)||_0x5624de[_0xb61974(0x1c5)]==='table')await handleSDKOutput(_0x196b62,_0x5624de);else{if(_0x196b62[_0xb61974(0x24a)]===0x0)_0xcb6c8a?console[_0xb61974(0x2bd)](_0xb61974(0x325)+_0xcb6c8a):console['log']('No\x20workflows\x20found');else{const _0xc204e7=_0x5624de[_0xb61974(0x2aa)],_0x2a38a3=_0x196b62['map'](_0x38f647=>{const _0x171ba0=_0xb61974,_0x500053=a54_0x1d136b['dim']('#'+_0x38f647['id']),_0x1f0799=hyperlink(_0x500053,getWorkflowUrl(_0xc204e7,_0x38f647['id'])),_0x17304b=_0x38f647['project']?.[_0x171ba0(0x2e3)]?a54_0x1d136b['dim']('\x20('+_0x38f647['project'][_0x171ba0(0x2e3)]+')'):'';return _0x171ba0(0x317)+_0x1f0799+'\x20'+_0x38f647[_0x171ba0(0x2e3)]+_0x17304b;});await writeOutput(_0x2a38a3[_0xb61974(0x1fc)]('\x0a'),_0x5624de[_0xb61974(0x347)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x176df0(0x2e3)]='workflow:sessions';['description']=a54_0x176df0(0x27f);async['execute'](_0x3abb31){const _0x1ecbe0=a54_0x176df0,{options:_0x20b709,args:_0x388dbf,tdx:_0x1dc2a4}=_0x3abb31,_0x461565=this[_0x1ecbe0(0x348)](_0x388dbf,_0x20b709);if(!_0x461565)return 0x1;const {projectName:_0x8e6fb4,workflowName:_0x33e5a3}=_0x461565;if(_0x20b709[_0x1ecbe0(0x1ac)]){if(_0x8e6fb4&&_0x33e5a3)console[_0x1ecbe0(0x300)]('Filter:\x20'+_0x8e6fb4+'.'+_0x33e5a3);else _0x8e6fb4&&console[_0x1ecbe0(0x300)](_0x1ecbe0(0x306)+_0x8e6fb4);const _0x4c65a1=_0x20b709[_0x1ecbe0(0x2e9)];_0x4c65a1&&console[_0x1ecbe0(0x300)](_0x1ecbe0(0x2a5)+_0x4c65a1);}let _0x47c7b4=0x28;if(process[_0x1ecbe0(0x1fd)][_0x1ecbe0(0x346)]&&!_0x20b709[_0x1ecbe0(0x347)]&&!_0x20b709['format']){const _0x322d45=process[_0x1ecbe0(0x1fd)][_0x1ecbe0(0x2c3)]||0x28;_0x47c7b4=Math[_0x1ecbe0(0x1f9)](0x14,Math[_0x1ecbe0(0x1bb)](_0x322d45*0x2/0x3));}const _0x3fa8af=_0x20b709[_0x1ecbe0(0x29d)]||_0x47c7b4,_0xe9b7f5=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x1dc2a4[_0x1ecbe0(0x25a)][_0x1ecbe0(0x30f)]({'projectName':_0x8e6fb4,'workflowName':_0x33e5a3,'status':_0x20b709[_0x1ecbe0(0x2e9)],'fromTime':_0x20b709['from'],'toTime':_0x20b709['to'],'limit':_0x3fa8af}),{'verbose':_0x20b709[_0x1ecbe0(0x1ac)]}),_0x36971b=_0xe9b7f5['data'];_0x36971b['sort']((_0x44ff79,_0x336c14)=>{const _0x17d75d=_0x1ecbe0,_0x39712b=_0x44ff79['sessionTime']||'',_0x59b967=_0x336c14['sessionTime']||'';return _0x59b967[_0x17d75d(0x189)](_0x39712b);});_0x36971b[_0x1ecbe0(0x24a)]>=_0x3fa8af?console[_0x1ecbe0(0x300)](_0x1ecbe0(0x2f5)+_0x36971b[_0x1ecbe0(0x24a)]+_0x1ecbe0(0x31f)+a54_0x1d136b[_0x1ecbe0(0x2c5)](_0x1ecbe0(0x192))):console[_0x1ecbe0(0x300)]('✔\x20Found\x20'+_0x36971b['length']+_0x1ecbe0(0x1bd)+(_0x36971b[_0x1ecbe0(0x24a)]!==0x1?'s':''));if(_0x20b709[_0x1ecbe0(0x1c5)]===_0x1ecbe0(0x277)||_0x20b709[_0x1ecbe0(0x1c5)]===_0x1ecbe0(0x274)||_0x20b709[_0x1ecbe0(0x1c5)]==='table')await handleSDKOutput(_0x36971b,_0x20b709);else{if(!process[_0x1ecbe0(0x1fd)][_0x1ecbe0(0x346)]||_0x20b709[_0x1ecbe0(0x347)]){if(_0x36971b[_0x1ecbe0(0x24a)]===0x0){if(_0x8e6fb4&&_0x33e5a3)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x8e6fb4+'.'+_0x33e5a3);else _0x8e6fb4?console[_0x1ecbe0(0x2bd)](_0x1ecbe0(0x2f8)+_0x8e6fb4):console['log'](_0x1ecbe0(0x2d9));}else{const _0x50dd19=_0x20b709[_0x1ecbe0(0x2aa)],_0xd7f081=this[_0x1ecbe0(0x330)](_0x36971b,_0x50dd19);_0x20b709[_0x1ecbe0(0x347)]?await writeOutput(_0xd7f081,_0x20b709[_0x1ecbe0(0x347)],'list'):console['log'](_0xd7f081);}!_0x8e6fb4&&(console['error'](''),console[_0x1ecbe0(0x300)](a54_0x1d136b[_0x1ecbe0(0x2c5)](_0x1ecbe0(0x1ab))),console[_0x1ecbe0(0x300)](a54_0x1d136b[_0x1ecbe0(0x2c5)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x1d136b[_0x1ecbe0(0x2c5)](_0x1ecbe0(0x1de))));}else{if(_0x36971b[_0x1ecbe0(0x24a)]===0x0){if(_0x8e6fb4&&_0x33e5a3)console[_0x1ecbe0(0x2bd)](_0x1ecbe0(0x1c7)+_0x8e6fb4+'.'+_0x33e5a3);else _0x8e6fb4?console['log'](_0x1ecbe0(0x2f8)+_0x8e6fb4):console[_0x1ecbe0(0x2bd)](_0x1ecbe0(0x2d9));}else await this[_0x1ecbe0(0x193)](_0x36971b,_0x3abb31,_0x8e6fb4);}}return 0x0;}[a54_0x176df0(0x330)](_0x13509d,_0x409e00){const _0x1fc01a=a54_0x176df0,_0x5209f7=[],_0x544493=new Map();let _0x55e689=Infinity,_0x58d782=-Infinity;for(const _0x41b2b1 of _0x13509d){if(_0x41b2b1['lastAttempt']?.['createdAt']){const _0x4ec26e=new Date(_0x41b2b1[_0x1fc01a(0x217)][_0x1fc01a(0x2d1)])[_0x1fc01a(0x1e9)](),_0x4a536c=_0x41b2b1[_0x1fc01a(0x217)][_0x1fc01a(0x2bb)]?new Date(_0x41b2b1['lastAttempt'][_0x1fc01a(0x2bb)])['getTime']():Date[_0x1fc01a(0x1af)](),_0x446840=_0x41b2b1[_0x1fc01a(0x26d)]?.['name']||'(unknown)';!_0x544493['has'](_0x446840)&&_0x544493[_0x1fc01a(0x1cb)](_0x446840,[]),_0x544493['get'](_0x446840)['push']({'session':_0x41b2b1,'startTime':_0x4ec26e,'endTime':_0x4a536c,'duration':_0x4a536c-_0x4ec26e}),_0x55e689=Math['min'](_0x55e689,_0x4ec26e),_0x58d782=Math['max'](_0x58d782,_0x4a536c);}}if(_0x544493['size']===0x0)return _0x1fc01a(0x27b);const _0x533d5=process[_0x1fc01a(0x1fd)][_0x1fc01a(0x2c0)]||0x78,_0x5f585f=0x1e,_0x3ce75d=0x32,_0xb251e6=0x4,_0x56305d=Math[_0x1fc01a(0x22b)](_0x3ce75d,Math[_0x1fc01a(0x1f9)](_0x5f585f,Math['floor'](_0x533d5*0.3))),_0x3fdb3d=_0x533d5-_0x56305d-TIMELINE_CONFIG[_0x1fc01a(0x1e4)]-0x3-_0xb251e6,_0x338e41=_0x58d782-_0x55e689,_0x19fb60=_0x338e41/_0x56305d,_0x253197=renderTimeAxis({'startTime':_0x55e689,'endTime':_0x58d782,'durationMs':_0x338e41,'msPerChar':_0x19fb60},_0x56305d),_0x4f9a65=[];for(const _0x17fb89 of _0x544493['values']()){_0x4f9a65[_0x1fc01a(0x30d)](..._0x17fb89);}_0x4f9a65[_0x1fc01a(0x2c2)]((_0x546da5,_0x5e534a)=>_0x5e534a[_0x1fc01a(0x23c)]-_0x546da5['startTime']);const _0x359df7=new Date(_0x55e689),_0x3d7d0c=formatDate(_0x359df7),_0x34eeec=_0xb251e6+TIMELINE_CONFIG[_0x1fc01a(0x2fc)]+TIMELINE_CONFIG['ICON_SPACING']+_0x3fdb3d,_0x662d7d='\x20'[_0x1fc01a(0x255)](_0x34eeec-_0x3d7d0c[_0x1fc01a(0x24a)]),_0x3b2a1f=_0x662d7d+a54_0x1d136b[_0x1fc01a(0x2c5)](_0x3d7d0c)+'\x20'+_0x253197;_0x5209f7[_0x1fc01a(0x30d)](_0x3b2a1f);const _0x1b9f83=0x16;let _0x4859b4=0x0;for(const _0x316920 of _0x4f9a65){const _0x17b685=_0x316920[_0x1fc01a(0x297)][_0x1fc01a(0x26d)]?.[_0x1fc01a(0x2e3)]||'?',_0x238172=Math[_0x1fc01a(0x22b)](stringWidth(_0x17b685),_0x1b9f83);_0x4859b4=Math[_0x1fc01a(0x1f9)](_0x4859b4,_0x238172);}for(const _0x551bd9 of _0x4f9a65){const {session:_0x25a379,startTime:_0x1022bb,endTime:_0x312097,duration:_0x4e7484}=_0x551bd9,_0x12e9f3=_0x25a379[_0x1fc01a(0x26d)]?.['id'],_0x4a0f4e=_0x25a379['id'],_0xa568c6=_0x25a379['project']?.[_0x1fc01a(0x2e3)]||'?',_0x42fc63=_0x25a379[_0x1fc01a(0x25a)]?.['name']||'?';let _0x18ac6d,_0x568f1c;if(_0x25a379[_0x1fc01a(0x217)]){const _0x1b12f1=_0x25a379[_0x1fc01a(0x217)];!_0x1b12f1[_0x1fc01a(0x21d)]?(_0x18ac6d=_0x1b12f1['cancelRequested']?'🛑':'🔄',_0x568f1c=_0x1b12f1[_0x1fc01a(0x314)]?a54_0x1d136b[_0x1fc01a(0x2ef)]:a54_0x1d136b[_0x1fc01a(0x2b4)]):(_0x18ac6d=_0x1b12f1[_0x1fc01a(0x23f)]?'✅':'❌',_0x568f1c=_0x1b12f1[_0x1fc01a(0x23f)]?a54_0x1d136b[_0x1fc01a(0x248)]:a54_0x1d136b[_0x1fc01a(0x1f8)]);}else _0x18ac6d='⏳',_0x568f1c=a54_0x1d136b[_0x1fc01a(0x2c5)];const _0x46da87='#'+_0x4a0f4e,_0x1afd2d=_0x12e9f3?hyperlink(_0x46da87,getWorkflowSessionUrl(_0x409e00,_0x12e9f3,_0x4a0f4e)):_0x46da87;let _0x186802=_0xa568c6;stringWidth(_0xa568c6)>_0x1b9f83&&(_0x186802=_0xa568c6['slice'](0x0,_0x1b9f83-0x1)+'…');const _0x287be7=a54_0x1d136b[_0x1fc01a(0x2c5)](_0x186802),_0x362c77=stringWidth(_0x186802),_0x14a085='\x20'['repeat'](_0x4859b4-stringWidth(_0x186802)+0x2),_0x4930ce='('+formatElapsed(_0x4e7484)+')',_0x1d8299=stringWidth(_0x4930ce),_0x424259=stringWidth(_0x46da87),_0x431072=_0x424259+0x1+_0x362c77+_0x14a085[_0x1fc01a(0x24a)],_0x3c70b0=_0x3fdb3d-_0x431072-_0x1d8299-0x1-0x8;let _0x9a32ae=_0x42fc63;stringWidth(_0x9a32ae)>_0x3c70b0&&(_0x9a32ae=_0x9a32ae[_0x1fc01a(0x1cf)](0x0,_0x3c70b0-0x1)+'…');const _0x47c9c5=_0x1afd2d+'\x20'+_0x287be7+_0x14a085+_0x9a32ae,_0x901c=stringWidth(_0x47c9c5),_0x350d91=_0x3fdb3d-_0x901c-_0x1d8299,_0x726738=_0x47c9c5+'\x20'[_0x1fc01a(0x255)](Math[_0x1fc01a(0x1f9)](0x1,_0x350d91))+a54_0x1d136b[_0x1fc01a(0x2c5)](_0x4930ce),_0x1c92d4=Math[_0x1fc01a(0x1bb)]((_0x1022bb-_0x55e689)/_0x19fb60),_0x3642c3=Math['floor']((_0x312097-_0x55e689)/_0x19fb60),_0x4ee5a4=Math[_0x1fc01a(0x1f9)](_0x1c92d4+0x1,_0x3642c3),_0x25d681=new Array(_0x56305d)['fill']('\x20');for(let _0x4e96b2=_0x1c92d4;_0x4e96b2<Math[_0x1fc01a(0x22b)](_0x4ee5a4,_0x56305d);_0x4e96b2++){_0x25d681[_0x4e96b2]='─';}const _0x1976f8=_0x25d681[_0x1fc01a(0x30c)](_0xb1a4ce=>_0xb1a4ce==='\x20'?'\x20':_0x568f1c(_0xb1a4ce))[_0x1fc01a(0x1fc)]('');_0x5209f7['push'](_0x18ac6d+'\x20'+_0x726738+'│'+_0x1976f8+'│');}return _0x5209f7[_0x1fc01a(0x1fc)]('\x0a');}async['navigateSessionsInteractive'](_0x57e2bc,_0x55c13d,_0x5e0521){const _0x51b944=a54_0x176df0,{options:_0x1495ac,tdx:_0x2af4b0}=_0x55c13d,_0x2009ad=_0x1495ac['site'],{timelineRows:_0x57d397,timeAxisHeader:_0x1d0dbc}=this[_0x51b944(0x208)](_0x57e2bc,_0x2009ad),_0xdbb48=_0x57d397[_0x51b944(0x278)](_0x1effa4=>_0x1effa4[_0x51b944(0x2b8)]);if(_0xdbb48['length']===0x0){const _0xb7b0ff=this[_0x51b944(0x330)](_0x57e2bc,_0x2009ad);console[_0x51b944(0x2bd)](_0xb7b0ff);!_0x5e0521&&(console[_0x51b944(0x300)](''),console[_0x51b944(0x300)](a54_0x1d136b['dim'](_0x51b944(0x1ab))),console[_0x51b944(0x300)](a54_0x1d136b[_0x51b944(0x2c5)](_0x51b944(0x244))+'or'+a54_0x1d136b[_0x51b944(0x2c5)](_0x51b944(0x1de))));return;}_0x1d0dbc&&console['log'](_0x1d0dbc);const _0x14fd36=_0x57d397['filter'](_0x30de10=>_0x30de10[_0x51b944(0x2b8)])[_0x51b944(0x30c)](_0x415737=>({'title':_0x415737['displayLine'],'value':_0x415737[_0x51b944(0x2b8)]})),_0x2fa53c=process[_0x51b944(0x1fd)][_0x51b944(0x2c3)]||0x3c,_0xef1a95=Math[_0x51b944(0x1f9)](0x28,Math[_0x51b944(0x1bb)](_0x2fa53c*0x2/0x3)),_0x17a252=await a54_0x3a0313({'type':_0x51b944(0x239),'name':_0x51b944(0x2b8),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x14fd36,'initial':-0x1,'limit':_0xef1a95,'clearFirst':!![],'fallback':{'title':_0x51b944(0x266),'value':null},'suggest':(_0x2c6da7,_0x7186f)=>{const _0x49f595=_0x51b944;if(!_0x2c6da7)return Promise[_0x49f595(0x1dd)](_0x7186f);const _0xbbbf43=_0x7186f[_0x49f595(0x278)](_0xe90955=>{const _0x1f5acf=_0x49f595,_0x300283=_0xe90955;return _0x300283['title'][_0x1f5acf(0x205)]()[_0x1f5acf(0x2cd)](_0x2c6da7['toLowerCase']());});return Promise['resolve'](_0xbbbf43);}}),_0x491994=()=>{const _0x2f6f1d=_0x51b944;process[_0x2f6f1d(0x1fd)]['write']('\x1b[1A\x1b[2K'),process[_0x2f6f1d(0x1fd)][_0x2f6f1d(0x344)](_0x2f6f1d(0x223)),process[_0x2f6f1d(0x1fd)]['write']('\x1b[1A\x1b[2K');},_0x3fe17f=_0x17a252&&_0x17a252['attemptId']&&_0x17a252[_0x51b944(0x2b8)]!==null&&_0x17a252[_0x51b944(0x2b8)][_0x51b944(0x268)]()!=='';if(!_0x3fe17f){_0x491994(),console[_0x51b944(0x2bd)](a54_0x1d136b[_0x51b944(0x2c5)]('Cancelled'));return;}_0x491994();const _0x37f8a3=_0x57e2bc['find'](_0x18be96=>_0x18be96[_0x51b944(0x217)]?.['id']===_0x17a252['attemptId']);if(_0x37f8a3){const _0x544e95=_0x37f8a3[_0x51b944(0x26d)]?.[_0x51b944(0x2e3)]||'?',_0x4bad72=_0x37f8a3[_0x51b944(0x25a)]?.['name']||'?';console[_0x51b944(0x2bd)](_0x51b944(0x1ce)+a54_0x1d136b[_0x51b944(0x2c5)](_0x544e95)+_0x51b944(0x2d2)+a54_0x1d136b[_0x51b944(0x2c5)](_0x4bad72));}const _0x2e69fc=new WorkflowTimelineCommand();await _0x2e69fc['execute']({'args':[],'options':{..._0x1495ac,'attemptId':_0x17a252[_0x51b944(0x2b8)]},'tdx':_0x2af4b0});}[a54_0x176df0(0x208)](_0x1fa85b,_0x1b5b5d){const _0x15a7f2=a54_0x176df0,_0x13b95d=new Map();for(const _0x204055 of _0x1fa85b){_0x204055['id']&&_0x204055[_0x15a7f2(0x217)]?.['id']&&_0x13b95d[_0x15a7f2(0x1cb)](_0x204055['id'],_0x204055[_0x15a7f2(0x217)]['id']);}const _0x11f6df=[];let _0x1afe28='';const _0x34bc8e=this[_0x15a7f2(0x330)](_0x1fa85b,_0x1b5b5d),_0x354c5b=_0x34bc8e[_0x15a7f2(0x22f)]('\x0a');for(const _0x3b5d8b of _0x354c5b){if(_0x3b5d8b[_0x15a7f2(0x1c2)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x3b5d8b[_0x15a7f2(0x319)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1afe28=_0x3b5d8b;else{if(_0x3b5d8b[_0x15a7f2(0x319)](/^[✅❌🔄🛑⏳]/)){const _0xfed0db=_0x3b5d8b[_0x15a7f2(0x319)](/#(\d+)/),_0x1ad384=_0xfed0db?_0xfed0db[0x1]:null,_0x569eb4=_0x1ad384?_0x13b95d[_0x15a7f2(0x28b)](_0x1ad384)||null:null,_0x4f18fe=_0x1fa85b[_0x15a7f2(0x313)](_0x46f4d6=>_0x46f4d6['id']===_0x1ad384),_0x354c6e=_0x4f18fe?.['project']?.[_0x15a7f2(0x2e3)]||'';_0x11f6df[_0x15a7f2(0x30d)]({'displayLine':_0x3b5d8b,'attemptId':_0x569eb4,'projectName':_0x354c6e});}}}return{'timelineRows':_0x11f6df,'timeAxisHeader':_0x1afe28};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x21e);[a54_0x176df0(0x2a7)]='List\x20workflow\x20attempts';async[a54_0x176df0(0x2dd)](_0x1c8744){const _0x3e633c=a54_0x176df0,{options:_0x2394d9,args:_0x446827,tdx:_0x5cc8e5}=_0x1c8744,_0x526d70=this[_0x3e633c(0x348)](_0x446827,_0x2394d9);if(!_0x526d70)return 0x1;const {projectName:_0x1608f2,workflowName:_0x3e330d}=_0x526d70,_0x18eee0=_0x2394d9['includeRetried'];if(_0x2394d9['verbose']){if(_0x1608f2&&_0x3e330d)console[_0x3e633c(0x300)](_0x3e633c(0x2e0)+_0x1608f2+'.'+_0x3e330d);else _0x1608f2&&console['error'](_0x3e633c(0x306)+_0x1608f2);_0x18eee0&&console[_0x3e633c(0x300)](_0x3e633c(0x241));}const _0x47f292=await withSpinner(_0x3e633c(0x1d3),()=>_0x5cc8e5[_0x3e633c(0x25a)][_0x3e633c(0x28f)]({'projectName':_0x1608f2,'workflowName':_0x3e330d,'includeRetried':_0x18eee0,'limit':_0x2394d9['limit']}),{'verbose':_0x2394d9['verbose']}),_0x5f0390=_0x47f292[_0x3e633c(0x2f2)],_0x496a60=_0x2394d9['limit']||0x64,_0x147311=_0x5f0390[_0x3e633c(0x24a)]>=_0x496a60?a54_0x1d136b[_0x3e633c(0x2c5)](_0x3e633c(0x1d2)):'';console[_0x3e633c(0x300)]('✔\x20Found\x20'+_0x5f0390[_0x3e633c(0x24a)]+_0x3e633c(0x22d)+(_0x5f0390[_0x3e633c(0x24a)]!==0x1?'s':'')+_0x147311);if(_0x2394d9[_0x3e633c(0x1c5)]===_0x3e633c(0x277)||_0x2394d9[_0x3e633c(0x1c5)]===_0x3e633c(0x274)||_0x2394d9['format']===_0x3e633c(0x2e2))await handleSDKOutput(_0x5f0390,_0x2394d9);else{if(_0x5f0390[_0x3e633c(0x24a)]===0x0){if(_0x1608f2&&_0x3e330d)console[_0x3e633c(0x2bd)](_0x3e633c(0x20d)+_0x1608f2+'.'+_0x3e330d);else _0x1608f2?console[_0x3e633c(0x2bd)](_0x3e633c(0x2f0)+_0x1608f2):console[_0x3e633c(0x2bd)](_0x3e633c(0x31b));}else{const _0x40e79b=_0x2394d9[_0x3e633c(0x2aa)],_0x418579=_0x5f0390[_0x3e633c(0x30c)](_0x39bee1=>{const _0x99d7be=_0x3e633c,_0x42ec31=a54_0x1d136b[_0x99d7be(0x2c5)]('#'+_0x39bee1['id']),_0x227af8=_0x39bee1[_0x99d7be(0x26d)]?.['id'],_0x35d942=_0x39bee1[_0x99d7be(0x1d0)]||_0x39bee1[_0x99d7be(0x1c8)],_0x594f4d=_0x227af8&&_0x35d942?hyperlink(_0x42ec31,getWorkflowAttemptUrl(_0x40e79b,_0x227af8,_0x35d942,_0x39bee1['id'])):_0x42ec31,{icon:_0x183553,text:_0x3fef9f}=getAttemptStatusDisplay(_0x39bee1),_0x49b159=(_0x39bee1[_0x99d7be(0x26d)]?.['name']||'?')+'.'+(_0x39bee1[_0x99d7be(0x25a)]?.[_0x99d7be(0x2e3)]||'?'),_0x3465ab=_0x39bee1[_0x99d7be(0x310)]?a54_0x1d136b['dim'](_0x39bee1[_0x99d7be(0x310)]):'';return(_0x594f4d+'\x20'+_0x183553+(_0x3fef9f?'\x20'+_0x3fef9f:'')+'\x20'+_0x49b159+'\x20'+_0x3465ab)[_0x99d7be(0x1e2)]();});await writeOutput(_0x418579[_0x3e633c(0x1fc)]('\x0a'),_0x2394d9[_0x3e633c(0x347)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x176df0(0x2e3)]='workflow:attempt';[a54_0x176df0(0x2a7)]=a54_0x176df0(0x2ce);async[a54_0x176df0(0x2dd)](_0x146858){const _0x442cdd=a54_0x176df0,{options:_0x2ef462,args:_0x20c508,tdx:_0x1ffd68}=_0x146858,_0x58c438=_0x20c508[0x0];if(!_0x58c438)return console[_0x442cdd(0x300)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x2ef462[_0x442cdd(0x1ac)]&&console[_0x442cdd(0x300)]('Attempt\x20ID:\x20'+_0x58c438);const _0x111f24=await withSpinner(_0x442cdd(0x321),()=>_0x1ffd68[_0x442cdd(0x25a)][_0x442cdd(0x245)](_0x58c438),{'verbose':_0x2ef462[_0x442cdd(0x1ac)]}),_0x43b88e=_0x111f24[_0x442cdd(0x2f2)];let _0x19e763;!_0x43b88e['done']?_0x19e763=_0x43b88e['cancelRequested']?'canceling':_0x442cdd(0x24d):_0x19e763=_0x43b88e['success']?_0x442cdd(0x23f):_0x442cdd(0x300);let _0x55e00e;if(_0x43b88e[_0x442cdd(0x2d1)]&&_0x43b88e[_0x442cdd(0x2bb)]){const _0x435af0=new Date(_0x43b88e[_0x442cdd(0x2d1)])[_0x442cdd(0x1e9)](),_0x4b1115=new Date(_0x43b88e[_0x442cdd(0x2bb)])[_0x442cdd(0x1e9)]();_0x55e00e=Math[_0x442cdd(0x280)]((_0x4b1115-_0x435af0)/0x3e8);}const _0x2c8deb={'attempt_id':_0x43b88e['id'],'status':_0x19e763,..._0x43b88e[_0x442cdd(0x1c9)]!==undefined&&{'index':_0x43b88e[_0x442cdd(0x1c9)]},..._0x43b88e['project']&&{'project':_0x43b88e['project']['name']},..._0x43b88e[_0x442cdd(0x25a)]&&{'workflow':_0x43b88e['workflow'][_0x442cdd(0x2e3)]},..._0x43b88e[_0x442cdd(0x1c8)]&&{'session_id':_0x43b88e[_0x442cdd(0x1c8)]},..._0x43b88e[_0x442cdd(0x310)]&&{'session_time':_0x43b88e[_0x442cdd(0x310)]},..._0x43b88e[_0x442cdd(0x34a)]&&{'retry_attempt':_0x43b88e[_0x442cdd(0x34a)]},..._0x55e00e!==undefined&&{'duration_sec':_0x55e00e},..._0x43b88e['createdAt']&&{'created_at':_0x43b88e[_0x442cdd(0x2d1)]},..._0x43b88e[_0x442cdd(0x2bb)]&&{'finished_at':_0x43b88e[_0x442cdd(0x2bb)]},...Object[_0x442cdd(0x27c)](_0x43b88e[_0x442cdd(0x30e)])[_0x442cdd(0x24a)]>0x0&&{'params':_0x43b88e[_0x442cdd(0x30e)]}};return await handleSingleObjectOutput(_0x2c8deb,_0x2ef462),0x0;}}function a54_0xbbfc(_0x515602,_0x18519b){_0x515602=_0x515602-0x187;const _0x19836c=a54_0x1983();let _0xbbfcf2=_0x19836c[_0x515602];return _0xbbfcf2;}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x176df0(0x229);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x1ad);async[a54_0x176df0(0x2dd)](_0x206835){const _0x17ee34=a54_0x176df0,{options:_0x465cfc,args:_0x425bdd,tdx:_0xdd8f2e}=_0x206835,_0x108c06=_0x425bdd[0x0];if(!_0x108c06)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x14bfe4=_0x465cfc[_0x17ee34(0x237)];_0x465cfc[_0x17ee34(0x1ac)]&&(console['error'](_0x17ee34(0x18f)+_0x108c06),_0x14bfe4&&console[_0x17ee34(0x300)](_0x17ee34(0x25e)));const _0x502f2a=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0xdd8f2e[_0x17ee34(0x25a)][_0x17ee34(0x261)](_0x108c06,_0x14bfe4||![]),{'verbose':_0x465cfc[_0x17ee34(0x1ac)]}),_0x46cfa8=_0x502f2a[_0x17ee34(0x2f2)];return console[_0x17ee34(0x300)]('✔\x20Found\x20'+_0x46cfa8[_0x17ee34(0x24a)]+_0x17ee34(0x326)+(_0x46cfa8[_0x17ee34(0x24a)]!==0x1?'s':'')),await handleSDKOutput(_0x46cfa8,_0x465cfc),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x176df0(0x2e3)]='workflow:logs';['description']=a54_0x176df0(0x1b6);async[a54_0x176df0(0x2dd)](_0x53af86){const _0x43caae=a54_0x176df0,{options:_0x5b4af6,args:_0x325d1c,tdx:_0x59cfe1}=_0x53af86,_0xdfa915=_0x325d1c[0x0];let _0x1ffac5=_0x325d1c[0x1];if(!_0xdfa915)return console[_0x43caae(0x300)](_0x43caae(0x339)),0x1;_0x5b4af6[_0x43caae(0x1ac)]&&(console[_0x43caae(0x300)](_0x43caae(0x18f)+_0xdfa915),_0x1ffac5&&console[_0x43caae(0x300)]('Task\x20name:\x20'+_0x1ffac5));const _0x17a5cb=await withSpinner('Fetching\x20log\x20files...',()=>_0x59cfe1[_0x43caae(0x25a)][_0x43caae(0x315)](_0xdfa915,_0x1ffac5),{'verbose':_0x5b4af6[_0x43caae(0x1ac)]}),_0x180c86=_0x17a5cb[_0x43caae(0x2f2)];if(_0x180c86[_0x43caae(0x24a)]===0x0)return console[_0x43caae(0x300)](_0x43caae(0x31c)),0x0;if(!_0x1ffac5&&(_0x5b4af6[_0x43caae(0x277)]||_0x5b4af6[_0x43caae(0x1c5)]))return await handleSDKOutput(_0x180c86,_0x5b4af6),0x0;if(!_0x1ffac5){const _0x2a0daa=_0x180c86[_0x43caae(0x30c)](_0x261e3b=>({'title':_0x261e3b[_0x43caae(0x32d)]+'\x20('+formatBytes(_0x261e3b[_0x43caae(0x1e3)])+')','value':_0x261e3b[_0x43caae(0x32d)]})),_0x15f0d0=await a54_0x3a0313({'type':_0x43caae(0x1fb),'name':_0x43caae(0x25b),'message':_0x43caae(0x322),'choices':_0x2a0daa});if(!_0x15f0d0[_0x43caae(0x25b)])return console[_0x43caae(0x300)](_0x43caae(0x2d7)),0x0;_0x1ffac5=_0x15f0d0[_0x43caae(0x25b)];}const _0x465243=await withSpinner('Downloading\x20logs...',()=>_0x59cfe1[_0x43caae(0x25a)][_0x43caae(0x260)](_0xdfa915,_0x1ffac5),{'verbose':_0x5b4af6[_0x43caae(0x1ac)]}),_0x4a5acf=_0x465243['data'];return _0x4a5acf?console[_0x43caae(0x2bd)](_0x4a5acf):console[_0x43caae(0x300)](_0x43caae(0x1c3)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x2d0);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x18d);async[a54_0x176df0(0x2dd)](_0x37dcd1){const _0x29fafe=a54_0x176df0,{options:_0x43f585,args:_0x5a5fe2,tdx:_0x4e4f8f}=_0x37dcd1,_0x2d5338=_0x5a5fe2[0x0];if(!_0x2d5338)return console[_0x29fafe(0x300)](_0x29fafe(0x339)),0x1;const _0x462b2b=_0x43f585[_0x29fafe(0x20c)];_0x43f585[_0x29fafe(0x1ac)]&&(console['error'](_0x29fafe(0x18f)+_0x2d5338),_0x462b2b&&console['error']('Reason:\x20'+_0x462b2b));if(!_0x43f585[_0x29fafe(0x349)]){if(!isInteractive())return console[_0x29fafe(0x300)](a54_0x1d136b[_0x29fafe(0x1f8)](_0x29fafe(0x1b3)),_0x29fafe(0x195)),console[_0x29fafe(0x300)](a54_0x1d136b[_0x29fafe(0x2c5)](_0x29fafe(0x2ec))),0x1;const _0x591d7d=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x2d5338+'?');if(!_0x591d7d)return console[_0x29fafe(0x300)](a54_0x1d136b[_0x29fafe(0x2ef)]('Cancelled')),0x1;}const _0x453d17=await withSpinner(_0x29fafe(0x1df),()=>_0x4e4f8f[_0x29fafe(0x25a)][_0x29fafe(0x345)](_0x2d5338,_0x462b2b),{'verbose':_0x43f585[_0x29fafe(0x1ac)]}),_0x326fc8=_0x453d17['data'];return console[_0x29fafe(0x300)]('✔\x20'+_0x326fc8),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x187);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x2a4);async['execute'](_0x37f527){const _0x5374d5=a54_0x176df0,{options:_0x4e833b,args:_0x1f56db,tdx:_0x3ad210}=_0x37f527,_0x244a44=_0x1f56db[0x0];if(!_0x244a44)return console[_0x5374d5(0x300)](_0x5374d5(0x257)),console[_0x5374d5(0x300)](_0x5374d5(0x305)),0x1;let _0x157ff0=![],_0x4a2962=_0x244a44;if(_0x244a44['startsWith'](_0x5374d5(0x336)))_0x157ff0=!![],_0x4a2962=_0x244a44[_0x5374d5(0x341)](0x8);else{if(_0x244a44[_0x5374d5(0x1c2)](_0x5374d5(0x1a6)))_0x157ff0=![],_0x4a2962=_0x244a44[_0x5374d5(0x341)](0x8);else return console[_0x5374d5(0x300)](_0x5374d5(0x1ba)),console[_0x5374d5(0x300)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0xa1d785=_0x4e833b['fromTask'],_0x13ccbe=_0x4e833b[_0x5374d5(0x340)],_0x75b1ba=_0x4e833b[_0x5374d5(0x30e)],_0x5b67a7=_0x4e833b[_0x5374d5(0x1a8)];_0x4e833b[_0x5374d5(0x1ac)]&&(console['error'](_0x5374d5(0x222)+(_0x157ff0?_0x5374d5(0x297):'attempt')+'\x20'+_0x4a2962),_0xa1d785&&console[_0x5374d5(0x300)](_0x5374d5(0x22a)+_0xa1d785),_0x13ccbe&&console['error'](_0x5374d5(0x2cc)+_0x13ccbe),_0x75b1ba&&console[_0x5374d5(0x300)](_0x5374d5(0x327)+_0x75b1ba),_0x5b67a7&&console[_0x5374d5(0x300)](_0x5374d5(0x1ff)));let _0x546bba;if(_0x75b1ba)try{if(_0x75b1ba['startsWith']('@')){const _0x3241d9=await import(_0x5374d5(0x33e)),_0x4536ca=_0x75b1ba['substring'](0x1),_0x39fe7d=await _0x3241d9[_0x5374d5(0x2da)](_0x4536ca,_0x5374d5(0x20a));_0x546bba=JSON['parse'](_0x39fe7d);}else _0x546bba=JSON[_0x5374d5(0x240)](_0x75b1ba);}catch{return console[_0x5374d5(0x300)](_0x5374d5(0x24e)),0x1;}if(!_0x4e833b[_0x5374d5(0x349)]){if(!isInteractive())return console['error'](a54_0x1d136b[_0x5374d5(0x1f8)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5374d5(0x300)](a54_0x1d136b[_0x5374d5(0x2c5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x19bdc2=await confirmKey(_0x5374d5(0x1f4)+(_0x157ff0?_0x5374d5(0x297):'attempt')+'\x20'+_0x4a2962+'?');if(!_0x19bdc2)return console[_0x5374d5(0x300)](a54_0x1d136b[_0x5374d5(0x2ef)]('Cancelled')),0x1;}let _0x364c72;_0x157ff0?_0x364c72=await withSpinner(_0x5374d5(0x296),()=>_0x3ad210[_0x5374d5(0x25a)][_0x5374d5(0x309)](_0x4a2962,{'fromTask':_0xa1d785,'retryParams':_0x546bba}),{'verbose':_0x4e833b['verbose']}):_0x364c72=await withSpinner(_0x5374d5(0x1b9),()=>_0x3ad210[_0x5374d5(0x25a)]['retryAttempt'](_0x4a2962,{'resumeFrom':_0x13ccbe,'retryParams':_0x546bba,'force':_0x5b67a7}),{'verbose':_0x4e833b[_0x5374d5(0x1ac)]});const _0x2f4d38=_0x364c72[_0x5374d5(0x2f2)];return console['error'](_0x5374d5(0x269)),console[_0x5374d5(0x300)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x2f4d38[_0x5374d5(0x2b8)]),console[_0x5374d5(0x300)](_0x5374d5(0x233)+_0x2f4d38[_0x5374d5(0x1c8)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']='workflow:run';['description']=a54_0x176df0(0x2c9);async[a54_0x176df0(0x2dd)](_0x3d7ff4){const _0x367a8f=a54_0x176df0,{options:_0x29ff30,args:_0x17566c,tdx:_0x54da98}=_0x3d7ff4;let _0x33b0bd=_0x17566c[0x0];if(!_0x33b0bd){const _0x1dbe54=this['resolveProject']([],_0x29ff30),_0x4be752=await withSpinner('Loading\x20workflows...',()=>_0x54da98['workflow']['workflows'](_0x1dbe54,{'limit':_0x29ff30[_0x367a8f(0x29d)]}),{'verbose':_0x29ff30['verbose']}),_0x37df54=_0x4be752['data'];if(_0x37df54[_0x367a8f(0x24a)]===0x0)return console[_0x367a8f(0x300)](_0x367a8f(0x323)),!_0x1dbe54&&console[_0x367a8f(0x300)](a54_0x1d136b[_0x367a8f(0x2c5)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x5da647=_0x37df54['map'](_0x59278b=>({'title':_0x59278b[_0x367a8f(0x26d)]?.[_0x367a8f(0x2e3)]+'.'+_0x59278b[_0x367a8f(0x2e3)],'value':_0x59278b['project']?.[_0x367a8f(0x2e3)]+'.'+_0x59278b[_0x367a8f(0x2e3)],'description':_0x59278b[_0x367a8f(0x2e6)]?_0x367a8f(0x18c)+_0x59278b['revision']:undefined})),_0x28ecf7=await a54_0x3a0313({'type':_0x367a8f(0x1fb),'name':_0x367a8f(0x25a),'message':_0x367a8f(0x338),'choices':_0x5da647});if(!_0x28ecf7['workflow'])return 0x1;_0x33b0bd=_0x28ecf7[_0x367a8f(0x25a)];}if(!_0x33b0bd[_0x367a8f(0x2cd)]('.')){const _0x311075=this['resolveProject']([],_0x29ff30);if(_0x311075)_0x33b0bd=_0x311075+'.'+_0x33b0bd;else return console[_0x367a8f(0x300)](a54_0x1d136b['red'](_0x367a8f(0x231)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x367a8f(0x300)](a54_0x1d136b[_0x367a8f(0x2c5)](_0x367a8f(0x2bf))),0x1;}const _0x2e333b=_0x29ff30['param'],_0x5b4c48=_0x29ff30[_0x367a8f(0x310)],_0x1fe68e={};if(_0x2e333b&&Array['isArray'](_0x2e333b))for(const _0x3c5064 of _0x2e333b){const _0x402cbe=_0x3c5064[_0x367a8f(0x2de)]('=');if(_0x402cbe===-0x1)return console[_0x367a8f(0x300)](_0x367a8f(0x1c6)+_0x3c5064),console[_0x367a8f(0x300)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x6740e8=_0x3c5064['substring'](0x0,_0x402cbe),_0x328f81=_0x3c5064['substring'](_0x402cbe+0x1);try{_0x1fe68e[_0x6740e8]=JSON[_0x367a8f(0x240)](_0x328f81);}catch{_0x1fe68e[_0x6740e8]=_0x328f81;}}_0x29ff30[_0x367a8f(0x1ac)]&&(console[_0x367a8f(0x300)](_0x367a8f(0x210)+_0x33b0bd),Object[_0x367a8f(0x27c)](_0x1fe68e)[_0x367a8f(0x24a)]>0x0&&console[_0x367a8f(0x300)](_0x367a8f(0x2dc)+JSON[_0x367a8f(0x2ab)](_0x1fe68e)),_0x5b4c48&&console[_0x367a8f(0x300)]('Session\x20time:\x20'+_0x5b4c48));if(_0x29ff30[_0x367a8f(0x353)])return await this[_0x367a8f(0x303)](_0x3d7ff4,_0x33b0bd,_0x1fe68e,_0x5b4c48);const _0x250c3e=await withSpinner(_0x367a8f(0x28c),()=>_0x54da98[_0x367a8f(0x25a)][_0x367a8f(0x259)](_0x33b0bd,_0x1fe68e,{'sessionTime':_0x5b4c48}),{'verbose':_0x29ff30[_0x367a8f(0x1ac)]}),_0x4bde47=_0x250c3e[_0x367a8f(0x2f2)];console[_0x367a8f(0x300)](_0x367a8f(0x212)),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x4bde47['id']),console[_0x367a8f(0x300)](_0x367a8f(0x233)+_0x4bde47[_0x367a8f(0x1c8)]),console[_0x367a8f(0x300)]('\x20\x20Project:\x20'+_0x4bde47[_0x367a8f(0x26d)]?.[_0x367a8f(0x2e3)]),console[_0x367a8f(0x300)](_0x367a8f(0x2c4)+_0x4bde47[_0x367a8f(0x25a)]?.[_0x367a8f(0x2e3)]);if(_0x4bde47[_0x367a8f(0x26d)]?.['id']&&_0x4bde47[_0x367a8f(0x1c8)]&&_0x4bde47['id']){const _0x13f34c=_0x29ff30['site'],_0x5b7bd1=getConsoleUrl(_0x13f34c,_0x367a8f(0x221)+_0x4bde47[_0x367a8f(0x26d)]['id']+'/sessions/'+_0x4bde47[_0x367a8f(0x1c8)]+_0x367a8f(0x1e1)+_0x4bde47['id']);console[_0x367a8f(0x300)](_0x367a8f(0x19a)+a54_0x1d136b['cyan'](_0x5b7bd1));}return 0x0;}async[a54_0x176df0(0x303)](_0x3031f6,_0x49aa42,_0x3ecc98,_0x28aff7){const _0x421655=a54_0x176df0,{options:_0x9708d2,tdx:_0x305d37}=_0x3031f6,_0xd813e0=await withSpinner('Fetching\x20workflow\x20'+_0x49aa42+_0x421655(0x34c),()=>_0x305d37[_0x421655(0x25a)][_0x421655(0x34d)](_0x49aa42),{'verbose':_0x9708d2[_0x421655(0x1ac)]}),_0x1aa84d=_0xd813e0[_0x421655(0x2f2)],_0x27dda9=_0x28aff7??new Date()[_0x421655(0x1a5)]();console[_0x421655(0x2bd)](a54_0x1d136b[_0x421655(0x225)](_0x421655(0x207)),_0x49aa42),console[_0x421655(0x2bd)](a54_0x1d136b['bold']('Session\x20time:'),_0x27dda9),console[_0x421655(0x2bd)](a54_0x1d136b[_0x421655(0x225)](_0x421655(0x2a6)),JSON[_0x421655(0x2ab)](_0x3ecc98)),console[_0x421655(0x2bd)](''),console[_0x421655(0x2bd)](a54_0x1d136b[_0x421655(0x225)](_0x421655(0x22e)));const _0x484c3e=parseTaskGraph(_0x1aa84d[_0x421655(0x1cd)]??null);if(_0x484c3e['length']===0x0)console[_0x421655(0x2bd)](a54_0x1d136b['dim'](_0x421655(0x2b3)));else for(const _0x3e0ff5 of formatTaskGraph(_0x484c3e)){console['log'](_0x3e0ff5);}const _0xbccb98=summarizeTaskGraph(_0x484c3e),_0x434f0a=formatWarningSummary(_0xbccb98);return _0x434f0a&&(console[_0x421655(0x2bd)](''),console[_0x421655(0x2bd)](a54_0x1d136b[_0x421655(0x2ef)](_0x434f0a))),console[_0x421655(0x2bd)](a54_0x1d136b[_0x421655(0x2ef)]('\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.')),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x176df0(0x294);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x249);async[a54_0x176df0(0x2dd)](_0x216d6c){const _0x3072c2=a54_0x176df0,{options:_0x44c703,args:_0x4bd694,tdx:_0x118f71}=_0x216d6c,_0x4b1b61=_0x4bd694[0x0],_0x2243e6=_0x4bd694[0x1]||'.';if(!_0x4b1b61)return console[_0x3072c2(0x300)](_0x3072c2(0x298)),console[_0x3072c2(0x300)](_0x3072c2(0x299)),0x1;const _0x77eecf=_0x44c703[_0x3072c2(0x2e6)];_0x44c703[_0x3072c2(0x1ac)]&&(console['error'](_0x3072c2(0x1ce)+_0x4b1b61),console[_0x3072c2(0x300)](_0x3072c2(0x34b)+_0x2243e6),_0x77eecf&&console[_0x3072c2(0x300)](_0x3072c2(0x2fb)+_0x77eecf));const _0x4b8d75=await withSpinner(_0x3072c2(0x33a)+_0x4b1b61+_0x3072c2(0x34c),()=>_0x118f71[_0x3072c2(0x25a)][_0x3072c2(0x26c)](_0x4b1b61,_0x2243e6,{'revision':_0x77eecf}),{'verbose':_0x44c703[_0x3072c2(0x1ac)]}),_0x2b9fac=_0x4b8d75['data'];return console[_0x3072c2(0x300)](_0x3072c2(0x1ee)+_0x2b9fac[_0x3072c2(0x1a7)]),console['error'](_0x3072c2(0x302)+_0x2b9fac[_0x3072c2(0x2e6)]),console[_0x3072c2(0x300)](_0x3072c2(0x20f)+_0x2b9fac['filesExtracted']),console[_0x3072c2(0x300)](_0x3072c2(0x29b)+_0x2243e6+'/'+_0x2b9fac[_0x3072c2(0x1a7)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x1a2);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x203);async[a54_0x176df0(0x2dd)](_0x3080cb){const _0x17d3a5=a54_0x176df0,{options:_0x5a9fae,args:_0x4f26c7,tdx:_0x45828c}=_0x3080cb;let _0x52068d='.',_0x45851a=_0x5a9fae['name'];if(_0x4f26c7[0x0]){const {promises:_0x2b2834}=await import('fs');try{const _0x358fc5=await _0x2b2834['stat'](_0x4f26c7[0x0]);if(_0x358fc5[_0x17d3a5(0x2d3)]())_0x52068d=_0x4f26c7[0x0];else return console['error'](_0x17d3a5(0x219)+_0x4f26c7[0x0]+_0x17d3a5(0x250)),0x1;}catch{_0x45851a=_0x4f26c7[0x0],_0x52068d='.';}}const _0x17f139=_0x5a9fae[_0x17d3a5(0x2e6)],_0x2e6596=_0x5a9fae[_0x17d3a5(0x1f0)];_0x5a9fae[_0x17d3a5(0x1ac)]&&(console[_0x17d3a5(0x300)]('Project\x20directory:\x20'+_0x52068d),_0x45851a&&console['error'](_0x17d3a5(0x1ae)+_0x45851a),_0x17f139&&console[_0x17d3a5(0x300)](_0x17d3a5(0x2fb)+_0x17f139),_0x2e6596&&console[_0x17d3a5(0x300)]('Validation:\x20skipped'));const _0x2b0eb2=await withSpinner(_0x17d3a5(0x2f3),()=>_0x45828c[_0x17d3a5(0x25a)][_0x17d3a5(0x30d)](_0x52068d,{'projectName':_0x45851a,'revision':_0x17f139,'skipValidation':_0x2e6596}),{'verbose':_0x5a9fae[_0x17d3a5(0x1ac)]}),_0x28914f=_0x2b0eb2[_0x17d3a5(0x2f2)];return console[_0x17d3a5(0x300)](_0x17d3a5(0x218)+_0x28914f[_0x17d3a5(0x1a7)]),console[_0x17d3a5(0x300)](_0x17d3a5(0x2b7)+_0x28914f['projectId']),console['error'](_0x17d3a5(0x302)+_0x28914f[_0x17d3a5(0x2e6)]),await this[_0x17d3a5(0x1b8)](_0x45828c,_0x28914f[_0x17d3a5(0x1a7)],_0x5a9fae['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0x176df0(0x1d4);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x1f6);async[a54_0x176df0(0x2dd)](_0x1884eb){const _0x53a071=a54_0x176df0,{options:_0x28f323,args:_0x558ac9,tdx:_0x20b99c}=_0x1884eb,_0x2f73ee=_0x558ac9[0x0],_0x102e30=_0x558ac9[0x1];if(!_0x2f73ee)return console[_0x53a071(0x300)](a54_0x1d136b[_0x53a071(0x1f8)](_0x53a071(0x231)),_0x53a071(0x1e7)),console['error'](a54_0x1d136b['dim'](_0x53a071(0x1a0))),0x1;const _0x41eb7f=_0x28f323['revision'];_0x28f323[_0x53a071(0x1ac)]&&(console['error'](_0x53a071(0x1ce)+_0x2f73ee),_0x102e30&&console[_0x53a071(0x300)](_0x53a071(0x214)+_0x102e30),_0x41eb7f&&console[_0x53a071(0x300)](_0x53a071(0x2fb)+_0x41eb7f),_0x28f323['dryRun']&&console[_0x53a071(0x300)]('Dry\x20run:\x20yes'));const _0x1e3057=await withSpinner(_0x53a071(0x1c0)+_0x2f73ee+'...',()=>_0x20b99c['workflow'][_0x53a071(0x1a4)](_0x2f73ee,{'targetDir':_0x102e30,'revision':_0x41eb7f}),{'verbose':_0x28f323[_0x53a071(0x1ac)]}),_0x522250=_0x1e3057['data'];_0x522250[_0x53a071(0x1fe)]?console[_0x53a071(0x300)]('→\x20New\x20project:\x20'+_0x522250[_0x53a071(0x1a7)]):console['error'](_0x53a071(0x1d9)+_0x522250['projectName']);console[_0x53a071(0x300)](_0x53a071(0x302)+_0x522250[_0x53a071(0x2e6)]),console[_0x53a071(0x300)](_0x53a071(0x351)+(a54_0x31ab49['relative'](process[_0x53a071(0x1d8)](),_0x522250['targetDir'])||'.')),console[_0x53a071(0x300)](_0x53a071(0x2ea)+a54_0x1d136b[_0x53a071(0x248)]('+'+_0x522250['summary']['new']+'\x20new')+',\x20'+(a54_0x1d136b[_0x53a071(0x2ef)]('~'+_0x522250[_0x53a071(0x2ee)][_0x53a071(0x320)]+_0x53a071(0x24f))+',\x20')+(a54_0x1d136b[_0x53a071(0x1f8)]('-'+_0x522250['summary'][_0x53a071(0x1f7)]+_0x53a071(0x308))+',\x20')+(''+a54_0x1d136b[_0x53a071(0x2c5)](_0x522250[_0x53a071(0x2ee)][_0x53a071(0x27e)]+_0x53a071(0x2fa))));for(const _0x5433da of _0x522250[_0x53a071(0x2ae)]){_0x5433da[_0x53a071(0x209)]===_0x53a071(0x320)&&_0x5433da[_0x53a071(0x263)]&&(console[_0x53a071(0x300)]('\x0a'+a54_0x1d136b[_0x53a071(0x1d6)](_0x53a071(0x284)+_0x5433da[_0x53a071(0x1aa)])),console[_0x53a071(0x300)](_0x5433da['diff']));}if(!_0x522250[_0x53a071(0x2a8)])return saveSessionContext({'workflow_project':_0x522250['projectName']},_0x28f323[_0x53a071(0x297)]),console['error'](a54_0x1d136b[_0x53a071(0x248)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x53a071(0x300)](a54_0x1d136b[_0x53a071(0x2c5)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x522250[_0x53a071(0x1a7)])),0x0;if(_0x28f323['dryRun'])return console[_0x53a071(0x300)](a54_0x1d136b[_0x53a071(0x2ef)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x28f323[_0x53a071(0x349)]){if(!isInteractive())return console['error'](a54_0x1d136b[_0x53a071(0x1f8)](_0x53a071(0x1b3)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x53a071(0x300)](a54_0x1d136b['dim'](_0x53a071(0x2ec))),0x1;const _0x4f28a9=await confirmKey(_0x53a071(0x200));if(!_0x4f28a9)return console[_0x53a071(0x300)](a54_0x1d136b[_0x53a071(0x2ef)](_0x53a071(0x2d7)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x53a071(0x33f),()=>_0x20b99c[_0x53a071(0x25a)][_0x53a071(0x33d)](_0x522250,{'revision':_0x41eb7f}),{'verbose':_0x28f323['verbose']}),saveSessionContext({'workflow_project':_0x522250[_0x53a071(0x1a7)]},_0x28f323[_0x53a071(0x297)]),console['error'](a54_0x1d136b[_0x53a071(0x248)]('✔\x20Pull\x20complete'));const _0x47b0b6=a54_0x31ab49[_0x53a071(0x2b2)](process[_0x53a071(0x1d8)](),_0x522250[_0x53a071(0x2b1)])||'.';return console[_0x53a071(0x300)](a54_0x1d136b['dim'](_0x53a071(0x29b)+_0x47b0b6)),console['error'](a54_0x1d136b[_0x53a071(0x2c5)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x522250[_0x53a071(0x1a7)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x2ca);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x21b);async[a54_0x176df0(0x2dd)](_0x4e8bfd){const _0x773e66=a54_0x176df0,{options:_0x25903c,args:_0x35f044,tdx:_0x3e0d21}=_0x4e8bfd,_0x20641b=this[_0x773e66(0x238)](_0x35f044,_0x25903c),_0x44e33a=_0x25903c[_0x773e66(0x2e6)],_0x49625f=_0x25903c[_0x773e66(0x1f0)];_0x25903c[_0x773e66(0x1ac)]&&(_0x20641b&&console[_0x773e66(0x300)]('Source\x20directory:\x20'+_0x20641b),_0x44e33a&&console[_0x773e66(0x300)](_0x773e66(0x2fb)+_0x44e33a),_0x25903c['dryRun']&&console[_0x773e66(0x300)](_0x773e66(0x2e8)),_0x49625f&&console[_0x773e66(0x300)](_0x773e66(0x216)));let _0x595256;try{_0x595256=await withSpinner(_0x773e66(0x2e7),()=>_0x3e0d21[_0x773e66(0x25a)][_0x773e66(0x2c8)]({'sourceDir':_0x20641b,'revision':_0x44e33a,'skipValidation':_0x49625f}),{'verbose':_0x25903c[_0x773e66(0x1ac)]});}catch(_0x4ce422){if(_0x4ce422 instanceof Error&&_0x4ce422[_0x773e66(0x202)][_0x773e66(0x2cd)](_0x773e66(0x24b)))return console[_0x773e66(0x300)](a54_0x1d136b[_0x773e66(0x1f8)](_0x773e66(0x231)),_0x773e66(0x343)),_0x25903c[_0x773e66(0x25d)]?console[_0x773e66(0x300)](a54_0x1d136b[_0x773e66(0x2c5)](_0x773e66(0x2c6)+_0x25903c['workflowProject']+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x25903c[_0x773e66(0x25d)]+'\x27')):console[_0x773e66(0x300)](a54_0x1d136b[_0x773e66(0x2c5)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x4ce422;}const _0x31db62=_0x595256['data'];console[_0x773e66(0x300)](_0x773e66(0x252)+_0x31db62['projectName']),console[_0x773e66(0x300)](_0x773e66(0x32e)+_0x31db62[_0x773e66(0x1ec)]),console[_0x773e66(0x300)](_0x773e66(0x302)+_0x31db62['revision']),console['error']('\x20\x20Changes:\x20'+a54_0x1d136b[_0x773e66(0x248)]('+'+_0x31db62[_0x773e66(0x2ee)][_0x773e66(0x2ac)]+_0x773e66(0x1f5))+',\x20'+(a54_0x1d136b[_0x773e66(0x2ef)]('~'+_0x31db62['summary'][_0x773e66(0x320)]+'\x20modified')+',\x20')+(a54_0x1d136b['red']('-'+_0x31db62[_0x773e66(0x2ee)][_0x773e66(0x1f7)]+_0x773e66(0x308))+',\x20')+(''+a54_0x1d136b[_0x773e66(0x2c5)](_0x31db62['summary'][_0x773e66(0x27e)]+_0x773e66(0x2fa))));for(const _0x1fcd29 of _0x31db62[_0x773e66(0x2ae)]){_0x1fcd29[_0x773e66(0x209)]===_0x773e66(0x320)&&_0x1fcd29[_0x773e66(0x263)]&&(console[_0x773e66(0x300)]('\x0a'+a54_0x1d136b['cyan'](_0x773e66(0x284)+_0x1fcd29[_0x773e66(0x1aa)])),console[_0x773e66(0x300)](_0x1fcd29['diff']));}if(!_0x31db62['hasChanges'])return console[_0x773e66(0x300)](a54_0x1d136b['green'](_0x773e66(0x29e))),await this[_0x773e66(0x1b8)](_0x3e0d21,_0x31db62['projectName'],_0x25903c[_0x773e66(0x2aa)]),0x0;if(_0x25903c[_0x773e66(0x353)])return console[_0x773e66(0x300)](a54_0x1d136b[_0x773e66(0x2ef)](_0x773e66(0x2a9))),0x0;if(!_0x25903c[_0x773e66(0x349)]){if(!isInteractive())return console[_0x773e66(0x300)](a54_0x1d136b[_0x773e66(0x1f8)]('\x0aError:'),_0x773e66(0x195)),console[_0x773e66(0x300)](a54_0x1d136b[_0x773e66(0x2c5)](_0x773e66(0x2ec))),0x1;const _0x3f345e=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x3f345e)return console[_0x773e66(0x300)](a54_0x1d136b[_0x773e66(0x2ef)](_0x773e66(0x2d7)),'-\x20nothing\x20pushed'),0x1;}const _0x25f243=await withSpinner(_0x773e66(0x1ea),()=>_0x3e0d21[_0x773e66(0x25a)][_0x773e66(0x1b5)](_0x31db62),{'verbose':_0x25903c[_0x773e66(0x1ac)]}),_0x1022d9=_0x25f243[_0x773e66(0x2f2)];return console[_0x773e66(0x300)](a54_0x1d136b['green']('✔\x20Push\x20complete')),console['error'](_0x773e66(0x2b7)+_0x1022d9[_0x773e66(0x204)]),console[_0x773e66(0x300)](_0x773e66(0x302)+_0x1022d9['revision']),await this['showWorkflowConsoleUrl'](_0x3e0d21,_0x1022d9[_0x773e66(0x1a7)],_0x25903c[_0x773e66(0x2aa)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x176df0(0x332);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x2cb);async[a54_0x176df0(0x2dd)](_0x177a76){const _0x53af1a=a54_0x176df0,{options:_0x3f4ea2,args:_0x3a8e7b,tdx:_0x42d02e}=_0x177a76,_0x2614bd=this[_0x53af1a(0x238)](_0x3a8e7b,_0x3f4ea2),_0x5a8807=_0x3f4ea2['name'],_0x2cefe4=_0x3f4ea2[_0x53af1a(0x2e6)],_0x15adbd=_0x3f4ea2[_0x53af1a(0x1f0)];if(!_0x2614bd)return console[_0x53af1a(0x300)](a54_0x1d136b[_0x53af1a(0x1f8)](_0x53af1a(0x231)),_0x53af1a(0x2fd)),console[_0x53af1a(0x300)](a54_0x1d136b[_0x53af1a(0x2c5)](_0x53af1a(0x273))),console[_0x53af1a(0x300)](a54_0x1d136b[_0x53af1a(0x2c5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x5a8807)return console[_0x53af1a(0x300)](a54_0x1d136b[_0x53af1a(0x1f8)](_0x53af1a(0x231)),_0x53af1a(0x30a)),console['error'](a54_0x1d136b[_0x53af1a(0x2c5)](_0x53af1a(0x273))),0x1;_0x3f4ea2[_0x53af1a(0x1ac)]&&(console[_0x53af1a(0x300)](_0x53af1a(0x34f)+_0x2614bd),console[_0x53af1a(0x300)](_0x53af1a(0x1c4)+_0x5a8807),_0x2cefe4&&console[_0x53af1a(0x300)]('Revision:\x20'+_0x2cefe4),_0x3f4ea2['dryRun']&&console[_0x53af1a(0x300)](_0x53af1a(0x2e8)),_0x15adbd&&console[_0x53af1a(0x300)]('Validation:\x20skipped'));const _0x15ec5d=await withSpinner(_0x53af1a(0x256),()=>_0x42d02e[_0x53af1a(0x25a)]['prepareCloneProject'](_0x2614bd,_0x5a8807,{'revision':_0x2cefe4,'skipValidation':_0x15adbd}),{'verbose':_0x3f4ea2[_0x53af1a(0x1ac)]}),_0x2c5173=_0x15ec5d[_0x53af1a(0x2f2)];console[_0x53af1a(0x300)](_0x53af1a(0x2cf)+_0x2c5173[_0x53af1a(0x1ec)]);_0x2c5173[_0x53af1a(0x196)]&&console['error'](_0x53af1a(0x1a1)+_0x2c5173[_0x53af1a(0x196)]);console[_0x53af1a(0x300)](_0x53af1a(0x1c4)+_0x2c5173[_0x53af1a(0x227)]),console[_0x53af1a(0x300)]('Revision:\x20'+_0x2c5173[_0x53af1a(0x2e6)]),console[_0x53af1a(0x300)](_0x53af1a(0x226)+_0x2c5173[_0x53af1a(0x232)]);_0x2c5173[_0x53af1a(0x194)]&&(console[_0x53af1a(0x300)](a54_0x1d136b['yellow']('\x0a⚠\x20Project\x20\x22'+_0x2c5173[_0x53af1a(0x227)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x2c5173[_0x53af1a(0x25f)]+')')),console[_0x53af1a(0x300)](a54_0x1d136b[_0x53af1a(0x2ef)](_0x53af1a(0x2ff))));if(_0x3f4ea2[_0x53af1a(0x353)])return console[_0x53af1a(0x300)](a54_0x1d136b['yellow'](_0x53af1a(0x2bc))),0x0;if(!_0x3f4ea2[_0x53af1a(0x349)]){if(!isInteractive())return console[_0x53af1a(0x300)](a54_0x1d136b[_0x53af1a(0x1f8)]('\x0aError:'),_0x53af1a(0x195)),console[_0x53af1a(0x300)](a54_0x1d136b[_0x53af1a(0x2c5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3ddb41=_0x2c5173['sourceProjectName']||a54_0x31ab49['basename'](_0x2614bd),_0x39bdfd=_0x2c5173[_0x53af1a(0x194)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x5a8807+'\x22\x20with\x20new\x20revision?':_0x53af1a(0x286)+_0x3ddb41+_0x53af1a(0x26a)+_0x5a8807+'\x22?',_0x42c98b=await confirmKey(_0x39bdfd);if(!_0x42c98b)return console[_0x53af1a(0x300)](a54_0x1d136b['yellow'](_0x53af1a(0x2d7))),0x1;}const _0x52d0b5=await withSpinner(_0x2c5173[_0x53af1a(0x194)]?_0x53af1a(0x2b6)+_0x5a8807+_0x53af1a(0x34c):_0x53af1a(0x253)+_0x5a8807+_0x53af1a(0x34c),()=>_0x42d02e['workflow'][_0x53af1a(0x220)](_0x2c5173),{'verbose':_0x3f4ea2[_0x53af1a(0x1ac)]}),_0x24a3ce=_0x52d0b5['data'];return console[_0x53af1a(0x300)](a54_0x1d136b[_0x53af1a(0x248)](_0x2c5173['targetExists']?_0x53af1a(0x285):_0x53af1a(0x19c))),console[_0x53af1a(0x300)](_0x53af1a(0x2d5)+_0x24a3ce[_0x53af1a(0x227)]),console[_0x53af1a(0x300)](_0x53af1a(0x2b7)+_0x24a3ce['newProjectId']),console[_0x53af1a(0x300)]('\x20\x20Revision:\x20'+_0x24a3ce['revision']),await this[_0x53af1a(0x1b8)](_0x42d02e,_0x24a3ce[_0x53af1a(0x227)],_0x3f4ea2['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x176df0(0x2e3)]='workflow:delete';['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x3af563){const _0x26ab55=a54_0x176df0,{options:_0x46cce5,args:_0x50e030,tdx:_0x4e80a3}=_0x3af563,_0x23c212=_0x50e030[0x0];if(!_0x23c212)return console[_0x26ab55(0x300)](_0x26ab55(0x1b0)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x46cce5['verbose']&&console['error'](_0x26ab55(0x1ce)+_0x23c212);if(!_0x46cce5[_0x26ab55(0x349)]){if(!isInteractive())return console[_0x26ab55(0x300)](a54_0x1d136b[_0x26ab55(0x1f8)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x26ab55(0x300)](a54_0x1d136b[_0x26ab55(0x2c5)](_0x26ab55(0x2ec))),0x1;const _0x8b769=await confirmKey(_0x26ab55(0x198)+_0x23c212+_0x26ab55(0x329));if(!_0x8b769)return console[_0x26ab55(0x300)](a54_0x1d136b[_0x26ab55(0x2ef)](_0x26ab55(0x2d7))),0x1;}const _0x7d821b=await withSpinner(_0x26ab55(0x21f)+_0x23c212+_0x26ab55(0x34c),()=>_0x4e80a3[_0x26ab55(0x25a)][_0x26ab55(0x20b)](_0x23c212),{'verbose':_0x46cce5[_0x26ab55(0x1ac)]}),_0x4994f3=_0x7d821b['data'];return console[_0x26ab55(0x300)](_0x26ab55(0x2b5)+_0x4994f3[_0x26ab55(0x1a7)]),console['error'](_0x26ab55(0x2b7)+_0x4994f3['projectId']),0x0;}}export function parseKeyValue(_0xb5b7fe){const _0x5b1a69=a54_0x176df0,_0x221075=_0xb5b7fe[_0x5b1a69(0x2de)]('=');if(_0x221075===-0x1)throw new Error(_0x5b1a69(0x32f)+_0xb5b7fe+_0x5b1a69(0x213));const _0xeb5754=_0xb5b7fe[_0x5b1a69(0x341)](0x0,_0x221075),_0x4cbcf1=_0xb5b7fe[_0x5b1a69(0x341)](_0x221075+0x1);if(!_0xeb5754)throw new Error(_0x5b1a69(0x2e1));return{'key':_0xeb5754,'value':_0x4cbcf1};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a54_0x176df0(0x1db);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x23a);async[a54_0x176df0(0x2dd)](_0x5dd8dc){const _0x277b06=a54_0x176df0,{options:_0x18f535,args:_0x25a781,tdx:_0x3fa9dd}=_0x5dd8dc,_0x492746=this[_0x277b06(0x258)](_0x25a781,_0x18f535);if(!_0x492746)return 0x1;_0x18f535[_0x277b06(0x1ac)]&&console[_0x277b06(0x300)]('Project:\x20'+_0x492746);const _0x5a3639=await withSpinner(_0x277b06(0x19d),()=>_0x3fa9dd[_0x277b06(0x25a)][_0x277b06(0x1f2)](_0x492746),{'verbose':_0x18f535[_0x277b06(0x1ac)]}),{secrets:_0x10e9e1}=_0x5a3639[_0x277b06(0x2f2)];return console['error']('✔\x20Found\x20'+_0x10e9e1['length']+'\x20secret'+(_0x10e9e1['length']!==0x1?'s':'')),await handleSDKOutput(_0x10e9e1,_0x18f535),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a54_0x176df0(0x1c1);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x333);async['execute'](_0x1264c9){const _0x31ac6e=a54_0x176df0,{options:_0x52fc6f,args:_0x2b4a0c,tdx:_0x2ebcc9}=_0x1264c9;let _0x1a5b58,_0x127eca;if(_0x2b4a0c[_0x31ac6e(0x24a)]>=0x1&&!_0x2b4a0c[0x0]['includes']('='))_0x1a5b58=_0x2b4a0c[0x0],_0x127eca=_0x2b4a0c[_0x31ac6e(0x1cf)](0x1);else{if(_0x2b4a0c[_0x31ac6e(0x24a)]>=0x1&&_0x52fc6f[_0x31ac6e(0x25d)])_0x1a5b58=_0x52fc6f['workflowProject'],_0x127eca=_0x2b4a0c;else return _0x2b4a0c[_0x31ac6e(0x24a)]>=0x1?(console[_0x31ac6e(0x300)](_0x31ac6e(0x298)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x31ac6e(0x300)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x31ac6e(0x300)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x127eca[_0x31ac6e(0x24a)]===0x0)return console[_0x31ac6e(0x300)](_0x31ac6e(0x33b)),console[_0x31ac6e(0x300)](_0x31ac6e(0x2c1)),0x1;const _0x3139ef={};try{for(const _0x58a854 of _0x127eca){const {key:_0x10b426,value:_0x4a0ab2}=parseKeyValue(_0x58a854);_0x3139ef[_0x10b426]=_0x4a0ab2;}}catch(_0x50f5a5){return _0x50f5a5 instanceof Error&&console[_0x31ac6e(0x300)](a54_0x1d136b[_0x31ac6e(0x1f8)](_0x31ac6e(0x231)),_0x50f5a5[_0x31ac6e(0x202)]),0x1;}const _0x3decc4=Object[_0x31ac6e(0x27c)](_0x3139ef);_0x52fc6f[_0x31ac6e(0x1ac)]&&(console[_0x31ac6e(0x300)](_0x31ac6e(0x1ce)+_0x1a5b58),console[_0x31ac6e(0x300)](_0x31ac6e(0x201)+_0x3decc4[_0x31ac6e(0x1fc)](',\x20')));const _0x50ded7=await withSpinner(_0x3decc4[_0x31ac6e(0x24a)]===0x1?'Setting\x20secret...':_0x31ac6e(0x312)+_0x3decc4[_0x31ac6e(0x24a)]+'\x20secrets...',()=>_0x2ebcc9['workflow'][_0x31ac6e(0x29c)](_0x1a5b58,_0x3139ef),{'verbose':_0x52fc6f['verbose']}),_0x23a701=_0x50ded7['data'];return console[_0x31ac6e(0x300)](_0x3decc4['length']===0x1?_0x31ac6e(0x31e)+_0x23a701[_0x31ac6e(0x27c)][0x0]+_0x31ac6e(0x1ed)+_0x23a701['projectName']+'\x27':'✔\x20'+_0x23a701[_0x31ac6e(0x27c)][_0x31ac6e(0x24a)]+_0x31ac6e(0x23d)+_0x23a701[_0x31ac6e(0x1a7)]+'\x27'),(_0x52fc6f['json']||_0x52fc6f['jsonl'])&&await handleSingleObjectOutput(_0x23a701,_0x52fc6f),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x18b);[a54_0x176df0(0x2a7)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a54_0x176df0(0x2dd)](_0x3ee0d6){const _0x3254b5=a54_0x176df0,{options:_0x24cee8,args:_0x551d9c,tdx:_0x51035d}=_0x3ee0d6;let _0x427ffc,_0xd11fff;if(_0x551d9c['length']>=0x2)_0x427ffc=_0x551d9c[0x0],_0xd11fff=_0x551d9c[0x1];else{if(_0x551d9c[_0x3254b5(0x24a)]===0x1&&_0x24cee8['workflowProject'])_0x427ffc=_0x24cee8[_0x3254b5(0x25d)],_0xd11fff=_0x551d9c[0x0];else return _0x551d9c[_0x3254b5(0x24a)]===0x1?(console[_0x3254b5(0x300)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x3254b5(0x300)](_0x3254b5(0x2bf)),0x1):(console['error'](_0x3254b5(0x28e)),console['error'](_0x3254b5(0x1a9)),0x1);}_0x24cee8['verbose']&&(console[_0x3254b5(0x300)]('Project:\x20'+_0x427ffc),console[_0x3254b5(0x300)](_0x3254b5(0x1b1)+_0xd11fff));if(!_0x24cee8[_0x3254b5(0x349)]){if(!isInteractive())return console[_0x3254b5(0x300)](a54_0x1d136b['red'](_0x3254b5(0x1b3)),_0x3254b5(0x195)),console[_0x3254b5(0x300)](a54_0x1d136b[_0x3254b5(0x2c5)](_0x3254b5(0x2ec))),0x1;const _0x182398=await confirmKey(_0x3254b5(0x295)+_0xd11fff+'\x27\x20from\x20project\x20\x27'+_0x427ffc+'\x27?');if(!_0x182398)return console['error'](a54_0x1d136b[_0x3254b5(0x2ef)]('Cancelled')),0x1;}const _0x42ad1c=await withSpinner(_0x3254b5(0x2e5),()=>_0x51035d[_0x3254b5(0x25a)]['deleteSecret'](_0x427ffc,_0xd11fff),{'verbose':_0x24cee8[_0x3254b5(0x1ac)]}),_0x31289f=_0x42ad1c['data'];return console['error']('✔\x20Secret\x20\x27'+_0x31289f['key']+_0x3254b5(0x282)+_0x31289f['projectName']+'\x27'),(_0x24cee8[_0x3254b5(0x277)]||_0x24cee8[_0x3254b5(0x274)])&&await handleSingleObjectOutput(_0x31289f,_0x24cee8),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(_0x1a7501){const _0x448d30=a54_0x176df0,_0x12353a=Math[_0x448d30(0x1bb)](_0x1a7501/0x3e8),_0x476886=Math[_0x448d30(0x1bb)](_0x12353a/0x3c),_0x281524=Math[_0x448d30(0x1bb)](_0x476886/0x3c),_0x7cb256=Math[_0x448d30(0x1bb)](_0x281524/0x18);if(_0x7cb256>0x0){const _0x3d3f74=_0x281524%0x18;return _0x3d3f74>0x0?_0x7cb256+'d\x20'+_0x3d3f74+'h':_0x7cb256+'d';}else{if(_0x281524>0x0){const _0x50983b=_0x476886%0x3c;return _0x50983b>0x0?_0x281524+'h\x20'+_0x50983b+'m':_0x281524+'h';}else{if(_0x476886>0x0){const _0x2f22f5=_0x12353a%0x3c;return _0x2f22f5>0x0?_0x476886+'m\x20'+_0x2f22f5+'s':_0x476886+'m';}else return _0x12353a+'s';}}}function a54_0x1983(){const _0x3916e4=['Cancelled','some','No\x20sessions\x20found','readFile','\x20workflow','Parameters:\x20','execute','indexOf','⚠\x20Showing\x20first\x20','Filter:\x20','Key\x20cannot\x20be\x20empty','table','name','Loading\x20sessions...','Deleting\x20secret...','revision','Analyzing\x20changes...','Dry\x20run:\x20yes','status','\x20\x20Changes:\x20','getFullYear','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','MIN_LABEL_COUNT','summary','yellow','No\x20attempts\x20found\x20in\x20project:\x20','7nRXDMb','data','Pushing\x20workflow\x20project...','\x20enabled\x20(','✔\x20Showing\x20','start','group_error','No\x20sessions\x20found\x20in\x20project:\x20','2025282ADtcAw','\x20unchanged','Revision:\x20','ICON_WIDTH','Source\x20directory\x20is\x20required','(unknown)','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','error','startedAt','\x20\x20Revision:\x20','executeDryRun','No\x20schedules\x20found','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Filter:\x20project=','4xuxljl','\x20deleted','retrySession','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Session\x20not\x20found:\x20','map','push','params','sessions','sessionTime','renderTimeline','Setting\x20','find','cancelRequested','logFiles','fullName','📋\x20','💡\x20Tip:\x20Use\x20','match','every','No\x20attempts\x20found','No\x20log\x20files\x20found\x20for\x20this\x20attempt','text','✔\x20Secret\x20\x27','\x20sessions\x20','modified','Getting\x20attempt\x20details...','Select\x20a\x20task\x20to\x20view\x20logs:','No\x20workflows\x20found','📁\x20','No\x20workflows\x20found\x20in\x20project:\x20','\x20task','Params:\x20','workflow:workflows','\x22?\x20This\x20cannot\x20be\x20undone.','Attempt:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','28613mNMnaU','taskName','\x20\x20Source:\x20','Invalid\x20format:\x20','renderSessionsTimeline','Enable\x20a\x20workflow\x20schedule','workflow:clone','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20tasks','list','session:','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Select\x20a\x20workflow\x20to\x20run','Error:\x20Attempt\x20ID\x20is\x20required','Downloading\x20project\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Listing\x20workflow\x20projects...','applyPullProject','fs/promises','Writing\x20files...','resumeFrom','substring','buildTimelineData','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','write','kill','isTTY','output','parseProjectWorkflowPattern','yes','retryAttemptName','Output\x20directory:\x20','...','getWorkflow','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Source\x20directory:\x20','📅\x20#','\x20\x20Target:\x20','MAX_LABEL_COUNT','dryRun','unknown','workflow:retry','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','localeCompare','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','workflow:secrets:delete','revision:\x20','Kill\x20a\x20running\x20attempt','metadata','Attempt\x20ID:\x20','resolveProjectId','\x20(disabled)','(use\x20--limit\x20to\x20see\x20more)','navigateSessionsInteractive','targetExists','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','sourceProjectName','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x27...','\x20\x20Console:\x20','Warning:','✔\x20Clone\x20complete','Listing\x20secrets...','end','2482536wXaCrw','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Source\x20project:\x20','workflow:upload','all','pullProject','toISOString','attempt:','projectName','force','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','path','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','verbose','Show\x20tasks\x20for\x20an\x20attempt','Project\x20name:\x20','now','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Key:\x20','\x20of\x20','\x0aError:','workflow:schedules','executePushProject','Show\x20logs\x20for\x20a\x20workflow\x20attempt','window','showWorkflowConsoleUrl','Retrying\x20attempt...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','floor','toLocaleString','\x20session','Auto-selected\x20latest\x20session:\x20','MAX_POLL_ITERATIONS','Pulling\x20project\x20','workflow:secrets:set','startsWith','No\x20log\x20content\x20found','New\x20project\x20name:\x20','format','Error:\x20Invalid\x20parameter\x20format:\x20','No\x20sessions\x20found\x20for:\x20','sessionId','index','nextRunTime','set','Pattern:\x20','config','Project:\x20','slice','session_id','follow','\x20(use\x20--limit\x20to\x20show\x20more)','Listing\x20workflow\x20attempts...','workflow:pull','850618VbGeqt','cyan','13892180bpXVlt','cwd','→\x20Project:\x20','\x0a✔\x20Attempt\x20complete','workflow:secrets:list','updatedAt','resolve','\x20\x20tdx\x20wf\x20use\x20<project>','Killing\x20attempt...','\x20-\x20','/attempt/','trimEnd','fileSize','GUTTER','context','No\x20projects\x20match\x20pattern:\x20','Project\x20name\x20is\x20required','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','getTime','Pushing\x20project...','replace','sourceDir','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','✔\x20Downloaded\x20','List\x20workflows','skipValidation','getMonth','listSecrets','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x20new','Pull\x20workflow\x20project\x20to\x20local\x20folder','deleted','red','max','No\x20workflow\x20projects\x20found','select','join','stdout','isNewProject','Force:\x20yes','\x0aApply\x20these\x20changes?','Secrets\x20to\x20set:\x20','message','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','projectId','toLowerCase','renderSingleTimeline','Workflow:','generateSessionTimelineRows','type','utf-8','delete','reason','No\x20attempts\x20found\x20for:\x20','workflow:timeline','\x20\x20Files\x20extracted:\x20','Workflow:\x20','disableSchedule','✔\x20Workflow\x20run\x20started','.\x20Expected\x20format:\x20KEY=VALUE','Target\x20directory:\x20','enableSchedule','Validation:\x20skipped','lastAttempt','✔\x20Pushed\x20','Error:\x20','TASK_NAME_WIDTH','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','clear','done','workflow:attempts','Deleting\x20project\x20','executeCloneProject','/app/workflows/','Target:\x20','\x1b[1A\x1b[2K','workflowName','bold','Files\x20to\x20upload:\x20','newProjectName','icon','workflow:tasks','From\x20task:\x20','min','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','\x20attempt','Task\x20graph:','split','363330MXtxon','Error:','fileCount','\x20\x20Session\x20ID:\x20','\x20\x20Next\x20run:\x20','getHours','value','includeSubtasks','resolveProjectDir','autocomplete','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','✔\x20Workflow\x20project\x20set\x20to:\x20','startTime','\x20secrets\x20set\x20for\x20project\x20\x27','workflows','success','parse','Include\x20retried:\x20yes','durationMs','List\x20workflow\x20schedules','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','attempt','white','workflow:schedule:disable','green','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','length','No\x20workflow\x20tdx.json\x20found','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','running','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20modified','\x20is\x20not\x20a\x20directory','sys','✔\x20Project:\x20','Cloning\x20to\x20','✔\x20Found\x20','repeat','Analyzing\x20project...','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','requireProject','run','workflow','task','state','workflowProject','Including\x20subtasks:\x20yes','existingProjectId','logs','tasks','\x20schedule','diff','11KMUnDy','Listing\x20schedules...','No\x20matching\x20sessions\x20found','32FdNmtF','trim','✔\x20Retry\x20started','\x22\x20to\x20new\x20project\x20\x22','resolveProject','download','project','padStart','Disable\x20a\x20workflow\x20schedule','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Loading\x20session...','\x20next:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','jsonl','tdx.json','4zgykwv','json','filter','msPerChar','\x20disabled\x20(','No\x20sessions\x20with\x20timing\x20information','keys','Listing\x20workflows...','unchanged','List\x20workflow\x20execution\x20sessions','round','Select\x20a\x20session\x20to\x20view\x20timeline:','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20logs','---\x20','✔\x20Project\x20updated','\x0aClone\x20\x22','MAX_TASKS_DISPLAY','16752zPqJpm','\x20has\x20no\x20attempts','Resolving\x20project\x20\x27','get','Starting\x20workflow\x20run...','Disabling\x20schedule\x20#','Error:\x20Secret\x20key\x20is\x20required','attempts','Session\x20','getDate','Failed\x20to\x20fetch\x20attempt\x20data','2915140raXDew','workflow:download','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Retrying\x20session...','session','Error:\x20Project\x20name\x20is\x20required','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','MIN_TIMELINE_WIDTH','\x20\x20Location:\x20','setSecrets','limit','\x0a✔\x20No\x20changes\x20to\x20push','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Schedule\x20ID\x20is\x20required','ICON_SPACING','duration','splice','Retry\x20a\x20session\x20or\x20attempt','Status:\x20','Parameters:','description','hasChanges','\x0aDry\x20run\x20-\x20nothing\x20pushed','site','stringify','new','POLL_INTERVAL_MS','changes','fill','No\x20workflow\x20sessions\x20found','targetDir','relative','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','blue','✔\x20Deleted\x20project\x20','Updating\x20','\x20\x20Project\x20ID:\x20','attemptId','🔄\x20','canceling','finishedAt','\x0aDry\x20run\x20-\x20no\x20project\x20created','log','planned','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','columns','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','sort','rows','\x20\x20Workflow:\x20','dim','Tip:\x20cd\x20to\x20workflows/','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','preparePushProject','Start\x20a\x20workflow\x20run','workflow:push','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Resume\x20from:\x20','includes','Show\x20specific\x20attempt\x20details','Source:\x20','workflow:kill','createdAt',',\x20Workflow:\x20','isDirectory','disabledAt','\x20\x20Project:\x20','pollTimeline'];a54_0x1983=function(){return _0x3916e4;};return a54_0x1983();}function formatTimestamp(_0x4458a3,_0x5bf72d){const _0x4a8013=a54_0x176df0,_0x325984=new Date(_0x4458a3),_0x120ad8=String(_0x325984[_0x4a8013(0x235)]())[_0x4a8013(0x26e)](0x2,'0'),_0x3bac71=String(_0x325984['getMinutes']())['padStart'](0x2,'0'),_0x411709=_0x120ad8+':'+_0x3bac71,_0x286fc1=_0x325984[_0x4a8013(0x2eb)]()===_0x5bf72d[_0x4a8013(0x2eb)]()&&_0x325984['getMonth']()===_0x5bf72d[_0x4a8013(0x1f1)]()&&_0x325984[_0x4a8013(0x291)]()===_0x5bf72d[_0x4a8013(0x291)]();if(_0x286fc1)return _0x411709;else{const _0x2973aa=String(_0x325984[_0x4a8013(0x1f1)]()+0x1)[_0x4a8013(0x26e)](0x2,'0'),_0x2532e8=String(_0x325984[_0x4a8013(0x291)]())['padStart'](0x2,'0');return _0x2973aa+'-'+_0x2532e8+'\x20'+_0x411709;}}function formatDate(_0x49005e){const _0x36aebe=a54_0x176df0,_0xeaa5ac=_0x49005e[_0x36aebe(0x2eb)](),_0x527adc=String(_0x49005e['getMonth']()+0x1)[_0x36aebe(0x26e)](0x2,'0'),_0x364c96=String(_0x49005e[_0x36aebe(0x291)]())[_0x36aebe(0x26e)](0x2,'0');return _0xeaa5ac+'-'+_0x527adc+'-'+_0x364c96;}function getTaskStateIcon(_0x53ba27){const _0x3256f5={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3256f5[_0x53ba27]||'⚪';}function getBarChar(_0x1ff733){const _0x3a5c28=a54_0x176df0;return _0x1ff733==='error'||_0x1ff733===_0x3a5c28(0x2f7)?'×':'─';}function getBarColor(_0x488dc4){const _0x4cca9f=a54_0x176df0,_0x48e1e0={'success':a54_0x1d136b[_0x4cca9f(0x248)],'error':a54_0x1d136b[_0x4cca9f(0x1f8)],'group_error':a54_0x1d136b[_0x4cca9f(0x1f8)],'running':a54_0x1d136b['blue'],'blocked':a54_0x1d136b[_0x4cca9f(0x2ef)],'planned':a54_0x1d136b[_0x4cca9f(0x2c5)],'canceling':a54_0x1d136b['yellow']};return _0x48e1e0[_0x488dc4]||a54_0x1d136b[_0x4cca9f(0x246)];}function parseTaskName(_0x25b34e){const _0x4f77aa=a54_0x176df0;let _0x5d8fda=_0x25b34e[_0x4f77aa(0x1eb)](/^\++/,'');const _0xbe9822=_0x5d8fda[_0x4f77aa(0x22f)]('+'),_0x5319a=_0xbe9822['length']>0x1?_0xbe9822[_0x4f77aa(0x24a)]-0x2:0x0,_0x197d21=_0xbe9822[_0xbe9822[_0x4f77aa(0x24a)]-0x1]||_0x5d8fda;return{'level':_0x5319a,'name':'+'+_0x197d21};}function truncateTaskName(_0x326769,_0x51ddb8){const _0x5a3b0f=a54_0x176df0,_0x56db57=stringWidth(_0x326769);if(_0x56db57<=_0x51ddb8)return _0x326769;let _0x3061ab=_0x326769;while(stringWidth(_0x3061ab+'…')>_0x51ddb8&&_0x3061ab[_0x5a3b0f(0x24a)]>0x0){_0x3061ab=_0x3061ab[_0x5a3b0f(0x1cf)](0x0,-0x1);}return _0x3061ab+'…';}function calculateTimeScale(_0x4225b1,_0x2782c4){const _0xf1443f=a54_0x176df0;return{'startTime':_0x4225b1['start'],'endTime':_0x4225b1['end'],'durationMs':_0x4225b1[_0xf1443f(0x2a2)],'msPerChar':_0x4225b1[_0xf1443f(0x2a2)]/_0x2782c4};}function timeToPosition(_0x1af37a,_0xd037ff,_0x57953f){const _0x146e8f=a54_0x176df0,_0x17a165=_0x1af37a-_0xd037ff['startTime'],_0x15aa79=Math[_0x146e8f(0x1bb)](_0x17a165/_0xd037ff[_0x146e8f(0x279)]);return Math['max'](0x0,Math[_0x146e8f(0x22b)](_0x15aa79,_0x57953f));}function renderTimeAxis(_0x48b9dd,_0x9c1f51){const _0x3a9977=a54_0x176df0,_0x2991d5=Math[_0x3a9977(0x22b)](TIMELINE_CONFIG[_0x3a9977(0x352)],Math[_0x3a9977(0x1f9)](TIMELINE_CONFIG[_0x3a9977(0x2ed)],Math[_0x3a9977(0x1bb)](_0x9c1f51/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x1d0c27=_0x48b9dd[_0x3a9977(0x242)]/(_0x2991d5-0x1),_0x415716=new Date(_0x48b9dd['startTime']),_0x1674e4=[];for(let _0x46bf90=0x0;_0x46bf90<_0x2991d5;_0x46bf90++){const _0x3f0c17=_0x48b9dd[_0x3a9977(0x23c)]+_0x46bf90*_0x1d0c27,_0x17166b=timeToPosition(_0x3f0c17,_0x48b9dd,_0x9c1f51),_0x11028c=formatTimestamp(_0x3f0c17,_0x415716);_0x1674e4['push']({'pos':_0x17166b,'text':_0x11028c});}const _0x580414=new Array(_0x9c1f51)[_0x3a9977(0x2af)]('\x20');let _0x138ac7=-0x1;for(const {pos:_0x23f8bd,text:_0x4ab42a}of _0x1674e4){let _0x51f0dc=Math['max'](0x0,_0x23f8bd-Math[_0x3a9977(0x1bb)](_0x4ab42a[_0x3a9977(0x24a)]/0x2));_0x51f0dc<=_0x138ac7+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x51f0dc=_0x138ac7+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x51f0dc+_0x4ab42a['length']>_0x9c1f51&&(_0x51f0dc=_0x9c1f51-_0x4ab42a[_0x3a9977(0x24a)]);if(_0x51f0dc>=0x0&&_0x51f0dc+_0x4ab42a['length']<=_0x9c1f51&&_0x51f0dc>_0x138ac7){for(let _0x20aefd=0x0;_0x20aefd<_0x4ab42a['length'];_0x20aefd++){_0x580414[_0x51f0dc+_0x20aefd]=_0x4ab42a[_0x20aefd];}_0x138ac7=_0x51f0dc+_0x4ab42a[_0x3a9977(0x24a)]-0x1;}}return _0x580414['join']('');}function renderTaskRow(_0x5d639e,_0x51e509,_0x1407a9,_0x5495c7){const _0x1977c4=a54_0x176df0,{level:_0x1e503a,name:_0x56cc67}=parseTaskName(_0x5d639e[_0x1977c4(0x2e3)]),_0x3d10eb='\x20'[_0x1977c4(0x255)](_0x1e503a),_0x8db084=_0x5d639e['window']?'('+formatElapsed(_0x5d639e[_0x1977c4(0x1b7)][_0x1977c4(0x2a2)])+')':'',_0xb2784b=stringWidth(_0x8db084),_0x169e15=_0x1e503a*0x1,_0x371036=_0x5495c7-_0x169e15-_0xb2784b-0x1,_0x5323cd=truncateTaskName(_0x56cc67,_0x371036),_0x56af78=_0x3d10eb+_0x5323cd,_0x38337a=stringWidth(_0x56af78),_0x55f6d6=_0x5495c7-_0x38337a-_0xb2784b,_0x23b2c1=_0x56af78+'\x20'[_0x1977c4(0x255)](Math[_0x1977c4(0x1f9)](0x1,_0x55f6d6))+a54_0x1d136b['dim'](_0x8db084),_0x179961=getTaskStateIcon(_0x5d639e[_0x1977c4(0x25c)]),_0x4bce94=new Array(_0x1407a9)[_0x1977c4(0x2af)]('\x20');if(_0x5d639e[_0x1977c4(0x1b7)]){const _0x3c9498=timeToPosition(_0x5d639e[_0x1977c4(0x1b7)][_0x1977c4(0x2f6)],_0x51e509,_0x1407a9),_0x5bace8=timeToPosition(_0x5d639e[_0x1977c4(0x1b7)]['end'],_0x51e509,_0x1407a9),_0xc2ba6f=getBarChar(_0x5d639e[_0x1977c4(0x25c)]),_0x5e7681=Math[_0x1977c4(0x1f9)](_0x3c9498+0x1,_0x5bace8);for(let _0x5bf69c=_0x3c9498;_0x5bf69c<Math[_0x1977c4(0x22b)](_0x5e7681,_0x1407a9);_0x5bf69c++){_0x4bce94[_0x5bf69c]=_0xc2ba6f;}}const _0xdee780=getBarColor(_0x5d639e[_0x1977c4(0x25c)]),_0x4b5082=_0x4bce94[_0x1977c4(0x30c)](_0x273064=>_0x273064==='\x20'?'\x20':_0xdee780(_0x273064))[_0x1977c4(0x1fc)]('');return _0x179961+'\x20'+_0x23b2c1+'│'+_0x4b5082+'│';}function calculateStats(_0x3ae6c3){const _0x4f85cf=a54_0x176df0,_0x4b9f17={'total':_0x3ae6c3[_0x4f85cf(0x24a)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x55d449 of _0x3ae6c3){if(_0x55d449[_0x4f85cf(0x25c)]===_0x4f85cf(0x23f))_0x4b9f17[_0x4f85cf(0x23f)]++;else{if(_0x55d449['state']==='error'||_0x55d449['state']===_0x4f85cf(0x2f7))_0x4b9f17[_0x4f85cf(0x300)]++;else _0x55d449[_0x4f85cf(0x25c)]===_0x4f85cf(0x24d)?_0x4b9f17[_0x4f85cf(0x24d)]++:_0x4b9f17['pending']++;}}return _0x4b9f17;}function formatStats(_0x3f8d4f){const _0x220194=a54_0x176df0;return['Total:\x20'+_0x3f8d4f['total'],'✅\x20'+_0x3f8d4f[_0x220194(0x23f)],'❌\x20'+_0x3f8d4f[_0x220194(0x300)],_0x220194(0x2b9)+_0x3f8d4f[_0x220194(0x24d)],'⏳\x20'+_0x3f8d4f['pending']][_0x220194(0x1fc)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0x176df0(0x20e);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x34e);async[a54_0x176df0(0x2dd)](_0x4e98d4){const _0x306823=a54_0x176df0,{options:_0x4599cb,args:_0x2c8678,tdx:_0x69b87e}=_0x4e98d4;let _0x5d426b,_0x3add94,_0x4c85bc=![];if(_0x2c8678[0x0]){if(_0x2c8678[0x0][_0x306823(0x2cd)]('.')){const _0x3be954=this[_0x306823(0x348)](_0x2c8678,_0x4599cb);if(!_0x3be954)return 0x1;_0x5d426b=_0x3be954['projectName'],_0x3add94=_0x3be954[_0x306823(0x224)];}else{_0x3add94=_0x2c8678[0x0],_0x5d426b=_0x4599cb[_0x306823(0x25d)];if(!_0x5d426b)return console[_0x306823(0x300)](a54_0x1d136b[_0x306823(0x1f8)](_0x306823(0x231)),_0x306823(0x24c)),0x1;_0x4c85bc=!![];}}else{const _0x3d86fc=this['parseProjectWorkflowPattern'](_0x2c8678,_0x4599cb);if(!_0x3d86fc)return 0x1;_0x5d426b=_0x3d86fc['projectName'],_0x3add94=_0x3d86fc[_0x306823(0x224)];}if(_0x4599cb[_0x306823(0x1ac)]){if(_0x5d426b&&_0x3add94)console[_0x306823(0x300)](_0x306823(0x2e0)+_0x5d426b+'.'+_0x3add94);else _0x5d426b&&console[_0x306823(0x300)](_0x306823(0x306)+_0x5d426b);}const _0x552b90=_0x4599cb[_0x306823(0x2b8)],_0x2cf86d=_0x4599cb[_0x306823(0x1c8)];if(_0x552b90){_0x2cf86d&&console[_0x306823(0x300)](a54_0x1d136b[_0x306823(0x2ef)](_0x306823(0x19b)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x5d2d98=_0x4599cb['follow'];return _0x5d2d98?await this[_0x306823(0x2d6)](_0x4e98d4,_0x552b90):await this[_0x306823(0x206)](_0x4e98d4,_0x552b90,_0x4599cb),0x0;}if(_0x2cf86d){const _0x586446=await withSpinner(_0x306823(0x271),()=>_0x69b87e[_0x306823(0x25a)]['sessions']({'projectName':_0x5d426b,'workflowName':_0x3add94,'limit':0x64}),{'verbose':_0x4599cb['verbose']}),_0x4fcf5a=_0x586446[_0x306823(0x2f2)][_0x306823(0x313)](_0x29a149=>_0x29a149['id']===_0x2cf86d);if(!_0x4fcf5a)return console['error'](a54_0x1d136b[_0x306823(0x1f8)](_0x306823(0x231)),_0x306823(0x30b)+_0x2cf86d),0x1;if(!_0x4fcf5a[_0x306823(0x217)]?.['id'])return console[_0x306823(0x300)](a54_0x1d136b['red'](_0x306823(0x231)),_0x306823(0x290)+_0x2cf86d+_0x306823(0x289)),0x1;const _0x2b0c59=_0x4fcf5a[_0x306823(0x217)]['id'];_0x4599cb[_0x306823(0x1ac)]&&console[_0x306823(0x300)]('Using\x20attempt\x20'+_0x2b0c59+'\x20from\x20session\x20'+_0x2cf86d);const _0x4568be=_0x4599cb[_0x306823(0x1d1)];return _0x4568be?await this[_0x306823(0x2d6)](_0x4e98d4,_0x2b0c59):await this[_0x306823(0x206)](_0x4e98d4,_0x2b0c59,_0x4599cb),0x0;}const _0x338258=await withSpinner(_0x306823(0x2e4),()=>_0x69b87e[_0x306823(0x25a)]['sessions']({'projectName':_0x5d426b,'workflowName':_0x3add94,'limit':_0x4599cb[_0x306823(0x29d)]||0x32}),{'verbose':_0x4599cb[_0x306823(0x1ac)]}),_0x43132=_0x338258[_0x306823(0x2f2)];if(_0x43132['length']===0x0){if(_0x5d426b&&_0x3add94)console[_0x306823(0x300)](_0x306823(0x1c7)+_0x5d426b+'.'+_0x3add94);else _0x5d426b?console['error'](_0x306823(0x2f8)+_0x5d426b):(console[_0x306823(0x300)](_0x306823(0x2b0)),console[_0x306823(0x300)](a54_0x1d136b[_0x306823(0x2c5)](_0x306823(0x337))));return 0x0;}_0x43132[_0x306823(0x2c2)]((_0xc2d812,_0x2d8676)=>{const _0x4e687c=_0x306823,_0x4e5dfb=_0xc2d812[_0x4e687c(0x310)]||'',_0x308b36=_0x2d8676[_0x4e687c(0x310)]||'';return _0x308b36[_0x4e687c(0x189)](_0x4e5dfb);});if(_0x4599cb[_0x306823(0x277)]||_0x4599cb['jsonl'])return await handleSDKOutput(_0x43132,_0x4599cb),0x0;let _0x2ccccc;if(_0x4c85bc){const _0x5ee244=_0x43132[0x0];if(!_0x5ee244[_0x306823(0x217)]?.['id'])return console[_0x306823(0x300)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x2ccccc=_0x5ee244[_0x306823(0x217)]['id'],_0x4599cb[_0x306823(0x1ac)]&&console[_0x306823(0x300)](_0x306823(0x1be)+_0x5ee244['sessionTime']);}else{const _0x1f520f=_0x43132[_0x306823(0x30c)](_0x5d29b7=>{const _0x3ba69f=_0x306823,_0x5ee0bc=getAttemptStatusDisplay(_0x5d29b7[_0x3ba69f(0x217)]);return{'title':_0x5d29b7[_0x3ba69f(0x26d)]?.['name']+'.'+_0x5d29b7[_0x3ba69f(0x25a)]?.['name']+_0x3ba69f(0x1e0)+_0x5d29b7[_0x3ba69f(0x310)]+'\x20'+_0x5ee0bc[_0x3ba69f(0x228)],'value':_0x5d29b7[_0x3ba69f(0x217)]?.['id']||'','description':_0x5ee0bc[_0x3ba69f(0x31d)]};}),_0xe06299=await a54_0x3a0313({'type':_0x306823(0x1fb),'name':_0x306823(0x2b8),'message':_0x306823(0x281),'choices':_0x1f520f[_0x306823(0x278)](_0x4f60e6=>_0x4f60e6[_0x306823(0x236)]!=='')});if(!_0xe06299[_0x306823(0x2b8)])return 0x0;_0x2ccccc=_0xe06299[_0x306823(0x2b8)];}const _0x4839b4=_0x4599cb[_0x306823(0x1d1)];return _0x4839b4?await this[_0x306823(0x2d6)](_0x4e98d4,_0x2ccccc):await this['renderSingleTimeline'](_0x4e98d4,_0x2ccccc,_0x4599cb),0x0;}async[a54_0x176df0(0x206)](_0x31ad0e,_0x23e4bf,_0x4c168f){const _0x56de72=a54_0x176df0,{tdx:_0x1fe105}=_0x31ad0e;let _0x258475,_0x43a0bb;try{[_0x258475,_0x43a0bb]=await Promise['all']([_0x1fe105[_0x56de72(0x25a)][_0x56de72(0x245)](_0x23e4bf),_0x1fe105[_0x56de72(0x25a)]['tasks'](_0x23e4bf,![])]);}catch(_0x1f1cd0){console['error'](a54_0x1d136b[_0x56de72(0x1f8)](_0x56de72(0x292)));_0x4c168f[_0x56de72(0x1ac)]&&console[_0x56de72(0x300)](_0x1f1cd0);throw _0x1f1cd0;}if(_0x4c168f[_0x56de72(0x277)]||_0x4c168f[_0x56de72(0x274)]){const _0x55b63a=this[_0x56de72(0x342)](_0x258475,_0x43a0bb);await handleSDKOutput([_0x55b63a],_0x4c168f);return;}const _0x5aaa74=_0x1fe105[_0x56de72(0x1e5)][_0x56de72(0x2aa)],_0x5f3680=this[_0x56de72(0x311)](_0x258475,_0x43a0bb,_0x5aaa74);console[_0x56de72(0x2bd)](_0x5f3680);}async[a54_0x176df0(0x2d6)](_0x2fbd71,_0xb0cf6f){const _0x26eaf8=a54_0x176df0,{tdx:_0x57585a}=_0x2fbd71,_0x503233=TIMELINE_CONFIG[_0x26eaf8(0x2ad)],_0x170f0a=TIMELINE_CONFIG[_0x26eaf8(0x1bf)];let _0x1a6e5f=0x0;while(_0x1a6e5f<_0x170f0a){process['stdout'][_0x26eaf8(0x346)]&&process[_0x26eaf8(0x1fd)]['write']('\x1bc');let _0x50cf5d,_0x7bd592;try{[_0x50cf5d,_0x7bd592]=await Promise[_0x26eaf8(0x1a3)]([_0x57585a[_0x26eaf8(0x25a)]['attempt'](_0xb0cf6f),_0x57585a['workflow'][_0x26eaf8(0x261)](_0xb0cf6f,![])]);}catch(_0x20688c){console[_0x26eaf8(0x300)](a54_0x1d136b[_0x26eaf8(0x1f8)](_0x26eaf8(0x1f3)));_0x1a6e5f>0x0&&console['error'](a54_0x1d136b[_0x26eaf8(0x2c5)](_0x26eaf8(0x29f)+_0x1a6e5f));throw _0x20688c;}const _0x160287=_0x57585a[_0x26eaf8(0x1e5)][_0x26eaf8(0x2aa)],_0x1096dd=this[_0x26eaf8(0x311)](_0x50cf5d,_0x7bd592,_0x160287);console[_0x26eaf8(0x2bd)](_0x1096dd);const _0x461078=_0x50cf5d['done']&&_0x7bd592[_0x26eaf8(0x31a)](_0x4646ca=>_0x4646ca[_0x26eaf8(0x25c)]!==_0x26eaf8(0x24d)&&_0x4646ca[_0x26eaf8(0x25c)]!==_0x26eaf8(0x2be));if(_0x461078){console[_0x26eaf8(0x300)](a54_0x1d136b[_0x26eaf8(0x248)](_0x26eaf8(0x1da)));break;}console[_0x26eaf8(0x300)](a54_0x1d136b[_0x26eaf8(0x2c5)]('\x0aPolling...\x20('+_0x1a6e5f*0x2+_0x26eaf8(0x197))),await new Promise(_0x435370=>setTimeout(_0x435370,_0x503233)),_0x1a6e5f++;}_0x1a6e5f>=_0x170f0a&&console['error'](a54_0x1d136b[_0x26eaf8(0x2ef)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x176df0(0x311)](_0x7ea6d3,_0x30e80e,_0x508d50){const _0x118df5=a54_0x176df0,_0x18ffae=[],_0x24c74a=TIMELINE_CONFIG[_0x118df5(0x21a)],_0x57a521=0x5,_0x4f0f62=process[_0x118df5(0x1fd)][_0x118df5(0x2c0)]||0x78,_0x3c7151=_0x4f0f62-_0x24c74a-_0x57a521,_0x1ee7cb=Math[_0x118df5(0x1f9)](TIMELINE_CONFIG[_0x118df5(0x29a)],Math[_0x118df5(0x22b)](_0x3c7151,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x2a5917=new Date(_0x7ea6d3['createdAt'])['getTime'](),_0x59faab=_0x7ea6d3['finishedAt']?new Date(_0x7ea6d3[_0x118df5(0x2bb)])['getTime']():Date[_0x118df5(0x1af)](),_0x2d180a={'start':_0x2a5917,'end':_0x59faab,'duration':_0x59faab-_0x2a5917},_0x3e02fc=new Map(),_0x5bf9fc=[];for(const _0x411913 of _0x30e80e){if(_0x411913[_0x118df5(0x301)]){const _0x4f62c4=new Date(_0x411913['startedAt'])['getTime'](),_0x377c93=_0x411913['updatedAt']?new Date(_0x411913[_0x118df5(0x1dc)])['getTime']():Date[_0x118df5(0x1af)](),_0x40d805={'start':_0x4f62c4,'end':_0x377c93,'duration':_0x377c93-_0x4f62c4};_0x3e02fc[_0x118df5(0x1cb)](_0x411913['id'],_0x40d805),_0x5bf9fc[_0x118df5(0x30d)]({'name':_0x411913[_0x118df5(0x316)],'state':_0x411913[_0x118df5(0x25c)]||_0x118df5(0x354),'window':_0x40d805});}else _0x5bf9fc['push']({'name':_0x411913[_0x118df5(0x316)],'state':_0x411913[_0x118df5(0x25c)]||_0x118df5(0x2be),'window':undefined});}_0x5bf9fc[_0x118df5(0x2c2)]((_0x5061fe,_0x477d4a)=>{const _0x50cb63=_0x118df5;if(!_0x5061fe[_0x50cb63(0x1b7)])return 0x1;if(!_0x477d4a[_0x50cb63(0x1b7)])return-0x1;return _0x5061fe[_0x50cb63(0x1b7)][_0x50cb63(0x2f6)]-_0x477d4a['window']['start'];});const _0x3e9931=_0x5bf9fc['length'],_0x3f7fc0=_0x3e9931>TIMELINE_CONFIG[_0x118df5(0x287)];_0x3f7fc0&&_0x5bf9fc[_0x118df5(0x2a3)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x1b047e=calculateTimeScale(_0x2d180a,_0x1ee7cb),_0x29a347=_0x7ea6d3[_0x118df5(0x21d)]?_0x7ea6d3[_0x118df5(0x23f)]?a54_0x1d136b[_0x118df5(0x248)]('success'):a54_0x1d136b[_0x118df5(0x1f8)](_0x118df5(0x300)):a54_0x1d136b[_0x118df5(0x2b4)](_0x118df5(0x24d)),_0x12e941=_0x7ea6d3[_0x118df5(0x26d)]?.['id'],_0x504d08=_0x7ea6d3[_0x118df5(0x1c8)];let _0x4b374b;if(_0x12e941&&_0x504d08){const _0x1fffe9=getWorkflowAttemptUrl(_0x508d50,_0x12e941,_0x504d08,_0x7ea6d3['id']);_0x4b374b=hyperlink(a54_0x1d136b['dim'](_0x7ea6d3['id']),_0x1fffe9);}else _0x4b374b=a54_0x1d136b[_0x118df5(0x2c5)](_0x7ea6d3['id']);_0x18ffae[_0x118df5(0x30d)](_0x118df5(0x32a)+_0x4b374b+_0x118df5(0x1e0)+_0x29a347+_0x118df5(0x1e0)+formatElapsed(_0x2d180a[_0x118df5(0x2a2)]));if(_0x5bf9fc[_0x118df5(0x24a)]>0x0){const _0x5c9faa=renderTimeAxis(_0x1b047e,_0x1ee7cb),_0x52b0d5=new Date(_0x2d180a[_0x118df5(0x2f6)]),_0x5f2217=formatDate(_0x52b0d5),_0x4293e4=TIMELINE_CONFIG[_0x118df5(0x2fc)]+TIMELINE_CONFIG[_0x118df5(0x2a1)]+_0x24c74a,_0x39bd3d=_0x5f2217[_0x118df5(0x26e)](_0x4293e4),_0x3e7d04=a54_0x1d136b[_0x118df5(0x2c5)](_0x39bd3d);_0x18ffae[_0x118df5(0x30d)](_0x3e7d04+'\x20'+_0x5c9faa);for(const _0x45077a of _0x5bf9fc){_0x18ffae['push'](renderTaskRow(_0x45077a,_0x1b047e,_0x1ee7cb,_0x24c74a));}const _0x37dfdf=calculateStats(_0x5bf9fc);_0x18ffae['push'](formatStats(_0x37dfdf)),_0x3f7fc0&&_0x18ffae[_0x118df5(0x30d)](a54_0x1d136b[_0x118df5(0x2ef)](_0x118df5(0x2df)+TIMELINE_CONFIG[_0x118df5(0x287)]+_0x118df5(0x1b2)+_0x3e9931+_0x118df5(0x334))),_0x18ffae[_0x118df5(0x30d)](''),_0x18ffae[_0x118df5(0x30d)](a54_0x1d136b[_0x118df5(0x2c5)](_0x118df5(0x318))+('tdx\x20wf\x20attempt\x20'+_0x7ea6d3['id']+_0x118df5(0x283))+a54_0x1d136b[_0x118df5(0x2c5)]('\x20to\x20see\x20detailed\x20logs'));}else _0x18ffae[_0x118df5(0x30d)](_0x118df5(0x188));return _0x18ffae['join']('\x0a');}[a54_0x176df0(0x342)](_0x4a88c0,_0x252d0e){const _0x324058=a54_0x176df0,_0x350c1d=new Date(_0x4a88c0[_0x324058(0x2d1)])['getTime'](),_0x56ef67=_0x4a88c0[_0x324058(0x2bb)]?new Date(_0x4a88c0[_0x324058(0x2bb)])[_0x324058(0x1e9)]():Date['now'](),_0x2fb90e=_0x56ef67-_0x350c1d,_0xfc7aa0=[];for(const _0x449487 of _0x252d0e){if(_0x449487[_0x324058(0x301)]){const _0x5214fb=new Date(_0x449487[_0x324058(0x301)])[_0x324058(0x1e9)](),_0x38e776=_0x449487[_0x324058(0x1dc)]?new Date(_0x449487[_0x324058(0x1dc)])[_0x324058(0x1e9)]():Date[_0x324058(0x1af)]();_0xfc7aa0['push']({'name':_0x449487[_0x324058(0x316)],'state':_0x449487[_0x324058(0x25c)]||_0x324058(0x354),'window':{'start':_0x5214fb,'end':_0x38e776,'duration':_0x38e776-_0x5214fb}});}else _0xfc7aa0[_0x324058(0x30d)]({'name':_0x449487[_0x324058(0x316)],'state':_0x449487[_0x324058(0x25c)]||'planned','window':undefined});}const _0x66f6b=calculateStats(_0xfc7aa0);return{'attempt':{'id':_0x4a88c0['id'],'status':_0x4a88c0[_0x324058(0x21d)]?_0x4a88c0[_0x324058(0x23f)]?'success':_0x324058(0x300):'running','createdAt':_0x4a88c0[_0x324058(0x2d1)],'finishedAt':_0x4a88c0[_0x324058(0x2bb)],'duration_ms':_0x2fb90e},'tasks':_0xfc7aa0[_0x324058(0x30c)](_0x32d4c9=>({'name':_0x32d4c9[_0x324058(0x2e3)],'state':_0x32d4c9[_0x324058(0x25c)],'startedAt':_0x32d4c9[_0x324058(0x1b7)]?new Date(_0x32d4c9[_0x324058(0x1b7)]['start'])[_0x324058(0x1a5)]():null,'updatedAt':_0x32d4c9[_0x324058(0x1b7)]?new Date(_0x32d4c9[_0x324058(0x1b7)][_0x324058(0x19e)])['toISOString']():null,'duration_ms':_0x32d4c9[_0x324058(0x1b7)]?.[_0x324058(0x2a2)]||null})),'stats':_0x66f6b};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x1b4);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x243);async['execute'](_0x237ccb){const _0x51ebb0=a54_0x176df0,{options:_0x1153fd,tdx:_0x50279f}=_0x237ccb,_0x52e310=await withSpinner(_0x51ebb0(0x265),()=>_0x50279f[_0x51ebb0(0x25a)]['listSchedules'](),{'verbose':_0x1153fd[_0x51ebb0(0x1ac)]}),_0x22bc8b=_0x52e310[_0x51ebb0(0x2f2)];console['error'](_0x51ebb0(0x254)+_0x22bc8b[_0x51ebb0(0x24a)]+_0x51ebb0(0x262)+(_0x22bc8b['length']!==0x1?'s':''));if(isStructuredFormat(_0x1153fd))await handleSDKOutput(_0x22bc8b,_0x1153fd);else{if(_0x22bc8b[_0x51ebb0(0x24a)]===0x0)console[_0x51ebb0(0x2bd)](_0x51ebb0(0x304));else for(const _0x49fe4e of _0x22bc8b){const _0x45b03b=_0x49fe4e[_0x51ebb0(0x2d4)]?a54_0x1d136b[_0x51ebb0(0x2ef)](_0x51ebb0(0x191)):'',_0xcc4988=_0x49fe4e['project']?.['name']?a54_0x1d136b[_0x51ebb0(0x2c5)]('\x20['+_0x49fe4e[_0x51ebb0(0x26d)]['name']+']'):'',_0x14d484=_0x49fe4e[_0x51ebb0(0x1ca)]?a54_0x1d136b[_0x51ebb0(0x2c5)](_0x51ebb0(0x272)+new Date(_0x49fe4e[_0x51ebb0(0x1ca)])[_0x51ebb0(0x1bc)]()):'';console[_0x51ebb0(0x2bd)](_0x51ebb0(0x350)+_0x49fe4e['id']+'\x20'+(_0x49fe4e[_0x51ebb0(0x25a)]?.[_0x51ebb0(0x2e3)]||_0x51ebb0(0x2fe))+_0xcc4988+_0x45b03b+_0x14d484);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']='workflow:schedule:enable';['description']=a54_0x176df0(0x331);async[a54_0x176df0(0x2dd)](_0x278096){const _0x27f15c=a54_0x176df0,{options:_0x23a80a,args:_0x5b60eb,tdx:_0x1ebc2e}=_0x278096,_0x4ef912=_0x5b60eb[0x0];if(!_0x4ef912)return console[_0x27f15c(0x300)](a54_0x1d136b[_0x27f15c(0x1f8)](_0x27f15c(0x231)),_0x27f15c(0x2a0)),console[_0x27f15c(0x300)](a54_0x1d136b['dim'](_0x27f15c(0x1e8))),console[_0x27f15c(0x300)](a54_0x1d136b[_0x27f15c(0x2c5)](_0x27f15c(0x270))),0x1;const _0x278159=await withSpinner('Enabling\x20schedule\x20#'+_0x4ef912+_0x27f15c(0x34c),()=>_0x1ebc2e[_0x27f15c(0x25a)][_0x27f15c(0x215)](_0x4ef912),{'verbose':_0x23a80a[_0x27f15c(0x1ac)]}),_0x41a5ef=_0x278159[_0x27f15c(0x2f2)];return isStructuredFormat(_0x23a80a)?await handleSingleObjectOutput(_0x41a5ef,_0x23a80a):(console[_0x27f15c(0x2bd)]('✔\x20Schedule\x20#'+_0x4ef912+_0x27f15c(0x2f4)+(_0x41a5ef[_0x27f15c(0x25a)]?.[_0x27f15c(0x2e3)]||'unknown')+')'),_0x41a5ef[_0x27f15c(0x1ca)]&&console['log'](a54_0x1d136b[_0x27f15c(0x2c5)](_0x27f15c(0x234)+new Date(_0x41a5ef[_0x27f15c(0x1ca)])[_0x27f15c(0x1bc)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x176df0(0x2e3)]=a54_0x176df0(0x247);[a54_0x176df0(0x2a7)]=a54_0x176df0(0x26f);async[a54_0x176df0(0x2dd)](_0x4aa26e){const _0x597d73=a54_0x176df0,{options:_0x23e5f9,args:_0x2ec81d,tdx:_0x7aefdf}=_0x4aa26e,_0x12b5c7=_0x2ec81d[0x0];if(!_0x12b5c7)return console[_0x597d73(0x300)](a54_0x1d136b[_0x597d73(0x1f8)](_0x597d73(0x231)),_0x597d73(0x2a0)),console[_0x597d73(0x300)](a54_0x1d136b[_0x597d73(0x2c5)](_0x597d73(0x22c))),console[_0x597d73(0x300)](a54_0x1d136b[_0x597d73(0x2c5)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x2698fd=await withSpinner(_0x597d73(0x28d)+_0x12b5c7+_0x597d73(0x34c),()=>_0x7aefdf[_0x597d73(0x25a)][_0x597d73(0x211)](_0x12b5c7),{'verbose':_0x23e5f9['verbose']}),_0x3112c5=_0x2698fd['data'];return isStructuredFormat(_0x23e5f9)?await handleSingleObjectOutput(_0x3112c5,_0x23e5f9):console[_0x597d73(0x2bd)]('✔\x20Schedule\x20#'+_0x12b5c7+_0x597d73(0x27a)+(_0x3112c5[_0x597d73(0x25a)]?.[_0x597d73(0x2e3)]||'unknown')+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40fc2b,_0x298c12){const _0x2671d8=a55_0x3632,_0x2c5e46=_0x40fc2b();while(!![]){try{const _0x2f1bc8=-parseInt(_0x2671d8(0xab))/0x1+-parseInt(_0x2671d8(0xbd))/0x2+parseInt(_0x2671d8(0xb4))/0x3*(-parseInt(_0x2671d8(0xb1))/0x4)+-parseInt(_0x2671d8(0xae))/0x5+parseInt(_0x2671d8(0xb7))/0x6+parseInt(_0x2671d8(0xad))/0x7+-parseInt(_0x2671d8(0xb5))/0x8*(-parseInt(_0x2671d8(0xaf))/0x9);if(_0x2f1bc8===_0x298c12)break;else _0x2c5e46['push'](_0x2c5e46['shift']());}catch(_0x110919){_0x2c5e46['push'](_0x2c5e46['shift']());}}}(a55_0x5c3a,0x2abed));import{platform}from'os';function a55_0x3632(_0x258e21,_0x4b9449){_0x258e21=_0x258e21-0xab;const _0x5c3a87=a55_0x5c3a();let _0x3632dc=_0x5c3a87[_0x258e21];return _0x3632dc;}import{getAPIKey}from'./config.js';function a55_0x5c3a(){const _0x32a960=['963vpmNrD','X-Trino-User','21596eAXCSt','Bearer\x20','length','99OBCvso','35920KEvmNO','entries','620364feLKvE','tdx',';\x20node/','TD1\x20','Authorization','version','304328zwRKkn','155740WoaGmC','replace','1662836zsipOH','801080MRwsOh'];a55_0x5c3a=function(){return _0x32a960;};return a55_0x5c3a();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2b091a=a55_0x3632,_0xd64ed6=getVersion(),_0x37ff7c=platform(),_0x24797d=process[_0x2b091a(0xbc)][_0x2b091a(0xac)]('v','');return'tdx/'+_0xd64ed6+'\x20('+_0x37ff7c+_0x2b091a(0xb9)+_0x24797d+')';}export function getAuthHeaders(_0x4e5c4c,_0x159fe8,_0x492ce1){const _0x8faf0a=a55_0x3632,_0x2eba62=getVersion(),_0x37674f={'User-Agent':getUserAgent(),'X-TD-Client':_0x8faf0a(0xb8),'X-TD-Client-Version':_0x2eba62};if(_0x492ce1)_0x37674f[_0x8faf0a(0xbb)]=_0x8faf0a(0xb2)+_0x492ce1;else _0x159fe8&&(_0x37674f['Authorization']=_0x8faf0a(0xba)+_0x159fe8);return _0x37674f;}export function toHeaderRecord(_0x28e053){const _0x506397=a55_0x3632,_0x567ab7={};for(const [_0x3ae27b,_0x34c3e2]of Object[_0x506397(0xb6)](_0x28e053)){_0x34c3e2!==undefined&&(_0x567ab7[_0x3ae27b]=_0x34c3e2);}return _0x567ab7;}export function getTrinoHeaders(_0x3088e1,_0x1dfb5f,_0x5e1470){const _0x3f71f5=a55_0x3632,_0x27d9fe=getAuthHeaders(_0x3088e1),_0x4db74c=toHeaderRecord(_0x27d9fe);if(_0x5e1470)_0x4db74c[_0x3f71f5(0xbb)]=_0x3f71f5(0xb2)+_0x5e1470;else _0x1dfb5f&&(_0x4db74c[_0x3f71f5(0xb0)]=_0x1dfb5f);return _0x4db74c;}export function hasAPIKey(_0x345d1a){const _0x1d65e1=a55_0x3632,_0x2bdd13=getAPIKey();return _0x2bdd13!==undefined&&_0x2bdd13[_0x1d65e1(0xb3)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4032ed,_0xd86dbf){const _0xfa39d1=a56_0x5ba8,_0x5f0c64=_0x4032ed();while(!![]){try{const _0x34243a=-parseInt(_0xfa39d1(0x1a5))/0x1+parseInt(_0xfa39d1(0x1a3))/0x2+-parseInt(_0xfa39d1(0x1b6))/0x3+parseInt(_0xfa39d1(0x1b3))/0x4+parseInt(_0xfa39d1(0x191))/0x5+-parseInt(_0xfa39d1(0x193))/0x6+parseInt(_0xfa39d1(0x1bf))/0x7;if(_0x34243a===_0xd86dbf)break;else _0x5f0c64['push'](_0x5f0c64['shift']());}catch(_0x4191dd){_0x5f0c64['push'](_0x5f0c64['shift']());}}}(a56_0x5de9,0x8cd1e));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x45f37f from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x32e82e){const _0xc54685=a56_0x5ba8;return _0x32e82e[_0xc54685(0x19b)]===_0xc54685(0x1ae)||_0x32e82e['format']===_0xc54685(0x1c6)||_0x32e82e['format']===_0xc54685(0x195)||_0x32e82e[_0xc54685(0x19b)]===_0xc54685(0x1a9)||_0x32e82e[_0xc54685(0x1ae)]===!![]||_0x32e82e['jsonl']===!![]||_0x32e82e['tsv']===!![]||_0x32e82e[_0xc54685(0x1a9)]===!![];}export function parseOutputOptions(_0x492da9){const _0x56de07=a56_0x5ba8;return{'format':_0x492da9['format']||_0x56de07(0x1a9),'output':_0x492da9['output']||'','limit':_0x492da9[_0x56de07(0x1c1)],'limitStructuredFormats':_0x492da9[_0x56de07(0x1a6)],'color':_0x492da9[_0x56de07(0x1a8)],'noColor':_0x492da9[_0x56de07(0x1be)]};}function convertSDKResultToQueryResult(_0x2c2721){const _0x46e6f2=a56_0x5ba8,_0xcb6967=[];if(_0x2c2721[_0x46e6f2(0x1b4)]>0x0){const _0x29db03=_0x2c2721[0x0];for(const [_0x3f6d16,_0x1d577f]of Object['entries'](_0x29db03)){let _0xd7f7f3=_0x46e6f2(0x1a7);if(typeof _0x1d577f===_0x46e6f2(0x19e))_0xd7f7f3=Number['isInteger'](_0x1d577f)?_0x46e6f2(0x18f):_0x46e6f2(0x1cc);else{if(typeof _0x1d577f===_0x46e6f2(0x1d0))_0xd7f7f3=_0x46e6f2(0x1d0);else _0x1d577f===null&&(_0xd7f7f3='varchar');}_0xcb6967[_0x46e6f2(0x19f)]({'name':_0x3f6d16,'type':_0xd7f7f3});}}return{'queryId':_0x46e6f2(0x1af),'columns':_0xcb6967,'data':_0x2c2721,'stats':{'state':_0x46e6f2(0x1a1),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2c2721[_0x46e6f2(0x1b4)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x587755,_0x30a26b){const _0x5139eb=convertSDKResultToQueryResult(_0x587755);return formatQueryOutput(_0x5139eb,_0x30a26b);}export async function formatQueryOutput(_0x3eb996,_0xd4e501){const _0x2d3151=a56_0x5ba8,{format:_0x2a6794,limit:_0xabbbcb,output:_0xcd37bb,color:_0x16df97,noColor:_0x15979b,limitStructuredFormats:_0x36aca7}=_0xd4e501,_0x182385=Boolean(_0xcd37bb)&&!_0x16df97,_0x436636={'color':_0x16df97,'noColor':_0x15979b||_0x182385};if(_0x2a6794===_0x2d3151(0x1a9)){const _0x2426f3=shouldUseLess(_0x2a6794,_0xcd37bb);return formatAsTable(_0x3eb996,_0xabbbcb,_0x2426f3,_0x436636);}const _0x247360=_0x36aca7&&Number[_0x2d3151(0x1d6)](_0xabbbcb)&&_0x3eb996[_0x2d3151(0x190)]['length']>_0xabbbcb?{..._0x3eb996,'data':_0x3eb996[_0x2d3151(0x190)][_0x2d3151(0x1a0)](0x0,_0xabbbcb)}:_0x3eb996;if(_0x2a6794==='json')return formatAsJSON(_0x247360,_0x436636);else return _0x2a6794===_0x2d3151(0x1c6)?formatAsJSONL(_0x247360,_0x436636):formatQueryResult(_0x247360,_0x2a6794);}function a56_0x5ba8(_0x467a53,_0x5f186f){_0x467a53=_0x467a53-0x18f;const _0x5de95e=a56_0x5de9();let _0x5ba822=_0x5de95e[_0x467a53];return _0x5ba822;}function shouldUseLess(_0x5f0e8c,_0x507abb){const _0x27d1d7=a56_0x5ba8;return(_0x5f0e8c===_0x27d1d7(0x1a9)||_0x5f0e8c===_0x27d1d7(0x1b2))&&process[_0x27d1d7(0x1b5)][_0x27d1d7(0x1d8)]&&!_0x507abb;}export function resolveOutputOptions(_0xc3badb){const _0xf295e3=a56_0x5ba8,_0x5d7b2e=_0xc3badb[_0xf295e3(0x1cf)]||'',_0xe9f104=resolveOutputFormat(_0xc3badb[_0xf295e3(0x19b)],_0x5d7b2e,_0xf295e3(0x1a9));let _0x4f1ec9=typeof _0xc3badb['limit']===_0xf295e3(0x19e)?_0xc3badb[_0xf295e3(0x1c1)]:parseInt(_0xc3badb['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0xc3badb[_0xf295e3(0x1c1)]===undefined&&shouldUseLess(_0xe9f104,_0x5d7b2e)&&(_0x4f1ec9=Infinity),{'format':_0xe9f104,'output':_0x5d7b2e,'limit':_0x4f1ec9,'limitStructuredFormats':_0xc3badb[_0xf295e3(0x1a6)],'color':_0xc3badb[_0xf295e3(0x1a8)],'noColor':_0xc3badb[_0xf295e3(0x1be)]};}function a56_0x5de9(){const _0x50ecba=['stderr','error','padEnd','join','bold','noColor','1189314pVQsZS','less','limit','yellow','red','query','[error]','jsonl','end','resolve','─┴─','string','entries','double','max','inherit','output','boolean','stringify','[logs]','trim','params','keys','isFinite','split','isTTY','bigint','data','4186265bmyQYP','[params]','3667986wtnWdn','filter','tsv','cyan','cmdout','forEach','[rule]','map','format','object','[query]','number','push','slice','FINISHED','pipe','774354oPnNSZ','Results\x20saved\x20to\x20','602678KPzdoM','limitStructuredFormats','varchar','color','table','debug','-FXRSn','[Object]','write','json','sdk-result','repeat','log','list','1973868CHYkLk','length','stdout','290976OxYFvb','rule','stdin'];a56_0x5de9=function(){return _0x50ecba;};return a56_0x5de9();}export function writeOutput(_0x49f226,_0x4838c1,_0xe31905){const _0x40fc02=a56_0x5ba8;return _0x4838c1?(writeFileSync(_0x4838c1,_0x49f226),console[_0x40fc02(0x1ba)](_0x40fc02(0x1a4)+_0x4838c1),Promise[_0x40fc02(0x1c8)]()):shouldUseLess(_0xe31905||'','')?new Promise(_0x5ce288=>{const _0x3ddf67=_0x40fc02,_0x2c7760=spawn(_0x3ddf67(0x1c0),[_0x3ddf67(0x1ab)],{'stdio':[_0x3ddf67(0x1a2),_0x3ddf67(0x1ce),_0x3ddf67(0x1ce)]});let _0x14d6f9=![];_0x2c7760['on'](_0x3ddf67(0x1ba),()=>{const _0x2a6fd8=_0x3ddf67;!_0x14d6f9&&(_0x14d6f9=!![],console[_0x2a6fd8(0x1b1)](_0x49f226),_0x5ce288());}),_0x2c7760['on']('close',()=>{!_0x14d6f9&&(_0x14d6f9=!![],_0x5ce288());}),_0x2c7760['on']('spawn',()=>{const _0x1218e3=_0x3ddf67;!_0x14d6f9&&_0x2c7760[_0x1218e3(0x1b8)]&&(_0x2c7760[_0x1218e3(0x1b8)]['on'](_0x1218e3(0x1ba),()=>{}),_0x2c7760[_0x1218e3(0x1b8)][_0x1218e3(0x1ad)](_0x49f226),_0x2c7760[_0x1218e3(0x1b8)][_0x1218e3(0x1c7)]());}),!_0x2c7760['stdin']&&(!_0x14d6f9&&(_0x14d6f9=!![],console[_0x3ddf67(0x1b1)](_0x49f226),_0x5ce288()));}):(console[_0x40fc02(0x1b1)](_0x49f226),Promise[_0x40fc02(0x1c8)]());}export async function handleSDKOutput(_0x28d544,_0x549afa){const _0xe1044a=a56_0x5ba8,_0x5e9528=resolveOutputOptions(_0x549afa),_0x496aef=await formatSDKOutput(_0x28d544,_0x5e9528);await writeOutput(_0x496aef,_0x5e9528[_0xe1044a(0x1cf)]||undefined,_0x5e9528[_0xe1044a(0x19b)]);}export async function handleQueryOutput(_0x511836,_0x35d6d0){const _0x39e8b3=a56_0x5ba8,_0xe44916=resolveOutputOptions(_0x35d6d0),_0x1ed147=await formatQueryOutput(_0x511836,_0xe44916);await writeOutput(_0x1ed147,_0xe44916[_0x39e8b3(0x1cf)]||undefined,_0xe44916[_0x39e8b3(0x19b)]);}async function formatSingleObject(_0xcc6f6a,_0x2b58df){const _0x55a2c7=a56_0x5ba8,{format:_0x4bb5fa,color:_0x58f814,noColor:_0x5de516}=_0x2b58df,_0x3e25f9={'color':_0x58f814,'noColor':_0x5de516};if(_0x4bb5fa===_0x55a2c7(0x1ae)){if(shouldUseColor(_0x3e25f9))return colorizeJSON(_0xcc6f6a,_0x3e25f9);return JSON[_0x55a2c7(0x1d1)](_0xcc6f6a,null,0x2);}else{if(_0x4bb5fa===_0x55a2c7(0x1c6)){if(shouldUseColor(_0x3e25f9))return colorizeJSONCompact(_0xcc6f6a,_0x3e25f9);return JSON[_0x55a2c7(0x1d1)](_0xcc6f6a);}else{if(_0x4bb5fa===_0x55a2c7(0x195))return Object['entries'](_0xcc6f6a)[_0x55a2c7(0x19a)](([_0x2b5e2b,_0x18b8f4])=>_0x2b5e2b+'\x09'+_0x18b8f4)[_0x55a2c7(0x1bc)]('\x0a');else{const _0x4dd8d3=Object[_0x55a2c7(0x1cb)](_0xcc6f6a);if(_0x4dd8d3[_0x55a2c7(0x1b4)]===0x0)return'No\x20data';const _0x2797cb=_0xcc6f6a['debug'],_0x4ee0f3=_0xcc6f6a[_0x55a2c7(0x1c4)],_0x5cdab8=_0xcc6f6a[_0x55a2c7(0x1d4)],_0x35229d=_0xcc6f6a[_0x55a2c7(0x1b7)],_0x34a0b2=_0x4ee0f3?typeof _0x4ee0f3===_0x55a2c7(0x1ca)?_0x4ee0f3:JSON[_0x55a2c7(0x1d1)](_0x4ee0f3,null,0x2):undefined,_0x3aa261=_0x5cdab8&&Object[_0x55a2c7(0x1d5)](_0x5cdab8)[_0x55a2c7(0x1b4)]>0x0?JSON[_0x55a2c7(0x1d1)](_0x5cdab8,null,0x2):undefined,_0x38e944=_0x35229d&&Object[_0x55a2c7(0x1d5)](_0x35229d)['length']>0x0?JSON[_0x55a2c7(0x1d1)](_0x35229d,null,0x2):undefined,_0x1778d3=_0x4dd8d3[_0x55a2c7(0x194)](([_0x4d5433])=>_0x4d5433!==_0x55a2c7(0x1aa)&&_0x4d5433!=='query'&&_0x4d5433!=='params'&&_0x4d5433!==_0x55a2c7(0x1b7)),_0x4ba569=Math[_0x55a2c7(0x1cd)](..._0x1778d3[_0x55a2c7(0x19a)](([_0x4c0615])=>_0x4c0615['length'])),_0x26688d=Math[_0x55a2c7(0x1cd)](..._0x1778d3[_0x55a2c7(0x19a)](([,_0x34e2ab])=>{const _0x2a2b62=_0x55a2c7;try{const _0x36d2cb=_0x34e2ab===null||_0x34e2ab===undefined?'':typeof _0x34e2ab===_0x2a2b62(0x19c)?JSON[_0x2a2b62(0x1d1)](_0x34e2ab):String(_0x34e2ab),_0x1d79bc=_0x36d2cb[_0x2a2b62(0x1d7)]('\x0a');return Math[_0x2a2b62(0x1cd)](..._0x1d79bc['map'](_0x7919eb=>_0x7919eb[_0x2a2b62(0x1b4)]),0x0);}catch{return 0x0;}}),0x14),_0x51ad7f=[];_0x51ad7f['push'](colorBorder('┌─'+'─'['repeat'](_0x4ba569)+'─┬─'+'─'[_0x55a2c7(0x1b0)](_0x26688d)+'─┐',_0x3e25f9)),_0x1778d3[_0x55a2c7(0x198)](([_0xf29aa4,_0x3c5955])=>{const _0x177c47=_0x55a2c7;let _0x3ecf0e;try{_0x3ecf0e=_0x3c5955===null||_0x3c5955===undefined?'':typeof _0x3c5955===_0x177c47(0x19c)?JSON[_0x177c47(0x1d1)](_0x3c5955):String(_0x3c5955);}catch{_0x3ecf0e=_0x177c47(0x1ac);}const _0x2cfc04=_0xf29aa4['padEnd'](_0x4ba569),_0x405017=_0x3ecf0e[_0x177c47(0x1d7)]('\x0a');_0x405017[_0x177c47(0x198)]((_0x228652,_0x39d516)=>{const _0x6bb5c3=_0x177c47,_0x1df07e=colorBorder('│',_0x3e25f9);_0x39d516===0x0?_0x51ad7f[_0x6bb5c3(0x19f)](_0x1df07e+'\x20'+_0x2cfc04+'\x20'+_0x1df07e+'\x20'+_0x228652[_0x6bb5c3(0x1bb)](_0x26688d)+'\x20'+_0x1df07e):_0x51ad7f[_0x6bb5c3(0x19f)](_0x1df07e+'\x20'+'\x20'[_0x6bb5c3(0x1b0)](_0x4ba569)+'\x20'+_0x1df07e+'\x20'+_0x228652[_0x6bb5c3(0x1bb)](_0x26688d)+'\x20'+_0x1df07e);});}),_0x51ad7f[_0x55a2c7(0x19f)](colorBorder('└─'+'─'[_0x55a2c7(0x1b0)](_0x4ba569)+_0x55a2c7(0x1c9)+'─'['repeat'](_0x26688d)+'─┘',_0x3e25f9));_0x34a0b2&&(_0x51ad7f[_0x55a2c7(0x19f)](''),_0x51ad7f[_0x55a2c7(0x19f)](String(a56_0x45f37f[_0x55a2c7(0x1c2)][_0x55a2c7(0x1bd)](_0x55a2c7(0x19d)))),_0x51ad7f[_0x55a2c7(0x19f)](_0x34a0b2));_0x3aa261&&(_0x51ad7f[_0x55a2c7(0x19f)](''),_0x51ad7f[_0x55a2c7(0x19f)](String(a56_0x45f37f['blue'][_0x55a2c7(0x1bd)](_0x55a2c7(0x192)))),_0x51ad7f[_0x55a2c7(0x19f)](_0x3aa261));_0x38e944&&(_0x51ad7f[_0x55a2c7(0x19f)](''),_0x51ad7f[_0x55a2c7(0x19f)](String(a56_0x45f37f['magenta']['bold'](_0x55a2c7(0x199)))),_0x51ad7f[_0x55a2c7(0x19f)](_0x38e944));if(_0x2797cb){if(_0x2797cb[_0x55a2c7(0x1b9)]){_0x51ad7f[_0x55a2c7(0x19f)](''),_0x51ad7f[_0x55a2c7(0x19f)](String(a56_0x45f37f[_0x55a2c7(0x1c3)][_0x55a2c7(0x1bd)](_0x55a2c7(0x1c5))));const _0x12fda9=_0x2797cb[_0x55a2c7(0x1b9)][_0x55a2c7(0x1d7)]('\x0a');_0x12fda9[_0x55a2c7(0x198)](_0x471cd3=>{const _0x172f0c=_0x55a2c7;_0x471cd3[_0x172f0c(0x1d3)]()&&_0x51ad7f[_0x172f0c(0x19f)](_0x471cd3);});}if(_0x2797cb['cmdout']){_0x51ad7f['push'](''),_0x51ad7f[_0x55a2c7(0x19f)](String(a56_0x45f37f[_0x55a2c7(0x196)]['bold'](_0x55a2c7(0x1d2))));const _0x57ebdf=_0x2797cb[_0x55a2c7(0x197)][_0x55a2c7(0x1d7)]('\x0a');_0x57ebdf[_0x55a2c7(0x198)](_0x498538=>{const _0x24f40f=_0x55a2c7;_0x498538[_0x24f40f(0x1d3)]()&&_0x51ad7f[_0x24f40f(0x19f)](_0x498538);});}}return _0x51ad7f[_0x55a2c7(0x1bc)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x1bcfbf,_0x5b5360){const _0x253096=a56_0x5ba8;if(_0x5b5360[_0x253096(0x19b)]===_0x253096(0x1a9)){await handleSDKOutput([_0x1bcfbf],_0x5b5360);return;}const _0x1bb6db=resolveOutputOptions(_0x5b5360),_0x380b88=await formatSingleObject(_0x1bcfbf,_0x1bb6db);await writeOutput(_0x380b88,_0x1bb6db[_0x253096(0x1cf)]||undefined,_0x1bb6db[_0x253096(0x19b)]);}
|
|
1
|
+
(function(_0x1ffb19,_0x39fb9e){const _0xba6dc1=a56_0x5875,_0x126796=_0x1ffb19();while(!![]){try{const _0x43ec6b=-parseInt(_0xba6dc1(0xe3))/0x1+parseInt(_0xba6dc1(0xd8))/0x2+-parseInt(_0xba6dc1(0xbe))/0x3+-parseInt(_0xba6dc1(0xe2))/0x4*(parseInt(_0xba6dc1(0xa8))/0x5)+parseInt(_0xba6dc1(0xd1))/0x6*(-parseInt(_0xba6dc1(0xde))/0x7)+-parseInt(_0xba6dc1(0xac))/0x8*(-parseInt(_0xba6dc1(0xd2))/0x9)+parseInt(_0xba6dc1(0xe4))/0xa;if(_0x43ec6b===_0x39fb9e)break;else _0x126796['push'](_0x126796['shift']());}catch(_0x1e27bd){_0x126796['push'](_0x126796['shift']());}}}(a56_0x1287,0x7762d));import{writeFileSync}from'fs';function a56_0x1287(){const _0x18bd83=['jsonl','varchar','792633NfTgkR','stderr','resolve','limitStructuredFormats','magenta','split','slice','FINISHED','data','string','cmdout','error','red','Results\x20saved\x20to\x20','spawn','number','stringify','keys','[logs]','565518mnPvXF','183195QaSdOD','object','isInteger','tsv','rule','map','1046740RrLeoW','[params]','bigint','-FXRSn','padEnd','[error]','49SwAnta','join','log','─┴─','3504472RUgFfe','488155UOvQJl','13786250QZWirq','stdin','max','output','trim','entries','blue','No\x20data','pipe','format','table','5gHzHcJ','noColor','color','length','344FzzrlV','query','close','forEach','yellow','bold','push','isFinite','limit','[query]','[rule]','json','debug','params','repeat','boolean'];a56_0x1287=function(){return _0x18bd83;};return a56_0x1287();}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x4eca46 from'chalk';function a56_0x5875(_0x36c512,_0x3f3636){_0x36c512=_0x36c512-0xa7;const _0x128776=a56_0x1287();let _0x587559=_0x128776[_0x36c512];return _0x587559;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x204b02){const _0x31b1e5=a56_0x5875;return _0x204b02[_0x31b1e5(0xed)]===_0x31b1e5(0xb7)||_0x204b02['format']===_0x31b1e5(0xbc)||_0x204b02['format']===_0x31b1e5(0xd5)||_0x204b02[_0x31b1e5(0xed)]==='table'||_0x204b02[_0x31b1e5(0xb7)]===!![]||_0x204b02[_0x31b1e5(0xbc)]===!![]||_0x204b02['tsv']===!![]||_0x204b02[_0x31b1e5(0xa7)]===!![];}export function parseOutputOptions(_0x46fcaf){const _0x40c642=a56_0x5875;return{'format':_0x46fcaf[_0x40c642(0xed)]||_0x40c642(0xa7),'output':_0x46fcaf[_0x40c642(0xe7)]||'','limit':_0x46fcaf[_0x40c642(0xb4)],'limitStructuredFormats':_0x46fcaf[_0x40c642(0xc1)],'color':_0x46fcaf[_0x40c642(0xaa)],'noColor':_0x46fcaf[_0x40c642(0xa9)]};}function convertSDKResultToQueryResult(_0x439dc8){const _0xddd10a=a56_0x5875,_0x32aa20=[];if(_0x439dc8[_0xddd10a(0xab)]>0x0){const _0x4ec180=_0x439dc8[0x0];for(const [_0xcd62c1,_0x3a84ea]of Object[_0xddd10a(0xe9)](_0x4ec180)){let _0x2b4271='varchar';if(typeof _0x3a84ea===_0xddd10a(0xcd))_0x2b4271=Number[_0xddd10a(0xd4)](_0x3a84ea)?_0xddd10a(0xda):'double';else{if(typeof _0x3a84ea===_0xddd10a(0xbb))_0x2b4271=_0xddd10a(0xbb);else _0x3a84ea===null&&(_0x2b4271=_0xddd10a(0xbd));}_0x32aa20[_0xddd10a(0xb2)]({'name':_0xcd62c1,'type':_0x2b4271});}}return{'queryId':'sdk-result','columns':_0x32aa20,'data':_0x439dc8,'stats':{'state':_0xddd10a(0xc5),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x439dc8[_0xddd10a(0xab)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3f2e64,_0xb28bd1){const _0x591a31=convertSDKResultToQueryResult(_0x3f2e64);return formatQueryOutput(_0x591a31,_0xb28bd1);}export async function formatQueryOutput(_0x3359aa,_0x2553aa){const _0x578a87=a56_0x5875,{format:_0x2b93e8,limit:_0x590f97,output:_0x3617d3,color:_0x1d9998,noColor:_0x417a0b,limitStructuredFormats:_0x124baf}=_0x2553aa,_0x326e13=Boolean(_0x3617d3)&&!_0x1d9998,_0x23cd7d={'color':_0x1d9998,'noColor':_0x417a0b||_0x326e13};if(_0x2b93e8===_0x578a87(0xa7)){const _0x55ba46=shouldUseLess(_0x2b93e8,_0x3617d3);return formatAsTable(_0x3359aa,_0x590f97,_0x55ba46,_0x23cd7d);}const _0x2d8030=_0x124baf&&Number[_0x578a87(0xb3)](_0x590f97)&&_0x3359aa[_0x578a87(0xc6)][_0x578a87(0xab)]>_0x590f97?{..._0x3359aa,'data':_0x3359aa[_0x578a87(0xc6)][_0x578a87(0xc4)](0x0,_0x590f97)}:_0x3359aa;if(_0x2b93e8===_0x578a87(0xb7))return formatAsJSON(_0x2d8030,_0x23cd7d);else return _0x2b93e8==='jsonl'?formatAsJSONL(_0x2d8030,_0x23cd7d):formatQueryResult(_0x2d8030,_0x2b93e8);}function shouldUseLess(_0x5f003b,_0x5b0b7e){const _0x4e8aec=a56_0x5875;return(_0x5f003b===_0x4e8aec(0xa7)||_0x5f003b==='list')&&process['stdout']['isTTY']&&!_0x5b0b7e;}export function resolveOutputOptions(_0xdbbe2){const _0x480515=a56_0x5875,_0x19c9d8=_0xdbbe2['output']||'',_0x44c830=resolveOutputFormat(_0xdbbe2[_0x480515(0xed)],_0x19c9d8,_0x480515(0xa7));let _0x223e52=typeof _0xdbbe2[_0x480515(0xb4)]===_0x480515(0xcd)?_0xdbbe2[_0x480515(0xb4)]:parseInt(_0xdbbe2[_0x480515(0xb4)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0xdbbe2[_0x480515(0xb4)]===undefined&&shouldUseLess(_0x44c830,_0x19c9d8)&&(_0x223e52=Infinity),{'format':_0x44c830,'output':_0x19c9d8,'limit':_0x223e52,'limitStructuredFormats':_0xdbbe2[_0x480515(0xc1)],'color':_0xdbbe2['color'],'noColor':_0xdbbe2[_0x480515(0xa9)]};}export function writeOutput(_0x565dc0,_0x389d70,_0x49bc54){const _0x5a2c0a=a56_0x5875;return _0x389d70?(writeFileSync(_0x389d70,_0x565dc0),console[_0x5a2c0a(0xc9)](_0x5a2c0a(0xcb)+_0x389d70),Promise['resolve']()):shouldUseLess(_0x49bc54||'','')?new Promise(_0x1bda64=>{const _0x29bd9b=_0x5a2c0a,_0x330259=spawn('less',[_0x29bd9b(0xdb)],{'stdio':[_0x29bd9b(0xec),'inherit','inherit']});let _0x4b7128=![];_0x330259['on'](_0x29bd9b(0xc9),()=>{const _0xb0aff0=_0x29bd9b;!_0x4b7128&&(_0x4b7128=!![],console[_0xb0aff0(0xe0)](_0x565dc0),_0x1bda64());}),_0x330259['on'](_0x29bd9b(0xae),()=>{!_0x4b7128&&(_0x4b7128=!![],_0x1bda64());}),_0x330259['on'](_0x29bd9b(0xcc),()=>{const _0x19aa3d=_0x29bd9b;!_0x4b7128&&_0x330259['stdin']&&(_0x330259[_0x19aa3d(0xe5)]['on'](_0x19aa3d(0xc9),()=>{}),_0x330259['stdin']['write'](_0x565dc0),_0x330259[_0x19aa3d(0xe5)]['end']());}),!_0x330259[_0x29bd9b(0xe5)]&&(!_0x4b7128&&(_0x4b7128=!![],console['log'](_0x565dc0),_0x1bda64()));}):(console['log'](_0x565dc0),Promise[_0x5a2c0a(0xc0)]());}export async function handleSDKOutput(_0x317ef9,_0x293408){const _0x59d94a=a56_0x5875,_0x2ecf4d=resolveOutputOptions(_0x293408),_0x1b15fc=await formatSDKOutput(_0x317ef9,_0x2ecf4d);await writeOutput(_0x1b15fc,_0x2ecf4d[_0x59d94a(0xe7)]||undefined,_0x2ecf4d[_0x59d94a(0xed)]);}export async function handleQueryOutput(_0x3c0ad8,_0x34e136){const _0x4720fb=a56_0x5875,_0x3f1af6=resolveOutputOptions(_0x34e136),_0x158759=await formatQueryOutput(_0x3c0ad8,_0x3f1af6);await writeOutput(_0x158759,_0x3f1af6[_0x4720fb(0xe7)]||undefined,_0x3f1af6[_0x4720fb(0xed)]);}async function formatSingleObject(_0x36bc1e,_0x323684){const _0x598aec=a56_0x5875,{format:_0x1ad8ea,color:_0x3b5c5a,noColor:_0x1a71a3}=_0x323684,_0x52cfa4={'color':_0x3b5c5a,'noColor':_0x1a71a3};if(_0x1ad8ea===_0x598aec(0xb7)){if(shouldUseColor(_0x52cfa4))return colorizeJSON(_0x36bc1e,_0x52cfa4);return JSON[_0x598aec(0xce)](_0x36bc1e,null,0x2);}else{if(_0x1ad8ea===_0x598aec(0xbc)){if(shouldUseColor(_0x52cfa4))return colorizeJSONCompact(_0x36bc1e,_0x52cfa4);return JSON[_0x598aec(0xce)](_0x36bc1e);}else{if(_0x1ad8ea===_0x598aec(0xd5))return Object[_0x598aec(0xe9)](_0x36bc1e)[_0x598aec(0xd7)](([_0x2e3dd6,_0x93ab20])=>_0x2e3dd6+'\x09'+_0x93ab20)[_0x598aec(0xdf)]('\x0a');else{const _0x3e27c2=Object['entries'](_0x36bc1e);if(_0x3e27c2[_0x598aec(0xab)]===0x0)return _0x598aec(0xeb);const _0xb81231=_0x36bc1e[_0x598aec(0xb8)],_0x511138=_0x36bc1e[_0x598aec(0xad)],_0xa9c883=_0x36bc1e[_0x598aec(0xb9)],_0x4d944a=_0x36bc1e[_0x598aec(0xd6)],_0x1d2825=_0x511138?typeof _0x511138===_0x598aec(0xc7)?_0x511138:JSON['stringify'](_0x511138,null,0x2):undefined,_0x55eaf0=_0xa9c883&&Object[_0x598aec(0xcf)](_0xa9c883)['length']>0x0?JSON[_0x598aec(0xce)](_0xa9c883,null,0x2):undefined,_0x18de72=_0x4d944a&&Object[_0x598aec(0xcf)](_0x4d944a)[_0x598aec(0xab)]>0x0?JSON[_0x598aec(0xce)](_0x4d944a,null,0x2):undefined,_0x294f30=_0x3e27c2['filter'](([_0x1ec393])=>_0x1ec393!==_0x598aec(0xb8)&&_0x1ec393!==_0x598aec(0xad)&&_0x1ec393!==_0x598aec(0xb9)&&_0x1ec393!==_0x598aec(0xd6)),_0x29e967=Math[_0x598aec(0xe6)](..._0x294f30[_0x598aec(0xd7)](([_0x1c8153])=>_0x1c8153['length'])),_0xb6f165=Math[_0x598aec(0xe6)](..._0x294f30['map'](([,_0x283cdb])=>{const _0x5df6c7=_0x598aec;try{const _0x22c2fd=_0x283cdb===null||_0x283cdb===undefined?'':typeof _0x283cdb===_0x5df6c7(0xd3)?JSON['stringify'](_0x283cdb):String(_0x283cdb),_0x3243a=_0x22c2fd[_0x5df6c7(0xc3)]('\x0a');return Math[_0x5df6c7(0xe6)](..._0x3243a[_0x5df6c7(0xd7)](_0x3f88b7=>_0x3f88b7[_0x5df6c7(0xab)]),0x0);}catch{return 0x0;}}),0x14),_0x567070=[];_0x567070[_0x598aec(0xb2)](colorBorder('┌─'+'─'[_0x598aec(0xba)](_0x29e967)+'─┬─'+'─'[_0x598aec(0xba)](_0xb6f165)+'─┐',_0x52cfa4)),_0x294f30['forEach'](([_0x3c6ab2,_0x300b5e])=>{const _0x5adec4=_0x598aec;let _0x2bf141;try{_0x2bf141=_0x300b5e===null||_0x300b5e===undefined?'':typeof _0x300b5e===_0x5adec4(0xd3)?JSON[_0x5adec4(0xce)](_0x300b5e):String(_0x300b5e);}catch{_0x2bf141='[Object]';}const _0x10d2fa=_0x3c6ab2['padEnd'](_0x29e967),_0x46dd8f=_0x2bf141[_0x5adec4(0xc3)]('\x0a');_0x46dd8f[_0x5adec4(0xaf)]((_0xd1ec7e,_0xce0ec7)=>{const _0x1246d4=_0x5adec4,_0x4bfff3=colorBorder('│',_0x52cfa4);_0xce0ec7===0x0?_0x567070[_0x1246d4(0xb2)](_0x4bfff3+'\x20'+_0x10d2fa+'\x20'+_0x4bfff3+'\x20'+_0xd1ec7e[_0x1246d4(0xdc)](_0xb6f165)+'\x20'+_0x4bfff3):_0x567070['push'](_0x4bfff3+'\x20'+'\x20'['repeat'](_0x29e967)+'\x20'+_0x4bfff3+'\x20'+_0xd1ec7e['padEnd'](_0xb6f165)+'\x20'+_0x4bfff3);});}),_0x567070[_0x598aec(0xb2)](colorBorder('└─'+'─'['repeat'](_0x29e967)+_0x598aec(0xe1)+'─'[_0x598aec(0xba)](_0xb6f165)+'─┘',_0x52cfa4));_0x1d2825&&(_0x567070['push'](''),_0x567070[_0x598aec(0xb2)](String(a56_0x4eca46[_0x598aec(0xb0)][_0x598aec(0xb1)](_0x598aec(0xb5)))),_0x567070['push'](_0x1d2825));_0x55eaf0&&(_0x567070['push'](''),_0x567070[_0x598aec(0xb2)](String(a56_0x4eca46[_0x598aec(0xea)][_0x598aec(0xb1)](_0x598aec(0xd9)))),_0x567070['push'](_0x55eaf0));_0x18de72&&(_0x567070[_0x598aec(0xb2)](''),_0x567070[_0x598aec(0xb2)](String(a56_0x4eca46[_0x598aec(0xc2)][_0x598aec(0xb1)](_0x598aec(0xb6)))),_0x567070[_0x598aec(0xb2)](_0x18de72));if(_0xb81231){if(_0xb81231['stderr']){_0x567070[_0x598aec(0xb2)](''),_0x567070['push'](String(a56_0x4eca46[_0x598aec(0xca)][_0x598aec(0xb1)](_0x598aec(0xdd))));const _0x113fbf=_0xb81231[_0x598aec(0xbf)][_0x598aec(0xc3)]('\x0a');_0x113fbf[_0x598aec(0xaf)](_0xafe415=>{_0xafe415['trim']()&&_0x567070['push'](_0xafe415);});}if(_0xb81231[_0x598aec(0xc8)]){_0x567070[_0x598aec(0xb2)](''),_0x567070['push'](String(a56_0x4eca46['cyan'][_0x598aec(0xb1)](_0x598aec(0xd0))));const _0x225c7b=_0xb81231[_0x598aec(0xc8)]['split']('\x0a');_0x225c7b['forEach'](_0x4459c1=>{const _0x3d9d69=_0x598aec;_0x4459c1[_0x3d9d69(0xe8)]()&&_0x567070[_0x3d9d69(0xb2)](_0x4459c1);});}}return _0x567070[_0x598aec(0xdf)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x24963f,_0x3416d4){const _0x526308=a56_0x5875;if(_0x3416d4['format']===_0x526308(0xa7)){await handleSDKOutput([_0x24963f],_0x3416d4);return;}const _0xf1afc3=resolveOutputOptions(_0x3416d4),_0x1989f1=await formatSingleObject(_0x24963f,_0xf1afc3);await writeOutput(_0x1989f1,_0xf1afc3[_0x526308(0xe7)]||undefined,_0xf1afc3[_0x526308(0xed)]);}
|