@treasuredata/tdx 2026.4.9 → 2026.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.d.ts +52 -0
- package/dist/sdk/workspace/git.d.ts.map +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/git.js.map +1 -1
- package/dist/sdk/workspace/index.d.ts +14 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.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 +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0xb99464=a54_0xabc4;(function(_0x5d3a78,_0x353bda){const _0x129a36=a54_0xabc4,_0x3c9c7e=_0x5d3a78();while(!![]){try{const _0x24fea4=-parseInt(_0x129a36(0x162))/0x1*(parseInt(_0x129a36(0x251))/0x2)+parseInt(_0x129a36(0x269))/0x3+-parseInt(_0x129a36(0x29c))/0x4*(-parseInt(_0x129a36(0x114))/0x5)+parseInt(_0x129a36(0x193))/0x6+-parseInt(_0x129a36(0x1c8))/0x7+parseInt(_0x129a36(0x278))/0x8+parseInt(_0x129a36(0x172))/0x9*(parseInt(_0x129a36(0x122))/0xa);if(_0x24fea4===_0x353bda)break;else _0x3c9c7e['push'](_0x3c9c7e['shift']());}catch(_0x572011){_0x3c9c7e['push'](_0x3c9c7e['shift']());}}}(a54_0x299b,0x47930));import a54_0x3265bd from'chalk';import{existsSync}from'fs';import a54_0x5df1b0 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';function a54_0xabc4(_0x40baa0,_0x1c70b3){_0x40baa0=_0x40baa0-0x110;const _0x299b22=a54_0x299b();let _0xabc454=_0x299b22[_0x40baa0];return _0xabc454;}import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x24334b from'prompts';function getAttemptStatusDisplay(_0x5a3470){const _0x56e9d0=a54_0xabc4;if(!_0x5a3470)return{'icon':'⏳','text':''};const {done:_0x317b19,success:_0x4caae3,cancelRequested:_0x41071a}=_0x5a3470;if(!_0x317b19)return _0x41071a?{'icon':'🛑','text':a54_0x3265bd['yellow'](_0x56e9d0(0x28b))}:{'icon':'🔄','text':a54_0x3265bd[_0x56e9d0(0x144)]('running')};if(_0x4caae3)return{'icon':'✅','text':a54_0x3265bd[_0x56e9d0(0x119)](_0x56e9d0(0x252))};return{'icon':'❌','text':a54_0x3265bd['red'](_0x56e9d0(0x274))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0xb99464(0x178)](_0x1c1c78,_0xa8f81f,_0x2916f9=0x0){return _0x1c1c78[_0x2916f9]||_0xa8f81f['workflowProject'];}[a54_0xb99464(0x1ef)](_0x140653,_0x2c27cd,_0xb262fa=0x0){const _0x2ae4b8=a54_0xb99464,_0x108f96=this[_0x2ae4b8(0x178)](_0x140653,_0x2c27cd,_0xb262fa);if(!_0x108f96)return console[_0x2ae4b8(0x274)](a54_0x3265bd['red'](_0x2ae4b8(0x1dc)),_0x2ae4b8(0x164)),console[_0x2ae4b8(0x274)](a54_0x3265bd[_0x2ae4b8(0x1a1)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x108f96;}[a54_0xb99464(0x15b)](_0x5ed73c,_0x17067e){const _0x27ae7b=a54_0xb99464;if(_0x5ed73c[0x0]){const _0x49826c=_0x5ed73c[0x0][_0x27ae7b(0x242)]('.');if(_0x49826c[_0x27ae7b(0x1b9)]===0x1)return{'projectName':_0x49826c[0x0],'workflowName':undefined};else return _0x49826c[_0x27ae7b(0x1b9)]===0x2?{'projectName':_0x49826c[0x0],'workflowName':_0x49826c[0x1]}:(console[_0x27ae7b(0x274)](a54_0x3265bd['red']('Error:'),_0x27ae7b(0x1ec)),null);}return{'projectName':_0x17067e[_0x27ae7b(0x23a)],'workflowName':undefined};}[a54_0xb99464(0x284)](_0x591f8a,_0x5414a2,_0x323af7=0x0){const _0x5da64b=a54_0xb99464;if(_0x591f8a[_0x323af7])return _0x591f8a[_0x323af7];if(_0x5414a2[_0x5da64b(0x23a)]){const _0x3e3c07=a54_0x5df1b0[_0x5da64b(0x237)](process[_0x5da64b(0x1b7)](),_0x5da64b(0x1d5),_0x5414a2[_0x5da64b(0x23a)]);if(existsSync(a54_0x5df1b0[_0x5da64b(0x237)](_0x3e3c07,_0x5da64b(0x1c2))))return _0x3e3c07;}return undefined;}async[a54_0xb99464(0x2b1)](_0x5bff1d,_0x11e777,_0x9b39aa){const _0x1b9dd6=a54_0xb99464;try{const _0x5ba007=await _0x5bff1d[_0x1b9dd6(0x229)][_0x1b9dd6(0x1d5)](_0x11e777,{'limit':0x1});if(_0x5ba007[_0x1b9dd6(0x1b9)]>0x0){const _0x13cc81=_0x5ba007[0x0]['id'],_0x202996=getWorkflowUrl(_0x9b39aa,_0x13cc81);console[_0x1b9dd6(0x274)](_0x1b9dd6(0x1b5)+a54_0x3265bd['cyan'](_0x202996));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0xb99464(0x1be);[a54_0xb99464(0x13a)]=a54_0xb99464(0x24d);async['execute'](_0x58f1f9){const _0x31ef66=a54_0xb99464,{options:_0x388b1a,args:_0x3d4dc6,tdx:_0x5832e3}=_0x58f1f9,_0x26ac55=_0x3d4dc6[0x0],_0x541416=_0x388b1a[_0x31ef66(0x16d)];if(_0x541416)return saveSessionContext({'workflow_project':undefined},_0x388b1a[_0x31ef66(0x29b)]),console[_0x31ef66(0x25a)](a54_0x3265bd[_0x31ef66(0x119)](_0x31ef66(0x129))),0x0;if(!_0x26ac55)return console[_0x31ef66(0x274)](a54_0x3265bd['red'](_0x31ef66(0x1dc)),_0x31ef66(0x164)),console[_0x31ef66(0x274)](a54_0x3265bd['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a54_0x3265bd['dim'](_0x31ef66(0x2b5))),0x1;const _0x3a4263=await withSpinner(_0x31ef66(0x28f)+_0x26ac55+'\x27...',()=>_0x5832e3[_0x31ef66(0x229)][_0x31ef66(0x2a8)](_0x26ac55),{'verbose':_0x388b1a[_0x31ef66(0x2a9)]}),{name:_0x1c322c}=_0x3a4263[_0x31ef66(0x149)];return saveSessionContext({'workflow_project':_0x1c322c},_0x388b1a[_0x31ef66(0x29b)]),console['log'](a54_0x3265bd[_0x31ef66(0x119)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x3265bd['cyan'](_0x1c322c))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x200);['description']='List\x20all\x20workflow\x20projects';async[a54_0xb99464(0x1e1)](_0x25cc5b){const _0x3d2d12=a54_0xb99464,{options:_0x506b18,args:_0xa2db4d,tdx:_0x1aca75}=_0x25cc5b,_0x30912f=_0xa2db4d[0x0];_0x506b18[_0x3d2d12(0x2a9)]&&_0x30912f&&console['error'](_0x3d2d12(0x205)+_0x30912f);const _0x2567fb=await withSpinner(_0x3d2d12(0x2cf),()=>_0x1aca75['workflow'][_0x3d2d12(0x230)](_0x30912f,{'limit':_0x506b18[_0x3d2d12(0x14e)]}),{'verbose':_0x506b18['verbose']});let _0x16e655=_0x2567fb['data'];_0x16e655['sort']((_0x21b355,_0x756599)=>_0x21b355[_0x3d2d12(0x2ba)][_0x3d2d12(0x1d2)](_0x756599[_0x3d2d12(0x2ba)]));const _0x17247b=_0x506b18['limit']||0x64,_0x2e6eca=_0x16e655[_0x3d2d12(0x1b9)]>=_0x17247b?a54_0x3265bd[_0x3d2d12(0x1a1)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3d2d12(0x274)](_0x3d2d12(0x28e)+_0x16e655[_0x3d2d12(0x1b9)]+'\x20project'+(_0x16e655[_0x3d2d12(0x1b9)]!==0x1?'s':'')+_0x2e6eca);if(_0x506b18[_0x3d2d12(0x256)]===_0x3d2d12(0x279)||_0x506b18[_0x3d2d12(0x256)]===_0x3d2d12(0x197)||_0x506b18[_0x3d2d12(0x256)]===_0x3d2d12(0x1c1))await handleSDKOutput(_0x16e655,_0x506b18);else{if(_0x16e655[_0x3d2d12(0x1b9)]===0x0)_0x30912f?console[_0x3d2d12(0x25a)](_0x3d2d12(0x1fd)+_0x30912f):console[_0x3d2d12(0x25a)](_0x3d2d12(0x299));else{const _0x48135f=_0x16e655[_0x3d2d12(0x127)](_0x1671af=>{const _0x4baba9=_0x3d2d12,_0x2bb9dd=_0x1671af['metadata']?.[_0x4baba9(0x23f)](_0x3cb7b5=>_0x3cb7b5[_0x4baba9(0x132)]===_0x4baba9(0x18d)),_0x118462=_0x2bb9dd?a54_0x3265bd[_0x4baba9(0x1a1)](_0x4baba9(0x134)):'';return _0x4baba9(0x290)+_0x1671af[_0x4baba9(0x2ba)]+_0x118462;});await writeOutput(_0x48135f[_0x3d2d12(0x237)]('\x0a'),_0x506b18[_0x3d2d12(0x1b6)],_0x3d2d12(0x157));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a54_0xb99464(0x246);['description']=a54_0xb99464(0x161);async[a54_0xb99464(0x1e1)](_0x2cbfd6){const _0x10f9da=a54_0xb99464,{options:_0x1daa1e,args:_0x4da627,tdx:_0x27f77e}=_0x2cbfd6,_0x295bd3=this[_0x10f9da(0x178)](_0x4da627,_0x1daa1e);_0x1daa1e['verbose']&&_0x295bd3&&console[_0x10f9da(0x274)]('Project\x20filter:\x20'+_0x295bd3);const _0x83fd14=await withSpinner(_0x10f9da(0x1e7),()=>_0x27f77e[_0x10f9da(0x229)][_0x10f9da(0x1d5)](_0x295bd3,{'limit':_0x1daa1e[_0x10f9da(0x14e)]}),{'verbose':_0x1daa1e[_0x10f9da(0x2a9)]});let _0x1abd82=_0x83fd14[_0x10f9da(0x149)];_0x1abd82['sort']((_0x467b42,_0x462c46)=>{const _0x44c3ce=_0x10f9da,_0x1a10f4=_0x467b42[_0x44c3ce(0x2ba)][_0x44c3ce(0x1d2)](_0x462c46[_0x44c3ce(0x2ba)]);if(_0x1a10f4!==0x0)return _0x1a10f4;return(_0x467b42[_0x44c3ce(0x23d)]?.[_0x44c3ce(0x2ba)]||'')['localeCompare'](_0x462c46[_0x44c3ce(0x23d)]?.[_0x44c3ce(0x2ba)]||'');});const _0x526a80=_0x1daa1e[_0x10f9da(0x14e)]||0x64,_0x1f8ebf=_0x1abd82[_0x10f9da(0x1b9)]>=_0x526a80?a54_0x3265bd[_0x10f9da(0x1a1)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x10f9da(0x274)](_0x10f9da(0x28e)+_0x1abd82[_0x10f9da(0x1b9)]+_0x10f9da(0x20b)+(_0x1abd82[_0x10f9da(0x1b9)]!==0x1?'s':'')+_0x1f8ebf);if(_0x1daa1e['format']===_0x10f9da(0x279)||_0x1daa1e['format']===_0x10f9da(0x197)||_0x1daa1e['format']===_0x10f9da(0x1c1))await handleSDKOutput(_0x1abd82,_0x1daa1e);else{if(_0x1abd82[_0x10f9da(0x1b9)]===0x0)_0x295bd3?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x295bd3):console[_0x10f9da(0x25a)]('No\x20workflows\x20found');else{const _0x3e1e5a=_0x1daa1e[_0x10f9da(0x1fa)],_0xec7be0=_0x1abd82[_0x10f9da(0x127)](_0xf0d930=>{const _0x1cff3b=_0x10f9da,_0x1ca4db=a54_0x3265bd['dim']('#'+_0xf0d930['id']),_0x417204=hyperlink(_0x1ca4db,getWorkflowUrl(_0x3e1e5a,_0xf0d930['id'])),_0x48537e=_0xf0d930['project']?.[_0x1cff3b(0x2ba)]?a54_0x3265bd[_0x1cff3b(0x1a1)]('\x20('+_0xf0d930[_0x1cff3b(0x23d)]['name']+')'):'';return _0x1cff3b(0x245)+_0x417204+'\x20'+_0xf0d930[_0x1cff3b(0x2ba)]+_0x48537e;});await writeOutput(_0xec7be0[_0x10f9da(0x237)]('\x0a'),_0x1daa1e['output'],_0x10f9da(0x157));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]='workflow:sessions';[a54_0xb99464(0x13a)]=a54_0xb99464(0x192);async[a54_0xb99464(0x1e1)](_0x1a149e){const _0x238221=a54_0xb99464,{options:_0xb39081,args:_0x3ed20a,tdx:_0x71c5bd}=_0x1a149e,_0x40412f=this[_0x238221(0x15b)](_0x3ed20a,_0xb39081);if(!_0x40412f)return 0x1;const {projectName:_0x6543dd,workflowName:_0x1dd276}=_0x40412f;if(_0xb39081[_0x238221(0x2a9)]){if(_0x6543dd&&_0x1dd276)console[_0x238221(0x274)](_0x238221(0x180)+_0x6543dd+'.'+_0x1dd276);else _0x6543dd&&console[_0x238221(0x274)]('Filter:\x20project='+_0x6543dd);const _0x47192c=_0xb39081[_0x238221(0x179)];_0x47192c&&console['error'](_0x238221(0x1e8)+_0x47192c);}let _0x878221=0x28;if(process[_0x238221(0x194)]['isTTY']&&!_0xb39081[_0x238221(0x1b6)]&&!_0xb39081['format']){const _0x13faf2=process[_0x238221(0x194)]['rows']||0x28;_0x878221=Math[_0x238221(0x2b0)](0x14,Math[_0x238221(0x1f6)](_0x13faf2*0x2/0x3));}const _0x2a9ca5=_0xb39081[_0x238221(0x14e)]||_0x878221,_0x41b69d=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x71c5bd[_0x238221(0x229)][_0x238221(0x218)]({'projectName':_0x6543dd,'workflowName':_0x1dd276,'status':_0xb39081[_0x238221(0x179)],'fromTime':_0xb39081[_0x238221(0x1d0)],'toTime':_0xb39081['to'],'limit':_0x2a9ca5}),{'verbose':_0xb39081[_0x238221(0x2a9)]}),_0x45ddbc=_0x41b69d[_0x238221(0x149)];_0x45ddbc[_0x238221(0x1bc)]((_0x313950,_0x109de9)=>{const _0x5f40db=_0x238221,_0x45cf33=_0x313950[_0x5f40db(0x2c5)]||'',_0x170f70=_0x109de9['sessionTime']||'';return _0x170f70[_0x5f40db(0x1d2)](_0x45cf33);});_0x45ddbc[_0x238221(0x1b9)]>=_0x2a9ca5?console['error'](_0x238221(0x239)+_0x45ddbc[_0x238221(0x1b9)]+_0x238221(0x271)+a54_0x3265bd[_0x238221(0x1a1)](_0x238221(0x110))):console['error'](_0x238221(0x28e)+_0x45ddbc[_0x238221(0x1b9)]+'\x20session'+(_0x45ddbc[_0x238221(0x1b9)]!==0x1?'s':''));if(_0xb39081[_0x238221(0x256)]===_0x238221(0x279)||_0xb39081[_0x238221(0x256)]===_0x238221(0x197)||_0xb39081[_0x238221(0x256)]===_0x238221(0x1c1))await handleSDKOutput(_0x45ddbc,_0xb39081);else{if(!process['stdout']['isTTY']||_0xb39081['output']){if(_0x45ddbc[_0x238221(0x1b9)]===0x0){if(_0x6543dd&&_0x1dd276)console[_0x238221(0x25a)](_0x238221(0x292)+_0x6543dd+'.'+_0x1dd276);else _0x6543dd?console[_0x238221(0x25a)](_0x238221(0x16f)+_0x6543dd):console[_0x238221(0x25a)]('No\x20sessions\x20found');}else{const _0xfe0947=_0xb39081[_0x238221(0x1fa)],_0x45c3ef=this['renderSessionsTimeline'](_0x45ddbc,_0xfe0947);_0xb39081[_0x238221(0x1b6)]?await writeOutput(_0x45c3ef,_0xb39081['output'],_0x238221(0x157)):console[_0x238221(0x25a)](_0x45c3ef);}!_0x6543dd&&(console['error'](''),console['error'](a54_0x3265bd[_0x238221(0x1a1)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x238221(0x274)](a54_0x3265bd['dim'](_0x238221(0x1ba))+'or'+a54_0x3265bd[_0x238221(0x1a1)](_0x238221(0x1f9))));}else{if(_0x45ddbc[_0x238221(0x1b9)]===0x0){if(_0x6543dd&&_0x1dd276)console[_0x238221(0x25a)](_0x238221(0x292)+_0x6543dd+'.'+_0x1dd276);else _0x6543dd?console[_0x238221(0x25a)](_0x238221(0x16f)+_0x6543dd):console[_0x238221(0x25a)]('No\x20sessions\x20found');}else await this[_0x238221(0x294)](_0x45ddbc,_0x1a149e,_0x6543dd);}}return 0x0;}['renderSessionsTimeline'](_0x419134,_0x3502eb){const _0x3dfa91=a54_0xb99464,_0x26091c=[],_0x2f93c1=new Map();let _0x2a7cd0=Infinity,_0x431f3c=-Infinity;for(const _0x119052 of _0x419134){if(_0x119052[_0x3dfa91(0x206)]?.[_0x3dfa91(0x168)]){const _0x43e954=new Date(_0x119052[_0x3dfa91(0x206)][_0x3dfa91(0x168)])[_0x3dfa91(0x21b)](),_0x414b8f=_0x119052[_0x3dfa91(0x206)][_0x3dfa91(0x1e6)]?new Date(_0x119052[_0x3dfa91(0x206)][_0x3dfa91(0x1e6)])[_0x3dfa91(0x21b)]():Date[_0x3dfa91(0x186)](),_0x5bbd75=_0x119052[_0x3dfa91(0x23d)]?.[_0x3dfa91(0x2ba)]||_0x3dfa91(0x15a);!_0x2f93c1[_0x3dfa91(0x21c)](_0x5bbd75)&&_0x2f93c1[_0x3dfa91(0x138)](_0x5bbd75,[]),_0x2f93c1[_0x3dfa91(0x118)](_0x5bbd75)[_0x3dfa91(0x2c3)]({'session':_0x119052,'startTime':_0x43e954,'endTime':_0x414b8f,'duration':_0x414b8f-_0x43e954}),_0x2a7cd0=Math[_0x3dfa91(0x2c4)](_0x2a7cd0,_0x43e954),_0x431f3c=Math[_0x3dfa91(0x2b0)](_0x431f3c,_0x414b8f);}}if(_0x2f93c1[_0x3dfa91(0x15c)]===0x0)return _0x3dfa91(0x146);const _0x50ebdc=process[_0x3dfa91(0x194)][_0x3dfa91(0x15f)]||0x78,_0x43c4c5=0x1e,_0xa5d5b=0x32,_0x3ec1c9=0x4,_0x46648d=Math[_0x3dfa91(0x2c4)](_0xa5d5b,Math[_0x3dfa91(0x2b0)](_0x43c4c5,Math[_0x3dfa91(0x1f6)](_0x50ebdc*0.3))),_0x349e96=_0x50ebdc-_0x46648d-TIMELINE_CONFIG[_0x3dfa91(0x126)]-0x3-_0x3ec1c9,_0x489946=_0x431f3c-_0x2a7cd0,_0x370862=_0x489946/_0x46648d,_0x30282f=renderTimeAxis({'startTime':_0x2a7cd0,'endTime':_0x431f3c,'durationMs':_0x489946,'msPerChar':_0x370862},_0x46648d),_0x3b1d9b=[];for(const _0x2aaa04 of _0x2f93c1['values']()){_0x3b1d9b[_0x3dfa91(0x2c3)](..._0x2aaa04);}_0x3b1d9b[_0x3dfa91(0x1bc)]((_0x59cfeb,_0x543db9)=>_0x543db9[_0x3dfa91(0x1f0)]-_0x59cfeb[_0x3dfa91(0x1f0)]);const _0x555ada=new Date(_0x2a7cd0),_0x2ee94e=formatDate(_0x555ada),_0x4fffc8=_0x3ec1c9+TIMELINE_CONFIG[_0x3dfa91(0x24e)]+TIMELINE_CONFIG['ICON_SPACING']+_0x349e96,_0x2a6f8c='\x20'[_0x3dfa91(0x155)](_0x4fffc8-_0x2ee94e[_0x3dfa91(0x1b9)]),_0x527184=_0x2a6f8c+a54_0x3265bd['dim'](_0x2ee94e)+'\x20'+_0x30282f;_0x26091c[_0x3dfa91(0x2c3)](_0x527184);const _0x3d4ac1=0x16;let _0x506b2e=0x0;for(const _0x159e2b of _0x3b1d9b){const _0x31a311=_0x159e2b[_0x3dfa91(0x29b)][_0x3dfa91(0x23d)]?.[_0x3dfa91(0x2ba)]||'?',_0x439183=Math[_0x3dfa91(0x2c4)](stringWidth(_0x31a311),_0x3d4ac1);_0x506b2e=Math[_0x3dfa91(0x2b0)](_0x506b2e,_0x439183);}for(const _0x3df239 of _0x3b1d9b){const {session:_0x5b97a3,startTime:_0x5aa7cb,endTime:_0x4c93a5,duration:_0x3fdf7b}=_0x3df239,_0x46e151=_0x5b97a3[_0x3dfa91(0x23d)]?.['id'],_0xd8025e=_0x5b97a3['id'],_0x2bcf8a=_0x5b97a3[_0x3dfa91(0x23d)]?.[_0x3dfa91(0x2ba)]||'?',_0x507ebc=_0x5b97a3[_0x3dfa91(0x229)]?.[_0x3dfa91(0x2ba)]||'?';let _0x4ce2ab,_0x589953;if(_0x5b97a3['lastAttempt']){const _0x567409=_0x5b97a3['lastAttempt'];!_0x567409[_0x3dfa91(0x1c6)]?(_0x4ce2ab=_0x567409['cancelRequested']?'🛑':'🔄',_0x589953=_0x567409[_0x3dfa91(0x11b)]?a54_0x3265bd[_0x3dfa91(0x267)]:a54_0x3265bd[_0x3dfa91(0x144)]):(_0x4ce2ab=_0x567409[_0x3dfa91(0x252)]?'✅':'❌',_0x589953=_0x567409[_0x3dfa91(0x252)]?a54_0x3265bd['green']:a54_0x3265bd[_0x3dfa91(0x2aa)]);}else _0x4ce2ab='⏳',_0x589953=a54_0x3265bd[_0x3dfa91(0x1a1)];const _0x18e667='#'+_0xd8025e,_0x53eaea=_0x46e151?hyperlink(_0x18e667,getWorkflowSessionUrl(_0x3502eb,_0x46e151,_0xd8025e)):_0x18e667;let _0xaf820f=_0x2bcf8a;stringWidth(_0x2bcf8a)>_0x3d4ac1&&(_0xaf820f=_0x2bcf8a[_0x3dfa91(0x259)](0x0,_0x3d4ac1-0x1)+'…');const _0x36611c=a54_0x3265bd[_0x3dfa91(0x1a1)](_0xaf820f),_0x270885=stringWidth(_0xaf820f),_0x42441e='\x20'[_0x3dfa91(0x155)](_0x506b2e-stringWidth(_0xaf820f)+0x2),_0x3bb25a='('+formatElapsed(_0x3fdf7b)+')',_0x19b6fc=stringWidth(_0x3bb25a),_0x2ba5dd=stringWidth(_0x18e667),_0x53292b=_0x2ba5dd+0x1+_0x270885+_0x42441e[_0x3dfa91(0x1b9)],_0x134a11=_0x349e96-_0x53292b-_0x19b6fc-0x1-0x8;let _0xffc2ec=_0x507ebc;stringWidth(_0xffc2ec)>_0x134a11&&(_0xffc2ec=_0xffc2ec[_0x3dfa91(0x259)](0x0,_0x134a11-0x1)+'…');const _0x2eeb52=_0x53eaea+'\x20'+_0x36611c+_0x42441e+_0xffc2ec,_0x212d51=stringWidth(_0x2eeb52),_0xc0ec9d=_0x349e96-_0x212d51-_0x19b6fc,_0x39f009=_0x2eeb52+'\x20'['repeat'](Math[_0x3dfa91(0x2b0)](0x1,_0xc0ec9d))+a54_0x3265bd['dim'](_0x3bb25a),_0x3df19d=Math[_0x3dfa91(0x1f6)]((_0x5aa7cb-_0x2a7cd0)/_0x370862),_0x2c8db0=Math[_0x3dfa91(0x1f6)]((_0x4c93a5-_0x2a7cd0)/_0x370862),_0x167301=Math['max'](_0x3df19d+0x1,_0x2c8db0),_0x2b46d9=new Array(_0x46648d)[_0x3dfa91(0x18b)]('\x20');for(let _0x3a7c90=_0x3df19d;_0x3a7c90<Math['min'](_0x167301,_0x46648d);_0x3a7c90++){_0x2b46d9[_0x3a7c90]='─';}const _0x2baa27=_0x2b46d9[_0x3dfa91(0x127)](_0x38e529=>_0x38e529==='\x20'?'\x20':_0x589953(_0x38e529))[_0x3dfa91(0x237)]('');_0x26091c[_0x3dfa91(0x2c3)](_0x4ce2ab+'\x20'+_0x39f009+'│'+_0x2baa27+'│');}return _0x26091c[_0x3dfa91(0x237)]('\x0a');}async[a54_0xb99464(0x294)](_0x1aee33,_0xface2a,_0x1df10f){const _0x4edc64=a54_0xb99464,{options:_0x30ee56,tdx:_0x4380ee}=_0xface2a,_0x236030=_0x30ee56[_0x4edc64(0x1fa)],{timelineRows:_0x551fd1,timeAxisHeader:_0xc0a6dc}=this[_0x4edc64(0x139)](_0x1aee33,_0x236030),_0x4c5afb=_0x551fd1[_0x4edc64(0x13f)](_0x50a3de=>_0x50a3de[_0x4edc64(0x216)]);if(_0x4c5afb[_0x4edc64(0x1b9)]===0x0){const _0x2a47ce=this['renderSessionsTimeline'](_0x1aee33,_0x236030);console[_0x4edc64(0x25a)](_0x2a47ce);!_0x1df10f&&(console[_0x4edc64(0x274)](''),console[_0x4edc64(0x274)](a54_0x3265bd[_0x4edc64(0x1a1)](_0x4edc64(0x1c5))),console[_0x4edc64(0x274)](a54_0x3265bd[_0x4edc64(0x1a1)](_0x4edc64(0x1ba))+'or'+a54_0x3265bd[_0x4edc64(0x1a1)](_0x4edc64(0x1f9))));return;}_0xc0a6dc&&console[_0x4edc64(0x25a)](_0xc0a6dc);const _0x1b940d=_0x551fd1[_0x4edc64(0x13f)](_0x118f1c=>_0x118f1c[_0x4edc64(0x216)])['map'](_0x55a7ac=>({'title':_0x55a7ac[_0x4edc64(0x1fc)],'value':_0x55a7ac[_0x4edc64(0x216)]})),_0xd9722f=process[_0x4edc64(0x194)][_0x4edc64(0x1dd)]||0x3c,_0x43dfc6=Math[_0x4edc64(0x2b0)](0x28,Math[_0x4edc64(0x1f6)](_0xd9722f*0x2/0x3)),_0x3724b9=await a54_0x24334b({'type':'autocomplete','name':_0x4edc64(0x216),'message':_0x4edc64(0x112),'choices':_0x1b940d,'initial':-0x1,'limit':_0x43dfc6,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x441899,_0x210103)=>{const _0x1fffc2=_0x4edc64;if(!_0x441899)return Promise[_0x1fffc2(0x1da)](_0x210103);const _0xa1070a=_0x210103[_0x1fffc2(0x13f)](_0x2162a4=>{const _0x3850a3=_0x1fffc2,_0x45251d=_0x2162a4;return _0x45251d[_0x3850a3(0x16a)][_0x3850a3(0x2cb)]()[_0x3850a3(0x1e0)](_0x441899['toLowerCase']());});return Promise[_0x1fffc2(0x1da)](_0xa1070a);}}),_0x5b4521=()=>{const _0x1906c2=_0x4edc64;process['stdout']['write'](_0x1906c2(0x199)),process[_0x1906c2(0x194)][_0x1906c2(0x283)](_0x1906c2(0x199)),process[_0x1906c2(0x194)][_0x1906c2(0x283)](_0x1906c2(0x199));},_0x21e5ea=_0x3724b9&&_0x3724b9['attemptId']&&_0x3724b9[_0x4edc64(0x216)]!==null&&_0x3724b9['attemptId'][_0x4edc64(0x220)]()!=='';if(!_0x21e5ea){_0x5b4521(),console['log'](a54_0x3265bd[_0x4edc64(0x1a1)](_0x4edc64(0x1af)));return;}_0x5b4521();const _0x29fe3c=_0x1aee33[_0x4edc64(0x2a2)](_0x3feab1=>_0x3feab1['lastAttempt']?.['id']===_0x3724b9['attemptId']);if(_0x29fe3c){const _0x117c0e=_0x29fe3c[_0x4edc64(0x23d)]?.[_0x4edc64(0x2ba)]||'?',_0x4d18a1=_0x29fe3c[_0x4edc64(0x229)]?.['name']||'?';console[_0x4edc64(0x25a)](_0x4edc64(0x2a6)+a54_0x3265bd[_0x4edc64(0x1a1)](_0x117c0e)+_0x4edc64(0x215)+a54_0x3265bd['dim'](_0x4d18a1));}const _0x9369d=new WorkflowTimelineCommand();await _0x9369d[_0x4edc64(0x1e1)]({'args':[],'options':{..._0x30ee56,'attemptId':_0x3724b9[_0x4edc64(0x216)]},'tdx':_0x4380ee});}['generateSessionTimelineRows'](_0x4d118c,_0x465e2f){const _0x3031c4=a54_0xb99464,_0x39aa83=new Map();for(const _0x3c4e53 of _0x4d118c){_0x3c4e53['id']&&_0x3c4e53[_0x3031c4(0x206)]?.['id']&&_0x39aa83[_0x3031c4(0x138)](_0x3c4e53['id'],_0x3c4e53[_0x3031c4(0x206)]['id']);}const _0x165888=[];let _0x1e08f6='';const _0xffb720=this[_0x3031c4(0x1e4)](_0x4d118c,_0x465e2f),_0x3f7f47=_0xffb720['split']('\x0a');for(const _0xea0615 of _0x3f7f47){if(_0xea0615[_0x3031c4(0x2d3)](_0x3031c4(0x221))||_0xea0615[_0x3031c4(0x19f)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1e08f6=_0xea0615;else{if(_0xea0615[_0x3031c4(0x19f)](/^[✅❌🔄🛑⏳]/)){const _0x3c775f=_0xea0615[_0x3031c4(0x19f)](/#(\d+)/),_0x2794e7=_0x3c775f?_0x3c775f[0x1]:null,_0x5b67ff=_0x2794e7?_0x39aa83[_0x3031c4(0x118)](_0x2794e7)||null:null,_0xa250eb=_0x4d118c['find'](_0x44e0ec=>_0x44e0ec['id']===_0x2794e7),_0x39d8c2=_0xa250eb?.[_0x3031c4(0x23d)]?.[_0x3031c4(0x2ba)]||'';_0x165888['push']({'displayLine':_0xea0615,'attemptId':_0x5b67ff,'projectName':_0x39d8c2});}}}return{'timelineRows':_0x165888,'timeAxisHeader':_0x1e08f6};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x18e);['description']=a54_0xb99464(0x147);async['execute'](_0x446293){const _0x4e426b=a54_0xb99464,{options:_0x35304a,args:_0x10c18c,tdx:_0x32163c}=_0x446293,_0x35f245=this[_0x4e426b(0x15b)](_0x10c18c,_0x35304a);if(!_0x35f245)return 0x1;const {projectName:_0x57b522,workflowName:_0x3afb61}=_0x35f245,_0x106e42=_0x35304a['includeRetried'];if(_0x35304a[_0x4e426b(0x2a9)]){if(_0x57b522&&_0x3afb61)console[_0x4e426b(0x274)](_0x4e426b(0x180)+_0x57b522+'.'+_0x3afb61);else _0x57b522&&console[_0x4e426b(0x274)]('Filter:\x20project='+_0x57b522);_0x106e42&&console['error'](_0x4e426b(0x19e));}const _0x48544f=await withSpinner(_0x4e426b(0x1ea),()=>_0x32163c['workflow'][_0x4e426b(0x1a5)]({'projectName':_0x57b522,'workflowName':_0x3afb61,'includeRetried':_0x106e42,'limit':_0x35304a[_0x4e426b(0x14e)]}),{'verbose':_0x35304a[_0x4e426b(0x2a9)]}),_0x13cbf1=_0x48544f['data'],_0x5aa7b3=_0x35304a['limit']||0x64,_0x59efe2=_0x13cbf1['length']>=_0x5aa7b3?a54_0x3265bd['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x4e426b(0x274)](_0x4e426b(0x28e)+_0x13cbf1[_0x4e426b(0x1b9)]+_0x4e426b(0x1d4)+(_0x13cbf1['length']!==0x1?'s':'')+_0x59efe2);if(_0x35304a[_0x4e426b(0x256)]==='json'||_0x35304a['format']===_0x4e426b(0x197)||_0x35304a['format']==='table')await handleSDKOutput(_0x13cbf1,_0x35304a);else{if(_0x13cbf1['length']===0x0){if(_0x57b522&&_0x3afb61)console[_0x4e426b(0x25a)](_0x4e426b(0x187)+_0x57b522+'.'+_0x3afb61);else _0x57b522?console[_0x4e426b(0x25a)](_0x4e426b(0x182)+_0x57b522):console[_0x4e426b(0x25a)]('No\x20attempts\x20found');}else{const _0x1fc22d=_0x35304a[_0x4e426b(0x1fa)],_0x185673=_0x13cbf1[_0x4e426b(0x127)](_0x27dd6a=>{const _0x14e5c2=_0x4e426b,_0x2e63c9=a54_0x3265bd['dim']('#'+_0x27dd6a['id']),_0x11dd0d=_0x27dd6a[_0x14e5c2(0x23d)]?.['id'],_0x4ebe76=_0x27dd6a[_0x14e5c2(0x2d2)]||_0x27dd6a[_0x14e5c2(0x1cd)],_0x45caa1=_0x11dd0d&&_0x4ebe76?hyperlink(_0x2e63c9,getWorkflowAttemptUrl(_0x1fc22d,_0x11dd0d,_0x4ebe76,_0x27dd6a['id'])):_0x2e63c9,{icon:_0x3fd399,text:_0x4f164a}=getAttemptStatusDisplay(_0x27dd6a),_0x5b6af0=(_0x27dd6a[_0x14e5c2(0x23d)]?.['name']||'?')+'.'+(_0x27dd6a['workflow']?.['name']||'?'),_0x510517=_0x27dd6a['sessionTime']?a54_0x3265bd[_0x14e5c2(0x1a1)](_0x27dd6a[_0x14e5c2(0x2c5)]):'';return(_0x45caa1+'\x20'+_0x3fd399+(_0x4f164a?'\x20'+_0x4f164a:'')+'\x20'+_0x5b6af0+'\x20'+_0x510517)[_0x14e5c2(0x183)]();});await writeOutput(_0x185673['join']('\x0a'),_0x35304a[_0x4e426b(0x1b6)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a54_0xb99464(0x13a)]=a54_0xb99464(0x240);async['execute'](_0x21faf4){const _0x5cb40f=a54_0xb99464,{options:_0x4d022e,args:_0xb5a7f,tdx:_0x507682}=_0x21faf4,_0x2d40c5=_0xb5a7f[0x0];if(!_0x2d40c5)return console[_0x5cb40f(0x274)](_0x5cb40f(0x2ce)),0x1;_0x4d022e[_0x5cb40f(0x2a9)]&&console[_0x5cb40f(0x274)](_0x5cb40f(0x24c)+_0x2d40c5);const _0x2ffa0c=await withSpinner(_0x5cb40f(0x276),()=>_0x507682[_0x5cb40f(0x229)]['attempt'](_0x2d40c5),{'verbose':_0x4d022e[_0x5cb40f(0x2a9)]}),_0x420c59=_0x2ffa0c[_0x5cb40f(0x149)];let _0x4bace2;!_0x420c59[_0x5cb40f(0x1c6)]?_0x4bace2=_0x420c59[_0x5cb40f(0x11b)]?_0x5cb40f(0x28b):_0x5cb40f(0x148):_0x4bace2=_0x420c59[_0x5cb40f(0x252)]?_0x5cb40f(0x252):_0x5cb40f(0x274);let _0xeb132;if(_0x420c59[_0x5cb40f(0x168)]&&_0x420c59['finishedAt']){const _0x169679=new Date(_0x420c59[_0x5cb40f(0x168)])[_0x5cb40f(0x21b)](),_0x30ca58=new Date(_0x420c59['finishedAt'])[_0x5cb40f(0x21b)]();_0xeb132=Math[_0x5cb40f(0x2cc)]((_0x30ca58-_0x169679)/0x3e8);}const _0x12e788={'attempt_id':_0x420c59['id'],'status':_0x4bace2,..._0x420c59[_0x5cb40f(0x2b2)]!==undefined&&{'index':_0x420c59[_0x5cb40f(0x2b2)]},..._0x420c59[_0x5cb40f(0x23d)]&&{'project':_0x420c59[_0x5cb40f(0x23d)][_0x5cb40f(0x2ba)]},..._0x420c59[_0x5cb40f(0x229)]&&{'workflow':_0x420c59[_0x5cb40f(0x229)][_0x5cb40f(0x2ba)]},..._0x420c59[_0x5cb40f(0x1cd)]&&{'session_id':_0x420c59['sessionId']},..._0x420c59[_0x5cb40f(0x2c5)]&&{'session_time':_0x420c59[_0x5cb40f(0x2c5)]},..._0x420c59[_0x5cb40f(0x26f)]&&{'retry_attempt':_0x420c59[_0x5cb40f(0x26f)]},..._0xeb132!==undefined&&{'duration_sec':_0xeb132},..._0x420c59[_0x5cb40f(0x168)]&&{'created_at':_0x420c59[_0x5cb40f(0x168)]},..._0x420c59['finishedAt']&&{'finished_at':_0x420c59[_0x5cb40f(0x1e6)]},...Object[_0x5cb40f(0x1b8)](_0x420c59[_0x5cb40f(0x158)])['length']>0x0&&{'params':_0x420c59[_0x5cb40f(0x158)]}};return await handleSingleObjectOutput(_0x12e788,_0x4d022e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x1fb);[a54_0xb99464(0x13a)]=a54_0xb99464(0x12d);async[a54_0xb99464(0x1e1)](_0x1808b1){const _0x12e1b4=a54_0xb99464,{options:_0x29bc41,args:_0x1446bb,tdx:_0x3f697f}=_0x1808b1,_0xa43997=_0x1446bb[0x0];if(!_0xa43997)return console[_0x12e1b4(0x274)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x841438=_0x29bc41[_0x12e1b4(0x26d)];_0x29bc41[_0x12e1b4(0x2a9)]&&(console[_0x12e1b4(0x274)](_0x12e1b4(0x24c)+_0xa43997),_0x841438&&console[_0x12e1b4(0x274)](_0x12e1b4(0x1de)));const _0x23f9f2=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x3f697f[_0x12e1b4(0x229)][_0x12e1b4(0x21f)](_0xa43997,_0x841438||![]),{'verbose':_0x29bc41[_0x12e1b4(0x2a9)]}),_0x4695d6=_0x23f9f2['data'];return console[_0x12e1b4(0x274)](_0x12e1b4(0x28e)+_0x4695d6[_0x12e1b4(0x1b9)]+_0x12e1b4(0x208)+(_0x4695d6['length']!==0x1?'s':'')),await handleSDKOutput(_0x4695d6,_0x29bc41),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x20c);['description']=a54_0xb99464(0x191);async['execute'](_0x4c0b88){const _0x3b87b3=a54_0xb99464,{options:_0x23b51f,args:_0x162302,tdx:_0x579c9b}=_0x4c0b88,_0x419065=_0x162302[0x0];let _0x549579=_0x162302[0x1];if(!_0x419065)return console['error'](_0x3b87b3(0x2ce)),0x1;_0x23b51f[_0x3b87b3(0x2a9)]&&(console['error']('Attempt\x20ID:\x20'+_0x419065),_0x549579&&console[_0x3b87b3(0x274)](_0x3b87b3(0x288)+_0x549579));const _0xe0b3f3=await withSpinner('Fetching\x20log\x20files...',()=>_0x579c9b[_0x3b87b3(0x229)][_0x3b87b3(0x21d)](_0x419065,_0x549579),{'verbose':_0x23b51f[_0x3b87b3(0x2a9)]}),_0x8d6098=_0xe0b3f3[_0x3b87b3(0x149)];if(_0x8d6098[_0x3b87b3(0x1b9)]===0x0)return console[_0x3b87b3(0x274)](_0x3b87b3(0x25f)),0x0;if(!_0x549579&&(_0x23b51f['json']||_0x23b51f[_0x3b87b3(0x256)]))return await handleSDKOutput(_0x8d6098,_0x23b51f),0x0;if(!_0x549579){const _0x44de1=_0x8d6098['map'](_0x3222db=>({'title':_0x3222db[_0x3b87b3(0x130)]+'\x20('+formatBytes(_0x3222db[_0x3b87b3(0x2ad)])+')','value':_0x3222db['taskName']})),_0x209aec=await a54_0x24334b({'type':'select','name':_0x3b87b3(0x24b),'message':_0x3b87b3(0x29a),'choices':_0x44de1});if(!_0x209aec['task'])return console[_0x3b87b3(0x274)](_0x3b87b3(0x1af)),0x0;_0x549579=_0x209aec[_0x3b87b3(0x24b)];}const _0x36d1c7=await withSpinner(_0x3b87b3(0x1f7),()=>_0x579c9b[_0x3b87b3(0x229)][_0x3b87b3(0x219)](_0x419065,_0x549579),{'verbose':_0x23b51f[_0x3b87b3(0x2a9)]}),_0x2cc68d=_0x36d1c7[_0x3b87b3(0x149)];return _0x2cc68d?console[_0x3b87b3(0x25a)](_0x2cc68d):console['error'](_0x3b87b3(0x233)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x1ab);[a54_0xb99464(0x13a)]=a54_0xb99464(0x217);async[a54_0xb99464(0x1e1)](_0x7c0d72){const _0x27b9fc=a54_0xb99464,{options:_0x3fb5a4,args:_0x4dbdea,tdx:_0x6f3e73}=_0x7c0d72,_0x346c18=_0x4dbdea[0x0];if(!_0x346c18)return console[_0x27b9fc(0x274)](_0x27b9fc(0x2ce)),0x1;const _0x34c02c=_0x3fb5a4['reason'];_0x3fb5a4[_0x27b9fc(0x2a9)]&&(console[_0x27b9fc(0x274)](_0x27b9fc(0x24c)+_0x346c18),_0x34c02c&&console[_0x27b9fc(0x274)](_0x27b9fc(0x1ae)+_0x34c02c));if(!_0x3fb5a4[_0x27b9fc(0x167)]){if(!isInteractive())return console[_0x27b9fc(0x274)](a54_0x3265bd[_0x27b9fc(0x2aa)]('\x0aError:'),_0x27b9fc(0x2c6)),console[_0x27b9fc(0x274)](a54_0x3265bd[_0x27b9fc(0x1a1)](_0x27b9fc(0x128))),0x1;const _0x4e81ba=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x346c18+'?');if(!_0x4e81ba)return console['error'](a54_0x3265bd[_0x27b9fc(0x267)](_0x27b9fc(0x1af))),0x1;}const _0x546e3d=await withSpinner(_0x27b9fc(0x214),()=>_0x6f3e73[_0x27b9fc(0x229)]['kill'](_0x346c18,_0x34c02c),{'verbose':_0x3fb5a4['verbose']}),_0x5d26fa=_0x546e3d[_0x27b9fc(0x149)];return console[_0x27b9fc(0x274)]('✔\x20'+_0x5d26fa),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x258);['description']=a54_0xb99464(0x2d4);async[a54_0xb99464(0x1e1)](_0x5aae24){const _0x3532ad=a54_0xb99464,{options:_0x595cdf,args:_0x5e39a2,tdx:_0x44aca1}=_0x5aae24,_0x1cfd35=_0x5e39a2[0x0];if(!_0x1cfd35)return console[_0x3532ad(0x274)](_0x3532ad(0x1cb)),console['error'](_0x3532ad(0x22d)),0x1;let _0x1012bf=![],_0x1ff4a4=_0x1cfd35;if(_0x1cfd35[_0x3532ad(0x2d3)](_0x3532ad(0x1aa)))_0x1012bf=!![],_0x1ff4a4=_0x1cfd35['substring'](0x8);else{if(_0x1cfd35[_0x3532ad(0x2d3)](_0x3532ad(0x19c)))_0x1012bf=![],_0x1ff4a4=_0x1cfd35[_0x3532ad(0x297)](0x8);else return console[_0x3532ad(0x274)](_0x3532ad(0x1f5)),console[_0x3532ad(0x274)](_0x3532ad(0x22d)),0x1;}const _0x430805=_0x595cdf[_0x3532ad(0x165)],_0x4cb680=_0x595cdf[_0x3532ad(0x177)],_0x230f07=_0x595cdf[_0x3532ad(0x158)],_0x270b73=_0x595cdf[_0x3532ad(0x14b)];_0x595cdf[_0x3532ad(0x2a9)]&&(console[_0x3532ad(0x274)](_0x3532ad(0x2ae)+(_0x1012bf?_0x3532ad(0x29b):_0x3532ad(0x1ca))+'\x20'+_0x1ff4a4),_0x430805&&console[_0x3532ad(0x274)](_0x3532ad(0x266)+_0x430805),_0x4cb680&&console['error'](_0x3532ad(0x11d)+_0x4cb680),_0x230f07&&console[_0x3532ad(0x274)]('Params:\x20'+_0x230f07),_0x270b73&&console[_0x3532ad(0x274)](_0x3532ad(0x25b)));let _0x40a6c5;if(_0x230f07)try{if(_0x230f07[_0x3532ad(0x2d3)]('@')){const _0x59ac24=await import(_0x3532ad(0x1d3)),_0x4e49f2=_0x230f07[_0x3532ad(0x297)](0x1),_0x5e3d9a=await _0x59ac24[_0x3532ad(0x222)](_0x4e49f2,_0x3532ad(0x140));_0x40a6c5=JSON[_0x3532ad(0x1b0)](_0x5e3d9a);}else _0x40a6c5=JSON[_0x3532ad(0x1b0)](_0x230f07);}catch{return console['error'](_0x3532ad(0x27a)),0x1;}if(!_0x595cdf['yes']){if(!isInteractive())return console['error'](a54_0x3265bd[_0x3532ad(0x2aa)](_0x3532ad(0x11a)),_0x3532ad(0x2c6)),console[_0x3532ad(0x274)](a54_0x3265bd[_0x3532ad(0x1a1)](_0x3532ad(0x128))),0x1;const _0x1d90c9=await confirmKey(_0x3532ad(0x1f1)+(_0x1012bf?_0x3532ad(0x29b):'attempt')+'\x20'+_0x1ff4a4+'?');if(!_0x1d90c9)return console['error'](a54_0x3265bd[_0x3532ad(0x267)]('Cancelled')),0x1;}let _0x4a2bab;_0x1012bf?_0x4a2bab=await withSpinner('Retrying\x20session...',()=>_0x44aca1[_0x3532ad(0x229)]['retrySession'](_0x1ff4a4,{'fromTask':_0x430805,'retryParams':_0x40a6c5}),{'verbose':_0x595cdf[_0x3532ad(0x2a9)]}):_0x4a2bab=await withSpinner('Retrying\x20attempt...',()=>_0x44aca1['workflow']['retryAttempt'](_0x1ff4a4,{'resumeFrom':_0x4cb680,'retryParams':_0x40a6c5,'force':_0x270b73}),{'verbose':_0x595cdf['verbose']});const _0x44fce2=_0x4a2bab[_0x3532ad(0x149)];return console['error'](_0x3532ad(0x235)),console[_0x3532ad(0x274)](_0x3532ad(0x13c)+_0x44fce2[_0x3532ad(0x216)]),console[_0x3532ad(0x274)]('\x20\x20Session\x20ID:\x20'+_0x44fce2[_0x3532ad(0x1cd)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x159);['description']='Start\x20a\x20workflow\x20run';async[a54_0xb99464(0x1e1)](_0x5c78c5){const _0x5c73bd=a54_0xb99464,{options:_0x6a6813,args:_0xf7d53b,tdx:_0x2f8cde}=_0x5c78c5;let _0x351b30=_0xf7d53b[0x0];if(!_0x351b30){const _0x50bf60=this[_0x5c73bd(0x178)]([],_0x6a6813),_0x6abbb2=await withSpinner(_0x5c73bd(0x21e),()=>_0x2f8cde[_0x5c73bd(0x229)][_0x5c73bd(0x1d5)](_0x50bf60,{'limit':_0x6a6813[_0x5c73bd(0x14e)]}),{'verbose':_0x6a6813[_0x5c73bd(0x2a9)]}),_0x2e0a83=_0x6abbb2[_0x5c73bd(0x149)];if(_0x2e0a83[_0x5c73bd(0x1b9)]===0x0)return console[_0x5c73bd(0x274)]('No\x20workflows\x20found'),!_0x50bf60&&console[_0x5c73bd(0x274)](a54_0x3265bd[_0x5c73bd(0x1a1)](_0x5c73bd(0x2bf))),0x1;const _0x5c800c=_0x2e0a83[_0x5c73bd(0x127)](_0x25fbc5=>({'title':_0x25fbc5[_0x5c73bd(0x23d)]?.[_0x5c73bd(0x2ba)]+'.'+_0x25fbc5[_0x5c73bd(0x2ba)],'value':_0x25fbc5[_0x5c73bd(0x23d)]?.['name']+'.'+_0x25fbc5['name'],'description':_0x25fbc5[_0x5c73bd(0x261)]?'revision:\x20'+_0x25fbc5[_0x5c73bd(0x261)]:undefined})),_0x42bda3=await a54_0x24334b({'type':_0x5c73bd(0x173),'name':_0x5c73bd(0x229),'message':_0x5c73bd(0x1a7),'choices':_0x5c800c});if(!_0x42bda3[_0x5c73bd(0x229)])return 0x1;_0x351b30=_0x42bda3[_0x5c73bd(0x229)];}if(!_0x351b30[_0x5c73bd(0x1e0)]('.')){const _0x257dbe=this[_0x5c73bd(0x178)]([],_0x6a6813);if(_0x257dbe)_0x351b30=_0x257dbe+'.'+_0x351b30;else return console[_0x5c73bd(0x274)](a54_0x3265bd['red']('Error:'),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x5c73bd(0x274)](a54_0x3265bd[_0x5c73bd(0x1a1)](_0x5c73bd(0x2bf))),0x1;}const _0x378063=_0x6a6813[_0x5c73bd(0x21a)],_0x21eed2=_0x6a6813[_0x5c73bd(0x2c5)],_0x3240e6={};if(_0x378063&&Array[_0x5c73bd(0x2ab)](_0x378063))for(const _0x4ae9a1 of _0x378063){const _0x3d6708=_0x4ae9a1[_0x5c73bd(0x1a9)]('=');if(_0x3d6708===-0x1)return console[_0x5c73bd(0x274)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4ae9a1),console[_0x5c73bd(0x274)](_0x5c73bd(0x228)),0x1;const _0x67a7f1=_0x4ae9a1['substring'](0x0,_0x3d6708),_0x33cb36=_0x4ae9a1[_0x5c73bd(0x297)](_0x3d6708+0x1);try{_0x3240e6[_0x67a7f1]=JSON['parse'](_0x33cb36);}catch{_0x3240e6[_0x67a7f1]=_0x33cb36;}}_0x6a6813[_0x5c73bd(0x2a9)]&&(console[_0x5c73bd(0x274)](_0x5c73bd(0x17c)+_0x351b30),Object[_0x5c73bd(0x1b8)](_0x3240e6)[_0x5c73bd(0x1b9)]>0x0&&console[_0x5c73bd(0x274)](_0x5c73bd(0x154)+JSON['stringify'](_0x3240e6)),_0x21eed2&&console[_0x5c73bd(0x274)]('Session\x20time:\x20'+_0x21eed2));const _0x3daf52=await withSpinner(_0x5c73bd(0x23e),()=>_0x2f8cde[_0x5c73bd(0x229)][_0x5c73bd(0x153)](_0x351b30,_0x3240e6,{'sessionTime':_0x21eed2}),{'verbose':_0x6a6813[_0x5c73bd(0x2a9)]}),_0x529d95=_0x3daf52[_0x5c73bd(0x149)];console[_0x5c73bd(0x274)]('✔\x20Workflow\x20run\x20started'),console['error'](_0x5c73bd(0x111)+_0x529d95['id']),console[_0x5c73bd(0x274)](_0x5c73bd(0x2b7)+_0x529d95[_0x5c73bd(0x1cd)]),console[_0x5c73bd(0x274)]('\x20\x20Project:\x20'+_0x529d95[_0x5c73bd(0x23d)]?.['name']),console[_0x5c73bd(0x274)](_0x5c73bd(0x236)+_0x529d95[_0x5c73bd(0x229)]?.[_0x5c73bd(0x2ba)]);if(_0x529d95[_0x5c73bd(0x23d)]?.['id']&&_0x529d95[_0x5c73bd(0x1cd)]&&_0x529d95['id']){const _0x31fe60=_0x6a6813[_0x5c73bd(0x1fa)],_0x1b64f5=getConsoleUrl(_0x31fe60,'/app/workflows/'+_0x529d95[_0x5c73bd(0x23d)]['id']+_0x5c73bd(0x1ce)+_0x529d95[_0x5c73bd(0x1cd)]+_0x5c73bd(0x28d)+_0x529d95['id']);console[_0x5c73bd(0x274)]('\x20\x20Console:\x20'+a54_0x3265bd['cyan'](_0x1b64f5));}return 0x0;}}function a54_0x299b(){const _0x3bed1f=['buildTimelineData','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','workflow:schedule:enable','GUTTER','map','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20Workflow\x20project\x20context\x20cleared.','LABEL_MIN_SPACING','every','padStart','Show\x20tasks\x20for\x20an\x20attempt','projectId','pullProject','taskName','getMinutes','key','-\x20no\x20files\x20written','\x20(system)','\x20deleted','MAX_TIMELINE_WIDTH','nextRunTime','set','generateSessionTimelineRows','description','type','\x20\x20New\x20attempt\x20ID:\x20','modified','→\x20Project:\x20','filter','utf-8','Project\x20directory:\x20','Source\x20project:\x20','workflow:timeline','blue','isTTY','No\x20sessions\x20with\x20timing\x20information','List\x20workflow\x20attempts','running','data','Disabling\x20schedule\x20#','force','splice','deleted','limit','---\x20','Error:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','text','run','Parameters:\x20','repeat','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','list','params','workflow:run','(unknown)','parseProjectWorkflowPattern','size','Target\x20directory:\x20','\x20to\x20see\x20detailed\x20logs','columns','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','List\x20workflows','1zlKEdu','disableSchedule','Project\x20name\x20is\x20required','fromTask','Session\x20not\x20found:\x20','yes','createdAt','-\x20nothing\x20pushed','title','toLocaleString','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','clear','\x20logs','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:set','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','45tbzrvB','select','\x20\x20Project:\x20','\x20new','\x22\x20already\x20exists\x20(ID:\x20','resumeFrom','resolveProject','status','\x27\x20from\x20project\x20\x27','💡\x20Tip:\x20Use\x20','Workflow:\x20','\x20enabled\x20(','Key\x20cannot\x20be\x20empty','workflowName','Filter:\x20','Downloading\x20project\x20','No\x20attempts\x20found\x20in\x20project:\x20','trimEnd','\x0aDry\x20run\x20-\x20no\x20files\x20written','✔\x20Push\x20complete','now','No\x20attempts\x20found\x20for:\x20','Enable\x20a\x20workflow\x20schedule','\x20-\x20','\x20\x20Project\x20ID:\x20','fill','durationMs','sys','workflow:attempts','Pushing\x20project...','changes','Show\x20logs\x20for\x20a\x20workflow\x20attempt','List\x20workflow\x20execution\x20sessions','203496NzmBtJ','stdout','tdx\x20wf\x20attempt\x20','sourceProjectName','jsonl','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x1b[1A\x1b[2K','TASK_NAME_WIDTH','MAX_POLL_ITERATIONS','attempt:','Updating\x20','Include\x20retried:\x20yes','match','\x20\x20Revision:\x20','dim','No\x20workflow\x20sessions\x20found','\x20\x20Location:\x20','enableSchedule','attempts','Dry\x20run:\x20yes','Select\x20a\x20workflow\x20to\x20run','msPerChar','indexOf','session:','workflow:kill','cyan','Deleting\x20project\x20','Reason:\x20','Cancelled','parse','Select\x20a\x20session\x20to\x20view\x20timeline:','Revision:\x20','Listing\x20secrets...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x20\x20Console:\x20','output','cwd','keys','length','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20(disabled)','sort','Session\x20','workflow:use','Schedule\x20ID\x20is\x20required','message','table','tdx.json','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','startedAt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','done','\x20from\x20session\x20','1967182NMNrhv','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','attempt','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','MAX_LABEL_COUNT','sessionId','/sessions/','hasChanges','from','\x20is\x20not\x20a\x20directory','localeCompare','fs/promises','\x20attempt','workflows','applyPullProject','LABEL_WIDTH_DIVISOR','state','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','resolve','pending','Error:','rows','Including\x20subtasks:\x20yes','targetDir','includes','execute','getDate','✔\x20Secret\x20\x27','renderSessionsTimeline','✔\x20Project\x20updated','finishedAt','Listing\x20workflows...','Status:\x20','stat','Listing\x20workflow\x20attempts...','path','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:pull','\x20of\x20','requireProject','startTime','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Tip:\x20cd\x20to\x20workflows/','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20\x20Next\x20run:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','floor','Downloading\x20logs...','Validation:\x20skipped','\x20\x20tdx\x20wf\x20use\x20<project>','site','workflow:tasks','displayLine','No\x20projects\x20match\x20pattern:\x20','unchanged','end','workflow:projects','Deleting\x20secret...','summary','planned','workflow:schedule:disable','Pattern:\x20','lastAttempt','\x20secrets\x20set\x20for\x20project\x20\x27','\x20task','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','duration','\x20workflow','workflow:logs','all','preparePushProject','pollTimeline','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Loading\x20session...','✔\x20Schedule\x20#','workflow:clone','Killing\x20attempt...',',\x20Workflow:\x20','attemptId','Kill\x20a\x20running\x20attempt','sessions','logs','param','getTime','has','logFiles','Loading\x20workflows...','tasks','trim','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','readFile','white','renderSingleTimeline','\x20schedule','📅\x20#','workflow:delete','Expected\x20format:\x20--param\x20key=value','workflow','No\x20schedules\x20found','getHours','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','✔\x20Deleted\x20project\x20','\x0a✔\x20Already\x20up\x20to\x20date','projects','group_error','listSecrets','No\x20log\x20content\x20found','Warning:','✔\x20Retry\x20started','\x20\x20Workflow:\x20','join','newProjectName','✔\x20Showing\x20','workflowProject','Failed\x20to\x20fetch\x20attempt\x20data','Secrets\x20to\x20set:\x20','project','Starting\x20workflow\x20run...','some','Show\x20specific\x20attempt\x20details','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','split','Key:\x20','Listing\x20schedules...','📋\x20','workflow:workflows','✔\x20Pull\x20complete','\x22\x20with\x20new\x20revision?','follow','Output\x20directory:\x20','task','Attempt\x20ID:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','ICON_WIDTH','basename','workflow:download','862614SyoUpJ','success','deleteSecret','getFullYear','prepareCloneProject','format','...','workflow:retry','slice','log','Force:\x20yes','value','Setting\x20secret...','Cloning\x20to\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Files\x20to\x20upload:\x20','revision','Filter:\x20project=','Using\x20attempt\x20','Error:\x20Secret\x20key\x20is\x20required','unknown','From\x20task:\x20','yellow','\x0aDry\x20run\x20-\x20no\x20project\x20created','668034wIrfkj','workflow:schedules','\x0a✔\x20No\x20changes\x20to\x20push','projectName','includeSubtasks','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','retryAttemptName','disabledAt','\x20sessions\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x0aPush\x20these\x20changes?','error','fullName','Getting\x20attempt\x20details...','\x0a✔\x20Attempt\x20complete','886368VRdtji','json','Error:\x20Invalid\x20JSON\x20in\x20--params','\x22\x20to\x20new\x20project\x20\x22','\x20disabled\x20(','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','updatedAt','Pull\x20workflow\x20project\x20to\x20local\x20folder','workflow:upload','\x20\x20Target:\x20','\x20secret','write','resolveProjectDir','ICON_SPACING','\x20next:\x20','\x20has\x20no\x20attempts','Task\x20name:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','\x0a⚠\x20Project\x20\x22','canceling','start','/attempt/','✔\x20Found\x20','Resolving\x20project\x20\x27','📁\x20','MAX_TASKS_DISPLAY','No\x20sessions\x20found\x20for:\x20','icon','navigateSessionsInteractive','Invalid\x20format:\x20','diff','substring','\x0aClone\x20\x22','No\x20workflow\x20projects\x20found','Select\x20a\x20task\x20to\x20view\x20logs:','session','4xCFImk','toISOString','Attempt:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20tasks','find','Error:\x20Project\x20name\x20is\x20required','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Analyzing\x20project...','Project:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','resolveProjectId','verbose','red','isArray','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','fileSize','Target:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','max','showWorkflowConsoleUrl','index','dryRun','newProjectId','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x20\x20Session\x20ID:\x20','Source\x20directory\x20is\x20required','Total:\x20','name','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','getMonth','skipValidation','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','targetExists','sourceDir','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','push','min','sessionTime','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Setting\x20','window','delete','toLowerCase','round','context','Error:\x20Attempt\x20ID\x20is\x20required','Listing\x20workflow\x20projects...','.\x20Expected\x20format:\x20KEY=VALUE','New\x20project\x20name:\x20','session_id','startsWith','Retry\x20a\x20session\x20or\x20attempt','\x20unchanged','(use\x20--limit\x20to\x20see\x20more)','\x20\x20Attempt\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','new','1879855nQFyCn','Latest\x20session\x20has\x20no\x20attempt','MIN_TIMELINE_WIDTH','isDirectory','get','green','\x0aError:','cancelRequested','\x20\x20Session\x20context\x20set\x20to:\x20','Resume\x20from:\x20','No\x20workflow\x20tdx.json\x20found','\x0aApply\x20these\x20changes?','relative','workflow:secrets:delete','524280UNQvkP'];a54_0x299b=function(){return _0x3bed1f;};return a54_0x299b();}export class WorkflowDownloadCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x250);[a54_0xb99464(0x13a)]=a54_0xb99464(0x2a4);async[a54_0xb99464(0x1e1)](_0x46c51c){const _0x32a1d2=a54_0xb99464,{options:_0x52696e,args:_0x26c995,tdx:_0x17de19}=_0x46c51c,_0x511835=_0x26c995[0x0],_0x4a4122=_0x26c995[0x1]||'.';if(!_0x511835)return console[_0x32a1d2(0x274)](_0x32a1d2(0x2a3)),console[_0x32a1d2(0x274)](_0x32a1d2(0x171)),0x1;const _0x4bc4de=_0x52696e[_0x32a1d2(0x261)];_0x52696e[_0x32a1d2(0x2a9)]&&(console[_0x32a1d2(0x274)](_0x32a1d2(0x2a6)+_0x511835),console[_0x32a1d2(0x274)](_0x32a1d2(0x24a)+_0x4a4122),_0x4bc4de&&console['error'](_0x32a1d2(0x1b2)+_0x4bc4de));const _0x3aa670=await withSpinner(_0x32a1d2(0x181)+_0x511835+'...',()=>_0x17de19[_0x32a1d2(0x229)]['download'](_0x511835,_0x4a4122,{'revision':_0x4bc4de}),{'verbose':_0x52696e[_0x32a1d2(0x2a9)]}),_0x4c756b=_0x3aa670[_0x32a1d2(0x149)];return console[_0x32a1d2(0x274)]('✔\x20Downloaded\x20'+_0x4c756b['projectName']),console[_0x32a1d2(0x274)]('\x20\x20Revision:\x20'+_0x4c756b[_0x32a1d2(0x261)]),console[_0x32a1d2(0x274)]('\x20\x20Files\x20extracted:\x20'+_0x4c756b['filesExtracted']),console[_0x32a1d2(0x274)](_0x32a1d2(0x1a3)+_0x4a4122+'/'+_0x4c756b[_0x32a1d2(0x26c)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a54_0xb99464(0x280);['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a54_0xb99464(0x1e1)](_0x2a319e){const _0x367579=a54_0xb99464,{options:_0x23ef49,args:_0x4e5961,tdx:_0x1ba1fc}=_0x2a319e;let _0x3fe75f='.',_0x221cbc=_0x23ef49[_0x367579(0x2ba)];if(_0x4e5961[0x0]){const {promises:_0x32ca38}=await import('fs');try{const _0xf83499=await _0x32ca38[_0x367579(0x1e9)](_0x4e5961[0x0]);if(_0xf83499[_0x367579(0x117)]())_0x3fe75f=_0x4e5961[0x0];else return console[_0x367579(0x274)](_0x367579(0x150)+_0x4e5961[0x0]+_0x367579(0x1d1)),0x1;}catch{_0x221cbc=_0x4e5961[0x0],_0x3fe75f='.';}}const _0x36ac8c=_0x23ef49[_0x367579(0x261)],_0x489ef1=_0x23ef49[_0x367579(0x2bd)];_0x23ef49['verbose']&&(console['error'](_0x367579(0x141)+_0x3fe75f),_0x221cbc&&console[_0x367579(0x274)]('Project\x20name:\x20'+_0x221cbc),_0x36ac8c&&console[_0x367579(0x274)](_0x367579(0x1b2)+_0x36ac8c),_0x489ef1&&console[_0x367579(0x274)](_0x367579(0x1f8)));const _0xf65953=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x1ba1fc[_0x367579(0x229)][_0x367579(0x2c3)](_0x3fe75f,{'projectName':_0x221cbc,'revision':_0x36ac8c,'skipValidation':_0x489ef1}),{'verbose':_0x23ef49['verbose']}),_0x2a5a83=_0xf65953[_0x367579(0x149)];return console[_0x367579(0x274)]('✔\x20Pushed\x20'+_0x2a5a83['projectName']),console[_0x367579(0x274)](_0x367579(0x18a)+_0x2a5a83[_0x367579(0x12e)]),console[_0x367579(0x274)](_0x367579(0x1a0)+_0x2a5a83[_0x367579(0x261)]),await this[_0x367579(0x2b1)](_0x1ba1fc,_0x2a5a83['projectName'],_0x23ef49[_0x367579(0x1fa)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0xb99464(0x1ed);['description']=a54_0xb99464(0x27f);async[a54_0xb99464(0x1e1)](_0x5bbb58){const _0xe53570=a54_0xb99464,{options:_0x721f6f,args:_0x3f8c5e,tdx:_0x276b6b}=_0x5bbb58,_0x26f1a7=_0x3f8c5e[0x0],_0x5df5a0=_0x3f8c5e[0x1];if(!_0x26f1a7)return console['error'](a54_0x3265bd[_0xe53570(0x2aa)](_0xe53570(0x1dc)),_0xe53570(0x164)),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2783df=_0x721f6f[_0xe53570(0x261)];_0x721f6f['verbose']&&(console[_0xe53570(0x274)](_0xe53570(0x2a6)+_0x26f1a7),_0x5df5a0&&console[_0xe53570(0x274)](_0xe53570(0x15d)+_0x5df5a0),_0x2783df&&console[_0xe53570(0x274)](_0xe53570(0x1b2)+_0x2783df),_0x721f6f[_0xe53570(0x2b3)]&&console['error']('Dry\x20run:\x20yes'));const _0x42c850=await withSpinner('Pulling\x20project\x20'+_0x26f1a7+_0xe53570(0x257),()=>_0x276b6b[_0xe53570(0x229)][_0xe53570(0x12f)](_0x26f1a7,{'targetDir':_0x5df5a0,'revision':_0x2783df}),{'verbose':_0x721f6f[_0xe53570(0x2a9)]}),_0x150a2b=_0x42c850[_0xe53570(0x149)];_0x150a2b['isNewProject']?console[_0xe53570(0x274)]('→\x20New\x20project:\x20'+_0x150a2b[_0xe53570(0x26c)]):console[_0xe53570(0x274)](_0xe53570(0x13e)+_0x150a2b[_0xe53570(0x26c)]);console[_0xe53570(0x274)](_0xe53570(0x1a0)+_0x150a2b['revision']),console['error'](_0xe53570(0x281)+(a54_0x5df1b0['relative'](process['cwd'](),_0x150a2b[_0xe53570(0x1df)])||'.')),console[_0xe53570(0x274)]('\x20\x20Changes:\x20'+a54_0x3265bd[_0xe53570(0x119)]('+'+_0x150a2b[_0xe53570(0x202)][_0xe53570(0x113)]+_0xe53570(0x175))+',\x20'+(a54_0x3265bd[_0xe53570(0x267)]('~'+_0x150a2b[_0xe53570(0x202)][_0xe53570(0x13d)]+'\x20modified')+',\x20')+(a54_0x3265bd[_0xe53570(0x2aa)]('-'+_0x150a2b['summary'][_0xe53570(0x14d)]+_0xe53570(0x135))+',\x20')+(''+a54_0x3265bd[_0xe53570(0x1a1)](_0x150a2b[_0xe53570(0x202)][_0xe53570(0x1fe)]+_0xe53570(0x2d5))));for(const _0x3fc133 of _0x150a2b['changes']){_0x3fc133[_0xe53570(0x13b)]===_0xe53570(0x13d)&&_0x3fc133['diff']&&(console[_0xe53570(0x274)]('\x0a'+a54_0x3265bd[_0xe53570(0x1ac)]('---\x20'+_0x3fc133[_0xe53570(0x1eb)])),console[_0xe53570(0x274)](_0x3fc133['diff']));}if(!_0x150a2b[_0xe53570(0x1cf)])return saveSessionContext({'workflow_project':_0x150a2b[_0xe53570(0x26c)]},_0x721f6f[_0xe53570(0x29b)]),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x119)](_0xe53570(0x22f))),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)](_0xe53570(0x11c)+_0x150a2b[_0xe53570(0x26c)])),0x0;if(_0x721f6f[_0xe53570(0x2b3)])return console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x267)](_0xe53570(0x184))),0x0;if(!_0x721f6f[_0xe53570(0x167)]){if(!isInteractive())return console['error'](a54_0x3265bd['red'](_0xe53570(0x11a)),_0xe53570(0x2c6)),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)](_0xe53570(0x128))),0x1;const _0x4f3e10=await confirmKey(_0xe53570(0x11f));if(!_0x4f3e10)return console['error'](a54_0x3265bd['yellow'](_0xe53570(0x1af)),_0xe53570(0x133)),0x1;}await withSpinner('Writing\x20files...',()=>_0x276b6b[_0xe53570(0x229)][_0xe53570(0x1d6)](_0x150a2b,{'revision':_0x2783df}),{'verbose':_0x721f6f['verbose']}),saveSessionContext({'workflow_project':_0x150a2b[_0xe53570(0x26c)]},_0x721f6f[_0xe53570(0x29b)]),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x119)](_0xe53570(0x247)));const _0x2c71ca=a54_0x5df1b0[_0xe53570(0x120)](process['cwd'](),_0x150a2b[_0xe53570(0x1df)])||'.';return console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)]('\x20\x20Location:\x20'+_0x2c71ca)),console[_0xe53570(0x274)](a54_0x3265bd[_0xe53570(0x1a1)](_0xe53570(0x11c)+_0x150a2b[_0xe53570(0x26c)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]='workflow:push';['description']=a54_0xb99464(0x209);async['execute'](_0x2b468e){const _0x1bec1d=a54_0xb99464,{options:_0x45e6c1,args:_0x55246c,tdx:_0x2b29b3}=_0x2b468e,_0x214af6=this[_0x1bec1d(0x284)](_0x55246c,_0x45e6c1),_0x112555=_0x45e6c1[_0x1bec1d(0x261)],_0x3106ed=_0x45e6c1[_0x1bec1d(0x2bd)];_0x45e6c1[_0x1bec1d(0x2a9)]&&(_0x214af6&&console[_0x1bec1d(0x274)]('Source\x20directory:\x20'+_0x214af6),_0x112555&&console['error'](_0x1bec1d(0x1b2)+_0x112555),_0x45e6c1[_0x1bec1d(0x2b3)]&&console['error']('Dry\x20run:\x20yes'),_0x3106ed&&console[_0x1bec1d(0x274)]('Validation:\x20skipped'));let _0x25e1bf;try{_0x25e1bf=await withSpinner('Analyzing\x20changes...',()=>_0x2b29b3[_0x1bec1d(0x229)][_0x1bec1d(0x20e)]({'sourceDir':_0x214af6,'revision':_0x112555,'skipValidation':_0x3106ed}),{'verbose':_0x45e6c1[_0x1bec1d(0x2a9)]});}catch(_0x249a40){if(_0x249a40 instanceof Error&&_0x249a40[_0x1bec1d(0x1c0)][_0x1bec1d(0x1e0)](_0x1bec1d(0x11e)))return console['error'](a54_0x3265bd[_0x1bec1d(0x2aa)]('Error:'),_0x1bec1d(0x1b4)),_0x45e6c1[_0x1bec1d(0x23a)]?console[_0x1bec1d(0x274)](a54_0x3265bd['dim'](_0x1bec1d(0x1f2)+_0x45e6c1['workflowProject']+_0x1bec1d(0x2c2)+_0x45e6c1[_0x1bec1d(0x23a)]+'\x27')):console[_0x1bec1d(0x274)](a54_0x3265bd['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x249a40;}const _0x56cdcd=_0x25e1bf[_0x1bec1d(0x149)];console[_0x1bec1d(0x274)]('✔\x20Project:\x20'+_0x56cdcd[_0x1bec1d(0x26c)]),console[_0x1bec1d(0x274)]('\x20\x20Source:\x20'+_0x56cdcd[_0x1bec1d(0x2c1)]),console[_0x1bec1d(0x274)](_0x1bec1d(0x1a0)+_0x56cdcd['revision']),console[_0x1bec1d(0x274)]('\x20\x20Changes:\x20'+a54_0x3265bd[_0x1bec1d(0x119)]('+'+_0x56cdcd[_0x1bec1d(0x202)][_0x1bec1d(0x113)]+_0x1bec1d(0x175))+',\x20'+(a54_0x3265bd[_0x1bec1d(0x267)]('~'+_0x56cdcd['summary']['modified']+'\x20modified')+',\x20')+(a54_0x3265bd[_0x1bec1d(0x2aa)]('-'+_0x56cdcd['summary'][_0x1bec1d(0x14d)]+'\x20deleted')+',\x20')+(''+a54_0x3265bd[_0x1bec1d(0x1a1)](_0x56cdcd[_0x1bec1d(0x202)][_0x1bec1d(0x1fe)]+'\x20unchanged')));for(const _0x100a5a of _0x56cdcd[_0x1bec1d(0x190)]){_0x100a5a[_0x1bec1d(0x13b)]===_0x1bec1d(0x13d)&&_0x100a5a[_0x1bec1d(0x296)]&&(console['error']('\x0a'+a54_0x3265bd['cyan'](_0x1bec1d(0x14f)+_0x100a5a['path'])),console[_0x1bec1d(0x274)](_0x100a5a[_0x1bec1d(0x296)]));}if(!_0x56cdcd[_0x1bec1d(0x1cf)])return console[_0x1bec1d(0x274)](a54_0x3265bd[_0x1bec1d(0x119)](_0x1bec1d(0x26b))),await this[_0x1bec1d(0x2b1)](_0x2b29b3,_0x56cdcd[_0x1bec1d(0x26c)],_0x45e6c1[_0x1bec1d(0x1fa)]),0x0;if(_0x45e6c1[_0x1bec1d(0x2b3)])return console['error'](a54_0x3265bd[_0x1bec1d(0x267)](_0x1bec1d(0x272))),0x0;if(!_0x45e6c1[_0x1bec1d(0x167)]){if(!isInteractive())return console['error'](a54_0x3265bd[_0x1bec1d(0x2aa)](_0x1bec1d(0x11a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x3265bd[_0x1bec1d(0x1a1)](_0x1bec1d(0x128))),0x1;const _0x55cc83=await confirmKey(_0x1bec1d(0x273));if(!_0x55cc83)return console[_0x1bec1d(0x274)](a54_0x3265bd[_0x1bec1d(0x267)](_0x1bec1d(0x1af)),_0x1bec1d(0x169)),0x1;}const _0x310bf2=await withSpinner(_0x1bec1d(0x18f),()=>_0x2b29b3[_0x1bec1d(0x229)]['executePushProject'](_0x56cdcd),{'verbose':_0x45e6c1[_0x1bec1d(0x2a9)]}),_0x91cce=_0x310bf2['data'];return console['error'](a54_0x3265bd[_0x1bec1d(0x119)](_0x1bec1d(0x185))),console['error']('\x20\x20Project\x20ID:\x20'+_0x91cce['projectId']),console[_0x1bec1d(0x274)](_0x1bec1d(0x1a0)+_0x91cce[_0x1bec1d(0x261)]),await this[_0x1bec1d(0x2b1)](_0x2b29b3,_0x91cce[_0x1bec1d(0x26c)],_0x45e6c1[_0x1bec1d(0x1fa)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x213);[a54_0xb99464(0x13a)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0x343944){const _0xece189=a54_0xb99464,{options:_0x2ebe78,args:_0xb69c2b,tdx:_0x3cbcee}=_0x343944,_0x1b9898=this[_0xece189(0x284)](_0xb69c2b,_0x2ebe78),_0x829c58=_0x2ebe78[_0xece189(0x2ba)],_0x22cf1a=_0x2ebe78[_0xece189(0x261)],_0x2fe329=_0x2ebe78['skipValidation'];if(!_0x1b9898)return console['error'](a54_0x3265bd[_0xece189(0x2aa)]('Error:'),_0xece189(0x2b8)),console[_0xece189(0x274)](a54_0x3265bd[_0xece189(0x1a1)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a54_0x3265bd['dim'](_0xece189(0x29f))),0x1;if(!_0x829c58)return console['error'](a54_0x3265bd['red']('Error:'),_0xece189(0x160)),console[_0xece189(0x274)](a54_0x3265bd['dim'](_0xece189(0x1d9))),0x1;_0x2ebe78[_0xece189(0x2a9)]&&(console[_0xece189(0x274)]('Source\x20directory:\x20'+_0x1b9898),console[_0xece189(0x274)](_0xece189(0x2d1)+_0x829c58),_0x22cf1a&&console['error'](_0xece189(0x1b2)+_0x22cf1a),_0x2ebe78[_0xece189(0x2b3)]&&console[_0xece189(0x274)](_0xece189(0x1a6)),_0x2fe329&&console['error'](_0xece189(0x1f8)));const _0x35b9f0=await withSpinner(_0xece189(0x2a5),()=>_0x3cbcee[_0xece189(0x229)][_0xece189(0x255)](_0x1b9898,_0x829c58,{'revision':_0x22cf1a,'skipValidation':_0x2fe329}),{'verbose':_0x2ebe78['verbose']}),_0x46c4a0=_0x35b9f0[_0xece189(0x149)];console['error']('Source:\x20'+_0x46c4a0['sourceDir']);_0x46c4a0[_0xece189(0x196)]&&console[_0xece189(0x274)](_0xece189(0x142)+_0x46c4a0[_0xece189(0x196)]);console[_0xece189(0x274)](_0xece189(0x2d1)+_0x46c4a0['newProjectName']),console['error'](_0xece189(0x1b2)+_0x46c4a0[_0xece189(0x261)]),console[_0xece189(0x274)](_0xece189(0x260)+_0x46c4a0['fileCount']);_0x46c4a0[_0xece189(0x2c0)]&&(console[_0xece189(0x274)](a54_0x3265bd['yellow'](_0xece189(0x28a)+_0x46c4a0[_0xece189(0x238)]+_0xece189(0x176)+_0x46c4a0['existingProjectId']+')')),console[_0xece189(0x274)](a54_0x3265bd[_0xece189(0x267)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x2ebe78[_0xece189(0x2b3)])return console['error'](a54_0x3265bd[_0xece189(0x267)](_0xece189(0x268))),0x0;if(!_0x2ebe78[_0xece189(0x167)]){if(!isInteractive())return console[_0xece189(0x274)](a54_0x3265bd['red']('\x0aError:'),_0xece189(0x2c6)),console['error'](a54_0x3265bd[_0xece189(0x1a1)](_0xece189(0x128))),0x1;const _0x7c2bb0=_0x46c4a0[_0xece189(0x196)]||a54_0x5df1b0[_0xece189(0x24f)](_0x1b9898),_0x431632=_0x46c4a0['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x829c58+_0xece189(0x248):_0xece189(0x298)+_0x7c2bb0+_0xece189(0x27b)+_0x829c58+'\x22?',_0x6da01a=await confirmKey(_0x431632);if(!_0x6da01a)return console['error'](a54_0x3265bd[_0xece189(0x267)](_0xece189(0x1af))),0x1;}const _0x4bacfc=await withSpinner(_0x46c4a0[_0xece189(0x2c0)]?_0xece189(0x19d)+_0x829c58+_0xece189(0x257):_0xece189(0x25e)+_0x829c58+_0xece189(0x257),()=>_0x3cbcee[_0xece189(0x229)]['executeCloneProject'](_0x46c4a0),{'verbose':_0x2ebe78['verbose']}),_0x3f16e1=_0x4bacfc[_0xece189(0x149)];return console[_0xece189(0x274)](a54_0x3265bd[_0xece189(0x119)](_0x46c4a0[_0xece189(0x2c0)]?_0xece189(0x1e5):'✔\x20Clone\x20complete')),console['error'](_0xece189(0x174)+_0x3f16e1[_0xece189(0x238)]),console[_0xece189(0x274)](_0xece189(0x18a)+_0x3f16e1[_0xece189(0x2b4)]),console[_0xece189(0x274)](_0xece189(0x1a0)+_0x3f16e1['revision']),await this['showWorkflowConsoleUrl'](_0x3cbcee,_0x3f16e1[_0xece189(0x238)],_0x2ebe78['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a54_0xb99464(0x227);[a54_0xb99464(0x13a)]=a54_0xb99464(0x2a7);async[a54_0xb99464(0x1e1)](_0x4d30f1){const _0x20b8f0=a54_0xb99464,{options:_0x40f212,args:_0x30fe27,tdx:_0x5069d5}=_0x4d30f1,_0x4a6d61=_0x30fe27[0x0];if(!_0x4a6d61)return console[_0x20b8f0(0x274)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x20b8f0(0x274)](_0x20b8f0(0x151)),0x1;_0x40f212['verbose']&&console[_0x20b8f0(0x274)](_0x20b8f0(0x2a6)+_0x4a6d61);if(!_0x40f212[_0x20b8f0(0x167)]){if(!isInteractive())return console[_0x20b8f0(0x274)](a54_0x3265bd[_0x20b8f0(0x2aa)](_0x20b8f0(0x11a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20b8f0(0x274)](a54_0x3265bd[_0x20b8f0(0x1a1)](_0x20b8f0(0x128))),0x1;const _0x47693d=await confirmKey(_0x20b8f0(0x16c)+_0x4a6d61+_0x20b8f0(0x289));if(!_0x47693d)return console[_0x20b8f0(0x274)](a54_0x3265bd[_0x20b8f0(0x267)](_0x20b8f0(0x1af))),0x1;}const _0x471056=await withSpinner(_0x20b8f0(0x1ad)+_0x4a6d61+_0x20b8f0(0x257),()=>_0x5069d5[_0x20b8f0(0x229)][_0x20b8f0(0x2ca)](_0x4a6d61),{'verbose':_0x40f212[_0x20b8f0(0x2a9)]}),_0x58a3c2=_0x471056[_0x20b8f0(0x149)];return console[_0x20b8f0(0x274)](_0x20b8f0(0x22e)+_0x58a3c2[_0x20b8f0(0x26c)]),console[_0x20b8f0(0x274)](_0x20b8f0(0x18a)+_0x58a3c2[_0x20b8f0(0x12e)]),0x0;}}export function parseKeyValue(_0x284ae2){const _0x1ff25b=a54_0xb99464,_0x1a7bfe=_0x284ae2[_0x1ff25b(0x1a9)]('=');if(_0x1a7bfe===-0x1)throw new Error(_0x1ff25b(0x295)+_0x284ae2+_0x1ff25b(0x2d0));const _0x1e11f1=_0x284ae2[_0x1ff25b(0x297)](0x0,_0x1a7bfe),_0x3012be=_0x284ae2[_0x1ff25b(0x297)](_0x1a7bfe+0x1);if(!_0x1e11f1)throw new Error(_0x1ff25b(0x17e));return{'key':_0x1e11f1,'value':_0x3012be};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]='workflow:secrets:list';[a54_0xb99464(0x13a)]=a54_0xb99464(0x26e);async['execute'](_0x304764){const _0x3e21a3=a54_0xb99464,{options:_0x1e654b,args:_0x929bfb,tdx:_0x57a8f9}=_0x304764,_0x1467ef=this[_0x3e21a3(0x1ef)](_0x929bfb,_0x1e654b);if(!_0x1467ef)return 0x1;_0x1e654b['verbose']&&console[_0x3e21a3(0x274)](_0x3e21a3(0x2a6)+_0x1467ef);const _0x54ecc1=await withSpinner(_0x3e21a3(0x1b3),()=>_0x57a8f9[_0x3e21a3(0x229)][_0x3e21a3(0x232)](_0x1467ef),{'verbose':_0x1e654b[_0x3e21a3(0x2a9)]}),{secrets:_0x20431a}=_0x54ecc1[_0x3e21a3(0x149)];return console[_0x3e21a3(0x274)](_0x3e21a3(0x28e)+_0x20431a['length']+_0x3e21a3(0x282)+(_0x20431a[_0x3e21a3(0x1b9)]!==0x1?'s':'')),await handleSDKOutput(_0x20431a,_0x1e654b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x170);[a54_0xb99464(0x13a)]=a54_0xb99464(0x1f3);async['execute'](_0x3b3dd2){const _0xf25ad7=a54_0xb99464,{options:_0x566f19,args:_0x1481a2,tdx:_0x25d265}=_0x3b3dd2;let _0x554b4e,_0x17715a;if(_0x1481a2['length']>=0x1&&!_0x1481a2[0x0][_0xf25ad7(0x1e0)]('='))_0x554b4e=_0x1481a2[0x0],_0x17715a=_0x1481a2[_0xf25ad7(0x259)](0x1);else{if(_0x1481a2['length']>=0x1&&_0x566f19[_0xf25ad7(0x23a)])_0x554b4e=_0x566f19[_0xf25ad7(0x23a)],_0x17715a=_0x1481a2;else return _0x1481a2[_0xf25ad7(0x1b9)]>=0x1?(console[_0xf25ad7(0x274)](_0xf25ad7(0x2a3)),console['error'](_0xf25ad7(0x2bf)),0x1):(console[_0xf25ad7(0x274)](_0xf25ad7(0x27d)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x17715a[_0xf25ad7(0x1b9)]===0x0)return console[_0xf25ad7(0x274)](_0xf25ad7(0x27d)),console['error'](_0xf25ad7(0x2b6)),0x1;const _0x1004e2={};try{for(const _0x40f1f0 of _0x17715a){const {key:_0x10a05c,value:_0x10b25b}=parseKeyValue(_0x40f1f0);_0x1004e2[_0x10a05c]=_0x10b25b;}}catch(_0x1d1484){return _0x1d1484 instanceof Error&&console['error'](a54_0x3265bd['red'](_0xf25ad7(0x1dc)),_0x1d1484[_0xf25ad7(0x1c0)]),0x1;}const _0x4800b6=Object['keys'](_0x1004e2);_0x566f19[_0xf25ad7(0x2a9)]&&(console[_0xf25ad7(0x274)](_0xf25ad7(0x2a6)+_0x554b4e),console[_0xf25ad7(0x274)](_0xf25ad7(0x23c)+_0x4800b6[_0xf25ad7(0x237)](',\x20')));const _0x149de1=await withSpinner(_0x4800b6[_0xf25ad7(0x1b9)]===0x1?_0xf25ad7(0x25d):_0xf25ad7(0x2c8)+_0x4800b6['length']+'\x20secrets...',()=>_0x25d265[_0xf25ad7(0x229)]['setSecrets'](_0x554b4e,_0x1004e2),{'verbose':_0x566f19[_0xf25ad7(0x2a9)]}),_0x12ddbe=_0x149de1[_0xf25ad7(0x149)];return console[_0xf25ad7(0x274)](_0x4800b6[_0xf25ad7(0x1b9)]===0x1?'✔\x20Secret\x20\x27'+_0x12ddbe[_0xf25ad7(0x1b8)][0x0]+_0xf25ad7(0x210)+_0x12ddbe[_0xf25ad7(0x26c)]+'\x27':'✔\x20'+_0x12ddbe[_0xf25ad7(0x1b8)][_0xf25ad7(0x1b9)]+_0xf25ad7(0x207)+_0x12ddbe[_0xf25ad7(0x26c)]+'\x27'),(_0x566f19['json']||_0x566f19['jsonl'])&&await handleSingleObjectOutput(_0x12ddbe,_0x566f19),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x121);['description']=a54_0xb99464(0x22c);async['execute'](_0x153f2b){const _0x55f145=a54_0xb99464,{options:_0x3d5fb2,args:_0xb389d4,tdx:_0xe86069}=_0x153f2b;let _0x396c95,_0x290ce3;if(_0xb389d4[_0x55f145(0x1b9)]>=0x2)_0x396c95=_0xb389d4[0x0],_0x290ce3=_0xb389d4[0x1];else{if(_0xb389d4[_0x55f145(0x1b9)]===0x1&&_0x3d5fb2[_0x55f145(0x23a)])_0x396c95=_0x3d5fb2[_0x55f145(0x23a)],_0x290ce3=_0xb389d4[0x0];else return _0xb389d4['length']===0x1?(console[_0x55f145(0x274)](_0x55f145(0x2a3)),console[_0x55f145(0x274)](_0x55f145(0x2bf)),0x1):(console[_0x55f145(0x274)](_0x55f145(0x264)),console['error'](_0x55f145(0x2af)),0x1);}_0x3d5fb2[_0x55f145(0x2a9)]&&(console[_0x55f145(0x274)](_0x55f145(0x2a6)+_0x396c95),console[_0x55f145(0x274)](_0x55f145(0x243)+_0x290ce3));if(!_0x3d5fb2[_0x55f145(0x167)]){if(!isInteractive())return console['error'](a54_0x3265bd[_0x55f145(0x2aa)]('\x0aError:'),_0x55f145(0x2c6)),console[_0x55f145(0x274)](a54_0x3265bd[_0x55f145(0x1a1)](_0x55f145(0x128))),0x1;const _0x2a28a4=await confirmKey(_0x55f145(0x198)+_0x290ce3+_0x55f145(0x17a)+_0x396c95+'\x27?');if(!_0x2a28a4)return console['error'](a54_0x3265bd[_0x55f145(0x267)]('Cancelled')),0x1;}const _0x1a5b5f=await withSpinner(_0x55f145(0x201),()=>_0xe86069[_0x55f145(0x229)][_0x55f145(0x253)](_0x396c95,_0x290ce3),{'verbose':_0x3d5fb2[_0x55f145(0x2a9)]}),_0x9d2c2b=_0x1a5b5f[_0x55f145(0x149)];return console[_0x55f145(0x274)](_0x55f145(0x1e3)+_0x9d2c2b[_0x55f145(0x132)]+_0x55f145(0x241)+_0x9d2c2b[_0x55f145(0x26c)]+'\x27'),(_0x3d5fb2[_0x55f145(0x279)]||_0x3d5fb2[_0x55f145(0x197)])&&await handleSingleObjectOutput(_0x9d2c2b,_0x3d5fb2),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(_0x30772f){const _0x37e72b=a54_0xb99464,_0x5f2c07=Math[_0x37e72b(0x1f6)](_0x30772f/0x3e8),_0x349fb9=Math[_0x37e72b(0x1f6)](_0x5f2c07/0x3c),_0x2b5392=Math['floor'](_0x349fb9/0x3c),_0x5388d9=Math[_0x37e72b(0x1f6)](_0x2b5392/0x18);if(_0x5388d9>0x0){const _0x43845e=_0x2b5392%0x18;return _0x43845e>0x0?_0x5388d9+'d\x20'+_0x43845e+'h':_0x5388d9+'d';}else{if(_0x2b5392>0x0){const _0x4aab3c=_0x349fb9%0x3c;return _0x4aab3c>0x0?_0x2b5392+'h\x20'+_0x4aab3c+'m':_0x2b5392+'h';}else{if(_0x349fb9>0x0){const _0x3bee95=_0x5f2c07%0x3c;return _0x3bee95>0x0?_0x349fb9+'m\x20'+_0x3bee95+'s':_0x349fb9+'m';}else return _0x5f2c07+'s';}}}function formatTimestamp(_0x1cfe09,_0x436700){const _0x1de0e9=a54_0xb99464,_0x380233=new Date(_0x1cfe09),_0x4d6d1d=String(_0x380233[_0x1de0e9(0x22b)]())[_0x1de0e9(0x12c)](0x2,'0'),_0x175841=String(_0x380233[_0x1de0e9(0x131)]())[_0x1de0e9(0x12c)](0x2,'0'),_0x56c258=_0x4d6d1d+':'+_0x175841,_0xc23c35=_0x380233[_0x1de0e9(0x254)]()===_0x436700[_0x1de0e9(0x254)]()&&_0x380233[_0x1de0e9(0x2bc)]()===_0x436700['getMonth']()&&_0x380233[_0x1de0e9(0x1e2)]()===_0x436700[_0x1de0e9(0x1e2)]();if(_0xc23c35)return _0x56c258;else{const _0x1626b4=String(_0x380233[_0x1de0e9(0x2bc)]()+0x1)[_0x1de0e9(0x12c)](0x2,'0'),_0x247d66=String(_0x380233['getDate']())[_0x1de0e9(0x12c)](0x2,'0');return _0x1626b4+'-'+_0x247d66+'\x20'+_0x56c258;}}function formatDate(_0x483ab8){const _0xb25606=a54_0xb99464,_0x35ab4d=_0x483ab8[_0xb25606(0x254)](),_0x44fe1a=String(_0x483ab8[_0xb25606(0x2bc)]()+0x1)['padStart'](0x2,'0'),_0x3a0116=String(_0x483ab8[_0xb25606(0x1e2)]())[_0xb25606(0x12c)](0x2,'0');return _0x35ab4d+'-'+_0x44fe1a+'-'+_0x3a0116;}function getTaskStateIcon(_0x19f3b7){const _0x43c383={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x43c383[_0x19f3b7]||'⚪';}function getBarChar(_0x3ee548){const _0x21fd01=a54_0xb99464;return _0x3ee548===_0x21fd01(0x274)||_0x3ee548===_0x21fd01(0x231)?'×':'─';}function getBarColor(_0x51b0f3){const _0x17e94c=a54_0xb99464,_0x1eeab2={'success':a54_0x3265bd[_0x17e94c(0x119)],'error':a54_0x3265bd[_0x17e94c(0x2aa)],'group_error':a54_0x3265bd[_0x17e94c(0x2aa)],'running':a54_0x3265bd[_0x17e94c(0x144)],'blocked':a54_0x3265bd[_0x17e94c(0x267)],'planned':a54_0x3265bd['dim'],'canceling':a54_0x3265bd[_0x17e94c(0x267)]};return _0x1eeab2[_0x51b0f3]||a54_0x3265bd[_0x17e94c(0x223)];}function parseTaskName(_0x1aaf1e){const _0x9ae66e=a54_0xb99464;let _0x8523ac=_0x1aaf1e['replace'](/^\++/,'');const _0x5b8dcb=_0x8523ac[_0x9ae66e(0x242)]('+'),_0x31f540=_0x5b8dcb[_0x9ae66e(0x1b9)]>0x1?_0x5b8dcb[_0x9ae66e(0x1b9)]-0x2:0x0,_0x58ae81=_0x5b8dcb[_0x5b8dcb[_0x9ae66e(0x1b9)]-0x1]||_0x8523ac;return{'level':_0x31f540,'name':'+'+_0x58ae81};}function truncateTaskName(_0x3820f7,_0x492f31){const _0x14029f=a54_0xb99464,_0x436fb3=stringWidth(_0x3820f7);if(_0x436fb3<=_0x492f31)return _0x3820f7;let _0x51c46b=_0x3820f7;while(stringWidth(_0x51c46b+'…')>_0x492f31&&_0x51c46b[_0x14029f(0x1b9)]>0x0){_0x51c46b=_0x51c46b[_0x14029f(0x259)](0x0,-0x1);}return _0x51c46b+'…';}function calculateTimeScale(_0x46d627,_0x4056fd){const _0x22c7ab=a54_0xb99464;return{'startTime':_0x46d627['start'],'endTime':_0x46d627[_0x22c7ab(0x1ff)],'durationMs':_0x46d627[_0x22c7ab(0x20a)],'msPerChar':_0x46d627[_0x22c7ab(0x20a)]/_0x4056fd};}function timeToPosition(_0x5d2a25,_0x3e1f4c,_0x45dc45){const _0x4d8c2a=a54_0xb99464,_0x27d1d4=_0x5d2a25-_0x3e1f4c[_0x4d8c2a(0x1f0)],_0x4a7c09=Math[_0x4d8c2a(0x1f6)](_0x27d1d4/_0x3e1f4c[_0x4d8c2a(0x1a8)]);return Math[_0x4d8c2a(0x2b0)](0x0,Math[_0x4d8c2a(0x2c4)](_0x4a7c09,_0x45dc45));}function renderTimeAxis(_0x57255b,_0x10f4d6){const _0x3e36f2=a54_0xb99464,_0x43cb9d=Math[_0x3e36f2(0x2c4)](TIMELINE_CONFIG[_0x3e36f2(0x1cc)],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x3e36f2(0x1f6)](_0x10f4d6/TIMELINE_CONFIG[_0x3e36f2(0x1d7)]))),_0x515599=_0x57255b[_0x3e36f2(0x18c)]/(_0x43cb9d-0x1),_0x1d9b83=new Date(_0x57255b['startTime']),_0x1c632e=[];for(let _0x10e9f8=0x0;_0x10e9f8<_0x43cb9d;_0x10e9f8++){const _0x84a4f6=_0x57255b[_0x3e36f2(0x1f0)]+_0x10e9f8*_0x515599,_0x43f39a=timeToPosition(_0x84a4f6,_0x57255b,_0x10f4d6),_0x3c8bd9=formatTimestamp(_0x84a4f6,_0x1d9b83);_0x1c632e['push']({'pos':_0x43f39a,'text':_0x3c8bd9});}const _0xea2678=new Array(_0x10f4d6)['fill']('\x20');let _0x1f6293=-0x1;for(const {pos:_0xe02155,text:_0x2b0e61}of _0x1c632e){let _0x39caa9=Math['max'](0x0,_0xe02155-Math[_0x3e36f2(0x1f6)](_0x2b0e61[_0x3e36f2(0x1b9)]/0x2));_0x39caa9<=_0x1f6293+TIMELINE_CONFIG[_0x3e36f2(0x12a)]&&(_0x39caa9=_0x1f6293+TIMELINE_CONFIG[_0x3e36f2(0x12a)]+0x1);_0x39caa9+_0x2b0e61[_0x3e36f2(0x1b9)]>_0x10f4d6&&(_0x39caa9=_0x10f4d6-_0x2b0e61[_0x3e36f2(0x1b9)]);if(_0x39caa9>=0x0&&_0x39caa9+_0x2b0e61[_0x3e36f2(0x1b9)]<=_0x10f4d6&&_0x39caa9>_0x1f6293){for(let _0x2051a8=0x0;_0x2051a8<_0x2b0e61[_0x3e36f2(0x1b9)];_0x2051a8++){_0xea2678[_0x39caa9+_0x2051a8]=_0x2b0e61[_0x2051a8];}_0x1f6293=_0x39caa9+_0x2b0e61['length']-0x1;}}return _0xea2678[_0x3e36f2(0x237)]('');}function renderTaskRow(_0x5e124a,_0x3cd9c5,_0x52e806,_0x16a6ce){const _0x37f157=a54_0xb99464,{level:_0x36c282,name:_0x3918da}=parseTaskName(_0x5e124a[_0x37f157(0x2ba)]),_0x13cfe7='\x20'[_0x37f157(0x155)](_0x36c282),_0x518414=_0x5e124a[_0x37f157(0x2c9)]?'('+formatElapsed(_0x5e124a[_0x37f157(0x2c9)][_0x37f157(0x20a)])+')':'',_0x172dfc=stringWidth(_0x518414),_0x27ef35=_0x36c282*0x1,_0x3a2354=_0x16a6ce-_0x27ef35-_0x172dfc-0x1,_0x92b16e=truncateTaskName(_0x3918da,_0x3a2354),_0x3fe184=_0x13cfe7+_0x92b16e,_0x706853=stringWidth(_0x3fe184),_0x2c0be1=_0x16a6ce-_0x706853-_0x172dfc,_0x228106=_0x3fe184+'\x20'[_0x37f157(0x155)](Math[_0x37f157(0x2b0)](0x1,_0x2c0be1))+a54_0x3265bd['dim'](_0x518414),_0x23aa06=getTaskStateIcon(_0x5e124a[_0x37f157(0x1d8)]),_0x5a9c7f=new Array(_0x52e806)['fill']('\x20');if(_0x5e124a['window']){const _0x1f78da=timeToPosition(_0x5e124a[_0x37f157(0x2c9)][_0x37f157(0x28c)],_0x3cd9c5,_0x52e806),_0x5eb11e=timeToPosition(_0x5e124a[_0x37f157(0x2c9)][_0x37f157(0x1ff)],_0x3cd9c5,_0x52e806),_0x35e475=getBarChar(_0x5e124a['state']),_0x1efb2d=Math['max'](_0x1f78da+0x1,_0x5eb11e);for(let _0x29f595=_0x1f78da;_0x29f595<Math['min'](_0x1efb2d,_0x52e806);_0x29f595++){_0x5a9c7f[_0x29f595]=_0x35e475;}}const _0x528a03=getBarColor(_0x5e124a[_0x37f157(0x1d8)]),_0x52edbf=_0x5a9c7f[_0x37f157(0x127)](_0x3d0caf=>_0x3d0caf==='\x20'?'\x20':_0x528a03(_0x3d0caf))[_0x37f157(0x237)]('');return _0x23aa06+'\x20'+_0x228106+'│'+_0x52edbf+'│';}function calculateStats(_0x55703f){const _0x4c2338=a54_0xb99464,_0x19f413={'total':_0x55703f[_0x4c2338(0x1b9)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x73ebf9 of _0x55703f){if(_0x73ebf9[_0x4c2338(0x1d8)]===_0x4c2338(0x252))_0x19f413[_0x4c2338(0x252)]++;else{if(_0x73ebf9[_0x4c2338(0x1d8)]===_0x4c2338(0x274)||_0x73ebf9[_0x4c2338(0x1d8)]==='group_error')_0x19f413[_0x4c2338(0x274)]++;else _0x73ebf9[_0x4c2338(0x1d8)]===_0x4c2338(0x148)?_0x19f413[_0x4c2338(0x148)]++:_0x19f413[_0x4c2338(0x1db)]++;}}return _0x19f413;}function formatStats(_0x4ee720){const _0xb51313=a54_0xb99464;return[_0xb51313(0x2b9)+_0x4ee720['total'],'✅\x20'+_0x4ee720[_0xb51313(0x252)],'❌\x20'+_0x4ee720[_0xb51313(0x274)],'🔄\x20'+_0x4ee720['running'],'⏳\x20'+_0x4ee720[_0xb51313(0x1db)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x143);['description']=a54_0xb99464(0x2a0);async[a54_0xb99464(0x1e1)](_0x41ccf6){const _0x323e0e=a54_0xb99464,{options:_0x717eee,args:_0x37b9eb,tdx:_0x57cfa3}=_0x41ccf6;let _0x13268a,_0xc4fb9c,_0x10aefb=![];if(_0x37b9eb[0x0]){if(_0x37b9eb[0x0]['includes']('.')){const _0x5a5bd9=this[_0x323e0e(0x15b)](_0x37b9eb,_0x717eee);if(!_0x5a5bd9)return 0x1;_0x13268a=_0x5a5bd9[_0x323e0e(0x26c)],_0xc4fb9c=_0x5a5bd9['workflowName'];}else{_0xc4fb9c=_0x37b9eb[0x0],_0x13268a=_0x717eee[_0x323e0e(0x23a)];if(!_0x13268a)return console['error'](a54_0x3265bd[_0x323e0e(0x2aa)](_0x323e0e(0x1dc)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x10aefb=!![];}}else{const _0x392b66=this[_0x323e0e(0x15b)](_0x37b9eb,_0x717eee);if(!_0x392b66)return 0x1;_0x13268a=_0x392b66['projectName'],_0xc4fb9c=_0x392b66[_0x323e0e(0x17f)];}if(_0x717eee['verbose']){if(_0x13268a&&_0xc4fb9c)console['error'](_0x323e0e(0x180)+_0x13268a+'.'+_0xc4fb9c);else _0x13268a&&console['error'](_0x323e0e(0x262)+_0x13268a);}const _0x59c313=_0x717eee[_0x323e0e(0x216)],_0x3715c3=_0x717eee[_0x323e0e(0x1cd)];if(_0x59c313){_0x3715c3&&console[_0x323e0e(0x274)](a54_0x3265bd[_0x323e0e(0x267)](_0x323e0e(0x234)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0xd758fb=_0x717eee[_0x323e0e(0x249)];return _0xd758fb?await this[_0x323e0e(0x20f)](_0x41ccf6,_0x59c313):await this[_0x323e0e(0x224)](_0x41ccf6,_0x59c313,_0x717eee),0x0;}if(_0x3715c3){const _0x336d74=await withSpinner(_0x323e0e(0x211),()=>_0x57cfa3[_0x323e0e(0x229)][_0x323e0e(0x218)]({'projectName':_0x13268a,'workflowName':_0xc4fb9c,'limit':0x64}),{'verbose':_0x717eee[_0x323e0e(0x2a9)]}),_0x2f4e3a=_0x336d74['data'][_0x323e0e(0x2a2)](_0x5224b2=>_0x5224b2['id']===_0x3715c3);if(!_0x2f4e3a)return console['error'](a54_0x3265bd[_0x323e0e(0x2aa)](_0x323e0e(0x1dc)),_0x323e0e(0x166)+_0x3715c3),0x1;if(!_0x2f4e3a[_0x323e0e(0x206)]?.['id'])return console[_0x323e0e(0x274)](a54_0x3265bd[_0x323e0e(0x2aa)](_0x323e0e(0x1dc)),_0x323e0e(0x1bd)+_0x3715c3+_0x323e0e(0x287)),0x1;const _0x445270=_0x2f4e3a[_0x323e0e(0x206)]['id'];_0x717eee[_0x323e0e(0x2a9)]&&console[_0x323e0e(0x274)](_0x323e0e(0x263)+_0x445270+_0x323e0e(0x1c7)+_0x3715c3);const _0x243df1=_0x717eee['follow'];return _0x243df1?await this[_0x323e0e(0x20f)](_0x41ccf6,_0x445270):await this[_0x323e0e(0x224)](_0x41ccf6,_0x445270,_0x717eee),0x0;}const _0x26c459=await withSpinner('Loading\x20sessions...',()=>_0x57cfa3[_0x323e0e(0x229)]['sessions']({'projectName':_0x13268a,'workflowName':_0xc4fb9c,'limit':_0x717eee['limit']||0x32}),{'verbose':_0x717eee[_0x323e0e(0x2a9)]}),_0x1223ed=_0x26c459[_0x323e0e(0x149)];if(_0x1223ed[_0x323e0e(0x1b9)]===0x0){if(_0x13268a&&_0xc4fb9c)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x13268a+'.'+_0xc4fb9c);else _0x13268a?console[_0x323e0e(0x274)](_0x323e0e(0x16f)+_0x13268a):(console[_0x323e0e(0x274)](_0x323e0e(0x1a2)),console[_0x323e0e(0x274)](a54_0x3265bd[_0x323e0e(0x1a1)](_0x323e0e(0x156))));return 0x0;}_0x1223ed[_0x323e0e(0x1bc)]((_0x411d8d,_0x28122c)=>{const _0x4473a4=_0x323e0e,_0x127355=_0x411d8d[_0x4473a4(0x2c5)]||'',_0x561c98=_0x28122c[_0x4473a4(0x2c5)]||'';return _0x561c98[_0x4473a4(0x1d2)](_0x127355);});if(_0x717eee[_0x323e0e(0x279)]||_0x717eee['jsonl'])return await handleSDKOutput(_0x1223ed,_0x717eee),0x0;let _0x421d49;if(_0x10aefb){const _0x1e6d37=_0x1223ed[0x0];if(!_0x1e6d37[_0x323e0e(0x206)]?.['id'])return console[_0x323e0e(0x274)](_0x323e0e(0x115)),0x0;_0x421d49=_0x1e6d37['lastAttempt']['id'],_0x717eee[_0x323e0e(0x2a9)]&&console[_0x323e0e(0x274)]('Auto-selected\x20latest\x20session:\x20'+_0x1e6d37['sessionTime']);}else{const _0x3817e5=_0x1223ed['map'](_0x3dd9bb=>{const _0x160293=_0x323e0e,_0xbb1046=getAttemptStatusDisplay(_0x3dd9bb['lastAttempt']);return{'title':_0x3dd9bb[_0x160293(0x23d)]?.[_0x160293(0x2ba)]+'.'+_0x3dd9bb[_0x160293(0x229)]?.[_0x160293(0x2ba)]+_0x160293(0x189)+_0x3dd9bb[_0x160293(0x2c5)]+'\x20'+_0xbb1046[_0x160293(0x293)],'value':_0x3dd9bb[_0x160293(0x206)]?.['id']||'','description':_0xbb1046[_0x160293(0x152)]};}),_0xc554ef=await a54_0x24334b({'type':_0x323e0e(0x173),'name':'attemptId','message':_0x323e0e(0x1b1),'choices':_0x3817e5[_0x323e0e(0x13f)](_0x2f5137=>_0x2f5137[_0x323e0e(0x25c)]!=='')});if(!_0xc554ef[_0x323e0e(0x216)])return 0x0;_0x421d49=_0xc554ef[_0x323e0e(0x216)];}const _0x26cbfd=_0x717eee[_0x323e0e(0x249)];return _0x26cbfd?await this[_0x323e0e(0x20f)](_0x41ccf6,_0x421d49):await this[_0x323e0e(0x224)](_0x41ccf6,_0x421d49,_0x717eee),0x0;}async[a54_0xb99464(0x224)](_0x10d123,_0x27c1c6,_0x4c6534){const _0x181452=a54_0xb99464,{tdx:_0x2533eb}=_0x10d123;let _0x5b0b4c,_0x1f646e;try{[_0x5b0b4c,_0x1f646e]=await Promise[_0x181452(0x20d)]([_0x2533eb[_0x181452(0x229)][_0x181452(0x1ca)](_0x27c1c6),_0x2533eb[_0x181452(0x229)]['tasks'](_0x27c1c6,![])]);}catch(_0x5677e0){console[_0x181452(0x274)](a54_0x3265bd[_0x181452(0x2aa)](_0x181452(0x23b)));_0x4c6534[_0x181452(0x2a9)]&&console[_0x181452(0x274)](_0x5677e0);throw _0x5677e0;}if(_0x4c6534['json']||_0x4c6534[_0x181452(0x197)]){const _0x4aec8=this['buildTimelineData'](_0x5b0b4c,_0x1f646e);await handleSDKOutput([_0x4aec8],_0x4c6534);return;}const _0x535ce5=_0x2533eb['context'][_0x181452(0x1fa)],_0x6d20cf=this['renderTimeline'](_0x5b0b4c,_0x1f646e,_0x535ce5);console[_0x181452(0x25a)](_0x6d20cf);}async[a54_0xb99464(0x20f)](_0x5e3d03,_0x218a6f){const _0x53fc96=a54_0xb99464,{tdx:_0x2fb7c1}=_0x5e3d03,_0x465d91=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1cdd1d=TIMELINE_CONFIG[_0x53fc96(0x19b)];let _0x31f375=0x0;while(_0x31f375<_0x1cdd1d){process[_0x53fc96(0x194)][_0x53fc96(0x145)]&&process['stdout'][_0x53fc96(0x283)]('\x1bc');let _0x17047c,_0x5bc8fd;try{[_0x17047c,_0x5bc8fd]=await Promise['all']([_0x2fb7c1['workflow'][_0x53fc96(0x1ca)](_0x218a6f),_0x2fb7c1['workflow'][_0x53fc96(0x21f)](_0x218a6f,![])]);}catch(_0x215bc7){console[_0x53fc96(0x274)](a54_0x3265bd[_0x53fc96(0x2aa)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x31f375>0x0&&console[_0x53fc96(0x274)](a54_0x3265bd[_0x53fc96(0x1a1)](_0x53fc96(0x2ac)+_0x31f375));throw _0x215bc7;}const _0x3dc588=_0x2fb7c1[_0x53fc96(0x2cd)][_0x53fc96(0x1fa)],_0x1418dd=this['renderTimeline'](_0x17047c,_0x5bc8fd,_0x3dc588);console[_0x53fc96(0x25a)](_0x1418dd);const _0xbbcb93=_0x17047c[_0x53fc96(0x1c6)]&&_0x5bc8fd[_0x53fc96(0x12b)](_0x393781=>_0x393781[_0x53fc96(0x1d8)]!==_0x53fc96(0x148)&&_0x393781[_0x53fc96(0x1d8)]!=='planned');if(_0xbbcb93){console[_0x53fc96(0x274)](a54_0x3265bd[_0x53fc96(0x119)](_0x53fc96(0x277)));break;}console[_0x53fc96(0x274)](a54_0x3265bd[_0x53fc96(0x1a1)]('\x0aPolling...\x20('+_0x31f375*0x2+_0x53fc96(0x2c7))),await new Promise(_0x1b2d98=>setTimeout(_0x1b2d98,_0x465d91)),_0x31f375++;}_0x31f375>=_0x1cdd1d&&console['error'](a54_0x3265bd[_0x53fc96(0x267)](_0x53fc96(0x2be)));}['renderTimeline'](_0xe0f52a,_0x200fd7,_0x5826f9){const _0x1ad1cd=a54_0xb99464,_0x37a903=[],_0x26cef7=TIMELINE_CONFIG[_0x1ad1cd(0x19a)],_0x470080=0x5,_0x2a734b=process[_0x1ad1cd(0x194)][_0x1ad1cd(0x15f)]||0x78,_0x18685f=_0x2a734b-_0x26cef7-_0x470080,_0x10da8f=Math[_0x1ad1cd(0x2b0)](TIMELINE_CONFIG[_0x1ad1cd(0x116)],Math[_0x1ad1cd(0x2c4)](_0x18685f,TIMELINE_CONFIG[_0x1ad1cd(0x136)])),_0x310537=new Date(_0xe0f52a[_0x1ad1cd(0x168)])[_0x1ad1cd(0x21b)](),_0x47de92=_0xe0f52a[_0x1ad1cd(0x1e6)]?new Date(_0xe0f52a[_0x1ad1cd(0x1e6)])[_0x1ad1cd(0x21b)]():Date['now'](),_0x27a7b1={'start':_0x310537,'end':_0x47de92,'duration':_0x47de92-_0x310537},_0x23a67d=new Map(),_0xfcf30c=[];for(const _0x378455 of _0x200fd7){if(_0x378455[_0x1ad1cd(0x1c4)]){const _0x2da3a0=new Date(_0x378455[_0x1ad1cd(0x1c4)])[_0x1ad1cd(0x21b)](),_0x3165eb=_0x378455['updatedAt']?new Date(_0x378455['updatedAt'])[_0x1ad1cd(0x21b)]():Date['now'](),_0x240595={'start':_0x2da3a0,'end':_0x3165eb,'duration':_0x3165eb-_0x2da3a0};_0x23a67d['set'](_0x378455['id'],_0x240595),_0xfcf30c[_0x1ad1cd(0x2c3)]({'name':_0x378455['fullName'],'state':_0x378455[_0x1ad1cd(0x1d8)]||_0x1ad1cd(0x265),'window':_0x240595});}else _0xfcf30c['push']({'name':_0x378455[_0x1ad1cd(0x275)],'state':_0x378455[_0x1ad1cd(0x1d8)]||_0x1ad1cd(0x203),'window':undefined});}_0xfcf30c[_0x1ad1cd(0x1bc)]((_0x55cbf2,_0x1b7559)=>{const _0x36664b=_0x1ad1cd;if(!_0x55cbf2['window'])return 0x1;if(!_0x1b7559[_0x36664b(0x2c9)])return-0x1;return _0x55cbf2['window'][_0x36664b(0x28c)]-_0x1b7559['window'][_0x36664b(0x28c)];});const _0x3a994d=_0xfcf30c[_0x1ad1cd(0x1b9)],_0x4a75f8=_0x3a994d>TIMELINE_CONFIG[_0x1ad1cd(0x291)];_0x4a75f8&&_0xfcf30c[_0x1ad1cd(0x14c)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x1a4258=calculateTimeScale(_0x27a7b1,_0x10da8f),_0x315ced=_0xe0f52a[_0x1ad1cd(0x1c6)]?_0xe0f52a['success']?a54_0x3265bd[_0x1ad1cd(0x119)](_0x1ad1cd(0x252)):a54_0x3265bd[_0x1ad1cd(0x2aa)](_0x1ad1cd(0x274)):a54_0x3265bd['blue'](_0x1ad1cd(0x148)),_0x29fc15=_0xe0f52a[_0x1ad1cd(0x23d)]?.['id'],_0x5bef46=_0xe0f52a['sessionId'];let _0x484e45;if(_0x29fc15&&_0x5bef46){const _0x29c9c2=getWorkflowAttemptUrl(_0x5826f9,_0x29fc15,_0x5bef46,_0xe0f52a['id']);_0x484e45=hyperlink(a54_0x3265bd[_0x1ad1cd(0x1a1)](_0xe0f52a['id']),_0x29c9c2);}else _0x484e45=a54_0x3265bd['dim'](_0xe0f52a['id']);_0x37a903[_0x1ad1cd(0x2c3)](_0x1ad1cd(0x29e)+_0x484e45+_0x1ad1cd(0x189)+_0x315ced+_0x1ad1cd(0x189)+formatElapsed(_0x27a7b1[_0x1ad1cd(0x20a)]));if(_0xfcf30c[_0x1ad1cd(0x1b9)]>0x0){const _0x23531e=renderTimeAxis(_0x1a4258,_0x10da8f),_0x3a54c9=new Date(_0x27a7b1[_0x1ad1cd(0x28c)]),_0x46ac84=formatDate(_0x3a54c9),_0x3cfa42=TIMELINE_CONFIG[_0x1ad1cd(0x24e)]+TIMELINE_CONFIG[_0x1ad1cd(0x285)]+_0x26cef7,_0x3c8310=_0x46ac84[_0x1ad1cd(0x12c)](_0x3cfa42),_0xd38f25=a54_0x3265bd[_0x1ad1cd(0x1a1)](_0x3c8310);_0x37a903['push'](_0xd38f25+'\x20'+_0x23531e);for(const _0x363215 of _0xfcf30c){_0x37a903['push'](renderTaskRow(_0x363215,_0x1a4258,_0x10da8f,_0x26cef7));}const _0x22cbe5=calculateStats(_0xfcf30c);_0x37a903[_0x1ad1cd(0x2c3)](formatStats(_0x22cbe5)),_0x4a75f8&&_0x37a903[_0x1ad1cd(0x2c3)](a54_0x3265bd[_0x1ad1cd(0x267)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x1ad1cd(0x1ee)+_0x3a994d+_0x1ad1cd(0x2a1))),_0x37a903[_0x1ad1cd(0x2c3)](''),_0x37a903[_0x1ad1cd(0x2c3)](a54_0x3265bd['dim'](_0x1ad1cd(0x17b))+(_0x1ad1cd(0x195)+_0xe0f52a['id']+_0x1ad1cd(0x16e))+a54_0x3265bd[_0x1ad1cd(0x1a1)](_0x1ad1cd(0x15e)));}else _0x37a903[_0x1ad1cd(0x2c3)](_0x1ad1cd(0x2bb));return _0x37a903['join']('\x0a');}[a54_0xb99464(0x123)](_0x46937d,_0xea610b){const _0x31a076=a54_0xb99464,_0x3fda57=new Date(_0x46937d['createdAt'])[_0x31a076(0x21b)](),_0x423fa8=_0x46937d[_0x31a076(0x1e6)]?new Date(_0x46937d[_0x31a076(0x1e6)])[_0x31a076(0x21b)]():Date[_0x31a076(0x186)](),_0x543d4c=_0x423fa8-_0x3fda57,_0xc42ea4=[];for(const _0x588c13 of _0xea610b){if(_0x588c13[_0x31a076(0x1c4)]){const _0x18f144=new Date(_0x588c13[_0x31a076(0x1c4)])[_0x31a076(0x21b)](),_0x28096f=_0x588c13[_0x31a076(0x27e)]?new Date(_0x588c13[_0x31a076(0x27e)])['getTime']():Date['now']();_0xc42ea4[_0x31a076(0x2c3)]({'name':_0x588c13[_0x31a076(0x275)],'state':_0x588c13[_0x31a076(0x1d8)]||'unknown','window':{'start':_0x18f144,'end':_0x28096f,'duration':_0x28096f-_0x18f144}});}else _0xc42ea4[_0x31a076(0x2c3)]({'name':_0x588c13['fullName'],'state':_0x588c13[_0x31a076(0x1d8)]||_0x31a076(0x203),'window':undefined});}const _0x1ff226=calculateStats(_0xc42ea4);return{'attempt':{'id':_0x46937d['id'],'status':_0x46937d[_0x31a076(0x1c6)]?_0x46937d['success']?_0x31a076(0x252):_0x31a076(0x274):'running','createdAt':_0x46937d[_0x31a076(0x168)],'finishedAt':_0x46937d[_0x31a076(0x1e6)],'duration_ms':_0x543d4c},'tasks':_0xc42ea4[_0x31a076(0x127)](_0x4d44e9=>({'name':_0x4d44e9['name'],'state':_0x4d44e9[_0x31a076(0x1d8)],'startedAt':_0x4d44e9['window']?new Date(_0x4d44e9[_0x31a076(0x2c9)][_0x31a076(0x28c)])[_0x31a076(0x29d)]():null,'updatedAt':_0x4d44e9[_0x31a076(0x2c9)]?new Date(_0x4d44e9['window'][_0x31a076(0x1ff)])[_0x31a076(0x29d)]():null,'duration_ms':_0x4d44e9[_0x31a076(0x2c9)]?.['duration']||null})),'stats':_0x1ff226};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x26a);['description']='List\x20workflow\x20schedules';async[a54_0xb99464(0x1e1)](_0x4f5bc4){const _0x188afd=a54_0xb99464,{options:_0x3df03a,tdx:_0x284f50}=_0x4f5bc4,_0x4048f8=await withSpinner(_0x188afd(0x244),()=>_0x284f50['workflow']['listSchedules'](),{'verbose':_0x3df03a[_0x188afd(0x2a9)]}),_0x5f01ec=_0x4048f8[_0x188afd(0x149)];console['error'](_0x188afd(0x28e)+_0x5f01ec[_0x188afd(0x1b9)]+_0x188afd(0x225)+(_0x5f01ec[_0x188afd(0x1b9)]!==0x1?'s':''));if(isStructuredFormat(_0x3df03a))await handleSDKOutput(_0x5f01ec,_0x3df03a);else{if(_0x5f01ec[_0x188afd(0x1b9)]===0x0)console[_0x188afd(0x25a)](_0x188afd(0x22a));else for(const _0x350e81 of _0x5f01ec){const _0x5e728a=_0x350e81[_0x188afd(0x270)]?a54_0x3265bd['yellow'](_0x188afd(0x1bb)):'',_0xfe2fdc=_0x350e81[_0x188afd(0x23d)]?.[_0x188afd(0x2ba)]?a54_0x3265bd[_0x188afd(0x1a1)]('\x20['+_0x350e81[_0x188afd(0x23d)][_0x188afd(0x2ba)]+']'):'',_0x5d72ef=_0x350e81[_0x188afd(0x137)]?a54_0x3265bd[_0x188afd(0x1a1)](_0x188afd(0x286)+new Date(_0x350e81[_0x188afd(0x137)])[_0x188afd(0x16b)]()):'';console['log'](_0x188afd(0x226)+_0x350e81['id']+'\x20'+(_0x350e81['workflow']?.[_0x188afd(0x2ba)]||_0x188afd(0x15a))+_0xfe2fdc+_0x5e728a+_0x5d72ef);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x125);['description']=a54_0xb99464(0x188);async[a54_0xb99464(0x1e1)](_0x1e9cc9){const _0x71d30d=a54_0xb99464,{options:_0x59b466,args:_0x56ab4e,tdx:_0x3fbf1e}=_0x1e9cc9,_0x5c2aaf=_0x56ab4e[0x0];if(!_0x5c2aaf)return console[_0x71d30d(0x274)](a54_0x3265bd[_0x71d30d(0x2aa)](_0x71d30d(0x1dc)),_0x71d30d(0x1bf)),console[_0x71d30d(0x274)](a54_0x3265bd[_0x71d30d(0x1a1)](_0x71d30d(0x124))),console['error'](a54_0x3265bd[_0x71d30d(0x1a1)](_0x71d30d(0x1c9))),0x1;const _0x1b4c9e=await withSpinner('Enabling\x20schedule\x20#'+_0x5c2aaf+_0x71d30d(0x257),()=>_0x3fbf1e[_0x71d30d(0x229)][_0x71d30d(0x1a4)](_0x5c2aaf),{'verbose':_0x59b466[_0x71d30d(0x2a9)]}),_0x24680c=_0x1b4c9e[_0x71d30d(0x149)];return isStructuredFormat(_0x59b466)?await handleSingleObjectOutput(_0x24680c,_0x59b466):(console[_0x71d30d(0x25a)](_0x71d30d(0x212)+_0x5c2aaf+_0x71d30d(0x17d)+(_0x24680c[_0x71d30d(0x229)]?.[_0x71d30d(0x2ba)]||_0x71d30d(0x265))+')'),_0x24680c[_0x71d30d(0x137)]&&console['log'](a54_0x3265bd[_0x71d30d(0x1a1)](_0x71d30d(0x1f4)+new Date(_0x24680c['nextRunTime'])[_0x71d30d(0x16b)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0xb99464(0x2ba)]=a54_0xb99464(0x204);[a54_0xb99464(0x13a)]='Disable\x20a\x20workflow\x20schedule';async[a54_0xb99464(0x1e1)](_0x2c5c5c){const _0x50c577=a54_0xb99464,{options:_0x482d95,args:_0x271959,tdx:_0x26f80f}=_0x2c5c5c,_0x1ea008=_0x271959[0x0];if(!_0x1ea008)return console[_0x50c577(0x274)](a54_0x3265bd['red']('Error:'),_0x50c577(0x1bf)),console[_0x50c577(0x274)](a54_0x3265bd[_0x50c577(0x1a1)](_0x50c577(0x1c3))),console['error'](a54_0x3265bd[_0x50c577(0x1a1)](_0x50c577(0x1c9))),0x1;const _0x29f4a7=await withSpinner(_0x50c577(0x14a)+_0x1ea008+'...',()=>_0x26f80f[_0x50c577(0x229)][_0x50c577(0x163)](_0x1ea008),{'verbose':_0x482d95[_0x50c577(0x2a9)]}),_0x4c8fa4=_0x29f4a7[_0x50c577(0x149)];return isStructuredFormat(_0x482d95)?await handleSingleObjectOutput(_0x4c8fa4,_0x482d95):console[_0x50c577(0x25a)]('✔\x20Schedule\x20#'+_0x1ea008+_0x50c577(0x27c)+(_0x4c8fa4['workflow']?.[_0x50c577(0x2ba)]||'unknown')+')'),0x0;}}
|
|
1
|
+
const a54_0x2a0943=a54_0x5ebb;(function(_0xf7ee2f,_0x24fdf7){const _0x49e936=a54_0x5ebb,_0x4a5c98=_0xf7ee2f();while(!![]){try{const _0x429980=-parseInt(_0x49e936(0x349))/0x1*(-parseInt(_0x49e936(0x344))/0x2)+-parseInt(_0x49e936(0x324))/0x3*(-parseInt(_0x49e936(0x1f6))/0x4)+-parseInt(_0x49e936(0x2f4))/0x5*(parseInt(_0x49e936(0x2b6))/0x6)+parseInt(_0x49e936(0x302))/0x7+parseInt(_0x49e936(0x2ce))/0x8+-parseInt(_0x49e936(0x28d))/0x9+-parseInt(_0x49e936(0x25f))/0xa;if(_0x429980===_0x24fdf7)break;else _0x4a5c98['push'](_0x4a5c98['shift']());}catch(_0x41ed50){_0x4a5c98['push'](_0x4a5c98['shift']());}}}(a54_0x2768,0x18a8a));import a54_0x13943d from'chalk';import{existsSync}from'fs';import a54_0x4c5432 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x1b2330 from'prompts';function getAttemptStatusDisplay(_0x237b08){const _0x2a9055=a54_0x5ebb;if(!_0x237b08)return{'icon':'⏳','text':''};const {done:_0x51bb11,success:_0x3b75a5,cancelRequested:_0x5394ff}=_0x237b08;if(!_0x51bb11)return _0x5394ff?{'icon':'🛑','text':a54_0x13943d[_0x2a9055(0x2f5)](_0x2a9055(0x27c))}:{'icon':'🔄','text':a54_0x13943d[_0x2a9055(0x258)](_0x2a9055(0x2ea))};if(_0x3b75a5)return{'icon':'✅','text':a54_0x13943d['green']('success')};return{'icon':'❌','text':a54_0x13943d[_0x2a9055(0x1fc)](_0x2a9055(0x2ae))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x2a0943(0x1d4)](_0x3c5ae0,_0x443b93,_0x1987f0=0x0){const _0x30ebfd=a54_0x2a0943;return _0x3c5ae0[_0x1987f0]||_0x443b93[_0x30ebfd(0x2fb)];}[a54_0x2a0943(0x240)](_0x160bdf,_0x479379,_0x1354d0=0x0){const _0x5c76bb=a54_0x2a0943,_0x5ee826=this[_0x5c76bb(0x1d4)](_0x160bdf,_0x479379,_0x1354d0);if(!_0x5ee826)return console[_0x5c76bb(0x2ae)](a54_0x13943d[_0x5c76bb(0x1fc)](_0x5c76bb(0x33f)),_0x5c76bb(0x24c)),console['error'](a54_0x13943d[_0x5c76bb(0x31c)](_0x5c76bb(0x362))),null;return _0x5ee826;}[a54_0x2a0943(0x228)](_0x1c7874,_0x989f86){const _0x2450e8=a54_0x2a0943;if(_0x1c7874[0x0]){const _0x1f12af=_0x1c7874[0x0][_0x2450e8(0x2ca)]('.');if(_0x1f12af[_0x2450e8(0x2c2)]===0x1)return{'projectName':_0x1f12af[0x0],'workflowName':undefined};else return _0x1f12af[_0x2450e8(0x2c2)]===0x2?{'projectName':_0x1f12af[0x0],'workflowName':_0x1f12af[0x1]}:(console[_0x2450e8(0x2ae)](a54_0x13943d['red']('Error:'),_0x2450e8(0x2c5)),null);}return{'projectName':_0x989f86['workflowProject'],'workflowName':undefined};}['resolveProjectDir'](_0x53d13f,_0x176f0e,_0x126834=0x0){const _0x7b14df=a54_0x2a0943;if(_0x53d13f[_0x126834])return _0x53d13f[_0x126834];if(_0x176f0e['workflowProject']){const _0x70b7c5=a54_0x4c5432['join'](process['cwd'](),'workflows',_0x176f0e['workflowProject']);if(existsSync(a54_0x4c5432[_0x7b14df(0x219)](_0x70b7c5,'tdx.json')))return _0x70b7c5;}return undefined;}async[a54_0x2a0943(0x388)](_0x5b4900,_0x5a58d2,_0x329422){const _0x104a95=a54_0x2a0943;try{const _0xabac4b=await _0x5b4900['workflow']['workflows'](_0x5a58d2,{'limit':0x1});if(_0xabac4b[_0x104a95(0x2c2)]>0x0){const _0x3044aa=_0xabac4b[0x0]['id'],_0x4f7c9c=getWorkflowUrl(_0x329422,_0x3044aa);console[_0x104a95(0x2ae)](_0x104a95(0x2fd)+a54_0x13943d[_0x104a95(0x38a)](_0x4f7c9c));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c0);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x203);async[a54_0x2a0943(0x295)](_0x180536){const _0x2b13f3=a54_0x2a0943,{options:_0x4401af,args:_0x1c36f0,tdx:_0x46e025}=_0x180536,_0x234586=_0x1c36f0[0x0],_0x4c749e=_0x4401af[_0x2b13f3(0x213)];if(_0x4c749e)return saveSessionContext({'workflow_project':undefined},_0x4401af[_0x2b13f3(0x229)]),console[_0x2b13f3(0x31e)](a54_0x13943d[_0x2b13f3(0x211)](_0x2b13f3(0x31b))),0x0;if(!_0x234586)return console[_0x2b13f3(0x2ae)](a54_0x13943d['red'](_0x2b13f3(0x33f)),_0x2b13f3(0x24c)),console[_0x2b13f3(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x2b13f3(0x2ae)](a54_0x13943d[_0x2b13f3(0x31c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3cde08=await withSpinner(_0x2b13f3(0x2ac)+_0x234586+'\x27...',()=>_0x46e025[_0x2b13f3(0x2f9)][_0x2b13f3(0x260)](_0x234586),{'verbose':_0x4401af['verbose']}),{name:_0x48561f}=_0x3cde08[_0x2b13f3(0x2c0)];return saveSessionContext({'workflow_project':_0x48561f},_0x4401af['session']),console['log'](a54_0x13943d[_0x2b13f3(0x211)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x13943d[_0x2b13f3(0x38a)](_0x48561f))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0x2a0943(0x366);['description']=a54_0x2a0943(0x37b);async[a54_0x2a0943(0x295)](_0x10f5e5){const _0x3e8c90=a54_0x2a0943,{options:_0x53d205,args:_0x4e4fc6,tdx:_0x335114}=_0x10f5e5,_0x58bd13=_0x4e4fc6[0x0];_0x53d205[_0x3e8c90(0x31f)]&&_0x58bd13&&console['error'](_0x3e8c90(0x1f3)+_0x58bd13);const _0x3ca647=await withSpinner(_0x3e8c90(0x387),()=>_0x335114['workflow'][_0x3e8c90(0x2d3)](_0x58bd13,{'limit':_0x53d205[_0x3e8c90(0x34d)]}),{'verbose':_0x53d205[_0x3e8c90(0x31f)]});let _0x5261f5=_0x3ca647['data'];_0x5261f5[_0x3e8c90(0x2ba)]((_0x372a24,_0x201975)=>_0x372a24[_0x3e8c90(0x1c3)][_0x3e8c90(0x351)](_0x201975[_0x3e8c90(0x1c3)]));const _0x1c9233=_0x53d205[_0x3e8c90(0x34d)]||0x64,_0x28492d=_0x5261f5['length']>=_0x1c9233?a54_0x13943d[_0x3e8c90(0x31c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3e8c90(0x2ae)]('✔\x20Found\x20'+_0x5261f5[_0x3e8c90(0x2c2)]+_0x3e8c90(0x1ec)+(_0x5261f5[_0x3e8c90(0x2c2)]!==0x1?'s':'')+_0x28492d);if(_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x200)||_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x291)||_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x311))await handleSDKOutput(_0x5261f5,_0x53d205);else{if(_0x5261f5[_0x3e8c90(0x2c2)]===0x0)_0x58bd13?console[_0x3e8c90(0x31e)](_0x3e8c90(0x265)+_0x58bd13):console[_0x3e8c90(0x31e)](_0x3e8c90(0x243));else{const _0x1d7085=_0x5261f5[_0x3e8c90(0x285)](_0x3443c6=>{const _0x4bb3f1=_0x3e8c90,_0x5f54df=_0x3443c6[_0x4bb3f1(0x379)]?.[_0x4bb3f1(0x2f0)](_0x3aced6=>_0x3aced6[_0x4bb3f1(0x1d2)]===_0x4bb3f1(0x244)),_0x18d800=_0x5f54df?a54_0x13943d['dim'](_0x4bb3f1(0x325)):'';return'📁\x20'+_0x3443c6[_0x4bb3f1(0x1c3)]+_0x18d800;});await writeOutput(_0x1d7085[_0x3e8c90(0x219)]('\x0a'),_0x53d205['output'],_0x3e8c90(0x354));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1ee);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2bb);async[a54_0x2a0943(0x295)](_0x4f8c99){const _0x500944=a54_0x2a0943,{options:_0x36d714,args:_0x33c6c6,tdx:_0x1ed505}=_0x4f8c99,_0x24f3f6=this[_0x500944(0x1d4)](_0x33c6c6,_0x36d714);_0x36d714[_0x500944(0x31f)]&&_0x24f3f6&&console[_0x500944(0x2ae)](_0x500944(0x23b)+_0x24f3f6);const _0x3c40d2=await withSpinner(_0x500944(0x2b8),()=>_0x1ed505[_0x500944(0x2f9)][_0x500944(0x1d5)](_0x24f3f6,{'limit':_0x36d714[_0x500944(0x34d)]}),{'verbose':_0x36d714[_0x500944(0x31f)]});let _0x4615fa=_0x3c40d2['data'];_0x4615fa[_0x500944(0x2ba)]((_0x77ed16,_0x58c195)=>{const _0x1ffc44=_0x500944,_0x18a598=_0x77ed16[_0x1ffc44(0x1c3)][_0x1ffc44(0x351)](_0x58c195[_0x1ffc44(0x1c3)]);if(_0x18a598!==0x0)return _0x18a598;return(_0x77ed16[_0x1ffc44(0x330)]?.[_0x1ffc44(0x1c3)]||'')[_0x1ffc44(0x351)](_0x58c195['project']?.[_0x1ffc44(0x1c3)]||'');});const _0x3547f5=_0x36d714[_0x500944(0x34d)]||0x64,_0xdb6455=_0x4615fa[_0x500944(0x2c2)]>=_0x3547f5?a54_0x13943d[_0x500944(0x31c)](_0x500944(0x2e5)):'';console[_0x500944(0x2ae)](_0x500944(0x37e)+_0x4615fa[_0x500944(0x2c2)]+_0x500944(0x316)+(_0x4615fa[_0x500944(0x2c2)]!==0x1?'s':'')+_0xdb6455);if(_0x36d714[_0x500944(0x352)]===_0x500944(0x200)||_0x36d714['format']==='jsonl'||_0x36d714[_0x500944(0x352)]===_0x500944(0x311))await handleSDKOutput(_0x4615fa,_0x36d714);else{if(_0x4615fa[_0x500944(0x2c2)]===0x0)_0x24f3f6?console[_0x500944(0x31e)](_0x500944(0x232)+_0x24f3f6):console[_0x500944(0x31e)](_0x500944(0x293));else{const _0x4c6b1b=_0x36d714[_0x500944(0x1e2)],_0x3e995d=_0x4615fa[_0x500944(0x285)](_0x58110f=>{const _0x5edf10=_0x500944,_0x59e75e=a54_0x13943d[_0x5edf10(0x31c)]('#'+_0x58110f['id']),_0x4ff677=hyperlink(_0x59e75e,getWorkflowUrl(_0x4c6b1b,_0x58110f['id'])),_0x20daf6=_0x58110f[_0x5edf10(0x330)]?.[_0x5edf10(0x1c3)]?a54_0x13943d[_0x5edf10(0x31c)]('\x20('+_0x58110f[_0x5edf10(0x330)][_0x5edf10(0x1c3)]+')'):'';return _0x5edf10(0x381)+_0x4ff677+'\x20'+_0x58110f[_0x5edf10(0x1c3)]+_0x20daf6;});await writeOutput(_0x3e995d[_0x500944(0x219)]('\x0a'),_0x36d714[_0x500944(0x1bb)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2a8);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x375);async[a54_0x2a0943(0x295)](_0x249da0){const _0x25f139=a54_0x2a0943,{options:_0x40dfbf,args:_0x5f0405,tdx:_0x150a8c}=_0x249da0,_0x33b2ef=this[_0x25f139(0x228)](_0x5f0405,_0x40dfbf);if(!_0x33b2ef)return 0x1;const {projectName:_0x13371e,workflowName:_0x56e521}=_0x33b2ef;if(_0x40dfbf['verbose']){if(_0x13371e&&_0x56e521)console['error'](_0x25f139(0x24f)+_0x13371e+'.'+_0x56e521);else _0x13371e&&console[_0x25f139(0x2ae)](_0x25f139(0x2d5)+_0x13371e);const _0x573065=_0x40dfbf[_0x25f139(0x2ec)];_0x573065&&console[_0x25f139(0x2ae)](_0x25f139(0x346)+_0x573065);}let _0x78ff48=0x28;if(process['stdout'][_0x25f139(0x2aa)]&&!_0x40dfbf[_0x25f139(0x1bb)]&&!_0x40dfbf['format']){const _0x2fbcea=process[_0x25f139(0x2fc)][_0x25f139(0x1fd)]||0x28;_0x78ff48=Math[_0x25f139(0x26c)](0x14,Math[_0x25f139(0x2bc)](_0x2fbcea*0x2/0x3));}const _0x253a20=_0x40dfbf[_0x25f139(0x34d)]||_0x78ff48,_0x405813=await withSpinner(_0x25f139(0x2cf),()=>_0x150a8c['workflow'][_0x25f139(0x296)]({'projectName':_0x13371e,'workflowName':_0x56e521,'status':_0x40dfbf[_0x25f139(0x2ec)],'fromTime':_0x40dfbf[_0x25f139(0x365)],'toTime':_0x40dfbf['to'],'limit':_0x253a20}),{'verbose':_0x40dfbf[_0x25f139(0x31f)]}),_0x2105cf=_0x405813[_0x25f139(0x2c0)];_0x2105cf[_0x25f139(0x2ba)]((_0x12ad63,_0x6dbe06)=>{const _0x415684=_0x25f139,_0x510ef1=_0x12ad63['sessionTime']||'',_0x48ccac=_0x6dbe06[_0x415684(0x36a)]||'';return _0x48ccac[_0x415684(0x351)](_0x510ef1);});_0x2105cf[_0x25f139(0x2c2)]>=_0x253a20?console[_0x25f139(0x2ae)](_0x25f139(0x2f1)+_0x2105cf[_0x25f139(0x2c2)]+_0x25f139(0x29d)+a54_0x13943d['dim'](_0x25f139(0x364))):console['error']('✔\x20Found\x20'+_0x2105cf[_0x25f139(0x2c2)]+_0x25f139(0x284)+(_0x2105cf['length']!==0x1?'s':''));if(_0x40dfbf[_0x25f139(0x352)]==='json'||_0x40dfbf[_0x25f139(0x352)]===_0x25f139(0x291)||_0x40dfbf[_0x25f139(0x352)]==='table')await handleSDKOutput(_0x2105cf,_0x40dfbf);else{if(!process[_0x25f139(0x2fc)][_0x25f139(0x2aa)]||_0x40dfbf['output']){if(_0x2105cf[_0x25f139(0x2c2)]===0x0){if(_0x13371e&&_0x56e521)console[_0x25f139(0x31e)](_0x25f139(0x234)+_0x13371e+'.'+_0x56e521);else _0x13371e?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x13371e):console[_0x25f139(0x31e)](_0x25f139(0x334));}else{const _0x27072e=_0x40dfbf[_0x25f139(0x1e2)],_0x423812=this[_0x25f139(0x227)](_0x2105cf,_0x27072e);_0x40dfbf[_0x25f139(0x1bb)]?await writeOutput(_0x423812,_0x40dfbf['output'],'list'):console[_0x25f139(0x31e)](_0x423812);}!_0x13371e&&(console[_0x25f139(0x2ae)](''),console[_0x25f139(0x2ae)](a54_0x13943d['dim'](_0x25f139(0x34c))),console[_0x25f139(0x2ae)](a54_0x13943d[_0x25f139(0x31c)](_0x25f139(0x2d8))+'or'+a54_0x13943d[_0x25f139(0x31c)](_0x25f139(0x264))));}else{if(_0x2105cf[_0x25f139(0x2c2)]===0x0){if(_0x13371e&&_0x56e521)console[_0x25f139(0x31e)](_0x25f139(0x234)+_0x13371e+'.'+_0x56e521);else _0x13371e?console['log'](_0x25f139(0x372)+_0x13371e):console[_0x25f139(0x31e)](_0x25f139(0x334));}else await this[_0x25f139(0x36c)](_0x2105cf,_0x249da0,_0x13371e);}}return 0x0;}[a54_0x2a0943(0x227)](_0x66f4da,_0x2ffd70){const _0x39407f=a54_0x2a0943,_0x2c6c5f=[],_0x1e155e=new Map();let _0x45787e=Infinity,_0x2e4428=-Infinity;for(const _0x3ee661 of _0x66f4da){if(_0x3ee661[_0x39407f(0x363)]?.['createdAt']){const _0xac8301=new Date(_0x3ee661['lastAttempt'][_0x39407f(0x34e)])[_0x39407f(0x29c)](),_0x24f7fc=_0x3ee661[_0x39407f(0x363)][_0x39407f(0x2e0)]?new Date(_0x3ee661['lastAttempt'][_0x39407f(0x2e0)])[_0x39407f(0x29c)]():Date[_0x39407f(0x22e)](),_0x4277c7=_0x3ee661[_0x39407f(0x330)]?.[_0x39407f(0x1c3)]||_0x39407f(0x1d8);!_0x1e155e[_0x39407f(0x383)](_0x4277c7)&&_0x1e155e[_0x39407f(0x2a7)](_0x4277c7,[]),_0x1e155e[_0x39407f(0x1bf)](_0x4277c7)[_0x39407f(0x377)]({'session':_0x3ee661,'startTime':_0xac8301,'endTime':_0x24f7fc,'duration':_0x24f7fc-_0xac8301}),_0x45787e=Math['min'](_0x45787e,_0xac8301),_0x2e4428=Math['max'](_0x2e4428,_0x24f7fc);}}if(_0x1e155e[_0x39407f(0x1e5)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x29e5d8=process[_0x39407f(0x2fc)][_0x39407f(0x34a)]||0x78,_0x299122=0x1e,_0x17ce2=0x32,_0x467ab6=0x4,_0x15202c=Math[_0x39407f(0x294)](_0x17ce2,Math['max'](_0x299122,Math[_0x39407f(0x2bc)](_0x29e5d8*0.3))),_0x4fddc6=_0x29e5d8-_0x15202c-TIMELINE_CONFIG['GUTTER']-0x3-_0x467ab6,_0xa3994f=_0x2e4428-_0x45787e,_0x509a76=_0xa3994f/_0x15202c,_0x43c7a2=renderTimeAxis({'startTime':_0x45787e,'endTime':_0x2e4428,'durationMs':_0xa3994f,'msPerChar':_0x509a76},_0x15202c),_0x3f98d7=[];for(const _0x1b92de of _0x1e155e[_0x39407f(0x34f)]()){_0x3f98d7[_0x39407f(0x377)](..._0x1b92de);}_0x3f98d7[_0x39407f(0x2ba)]((_0x1006db,_0x2fd758)=>_0x2fd758[_0x39407f(0x2c3)]-_0x1006db[_0x39407f(0x2c3)]);const _0x8e450e=new Date(_0x45787e),_0x26aaac=formatDate(_0x8e450e),_0x221479=_0x467ab6+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x4fddc6,_0x4352ab='\x20'[_0x39407f(0x297)](_0x221479-_0x26aaac[_0x39407f(0x2c2)]),_0x144798=_0x4352ab+a54_0x13943d[_0x39407f(0x31c)](_0x26aaac)+'\x20'+_0x43c7a2;_0x2c6c5f[_0x39407f(0x377)](_0x144798);const _0x3339e1=0x16;let _0x52e3b1=0x0;for(const _0x447c7b of _0x3f98d7){const _0x4cfbd7=_0x447c7b['session']['project']?.[_0x39407f(0x1c3)]||'?',_0xe8bf25=Math[_0x39407f(0x294)](stringWidth(_0x4cfbd7),_0x3339e1);_0x52e3b1=Math[_0x39407f(0x26c)](_0x52e3b1,_0xe8bf25);}for(const _0x35460b of _0x3f98d7){const {session:_0x195f02,startTime:_0xd431cc,endTime:_0x8b8e67,duration:_0x370413}=_0x35460b,_0x35ecc9=_0x195f02['project']?.['id'],_0x435ac9=_0x195f02['id'],_0x54318f=_0x195f02[_0x39407f(0x330)]?.[_0x39407f(0x1c3)]||'?',_0x2aea14=_0x195f02[_0x39407f(0x2f9)]?.[_0x39407f(0x1c3)]||'?';let _0x240654,_0x1283df;if(_0x195f02[_0x39407f(0x363)]){const _0x986773=_0x195f02['lastAttempt'];!_0x986773[_0x39407f(0x20a)]?(_0x240654=_0x986773['cancelRequested']?'🛑':'🔄',_0x1283df=_0x986773['cancelRequested']?a54_0x13943d[_0x39407f(0x2f5)]:a54_0x13943d[_0x39407f(0x258)]):(_0x240654=_0x986773[_0x39407f(0x204)]?'✅':'❌',_0x1283df=_0x986773[_0x39407f(0x204)]?a54_0x13943d[_0x39407f(0x211)]:a54_0x13943d[_0x39407f(0x1fc)]);}else _0x240654='⏳',_0x1283df=a54_0x13943d[_0x39407f(0x31c)];const _0x5cff45='#'+_0x435ac9,_0x2e9856=_0x35ecc9?hyperlink(_0x5cff45,getWorkflowSessionUrl(_0x2ffd70,_0x35ecc9,_0x435ac9)):_0x5cff45;let _0x4ff1f3=_0x54318f;stringWidth(_0x54318f)>_0x3339e1&&(_0x4ff1f3=_0x54318f['slice'](0x0,_0x3339e1-0x1)+'…');const _0x55817d=a54_0x13943d[_0x39407f(0x31c)](_0x4ff1f3),_0x5f6ca4=stringWidth(_0x4ff1f3),_0x52d5b6='\x20'[_0x39407f(0x297)](_0x52e3b1-stringWidth(_0x4ff1f3)+0x2),_0x442fef='('+formatElapsed(_0x370413)+')',_0x35ee77=stringWidth(_0x442fef),_0x2ddb15=stringWidth(_0x5cff45),_0x1ddb60=_0x2ddb15+0x1+_0x5f6ca4+_0x52d5b6[_0x39407f(0x2c2)],_0x4214eb=_0x4fddc6-_0x1ddb60-_0x35ee77-0x1-0x8;let _0x28b3be=_0x2aea14;stringWidth(_0x28b3be)>_0x4214eb&&(_0x28b3be=_0x28b3be['slice'](0x0,_0x4214eb-0x1)+'…');const _0x52e7e6=_0x2e9856+'\x20'+_0x55817d+_0x52d5b6+_0x28b3be,_0x176e42=stringWidth(_0x52e7e6),_0x5833fd=_0x4fddc6-_0x176e42-_0x35ee77,_0x2c1b1a=_0x52e7e6+'\x20'[_0x39407f(0x297)](Math[_0x39407f(0x26c)](0x1,_0x5833fd))+a54_0x13943d[_0x39407f(0x31c)](_0x442fef),_0x5900b3=Math[_0x39407f(0x2bc)]((_0xd431cc-_0x45787e)/_0x509a76),_0x4ee2ed=Math[_0x39407f(0x2bc)]((_0x8b8e67-_0x45787e)/_0x509a76),_0x286230=Math[_0x39407f(0x26c)](_0x5900b3+0x1,_0x4ee2ed),_0x1436ce=new Array(_0x15202c)['fill']('\x20');for(let _0x4deb3e=_0x5900b3;_0x4deb3e<Math[_0x39407f(0x294)](_0x286230,_0x15202c);_0x4deb3e++){_0x1436ce[_0x4deb3e]='─';}const _0x556149=_0x1436ce[_0x39407f(0x285)](_0x4fc93d=>_0x4fc93d==='\x20'?'\x20':_0x1283df(_0x4fc93d))[_0x39407f(0x219)]('');_0x2c6c5f[_0x39407f(0x377)](_0x240654+'\x20'+_0x2c1b1a+'│'+_0x556149+'│');}return _0x2c6c5f[_0x39407f(0x219)]('\x0a');}async['navigateSessionsInteractive'](_0x1cb770,_0x4ec489,_0xa6d679){const _0x305c9c=a54_0x2a0943,{options:_0x699f4e,tdx:_0x5ee484}=_0x4ec489,_0x5ad973=_0x699f4e[_0x305c9c(0x1e2)],{timelineRows:_0x47cb95,timeAxisHeader:_0x2db2f9}=this[_0x305c9c(0x389)](_0x1cb770,_0x5ad973),_0x3b188b=_0x47cb95['filter'](_0x26dec7=>_0x26dec7[_0x305c9c(0x20b)]);if(_0x3b188b[_0x305c9c(0x2c2)]===0x0){const _0x3addf3=this[_0x305c9c(0x227)](_0x1cb770,_0x5ad973);console[_0x305c9c(0x31e)](_0x3addf3);!_0xa6d679&&(console[_0x305c9c(0x2ae)](''),console[_0x305c9c(0x2ae)](a54_0x13943d['dim'](_0x305c9c(0x34c))),console['error'](a54_0x13943d[_0x305c9c(0x31c)](_0x305c9c(0x2d8))+'or'+a54_0x13943d['dim'](_0x305c9c(0x264))));return;}_0x2db2f9&&console[_0x305c9c(0x31e)](_0x2db2f9);const _0x16c9d3=_0x47cb95[_0x305c9c(0x2ed)](_0x5496d5=>_0x5496d5[_0x305c9c(0x20b)])[_0x305c9c(0x285)](_0x45c37d=>({'title':_0x45c37d[_0x305c9c(0x2b9)],'value':_0x45c37d['attemptId']})),_0x2397bd=process['stdout'][_0x305c9c(0x1fd)]||0x3c,_0x54ab0e=Math[_0x305c9c(0x26c)](0x28,Math[_0x305c9c(0x2bc)](_0x2397bd*0x2/0x3)),_0x44c8eb=await a54_0x1b2330({'type':_0x305c9c(0x214),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x16c9d3,'initial':-0x1,'limit':_0x54ab0e,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x3f551f,_0x13bb16)=>{const _0x26379a=_0x305c9c;if(!_0x3f551f)return Promise[_0x26379a(0x223)](_0x13bb16);const _0x5855dd=_0x13bb16['filter'](_0x8b1d02=>{const _0x2b7e91=_0x26379a,_0x489ffd=_0x8b1d02;return _0x489ffd['title'][_0x2b7e91(0x1ea)]()[_0x2b7e91(0x2c6)](_0x3f551f[_0x2b7e91(0x1ea)]());});return Promise[_0x26379a(0x223)](_0x5855dd);}}),_0x3e54dd=()=>{const _0x4c0835=_0x305c9c;process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)](_0x4c0835(0x2b2)),process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)]('\x1b[1A\x1b[2K'),process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)](_0x4c0835(0x2b2));},_0x196f26=_0x44c8eb&&_0x44c8eb[_0x305c9c(0x20b)]&&_0x44c8eb['attemptId']!==null&&_0x44c8eb[_0x305c9c(0x20b)][_0x305c9c(0x2c9)]()!=='';if(!_0x196f26){_0x3e54dd(),console[_0x305c9c(0x31e)](a54_0x13943d['dim']('Cancelled'));return;}_0x3e54dd();const _0x985979=_0x1cb770['find'](_0x2a5804=>_0x2a5804[_0x305c9c(0x363)]?.['id']===_0x44c8eb[_0x305c9c(0x20b)]);if(_0x985979){const _0x152590=_0x985979['project']?.[_0x305c9c(0x1c3)]||'?',_0x1ea567=_0x985979[_0x305c9c(0x2f9)]?.[_0x305c9c(0x1c3)]||'?';console[_0x305c9c(0x31e)](_0x305c9c(0x30e)+a54_0x13943d[_0x305c9c(0x31c)](_0x152590)+_0x305c9c(0x22a)+a54_0x13943d[_0x305c9c(0x31c)](_0x1ea567));}const _0x4a83f6=new WorkflowTimelineCommand();await _0x4a83f6[_0x305c9c(0x295)]({'args':[],'options':{..._0x699f4e,'attemptId':_0x44c8eb[_0x305c9c(0x20b)]},'tdx':_0x5ee484});}['generateSessionTimelineRows'](_0x3b0bc7,_0x1508fa){const _0x2e91c0=a54_0x2a0943,_0x1d3678=new Map();for(const _0x1f2ed5 of _0x3b0bc7){_0x1f2ed5['id']&&_0x1f2ed5[_0x2e91c0(0x363)]?.['id']&&_0x1d3678['set'](_0x1f2ed5['id'],_0x1f2ed5[_0x2e91c0(0x363)]['id']);}const _0x2b0afa=[];let _0x3eb66d='';const _0x2bc52e=this['renderSessionsTimeline'](_0x3b0bc7,_0x1508fa),_0x31e85e=_0x2bc52e[_0x2e91c0(0x2ca)]('\x0a');for(const _0x1bf963 of _0x31e85e){if(_0x1bf963['startsWith'](_0x2e91c0(0x350))||_0x1bf963[_0x2e91c0(0x2d4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3eb66d=_0x1bf963;else{if(_0x1bf963['match'](/^[✅❌🔄🛑⏳]/)){const _0x649a6b=_0x1bf963[_0x2e91c0(0x2d4)](/#(\d+)/),_0x77203d=_0x649a6b?_0x649a6b[0x1]:null,_0x56f129=_0x77203d?_0x1d3678[_0x2e91c0(0x1bf)](_0x77203d)||null:null,_0x39f0f8=_0x3b0bc7[_0x2e91c0(0x331)](_0x1824a3=>_0x1824a3['id']===_0x77203d),_0x477ee2=_0x39f0f8?.['project']?.[_0x2e91c0(0x1c3)]||'';_0x2b0afa[_0x2e91c0(0x377)]({'displayLine':_0x1bf963,'attemptId':_0x56f129,'projectName':_0x477ee2});}}}return{'timelineRows':_0x2b0afa,'timeAxisHeader':_0x3eb66d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x2b5);['description']=a54_0x2a0943(0x1d9);async[a54_0x2a0943(0x295)](_0x5a96c5){const _0x5eb72f=a54_0x2a0943,{options:_0x48e602,args:_0x349fc2,tdx:_0x56b2fc}=_0x5a96c5,_0x37ba8d=this['parseProjectWorkflowPattern'](_0x349fc2,_0x48e602);if(!_0x37ba8d)return 0x1;const {projectName:_0x406218,workflowName:_0x1c5053}=_0x37ba8d,_0xf4840b=_0x48e602['includeRetried'];if(_0x48e602[_0x5eb72f(0x31f)]){if(_0x406218&&_0x1c5053)console[_0x5eb72f(0x2ae)](_0x5eb72f(0x24f)+_0x406218+'.'+_0x1c5053);else _0x406218&&console[_0x5eb72f(0x2ae)](_0x5eb72f(0x2d5)+_0x406218);_0xf4840b&&console[_0x5eb72f(0x2ae)](_0x5eb72f(0x2e7));}const _0x1eb104=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x56b2fc[_0x5eb72f(0x2f9)]['attempts']({'projectName':_0x406218,'workflowName':_0x1c5053,'includeRetried':_0xf4840b,'limit':_0x48e602[_0x5eb72f(0x34d)]}),{'verbose':_0x48e602[_0x5eb72f(0x31f)]}),_0x267641=_0x1eb104[_0x5eb72f(0x2c0)],_0x3ed299=_0x48e602[_0x5eb72f(0x34d)]||0x64,_0x26c7f2=_0x267641['length']>=_0x3ed299?a54_0x13943d[_0x5eb72f(0x31c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x5eb72f(0x2ae)]('✔\x20Found\x20'+_0x267641[_0x5eb72f(0x2c2)]+_0x5eb72f(0x212)+(_0x267641[_0x5eb72f(0x2c2)]!==0x1?'s':'')+_0x26c7f2);if(_0x48e602['format']===_0x5eb72f(0x200)||_0x48e602[_0x5eb72f(0x352)]===_0x5eb72f(0x291)||_0x48e602['format']===_0x5eb72f(0x311))await handleSDKOutput(_0x267641,_0x48e602);else{if(_0x267641[_0x5eb72f(0x2c2)]===0x0){if(_0x406218&&_0x1c5053)console['log'](_0x5eb72f(0x28a)+_0x406218+'.'+_0x1c5053);else _0x406218?console[_0x5eb72f(0x31e)](_0x5eb72f(0x1dd)+_0x406218):console[_0x5eb72f(0x31e)](_0x5eb72f(0x368));}else{const _0x52f395=_0x48e602[_0x5eb72f(0x1e2)],_0x29fde9=_0x267641[_0x5eb72f(0x285)](_0x1a715e=>{const _0x3273ce=_0x5eb72f,_0x5ccce1=a54_0x13943d[_0x3273ce(0x31c)]('#'+_0x1a715e['id']),_0x14fac3=_0x1a715e[_0x3273ce(0x330)]?.['id'],_0xe46731=_0x1a715e[_0x3273ce(0x1f8)]||_0x1a715e['sessionId'],_0x1eb4e0=_0x14fac3&&_0xe46731?hyperlink(_0x5ccce1,getWorkflowAttemptUrl(_0x52f395,_0x14fac3,_0xe46731,_0x1a715e['id'])):_0x5ccce1,{icon:_0x4a42b8,text:_0x3c3abb}=getAttemptStatusDisplay(_0x1a715e),_0x580766=(_0x1a715e[_0x3273ce(0x330)]?.['name']||'?')+'.'+(_0x1a715e[_0x3273ce(0x2f9)]?.[_0x3273ce(0x1c3)]||'?'),_0x3edb0c=_0x1a715e[_0x3273ce(0x36a)]?a54_0x13943d[_0x3273ce(0x31c)](_0x1a715e[_0x3273ce(0x36a)]):'';return(_0x1eb4e0+'\x20'+_0x4a42b8+(_0x3c3abb?'\x20'+_0x3c3abb:'')+'\x20'+_0x580766+'\x20'+_0x3edb0c)['trimEnd']();});await writeOutput(_0x29fde9[_0x5eb72f(0x219)]('\x0a'),_0x48e602['output'],_0x5eb72f(0x354));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c2);['description']='Show\x20specific\x20attempt\x20details';async['execute'](_0x3a3a83){const _0x10189d=a54_0x2a0943,{options:_0x5e1a10,args:_0x20c12d,tdx:_0x4b412c}=_0x3a3a83,_0x2c3234=_0x20c12d[0x0];if(!_0x2c3234)return console[_0x10189d(0x2ae)](_0x10189d(0x231)),0x1;_0x5e1a10['verbose']&&console[_0x10189d(0x2ae)](_0x10189d(0x310)+_0x2c3234);const _0x499f81=await withSpinner(_0x10189d(0x2f3),()=>_0x4b412c['workflow'][_0x10189d(0x1ff)](_0x2c3234),{'verbose':_0x5e1a10[_0x10189d(0x31f)]}),_0x1d2b73=_0x499f81[_0x10189d(0x2c0)];let _0x4d70dd;!_0x1d2b73['done']?_0x4d70dd=_0x1d2b73[_0x10189d(0x2a9)]?_0x10189d(0x27c):_0x10189d(0x2ea):_0x4d70dd=_0x1d2b73['success']?_0x10189d(0x204):_0x10189d(0x2ae);let _0x112131;if(_0x1d2b73[_0x10189d(0x34e)]&&_0x1d2b73[_0x10189d(0x2e0)]){const _0x4f9067=new Date(_0x1d2b73['createdAt'])['getTime'](),_0x120122=new Date(_0x1d2b73[_0x10189d(0x2e0)])[_0x10189d(0x29c)]();_0x112131=Math[_0x10189d(0x277)]((_0x120122-_0x4f9067)/0x3e8);}const _0x20712b={'attempt_id':_0x1d2b73['id'],'status':_0x4d70dd,..._0x1d2b73['index']!==undefined&&{'index':_0x1d2b73[_0x10189d(0x2bf)]},..._0x1d2b73[_0x10189d(0x330)]&&{'project':_0x1d2b73[_0x10189d(0x330)]['name']},..._0x1d2b73[_0x10189d(0x2f9)]&&{'workflow':_0x1d2b73[_0x10189d(0x2f9)]['name']},..._0x1d2b73[_0x10189d(0x1fe)]&&{'session_id':_0x1d2b73[_0x10189d(0x1fe)]},..._0x1d2b73[_0x10189d(0x36a)]&&{'session_time':_0x1d2b73[_0x10189d(0x36a)]},..._0x1d2b73[_0x10189d(0x358)]&&{'retry_attempt':_0x1d2b73[_0x10189d(0x358)]},..._0x112131!==undefined&&{'duration_sec':_0x112131},..._0x1d2b73[_0x10189d(0x34e)]&&{'created_at':_0x1d2b73[_0x10189d(0x34e)]},..._0x1d2b73['finishedAt']&&{'finished_at':_0x1d2b73[_0x10189d(0x2e0)]},...Object[_0x10189d(0x1c9)](_0x1d2b73[_0x10189d(0x253)])[_0x10189d(0x2c2)]>0x0&&{'params':_0x1d2b73[_0x10189d(0x253)]}};return await handleSingleObjectOutput(_0x20712b,_0x5e1a10),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x2a0943(0x23d);[a54_0x2a0943(0x337)]='Show\x20tasks\x20for\x20an\x20attempt';async[a54_0x2a0943(0x295)](_0x5d5f0b){const _0x3b4b8e=a54_0x2a0943,{options:_0x1d8e9d,args:_0x238534,tdx:_0x1fc44c}=_0x5d5f0b,_0x341448=_0x238534[0x0];if(!_0x341448)return console[_0x3b4b8e(0x2ae)](_0x3b4b8e(0x231)),0x1;const _0x40ddff=_0x1d8e9d[_0x3b4b8e(0x209)];_0x1d8e9d[_0x3b4b8e(0x31f)]&&(console[_0x3b4b8e(0x2ae)](_0x3b4b8e(0x310)+_0x341448),_0x40ddff&&console['error'](_0x3b4b8e(0x359)));const _0x2d1053=await withSpinner(_0x3b4b8e(0x371),()=>_0x1fc44c[_0x3b4b8e(0x2f9)]['tasks'](_0x341448,_0x40ddff||![]),{'verbose':_0x1d8e9d[_0x3b4b8e(0x31f)]}),_0x169f81=_0x2d1053['data'];return console[_0x3b4b8e(0x2ae)]('✔\x20Found\x20'+_0x169f81['length']+_0x3b4b8e(0x1de)+(_0x169f81['length']!==0x1?'s':'')),await handleSDKOutput(_0x169f81,_0x1d8e9d),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a54_0x2a0943(0x1c4);['description']=a54_0x2a0943(0x283);async[a54_0x2a0943(0x295)](_0x4483d1){const _0x472c3d=a54_0x2a0943,{options:_0x571506,args:_0xe8eb53,tdx:_0x3bdc4c}=_0x4483d1,_0x22aeae=_0xe8eb53[0x0];let _0x36ff36=_0xe8eb53[0x1];if(!_0x22aeae)return console['error'](_0x472c3d(0x231)),0x1;_0x571506['verbose']&&(console[_0x472c3d(0x2ae)](_0x472c3d(0x310)+_0x22aeae),_0x36ff36&&console[_0x472c3d(0x2ae)](_0x472c3d(0x308)+_0x36ff36));const _0x4a377f=await withSpinner(_0x472c3d(0x30c),()=>_0x3bdc4c['workflow'][_0x472c3d(0x286)](_0x22aeae,_0x36ff36),{'verbose':_0x571506[_0x472c3d(0x31f)]}),_0x47c28c=_0x4a377f[_0x472c3d(0x2c0)];if(_0x47c28c['length']===0x0)return console['error'](_0x472c3d(0x2a0)),0x0;if(!_0x36ff36&&(_0x571506[_0x472c3d(0x200)]||_0x571506['format']))return await handleSDKOutput(_0x47c28c,_0x571506),0x0;if(!_0x36ff36){const _0x114fe9=_0x47c28c['map'](_0x249ec2=>({'title':_0x249ec2[_0x472c3d(0x343)]+'\x20('+formatBytes(_0x249ec2[_0x472c3d(0x369)])+')','value':_0x249ec2[_0x472c3d(0x343)]})),_0x20716e=await a54_0x1b2330({'type':_0x472c3d(0x336),'name':_0x472c3d(0x27e),'message':_0x472c3d(0x236),'choices':_0x114fe9});if(!_0x20716e[_0x472c3d(0x27e)])return console[_0x472c3d(0x2ae)](_0x472c3d(0x22c)),0x0;_0x36ff36=_0x20716e[_0x472c3d(0x27e)];}const _0x21dd97=await withSpinner(_0x472c3d(0x1c5),()=>_0x3bdc4c[_0x472c3d(0x2f9)][_0x472c3d(0x1d1)](_0x22aeae,_0x36ff36),{'verbose':_0x571506[_0x472c3d(0x31f)]}),_0x308e06=_0x21dd97['data'];return _0x308e06?console[_0x472c3d(0x31e)](_0x308e06):console[_0x472c3d(0x2ae)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x386);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x24d);async[a54_0x2a0943(0x295)](_0xc63e18){const _0x1192f2=a54_0x2a0943,{options:_0x2d2927,args:_0x5b5d5a,tdx:_0x292140}=_0xc63e18,_0xd145ee=_0x5b5d5a[0x0];if(!_0xd145ee)return console[_0x1192f2(0x2ae)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x39eff5=_0x2d2927[_0x1192f2(0x254)];_0x2d2927[_0x1192f2(0x31f)]&&(console['error'](_0x1192f2(0x310)+_0xd145ee),_0x39eff5&&console[_0x1192f2(0x2ae)](_0x1192f2(0x2bd)+_0x39eff5));if(!_0x2d2927['yes']){if(!isInteractive())return console[_0x1192f2(0x2ae)](a54_0x13943d['red'](_0x1192f2(0x252)),_0x1192f2(0x2e4)),console[_0x1192f2(0x2ae)](a54_0x13943d[_0x1192f2(0x31c)](_0x1192f2(0x25d))),0x1;const _0x543766=await confirmKey(_0x1192f2(0x29b)+_0xd145ee+'?');if(!_0x543766)return console['error'](a54_0x13943d['yellow'](_0x1192f2(0x22c))),0x1;}const _0x4f132f=await withSpinner('Killing\x20attempt...',()=>_0x292140[_0x1192f2(0x2f9)][_0x1192f2(0x1f5)](_0xd145ee,_0x39eff5),{'verbose':_0x2d2927[_0x1192f2(0x31f)]}),_0x395540=_0x4f132f[_0x1192f2(0x2c0)];return console['error']('✔\x20'+_0x395540),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]='workflow:retry';['description']=a54_0x2a0943(0x255);async[a54_0x2a0943(0x295)](_0x2ec92c){const _0xcfac80=a54_0x2a0943,{options:_0x198308,args:_0x39c043,tdx:_0x306e7e}=_0x2ec92c,_0x31478a=_0x39c043[0x0];if(!_0x31478a)return console[_0xcfac80(0x2ae)](_0xcfac80(0x270)),console[_0xcfac80(0x2ae)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x14d630=![],_0x30a302=_0x31478a;if(_0x31478a[_0xcfac80(0x37d)](_0xcfac80(0x22f)))_0x14d630=!![],_0x30a302=_0x31478a[_0xcfac80(0x259)](0x8);else{if(_0x31478a[_0xcfac80(0x37d)](_0xcfac80(0x241)))_0x14d630=![],_0x30a302=_0x31478a['substring'](0x8);else return console['error'](_0xcfac80(0x342)),console[_0xcfac80(0x2ae)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x5dfb3e=_0x198308['fromTask'],_0x4945d4=_0x198308[_0xcfac80(0x220)],_0x31103b=_0x198308[_0xcfac80(0x253)],_0x2c6504=_0x198308[_0xcfac80(0x328)];_0x198308[_0xcfac80(0x31f)]&&(console[_0xcfac80(0x2ae)]('Target:\x20'+(_0x14d630?'session':_0xcfac80(0x1ff))+'\x20'+_0x30a302),_0x5dfb3e&&console[_0xcfac80(0x2ae)](_0xcfac80(0x35c)+_0x5dfb3e),_0x4945d4&&console[_0xcfac80(0x2ae)]('Resume\x20from:\x20'+_0x4945d4),_0x31103b&&console[_0xcfac80(0x2ae)]('Params:\x20'+_0x31103b),_0x2c6504&&console[_0xcfac80(0x2ae)](_0xcfac80(0x303)));let _0xf981ed;if(_0x31103b)try{if(_0x31103b[_0xcfac80(0x37d)]('@')){const _0x300e5c=await import(_0xcfac80(0x1f1)),_0x56a708=_0x31103b[_0xcfac80(0x259)](0x1),_0x19207c=await _0x300e5c[_0xcfac80(0x2e2)](_0x56a708,'utf-8');_0xf981ed=JSON['parse'](_0x19207c);}else _0xf981ed=JSON[_0xcfac80(0x1bd)](_0x31103b);}catch{return console[_0xcfac80(0x2ae)](_0xcfac80(0x24b)),0x1;}if(!_0x198308[_0xcfac80(0x340)]){if(!isInteractive())return console[_0xcfac80(0x2ae)](a54_0x13943d[_0xcfac80(0x1fc)](_0xcfac80(0x252)),_0xcfac80(0x2e4)),console[_0xcfac80(0x2ae)](a54_0x13943d['dim'](_0xcfac80(0x25d))),0x1;const _0x4f1441=await confirmKey(_0xcfac80(0x35b)+(_0x14d630?_0xcfac80(0x229):_0xcfac80(0x1ff))+'\x20'+_0x30a302+'?');if(!_0x4f1441)return console['error'](a54_0x13943d[_0xcfac80(0x2f5)](_0xcfac80(0x22c))),0x1;}let _0x928dec;_0x14d630?_0x928dec=await withSpinner(_0xcfac80(0x25b),()=>_0x306e7e[_0xcfac80(0x2f9)]['retrySession'](_0x30a302,{'fromTask':_0x5dfb3e,'retryParams':_0xf981ed}),{'verbose':_0x198308['verbose']}):_0x928dec=await withSpinner('Retrying\x20attempt...',()=>_0x306e7e[_0xcfac80(0x2f9)][_0xcfac80(0x281)](_0x30a302,{'resumeFrom':_0x4945d4,'retryParams':_0xf981ed,'force':_0x2c6504}),{'verbose':_0x198308[_0xcfac80(0x31f)]});const _0x597602=_0x928dec[_0xcfac80(0x2c0)];return console[_0xcfac80(0x2ae)](_0xcfac80(0x306)),console[_0xcfac80(0x2ae)](_0xcfac80(0x2d1)+_0x597602['attemptId']),console[_0xcfac80(0x2ae)]('\x20\x20Session\x20ID:\x20'+_0x597602[_0xcfac80(0x1fe)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x333);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2ad);async[a54_0x2a0943(0x295)](_0x4aee00){const _0x331a3b=a54_0x2a0943,{options:_0x28eac7,args:_0x2679aa,tdx:_0x2dad9a}=_0x4aee00;let _0x44c783=_0x2679aa[0x0];if(!_0x44c783){const _0x3361c1=this[_0x331a3b(0x1d4)]([],_0x28eac7),_0x9a86fb=await withSpinner(_0x331a3b(0x341),()=>_0x2dad9a[_0x331a3b(0x2f9)][_0x331a3b(0x1d5)](_0x3361c1,{'limit':_0x28eac7[_0x331a3b(0x34d)]}),{'verbose':_0x28eac7['verbose']}),_0x96bd32=_0x9a86fb[_0x331a3b(0x2c0)];if(_0x96bd32[_0x331a3b(0x2c2)]===0x0)return console[_0x331a3b(0x2ae)](_0x331a3b(0x293)),!_0x3361c1&&console['error'](a54_0x13943d[_0x331a3b(0x31c)](_0x331a3b(0x362))),0x1;const _0xa1f094=_0x96bd32[_0x331a3b(0x285)](_0x4a8968=>({'title':_0x4a8968['project']?.[_0x331a3b(0x1c3)]+'.'+_0x4a8968[_0x331a3b(0x1c3)],'value':_0x4a8968[_0x331a3b(0x330)]?.[_0x331a3b(0x1c3)]+'.'+_0x4a8968[_0x331a3b(0x1c3)],'description':_0x4a8968['revision']?_0x331a3b(0x26b)+_0x4a8968[_0x331a3b(0x271)]:undefined})),_0x51a273=await a54_0x1b2330({'type':_0x331a3b(0x336),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0xa1f094});if(!_0x51a273[_0x331a3b(0x2f9)])return 0x1;_0x44c783=_0x51a273[_0x331a3b(0x2f9)];}if(!_0x44c783[_0x331a3b(0x2c6)]('.')){const _0x58ea46=this[_0x331a3b(0x1d4)]([],_0x28eac7);if(_0x58ea46)_0x44c783=_0x58ea46+'.'+_0x44c783;else return console['error'](a54_0x13943d[_0x331a3b(0x1fc)](_0x331a3b(0x33f)),_0x331a3b(0x376)),console[_0x331a3b(0x2ae)](a54_0x13943d['dim'](_0x331a3b(0x362))),0x1;}const _0xfd6e51=_0x28eac7[_0x331a3b(0x21e)],_0x43ad2a=_0x28eac7[_0x331a3b(0x36a)],_0x401b11={};if(_0xfd6e51&&Array['isArray'](_0xfd6e51))for(const _0x2f60c7 of _0xfd6e51){const _0x2c4698=_0x2f60c7['indexOf']('=');if(_0x2c4698===-0x1)return console[_0x331a3b(0x2ae)](_0x331a3b(0x27f)+_0x2f60c7),console[_0x331a3b(0x2ae)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1b5193=_0x2f60c7[_0x331a3b(0x259)](0x0,_0x2c4698),_0x30b29f=_0x2f60c7[_0x331a3b(0x259)](_0x2c4698+0x1);try{_0x401b11[_0x1b5193]=JSON[_0x331a3b(0x1bd)](_0x30b29f);}catch{_0x401b11[_0x1b5193]=_0x30b29f;}}_0x28eac7[_0x331a3b(0x31f)]&&(console['error'](_0x331a3b(0x27a)+_0x44c783),Object[_0x331a3b(0x1c9)](_0x401b11)['length']>0x0&&console[_0x331a3b(0x2ae)]('Parameters:\x20'+JSON[_0x331a3b(0x327)](_0x401b11)),_0x43ad2a&&console['error'](_0x331a3b(0x20d)+_0x43ad2a));const _0x151614=await withSpinner(_0x331a3b(0x22b),()=>_0x2dad9a['workflow'][_0x331a3b(0x28b)](_0x44c783,_0x401b11,{'sessionTime':_0x43ad2a}),{'verbose':_0x28eac7[_0x331a3b(0x31f)]}),_0x41c3fa=_0x151614[_0x331a3b(0x2c0)];console['error'](_0x331a3b(0x29e)),console[_0x331a3b(0x2ae)](_0x331a3b(0x2b7)+_0x41c3fa['id']),console['error'](_0x331a3b(0x256)+_0x41c3fa[_0x331a3b(0x1fe)]),console[_0x331a3b(0x2ae)](_0x331a3b(0x33b)+_0x41c3fa['project']?.[_0x331a3b(0x1c3)]),console['error'](_0x331a3b(0x35e)+_0x41c3fa[_0x331a3b(0x2f9)]?.['name']);if(_0x41c3fa[_0x331a3b(0x330)]?.['id']&&_0x41c3fa[_0x331a3b(0x1fe)]&&_0x41c3fa['id']){const _0x5ca5ae=_0x28eac7[_0x331a3b(0x1e2)],_0x4fe8cd=getConsoleUrl(_0x5ca5ae,_0x331a3b(0x33a)+_0x41c3fa[_0x331a3b(0x330)]['id']+_0x331a3b(0x1cd)+_0x41c3fa[_0x331a3b(0x1fe)]+_0x331a3b(0x2d0)+_0x41c3fa['id']);console[_0x331a3b(0x2ae)](_0x331a3b(0x2fd)+a54_0x13943d['cyan'](_0x4fe8cd));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2be);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2df);async[a54_0x2a0943(0x295)](_0x248ed9){const _0x453fa1=a54_0x2a0943,{options:_0x4410bf,args:_0x28b482,tdx:_0xa9dc0e}=_0x248ed9,_0x59629d=_0x28b482[0x0],_0x5a42d8=_0x28b482[0x1]||'.';if(!_0x59629d)return console[_0x453fa1(0x2ae)](_0x453fa1(0x21c)),console['error'](_0x453fa1(0x24a)),0x1;const _0x54d193=_0x4410bf[_0x453fa1(0x271)];_0x4410bf['verbose']&&(console['error']('Project:\x20'+_0x59629d),console[_0x453fa1(0x2ae)](_0x453fa1(0x36e)+_0x5a42d8),_0x54d193&&console[_0x453fa1(0x2ae)](_0x453fa1(0x20c)+_0x54d193));const _0x3cd632=await withSpinner(_0x453fa1(0x1ce)+_0x59629d+_0x453fa1(0x320),()=>_0xa9dc0e[_0x453fa1(0x2f9)][_0x453fa1(0x224)](_0x59629d,_0x5a42d8,{'revision':_0x54d193}),{'verbose':_0x4410bf[_0x453fa1(0x31f)]}),_0x128565=_0x3cd632[_0x453fa1(0x2c0)];return console[_0x453fa1(0x2ae)](_0x453fa1(0x32a)+_0x128565[_0x453fa1(0x282)]),console[_0x453fa1(0x2ae)](_0x453fa1(0x1f0)+_0x128565['revision']),console[_0x453fa1(0x2ae)](_0x453fa1(0x250)+_0x128565[_0x453fa1(0x2d6)]),console[_0x453fa1(0x2ae)](_0x453fa1(0x21b)+_0x5a42d8+'/'+_0x128565[_0x453fa1(0x282)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x357);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x1da);async[a54_0x2a0943(0x295)](_0x321086){const _0x14f715=a54_0x2a0943,{options:_0x1813d6,args:_0x11cf39,tdx:_0x3a3753}=_0x321086;let _0x407471='.',_0x36373c=_0x1813d6[_0x14f715(0x1c3)];if(_0x11cf39[0x0]){const {promises:_0x1a246c}=await import('fs');try{const _0x58b509=await _0x1a246c['stat'](_0x11cf39[0x0]);if(_0x58b509[_0x14f715(0x2af)]())_0x407471=_0x11cf39[0x0];else return console[_0x14f715(0x2ae)](_0x14f715(0x2cb)+_0x11cf39[0x0]+_0x14f715(0x276)),0x1;}catch{_0x36373c=_0x11cf39[0x0],_0x407471='.';}}const _0x3b4970=_0x1813d6[_0x14f715(0x271)],_0x410452=_0x1813d6[_0x14f715(0x251)];_0x1813d6['verbose']&&(console[_0x14f715(0x2ae)](_0x14f715(0x28c)+_0x407471),_0x36373c&&console[_0x14f715(0x2ae)](_0x14f715(0x345)+_0x36373c),_0x3b4970&&console[_0x14f715(0x2ae)](_0x14f715(0x20c)+_0x3b4970),_0x410452&&console['error'](_0x14f715(0x2e8)));const _0x15f00b=await withSpinner(_0x14f715(0x1c7),()=>_0x3a3753[_0x14f715(0x2f9)]['push'](_0x407471,{'projectName':_0x36373c,'revision':_0x3b4970,'skipValidation':_0x410452}),{'verbose':_0x1813d6[_0x14f715(0x31f)]}),_0x8ba727=_0x15f00b['data'];return console['error'](_0x14f715(0x25a)+_0x8ba727[_0x14f715(0x282)]),console[_0x14f715(0x2ae)](_0x14f715(0x2db)+_0x8ba727[_0x14f715(0x360)]),console[_0x14f715(0x2ae)]('\x20\x20Revision:\x20'+_0x8ba727[_0x14f715(0x271)]),await this[_0x14f715(0x388)](_0x3a3753,_0x8ba727['projectName'],_0x1813d6[_0x14f715(0x1e2)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2c8);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2fe);async['execute'](_0x49d05f){const _0x31e613=a54_0x2a0943,{options:_0x4eeb45,args:_0xf0d337,tdx:_0x2c0d0a}=_0x49d05f,_0x2014f7=_0xf0d337[0x0],_0x395c51=_0xf0d337[0x1];if(!_0x2014f7)return console['error'](a54_0x13943d[_0x31e613(0x1fc)](_0x31e613(0x33f)),_0x31e613(0x24c)),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x207))),0x1;const _0x5c4ff3=_0x4eeb45[_0x31e613(0x271)];_0x4eeb45['verbose']&&(console[_0x31e613(0x2ae)]('Project:\x20'+_0x2014f7),_0x395c51&&console[_0x31e613(0x2ae)]('Target\x20directory:\x20'+_0x395c51),_0x5c4ff3&&console[_0x31e613(0x2ae)]('Revision:\x20'+_0x5c4ff3),_0x4eeb45[_0x31e613(0x21f)]&&console[_0x31e613(0x2ae)](_0x31e613(0x329)));const _0x15c4c7=await withSpinner(_0x31e613(0x272)+_0x2014f7+_0x31e613(0x320),()=>_0x2c0d0a[_0x31e613(0x2f9)][_0x31e613(0x1db)](_0x2014f7,{'targetDir':_0x395c51,'revision':_0x5c4ff3}),{'verbose':_0x4eeb45[_0x31e613(0x31f)]}),_0xa2dc45=_0x15c4c7['data'];_0xa2dc45['isNewProject']?console[_0x31e613(0x2ae)](_0x31e613(0x237)+_0xa2dc45[_0x31e613(0x282)]):console[_0x31e613(0x2ae)](_0x31e613(0x20f)+_0xa2dc45[_0x31e613(0x282)]);console['error'](_0x31e613(0x1f0)+_0xa2dc45[_0x31e613(0x271)]),console[_0x31e613(0x2ae)](_0x31e613(0x2cc)+(a54_0x4c5432[_0x31e613(0x1fa)](process['cwd'](),_0xa2dc45[_0x31e613(0x1c8)])||'.')),console[_0x31e613(0x2ae)](_0x31e613(0x2e3)+a54_0x13943d[_0x31e613(0x211)]('+'+_0xa2dc45['summary'][_0x31e613(0x384)]+_0x31e613(0x30a))+',\x20'+(a54_0x13943d[_0x31e613(0x2f5)]('~'+_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1cb)]+_0x31e613(0x378))+',\x20')+(a54_0x13943d[_0x31e613(0x1fc)]('-'+_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1e1)]+_0x31e613(0x29a))+',\x20')+(''+a54_0x13943d[_0x31e613(0x31c)](_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1dc)]+_0x31e613(0x1d0))));for(const _0x1c826d of _0xa2dc45[_0x31e613(0x2e1)]){_0x1c826d[_0x31e613(0x275)]===_0x31e613(0x1cb)&&_0x1c826d[_0x31e613(0x27b)]&&(console[_0x31e613(0x2ae)]('\x0a'+a54_0x13943d[_0x31e613(0x38a)](_0x31e613(0x2d7)+_0x1c826d[_0x31e613(0x26e)])),console['error'](_0x1c826d['diff']));}if(!_0xa2dc45['hasChanges'])return saveSessionContext({'workflow_project':_0xa2dc45[_0x31e613(0x282)]},_0x4eeb45[_0x31e613(0x229)]),console[_0x31e613(0x2ae)](a54_0x13943d['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x31e613(0x2ae)](a54_0x13943d['dim'](_0x31e613(0x380)+_0xa2dc45['projectName'])),0x0;if(_0x4eeb45['dryRun'])return console[_0x31e613(0x2ae)](a54_0x13943d['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x4eeb45['yes']){if(!isInteractive())return console['error'](a54_0x13943d[_0x31e613(0x1fc)](_0x31e613(0x252)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x25d))),0x1;const _0x303dc1=await confirmKey(_0x31e613(0x206));if(!_0x303dc1)return console['error'](a54_0x13943d[_0x31e613(0x2f5)](_0x31e613(0x22c)),_0x31e613(0x2eb)),0x1;}await withSpinner('Writing\x20files...',()=>_0x2c0d0a['workflow'][_0x31e613(0x1b9)](_0xa2dc45,{'revision':_0x5c4ff3}),{'verbose':_0x4eeb45['verbose']}),saveSessionContext({'workflow_project':_0xa2dc45[_0x31e613(0x282)]},_0x4eeb45[_0x31e613(0x229)]),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x211)](_0x31e613(0x353)));const _0x3562af=a54_0x4c5432[_0x31e613(0x1fa)](process[_0x31e613(0x239)](),_0xa2dc45['targetDir'])||'.';return console['error'](a54_0x13943d[_0x31e613(0x31c)]('\x20\x20Location:\x20'+_0x3562af)),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x380)+_0xa2dc45[_0x31e613(0x282)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2f8);['description']=a54_0x2a0943(0x2ef);async['execute'](_0x33e279){const _0x417029=a54_0x2a0943,{options:_0x538de4,args:_0x8a2a78,tdx:_0x307cc4}=_0x33e279,_0x4f7bfd=this['resolveProjectDir'](_0x8a2a78,_0x538de4),_0x2467a0=_0x538de4[_0x417029(0x271)],_0x4af9d7=_0x538de4[_0x417029(0x251)];_0x538de4['verbose']&&(_0x4f7bfd&&console[_0x417029(0x2ae)](_0x417029(0x2a5)+_0x4f7bfd),_0x2467a0&&console[_0x417029(0x2ae)](_0x417029(0x20c)+_0x2467a0),_0x538de4[_0x417029(0x21f)]&&console['error'](_0x417029(0x329)),_0x4af9d7&&console[_0x417029(0x2ae)](_0x417029(0x2e8)));let _0xbb5d5c;try{_0xbb5d5c=await withSpinner(_0x417029(0x37c),()=>_0x307cc4['workflow']['preparePushProject']({'sourceDir':_0x4f7bfd,'revision':_0x2467a0,'skipValidation':_0x4af9d7}),{'verbose':_0x538de4[_0x417029(0x31f)]});}catch(_0x24f935){if(_0x24f935 instanceof Error&&_0x24f935[_0x417029(0x266)][_0x417029(0x2c6)](_0x417029(0x208)))return console['error'](a54_0x13943d[_0x417029(0x1fc)](_0x417029(0x33f)),_0x417029(0x278)),_0x538de4[_0x417029(0x2fb)]?console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x31c)](_0x417029(0x2a4)+_0x538de4[_0x417029(0x2fb)]+_0x417029(0x247)+_0x538de4[_0x417029(0x2fb)]+'\x27')):console[_0x417029(0x2ae)](a54_0x13943d['dim'](_0x417029(0x210))),0x1;throw _0x24f935;}const _0x26df14=_0xbb5d5c[_0x417029(0x2c0)];console[_0x417029(0x2ae)](_0x417029(0x35a)+_0x26df14['projectName']),console[_0x417029(0x2ae)]('\x20\x20Source:\x20'+_0x26df14[_0x417029(0x1f2)]),console[_0x417029(0x2ae)]('\x20\x20Revision:\x20'+_0x26df14[_0x417029(0x271)]),console['error'](_0x417029(0x2e3)+a54_0x13943d['green']('+'+_0x26df14[_0x417029(0x301)]['new']+'\x20new')+',\x20'+(a54_0x13943d[_0x417029(0x2f5)]('~'+_0x26df14[_0x417029(0x301)][_0x417029(0x1cb)]+_0x417029(0x378))+',\x20')+(a54_0x13943d[_0x417029(0x1fc)]('-'+_0x26df14[_0x417029(0x301)][_0x417029(0x1e1)]+_0x417029(0x29a))+',\x20')+(''+a54_0x13943d[_0x417029(0x31c)](_0x26df14[_0x417029(0x301)]['unchanged']+_0x417029(0x1d0))));for(const _0x26c166 of _0x26df14['changes']){_0x26c166[_0x417029(0x275)]==='modified'&&_0x26c166[_0x417029(0x27b)]&&(console[_0x417029(0x2ae)]('\x0a'+a54_0x13943d['cyan'](_0x417029(0x2d7)+_0x26c166[_0x417029(0x26e)])),console[_0x417029(0x2ae)](_0x26c166['diff']));}if(!_0x26df14[_0x417029(0x25c)])return console['error'](a54_0x13943d[_0x417029(0x211)](_0x417029(0x249))),await this[_0x417029(0x388)](_0x307cc4,_0x26df14[_0x417029(0x282)],_0x538de4[_0x417029(0x1e2)]),0x0;if(_0x538de4[_0x417029(0x21f)])return console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x2f5)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x538de4[_0x417029(0x340)]){if(!isInteractive())return console['error'](a54_0x13943d[_0x417029(0x1fc)]('\x0aError:'),_0x417029(0x2e4)),console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x31c)](_0x417029(0x25d))),0x1;const _0x5a9b28=await confirmKey(_0x417029(0x21d));if(!_0x5a9b28)return console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x2f5)](_0x417029(0x22c)),_0x417029(0x36d)),0x1;}const _0x36fbb6=await withSpinner(_0x417029(0x262),()=>_0x307cc4['workflow'][_0x417029(0x2b0)](_0x26df14),{'verbose':_0x538de4[_0x417029(0x31f)]}),_0x1e7828=_0x36fbb6[_0x417029(0x2c0)];return console['error'](a54_0x13943d[_0x417029(0x211)](_0x417029(0x292))),console['error'](_0x417029(0x2db)+_0x1e7828[_0x417029(0x360)]),console[_0x417029(0x2ae)](_0x417029(0x1f0)+_0x1e7828[_0x417029(0x271)]),await this[_0x417029(0x388)](_0x307cc4,_0x1e7828[_0x417029(0x282)],_0x538de4[_0x417029(0x1e2)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x2f6);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x323);async[a54_0x2a0943(0x295)](_0x361acd){const _0x1cd8de=a54_0x2a0943,{options:_0x5ed3e8,args:_0x3df2d8,tdx:_0x31c5e5}=_0x361acd,_0x50dccf=this['resolveProjectDir'](_0x3df2d8,_0x5ed3e8),_0x29dafb=_0x5ed3e8[_0x1cd8de(0x1c3)],_0xab1196=_0x5ed3e8[_0x1cd8de(0x271)],_0x5509ac=_0x5ed3e8[_0x1cd8de(0x251)];if(!_0x50dccf)return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x1fc)]('Error:'),_0x1cd8de(0x385)),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim'](_0x1cd8de(0x280))),0x1;if(!_0x29dafb)return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x1fc)](_0x1cd8de(0x33f)),_0x1cd8de(0x290)),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5ed3e8['verbose']&&(console['error'](_0x1cd8de(0x2a5)+_0x50dccf),console[_0x1cd8de(0x2ae)]('New\x20project\x20name:\x20'+_0x29dafb),_0xab1196&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x20c)+_0xab1196),_0x5ed3e8['dryRun']&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x329)),_0x5509ac&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x2e8)));const _0x3cffbf=await withSpinner(_0x1cd8de(0x2b3),()=>_0x31c5e5[_0x1cd8de(0x2f9)][_0x1cd8de(0x319)](_0x50dccf,_0x29dafb,{'revision':_0xab1196,'skipValidation':_0x5509ac}),{'verbose':_0x5ed3e8['verbose']}),_0x79d7cc=_0x3cffbf[_0x1cd8de(0x2c0)];console[_0x1cd8de(0x2ae)](_0x1cd8de(0x335)+_0x79d7cc['sourceDir']);_0x79d7cc[_0x1cd8de(0x2c7)]&&console[_0x1cd8de(0x2ae)]('Source\x20project:\x20'+_0x79d7cc[_0x1cd8de(0x2c7)]);console[_0x1cd8de(0x2ae)](_0x1cd8de(0x307)+_0x79d7cc[_0x1cd8de(0x1e7)]),console['error'](_0x1cd8de(0x20c)+_0x79d7cc[_0x1cd8de(0x271)]),console[_0x1cd8de(0x2ae)](_0x1cd8de(0x1e8)+_0x79d7cc[_0x1cd8de(0x24e)]);_0x79d7cc[_0x1cd8de(0x34b)]&&(console['error'](a54_0x13943d[_0x1cd8de(0x2f5)](_0x1cd8de(0x2a2)+_0x79d7cc[_0x1cd8de(0x1e7)]+_0x1cd8de(0x317)+_0x79d7cc[_0x1cd8de(0x202)]+')')),console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x2f5)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5ed3e8[_0x1cd8de(0x21f)])return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x2f5)](_0x1cd8de(0x1bc))),0x0;if(!_0x5ed3e8[_0x1cd8de(0x340)]){if(!isInteractive())return console['error'](a54_0x13943d['red'](_0x1cd8de(0x252)),_0x1cd8de(0x2e4)),console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x31c)](_0x1cd8de(0x25d))),0x1;const _0x417e40=_0x79d7cc[_0x1cd8de(0x2c7)]||a54_0x4c5432[_0x1cd8de(0x32d)](_0x50dccf),_0x26769f=_0x79d7cc[_0x1cd8de(0x34b)]?_0x1cd8de(0x35f)+_0x29dafb+_0x1cd8de(0x2fa):_0x1cd8de(0x289)+_0x417e40+_0x1cd8de(0x2f2)+_0x29dafb+'\x22?',_0x527df8=await confirmKey(_0x26769f);if(!_0x527df8)return console[_0x1cd8de(0x2ae)](a54_0x13943d['yellow'](_0x1cd8de(0x22c))),0x1;}const _0x48cfe9=await withSpinner(_0x79d7cc['targetExists']?_0x1cd8de(0x205)+_0x29dafb+_0x1cd8de(0x320):_0x1cd8de(0x23e)+_0x29dafb+_0x1cd8de(0x320),()=>_0x31c5e5[_0x1cd8de(0x2f9)]['executeCloneProject'](_0x79d7cc),{'verbose':_0x5ed3e8[_0x1cd8de(0x31f)]}),_0x34b1f6=_0x48cfe9['data'];return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x211)](_0x79d7cc['targetExists']?_0x1cd8de(0x35d):'✔\x20Clone\x20complete')),console['error'](_0x1cd8de(0x33b)+_0x34b1f6['newProjectName']),console[_0x1cd8de(0x2ae)](_0x1cd8de(0x2db)+_0x34b1f6[_0x1cd8de(0x37f)]),console['error'](_0x1cd8de(0x1f0)+_0x34b1f6['revision']),await this['showWorkflowConsoleUrl'](_0x31c5e5,_0x34b1f6['newProjectName'],_0x5ed3e8['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x267);['description']=a54_0x2a0943(0x201);async['execute'](_0x87e2e6){const _0x2c4b1b=a54_0x2a0943,{options:_0x4aad55,args:_0x392a2d,tdx:_0x5b2b5a}=_0x87e2e6,_0x263a8d=_0x392a2d[0x0];if(!_0x263a8d)return console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x26d)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x4aad55[_0x2c4b1b(0x31f)]&&console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x30e)+_0x263a8d);if(!_0x4aad55['yes']){if(!isInteractive())return console['error'](a54_0x13943d[_0x2c4b1b(0x1fc)](_0x2c4b1b(0x252)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2c4b1b(0x2ae)](a54_0x13943d[_0x2c4b1b(0x31c)](_0x2c4b1b(0x25d))),0x1;const _0x52dbc4=await confirmKey(_0x2c4b1b(0x25e)+_0x263a8d+_0x2c4b1b(0x2a3));if(!_0x52dbc4)return console[_0x2c4b1b(0x2ae)](a54_0x13943d[_0x2c4b1b(0x2f5)](_0x2c4b1b(0x22c))),0x1;}const _0x486ead=await withSpinner(_0x2c4b1b(0x1df)+_0x263a8d+_0x2c4b1b(0x320),()=>_0x5b2b5a[_0x2c4b1b(0x2f9)]['delete'](_0x263a8d),{'verbose':_0x4aad55[_0x2c4b1b(0x31f)]}),_0x5ec44c=_0x486ead[_0x2c4b1b(0x2c0)];return console['error'](_0x2c4b1b(0x30b)+_0x5ec44c[_0x2c4b1b(0x282)]),console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x2db)+_0x5ec44c[_0x2c4b1b(0x360)]),0x0;}}export function parseKeyValue(_0x188d85){const _0x53e662=a54_0x2a0943,_0x3f29c3=_0x188d85[_0x53e662(0x2dc)]('=');if(_0x3f29c3===-0x1)throw new Error(_0x53e662(0x309)+_0x188d85+_0x53e662(0x36f));const _0x1eff98=_0x188d85[_0x53e662(0x259)](0x0,_0x3f29c3),_0x25fd0f=_0x188d85[_0x53e662(0x259)](_0x3f29c3+0x1);if(!_0x1eff98)throw new Error(_0x53e662(0x2ff));return{'key':_0x1eff98,'value':_0x25fd0f};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x373);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x287);async[a54_0x2a0943(0x295)](_0x4bd9ca){const _0x8379d4=a54_0x2a0943,{options:_0xd55625,args:_0x2a5171,tdx:_0x1f91d4}=_0x4bd9ca,_0x159300=this[_0x8379d4(0x240)](_0x2a5171,_0xd55625);if(!_0x159300)return 0x1;_0xd55625[_0x8379d4(0x31f)]&&console['error']('Project:\x20'+_0x159300);const _0x45a4ce=await withSpinner(_0x8379d4(0x1cf),()=>_0x1f91d4[_0x8379d4(0x2f9)]['listSecrets'](_0x159300),{'verbose':_0xd55625['verbose']}),{secrets:_0x35c5ba}=_0x45a4ce[_0x8379d4(0x2c0)];return console[_0x8379d4(0x2ae)](_0x8379d4(0x37e)+_0x35c5ba[_0x8379d4(0x2c2)]+'\x20secret'+(_0x35c5ba[_0x8379d4(0x2c2)]!==0x1?'s':'')),await handleSDKOutput(_0x35c5ba,_0xd55625),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x31a);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2ee);async[a54_0x2a0943(0x295)](_0x43399f){const _0x4aadcd=a54_0x2a0943,{options:_0x26314b,args:_0x3f9b52,tdx:_0x3e777d}=_0x43399f;let _0x4723ef,_0x44cac3;if(_0x3f9b52[_0x4aadcd(0x2c2)]>=0x1&&!_0x3f9b52[0x0][_0x4aadcd(0x2c6)]('='))_0x4723ef=_0x3f9b52[0x0],_0x44cac3=_0x3f9b52['slice'](0x1);else{if(_0x3f9b52['length']>=0x1&&_0x26314b['workflowProject'])_0x4723ef=_0x26314b[_0x4aadcd(0x2fb)],_0x44cac3=_0x3f9b52;else return _0x3f9b52[_0x4aadcd(0x2c2)]>=0x1?(console[_0x4aadcd(0x2ae)](_0x4aadcd(0x21c)),console[_0x4aadcd(0x2ae)](_0x4aadcd(0x362)),0x1):(console['error'](_0x4aadcd(0x32b)),console[_0x4aadcd(0x2ae)](_0x4aadcd(0x32c)),0x1);}if(_0x44cac3['length']===0x0)return console[_0x4aadcd(0x2ae)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x4aadcd(0x2ae)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x5e803e={};try{for(const _0x3a6cc7 of _0x44cac3){const {key:_0x2968c8,value:_0x34e61d}=parseKeyValue(_0x3a6cc7);_0x5e803e[_0x2968c8]=_0x34e61d;}}catch(_0x20cecc){return _0x20cecc instanceof Error&&console['error'](a54_0x13943d[_0x4aadcd(0x1fc)](_0x4aadcd(0x33f)),_0x20cecc[_0x4aadcd(0x266)]),0x1;}const _0x4d851e=Object[_0x4aadcd(0x1c9)](_0x5e803e);_0x26314b[_0x4aadcd(0x31f)]&&(console[_0x4aadcd(0x2ae)]('Project:\x20'+_0x4723ef),console[_0x4aadcd(0x2ae)]('Secrets\x20to\x20set:\x20'+_0x4d851e[_0x4aadcd(0x219)](',\x20')));const _0x33845e=await withSpinner(_0x4d851e[_0x4aadcd(0x2c2)]===0x1?_0x4aadcd(0x28e):_0x4aadcd(0x1e6)+_0x4d851e[_0x4aadcd(0x2c2)]+_0x4aadcd(0x332),()=>_0x3e777d['workflow'][_0x4aadcd(0x242)](_0x4723ef,_0x5e803e),{'verbose':_0x26314b[_0x4aadcd(0x31f)]}),_0x282326=_0x33845e[_0x4aadcd(0x2c0)];return console[_0x4aadcd(0x2ae)](_0x4d851e['length']===0x1?'✔\x20Secret\x20\x27'+_0x282326[_0x4aadcd(0x1c9)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x282326[_0x4aadcd(0x282)]+'\x27':'✔\x20'+_0x282326[_0x4aadcd(0x1c9)][_0x4aadcd(0x2c2)]+_0x4aadcd(0x1eb)+_0x282326[_0x4aadcd(0x282)]+'\x27'),(_0x26314b['json']||_0x26314b[_0x4aadcd(0x291)])&&await handleSingleObjectOutput(_0x282326,_0x26314b),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x274);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x33c);async[a54_0x2a0943(0x295)](_0x4f1eaf){const _0x45b39b=a54_0x2a0943,{options:_0xb4501,args:_0x593655,tdx:_0x31cce8}=_0x4f1eaf;let _0xdfc62b,_0x1f550f;if(_0x593655[_0x45b39b(0x2c2)]>=0x2)_0xdfc62b=_0x593655[0x0],_0x1f550f=_0x593655[0x1];else{if(_0x593655[_0x45b39b(0x2c2)]===0x1&&_0xb4501[_0x45b39b(0x2fb)])_0xdfc62b=_0xb4501['workflowProject'],_0x1f550f=_0x593655[0x0];else return _0x593655['length']===0x1?(console[_0x45b39b(0x2ae)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x45b39b(0x2ae)](_0x45b39b(0x362)),0x1):(console[_0x45b39b(0x2ae)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x45b39b(0x2ae)](_0x45b39b(0x288)),0x1);}_0xb4501['verbose']&&(console['error'](_0x45b39b(0x30e)+_0xdfc62b),console['error']('Key:\x20'+_0x1f550f));if(!_0xb4501[_0x45b39b(0x340)]){if(!isInteractive())return console[_0x45b39b(0x2ae)](a54_0x13943d[_0x45b39b(0x1fc)](_0x45b39b(0x252)),_0x45b39b(0x2e4)),console['error'](a54_0x13943d[_0x45b39b(0x31c)](_0x45b39b(0x25d))),0x1;const _0xe74587=await confirmKey(_0x45b39b(0x2d9)+_0x1f550f+_0x45b39b(0x32f)+_0xdfc62b+'\x27?');if(!_0xe74587)return console[_0x45b39b(0x2ae)](a54_0x13943d[_0x45b39b(0x2f5)](_0x45b39b(0x22c))),0x1;}const _0x50f93c=await withSpinner('Deleting\x20secret...',()=>_0x31cce8[_0x45b39b(0x2f9)][_0x45b39b(0x33e)](_0xdfc62b,_0x1f550f),{'verbose':_0xb4501[_0x45b39b(0x31f)]}),_0x2a4d09=_0x50f93c[_0x45b39b(0x2c0)];return console[_0x45b39b(0x2ae)](_0x45b39b(0x304)+_0x2a4d09[_0x45b39b(0x1d2)]+_0x45b39b(0x20e)+_0x2a4d09[_0x45b39b(0x282)]+'\x27'),(_0xb4501[_0x45b39b(0x200)]||_0xb4501['jsonl'])&&await handleSingleObjectOutput(_0x2a4d09,_0xb4501),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0xd7b3a){const _0x1e4820=a54_0x2a0943,_0x1e1ba5=Math[_0x1e4820(0x2bc)](_0xd7b3a/0x3e8),_0x32b4a3=Math[_0x1e4820(0x2bc)](_0x1e1ba5/0x3c),_0xf07283=Math[_0x1e4820(0x2bc)](_0x32b4a3/0x3c),_0x197587=Math[_0x1e4820(0x2bc)](_0xf07283/0x18);if(_0x197587>0x0){const _0xbf2b49=_0xf07283%0x18;return _0xbf2b49>0x0?_0x197587+'d\x20'+_0xbf2b49+'h':_0x197587+'d';}else{if(_0xf07283>0x0){const _0x4d84ac=_0x32b4a3%0x3c;return _0x4d84ac>0x0?_0xf07283+'h\x20'+_0x4d84ac+'m':_0xf07283+'h';}else{if(_0x32b4a3>0x0){const _0x493e57=_0x1e1ba5%0x3c;return _0x493e57>0x0?_0x32b4a3+'m\x20'+_0x493e57+'s':_0x32b4a3+'m';}else return _0x1e1ba5+'s';}}}function formatTimestamp(_0x2e32f4,_0x4a3a2f){const _0x37b67e=a54_0x2a0943,_0x23dc13=new Date(_0x2e32f4),_0x522812=String(_0x23dc13[_0x37b67e(0x37a)]())[_0x37b67e(0x299)](0x2,'0'),_0x3943ec=String(_0x23dc13[_0x37b67e(0x27d)]())[_0x37b67e(0x299)](0x2,'0'),_0x5b244f=_0x522812+':'+_0x3943ec,_0x56344e=_0x23dc13['getFullYear']()===_0x4a3a2f['getFullYear']()&&_0x23dc13[_0x37b67e(0x30f)]()===_0x4a3a2f[_0x37b67e(0x30f)]()&&_0x23dc13[_0x37b67e(0x30d)]()===_0x4a3a2f['getDate']();if(_0x56344e)return _0x5b244f;else{const _0x8321e4=String(_0x23dc13[_0x37b67e(0x30f)]()+0x1)[_0x37b67e(0x299)](0x2,'0'),_0x35cbd2=String(_0x23dc13[_0x37b67e(0x30d)]())[_0x37b67e(0x299)](0x2,'0');return _0x8321e4+'-'+_0x35cbd2+'\x20'+_0x5b244f;}}function formatDate(_0x3b1e30){const _0x3b9c46=a54_0x2a0943,_0x33d973=_0x3b1e30[_0x3b9c46(0x1f4)](),_0x40c1de=String(_0x3b1e30[_0x3b9c46(0x30f)]()+0x1)[_0x3b9c46(0x299)](0x2,'0'),_0x29490f=String(_0x3b1e30[_0x3b9c46(0x30d)]())[_0x3b9c46(0x299)](0x2,'0');return _0x33d973+'-'+_0x40c1de+'-'+_0x29490f;}function a54_0x5ebb(_0x5da824,_0x212514){_0x5da824=_0x5da824-0x1b9;const _0x2768a6=a54_0x2768();let _0x5ebbc7=_0x2768a6[_0x5da824];return _0x5ebbc7;}function getTaskStateIcon(_0x15811b){const _0x7c925={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x7c925[_0x15811b]||'⚪';}function getBarChar(_0x386d2c){const _0xc9f643=a54_0x2a0943;return _0x386d2c===_0xc9f643(0x2ae)||_0x386d2c===_0xc9f643(0x1f9)?'×':'─';}function getBarColor(_0xf491c4){const _0x3f58a7=a54_0x2a0943,_0x47cc1a={'success':a54_0x13943d[_0x3f58a7(0x211)],'error':a54_0x13943d[_0x3f58a7(0x1fc)],'group_error':a54_0x13943d[_0x3f58a7(0x1fc)],'running':a54_0x13943d[_0x3f58a7(0x258)],'blocked':a54_0x13943d[_0x3f58a7(0x2f5)],'planned':a54_0x13943d['dim'],'canceling':a54_0x13943d[_0x3f58a7(0x2f5)]};return _0x47cc1a[_0xf491c4]||a54_0x13943d[_0x3f58a7(0x305)];}function parseTaskName(_0x3a2452){const _0x3b3eeb=a54_0x2a0943;let _0x5e057e=_0x3a2452[_0x3b3eeb(0x23f)](/^\++/,'');const _0x374383=_0x5e057e[_0x3b3eeb(0x2ca)]('+'),_0x10bbd3=_0x374383[_0x3b3eeb(0x2c2)]>0x1?_0x374383[_0x3b3eeb(0x2c2)]-0x2:0x0,_0x3bbf89=_0x374383[_0x374383[_0x3b3eeb(0x2c2)]-0x1]||_0x5e057e;return{'level':_0x10bbd3,'name':'+'+_0x3bbf89};}function truncateTaskName(_0x2f410c,_0x2c9748){const _0x342749=a54_0x2a0943,_0x3c2e41=stringWidth(_0x2f410c);if(_0x3c2e41<=_0x2c9748)return _0x2f410c;let _0x5e21f7=_0x2f410c;while(stringWidth(_0x5e21f7+'…')>_0x2c9748&&_0x5e21f7[_0x342749(0x2c2)]>0x0){_0x5e21f7=_0x5e21f7['slice'](0x0,-0x1);}return _0x5e21f7+'…';}function calculateTimeScale(_0x244b8c,_0x4e62d6){const _0x5a895b=a54_0x2a0943;return{'startTime':_0x244b8c['start'],'endTime':_0x244b8c[_0x5a895b(0x313)],'durationMs':_0x244b8c[_0x5a895b(0x298)],'msPerChar':_0x244b8c['duration']/_0x4e62d6};}function timeToPosition(_0x40bc4e,_0x3006fb,_0x5c9ab2){const _0x15e3f8=a54_0x2a0943,_0x4de0bc=_0x40bc4e-_0x3006fb[_0x15e3f8(0x2c3)],_0x37cd8c=Math[_0x15e3f8(0x2bc)](_0x4de0bc/_0x3006fb[_0x15e3f8(0x33d)]);return Math[_0x15e3f8(0x26c)](0x0,Math[_0x15e3f8(0x294)](_0x37cd8c,_0x5c9ab2));}function renderTimeAxis(_0x3c9608,_0x2d4ea2){const _0x435f96=a54_0x2a0943,_0x39bede=Math[_0x435f96(0x294)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x435f96(0x26c)](TIMELINE_CONFIG[_0x435f96(0x355)],Math[_0x435f96(0x2bc)](_0x2d4ea2/TIMELINE_CONFIG[_0x435f96(0x374)]))),_0x1932a6=_0x3c9608['durationMs']/(_0x39bede-0x1),_0x1bd023=new Date(_0x3c9608[_0x435f96(0x2c3)]),_0x56380f=[];for(let _0x4bd5c5=0x0;_0x4bd5c5<_0x39bede;_0x4bd5c5++){const _0x5b0289=_0x3c9608[_0x435f96(0x2c3)]+_0x4bd5c5*_0x1932a6,_0x35c2d2=timeToPosition(_0x5b0289,_0x3c9608,_0x2d4ea2),_0x458279=formatTimestamp(_0x5b0289,_0x1bd023);_0x56380f[_0x435f96(0x377)]({'pos':_0x35c2d2,'text':_0x458279});}const _0x14d98f=new Array(_0x2d4ea2)['fill']('\x20');let _0x56a80a=-0x1;for(const {pos:_0x211e87,text:_0x2e07ee}of _0x56380f){let _0x635068=Math['max'](0x0,_0x211e87-Math[_0x435f96(0x2bc)](_0x2e07ee[_0x435f96(0x2c2)]/0x2));_0x635068<=_0x56a80a+TIMELINE_CONFIG[_0x435f96(0x2c4)]&&(_0x635068=_0x56a80a+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x635068+_0x2e07ee[_0x435f96(0x2c2)]>_0x2d4ea2&&(_0x635068=_0x2d4ea2-_0x2e07ee[_0x435f96(0x2c2)]);if(_0x635068>=0x0&&_0x635068+_0x2e07ee[_0x435f96(0x2c2)]<=_0x2d4ea2&&_0x635068>_0x56a80a){for(let _0x21aba5=0x0;_0x21aba5<_0x2e07ee[_0x435f96(0x2c2)];_0x21aba5++){_0x14d98f[_0x635068+_0x21aba5]=_0x2e07ee[_0x21aba5];}_0x56a80a=_0x635068+_0x2e07ee[_0x435f96(0x2c2)]-0x1;}}return _0x14d98f[_0x435f96(0x219)]('');}function renderTaskRow(_0x5b9ae4,_0x95d3ac,_0x42bbd7,_0x569f94){const _0x2c46e2=a54_0x2a0943,{level:_0x2f8397,name:_0x28386b}=parseTaskName(_0x5b9ae4[_0x2c46e2(0x1c3)]),_0x5db911='\x20'[_0x2c46e2(0x297)](_0x2f8397),_0x750038=_0x5b9ae4['window']?'('+formatElapsed(_0x5b9ae4[_0x2c46e2(0x261)][_0x2c46e2(0x298)])+')':'',_0x40a193=stringWidth(_0x750038),_0x2c7b21=_0x2f8397*0x1,_0xd7906e=_0x569f94-_0x2c7b21-_0x40a193-0x1,_0x555026=truncateTaskName(_0x28386b,_0xd7906e),_0x3bbc29=_0x5db911+_0x555026,_0x443199=stringWidth(_0x3bbc29),_0x221de1=_0x569f94-_0x443199-_0x40a193,_0x535caa=_0x3bbc29+'\x20'[_0x2c46e2(0x297)](Math[_0x2c46e2(0x26c)](0x1,_0x221de1))+a54_0x13943d[_0x2c46e2(0x31c)](_0x750038),_0x4a7545=getTaskStateIcon(_0x5b9ae4['state']),_0x4982c5=new Array(_0x42bbd7)[_0x2c46e2(0x26a)]('\x20');if(_0x5b9ae4[_0x2c46e2(0x261)]){const _0x1b3d2d=timeToPosition(_0x5b9ae4[_0x2c46e2(0x261)][_0x2c46e2(0x273)],_0x95d3ac,_0x42bbd7),_0x51d019=timeToPosition(_0x5b9ae4[_0x2c46e2(0x261)]['end'],_0x95d3ac,_0x42bbd7),_0x3de04f=getBarChar(_0x5b9ae4['state']),_0x5a964b=Math[_0x2c46e2(0x26c)](_0x1b3d2d+0x1,_0x51d019);for(let _0x1bcdc8=_0x1b3d2d;_0x1bcdc8<Math['min'](_0x5a964b,_0x42bbd7);_0x1bcdc8++){_0x4982c5[_0x1bcdc8]=_0x3de04f;}}const _0x853598=getBarColor(_0x5b9ae4[_0x2c46e2(0x233)]),_0x6c7287=_0x4982c5['map'](_0x2e684e=>_0x2e684e==='\x20'?'\x20':_0x853598(_0x2e684e))['join']('');return _0x4a7545+'\x20'+_0x535caa+'│'+_0x6c7287+'│';}function a54_0x2768(){const _0x1524af=['getFullYear','kill','1248TaKfvg','MAX_TIMELINE_WIDTH','session_id','group_error','relative','value','red','rows','sessionId','attempt','json','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','existingProjectId','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','success','Updating\x20','\x0aApply\x20these\x20changes?','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','No\x20workflow\x20tdx.json\x20found','includeSubtasks','done','attemptId','Revision:\x20','Session\x20time:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','→\x20Project:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','green','\x20attempt','clear','autocomplete','renderTimeline','📅\x20#','all','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','join','context','\x20\x20Location:\x20','Error:\x20Project\x20name\x20is\x20required','\x0aPush\x20these\x20changes?','param','dryRun','resumeFrom','pending','Disable\x20a\x20workflow\x20schedule','resolve','download','updatedAt','listSchedules','renderSessionsTimeline','parseProjectWorkflowPattern','session',',\x20Workflow:\x20','Starting\x20workflow\x20run...','Cancelled','ICON_SPACING','now','session:','\x20to\x20see\x20detailed\x20logs','Error:\x20Attempt\x20ID\x20is\x20required','No\x20workflows\x20found\x20in\x20project:\x20','state','No\x20sessions\x20found\x20for:\x20','ICON_WIDTH','Select\x20a\x20task\x20to\x20view\x20logs:','→\x20New\x20project:\x20','\x20(disabled)','cwd','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Project\x20filter:\x20','\x20\x20Next\x20run:\x20','workflow:tasks','Cloning\x20to\x20','replace','requireProject','attempt:','setSecrets','No\x20workflow\x20projects\x20found','sys','renderSingleTimeline','\x20disabled\x20(','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Session\x20not\x20found:\x20','\x0a✔\x20No\x20changes\x20to\x20push','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Error:\x20Invalid\x20JSON\x20in\x20--params','Project\x20name\x20is\x20required','Kill\x20a\x20running\x20attempt','fileCount','Filter:\x20','\x20\x20Files\x20extracted:\x20','skipValidation','\x0aError:','params','reason','Retry\x20a\x20session\x20or\x20attempt','\x20\x20Session\x20ID:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','blue','substring','✔\x20Pushed\x20','Retrying\x20session...','hasChanges','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','3657380tVpBQz','resolveProjectId','window','Pushing\x20project...','unknown','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20projects\x20match\x20pattern:\x20','message','workflow:delete','Select\x20a\x20session\x20to\x20view\x20timeline:','\x20enabled\x20(','fill','revision:\x20','max','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','path','Schedule\x20ID\x20is\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','revision','Pulling\x20project\x20','start','workflow:secrets:delete','type','\x20is\x20not\x20a\x20directory','round','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Workflow:\x20','diff','canceling','getMinutes','task','Error:\x20Invalid\x20parameter\x20format:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','retryAttempt','projectName','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20session','map','logFiles','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aClone\x20\x22','No\x20attempts\x20found\x20for:\x20','run','Project\x20directory:\x20','979866RJuRzs','Setting\x20secret...','⚠\x20Showing\x20first\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','jsonl','✔\x20Push\x20complete','No\x20workflows\x20found','min','execute','sessions','repeat','duration','padStart','\x20deleted','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','getTime','\x20sessions\x20','✔\x20Workflow\x20run\x20started','disabledAt','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Failed\x20to\x20fetch\x20attempt\x20data','\x0a⚠\x20Project\x20\x22','\x22?\x20This\x20cannot\x20be\x20undone.','Tip:\x20cd\x20to\x20workflows/','Source\x20directory:\x20','Listing\x20schedules...','set','workflow:sessions','cancelRequested','isTTY','enableSchedule','Resolving\x20project\x20\x27','Start\x20a\x20workflow\x20run','error','isDirectory','executePushProject','🔄\x20','\x1b[1A\x1b[2K','Analyzing\x20project...','\x20next:\x20','workflow:attempts','13116hHoiJL','\x20\x20Attempt\x20ID:\x20','Listing\x20workflows...','displayLine','sort','List\x20workflows','floor','Reason:\x20','workflow:download','index','data','List\x20workflow\x20schedules','length','startTime','LABEL_MIN_SPACING','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','includes','sourceProjectName','workflow:pull','trim','split','Error:\x20','\x20\x20Target:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','1476568kTRZIo','Listing\x20workflow\x20sessions...','/attempt/','\x20\x20New\x20attempt\x20ID:\x20','tasks','projects','match','Filter:\x20project=','filesExtracted','---\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x0aPolling...\x20(','\x20\x20Project\x20ID:\x20','indexOf','Loading\x20session...','\x20of\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','finishedAt','changes','readFile','\x20\x20Changes:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20(use\x20--limit\x20to\x20show\x20more)','pollTimeline','Include\x20retried:\x20yes','Validation:\x20skipped','MIN_TIMELINE_WIDTH','running','-\x20no\x20files\x20written','status','filter','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','some','✔\x20Showing\x20','\x22\x20to\x20new\x20project\x20\x22','Getting\x20attempt\x20details...','90pWCMxM','yellow','workflow:clone','Auto-selected\x20latest\x20session:\x20','workflow:push','workflow','\x22\x20with\x20new\x20revision?','workflowProject','stdout','\x20\x20Console:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','Key\x20cannot\x20be\x20empty','✔\x20Schedule\x20#','summary','468286ZVRJYk','Force:\x20yes','✔\x20Secret\x20\x27','white','✔\x20Retry\x20started','New\x20project\x20name:\x20','Task\x20name:\x20','Invalid\x20format:\x20','\x20new','✔\x20Deleted\x20project\x20','Fetching\x20log\x20files...','getDate','Project:\x20','getMonth','Attempt\x20ID:\x20','table','Latest\x20session\x20has\x20no\x20attempt','end','follow','workflowName','\x20workflow','\x22\x20already\x20exists\x20(ID:\x20','text','prepareCloneProject','workflow:secrets:set','✔\x20Workflow\x20project\x20context\x20cleared.','dim','workflow:schedules','log','verbose','...','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflow\x20sessions\x20found','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','1929UjJnrx','\x20(system)','buildTimelineData','stringify','force','Dry\x20run:\x20yes','✔\x20Downloaded\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','basename','Disabling\x20schedule\x20#','\x27\x20from\x20project\x20\x27','project','find','\x20secrets...','workflow:run','No\x20sessions\x20found','Source:\x20','select','description','\x20has\x20no\x20attempts','Session\x20','/app/workflows/','\x20\x20Project:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','msPerChar','deleteSecret','Error:','yes','Loading\x20workflows...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','taskName','325754OajneB','Project\x20name:\x20','Status:\x20','MAX_TASKS_DISPLAY','\x20-\x20','1aEWiBp','columns','targetExists','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','limit','createdAt','values','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','localeCompare','format','✔\x20Pull\x20complete','list','MIN_LABEL_COUNT','Attempt:\x20','workflow:upload','retryAttemptName','Including\x20subtasks:\x20yes','✔\x20Project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','From\x20task:\x20','✔\x20Project\x20updated','\x20\x20Workflow:\x20','\x0aUpdate\x20existing\x20project\x20\x22','projectId','planned','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','lastAttempt','(use\x20--limit\x20to\x20see\x20more)','from','workflow:projects','Enable\x20a\x20workflow\x20schedule','No\x20attempts\x20found','fileSize','sessionTime','workflow:schedule:disable','navigateSessionsInteractive','-\x20nothing\x20pushed','Output\x20directory:\x20','.\x20Expected\x20format:\x20KEY=VALUE','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Getting\x20attempt\x20tasks...','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:list','LABEL_WIDTH_DIVISOR','List\x20workflow\x20execution\x20sessions','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','push','\x20modified','metadata','getHours','List\x20all\x20workflow\x20projects','Analyzing\x20changes...','startsWith','✔\x20Found\x20','newProjectId','\x20\x20Session\x20context\x20set\x20to:\x20','📋\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','has','new','Source\x20directory\x20is\x20required','workflow:kill','Listing\x20workflow\x20projects...','showWorkflowConsoleUrl','generateSessionTimelineRows','cyan','applyPullProject','tdx\x20wf\x20attempt\x20','output','\x0aDry\x20run\x20-\x20no\x20project\x20created','parse','\x20from\x20session\x20','get','workflow:use','workflow:timeline','workflow:attempt','name','workflow:logs','Downloading\x20logs...','POLL_INTERVAL_MS','Pushing\x20workflow\x20project...','targetDir','keys','fullName','modified','💡\x20Tip:\x20Use\x20','/sessions/','Downloading\x20project\x20','Listing\x20secrets...','\x20unchanged','logs','key','nextRunTime','resolveProject','workflows','write','Loading\x20sessions...','(unknown)','List\x20workflow\x20attempts','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','pullProject','unchanged','No\x20attempts\x20found\x20in\x20project:\x20','\x20task','Deleting\x20project\x20','Enabling\x20schedule\x20#','deleted','site','toISOString','toLocaleString','size','Setting\x20','newProjectName','Files\x20to\x20upload:\x20','startedAt','toLowerCase','\x20secrets\x20set\x20for\x20project\x20\x27','\x20project','every','workflow:workflows','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x20\x20Revision:\x20','fs/promises','sourceDir','Pattern:\x20'];a54_0x2768=function(){return _0x1524af;};return a54_0x2768();}function calculateStats(_0x4d33b6){const _0x5b03db=a54_0x2a0943,_0x426611={'total':_0x4d33b6['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x433a91 of _0x4d33b6){if(_0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x204))_0x426611[_0x5b03db(0x204)]++;else{if(_0x433a91[_0x5b03db(0x233)]==='error'||_0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x1f9))_0x426611[_0x5b03db(0x2ae)]++;else _0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x2ea)?_0x426611[_0x5b03db(0x2ea)]++:_0x426611[_0x5b03db(0x221)]++;}}return _0x426611;}function formatStats(_0x2d839b){const _0x282149=a54_0x2a0943;return['Total:\x20'+_0x2d839b['total'],'✅\x20'+_0x2d839b['success'],'❌\x20'+_0x2d839b['error'],_0x282149(0x2b1)+_0x2d839b[_0x282149(0x2ea)],'⏳\x20'+_0x2d839b[_0x282149(0x221)]][_0x282149(0x219)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c1);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x321);async[a54_0x2a0943(0x295)](_0x4904f4){const _0x45bc85=a54_0x2a0943,{options:_0x219e52,args:_0x87ca29,tdx:_0x366f38}=_0x4904f4;let _0x10a600,_0x4b4d74,_0x2c5e66=![];if(_0x87ca29[0x0]){if(_0x87ca29[0x0][_0x45bc85(0x2c6)]('.')){const _0x28f7dd=this['parseProjectWorkflowPattern'](_0x87ca29,_0x219e52);if(!_0x28f7dd)return 0x1;_0x10a600=_0x28f7dd[_0x45bc85(0x282)],_0x4b4d74=_0x28f7dd['workflowName'];}else{_0x4b4d74=_0x87ca29[0x0],_0x10a600=_0x219e52[_0x45bc85(0x2fb)];if(!_0x10a600)return console['error'](a54_0x13943d[_0x45bc85(0x1fc)](_0x45bc85(0x33f)),_0x45bc85(0x218)),0x1;_0x2c5e66=!![];}}else{const _0x310b3b=this[_0x45bc85(0x228)](_0x87ca29,_0x219e52);if(!_0x310b3b)return 0x1;_0x10a600=_0x310b3b[_0x45bc85(0x282)],_0x4b4d74=_0x310b3b[_0x45bc85(0x315)];}if(_0x219e52[_0x45bc85(0x31f)]){if(_0x10a600&&_0x4b4d74)console[_0x45bc85(0x2ae)](_0x45bc85(0x24f)+_0x10a600+'.'+_0x4b4d74);else _0x10a600&&console[_0x45bc85(0x2ae)](_0x45bc85(0x2d5)+_0x10a600);}const _0x21069e=_0x219e52[_0x45bc85(0x20b)],_0x4ab1ef=_0x219e52[_0x45bc85(0x1fe)];if(_0x21069e){_0x4ab1ef&&console[_0x45bc85(0x2ae)](a54_0x13943d[_0x45bc85(0x2f5)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x49dc99=_0x219e52['follow'];return _0x49dc99?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x21069e):await this[_0x45bc85(0x245)](_0x4904f4,_0x21069e,_0x219e52),0x0;}if(_0x4ab1ef){const _0x2cd299=await withSpinner(_0x45bc85(0x2dd),()=>_0x366f38[_0x45bc85(0x2f9)][_0x45bc85(0x296)]({'projectName':_0x10a600,'workflowName':_0x4b4d74,'limit':0x64}),{'verbose':_0x219e52[_0x45bc85(0x31f)]}),_0x283b65=_0x2cd299[_0x45bc85(0x2c0)][_0x45bc85(0x331)](_0x3b095d=>_0x3b095d['id']===_0x4ab1ef);if(!_0x283b65)return console['error'](a54_0x13943d[_0x45bc85(0x1fc)](_0x45bc85(0x33f)),_0x45bc85(0x248)+_0x4ab1ef),0x1;if(!_0x283b65['lastAttempt']?.['id'])return console[_0x45bc85(0x2ae)](a54_0x13943d[_0x45bc85(0x1fc)]('Error:'),_0x45bc85(0x339)+_0x4ab1ef+_0x45bc85(0x338)),0x1;const _0x552d2e=_0x283b65[_0x45bc85(0x363)]['id'];_0x219e52['verbose']&&console[_0x45bc85(0x2ae)]('Using\x20attempt\x20'+_0x552d2e+_0x45bc85(0x1be)+_0x4ab1ef);const _0x553c28=_0x219e52[_0x45bc85(0x314)];return _0x553c28?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x552d2e):await this[_0x45bc85(0x245)](_0x4904f4,_0x552d2e,_0x219e52),0x0;}const _0x3145d5=await withSpinner(_0x45bc85(0x1d7),()=>_0x366f38[_0x45bc85(0x2f9)]['sessions']({'projectName':_0x10a600,'workflowName':_0x4b4d74,'limit':_0x219e52[_0x45bc85(0x34d)]||0x32}),{'verbose':_0x219e52['verbose']}),_0x5a031e=_0x3145d5[_0x45bc85(0x2c0)];if(_0x5a031e[_0x45bc85(0x2c2)]===0x0){if(_0x10a600&&_0x4b4d74)console[_0x45bc85(0x2ae)]('No\x20sessions\x20found\x20for:\x20'+_0x10a600+'.'+_0x4b4d74);else _0x10a600?console[_0x45bc85(0x2ae)](_0x45bc85(0x372)+_0x10a600):(console[_0x45bc85(0x2ae)](_0x45bc85(0x322)),console['error'](a54_0x13943d['dim'](_0x45bc85(0x279))));return 0x0;}_0x5a031e[_0x45bc85(0x2ba)]((_0x451fff,_0x435b91)=>{const _0x100e18=_0x45bc85,_0x161623=_0x451fff['sessionTime']||'',_0x157664=_0x435b91[_0x100e18(0x36a)]||'';return _0x157664['localeCompare'](_0x161623);});if(_0x219e52[_0x45bc85(0x200)]||_0x219e52[_0x45bc85(0x291)])return await handleSDKOutput(_0x5a031e,_0x219e52),0x0;let _0x15f997;if(_0x2c5e66){const _0x33611c=_0x5a031e[0x0];if(!_0x33611c[_0x45bc85(0x363)]?.['id'])return console['error'](_0x45bc85(0x312)),0x0;_0x15f997=_0x33611c[_0x45bc85(0x363)]['id'],_0x219e52[_0x45bc85(0x31f)]&&console['error'](_0x45bc85(0x2f7)+_0x33611c['sessionTime']);}else{const _0x3ec5dd=_0x5a031e[_0x45bc85(0x285)](_0x167c82=>{const _0xee57bd=_0x45bc85,_0x54c205=getAttemptStatusDisplay(_0x167c82['lastAttempt']);return{'title':_0x167c82[_0xee57bd(0x330)]?.['name']+'.'+_0x167c82[_0xee57bd(0x2f9)]?.[_0xee57bd(0x1c3)]+'\x20-\x20'+_0x167c82['sessionTime']+'\x20'+_0x54c205['icon'],'value':_0x167c82[_0xee57bd(0x363)]?.['id']||'','description':_0x54c205[_0xee57bd(0x318)]};}),_0x577981=await a54_0x1b2330({'type':'select','name':_0x45bc85(0x20b),'message':_0x45bc85(0x268),'choices':_0x3ec5dd[_0x45bc85(0x2ed)](_0x386de9=>_0x386de9[_0x45bc85(0x1fb)]!=='')});if(!_0x577981['attemptId'])return 0x0;_0x15f997=_0x577981['attemptId'];}const _0x2a7056=_0x219e52[_0x45bc85(0x314)];return _0x2a7056?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x15f997):await this[_0x45bc85(0x245)](_0x4904f4,_0x15f997,_0x219e52),0x0;}async[a54_0x2a0943(0x245)](_0x54d9bb,_0x504dac,_0x589595){const _0x3d97cc=a54_0x2a0943,{tdx:_0x3da4d1}=_0x54d9bb;let _0x54706a,_0x293598;try{[_0x54706a,_0x293598]=await Promise['all']([_0x3da4d1[_0x3d97cc(0x2f9)][_0x3d97cc(0x1ff)](_0x504dac),_0x3da4d1[_0x3d97cc(0x2f9)][_0x3d97cc(0x2d2)](_0x504dac,![])]);}catch(_0x365a1b){console[_0x3d97cc(0x2ae)](a54_0x13943d[_0x3d97cc(0x1fc)](_0x3d97cc(0x2a1)));_0x589595[_0x3d97cc(0x31f)]&&console[_0x3d97cc(0x2ae)](_0x365a1b);throw _0x365a1b;}if(_0x589595[_0x3d97cc(0x200)]||_0x589595['jsonl']){const _0x36473f=this[_0x3d97cc(0x326)](_0x54706a,_0x293598);await handleSDKOutput([_0x36473f],_0x589595);return;}const _0x5c0f69=_0x3da4d1[_0x3d97cc(0x21a)][_0x3d97cc(0x1e2)],_0x950c1c=this[_0x3d97cc(0x215)](_0x54706a,_0x293598,_0x5c0f69);console[_0x3d97cc(0x31e)](_0x950c1c);}async['pollTimeline'](_0x23e5d7,_0xdfbc3){const _0xd75e61=a54_0x2a0943,{tdx:_0x19df3c}=_0x23e5d7,_0x2f9685=TIMELINE_CONFIG[_0xd75e61(0x1c6)],_0x363a78=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x2fa3e3=0x0;while(_0x2fa3e3<_0x363a78){process[_0xd75e61(0x2fc)][_0xd75e61(0x2aa)]&&process[_0xd75e61(0x2fc)][_0xd75e61(0x1d6)]('\x1bc');let _0x3cc12f,_0x3bc1ff;try{[_0x3cc12f,_0x3bc1ff]=await Promise[_0xd75e61(0x217)]([_0x19df3c[_0xd75e61(0x2f9)]['attempt'](_0xdfbc3),_0x19df3c[_0xd75e61(0x2f9)][_0xd75e61(0x2d2)](_0xdfbc3,![])]);}catch(_0x56823d){console['error'](a54_0x13943d[_0xd75e61(0x1fc)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x2fa3e3>0x0&&console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x31c)](_0xd75e61(0x370)+_0x2fa3e3));throw _0x56823d;}const _0xf1c96d=_0x19df3c[_0xd75e61(0x21a)][_0xd75e61(0x1e2)],_0x3ae908=this['renderTimeline'](_0x3cc12f,_0x3bc1ff,_0xf1c96d);console[_0xd75e61(0x31e)](_0x3ae908);const _0x59179c=_0x3cc12f[_0xd75e61(0x20a)]&&_0x3bc1ff[_0xd75e61(0x1ed)](_0x37256e=>_0x37256e['state']!==_0xd75e61(0x2ea)&&_0x37256e[_0xd75e61(0x233)]!==_0xd75e61(0x361));if(_0x59179c){console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x211)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x31c)](_0xd75e61(0x2da)+_0x2fa3e3*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x3ee7f7=>setTimeout(_0x3ee7f7,_0x2f9685)),_0x2fa3e3++;}_0x2fa3e3>=_0x363a78&&console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x2f5)](_0xd75e61(0x1ef)));}[a54_0x2a0943(0x215)](_0x4faa26,_0x817377,_0x4ba71d){const _0x5267ba=a54_0x2a0943,_0x1145d1=[],_0x1e9a31=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5f36d9=0x5,_0x3badfb=process['stdout'][_0x5267ba(0x34a)]||0x78,_0x28acc8=_0x3badfb-_0x1e9a31-_0x5f36d9,_0x42151d=Math['max'](TIMELINE_CONFIG[_0x5267ba(0x2e9)],Math[_0x5267ba(0x294)](_0x28acc8,TIMELINE_CONFIG[_0x5267ba(0x1f7)])),_0x3c5586=new Date(_0x4faa26['createdAt'])[_0x5267ba(0x29c)](),_0x148b8c=_0x4faa26[_0x5267ba(0x2e0)]?new Date(_0x4faa26[_0x5267ba(0x2e0)])[_0x5267ba(0x29c)]():Date[_0x5267ba(0x22e)](),_0x130f0f={'start':_0x3c5586,'end':_0x148b8c,'duration':_0x148b8c-_0x3c5586},_0x1ee08a=new Map(),_0x94aa97=[];for(const _0x25a3f0 of _0x817377){if(_0x25a3f0['startedAt']){const _0x1871cc=new Date(_0x25a3f0[_0x5267ba(0x1e9)])['getTime'](),_0x30fd62=_0x25a3f0[_0x5267ba(0x225)]?new Date(_0x25a3f0[_0x5267ba(0x225)])[_0x5267ba(0x29c)]():Date[_0x5267ba(0x22e)](),_0x399a29={'start':_0x1871cc,'end':_0x30fd62,'duration':_0x30fd62-_0x1871cc};_0x1ee08a[_0x5267ba(0x2a7)](_0x25a3f0['id'],_0x399a29),_0x94aa97['push']({'name':_0x25a3f0[_0x5267ba(0x1ca)],'state':_0x25a3f0[_0x5267ba(0x233)]||_0x5267ba(0x263),'window':_0x399a29});}else _0x94aa97[_0x5267ba(0x377)]({'name':_0x25a3f0[_0x5267ba(0x1ca)],'state':_0x25a3f0['state']||_0x5267ba(0x361),'window':undefined});}_0x94aa97[_0x5267ba(0x2ba)]((_0x690f61,_0x39c56d)=>{const _0x527c97=_0x5267ba;if(!_0x690f61['window'])return 0x1;if(!_0x39c56d[_0x527c97(0x261)])return-0x1;return _0x690f61['window'][_0x527c97(0x273)]-_0x39c56d[_0x527c97(0x261)][_0x527c97(0x273)];});const _0x4867b3=_0x94aa97['length'],_0xaaf960=_0x4867b3>TIMELINE_CONFIG[_0x5267ba(0x347)];_0xaaf960&&_0x94aa97['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x3ede6a=calculateTimeScale(_0x130f0f,_0x42151d),_0x5ab640=_0x4faa26[_0x5267ba(0x20a)]?_0x4faa26['success']?a54_0x13943d['green'](_0x5267ba(0x204)):a54_0x13943d[_0x5267ba(0x1fc)]('error'):a54_0x13943d[_0x5267ba(0x258)](_0x5267ba(0x2ea)),_0x5417de=_0x4faa26[_0x5267ba(0x330)]?.['id'],_0xf83000=_0x4faa26[_0x5267ba(0x1fe)];let _0x10fd4a;if(_0x5417de&&_0xf83000){const _0x2822e8=getWorkflowAttemptUrl(_0x4ba71d,_0x5417de,_0xf83000,_0x4faa26['id']);_0x10fd4a=hyperlink(a54_0x13943d[_0x5267ba(0x31c)](_0x4faa26['id']),_0x2822e8);}else _0x10fd4a=a54_0x13943d[_0x5267ba(0x31c)](_0x4faa26['id']);_0x1145d1[_0x5267ba(0x377)](_0x5267ba(0x356)+_0x10fd4a+_0x5267ba(0x348)+_0x5ab640+'\x20-\x20'+formatElapsed(_0x130f0f[_0x5267ba(0x298)]));if(_0x94aa97['length']>0x0){const _0x3ceeeb=renderTimeAxis(_0x3ede6a,_0x42151d),_0x429bbe=new Date(_0x130f0f[_0x5267ba(0x273)]),_0x3eb942=formatDate(_0x429bbe),_0x6dde4d=TIMELINE_CONFIG[_0x5267ba(0x235)]+TIMELINE_CONFIG[_0x5267ba(0x22d)]+_0x1e9a31,_0x44fcaf=_0x3eb942['padStart'](_0x6dde4d),_0x38fba6=a54_0x13943d['dim'](_0x44fcaf);_0x1145d1['push'](_0x38fba6+'\x20'+_0x3ceeeb);for(const _0x2fb8b0 of _0x94aa97){_0x1145d1[_0x5267ba(0x377)](renderTaskRow(_0x2fb8b0,_0x3ede6a,_0x42151d,_0x1e9a31));}const _0x1fdba2=calculateStats(_0x94aa97);_0x1145d1[_0x5267ba(0x377)](formatStats(_0x1fdba2)),_0xaaf960&&_0x1145d1[_0x5267ba(0x377)](a54_0x13943d['yellow'](_0x5267ba(0x28f)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x5267ba(0x2de)+_0x4867b3+'\x20tasks')),_0x1145d1[_0x5267ba(0x377)](''),_0x1145d1[_0x5267ba(0x377)](a54_0x13943d[_0x5267ba(0x31c)](_0x5267ba(0x1cc))+(_0x5267ba(0x1ba)+_0x4faa26['id']+'\x20logs')+a54_0x13943d[_0x5267ba(0x31c)](_0x5267ba(0x230)));}else _0x1145d1[_0x5267ba(0x377)](_0x5267ba(0x257));return _0x1145d1[_0x5267ba(0x219)]('\x0a');}['buildTimelineData'](_0x5b2aa3,_0x36ba3a){const _0xd128cc=a54_0x2a0943,_0x290d6e=new Date(_0x5b2aa3['createdAt'])[_0xd128cc(0x29c)](),_0xe7debf=_0x5b2aa3['finishedAt']?new Date(_0x5b2aa3['finishedAt'])[_0xd128cc(0x29c)]():Date[_0xd128cc(0x22e)](),_0x2a8e4e=_0xe7debf-_0x290d6e,_0xae8e97=[];for(const _0x345bca of _0x36ba3a){if(_0x345bca[_0xd128cc(0x1e9)]){const _0x3e08a7=new Date(_0x345bca['startedAt'])['getTime'](),_0x1eed71=_0x345bca[_0xd128cc(0x225)]?new Date(_0x345bca[_0xd128cc(0x225)])['getTime']():Date['now']();_0xae8e97[_0xd128cc(0x377)]({'name':_0x345bca['fullName'],'state':_0x345bca[_0xd128cc(0x233)]||_0xd128cc(0x263),'window':{'start':_0x3e08a7,'end':_0x1eed71,'duration':_0x1eed71-_0x3e08a7}});}else _0xae8e97[_0xd128cc(0x377)]({'name':_0x345bca['fullName'],'state':_0x345bca[_0xd128cc(0x233)]||'planned','window':undefined});}const _0x2c67cd=calculateStats(_0xae8e97);return{'attempt':{'id':_0x5b2aa3['id'],'status':_0x5b2aa3[_0xd128cc(0x20a)]?_0x5b2aa3['success']?_0xd128cc(0x204):_0xd128cc(0x2ae):_0xd128cc(0x2ea),'createdAt':_0x5b2aa3[_0xd128cc(0x34e)],'finishedAt':_0x5b2aa3[_0xd128cc(0x2e0)],'duration_ms':_0x2a8e4e},'tasks':_0xae8e97[_0xd128cc(0x285)](_0x3c0215=>({'name':_0x3c0215['name'],'state':_0x3c0215['state'],'startedAt':_0x3c0215[_0xd128cc(0x261)]?new Date(_0x3c0215[_0xd128cc(0x261)][_0xd128cc(0x273)])[_0xd128cc(0x1e3)]():null,'updatedAt':_0x3c0215[_0xd128cc(0x261)]?new Date(_0x3c0215[_0xd128cc(0x261)]['end'])[_0xd128cc(0x1e3)]():null,'duration_ms':_0x3c0215[_0xd128cc(0x261)]?.[_0xd128cc(0x298)]||null})),'stats':_0x2c67cd};}}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x2a0943(0x31d);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2c1);async['execute'](_0x2b70a4){const _0x13ac2d=a54_0x2a0943,{options:_0x32cf6b,tdx:_0x5f2035}=_0x2b70a4,_0x33a6cd=await withSpinner(_0x13ac2d(0x2a6),()=>_0x5f2035[_0x13ac2d(0x2f9)][_0x13ac2d(0x226)](),{'verbose':_0x32cf6b['verbose']}),_0x4ae562=_0x33a6cd[_0x13ac2d(0x2c0)];console[_0x13ac2d(0x2ae)]('✔\x20Found\x20'+_0x4ae562[_0x13ac2d(0x2c2)]+'\x20schedule'+(_0x4ae562[_0x13ac2d(0x2c2)]!==0x1?'s':''));if(isStructuredFormat(_0x32cf6b))await handleSDKOutput(_0x4ae562,_0x32cf6b);else{if(_0x4ae562[_0x13ac2d(0x2c2)]===0x0)console['log']('No\x20schedules\x20found');else for(const _0x5bad7c of _0x4ae562){const _0x36b644=_0x5bad7c[_0x13ac2d(0x29f)]?a54_0x13943d['yellow'](_0x13ac2d(0x238)):'',_0xf6d701=_0x5bad7c[_0x13ac2d(0x330)]?.['name']?a54_0x13943d[_0x13ac2d(0x31c)]('\x20['+_0x5bad7c[_0x13ac2d(0x330)]['name']+']'):'',_0x3c3c73=_0x5bad7c['nextRunTime']?a54_0x13943d['dim'](_0x13ac2d(0x2b4)+new Date(_0x5bad7c['nextRunTime'])[_0x13ac2d(0x1e4)]()):'';console['log'](_0x13ac2d(0x216)+_0x5bad7c['id']+'\x20'+(_0x5bad7c[_0x13ac2d(0x2f9)]?.[_0x13ac2d(0x1c3)]||'(unknown)')+_0xf6d701+_0x36b644+_0x3c3c73);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]='workflow:schedule:enable';['description']=a54_0x2a0943(0x367);async[a54_0x2a0943(0x295)](_0x1f52aa){const _0x1ef387=a54_0x2a0943,{options:_0x5e3975,args:_0x5153c8,tdx:_0x24a8ba}=_0x1f52aa,_0x57df67=_0x5153c8[0x0];if(!_0x57df67)return console[_0x1ef387(0x2ae)](a54_0x13943d[_0x1ef387(0x1fc)](_0x1ef387(0x33f)),_0x1ef387(0x26f)),console['error'](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x2cd))),console['error'](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x382))),0x1;const _0x108dd3=await withSpinner(_0x1ef387(0x1e0)+_0x57df67+_0x1ef387(0x320),()=>_0x24a8ba[_0x1ef387(0x2f9)][_0x1ef387(0x2ab)](_0x57df67),{'verbose':_0x5e3975[_0x1ef387(0x31f)]}),_0x3df794=_0x108dd3['data'];return isStructuredFormat(_0x5e3975)?await handleSingleObjectOutput(_0x3df794,_0x5e3975):(console['log']('✔\x20Schedule\x20#'+_0x57df67+_0x1ef387(0x269)+(_0x3df794[_0x1ef387(0x2f9)]?.[_0x1ef387(0x1c3)]||_0x1ef387(0x263))+')'),_0x3df794['nextRunTime']&&console[_0x1ef387(0x31e)](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x23c)+new Date(_0x3df794[_0x1ef387(0x1d3)])[_0x1ef387(0x1e4)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x36b);['description']=a54_0x2a0943(0x222);async['execute'](_0x350c4f){const _0x4e22fc=a54_0x2a0943,{options:_0x2c1a79,args:_0x5113f5,tdx:_0x573e81}=_0x350c4f,_0x4b573c=_0x5113f5[0x0];if(!_0x4b573c)return console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x1fc)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x31c)](_0x4e22fc(0x23a))),console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x31c)](_0x4e22fc(0x382))),0x1;const _0x398386=await withSpinner(_0x4e22fc(0x32e)+_0x4b573c+'...',()=>_0x573e81[_0x4e22fc(0x2f9)]['disableSchedule'](_0x4b573c),{'verbose':_0x2c1a79['verbose']}),_0x4488fb=_0x398386[_0x4e22fc(0x2c0)];return isStructuredFormat(_0x2c1a79)?await handleSingleObjectOutput(_0x4488fb,_0x2c1a79):console[_0x4e22fc(0x31e)](_0x4e22fc(0x300)+_0x4b573c+_0x4e22fc(0x246)+(_0x4488fb['workflow']?.[_0x4e22fc(0x1c3)]||'unknown')+')'),0x0;}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43ae43,_0x2a6f45){const _0x3e0589=a55_0x1c45,_0x4e9595=_0x43ae43();while(!![]){try{const _0x2dc303=parseInt(_0x3e0589(0x67))/0x1*(-parseInt(_0x3e0589(0x6c))/0x2)+parseInt(_0x3e0589(0x73))/0x3+-parseInt(_0x3e0589(0x72))/0x4+-parseInt(_0x3e0589(0x70))/0x5*(parseInt(_0x3e0589(0x68))/0x6)+parseInt(_0x3e0589(0x6d))/0x7+parseInt(_0x3e0589(0x6b))/0x8+parseInt(_0x3e0589(0x6a))/0x9;if(_0x2dc303===_0x2a6f45)break;else _0x4e9595['push'](_0x4e9595['shift']());}catch(_0x355468){_0x4e9595['push'](_0x4e9595['shift']());}}}(a55_0xd09a,0x99378));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x1c45(_0xe201b9,_0x271a6d){_0xe201b9=_0xe201b9-0x67;const _0xd09a8b=a55_0xd09a();let _0x1c451d=_0xd09a8b[_0xe201b9];return _0x1c451d;}export function getUserAgent(){const _0x475930=a55_0x1c45,_0x48033a=getVersion(),_0xdec034=platform(),_0x429402=process[_0x475930(0x6f)][_0x475930(0x69)]('v','');return'tdx/'+_0x48033a+'\x20('+_0xdec034+';\x20node/'+_0x429402+')';}export function getAuthHeaders(_0x26c989,_0x419546,_0x2ee35e){const _0x4d91c8=a55_0x1c45,_0x56a71e=getVersion(),_0x54b9c8={'User-Agent':getUserAgent(),'X-TD-Client':_0x4d91c8(0x6e),'X-TD-Client-Version':_0x56a71e};if(_0x2ee35e)_0x54b9c8[_0x4d91c8(0x74)]=_0x4d91c8(0x75)+_0x2ee35e;else _0x419546&&(_0x54b9c8['Authorization']='TD1\x20'+_0x419546);return _0x54b9c8;}export function toHeaderRecord(_0x424f33){const _0x1e0ce1={};for(const [_0x289dfb,_0x5079b9]of Object['entries'](_0x424f33)){_0x5079b9!==undefined&&(_0x1e0ce1[_0x289dfb]=_0x5079b9);}return _0x1e0ce1;}export function getTrinoHeaders(_0x58064d,_0x46f0bc,_0x49cc1b){const _0x24a754=a55_0x1c45,_0x1bde29=getAuthHeaders(_0x58064d),_0x5024a8=toHeaderRecord(_0x1bde29);if(_0x49cc1b)_0x5024a8[_0x24a754(0x74)]=_0x24a754(0x75)+_0x49cc1b;else _0x46f0bc&&(_0x5024a8[_0x24a754(0x71)]=_0x46f0bc);return _0x5024a8;}export function hasAPIKey(_0x99a94c){const _0x3d6fe8=getAPIKey();return _0x3d6fe8!==undefined&&_0x3d6fe8['length']>0x0;}function a55_0xd09a(){const _0x2ea6ca=['3006426CUiBEP','replace','8744544yDJWxZ','4809216FzxVIh','16fJwPhA','6643014QQQDrH','tdx','version','10QoGgUU','X-Trino-User','1607032hmNCtr','1093614rsMVTu','Authorization','Bearer\x20','106854CWdgQz'];a55_0xd09a=function(){return _0x2ea6ca;};return a55_0xd09a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5e41ab,_0x46117f){const _0x1a8e79=a56_0x582d,_0x2c9335=_0x5e41ab();while(!![]){try{const _0xca8c17=parseInt(_0x1a8e79(0x1f9))/0x1+parseInt(_0x1a8e79(0x1e4))/0x2*(-parseInt(_0x1a8e79(0x1ec))/0x3)+-parseInt(_0x1a8e79(0x1cd))/0x4+parseInt(_0x1a8e79(0x1e1))/0x5*(parseInt(_0x1a8e79(0x1cc))/0x6)+parseInt(_0x1a8e79(0x1c9))/0x7+parseInt(_0x1a8e79(0x1f3))/0x8+-parseInt(_0x1a8e79(0x1f2))/0x9;if(_0xca8c17===_0x46117f)break;else _0x2c9335['push'](_0x2c9335['shift']());}catch(_0x985eb5){_0x2c9335['push'](_0x2c9335['shift']());}}}(a56_0xb90e,0xb34fa));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_0x1434dd from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';function a56_0xb90e(){const _0x5b86c4=['[query]','json','─┴─','format','─┬─','forEach','varchar','stringify','object','push','bigint','slice','bold','params','trim','pipe','split','stdout','[rule]','spawn','1022518MvYzsH','entries','cmdout','888318hZxLcM','2081972zDDbKb','padEnd','map','boolean','resolve','stdin','less','repeat','number','filter','jsonl','FINISHED','limit','list','limitStructuredFormats','double','debug','table','length','isTTY','5djaLAp','end','color','2mxzvjQ','keys','error','sdk-result','max','data','stderr','log','1940997ShKpPr','red','tsv','inherit','[logs]','join','2565072thulLl','7504256qZAzrm','[Object]','output','cyan','rule','query','954799KrbqfG','[error]','magenta','-FXRSn','[params]','noColor','Results\x20saved\x20to\x20'];a56_0xb90e=function(){return _0x5b86c4;};return a56_0xb90e();}import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1d703d){const _0x183ae5=a56_0x582d;return _0x1d703d['format']==='json'||_0x1d703d[_0x183ae5(0x203)]==='jsonl'||_0x1d703d[_0x183ae5(0x203)]===_0x183ae5(0x1ee)||_0x1d703d[_0x183ae5(0x203)]==='table'||_0x1d703d['json']===!![]||_0x1d703d['jsonl']===!![]||_0x1d703d[_0x183ae5(0x1ee)]===!![]||_0x1d703d[_0x183ae5(0x1de)]===!![];}export function parseOutputOptions(_0x59e186){const _0x47efb9=a56_0x582d;return{'format':_0x59e186[_0x47efb9(0x203)]||'table','output':_0x59e186[_0x47efb9(0x1f5)]||'','limit':_0x59e186[_0x47efb9(0x1d9)],'limitStructuredFormats':_0x59e186[_0x47efb9(0x1db)],'color':_0x59e186[_0x47efb9(0x1e3)],'noColor':_0x59e186[_0x47efb9(0x1fe)]};}function convertSDKResultToQueryResult(_0x4b5ab9){const _0xdecf69=a56_0x582d,_0x306d1f=[];if(_0x4b5ab9[_0xdecf69(0x1df)]>0x0){const _0x1c861f=_0x4b5ab9[0x0];for(const [_0x41c7b6,_0x49cdb8]of Object[_0xdecf69(0x1ca)](_0x1c861f)){let _0x1a3a9f='varchar';if(typeof _0x49cdb8===_0xdecf69(0x1d5))_0x1a3a9f=Number['isInteger'](_0x49cdb8)?_0xdecf69(0x1bf):_0xdecf69(0x1dc);else{if(typeof _0x49cdb8===_0xdecf69(0x1d0))_0x1a3a9f=_0xdecf69(0x1d0);else _0x49cdb8===null&&(_0x1a3a9f=_0xdecf69(0x1bb));}_0x306d1f[_0xdecf69(0x1be)]({'name':_0x41c7b6,'type':_0x1a3a9f});}}return{'queryId':_0xdecf69(0x1e7),'columns':_0x306d1f,'data':_0x4b5ab9,'stats':{'state':_0xdecf69(0x1d8),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4b5ab9[_0xdecf69(0x1df)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x50a3b0,_0x4f0171){const _0x3ecf9b=convertSDKResultToQueryResult(_0x50a3b0);return formatQueryOutput(_0x3ecf9b,_0x4f0171);}export async function formatQueryOutput(_0x408d10,_0x87e693){const _0x4e3d36=a56_0x582d,{format:_0x427430,limit:_0x10e013,output:_0x3eaf58,color:_0x121ec9,noColor:_0x3bf4f7,limitStructuredFormats:_0x31034b}=_0x87e693,_0x5247a0=Boolean(_0x3eaf58)&&!_0x121ec9,_0xfc8a98={'color':_0x121ec9,'noColor':_0x3bf4f7||_0x5247a0};if(_0x427430===_0x4e3d36(0x1de)){const _0x399a11=shouldUseLess(_0x427430,_0x3eaf58);return formatAsTable(_0x408d10,_0x10e013,_0x399a11,_0xfc8a98);}const _0x1a31b5=_0x31034b&&Number['isFinite'](_0x10e013)&&_0x408d10[_0x4e3d36(0x1e9)][_0x4e3d36(0x1df)]>_0x10e013?{..._0x408d10,'data':_0x408d10[_0x4e3d36(0x1e9)][_0x4e3d36(0x1c0)](0x0,_0x10e013)}:_0x408d10;if(_0x427430===_0x4e3d36(0x201))return formatAsJSON(_0x1a31b5,_0xfc8a98);else return _0x427430===_0x4e3d36(0x1d7)?formatAsJSONL(_0x1a31b5,_0xfc8a98):formatQueryResult(_0x1a31b5,_0x427430);}function shouldUseLess(_0x228a21,_0x54ac5d){const _0x229075=a56_0x582d;return(_0x228a21==='table'||_0x228a21===_0x229075(0x1da))&&process[_0x229075(0x1c6)][_0x229075(0x1e0)]&&!_0x54ac5d;}export function resolveOutputOptions(_0x1fda88){const _0x121bed=a56_0x582d,_0x50abba=_0x1fda88[_0x121bed(0x1f5)]||'',_0x4e9e31=resolveOutputFormat(_0x1fda88[_0x121bed(0x203)],_0x50abba,_0x121bed(0x1de));let _0x3b2fd1=typeof _0x1fda88[_0x121bed(0x1d9)]==='number'?_0x1fda88[_0x121bed(0x1d9)]:parseInt(_0x1fda88['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1fda88['limit']===undefined&&shouldUseLess(_0x4e9e31,_0x50abba)&&(_0x3b2fd1=Infinity),{'format':_0x4e9e31,'output':_0x50abba,'limit':_0x3b2fd1,'limitStructuredFormats':_0x1fda88['limitStructuredFormats'],'color':_0x1fda88['color'],'noColor':_0x1fda88['noColor']};}function a56_0x582d(_0x5e591f,_0x12c6b2){_0x5e591f=_0x5e591f-0x1b9;const _0xb90e2d=a56_0xb90e();let _0x582d2e=_0xb90e2d[_0x5e591f];return _0x582d2e;}export function writeOutput(_0x4ce5af,_0x56fd10,_0xcae416){const _0x399c13=a56_0x582d;return _0x56fd10?(writeFileSync(_0x56fd10,_0x4ce5af),console['error'](_0x399c13(0x1ff)+_0x56fd10),Promise[_0x399c13(0x1d1)]()):shouldUseLess(_0xcae416||'','')?new Promise(_0xbddbea=>{const _0x29a730=_0x399c13,_0x4065ea=spawn(_0x29a730(0x1d3),[_0x29a730(0x1fc)],{'stdio':[_0x29a730(0x1c4),'inherit',_0x29a730(0x1ef)]});let _0x3b586d=![];_0x4065ea['on']('error',()=>{const _0x559fb1=_0x29a730;!_0x3b586d&&(_0x3b586d=!![],console[_0x559fb1(0x1eb)](_0x4ce5af),_0xbddbea());}),_0x4065ea['on']('close',()=>{!_0x3b586d&&(_0x3b586d=!![],_0xbddbea());}),_0x4065ea['on'](_0x29a730(0x1c8),()=>{const _0x3358d9=_0x29a730;!_0x3b586d&&_0x4065ea[_0x3358d9(0x1d2)]&&(_0x4065ea[_0x3358d9(0x1d2)]['on'](_0x3358d9(0x1e6),()=>{}),_0x4065ea[_0x3358d9(0x1d2)]['write'](_0x4ce5af),_0x4065ea[_0x3358d9(0x1d2)][_0x3358d9(0x1e2)]());}),!_0x4065ea[_0x29a730(0x1d2)]&&(!_0x3b586d&&(_0x3b586d=!![],console[_0x29a730(0x1eb)](_0x4ce5af),_0xbddbea()));}):(console[_0x399c13(0x1eb)](_0x4ce5af),Promise[_0x399c13(0x1d1)]());}export async function handleSDKOutput(_0x20917f,_0x53157b){const _0x18929a=a56_0x582d,_0x3973c5=resolveOutputOptions(_0x53157b),_0x211b6f=await formatSDKOutput(_0x20917f,_0x3973c5);await writeOutput(_0x211b6f,_0x3973c5[_0x18929a(0x1f5)]||undefined,_0x3973c5['format']);}export async function handleQueryOutput(_0x7c11d5,_0x102f9d){const _0x360391=a56_0x582d,_0x47baef=resolveOutputOptions(_0x102f9d),_0x56138a=await formatQueryOutput(_0x7c11d5,_0x47baef);await writeOutput(_0x56138a,_0x47baef[_0x360391(0x1f5)]||undefined,_0x47baef['format']);}async function formatSingleObject(_0xcef170,_0x2cc748){const _0x519622=a56_0x582d,{format:_0x5527cd,color:_0x1d3cd8,noColor:_0x38c347}=_0x2cc748,_0x388c9d={'color':_0x1d3cd8,'noColor':_0x38c347};if(_0x5527cd===_0x519622(0x201)){if(shouldUseColor(_0x388c9d))return colorizeJSON(_0xcef170,_0x388c9d);return JSON[_0x519622(0x1bc)](_0xcef170,null,0x2);}else{if(_0x5527cd===_0x519622(0x1d7)){if(shouldUseColor(_0x388c9d))return colorizeJSONCompact(_0xcef170,_0x388c9d);return JSON['stringify'](_0xcef170);}else{if(_0x5527cd===_0x519622(0x1ee))return Object[_0x519622(0x1ca)](_0xcef170)[_0x519622(0x1cf)](([_0x46c50f,_0x4f3553])=>_0x46c50f+'\x09'+_0x4f3553)[_0x519622(0x1f1)]('\x0a');else{const _0x28559e=Object[_0x519622(0x1ca)](_0xcef170);if(_0x28559e[_0x519622(0x1df)]===0x0)return'No\x20data';const _0x495736=_0xcef170[_0x519622(0x1dd)],_0x39eff3=_0xcef170[_0x519622(0x1f8)],_0x16ac6b=_0xcef170[_0x519622(0x1c2)],_0x4cccda=_0xcef170[_0x519622(0x1f7)],_0x23d6c9=_0x39eff3?typeof _0x39eff3==='string'?_0x39eff3:JSON[_0x519622(0x1bc)](_0x39eff3,null,0x2):undefined,_0xbff1fd=_0x16ac6b&&Object[_0x519622(0x1e5)](_0x16ac6b)[_0x519622(0x1df)]>0x0?JSON[_0x519622(0x1bc)](_0x16ac6b,null,0x2):undefined,_0x509a43=_0x4cccda&&Object[_0x519622(0x1e5)](_0x4cccda)[_0x519622(0x1df)]>0x0?JSON[_0x519622(0x1bc)](_0x4cccda,null,0x2):undefined,_0x4e4ed2=_0x28559e[_0x519622(0x1d6)](([_0x23730b])=>_0x23730b!==_0x519622(0x1dd)&&_0x23730b!==_0x519622(0x1f8)&&_0x23730b!==_0x519622(0x1c2)&&_0x23730b!==_0x519622(0x1f7)),_0x37751a=Math[_0x519622(0x1e8)](..._0x4e4ed2['map'](([_0x4a5474])=>_0x4a5474[_0x519622(0x1df)])),_0x563e0a=Math[_0x519622(0x1e8)](..._0x4e4ed2[_0x519622(0x1cf)](([,_0x479e2b])=>{const _0xe62e82=_0x519622;try{const _0x532698=_0x479e2b===null||_0x479e2b===undefined?'':typeof _0x479e2b===_0xe62e82(0x1bd)?JSON['stringify'](_0x479e2b):String(_0x479e2b),_0x3e372a=_0x532698[_0xe62e82(0x1c5)]('\x0a');return Math[_0xe62e82(0x1e8)](..._0x3e372a[_0xe62e82(0x1cf)](_0x3514a6=>_0x3514a6[_0xe62e82(0x1df)]),0x0);}catch{return 0x0;}}),0x14),_0x1ed58b=[];_0x1ed58b[_0x519622(0x1be)](colorBorder('┌─'+'─'[_0x519622(0x1d4)](_0x37751a)+_0x519622(0x1b9)+'─'[_0x519622(0x1d4)](_0x563e0a)+'─┐',_0x388c9d)),_0x4e4ed2['forEach'](([_0x12cbf3,_0x3f8f98])=>{const _0x4c1dff=_0x519622;let _0x99ea8;try{_0x99ea8=_0x3f8f98===null||_0x3f8f98===undefined?'':typeof _0x3f8f98===_0x4c1dff(0x1bd)?JSON['stringify'](_0x3f8f98):String(_0x3f8f98);}catch{_0x99ea8=_0x4c1dff(0x1f4);}const _0x529f39=_0x12cbf3['padEnd'](_0x37751a),_0x536aa6=_0x99ea8[_0x4c1dff(0x1c5)]('\x0a');_0x536aa6[_0x4c1dff(0x1ba)]((_0x4b7a48,_0x507494)=>{const _0x4e746c=_0x4c1dff,_0x1e2200=colorBorder('│',_0x388c9d);_0x507494===0x0?_0x1ed58b[_0x4e746c(0x1be)](_0x1e2200+'\x20'+_0x529f39+'\x20'+_0x1e2200+'\x20'+_0x4b7a48[_0x4e746c(0x1ce)](_0x563e0a)+'\x20'+_0x1e2200):_0x1ed58b[_0x4e746c(0x1be)](_0x1e2200+'\x20'+'\x20'['repeat'](_0x37751a)+'\x20'+_0x1e2200+'\x20'+_0x4b7a48[_0x4e746c(0x1ce)](_0x563e0a)+'\x20'+_0x1e2200);});}),_0x1ed58b[_0x519622(0x1be)](colorBorder('└─'+'─'['repeat'](_0x37751a)+_0x519622(0x202)+'─'[_0x519622(0x1d4)](_0x563e0a)+'─┘',_0x388c9d));_0x23d6c9&&(_0x1ed58b['push'](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd['yellow']['bold'](_0x519622(0x200)))),_0x1ed58b[_0x519622(0x1be)](_0x23d6c9));_0xbff1fd&&(_0x1ed58b[_0x519622(0x1be)](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd['blue']['bold'](_0x519622(0x1fd)))),_0x1ed58b[_0x519622(0x1be)](_0xbff1fd));_0x509a43&&(_0x1ed58b[_0x519622(0x1be)](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd[_0x519622(0x1fb)][_0x519622(0x1c1)](_0x519622(0x1c7)))),_0x1ed58b[_0x519622(0x1be)](_0x509a43));if(_0x495736){if(_0x495736['stderr']){_0x1ed58b[_0x519622(0x1be)](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd[_0x519622(0x1ed)]['bold'](_0x519622(0x1fa))));const _0x440641=_0x495736[_0x519622(0x1ea)][_0x519622(0x1c5)]('\x0a');_0x440641[_0x519622(0x1ba)](_0xb95e7f=>{const _0x32e0f9=_0x519622;_0xb95e7f[_0x32e0f9(0x1c3)]()&&_0x1ed58b[_0x32e0f9(0x1be)](_0xb95e7f);});}if(_0x495736[_0x519622(0x1cb)]){_0x1ed58b[_0x519622(0x1be)](''),_0x1ed58b[_0x519622(0x1be)](String(a56_0x1434dd[_0x519622(0x1f6)][_0x519622(0x1c1)](_0x519622(0x1f0))));const _0x396858=_0x495736[_0x519622(0x1cb)][_0x519622(0x1c5)]('\x0a');_0x396858[_0x519622(0x1ba)](_0x464cc4=>{const _0x547599=_0x519622;_0x464cc4[_0x547599(0x1c3)]()&&_0x1ed58b[_0x547599(0x1be)](_0x464cc4);});}}return _0x1ed58b[_0x519622(0x1f1)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x7bf098,_0x14c670){const _0x5b30b5=a56_0x582d;if(_0x14c670[_0x5b30b5(0x203)]==='table'){await handleSDKOutput([_0x7bf098],_0x14c670);return;}const _0x55ca26=resolveOutputOptions(_0x14c670),_0x3a7a24=await formatSingleObject(_0x7bf098,_0x55ca26);await writeOutput(_0x3a7a24,_0x55ca26[_0x5b30b5(0x1f5)]||undefined,_0x55ca26['format']);}
|
|
1
|
+
(function(_0x5618e4,_0xaea572){const _0x8981cd=a56_0x3663,_0x277f83=_0x5618e4();while(!![]){try{const _0x3f0e7d=parseInt(_0x8981cd(0x93))/0x1*(parseInt(_0x8981cd(0xc0))/0x2)+-parseInt(_0x8981cd(0xb9))/0x3+parseInt(_0x8981cd(0xb3))/0x4*(-parseInt(_0x8981cd(0xa4))/0x5)+-parseInt(_0x8981cd(0xc1))/0x6+parseInt(_0x8981cd(0x9d))/0x7*(-parseInt(_0x8981cd(0xa0))/0x8)+-parseInt(_0x8981cd(0xb2))/0x9*(parseInt(_0x8981cd(0xbb))/0xa)+parseInt(_0x8981cd(0x91))/0xb;if(_0x3f0e7d===_0xaea572)break;else _0x277f83['push'](_0x277f83['shift']());}catch(_0x44b52b){_0x277f83['push'](_0x277f83['shift']());}}}(a56_0xbfa4,0x67841));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';function a56_0x3663(_0x3aebf4,_0x52ead9){_0x3aebf4=_0x3aebf4-0x8d;const _0xbfa40=a56_0xbfa4();let _0x366382=_0xbfa40[_0x3aebf4];return _0x366382;}import a56_0x5babab from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x35ee6e){const _0x8d2e9a=a56_0x3663;return _0x35ee6e['format']===_0x8d2e9a(0xa3)||_0x35ee6e[_0x8d2e9a(0x9e)]==='jsonl'||_0x35ee6e[_0x8d2e9a(0x9e)]===_0x8d2e9a(0xbe)||_0x35ee6e['format']===_0x8d2e9a(0xb7)||_0x35ee6e['json']===!![]||_0x35ee6e[_0x8d2e9a(0xce)]===!![]||_0x35ee6e[_0x8d2e9a(0xbe)]===!![]||_0x35ee6e[_0x8d2e9a(0xb7)]===!![];}export function parseOutputOptions(_0x42dc04){const _0x20f920=a56_0x3663;return{'format':_0x42dc04[_0x20f920(0x9e)]||_0x20f920(0xb7),'output':_0x42dc04[_0x20f920(0xcb)]||'','limit':_0x42dc04['limit'],'limitStructuredFormats':_0x42dc04[_0x20f920(0xd5)],'color':_0x42dc04[_0x20f920(0xa6)],'noColor':_0x42dc04['noColor']};}function convertSDKResultToQueryResult(_0x4f8f4d){const _0x1af600=a56_0x3663,_0x502e26=[];if(_0x4f8f4d[_0x1af600(0xa9)]>0x0){const _0x3b6af1=_0x4f8f4d[0x0];for(const [_0x10bb11,_0x1b61c2]of Object['entries'](_0x3b6af1)){let _0x9e1028=_0x1af600(0xc2);if(typeof _0x1b61c2==='number')_0x9e1028=Number[_0x1af600(0xd3)](_0x1b61c2)?_0x1af600(0xc8):_0x1af600(0xd7);else{if(typeof _0x1b61c2===_0x1af600(0xac))_0x9e1028='boolean';else _0x1b61c2===null&&(_0x9e1028=_0x1af600(0xc2));}_0x502e26[_0x1af600(0x96)]({'name':_0x10bb11,'type':_0x9e1028});}}return{'queryId':_0x1af600(0x90),'columns':_0x502e26,'data':_0x4f8f4d,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4f8f4d[_0x1af600(0xa9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2556c8,_0x59dcb7){const _0x4b06f7=convertSDKResultToQueryResult(_0x2556c8);return formatQueryOutput(_0x4b06f7,_0x59dcb7);}export async function formatQueryOutput(_0x148b1d,_0x73b2f2){const _0x2051b0=a56_0x3663,{format:_0x269399,limit:_0x23c94c,output:_0xb454af,color:_0x8a947e,noColor:_0x509bf0,limitStructuredFormats:_0x59848c}=_0x73b2f2,_0x3356cd=Boolean(_0xb454af)&&!_0x8a947e,_0x534ba2={'color':_0x8a947e,'noColor':_0x509bf0||_0x3356cd};if(_0x269399===_0x2051b0(0xb7)){const _0x120a2c=shouldUseLess(_0x269399,_0xb454af);return formatAsTable(_0x148b1d,_0x23c94c,_0x120a2c,_0x534ba2);}const _0x1a242b=_0x59848c&&Number[_0x2051b0(0xcf)](_0x23c94c)&&_0x148b1d[_0x2051b0(0xad)][_0x2051b0(0xa9)]>_0x23c94c?{..._0x148b1d,'data':_0x148b1d[_0x2051b0(0xad)][_0x2051b0(0xaf)](0x0,_0x23c94c)}:_0x148b1d;if(_0x269399===_0x2051b0(0xa3))return formatAsJSON(_0x1a242b,_0x534ba2);else return _0x269399==='jsonl'?formatAsJSONL(_0x1a242b,_0x534ba2):formatQueryResult(_0x1a242b,_0x269399);}function shouldUseLess(_0x2a5207,_0x1fcf58){const _0x351d6f=a56_0x3663;return(_0x2a5207===_0x351d6f(0xb7)||_0x2a5207===_0x351d6f(0xc6))&&process[_0x351d6f(0xb5)][_0x351d6f(0xa1)]&&!_0x1fcf58;}export function resolveOutputOptions(_0x22fbb5){const _0xf1688d=a56_0x3663,_0x120ddd=_0x22fbb5[_0xf1688d(0xcb)]||'',_0x3ca5dd=resolveOutputFormat(_0x22fbb5['format'],_0x120ddd,_0xf1688d(0xb7));let _0x42237d=typeof _0x22fbb5[_0xf1688d(0xa5)]===_0xf1688d(0xc9)?_0x22fbb5['limit']:parseInt(_0x22fbb5[_0xf1688d(0xa5)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x22fbb5[_0xf1688d(0xa5)]===undefined&&shouldUseLess(_0x3ca5dd,_0x120ddd)&&(_0x42237d=Infinity),{'format':_0x3ca5dd,'output':_0x120ddd,'limit':_0x42237d,'limitStructuredFormats':_0x22fbb5[_0xf1688d(0xd5)],'color':_0x22fbb5[_0xf1688d(0xa6)],'noColor':_0x22fbb5[_0xf1688d(0xa2)]};}export function writeOutput(_0x1f5b70,_0x5da70a,_0xbaf941){const _0x84c103=a56_0x3663;return _0x5da70a?(writeFileSync(_0x5da70a,_0x1f5b70),console[_0x84c103(0xd8)](_0x84c103(0xa7)+_0x5da70a),Promise['resolve']()):shouldUseLess(_0xbaf941||'','')?new Promise(_0x431529=>{const _0x15dc37=_0x84c103,_0x43ac3c=spawn(_0x15dc37(0xd9),[_0x15dc37(0xbd)],{'stdio':['pipe',_0x15dc37(0xd6),_0x15dc37(0xd6)]});let _0x246f93=![];_0x43ac3c['on']('error',()=>{const _0x41bec2=_0x15dc37;!_0x246f93&&(_0x246f93=!![],console[_0x41bec2(0xb8)](_0x1f5b70),_0x431529());}),_0x43ac3c['on'](_0x15dc37(0x9b),()=>{!_0x246f93&&(_0x246f93=!![],_0x431529());}),_0x43ac3c['on'](_0x15dc37(0xc7),()=>{const _0x23bd34=_0x15dc37;!_0x246f93&&_0x43ac3c['stdin']&&(_0x43ac3c[_0x23bd34(0x9c)]['on'](_0x23bd34(0xd8),()=>{}),_0x43ac3c['stdin'][_0x23bd34(0xd1)](_0x1f5b70),_0x43ac3c[_0x23bd34(0x9c)]['end']());}),!_0x43ac3c['stdin']&&(!_0x246f93&&(_0x246f93=!![],console[_0x15dc37(0xb8)](_0x1f5b70),_0x431529()));}):(console[_0x84c103(0xb8)](_0x1f5b70),Promise[_0x84c103(0x8f)]());}export async function handleSDKOutput(_0x15392e,_0x42d06e){const _0x36dd74=a56_0x3663,_0x54347c=resolveOutputOptions(_0x42d06e),_0x55bcdd=await formatSDKOutput(_0x15392e,_0x54347c);await writeOutput(_0x55bcdd,_0x54347c[_0x36dd74(0xcb)]||undefined,_0x54347c[_0x36dd74(0x9e)]);}export async function handleQueryOutput(_0x37cf51,_0x2a360b){const _0x1ecdb8=a56_0x3663,_0x53106b=resolveOutputOptions(_0x2a360b),_0x85350c=await formatQueryOutput(_0x37cf51,_0x53106b);await writeOutput(_0x85350c,_0x53106b[_0x1ecdb8(0xcb)]||undefined,_0x53106b[_0x1ecdb8(0x9e)]);}function a56_0xbfa4(){const _0x3aca5e=['─┴─','table','log','1386558AIGnla','[params]','30TFBnjG','filter','-FXRSn','tsv','cyan','2sGNAvY','4686516PQtptx','varchar','debug','─┬─','cmdout','list','spawn','bigint','number','entries','output','[Object]','blue','jsonl','isFinite','query','write','magenta','isInteger','trim','limitStructuredFormats','inherit','double','error','less','repeat','string','resolve','sdk-result','20269733SSVtIT','object','441293JxVTap','keys','bold','push','rule','[error]','split','forEach','close','stdin','42wmUXHV','format','stderr','81744YuDBJo','isTTY','noColor','json','308110sQEvvE','limit','color','Results\x20saved\x20to\x20','[logs]','length','stringify','map','boolean','data','red','slice','params','padEnd','741915VueuAz','20SkMzzX','max','stdout'];a56_0xbfa4=function(){return _0x3aca5e;};return a56_0xbfa4();}async function formatSingleObject(_0x360309,_0x554280){const _0x357f85=a56_0x3663,{format:_0x4d3b21,color:_0x34b718,noColor:_0x164824}=_0x554280,_0x43e337={'color':_0x34b718,'noColor':_0x164824};if(_0x4d3b21===_0x357f85(0xa3)){if(shouldUseColor(_0x43e337))return colorizeJSON(_0x360309,_0x43e337);return JSON[_0x357f85(0xaa)](_0x360309,null,0x2);}else{if(_0x4d3b21===_0x357f85(0xce)){if(shouldUseColor(_0x43e337))return colorizeJSONCompact(_0x360309,_0x43e337);return JSON[_0x357f85(0xaa)](_0x360309);}else{if(_0x4d3b21===_0x357f85(0xbe))return Object[_0x357f85(0xca)](_0x360309)[_0x357f85(0xab)](([_0x2e29c4,_0x18a687])=>_0x2e29c4+'\x09'+_0x18a687)['join']('\x0a');else{const _0x68fb91=Object[_0x357f85(0xca)](_0x360309);if(_0x68fb91[_0x357f85(0xa9)]===0x0)return'No\x20data';const _0x384523=_0x360309[_0x357f85(0xc3)],_0x1517d3=_0x360309[_0x357f85(0xd0)],_0x47cdcb=_0x360309[_0x357f85(0xb0)],_0xa2a8c9=_0x360309[_0x357f85(0x97)],_0x2f5706=_0x1517d3?typeof _0x1517d3===_0x357f85(0x8e)?_0x1517d3:JSON['stringify'](_0x1517d3,null,0x2):undefined,_0x1be428=_0x47cdcb&&Object[_0x357f85(0x94)](_0x47cdcb)[_0x357f85(0xa9)]>0x0?JSON[_0x357f85(0xaa)](_0x47cdcb,null,0x2):undefined,_0x51ce06=_0xa2a8c9&&Object[_0x357f85(0x94)](_0xa2a8c9)[_0x357f85(0xa9)]>0x0?JSON[_0x357f85(0xaa)](_0xa2a8c9,null,0x2):undefined,_0x71c480=_0x68fb91[_0x357f85(0xbc)](([_0x2f7d15])=>_0x2f7d15!==_0x357f85(0xc3)&&_0x2f7d15!=='query'&&_0x2f7d15!==_0x357f85(0xb0)&&_0x2f7d15!==_0x357f85(0x97)),_0x1eb905=Math[_0x357f85(0xb4)](..._0x71c480['map'](([_0x10df30])=>_0x10df30[_0x357f85(0xa9)])),_0x5b5f7a=Math[_0x357f85(0xb4)](..._0x71c480['map'](([,_0x42a589])=>{const _0x21c939=_0x357f85;try{const _0x10f0d4=_0x42a589===null||_0x42a589===undefined?'':typeof _0x42a589===_0x21c939(0x92)?JSON[_0x21c939(0xaa)](_0x42a589):String(_0x42a589),_0x2f945=_0x10f0d4['split']('\x0a');return Math[_0x21c939(0xb4)](..._0x2f945[_0x21c939(0xab)](_0x4c3b61=>_0x4c3b61[_0x21c939(0xa9)]),0x0);}catch{return 0x0;}}),0x14),_0x5b1fc2=[];_0x5b1fc2['push'](colorBorder('┌─'+'─'[_0x357f85(0x8d)](_0x1eb905)+_0x357f85(0xc4)+'─'[_0x357f85(0x8d)](_0x5b5f7a)+'─┐',_0x43e337)),_0x71c480[_0x357f85(0x9a)](([_0x2b366b,_0x3e5571])=>{const _0x14e35b=_0x357f85;let _0x5e7cbc;try{_0x5e7cbc=_0x3e5571===null||_0x3e5571===undefined?'':typeof _0x3e5571===_0x14e35b(0x92)?JSON[_0x14e35b(0xaa)](_0x3e5571):String(_0x3e5571);}catch{_0x5e7cbc=_0x14e35b(0xcc);}const _0x493e74=_0x2b366b['padEnd'](_0x1eb905),_0x396800=_0x5e7cbc[_0x14e35b(0x99)]('\x0a');_0x396800[_0x14e35b(0x9a)]((_0x10424d,_0x52c106)=>{const _0x48ae22=_0x14e35b,_0x592110=colorBorder('│',_0x43e337);_0x52c106===0x0?_0x5b1fc2[_0x48ae22(0x96)](_0x592110+'\x20'+_0x493e74+'\x20'+_0x592110+'\x20'+_0x10424d[_0x48ae22(0xb1)](_0x5b5f7a)+'\x20'+_0x592110):_0x5b1fc2['push'](_0x592110+'\x20'+'\x20'[_0x48ae22(0x8d)](_0x1eb905)+'\x20'+_0x592110+'\x20'+_0x10424d[_0x48ae22(0xb1)](_0x5b5f7a)+'\x20'+_0x592110);});}),_0x5b1fc2[_0x357f85(0x96)](colorBorder('└─'+'─'[_0x357f85(0x8d)](_0x1eb905)+_0x357f85(0xb6)+'─'[_0x357f85(0x8d)](_0x5b5f7a)+'─┘',_0x43e337));_0x2f5706&&(_0x5b1fc2['push'](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab['yellow']['bold']('[query]'))),_0x5b1fc2[_0x357f85(0x96)](_0x2f5706));_0x1be428&&(_0x5b1fc2['push'](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xcd)][_0x357f85(0x95)](_0x357f85(0xba)))),_0x5b1fc2[_0x357f85(0x96)](_0x1be428));_0x51ce06&&(_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xd2)]['bold']('[rule]'))),_0x5b1fc2[_0x357f85(0x96)](_0x51ce06));if(_0x384523){if(_0x384523['stderr']){_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xae)][_0x357f85(0x95)](_0x357f85(0x98))));const _0xf7601e=_0x384523[_0x357f85(0x9f)][_0x357f85(0x99)]('\x0a');_0xf7601e[_0x357f85(0x9a)](_0x1d18d7=>{const _0x22e8f2=_0x357f85;_0x1d18d7[_0x22e8f2(0xd4)]()&&_0x5b1fc2['push'](_0x1d18d7);});}if(_0x384523[_0x357f85(0xc5)]){_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xbf)][_0x357f85(0x95)](_0x357f85(0xa8))));const _0x4b4970=_0x384523['cmdout'][_0x357f85(0x99)]('\x0a');_0x4b4970[_0x357f85(0x9a)](_0x59c3dd=>{const _0x1d4889=_0x357f85;_0x59c3dd['trim']()&&_0x5b1fc2[_0x1d4889(0x96)](_0x59c3dd);});}}return _0x5b1fc2['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x5b91c6,_0x3721c5){const _0x1b5349=a56_0x3663;if(_0x3721c5[_0x1b5349(0x9e)]===_0x1b5349(0xb7)){await handleSDKOutput([_0x5b91c6],_0x3721c5);return;}const _0x4ab00f=resolveOutputOptions(_0x3721c5),_0x58eae8=await formatSingleObject(_0x5b91c6,_0x4ab00f);await writeOutput(_0x58eae8,_0x4ab00f[_0x1b5349(0xcb)]||undefined,_0x4ab00f[_0x1b5349(0x9e)]);}
|