@treasuredata/tdx 0.28.6 → 0.28.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a47_0x4381f9=a47_0x5192;(function(_0x3ba5ac,_0x29db56){const _0x137358=a47_0x5192,_0x378113=_0x3ba5ac();while(!![]){try{const _0x1ec14c=parseInt(_0x137358(0x274))/0x1+-parseInt(_0x137358(0x2fc))/0x2+-parseInt(_0x137358(0x237))/0x3*(-parseInt(_0x137358(0x294))/0x4)+parseInt(_0x137358(0x2ee))/0x5*(-parseInt(_0x137358(0x2c6))/0x6)+-parseInt(_0x137358(0x374))/0x7*(-parseInt(_0x137358(0x28c))/0x8)+-parseInt(_0x137358(0x1e1))/0x9*(parseInt(_0x137358(0x28a))/0xa)+parseInt(_0x137358(0x320))/0xb;if(_0x1ec14c===_0x29db56)break;else _0x378113['push'](_0x378113['shift']());}catch(_0x4144a6){_0x378113['push'](_0x378113['shift']());}}}(a47_0x4959,0xddff0));import a47_0x321bc0 from'chalk';import{existsSync}from'fs';import a47_0x24719a from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a47_0x1ec412 from'prompts';function getAttemptStatusDisplay(_0x49e0db){const _0x9743d4=a47_0x5192;if(!_0x49e0db)return{'icon':'⏳','text':''};const {done:_0x26041e,success:_0x1c6f8a,cancelRequested:_0x13a65b}=_0x49e0db;if(!_0x26041e)return _0x13a65b?{'icon':'🛑','text':a47_0x321bc0['yellow'](_0x9743d4(0x2ec))}:{'icon':'🔄','text':a47_0x321bc0['blue'](_0x9743d4(0x2d2))};if(_0x1c6f8a)return{'icon':'✅','text':a47_0x321bc0[_0x9743d4(0x2df)](_0x9743d4(0x2aa))};return{'icon':'❌','text':a47_0x321bc0[_0x9743d4(0x330)](_0x9743d4(0x2f5))};}export class WorkflowBaseCommand extends BaseCommand{[a47_0x4381f9(0x361)](_0x3a1df4,_0x272de9,_0x58b9a0=0x0){return _0x3a1df4[_0x58b9a0]||_0x272de9['workflowProject'];}[a47_0x4381f9(0x264)](_0x18d640,_0x59a432,_0x51a0c0=0x0){const _0x328bc6=a47_0x4381f9,_0x22b0fd=this[_0x328bc6(0x361)](_0x18d640,_0x59a432,_0x51a0c0);if(!_0x22b0fd)return console[_0x328bc6(0x2f5)](a47_0x321bc0[_0x328bc6(0x330)](_0x328bc6(0x28e)),_0x328bc6(0x204)),console[_0x328bc6(0x2f5)](a47_0x321bc0[_0x328bc6(0x340)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x22b0fd;}[a47_0x4381f9(0x2c9)](_0x583062,_0x2cfee5){const _0x3b0368=a47_0x4381f9;if(_0x583062[0x0]){const _0x5edf3a=_0x583062[0x0]['split']('.');if(_0x5edf3a[_0x3b0368(0x35e)]===0x1)return{'projectName':_0x5edf3a[0x0],'workflowName':undefined};else return _0x5edf3a[_0x3b0368(0x35e)]===0x2?{'projectName':_0x5edf3a[0x0],'workflowName':_0x5edf3a[0x1]}:(console['error'](a47_0x321bc0['red'](_0x3b0368(0x28e)),_0x3b0368(0x369)),null);}return{'projectName':_0x2cfee5[_0x3b0368(0x309)],'workflowName':undefined};}[a47_0x4381f9(0x2e9)](_0xe3a0bb,_0x40ca4e,_0x137dc3=0x0){const _0xd8e722=a47_0x4381f9;if(_0xe3a0bb[_0x137dc3])return _0xe3a0bb[_0x137dc3];if(_0x40ca4e[_0xd8e722(0x309)]){const _0xbde8f7=a47_0x24719a['join'](process[_0xd8e722(0x381)](),'workflows',_0x40ca4e[_0xd8e722(0x309)]);if(existsSync(a47_0x24719a['join'](_0xbde8f7,_0xd8e722(0x2ce))))return _0xbde8f7;}return undefined;}async[a47_0x4381f9(0x27f)](_0x132784,_0xfd577f,_0x3b0b71){const _0x442371=a47_0x4381f9;try{const _0x3ba2f5=await _0x132784['workflow'][_0x442371(0x234)](_0xfd577f,{'limit':0x1});if(_0x3ba2f5[_0x442371(0x35e)]>0x0){const _0x2424d9=_0x3ba2f5[0x0]['id'],_0x10dfd9=getWorkflowUrl(_0x3b0b71,_0x2424d9);console[_0x442371(0x2f5)](_0x442371(0x24c)+a47_0x321bc0[_0x442371(0x362)](_0x10dfd9));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a47_0x4381f9(0x231)]='workflow:use';[a47_0x4381f9(0x263)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a47_0x4381f9(0x1f5)](_0x5991e4){const _0x19e159=a47_0x4381f9,{options:_0x397656,args:_0x3b3afb,tdx:_0x55bffa}=_0x5991e4,_0x112661=_0x3b3afb[0x0],_0x11cc92=_0x397656[_0x19e159(0x365)];if(_0x11cc92)return saveSessionContext({'workflow_project':undefined},_0x397656[_0x19e159(0x387)]),console[_0x19e159(0x1e4)](a47_0x321bc0[_0x19e159(0x2df)](_0x19e159(0x338))),0x0;if(!_0x112661)return console[_0x19e159(0x2f5)](a47_0x321bc0[_0x19e159(0x330)]('Error:'),'Project\x20name\x20is\x20required'),console['error'](a47_0x321bc0[_0x19e159(0x340)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x19e159(0x2f5)](a47_0x321bc0[_0x19e159(0x340)](_0x19e159(0x1f6))),0x1;const _0x28dff2=await withSpinner(_0x19e159(0x245)+_0x112661+'\x27...',()=>_0x55bffa[_0x19e159(0x25e)][_0x19e159(0x351)](_0x112661),{'verbose':_0x397656[_0x19e159(0x354)]}),{name:_0x24cea3}=_0x28dff2[_0x19e159(0x360)];return saveSessionContext({'workflow_project':_0x24cea3},_0x397656[_0x19e159(0x387)]),console[_0x19e159(0x1e4)](a47_0x321bc0[_0x19e159(0x2df)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a47_0x321bc0[_0x19e159(0x362)](_0x24cea3))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x248);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x254);async['execute'](_0x15bb72){const _0xd5b3a8=a47_0x4381f9,{options:_0x25887a,args:_0x1bb53d,tdx:_0x4a4024}=_0x15bb72,_0x86145c=_0x1bb53d[0x0];_0x25887a[_0xd5b3a8(0x354)]&&_0x86145c&&console['error'](_0xd5b3a8(0x29e)+_0x86145c);const _0xb09d0=await withSpinner(_0xd5b3a8(0x2b8),()=>_0x4a4024['workflow'][_0xd5b3a8(0x337)](_0x86145c,{'limit':_0x25887a[_0xd5b3a8(0x26c)]}),{'verbose':_0x25887a[_0xd5b3a8(0x354)]});let _0x4d609f=_0xb09d0[_0xd5b3a8(0x360)];_0x4d609f[_0xd5b3a8(0x27c)]((_0x261f30,_0x4746f6)=>_0x261f30['name'][_0xd5b3a8(0x1fe)](_0x4746f6[_0xd5b3a8(0x231)]));const _0x299044=_0x25887a['limit']||0x64,_0x4ba16a=_0x4d609f[_0xd5b3a8(0x35e)]>=_0x299044?a47_0x321bc0[_0xd5b3a8(0x340)](_0xd5b3a8(0x328)):'';console[_0xd5b3a8(0x2f5)](_0xd5b3a8(0x2d7)+_0x4d609f[_0xd5b3a8(0x35e)]+_0xd5b3a8(0x376)+(_0x4d609f[_0xd5b3a8(0x35e)]!==0x1?'s':'')+_0x4ba16a);if(_0x25887a['format']===_0xd5b3a8(0x28d)||_0x25887a['format']===_0xd5b3a8(0x37e)||_0x25887a[_0xd5b3a8(0x29c)]==='table')await handleSDKOutput(_0x4d609f,_0x25887a);else{if(_0x4d609f[_0xd5b3a8(0x35e)]===0x0)_0x86145c?console[_0xd5b3a8(0x1e4)](_0xd5b3a8(0x233)+_0x86145c):console[_0xd5b3a8(0x1e4)]('No\x20workflow\x20projects\x20found');else{const _0x4e68fc=_0x4d609f[_0xd5b3a8(0x230)](_0x17740f=>{const _0x42450b=_0xd5b3a8,_0xacb39=_0x17740f[_0x42450b(0x269)]?.[_0x42450b(0x278)](_0x236493=>_0x236493[_0x42450b(0x277)]===_0x42450b(0x2d9)),_0x984a84=_0xacb39?a47_0x321bc0[_0x42450b(0x340)](_0x42450b(0x25a)):'';return'📁\x20'+_0x17740f[_0x42450b(0x231)]+_0x984a84;});await writeOutput(_0x4e68fc[_0xd5b3a8(0x2cd)]('\x0a'),_0x25887a[_0xd5b3a8(0x2e8)],_0xd5b3a8(0x246));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x31b);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x378);async[a47_0x4381f9(0x1f5)](_0x5122a6){const _0x2ed0b1=a47_0x4381f9,{options:_0x377817,args:_0x2e5077,tdx:_0x147392}=_0x5122a6,_0x1351c3=this[_0x2ed0b1(0x361)](_0x2e5077,_0x377817);_0x377817[_0x2ed0b1(0x354)]&&_0x1351c3&&console[_0x2ed0b1(0x2f5)](_0x2ed0b1(0x305)+_0x1351c3);const _0x50635f=await withSpinner('Listing\x20workflows...',()=>_0x147392[_0x2ed0b1(0x25e)][_0x2ed0b1(0x234)](_0x1351c3,{'limit':_0x377817[_0x2ed0b1(0x26c)]}),{'verbose':_0x377817[_0x2ed0b1(0x354)]});let _0x4f33d6=_0x50635f[_0x2ed0b1(0x360)];_0x4f33d6[_0x2ed0b1(0x27c)]((_0xf8380c,_0x3d7acf)=>{const _0x1c045e=_0x2ed0b1,_0x15f203=_0xf8380c[_0x1c045e(0x231)]['localeCompare'](_0x3d7acf['name']);if(_0x15f203!==0x0)return _0x15f203;return(_0xf8380c[_0x1c045e(0x26b)]?.['name']||'')[_0x1c045e(0x1fe)](_0x3d7acf['project']?.['name']||'');});const _0x5530be=_0x377817[_0x2ed0b1(0x26c)]||0x64,_0x544ecd=_0x4f33d6[_0x2ed0b1(0x35e)]>=_0x5530be?a47_0x321bc0[_0x2ed0b1(0x340)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2ed0b1(0x2f5)](_0x2ed0b1(0x2d7)+_0x4f33d6['length']+'\x20workflow'+(_0x4f33d6[_0x2ed0b1(0x35e)]!==0x1?'s':'')+_0x544ecd);if(_0x377817['format']==='json'||_0x377817[_0x2ed0b1(0x29c)]===_0x2ed0b1(0x37e)||_0x377817['format']===_0x2ed0b1(0x37b))await handleSDKOutput(_0x4f33d6,_0x377817);else{if(_0x4f33d6[_0x2ed0b1(0x35e)]===0x0)_0x1351c3?console['log'](_0x2ed0b1(0x298)+_0x1351c3):console[_0x2ed0b1(0x1e4)](_0x2ed0b1(0x341));else{const _0x5e7711=_0x377817['site'],_0x434dbe=_0x4f33d6['map'](_0x1ec4e8=>{const _0x16d63a=_0x2ed0b1,_0xdbaf43=a47_0x321bc0['dim']('#'+_0x1ec4e8['id']),_0x14863b=hyperlink(_0xdbaf43,getWorkflowUrl(_0x5e7711,_0x1ec4e8['id'])),_0x2769a7=_0x1ec4e8[_0x16d63a(0x26b)]?.[_0x16d63a(0x231)]?a47_0x321bc0[_0x16d63a(0x340)]('\x20('+_0x1ec4e8[_0x16d63a(0x26b)][_0x16d63a(0x231)]+')'):'';return _0x16d63a(0x218)+_0x14863b+'\x20'+_0x1ec4e8[_0x16d63a(0x231)]+_0x2769a7;});await writeOutput(_0x434dbe['join']('\x0a'),_0x377817[_0x2ed0b1(0x2e8)],_0x2ed0b1(0x246));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x210);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x232);async[a47_0x4381f9(0x1f5)](_0x2e563f){const _0x4853ff=a47_0x4381f9,{options:_0x292839,args:_0x45c62b,tdx:_0x4f5348}=_0x2e563f,_0x59106a=this[_0x4853ff(0x2c9)](_0x45c62b,_0x292839);if(!_0x59106a)return 0x1;const {projectName:_0x741567,workflowName:_0x573d77}=_0x59106a;if(_0x292839[_0x4853ff(0x354)]){if(_0x741567&&_0x573d77)console['error'](_0x4853ff(0x32b)+_0x741567+'.'+_0x573d77);else _0x741567&&console[_0x4853ff(0x2f5)](_0x4853ff(0x342)+_0x741567);const _0x220be9=_0x292839[_0x4853ff(0x355)];_0x220be9&&console[_0x4853ff(0x2f5)]('Status:\x20'+_0x220be9);}let _0xe4e3e2=0x28;if(process[_0x4853ff(0x352)][_0x4853ff(0x2a5)]&&!_0x292839[_0x4853ff(0x2e8)]&&!_0x292839['format']){const _0x198c13=process[_0x4853ff(0x352)][_0x4853ff(0x2fe)]||0x28;_0xe4e3e2=Math[_0x4853ff(0x1ec)](0x14,Math[_0x4853ff(0x2db)](_0x198c13*0x2/0x3));}const _0x2e94c9=_0x292839[_0x4853ff(0x26c)]||_0xe4e3e2,_0x289e68=await withSpinner(_0x4853ff(0x22d),()=>_0x4f5348[_0x4853ff(0x25e)]['sessions']({'projectName':_0x741567,'workflowName':_0x573d77,'status':_0x292839[_0x4853ff(0x355)],'fromTime':_0x292839[_0x4853ff(0x1ed)],'toTime':_0x292839['to'],'limit':_0x2e94c9}),{'verbose':_0x292839[_0x4853ff(0x354)]}),_0x1cc6c0=_0x289e68[_0x4853ff(0x360)];_0x1cc6c0[_0x4853ff(0x27c)]((_0x5a3d4b,_0x1d2c2b)=>{const _0x38b5e9=_0x4853ff,_0xa64ff1=_0x5a3d4b[_0x38b5e9(0x1e9)]||'',_0x389465=_0x1d2c2b[_0x38b5e9(0x1e9)]||'';return _0x389465[_0x38b5e9(0x1fe)](_0xa64ff1);});_0x1cc6c0['length']>=_0x2e94c9?console['error']('✔\x20Showing\x20'+_0x1cc6c0[_0x4853ff(0x35e)]+_0x4853ff(0x36e)+a47_0x321bc0[_0x4853ff(0x340)](_0x4853ff(0x2cb))):console[_0x4853ff(0x2f5)]('✔\x20Found\x20'+_0x1cc6c0['length']+_0x4853ff(0x2d0)+(_0x1cc6c0['length']!==0x1?'s':''));if(_0x292839['format']===_0x4853ff(0x28d)||_0x292839[_0x4853ff(0x29c)]===_0x4853ff(0x37e)||_0x292839['format']===_0x4853ff(0x37b))await handleSDKOutput(_0x1cc6c0,_0x292839);else{if(!process[_0x4853ff(0x352)][_0x4853ff(0x2a5)]||_0x292839['output']){if(_0x1cc6c0[_0x4853ff(0x35e)]===0x0){if(_0x741567&&_0x573d77)console[_0x4853ff(0x1e4)](_0x4853ff(0x1e2)+_0x741567+'.'+_0x573d77);else _0x741567?console[_0x4853ff(0x1e4)](_0x4853ff(0x2ed)+_0x741567):console['log'](_0x4853ff(0x2b6));}else{const _0x5e7e32=_0x292839[_0x4853ff(0x2b3)],_0x449f35=this[_0x4853ff(0x1f4)](_0x1cc6c0,_0x5e7e32);_0x292839[_0x4853ff(0x2e8)]?await writeOutput(_0x449f35,_0x292839[_0x4853ff(0x2e8)],_0x4853ff(0x246)):console['log'](_0x449f35);}!_0x741567&&(console[_0x4853ff(0x2f5)](''),console['error'](a47_0x321bc0[_0x4853ff(0x340)](_0x4853ff(0x282))),console[_0x4853ff(0x2f5)](a47_0x321bc0['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a47_0x321bc0[_0x4853ff(0x340)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x1cc6c0['length']===0x0){if(_0x741567&&_0x573d77)console[_0x4853ff(0x1e4)](_0x4853ff(0x1e2)+_0x741567+'.'+_0x573d77);else _0x741567?console[_0x4853ff(0x1e4)](_0x4853ff(0x2ed)+_0x741567):console['log'](_0x4853ff(0x2b6));}else await this[_0x4853ff(0x212)](_0x1cc6c0,_0x2e563f,_0x741567);}}return 0x0;}[a47_0x4381f9(0x1f4)](_0x44e74c,_0x1e3f56){const _0x5e5d6f=a47_0x4381f9,_0x59535e=[],_0xabb203=new Map();let _0x242a7e=Infinity,_0xf84a67=-Infinity;for(const _0x44d581 of _0x44e74c){if(_0x44d581[_0x5e5d6f(0x2f8)]?.[_0x5e5d6f(0x1fc)]){const _0x445f27=new Date(_0x44d581[_0x5e5d6f(0x2f8)][_0x5e5d6f(0x1fc)])[_0x5e5d6f(0x384)](),_0x89935a=_0x44d581[_0x5e5d6f(0x2f8)][_0x5e5d6f(0x20a)]?new Date(_0x44d581['lastAttempt'][_0x5e5d6f(0x20a)])[_0x5e5d6f(0x384)]():Date[_0x5e5d6f(0x307)](),_0x20c6ac=_0x44d581[_0x5e5d6f(0x26b)]?.['name']||'(unknown)';!_0xabb203['has'](_0x20c6ac)&&_0xabb203[_0x5e5d6f(0x368)](_0x20c6ac,[]),_0xabb203['get'](_0x20c6ac)[_0x5e5d6f(0x303)]({'session':_0x44d581,'startTime':_0x445f27,'endTime':_0x89935a,'duration':_0x89935a-_0x445f27}),_0x242a7e=Math[_0x5e5d6f(0x32c)](_0x242a7e,_0x445f27),_0xf84a67=Math['max'](_0xf84a67,_0x89935a);}}if(_0xabb203[_0x5e5d6f(0x31a)]===0x0)return _0x5e5d6f(0x241);const _0x496e11=process[_0x5e5d6f(0x352)][_0x5e5d6f(0x1f1)]||0x78,_0x22e37e=0x1e,_0x43372b=0x32,_0x5989fe=0x4,_0x2f036c=Math['min'](_0x43372b,Math[_0x5e5d6f(0x1ec)](_0x22e37e,Math['floor'](_0x496e11*0.3))),_0x2e7ded=_0x496e11-_0x2f036c-TIMELINE_CONFIG[_0x5e5d6f(0x36a)]-0x3-_0x5989fe,_0x2d929f=_0xf84a67-_0x242a7e,_0x44929e=_0x2d929f/_0x2f036c,_0x56191d=renderTimeAxis({'startTime':_0x242a7e,'endTime':_0xf84a67,'durationMs':_0x2d929f,'msPerChar':_0x44929e},_0x2f036c),_0x42b3e1=[];for(const _0x53a446 of _0xabb203[_0x5e5d6f(0x2a0)]()){_0x42b3e1[_0x5e5d6f(0x303)](..._0x53a446);}_0x42b3e1['sort']((_0x24e320,_0x232483)=>_0x232483[_0x5e5d6f(0x22b)]-_0x24e320['startTime']);const _0x46c3c4=new Date(_0x242a7e),_0x47d088=formatDate(_0x46c3c4),_0x1b40eb=_0x5989fe+TIMELINE_CONFIG[_0x5e5d6f(0x347)]+TIMELINE_CONFIG[_0x5e5d6f(0x34c)]+_0x2e7ded,_0x5f25bb='\x20'['repeat'](_0x1b40eb-_0x47d088[_0x5e5d6f(0x35e)]),_0x3a3894=_0x5f25bb+a47_0x321bc0[_0x5e5d6f(0x340)](_0x47d088)+'\x20'+_0x56191d;_0x59535e[_0x5e5d6f(0x303)](_0x3a3894);const _0xbc7d71=0x16;let _0x4146e1=0x0;for(const _0x3dd690 of _0x42b3e1){const _0x5cd994=_0x3dd690[_0x5e5d6f(0x387)][_0x5e5d6f(0x26b)]?.[_0x5e5d6f(0x231)]||'?',_0x96c707=Math[_0x5e5d6f(0x32c)](stringWidth(_0x5cd994),_0xbc7d71);_0x4146e1=Math[_0x5e5d6f(0x1ec)](_0x4146e1,_0x96c707);}for(const _0x33e898 of _0x42b3e1){const {session:_0x4ca2ce,startTime:_0x559505,endTime:_0x4887ac,duration:_0x14506d}=_0x33e898,_0x378345=_0x4ca2ce['project']?.['id'],_0x1d4934=_0x4ca2ce['id'],_0x16a4ae=_0x4ca2ce['project']?.[_0x5e5d6f(0x231)]||'?',_0x261736=_0x4ca2ce[_0x5e5d6f(0x25e)]?.['name']||'?';let _0x5c34f3,_0x13f71e;if(_0x4ca2ce['lastAttempt']){const _0x2e5deb=_0x4ca2ce[_0x5e5d6f(0x2f8)];!_0x2e5deb[_0x5e5d6f(0x350)]?(_0x5c34f3=_0x2e5deb['cancelRequested']?'🛑':'🔄',_0x13f71e=_0x2e5deb[_0x5e5d6f(0x279)]?a47_0x321bc0[_0x5e5d6f(0x251)]:a47_0x321bc0[_0x5e5d6f(0x205)]):(_0x5c34f3=_0x2e5deb['success']?'✅':'❌',_0x13f71e=_0x2e5deb[_0x5e5d6f(0x2aa)]?a47_0x321bc0[_0x5e5d6f(0x2df)]:a47_0x321bc0[_0x5e5d6f(0x330)]);}else _0x5c34f3='⏳',_0x13f71e=a47_0x321bc0['dim'];const _0x4f23ee='#'+_0x1d4934,_0x52799c=_0x378345?hyperlink(_0x4f23ee,getWorkflowSessionUrl(_0x1e3f56,_0x378345,_0x1d4934)):_0x4f23ee;let _0x310492=_0x16a4ae;stringWidth(_0x16a4ae)>_0xbc7d71&&(_0x310492=_0x16a4ae[_0x5e5d6f(0x33a)](0x0,_0xbc7d71-0x1)+'…');const _0x86265d=a47_0x321bc0[_0x5e5d6f(0x340)](_0x310492),_0x1a8d14=stringWidth(_0x310492),_0x3dad42='\x20'['repeat'](_0x4146e1-stringWidth(_0x310492)+0x2),_0x8f97b5='('+formatElapsed(_0x14506d)+')',_0x234ee3=stringWidth(_0x8f97b5),_0x1e8b31=stringWidth(_0x4f23ee),_0x267bef=_0x1e8b31+0x1+_0x1a8d14+_0x3dad42[_0x5e5d6f(0x35e)],_0x36618e=_0x2e7ded-_0x267bef-_0x234ee3-0x1-0x8;let _0x3a70b5=_0x261736;stringWidth(_0x3a70b5)>_0x36618e&&(_0x3a70b5=_0x3a70b5['slice'](0x0,_0x36618e-0x1)+'…');const _0xf52354=_0x52799c+'\x20'+_0x86265d+_0x3dad42+_0x3a70b5,_0x456cb7=stringWidth(_0xf52354),_0x3c687a=_0x2e7ded-_0x456cb7-_0x234ee3,_0x44fdef=_0xf52354+'\x20'['repeat'](Math[_0x5e5d6f(0x1ec)](0x1,_0x3c687a))+a47_0x321bc0['dim'](_0x8f97b5),_0x3d2308=Math[_0x5e5d6f(0x2db)]((_0x559505-_0x242a7e)/_0x44929e),_0xa50fa7=Math['floor']((_0x4887ac-_0x242a7e)/_0x44929e),_0x39bcee=Math['max'](_0x3d2308+0x1,_0xa50fa7),_0x14061b=new Array(_0x2f036c)[_0x5e5d6f(0x21c)]('\x20');for(let _0x4b45f9=_0x3d2308;_0x4b45f9<Math[_0x5e5d6f(0x32c)](_0x39bcee,_0x2f036c);_0x4b45f9++){_0x14061b[_0x4b45f9]='─';}const _0x4b7087=_0x14061b[_0x5e5d6f(0x230)](_0x58e126=>_0x58e126==='\x20'?'\x20':_0x13f71e(_0x58e126))[_0x5e5d6f(0x2cd)]('');_0x59535e[_0x5e5d6f(0x303)](_0x5c34f3+'\x20'+_0x44fdef+'│'+_0x4b7087+'│');}return _0x59535e[_0x5e5d6f(0x2cd)]('\x0a');}async[a47_0x4381f9(0x212)](_0x556468,_0x4ea546,_0x151bd5){const _0x255c39=a47_0x4381f9,{options:_0x4a087c,tdx:_0x219557}=_0x4ea546,_0x353743=_0x4a087c['site'],{timelineRows:_0x2f9446,timeAxisHeader:_0x5124d3}=this[_0x255c39(0x27e)](_0x556468,_0x353743),_0x4f3e0e=_0x2f9446[_0x255c39(0x22e)](_0x283d95=>_0x283d95[_0x255c39(0x247)]);if(_0x4f3e0e['length']===0x0){const _0x38df23=this[_0x255c39(0x1f4)](_0x556468,_0x353743);console[_0x255c39(0x1e4)](_0x38df23);!_0x151bd5&&(console[_0x255c39(0x2f5)](''),console[_0x255c39(0x2f5)](a47_0x321bc0['dim'](_0x255c39(0x282))),console[_0x255c39(0x2f5)](a47_0x321bc0[_0x255c39(0x340)](_0x255c39(0x2d5))+'or'+a47_0x321bc0[_0x255c39(0x340)](_0x255c39(0x30e))));return;}_0x5124d3&&console[_0x255c39(0x1e4)](_0x5124d3);const _0x1bebd7=_0x2f9446[_0x255c39(0x22e)](_0x9c3245=>_0x9c3245[_0x255c39(0x247)])[_0x255c39(0x230)](_0x113d81=>({'title':_0x113d81[_0x255c39(0x30f)],'value':_0x113d81[_0x255c39(0x247)]})),_0x5813e4=process[_0x255c39(0x352)][_0x255c39(0x2fe)]||0x3c,_0x111495=Math[_0x255c39(0x1ec)](0x28,Math[_0x255c39(0x2db)](_0x5813e4*0x2/0x3)),_0x25d5cd=await a47_0x1ec412({'type':_0x255c39(0x1e8),'name':_0x255c39(0x247),'message':_0x255c39(0x217),'choices':_0x1bebd7,'initial':-0x1,'limit':_0x111495,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x436312,_0x46088f)=>{const _0x306c4c=_0x255c39;if(!_0x436312)return Promise['resolve'](_0x46088f);const _0x2c27a8=_0x46088f[_0x306c4c(0x22e)](_0x22a509=>{const _0x352344=_0x306c4c,_0x47d529=_0x22a509;return _0x47d529[_0x352344(0x2b9)][_0x352344(0x296)]()[_0x352344(0x280)](_0x436312[_0x352344(0x296)]());});return Promise['resolve'](_0x2c27a8);}}),_0x21fa81=()=>{const _0x2a96dd=_0x255c39;process[_0x2a96dd(0x352)]['write'](_0x2a96dd(0x37d)),process[_0x2a96dd(0x352)][_0x2a96dd(0x203)](_0x2a96dd(0x37d)),process[_0x2a96dd(0x352)]['write'](_0x2a96dd(0x37d));},_0x399988=_0x25d5cd&&_0x25d5cd[_0x255c39(0x247)]&&_0x25d5cd['attemptId']!==null&&_0x25d5cd['attemptId']['trim']()!=='';if(!_0x399988){_0x21fa81(),console['log'](a47_0x321bc0[_0x255c39(0x340)](_0x255c39(0x2b7)));return;}_0x21fa81();const _0x395eac=_0x556468['find'](_0xbc73d6=>_0xbc73d6[_0x255c39(0x2f8)]?.['id']===_0x25d5cd['attemptId']);if(_0x395eac){const _0xd46e4a=_0x395eac['project']?.[_0x255c39(0x231)]||'?',_0x49c573=_0x395eac['workflow']?.[_0x255c39(0x231)]||'?';console[_0x255c39(0x1e4)](_0x255c39(0x33f)+a47_0x321bc0['dim'](_0xd46e4a)+_0x255c39(0x32f)+a47_0x321bc0[_0x255c39(0x340)](_0x49c573));}const _0x12bf8a=new WorkflowTimelineCommand();await _0x12bf8a[_0x255c39(0x1f5)]({'args':[],'options':{..._0x4a087c,'attemptId':_0x25d5cd[_0x255c39(0x247)]},'tdx':_0x219557});}[a47_0x4381f9(0x27e)](_0x4093e5,_0x2e4186){const _0x4e873d=a47_0x4381f9,_0x22a97f=new Map();for(const _0x43de9a of _0x4093e5){_0x43de9a['id']&&_0x43de9a[_0x4e873d(0x2f8)]?.['id']&&_0x22a97f[_0x4e873d(0x368)](_0x43de9a['id'],_0x43de9a[_0x4e873d(0x2f8)]['id']);}const _0xf391fb=[];let _0x33297e='';const _0xdbb598=this[_0x4e873d(0x1f4)](_0x4093e5,_0x2e4186),_0x244203=_0xdbb598[_0x4e873d(0x35a)]('\x0a');for(const _0x639280 of _0x244203){if(_0x639280[_0x4e873d(0x22c)](_0x4e873d(0x2bd))||_0x639280['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x33297e=_0x639280;else{if(_0x639280[_0x4e873d(0x383)](/^[✅❌🔄🛑⏳]/)){const _0x81884e=_0x639280[_0x4e873d(0x383)](/#(\d+)/),_0x5ef024=_0x81884e?_0x81884e[0x1]:null,_0x13b053=_0x5ef024?_0x22a97f[_0x4e873d(0x335)](_0x5ef024)||null:null,_0x507307=_0x4093e5[_0x4e873d(0x2a4)](_0x428cfa=>_0x428cfa['id']===_0x5ef024),_0x52aa87=_0x507307?.[_0x4e873d(0x26b)]?.['name']||'';_0xf391fb[_0x4e873d(0x303)]({'displayLine':_0x639280,'attemptId':_0x13b053,'projectName':_0x52aa87});}}}return{'timelineRows':_0xf391fb,'timeAxisHeader':_0x33297e};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x20c);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x334);async[a47_0x4381f9(0x1f5)](_0x16d966){const _0x54ea33=a47_0x4381f9,{options:_0xc23625,args:_0x35c0d1,tdx:_0x1d1bfe}=_0x16d966,_0x11d5d0=this[_0x54ea33(0x2c9)](_0x35c0d1,_0xc23625);if(!_0x11d5d0)return 0x1;const {projectName:_0x509973,workflowName:_0x4264d3}=_0x11d5d0,_0x3ad85d=_0xc23625[_0x54ea33(0x22a)];if(_0xc23625['verbose']){if(_0x509973&&_0x4264d3)console['error'](_0x54ea33(0x32b)+_0x509973+'.'+_0x4264d3);else _0x509973&&console[_0x54ea33(0x2f5)](_0x54ea33(0x342)+_0x509973);_0x3ad85d&&console[_0x54ea33(0x2f5)](_0x54ea33(0x329));}const _0x2f5a7d=await withSpinner(_0x54ea33(0x327),()=>_0x1d1bfe['workflow']['attempts']({'projectName':_0x509973,'workflowName':_0x4264d3,'includeRetried':_0x3ad85d,'limit':_0xc23625['limit']}),{'verbose':_0xc23625[_0x54ea33(0x354)]}),_0x1427b7=_0x2f5a7d[_0x54ea33(0x360)],_0xcf137b=_0xc23625[_0x54ea33(0x26c)]||0x64,_0x10fa7b=_0x1427b7[_0x54ea33(0x35e)]>=_0xcf137b?a47_0x321bc0[_0x54ea33(0x340)](_0x54ea33(0x328)):'';console[_0x54ea33(0x2f5)](_0x54ea33(0x2d7)+_0x1427b7['length']+_0x54ea33(0x28f)+(_0x1427b7[_0x54ea33(0x35e)]!==0x1?'s':'')+_0x10fa7b);if(_0xc23625['format']===_0x54ea33(0x28d)||_0xc23625[_0x54ea33(0x29c)]===_0x54ea33(0x37e)||_0xc23625[_0x54ea33(0x29c)]===_0x54ea33(0x37b))await handleSDKOutput(_0x1427b7,_0xc23625);else{if(_0x1427b7['length']===0x0){if(_0x509973&&_0x4264d3)console[_0x54ea33(0x1e4)](_0x54ea33(0x1f9)+_0x509973+'.'+_0x4264d3);else _0x509973?console['log'](_0x54ea33(0x2c3)+_0x509973):console[_0x54ea33(0x1e4)](_0x54ea33(0x310));}else{const _0x2d0dcb=_0xc23625[_0x54ea33(0x2b3)],_0x4f8575=_0x1427b7[_0x54ea33(0x230)](_0x1a1afe=>{const _0x37acf0=_0x54ea33,_0x544a18=a47_0x321bc0['dim']('#'+_0x1a1afe['id']),_0x49e715=_0x1a1afe[_0x37acf0(0x26b)]?.['id'],_0x233402=_0x1a1afe[_0x37acf0(0x25d)]||_0x1a1afe['sessionId'],_0x3dbbea=_0x49e715&&_0x233402?hyperlink(_0x544a18,getWorkflowAttemptUrl(_0x2d0dcb,_0x49e715,_0x233402,_0x1a1afe['id'])):_0x544a18,{icon:_0x3931d9,text:_0x34598e}=getAttemptStatusDisplay(_0x1a1afe),_0xed2abb=(_0x1a1afe[_0x37acf0(0x26b)]?.['name']||'?')+'.'+(_0x1a1afe[_0x37acf0(0x25e)]?.[_0x37acf0(0x231)]||'?'),_0x37cd61=_0x1a1afe['sessionTime']?a47_0x321bc0[_0x37acf0(0x340)](_0x1a1afe['sessionTime']):'';return(_0x3dbbea+'\x20'+_0x3931d9+(_0x34598e?'\x20'+_0x34598e:'')+'\x20'+_0xed2abb+'\x20'+_0x37cd61)['trimEnd']();});await writeOutput(_0x4f8575[_0x54ea33(0x2cd)]('\x0a'),_0xc23625[_0x54ea33(0x2e8)],_0x54ea33(0x246));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a47_0x4381f9(0x2de);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x2fd);async['execute'](_0x3e5cab){const _0xa51748=a47_0x4381f9,{options:_0x259da7,args:_0x2d04e8,tdx:_0x2e5021}=_0x3e5cab,_0x448e8d=_0x2d04e8[0x0];if(!_0x448e8d)return console['error'](_0xa51748(0x34d)),0x1;_0x259da7[_0xa51748(0x354)]&&console['error'](_0xa51748(0x29a)+_0x448e8d);const _0x24bbb2=await withSpinner('Getting\x20attempt\x20details...',()=>_0x2e5021[_0xa51748(0x25e)]['attempt'](_0x448e8d),{'verbose':_0x259da7[_0xa51748(0x354)]}),_0xc59fc5=_0x24bbb2[_0xa51748(0x360)];let _0x1116f6;!_0xc59fc5['done']?_0x1116f6=_0xc59fc5['cancelRequested']?_0xa51748(0x2ec):'running':_0x1116f6=_0xc59fc5[_0xa51748(0x2aa)]?_0xa51748(0x2aa):_0xa51748(0x2f5);let _0x5322d3;if(_0xc59fc5[_0xa51748(0x1fc)]&&_0xc59fc5[_0xa51748(0x20a)]){const _0xcc0b10=new Date(_0xc59fc5[_0xa51748(0x1fc)])['getTime'](),_0x444b35=new Date(_0xc59fc5[_0xa51748(0x20a)])['getTime']();_0x5322d3=Math['round']((_0x444b35-_0xcc0b10)/0x3e8);}const _0x1a6b07={'attempt_id':_0xc59fc5['id'],'status':_0x1116f6,..._0xc59fc5[_0xa51748(0x2f0)]!==undefined&&{'index':_0xc59fc5[_0xa51748(0x2f0)]},..._0xc59fc5[_0xa51748(0x26b)]&&{'project':_0xc59fc5[_0xa51748(0x26b)][_0xa51748(0x231)]},..._0xc59fc5[_0xa51748(0x25e)]&&{'workflow':_0xc59fc5[_0xa51748(0x25e)]['name']},..._0xc59fc5[_0xa51748(0x2d8)]&&{'session_id':_0xc59fc5['sessionId']},..._0xc59fc5[_0xa51748(0x1e9)]&&{'session_time':_0xc59fc5[_0xa51748(0x1e9)]},..._0xc59fc5[_0xa51748(0x2d4)]&&{'retry_attempt':_0xc59fc5['retryAttemptName']},..._0x5322d3!==undefined&&{'duration_sec':_0x5322d3},..._0xc59fc5['createdAt']&&{'created_at':_0xc59fc5[_0xa51748(0x1fc)]},..._0xc59fc5[_0xa51748(0x20a)]&&{'finished_at':_0xc59fc5['finishedAt']},...Object[_0xa51748(0x26f)](_0xc59fc5[_0xa51748(0x2f3)])[_0xa51748(0x35e)]>0x0&&{'params':_0xc59fc5[_0xa51748(0x2f3)]}};return await handleSingleObjectOutput(_0x1a6b07,_0x259da7),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a47_0x4381f9(0x231)]='workflow:tasks';[a47_0x4381f9(0x263)]=a47_0x4381f9(0x244);async[a47_0x4381f9(0x1f5)](_0x41c3ee){const _0x16f012=a47_0x4381f9,{options:_0x5747ee,args:_0x44f2ee,tdx:_0x3334db}=_0x41c3ee,_0x5b3dcf=_0x44f2ee[0x0];if(!_0x5b3dcf)return console['error'](_0x16f012(0x34d)),0x1;const _0x523940=_0x5747ee[_0x16f012(0x348)];_0x5747ee[_0x16f012(0x354)]&&(console[_0x16f012(0x2f5)](_0x16f012(0x29a)+_0x5b3dcf),_0x523940&&console[_0x16f012(0x2f5)](_0x16f012(0x1ea)));const _0x4541a3=await withSpinner(_0x16f012(0x308),()=>_0x3334db[_0x16f012(0x25e)][_0x16f012(0x2d6)](_0x5b3dcf,_0x523940||![]),{'verbose':_0x5747ee[_0x16f012(0x354)]}),_0x2e739e=_0x4541a3['data'];return console[_0x16f012(0x2f5)](_0x16f012(0x2d7)+_0x2e739e[_0x16f012(0x35e)]+_0x16f012(0x343)+(_0x2e739e[_0x16f012(0x35e)]!==0x1?'s':'')),await handleSDKOutput(_0x2e739e,_0x5747ee),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x288);[a47_0x4381f9(0x263)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x4f9c04){const _0x46cd42=a47_0x4381f9,{options:_0x59cf0d,args:_0x3860fe,tdx:_0x152684}=_0x4f9c04,_0x57fa00=_0x3860fe[0x0];let _0x3fc247=_0x3860fe[0x1];if(!_0x57fa00)return console[_0x46cd42(0x2f5)](_0x46cd42(0x34d)),0x1;_0x59cf0d[_0x46cd42(0x354)]&&(console[_0x46cd42(0x2f5)](_0x46cd42(0x29a)+_0x57fa00),_0x3fc247&&console['error'](_0x46cd42(0x37c)+_0x3fc247));const _0x5bb714=await withSpinner(_0x46cd42(0x380),()=>_0x152684[_0x46cd42(0x25e)][_0x46cd42(0x2b2)](_0x57fa00,_0x3fc247),{'verbose':_0x59cf0d['verbose']}),_0x524f4c=_0x5bb714['data'];if(_0x524f4c[_0x46cd42(0x35e)]===0x0)return console[_0x46cd42(0x2f5)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x3fc247&&(_0x59cf0d[_0x46cd42(0x28d)]||_0x59cf0d[_0x46cd42(0x29c)]))return await handleSDKOutput(_0x524f4c,_0x59cf0d),0x0;if(!_0x3fc247){const _0x45e22f=_0x524f4c['map'](_0x37bdc5=>({'title':_0x37bdc5[_0x46cd42(0x290)]+'\x20('+formatBytes(_0x37bdc5['fileSize'])+')','value':_0x37bdc5[_0x46cd42(0x290)]})),_0x241ec4=await a47_0x1ec412({'type':_0x46cd42(0x271),'name':_0x46cd42(0x2c7),'message':_0x46cd42(0x32d),'choices':_0x45e22f});if(!_0x241ec4[_0x46cd42(0x2c7)])return console['error']('Cancelled'),0x0;_0x3fc247=_0x241ec4['task'];}const _0x45a35e=await withSpinner('Downloading\x20logs...',()=>_0x152684[_0x46cd42(0x25e)][_0x46cd42(0x2f9)](_0x57fa00,_0x3fc247),{'verbose':_0x59cf0d[_0x46cd42(0x354)]}),_0x4bce16=_0x45a35e[_0x46cd42(0x360)];return _0x4bce16?console['log'](_0x4bce16):console['error'](_0x46cd42(0x242)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x34e);['description']=a47_0x4381f9(0x2ba);async[a47_0x4381f9(0x1f5)](_0x353248){const _0x1efdfd=a47_0x4381f9,{options:_0x21b69c,args:_0x23a1e4,tdx:_0x136b71}=_0x353248,_0x5e769e=_0x23a1e4[0x0];if(!_0x5e769e)return console[_0x1efdfd(0x2f5)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x46a8d7=_0x21b69c[_0x1efdfd(0x270)];_0x21b69c[_0x1efdfd(0x354)]&&(console[_0x1efdfd(0x2f5)](_0x1efdfd(0x29a)+_0x5e769e),_0x46a8d7&&console[_0x1efdfd(0x2f5)](_0x1efdfd(0x225)+_0x46a8d7));if(!_0x21b69c[_0x1efdfd(0x312)]){if(!isInteractive())return console['error'](a47_0x321bc0[_0x1efdfd(0x330)](_0x1efdfd(0x382)),_0x1efdfd(0x2a8)),console[_0x1efdfd(0x2f5)](a47_0x321bc0[_0x1efdfd(0x340)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x6f7372=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x5e769e+'?');if(!_0x6f7372)return console['error'](a47_0x321bc0['yellow']('Cancelled')),0x1;}const _0x2009d7=await withSpinner(_0x1efdfd(0x349),()=>_0x136b71[_0x1efdfd(0x25e)]['kill'](_0x5e769e,_0x46a8d7),{'verbose':_0x21b69c[_0x1efdfd(0x354)]}),_0x3a359f=_0x2009d7['data'];return console[_0x1efdfd(0x2f5)]('✔\x20'+_0x3a359f),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x213);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x372);async[a47_0x4381f9(0x1f5)](_0x50669a){const _0x12202e=a47_0x4381f9,{options:_0x5cdb4e,args:_0x7a6827,tdx:_0x294716}=_0x50669a,_0x45e8fd=_0x7a6827[0x0];if(!_0x45e8fd)return console[_0x12202e(0x2f5)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x12202e(0x2f5)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x59e10b=![],_0x3f05b9=_0x45e8fd;if(_0x45e8fd[_0x12202e(0x22c)](_0x12202e(0x35c)))_0x59e10b=!![],_0x3f05b9=_0x45e8fd[_0x12202e(0x370)](0x8);else{if(_0x45e8fd[_0x12202e(0x22c)](_0x12202e(0x31f)))_0x59e10b=![],_0x3f05b9=_0x45e8fd[_0x12202e(0x370)](0x8);else return console[_0x12202e(0x2f5)](_0x12202e(0x24a)),console[_0x12202e(0x2f5)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x2fe016=_0x5cdb4e[_0x12202e(0x293)],_0x43a181=_0x5cdb4e[_0x12202e(0x2c8)],_0x24103a=_0x5cdb4e[_0x12202e(0x2f3)],_0x51abbc=_0x5cdb4e[_0x12202e(0x2c2)];_0x5cdb4e['verbose']&&(console[_0x12202e(0x2f5)]('Target:\x20'+(_0x59e10b?_0x12202e(0x387):_0x12202e(0x215))+'\x20'+_0x3f05b9),_0x2fe016&&console[_0x12202e(0x2f5)](_0x12202e(0x29b)+_0x2fe016),_0x43a181&&console[_0x12202e(0x2f5)](_0x12202e(0x346)+_0x43a181),_0x24103a&&console[_0x12202e(0x2f5)](_0x12202e(0x1f8)+_0x24103a),_0x51abbc&&console['error'](_0x12202e(0x21e)));let _0x5b8630;if(_0x24103a)try{if(_0x24103a[_0x12202e(0x22c)]('@')){const _0x17a79d=await import(_0x12202e(0x32a)),_0x41b132=_0x24103a[_0x12202e(0x370)](0x1),_0x4a6deb=await _0x17a79d[_0x12202e(0x20e)](_0x41b132,_0x12202e(0x2a7));_0x5b8630=JSON[_0x12202e(0x373)](_0x4a6deb);}else _0x5b8630=JSON[_0x12202e(0x373)](_0x24103a);}catch{return console[_0x12202e(0x2f5)](_0x12202e(0x306)),0x1;}if(!_0x5cdb4e[_0x12202e(0x312)]){if(!isInteractive())return console[_0x12202e(0x2f5)](a47_0x321bc0[_0x12202e(0x330)](_0x12202e(0x382)),_0x12202e(0x2a8)),console[_0x12202e(0x2f5)](a47_0x321bc0[_0x12202e(0x340)](_0x12202e(0x2c5))),0x1;const _0x23a060=await confirmKey(_0x12202e(0x317)+(_0x59e10b?_0x12202e(0x387):_0x12202e(0x215))+'\x20'+_0x3f05b9+'?');if(!_0x23a060)return console[_0x12202e(0x2f5)](a47_0x321bc0['yellow'](_0x12202e(0x2b7))),0x1;}let _0x3bc3e6;_0x59e10b?_0x3bc3e6=await withSpinner(_0x12202e(0x224),()=>_0x294716[_0x12202e(0x25e)][_0x12202e(0x208)](_0x3f05b9,{'fromTask':_0x2fe016,'retryParams':_0x5b8630}),{'verbose':_0x5cdb4e[_0x12202e(0x354)]}):_0x3bc3e6=await withSpinner('Retrying\x20attempt...',()=>_0x294716[_0x12202e(0x25e)]['retryAttempt'](_0x3f05b9,{'resumeFrom':_0x43a181,'retryParams':_0x5b8630,'force':_0x51abbc}),{'verbose':_0x5cdb4e['verbose']});const _0x5173a8=_0x3bc3e6['data'];return console[_0x12202e(0x2f5)](_0x12202e(0x299)),console[_0x12202e(0x2f5)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x5173a8[_0x12202e(0x247)]),console['error'](_0x12202e(0x304)+_0x5173a8[_0x12202e(0x2d8)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x21a);[a47_0x4381f9(0x263)]='Start\x20a\x20workflow\x20run';async[a47_0x4381f9(0x1f5)](_0xce2c37){const _0x3be916=a47_0x4381f9,{options:_0x511bd9,args:_0x517021,tdx:_0x422750}=_0xce2c37;let _0x34034a=_0x517021[0x0];if(!_0x34034a){const _0x34677e=this[_0x3be916(0x361)]([],_0x511bd9),_0x1507e9=await withSpinner(_0x3be916(0x1f3),()=>_0x422750[_0x3be916(0x25e)][_0x3be916(0x234)](_0x34677e,{'limit':_0x511bd9[_0x3be916(0x26c)]}),{'verbose':_0x511bd9['verbose']}),_0x424037=_0x1507e9[_0x3be916(0x360)];if(_0x424037[_0x3be916(0x35e)]===0x0)return console[_0x3be916(0x2f5)]('No\x20workflows\x20found'),!_0x34677e&&console[_0x3be916(0x2f5)](a47_0x321bc0[_0x3be916(0x340)](_0x3be916(0x323))),0x1;const _0x46457d=_0x424037[_0x3be916(0x230)](_0x287f9a=>({'title':_0x287f9a[_0x3be916(0x26b)]?.[_0x3be916(0x231)]+'.'+_0x287f9a[_0x3be916(0x231)],'value':_0x287f9a[_0x3be916(0x26b)]?.[_0x3be916(0x231)]+'.'+_0x287f9a[_0x3be916(0x231)],'description':_0x287f9a[_0x3be916(0x1fb)]?_0x3be916(0x377)+_0x287f9a[_0x3be916(0x1fb)]:undefined})),_0x3a0506=await a47_0x1ec412({'type':_0x3be916(0x271),'name':_0x3be916(0x25e),'message':_0x3be916(0x289),'choices':_0x46457d});if(!_0x3a0506[_0x3be916(0x25e)])return 0x1;_0x34034a=_0x3a0506[_0x3be916(0x25e)];}if(!_0x34034a[_0x3be916(0x280)]('.')){const _0x38ae1e=this[_0x3be916(0x361)]([],_0x511bd9);if(_0x38ae1e)_0x34034a=_0x38ae1e+'.'+_0x34034a;else return console['error'](a47_0x321bc0[_0x3be916(0x330)](_0x3be916(0x28e)),_0x3be916(0x24f)),console['error'](a47_0x321bc0[_0x3be916(0x340)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x980435=_0x511bd9[_0x3be916(0x25b)],_0x25a970=_0x511bd9[_0x3be916(0x1e9)],_0x41a109={};if(_0x980435&&Array[_0x3be916(0x321)](_0x980435))for(const _0x5f1868 of _0x980435){const _0x105907=_0x5f1868[_0x3be916(0x216)]('=');if(_0x105907===-0x1)return console[_0x3be916(0x2f5)](_0x3be916(0x239)+_0x5f1868),console[_0x3be916(0x2f5)](_0x3be916(0x2fb)),0x1;const _0x156490=_0x5f1868[_0x3be916(0x370)](0x0,_0x105907),_0x4ba8b6=_0x5f1868[_0x3be916(0x370)](_0x105907+0x1);try{_0x41a109[_0x156490]=JSON[_0x3be916(0x373)](_0x4ba8b6);}catch{_0x41a109[_0x156490]=_0x4ba8b6;}}_0x511bd9[_0x3be916(0x354)]&&(console[_0x3be916(0x2f5)]('Workflow:\x20'+_0x34034a),Object['keys'](_0x41a109)['length']>0x0&&console[_0x3be916(0x2f5)](_0x3be916(0x1f0)+JSON['stringify'](_0x41a109)),_0x25a970&&console['error'](_0x3be916(0x2e6)+_0x25a970));const _0x5264eb=await withSpinner('Starting\x20workflow\x20run...',()=>_0x422750[_0x3be916(0x25e)][_0x3be916(0x2ea)](_0x34034a,_0x41a109,{'sessionTime':_0x25a970}),{'verbose':_0x511bd9[_0x3be916(0x354)]}),_0x2c5e89=_0x5264eb[_0x3be916(0x360)];console[_0x3be916(0x2f5)]('✔\x20Workflow\x20run\x20started'),console[_0x3be916(0x2f5)](_0x3be916(0x23f)+_0x2c5e89['id']),console[_0x3be916(0x2f5)]('\x20\x20Session\x20ID:\x20'+_0x2c5e89[_0x3be916(0x2d8)]),console['error'](_0x3be916(0x344)+_0x2c5e89['project']?.[_0x3be916(0x231)]),console[_0x3be916(0x2f5)](_0x3be916(0x209)+_0x2c5e89[_0x3be916(0x25e)]?.[_0x3be916(0x231)]);if(_0x2c5e89['project']?.['id']&&_0x2c5e89[_0x3be916(0x2d8)]&&_0x2c5e89['id']){const _0x3b1ed3=_0x511bd9['site'],_0x116579=getConsoleUrl(_0x3b1ed3,_0x3be916(0x23e)+_0x2c5e89['project']['id']+_0x3be916(0x287)+_0x2c5e89[_0x3be916(0x2d8)]+_0x3be916(0x29f)+_0x2c5e89['id']);console[_0x3be916(0x2f5)]('\x20\x20Console:\x20'+a47_0x321bc0[_0x3be916(0x362)](_0x116579));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a47_0x4381f9(0x300);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x29d);async[a47_0x4381f9(0x1f5)](_0x15b24c){const _0xfd637a=a47_0x4381f9,{options:_0xca7bcb,args:_0x4a8b38,tdx:_0x1f7b38}=_0x15b24c,_0x551280=_0x4a8b38[0x0],_0x27b65d=_0x4a8b38[0x1]||'.';if(!_0x551280)return console[_0xfd637a(0x2f5)](_0xfd637a(0x30a)),console[_0xfd637a(0x2f5)](_0xfd637a(0x316)),0x1;const _0x581954=_0xca7bcb[_0xfd637a(0x1fb)];_0xca7bcb[_0xfd637a(0x354)]&&(console[_0xfd637a(0x2f5)](_0xfd637a(0x33f)+_0x551280),console['error'](_0xfd637a(0x240)+_0x27b65d),_0x581954&&console[_0xfd637a(0x2f5)](_0xfd637a(0x2f6)+_0x581954));const _0x1b0d29=await withSpinner('Downloading\x20project\x20'+_0x551280+'...',()=>_0x1f7b38[_0xfd637a(0x25e)][_0xfd637a(0x1e6)](_0x551280,_0x27b65d,{'revision':_0x581954}),{'verbose':_0xca7bcb[_0xfd637a(0x354)]}),_0x5a1a48=_0x1b0d29['data'];return console[_0xfd637a(0x2f5)]('✔\x20Downloaded\x20'+_0x5a1a48[_0xfd637a(0x2a2)]),console[_0xfd637a(0x2f5)](_0xfd637a(0x2ac)+_0x5a1a48[_0xfd637a(0x1fb)]),console[_0xfd637a(0x2f5)]('\x20\x20Files\x20extracted:\x20'+_0x5a1a48[_0xfd637a(0x1f2)]),console[_0xfd637a(0x2f5)](_0xfd637a(0x262)+_0x27b65d+'/'+_0x5a1a48[_0xfd637a(0x2a2)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x206);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x35d);async[a47_0x4381f9(0x1f5)](_0x23fea4){const _0x44857e=a47_0x4381f9,{options:_0x2654b3,args:_0x4b6f6c,tdx:_0x2b8c05}=_0x23fea4;let _0x3d2d54='.',_0x28d1eb=_0x2654b3['name'];if(_0x4b6f6c[0x0]){const {promises:_0x36ff4c}=await import('fs');try{const _0xaebcc6=await _0x36ff4c[_0x44857e(0x253)](_0x4b6f6c[0x0]);if(_0xaebcc6[_0x44857e(0x36f)]())_0x3d2d54=_0x4b6f6c[0x0];else return console[_0x44857e(0x2f5)](_0x44857e(0x25c)+_0x4b6f6c[0x0]+_0x44857e(0x256)),0x1;}catch{_0x28d1eb=_0x4b6f6c[0x0],_0x3d2d54='.';}}const _0x72d2d8=_0x2654b3[_0x44857e(0x1fb)],_0x5abbaa=_0x2654b3[_0x44857e(0x249)];_0x2654b3['verbose']&&(console[_0x44857e(0x2f5)]('Project\x20directory:\x20'+_0x3d2d54),_0x28d1eb&&console['error'](_0x44857e(0x1e3)+_0x28d1eb),_0x72d2d8&&console[_0x44857e(0x2f5)]('Revision:\x20'+_0x72d2d8),_0x5abbaa&&console[_0x44857e(0x2f5)](_0x44857e(0x2c1)));const _0x405dc7=await withSpinner(_0x44857e(0x315),()=>_0x2b8c05[_0x44857e(0x25e)]['push'](_0x3d2d54,{'projectName':_0x28d1eb,'revision':_0x72d2d8,'skipValidation':_0x5abbaa}),{'verbose':_0x2654b3[_0x44857e(0x354)]}),_0x535bb8=_0x405dc7[_0x44857e(0x360)];return console[_0x44857e(0x2f5)](_0x44857e(0x2c4)+_0x535bb8[_0x44857e(0x2a2)]),console[_0x44857e(0x2f5)]('\x20\x20Project\x20ID:\x20'+_0x535bb8[_0x44857e(0x221)]),console[_0x44857e(0x2f5)]('\x20\x20Revision:\x20'+_0x535bb8[_0x44857e(0x1fb)]),await this[_0x44857e(0x27f)](_0x2b8c05,_0x535bb8[_0x44857e(0x2a2)],_0x2654b3[_0x44857e(0x2b3)]),0x0;}}function a47_0x5192(_0x4d372e,_0x3ca1d5){_0x4d372e=_0x4d372e-0x1e0;const _0x495964=a47_0x4959();let _0x51929b=_0x495964[_0x4d372e];return _0x51929b;}export class WorkflowPullCommand extends BaseCommand{[a47_0x4381f9(0x231)]='workflow:pull';[a47_0x4381f9(0x263)]=a47_0x4381f9(0x371);async['execute'](_0x4433ab){const _0xcd0577=a47_0x4381f9,{options:_0xc85bf,args:_0x1d29dc,tdx:_0xb864ad}=_0x4433ab,_0x46edfb=_0x1d29dc[0x0],_0x46874a=_0x1d29dc[0x1];if(!_0x46edfb)return console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x330)](_0xcd0577(0x28e)),_0xcd0577(0x204)),console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x340)](_0xcd0577(0x214))),0x1;const _0x16b10e=_0xc85bf[_0xcd0577(0x1fb)];_0xc85bf[_0xcd0577(0x354)]&&(console[_0xcd0577(0x2f5)](_0xcd0577(0x33f)+_0x46edfb),_0x46874a&&console[_0xcd0577(0x2f5)](_0xcd0577(0x250)+_0x46874a),_0x16b10e&&console[_0xcd0577(0x2f5)](_0xcd0577(0x2f6)+_0x16b10e),_0xc85bf['dryRun']&&console[_0xcd0577(0x2f5)]('Dry\x20run:\x20yes'));const _0x498f3e=await withSpinner('Pulling\x20project\x20'+_0x46edfb+_0xcd0577(0x266),()=>_0xb864ad['workflow'][_0xcd0577(0x1f7)](_0x46edfb,{'targetDir':_0x46874a,'revision':_0x16b10e}),{'verbose':_0xc85bf[_0xcd0577(0x354)]}),_0x54b803=_0x498f3e[_0xcd0577(0x360)];_0x54b803[_0xcd0577(0x34b)]?console['error']('→\x20New\x20project:\x20'+_0x54b803['projectName']):console[_0xcd0577(0x2f5)]('→\x20Project:\x20'+_0x54b803[_0xcd0577(0x2a2)]);console[_0xcd0577(0x2f5)](_0xcd0577(0x2ac)+_0x54b803[_0xcd0577(0x1fb)]),console[_0xcd0577(0x2f5)](_0xcd0577(0x201)+(a47_0x24719a[_0xcd0577(0x2dd)](process[_0xcd0577(0x381)](),_0x54b803[_0xcd0577(0x324)])||'.')),console[_0xcd0577(0x2f5)](_0xcd0577(0x281)+a47_0x321bc0[_0xcd0577(0x2df)]('+'+_0x54b803['summary'][_0xcd0577(0x24b)]+_0xcd0577(0x21b))+',\x20'+(a47_0x321bc0[_0xcd0577(0x251)]('~'+_0x54b803[_0xcd0577(0x2eb)][_0xcd0577(0x2af)]+_0xcd0577(0x319))+',\x20')+(a47_0x321bc0[_0xcd0577(0x330)]('-'+_0x54b803[_0xcd0577(0x2eb)][_0xcd0577(0x20d)]+_0xcd0577(0x265))+',\x20')+(''+a47_0x321bc0[_0xcd0577(0x340)](_0x54b803['summary'][_0xcd0577(0x275)]+_0xcd0577(0x23c))));for(const _0x3ea801 of _0x54b803[_0xcd0577(0x24e)]){_0x3ea801[_0xcd0577(0x375)]===_0xcd0577(0x2af)&&_0x3ea801[_0xcd0577(0x2bf)]&&(console[_0xcd0577(0x2f5)]('\x0a'+a47_0x321bc0['cyan']('---\x20'+_0x3ea801[_0xcd0577(0x2dc)])),console[_0xcd0577(0x2f5)](_0x3ea801['diff']));}if(!_0x54b803[_0xcd0577(0x2ae)])return saveSessionContext({'workflow_project':_0x54b803[_0xcd0577(0x2a2)]},_0xc85bf[_0xcd0577(0x387)]),console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x2df)](_0xcd0577(0x359))),console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x340)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x54b803[_0xcd0577(0x2a2)])),0x0;if(_0xc85bf[_0xcd0577(0x291)])return console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x251)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0xc85bf[_0xcd0577(0x312)]){if(!isInteractive())return console[_0xcd0577(0x2f5)](a47_0x321bc0['red'](_0xcd0577(0x382)),_0xcd0577(0x2a8)),console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x340)](_0xcd0577(0x2c5))),0x1;const _0x1640da=await confirmKey(_0xcd0577(0x292));if(!_0x1640da)return console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x251)]('Cancelled'),_0xcd0577(0x322)),0x1;}await withSpinner(_0xcd0577(0x27a),()=>_0xb864ad[_0xcd0577(0x25e)][_0xcd0577(0x363)](_0x54b803,{'revision':_0x16b10e}),{'verbose':_0xc85bf['verbose']}),saveSessionContext({'workflow_project':_0x54b803[_0xcd0577(0x2a2)]},_0xc85bf[_0xcd0577(0x387)]),console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x2df)]('✔\x20Pull\x20complete'));const _0x4aac8b=a47_0x24719a[_0xcd0577(0x2dd)](process[_0xcd0577(0x381)](),_0x54b803[_0xcd0577(0x324)])||'.';return console[_0xcd0577(0x2f5)](a47_0x321bc0['dim'](_0xcd0577(0x262)+_0x4aac8b)),console[_0xcd0577(0x2f5)](a47_0x321bc0[_0xcd0577(0x340)](_0xcd0577(0x27b)+_0x54b803['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]='workflow:push';[a47_0x4381f9(0x263)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a47_0x4381f9(0x1f5)](_0x33de3b){const _0xf20073=a47_0x4381f9,{options:_0x339c80,args:_0x57f5b8,tdx:_0x5d4aba}=_0x33de3b,_0x2bce35=this[_0xf20073(0x2e9)](_0x57f5b8,_0x339c80),_0x1e588a=_0x339c80[_0xf20073(0x1fb)],_0x26a8b1=_0x339c80[_0xf20073(0x249)];_0x339c80[_0xf20073(0x354)]&&(_0x2bce35&&console[_0xf20073(0x2f5)](_0xf20073(0x2e2)+_0x2bce35),_0x1e588a&&console['error'](_0xf20073(0x2f6)+_0x1e588a),_0x339c80['dryRun']&&console[_0xf20073(0x2f5)](_0xf20073(0x2e4)),_0x26a8b1&&console[_0xf20073(0x2f5)](_0xf20073(0x2c1)));let _0x383ae2;try{_0x383ae2=await withSpinner(_0xf20073(0x258),()=>_0x5d4aba[_0xf20073(0x25e)][_0xf20073(0x366)]({'sourceDir':_0x2bce35,'revision':_0x1e588a,'skipValidation':_0x26a8b1}),{'verbose':_0x339c80[_0xf20073(0x354)]});}catch(_0x205aa2){if(_0x205aa2 instanceof Error&&_0x205aa2['message']['includes'](_0xf20073(0x385)))return console[_0xf20073(0x2f5)](a47_0x321bc0['red'](_0xf20073(0x28e)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x339c80[_0xf20073(0x309)]?console[_0xf20073(0x2f5)](a47_0x321bc0[_0xf20073(0x340)]('Tip:\x20cd\x20to\x20workflows/'+_0x339c80[_0xf20073(0x309)]+_0xf20073(0x261)+_0x339c80[_0xf20073(0x309)]+'\x27')):console[_0xf20073(0x2f5)](a47_0x321bc0['dim'](_0xf20073(0x34a))),0x1;throw _0x205aa2;}const _0x32923c=_0x383ae2[_0xf20073(0x360)];console[_0xf20073(0x2f5)](_0xf20073(0x301)+_0x32923c[_0xf20073(0x2a2)]),console['error'](_0xf20073(0x272)+_0x32923c['sourceDir']),console[_0xf20073(0x2f5)](_0xf20073(0x2ac)+_0x32923c[_0xf20073(0x1fb)]),console['error']('\x20\x20Changes:\x20'+a47_0x321bc0['green']('+'+_0x32923c[_0xf20073(0x2eb)][_0xf20073(0x24b)]+_0xf20073(0x21b))+',\x20'+(a47_0x321bc0[_0xf20073(0x251)]('~'+_0x32923c[_0xf20073(0x2eb)]['modified']+_0xf20073(0x319))+',\x20')+(a47_0x321bc0[_0xf20073(0x330)]('-'+_0x32923c[_0xf20073(0x2eb)][_0xf20073(0x20d)]+_0xf20073(0x265))+',\x20')+(''+a47_0x321bc0['dim'](_0x32923c['summary'][_0xf20073(0x275)]+_0xf20073(0x23c))));for(const _0x4d1f16 of _0x32923c['changes']){_0x4d1f16[_0xf20073(0x375)]===_0xf20073(0x2af)&&_0x4d1f16[_0xf20073(0x2bf)]&&(console[_0xf20073(0x2f5)]('\x0a'+a47_0x321bc0[_0xf20073(0x362)](_0xf20073(0x2ad)+_0x4d1f16['path'])),console['error'](_0x4d1f16[_0xf20073(0x2bf)]));}if(!_0x32923c[_0xf20073(0x2ae)])return console[_0xf20073(0x2f5)](a47_0x321bc0[_0xf20073(0x2df)](_0xf20073(0x31d))),await this['showWorkflowConsoleUrl'](_0x5d4aba,_0x32923c[_0xf20073(0x2a2)],_0x339c80[_0xf20073(0x2b3)]),0x0;if(_0x339c80[_0xf20073(0x291)])return console['error'](a47_0x321bc0[_0xf20073(0x251)](_0xf20073(0x268))),0x0;if(!_0x339c80[_0xf20073(0x312)]){if(!isInteractive())return console['error'](a47_0x321bc0[_0xf20073(0x330)](_0xf20073(0x382)),_0xf20073(0x2a8)),console[_0xf20073(0x2f5)](a47_0x321bc0[_0xf20073(0x340)](_0xf20073(0x2c5))),0x1;const _0x1a5f9b=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x1a5f9b)return console[_0xf20073(0x2f5)](a47_0x321bc0['yellow'](_0xf20073(0x2b7)),_0xf20073(0x2a1)),0x1;}const _0x5b5dcf=await withSpinner(_0xf20073(0x211),()=>_0x5d4aba['workflow']['executePushProject'](_0x32923c),{'verbose':_0x339c80[_0xf20073(0x354)]}),_0x5b4150=_0x5b5dcf[_0xf20073(0x360)];return console[_0xf20073(0x2f5)](a47_0x321bc0[_0xf20073(0x2df)](_0xf20073(0x25f))),console[_0xf20073(0x2f5)](_0xf20073(0x386)+_0x5b4150[_0xf20073(0x221)]),console[_0xf20073(0x2f5)]('\x20\x20Revision:\x20'+_0x5b4150[_0xf20073(0x1fb)]),await this[_0xf20073(0x27f)](_0x5d4aba,_0x5b4150[_0xf20073(0x2a2)],_0x339c80[_0xf20073(0x2b3)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x2cc);['description']=a47_0x4381f9(0x2cf);async[a47_0x4381f9(0x1f5)](_0x17df93){const _0x460c50=a47_0x4381f9,{options:_0xe9c15b,args:_0x499f0d,tdx:_0x96d531}=_0x17df93,_0x112d8f=this[_0x460c50(0x2e9)](_0x499f0d,_0xe9c15b),_0x3ef3c4=_0xe9c15b[_0x460c50(0x231)],_0x1551e4=_0xe9c15b[_0x460c50(0x1fb)],_0x4ce900=_0xe9c15b[_0x460c50(0x249)];if(!_0x112d8f)return console[_0x460c50(0x2f5)](a47_0x321bc0[_0x460c50(0x330)](_0x460c50(0x28e)),'Source\x20directory\x20is\x20required'),console[_0x460c50(0x2f5)](a47_0x321bc0['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x460c50(0x2f5)](a47_0x321bc0[_0x460c50(0x340)](_0x460c50(0x33c))),0x1;if(!_0x3ef3c4)return console[_0x460c50(0x2f5)](a47_0x321bc0[_0x460c50(0x330)](_0x460c50(0x28e)),_0x460c50(0x22f)),console['error'](a47_0x321bc0[_0x460c50(0x340)](_0x460c50(0x2f2))),0x1;_0xe9c15b[_0x460c50(0x354)]&&(console['error'](_0x460c50(0x2e2)+_0x112d8f),console[_0x460c50(0x2f5)](_0x460c50(0x2e5)+_0x3ef3c4),_0x1551e4&&console[_0x460c50(0x2f5)](_0x460c50(0x2f6)+_0x1551e4),_0xe9c15b['dryRun']&&console[_0x460c50(0x2f5)](_0x460c50(0x2e4)),_0x4ce900&&console[_0x460c50(0x2f5)]('Validation:\x20skipped'));const _0x2ffb68=await withSpinner(_0x460c50(0x33e),()=>_0x96d531[_0x460c50(0x25e)][_0x460c50(0x36b)](_0x112d8f,_0x3ef3c4,{'revision':_0x1551e4,'skipValidation':_0x4ce900}),{'verbose':_0xe9c15b['verbose']}),_0xe38eeb=_0x2ffb68[_0x460c50(0x360)];console[_0x460c50(0x2f5)](_0x460c50(0x202)+_0xe38eeb[_0x460c50(0x219)]);_0xe38eeb[_0x460c50(0x32e)]&&console[_0x460c50(0x2f5)](_0x460c50(0x2f4)+_0xe38eeb[_0x460c50(0x32e)]);console['error'](_0x460c50(0x2e5)+_0xe38eeb['newProjectName']),console[_0x460c50(0x2f5)]('Revision:\x20'+_0xe38eeb[_0x460c50(0x1fb)]),console[_0x460c50(0x2f5)](_0x460c50(0x2da)+_0xe38eeb[_0x460c50(0x223)]);_0xe38eeb[_0x460c50(0x35f)]&&(console[_0x460c50(0x2f5)](a47_0x321bc0['yellow'](_0x460c50(0x2e7)+_0xe38eeb[_0x460c50(0x1eb)]+_0x460c50(0x285)+_0xe38eeb[_0x460c50(0x243)]+')')),console[_0x460c50(0x2f5)](a47_0x321bc0[_0x460c50(0x251)](_0x460c50(0x326))));if(_0xe9c15b[_0x460c50(0x291)])return console['error'](a47_0x321bc0[_0x460c50(0x251)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0xe9c15b[_0x460c50(0x312)]){if(!isInteractive())return console[_0x460c50(0x2f5)](a47_0x321bc0['red'](_0x460c50(0x382)),_0x460c50(0x2a8)),console['error'](a47_0x321bc0[_0x460c50(0x340)](_0x460c50(0x2c5))),0x1;const _0x47de30=_0xe38eeb[_0x460c50(0x32e)]||a47_0x24719a['basename'](_0x112d8f),_0x35167c=_0xe38eeb['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x3ef3c4+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x47de30+_0x460c50(0x31c)+_0x3ef3c4+'\x22?',_0x590dff=await confirmKey(_0x35167c);if(!_0x590dff)return console[_0x460c50(0x2f5)](a47_0x321bc0[_0x460c50(0x251)](_0x460c50(0x2b7))),0x1;}const _0x23d7b1=await withSpinner(_0xe38eeb['targetExists']?_0x460c50(0x379)+_0x3ef3c4+_0x460c50(0x266):_0x460c50(0x2f7)+_0x3ef3c4+_0x460c50(0x266),()=>_0x96d531['workflow'][_0x460c50(0x21d)](_0xe38eeb),{'verbose':_0xe9c15b[_0x460c50(0x354)]}),_0x45b7e0=_0x23d7b1[_0x460c50(0x360)];return console[_0x460c50(0x2f5)](a47_0x321bc0[_0x460c50(0x2df)](_0xe38eeb[_0x460c50(0x35f)]?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console['error'](_0x460c50(0x344)+_0x45b7e0[_0x460c50(0x1eb)]),console[_0x460c50(0x2f5)](_0x460c50(0x386)+_0x45b7e0[_0x460c50(0x273)]),console['error']('\x20\x20Revision:\x20'+_0x45b7e0[_0x460c50(0x1fb)]),await this[_0x460c50(0x27f)](_0x96d531,_0x45b7e0[_0x460c50(0x1eb)],_0xe9c15b[_0x460c50(0x2b3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a47_0x4381f9(0x231)]='workflow:delete';['description']=a47_0x4381f9(0x36d);async[a47_0x4381f9(0x1f5)](_0x288824){const _0x3faed6=a47_0x4381f9,{options:_0x27ef31,args:_0x47b6e9,tdx:_0x4a99ed}=_0x288824,_0x5b7941=_0x47b6e9[0x0];if(!_0x5b7941)return console[_0x3faed6(0x2f5)](_0x3faed6(0x2d1)),console['error'](_0x3faed6(0x255)),0x1;_0x27ef31['verbose']&&console['error']('Project:\x20'+_0x5b7941);if(!_0x27ef31['yes']){if(!isInteractive())return console[_0x3faed6(0x2f5)](a47_0x321bc0['red'](_0x3faed6(0x382)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3faed6(0x2f5)](a47_0x321bc0[_0x3faed6(0x340)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b7c8f=await confirmKey(_0x3faed6(0x26a)+_0x5b7941+_0x3faed6(0x339));if(!_0x5b7c8f)return console[_0x3faed6(0x2f5)](a47_0x321bc0[_0x3faed6(0x251)](_0x3faed6(0x2b7))),0x1;}const _0x36875b=await withSpinner('Deleting\x20project\x20'+_0x5b7941+_0x3faed6(0x266),()=>_0x4a99ed[_0x3faed6(0x25e)][_0x3faed6(0x236)](_0x5b7941),{'verbose':_0x27ef31[_0x3faed6(0x354)]}),_0x3ec37b=_0x36875b['data'];return console[_0x3faed6(0x2f5)](_0x3faed6(0x2ef)+_0x3ec37b['projectName']),console['error'](_0x3faed6(0x386)+_0x3ec37b['projectId']),0x0;}}export function parseKeyValue(_0x4a3998){const _0x4971ed=a47_0x4381f9,_0x2e854a=_0x4a3998[_0x4971ed(0x216)]('=');if(_0x2e854a===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4a3998+'.\x20Expected\x20format:\x20KEY=VALUE');const _0xf7e330=_0x4a3998['substring'](0x0,_0x2e854a),_0x5b246d=_0x4a3998['substring'](_0x2e854a+0x1);if(!_0xf7e330)throw new Error(_0x4971ed(0x1e7));return{'key':_0xf7e330,'value':_0x5b246d};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']='workflow:secrets:list';[a47_0x4381f9(0x263)]=a47_0x4381f9(0x2b4);async[a47_0x4381f9(0x1f5)](_0x1a4cb8){const _0xfd6804=a47_0x4381f9,{options:_0x354fef,args:_0x356eb0,tdx:_0x8f9b92}=_0x1a4cb8,_0x564ee7=this[_0xfd6804(0x264)](_0x356eb0,_0x354fef);if(!_0x564ee7)return 0x1;_0x354fef[_0xfd6804(0x354)]&&console[_0xfd6804(0x2f5)]('Project:\x20'+_0x564ee7);const _0x9684e0=await withSpinner(_0xfd6804(0x260),()=>_0x8f9b92[_0xfd6804(0x25e)]['listSecrets'](_0x564ee7),{'verbose':_0x354fef['verbose']}),{secrets:_0x4f2fed}=_0x9684e0[_0xfd6804(0x360)];return console['error']('✔\x20Found\x20'+_0x4f2fed['length']+'\x20secret'+(_0x4f2fed[_0xfd6804(0x35e)]!==0x1?'s':'')),await handleSDKOutput(_0x4f2fed,_0x354fef),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a47_0x4381f9(0x20b);[a47_0x4381f9(0x263)]=a47_0x4381f9(0x30c);async[a47_0x4381f9(0x1f5)](_0x4ff985){const _0x290080=a47_0x4381f9,{options:_0x1f5a94,args:_0x5a772d,tdx:_0x568e74}=_0x4ff985;let _0x192b01,_0x9d3024;if(_0x5a772d[_0x290080(0x35e)]>=0x2)_0x192b01=_0x5a772d[0x0],_0x9d3024=_0x5a772d[0x1];else{if(_0x5a772d[_0x290080(0x35e)]===0x1&&_0x1f5a94[_0x290080(0x309)])_0x192b01=_0x1f5a94[_0x290080(0x309)],_0x9d3024=_0x5a772d[0x0];else return _0x5a772d['length']===0x1?(console[_0x290080(0x2f5)](_0x290080(0x30a)),console[_0x290080(0x2f5)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x290080(0x2f5)](_0x290080(0x2be)),console[_0x290080(0x2f5)](_0x290080(0x1fa)),0x1);}let _0x34e42f,_0x172193;try{({key:_0x34e42f,value:_0x172193}=parseKeyValue(_0x9d3024));}catch(_0x403a4c){return _0x403a4c instanceof Error&&console[_0x290080(0x2f5)](a47_0x321bc0['red'](_0x290080(0x28e)),_0x403a4c[_0x290080(0x220)]),0x1;}_0x1f5a94[_0x290080(0x354)]&&(console[_0x290080(0x2f5)](_0x290080(0x33f)+_0x192b01),console[_0x290080(0x2f5)](_0x290080(0x353)+_0x34e42f));const _0x46789c=await withSpinner(_0x290080(0x314),()=>_0x568e74[_0x290080(0x25e)][_0x290080(0x1ee)](_0x192b01,_0x34e42f,_0x172193),{'verbose':_0x1f5a94['verbose']}),_0x502946=_0x46789c[_0x290080(0x360)];return console[_0x290080(0x2f5)](_0x290080(0x200)+_0x502946[_0x290080(0x277)]+_0x290080(0x284)+_0x502946[_0x290080(0x2a2)]+'\x27'),(_0x1f5a94[_0x290080(0x28d)]||_0x1f5a94[_0x290080(0x37e)])&&await handleSingleObjectOutput(_0x502946,_0x1f5a94),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]='workflow:secrets:delete';[a47_0x4381f9(0x263)]=a47_0x4381f9(0x20f);async[a47_0x4381f9(0x1f5)](_0x33cffb){const _0x53005c=a47_0x4381f9,{options:_0x37bf78,args:_0x27cdc6,tdx:_0x44390b}=_0x33cffb;let _0xdccd7d,_0x3de3a4;if(_0x27cdc6[_0x53005c(0x35e)]>=0x2)_0xdccd7d=_0x27cdc6[0x0],_0x3de3a4=_0x27cdc6[0x1];else{if(_0x27cdc6['length']===0x1&&_0x37bf78[_0x53005c(0x309)])_0xdccd7d=_0x37bf78[_0x53005c(0x309)],_0x3de3a4=_0x27cdc6[0x0];else return _0x27cdc6[_0x53005c(0x35e)]===0x1?(console[_0x53005c(0x2f5)](_0x53005c(0x30a)),console[_0x53005c(0x2f5)](_0x53005c(0x323)),0x1):(console['error'](_0x53005c(0x33b)),console['error']('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x37bf78[_0x53005c(0x354)]&&(console[_0x53005c(0x2f5)](_0x53005c(0x33f)+_0xdccd7d),console['error'](_0x53005c(0x353)+_0x3de3a4));if(!_0x37bf78[_0x53005c(0x312)]){if(!isInteractive())return console[_0x53005c(0x2f5)](a47_0x321bc0[_0x53005c(0x330)](_0x53005c(0x382)),_0x53005c(0x2a8)),console[_0x53005c(0x2f5)](a47_0x321bc0['dim'](_0x53005c(0x2c5))),0x1;const _0x4c9a3a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x3de3a4+_0x53005c(0x227)+_0xdccd7d+'\x27?');if(!_0x4c9a3a)return console[_0x53005c(0x2f5)](a47_0x321bc0[_0x53005c(0x251)](_0x53005c(0x2b7))),0x1;}const _0x56e32d=await withSpinner(_0x53005c(0x23d),()=>_0x44390b[_0x53005c(0x25e)][_0x53005c(0x295)](_0xdccd7d,_0x3de3a4),{'verbose':_0x37bf78[_0x53005c(0x354)]}),_0x354243=_0x56e32d[_0x53005c(0x360)];return console[_0x53005c(0x2f5)]('✔\x20Secret\x20\x27'+_0x354243['key']+_0x53005c(0x26d)+_0x354243[_0x53005c(0x2a2)]+'\x27'),(_0x37bf78[_0x53005c(0x28d)]||_0x37bf78[_0x53005c(0x37e)])&&await handleSingleObjectOutput(_0x354243,_0x37bf78),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(_0x278ae2){const _0x18f251=a47_0x4381f9,_0x5731eb=Math[_0x18f251(0x2db)](_0x278ae2/0x3e8),_0x54ab50=Math[_0x18f251(0x2db)](_0x5731eb/0x3c),_0x287c53=Math[_0x18f251(0x2db)](_0x54ab50/0x3c),_0x1119a0=Math[_0x18f251(0x2db)](_0x287c53/0x18);if(_0x1119a0>0x0){const _0x23abe7=_0x287c53%0x18;return _0x23abe7>0x0?_0x1119a0+'d\x20'+_0x23abe7+'h':_0x1119a0+'d';}else{if(_0x287c53>0x0){const _0x47cd38=_0x54ab50%0x3c;return _0x47cd38>0x0?_0x287c53+'h\x20'+_0x47cd38+'m':_0x287c53+'h';}else{if(_0x54ab50>0x0){const _0x3b98cb=_0x5731eb%0x3c;return _0x3b98cb>0x0?_0x54ab50+'m\x20'+_0x3b98cb+'s':_0x54ab50+'m';}else return _0x5731eb+'s';}}}function formatTimestamp(_0xc75bc7,_0x3424cb){const _0x18c1ef=a47_0x4381f9,_0x2d6946=new Date(_0xc75bc7),_0x35f11f=String(_0x2d6946[_0x18c1ef(0x1ef)]())[_0x18c1ef(0x358)](0x2,'0'),_0x1806dc=String(_0x2d6946[_0x18c1ef(0x259)]())[_0x18c1ef(0x358)](0x2,'0'),_0x1ba44e=_0x35f11f+':'+_0x1806dc,_0x11c1ca=_0x2d6946['getFullYear']()===_0x3424cb[_0x18c1ef(0x2b0)]()&&_0x2d6946[_0x18c1ef(0x28b)]()===_0x3424cb[_0x18c1ef(0x28b)]()&&_0x2d6946[_0x18c1ef(0x333)]()===_0x3424cb[_0x18c1ef(0x333)]();if(_0x11c1ca)return _0x1ba44e;else{const _0x2475ea=String(_0x2d6946[_0x18c1ef(0x28b)]()+0x1)[_0x18c1ef(0x358)](0x2,'0'),_0x5a5591=String(_0x2d6946['getDate']())['padStart'](0x2,'0');return _0x2475ea+'-'+_0x5a5591+'\x20'+_0x1ba44e;}}function formatDate(_0x4d5a90){const _0x382e9c=a47_0x4381f9,_0x324151=_0x4d5a90[_0x382e9c(0x2b0)](),_0x5256a9=String(_0x4d5a90['getMonth']()+0x1)[_0x382e9c(0x358)](0x2,'0'),_0x5efc36=String(_0x4d5a90[_0x382e9c(0x333)]())[_0x382e9c(0x358)](0x2,'0');return _0x324151+'-'+_0x5256a9+'-'+_0x5efc36;}function getTaskStateIcon(_0x38ac85){const _0x4965fc={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4965fc[_0x38ac85]||'⚪';}function getBarChar(_0x723cd4){const _0x19b701=a47_0x4381f9;return _0x723cd4===_0x19b701(0x2f5)||_0x723cd4===_0x19b701(0x302)?'×':'─';}function getBarColor(_0x4c7e03){const _0x4f4f7e=a47_0x4381f9,_0x162004={'success':a47_0x321bc0[_0x4f4f7e(0x2df)],'error':a47_0x321bc0[_0x4f4f7e(0x330)],'group_error':a47_0x321bc0['red'],'running':a47_0x321bc0[_0x4f4f7e(0x205)],'blocked':a47_0x321bc0[_0x4f4f7e(0x251)],'planned':a47_0x321bc0[_0x4f4f7e(0x340)],'canceling':a47_0x321bc0[_0x4f4f7e(0x251)]};return _0x162004[_0x4c7e03]||a47_0x321bc0['white'];}function parseTaskName(_0x3d6f41){const _0x159cd0=a47_0x4381f9;let _0x296db3=_0x3d6f41[_0x159cd0(0x37a)](/^\++/,'');const _0x494748=_0x296db3['split']('+'),_0x107e09=_0x494748[_0x159cd0(0x35e)]>0x1?_0x494748[_0x159cd0(0x35e)]-0x2:0x0,_0x3f949d=_0x494748[_0x494748[_0x159cd0(0x35e)]-0x1]||_0x296db3;return{'level':_0x107e09,'name':'+'+_0x3f949d};}function truncateTaskName(_0x44118d,_0x50abbf){const _0x4abd7f=a47_0x4381f9,_0x509c7b=stringWidth(_0x44118d);if(_0x509c7b<=_0x50abbf)return _0x44118d;let _0x173024=_0x44118d;while(stringWidth(_0x173024+'…')>_0x50abbf&&_0x173024[_0x4abd7f(0x35e)]>0x0){_0x173024=_0x173024[_0x4abd7f(0x33a)](0x0,-0x1);}return _0x173024+'…';}function calculateTimeScale(_0x53e84d,_0x3f1e73){const _0xe2eb66=a47_0x4381f9;return{'startTime':_0x53e84d[_0xe2eb66(0x283)],'endTime':_0x53e84d[_0xe2eb66(0x35b)],'durationMs':_0x53e84d['duration'],'msPerChar':_0x53e84d[_0xe2eb66(0x2a3)]/_0x3f1e73};}function timeToPosition(_0x431f36,_0x20a2fa,_0x14da0a){const _0x5edec2=a47_0x4381f9,_0x2d096d=_0x431f36-_0x20a2fa[_0x5edec2(0x22b)],_0x43a5c0=Math['floor'](_0x2d096d/_0x20a2fa[_0x5edec2(0x2ab)]);return Math[_0x5edec2(0x1ec)](0x0,Math[_0x5edec2(0x32c)](_0x43a5c0,_0x14da0a));}function renderTimeAxis(_0x202f37,_0x356035){const _0x48b860=a47_0x4381f9,_0xd3c08=Math[_0x48b860(0x32c)](TIMELINE_CONFIG[_0x48b860(0x257)],Math[_0x48b860(0x1ec)](TIMELINE_CONFIG[_0x48b860(0x325)],Math[_0x48b860(0x2db)](_0x356035/TIMELINE_CONFIG[_0x48b860(0x228)]))),_0x2ac745=_0x202f37[_0x48b860(0x26e)]/(_0xd3c08-0x1),_0x5c65d2=new Date(_0x202f37[_0x48b860(0x22b)]),_0x5268b7=[];for(let _0x3fe7bc=0x0;_0x3fe7bc<_0xd3c08;_0x3fe7bc++){const _0x3bfd09=_0x202f37[_0x48b860(0x22b)]+_0x3fe7bc*_0x2ac745,_0x1399a9=timeToPosition(_0x3bfd09,_0x202f37,_0x356035),_0x60bdb9=formatTimestamp(_0x3bfd09,_0x5c65d2);_0x5268b7[_0x48b860(0x303)]({'pos':_0x1399a9,'text':_0x60bdb9});}const _0x3c2721=new Array(_0x356035)['fill']('\x20');let _0x30a712=-0x1;for(const {pos:_0x137716,text:_0x5918c3}of _0x5268b7){let _0x501c7a=Math[_0x48b860(0x1ec)](0x0,_0x137716-Math[_0x48b860(0x2db)](_0x5918c3[_0x48b860(0x35e)]/0x2));_0x501c7a<=_0x30a712+TIMELINE_CONFIG[_0x48b860(0x30b)]&&(_0x501c7a=_0x30a712+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x501c7a+_0x5918c3[_0x48b860(0x35e)]>_0x356035&&(_0x501c7a=_0x356035-_0x5918c3['length']);if(_0x501c7a>=0x0&&_0x501c7a+_0x5918c3['length']<=_0x356035&&_0x501c7a>_0x30a712){for(let _0x1493fe=0x0;_0x1493fe<_0x5918c3[_0x48b860(0x35e)];_0x1493fe++){_0x3c2721[_0x501c7a+_0x1493fe]=_0x5918c3[_0x1493fe];}_0x30a712=_0x501c7a+_0x5918c3[_0x48b860(0x35e)]-0x1;}}return _0x3c2721[_0x48b860(0x2cd)]('');}function renderTaskRow(_0xa24408,_0x2c545b,_0x5788d6,_0x295cf2){const _0x58a6de=a47_0x4381f9,{level:_0x251c8b,name:_0x13ecaf}=parseTaskName(_0xa24408[_0x58a6de(0x231)]),_0x17ef12='\x20'[_0x58a6de(0x345)](_0x251c8b),_0x8922cc=_0xa24408[_0x58a6de(0x1ff)]?'('+formatElapsed(_0xa24408[_0x58a6de(0x1ff)][_0x58a6de(0x2a3)])+')':'',_0x237ff0=stringWidth(_0x8922cc),_0x4f978a=_0x251c8b*0x1,_0x3ac6a7=_0x295cf2-_0x4f978a-_0x237ff0-0x1,_0x43f3b6=truncateTaskName(_0x13ecaf,_0x3ac6a7),_0x215945=_0x17ef12+_0x43f3b6,_0xb5542=stringWidth(_0x215945),_0x5d4c19=_0x295cf2-_0xb5542-_0x237ff0,_0x1f2ee0=_0x215945+'\x20'[_0x58a6de(0x345)](Math[_0x58a6de(0x1ec)](0x1,_0x5d4c19))+a47_0x321bc0['dim'](_0x8922cc),_0x5566c4=getTaskStateIcon(_0xa24408[_0x58a6de(0x2ff)]),_0x245c07=new Array(_0x5788d6)['fill']('\x20');if(_0xa24408[_0x58a6de(0x1ff)]){const _0x527dd5=timeToPosition(_0xa24408[_0x58a6de(0x1ff)][_0x58a6de(0x283)],_0x2c545b,_0x5788d6),_0x3bd50c=timeToPosition(_0xa24408[_0x58a6de(0x1ff)][_0x58a6de(0x35b)],_0x2c545b,_0x5788d6),_0x2814d5=getBarChar(_0xa24408[_0x58a6de(0x2ff)]),_0x5ef3ec=Math[_0x58a6de(0x1ec)](_0x527dd5+0x1,_0x3bd50c);for(let _0x580d64=_0x527dd5;_0x580d64<Math[_0x58a6de(0x32c)](_0x5ef3ec,_0x5788d6);_0x580d64++){_0x245c07[_0x580d64]=_0x2814d5;}}const _0x54df15=getBarColor(_0xa24408[_0x58a6de(0x2ff)]),_0xd0090=_0x245c07[_0x58a6de(0x230)](_0x4a2544=>_0x4a2544==='\x20'?'\x20':_0x54df15(_0x4a2544))[_0x58a6de(0x2cd)]('');return _0x5566c4+'\x20'+_0x1f2ee0+'│'+_0xd0090+'│';}function calculateStats(_0x2bff2e){const _0xcbe58f=a47_0x4381f9,_0x325c18={'total':_0x2bff2e['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x593c76 of _0x2bff2e){if(_0x593c76[_0xcbe58f(0x2ff)]===_0xcbe58f(0x2aa))_0x325c18[_0xcbe58f(0x2aa)]++;else{if(_0x593c76[_0xcbe58f(0x2ff)]==='error'||_0x593c76[_0xcbe58f(0x2ff)]===_0xcbe58f(0x302))_0x325c18[_0xcbe58f(0x2f5)]++;else _0x593c76['state']===_0xcbe58f(0x2d2)?_0x325c18[_0xcbe58f(0x2d2)]++:_0x325c18[_0xcbe58f(0x2b1)]++;}}return _0x325c18;}function a47_0x4959(){const _0x379b92=['Pushing\x20project...','navigateSessionsInteractive','workflow:retry','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','attempt','indexOf','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','📋\x20','sourceDir','workflow:run','\x20new','fill','executeCloneProject','Force:\x20yes','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','message','projectId','\x20has\x20no\x20attempts','fileCount','Retrying\x20session...','Reason:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x27\x20from\x20project\x20\x27','LABEL_WIDTH_DIVISOR','MIN_TIMELINE_WIDTH','includeRetried','startTime','startsWith','Listing\x20workflow\x20sessions...','filter','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','map','name','List\x20workflow\x20execution\x20sessions','No\x20projects\x20match\x20pattern:\x20','workflows','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','delete','93SVtXLy','pollTimeline','Error:\x20Invalid\x20parameter\x20format:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20unchanged','Deleting\x20secret...','/app/workflows/','\x20\x20Attempt\x20ID:\x20','Output\x20directory:\x20','No\x20sessions\x20with\x20timing\x20information','No\x20log\x20content\x20found','existingProjectId','Show\x20tasks\x20for\x20an\x20attempt','Resolving\x20project\x20\x27','list','attemptId','workflow:projects','skipValidation','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','new','\x20\x20Console:\x20','workflow:timeline','changes','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Target\x20directory:\x20','yellow','MAX_TASKS_DISPLAY','stat','List\x20all\x20workflow\x20projects','Usage:\x20workflow:delete\x20<project-name-or-id>','\x20is\x20not\x20a\x20directory','MAX_LABEL_COUNT','Analyzing\x20changes...','getMinutes','\x20(system)','param','Error:\x20','session_id','workflow','✔\x20Push\x20complete','Listing\x20secrets...','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20\x20Location:\x20','description','requireProject','\x20deleted','...','startedAt','\x0aDry\x20run\x20-\x20nothing\x20pushed','metadata','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','project','limit','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','durationMs','keys','reason','select','\x20\x20Source:\x20','newProjectId','57080wRLNRf','unchanged','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','key','some','cancelRequested','Writing\x20files...','\x20\x20Session\x20context\x20set\x20to:\x20','sort','\x0aFailed\x20to\x20fetch\x20attempt\x20data','generateSessionTimelineRows','showWorkflowConsoleUrl','includes','\x20\x20Changes:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','start','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x22\x20already\x20exists\x20(ID:\x20','\x0a✔\x20Attempt\x20complete','/sessions/','workflow:logs','Select\x20a\x20workflow\x20to\x20run','7635570EzgXuk','getMonth','5613824bebJmd','json','Error:','\x20attempt','taskName','dryRun','\x0aApply\x20these\x20changes?','fromTask','29648FoHXzM','deleteSecret','toLowerCase','💡\x20Tip:\x20Use\x20','No\x20workflows\x20found\x20in\x20project:\x20','✔\x20Retry\x20started','Attempt\x20ID:\x20','From\x20task:\x20','format','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Pattern:\x20','/attempt/','values','-\x20nothing\x20pushed','projectName','duration','find','isTTY','icon','utf-8','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','workflowName','success','msPerChar','\x20\x20Revision:\x20','---\x20','hasChanges','modified','getFullYear','pending','logFiles','site','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20sessions\x20found','Cancelled','Listing\x20workflow\x20projects...','title','Kill\x20a\x20running\x20attempt','Session\x20not\x20found:\x20','renderTimeline','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Error:\x20KEY=VALUE\x20is\x20required','diff','\x20-\x20','Validation:\x20skipped','force','No\x20attempts\x20found\x20in\x20project:\x20','✔\x20Pushed\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','6876bBUHXb','task','resumeFrom','parseProjectWorkflowPattern','Total:\x20','(use\x20--limit\x20to\x20see\x20more)','workflow:clone','join','tdx.json','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20session','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','running','value','retryAttemptName','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','tasks','✔\x20Found\x20','sessionId','sys','Files\x20to\x20upload:\x20','floor','path','relative','workflow:attempt','green','updatedAt','Auto-selected\x20latest\x20session:\x20','Source\x20directory:\x20','Attempt:\x20','Dry\x20run:\x20yes','New\x20project\x20name:\x20','Session\x20time:\x20','\x0a⚠\x20Project\x20\x22','output','resolveProjectDir','run','summary','canceling','No\x20sessions\x20found\x20in\x20project:\x20','6850uVJvmj','✔\x20Deleted\x20project\x20','index','\x20to\x20see\x20detailed\x20logs','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','params','Source\x20project:\x20','error','Revision:\x20','Cloning\x20to\x20','lastAttempt','logs','\x0aPolling...\x20(','Expected\x20format:\x20--param\x20key=value','3585722sNRbYa','Show\x20specific\x20attempt\x20details','rows','state','workflow:download','✔\x20Project:\x20','group_error','push','\x20\x20Session\x20ID:\x20','Project\x20filter:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','now','Getting\x20attempt\x20tasks...','workflowProject','Error:\x20Project\x20name\x20is\x20required','LABEL_MIN_SPACING','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20logs','\x20\x20tdx\x20wf\x20use\x20<project>','displayLine','No\x20attempts\x20found','Loading\x20sessions...','yes','Loading\x20session...','Setting\x20secret...','Pushing\x20workflow\x20project...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','tdx\x20wf\x20attempt\x20','\x20modified','size','workflow:workflows','\x22\x20to\x20new\x20project\x20\x22','\x0a✔\x20No\x20changes\x20to\x20push','context','attempt:','45198813rTFdky','isArray','-\x20no\x20files\x20written','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','targetDir','MIN_LABEL_COUNT','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Listing\x20workflow\x20attempts...','\x20(use\x20--limit\x20to\x20show\x20more)','Include\x20retried:\x20yes','fs/promises','Filter:\x20','min','Select\x20a\x20task\x20to\x20view\x20logs:','sourceProjectName',',\x20Workflow:\x20','red','planned','follow','getDate','List\x20workflow\x20attempts','get','sessions','projects','✔\x20Workflow\x20project\x20context\x20cleared.','\x22?\x20This\x20cannot\x20be\x20undone.','slice','Error:\x20Secret\x20key\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','total','Analyzing\x20project...','Project:\x20','dim','No\x20workflows\x20found','Filter:\x20project=','\x20task','\x20\x20Project:\x20','repeat','Resume\x20from:\x20','ICON_WIDTH','includeSubtasks','Killing\x20attempt...','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','isNewProject','ICON_SPACING','Error:\x20Attempt\x20ID\x20is\x20required','workflow:kill','buildTimelineData','done','resolveProjectId','stdout','Key:\x20','verbose','status','fullName','Latest\x20session\x20has\x20no\x20attempt','padStart','\x0a✔\x20Already\x20up\x20to\x20date','split','end','session:','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','length','targetExists','data','resolveProject','cyan','applyPullProject','\x20of\x20','clear','preparePushProject','MAX_POLL_ITERATIONS','set','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','GUTTER','prepareCloneProject','toISOString','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20sessions\x20','isDirectory','substring','Pull\x20workflow\x20project\x20to\x20local\x20folder','Retry\x20a\x20session\x20or\x20attempt','parse','14IbRdEM','type','\x20project','revision:\x20','List\x20workflows','Updating\x20','replace','table','Task\x20name:\x20','\x1b[1A\x1b[2K','jsonl','all','Fetching\x20log\x20files...','cwd','\x0aError:','match','getTime','No\x20workflow\x20tdx.json\x20found','\x20\x20Project\x20ID:\x20','session','renderSingleTimeline','18PvAmxa','No\x20sessions\x20found\x20for:\x20','Project\x20name:\x20','log','text','download','Key\x20cannot\x20be\x20empty','autocomplete','sessionTime','Including\x20subtasks:\x20yes','newProjectName','max','from','setSecret','getHours','Parameters:\x20','columns','filesExtracted','Loading\x20workflows...','renderSessionsTimeline','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','pullProject','Params:\x20','No\x20attempts\x20found\x20for:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','revision','createdAt','TASK_NAME_WIDTH','localeCompare','window','✔\x20Secret\x20\x27','\x20\x20Target:\x20','Source:\x20','write','Project\x20name\x20is\x20required','blue','workflow:upload','Using\x20attempt\x20','retrySession','\x20\x20Workflow:\x20','finishedAt','workflow:secrets:set','workflow:attempts','deleted','readFile','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflow:sessions'];a47_0x4959=function(){return _0x379b92;};return a47_0x4959();}function formatStats(_0x538ee3){const _0x41d3e3=a47_0x4381f9;return[_0x41d3e3(0x2ca)+_0x538ee3[_0x41d3e3(0x33d)],'✅\x20'+_0x538ee3[_0x41d3e3(0x2aa)],'❌\x20'+_0x538ee3[_0x41d3e3(0x2f5)],'🔄\x20'+_0x538ee3[_0x41d3e3(0x2d2)],'⏳\x20'+_0x538ee3[_0x41d3e3(0x2b1)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a47_0x4381f9(0x231)]=a47_0x4381f9(0x24d);['description']=a47_0x4381f9(0x21f);async[a47_0x4381f9(0x1f5)](_0x18771b){const _0x1077bf=a47_0x4381f9,{options:_0x1eb4d2,args:_0x741e2e,tdx:_0x93a706}=_0x18771b;let _0x5984aa,_0xf6f1c1,_0x589075=![];if(_0x741e2e[0x0]){if(_0x741e2e[0x0][_0x1077bf(0x280)]('.')){const _0x172015=this[_0x1077bf(0x2c9)](_0x741e2e,_0x1eb4d2);if(!_0x172015)return 0x1;_0x5984aa=_0x172015[_0x1077bf(0x2a2)],_0xf6f1c1=_0x172015[_0x1077bf(0x2a9)];}else{_0xf6f1c1=_0x741e2e[0x0],_0x5984aa=_0x1eb4d2[_0x1077bf(0x309)];if(!_0x5984aa)return console[_0x1077bf(0x2f5)](a47_0x321bc0['red'](_0x1077bf(0x28e)),_0x1077bf(0x23a)),0x1;_0x589075=!![];}}else{const _0x36ad51=this['parseProjectWorkflowPattern'](_0x741e2e,_0x1eb4d2);if(!_0x36ad51)return 0x1;_0x5984aa=_0x36ad51[_0x1077bf(0x2a2)],_0xf6f1c1=_0x36ad51['workflowName'];}if(_0x1eb4d2[_0x1077bf(0x354)]){if(_0x5984aa&&_0xf6f1c1)console[_0x1077bf(0x2f5)]('Filter:\x20'+_0x5984aa+'.'+_0xf6f1c1);else _0x5984aa&&console[_0x1077bf(0x2f5)](_0x1077bf(0x342)+_0x5984aa);}const _0x4fb60b=_0x1eb4d2[_0x1077bf(0x247)],_0x5d55ff=_0x1eb4d2[_0x1077bf(0x2d8)];if(_0x4fb60b){_0x5d55ff&&console[_0x1077bf(0x2f5)](a47_0x321bc0[_0x1077bf(0x251)]('Warning:'),_0x1077bf(0x235));const _0x73e191=_0x1eb4d2[_0x1077bf(0x332)];return _0x73e191?await this[_0x1077bf(0x238)](_0x18771b,_0x4fb60b):await this[_0x1077bf(0x1e0)](_0x18771b,_0x4fb60b,_0x1eb4d2),0x0;}if(_0x5d55ff){const _0x626535=await withSpinner(_0x1077bf(0x313),()=>_0x93a706['workflow'][_0x1077bf(0x336)]({'projectName':_0x5984aa,'workflowName':_0xf6f1c1,'limit':0x64}),{'verbose':_0x1eb4d2[_0x1077bf(0x354)]}),_0x45b6cd=_0x626535[_0x1077bf(0x360)][_0x1077bf(0x2a4)](_0x4d9882=>_0x4d9882['id']===_0x5d55ff);if(!_0x45b6cd)return console[_0x1077bf(0x2f5)](a47_0x321bc0[_0x1077bf(0x330)](_0x1077bf(0x28e)),_0x1077bf(0x2bb)+_0x5d55ff),0x1;if(!_0x45b6cd['lastAttempt']?.['id'])return console[_0x1077bf(0x2f5)](a47_0x321bc0[_0x1077bf(0x330)](_0x1077bf(0x28e)),'Session\x20'+_0x5d55ff+_0x1077bf(0x222)),0x1;const _0x107bba=_0x45b6cd[_0x1077bf(0x2f8)]['id'];_0x1eb4d2[_0x1077bf(0x354)]&&console['error'](_0x1077bf(0x207)+_0x107bba+'\x20from\x20session\x20'+_0x5d55ff);const _0x3a0566=_0x1eb4d2[_0x1077bf(0x332)];return _0x3a0566?await this['pollTimeline'](_0x18771b,_0x107bba):await this[_0x1077bf(0x1e0)](_0x18771b,_0x107bba,_0x1eb4d2),0x0;}const _0x305c4f=await withSpinner(_0x1077bf(0x311),()=>_0x93a706[_0x1077bf(0x25e)]['sessions']({'projectName':_0x5984aa,'workflowName':_0xf6f1c1,'limit':_0x1eb4d2[_0x1077bf(0x26c)]||0x32}),{'verbose':_0x1eb4d2['verbose']}),_0x4ea8fb=_0x305c4f[_0x1077bf(0x360)];if(_0x4ea8fb['length']===0x0){if(_0x5984aa&&_0xf6f1c1)console[_0x1077bf(0x2f5)]('No\x20sessions\x20found\x20for:\x20'+_0x5984aa+'.'+_0xf6f1c1);else _0x5984aa?console[_0x1077bf(0x2f5)](_0x1077bf(0x2ed)+_0x5984aa):(console[_0x1077bf(0x2f5)]('No\x20workflow\x20sessions\x20found'),console['error'](a47_0x321bc0[_0x1077bf(0x340)](_0x1077bf(0x2b5))));return 0x0;}_0x4ea8fb[_0x1077bf(0x27c)]((_0x3b7c20,_0x2987b2)=>{const _0x2563b7=_0x1077bf,_0x3ac0e5=_0x3b7c20[_0x2563b7(0x1e9)]||'',_0x55cee3=_0x2987b2[_0x2563b7(0x1e9)]||'';return _0x55cee3[_0x2563b7(0x1fe)](_0x3ac0e5);});if(_0x1eb4d2[_0x1077bf(0x28d)]||_0x1eb4d2[_0x1077bf(0x37e)])return await handleSDKOutput(_0x4ea8fb,_0x1eb4d2),0x0;let _0x1b3e23;if(_0x589075){const _0x3ac6d5=_0x4ea8fb[0x0];if(!_0x3ac6d5[_0x1077bf(0x2f8)]?.['id'])return console[_0x1077bf(0x2f5)](_0x1077bf(0x357)),0x0;_0x1b3e23=_0x3ac6d5[_0x1077bf(0x2f8)]['id'],_0x1eb4d2[_0x1077bf(0x354)]&&console[_0x1077bf(0x2f5)](_0x1077bf(0x2e1)+_0x3ac6d5['sessionTime']);}else{const _0x52f152=_0x4ea8fb['map'](_0x2318ee=>{const _0x288b20=_0x1077bf,_0x3e7f1a=getAttemptStatusDisplay(_0x2318ee[_0x288b20(0x2f8)]);return{'title':_0x2318ee[_0x288b20(0x26b)]?.[_0x288b20(0x231)]+'.'+_0x2318ee[_0x288b20(0x25e)]?.[_0x288b20(0x231)]+_0x288b20(0x2c0)+_0x2318ee[_0x288b20(0x1e9)]+'\x20'+_0x3e7f1a[_0x288b20(0x2a6)],'value':_0x2318ee[_0x288b20(0x2f8)]?.['id']||'','description':_0x3e7f1a[_0x288b20(0x1e5)]};}),_0x437a86=await a47_0x1ec412({'type':_0x1077bf(0x271),'name':_0x1077bf(0x247),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x52f152[_0x1077bf(0x22e)](_0xacb9b=>_0xacb9b[_0x1077bf(0x2d3)]!=='')});if(!_0x437a86['attemptId'])return 0x0;_0x1b3e23=_0x437a86['attemptId'];}const _0x5541aa=_0x1eb4d2[_0x1077bf(0x332)];return _0x5541aa?await this['pollTimeline'](_0x18771b,_0x1b3e23):await this[_0x1077bf(0x1e0)](_0x18771b,_0x1b3e23,_0x1eb4d2),0x0;}async[a47_0x4381f9(0x1e0)](_0x1e8629,_0x1d71f3,_0x1d0af3){const _0x2d32f8=a47_0x4381f9,{tdx:_0x27252e}=_0x1e8629;let _0x3069ab,_0x1b9a0b;try{[_0x3069ab,_0x1b9a0b]=await Promise[_0x2d32f8(0x37f)]([_0x27252e[_0x2d32f8(0x25e)][_0x2d32f8(0x215)](_0x1d71f3),_0x27252e['workflow']['tasks'](_0x1d71f3,![])]);}catch(_0x2f103){console[_0x2d32f8(0x2f5)](a47_0x321bc0[_0x2d32f8(0x330)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x1d0af3['verbose']&&console[_0x2d32f8(0x2f5)](_0x2f103);throw _0x2f103;}if(_0x1d0af3['json']||_0x1d0af3[_0x2d32f8(0x37e)]){const _0x274fbf=this['buildTimelineData'](_0x3069ab,_0x1b9a0b);await handleSDKOutput([_0x274fbf],_0x1d0af3);return;}const _0x412f22=_0x27252e[_0x2d32f8(0x31e)]['site'],_0x2f98d1=this[_0x2d32f8(0x2bc)](_0x3069ab,_0x1b9a0b,_0x412f22);console['log'](_0x2f98d1);}async[a47_0x4381f9(0x238)](_0x4e40f5,_0x189dfa){const _0x4be0b2=a47_0x4381f9,{tdx:_0x12ec06}=_0x4e40f5,_0x26a1c1=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x58ed05=TIMELINE_CONFIG[_0x4be0b2(0x367)];let _0x38457b=0x0;while(_0x38457b<_0x58ed05){process['stdout']['isTTY']&&process['stdout'][_0x4be0b2(0x203)]('\x1bc');let _0x3e4c7f,_0x2b24ae;try{[_0x3e4c7f,_0x2b24ae]=await Promise['all']([_0x12ec06[_0x4be0b2(0x25e)]['attempt'](_0x189dfa),_0x12ec06[_0x4be0b2(0x25e)]['tasks'](_0x189dfa,![])]);}catch(_0x2809a1){console[_0x4be0b2(0x2f5)](a47_0x321bc0[_0x4be0b2(0x330)](_0x4be0b2(0x27d)));_0x38457b>0x0&&console['error'](a47_0x321bc0['dim'](_0x4be0b2(0x226)+_0x38457b));throw _0x2809a1;}const _0x332b2f=_0x12ec06[_0x4be0b2(0x31e)][_0x4be0b2(0x2b3)],_0x48a814=this[_0x4be0b2(0x2bc)](_0x3e4c7f,_0x2b24ae,_0x332b2f);console[_0x4be0b2(0x1e4)](_0x48a814);const _0x29620a=_0x3e4c7f[_0x4be0b2(0x350)]&&_0x2b24ae['every'](_0x5654c4=>_0x5654c4[_0x4be0b2(0x2ff)]!=='running'&&_0x5654c4[_0x4be0b2(0x2ff)]!==_0x4be0b2(0x331));if(_0x29620a){console[_0x4be0b2(0x2f5)](a47_0x321bc0[_0x4be0b2(0x2df)](_0x4be0b2(0x286)));break;}console[_0x4be0b2(0x2f5)](a47_0x321bc0[_0x4be0b2(0x340)](_0x4be0b2(0x2fa)+_0x38457b*0x2+_0x4be0b2(0x23b))),await new Promise(_0x5c9698=>setTimeout(_0x5c9698,_0x26a1c1)),_0x38457b++;}_0x38457b>=_0x58ed05&&console[_0x4be0b2(0x2f5)](a47_0x321bc0[_0x4be0b2(0x251)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a47_0x4381f9(0x2bc)](_0x36083d,_0x2ed6a3,_0x1548a6){const _0x2ca259=a47_0x4381f9,_0x3e86cc=[],_0x2813f8=TIMELINE_CONFIG[_0x2ca259(0x1fd)],_0x210a5a=0x5,_0x5ee316=process[_0x2ca259(0x352)][_0x2ca259(0x1f1)]||0x78,_0x4457cd=_0x5ee316-_0x2813f8-_0x210a5a,_0x278784=Math['max'](TIMELINE_CONFIG[_0x2ca259(0x229)],Math[_0x2ca259(0x32c)](_0x4457cd,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x566149=new Date(_0x36083d[_0x2ca259(0x1fc)])[_0x2ca259(0x384)](),_0x27603d=_0x36083d[_0x2ca259(0x20a)]?new Date(_0x36083d[_0x2ca259(0x20a)])[_0x2ca259(0x384)]():Date['now'](),_0x171473={'start':_0x566149,'end':_0x27603d,'duration':_0x27603d-_0x566149},_0x1e1df8=new Map(),_0xdb54dd=[];for(const _0xdef7c9 of _0x2ed6a3){if(_0xdef7c9['startedAt']){const _0x17443d=new Date(_0xdef7c9[_0x2ca259(0x267)])[_0x2ca259(0x384)](),_0x4dd603=_0xdef7c9[_0x2ca259(0x2e0)]?new Date(_0xdef7c9[_0x2ca259(0x2e0)])[_0x2ca259(0x384)]():Date[_0x2ca259(0x307)](),_0x3e2035={'start':_0x17443d,'end':_0x4dd603,'duration':_0x4dd603-_0x17443d};_0x1e1df8[_0x2ca259(0x368)](_0xdef7c9['id'],_0x3e2035),_0xdb54dd[_0x2ca259(0x303)]({'name':_0xdef7c9[_0x2ca259(0x356)],'state':_0xdef7c9[_0x2ca259(0x2ff)]||'unknown','window':_0x3e2035});}else _0xdb54dd[_0x2ca259(0x303)]({'name':_0xdef7c9[_0x2ca259(0x356)],'state':_0xdef7c9[_0x2ca259(0x2ff)]||_0x2ca259(0x331),'window':undefined});}_0xdb54dd[_0x2ca259(0x27c)]((_0x4fe903,_0x261793)=>{const _0x359642=_0x2ca259;if(!_0x4fe903[_0x359642(0x1ff)])return 0x1;if(!_0x261793[_0x359642(0x1ff)])return-0x1;return _0x4fe903[_0x359642(0x1ff)][_0x359642(0x283)]-_0x261793[_0x359642(0x1ff)][_0x359642(0x283)];});const _0x34cde9=_0xdb54dd[_0x2ca259(0x35e)],_0x3367e4=_0x34cde9>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x3367e4&&_0xdb54dd['splice'](TIMELINE_CONFIG[_0x2ca259(0x252)]);const _0xe40870=calculateTimeScale(_0x171473,_0x278784),_0x3038d8=_0x36083d[_0x2ca259(0x350)]?_0x36083d[_0x2ca259(0x2aa)]?a47_0x321bc0[_0x2ca259(0x2df)](_0x2ca259(0x2aa)):a47_0x321bc0[_0x2ca259(0x330)](_0x2ca259(0x2f5)):a47_0x321bc0[_0x2ca259(0x205)]('running'),_0x13d80b=_0x36083d[_0x2ca259(0x26b)]?.['id'],_0x213509=_0x36083d[_0x2ca259(0x2d8)];let _0x73bd1a;if(_0x13d80b&&_0x213509){const _0x5d3650=getWorkflowAttemptUrl(_0x1548a6,_0x13d80b,_0x213509,_0x36083d['id']);_0x73bd1a=hyperlink(a47_0x321bc0[_0x2ca259(0x340)](_0x36083d['id']),_0x5d3650);}else _0x73bd1a=a47_0x321bc0['dim'](_0x36083d['id']);_0x3e86cc[_0x2ca259(0x303)](_0x2ca259(0x2e3)+_0x73bd1a+'\x20-\x20'+_0x3038d8+_0x2ca259(0x2c0)+formatElapsed(_0x171473['duration']));if(_0xdb54dd[_0x2ca259(0x35e)]>0x0){const _0x851c7a=renderTimeAxis(_0xe40870,_0x278784),_0x1107a9=new Date(_0x171473[_0x2ca259(0x283)]),_0x372e73=formatDate(_0x1107a9),_0x1cdd48=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x2ca259(0x34c)]+_0x2813f8,_0x4ae8ee=_0x372e73[_0x2ca259(0x358)](_0x1cdd48),_0x22fcb7=a47_0x321bc0[_0x2ca259(0x340)](_0x4ae8ee);_0x3e86cc[_0x2ca259(0x303)](_0x22fcb7+'\x20'+_0x851c7a);for(const _0x5a0354 of _0xdb54dd){_0x3e86cc['push'](renderTaskRow(_0x5a0354,_0xe40870,_0x278784,_0x2813f8));}const _0x15c162=calculateStats(_0xdb54dd);_0x3e86cc['push'](formatStats(_0x15c162)),_0x3367e4&&_0x3e86cc[_0x2ca259(0x303)](a47_0x321bc0[_0x2ca259(0x251)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x2ca259(0x252)]+_0x2ca259(0x364)+_0x34cde9+'\x20tasks')),_0x3e86cc[_0x2ca259(0x303)](''),_0x3e86cc[_0x2ca259(0x303)](a47_0x321bc0['dim'](_0x2ca259(0x297))+(_0x2ca259(0x318)+_0x36083d['id']+_0x2ca259(0x30d))+a47_0x321bc0['dim'](_0x2ca259(0x2f1)));}else _0x3e86cc[_0x2ca259(0x303)](_0x2ca259(0x276));return _0x3e86cc[_0x2ca259(0x2cd)]('\x0a');}[a47_0x4381f9(0x34f)](_0x52146d,_0x792f24){const _0x1b4e9a=a47_0x4381f9,_0x1b1f44=new Date(_0x52146d['createdAt'])['getTime'](),_0x524b8a=_0x52146d[_0x1b4e9a(0x20a)]?new Date(_0x52146d['finishedAt'])[_0x1b4e9a(0x384)]():Date[_0x1b4e9a(0x307)](),_0x3deb76=_0x524b8a-_0x1b1f44,_0x411476=[];for(const _0x878a59 of _0x792f24){if(_0x878a59[_0x1b4e9a(0x267)]){const _0x118bf3=new Date(_0x878a59[_0x1b4e9a(0x267)])['getTime'](),_0x164815=_0x878a59[_0x1b4e9a(0x2e0)]?new Date(_0x878a59[_0x1b4e9a(0x2e0)])[_0x1b4e9a(0x384)]():Date[_0x1b4e9a(0x307)]();_0x411476[_0x1b4e9a(0x303)]({'name':_0x878a59[_0x1b4e9a(0x356)],'state':_0x878a59['state']||'unknown','window':{'start':_0x118bf3,'end':_0x164815,'duration':_0x164815-_0x118bf3}});}else _0x411476['push']({'name':_0x878a59[_0x1b4e9a(0x356)],'state':_0x878a59[_0x1b4e9a(0x2ff)]||_0x1b4e9a(0x331),'window':undefined});}const _0x5b76fd=calculateStats(_0x411476);return{'attempt':{'id':_0x52146d['id'],'status':_0x52146d[_0x1b4e9a(0x350)]?_0x52146d[_0x1b4e9a(0x2aa)]?_0x1b4e9a(0x2aa):'error':'running','createdAt':_0x52146d['createdAt'],'finishedAt':_0x52146d['finishedAt'],'duration_ms':_0x3deb76},'tasks':_0x411476[_0x1b4e9a(0x230)](_0x240ae2=>({'name':_0x240ae2[_0x1b4e9a(0x231)],'state':_0x240ae2['state'],'startedAt':_0x240ae2[_0x1b4e9a(0x1ff)]?new Date(_0x240ae2[_0x1b4e9a(0x1ff)][_0x1b4e9a(0x283)])[_0x1b4e9a(0x36c)]():null,'updatedAt':_0x240ae2[_0x1b4e9a(0x1ff)]?new Date(_0x240ae2[_0x1b4e9a(0x1ff)][_0x1b4e9a(0x35b)])[_0x1b4e9a(0x36c)]():null,'duration_ms':_0x240ae2[_0x1b4e9a(0x1ff)]?.[_0x1b4e9a(0x2a3)]||null})),'stats':_0x5b76fd};}}
|
|
1
|
+
const a47_0xda8e2=a47_0x45e3;function a47_0x317d(){const _0x4db1e5=['2062332GNnAvB','\x20of\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','💡\x20Tip:\x20Use\x20','✔\x20Clone\x20complete','every','keys','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','push',',\x20Workflow:\x20','workflow:retry','\x20\x20Attempt\x20ID:\x20','get','\x20\x20Project:\x20','format','renderSingleTimeline','workflow:attempts','Attempt\x20ID:\x20','Error:\x20Attempt\x20ID\x20is\x20required','MIN_TIMELINE_WIDTH','Status:\x20','workflow:push','Fetching\x20log\x20files...','red','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x0a✔\x20No\x20changes\x20to\x20push','retryAttempt','indexOf','\x0aApply\x20these\x20changes?','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Source\x20directory\x20is\x20required','rows','cwd','replace','GUTTER','columns','tdx\x20wf\x20attempt\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','skipValidation','includeRetried','renderSessionsTimeline','Getting\x20attempt\x20details...','No\x20sessions\x20found','task','description','jsonl','157443SGbfxD','utf-8','Analyzing\x20project...','getMinutes','Select\x20a\x20session\x20to\x20view\x20timeline:','✔\x20Found\x20','download','Latest\x20session\x20has\x20no\x20attempt','stdout','lastAttempt','parse','title','select','pullProject','Retrying\x20session...','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Session\x20context\x20set\x20to:\x20','kill','Resume\x20from:\x20','473dfIdxs','Target:\x20','fullName','diff','Error:','Target\x20directory:\x20','from','param','padStart','cancelRequested','Getting\x20attempt\x20tasks...','existingProjectId','reason','No\x20matching\x20sessions\x20found','📁\x20','Validation:\x20skipped','delete','split','\x0aClone\x20\x22','\x20unchanged','30WyfNsq','getTime','hasChanges','find','attemptId','workflow:upload','applyPullProject','workflow','targetDir','table','\x22\x20already\x20exists\x20(ID:\x20','fs/promises','duration','Retry\x20a\x20session\x20or\x20attempt','start','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','end','done','sourceProjectName','sourceDir','fill','Cloning\x20to\x20','MAX_POLL_ITERATIONS','cyan','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','✔\x20Project\x20updated','\x0a✔\x20Already\x20up\x20to\x20date','pending','session_id','verbose','filesExtracted','\x1b[1A\x1b[2K','\x20-\x20','3MzwBqA','→\x20New\x20project:\x20','\x20\x20Source:\x20','json','yes','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','startTime','\x20project','max','Downloading\x20project\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','index','workflow:delete','\x0aPolling...\x20(','data','deleteSecret','project','\x20\x20Target:\x20','key','112lgyybc','Listing\x20workflow\x20sessions...','\x20logs','✔\x20Secret\x20\x27','workflowName','autocomplete','parseProjectWorkflowPattern','Listing\x20secrets...','Error:\x20','No\x20log\x20content\x20found','session','length','workflow:workflows','unchanged','type','113456GdApwK','window','\x20modified','Cancelled','Start\x20a\x20workflow\x20run','workflow:tasks','(unknown)','POLL_INTERVAL_MS','List\x20all\x20workflow\x20projects','retryAttemptName','blue','No\x20workflow\x20tdx.json\x20found','summary','error','tasks','substring','log','taskName','Listing\x20workflow\x20projects...','ICON_SPACING','workflow:pull','includes','\x27...','startedAt','\x20(use\x20--limit\x20to\x20show\x20more)','List\x20workflow\x20execution\x20sessions','preparePushProject','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','toLowerCase','Pushing\x20project...','targetExists','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','resolveProject','success','total','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','filter','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','readFile','Tip:\x20cd\x20to\x20workflows/','Setting\x20secret...','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0a✔\x20Attempt\x20complete','resolveProjectId','relative','showWorkflowConsoleUrl','Filter:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','\x20\x20Location:\x20','Key:\x20','generateSessionTimelineRows','fromTask','basename','listSecrets','/sessions/','output','match','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','run','createdAt','\x20(system)','\x0aDry\x20run\x20-\x20nothing\x20pushed','retrySession','Pulling\x20project\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Params:\x20','Project:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Select\x20a\x20workflow\x20to\x20run','planned','deleted','Force:\x20yes','pollTimeline','\x20\x20Project\x20ID:\x20','Project\x20name:\x20','attempt','TASK_NAME_WIDTH','workflow:kill','\x0aFailed\x20to\x20fetch\x20attempt\x20data','LABEL_MIN_SPACING','✔\x20Project:\x20','list','/attempt/','getDate','map','min','isNewProject','requireProject','Downloading\x20logs...','\x20\x20Revision:\x20','canceling','dryRun','Show\x20logs\x20for\x20a\x20workflow\x20attempt','isTTY','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','projects','Project\x20name\x20is\x20required','Attempt:\x20','finishedAt','newProjectId','revision:\x20','resolveProjectDir','3414188vbvCoY','✔\x20Push\x20complete','executeCloneProject','Error:\x20Secret\x20key\x20is\x20required','workflow:use','Listing\x20workflows...','icon','site','\x20\x20Console:\x20','Pattern:\x20','workflow:download','context','✔\x20Pushed\x20','⚠\x20Showing\x20first\x20','Session\x20','Using\x20attempt\x20','green','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x20attempt','has','sys','prepareCloneProject','\x20\x20Changes:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','updatedAt','64495aVVtqS','execute','\x20\x20Session\x20ID:\x20','...','getFullYear','floor','newProjectName','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','176560JtJcKW','startsWith','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20sessions\x20with\x20timing\x20information','params','\x20new','Reason:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','navigateSessionsInteractive','No\x20sessions\x20found\x20for:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','stat','No\x20attempts\x20found','No\x20workflow\x20projects\x20found','\x20is\x20not\x20a\x20directory','\x20\x20New\x20attempt\x20ID:\x20','changes','localeCompare','Session\x20not\x20found:\x20','executePushProject','No\x20attempts\x20found\x20for:\x20','Auto-selected\x20latest\x20session:\x20','workflow:clone','revision','Starting\x20workflow\x20run...','yellow','Listing\x20workflow\x20attempts...','\x20has\x20no\x20attempts','Updating\x20','\x20to\x20see\x20detailed\x20logs','state','workflows','workflow:attempt','resumeFrom','\x20task','🔄\x20','projectId','Select\x20a\x20task\x20to\x20view\x20logs:','\x20tasks','setSecret','From\x20task:\x20','sessions','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Invalid\x20format:\x20','sessionId','group_error','buildTimelineData','durationMs','follow','Loading\x20session...','logs','resolve','Retrying\x20attempt...','sort','metadata','modified','set','unknown','\x20from\x20session\x20','fileCount','all','dim','renderTimeline','toISOString','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20tdx\x20wf\x20use\x20<project>','workflow:secrets:set','Pull\x20workflow\x20project\x20to\x20local\x20folder','→\x20Project:\x20','9540774hvfCPa','Revision:\x20','\x20workflow','Killing\x20attempt...','Dry\x20run:\x20yes','\x27\x20from\x20project\x20\x27','Files\x20to\x20upload:\x20','\x0aError:','Include\x20retried:\x20yes','Show\x20tasks\x20for\x20an\x20attempt','List\x20workflows','LABEL_WIDTH_DIVISOR','.\x20Expected\x20format:\x20KEY=VALUE','running','MAX_LABEL_COUNT','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','workflowProject','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Error:\x20KEY=VALUE\x20is\x20required','No\x20workflow\x20sessions\x20found','name','getHours','No\x20sessions\x20found\x20in\x20project:\x20','Project\x20filter:\x20','isDirectory','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Source:\x20','Output\x20directory:\x20','join','projectName','Usage:\x20tdx\x20wf\x20use\x20<project>','Warning:','displayLine','attempt:','splice','slice','Source\x20directory:\x20','New\x20project\x20name:\x20','path','ICON_WIDTH','Loading\x20workflows...','round','repeat','\x20\x20Files\x20extracted:\x20','Failed\x20to\x20fetch\x20attempt\x20data','write','now','limit','-\x20nothing\x20pushed','Filter:\x20project=','stringify','workflow:projects','sessionTime','workflow:secrets:list','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','No\x20attempts\x20found\x20in\x20project:\x20','Workflow:\x20','logFiles','/app/workflows/','Deleting\x20project\x20','MAX_TASKS_DISPLAY','Error:\x20Project\x20name\x20is\x20required','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getMonth','No\x20workflows\x20found','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Kill\x20a\x20running\x20attempt','message','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)'];a47_0x317d=function(){return _0x4db1e5;};return a47_0x317d();}(function(_0x19259e,_0x242009){const _0x2e6cc6=a47_0x45e3,_0x4ad2d4=_0x19259e();while(!![]){try{const _0x20b91e=parseInt(_0x2e6cc6(0x162))/0x1+-parseInt(_0x2e6cc6(0x131))/0x2+parseInt(_0x2e6cc6(0x1ab))/0x3*(parseInt(_0x2e6cc6(0x85))/0x4)+parseInt(_0x2e6cc6(0x9e))/0x5*(parseInt(_0x2e6cc6(0x189))/0x6)+-parseInt(_0x2e6cc6(0x1cd))/0x7*(-parseInt(_0x2e6cc6(0x1be))/0x8)+parseInt(_0x2e6cc6(0xec))/0x9+parseInt(_0x2e6cc6(0xa6))/0xa*(-parseInt(_0x2e6cc6(0x175))/0xb);if(_0x20b91e===_0x242009)break;else _0x4ad2d4['push'](_0x4ad2d4['shift']());}catch(_0x5e7ba6){_0x4ad2d4['push'](_0x4ad2d4['shift']());}}}(a47_0x317d,0x8bacd));import a47_0x1cdfef from'chalk';import{existsSync}from'fs';import a47_0x405fdf from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a47_0x5d0169 from'prompts';function getAttemptStatusDisplay(_0xaceebd){const _0x3dc012=a47_0x45e3;if(!_0xaceebd)return{'icon':'⏳','text':''};const {done:_0x349785,success:_0x4b8982,cancelRequested:_0xbfa726}=_0xaceebd;if(!_0x349785)return _0xbfa726?{'icon':'🛑','text':a47_0x1cdfef[_0x3dc012(0xbf)]('canceling')}:{'icon':'🔄','text':a47_0x1cdfef[_0x3dc012(0x1d7)](_0x3dc012(0xf9))};if(_0x4b8982)return{'icon':'✅','text':a47_0x1cdfef['green'](_0x3dc012(0x1ee))};return{'icon':'❌','text':a47_0x1cdfef[_0x3dc012(0x149)](_0x3dc012(0x1da))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0xbdb071,_0x144198,_0x1a9ad0=0x0){return _0xbdb071[_0x1a9ad0]||_0x144198['workflowProject'];}['requireProject'](_0x49c660,_0x1b6847,_0x73a769=0x0){const _0x5219dc=a47_0x45e3,_0x4316b2=this[_0x5219dc(0x1ed)](_0x49c660,_0x1b6847,_0x73a769);if(!_0x4316b2)return console[_0x5219dc(0x1da)](a47_0x1cdfef[_0x5219dc(0x149)]('Error:'),_0x5219dc(0x7f)),console[_0x5219dc(0x1da)](a47_0x1cdfef[_0x5219dc(0xe3)](_0x5219dc(0x1b5))),null;return _0x4316b2;}['parseProjectWorkflowPattern'](_0x142331,_0x5e32e3){const _0x48b392=a47_0x45e3;if(_0x142331[0x0]){const _0x3ad7de=_0x142331[0x0]['split']('.');if(_0x3ad7de[_0x48b392(0x1c9)]===0x1)return{'projectName':_0x3ad7de[0x0],'workflowName':undefined};else return _0x3ad7de[_0x48b392(0x1c9)]===0x2?{'projectName':_0x3ad7de[0x0],'workflowName':_0x3ad7de[0x1]}:(console['error'](a47_0x1cdfef[_0x48b392(0x149)](_0x48b392(0x179)),_0x48b392(0x151)),null);}return{'projectName':_0x5e32e3[_0x48b392(0xfc)],'workflowName':undefined};}[a47_0xda8e2(0x84)](_0x57fc96,_0x54d905,_0x282bc5=0x0){const _0x4b259=a47_0xda8e2;if(_0x57fc96[_0x282bc5])return _0x57fc96[_0x282bc5];if(_0x54d905[_0x4b259(0xfc)]){const _0x188cc8=a47_0x405fdf[_0x4b259(0x108)](process['cwd'](),'workflows',_0x54d905['workflowProject']);if(existsSync(a47_0x405fdf[_0x4b259(0x108)](_0x188cc8,'tdx.json')))return _0x188cc8;}return undefined;}async['showWorkflowConsoleUrl'](_0x14f2da,_0x3c0716,_0x55c6e1){const _0x53a076=a47_0xda8e2;try{const _0x39de13=await _0x14f2da[_0x53a076(0x190)][_0x53a076(0xc5)](_0x3c0716,{'limit':0x1});if(_0x39de13[_0x53a076(0x1c9)]>0x0){const _0x47b4c7=_0x39de13[0x0]['id'],_0x505803=getWorkflowUrl(_0x55c6e1,_0x47b4c7);console[_0x53a076(0x1da)]('\x20\x20Console:\x20'+a47_0x1cdfef[_0x53a076(0x1a1)](_0x505803));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a47_0xda8e2(0x89);[a47_0xda8e2(0x160)]=a47_0xda8e2(0x210);async[a47_0xda8e2(0x9f)](_0x21ac31){const _0x167a58=a47_0xda8e2,{options:_0x11cfac,args:_0x58ae24,tdx:_0x4bc7a7}=_0x21ac31,_0x565459=_0x58ae24[0x0],_0xc55659=_0x11cfac['clear'];if(_0xc55659)return saveSessionContext({'workflow_project':undefined},_0x11cfac[_0x167a58(0x1c8)]),console[_0x167a58(0x1dd)](a47_0x1cdfef[_0x167a58(0x95)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x565459)return console[_0x167a58(0x1da)](a47_0x1cdfef[_0x167a58(0x149)](_0x167a58(0x179)),_0x167a58(0x7f)),console[_0x167a58(0x1da)](a47_0x1cdfef[_0x167a58(0xe3)](_0x167a58(0x10a))),console[_0x167a58(0x1da)](a47_0x1cdfef[_0x167a58(0xe3)](_0x167a58(0x1b0))),0x1;const _0x4a04d5=await withSpinner('Resolving\x20project\x20\x27'+_0x565459+_0x167a58(0x1e3),()=>_0x4bc7a7['workflow'][_0x167a58(0x1f8)](_0x565459),{'verbose':_0x11cfac[_0x167a58(0x1a7)]}),{name:_0x25d2ca}=_0x4a04d5['data'];return saveSessionContext({'workflow_project':_0x25d2ca},_0x11cfac[_0x167a58(0x1c8)]),console[_0x167a58(0x1dd)](a47_0x1cdfef[_0x167a58(0x95)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a47_0x1cdfef[_0x167a58(0x1a1)](_0x25d2ca))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x11f);['description']=a47_0xda8e2(0x1d5);async['execute'](_0x414aa0){const _0x4dca55=a47_0xda8e2,{options:_0x5831bf,args:_0xfb5141,tdx:_0x2b6d09}=_0x414aa0,_0x58323e=_0xfb5141[0x0];_0x5831bf[_0x4dca55(0x1a7)]&&_0x58323e&&console['error'](_0x4dca55(0x8e)+_0x58323e);const _0x149a58=await withSpinner(_0x4dca55(0x1df),()=>_0x2b6d09[_0x4dca55(0x190)][_0x4dca55(0x7e)](_0x58323e,{'limit':_0x5831bf['limit']}),{'verbose':_0x5831bf['verbose']});let _0xc14fa3=_0x149a58['data'];_0xc14fa3[_0x4dca55(0xdb)]((_0xa0a3a4,_0x2563a0)=>_0xa0a3a4[_0x4dca55(0x100)][_0x4dca55(0xb7)](_0x2563a0[_0x4dca55(0x100)]));const _0x5776e9=_0x5831bf[_0x4dca55(0x11b)]||0x64,_0x3813d8=_0xc14fa3[_0x4dca55(0x1c9)]>=_0x5776e9?a47_0x1cdfef[_0x4dca55(0xe3)](_0x4dca55(0x1e5)):'';console[_0x4dca55(0x1da)](_0x4dca55(0x167)+_0xc14fa3[_0x4dca55(0x1c9)]+_0x4dca55(0x1b2)+(_0xc14fa3['length']!==0x1?'s':'')+_0x3813d8);if(_0x5831bf['format']===_0x4dca55(0x1ae)||_0x5831bf['format']==='jsonl'||_0x5831bf[_0x4dca55(0x140)]==='table')await handleSDKOutput(_0xc14fa3,_0x5831bf);else{if(_0xc14fa3['length']===0x0)_0x58323e?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x58323e):console[_0x4dca55(0x1dd)](_0x4dca55(0xb3));else{const _0x48a96b=_0xc14fa3[_0x4dca55(0x221)](_0x44de34=>{const _0x8acb92=_0x4dca55,_0x407804=_0x44de34[_0x8acb92(0xdc)]?.['some'](_0x46cfa7=>_0x46cfa7[_0x8acb92(0x1bd)]===_0x8acb92(0x99)),_0x344bbd=_0x407804?a47_0x1cdfef[_0x8acb92(0xe3)](_0x8acb92(0x209)):'';return _0x8acb92(0x183)+_0x44de34['name']+_0x344bbd;});await writeOutput(_0x48a96b[_0x4dca55(0x108)]('\x0a'),_0x5831bf[_0x4dca55(0x204)],_0x4dca55(0x21e));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x1ca);[a47_0xda8e2(0x160)]=a47_0xda8e2(0xf6);async[a47_0xda8e2(0x9f)](_0x2ac1af){const _0x4ecce5=a47_0xda8e2,{options:_0x34144a,args:_0xc52752,tdx:_0x3187ca}=_0x2ac1af,_0x2fe236=this[_0x4ecce5(0x1ed)](_0xc52752,_0x34144a);_0x34144a[_0x4ecce5(0x1a7)]&&_0x2fe236&&console[_0x4ecce5(0x1da)](_0x4ecce5(0x103)+_0x2fe236);const _0x4808bd=await withSpinner(_0x4ecce5(0x8a),()=>_0x3187ca[_0x4ecce5(0x190)][_0x4ecce5(0xc5)](_0x2fe236,{'limit':_0x34144a['limit']}),{'verbose':_0x34144a[_0x4ecce5(0x1a7)]});let _0x386403=_0x4808bd[_0x4ecce5(0x1b9)];_0x386403['sort']((_0x120734,_0x2aa89f)=>{const _0x4c3f61=_0x4ecce5,_0x7c9eb2=_0x120734[_0x4c3f61(0x100)]['localeCompare'](_0x2aa89f['name']);if(_0x7c9eb2!==0x0)return _0x7c9eb2;return(_0x120734[_0x4c3f61(0x1bb)]?.[_0x4c3f61(0x100)]||'')[_0x4c3f61(0xb7)](_0x2aa89f[_0x4c3f61(0x1bb)]?.[_0x4c3f61(0x100)]||'');});const _0xb22844=_0x34144a['limit']||0x64,_0x5d1835=_0x386403[_0x4ecce5(0x1c9)]>=_0xb22844?a47_0x1cdfef[_0x4ecce5(0xe3)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x4ecce5(0x1da)]('✔\x20Found\x20'+_0x386403['length']+_0x4ecce5(0xee)+(_0x386403[_0x4ecce5(0x1c9)]!==0x1?'s':'')+_0x5d1835);if(_0x34144a[_0x4ecce5(0x140)]===_0x4ecce5(0x1ae)||_0x34144a[_0x4ecce5(0x140)]==='jsonl'||_0x34144a[_0x4ecce5(0x140)]===_0x4ecce5(0x192))await handleSDKOutput(_0x386403,_0x34144a);else{if(_0x386403[_0x4ecce5(0x1c9)]===0x0)_0x2fe236?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x2fe236):console[_0x4ecce5(0x1dd)](_0x4ecce5(0x12c));else{const _0x2083b0=_0x34144a[_0x4ecce5(0x8c)],_0x3334fb=_0x386403['map'](_0x4a8a25=>{const _0xee9575=_0x4ecce5,_0x5618f2=a47_0x1cdfef[_0xee9575(0xe3)]('#'+_0x4a8a25['id']),_0x192fce=hyperlink(_0x5618f2,getWorkflowUrl(_0x2083b0,_0x4a8a25['id'])),_0x474f83=_0x4a8a25[_0xee9575(0x1bb)]?.['name']?a47_0x1cdfef[_0xee9575(0xe3)]('\x20('+_0x4a8a25[_0xee9575(0x1bb)][_0xee9575(0x100)]+')'):'';return'📋\x20'+_0x192fce+'\x20'+_0x4a8a25['name']+_0x474f83;});await writeOutput(_0x3334fb[_0x4ecce5(0x108)]('\x0a'),_0x34144a[_0x4ecce5(0x204)],_0x4ecce5(0x21e));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';['description']=a47_0xda8e2(0x1e6);async[a47_0xda8e2(0x9f)](_0x1602b3){const _0x5529c8=a47_0xda8e2,{options:_0x1a83c7,args:_0x251315,tdx:_0x29386c}=_0x1602b3,_0x425b02=this[_0x5529c8(0x1c4)](_0x251315,_0x1a83c7);if(!_0x425b02)return 0x1;const {projectName:_0x5ed9d9,workflowName:_0x5d033a}=_0x425b02;if(_0x1a83c7['verbose']){if(_0x5ed9d9&&_0x5d033a)console[_0x5529c8(0x1da)](_0x5529c8(0x1fb)+_0x5ed9d9+'.'+_0x5d033a);else _0x5ed9d9&&console[_0x5529c8(0x1da)](_0x5529c8(0x11d)+_0x5ed9d9);const _0x40685c=_0x1a83c7['status'];_0x40685c&&console[_0x5529c8(0x1da)](_0x5529c8(0x146)+_0x40685c);}let _0xbe9e10=0x28;if(process['stdout'][_0x5529c8(0x22a)]&&!_0x1a83c7[_0x5529c8(0x204)]&&!_0x1a83c7[_0x5529c8(0x140)]){const _0x2c89b6=process['stdout'][_0x5529c8(0x153)]||0x28;_0xbe9e10=Math[_0x5529c8(0x1b3)](0x14,Math['floor'](_0x2c89b6*0x2/0x3));}const _0x10afe9=_0x1a83c7[_0x5529c8(0x11b)]||_0xbe9e10,_0x36cc27=await withSpinner(_0x5529c8(0x1bf),()=>_0x29386c['workflow'][_0x5529c8(0xcf)]({'projectName':_0x5ed9d9,'workflowName':_0x5d033a,'status':_0x1a83c7['status'],'fromTime':_0x1a83c7[_0x5529c8(0x17b)],'toTime':_0x1a83c7['to'],'limit':_0x10afe9}),{'verbose':_0x1a83c7[_0x5529c8(0x1a7)]}),_0x9a5194=_0x36cc27[_0x5529c8(0x1b9)];_0x9a5194[_0x5529c8(0xdb)]((_0x2854a8,_0x2fc8c9)=>{const _0x176bbb=_0x5529c8,_0x10eef2=_0x2854a8['sessionTime']||'',_0x42151d=_0x2fc8c9[_0x176bbb(0x120)]||'';return _0x42151d[_0x176bbb(0xb7)](_0x10eef2);});_0x9a5194['length']>=_0x10afe9?console[_0x5529c8(0x1da)]('✔\x20Showing\x20'+_0x9a5194[_0x5529c8(0x1c9)]+'\x20sessions\x20'+a47_0x1cdfef[_0x5529c8(0xe3)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x5529c8(0x167)+_0x9a5194[_0x5529c8(0x1c9)]+'\x20session'+(_0x9a5194[_0x5529c8(0x1c9)]!==0x1?'s':''));if(_0x1a83c7[_0x5529c8(0x140)]===_0x5529c8(0x1ae)||_0x1a83c7[_0x5529c8(0x140)]===_0x5529c8(0x161)||_0x1a83c7['format']===_0x5529c8(0x192))await handleSDKOutput(_0x9a5194,_0x1a83c7);else{if(!process[_0x5529c8(0x16a)][_0x5529c8(0x22a)]||_0x1a83c7['output']){if(_0x9a5194[_0x5529c8(0x1c9)]===0x0){if(_0x5ed9d9&&_0x5d033a)console['log'](_0x5529c8(0xaf)+_0x5ed9d9+'.'+_0x5d033a);else _0x5ed9d9?console[_0x5529c8(0x1dd)](_0x5529c8(0x102)+_0x5ed9d9):console['log']('No\x20sessions\x20found');}else{const _0x3a350e=_0x1a83c7[_0x5529c8(0x8c)],_0x59acb1=this[_0x5529c8(0x15c)](_0x9a5194,_0x3a350e);_0x1a83c7['output']?await writeOutput(_0x59acb1,_0x1a83c7['output'],_0x5529c8(0x21e)):console[_0x5529c8(0x1dd)](_0x59acb1);}!_0x5ed9d9&&(console['error'](''),console[_0x5529c8(0x1da)](a47_0x1cdfef[_0x5529c8(0xe3)](_0x5529c8(0x12d))),console[_0x5529c8(0x1da)](a47_0x1cdfef[_0x5529c8(0xe3)](_0x5529c8(0xe7))+'or'+a47_0x1cdfef[_0x5529c8(0xe3)](_0x5529c8(0xe8))));}else{if(_0x9a5194[_0x5529c8(0x1c9)]===0x0){if(_0x5ed9d9&&_0x5d033a)console['log'](_0x5529c8(0xaf)+_0x5ed9d9+'.'+_0x5d033a);else _0x5ed9d9?console['log'](_0x5529c8(0x102)+_0x5ed9d9):console['log'](_0x5529c8(0x15e));}else await this[_0x5529c8(0xae)](_0x9a5194,_0x1602b3,_0x5ed9d9);}}return 0x0;}[a47_0xda8e2(0x15c)](_0x322c62,_0x24add7){const _0x319a1c=a47_0xda8e2,_0x3a5104=[],_0x38f248=new Map();let _0x3c9a23=Infinity,_0x4a399f=-Infinity;for(const _0x3233cc of _0x322c62){if(_0x3233cc[_0x319a1c(0x16b)]?.['createdAt']){const _0x307560=new Date(_0x3233cc[_0x319a1c(0x16b)]['createdAt'])['getTime'](),_0x29b8ad=_0x3233cc[_0x319a1c(0x16b)]['finishedAt']?new Date(_0x3233cc[_0x319a1c(0x16b)]['finishedAt'])[_0x319a1c(0x18a)]():Date[_0x319a1c(0x11a)](),_0x548393=_0x3233cc[_0x319a1c(0x1bb)]?.[_0x319a1c(0x100)]||_0x319a1c(0x1d3);!_0x38f248[_0x319a1c(0x98)](_0x548393)&&_0x38f248['set'](_0x548393,[]),_0x38f248['get'](_0x548393)[_0x319a1c(0x13a)]({'session':_0x3233cc,'startTime':_0x307560,'endTime':_0x29b8ad,'duration':_0x29b8ad-_0x307560}),_0x3c9a23=Math[_0x319a1c(0x222)](_0x3c9a23,_0x307560),_0x4a399f=Math[_0x319a1c(0x1b3)](_0x4a399f,_0x29b8ad);}}if(_0x38f248['size']===0x0)return _0x319a1c(0xa9);const _0x40a25d=process[_0x319a1c(0x16a)][_0x319a1c(0x157)]||0x78,_0x383cd3=0x1e,_0x104af6=0x32,_0x27a5f2=0x4,_0x654684=Math[_0x319a1c(0x222)](_0x104af6,Math[_0x319a1c(0x1b3)](_0x383cd3,Math[_0x319a1c(0xa3)](_0x40a25d*0.3))),_0x413859=_0x40a25d-_0x654684-TIMELINE_CONFIG[_0x319a1c(0x156)]-0x3-_0x27a5f2,_0x7215da=_0x4a399f-_0x3c9a23,_0x168521=_0x7215da/_0x654684,_0x351319=renderTimeAxis({'startTime':_0x3c9a23,'endTime':_0x4a399f,'durationMs':_0x7215da,'msPerChar':_0x168521},_0x654684),_0x3a096b=[];for(const _0x865c3f of _0x38f248['values']()){_0x3a096b[_0x319a1c(0x13a)](..._0x865c3f);}_0x3a096b[_0x319a1c(0xdb)]((_0x28ed8f,_0x3fbb1f)=>_0x3fbb1f[_0x319a1c(0x1b1)]-_0x28ed8f[_0x319a1c(0x1b1)]);const _0x36a93a=new Date(_0x3c9a23),_0x182ad4=formatDate(_0x36a93a),_0x958078=_0x27a5f2+TIMELINE_CONFIG[_0x319a1c(0x113)]+TIMELINE_CONFIG[_0x319a1c(0x1e0)]+_0x413859,_0xb28411='\x20'[_0x319a1c(0x116)](_0x958078-_0x182ad4['length']),_0x4cf20=_0xb28411+a47_0x1cdfef[_0x319a1c(0xe3)](_0x182ad4)+'\x20'+_0x351319;_0x3a5104[_0x319a1c(0x13a)](_0x4cf20);const _0x4a5d37=0x16;let _0x5055de=0x0;for(const _0x367973 of _0x3a096b){const _0x31bfeb=_0x367973[_0x319a1c(0x1c8)][_0x319a1c(0x1bb)]?.[_0x319a1c(0x100)]||'?',_0x25b243=Math['min'](stringWidth(_0x31bfeb),_0x4a5d37);_0x5055de=Math[_0x319a1c(0x1b3)](_0x5055de,_0x25b243);}for(const _0x355324 of _0x3a096b){const {session:_0x407937,startTime:_0x4d7b41,endTime:_0x288d45,duration:_0x3c8aa4}=_0x355324,_0x25583a=_0x407937['project']?.['id'],_0x10becb=_0x407937['id'],_0x515167=_0x407937[_0x319a1c(0x1bb)]?.[_0x319a1c(0x100)]||'?',_0x1a591b=_0x407937[_0x319a1c(0x190)]?.[_0x319a1c(0x100)]||'?';let _0x38cc8e,_0x319cf0;if(_0x407937[_0x319a1c(0x16b)]){const _0x5e4c32=_0x407937[_0x319a1c(0x16b)];!_0x5e4c32[_0x319a1c(0x19b)]?(_0x38cc8e=_0x5e4c32[_0x319a1c(0x17e)]?'🛑':'🔄',_0x319cf0=_0x5e4c32[_0x319a1c(0x17e)]?a47_0x1cdfef[_0x319a1c(0xbf)]:a47_0x1cdfef['blue']):(_0x38cc8e=_0x5e4c32[_0x319a1c(0x1ee)]?'✅':'❌',_0x319cf0=_0x5e4c32['success']?a47_0x1cdfef['green']:a47_0x1cdfef['red']);}else _0x38cc8e='⏳',_0x319cf0=a47_0x1cdfef[_0x319a1c(0xe3)];const _0x1ef6d9='#'+_0x10becb,_0x400f52=_0x25583a?hyperlink(_0x1ef6d9,getWorkflowSessionUrl(_0x24add7,_0x25583a,_0x10becb)):_0x1ef6d9;let _0x956e80=_0x515167;stringWidth(_0x515167)>_0x4a5d37&&(_0x956e80=_0x515167[_0x319a1c(0x10f)](0x0,_0x4a5d37-0x1)+'…');const _0x26ed24=a47_0x1cdfef[_0x319a1c(0xe3)](_0x956e80),_0x296994=stringWidth(_0x956e80),_0x4d165f='\x20'[_0x319a1c(0x116)](_0x5055de-stringWidth(_0x956e80)+0x2),_0xac71ae='('+formatElapsed(_0x3c8aa4)+')',_0x1c72b8=stringWidth(_0xac71ae),_0x467bab=stringWidth(_0x1ef6d9),_0x1e5a81=_0x467bab+0x1+_0x296994+_0x4d165f[_0x319a1c(0x1c9)],_0x4af877=_0x413859-_0x1e5a81-_0x1c72b8-0x1-0x8;let _0x4a6496=_0x1a591b;stringWidth(_0x4a6496)>_0x4af877&&(_0x4a6496=_0x4a6496[_0x319a1c(0x10f)](0x0,_0x4af877-0x1)+'…');const _0x1753d2=_0x400f52+'\x20'+_0x26ed24+_0x4d165f+_0x4a6496,_0x4b3a99=stringWidth(_0x1753d2),_0x57267a=_0x413859-_0x4b3a99-_0x1c72b8,_0x4fe5af=_0x1753d2+'\x20'[_0x319a1c(0x116)](Math[_0x319a1c(0x1b3)](0x1,_0x57267a))+a47_0x1cdfef[_0x319a1c(0xe3)](_0xac71ae),_0x4d67ff=Math['floor']((_0x4d7b41-_0x3c9a23)/_0x168521),_0x16f286=Math[_0x319a1c(0xa3)]((_0x288d45-_0x3c9a23)/_0x168521),_0x136008=Math[_0x319a1c(0x1b3)](_0x4d67ff+0x1,_0x16f286),_0x5b03ec=new Array(_0x654684)['fill']('\x20');for(let _0x37cd36=_0x4d67ff;_0x37cd36<Math['min'](_0x136008,_0x654684);_0x37cd36++){_0x5b03ec[_0x37cd36]='─';}const _0x595698=_0x5b03ec[_0x319a1c(0x221)](_0x155742=>_0x155742==='\x20'?'\x20':_0x319cf0(_0x155742))[_0x319a1c(0x108)]('');_0x3a5104[_0x319a1c(0x13a)](_0x38cc8e+'\x20'+_0x4fe5af+'│'+_0x595698+'│');}return _0x3a5104[_0x319a1c(0x108)]('\x0a');}async[a47_0xda8e2(0xae)](_0x19eb8b,_0x3c4e3b,_0x553e42){const _0x1f3e4e=a47_0xda8e2,{options:_0x529e04,tdx:_0x465eea}=_0x3c4e3b,_0x419828=_0x529e04['site'],{timelineRows:_0x4b94cc,timeAxisHeader:_0x47afc7}=this[_0x1f3e4e(0x1ff)](_0x19eb8b,_0x419828),_0xd3460f=_0x4b94cc['filter'](_0x3fd4b8=>_0x3fd4b8['attemptId']);if(_0xd3460f[_0x1f3e4e(0x1c9)]===0x0){const _0x1c7ae9=this[_0x1f3e4e(0x15c)](_0x19eb8b,_0x419828);console[_0x1f3e4e(0x1dd)](_0x1c7ae9);!_0x553e42&&(console['error'](''),console['error'](a47_0x1cdfef[_0x1f3e4e(0xe3)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x1f3e4e(0x1da)](a47_0x1cdfef[_0x1f3e4e(0xe3)](_0x1f3e4e(0xe7))+'or'+a47_0x1cdfef[_0x1f3e4e(0xe3)](_0x1f3e4e(0xe8))));return;}_0x47afc7&&console[_0x1f3e4e(0x1dd)](_0x47afc7);const _0x182d74=_0x4b94cc[_0x1f3e4e(0x1f1)](_0x22c229=>_0x22c229[_0x1f3e4e(0x18d)])[_0x1f3e4e(0x221)](_0xed0383=>({'title':_0xed0383[_0x1f3e4e(0x10c)],'value':_0xed0383['attemptId']})),_0x528d16=process[_0x1f3e4e(0x16a)][_0x1f3e4e(0x153)]||0x3c,_0x29b95a=Math['max'](0x28,Math[_0x1f3e4e(0xa3)](_0x528d16*0x2/0x3)),_0x806da9=await a47_0x5d0169({'type':_0x1f3e4e(0x1c3),'name':_0x1f3e4e(0x18d),'message':_0x1f3e4e(0x130),'choices':_0x182d74,'initial':-0x1,'limit':_0x29b95a,'clearFirst':!![],'fallback':{'title':_0x1f3e4e(0x182),'value':null},'suggest':(_0x4ba359,_0x116863)=>{const _0xcb39a7=_0x1f3e4e;if(!_0x4ba359)return Promise[_0xcb39a7(0xd9)](_0x116863);const _0x481910=_0x116863[_0xcb39a7(0x1f1)](_0x16ed63=>{const _0x44e1df=_0xcb39a7,_0x49f12a=_0x16ed63;return _0x49f12a[_0x44e1df(0x16d)][_0x44e1df(0x1e9)]()[_0x44e1df(0x1e2)](_0x4ba359[_0x44e1df(0x1e9)]());});return Promise['resolve'](_0x481910);}}),_0x4d4a04=()=>{const _0x3d3076=_0x1f3e4e;process[_0x3d3076(0x16a)][_0x3d3076(0x119)]('\x1b[1A\x1b[2K'),process[_0x3d3076(0x16a)][_0x3d3076(0x119)]('\x1b[1A\x1b[2K'),process[_0x3d3076(0x16a)][_0x3d3076(0x119)](_0x3d3076(0x1a9));},_0x1a78db=_0x806da9&&_0x806da9['attemptId']&&_0x806da9[_0x1f3e4e(0x18d)]!==null&&_0x806da9[_0x1f3e4e(0x18d)]['trim']()!=='';if(!_0x1a78db){_0x4d4a04(),console[_0x1f3e4e(0x1dd)](a47_0x1cdfef['dim']('Cancelled'));return;}_0x4d4a04();const _0x5c99b9=_0x19eb8b['find'](_0x3ac407=>_0x3ac407[_0x1f3e4e(0x16b)]?.['id']===_0x806da9['attemptId']);if(_0x5c99b9){const _0x1ef887=_0x5c99b9[_0x1f3e4e(0x1bb)]?.[_0x1f3e4e(0x100)]||'?',_0x1d5598=_0x5c99b9[_0x1f3e4e(0x190)]?.[_0x1f3e4e(0x100)]||'?';console[_0x1f3e4e(0x1dd)](_0x1f3e4e(0x20f)+a47_0x1cdfef[_0x1f3e4e(0xe3)](_0x1ef887)+_0x1f3e4e(0x13b)+a47_0x1cdfef['dim'](_0x1d5598));}const _0xe9e8f7=new WorkflowTimelineCommand();await _0xe9e8f7[_0x1f3e4e(0x9f)]({'args':[],'options':{..._0x529e04,'attemptId':_0x806da9['attemptId']},'tdx':_0x465eea});}['generateSessionTimelineRows'](_0x2cceb1,_0x53ce7f){const _0x76cf0a=a47_0xda8e2,_0x729cd6=new Map();for(const _0x4e0781 of _0x2cceb1){_0x4e0781['id']&&_0x4e0781['lastAttempt']?.['id']&&_0x729cd6['set'](_0x4e0781['id'],_0x4e0781[_0x76cf0a(0x16b)]['id']);}const _0x1d0f55=[];let _0x16cab7='';const _0x5f4c4c=this[_0x76cf0a(0x15c)](_0x2cceb1,_0x53ce7f),_0x2e4b56=_0x5f4c4c[_0x76cf0a(0x186)]('\x0a');for(const _0x210b13 of _0x2e4b56){if(_0x210b13['startsWith'](_0x76cf0a(0x1e8))||_0x210b13[_0x76cf0a(0x205)](/^\s+\d{4}-\d{2}-\d{2}/))_0x16cab7=_0x210b13;else{if(_0x210b13[_0x76cf0a(0x205)](/^[✅❌🔄🛑⏳]/)){const _0xf3879c=_0x210b13[_0x76cf0a(0x205)](/#(\d+)/),_0xbaf62a=_0xf3879c?_0xf3879c[0x1]:null,_0x252582=_0xbaf62a?_0x729cd6[_0x76cf0a(0x13e)](_0xbaf62a)||null:null,_0x49e566=_0x2cceb1[_0x76cf0a(0x18c)](_0x5ab44a=>_0x5ab44a['id']===_0xbaf62a),_0x40bf06=_0x49e566?.[_0x76cf0a(0x1bb)]?.['name']||'';_0x1d0f55['push']({'displayLine':_0x210b13,'attemptId':_0x252582,'projectName':_0x40bf06});}}}return{'timelineRows':_0x1d0f55,'timeAxisHeader':_0x16cab7};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x142);[a47_0xda8e2(0x160)]='List\x20workflow\x20attempts';async['execute'](_0x3addd5){const _0x4a34ee=a47_0xda8e2,{options:_0x36d09d,args:_0x54c7a2,tdx:_0x66fe94}=_0x3addd5,_0x3443dd=this['parseProjectWorkflowPattern'](_0x54c7a2,_0x36d09d);if(!_0x3443dd)return 0x1;const {projectName:_0x365cdd,workflowName:_0x3b4b28}=_0x3443dd,_0x15dac0=_0x36d09d[_0x4a34ee(0x15b)];if(_0x36d09d['verbose']){if(_0x365cdd&&_0x3b4b28)console[_0x4a34ee(0x1da)](_0x4a34ee(0x1fb)+_0x365cdd+'.'+_0x3b4b28);else _0x365cdd&&console[_0x4a34ee(0x1da)](_0x4a34ee(0x11d)+_0x365cdd);_0x15dac0&&console[_0x4a34ee(0x1da)](_0x4a34ee(0xf4));}const _0xa0609e=await withSpinner(_0x4a34ee(0xc0),()=>_0x66fe94[_0x4a34ee(0x190)]['attempts']({'projectName':_0x365cdd,'workflowName':_0x3b4b28,'includeRetried':_0x15dac0,'limit':_0x36d09d[_0x4a34ee(0x11b)]}),{'verbose':_0x36d09d['verbose']}),_0x550f01=_0xa0609e['data'],_0x11f304=_0x36d09d[_0x4a34ee(0x11b)]||0x64,_0x5a44b6=_0x550f01['length']>=_0x11f304?a47_0x1cdfef['dim'](_0x4a34ee(0x1e5)):'';console[_0x4a34ee(0x1da)](_0x4a34ee(0x167)+_0x550f01['length']+_0x4a34ee(0x97)+(_0x550f01['length']!==0x1?'s':'')+_0x5a44b6);if(_0x36d09d['format']===_0x4a34ee(0x1ae)||_0x36d09d['format']==='jsonl'||_0x36d09d[_0x4a34ee(0x140)]===_0x4a34ee(0x192))await handleSDKOutput(_0x550f01,_0x36d09d);else{if(_0x550f01[_0x4a34ee(0x1c9)]===0x0){if(_0x365cdd&&_0x3b4b28)console[_0x4a34ee(0x1dd)](_0x4a34ee(0xba)+_0x365cdd+'.'+_0x3b4b28);else _0x365cdd?console[_0x4a34ee(0x1dd)](_0x4a34ee(0x123)+_0x365cdd):console['log'](_0x4a34ee(0xb2));}else{const _0x15341a=_0x36d09d[_0x4a34ee(0x8c)],_0x1a4e99=_0x550f01[_0x4a34ee(0x221)](_0x15a032=>{const _0xcf2a93=_0x4a34ee,_0x4ec552=a47_0x1cdfef[_0xcf2a93(0xe3)]('#'+_0x15a032['id']),_0x2b446b=_0x15a032[_0xcf2a93(0x1bb)]?.['id'],_0x2aec60=_0x15a032[_0xcf2a93(0x1a6)]||_0x15a032[_0xcf2a93(0xd2)],_0x4db661=_0x2b446b&&_0x2aec60?hyperlink(_0x4ec552,getWorkflowAttemptUrl(_0x15341a,_0x2b446b,_0x2aec60,_0x15a032['id'])):_0x4ec552,{icon:_0x3ea695,text:_0x378873}=getAttemptStatusDisplay(_0x15a032),_0x313833=(_0x15a032['project']?.[_0xcf2a93(0x100)]||'?')+'.'+(_0x15a032[_0xcf2a93(0x190)]?.[_0xcf2a93(0x100)]||'?'),_0x23d3a7=_0x15a032[_0xcf2a93(0x120)]?a47_0x1cdfef['dim'](_0x15a032[_0xcf2a93(0x120)]):'';return(_0x4db661+'\x20'+_0x3ea695+(_0x378873?'\x20'+_0x378873:'')+'\x20'+_0x313833+'\x20'+_0x23d3a7)['trimEnd']();});await writeOutput(_0x1a4e99[_0x4a34ee(0x108)]('\x0a'),_0x36d09d[_0x4a34ee(0x204)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0xc6);['description']='Show\x20specific\x20attempt\x20details';async[a47_0xda8e2(0x9f)](_0x3dd36e){const _0x49e260=a47_0xda8e2,{options:_0x5096c2,args:_0x16aa19,tdx:_0x377176}=_0x3dd36e,_0x5265a8=_0x16aa19[0x0];if(!_0x5265a8)return console[_0x49e260(0x1da)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x5096c2['verbose']&&console[_0x49e260(0x1da)](_0x49e260(0x143)+_0x5265a8);const _0x54e0e1=await withSpinner(_0x49e260(0x15d),()=>_0x377176[_0x49e260(0x190)][_0x49e260(0x218)](_0x5265a8),{'verbose':_0x5096c2[_0x49e260(0x1a7)]}),_0x173367=_0x54e0e1['data'];let _0x2cae80;!_0x173367['done']?_0x2cae80=_0x173367[_0x49e260(0x17e)]?_0x49e260(0x227):_0x49e260(0xf9):_0x2cae80=_0x173367['success']?_0x49e260(0x1ee):_0x49e260(0x1da);let _0x39da30;if(_0x173367[_0x49e260(0x208)]&&_0x173367[_0x49e260(0x81)]){const _0x4502fa=new Date(_0x173367[_0x49e260(0x208)])['getTime'](),_0x545f8b=new Date(_0x173367[_0x49e260(0x81)])['getTime']();_0x39da30=Math[_0x49e260(0x115)]((_0x545f8b-_0x4502fa)/0x3e8);}const _0x18f113={'attempt_id':_0x173367['id'],'status':_0x2cae80,..._0x173367['index']!==undefined&&{'index':_0x173367[_0x49e260(0x1b6)]},..._0x173367['project']&&{'project':_0x173367[_0x49e260(0x1bb)]['name']},..._0x173367[_0x49e260(0x190)]&&{'workflow':_0x173367[_0x49e260(0x190)][_0x49e260(0x100)]},..._0x173367[_0x49e260(0xd2)]&&{'session_id':_0x173367[_0x49e260(0xd2)]},..._0x173367[_0x49e260(0x120)]&&{'session_time':_0x173367[_0x49e260(0x120)]},..._0x173367[_0x49e260(0x1d6)]&&{'retry_attempt':_0x173367[_0x49e260(0x1d6)]},..._0x39da30!==undefined&&{'duration_sec':_0x39da30},..._0x173367['createdAt']&&{'created_at':_0x173367['createdAt']},..._0x173367[_0x49e260(0x81)]&&{'finished_at':_0x173367[_0x49e260(0x81)]},...Object[_0x49e260(0x138)](_0x173367[_0x49e260(0xaa)])[_0x49e260(0x1c9)]>0x0&&{'params':_0x173367[_0x49e260(0xaa)]}};return await handleSingleObjectOutput(_0x18f113,_0x5096c2),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x1d2);[a47_0xda8e2(0x160)]=a47_0xda8e2(0xf5);async[a47_0xda8e2(0x9f)](_0x1219b2){const _0x21ab96=a47_0xda8e2,{options:_0x43f9fe,args:_0x5206d9,tdx:_0x1a54cb}=_0x1219b2,_0x489d78=_0x5206d9[0x0];if(!_0x489d78)return console[_0x21ab96(0x1da)](_0x21ab96(0x144)),0x1;const _0x179980=_0x43f9fe['includeSubtasks'];_0x43f9fe[_0x21ab96(0x1a7)]&&(console['error'](_0x21ab96(0x143)+_0x489d78),_0x179980&&console[_0x21ab96(0x1da)]('Including\x20subtasks:\x20yes'));const _0x5639b2=await withSpinner(_0x21ab96(0x17f),()=>_0x1a54cb[_0x21ab96(0x190)][_0x21ab96(0x1db)](_0x489d78,_0x179980||![]),{'verbose':_0x43f9fe[_0x21ab96(0x1a7)]}),_0xada30e=_0x5639b2[_0x21ab96(0x1b9)];return console[_0x21ab96(0x1da)](_0x21ab96(0x167)+_0xada30e[_0x21ab96(0x1c9)]+_0x21ab96(0xc8)+(_0xada30e[_0x21ab96(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0xada30e,_0x43f9fe),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a47_0xda8e2(0x100)]='workflow:logs';[a47_0xda8e2(0x160)]=a47_0xda8e2(0x229);async[a47_0xda8e2(0x9f)](_0x317c84){const _0x539cea=a47_0xda8e2,{options:_0x20b8d0,args:_0x365254,tdx:_0x227ada}=_0x317c84,_0x35e3a9=_0x365254[0x0];let _0x4db6be=_0x365254[0x1];if(!_0x35e3a9)return console['error'](_0x539cea(0x144)),0x1;_0x20b8d0['verbose']&&(console[_0x539cea(0x1da)](_0x539cea(0x143)+_0x35e3a9),_0x4db6be&&console['error']('Task\x20name:\x20'+_0x4db6be));const _0x28fe2e=await withSpinner(_0x539cea(0x148),()=>_0x227ada[_0x539cea(0x190)][_0x539cea(0x125)](_0x35e3a9,_0x4db6be),{'verbose':_0x20b8d0[_0x539cea(0x1a7)]}),_0x4031=_0x28fe2e[_0x539cea(0x1b9)];if(_0x4031['length']===0x0)return console[_0x539cea(0x1da)](_0x539cea(0x14a)),0x0;if(!_0x4db6be&&(_0x20b8d0[_0x539cea(0x1ae)]||_0x20b8d0[_0x539cea(0x140)]))return await handleSDKOutput(_0x4031,_0x20b8d0),0x0;if(!_0x4db6be){const _0x290555=_0x4031[_0x539cea(0x221)](_0x279bf7=>({'title':_0x279bf7[_0x539cea(0x1de)]+'\x20('+formatBytes(_0x279bf7['fileSize'])+')','value':_0x279bf7[_0x539cea(0x1de)]})),_0x50cfcd=await a47_0x5d0169({'type':_0x539cea(0x16e),'name':_0x539cea(0x15f),'message':_0x539cea(0xcb),'choices':_0x290555});if(!_0x50cfcd['task'])return console[_0x539cea(0x1da)]('Cancelled'),0x0;_0x4db6be=_0x50cfcd[_0x539cea(0x15f)];}const _0x325b60=await withSpinner(_0x539cea(0x225),()=>_0x227ada['workflow'][_0x539cea(0xd8)](_0x35e3a9,_0x4db6be),{'verbose':_0x20b8d0[_0x539cea(0x1a7)]}),_0x26ba10=_0x325b60[_0x539cea(0x1b9)];return _0x26ba10?console[_0x539cea(0x1dd)](_0x26ba10):console[_0x539cea(0x1da)](_0x539cea(0x1c7)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a47_0xda8e2(0x21a);[a47_0xda8e2(0x160)]=a47_0xda8e2(0x12e);async[a47_0xda8e2(0x9f)](_0xfaeab1){const _0xdea424=a47_0xda8e2,{options:_0x5087ee,args:_0x24845e,tdx:_0x27b173}=_0xfaeab1,_0xa8351f=_0x24845e[0x0];if(!_0xa8351f)return console[_0xdea424(0x1da)](_0xdea424(0x144)),0x1;const _0x2cab03=_0x5087ee[_0xdea424(0x181)];_0x5087ee[_0xdea424(0x1a7)]&&(console[_0xdea424(0x1da)](_0xdea424(0x143)+_0xa8351f),_0x2cab03&&console['error'](_0xdea424(0xac)+_0x2cab03));if(!_0x5087ee['yes']){if(!isInteractive())return console['error'](a47_0x1cdfef[_0xdea424(0x149)](_0xdea424(0xf3)),_0xdea424(0x12a)),console[_0xdea424(0x1da)](a47_0x1cdfef['dim'](_0xdea424(0x206))),0x1;const _0x18b471=await confirmKey(_0xdea424(0x20d)+_0xa8351f+'?');if(!_0x18b471)return console['error'](a47_0x1cdfef['yellow'](_0xdea424(0x1d0))),0x1;}const _0xc2bd67=await withSpinner(_0xdea424(0xef),()=>_0x27b173[_0xdea424(0x190)][_0xdea424(0x173)](_0xa8351f,_0x2cab03),{'verbose':_0x5087ee[_0xdea424(0x1a7)]}),_0x26570b=_0xc2bd67[_0xdea424(0x1b9)];return console[_0xdea424(0x1da)]('✔\x20'+_0x26570b),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x13c);[a47_0xda8e2(0x160)]=a47_0xda8e2(0x196);async[a47_0xda8e2(0x9f)](_0x4f55a5){const _0x338f40=a47_0xda8e2,{options:_0x1cb677,args:_0x183ddb,tdx:_0x322fc8}=_0x4f55a5,_0x4302f4=_0x183ddb[0x0];if(!_0x4302f4)return console[_0x338f40(0x1da)](_0x338f40(0xfd)),console[_0x338f40(0x1da)](_0x338f40(0x1a2)),0x1;let _0xc6f39e=![],_0x5b6ff8=_0x4302f4;if(_0x4302f4[_0x338f40(0xa7)]('session:'))_0xc6f39e=!![],_0x5b6ff8=_0x4302f4[_0x338f40(0x1dc)](0x8);else{if(_0x4302f4['startsWith'](_0x338f40(0x10d)))_0xc6f39e=![],_0x5b6ff8=_0x4302f4['substring'](0x8);else return console[_0x338f40(0x1da)](_0x338f40(0x150)),console[_0x338f40(0x1da)](_0x338f40(0x1a2)),0x1;}const _0x4e2d3a=_0x1cb677[_0x338f40(0x200)],_0x4dcefa=_0x1cb677[_0x338f40(0xc7)],_0x48fa79=_0x1cb677[_0x338f40(0xaa)],_0x55b990=_0x1cb677['force'];_0x1cb677[_0x338f40(0x1a7)]&&(console['error'](_0x338f40(0x176)+(_0xc6f39e?_0x338f40(0x1c8):_0x338f40(0x218))+'\x20'+_0x5b6ff8),_0x4e2d3a&&console[_0x338f40(0x1da)](_0x338f40(0xce)+_0x4e2d3a),_0x4dcefa&&console[_0x338f40(0x1da)](_0x338f40(0x174)+_0x4dcefa),_0x48fa79&&console[_0x338f40(0x1da)](_0x338f40(0x20e)+_0x48fa79),_0x55b990&&console[_0x338f40(0x1da)](_0x338f40(0x214)));let _0xe17824;if(_0x48fa79)try{if(_0x48fa79[_0x338f40(0xa7)]('@')){const _0x4b21db=await import(_0x338f40(0x194)),_0x45c65c=_0x48fa79[_0x338f40(0x1dc)](0x1),_0x2cefde=await _0x4b21db[_0x338f40(0x1f3)](_0x45c65c,_0x338f40(0x163));_0xe17824=JSON[_0x338f40(0x16c)](_0x2cefde);}else _0xe17824=JSON['parse'](_0x48fa79);}catch{return console[_0x338f40(0x1da)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x1cb677[_0x338f40(0x1af)]){if(!isInteractive())return console['error'](a47_0x1cdfef['red']('\x0aError:'),_0x338f40(0x12a)),console[_0x338f40(0x1da)](a47_0x1cdfef['dim'](_0x338f40(0x206))),0x1;const _0x5883cb=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0xc6f39e?'session':'attempt')+'\x20'+_0x5b6ff8+'?');if(!_0x5883cb)return console[_0x338f40(0x1da)](a47_0x1cdfef[_0x338f40(0xbf)](_0x338f40(0x1d0))),0x1;}let _0x33f044;_0xc6f39e?_0x33f044=await withSpinner(_0x338f40(0x170),()=>_0x322fc8[_0x338f40(0x190)][_0x338f40(0x20b)](_0x5b6ff8,{'fromTask':_0x4e2d3a,'retryParams':_0xe17824}),{'verbose':_0x1cb677['verbose']}):_0x33f044=await withSpinner(_0x338f40(0xda),()=>_0x322fc8['workflow'][_0x338f40(0x14d)](_0x5b6ff8,{'resumeFrom':_0x4dcefa,'retryParams':_0xe17824,'force':_0x55b990}),{'verbose':_0x1cb677[_0x338f40(0x1a7)]});const _0xeb5af8=_0x33f044['data'];return console['error']('✔\x20Retry\x20started'),console['error'](_0x338f40(0xb5)+_0xeb5af8[_0x338f40(0x18d)]),console['error'](_0x338f40(0xa0)+_0xeb5af8[_0x338f40(0xd2)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]='workflow:run';['description']=a47_0xda8e2(0x1d1);async[a47_0xda8e2(0x9f)](_0x42d25e){const _0x20285=a47_0xda8e2,{options:_0x2ea233,args:_0x295f49,tdx:_0x560ca0}=_0x42d25e;let _0x4cb895=_0x295f49[0x0];if(!_0x4cb895){const _0x1cbeaa=this[_0x20285(0x1ed)]([],_0x2ea233),_0x5ef990=await withSpinner(_0x20285(0x114),()=>_0x560ca0['workflow']['workflows'](_0x1cbeaa,{'limit':_0x2ea233[_0x20285(0x11b)]}),{'verbose':_0x2ea233['verbose']}),_0x431714=_0x5ef990[_0x20285(0x1b9)];if(_0x431714[_0x20285(0x1c9)]===0x0)return console[_0x20285(0x1da)]('No\x20workflows\x20found'),!_0x1cbeaa&&console[_0x20285(0x1da)](a47_0x1cdfef['dim'](_0x20285(0x1b5))),0x1;const _0x59d53f=_0x431714[_0x20285(0x221)](_0x398846=>({'title':_0x398846[_0x20285(0x1bb)]?.[_0x20285(0x100)]+'.'+_0x398846[_0x20285(0x100)],'value':_0x398846[_0x20285(0x1bb)]?.['name']+'.'+_0x398846[_0x20285(0x100)],'description':_0x398846[_0x20285(0xbd)]?_0x20285(0x83)+_0x398846[_0x20285(0xbd)]:undefined})),_0x16b469=await a47_0x5d0169({'type':'select','name':'workflow','message':_0x20285(0x211),'choices':_0x59d53f});if(!_0x16b469[_0x20285(0x190)])return 0x1;_0x4cb895=_0x16b469[_0x20285(0x190)];}if(!_0x4cb895[_0x20285(0x1e2)]('.')){const _0x50f23c=this[_0x20285(0x1ed)]([],_0x2ea233);if(_0x50f23c)_0x4cb895=_0x50f23c+'.'+_0x4cb895;else return console[_0x20285(0x1da)](a47_0x1cdfef[_0x20285(0x149)](_0x20285(0x179)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x20285(0x1da)](a47_0x1cdfef[_0x20285(0xe3)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x1e5921=_0x2ea233[_0x20285(0x17c)],_0x56d245=_0x2ea233['sessionTime'],_0xf8d227={};if(_0x1e5921&&Array['isArray'](_0x1e5921))for(const _0x2636de of _0x1e5921){const _0x18f8c5=_0x2636de[_0x20285(0x14e)]('=');if(_0x18f8c5===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x2636de),console[_0x20285(0x1da)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x4c13e7=_0x2636de[_0x20285(0x1dc)](0x0,_0x18f8c5),_0x4e7d9c=_0x2636de['substring'](_0x18f8c5+0x1);try{_0xf8d227[_0x4c13e7]=JSON[_0x20285(0x16c)](_0x4e7d9c);}catch{_0xf8d227[_0x4c13e7]=_0x4e7d9c;}}_0x2ea233[_0x20285(0x1a7)]&&(console['error'](_0x20285(0x124)+_0x4cb895),Object[_0x20285(0x138)](_0xf8d227)['length']>0x0&&console[_0x20285(0x1da)]('Parameters:\x20'+JSON[_0x20285(0x11e)](_0xf8d227)),_0x56d245&&console[_0x20285(0x1da)]('Session\x20time:\x20'+_0x56d245));const _0x47ec42=await withSpinner(_0x20285(0xbe),()=>_0x560ca0[_0x20285(0x190)][_0x20285(0x207)](_0x4cb895,_0xf8d227,{'sessionTime':_0x56d245}),{'verbose':_0x2ea233[_0x20285(0x1a7)]}),_0x543a3c=_0x47ec42[_0x20285(0x1b9)];console[_0x20285(0x1da)]('✔\x20Workflow\x20run\x20started'),console[_0x20285(0x1da)](_0x20285(0x13d)+_0x543a3c['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x543a3c[_0x20285(0xd2)]),console['error'](_0x20285(0x13f)+_0x543a3c[_0x20285(0x1bb)]?.[_0x20285(0x100)]),console[_0x20285(0x1da)]('\x20\x20Workflow:\x20'+_0x543a3c[_0x20285(0x190)]?.[_0x20285(0x100)]);if(_0x543a3c[_0x20285(0x1bb)]?.['id']&&_0x543a3c[_0x20285(0xd2)]&&_0x543a3c['id']){const _0x15b783=_0x2ea233[_0x20285(0x8c)],_0x4c952f=getConsoleUrl(_0x15b783,_0x20285(0x126)+_0x543a3c[_0x20285(0x1bb)]['id']+_0x20285(0x203)+_0x543a3c['sessionId']+_0x20285(0x21f)+_0x543a3c['id']);console[_0x20285(0x1da)](_0x20285(0x8d)+a47_0x1cdfef['cyan'](_0x4c952f));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x8f);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a47_0xda8e2(0x9f)](_0x266cd6){const _0x1de7c5=a47_0xda8e2,{options:_0x1bd4eb,args:_0x11d661,tdx:_0x5ae117}=_0x266cd6,_0x5d8e52=_0x11d661[0x0],_0x314565=_0x11d661[0x1]||'.';if(!_0x5d8e52)return console[_0x1de7c5(0x1da)](_0x1de7c5(0x129)),console[_0x1de7c5(0x1da)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x3177c3=_0x1bd4eb[_0x1de7c5(0xbd)];_0x1bd4eb['verbose']&&(console[_0x1de7c5(0x1da)](_0x1de7c5(0x20f)+_0x5d8e52),console[_0x1de7c5(0x1da)](_0x1de7c5(0x107)+_0x314565),_0x3177c3&&console[_0x1de7c5(0x1da)]('Revision:\x20'+_0x3177c3));const _0x2826fd=await withSpinner(_0x1de7c5(0x1b4)+_0x5d8e52+'...',()=>_0x5ae117[_0x1de7c5(0x190)][_0x1de7c5(0x168)](_0x5d8e52,_0x314565,{'revision':_0x3177c3}),{'verbose':_0x1bd4eb[_0x1de7c5(0x1a7)]}),_0x2a7706=_0x2826fd[_0x1de7c5(0x1b9)];return console[_0x1de7c5(0x1da)]('✔\x20Downloaded\x20'+_0x2a7706[_0x1de7c5(0x109)]),console['error'](_0x1de7c5(0x226)+_0x2a7706[_0x1de7c5(0xbd)]),console[_0x1de7c5(0x1da)](_0x1de7c5(0x117)+_0x2a7706[_0x1de7c5(0x1a8)]),console['error'](_0x1de7c5(0x1fd)+_0x314565+'/'+_0x2a7706[_0x1de7c5(0x109)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a47_0xda8e2(0x18e);[a47_0xda8e2(0x160)]=a47_0xda8e2(0x134);async[a47_0xda8e2(0x9f)](_0x87aada){const _0x50ce96=a47_0xda8e2,{options:_0x1a4dd2,args:_0x31b5ff,tdx:_0x5787c4}=_0x87aada;let _0x24cab8='.',_0x3a1676=_0x1a4dd2['name'];if(_0x31b5ff[0x0]){const {promises:_0x236bb5}=await import('fs');try{const _0x19abba=await _0x236bb5[_0x50ce96(0xb1)](_0x31b5ff[0x0]);if(_0x19abba[_0x50ce96(0x104)]())_0x24cab8=_0x31b5ff[0x0];else return console[_0x50ce96(0x1da)](_0x50ce96(0x1c6)+_0x31b5ff[0x0]+_0x50ce96(0xb4)),0x1;}catch{_0x3a1676=_0x31b5ff[0x0],_0x24cab8='.';}}const _0x7751f5=_0x1a4dd2[_0x50ce96(0xbd)],_0x331a03=_0x1a4dd2[_0x50ce96(0x15a)];_0x1a4dd2[_0x50ce96(0x1a7)]&&(console[_0x50ce96(0x1da)]('Project\x20directory:\x20'+_0x24cab8),_0x3a1676&&console['error'](_0x50ce96(0x217)+_0x3a1676),_0x7751f5&&console[_0x50ce96(0x1da)](_0x50ce96(0xed)+_0x7751f5),_0x331a03&&console['error'](_0x50ce96(0x184)));const _0x4e5261=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x5787c4[_0x50ce96(0x190)]['push'](_0x24cab8,{'projectName':_0x3a1676,'revision':_0x7751f5,'skipValidation':_0x331a03}),{'verbose':_0x1a4dd2[_0x50ce96(0x1a7)]}),_0x471302=_0x4e5261['data'];return console['error'](_0x50ce96(0x91)+_0x471302[_0x50ce96(0x109)]),console[_0x50ce96(0x1da)](_0x50ce96(0x216)+_0x471302['projectId']),console[_0x50ce96(0x1da)](_0x50ce96(0x226)+_0x471302[_0x50ce96(0xbd)]),await this['showWorkflowConsoleUrl'](_0x5787c4,_0x471302[_0x50ce96(0x109)],_0x1a4dd2[_0x50ce96(0x8c)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x1e1);[a47_0xda8e2(0x160)]=a47_0xda8e2(0xea);async[a47_0xda8e2(0x9f)](_0x146211){const _0x2d89fa=a47_0xda8e2,{options:_0x48b58d,args:_0x34ff9e,tdx:_0x7f6e1a}=_0x146211,_0x36a10e=_0x34ff9e[0x0],_0xcff4f3=_0x34ff9e[0x1];if(!_0x36a10e)return console[_0x2d89fa(0x1da)](a47_0x1cdfef[_0x2d89fa(0x149)]('Error:'),_0x2d89fa(0x7f)),console[_0x2d89fa(0x1da)](a47_0x1cdfef['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x34bb5a=_0x48b58d['revision'];_0x48b58d['verbose']&&(console[_0x2d89fa(0x1da)](_0x2d89fa(0x20f)+_0x36a10e),_0xcff4f3&&console[_0x2d89fa(0x1da)](_0x2d89fa(0x17a)+_0xcff4f3),_0x34bb5a&&console[_0x2d89fa(0x1da)](_0x2d89fa(0xed)+_0x34bb5a),_0x48b58d[_0x2d89fa(0x228)]&&console[_0x2d89fa(0x1da)]('Dry\x20run:\x20yes'));const _0x5ec683=await withSpinner(_0x2d89fa(0x20c)+_0x36a10e+_0x2d89fa(0xa1),()=>_0x7f6e1a[_0x2d89fa(0x190)][_0x2d89fa(0x16f)](_0x36a10e,{'targetDir':_0xcff4f3,'revision':_0x34bb5a}),{'verbose':_0x48b58d['verbose']}),_0x3c690=_0x5ec683[_0x2d89fa(0x1b9)];_0x3c690[_0x2d89fa(0x223)]?console[_0x2d89fa(0x1da)](_0x2d89fa(0x1ac)+_0x3c690[_0x2d89fa(0x109)]):console[_0x2d89fa(0x1da)](_0x2d89fa(0xeb)+_0x3c690['projectName']);console[_0x2d89fa(0x1da)]('\x20\x20Revision:\x20'+_0x3c690[_0x2d89fa(0xbd)]),console['error'](_0x2d89fa(0x1bc)+(a47_0x405fdf[_0x2d89fa(0x1f9)](process[_0x2d89fa(0x154)](),_0x3c690[_0x2d89fa(0x191)])||'.')),console[_0x2d89fa(0x1da)](_0x2d89fa(0x9b)+a47_0x1cdfef['green']('+'+_0x3c690['summary']['new']+'\x20new')+',\x20'+(a47_0x1cdfef[_0x2d89fa(0xbf)]('~'+_0x3c690[_0x2d89fa(0x1d9)][_0x2d89fa(0xdd)]+'\x20modified')+',\x20')+(a47_0x1cdfef[_0x2d89fa(0x149)]('-'+_0x3c690[_0x2d89fa(0x1d9)][_0x2d89fa(0x213)]+'\x20deleted')+',\x20')+(''+a47_0x1cdfef[_0x2d89fa(0xe3)](_0x3c690['summary'][_0x2d89fa(0x1cb)]+_0x2d89fa(0x188))));for(const _0x11d20a of _0x3c690[_0x2d89fa(0xb6)]){_0x11d20a[_0x2d89fa(0x1cc)]===_0x2d89fa(0xdd)&&_0x11d20a[_0x2d89fa(0x178)]&&(console[_0x2d89fa(0x1da)]('\x0a'+a47_0x1cdfef['cyan']('---\x20'+_0x11d20a[_0x2d89fa(0x112)])),console[_0x2d89fa(0x1da)](_0x11d20a[_0x2d89fa(0x178)]));}if(!_0x3c690[_0x2d89fa(0x18b)])return saveSessionContext({'workflow_project':_0x3c690[_0x2d89fa(0x109)]},_0x48b58d['session']),console['error'](a47_0x1cdfef[_0x2d89fa(0x95)](_0x2d89fa(0x1a4))),console[_0x2d89fa(0x1da)](a47_0x1cdfef[_0x2d89fa(0xe3)](_0x2d89fa(0x172)+_0x3c690[_0x2d89fa(0x109)])),0x0;if(_0x48b58d[_0x2d89fa(0x228)])return console[_0x2d89fa(0x1da)](a47_0x1cdfef[_0x2d89fa(0xbf)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x48b58d['yes']){if(!isInteractive())return console[_0x2d89fa(0x1da)](a47_0x1cdfef[_0x2d89fa(0x149)]('\x0aError:'),_0x2d89fa(0x12a)),console[_0x2d89fa(0x1da)](a47_0x1cdfef[_0x2d89fa(0xe3)](_0x2d89fa(0x206))),0x1;const _0x38f48a=await confirmKey(_0x2d89fa(0x14f));if(!_0x38f48a)return console['error'](a47_0x1cdfef[_0x2d89fa(0xbf)](_0x2d89fa(0x1d0)),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x7f6e1a[_0x2d89fa(0x190)][_0x2d89fa(0x18f)](_0x3c690,{'revision':_0x34bb5a}),{'verbose':_0x48b58d[_0x2d89fa(0x1a7)]}),saveSessionContext({'workflow_project':_0x3c690[_0x2d89fa(0x109)]},_0x48b58d[_0x2d89fa(0x1c8)]),console[_0x2d89fa(0x1da)](a47_0x1cdfef[_0x2d89fa(0x95)]('✔\x20Pull\x20complete'));const _0x588464=a47_0x405fdf[_0x2d89fa(0x1f9)](process[_0x2d89fa(0x154)](),_0x3c690[_0x2d89fa(0x191)])||'.';return console[_0x2d89fa(0x1da)](a47_0x1cdfef[_0x2d89fa(0xe3)](_0x2d89fa(0x1fd)+_0x588464)),console['error'](a47_0x1cdfef[_0x2d89fa(0xe3)](_0x2d89fa(0x172)+_0x3c690[_0x2d89fa(0x109)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x147);[a47_0xda8e2(0x160)]=a47_0xda8e2(0x96);async[a47_0xda8e2(0x9f)](_0x4bdf7c){const _0x465c21=a47_0xda8e2,{options:_0xe6e142,args:_0x233e05,tdx:_0x5600a2}=_0x4bdf7c,_0x180037=this[_0x465c21(0x84)](_0x233e05,_0xe6e142),_0x5d5d75=_0xe6e142['revision'],_0x34d6d6=_0xe6e142[_0x465c21(0x15a)];_0xe6e142[_0x465c21(0x1a7)]&&(_0x180037&&console['error'](_0x465c21(0x110)+_0x180037),_0x5d5d75&&console[_0x465c21(0x1da)]('Revision:\x20'+_0x5d5d75),_0xe6e142[_0x465c21(0x228)]&&console[_0x465c21(0x1da)]('Dry\x20run:\x20yes'),_0x34d6d6&&console[_0x465c21(0x1da)](_0x465c21(0x184)));let _0x5b3145;try{_0x5b3145=await withSpinner('Analyzing\x20changes...',()=>_0x5600a2[_0x465c21(0x190)][_0x465c21(0x1e7)]({'sourceDir':_0x180037,'revision':_0x5d5d75,'skipValidation':_0x34d6d6}),{'verbose':_0xe6e142['verbose']});}catch(_0x52fcc2){if(_0x52fcc2 instanceof Error&&_0x52fcc2['message'][_0x465c21(0x1e2)](_0x465c21(0x1d8)))return console[_0x465c21(0x1da)](a47_0x1cdfef[_0x465c21(0x149)](_0x465c21(0x179)),_0x465c21(0xd0)),_0xe6e142[_0x465c21(0xfc)]?console[_0x465c21(0x1da)](a47_0x1cdfef[_0x465c21(0xe3)](_0x465c21(0x1f4)+_0xe6e142[_0x465c21(0xfc)]+_0x465c21(0xb0)+_0xe6e142[_0x465c21(0xfc)]+'\x27')):console[_0x465c21(0x1da)](a47_0x1cdfef[_0x465c21(0xe3)](_0x465c21(0x133))),0x1;throw _0x52fcc2;}const _0x451717=_0x5b3145['data'];console[_0x465c21(0x1da)](_0x465c21(0x21d)+_0x451717[_0x465c21(0x109)]),console[_0x465c21(0x1da)](_0x465c21(0x1ad)+_0x451717['sourceDir']),console[_0x465c21(0x1da)](_0x465c21(0x226)+_0x451717[_0x465c21(0xbd)]),console[_0x465c21(0x1da)]('\x20\x20Changes:\x20'+a47_0x1cdfef[_0x465c21(0x95)]('+'+_0x451717[_0x465c21(0x1d9)]['new']+_0x465c21(0xab))+',\x20'+(a47_0x1cdfef['yellow']('~'+_0x451717[_0x465c21(0x1d9)]['modified']+_0x465c21(0x1cf))+',\x20')+(a47_0x1cdfef[_0x465c21(0x149)]('-'+_0x451717['summary'][_0x465c21(0x213)]+'\x20deleted')+',\x20')+(''+a47_0x1cdfef[_0x465c21(0xe3)](_0x451717[_0x465c21(0x1d9)][_0x465c21(0x1cb)]+_0x465c21(0x188))));for(const _0x40d1d2 of _0x451717[_0x465c21(0xb6)]){_0x40d1d2['type']==='modified'&&_0x40d1d2[_0x465c21(0x178)]&&(console['error']('\x0a'+a47_0x1cdfef['cyan']('---\x20'+_0x40d1d2['path'])),console[_0x465c21(0x1da)](_0x40d1d2[_0x465c21(0x178)]));}if(!_0x451717[_0x465c21(0x18b)])return console[_0x465c21(0x1da)](a47_0x1cdfef[_0x465c21(0x95)](_0x465c21(0x14c))),await this['showWorkflowConsoleUrl'](_0x5600a2,_0x451717['projectName'],_0xe6e142[_0x465c21(0x8c)]),0x0;if(_0xe6e142[_0x465c21(0x228)])return console[_0x465c21(0x1da)](a47_0x1cdfef[_0x465c21(0xbf)](_0x465c21(0x20a))),0x0;if(!_0xe6e142[_0x465c21(0x1af)]){if(!isInteractive())return console[_0x465c21(0x1da)](a47_0x1cdfef[_0x465c21(0x149)](_0x465c21(0xf3)),_0x465c21(0x12a)),console[_0x465c21(0x1da)](a47_0x1cdfef[_0x465c21(0xe3)](_0x465c21(0x206))),0x1;const _0x20e1c9=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x20e1c9)return console[_0x465c21(0x1da)](a47_0x1cdfef[_0x465c21(0xbf)](_0x465c21(0x1d0)),_0x465c21(0x11c)),0x1;}const _0x5c2aca=await withSpinner(_0x465c21(0x1ea),()=>_0x5600a2[_0x465c21(0x190)][_0x465c21(0xb9)](_0x451717),{'verbose':_0xe6e142[_0x465c21(0x1a7)]}),_0x4126b5=_0x5c2aca[_0x465c21(0x1b9)];return console[_0x465c21(0x1da)](a47_0x1cdfef['green'](_0x465c21(0x86))),console[_0x465c21(0x1da)](_0x465c21(0x216)+_0x4126b5[_0x465c21(0xca)]),console['error'](_0x465c21(0x226)+_0x4126b5['revision']),await this[_0x465c21(0x1fa)](_0x5600a2,_0x4126b5['projectName'],_0xe6e142['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0xbc);[a47_0xda8e2(0x160)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a47_0xda8e2(0x9f)](_0xcb0ab0){const _0xa309de=a47_0xda8e2,{options:_0xa27058,args:_0x1dbe3d,tdx:_0x5d32b9}=_0xcb0ab0,_0x167674=this[_0xa309de(0x84)](_0x1dbe3d,_0xa27058),_0x5b161c=_0xa27058['name'],_0x2f0c78=_0xa27058['revision'],_0x594b46=_0xa27058[_0xa309de(0x15a)];if(!_0x167674)return console[_0xa309de(0x1da)](a47_0x1cdfef[_0xa309de(0x149)](_0xa309de(0x179)),_0xa309de(0x152)),console[_0xa309de(0x1da)](a47_0x1cdfef[_0xa309de(0xe3)](_0xa309de(0x105))),console[_0xa309de(0x1da)](a47_0x1cdfef['dim'](_0xa309de(0x199))),0x1;if(!_0x5b161c)return console['error'](a47_0x1cdfef[_0xa309de(0x149)](_0xa309de(0x179)),_0xa309de(0xa8)),console['error'](a47_0x1cdfef[_0xa309de(0xe3)](_0xa309de(0x105))),0x1;_0xa27058[_0xa309de(0x1a7)]&&(console[_0xa309de(0x1da)](_0xa309de(0x110)+_0x167674),console[_0xa309de(0x1da)](_0xa309de(0x111)+_0x5b161c),_0x2f0c78&&console[_0xa309de(0x1da)](_0xa309de(0xed)+_0x2f0c78),_0xa27058['dryRun']&&console[_0xa309de(0x1da)](_0xa309de(0xf0)),_0x594b46&&console[_0xa309de(0x1da)](_0xa309de(0x184)));const _0x17ddec=await withSpinner(_0xa309de(0x164),()=>_0x5d32b9[_0xa309de(0x190)][_0xa309de(0x9a)](_0x167674,_0x5b161c,{'revision':_0x2f0c78,'skipValidation':_0x594b46}),{'verbose':_0xa27058[_0xa309de(0x1a7)]}),_0x514a8b=_0x17ddec[_0xa309de(0x1b9)];console[_0xa309de(0x1da)](_0xa309de(0x106)+_0x514a8b[_0xa309de(0x19d)]);_0x514a8b[_0xa309de(0x19c)]&&console['error']('Source\x20project:\x20'+_0x514a8b[_0xa309de(0x19c)]);console[_0xa309de(0x1da)](_0xa309de(0x111)+_0x514a8b['newProjectName']),console[_0xa309de(0x1da)]('Revision:\x20'+_0x514a8b['revision']),console['error'](_0xa309de(0xf2)+_0x514a8b[_0xa309de(0xe1)]);_0x514a8b['targetExists']&&(console[_0xa309de(0x1da)](a47_0x1cdfef[_0xa309de(0xbf)]('\x0a⚠\x20Project\x20\x22'+_0x514a8b[_0xa309de(0xa4)]+_0xa309de(0x193)+_0x514a8b[_0xa309de(0x180)]+')')),console[_0xa309de(0x1da)](a47_0x1cdfef[_0xa309de(0xbf)](_0xa309de(0xe6))));if(_0xa27058['dryRun'])return console['error'](a47_0x1cdfef[_0xa309de(0xbf)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0xa27058[_0xa309de(0x1af)]){if(!isInteractive())return console[_0xa309de(0x1da)](a47_0x1cdfef['red']('\x0aError:'),_0xa309de(0x12a)),console[_0xa309de(0x1da)](a47_0x1cdfef['dim'](_0xa309de(0x206))),0x1;const _0x398ff2=_0x514a8b[_0xa309de(0x19c)]||a47_0x405fdf[_0xa309de(0x201)](_0x167674),_0x5277b5=_0x514a8b[_0xa309de(0x1eb)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x5b161c+'\x22\x20with\x20new\x20revision?':_0xa309de(0x187)+_0x398ff2+'\x22\x20to\x20new\x20project\x20\x22'+_0x5b161c+'\x22?',_0x6a4b99=await confirmKey(_0x5277b5);if(!_0x6a4b99)return console[_0xa309de(0x1da)](a47_0x1cdfef['yellow'](_0xa309de(0x1d0))),0x1;}const _0x5b2724=await withSpinner(_0x514a8b[_0xa309de(0x1eb)]?_0xa309de(0xc2)+_0x5b161c+_0xa309de(0xa1):_0xa309de(0x19f)+_0x5b161c+_0xa309de(0xa1),()=>_0x5d32b9[_0xa309de(0x190)][_0xa309de(0x87)](_0x514a8b),{'verbose':_0xa27058[_0xa309de(0x1a7)]}),_0x496466=_0x5b2724[_0xa309de(0x1b9)];return console[_0xa309de(0x1da)](a47_0x1cdfef[_0xa309de(0x95)](_0x514a8b[_0xa309de(0x1eb)]?_0xa309de(0x1a3):_0xa309de(0x136))),console[_0xa309de(0x1da)]('\x20\x20Project:\x20'+_0x496466[_0xa309de(0xa4)]),console[_0xa309de(0x1da)](_0xa309de(0x216)+_0x496466[_0xa309de(0x82)]),console[_0xa309de(0x1da)](_0xa309de(0x226)+_0x496466[_0xa309de(0xbd)]),await this[_0xa309de(0x1fa)](_0x5d32b9,_0x496466[_0xa309de(0xa4)],_0xa27058[_0xa309de(0x8c)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x1b7);[a47_0xda8e2(0x160)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a47_0xda8e2(0x9f)](_0x101375){const _0x227bff=a47_0xda8e2,{options:_0x36f153,args:_0x22725b,tdx:_0xa2b239}=_0x101375,_0x4d995b=_0x22725b[0x0];if(!_0x4d995b)return console[_0x227bff(0x1da)](_0x227bff(0x122)),console[_0x227bff(0x1da)](_0x227bff(0x1fc)),0x1;_0x36f153[_0x227bff(0x1a7)]&&console[_0x227bff(0x1da)](_0x227bff(0x20f)+_0x4d995b);if(!_0x36f153[_0x227bff(0x1af)]){if(!isInteractive())return console[_0x227bff(0x1da)](a47_0x1cdfef['red'](_0x227bff(0xf3)),_0x227bff(0x12a)),console['error'](a47_0x1cdfef[_0x227bff(0xe3)](_0x227bff(0x206))),0x1;const _0x5af8a2=await confirmKey(_0x227bff(0xfb)+_0x4d995b+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x5af8a2)return console[_0x227bff(0x1da)](a47_0x1cdfef[_0x227bff(0xbf)](_0x227bff(0x1d0))),0x1;}const _0x230a2f=await withSpinner(_0x227bff(0x127)+_0x4d995b+'...',()=>_0xa2b239['workflow'][_0x227bff(0x185)](_0x4d995b),{'verbose':_0x36f153[_0x227bff(0x1a7)]}),_0x4da21d=_0x230a2f[_0x227bff(0x1b9)];return console[_0x227bff(0x1da)]('✔\x20Deleted\x20project\x20'+_0x4da21d[_0x227bff(0x109)]),console[_0x227bff(0x1da)](_0x227bff(0x216)+_0x4da21d['projectId']),0x0;}}function a47_0x45e3(_0x47ada0,_0x65f3e8){_0x47ada0=_0x47ada0-0x7d;const _0x317d8e=a47_0x317d();let _0x45e33e=_0x317d8e[_0x47ada0];return _0x45e33e;}export function parseKeyValue(_0x32e108){const _0x2684d0=a47_0xda8e2,_0x5d0e1a=_0x32e108[_0x2684d0(0x14e)]('=');if(_0x5d0e1a===-0x1)throw new Error(_0x2684d0(0xd1)+_0x32e108+_0x2684d0(0xf8));const _0x8121f1=_0x32e108[_0x2684d0(0x1dc)](0x0,_0x5d0e1a),_0x57926d=_0x32e108[_0x2684d0(0x1dc)](_0x5d0e1a+0x1);if(!_0x8121f1)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x8121f1,'value':_0x57926d};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0x121);[a47_0xda8e2(0x160)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a47_0xda8e2(0x9f)](_0x3eaa4f){const _0x496f7b=a47_0xda8e2,{options:_0x19f0a0,args:_0x2e0702,tdx:_0x5ed8ca}=_0x3eaa4f,_0x482012=this[_0x496f7b(0x224)](_0x2e0702,_0x19f0a0);if(!_0x482012)return 0x1;_0x19f0a0[_0x496f7b(0x1a7)]&&console[_0x496f7b(0x1da)](_0x496f7b(0x20f)+_0x482012);const _0x3e0b36=await withSpinner(_0x496f7b(0x1c5),()=>_0x5ed8ca[_0x496f7b(0x190)][_0x496f7b(0x202)](_0x482012),{'verbose':_0x19f0a0[_0x496f7b(0x1a7)]}),{secrets:_0x4b425d}=_0x3e0b36[_0x496f7b(0x1b9)];return console[_0x496f7b(0x1da)]('✔\x20Found\x20'+_0x4b425d[_0x496f7b(0x1c9)]+'\x20secret'+(_0x4b425d[_0x496f7b(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0x4b425d,_0x19f0a0),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]=a47_0xda8e2(0xe9);['description']=a47_0xda8e2(0x1f2);async[a47_0xda8e2(0x9f)](_0x15b7b8){const _0x5b0d2b=a47_0xda8e2,{options:_0x3c1f48,args:_0x21d27f,tdx:_0x32b67a}=_0x15b7b8;let _0x27bf12,_0x2c382b;if(_0x21d27f[_0x5b0d2b(0x1c9)]>=0x2)_0x27bf12=_0x21d27f[0x0],_0x2c382b=_0x21d27f[0x1];else{if(_0x21d27f['length']===0x1&&_0x3c1f48[_0x5b0d2b(0xfc)])_0x27bf12=_0x3c1f48['workflowProject'],_0x2c382b=_0x21d27f[0x0];else return _0x21d27f[_0x5b0d2b(0x1c9)]===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x5b0d2b(0x1da)](_0x5b0d2b(0x1b5)),0x1):(console[_0x5b0d2b(0x1da)](_0x5b0d2b(0xfe)),console[_0x5b0d2b(0x1da)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x4f0d62,_0x5f4536;try{({key:_0x4f0d62,value:_0x5f4536}=parseKeyValue(_0x2c382b));}catch(_0x54454f){return _0x54454f instanceof Error&&console[_0x5b0d2b(0x1da)](a47_0x1cdfef[_0x5b0d2b(0x149)](_0x5b0d2b(0x179)),_0x54454f[_0x5b0d2b(0x12f)]),0x1;}_0x3c1f48[_0x5b0d2b(0x1a7)]&&(console['error'](_0x5b0d2b(0x20f)+_0x27bf12),console[_0x5b0d2b(0x1da)](_0x5b0d2b(0x1fe)+_0x4f0d62));const _0x300e71=await withSpinner(_0x5b0d2b(0x1f5),()=>_0x32b67a[_0x5b0d2b(0x190)][_0x5b0d2b(0xcd)](_0x27bf12,_0x4f0d62,_0x5f4536),{'verbose':_0x3c1f48['verbose']}),_0x3c4d29=_0x300e71[_0x5b0d2b(0x1b9)];return console[_0x5b0d2b(0x1da)]('✔\x20Secret\x20\x27'+_0x3c4d29[_0x5b0d2b(0x1bd)]+_0x5b0d2b(0x198)+_0x3c4d29['projectName']+'\x27'),(_0x3c1f48[_0x5b0d2b(0x1ae)]||_0x3c1f48[_0x5b0d2b(0x161)])&&await handleSingleObjectOutput(_0x3c4d29,_0x3c1f48),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]='workflow:secrets:delete';[a47_0xda8e2(0x160)]=a47_0xda8e2(0x7d);async['execute'](_0x44b4d6){const _0x41cfd8=a47_0xda8e2,{options:_0x5c2ec4,args:_0x3fd669,tdx:_0x5574a4}=_0x44b4d6;let _0x14cc8c,_0xb922d;if(_0x3fd669['length']>=0x2)_0x14cc8c=_0x3fd669[0x0],_0xb922d=_0x3fd669[0x1];else{if(_0x3fd669[_0x41cfd8(0x1c9)]===0x1&&_0x5c2ec4[_0x41cfd8(0xfc)])_0x14cc8c=_0x5c2ec4[_0x41cfd8(0xfc)],_0xb922d=_0x3fd669[0x0];else return _0x3fd669['length']===0x1?(console[_0x41cfd8(0x1da)](_0x41cfd8(0x129)),console[_0x41cfd8(0x1da)](_0x41cfd8(0x1b5)),0x1):(console[_0x41cfd8(0x1da)](_0x41cfd8(0x88)),console[_0x41cfd8(0x1da)](_0x41cfd8(0x139)),0x1);}_0x5c2ec4[_0x41cfd8(0x1a7)]&&(console['error']('Project:\x20'+_0x14cc8c),console['error'](_0x41cfd8(0x1fe)+_0xb922d));if(!_0x5c2ec4[_0x41cfd8(0x1af)]){if(!isInteractive())return console['error'](a47_0x1cdfef[_0x41cfd8(0x149)](_0x41cfd8(0xf3)),_0x41cfd8(0x12a)),console['error'](a47_0x1cdfef[_0x41cfd8(0xe3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3daf4b=await confirmKey(_0x41cfd8(0x1f0)+_0xb922d+_0x41cfd8(0xf1)+_0x14cc8c+'\x27?');if(!_0x3daf4b)return console[_0x41cfd8(0x1da)](a47_0x1cdfef[_0x41cfd8(0xbf)](_0x41cfd8(0x1d0))),0x1;}const _0x2dfe71=await withSpinner('Deleting\x20secret...',()=>_0x5574a4[_0x41cfd8(0x190)][_0x41cfd8(0x1ba)](_0x14cc8c,_0xb922d),{'verbose':_0x5c2ec4[_0x41cfd8(0x1a7)]}),_0x5df7e2=_0x2dfe71['data'];return console[_0x41cfd8(0x1da)](_0x41cfd8(0x1c1)+_0x5df7e2[_0x41cfd8(0x1bd)]+_0x41cfd8(0x1f6)+_0x5df7e2[_0x41cfd8(0x109)]+'\x27'),(_0x5c2ec4[_0x41cfd8(0x1ae)]||_0x5c2ec4[_0x41cfd8(0x161)])&&await handleSingleObjectOutput(_0x5df7e2,_0x5c2ec4),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(_0x41f0aa){const _0x3f490f=a47_0xda8e2,_0x517815=Math[_0x3f490f(0xa3)](_0x41f0aa/0x3e8),_0x4e52b3=Math[_0x3f490f(0xa3)](_0x517815/0x3c),_0xb85b7e=Math[_0x3f490f(0xa3)](_0x4e52b3/0x3c),_0x43c340=Math[_0x3f490f(0xa3)](_0xb85b7e/0x18);if(_0x43c340>0x0){const _0x51e15d=_0xb85b7e%0x18;return _0x51e15d>0x0?_0x43c340+'d\x20'+_0x51e15d+'h':_0x43c340+'d';}else{if(_0xb85b7e>0x0){const _0x1d8ac8=_0x4e52b3%0x3c;return _0x1d8ac8>0x0?_0xb85b7e+'h\x20'+_0x1d8ac8+'m':_0xb85b7e+'h';}else{if(_0x4e52b3>0x0){const _0x41ae49=_0x517815%0x3c;return _0x41ae49>0x0?_0x4e52b3+'m\x20'+_0x41ae49+'s':_0x4e52b3+'m';}else return _0x517815+'s';}}}function formatTimestamp(_0x49685d,_0x3b82f5){const _0x47874f=a47_0xda8e2,_0x1b61ff=new Date(_0x49685d),_0x2b3771=String(_0x1b61ff[_0x47874f(0x101)]())[_0x47874f(0x17d)](0x2,'0'),_0x33c6ae=String(_0x1b61ff[_0x47874f(0x165)]())['padStart'](0x2,'0'),_0x485b56=_0x2b3771+':'+_0x33c6ae,_0x325d5b=_0x1b61ff['getFullYear']()===_0x3b82f5[_0x47874f(0xa2)]()&&_0x1b61ff['getMonth']()===_0x3b82f5[_0x47874f(0x12b)]()&&_0x1b61ff[_0x47874f(0x220)]()===_0x3b82f5[_0x47874f(0x220)]();if(_0x325d5b)return _0x485b56;else{const _0x4c2e8d=String(_0x1b61ff['getMonth']()+0x1)[_0x47874f(0x17d)](0x2,'0'),_0xee5aa8=String(_0x1b61ff['getDate']())[_0x47874f(0x17d)](0x2,'0');return _0x4c2e8d+'-'+_0xee5aa8+'\x20'+_0x485b56;}}function formatDate(_0xa9dba1){const _0x5e8878=a47_0xda8e2,_0x224ad9=_0xa9dba1[_0x5e8878(0xa2)](),_0x5a6a25=String(_0xa9dba1[_0x5e8878(0x12b)]()+0x1)[_0x5e8878(0x17d)](0x2,'0'),_0x5d54dd=String(_0xa9dba1[_0x5e8878(0x220)]())[_0x5e8878(0x17d)](0x2,'0');return _0x224ad9+'-'+_0x5a6a25+'-'+_0x5d54dd;}function getTaskStateIcon(_0x56d5c6){const _0x31db6a={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x31db6a[_0x56d5c6]||'⚪';}function getBarChar(_0x20f785){const _0x2d8ed=a47_0xda8e2;return _0x20f785==='error'||_0x20f785===_0x2d8ed(0xd3)?'×':'─';}function getBarColor(_0x5e4a46){const _0x5d5902=a47_0xda8e2,_0x3bd44a={'success':a47_0x1cdfef['green'],'error':a47_0x1cdfef['red'],'group_error':a47_0x1cdfef[_0x5d5902(0x149)],'running':a47_0x1cdfef[_0x5d5902(0x1d7)],'blocked':a47_0x1cdfef[_0x5d5902(0xbf)],'planned':a47_0x1cdfef[_0x5d5902(0xe3)],'canceling':a47_0x1cdfef[_0x5d5902(0xbf)]};return _0x3bd44a[_0x5e4a46]||a47_0x1cdfef['white'];}function parseTaskName(_0xf0222e){const _0x1d7689=a47_0xda8e2;let _0xd864ee=_0xf0222e[_0x1d7689(0x155)](/^\++/,'');const _0x1185a1=_0xd864ee[_0x1d7689(0x186)]('+'),_0x1f51c9=_0x1185a1[_0x1d7689(0x1c9)]>0x1?_0x1185a1[_0x1d7689(0x1c9)]-0x2:0x0,_0x3da643=_0x1185a1[_0x1185a1['length']-0x1]||_0xd864ee;return{'level':_0x1f51c9,'name':'+'+_0x3da643};}function truncateTaskName(_0x288c9c,_0x108df2){const _0x14325e=a47_0xda8e2,_0x4ab877=stringWidth(_0x288c9c);if(_0x4ab877<=_0x108df2)return _0x288c9c;let _0x217e03=_0x288c9c;while(stringWidth(_0x217e03+'…')>_0x108df2&&_0x217e03[_0x14325e(0x1c9)]>0x0){_0x217e03=_0x217e03[_0x14325e(0x10f)](0x0,-0x1);}return _0x217e03+'…';}function calculateTimeScale(_0xa41292,_0x3fed56){const _0x45297f=a47_0xda8e2;return{'startTime':_0xa41292[_0x45297f(0x197)],'endTime':_0xa41292[_0x45297f(0x19a)],'durationMs':_0xa41292[_0x45297f(0x195)],'msPerChar':_0xa41292['duration']/_0x3fed56};}function timeToPosition(_0x5eac52,_0x23bbf9,_0x2bd7df){const _0x3d2f68=a47_0xda8e2,_0x262272=_0x5eac52-_0x23bbf9['startTime'],_0x5835cd=Math[_0x3d2f68(0xa3)](_0x262272/_0x23bbf9['msPerChar']);return Math[_0x3d2f68(0x1b3)](0x0,Math['min'](_0x5835cd,_0x2bd7df));}function renderTimeAxis(_0xf93fe0,_0x1f0b67){const _0x5d2806=a47_0xda8e2,_0x271e6c=Math[_0x5d2806(0x222)](TIMELINE_CONFIG[_0x5d2806(0xfa)],Math[_0x5d2806(0x1b3)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x5d2806(0xa3)](_0x1f0b67/TIMELINE_CONFIG[_0x5d2806(0xf7)]))),_0x45bd29=_0xf93fe0[_0x5d2806(0xd5)]/(_0x271e6c-0x1),_0x247a2b=new Date(_0xf93fe0[_0x5d2806(0x1b1)]),_0x17383b=[];for(let _0x4a9b0e=0x0;_0x4a9b0e<_0x271e6c;_0x4a9b0e++){const _0xd30eda=_0xf93fe0['startTime']+_0x4a9b0e*_0x45bd29,_0x2e5007=timeToPosition(_0xd30eda,_0xf93fe0,_0x1f0b67),_0x4916e0=formatTimestamp(_0xd30eda,_0x247a2b);_0x17383b[_0x5d2806(0x13a)]({'pos':_0x2e5007,'text':_0x4916e0});}const _0x5c9cd8=new Array(_0x1f0b67)[_0x5d2806(0x19e)]('\x20');let _0x39962b=-0x1;for(const {pos:_0x3c8c04,text:_0x4ca1a9}of _0x17383b){let _0x7c11e3=Math['max'](0x0,_0x3c8c04-Math['floor'](_0x4ca1a9[_0x5d2806(0x1c9)]/0x2));_0x7c11e3<=_0x39962b+TIMELINE_CONFIG[_0x5d2806(0x21c)]&&(_0x7c11e3=_0x39962b+TIMELINE_CONFIG[_0x5d2806(0x21c)]+0x1);_0x7c11e3+_0x4ca1a9[_0x5d2806(0x1c9)]>_0x1f0b67&&(_0x7c11e3=_0x1f0b67-_0x4ca1a9['length']);if(_0x7c11e3>=0x0&&_0x7c11e3+_0x4ca1a9[_0x5d2806(0x1c9)]<=_0x1f0b67&&_0x7c11e3>_0x39962b){for(let _0x5f24c1=0x0;_0x5f24c1<_0x4ca1a9[_0x5d2806(0x1c9)];_0x5f24c1++){_0x5c9cd8[_0x7c11e3+_0x5f24c1]=_0x4ca1a9[_0x5f24c1];}_0x39962b=_0x7c11e3+_0x4ca1a9[_0x5d2806(0x1c9)]-0x1;}}return _0x5c9cd8[_0x5d2806(0x108)]('');}function renderTaskRow(_0x3e285b,_0x39c7c3,_0x39bde6,_0x1bc6c7){const _0x9fa44c=a47_0xda8e2,{level:_0x5b03e6,name:_0x19b2c1}=parseTaskName(_0x3e285b['name']),_0x3a8ab7='\x20'['repeat'](_0x5b03e6),_0x311c9a=_0x3e285b[_0x9fa44c(0x1ce)]?'('+formatElapsed(_0x3e285b[_0x9fa44c(0x1ce)]['duration'])+')':'',_0x1da8ba=stringWidth(_0x311c9a),_0x453abf=_0x5b03e6*0x1,_0x51575d=_0x1bc6c7-_0x453abf-_0x1da8ba-0x1,_0xe1bb43=truncateTaskName(_0x19b2c1,_0x51575d),_0x361a3d=_0x3a8ab7+_0xe1bb43,_0x4e5bde=stringWidth(_0x361a3d),_0x3f6c33=_0x1bc6c7-_0x4e5bde-_0x1da8ba,_0x23c484=_0x361a3d+'\x20'[_0x9fa44c(0x116)](Math['max'](0x1,_0x3f6c33))+a47_0x1cdfef[_0x9fa44c(0xe3)](_0x311c9a),_0x5323aa=getTaskStateIcon(_0x3e285b['state']),_0x5a8fdd=new Array(_0x39bde6)[_0x9fa44c(0x19e)]('\x20');if(_0x3e285b[_0x9fa44c(0x1ce)]){const _0x39a0da=timeToPosition(_0x3e285b[_0x9fa44c(0x1ce)][_0x9fa44c(0x197)],_0x39c7c3,_0x39bde6),_0x30c87e=timeToPosition(_0x3e285b[_0x9fa44c(0x1ce)]['end'],_0x39c7c3,_0x39bde6),_0x59c2ac=getBarChar(_0x3e285b['state']),_0x392de7=Math[_0x9fa44c(0x1b3)](_0x39a0da+0x1,_0x30c87e);for(let _0x10d3da=_0x39a0da;_0x10d3da<Math[_0x9fa44c(0x222)](_0x392de7,_0x39bde6);_0x10d3da++){_0x5a8fdd[_0x10d3da]=_0x59c2ac;}}const _0xd8239=getBarColor(_0x3e285b[_0x9fa44c(0xc4)]),_0x52d052=_0x5a8fdd[_0x9fa44c(0x221)](_0x27518a=>_0x27518a==='\x20'?'\x20':_0xd8239(_0x27518a))['join']('');return _0x5323aa+'\x20'+_0x23c484+'│'+_0x52d052+'│';}function calculateStats(_0x14b5a7){const _0x209945=a47_0xda8e2,_0xef3d34={'total':_0x14b5a7[_0x209945(0x1c9)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x341349 of _0x14b5a7){if(_0x341349['state']==='success')_0xef3d34['success']++;else{if(_0x341349[_0x209945(0xc4)]===_0x209945(0x1da)||_0x341349[_0x209945(0xc4)]===_0x209945(0xd3))_0xef3d34[_0x209945(0x1da)]++;else _0x341349[_0x209945(0xc4)]===_0x209945(0xf9)?_0xef3d34['running']++:_0xef3d34[_0x209945(0x1a5)]++;}}return _0xef3d34;}function formatStats(_0x2bfc82){const _0x254d46=a47_0xda8e2;return['Total:\x20'+_0x2bfc82[_0x254d46(0x1ef)],'✅\x20'+_0x2bfc82[_0x254d46(0x1ee)],'❌\x20'+_0x2bfc82[_0x254d46(0x1da)],_0x254d46(0xc9)+_0x2bfc82['running'],'⏳\x20'+_0x2bfc82[_0x254d46(0x1a5)]][_0x254d46(0x108)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a47_0xda8e2(0x100)]='workflow:timeline';['description']=a47_0xda8e2(0x9c);async['execute'](_0x5d6311){const _0x5df2fa=a47_0xda8e2,{options:_0x5ba305,args:_0xe85281,tdx:_0x5e1fef}=_0x5d6311;let _0xf5078a,_0x4e0a1b,_0x3fc788=![];if(_0xe85281[0x0]){if(_0xe85281[0x0][_0x5df2fa(0x1e2)]('.')){const _0x1e1aa0=this[_0x5df2fa(0x1c4)](_0xe85281,_0x5ba305);if(!_0x1e1aa0)return 0x1;_0xf5078a=_0x1e1aa0[_0x5df2fa(0x109)],_0x4e0a1b=_0x1e1aa0['workflowName'];}else{_0x4e0a1b=_0xe85281[0x0],_0xf5078a=_0x5ba305[_0x5df2fa(0xfc)];if(!_0xf5078a)return console['error'](a47_0x1cdfef['red'](_0x5df2fa(0x179)),_0x5df2fa(0x171)),0x1;_0x3fc788=!![];}}else{const _0x3223cf=this[_0x5df2fa(0x1c4)](_0xe85281,_0x5ba305);if(!_0x3223cf)return 0x1;_0xf5078a=_0x3223cf[_0x5df2fa(0x109)],_0x4e0a1b=_0x3223cf[_0x5df2fa(0x1c2)];}if(_0x5ba305[_0x5df2fa(0x1a7)]){if(_0xf5078a&&_0x4e0a1b)console['error']('Filter:\x20'+_0xf5078a+'.'+_0x4e0a1b);else _0xf5078a&&console[_0x5df2fa(0x1da)](_0x5df2fa(0x11d)+_0xf5078a);}const _0x3a2711=_0x5ba305[_0x5df2fa(0x18d)],_0x2bc903=_0x5ba305[_0x5df2fa(0xd2)];if(_0x3a2711){_0x2bc903&&console[_0x5df2fa(0x1da)](a47_0x1cdfef['yellow'](_0x5df2fa(0x10b)),_0x5df2fa(0xa5));const _0x5256cc=_0x5ba305[_0x5df2fa(0xd6)];return _0x5256cc?await this['pollTimeline'](_0x5d6311,_0x3a2711):await this[_0x5df2fa(0x141)](_0x5d6311,_0x3a2711,_0x5ba305),0x0;}if(_0x2bc903){const _0x3faf19=await withSpinner(_0x5df2fa(0xd7),()=>_0x5e1fef[_0x5df2fa(0x190)]['sessions']({'projectName':_0xf5078a,'workflowName':_0x4e0a1b,'limit':0x64}),{'verbose':_0x5ba305[_0x5df2fa(0x1a7)]}),_0x168d45=_0x3faf19[_0x5df2fa(0x1b9)]['find'](_0x878bca=>_0x878bca['id']===_0x2bc903);if(!_0x168d45)return console[_0x5df2fa(0x1da)](a47_0x1cdfef['red'](_0x5df2fa(0x179)),_0x5df2fa(0xb8)+_0x2bc903),0x1;if(!_0x168d45[_0x5df2fa(0x16b)]?.['id'])return console[_0x5df2fa(0x1da)](a47_0x1cdfef[_0x5df2fa(0x149)](_0x5df2fa(0x179)),_0x5df2fa(0x93)+_0x2bc903+_0x5df2fa(0xc1)),0x1;const _0x36515d=_0x168d45[_0x5df2fa(0x16b)]['id'];_0x5ba305[_0x5df2fa(0x1a7)]&&console[_0x5df2fa(0x1da)](_0x5df2fa(0x94)+_0x36515d+_0x5df2fa(0xe0)+_0x2bc903);const _0x30cf01=_0x5ba305['follow'];return _0x30cf01?await this[_0x5df2fa(0x215)](_0x5d6311,_0x36515d):await this['renderSingleTimeline'](_0x5d6311,_0x36515d,_0x5ba305),0x0;}const _0x1e2b90=await withSpinner('Loading\x20sessions...',()=>_0x5e1fef['workflow'][_0x5df2fa(0xcf)]({'projectName':_0xf5078a,'workflowName':_0x4e0a1b,'limit':_0x5ba305['limit']||0x32}),{'verbose':_0x5ba305[_0x5df2fa(0x1a7)]}),_0x4a4481=_0x1e2b90[_0x5df2fa(0x1b9)];if(_0x4a4481[_0x5df2fa(0x1c9)]===0x0){if(_0xf5078a&&_0x4e0a1b)console[_0x5df2fa(0x1da)](_0x5df2fa(0xaf)+_0xf5078a+'.'+_0x4e0a1b);else _0xf5078a?console[_0x5df2fa(0x1da)](_0x5df2fa(0x102)+_0xf5078a):(console[_0x5df2fa(0x1da)](_0x5df2fa(0xff)),console[_0x5df2fa(0x1da)](a47_0x1cdfef[_0x5df2fa(0xe3)](_0x5df2fa(0x14b))));return 0x0;}_0x4a4481['sort']((_0x109634,_0x227a4b)=>{const _0x5d77c0=_0x5df2fa,_0x1767be=_0x109634['sessionTime']||'',_0x2d4e71=_0x227a4b[_0x5d77c0(0x120)]||'';return _0x2d4e71['localeCompare'](_0x1767be);});if(_0x5ba305['json']||_0x5ba305['jsonl'])return await handleSDKOutput(_0x4a4481,_0x5ba305),0x0;let _0x3e5c8a;if(_0x3fc788){const _0x46c8a1=_0x4a4481[0x0];if(!_0x46c8a1[_0x5df2fa(0x16b)]?.['id'])return console[_0x5df2fa(0x1da)](_0x5df2fa(0x169)),0x0;_0x3e5c8a=_0x46c8a1['lastAttempt']['id'],_0x5ba305[_0x5df2fa(0x1a7)]&&console[_0x5df2fa(0x1da)](_0x5df2fa(0xbb)+_0x46c8a1['sessionTime']);}else{const _0x1d460a=_0x4a4481[_0x5df2fa(0x221)](_0x3939ba=>{const _0x1accb0=_0x5df2fa,_0x43aecd=getAttemptStatusDisplay(_0x3939ba[_0x1accb0(0x16b)]);return{'title':_0x3939ba['project']?.[_0x1accb0(0x100)]+'.'+_0x3939ba[_0x1accb0(0x190)]?.['name']+_0x1accb0(0x1aa)+_0x3939ba[_0x1accb0(0x120)]+'\x20'+_0x43aecd[_0x1accb0(0x8b)],'value':_0x3939ba['lastAttempt']?.['id']||'','description':_0x43aecd['text']};}),_0x5ad4a0=await a47_0x5d0169({'type':_0x5df2fa(0x16e),'name':_0x5df2fa(0x18d),'message':_0x5df2fa(0x166),'choices':_0x1d460a[_0x5df2fa(0x1f1)](_0x312e4f=>_0x312e4f['value']!=='')});if(!_0x5ad4a0[_0x5df2fa(0x18d)])return 0x0;_0x3e5c8a=_0x5ad4a0[_0x5df2fa(0x18d)];}const _0x467b0c=_0x5ba305[_0x5df2fa(0xd6)];return _0x467b0c?await this[_0x5df2fa(0x215)](_0x5d6311,_0x3e5c8a):await this[_0x5df2fa(0x141)](_0x5d6311,_0x3e5c8a,_0x5ba305),0x0;}async[a47_0xda8e2(0x141)](_0x2e17cb,_0x466d82,_0x341d78){const _0x5cda24=a47_0xda8e2,{tdx:_0x58c463}=_0x2e17cb;let _0x2ac14c,_0x2ad44a;try{[_0x2ac14c,_0x2ad44a]=await Promise['all']([_0x58c463[_0x5cda24(0x190)][_0x5cda24(0x218)](_0x466d82),_0x58c463[_0x5cda24(0x190)][_0x5cda24(0x1db)](_0x466d82,![])]);}catch(_0x3a01ea){console[_0x5cda24(0x1da)](a47_0x1cdfef[_0x5cda24(0x149)](_0x5cda24(0x118)));_0x341d78[_0x5cda24(0x1a7)]&&console[_0x5cda24(0x1da)](_0x3a01ea);throw _0x3a01ea;}if(_0x341d78[_0x5cda24(0x1ae)]||_0x341d78[_0x5cda24(0x161)]){const _0x136742=this['buildTimelineData'](_0x2ac14c,_0x2ad44a);await handleSDKOutput([_0x136742],_0x341d78);return;}const _0x25ade0=_0x58c463[_0x5cda24(0x90)][_0x5cda24(0x8c)],_0xe4f006=this[_0x5cda24(0xe4)](_0x2ac14c,_0x2ad44a,_0x25ade0);console[_0x5cda24(0x1dd)](_0xe4f006);}async[a47_0xda8e2(0x215)](_0x3dd565,_0xac0e5){const _0x2cbe6a=a47_0xda8e2,{tdx:_0x35878d}=_0x3dd565,_0x27afe2=TIMELINE_CONFIG[_0x2cbe6a(0x1d4)],_0x4fac3f=TIMELINE_CONFIG[_0x2cbe6a(0x1a0)];let _0x374873=0x0;while(_0x374873<_0x4fac3f){process[_0x2cbe6a(0x16a)][_0x2cbe6a(0x22a)]&&process[_0x2cbe6a(0x16a)][_0x2cbe6a(0x119)]('\x1bc');let _0x2bfdf7,_0x55d445;try{[_0x2bfdf7,_0x55d445]=await Promise[_0x2cbe6a(0xe2)]([_0x35878d[_0x2cbe6a(0x190)][_0x2cbe6a(0x218)](_0xac0e5),_0x35878d[_0x2cbe6a(0x190)]['tasks'](_0xac0e5,![])]);}catch(_0x589e5a){console[_0x2cbe6a(0x1da)](a47_0x1cdfef[_0x2cbe6a(0x149)](_0x2cbe6a(0x21b)));_0x374873>0x0&&console['error'](a47_0x1cdfef['dim'](_0x2cbe6a(0x1ec)+_0x374873));throw _0x589e5a;}const _0x5651b4=_0x35878d['context'][_0x2cbe6a(0x8c)],_0x292738=this[_0x2cbe6a(0xe4)](_0x2bfdf7,_0x55d445,_0x5651b4);console['log'](_0x292738);const _0x3be790=_0x2bfdf7[_0x2cbe6a(0x19b)]&&_0x55d445[_0x2cbe6a(0x137)](_0x56d121=>_0x56d121[_0x2cbe6a(0xc4)]!=='running'&&_0x56d121['state']!==_0x2cbe6a(0x212));if(_0x3be790){console[_0x2cbe6a(0x1da)](a47_0x1cdfef[_0x2cbe6a(0x95)](_0x2cbe6a(0x1f7)));break;}console[_0x2cbe6a(0x1da)](a47_0x1cdfef['dim'](_0x2cbe6a(0x1b8)+_0x374873*0x2+_0x2cbe6a(0x159))),await new Promise(_0x54150c=>setTimeout(_0x54150c,_0x27afe2)),_0x374873++;}_0x374873>=_0x4fac3f&&console['error'](a47_0x1cdfef[_0x2cbe6a(0xbf)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}['renderTimeline'](_0xd3c0fe,_0x2a2f5a,_0x3b3f73){const _0x50ed04=a47_0xda8e2,_0x2c28fa=[],_0x430b7a=TIMELINE_CONFIG[_0x50ed04(0x219)],_0x5d1da7=0x5,_0x1c769e=process[_0x50ed04(0x16a)]['columns']||0x78,_0x4da19e=_0x1c769e-_0x430b7a-_0x5d1da7,_0x478b21=Math['max'](TIMELINE_CONFIG[_0x50ed04(0x145)],Math['min'](_0x4da19e,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x101229=new Date(_0xd3c0fe[_0x50ed04(0x208)])['getTime'](),_0x20164b=_0xd3c0fe[_0x50ed04(0x81)]?new Date(_0xd3c0fe[_0x50ed04(0x81)])[_0x50ed04(0x18a)]():Date['now'](),_0x512ac6={'start':_0x101229,'end':_0x20164b,'duration':_0x20164b-_0x101229},_0x194e57=new Map(),_0x24b128=[];for(const _0x1145be of _0x2a2f5a){if(_0x1145be[_0x50ed04(0x1e4)]){const _0x531266=new Date(_0x1145be[_0x50ed04(0x1e4)])['getTime'](),_0x1d7320=_0x1145be['updatedAt']?new Date(_0x1145be['updatedAt'])[_0x50ed04(0x18a)]():Date['now'](),_0x44ee5a={'start':_0x531266,'end':_0x1d7320,'duration':_0x1d7320-_0x531266};_0x194e57[_0x50ed04(0xde)](_0x1145be['id'],_0x44ee5a),_0x24b128[_0x50ed04(0x13a)]({'name':_0x1145be[_0x50ed04(0x177)],'state':_0x1145be[_0x50ed04(0xc4)]||_0x50ed04(0xdf),'window':_0x44ee5a});}else _0x24b128['push']({'name':_0x1145be[_0x50ed04(0x177)],'state':_0x1145be[_0x50ed04(0xc4)]||'planned','window':undefined});}_0x24b128[_0x50ed04(0xdb)]((_0x33b5a5,_0x246e72)=>{const _0x10d157=_0x50ed04;if(!_0x33b5a5[_0x10d157(0x1ce)])return 0x1;if(!_0x246e72['window'])return-0x1;return _0x33b5a5[_0x10d157(0x1ce)][_0x10d157(0x197)]-_0x246e72[_0x10d157(0x1ce)][_0x10d157(0x197)];});const _0x247133=_0x24b128[_0x50ed04(0x1c9)],_0x19cae7=_0x247133>TIMELINE_CONFIG[_0x50ed04(0x128)];_0x19cae7&&_0x24b128[_0x50ed04(0x10e)](TIMELINE_CONFIG[_0x50ed04(0x128)]);const _0x1cdaf6=calculateTimeScale(_0x512ac6,_0x478b21),_0x3d9d19=_0xd3c0fe[_0x50ed04(0x19b)]?_0xd3c0fe[_0x50ed04(0x1ee)]?a47_0x1cdfef[_0x50ed04(0x95)](_0x50ed04(0x1ee)):a47_0x1cdfef['red'](_0x50ed04(0x1da)):a47_0x1cdfef['blue'](_0x50ed04(0xf9)),_0x1ec7d8=_0xd3c0fe[_0x50ed04(0x1bb)]?.['id'],_0x5c6d30=_0xd3c0fe[_0x50ed04(0xd2)];let _0x2d5e49;if(_0x1ec7d8&&_0x5c6d30){const _0x43b973=getWorkflowAttemptUrl(_0x3b3f73,_0x1ec7d8,_0x5c6d30,_0xd3c0fe['id']);_0x2d5e49=hyperlink(a47_0x1cdfef['dim'](_0xd3c0fe['id']),_0x43b973);}else _0x2d5e49=a47_0x1cdfef[_0x50ed04(0xe3)](_0xd3c0fe['id']);_0x2c28fa[_0x50ed04(0x13a)](_0x50ed04(0x80)+_0x2d5e49+_0x50ed04(0x1aa)+_0x3d9d19+_0x50ed04(0x1aa)+formatElapsed(_0x512ac6[_0x50ed04(0x195)]));if(_0x24b128[_0x50ed04(0x1c9)]>0x0){const _0x1d6219=renderTimeAxis(_0x1cdaf6,_0x478b21),_0x26cd73=new Date(_0x512ac6[_0x50ed04(0x197)]),_0x37acc2=formatDate(_0x26cd73),_0x2f7aa8=TIMELINE_CONFIG[_0x50ed04(0x113)]+TIMELINE_CONFIG['ICON_SPACING']+_0x430b7a,_0x20328c=_0x37acc2[_0x50ed04(0x17d)](_0x2f7aa8),_0x352ceb=a47_0x1cdfef[_0x50ed04(0xe3)](_0x20328c);_0x2c28fa[_0x50ed04(0x13a)](_0x352ceb+'\x20'+_0x1d6219);for(const _0x53ca26 of _0x24b128){_0x2c28fa['push'](renderTaskRow(_0x53ca26,_0x1cdaf6,_0x478b21,_0x430b7a));}const _0x4077dd=calculateStats(_0x24b128);_0x2c28fa['push'](formatStats(_0x4077dd)),_0x19cae7&&_0x2c28fa[_0x50ed04(0x13a)](a47_0x1cdfef[_0x50ed04(0xbf)](_0x50ed04(0x92)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x50ed04(0x132)+_0x247133+_0x50ed04(0xcc))),_0x2c28fa[_0x50ed04(0x13a)](''),_0x2c28fa[_0x50ed04(0x13a)](a47_0x1cdfef['dim'](_0x50ed04(0x135))+(_0x50ed04(0x158)+_0xd3c0fe['id']+_0x50ed04(0x1c0))+a47_0x1cdfef[_0x50ed04(0xe3)](_0x50ed04(0xc3)));}else _0x2c28fa['push'](_0x50ed04(0xad));return _0x2c28fa[_0x50ed04(0x108)]('\x0a');}[a47_0xda8e2(0xd4)](_0xe5233e,_0x5df2a0){const _0x180b1f=a47_0xda8e2,_0x3a91f8=new Date(_0xe5233e['createdAt'])[_0x180b1f(0x18a)](),_0x547d11=_0xe5233e[_0x180b1f(0x81)]?new Date(_0xe5233e[_0x180b1f(0x81)])[_0x180b1f(0x18a)]():Date[_0x180b1f(0x11a)](),_0x276193=_0x547d11-_0x3a91f8,_0x11e355=[];for(const _0x278eb2 of _0x5df2a0){if(_0x278eb2[_0x180b1f(0x1e4)]){const _0x4e6c3b=new Date(_0x278eb2['startedAt'])[_0x180b1f(0x18a)](),_0x291978=_0x278eb2['updatedAt']?new Date(_0x278eb2[_0x180b1f(0x9d)])[_0x180b1f(0x18a)]():Date[_0x180b1f(0x11a)]();_0x11e355['push']({'name':_0x278eb2[_0x180b1f(0x177)],'state':_0x278eb2[_0x180b1f(0xc4)]||_0x180b1f(0xdf),'window':{'start':_0x4e6c3b,'end':_0x291978,'duration':_0x291978-_0x4e6c3b}});}else _0x11e355['push']({'name':_0x278eb2[_0x180b1f(0x177)],'state':_0x278eb2['state']||'planned','window':undefined});}const _0x49ff61=calculateStats(_0x11e355);return{'attempt':{'id':_0xe5233e['id'],'status':_0xe5233e[_0x180b1f(0x19b)]?_0xe5233e[_0x180b1f(0x1ee)]?_0x180b1f(0x1ee):_0x180b1f(0x1da):_0x180b1f(0xf9),'createdAt':_0xe5233e['createdAt'],'finishedAt':_0xe5233e['finishedAt'],'duration_ms':_0x276193},'tasks':_0x11e355[_0x180b1f(0x221)](_0x31aed1=>({'name':_0x31aed1['name'],'state':_0x31aed1[_0x180b1f(0xc4)],'startedAt':_0x31aed1['window']?new Date(_0x31aed1[_0x180b1f(0x1ce)]['start'])[_0x180b1f(0xe5)]():null,'updatedAt':_0x31aed1[_0x180b1f(0x1ce)]?new Date(_0x31aed1[_0x180b1f(0x1ce)][_0x180b1f(0x19a)])[_0x180b1f(0xe5)]():null,'duration_ms':_0x31aed1['window']?.[_0x180b1f(0x195)]||null})),'stats':_0x49ff61};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x285d1c,_0x2850ee){const _0x345a97=a48_0x2566,_0x1a35e6=_0x285d1c();while(!![]){try{const _0x2e27b3=-parseInt(_0x345a97(0x18d))/0x1*(-parseInt(_0x345a97(0x181))/0x2)+parseInt(_0x345a97(0x188))/0x3*(parseInt(_0x345a97(0x189))/0x4)+parseInt(_0x345a97(0x17e))/0x5*(-parseInt(_0x345a97(0x186))/0x6)+parseInt(_0x345a97(0x185))/0x7*(parseInt(_0x345a97(0x187))/0x8)+parseInt(_0x345a97(0x180))/0x9*(-parseInt(_0x345a97(0x18b))/0xa)+-parseInt(_0x345a97(0x184))/0xb+parseInt(_0x345a97(0x18a))/0xc;if(_0x2e27b3===_0x2850ee)break;else _0x1a35e6['push'](_0x1a35e6['shift']());}catch(_0x255a4){_0x1a35e6['push'](_0x1a35e6['shift']());}}}(a48_0x2d49,0x7c100));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a48_0x2d49(){const _0x828c7=['5141064FXvkLx','820hNGDcH','X-Trino-User','1ZEhIbm','tdx/','1760685lMthbN',';\x20node/','25263rGANcG','678998qnDBOi','length','TD1\x20','2064502mayxzT','5153939JTHdBm','12FfekUg','8CJvoiP','348xpitwb','4348CHCWfu'];a48_0x2d49=function(){return _0x828c7;};return a48_0x2d49();}function a48_0x2566(_0x470721,_0x20a2d1){_0x470721=_0x470721-0x17d;const _0x2d49c2=a48_0x2d49();let _0x25665b=_0x2d49c2[_0x470721];return _0x25665b;}export function getUserAgent(){const _0x270409=a48_0x2566,_0x4be42c=getVersion(),_0x1558b5=platform(),_0x28ce5e=process['version']['replace']('v','');return _0x270409(0x17d)+_0x4be42c+'\x20('+_0x1558b5+_0x270409(0x17f)+_0x28ce5e+')';}export function getAuthHeaders(_0x466022,_0x265cb1){const _0x40a5a0=a48_0x2566,_0x694790=getVersion(),_0x5af30f={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x694790};return _0x265cb1&&(_0x5af30f['Authorization']=_0x40a5a0(0x183)+_0x265cb1),_0x5af30f;}export function toHeaderRecord(_0xf0ec0c){const _0x11bbc9={};for(const [_0x57f96c,_0xeb3bdb]of Object['entries'](_0xf0ec0c)){_0xeb3bdb!==undefined&&(_0x11bbc9[_0x57f96c]=_0xeb3bdb);}return _0x11bbc9;}export function getTrinoHeaders(_0x1bbe45,_0x53879d){const _0x3d1808=a48_0x2566,_0x420f44=getAuthHeaders(_0x1bbe45,_0x53879d),_0x9208b5=toHeaderRecord(_0x420f44);return delete _0x9208b5['Authorization'],_0x53879d&&(_0x9208b5[_0x3d1808(0x18c)]=_0x53879d),_0x9208b5;}export function hasAPIKey(_0x19eefa){const _0x145e32=a48_0x2566,_0x26f350=getAPIKey();return _0x26f350!==undefined&&_0x26f350[_0x145e32(0x182)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4d2dee,_0x553ede){const _0xee1873=a49_0x564d,_0x1a75dc=_0x4d2dee();while(!![]){try{const _0x566046=-parseInt(_0xee1873(0x1c2))/0x1+-parseInt(_0xee1873(0x1d2))/0x2*(-parseInt(_0xee1873(0x1a5))/0x3)+-parseInt(_0xee1873(0x1a3))/0x4*(parseInt(_0xee1873(0x1a8))/0x5)+-parseInt(_0xee1873(0x18e))/0x6+-parseInt(_0xee1873(0x19d))/0x7*(parseInt(_0xee1873(0x1d3))/0x8)+parseInt(_0xee1873(0x1bf))/0x9+parseInt(_0xee1873(0x1b1))/0xa;if(_0x566046===_0x553ede)break;else _0x1a75dc['push'](_0x1a75dc['shift']());}catch(_0x2336e9){_0x1a75dc['push'](_0x1a75dc['shift']());}}}(a49_0x46d2,0x7e439));import{writeFileSync}from'fs';function a49_0x46d2(){const _0x26057a=['isInteger','spawn','format','boolean','stdout','[params]','padEnd','double','2qPjGwj','3655168ISnmcM','table','3326406RuMzGu','number','trim','end','isTTY','resolve','params','magenta','bold','object','json','repeat','rule','entries','varchar','14QXoGXt','─┴─','output','[rule]','[logs]','FINISHED','699824eRvbbA','Results\x20saved\x20to\x20','2375061hPeIpu','tsv','error','15TDvgmV','log','length','query','jsonl','keys','yellow','string','inherit','20308920KDHPdt','close','pipe','stderr','max','write','map','-FXRSn','debug','push','less','stdin','split','forEach','4948641xFCRhC','sdk-result','filter','862190abYCTt','limit','bigint','join','cmdout','stringify','noColor','[query]'];a49_0x46d2=function(){return _0x26057a;};return a49_0x46d2();}import{spawn}from'child_process';function a49_0x564d(_0x1e47a8,_0x18724d){_0x1e47a8=_0x1e47a8-0x18e;const _0x46d2bb=a49_0x46d2();let _0x564de4=_0x46d2bb[_0x1e47a8];return _0x564de4;}import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a49_0x586835 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x57774f){const _0x326540=a49_0x564d;return _0x57774f[_0x326540(0x1cc)]===_0x326540(0x198)||_0x57774f['format']===_0x326540(0x1ac)||_0x57774f[_0x326540(0x1cc)]==='tsv'||_0x57774f[_0x326540(0x1cc)]==='table'||_0x57774f[_0x326540(0x198)]===!![]||_0x57774f[_0x326540(0x1ac)]===!![]||_0x57774f[_0x326540(0x1a6)]===!![]||_0x57774f['table']===!![];}export function parseOutputOptions(_0x2c7301){const _0x132261=a49_0x564d;return{'format':_0x2c7301[_0x132261(0x1cc)]||'table','output':_0x2c7301[_0x132261(0x19f)]||'','limit':_0x2c7301[_0x132261(0x1c3)],'color':_0x2c7301['color'],'noColor':_0x2c7301[_0x132261(0x1c8)]};}function convertSDKResultToQueryResult(_0x376dd0){const _0x40f924=a49_0x564d,_0x22de3c=[];if(_0x376dd0['length']>0x0){const _0x2f9be8=_0x376dd0[0x0];for(const [_0x4f1e83,_0x2acc72]of Object[_0x40f924(0x19b)](_0x2f9be8)){let _0x4e1e0d=_0x40f924(0x19c);if(typeof _0x2acc72===_0x40f924(0x18f))_0x4e1e0d=Number[_0x40f924(0x1ca)](_0x2acc72)?_0x40f924(0x1c4):_0x40f924(0x1d1);else{if(typeof _0x2acc72==='boolean')_0x4e1e0d=_0x40f924(0x1cd);else _0x2acc72===null&&(_0x4e1e0d=_0x40f924(0x19c));}_0x22de3c[_0x40f924(0x1ba)]({'name':_0x4f1e83,'type':_0x4e1e0d});}}return{'queryId':_0x40f924(0x1c0),'columns':_0x22de3c,'data':_0x376dd0,'stats':{'state':_0x40f924(0x1a2),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x376dd0[_0x40f924(0x1aa)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0xe50f78,_0x209fb7){const _0x28f348=convertSDKResultToQueryResult(_0xe50f78);return formatQueryOutput(_0x28f348,_0x209fb7);}export async function formatQueryOutput(_0x1f4efe,_0x29924e){const _0x14e44f=a49_0x564d,{format:_0x3be6c6,limit:_0x235a65,output:_0x190ffd,color:_0x18946b,noColor:_0x3ac533}=_0x29924e,_0x4b1e94=Boolean(_0x190ffd)&&!_0x18946b,_0x571c85={'color':_0x18946b,'noColor':_0x3ac533||_0x4b1e94};if(_0x3be6c6===_0x14e44f(0x1d4)){const _0x230e03=shouldUseLess(_0x3be6c6,_0x190ffd);return formatAsTable(_0x1f4efe,_0x235a65,_0x230e03,_0x571c85);}else{if(_0x3be6c6==='json')return formatAsJSON(_0x1f4efe,_0x571c85);else return _0x3be6c6==='jsonl'?formatAsJSONL(_0x1f4efe,_0x571c85):formatQueryResult(_0x1f4efe,_0x3be6c6);}}function shouldUseLess(_0x26a6ea,_0x1daae3){const _0x1e3650=a49_0x564d;return(_0x26a6ea===_0x1e3650(0x1d4)||_0x26a6ea==='list')&&process[_0x1e3650(0x1ce)][_0x1e3650(0x192)]&&!_0x1daae3;}export function resolveOutputOptions(_0x59fbf7){const _0x5c0f47=a49_0x564d,_0x58877b=resolveOutputFormat(_0x59fbf7[_0x5c0f47(0x1cc)],_0x59fbf7[_0x5c0f47(0x19f)],_0x5c0f47(0x1d4));let _0x42425a=typeof _0x59fbf7[_0x5c0f47(0x1c3)]==='number'?_0x59fbf7['limit']:parseInt(_0x59fbf7[_0x5c0f47(0x1c3)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x4341d3=_0x59fbf7[_0x5c0f47(0x19f)]||'';return shouldUseLess(_0x58877b,_0x4341d3)&&(_0x42425a=Infinity),{'format':_0x58877b,'output':_0x4341d3,'limit':_0x42425a,'color':_0x59fbf7['color'],'noColor':_0x59fbf7['noColor']};}export function writeOutput(_0x228b90,_0x5d8783,_0x26965a){const _0x3f2d1a=a49_0x564d;return _0x5d8783?(writeFileSync(_0x5d8783,_0x228b90),console['error'](_0x3f2d1a(0x1a4)+_0x5d8783),Promise[_0x3f2d1a(0x193)]()):shouldUseLess(_0x26965a||'','')?new Promise(_0x418b70=>{const _0x23e00f=_0x3f2d1a,_0x4867b4=spawn(_0x23e00f(0x1bb),[_0x23e00f(0x1b8)],{'stdio':[_0x23e00f(0x1b3),_0x23e00f(0x1b0),_0x23e00f(0x1b0)]});let _0x24683f=![];_0x4867b4['on']('error',()=>{const _0x5108a1=_0x23e00f;!_0x24683f&&(_0x24683f=!![],console[_0x5108a1(0x1a9)](_0x228b90),_0x418b70());}),_0x4867b4['on'](_0x23e00f(0x1b2),()=>{!_0x24683f&&(_0x24683f=!![],_0x418b70());}),_0x4867b4['on'](_0x23e00f(0x1cb),()=>{const _0x4a641b=_0x23e00f;!_0x24683f&&_0x4867b4[_0x4a641b(0x1bc)]&&(_0x4867b4['stdin']['on'](_0x4a641b(0x1a7),()=>{}),_0x4867b4[_0x4a641b(0x1bc)][_0x4a641b(0x1b6)](_0x228b90),_0x4867b4['stdin'][_0x4a641b(0x191)]());}),!_0x4867b4[_0x23e00f(0x1bc)]&&(!_0x24683f&&(_0x24683f=!![],console['log'](_0x228b90),_0x418b70()));}):(console[_0x3f2d1a(0x1a9)](_0x228b90),Promise[_0x3f2d1a(0x193)]());}export async function handleSDKOutput(_0x51f76b,_0x232799){const _0x231d20=resolveOutputOptions(_0x232799),_0x4028e2=await formatSDKOutput(_0x51f76b,_0x231d20);await writeOutput(_0x4028e2,_0x231d20['output']||undefined,_0x231d20['format']);}export async function handleQueryOutput(_0x1e1b61,_0xdbce03){const _0x1befaa=a49_0x564d,_0x3a3253=resolveOutputOptions(_0xdbce03),_0x59031b=await formatQueryOutput(_0x1e1b61,_0x3a3253);await writeOutput(_0x59031b,_0x3a3253[_0x1befaa(0x19f)]||undefined,_0x3a3253[_0x1befaa(0x1cc)]);}async function formatSingleObject(_0x3559a5,_0x1d9ad5){const _0x499a65=a49_0x564d,{format:_0x26c27e,color:_0x251653,noColor:_0x309fb7}=_0x1d9ad5,_0x3f9aa={'color':_0x251653,'noColor':_0x309fb7};if(_0x26c27e===_0x499a65(0x198)){if(shouldUseColor(_0x3f9aa))return colorizeJSON(_0x3559a5,_0x3f9aa);return JSON[_0x499a65(0x1c7)](_0x3559a5,null,0x2);}else{if(_0x26c27e===_0x499a65(0x1ac)){if(shouldUseColor(_0x3f9aa))return colorizeJSONCompact(_0x3559a5,_0x3f9aa);return JSON[_0x499a65(0x1c7)](_0x3559a5);}else{if(_0x26c27e===_0x499a65(0x1a6))return Object[_0x499a65(0x19b)](_0x3559a5)['map'](([_0x166c1f,_0x3c8bb3])=>_0x166c1f+'\x09'+_0x3c8bb3)[_0x499a65(0x1c5)]('\x0a');else{const _0x2bc17e=Object[_0x499a65(0x19b)](_0x3559a5);if(_0x2bc17e[_0x499a65(0x1aa)]===0x0)return'No\x20data';const _0x5d86ee=_0x3559a5['debug'],_0x454123=_0x3559a5['query'],_0x4914fe=_0x3559a5['params'],_0x4f164d=_0x3559a5[_0x499a65(0x19a)],_0x4a4fc4=_0x454123?typeof _0x454123===_0x499a65(0x1af)?_0x454123:JSON['stringify'](_0x454123,null,0x2):undefined,_0x3ecde9=_0x4914fe&&Object[_0x499a65(0x1ad)](_0x4914fe)[_0x499a65(0x1aa)]>0x0?JSON[_0x499a65(0x1c7)](_0x4914fe,null,0x2):undefined,_0x429144=_0x4f164d&&Object[_0x499a65(0x1ad)](_0x4f164d)[_0x499a65(0x1aa)]>0x0?JSON[_0x499a65(0x1c7)](_0x4f164d,null,0x2):undefined,_0x2d85ec=_0x2bc17e[_0x499a65(0x1c1)](([_0x32b505])=>_0x32b505!==_0x499a65(0x1b9)&&_0x32b505!==_0x499a65(0x1ab)&&_0x32b505!==_0x499a65(0x194)&&_0x32b505!==_0x499a65(0x19a)),_0x5a7ec3=Math[_0x499a65(0x1b5)](..._0x2d85ec[_0x499a65(0x1b7)](([_0x1d69e2])=>_0x1d69e2[_0x499a65(0x1aa)])),_0x374fc0=Math[_0x499a65(0x1b5)](..._0x2d85ec[_0x499a65(0x1b7)](([,_0x359f4e])=>{const _0x393dde=_0x499a65;try{const _0x27e203=_0x359f4e===null||_0x359f4e===undefined?'':typeof _0x359f4e===_0x393dde(0x197)?JSON[_0x393dde(0x1c7)](_0x359f4e):String(_0x359f4e),_0x3c47c1=_0x27e203[_0x393dde(0x1bd)]('\x0a');return Math[_0x393dde(0x1b5)](..._0x3c47c1['map'](_0x44c164=>_0x44c164[_0x393dde(0x1aa)]),0x0);}catch{return 0x0;}}),0x14),_0x483418=[];_0x483418[_0x499a65(0x1ba)](colorBorder('┌─'+'─'[_0x499a65(0x199)](_0x5a7ec3)+'─┬─'+'─'[_0x499a65(0x199)](_0x374fc0)+'─┐',_0x3f9aa)),_0x2d85ec[_0x499a65(0x1be)](([_0x3c6ea3,_0x36b9f5])=>{const _0x3f1168=_0x499a65;let _0x3a8fcc;try{_0x3a8fcc=_0x36b9f5===null||_0x36b9f5===undefined?'':typeof _0x36b9f5===_0x3f1168(0x197)?JSON[_0x3f1168(0x1c7)](_0x36b9f5):String(_0x36b9f5);}catch{_0x3a8fcc='[Object]';}const _0x1e6edb=_0x3c6ea3[_0x3f1168(0x1d0)](_0x5a7ec3),_0x164a8d=_0x3a8fcc[_0x3f1168(0x1bd)]('\x0a');_0x164a8d[_0x3f1168(0x1be)]((_0x1501fb,_0x319b74)=>{const _0xa95d8=_0x3f1168,_0x17427f=colorBorder('│',_0x3f9aa);_0x319b74===0x0?_0x483418[_0xa95d8(0x1ba)](_0x17427f+'\x20'+_0x1e6edb+'\x20'+_0x17427f+'\x20'+_0x1501fb[_0xa95d8(0x1d0)](_0x374fc0)+'\x20'+_0x17427f):_0x483418['push'](_0x17427f+'\x20'+'\x20'['repeat'](_0x5a7ec3)+'\x20'+_0x17427f+'\x20'+_0x1501fb[_0xa95d8(0x1d0)](_0x374fc0)+'\x20'+_0x17427f);});}),_0x483418[_0x499a65(0x1ba)](colorBorder('└─'+'─'['repeat'](_0x5a7ec3)+_0x499a65(0x19e)+'─'['repeat'](_0x374fc0)+'─┘',_0x3f9aa));_0x4a4fc4&&(_0x483418[_0x499a65(0x1ba)](''),_0x483418[_0x499a65(0x1ba)](String(a49_0x586835[_0x499a65(0x1ae)]['bold'](_0x499a65(0x1c9)))),_0x483418[_0x499a65(0x1ba)](_0x4a4fc4));_0x3ecde9&&(_0x483418[_0x499a65(0x1ba)](''),_0x483418[_0x499a65(0x1ba)](String(a49_0x586835['blue']['bold'](_0x499a65(0x1cf)))),_0x483418[_0x499a65(0x1ba)](_0x3ecde9));_0x429144&&(_0x483418['push'](''),_0x483418['push'](String(a49_0x586835[_0x499a65(0x195)][_0x499a65(0x196)](_0x499a65(0x1a0)))),_0x483418[_0x499a65(0x1ba)](_0x429144));if(_0x5d86ee){if(_0x5d86ee[_0x499a65(0x1b4)]){_0x483418[_0x499a65(0x1ba)](''),_0x483418[_0x499a65(0x1ba)](String(a49_0x586835['red'][_0x499a65(0x196)]('[error]')));const _0x574956=_0x5d86ee['stderr'][_0x499a65(0x1bd)]('\x0a');_0x574956[_0x499a65(0x1be)](_0x1effef=>{const _0x10e29a=_0x499a65;_0x1effef[_0x10e29a(0x190)]()&&_0x483418[_0x10e29a(0x1ba)](_0x1effef);});}if(_0x5d86ee['cmdout']){_0x483418['push'](''),_0x483418[_0x499a65(0x1ba)](String(a49_0x586835['cyan'][_0x499a65(0x196)](_0x499a65(0x1a1))));const _0x12fc08=_0x5d86ee[_0x499a65(0x1c6)][_0x499a65(0x1bd)]('\x0a');_0x12fc08['forEach'](_0x3ad0cc=>{const _0x418d0e=_0x499a65;_0x3ad0cc['trim']()&&_0x483418[_0x418d0e(0x1ba)](_0x3ad0cc);});}}return _0x483418[_0x499a65(0x1c5)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x15735b,_0x3cefdd){const _0x2a9a61=a49_0x564d;if(_0x3cefdd[_0x2a9a61(0x1cc)]===_0x2a9a61(0x1d4)){await handleSDKOutput([_0x15735b],_0x3cefdd);return;}const _0x29a172=resolveOutputOptions(_0x3cefdd),_0x1762e2=await formatSingleObject(_0x15735b,_0x29a172);await writeOutput(_0x1762e2,_0x29a172['output']||undefined,_0x29a172[_0x2a9a61(0x1cc)]);}
|
|
1
|
+
(function(_0x79baa3,_0x3c95e2){const _0x2a8a7d=a49_0x2137,_0xb47097=_0x79baa3();while(!![]){try{const _0x565178=parseInt(_0x2a8a7d(0xbf))/0x1*(-parseInt(_0x2a8a7d(0xd6))/0x2)+-parseInt(_0x2a8a7d(0xac))/0x3+parseInt(_0x2a8a7d(0xa8))/0x4+parseInt(_0x2a8a7d(0xa6))/0x5+parseInt(_0x2a8a7d(0xbc))/0x6*(parseInt(_0x2a8a7d(0x94))/0x7)+-parseInt(_0x2a8a7d(0xb7))/0x8+parseInt(_0x2a8a7d(0xa3))/0x9*(parseInt(_0x2a8a7d(0xb1))/0xa);if(_0x565178===_0x3c95e2)break;else _0xb47097['push'](_0xb47097['shift']());}catch(_0x4fdb22){_0xb47097['push'](_0xb47097['shift']());}}}(a49_0x55d5,0x655c5));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 a49_0x533426 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x56ed2f){const _0x1a686d=a49_0x2137;return _0x56ed2f['format']===_0x1a686d(0xba)||_0x56ed2f[_0x1a686d(0xbe)]===_0x1a686d(0x9b)||_0x56ed2f[_0x1a686d(0xbe)]===_0x1a686d(0xcb)||_0x56ed2f[_0x1a686d(0xbe)]===_0x1a686d(0xc3)||_0x56ed2f['json']===!![]||_0x56ed2f[_0x1a686d(0x9b)]===!![]||_0x56ed2f[_0x1a686d(0xcb)]===!![]||_0x56ed2f['table']===!![];}export function parseOutputOptions(_0x235b12){const _0x29707c=a49_0x2137;return{'format':_0x235b12['format']||_0x29707c(0xc3),'output':_0x235b12['output']||'','limit':_0x235b12['limit'],'color':_0x235b12[_0x29707c(0xd9)],'noColor':_0x235b12['noColor']};}function convertSDKResultToQueryResult(_0x497380){const _0x4d5c50=a49_0x2137,_0x232d1c=[];if(_0x497380[_0x4d5c50(0xc6)]>0x0){const _0x52fc64=_0x497380[0x0];for(const [_0x5b264c,_0x51a7cd]of Object[_0x4d5c50(0xb9)](_0x52fc64)){let _0x3729dd=_0x4d5c50(0xb8);if(typeof _0x51a7cd===_0x4d5c50(0x9f))_0x3729dd=Number[_0x4d5c50(0xb6)](_0x51a7cd)?_0x4d5c50(0xc5):_0x4d5c50(0xb5);else{if(typeof _0x51a7cd==='boolean')_0x3729dd=_0x4d5c50(0xad);else _0x51a7cd===null&&(_0x3729dd=_0x4d5c50(0xb8));}_0x232d1c['push']({'name':_0x5b264c,'type':_0x3729dd});}}return{'queryId':_0x4d5c50(0xd1),'columns':_0x232d1c,'data':_0x497380,'stats':{'state':_0x4d5c50(0xa1),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x497380['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x16bef4,_0x432a33){const _0x518bcd=convertSDKResultToQueryResult(_0x16bef4);return formatQueryOutput(_0x518bcd,_0x432a33);}export async function formatQueryOutput(_0x1494ca,_0x287d0b){const _0x43280d=a49_0x2137,{format:_0x4f8796,limit:_0x266867,output:_0x46d8d7,color:_0x32652b,noColor:_0x1c1028}=_0x287d0b,_0x4d9b73=Boolean(_0x46d8d7)&&!_0x32652b,_0x18141d={'color':_0x32652b,'noColor':_0x1c1028||_0x4d9b73};if(_0x4f8796==='table'){const _0x598090=shouldUseLess(_0x4f8796,_0x46d8d7);return formatAsTable(_0x1494ca,_0x266867,_0x598090,_0x18141d);}else{if(_0x4f8796===_0x43280d(0xba))return formatAsJSON(_0x1494ca,_0x18141d);else return _0x4f8796==='jsonl'?formatAsJSONL(_0x1494ca,_0x18141d):formatQueryResult(_0x1494ca,_0x4f8796);}}function shouldUseLess(_0xa039b7,_0x3bb463){const _0x2a87fe=a49_0x2137;return(_0xa039b7==='table'||_0xa039b7===_0x2a87fe(0xd8))&&process[_0x2a87fe(0x95)][_0x2a87fe(0x93)]&&!_0x3bb463;}export function resolveOutputOptions(_0x1435f0){const _0x5e0b0b=a49_0x2137,_0x52e876=resolveOutputFormat(_0x1435f0[_0x5e0b0b(0xbe)],_0x1435f0['output'],_0x5e0b0b(0xc3));let _0x22c96f=typeof _0x1435f0[_0x5e0b0b(0xa2)]===_0x5e0b0b(0x9f)?_0x1435f0[_0x5e0b0b(0xa2)]:parseInt(_0x1435f0['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x1be9b7=_0x1435f0[_0x5e0b0b(0xcc)]||'';return shouldUseLess(_0x52e876,_0x1be9b7)&&(_0x22c96f=Infinity),{'format':_0x52e876,'output':_0x1be9b7,'limit':_0x22c96f,'color':_0x1435f0['color'],'noColor':_0x1435f0['noColor']};}export function writeOutput(_0x970249,_0xbc61f2,_0x564588){const _0x3074f7=a49_0x2137;return _0xbc61f2?(writeFileSync(_0xbc61f2,_0x970249),console[_0x3074f7(0xc0)](_0x3074f7(0x9a)+_0xbc61f2),Promise[_0x3074f7(0xd2)]()):shouldUseLess(_0x564588||'','')?new Promise(_0x52bc22=>{const _0x549802=_0x3074f7,_0x22893a=spawn('less',['-FXRSn'],{'stdio':['pipe',_0x549802(0xa4),_0x549802(0xa4)]});let _0x4618a0=![];_0x22893a['on'](_0x549802(0xc0),()=>{const _0x2248f9=_0x549802;!_0x4618a0&&(_0x4618a0=!![],console[_0x2248f9(0x9c)](_0x970249),_0x52bc22());}),_0x22893a['on'](_0x549802(0xcf),()=>{!_0x4618a0&&(_0x4618a0=!![],_0x52bc22());}),_0x22893a['on'](_0x549802(0xbb),()=>{const _0x14e571=_0x549802;!_0x4618a0&&_0x22893a[_0x14e571(0xa9)]&&(_0x22893a[_0x14e571(0xa9)]['on'](_0x14e571(0xc0),()=>{}),_0x22893a['stdin'][_0x14e571(0xab)](_0x970249),_0x22893a[_0x14e571(0xa9)][_0x14e571(0xce)]());}),!_0x22893a[_0x549802(0xa9)]&&(!_0x4618a0&&(_0x4618a0=!![],console['log'](_0x970249),_0x52bc22()));}):(console[_0x3074f7(0x9c)](_0x970249),Promise['resolve']());}export async function handleSDKOutput(_0x26f3ae,_0x106c51){const _0x1cf3f1=a49_0x2137,_0x53ab75=resolveOutputOptions(_0x106c51),_0x12d8a0=await formatSDKOutput(_0x26f3ae,_0x53ab75);await writeOutput(_0x12d8a0,_0x53ab75[_0x1cf3f1(0xcc)]||undefined,_0x53ab75[_0x1cf3f1(0xbe)]);}function a49_0x2137(_0xc91098,_0x4f357a){_0xc91098=_0xc91098-0x93;const _0x55d515=a49_0x55d5();let _0x213737=_0x55d515[_0xc91098];return _0x213737;}export async function handleQueryOutput(_0x5bdd2b,_0x187043){const _0x2a6d69=a49_0x2137,_0x2ec2d8=resolveOutputOptions(_0x187043),_0x5b5545=await formatQueryOutput(_0x5bdd2b,_0x2ec2d8);await writeOutput(_0x5b5545,_0x2ec2d8[_0x2a6d69(0xcc)]||undefined,_0x2ec2d8['format']);}function a49_0x55d5(){const _0x25fcc6=['221416zMrssz','stdin','yellow','write','894696vAmaax','boolean','max','[logs]','params','5441320hXXHEM','debug','bold','[Object]','double','isInteger','4214304PyJFEH','varchar','entries','json','spawn','6OcTerL','─┬─','format','359763FLqPJN','error','cmdout','blue','table','push','bigint','length','padEnd','string','trim','[query]','tsv','output','[rule]','end','close','forEach','sdk-result','resolve','stderr','query','[error]','2auOqen','filter','list','color','isTTY','505134ixBFpC','stdout','split','No\x20data','stringify','keys','Results\x20saved\x20to\x20','jsonl','log','[params]','repeat','number','rule','FINISHED','limit','18ApbxhJ','inherit','join','1920880hPTeXx','map'];a49_0x55d5=function(){return _0x25fcc6;};return a49_0x55d5();}async function formatSingleObject(_0x161225,_0x522fe3){const _0x5b7dc8=a49_0x2137,{format:_0x55680f,color:_0x3bf941,noColor:_0x13d47c}=_0x522fe3,_0x4c28c9={'color':_0x3bf941,'noColor':_0x13d47c};if(_0x55680f===_0x5b7dc8(0xba)){if(shouldUseColor(_0x4c28c9))return colorizeJSON(_0x161225,_0x4c28c9);return JSON[_0x5b7dc8(0x98)](_0x161225,null,0x2);}else{if(_0x55680f===_0x5b7dc8(0x9b)){if(shouldUseColor(_0x4c28c9))return colorizeJSONCompact(_0x161225,_0x4c28c9);return JSON['stringify'](_0x161225);}else{if(_0x55680f==='tsv')return Object[_0x5b7dc8(0xb9)](_0x161225)['map'](([_0x478ae8,_0x55d7f8])=>_0x478ae8+'\x09'+_0x55d7f8)[_0x5b7dc8(0xa5)]('\x0a');else{const _0x25eca9=Object[_0x5b7dc8(0xb9)](_0x161225);if(_0x25eca9[_0x5b7dc8(0xc6)]===0x0)return _0x5b7dc8(0x97);const _0x24a8db=_0x161225[_0x5b7dc8(0xb2)],_0xe66d24=_0x161225[_0x5b7dc8(0xd4)],_0x29d64e=_0x161225[_0x5b7dc8(0xb0)],_0x59c6ba=_0x161225[_0x5b7dc8(0xa0)],_0x5a462d=_0xe66d24?typeof _0xe66d24===_0x5b7dc8(0xc8)?_0xe66d24:JSON[_0x5b7dc8(0x98)](_0xe66d24,null,0x2):undefined,_0x186d2e=_0x29d64e&&Object[_0x5b7dc8(0x99)](_0x29d64e)['length']>0x0?JSON[_0x5b7dc8(0x98)](_0x29d64e,null,0x2):undefined,_0x2e52ed=_0x59c6ba&&Object['keys'](_0x59c6ba)[_0x5b7dc8(0xc6)]>0x0?JSON['stringify'](_0x59c6ba,null,0x2):undefined,_0x261229=_0x25eca9[_0x5b7dc8(0xd7)](([_0x4c4639])=>_0x4c4639!==_0x5b7dc8(0xb2)&&_0x4c4639!==_0x5b7dc8(0xd4)&&_0x4c4639!=='params'&&_0x4c4639!==_0x5b7dc8(0xa0)),_0x1650fe=Math[_0x5b7dc8(0xae)](..._0x261229[_0x5b7dc8(0xa7)](([_0x35efdc])=>_0x35efdc[_0x5b7dc8(0xc6)])),_0xd69065=Math[_0x5b7dc8(0xae)](..._0x261229[_0x5b7dc8(0xa7)](([,_0x326b51])=>{const _0x129837=_0x5b7dc8;try{const _0x4b5713=_0x326b51===null||_0x326b51===undefined?'':typeof _0x326b51==='object'?JSON['stringify'](_0x326b51):String(_0x326b51),_0x53ed5b=_0x4b5713[_0x129837(0x96)]('\x0a');return Math[_0x129837(0xae)](..._0x53ed5b[_0x129837(0xa7)](_0x15ee70=>_0x15ee70['length']),0x0);}catch{return 0x0;}}),0x14),_0x59bf23=[];_0x59bf23[_0x5b7dc8(0xc4)](colorBorder('┌─'+'─'[_0x5b7dc8(0x9e)](_0x1650fe)+_0x5b7dc8(0xbd)+'─'[_0x5b7dc8(0x9e)](_0xd69065)+'─┐',_0x4c28c9)),_0x261229[_0x5b7dc8(0xd0)](([_0x3c2da0,_0x552e7c])=>{const _0x25b12b=_0x5b7dc8;let _0xdf72a1;try{_0xdf72a1=_0x552e7c===null||_0x552e7c===undefined?'':typeof _0x552e7c==='object'?JSON[_0x25b12b(0x98)](_0x552e7c):String(_0x552e7c);}catch{_0xdf72a1=_0x25b12b(0xb4);}const _0x57a967=_0x3c2da0['padEnd'](_0x1650fe),_0x892416=_0xdf72a1[_0x25b12b(0x96)]('\x0a');_0x892416['forEach']((_0x1bc380,_0x5e2f5e)=>{const _0x1818c6=_0x25b12b,_0x4087ca=colorBorder('│',_0x4c28c9);_0x5e2f5e===0x0?_0x59bf23[_0x1818c6(0xc4)](_0x4087ca+'\x20'+_0x57a967+'\x20'+_0x4087ca+'\x20'+_0x1bc380[_0x1818c6(0xc7)](_0xd69065)+'\x20'+_0x4087ca):_0x59bf23['push'](_0x4087ca+'\x20'+'\x20'[_0x1818c6(0x9e)](_0x1650fe)+'\x20'+_0x4087ca+'\x20'+_0x1bc380['padEnd'](_0xd69065)+'\x20'+_0x4087ca);});}),_0x59bf23[_0x5b7dc8(0xc4)](colorBorder('└─'+'─'[_0x5b7dc8(0x9e)](_0x1650fe)+'─┴─'+'─'[_0x5b7dc8(0x9e)](_0xd69065)+'─┘',_0x4c28c9));_0x5a462d&&(_0x59bf23['push'](''),_0x59bf23[_0x5b7dc8(0xc4)](String(a49_0x533426[_0x5b7dc8(0xaa)][_0x5b7dc8(0xb3)](_0x5b7dc8(0xca)))),_0x59bf23[_0x5b7dc8(0xc4)](_0x5a462d));_0x186d2e&&(_0x59bf23[_0x5b7dc8(0xc4)](''),_0x59bf23[_0x5b7dc8(0xc4)](String(a49_0x533426[_0x5b7dc8(0xc2)][_0x5b7dc8(0xb3)](_0x5b7dc8(0x9d)))),_0x59bf23[_0x5b7dc8(0xc4)](_0x186d2e));_0x2e52ed&&(_0x59bf23['push'](''),_0x59bf23['push'](String(a49_0x533426['magenta'][_0x5b7dc8(0xb3)](_0x5b7dc8(0xcd)))),_0x59bf23[_0x5b7dc8(0xc4)](_0x2e52ed));if(_0x24a8db){if(_0x24a8db['stderr']){_0x59bf23[_0x5b7dc8(0xc4)](''),_0x59bf23['push'](String(a49_0x533426['red'][_0x5b7dc8(0xb3)](_0x5b7dc8(0xd5))));const _0x47f4e2=_0x24a8db[_0x5b7dc8(0xd3)][_0x5b7dc8(0x96)]('\x0a');_0x47f4e2[_0x5b7dc8(0xd0)](_0x20207d=>{const _0x95325a=_0x5b7dc8;_0x20207d[_0x95325a(0xc9)]()&&_0x59bf23[_0x95325a(0xc4)](_0x20207d);});}if(_0x24a8db[_0x5b7dc8(0xc1)]){_0x59bf23['push'](''),_0x59bf23[_0x5b7dc8(0xc4)](String(a49_0x533426['cyan'][_0x5b7dc8(0xb3)](_0x5b7dc8(0xaf))));const _0x35adeb=_0x24a8db[_0x5b7dc8(0xc1)][_0x5b7dc8(0x96)]('\x0a');_0x35adeb[_0x5b7dc8(0xd0)](_0xaceea5=>{const _0x236d4e=_0x5b7dc8;_0xaceea5[_0x236d4e(0xc9)]()&&_0x59bf23[_0x236d4e(0xc4)](_0xaceea5);});}}return _0x59bf23[_0x5b7dc8(0xa5)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2c462f,_0x2b7c77){const _0x4a769a=a49_0x2137;if(_0x2b7c77['format']===_0x4a769a(0xc3)){await handleSDKOutput([_0x2c462f],_0x2b7c77);return;}const _0x21f811=resolveOutputOptions(_0x2b7c77),_0x412b2c=await formatSingleObject(_0x2c462f,_0x21f811);await writeOutput(_0x412b2c,_0x21f811[_0x4a769a(0xcc)]||undefined,_0x21f811['format']);}
|