@treasuredata/tdx 0.28.0 → 0.28.1
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/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.d.ts +6 -0
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/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/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 a46_0x11de4d=a46_0x47c9;function a46_0x47c9(_0x55c284,_0x2ab626){_0x55c284=_0x55c284-0x169;const _0x5a96e1=a46_0x5a96();let _0x47c9bc=_0x5a96e1[_0x55c284];return _0x47c9bc;}(function(_0x4c71c9,_0x325011){const _0x138661=a46_0x47c9,_0x16c9f9=_0x4c71c9();while(!![]){try{const _0x591468=-parseInt(_0x138661(0x2e9))/0x1*(-parseInt(_0x138661(0x1ab))/0x2)+-parseInt(_0x138661(0x1db))/0x3+parseInt(_0x138661(0x1a6))/0x4+parseInt(_0x138661(0x17f))/0x5*(parseInt(_0x138661(0x1b9))/0x6)+parseInt(_0x138661(0x25c))/0x7+-parseInt(_0x138661(0x1c4))/0x8*(parseInt(_0x138661(0x2a4))/0x9)+-parseInt(_0x138661(0x2fe))/0xa*(parseInt(_0x138661(0x19b))/0xb);if(_0x591468===_0x325011)break;else _0x16c9f9['push'](_0x16c9f9['shift']());}catch(_0x581aff){_0x16c9f9['push'](_0x16c9f9['shift']());}}}(a46_0x5a96,0x34e7c));import a46_0x39c6a3 from'chalk';import{existsSync}from'fs';import a46_0x27c8a8 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 a46_0x4a1f33 from'prompts';function getAttemptStatusDisplay(_0x38a554){const _0x30c655=a46_0x47c9;if(!_0x38a554)return{'icon':'⏳','text':''};const {done:_0x9d8082,success:_0x1c4ca9,cancelRequested:_0x2e8431}=_0x38a554;if(!_0x9d8082)return _0x2e8431?{'icon':'🛑','text':a46_0x39c6a3[_0x30c655(0x16c)]('canceling')}:{'icon':'🔄','text':a46_0x39c6a3[_0x30c655(0x191)](_0x30c655(0x2e8))};if(_0x1c4ca9)return{'icon':'✅','text':a46_0x39c6a3[_0x30c655(0x2ea)](_0x30c655(0x221))};return{'icon':'❌','text':a46_0x39c6a3[_0x30c655(0x184)]('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x175703,_0x5e83d3,_0x565b17=0x0){const _0xe545ec=a46_0x47c9;return _0x175703[_0x565b17]||_0x5e83d3[_0xe545ec(0x18c)];}[a46_0x11de4d(0x246)](_0x5abe96,_0x4a2b83,_0xf744e9=0x0){const _0x247556=a46_0x11de4d,_0x5cf8bd=this[_0x247556(0x1a3)](_0x5abe96,_0x4a2b83,_0xf744e9);if(!_0x5cf8bd)return console['error'](a46_0x39c6a3[_0x247556(0x184)](_0x247556(0x2f1)),'Project\x20name\x20is\x20required'),console[_0x247556(0x216)](a46_0x39c6a3[_0x247556(0x2c6)](_0x247556(0x1f2))),null;return _0x5cf8bd;}[a46_0x11de4d(0x201)](_0x2d5bb6,_0x47c75f){const _0x319462=a46_0x11de4d;if(_0x2d5bb6[0x0]){const _0x41b595=_0x2d5bb6[0x0][_0x319462(0x2ae)]('.');if(_0x41b595[_0x319462(0x284)]===0x1)return{'projectName':_0x41b595[0x0],'workflowName':undefined};else return _0x41b595[_0x319462(0x284)]===0x2?{'projectName':_0x41b595[0x0],'workflowName':_0x41b595[0x1]}:(console[_0x319462(0x216)](a46_0x39c6a3['red']('Error:'),_0x319462(0x262)),null);}return{'projectName':_0x47c75f[_0x319462(0x18c)],'workflowName':undefined};}['resolveProjectDir'](_0x2f9749,_0x42099f,_0x3b2499=0x0){const _0x356f7b=a46_0x11de4d;if(_0x2f9749[_0x3b2499])return _0x2f9749[_0x3b2499];if(_0x42099f[_0x356f7b(0x18c)]){const _0x290fde=a46_0x27c8a8[_0x356f7b(0x26a)](process[_0x356f7b(0x1b6)](),'workflows',_0x42099f['workflowProject']);if(existsSync(a46_0x27c8a8['join'](_0x290fde,_0x356f7b(0x1a1))))return _0x290fde;}return undefined;}async['showWorkflowConsoleUrl'](_0x43ff63,_0x163a0e,_0x5280ae){const _0x24ecf1=a46_0x11de4d;try{const _0x25a38b=await _0x43ff63[_0x24ecf1(0x1ec)][_0x24ecf1(0x1af)](_0x163a0e,{'limit':0x1});if(_0x25a38b['length']>0x0){const _0x186361=_0x25a38b[0x0]['id'],_0x272079=getWorkflowUrl(_0x5280ae,_0x186361);console[_0x24ecf1(0x216)](_0x24ecf1(0x2e6)+a46_0x39c6a3[_0x24ecf1(0x1dc)](_0x272079));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x220);[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x25d);async[a46_0x11de4d(0x249)](_0x56d568){const _0x2d5b36=a46_0x11de4d,{options:_0x49d5dd,args:_0x333e76,tdx:_0x216fe3}=_0x56d568,_0x163a45=_0x333e76[0x0],_0x5caad0=_0x49d5dd[_0x2d5b36(0x1f8)];if(_0x5caad0)return saveSessionContext({'workflow_project':undefined},_0x49d5dd[_0x2d5b36(0x190)]),console[_0x2d5b36(0x2f4)](a46_0x39c6a3[_0x2d5b36(0x2ea)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x163a45)return console[_0x2d5b36(0x216)](a46_0x39c6a3[_0x2d5b36(0x184)](_0x2d5b36(0x2f1)),_0x2d5b36(0x19c)),console[_0x2d5b36(0x216)](a46_0x39c6a3[_0x2d5b36(0x2c6)](_0x2d5b36(0x281))),console[_0x2d5b36(0x216)](a46_0x39c6a3['dim'](_0x2d5b36(0x2a0))),0x1;const _0x32dfef=await withSpinner(_0x2d5b36(0x208)+_0x163a45+'\x27...',()=>_0x216fe3[_0x2d5b36(0x1ec)]['resolveProjectId'](_0x163a45),{'verbose':_0x49d5dd['verbose']}),{name:_0x48bcff}=_0x32dfef['data'];return saveSessionContext({'workflow_project':_0x48bcff},_0x49d5dd[_0x2d5b36(0x190)]),console[_0x2d5b36(0x2f4)](a46_0x39c6a3[_0x2d5b36(0x2ea)](_0x2d5b36(0x250)+a46_0x39c6a3['cyan'](_0x48bcff))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a46_0x11de4d(0x1ad);[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x2d4);async['execute'](_0x4f2804){const _0x16b7c5=a46_0x11de4d,{options:_0x444067,args:_0x48fa7f,tdx:_0x1e135e}=_0x4f2804,_0x2223e1=_0x48fa7f[0x0];_0x444067[_0x16b7c5(0x2df)]&&_0x2223e1&&console[_0x16b7c5(0x216)](_0x16b7c5(0x2b4)+_0x2223e1);const _0x1c45af=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x1e135e['workflow'][_0x16b7c5(0x256)](_0x2223e1,{'limit':_0x444067[_0x16b7c5(0x1df)]}),{'verbose':_0x444067[_0x16b7c5(0x2df)]});let _0xca6137=_0x1c45af['data'];_0xca6137['sort']((_0x22d0dd,_0x28afe3)=>_0x22d0dd[_0x16b7c5(0x242)][_0x16b7c5(0x2d9)](_0x28afe3[_0x16b7c5(0x242)]));const _0x1d8aec=_0x444067[_0x16b7c5(0x1df)]||0x64,_0x47c9cd=_0xca6137[_0x16b7c5(0x284)]>=_0x1d8aec?a46_0x39c6a3[_0x16b7c5(0x2c6)](_0x16b7c5(0x29e)):'';console[_0x16b7c5(0x216)](_0x16b7c5(0x199)+_0xca6137[_0x16b7c5(0x284)]+'\x20project'+(_0xca6137[_0x16b7c5(0x284)]!==0x1?'s':'')+_0x47c9cd);if(_0x444067[_0x16b7c5(0x22f)]===_0x16b7c5(0x1bc)||_0x444067[_0x16b7c5(0x22f)]===_0x16b7c5(0x1f4)||_0x444067[_0x16b7c5(0x22f)]===_0x16b7c5(0x300))await handleSDKOutput(_0xca6137,_0x444067);else{if(_0xca6137[_0x16b7c5(0x284)]===0x0)_0x2223e1?console[_0x16b7c5(0x2f4)]('No\x20projects\x20match\x20pattern:\x20'+_0x2223e1):console['log'](_0x16b7c5(0x2c8));else{const _0x1d7779=_0xca6137[_0x16b7c5(0x192)](_0x6dbf39=>{const _0x59be6b=_0x16b7c5,_0x1d6c84=_0x6dbf39[_0x59be6b(0x1e8)]?.[_0x59be6b(0x1c6)](_0x17418a=>_0x17418a[_0x59be6b(0x277)]===_0x59be6b(0x260)),_0x1494a6=_0x1d6c84?a46_0x39c6a3[_0x59be6b(0x2c6)](_0x59be6b(0x23f)):'';return _0x59be6b(0x178)+_0x6dbf39[_0x59be6b(0x242)]+_0x1494a6;});await writeOutput(_0x1d7779[_0x16b7c5(0x26a)]('\x0a'),_0x444067[_0x16b7c5(0x1a9)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x24c);['description']='List\x20workflows';async[a46_0x11de4d(0x249)](_0x45207f){const _0x57057d=a46_0x11de4d,{options:_0x2d83eb,args:_0x25253e,tdx:_0x4f1812}=_0x45207f,_0x394fc3=this[_0x57057d(0x1a3)](_0x25253e,_0x2d83eb);_0x2d83eb['verbose']&&_0x394fc3&&console[_0x57057d(0x216)]('Project\x20filter:\x20'+_0x394fc3);const _0x5182cb=await withSpinner('Listing\x20workflows...',()=>_0x4f1812[_0x57057d(0x1ec)]['workflows'](_0x394fc3,{'limit':_0x2d83eb[_0x57057d(0x1df)]}),{'verbose':_0x2d83eb['verbose']});let _0x287db5=_0x5182cb[_0x57057d(0x2c3)];_0x287db5['sort']((_0x2d0403,_0x23eec4)=>{const _0x3a4961=_0x57057d,_0x535f2a=_0x2d0403[_0x3a4961(0x242)][_0x3a4961(0x2d9)](_0x23eec4['name']);if(_0x535f2a!==0x0)return _0x535f2a;return(_0x2d0403[_0x3a4961(0x1d6)]?.[_0x3a4961(0x242)]||'')[_0x3a4961(0x2d9)](_0x23eec4['project']?.[_0x3a4961(0x242)]||'');});const _0x2c14b1=_0x2d83eb[_0x57057d(0x1df)]||0x64,_0x45ede3=_0x287db5[_0x57057d(0x284)]>=_0x2c14b1?a46_0x39c6a3['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x287db5[_0x57057d(0x284)]+_0x57057d(0x270)+(_0x287db5['length']!==0x1?'s':'')+_0x45ede3);if(_0x2d83eb['format']===_0x57057d(0x1bc)||_0x2d83eb[_0x57057d(0x22f)]===_0x57057d(0x1f4)||_0x2d83eb[_0x57057d(0x22f)]==='table')await handleSDKOutput(_0x287db5,_0x2d83eb);else{if(_0x287db5[_0x57057d(0x284)]===0x0)_0x394fc3?console[_0x57057d(0x2f4)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x394fc3):console[_0x57057d(0x2f4)]('No\x20workflows\x20found');else{const _0x480568=_0x2d83eb[_0x57057d(0x1b1)],_0x1ad1d9=_0x287db5[_0x57057d(0x192)](_0xd9fbb8=>{const _0x2d19ee=_0x57057d,_0x2607c8=a46_0x39c6a3[_0x2d19ee(0x2c6)]('#'+_0xd9fbb8['id']),_0x2faaba=hyperlink(_0x2607c8,getWorkflowUrl(_0x480568,_0xd9fbb8['id'])),_0x53d4c0=_0xd9fbb8[_0x2d19ee(0x1d6)]?.[_0x2d19ee(0x242)]?a46_0x39c6a3['dim']('\x20('+_0xd9fbb8[_0x2d19ee(0x1d6)][_0x2d19ee(0x242)]+')'):'';return _0x2d19ee(0x2d1)+_0x2faaba+'\x20'+_0xd9fbb8['name']+_0x53d4c0;});await writeOutput(_0x1ad1d9['join']('\x0a'),_0x2d83eb[_0x57057d(0x1a9)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x279);[a46_0x11de4d(0x1f7)]='List\x20workflow\x20execution\x20sessions';async['execute'](_0x227738){const _0x30d395=a46_0x11de4d,{options:_0x3d7c4d,args:_0x16ddc3,tdx:_0x5dc30b}=_0x227738,_0x37500e=this[_0x30d395(0x201)](_0x16ddc3,_0x3d7c4d);if(!_0x37500e)return 0x1;const {projectName:_0x1f5043,workflowName:_0x41947b}=_0x37500e;if(_0x3d7c4d[_0x30d395(0x2df)]){if(_0x1f5043&&_0x41947b)console[_0x30d395(0x216)](_0x30d395(0x29a)+_0x1f5043+'.'+_0x41947b);else _0x1f5043&&console[_0x30d395(0x216)](_0x30d395(0x1e4)+_0x1f5043);const _0x152f2a=_0x3d7c4d['status'];_0x152f2a&&console[_0x30d395(0x216)](_0x30d395(0x2d8)+_0x152f2a);}let _0xc70196=0x28;if(process[_0x30d395(0x2d3)][_0x30d395(0x1c8)]&&!_0x3d7c4d[_0x30d395(0x1a9)]&&!_0x3d7c4d[_0x30d395(0x22f)]){const _0x56401e=process[_0x30d395(0x2d3)][_0x30d395(0x264)]||0x28;_0xc70196=Math['max'](0x14,Math['floor'](_0x56401e*0x2/0x3));}const _0x4dd9ce=_0x3d7c4d[_0x30d395(0x1df)]||_0xc70196,_0x19fc4f=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5dc30b['workflow'][_0x30d395(0x1cf)]({'projectName':_0x1f5043,'workflowName':_0x41947b,'status':_0x3d7c4d[_0x30d395(0x189)],'fromTime':_0x3d7c4d[_0x30d395(0x2dd)],'toTime':_0x3d7c4d['to'],'limit':_0x4dd9ce}),{'verbose':_0x3d7c4d['verbose']}),_0x5d79f7=_0x19fc4f[_0x30d395(0x2c3)];_0x5d79f7[_0x30d395(0x1fc)]((_0x4b981e,_0x525608)=>{const _0x14041c=_0x30d395,_0x393f9a=_0x4b981e[_0x14041c(0x21d)]||'',_0x155a14=_0x525608[_0x14041c(0x21d)]||'';return _0x155a14['localeCompare'](_0x393f9a);});_0x5d79f7['length']>=_0x4dd9ce?console[_0x30d395(0x216)](_0x30d395(0x2c1)+_0x5d79f7['length']+'\x20sessions\x20'+a46_0x39c6a3[_0x30d395(0x2c6)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x30d395(0x216)](_0x30d395(0x199)+_0x5d79f7[_0x30d395(0x284)]+'\x20session'+(_0x5d79f7[_0x30d395(0x284)]!==0x1?'s':''));if(_0x3d7c4d['format']===_0x30d395(0x1bc)||_0x3d7c4d[_0x30d395(0x22f)]===_0x30d395(0x1f4)||_0x3d7c4d[_0x30d395(0x22f)]===_0x30d395(0x300))await handleSDKOutput(_0x5d79f7,_0x3d7c4d);else{if(!process[_0x30d395(0x2d3)][_0x30d395(0x1c8)]||_0x3d7c4d[_0x30d395(0x1a9)]){if(_0x5d79f7[_0x30d395(0x284)]===0x0){if(_0x1f5043&&_0x41947b)console[_0x30d395(0x2f4)](_0x30d395(0x212)+_0x1f5043+'.'+_0x41947b);else _0x1f5043?console[_0x30d395(0x2f4)](_0x30d395(0x2ab)+_0x1f5043):console['log'](_0x30d395(0x2ec));}else{const _0x22a8a0=_0x3d7c4d['site'],_0x46bbe2=this[_0x30d395(0x213)](_0x5d79f7,_0x22a8a0);_0x3d7c4d[_0x30d395(0x1a9)]?await writeOutput(_0x46bbe2,_0x3d7c4d[_0x30d395(0x1a9)],_0x30d395(0x237)):console[_0x30d395(0x2f4)](_0x46bbe2);}!_0x1f5043&&(console[_0x30d395(0x216)](''),console[_0x30d395(0x216)](a46_0x39c6a3[_0x30d395(0x2c6)](_0x30d395(0x1b2))),console[_0x30d395(0x216)](a46_0x39c6a3[_0x30d395(0x2c6)](_0x30d395(0x230))+'or'+a46_0x39c6a3[_0x30d395(0x2c6)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x5d79f7[_0x30d395(0x284)]===0x0){if(_0x1f5043&&_0x41947b)console[_0x30d395(0x2f4)](_0x30d395(0x212)+_0x1f5043+'.'+_0x41947b);else _0x1f5043?console[_0x30d395(0x2f4)](_0x30d395(0x2ab)+_0x1f5043):console['log'](_0x30d395(0x2ec));}else await this[_0x30d395(0x2b5)](_0x5d79f7,_0x227738,_0x1f5043);}}return 0x0;}[a46_0x11de4d(0x213)](_0x19d323,_0x35b740){const _0x4b734e=a46_0x11de4d,_0x2e5268=[],_0x1d2c19=new Map();let _0x8a68bd=Infinity,_0x256f90=-Infinity;for(const _0x23733a of _0x19d323){if(_0x23733a[_0x4b734e(0x22e)]?.[_0x4b734e(0x282)]){const _0x5f5d1a=new Date(_0x23733a[_0x4b734e(0x22e)][_0x4b734e(0x282)])[_0x4b734e(0x188)](),_0x33b1da=_0x23733a['lastAttempt'][_0x4b734e(0x175)]?new Date(_0x23733a['lastAttempt'][_0x4b734e(0x175)])['getTime']():Date[_0x4b734e(0x2f3)](),_0x18c22a=_0x23733a[_0x4b734e(0x1d6)]?.[_0x4b734e(0x242)]||'(unknown)';!_0x1d2c19['has'](_0x18c22a)&&_0x1d2c19[_0x4b734e(0x1eb)](_0x18c22a,[]),_0x1d2c19['get'](_0x18c22a)[_0x4b734e(0x2f9)]({'session':_0x23733a,'startTime':_0x5f5d1a,'endTime':_0x33b1da,'duration':_0x33b1da-_0x5f5d1a}),_0x8a68bd=Math[_0x4b734e(0x247)](_0x8a68bd,_0x5f5d1a),_0x256f90=Math[_0x4b734e(0x198)](_0x256f90,_0x33b1da);}}if(_0x1d2c19[_0x4b734e(0x24f)]===0x0)return _0x4b734e(0x2bd);const _0x47d8be=process[_0x4b734e(0x2d3)][_0x4b734e(0x2e2)]||0x78,_0x4b29ba=0x1e,_0x33d10c=0x32,_0x1a7d99=0x4,_0x26f9b1=Math['min'](_0x33d10c,Math['max'](_0x4b29ba,Math[_0x4b734e(0x1e3)](_0x47d8be*0.3))),_0x11036e=_0x47d8be-_0x26f9b1-TIMELINE_CONFIG[_0x4b734e(0x1e1)]-0x3-_0x1a7d99,_0x51162a=_0x256f90-_0x8a68bd,_0x2b9e30=_0x51162a/_0x26f9b1,_0x32d130=renderTimeAxis({'startTime':_0x8a68bd,'endTime':_0x256f90,'durationMs':_0x51162a,'msPerChar':_0x2b9e30},_0x26f9b1),_0x2a6e04=[];for(const _0x125618 of _0x1d2c19[_0x4b734e(0x219)]()){_0x2a6e04[_0x4b734e(0x2f9)](..._0x125618);}_0x2a6e04[_0x4b734e(0x1fc)]((_0x5760a2,_0x48b30e)=>_0x48b30e[_0x4b734e(0x215)]-_0x5760a2[_0x4b734e(0x215)]);const _0x5fa8ec=new Date(_0x8a68bd),_0x316d83=formatDate(_0x5fa8ec),_0x379b4c=_0x1a7d99+TIMELINE_CONFIG[_0x4b734e(0x298)]+TIMELINE_CONFIG[_0x4b734e(0x1a0)]+_0x11036e,_0x2e15ba='\x20'[_0x4b734e(0x2bb)](_0x379b4c-_0x316d83['length']),_0x4c57af=_0x2e15ba+a46_0x39c6a3[_0x4b734e(0x2c6)](_0x316d83)+'\x20'+_0x32d130;_0x2e5268['push'](_0x4c57af);const _0x529107=0x16;let _0x17aff7=0x0;for(const _0x4f397d of _0x2a6e04){const _0x487c25=_0x4f397d[_0x4b734e(0x190)][_0x4b734e(0x1d6)]?.[_0x4b734e(0x242)]||'?',_0x1ab54f=Math[_0x4b734e(0x247)](stringWidth(_0x487c25),_0x529107);_0x17aff7=Math[_0x4b734e(0x198)](_0x17aff7,_0x1ab54f);}for(const _0x5bae06 of _0x2a6e04){const {session:_0xf15001,startTime:_0x3aea13,endTime:_0x10e0dc,duration:_0xe0adc9}=_0x5bae06,_0x44d08d=_0xf15001[_0x4b734e(0x1d6)]?.['id'],_0x350d79=_0xf15001['id'],_0x472d04=_0xf15001[_0x4b734e(0x1d6)]?.['name']||'?',_0x29b63c=_0xf15001[_0x4b734e(0x1ec)]?.[_0x4b734e(0x242)]||'?';let _0x22a5ae,_0x40496e;if(_0xf15001[_0x4b734e(0x22e)]){const _0x1bddd3=_0xf15001[_0x4b734e(0x22e)];!_0x1bddd3[_0x4b734e(0x1fb)]?(_0x22a5ae=_0x1bddd3[_0x4b734e(0x2a8)]?'🛑':'🔄',_0x40496e=_0x1bddd3[_0x4b734e(0x2a8)]?a46_0x39c6a3['yellow']:a46_0x39c6a3[_0x4b734e(0x191)]):(_0x22a5ae=_0x1bddd3[_0x4b734e(0x221)]?'✅':'❌',_0x40496e=_0x1bddd3[_0x4b734e(0x221)]?a46_0x39c6a3[_0x4b734e(0x2ea)]:a46_0x39c6a3[_0x4b734e(0x184)]);}else _0x22a5ae='⏳',_0x40496e=a46_0x39c6a3[_0x4b734e(0x2c6)];const _0x98c33a='#'+_0x350d79,_0x4a2944=_0x44d08d?hyperlink(_0x98c33a,getWorkflowSessionUrl(_0x35b740,_0x44d08d,_0x350d79)):_0x98c33a;let _0x28c14f=_0x472d04;stringWidth(_0x472d04)>_0x529107&&(_0x28c14f=_0x472d04['slice'](0x0,_0x529107-0x1)+'…');const _0x2ee689=a46_0x39c6a3[_0x4b734e(0x2c6)](_0x28c14f),_0x207644=stringWidth(_0x28c14f),_0x39281a='\x20'['repeat'](_0x17aff7-stringWidth(_0x28c14f)+0x2),_0x34c83e='('+formatElapsed(_0xe0adc9)+')',_0x4b11e5=stringWidth(_0x34c83e),_0x54ac9e=stringWidth(_0x98c33a),_0x919621=_0x54ac9e+0x1+_0x207644+_0x39281a[_0x4b734e(0x284)],_0x3dc2fd=_0x11036e-_0x919621-_0x4b11e5-0x1-0x8;let _0x2a9dff=_0x29b63c;stringWidth(_0x2a9dff)>_0x3dc2fd&&(_0x2a9dff=_0x2a9dff[_0x4b734e(0x19a)](0x0,_0x3dc2fd-0x1)+'…');const _0xa52eab=_0x4a2944+'\x20'+_0x2ee689+_0x39281a+_0x2a9dff,_0x2f526b=stringWidth(_0xa52eab),_0xbf99ec=_0x11036e-_0x2f526b-_0x4b11e5,_0xd91d94=_0xa52eab+'\x20'[_0x4b734e(0x2bb)](Math[_0x4b734e(0x198)](0x1,_0xbf99ec))+a46_0x39c6a3[_0x4b734e(0x2c6)](_0x34c83e),_0x227b3e=Math[_0x4b734e(0x1e3)]((_0x3aea13-_0x8a68bd)/_0x2b9e30),_0x224e24=Math[_0x4b734e(0x1e3)]((_0x10e0dc-_0x8a68bd)/_0x2b9e30),_0x2682a7=Math[_0x4b734e(0x198)](_0x227b3e+0x1,_0x224e24),_0x2d5e9f=new Array(_0x26f9b1)[_0x4b734e(0x2ca)]('\x20');for(let _0x41de2f=_0x227b3e;_0x41de2f<Math[_0x4b734e(0x247)](_0x2682a7,_0x26f9b1);_0x41de2f++){_0x2d5e9f[_0x41de2f]='─';}const _0x114234=_0x2d5e9f[_0x4b734e(0x192)](_0xd3e76b=>_0xd3e76b==='\x20'?'\x20':_0x40496e(_0xd3e76b))[_0x4b734e(0x26a)]('');_0x2e5268[_0x4b734e(0x2f9)](_0x22a5ae+'\x20'+_0xd91d94+'│'+_0x114234+'│');}return _0x2e5268['join']('\x0a');}async[a46_0x11de4d(0x2b5)](_0x2fb6ea,_0x549207,_0xd23af3){const _0x561f0e=a46_0x11de4d,{options:_0x1fa23a,tdx:_0x2362e2}=_0x549207,_0xafdfb7=_0x1fa23a[_0x561f0e(0x1b1)],{timelineRows:_0x11a477,timeAxisHeader:_0xce9686}=this[_0x561f0e(0x267)](_0x2fb6ea,_0xafdfb7),_0x5e0bbb=_0x11a477[_0x561f0e(0x1aa)](_0x387094=>_0x387094[_0x561f0e(0x1e9)]);if(_0x5e0bbb[_0x561f0e(0x284)]===0x0){const _0x4bc049=this[_0x561f0e(0x213)](_0x2fb6ea,_0xafdfb7);console[_0x561f0e(0x2f4)](_0x4bc049);!_0xd23af3&&(console[_0x561f0e(0x216)](''),console[_0x561f0e(0x216)](a46_0x39c6a3[_0x561f0e(0x2c6)](_0x561f0e(0x1b2))),console[_0x561f0e(0x216)](a46_0x39c6a3[_0x561f0e(0x2c6)](_0x561f0e(0x230))+'or'+a46_0x39c6a3[_0x561f0e(0x2c6)](_0x561f0e(0x286))));return;}_0xce9686&&console[_0x561f0e(0x2f4)](_0xce9686);const _0x50fb9b=_0x11a477[_0x561f0e(0x1aa)](_0xe768c1=>_0xe768c1['attemptId'])[_0x561f0e(0x192)](_0x3b5387=>({'title':_0x3b5387[_0x561f0e(0x1ef)],'value':_0x3b5387[_0x561f0e(0x1e9)]})),_0x569a48=process[_0x561f0e(0x2d3)]['rows']||0x3c,_0xf45a0e=Math['max'](0x28,Math[_0x561f0e(0x1e3)](_0x569a48*0x2/0x3)),_0x10d3de=await a46_0x4a1f33({'type':'autocomplete','name':_0x561f0e(0x1e9),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x50fb9b,'initial':-0x1,'limit':_0xf45a0e,'clearFirst':!![],'fallback':{'title':_0x561f0e(0x24b),'value':null},'suggest':(_0x2a716d,_0x2c955a)=>{const _0x8fb868=_0x561f0e;if(!_0x2a716d)return Promise[_0x8fb868(0x245)](_0x2c955a);const _0x3cf318=_0x2c955a[_0x8fb868(0x1aa)](_0x1b7026=>{const _0x14f86b=_0x8fb868,_0x43ed27=_0x1b7026;return _0x43ed27[_0x14f86b(0x2ad)]['toLowerCase']()[_0x14f86b(0x233)](_0x2a716d['toLowerCase']());});return Promise['resolve'](_0x3cf318);}}),_0x2bc70f=()=>{const _0x359bea=_0x561f0e;process[_0x359bea(0x2d3)]['write'](_0x359bea(0x26d)),process[_0x359bea(0x2d3)]['write'](_0x359bea(0x26d)),process[_0x359bea(0x2d3)]['write'](_0x359bea(0x26d));},_0x372639=_0x10d3de&&_0x10d3de['attemptId']&&_0x10d3de[_0x561f0e(0x1e9)]!==null&&_0x10d3de['attemptId'][_0x561f0e(0x25e)]()!=='';if(!_0x372639){_0x2bc70f(),console[_0x561f0e(0x2f4)](a46_0x39c6a3[_0x561f0e(0x2c6)](_0x561f0e(0x2e5)));return;}_0x2bc70f();const _0x3493b9=_0x2fb6ea[_0x561f0e(0x1be)](_0x3c31c2=>_0x3c31c2[_0x561f0e(0x22e)]?.['id']===_0x10d3de[_0x561f0e(0x1e9)]);if(_0x3493b9){const _0x5e0a2a=_0x3493b9[_0x561f0e(0x1d6)]?.[_0x561f0e(0x242)]||'?',_0x352029=_0x3493b9['workflow']?.[_0x561f0e(0x242)]||'?';console[_0x561f0e(0x2f4)](_0x561f0e(0x1ac)+a46_0x39c6a3[_0x561f0e(0x2c6)](_0x5e0a2a)+_0x561f0e(0x195)+a46_0x39c6a3[_0x561f0e(0x2c6)](_0x352029));}const _0xc71657=new WorkflowTimelineCommand();await _0xc71657['execute']({'args':[],'options':{..._0x1fa23a,'attemptId':_0x10d3de[_0x561f0e(0x1e9)]},'tdx':_0x2362e2});}['generateSessionTimelineRows'](_0x5af0b0,_0x5dcc6d){const _0x221a73=a46_0x11de4d,_0x4febb3=new Map();for(const _0x13ee63 of _0x5af0b0){_0x13ee63['id']&&_0x13ee63[_0x221a73(0x22e)]?.['id']&&_0x4febb3[_0x221a73(0x1eb)](_0x13ee63['id'],_0x13ee63[_0x221a73(0x22e)]['id']);}const _0xf9e548=[];let _0xb2b7d6='';const _0x328536=this[_0x221a73(0x213)](_0x5af0b0,_0x5dcc6d),_0x1d0455=_0x328536['split']('\x0a');for(const _0x32b71c of _0x1d0455){if(_0x32b71c[_0x221a73(0x174)](_0x221a73(0x301))||_0x32b71c['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0xb2b7d6=_0x32b71c;else{if(_0x32b71c[_0x221a73(0x231)](/^[✅❌🔄🛑⏳]/)){const _0x7af5bf=_0x32b71c['match'](/#(\d+)/),_0x5a790a=_0x7af5bf?_0x7af5bf[0x1]:null,_0x41f35a=_0x5a790a?_0x4febb3[_0x221a73(0x17b)](_0x5a790a)||null:null,_0x1beb34=_0x5af0b0[_0x221a73(0x1be)](_0x282a48=>_0x282a48['id']===_0x5a790a),_0x1544df=_0x1beb34?.[_0x221a73(0x1d6)]?.[_0x221a73(0x242)]||'';_0xf9e548[_0x221a73(0x2f9)]({'displayLine':_0x32b71c,'attemptId':_0x41f35a,'projectName':_0x1544df});}}}return{'timelineRows':_0xf9e548,'timeAxisHeader':_0xb2b7d6};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a46_0x11de4d(0x1b4);[a46_0x11de4d(0x1f7)]='List\x20workflow\x20attempts';async[a46_0x11de4d(0x249)](_0x2bbe46){const _0x397e77=a46_0x11de4d,{options:_0x4199e9,args:_0x18ee33,tdx:_0x57cc0b}=_0x2bbe46,_0x4aee77=this[_0x397e77(0x201)](_0x18ee33,_0x4199e9);if(!_0x4aee77)return 0x1;const {projectName:_0x3b3635,workflowName:_0x39f8df}=_0x4aee77,_0x18275f=_0x4199e9[_0x397e77(0x1e7)];if(_0x4199e9[_0x397e77(0x2df)]){if(_0x3b3635&&_0x39f8df)console[_0x397e77(0x216)]('Filter:\x20'+_0x3b3635+'.'+_0x39f8df);else _0x3b3635&&console[_0x397e77(0x216)](_0x397e77(0x1e4)+_0x3b3635);_0x18275f&&console[_0x397e77(0x216)]('Include\x20retried:\x20yes');}const _0x47a84b=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x57cc0b['workflow']['attempts']({'projectName':_0x3b3635,'workflowName':_0x39f8df,'includeRetried':_0x18275f,'limit':_0x4199e9[_0x397e77(0x1df)]}),{'verbose':_0x4199e9[_0x397e77(0x2df)]}),_0x1556df=_0x47a84b[_0x397e77(0x2c3)],_0xd21e3a=_0x4199e9[_0x397e77(0x1df)]||0x64,_0x3db0e0=_0x1556df[_0x397e77(0x284)]>=_0xd21e3a?a46_0x39c6a3[_0x397e77(0x2c6)](_0x397e77(0x29e)):'';console['error'](_0x397e77(0x199)+_0x1556df[_0x397e77(0x284)]+_0x397e77(0x234)+(_0x1556df[_0x397e77(0x284)]!==0x1?'s':'')+_0x3db0e0);if(_0x4199e9[_0x397e77(0x22f)]===_0x397e77(0x1bc)||_0x4199e9[_0x397e77(0x22f)]===_0x397e77(0x1f4)||_0x4199e9[_0x397e77(0x22f)]===_0x397e77(0x300))await handleSDKOutput(_0x1556df,_0x4199e9);else{if(_0x1556df['length']===0x0){if(_0x3b3635&&_0x39f8df)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x3b3635+'.'+_0x39f8df);else _0x3b3635?console[_0x397e77(0x2f4)](_0x397e77(0x23c)+_0x3b3635):console[_0x397e77(0x2f4)](_0x397e77(0x272));}else{const _0x49cd3b=_0x4199e9[_0x397e77(0x1b1)],_0x460c5f=_0x1556df['map'](_0x441156=>{const _0x1e8a3b=_0x397e77,_0x342439=a46_0x39c6a3[_0x1e8a3b(0x2c6)]('#'+_0x441156['id']),_0x4f4645=_0x441156['project']?.['id'],_0x4e9fa8=_0x441156[_0x1e8a3b(0x1f1)]||_0x441156[_0x1e8a3b(0x1fa)],_0x3ab4d8=_0x4f4645&&_0x4e9fa8?hyperlink(_0x342439,getWorkflowAttemptUrl(_0x49cd3b,_0x4f4645,_0x4e9fa8,_0x441156['id'])):_0x342439,{icon:_0x3894de,text:_0x47671d}=getAttemptStatusDisplay(_0x441156),_0x1e0ed1=(_0x441156[_0x1e8a3b(0x1d6)]?.[_0x1e8a3b(0x242)]||'?')+'.'+(_0x441156[_0x1e8a3b(0x1ec)]?.[_0x1e8a3b(0x242)]||'?'),_0x5dd65f=_0x441156[_0x1e8a3b(0x21d)]?a46_0x39c6a3[_0x1e8a3b(0x2c6)](_0x441156[_0x1e8a3b(0x21d)]):'';return(_0x3ab4d8+'\x20'+_0x3894de+(_0x47671d?'\x20'+_0x47671d:'')+'\x20'+_0x1e0ed1+'\x20'+_0x5dd65f)[_0x1e8a3b(0x182)]();});await writeOutput(_0x460c5f[_0x397e77(0x26a)]('\x0a'),_0x4199e9['output'],_0x397e77(0x237));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x24e);[a46_0x11de4d(0x1f7)]='Show\x20specific\x20attempt\x20details';async[a46_0x11de4d(0x249)](_0x3187b8){const _0x32631e=a46_0x11de4d,{options:_0x1b6aa0,args:_0x9b5e10,tdx:_0x743aa8}=_0x3187b8,_0x5a1e23=_0x9b5e10[0x0];if(!_0x5a1e23)return console[_0x32631e(0x216)](_0x32631e(0x294)),0x1;_0x1b6aa0[_0x32631e(0x2df)]&&console['error'](_0x32631e(0x1ee)+_0x5a1e23);const _0x1f7d9a=await withSpinner(_0x32631e(0x1c2),()=>_0x743aa8[_0x32631e(0x1ec)][_0x32631e(0x2b6)](_0x5a1e23),{'verbose':_0x1b6aa0[_0x32631e(0x2df)]}),_0x440835=_0x1f7d9a['data'];let _0x9eafcc;!_0x440835[_0x32631e(0x1fb)]?_0x9eafcc=_0x440835[_0x32631e(0x2a8)]?'canceling':'running':_0x9eafcc=_0x440835['success']?'success':_0x32631e(0x216);let _0x214a7f;if(_0x440835[_0x32631e(0x282)]&&_0x440835['finishedAt']){const _0x1a69b9=new Date(_0x440835[_0x32631e(0x282)])[_0x32631e(0x188)](),_0x5c2cc2=new Date(_0x440835[_0x32631e(0x175)])[_0x32631e(0x188)]();_0x214a7f=Math[_0x32631e(0x2f0)]((_0x5c2cc2-_0x1a69b9)/0x3e8);}const _0x53eb49={'attempt_id':_0x440835['id'],'status':_0x9eafcc,..._0x440835[_0x32631e(0x25b)]!==undefined&&{'index':_0x440835[_0x32631e(0x25b)]},..._0x440835[_0x32631e(0x1d6)]&&{'project':_0x440835[_0x32631e(0x1d6)][_0x32631e(0x242)]},..._0x440835[_0x32631e(0x1ec)]&&{'workflow':_0x440835[_0x32631e(0x1ec)][_0x32631e(0x242)]},..._0x440835[_0x32631e(0x1fa)]&&{'session_id':_0x440835[_0x32631e(0x1fa)]},..._0x440835['sessionTime']&&{'session_time':_0x440835[_0x32631e(0x21d)]},..._0x440835['retryAttemptName']&&{'retry_attempt':_0x440835[_0x32631e(0x1b7)]},..._0x214a7f!==undefined&&{'duration_sec':_0x214a7f},..._0x440835[_0x32631e(0x282)]&&{'created_at':_0x440835['createdAt']},..._0x440835['finishedAt']&&{'finished_at':_0x440835[_0x32631e(0x175)]},...Object[_0x32631e(0x2c2)](_0x440835[_0x32631e(0x2af)])[_0x32631e(0x284)]>0x0&&{'params':_0x440835[_0x32631e(0x2af)]}};return await handleSingleObjectOutput(_0x53eb49,_0x1b6aa0),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x29b);[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x16d);async[a46_0x11de4d(0x249)](_0x360267){const _0x5121b2=a46_0x11de4d,{options:_0x34b083,args:_0x59435b,tdx:_0x560a5d}=_0x360267,_0x295190=_0x59435b[0x0];if(!_0x295190)return console[_0x5121b2(0x216)](_0x5121b2(0x294)),0x1;const _0x1742f1=_0x34b083[_0x5121b2(0x255)];_0x34b083[_0x5121b2(0x2df)]&&(console[_0x5121b2(0x216)](_0x5121b2(0x1ee)+_0x295190),_0x1742f1&&console[_0x5121b2(0x216)]('Including\x20subtasks:\x20yes'));const _0x184f46=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x560a5d['workflow'][_0x5121b2(0x1d9)](_0x295190,_0x1742f1||![]),{'verbose':_0x34b083['verbose']}),_0x5e2c5f=_0x184f46[_0x5121b2(0x2c3)];return console[_0x5121b2(0x216)](_0x5121b2(0x199)+_0x5e2c5f['length']+_0x5121b2(0x276)+(_0x5e2c5f['length']!==0x1?'s':'')),await handleSDKOutput(_0x5e2c5f,_0x34b083),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x177);['description']=a46_0x11de4d(0x287);async['execute'](_0xab5484){const _0x227b4b=a46_0x11de4d,{options:_0x45f4b4,args:_0x3ccbae,tdx:_0x11f492}=_0xab5484,_0x4c7946=_0x3ccbae[0x0];let _0x4b4a01=_0x3ccbae[0x1];if(!_0x4c7946)return console[_0x227b4b(0x216)](_0x227b4b(0x294)),0x1;_0x45f4b4[_0x227b4b(0x2df)]&&(console['error'](_0x227b4b(0x1ee)+_0x4c7946),_0x4b4a01&&console[_0x227b4b(0x216)](_0x227b4b(0x20c)+_0x4b4a01));const _0x1c5a85=await withSpinner(_0x227b4b(0x2cc),()=>_0x11f492[_0x227b4b(0x1ec)]['logFiles'](_0x4c7946,_0x4b4a01),{'verbose':_0x45f4b4[_0x227b4b(0x2df)]}),_0x4054b9=_0x1c5a85[_0x227b4b(0x2c3)];if(_0x4054b9[_0x227b4b(0x284)]===0x0)return console[_0x227b4b(0x216)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x4b4a01&&(_0x45f4b4[_0x227b4b(0x1bc)]||_0x45f4b4[_0x227b4b(0x22f)]))return await handleSDKOutput(_0x4054b9,_0x45f4b4),0x0;if(!_0x4b4a01){const _0x2a5c2c=_0x4054b9['map'](_0x20c9d6=>({'title':_0x20c9d6[_0x227b4b(0x2d2)]+'\x20('+formatBytes(_0x20c9d6[_0x227b4b(0x1b0)])+')','value':_0x20c9d6['taskName']})),_0x2122d8=await a46_0x4a1f33({'type':_0x227b4b(0x273),'name':_0x227b4b(0x1dd),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x2a5c2c});if(!_0x2122d8['task'])return console['error'](_0x227b4b(0x2e5)),0x0;_0x4b4a01=_0x2122d8[_0x227b4b(0x1dd)];}const _0x3a79b9=await withSpinner(_0x227b4b(0x183),()=>_0x11f492[_0x227b4b(0x1ec)][_0x227b4b(0x1d3)](_0x4c7946,_0x4b4a01),{'verbose':_0x45f4b4[_0x227b4b(0x2df)]}),_0x1e4351=_0x3a79b9[_0x227b4b(0x2c3)];return _0x1e4351?console[_0x227b4b(0x2f4)](_0x1e4351):console[_0x227b4b(0x216)]('No\x20log\x20content\x20found'),0x0;}}function a46_0x5a96(){const _0x497ebf=['Source\x20project:\x20','type','sessionTime','indexOf','setSecret','workflow:use','success','\x20tasks','write','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','executeCloneProject','getMonth','.\x20Expected\x20format:\x20KEY=VALUE','Resume\x20from:\x20','deleteSecret','Error:\x20Project\x20name\x20is\x20required','/sessions/','hasChanges','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','lastAttempt','format','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','match','pollTimeline','includes','\x20attempt','\x20has\x20no\x20attempts','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','list','resumeFrom','Project\x20name:\x20','/attempt/','✔\x20Project\x20updated','No\x20attempts\x20found\x20in\x20project:\x20','\x20deleted','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20(system)','message','workflow:clone','name','total','parse','resolve','requireProject','min','\x0aPolling...\x20(','execute','executePushProject','No\x20matching\x20sessions\x20found','workflow:workflows','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','workflow:attempt','size','✔\x20Workflow\x20project\x20set\x20to:\x20','Analyzing\x20changes...','stringify','Params:\x20','resolveProjectDir','includeSubtasks','projects','Source:\x20','Key:\x20','→\x20New\x20project:\x20','\x20is\x20not\x20a\x20directory','index','2841769QXcpfH','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','trim','Error:\x20','sys','Validation:\x20skipped','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','every','rows','Source\x20directory:\x20','Dry\x20run:\x20yes','generateSessionTimelineRows','group_error','utf-8','join','\x20modified','\x0aPush\x20these\x20changes?','\x1b[1A\x1b[2K','\x0aFailed\x20to\x20fetch\x20attempt\x20data','fullName','\x20workflow','workflow:download','No\x20attempts\x20found','select','Failed\x20to\x20fetch\x20attempt\x20data','Force:\x20yes','\x20task','key','\x22?\x20This\x20cannot\x20be\x20undone.','workflow:sessions','listSecrets','planned','Loading\x20workflows...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20\x20Location:\x20','\x20-\x20','end','Usage:\x20tdx\x20wf\x20use\x20<project>','createdAt','getHours','length','dryRun','\x20\x20tdx\x20wf\x20use\x20<project>','Show\x20logs\x20for\x20a\x20workflow\x20attempt','newProjectName','path','\x20\x20Changes:\x20','\x0aError:','Start\x20a\x20workflow\x20run','Pushing\x20workflow\x20project...','sourceDir','pending','workflow:secrets:set','✔\x20Pull\x20complete','duration','Select\x20a\x20workflow\x20to\x20run','Error:\x20Attempt\x20ID\x20is\x20required','No\x20workflows\x20found','\x20\x20Target:\x20','start','ICON_WIDTH','getFullYear','Filter:\x20','workflow:tasks','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','MAX_TASKS_DISPLAY','\x20(use\x20--limit\x20to\x20show\x20more)','getMinutes','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','MIN_LABEL_COUNT','Cloning\x20to\x20','reason','2007NzMlHa','MIN_TIMELINE_WIDTH','\x20\x20Session\x20ID:\x20','✔\x20Retry\x20started','cancelRequested','targetExists','Session\x20time:\x20','No\x20sessions\x20found\x20in\x20project:\x20','No\x20workflow\x20tdx.json\x20found','title','split','params','Error:\x20Secret\x20key\x20is\x20required','Reason:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','deleted','Pattern:\x20','navigateSessionsInteractive','attempt','Revision:\x20','padStart','\x0aDry\x20run\x20-\x20nothing\x20pushed','unchanged','repeat','filesExtracted','No\x20sessions\x20with\x20timing\x20information','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflowName','\x20\x20Workflow:\x20','✔\x20Showing\x20','keys','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','replace','dim','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','No\x20workflow\x20projects\x20found','✔\x20Workflow\x20run\x20started','fill','Invalid\x20format:\x20','Fetching\x20log\x20files...','text','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x0a✔\x20No\x20changes\x20to\x20push','Usage:\x20workflow:delete\x20<project-name-or-id>','📋\x20','taskName','stdout','List\x20all\x20workflow\x20projects','Pulling\x20project\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Total:\x20','Status:\x20','localeCompare','From\x20task:\x20','diff','Starting\x20workflow\x20run...','from','workflow:kill','verbose','✔\x20Pushed\x20','workflow:secrets:delete','columns','✔\x20Secret\x20\x27','pullProject','Cancelled','\x20\x20Console:\x20','\x20\x20Project:\x20','running','146UdLton','green','splice','No\x20sessions\x20found','Writing\x20files...','all','stat','round','Error:','\x20\x20Project\x20ID:\x20','now','log','workflow:upload','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','newProjectId','white','push','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Listing\x20secrets...','yes','5701240tyUSjP','renderSingleTimeline','table','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Killing\x20attempt...','modified','showWorkflowConsoleUrl','Workflow:\x20','Attempt:\x20','isArray','yellow','Show\x20tasks\x20for\x20an\x20attempt','new','\x20\x20Attempt\x20ID:\x20','✔\x20Project:\x20','workflow:secrets:list','\x22\x20to\x20new\x20project\x20\x22','Retrying\x20attempt...','startsWith','finishedAt','existingProjectId','workflow:logs','📁\x20','\x20from\x20session\x20','Parameters:\x20','get','Files\x20to\x20upload:\x20','renderTimeline','Target\x20directory:\x20','714860FzgMCr','force','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','trimEnd','Downloading\x20logs...','red','relative','Loading\x20sessions...','startedAt','getTime','status','window','updatedAt','workflowProject','Output\x20directory:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','session','blue','map','Target:\x20','\x20\x20Session\x20context\x20set\x20to:\x20',',\x20Workflow:\x20','...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','max','✔\x20Found\x20','slice','11szsHfd','Project\x20name\x20is\x20required','LABEL_WIDTH_DIVISOR','summary','applyPullProject','ICON_SPACING','tdx.json','follow','resolveProject','\x20new','kill','1476100VtBwUG','---\x20','getDate','output','filter','2566DVdEne','Project:\x20','workflow:projects','readFile','workflows','fileSize','site','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','New\x20project\x20name:\x20','workflow:attempts','state','cwd','retryAttemptName','TASK_NAME_WIDTH','6vtmBLf','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','json','-\x20nothing\x20pushed','find','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x22\x20with\x20new\x20revision?','icon','Getting\x20attempt\x20details...','basename','3968dbdUUV','targetDir','some','buildTimelineData','isTTY','Latest\x20session\x20has\x20no\x20attempt','💡\x20Tip:\x20Use\x20','Updating\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','Pushing\x20project...','substring','sessions','projectId','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','skipValidation','logs','unknown','🔄\x20','project','Retry\x20a\x20session\x20or\x20attempt','Error:\x20Invalid\x20JSON\x20in\x20--params','tasks','No\x20workflow\x20sessions\x20found','623550awHCsS','cyan','task','\x20\x20Revision:\x20','limit','changes','GUTTER','value','floor','Filter:\x20project=','LABEL_MIN_SPACING','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','includeRetried','metadata','attemptId','projectName','set','workflow','workflow:push','Attempt\x20ID:\x20','displayLine','\x27\x20from\x20project\x20\x27','session_id','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Files\x20extracted:\x20','jsonl','run','\x0a⚠\x20Project\x20\x22','description','clear','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','sessionId','done','sort','fromTask','Session\x20','fs/promises','context','parseProjectWorkflowPattern','\x22\x20already\x20exists\x20(ID:\x20','workflow:retry','\x0aUpdate\x20existing\x20project\x20\x22','workflow:timeline','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','revision','Resolving\x20project\x20\x27','\x20\x20Source:\x20','sourceProjectName','MAX_POLL_ITERATIONS','Task\x20name:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:pull','Key\x20cannot\x20be\x20empty','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','isNewProject','No\x20sessions\x20found\x20for:\x20','renderSessionsTimeline','fileCount','startTime','error','Loading\x20session...','Session\x20not\x20found:\x20','values','Warning:'];a46_0x5a96=function(){return _0x497ebf;};return a46_0x5a96();}export class WorkflowKillCommand extends BaseCommand{['name']=a46_0x11de4d(0x2de);[a46_0x11de4d(0x1f7)]='Kill\x20a\x20running\x20attempt';async[a46_0x11de4d(0x249)](_0x469307){const _0x2d4fe2=a46_0x11de4d,{options:_0x2a73ec,args:_0x2e3658,tdx:_0x248f9b}=_0x469307,_0x101986=_0x2e3658[0x0];if(!_0x101986)return console[_0x2d4fe2(0x216)](_0x2d4fe2(0x294)),0x1;const _0x2a7bd3=_0x2a73ec[_0x2d4fe2(0x2a3)];_0x2a73ec[_0x2d4fe2(0x2df)]&&(console['error']('Attempt\x20ID:\x20'+_0x101986),_0x2a7bd3&&console[_0x2d4fe2(0x216)](_0x2d4fe2(0x2b1)+_0x2a7bd3));if(!_0x2a73ec['yes']){if(!isInteractive())return console[_0x2d4fe2(0x216)](a46_0x39c6a3[_0x2d4fe2(0x184)](_0x2d4fe2(0x28b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a46_0x39c6a3[_0x2d4fe2(0x2c6)](_0x2d4fe2(0x1e6))),0x1;const _0x48ffed=await confirmKey(_0x2d4fe2(0x2b2)+_0x101986+'?');if(!_0x48ffed)return console[_0x2d4fe2(0x216)](a46_0x39c6a3[_0x2d4fe2(0x16c)](_0x2d4fe2(0x2e5))),0x1;}const _0x4d178a=await withSpinner(_0x2d4fe2(0x302),()=>_0x248f9b[_0x2d4fe2(0x1ec)][_0x2d4fe2(0x1a5)](_0x101986,_0x2a7bd3),{'verbose':_0x2a73ec[_0x2d4fe2(0x2df)]}),_0x318be4=_0x4d178a[_0x2d4fe2(0x2c3)];return console[_0x2d4fe2(0x216)]('✔\x20'+_0x318be4),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x203);['description']=a46_0x11de4d(0x1d7);async[a46_0x11de4d(0x249)](_0x1800bd){const _0x1c5dec=a46_0x11de4d,{options:_0x5abc42,args:_0x392cfc,tdx:_0x3e3078}=_0x1800bd,_0x47c764=_0x392cfc[0x0];if(!_0x47c764)return console[_0x1c5dec(0x216)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x1c5dec(0x216)](_0x1c5dec(0x27d)),0x1;let _0x1fc9c5=![],_0x50baf2=_0x47c764;if(_0x47c764['startsWith']('session:'))_0x1fc9c5=!![],_0x50baf2=_0x47c764[_0x1c5dec(0x1ce)](0x8);else{if(_0x47c764[_0x1c5dec(0x174)]('attempt:'))_0x1fc9c5=![],_0x50baf2=_0x47c764[_0x1c5dec(0x1ce)](0x8);else return console[_0x1c5dec(0x216)](_0x1c5dec(0x1bf)),console[_0x1c5dec(0x216)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0xa16512=_0x5abc42[_0x1c5dec(0x1fd)],_0xa222d=_0x5abc42[_0x1c5dec(0x238)],_0x220a7e=_0x5abc42[_0x1c5dec(0x2af)],_0xe68437=_0x5abc42[_0x1c5dec(0x180)];_0x5abc42['verbose']&&(console[_0x1c5dec(0x216)](_0x1c5dec(0x193)+(_0x1fc9c5?_0x1c5dec(0x190):_0x1c5dec(0x2b6))+'\x20'+_0x50baf2),_0xa16512&&console[_0x1c5dec(0x216)](_0x1c5dec(0x2da)+_0xa16512),_0xa222d&&console[_0x1c5dec(0x216)](_0x1c5dec(0x228)+_0xa222d),_0x220a7e&&console[_0x1c5dec(0x216)](_0x1c5dec(0x253)+_0x220a7e),_0xe68437&&console['error'](_0x1c5dec(0x275)));let _0x46077c;if(_0x220a7e)try{if(_0x220a7e[_0x1c5dec(0x174)]('@')){const _0x19df81=await import(_0x1c5dec(0x1ff)),_0x560563=_0x220a7e['substring'](0x1),_0x101431=await _0x19df81[_0x1c5dec(0x1ae)](_0x560563,_0x1c5dec(0x269));_0x46077c=JSON[_0x1c5dec(0x244)](_0x101431);}else _0x46077c=JSON[_0x1c5dec(0x244)](_0x220a7e);}catch{return console['error'](_0x1c5dec(0x1d8)),0x1;}if(!_0x5abc42[_0x1c5dec(0x2fd)]){if(!isInteractive())return console[_0x1c5dec(0x216)](a46_0x39c6a3[_0x1c5dec(0x184)](_0x1c5dec(0x28b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1c5dec(0x216)](a46_0x39c6a3[_0x1c5dec(0x2c6)](_0x1c5dec(0x1e6))),0x1;const _0x3de3a3=await confirmKey(_0x1c5dec(0x18e)+(_0x1fc9c5?'session':'attempt')+'\x20'+_0x50baf2+'?');if(!_0x3de3a3)return console['error'](a46_0x39c6a3[_0x1c5dec(0x16c)]('Cancelled')),0x1;}let _0x291f46;_0x1fc9c5?_0x291f46=await withSpinner('Retrying\x20session...',()=>_0x3e3078['workflow']['retrySession'](_0x50baf2,{'fromTask':_0xa16512,'retryParams':_0x46077c}),{'verbose':_0x5abc42[_0x1c5dec(0x2df)]}):_0x291f46=await withSpinner(_0x1c5dec(0x173),()=>_0x3e3078[_0x1c5dec(0x1ec)]['retryAttempt'](_0x50baf2,{'resumeFrom':_0xa222d,'retryParams':_0x46077c,'force':_0xe68437}),{'verbose':_0x5abc42['verbose']});const _0x3a617a=_0x291f46[_0x1c5dec(0x2c3)];return console[_0x1c5dec(0x216)](_0x1c5dec(0x2a7)),console[_0x1c5dec(0x216)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x3a617a[_0x1c5dec(0x1e9)]),console['error'](_0x1c5dec(0x2a6)+_0x3a617a['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]='workflow:run';[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x28c);async['execute'](_0x40b51f){const _0x12d594=a46_0x11de4d,{options:_0x295993,args:_0x29a5c1,tdx:_0x29c014}=_0x40b51f;let _0xc722aa=_0x29a5c1[0x0];if(!_0xc722aa){const _0x48e26a=this[_0x12d594(0x1a3)]([],_0x295993),_0x1a2314=await withSpinner(_0x12d594(0x27c),()=>_0x29c014[_0x12d594(0x1ec)][_0x12d594(0x1af)](_0x48e26a,{'limit':_0x295993[_0x12d594(0x1df)]}),{'verbose':_0x295993['verbose']}),_0x1445a7=_0x1a2314[_0x12d594(0x2c3)];if(_0x1445a7['length']===0x0)return console['error'](_0x12d594(0x295)),!_0x48e26a&&console[_0x12d594(0x216)](a46_0x39c6a3['dim'](_0x12d594(0x1f2))),0x1;const _0x49c3a9=_0x1445a7[_0x12d594(0x192)](_0x312dfd=>({'title':_0x312dfd[_0x12d594(0x1d6)]?.[_0x12d594(0x242)]+'.'+_0x312dfd['name'],'value':_0x312dfd['project']?.['name']+'.'+_0x312dfd[_0x12d594(0x242)],'description':_0x312dfd[_0x12d594(0x207)]?'revision:\x20'+_0x312dfd[_0x12d594(0x207)]:undefined})),_0x389e97=await a46_0x4a1f33({'type':'select','name':_0x12d594(0x1ec),'message':_0x12d594(0x293),'choices':_0x49c3a9});if(!_0x389e97[_0x12d594(0x1ec)])return 0x1;_0xc722aa=_0x389e97[_0x12d594(0x1ec)];}if(!_0xc722aa[_0x12d594(0x233)]('.')){const _0x299791=this[_0x12d594(0x1a3)]([],_0x295993);if(_0x299791)_0xc722aa=_0x299791+'.'+_0xc722aa;else return console[_0x12d594(0x216)](a46_0x39c6a3[_0x12d594(0x184)](_0x12d594(0x2f1)),_0x12d594(0x20d)),console[_0x12d594(0x216)](a46_0x39c6a3['dim'](_0x12d594(0x1f2))),0x1;}const _0x4f37c1=_0x295993['param'],_0x1ab84f=_0x295993[_0x12d594(0x21d)],_0x3533ba={};if(_0x4f37c1&&Array[_0x12d594(0x16b)](_0x4f37c1))for(const _0x528c17 of _0x4f37c1){const _0x2a1fa8=_0x528c17[_0x12d594(0x21e)]('=');if(_0x2a1fa8===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x528c17),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x6ffb4b=_0x528c17[_0x12d594(0x1ce)](0x0,_0x2a1fa8),_0x475ce7=_0x528c17['substring'](_0x2a1fa8+0x1);try{_0x3533ba[_0x6ffb4b]=JSON[_0x12d594(0x244)](_0x475ce7);}catch{_0x3533ba[_0x6ffb4b]=_0x475ce7;}}_0x295993[_0x12d594(0x2df)]&&(console[_0x12d594(0x216)](_0x12d594(0x169)+_0xc722aa),Object['keys'](_0x3533ba)[_0x12d594(0x284)]>0x0&&console[_0x12d594(0x216)](_0x12d594(0x17a)+JSON[_0x12d594(0x252)](_0x3533ba)),_0x1ab84f&&console[_0x12d594(0x216)](_0x12d594(0x2aa)+_0x1ab84f));const _0x4a1fef=await withSpinner(_0x12d594(0x2dc),()=>_0x29c014[_0x12d594(0x1ec)][_0x12d594(0x1f5)](_0xc722aa,_0x3533ba,{'sessionTime':_0x1ab84f}),{'verbose':_0x295993[_0x12d594(0x2df)]}),_0x28e1a6=_0x4a1fef[_0x12d594(0x2c3)];console['error'](_0x12d594(0x2c9)),console[_0x12d594(0x216)](_0x12d594(0x16f)+_0x28e1a6['id']),console[_0x12d594(0x216)](_0x12d594(0x2a6)+_0x28e1a6['sessionId']),console[_0x12d594(0x216)](_0x12d594(0x2e7)+_0x28e1a6[_0x12d594(0x1d6)]?.[_0x12d594(0x242)]),console[_0x12d594(0x216)](_0x12d594(0x2c0)+_0x28e1a6[_0x12d594(0x1ec)]?.['name']);if(_0x28e1a6[_0x12d594(0x1d6)]?.['id']&&_0x28e1a6[_0x12d594(0x1fa)]&&_0x28e1a6['id']){const _0x4903b2=_0x295993[_0x12d594(0x1b1)],_0x5e6f29=getConsoleUrl(_0x4903b2,'/app/workflows/'+_0x28e1a6[_0x12d594(0x1d6)]['id']+_0x12d594(0x22b)+_0x28e1a6[_0x12d594(0x1fa)]+_0x12d594(0x23a)+_0x28e1a6['id']);console[_0x12d594(0x216)](_0x12d594(0x2e6)+a46_0x39c6a3[_0x12d594(0x1dc)](_0x5e6f29));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x271);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a46_0x11de4d(0x249)](_0x43fa8e){const _0x293730=a46_0x11de4d,{options:_0x3af347,args:_0x389115,tdx:_0x58e387}=_0x43fa8e,_0x130a40=_0x389115[0x0],_0x493b58=_0x389115[0x1]||'.';if(!_0x130a40)return console['error'](_0x293730(0x22a)),console[_0x293730(0x216)](_0x293730(0x206)),0x1;const _0x474a7e=_0x3af347[_0x293730(0x207)];_0x3af347[_0x293730(0x2df)]&&(console['error'](_0x293730(0x1ac)+_0x130a40),console[_0x293730(0x216)](_0x293730(0x18d)+_0x493b58),_0x474a7e&&console[_0x293730(0x216)](_0x293730(0x2b7)+_0x474a7e));const _0x21cd02=await withSpinner('Downloading\x20project\x20'+_0x130a40+'...',()=>_0x58e387[_0x293730(0x1ec)]['download'](_0x130a40,_0x493b58,{'revision':_0x474a7e}),{'verbose':_0x3af347[_0x293730(0x2df)]}),_0x57a191=_0x21cd02[_0x293730(0x2c3)];return console['error']('✔\x20Downloaded\x20'+_0x57a191[_0x293730(0x1ea)]),console[_0x293730(0x216)](_0x293730(0x1de)+_0x57a191[_0x293730(0x207)]),console[_0x293730(0x216)](_0x293730(0x1f3)+_0x57a191[_0x293730(0x2bc)]),console[_0x293730(0x216)](_0x293730(0x27e)+_0x493b58+'/'+_0x57a191[_0x293730(0x1ea)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a46_0x11de4d(0x2f5);[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x2c7);async[a46_0x11de4d(0x249)](_0x138318){const _0x56d0cc=a46_0x11de4d,{options:_0x77c101,args:_0x1f5042,tdx:_0x4fce2f}=_0x138318;let _0x31b791='.',_0x2c520c=_0x77c101[_0x56d0cc(0x242)];if(_0x1f5042[0x0]){const {promises:_0x4a6369}=await import('fs');try{const _0x1e1c73=await _0x4a6369[_0x56d0cc(0x2ef)](_0x1f5042[0x0]);if(_0x1e1c73['isDirectory']())_0x31b791=_0x1f5042[0x0];else return console[_0x56d0cc(0x216)](_0x56d0cc(0x25f)+_0x1f5042[0x0]+_0x56d0cc(0x25a)),0x1;}catch{_0x2c520c=_0x1f5042[0x0],_0x31b791='.';}}const _0x345f45=_0x77c101[_0x56d0cc(0x207)],_0x5d70d4=_0x77c101[_0x56d0cc(0x1d2)];_0x77c101[_0x56d0cc(0x2df)]&&(console[_0x56d0cc(0x216)]('Project\x20directory:\x20'+_0x31b791),_0x2c520c&&console['error'](_0x56d0cc(0x239)+_0x2c520c),_0x345f45&&console[_0x56d0cc(0x216)](_0x56d0cc(0x2b7)+_0x345f45),_0x5d70d4&&console[_0x56d0cc(0x216)](_0x56d0cc(0x261)));const _0x5e663c=await withSpinner(_0x56d0cc(0x28d),()=>_0x4fce2f[_0x56d0cc(0x1ec)]['push'](_0x31b791,{'projectName':_0x2c520c,'revision':_0x345f45,'skipValidation':_0x5d70d4}),{'verbose':_0x77c101[_0x56d0cc(0x2df)]}),_0x268ec8=_0x5e663c[_0x56d0cc(0x2c3)];return console[_0x56d0cc(0x216)](_0x56d0cc(0x2e0)+_0x268ec8['projectName']),console['error']('\x20\x20Project\x20ID:\x20'+_0x268ec8['projectId']),console[_0x56d0cc(0x216)]('\x20\x20Revision:\x20'+_0x268ec8[_0x56d0cc(0x207)]),await this['showWorkflowConsoleUrl'](_0x4fce2f,_0x268ec8[_0x56d0cc(0x1ea)],_0x77c101[_0x56d0cc(0x1b1)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x20e);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a46_0x11de4d(0x249)](_0x3e3dd2){const _0x24cef5=a46_0x11de4d,{options:_0x4c4577,args:_0x1d6ac0,tdx:_0x5c28f6}=_0x3e3dd2,_0x34bb82=_0x1d6ac0[0x0],_0x25f630=_0x1d6ac0[0x1];if(!_0x34bb82)return console[_0x24cef5(0x216)](a46_0x39c6a3['red']('Error:'),_0x24cef5(0x19c)),console[_0x24cef5(0x216)](a46_0x39c6a3[_0x24cef5(0x2c6)](_0x24cef5(0x181))),0x1;const _0x15f41a=_0x4c4577[_0x24cef5(0x207)];_0x4c4577[_0x24cef5(0x2df)]&&(console[_0x24cef5(0x216)](_0x24cef5(0x1ac)+_0x34bb82),_0x25f630&&console[_0x24cef5(0x216)](_0x24cef5(0x17e)+_0x25f630),_0x15f41a&&console[_0x24cef5(0x216)](_0x24cef5(0x2b7)+_0x15f41a),_0x4c4577[_0x24cef5(0x285)]&&console[_0x24cef5(0x216)]('Dry\x20run:\x20yes'));const _0x4a67f8=await withSpinner(_0x24cef5(0x2d5)+_0x34bb82+_0x24cef5(0x196),()=>_0x5c28f6['workflow'][_0x24cef5(0x2e4)](_0x34bb82,{'targetDir':_0x25f630,'revision':_0x15f41a}),{'verbose':_0x4c4577['verbose']}),_0x5da404=_0x4a67f8[_0x24cef5(0x2c3)];_0x5da404[_0x24cef5(0x211)]?console[_0x24cef5(0x216)](_0x24cef5(0x259)+_0x5da404[_0x24cef5(0x1ea)]):console[_0x24cef5(0x216)]('→\x20Project:\x20'+_0x5da404['projectName']);console[_0x24cef5(0x216)](_0x24cef5(0x1de)+_0x5da404[_0x24cef5(0x207)]),console[_0x24cef5(0x216)](_0x24cef5(0x296)+(a46_0x27c8a8[_0x24cef5(0x185)](process[_0x24cef5(0x1b6)](),_0x5da404[_0x24cef5(0x1c5)])||'.')),console['error']('\x20\x20Changes:\x20'+a46_0x39c6a3[_0x24cef5(0x2ea)]('+'+_0x5da404['summary'][_0x24cef5(0x16e)]+_0x24cef5(0x1a4))+',\x20'+(a46_0x39c6a3[_0x24cef5(0x16c)]('~'+_0x5da404[_0x24cef5(0x19e)][_0x24cef5(0x303)]+_0x24cef5(0x26b))+',\x20')+(a46_0x39c6a3[_0x24cef5(0x184)]('-'+_0x5da404[_0x24cef5(0x19e)][_0x24cef5(0x2b3)]+'\x20deleted')+',\x20')+(''+a46_0x39c6a3[_0x24cef5(0x2c6)](_0x5da404['summary'][_0x24cef5(0x2ba)]+'\x20unchanged')));for(const _0x40a555 of _0x5da404[_0x24cef5(0x1e0)]){_0x40a555[_0x24cef5(0x21c)]===_0x24cef5(0x303)&&_0x40a555['diff']&&(console[_0x24cef5(0x216)]('\x0a'+a46_0x39c6a3['cyan'](_0x24cef5(0x1a7)+_0x40a555[_0x24cef5(0x289)])),console['error'](_0x40a555['diff']));}if(!_0x5da404[_0x24cef5(0x22c)])return saveSessionContext({'workflow_project':_0x5da404[_0x24cef5(0x1ea)]},_0x4c4577[_0x24cef5(0x190)]),console[_0x24cef5(0x216)](a46_0x39c6a3[_0x24cef5(0x2ea)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a46_0x39c6a3[_0x24cef5(0x2c6)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x5da404['projectName'])),0x0;if(_0x4c4577[_0x24cef5(0x285)])return console[_0x24cef5(0x216)](a46_0x39c6a3[_0x24cef5(0x16c)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x4c4577[_0x24cef5(0x2fd)]){if(!isInteractive())return console[_0x24cef5(0x216)](a46_0x39c6a3['red'](_0x24cef5(0x28b)),_0x24cef5(0x24d)),console[_0x24cef5(0x216)](a46_0x39c6a3[_0x24cef5(0x2c6)](_0x24cef5(0x1e6))),0x1;const _0x49709f=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x49709f)return console[_0x24cef5(0x216)](a46_0x39c6a3[_0x24cef5(0x16c)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x24cef5(0x2ed),()=>_0x5c28f6[_0x24cef5(0x1ec)][_0x24cef5(0x19f)](_0x5da404,{'revision':_0x15f41a}),{'verbose':_0x4c4577['verbose']}),saveSessionContext({'workflow_project':_0x5da404[_0x24cef5(0x1ea)]},_0x4c4577[_0x24cef5(0x190)]),console[_0x24cef5(0x216)](a46_0x39c6a3[_0x24cef5(0x2ea)](_0x24cef5(0x291)));const _0x1ba403=a46_0x27c8a8[_0x24cef5(0x185)](process[_0x24cef5(0x1b6)](),_0x5da404[_0x24cef5(0x1c5)])||'.';return console['error'](a46_0x39c6a3['dim']('\x20\x20Location:\x20'+_0x1ba403)),console[_0x24cef5(0x216)](a46_0x39c6a3[_0x24cef5(0x2c6)](_0x24cef5(0x194)+_0x5da404[_0x24cef5(0x1ea)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x1ed);[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x1d1);async['execute'](_0xc334ac){const _0x4620a4=a46_0x11de4d,{options:_0x4a5ad6,args:_0x2fd3ca,tdx:_0xf898b2}=_0xc334ac,_0x1fb581=this['resolveProjectDir'](_0x2fd3ca,_0x4a5ad6),_0x1d55ac=_0x4a5ad6['revision'],_0x46fece=_0x4a5ad6[_0x4620a4(0x1d2)];_0x4a5ad6[_0x4620a4(0x2df)]&&(_0x1fb581&&console['error'](_0x4620a4(0x265)+_0x1fb581),_0x1d55ac&&console[_0x4620a4(0x216)](_0x4620a4(0x2b7)+_0x1d55ac),_0x4a5ad6[_0x4620a4(0x285)]&&console[_0x4620a4(0x216)](_0x4620a4(0x266)),_0x46fece&&console['error'](_0x4620a4(0x261)));let _0x317b66;try{_0x317b66=await withSpinner(_0x4620a4(0x251),()=>_0xf898b2['workflow']['preparePushProject']({'sourceDir':_0x1fb581,'revision':_0x1d55ac,'skipValidation':_0x46fece}),{'verbose':_0x4a5ad6[_0x4620a4(0x2df)]});}catch(_0x5acf70){if(_0x5acf70 instanceof Error&&_0x5acf70['message']['includes'](_0x4620a4(0x2ac)))return console[_0x4620a4(0x216)](a46_0x39c6a3[_0x4620a4(0x184)]('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4a5ad6[_0x4620a4(0x18c)]?console[_0x4620a4(0x216)](a46_0x39c6a3['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x4a5ad6[_0x4620a4(0x18c)]+_0x4620a4(0x210)+_0x4a5ad6[_0x4620a4(0x18c)]+'\x27')):console[_0x4620a4(0x216)](a46_0x39c6a3[_0x4620a4(0x2c6)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x5acf70;}const _0x209292=_0x317b66['data'];console[_0x4620a4(0x216)](_0x4620a4(0x170)+_0x209292[_0x4620a4(0x1ea)]),console['error'](_0x4620a4(0x209)+_0x209292['sourceDir']),console['error'](_0x4620a4(0x1de)+_0x209292[_0x4620a4(0x207)]),console[_0x4620a4(0x216)](_0x4620a4(0x28a)+a46_0x39c6a3[_0x4620a4(0x2ea)]('+'+_0x209292['summary'][_0x4620a4(0x16e)]+_0x4620a4(0x1a4))+',\x20'+(a46_0x39c6a3[_0x4620a4(0x16c)]('~'+_0x209292['summary'][_0x4620a4(0x303)]+'\x20modified')+',\x20')+(a46_0x39c6a3[_0x4620a4(0x184)]('-'+_0x209292[_0x4620a4(0x19e)]['deleted']+_0x4620a4(0x23d))+',\x20')+(''+a46_0x39c6a3[_0x4620a4(0x2c6)](_0x209292['summary'][_0x4620a4(0x2ba)]+'\x20unchanged')));for(const _0x3ec55d of _0x209292[_0x4620a4(0x1e0)]){_0x3ec55d[_0x4620a4(0x21c)]===_0x4620a4(0x303)&&_0x3ec55d[_0x4620a4(0x2db)]&&(console[_0x4620a4(0x216)]('\x0a'+a46_0x39c6a3[_0x4620a4(0x1dc)]('---\x20'+_0x3ec55d[_0x4620a4(0x289)])),console[_0x4620a4(0x216)](_0x3ec55d[_0x4620a4(0x2db)]));}if(!_0x209292[_0x4620a4(0x22c)])return console['error'](a46_0x39c6a3[_0x4620a4(0x2ea)](_0x4620a4(0x2cf))),await this[_0x4620a4(0x304)](_0xf898b2,_0x209292[_0x4620a4(0x1ea)],_0x4a5ad6[_0x4620a4(0x1b1)]),0x0;if(_0x4a5ad6[_0x4620a4(0x285)])return console[_0x4620a4(0x216)](a46_0x39c6a3['yellow'](_0x4620a4(0x2b9))),0x0;if(!_0x4a5ad6[_0x4620a4(0x2fd)]){if(!isInteractive())return console[_0x4620a4(0x216)](a46_0x39c6a3[_0x4620a4(0x184)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4620a4(0x216)](a46_0x39c6a3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3a3e92=await confirmKey(_0x4620a4(0x26c));if(!_0x3a3e92)return console['error'](a46_0x39c6a3[_0x4620a4(0x16c)](_0x4620a4(0x2e5)),_0x4620a4(0x1bd)),0x1;}const _0x72085f=await withSpinner(_0x4620a4(0x1cd),()=>_0xf898b2['workflow'][_0x4620a4(0x24a)](_0x209292),{'verbose':_0x4a5ad6[_0x4620a4(0x2df)]}),_0x2c22be=_0x72085f[_0x4620a4(0x2c3)];return console['error'](a46_0x39c6a3[_0x4620a4(0x2ea)]('✔\x20Push\x20complete')),console[_0x4620a4(0x216)](_0x4620a4(0x2f2)+_0x2c22be[_0x4620a4(0x1d0)]),console[_0x4620a4(0x216)]('\x20\x20Revision:\x20'+_0x2c22be[_0x4620a4(0x207)]),await this['showWorkflowConsoleUrl'](_0xf898b2,_0x2c22be[_0x4620a4(0x1ea)],_0x4a5ad6[_0x4620a4(0x1b1)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x241);[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x1f9);async[a46_0x11de4d(0x249)](_0x112df4){const _0x290780=a46_0x11de4d,{options:_0x1b1351,args:_0x2888ef,tdx:_0x17bc16}=_0x112df4,_0x381cfa=this[_0x290780(0x254)](_0x2888ef,_0x1b1351),_0x5f0fa1=_0x1b1351['name'],_0x412e19=_0x1b1351[_0x290780(0x207)],_0x267bda=_0x1b1351[_0x290780(0x1d2)];if(!_0x381cfa)return console[_0x290780(0x216)](a46_0x39c6a3[_0x290780(0x184)](_0x290780(0x2f1)),'Source\x20directory\x20is\x20required'),console[_0x290780(0x216)](a46_0x39c6a3['dim'](_0x290780(0x2be))),console[_0x290780(0x216)](a46_0x39c6a3['dim'](_0x290780(0x2c4))),0x1;if(!_0x5f0fa1)return console['error'](a46_0x39c6a3[_0x290780(0x184)](_0x290780(0x2f1)),_0x290780(0x1bb)),console[_0x290780(0x216)](a46_0x39c6a3['dim'](_0x290780(0x2be))),0x1;_0x1b1351['verbose']&&(console['error']('Source\x20directory:\x20'+_0x381cfa),console[_0x290780(0x216)](_0x290780(0x1b3)+_0x5f0fa1),_0x412e19&&console['error'](_0x290780(0x2b7)+_0x412e19),_0x1b1351[_0x290780(0x285)]&&console[_0x290780(0x216)](_0x290780(0x266)),_0x267bda&&console['error'](_0x290780(0x261)));const _0x3e968a=await withSpinner('Analyzing\x20project...',()=>_0x17bc16[_0x290780(0x1ec)]['prepareCloneProject'](_0x381cfa,_0x5f0fa1,{'revision':_0x412e19,'skipValidation':_0x267bda}),{'verbose':_0x1b1351[_0x290780(0x2df)]}),_0x2601f5=_0x3e968a[_0x290780(0x2c3)];console[_0x290780(0x216)](_0x290780(0x257)+_0x2601f5[_0x290780(0x28e)]);_0x2601f5[_0x290780(0x20a)]&&console[_0x290780(0x216)](_0x290780(0x21b)+_0x2601f5[_0x290780(0x20a)]);console[_0x290780(0x216)]('New\x20project\x20name:\x20'+_0x2601f5['newProjectName']),console[_0x290780(0x216)](_0x290780(0x2b7)+_0x2601f5['revision']),console[_0x290780(0x216)](_0x290780(0x17c)+_0x2601f5[_0x290780(0x214)]);_0x2601f5[_0x290780(0x2a9)]&&(console[_0x290780(0x216)](a46_0x39c6a3['yellow'](_0x290780(0x1f6)+_0x2601f5[_0x290780(0x288)]+_0x290780(0x202)+_0x2601f5[_0x290780(0x176)]+')')),console[_0x290780(0x216)](a46_0x39c6a3['yellow'](_0x290780(0x2ce))));if(_0x1b1351[_0x290780(0x285)])return console[_0x290780(0x216)](a46_0x39c6a3['yellow'](_0x290780(0x1cc))),0x0;if(!_0x1b1351[_0x290780(0x2fd)]){if(!isInteractive())return console[_0x290780(0x216)](a46_0x39c6a3[_0x290780(0x184)](_0x290780(0x28b)),_0x290780(0x24d)),console['error'](a46_0x39c6a3[_0x290780(0x2c6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1e5a80=_0x2601f5[_0x290780(0x20a)]||a46_0x27c8a8[_0x290780(0x1c3)](_0x381cfa),_0x29f670=_0x2601f5[_0x290780(0x2a9)]?_0x290780(0x204)+_0x5f0fa1+_0x290780(0x1c0):'\x0aClone\x20\x22'+_0x1e5a80+_0x290780(0x172)+_0x5f0fa1+'\x22?',_0x3c9454=await confirmKey(_0x29f670);if(!_0x3c9454)return console['error'](a46_0x39c6a3[_0x290780(0x16c)]('Cancelled')),0x1;}const _0x44d8e6=await withSpinner(_0x2601f5[_0x290780(0x2a9)]?_0x290780(0x1cb)+_0x5f0fa1+_0x290780(0x196):_0x290780(0x2a2)+_0x5f0fa1+'...',()=>_0x17bc16[_0x290780(0x1ec)][_0x290780(0x225)](_0x2601f5),{'verbose':_0x1b1351[_0x290780(0x2df)]}),_0x51e7ce=_0x44d8e6[_0x290780(0x2c3)];return console['error'](a46_0x39c6a3[_0x290780(0x2ea)](_0x2601f5['targetExists']?_0x290780(0x23b):'✔\x20Clone\x20complete')),console[_0x290780(0x216)](_0x290780(0x2e7)+_0x51e7ce[_0x290780(0x288)]),console[_0x290780(0x216)](_0x290780(0x2f2)+_0x51e7ce[_0x290780(0x2f7)]),console[_0x290780(0x216)](_0x290780(0x1de)+_0x51e7ce[_0x290780(0x207)]),await this[_0x290780(0x304)](_0x17bc16,_0x51e7ce[_0x290780(0x288)],_0x1b1351[_0x290780(0x1b1)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a46_0x11de4d(0x242)]='workflow:delete';[a46_0x11de4d(0x1f7)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x2a7369){const _0x523a4a=a46_0x11de4d,{options:_0x2fa243,args:_0x107012,tdx:_0x44f2c1}=_0x2a7369,_0x54ccb8=_0x107012[0x0];if(!_0x54ccb8)return console[_0x523a4a(0x216)](_0x523a4a(0x224)),console[_0x523a4a(0x216)](_0x523a4a(0x2d0)),0x1;_0x2fa243[_0x523a4a(0x2df)]&&console['error'](_0x523a4a(0x1ac)+_0x54ccb8);if(!_0x2fa243['yes']){if(!isInteractive())return console['error'](a46_0x39c6a3[_0x523a4a(0x184)](_0x523a4a(0x28b)),_0x523a4a(0x24d)),console['error'](a46_0x39c6a3['dim'](_0x523a4a(0x1e6))),0x1;const _0x1e6eef=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x54ccb8+_0x523a4a(0x278));if(!_0x1e6eef)return console[_0x523a4a(0x216)](a46_0x39c6a3[_0x523a4a(0x16c)](_0x523a4a(0x2e5))),0x1;}const _0x4cfc4b=await withSpinner('Deleting\x20project\x20'+_0x54ccb8+'...',()=>_0x44f2c1['workflow']['delete'](_0x54ccb8),{'verbose':_0x2fa243[_0x523a4a(0x2df)]}),_0x315256=_0x4cfc4b[_0x523a4a(0x2c3)];return console[_0x523a4a(0x216)]('✔\x20Deleted\x20project\x20'+_0x315256['projectName']),console[_0x523a4a(0x216)](_0x523a4a(0x2f2)+_0x315256['projectId']),0x0;}}export function parseKeyValue(_0x1d8ffc){const _0x510055=a46_0x11de4d,_0x3fefc7=_0x1d8ffc['indexOf']('=');if(_0x3fefc7===-0x1)throw new Error(_0x510055(0x2cb)+_0x1d8ffc+_0x510055(0x227));const _0x32a1a0=_0x1d8ffc[_0x510055(0x1ce)](0x0,_0x3fefc7),_0x179a5a=_0x1d8ffc[_0x510055(0x1ce)](_0x3fefc7+0x1);if(!_0x32a1a0)throw new Error(_0x510055(0x20f));return{'key':_0x32a1a0,'value':_0x179a5a};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x171);['description']=a46_0x11de4d(0x2fb);async[a46_0x11de4d(0x249)](_0x2e428d){const _0x37183a=a46_0x11de4d,{options:_0x13135f,args:_0x1e2a2f,tdx:_0x497913}=_0x2e428d,_0xc2d20b=this[_0x37183a(0x246)](_0x1e2a2f,_0x13135f);if(!_0xc2d20b)return 0x1;_0x13135f['verbose']&&console[_0x37183a(0x216)]('Project:\x20'+_0xc2d20b);const _0x5085d5=await withSpinner(_0x37183a(0x2fc),()=>_0x497913[_0x37183a(0x1ec)][_0x37183a(0x27a)](_0xc2d20b),{'verbose':_0x13135f[_0x37183a(0x2df)]}),{secrets:_0x1bbe2a}=_0x5085d5[_0x37183a(0x2c3)];return console[_0x37183a(0x216)](_0x37183a(0x199)+_0x1bbe2a['length']+'\x20secret'+(_0x1bbe2a[_0x37183a(0x284)]!==0x1?'s':'')),await handleSDKOutput(_0x1bbe2a,_0x13135f),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x290);[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x18f);async[a46_0x11de4d(0x249)](_0x2124bc){const _0x95089=a46_0x11de4d,{options:_0x3a8374,args:_0x5ef971,tdx:_0x35b208}=_0x2124bc;let _0x214387,_0x46ce48;if(_0x5ef971[_0x95089(0x284)]>=0x2)_0x214387=_0x5ef971[0x0],_0x46ce48=_0x5ef971[0x1];else{if(_0x5ef971[_0x95089(0x284)]===0x1&&_0x3a8374[_0x95089(0x18c)])_0x214387=_0x3a8374[_0x95089(0x18c)],_0x46ce48=_0x5ef971[0x0];else return _0x5ef971['length']===0x1?(console[_0x95089(0x216)](_0x95089(0x22a)),console[_0x95089(0x216)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x95089(0x216)]('Error:\x20KEY=VALUE\x20is\x20required'),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x5dd821,_0x58720e;try{({key:_0x5dd821,value:_0x58720e}=parseKeyValue(_0x46ce48));}catch(_0x453f34){return _0x453f34 instanceof Error&&console[_0x95089(0x216)](a46_0x39c6a3[_0x95089(0x184)](_0x95089(0x2f1)),_0x453f34[_0x95089(0x240)]),0x1;}_0x3a8374[_0x95089(0x2df)]&&(console[_0x95089(0x216)](_0x95089(0x1ac)+_0x214387),console[_0x95089(0x216)](_0x95089(0x258)+_0x5dd821));const _0x178b2e=await withSpinner('Setting\x20secret...',()=>_0x35b208['workflow'][_0x95089(0x21f)](_0x214387,_0x5dd821,_0x58720e),{'verbose':_0x3a8374[_0x95089(0x2df)]}),_0x1642a9=_0x178b2e[_0x95089(0x2c3)];return console[_0x95089(0x216)](_0x95089(0x2e3)+_0x1642a9[_0x95089(0x277)]+_0x95089(0x2d6)+_0x1642a9[_0x95089(0x1ea)]+'\x27'),(_0x3a8374[_0x95089(0x1bc)]||_0x3a8374[_0x95089(0x1f4)])&&await handleSingleObjectOutput(_0x1642a9,_0x3a8374),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x2e1);[a46_0x11de4d(0x1f7)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a46_0x11de4d(0x249)](_0x122fc2){const _0x174468=a46_0x11de4d,{options:_0x4b19cb,args:_0x557a59,tdx:_0x25df15}=_0x122fc2;let _0x3bc7b4,_0x1285fa;if(_0x557a59[_0x174468(0x284)]>=0x2)_0x3bc7b4=_0x557a59[0x0],_0x1285fa=_0x557a59[0x1];else{if(_0x557a59['length']===0x1&&_0x4b19cb['workflowProject'])_0x3bc7b4=_0x4b19cb[_0x174468(0x18c)],_0x1285fa=_0x557a59[0x0];else return _0x557a59[_0x174468(0x284)]===0x1?(console[_0x174468(0x216)](_0x174468(0x22a)),console[_0x174468(0x216)](_0x174468(0x1f2)),0x1):(console[_0x174468(0x216)](_0x174468(0x2b0)),console[_0x174468(0x216)](_0x174468(0x197)),0x1);}_0x4b19cb[_0x174468(0x2df)]&&(console['error'](_0x174468(0x1ac)+_0x3bc7b4),console[_0x174468(0x216)](_0x174468(0x258)+_0x1285fa));if(!_0x4b19cb[_0x174468(0x2fd)]){if(!isInteractive())return console[_0x174468(0x216)](a46_0x39c6a3[_0x174468(0x184)](_0x174468(0x28b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x174468(0x216)](a46_0x39c6a3[_0x174468(0x2c6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3457f3=await confirmKey(_0x174468(0x2f6)+_0x1285fa+_0x174468(0x1f0)+_0x3bc7b4+'\x27?');if(!_0x3457f3)return console[_0x174468(0x216)](a46_0x39c6a3['yellow'](_0x174468(0x2e5))),0x1;}const _0x3a02d8=await withSpinner('Deleting\x20secret...',()=>_0x25df15[_0x174468(0x1ec)][_0x174468(0x229)](_0x3bc7b4,_0x1285fa),{'verbose':_0x4b19cb['verbose']}),_0x1b6d17=_0x3a02d8[_0x174468(0x2c3)];return console[_0x174468(0x216)](_0x174468(0x2e3)+_0x1b6d17[_0x174468(0x277)]+_0x174468(0x23e)+_0x1b6d17[_0x174468(0x1ea)]+'\x27'),(_0x4b19cb[_0x174468(0x1bc)]||_0x4b19cb[_0x174468(0x1f4)])&&await handleSingleObjectOutput(_0x1b6d17,_0x4b19cb),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(_0x1fb88b){const _0x2a9c86=a46_0x11de4d,_0x4e279a=Math[_0x2a9c86(0x1e3)](_0x1fb88b/0x3e8),_0x39a5e9=Math[_0x2a9c86(0x1e3)](_0x4e279a/0x3c),_0xd8550e=Math[_0x2a9c86(0x1e3)](_0x39a5e9/0x3c),_0x25dfeb=Math[_0x2a9c86(0x1e3)](_0xd8550e/0x18);if(_0x25dfeb>0x0){const _0x2f746c=_0xd8550e%0x18;return _0x2f746c>0x0?_0x25dfeb+'d\x20'+_0x2f746c+'h':_0x25dfeb+'d';}else{if(_0xd8550e>0x0){const _0x33e728=_0x39a5e9%0x3c;return _0x33e728>0x0?_0xd8550e+'h\x20'+_0x33e728+'m':_0xd8550e+'h';}else{if(_0x39a5e9>0x0){const _0x5095c4=_0x4e279a%0x3c;return _0x5095c4>0x0?_0x39a5e9+'m\x20'+_0x5095c4+'s':_0x39a5e9+'m';}else return _0x4e279a+'s';}}}function formatTimestamp(_0x1173e3,_0x2de3a5){const _0x12fff5=a46_0x11de4d,_0x4a7b8d=new Date(_0x1173e3),_0x1a235d=String(_0x4a7b8d[_0x12fff5(0x283)]())['padStart'](0x2,'0'),_0x2e0a4d=String(_0x4a7b8d[_0x12fff5(0x29f)]())['padStart'](0x2,'0'),_0x1b2ded=_0x1a235d+':'+_0x2e0a4d,_0x1cd04e=_0x4a7b8d['getFullYear']()===_0x2de3a5[_0x12fff5(0x299)]()&&_0x4a7b8d['getMonth']()===_0x2de3a5[_0x12fff5(0x226)]()&&_0x4a7b8d[_0x12fff5(0x1a8)]()===_0x2de3a5['getDate']();if(_0x1cd04e)return _0x1b2ded;else{const _0x180064=String(_0x4a7b8d[_0x12fff5(0x226)]()+0x1)[_0x12fff5(0x2b8)](0x2,'0'),_0x13c21e=String(_0x4a7b8d[_0x12fff5(0x1a8)]())[_0x12fff5(0x2b8)](0x2,'0');return _0x180064+'-'+_0x13c21e+'\x20'+_0x1b2ded;}}function formatDate(_0x2a3929){const _0x51d09b=a46_0x11de4d,_0x31045d=_0x2a3929[_0x51d09b(0x299)](),_0x221109=String(_0x2a3929[_0x51d09b(0x226)]()+0x1)[_0x51d09b(0x2b8)](0x2,'0'),_0x37f777=String(_0x2a3929[_0x51d09b(0x1a8)]())[_0x51d09b(0x2b8)](0x2,'0');return _0x31045d+'-'+_0x221109+'-'+_0x37f777;}function getTaskStateIcon(_0xc4c225){const _0x20552a={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x20552a[_0xc4c225]||'⚪';}function getBarChar(_0x2cd6e6){const _0x8c0129=a46_0x11de4d;return _0x2cd6e6==='error'||_0x2cd6e6===_0x8c0129(0x268)?'×':'─';}function getBarColor(_0x1070a9){const _0x998821=a46_0x11de4d,_0x1be745={'success':a46_0x39c6a3['green'],'error':a46_0x39c6a3[_0x998821(0x184)],'group_error':a46_0x39c6a3[_0x998821(0x184)],'running':a46_0x39c6a3['blue'],'blocked':a46_0x39c6a3[_0x998821(0x16c)],'planned':a46_0x39c6a3[_0x998821(0x2c6)],'canceling':a46_0x39c6a3[_0x998821(0x16c)]};return _0x1be745[_0x1070a9]||a46_0x39c6a3[_0x998821(0x2f8)];}function parseTaskName(_0x18a859){const _0x123218=a46_0x11de4d;let _0x4fc9e7=_0x18a859[_0x123218(0x2c5)](/^\++/,'');const _0x4a6e7a=_0x4fc9e7[_0x123218(0x2ae)]('+'),_0xf80144=_0x4a6e7a[_0x123218(0x284)]>0x1?_0x4a6e7a[_0x123218(0x284)]-0x2:0x0,_0x9d604e=_0x4a6e7a[_0x4a6e7a[_0x123218(0x284)]-0x1]||_0x4fc9e7;return{'level':_0xf80144,'name':'+'+_0x9d604e};}function truncateTaskName(_0x122a29,_0x17f820){const _0x4f69fc=a46_0x11de4d,_0x3ee6e6=stringWidth(_0x122a29);if(_0x3ee6e6<=_0x17f820)return _0x122a29;let _0x4c0e4e=_0x122a29;while(stringWidth(_0x4c0e4e+'…')>_0x17f820&&_0x4c0e4e[_0x4f69fc(0x284)]>0x0){_0x4c0e4e=_0x4c0e4e[_0x4f69fc(0x19a)](0x0,-0x1);}return _0x4c0e4e+'…';}function calculateTimeScale(_0x4d951d,_0x686b47){const _0x40ac64=a46_0x11de4d;return{'startTime':_0x4d951d[_0x40ac64(0x297)],'endTime':_0x4d951d[_0x40ac64(0x280)],'durationMs':_0x4d951d[_0x40ac64(0x292)],'msPerChar':_0x4d951d['duration']/_0x686b47};}function timeToPosition(_0x49f967,_0x9b9b59,_0x38dbc6){const _0x31937e=a46_0x11de4d,_0x41f73b=_0x49f967-_0x9b9b59[_0x31937e(0x215)],_0x49002d=Math[_0x31937e(0x1e3)](_0x41f73b/_0x9b9b59['msPerChar']);return Math[_0x31937e(0x198)](0x0,Math[_0x31937e(0x247)](_0x49002d,_0x38dbc6));}function renderTimeAxis(_0x5a1330,_0x44fca7){const _0xbbd1aa=a46_0x11de4d,_0xcf4bb6=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0xbbd1aa(0x198)](TIMELINE_CONFIG[_0xbbd1aa(0x2a1)],Math['floor'](_0x44fca7/TIMELINE_CONFIG[_0xbbd1aa(0x19d)]))),_0x458c9c=_0x5a1330['durationMs']/(_0xcf4bb6-0x1),_0x567511=new Date(_0x5a1330[_0xbbd1aa(0x215)]),_0x32f9d8=[];for(let _0x19544c=0x0;_0x19544c<_0xcf4bb6;_0x19544c++){const _0x19ed35=_0x5a1330[_0xbbd1aa(0x215)]+_0x19544c*_0x458c9c,_0x304f95=timeToPosition(_0x19ed35,_0x5a1330,_0x44fca7),_0x16013b=formatTimestamp(_0x19ed35,_0x567511);_0x32f9d8[_0xbbd1aa(0x2f9)]({'pos':_0x304f95,'text':_0x16013b});}const _0x569905=new Array(_0x44fca7)['fill']('\x20');let _0x17a05c=-0x1;for(const {pos:_0x394145,text:_0x172b27}of _0x32f9d8){let _0x260361=Math[_0xbbd1aa(0x198)](0x0,_0x394145-Math[_0xbbd1aa(0x1e3)](_0x172b27[_0xbbd1aa(0x284)]/0x2));_0x260361<=_0x17a05c+TIMELINE_CONFIG[_0xbbd1aa(0x1e5)]&&(_0x260361=_0x17a05c+TIMELINE_CONFIG[_0xbbd1aa(0x1e5)]+0x1);_0x260361+_0x172b27[_0xbbd1aa(0x284)]>_0x44fca7&&(_0x260361=_0x44fca7-_0x172b27[_0xbbd1aa(0x284)]);if(_0x260361>=0x0&&_0x260361+_0x172b27[_0xbbd1aa(0x284)]<=_0x44fca7&&_0x260361>_0x17a05c){for(let _0x456b3d=0x0;_0x456b3d<_0x172b27[_0xbbd1aa(0x284)];_0x456b3d++){_0x569905[_0x260361+_0x456b3d]=_0x172b27[_0x456b3d];}_0x17a05c=_0x260361+_0x172b27['length']-0x1;}}return _0x569905[_0xbbd1aa(0x26a)]('');}function renderTaskRow(_0x1219f7,_0x3caae3,_0x1ec4bd,_0x415dc2){const _0x16ce1a=a46_0x11de4d,{level:_0x2ca214,name:_0x5d671e}=parseTaskName(_0x1219f7[_0x16ce1a(0x242)]),_0x429bf7='\x20'[_0x16ce1a(0x2bb)](_0x2ca214),_0x27c76e=_0x1219f7['window']?'('+formatElapsed(_0x1219f7['window']['duration'])+')':'',_0x114300=stringWidth(_0x27c76e),_0x36401c=_0x2ca214*0x1,_0x26e95d=_0x415dc2-_0x36401c-_0x114300-0x1,_0x429521=truncateTaskName(_0x5d671e,_0x26e95d),_0xe6143=_0x429bf7+_0x429521,_0xa3e8ae=stringWidth(_0xe6143),_0x585c6f=_0x415dc2-_0xa3e8ae-_0x114300,_0x4087d7=_0xe6143+'\x20'[_0x16ce1a(0x2bb)](Math[_0x16ce1a(0x198)](0x1,_0x585c6f))+a46_0x39c6a3[_0x16ce1a(0x2c6)](_0x27c76e),_0x21a146=getTaskStateIcon(_0x1219f7[_0x16ce1a(0x1b5)]),_0x2032d3=new Array(_0x1ec4bd)[_0x16ce1a(0x2ca)]('\x20');if(_0x1219f7['window']){const _0x767d4a=timeToPosition(_0x1219f7['window'][_0x16ce1a(0x297)],_0x3caae3,_0x1ec4bd),_0x1a5320=timeToPosition(_0x1219f7[_0x16ce1a(0x18a)][_0x16ce1a(0x280)],_0x3caae3,_0x1ec4bd),_0x291a37=getBarChar(_0x1219f7[_0x16ce1a(0x1b5)]),_0x19ba44=Math['max'](_0x767d4a+0x1,_0x1a5320);for(let _0x8d5f75=_0x767d4a;_0x8d5f75<Math['min'](_0x19ba44,_0x1ec4bd);_0x8d5f75++){_0x2032d3[_0x8d5f75]=_0x291a37;}}const _0x485472=getBarColor(_0x1219f7['state']),_0x945b55=_0x2032d3[_0x16ce1a(0x192)](_0x4d44c3=>_0x4d44c3==='\x20'?'\x20':_0x485472(_0x4d44c3))['join']('');return _0x21a146+'\x20'+_0x4087d7+'│'+_0x945b55+'│';}function calculateStats(_0x403d4a){const _0x4db818=a46_0x11de4d,_0x240e27={'total':_0x403d4a[_0x4db818(0x284)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2ae775 of _0x403d4a){if(_0x2ae775[_0x4db818(0x1b5)]===_0x4db818(0x221))_0x240e27[_0x4db818(0x221)]++;else{if(_0x2ae775[_0x4db818(0x1b5)]===_0x4db818(0x216)||_0x2ae775['state']===_0x4db818(0x268))_0x240e27[_0x4db818(0x216)]++;else _0x2ae775[_0x4db818(0x1b5)]===_0x4db818(0x2e8)?_0x240e27[_0x4db818(0x2e8)]++:_0x240e27[_0x4db818(0x28f)]++;}}return _0x240e27;}function formatStats(_0x205e68){const _0x5fe376=a46_0x11de4d;return[_0x5fe376(0x2d7)+_0x205e68[_0x5fe376(0x243)],'✅\x20'+_0x205e68[_0x5fe376(0x221)],'❌\x20'+_0x205e68[_0x5fe376(0x216)],_0x5fe376(0x1d5)+_0x205e68['running'],'⏳\x20'+_0x205e68[_0x5fe376(0x28f)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a46_0x11de4d(0x242)]=a46_0x11de4d(0x205);[a46_0x11de4d(0x1f7)]=a46_0x11de4d(0x2fa);async['execute'](_0x3f71ea){const _0xcd1630=a46_0x11de4d,{options:_0x469ba8,args:_0x161457,tdx:_0x51d996}=_0x3f71ea;let _0x461f86,_0x4b8890,_0x391faa=![];if(_0x161457[0x0]){if(_0x161457[0x0]['includes']('.')){const _0x265245=this[_0xcd1630(0x201)](_0x161457,_0x469ba8);if(!_0x265245)return 0x1;_0x461f86=_0x265245[_0xcd1630(0x1ea)],_0x4b8890=_0x265245['workflowName'];}else{_0x4b8890=_0x161457[0x0],_0x461f86=_0x469ba8['workflowProject'];if(!_0x461f86)return console[_0xcd1630(0x216)](a46_0x39c6a3[_0xcd1630(0x184)](_0xcd1630(0x2f1)),_0xcd1630(0x22d)),0x1;_0x391faa=!![];}}else{const _0x2b94d6=this[_0xcd1630(0x201)](_0x161457,_0x469ba8);if(!_0x2b94d6)return 0x1;_0x461f86=_0x2b94d6['projectName'],_0x4b8890=_0x2b94d6[_0xcd1630(0x2bf)];}if(_0x469ba8[_0xcd1630(0x2df)]){if(_0x461f86&&_0x4b8890)console[_0xcd1630(0x216)](_0xcd1630(0x29a)+_0x461f86+'.'+_0x4b8890);else _0x461f86&&console[_0xcd1630(0x216)]('Filter:\x20project='+_0x461f86);}const _0x283937=_0x469ba8['attemptId'],_0x1b0005=_0x469ba8[_0xcd1630(0x1fa)];if(_0x283937){_0x1b0005&&console['error'](a46_0x39c6a3['yellow'](_0xcd1630(0x21a)),_0xcd1630(0x29c));const _0x2cf9af=_0x469ba8['follow'];return _0x2cf9af?await this[_0xcd1630(0x232)](_0x3f71ea,_0x283937):await this[_0xcd1630(0x2ff)](_0x3f71ea,_0x283937,_0x469ba8),0x0;}if(_0x1b0005){const _0xbd9a62=await withSpinner(_0xcd1630(0x217),()=>_0x51d996[_0xcd1630(0x1ec)][_0xcd1630(0x1cf)]({'projectName':_0x461f86,'workflowName':_0x4b8890,'limit':0x64}),{'verbose':_0x469ba8[_0xcd1630(0x2df)]}),_0x54dc31=_0xbd9a62[_0xcd1630(0x2c3)][_0xcd1630(0x1be)](_0x372365=>_0x372365['id']===_0x1b0005);if(!_0x54dc31)return console['error'](a46_0x39c6a3[_0xcd1630(0x184)](_0xcd1630(0x2f1)),_0xcd1630(0x218)+_0x1b0005),0x1;if(!_0x54dc31[_0xcd1630(0x22e)]?.['id'])return console[_0xcd1630(0x216)](a46_0x39c6a3['red'](_0xcd1630(0x2f1)),_0xcd1630(0x1fe)+_0x1b0005+_0xcd1630(0x235)),0x1;const _0x2b1472=_0x54dc31[_0xcd1630(0x22e)]['id'];_0x469ba8[_0xcd1630(0x2df)]&&console[_0xcd1630(0x216)]('Using\x20attempt\x20'+_0x2b1472+_0xcd1630(0x179)+_0x1b0005);const _0x574ed5=_0x469ba8[_0xcd1630(0x1a2)];return _0x574ed5?await this[_0xcd1630(0x232)](_0x3f71ea,_0x2b1472):await this['renderSingleTimeline'](_0x3f71ea,_0x2b1472,_0x469ba8),0x0;}const _0x373df2=await withSpinner(_0xcd1630(0x186),()=>_0x51d996[_0xcd1630(0x1ec)][_0xcd1630(0x1cf)]({'projectName':_0x461f86,'workflowName':_0x4b8890,'limit':_0x469ba8['limit']||0x32}),{'verbose':_0x469ba8[_0xcd1630(0x2df)]}),_0xae07fe=_0x373df2[_0xcd1630(0x2c3)];if(_0xae07fe[_0xcd1630(0x284)]===0x0){if(_0x461f86&&_0x4b8890)console[_0xcd1630(0x216)](_0xcd1630(0x212)+_0x461f86+'.'+_0x4b8890);else _0x461f86?console['error'](_0xcd1630(0x2ab)+_0x461f86):(console['error'](_0xcd1630(0x1da)),console['error'](a46_0x39c6a3[_0xcd1630(0x2c6)](_0xcd1630(0x1ba))));return 0x0;}_0xae07fe['sort']((_0x5aa666,_0x154c8f)=>{const _0x59f497=_0xcd1630,_0xdfda3c=_0x5aa666[_0x59f497(0x21d)]||'',_0x15494c=_0x154c8f[_0x59f497(0x21d)]||'';return _0x15494c['localeCompare'](_0xdfda3c);});if(_0x469ba8[_0xcd1630(0x1bc)]||_0x469ba8[_0xcd1630(0x1f4)])return await handleSDKOutput(_0xae07fe,_0x469ba8),0x0;let _0x5db4f9;if(_0x391faa){const _0x11686a=_0xae07fe[0x0];if(!_0x11686a[_0xcd1630(0x22e)]?.['id'])return console[_0xcd1630(0x216)](_0xcd1630(0x1c9)),0x0;_0x5db4f9=_0x11686a[_0xcd1630(0x22e)]['id'],_0x469ba8[_0xcd1630(0x2df)]&&console[_0xcd1630(0x216)]('Auto-selected\x20latest\x20session:\x20'+_0x11686a[_0xcd1630(0x21d)]);}else{const _0x34436a=_0xae07fe['map'](_0x1f3878=>{const _0x21126e=_0xcd1630,_0x287a86=getAttemptStatusDisplay(_0x1f3878[_0x21126e(0x22e)]);return{'title':_0x1f3878[_0x21126e(0x1d6)]?.[_0x21126e(0x242)]+'.'+_0x1f3878[_0x21126e(0x1ec)]?.[_0x21126e(0x242)]+'\x20-\x20'+_0x1f3878[_0x21126e(0x21d)]+'\x20'+_0x287a86[_0x21126e(0x1c1)],'value':_0x1f3878['lastAttempt']?.['id']||'','description':_0x287a86[_0x21126e(0x2cd)]};}),_0x407372=await a46_0x4a1f33({'type':_0xcd1630(0x273),'name':_0xcd1630(0x1e9),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x34436a[_0xcd1630(0x1aa)](_0x2aef7=>_0x2aef7[_0xcd1630(0x1e2)]!=='')});if(!_0x407372[_0xcd1630(0x1e9)])return 0x0;_0x5db4f9=_0x407372[_0xcd1630(0x1e9)];}const _0x50ebe5=_0x469ba8[_0xcd1630(0x1a2)];return _0x50ebe5?await this[_0xcd1630(0x232)](_0x3f71ea,_0x5db4f9):await this['renderSingleTimeline'](_0x3f71ea,_0x5db4f9,_0x469ba8),0x0;}async['renderSingleTimeline'](_0x25776d,_0x5bc9a3,_0x21fed3){const _0x4b3a89=a46_0x11de4d,{tdx:_0x1fbd5d}=_0x25776d;let _0x421a28,_0x47373f;try{[_0x421a28,_0x47373f]=await Promise[_0x4b3a89(0x2ee)]([_0x1fbd5d[_0x4b3a89(0x1ec)][_0x4b3a89(0x2b6)](_0x5bc9a3),_0x1fbd5d[_0x4b3a89(0x1ec)][_0x4b3a89(0x1d9)](_0x5bc9a3,![])]);}catch(_0x42ac06){console['error'](a46_0x39c6a3['red'](_0x4b3a89(0x274)));_0x21fed3[_0x4b3a89(0x2df)]&&console['error'](_0x42ac06);throw _0x42ac06;}if(_0x21fed3[_0x4b3a89(0x1bc)]||_0x21fed3[_0x4b3a89(0x1f4)]){const _0x29092d=this['buildTimelineData'](_0x421a28,_0x47373f);await handleSDKOutput([_0x29092d],_0x21fed3);return;}const _0x399d87=_0x1fbd5d[_0x4b3a89(0x200)]['site'],_0x111e4f=this[_0x4b3a89(0x17d)](_0x421a28,_0x47373f,_0x399d87);console['log'](_0x111e4f);}async['pollTimeline'](_0x38d2a9,_0x5cc25d){const _0xa81b71=a46_0x11de4d,{tdx:_0x27a438}=_0x38d2a9,_0x371cb5=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x2a1c3b=TIMELINE_CONFIG[_0xa81b71(0x20b)];let _0xfc9744=0x0;while(_0xfc9744<_0x2a1c3b){process['stdout'][_0xa81b71(0x1c8)]&&process[_0xa81b71(0x2d3)][_0xa81b71(0x223)]('\x1bc');let _0x3ae9a6,_0x4553a0;try{[_0x3ae9a6,_0x4553a0]=await Promise[_0xa81b71(0x2ee)]([_0x27a438['workflow']['attempt'](_0x5cc25d),_0x27a438[_0xa81b71(0x1ec)][_0xa81b71(0x1d9)](_0x5cc25d,![])]);}catch(_0x166e49){console['error'](a46_0x39c6a3[_0xa81b71(0x184)](_0xa81b71(0x26e)));_0xfc9744>0x0&&console[_0xa81b71(0x216)](a46_0x39c6a3['dim']('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0xfc9744));throw _0x166e49;}const _0x50c6ba=_0x27a438['context'][_0xa81b71(0x1b1)],_0x3e5851=this[_0xa81b71(0x17d)](_0x3ae9a6,_0x4553a0,_0x50c6ba);console[_0xa81b71(0x2f4)](_0x3e5851);const _0x512ef9=_0x3ae9a6['done']&&_0x4553a0[_0xa81b71(0x263)](_0x55f316=>_0x55f316['state']!==_0xa81b71(0x2e8)&&_0x55f316['state']!==_0xa81b71(0x27b));if(_0x512ef9){console[_0xa81b71(0x216)](a46_0x39c6a3[_0xa81b71(0x2ea)]('\x0a✔\x20Attempt\x20complete'));break;}console['error'](a46_0x39c6a3[_0xa81b71(0x2c6)](_0xa81b71(0x248)+_0xfc9744*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x586480=>setTimeout(_0x586480,_0x371cb5)),_0xfc9744++;}_0xfc9744>=_0x2a1c3b&&console['error'](a46_0x39c6a3[_0xa81b71(0x16c)](_0xa81b71(0x236)));}['renderTimeline'](_0x21372f,_0x364ffa,_0x4a43bb){const _0x1d9355=a46_0x11de4d,_0x142233=[],_0x41d6cf=TIMELINE_CONFIG[_0x1d9355(0x1b8)],_0x24c1df=0x5,_0x553d34=process[_0x1d9355(0x2d3)][_0x1d9355(0x2e2)]||0x78,_0x3b8b66=_0x553d34-_0x41d6cf-_0x24c1df,_0xd38545=Math[_0x1d9355(0x198)](TIMELINE_CONFIG[_0x1d9355(0x2a5)],Math[_0x1d9355(0x247)](_0x3b8b66,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x5d3ce1=new Date(_0x21372f['createdAt'])[_0x1d9355(0x188)](),_0x59f7ce=_0x21372f[_0x1d9355(0x175)]?new Date(_0x21372f['finishedAt'])[_0x1d9355(0x188)]():Date[_0x1d9355(0x2f3)](),_0x5c7b34={'start':_0x5d3ce1,'end':_0x59f7ce,'duration':_0x59f7ce-_0x5d3ce1},_0x150eb5=new Map(),_0x18d435=[];for(const _0xe8cd0e of _0x364ffa){if(_0xe8cd0e[_0x1d9355(0x187)]){const _0x57d5e0=new Date(_0xe8cd0e['startedAt'])['getTime'](),_0x55e833=_0xe8cd0e[_0x1d9355(0x18b)]?new Date(_0xe8cd0e[_0x1d9355(0x18b)])[_0x1d9355(0x188)]():Date[_0x1d9355(0x2f3)](),_0x7fd8f4={'start':_0x57d5e0,'end':_0x55e833,'duration':_0x55e833-_0x57d5e0};_0x150eb5[_0x1d9355(0x1eb)](_0xe8cd0e['id'],_0x7fd8f4),_0x18d435['push']({'name':_0xe8cd0e[_0x1d9355(0x26f)],'state':_0xe8cd0e[_0x1d9355(0x1b5)]||_0x1d9355(0x1d4),'window':_0x7fd8f4});}else _0x18d435[_0x1d9355(0x2f9)]({'name':_0xe8cd0e['fullName'],'state':_0xe8cd0e['state']||'planned','window':undefined});}_0x18d435[_0x1d9355(0x1fc)]((_0x482d26,_0x261ac2)=>{const _0x274c38=_0x1d9355;if(!_0x482d26[_0x274c38(0x18a)])return 0x1;if(!_0x261ac2[_0x274c38(0x18a)])return-0x1;return _0x482d26[_0x274c38(0x18a)][_0x274c38(0x297)]-_0x261ac2[_0x274c38(0x18a)][_0x274c38(0x297)];});const _0x5bc779=_0x18d435['length'],_0x3659e2=_0x5bc779>TIMELINE_CONFIG[_0x1d9355(0x29d)];_0x3659e2&&_0x18d435[_0x1d9355(0x2eb)](TIMELINE_CONFIG[_0x1d9355(0x29d)]);const _0x14131a=calculateTimeScale(_0x5c7b34,_0xd38545),_0x53d660=_0x21372f[_0x1d9355(0x1fb)]?_0x21372f['success']?a46_0x39c6a3['green'](_0x1d9355(0x221)):a46_0x39c6a3[_0x1d9355(0x184)](_0x1d9355(0x216)):a46_0x39c6a3[_0x1d9355(0x191)](_0x1d9355(0x2e8)),_0x31e117=_0x21372f[_0x1d9355(0x1d6)]?.['id'],_0x42932b=_0x21372f['sessionId'];let _0x33d239;if(_0x31e117&&_0x42932b){const _0x19cb8a=getWorkflowAttemptUrl(_0x4a43bb,_0x31e117,_0x42932b,_0x21372f['id']);_0x33d239=hyperlink(a46_0x39c6a3[_0x1d9355(0x2c6)](_0x21372f['id']),_0x19cb8a);}else _0x33d239=a46_0x39c6a3['dim'](_0x21372f['id']);_0x142233[_0x1d9355(0x2f9)](_0x1d9355(0x16a)+_0x33d239+_0x1d9355(0x27f)+_0x53d660+'\x20-\x20'+formatElapsed(_0x5c7b34[_0x1d9355(0x292)]));if(_0x18d435['length']>0x0){const _0x1e42d3=renderTimeAxis(_0x14131a,_0xd38545),_0x281ad2=new Date(_0x5c7b34['start']),_0x173ef3=formatDate(_0x281ad2),_0xfaad21=TIMELINE_CONFIG[_0x1d9355(0x298)]+TIMELINE_CONFIG['ICON_SPACING']+_0x41d6cf,_0x14f144=_0x173ef3[_0x1d9355(0x2b8)](_0xfaad21),_0x1d373d=a46_0x39c6a3[_0x1d9355(0x2c6)](_0x14f144);_0x142233['push'](_0x1d373d+'\x20'+_0x1e42d3);for(const _0xfa4f5d of _0x18d435){_0x142233[_0x1d9355(0x2f9)](renderTaskRow(_0xfa4f5d,_0x14131a,_0xd38545,_0x41d6cf));}const _0x4f3d1a=calculateStats(_0x18d435);_0x142233[_0x1d9355(0x2f9)](formatStats(_0x4f3d1a)),_0x3659e2&&_0x142233[_0x1d9355(0x2f9)](a46_0x39c6a3[_0x1d9355(0x16c)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x1d9355(0x29d)]+'\x20of\x20'+_0x5bc779+_0x1d9355(0x222))),_0x142233[_0x1d9355(0x2f9)](''),_0x142233['push'](a46_0x39c6a3['dim'](_0x1d9355(0x1ca))+('tdx\x20wf\x20attempt\x20'+_0x21372f['id']+'\x20logs')+a46_0x39c6a3[_0x1d9355(0x2c6)]('\x20to\x20see\x20detailed\x20logs'));}else _0x142233[_0x1d9355(0x2f9)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x142233[_0x1d9355(0x26a)]('\x0a');}[a46_0x11de4d(0x1c7)](_0x1a6cd7,_0x221357){const _0x3e14cc=a46_0x11de4d,_0x304d90=new Date(_0x1a6cd7[_0x3e14cc(0x282)])['getTime'](),_0x562f22=_0x1a6cd7['finishedAt']?new Date(_0x1a6cd7[_0x3e14cc(0x175)])[_0x3e14cc(0x188)]():Date[_0x3e14cc(0x2f3)](),_0x9bd385=_0x562f22-_0x304d90,_0xa76189=[];for(const _0x2fb72c of _0x221357){if(_0x2fb72c[_0x3e14cc(0x187)]){const _0x12e9ab=new Date(_0x2fb72c['startedAt'])['getTime'](),_0x44c12d=_0x2fb72c[_0x3e14cc(0x18b)]?new Date(_0x2fb72c[_0x3e14cc(0x18b)])[_0x3e14cc(0x188)]():Date[_0x3e14cc(0x2f3)]();_0xa76189[_0x3e14cc(0x2f9)]({'name':_0x2fb72c['fullName'],'state':_0x2fb72c['state']||'unknown','window':{'start':_0x12e9ab,'end':_0x44c12d,'duration':_0x44c12d-_0x12e9ab}});}else _0xa76189['push']({'name':_0x2fb72c[_0x3e14cc(0x26f)],'state':_0x2fb72c[_0x3e14cc(0x1b5)]||'planned','window':undefined});}const _0x275a09=calculateStats(_0xa76189);return{'attempt':{'id':_0x1a6cd7['id'],'status':_0x1a6cd7[_0x3e14cc(0x1fb)]?_0x1a6cd7[_0x3e14cc(0x221)]?_0x3e14cc(0x221):_0x3e14cc(0x216):'running','createdAt':_0x1a6cd7[_0x3e14cc(0x282)],'finishedAt':_0x1a6cd7['finishedAt'],'duration_ms':_0x9bd385},'tasks':_0xa76189[_0x3e14cc(0x192)](_0x3966c4=>({'name':_0x3966c4['name'],'state':_0x3966c4[_0x3e14cc(0x1b5)],'startedAt':_0x3966c4[_0x3e14cc(0x18a)]?new Date(_0x3966c4['window']['start'])['toISOString']():null,'updatedAt':_0x3966c4['window']?new Date(_0x3966c4[_0x3e14cc(0x18a)][_0x3e14cc(0x280)])['toISOString']():null,'duration_ms':_0x3966c4[_0x3e14cc(0x18a)]?.[_0x3e14cc(0x292)]||null})),'stats':_0x275a09};}}
|
|
1
|
+
const a46_0x591dc6=a46_0x2532;(function(_0x5bfb5e,_0x325086){const _0x66e9b3=a46_0x2532,_0x4e3ab1=_0x5bfb5e();while(!![]){try{const _0x156a9e=-parseInt(_0x66e9b3(0x20a))/0x1*(-parseInt(_0x66e9b3(0x13b))/0x2)+parseInt(_0x66e9b3(0x1a8))/0x3*(parseInt(_0x66e9b3(0x184))/0x4)+parseInt(_0x66e9b3(0xc1))/0x5+parseInt(_0x66e9b3(0x1bb))/0x6+parseInt(_0x66e9b3(0x183))/0x7+parseInt(_0x66e9b3(0xe4))/0x8*(parseInt(_0x66e9b3(0x1d2))/0x9)+-parseInt(_0x66e9b3(0x1a3))/0xa*(parseInt(_0x66e9b3(0x1e9))/0xb);if(_0x156a9e===_0x325086)break;else _0x4e3ab1['push'](_0x4e3ab1['shift']());}catch(_0x4fba12){_0x4e3ab1['push'](_0x4e3ab1['shift']());}}}(a46_0x5415,0xb849f));import a46_0x1f96c9 from'chalk';import{existsSync}from'fs';import a46_0x14a963 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 a46_0x1147d5 from'prompts';function getAttemptStatusDisplay(_0x26298c){const _0x36e94d=a46_0x2532;if(!_0x26298c)return{'icon':'⏳','text':''};const {done:_0x457900,success:_0x289f09,cancelRequested:_0x2e1690}=_0x26298c;if(!_0x457900)return _0x2e1690?{'icon':'🛑','text':a46_0x1f96c9[_0x36e94d(0x15c)](_0x36e94d(0x146))}:{'icon':'🔄','text':a46_0x1f96c9[_0x36e94d(0x122)](_0x36e94d(0x185))};if(_0x289f09)return{'icon':'✅','text':a46_0x1f96c9[_0x36e94d(0x17f)](_0x36e94d(0xb1))};return{'icon':'❌','text':a46_0x1f96c9[_0x36e94d(0xb9)](_0x36e94d(0xb3))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x41332c,_0xad1148,_0x1edd4e=0x0){const _0x380dac=a46_0x2532;return _0x41332c[_0x1edd4e]||_0xad1148[_0x380dac(0x12c)];}[a46_0x591dc6(0x1ac)](_0x4e28ed,_0x3caaf2,_0x30318a=0x0){const _0x3ae238=a46_0x591dc6,_0x4b81a4=this[_0x3ae238(0x203)](_0x4e28ed,_0x3caaf2,_0x30318a);if(!_0x4b81a4)return console[_0x3ae238(0xb3)](a46_0x1f96c9[_0x3ae238(0xb9)]('Error:'),_0x3ae238(0x1b3)),console['error'](a46_0x1f96c9[_0x3ae238(0x192)](_0x3ae238(0x83))),null;return _0x4b81a4;}[a46_0x591dc6(0x1e1)](_0x5f0f40,_0x13a62f){const _0x2e21b0=a46_0x591dc6;if(_0x5f0f40[0x0]){const _0x2f4e2e=_0x5f0f40[0x0][_0x2e21b0(0x1a4)]('.');if(_0x2f4e2e['length']===0x1)return{'projectName':_0x2f4e2e[0x0],'workflowName':undefined};else return _0x2f4e2e[_0x2e21b0(0x1ff)]===0x2?{'projectName':_0x2f4e2e[0x0],'workflowName':_0x2f4e2e[0x1]}:(console[_0x2e21b0(0xb3)](a46_0x1f96c9['red'](_0x2e21b0(0x1a9)),_0x2e21b0(0x19e)),null);}return{'projectName':_0x13a62f['workflowProject'],'workflowName':undefined};}[a46_0x591dc6(0xef)](_0x29644d,_0x5e845d,_0x23dfb4=0x0){const _0x3854d5=a46_0x591dc6;if(_0x29644d[_0x23dfb4])return _0x29644d[_0x23dfb4];if(_0x5e845d[_0x3854d5(0x12c)]){const _0x1ffe90=a46_0x14a963[_0x3854d5(0x84)](process[_0x3854d5(0xb7)](),_0x3854d5(0x22b),_0x5e845d[_0x3854d5(0x12c)]);if(existsSync(a46_0x14a963[_0x3854d5(0x84)](_0x1ffe90,'tdx.json')))return _0x1ffe90;}return undefined;}async[a46_0x591dc6(0x13d)](_0x1ce709,_0x46a61d,_0xa7b171){const _0x158b07=a46_0x591dc6;try{const _0x5668c0=await _0x1ce709['workflow']['workflows'](_0x46a61d,{'limit':0x1});if(_0x5668c0[_0x158b07(0x1ff)]>0x0){const _0x4e9961=_0x5668c0[0x0]['id'],_0x4f77b=getWorkflowUrl(_0xa7b171,_0x4e9961);console['error']('\x20\x20Console:\x20'+a46_0x1f96c9[_0x158b07(0xd9)](_0x4f77b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x222);[a46_0x591dc6(0x193)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x544083){const _0x4feef4=a46_0x591dc6,{options:_0x286b80,args:_0x4f2a6a,tdx:_0x27e8e9}=_0x544083,_0x5c0015=_0x4f2a6a[0x0],_0x5ecc8d=_0x286b80[_0x4feef4(0x12b)];if(_0x5ecc8d)return saveSessionContext({'workflow_project':undefined},_0x286b80['session']),console[_0x4feef4(0x9e)](a46_0x1f96c9[_0x4feef4(0x17f)](_0x4feef4(0x17c))),0x0;if(!_0x5c0015)return console[_0x4feef4(0xb3)](a46_0x1f96c9[_0x4feef4(0xb9)](_0x4feef4(0x1a9)),_0x4feef4(0x1b3)),console[_0x4feef4(0xb3)](a46_0x1f96c9['dim'](_0x4feef4(0x11d))),console[_0x4feef4(0xb3)](a46_0x1f96c9[_0x4feef4(0x192)](_0x4feef4(0x104))),0x1;const _0x6a3596=await withSpinner(_0x4feef4(0x213)+_0x5c0015+_0x4feef4(0x172),()=>_0x27e8e9[_0x4feef4(0x1f4)]['resolveProjectId'](_0x5c0015),{'verbose':_0x286b80[_0x4feef4(0x1a6)]}),{name:_0x3526e1}=_0x6a3596[_0x4feef4(0x164)];return saveSessionContext({'workflow_project':_0x3526e1},_0x286b80[_0x4feef4(0xd7)]),console[_0x4feef4(0x9e)](a46_0x1f96c9['green'](_0x4feef4(0xfe)+a46_0x1f96c9['cyan'](_0x3526e1))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a46_0x591dc6(0xc9)]='workflow:projects';[a46_0x591dc6(0x193)]=a46_0x591dc6(0x133);async['execute'](_0x5c0ea8){const _0x346516=a46_0x591dc6,{options:_0x4a4a39,args:_0x5aac43,tdx:_0x5c772c}=_0x5c0ea8,_0xca8dd9=_0x5aac43[0x0];_0x4a4a39[_0x346516(0x1a6)]&&_0xca8dd9&&console[_0x346516(0xb3)]('Pattern:\x20'+_0xca8dd9);const _0x55773b=await withSpinner(_0x346516(0x1f7),()=>_0x5c772c[_0x346516(0x1f4)]['projects'](_0xca8dd9,{'limit':_0x4a4a39[_0x346516(0xa1)]}),{'verbose':_0x4a4a39[_0x346516(0x1a6)]});let _0x1ef5f5=_0x55773b['data'];_0x1ef5f5[_0x346516(0xf9)]((_0x45c097,_0x1aeea9)=>_0x45c097[_0x346516(0xc9)][_0x346516(0x21d)](_0x1aeea9['name']));const _0x358945=_0x4a4a39[_0x346516(0xa1)]||0x64,_0x5441a8=_0x1ef5f5[_0x346516(0x1ff)]>=_0x358945?a46_0x1f96c9[_0x346516(0x192)](_0x346516(0x179)):'';console[_0x346516(0xb3)](_0x346516(0x182)+_0x1ef5f5[_0x346516(0x1ff)]+_0x346516(0x1db)+(_0x1ef5f5[_0x346516(0x1ff)]!==0x1?'s':'')+_0x5441a8);if(_0x4a4a39['format']===_0x346516(0x1fb)||_0x4a4a39['format']===_0x346516(0x1d8)||_0x4a4a39[_0x346516(0xa5)]===_0x346516(0x147))await handleSDKOutput(_0x1ef5f5,_0x4a4a39);else{if(_0x1ef5f5[_0x346516(0x1ff)]===0x0)_0xca8dd9?console[_0x346516(0x9e)](_0x346516(0x1b7)+_0xca8dd9):console[_0x346516(0x9e)](_0x346516(0x194));else{const _0x983f26=_0x1ef5f5['map'](_0x1b25dd=>{const _0x353b1f=_0x346516,_0xb03255=_0x1b25dd[_0x353b1f(0x98)]?.[_0x353b1f(0x1fe)](_0x2aa586=>_0x2aa586[_0x353b1f(0x21f)]===_0x353b1f(0x11e)),_0x5d2fdc=_0xb03255?a46_0x1f96c9['dim'](_0x353b1f(0x16c)):'';return'📁\x20'+_0x1b25dd[_0x353b1f(0xc9)]+_0x5d2fdc;});await writeOutput(_0x983f26[_0x346516(0x84)]('\x0a'),_0x4a4a39[_0x346516(0x19b)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x1bc);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1e5);async[a46_0x591dc6(0x1a1)](_0xdb8acb){const _0x168268=a46_0x591dc6,{options:_0x2f3f2a,args:_0x2b7e40,tdx:_0x50ea72}=_0xdb8acb,_0x1356cb=this['resolveProject'](_0x2b7e40,_0x2f3f2a);_0x2f3f2a[_0x168268(0x1a6)]&&_0x1356cb&&console[_0x168268(0xb3)](_0x168268(0x8a)+_0x1356cb);const _0x156a28=await withSpinner(_0x168268(0xc5),()=>_0x50ea72[_0x168268(0x1f4)][_0x168268(0x22b)](_0x1356cb,{'limit':_0x2f3f2a[_0x168268(0xa1)]}),{'verbose':_0x2f3f2a[_0x168268(0x1a6)]});let _0x44e6bb=_0x156a28[_0x168268(0x164)];_0x44e6bb[_0x168268(0xf9)]((_0x288cd9,_0xa3c99e)=>{const _0x4738f3=_0x168268,_0xcadcc1=_0x288cd9[_0x4738f3(0xc9)]['localeCompare'](_0xa3c99e[_0x4738f3(0xc9)]);if(_0xcadcc1!==0x0)return _0xcadcc1;return(_0x288cd9[_0x4738f3(0x1f6)]?.[_0x4738f3(0xc9)]||'')['localeCompare'](_0xa3c99e[_0x4738f3(0x1f6)]?.['name']||'');});const _0x38c308=_0x2f3f2a['limit']||0x64,_0x1af4bf=_0x44e6bb[_0x168268(0x1ff)]>=_0x38c308?a46_0x1f96c9[_0x168268(0x192)](_0x168268(0x179)):'';console['error']('✔\x20Found\x20'+_0x44e6bb['length']+_0x168268(0x208)+(_0x44e6bb[_0x168268(0x1ff)]!==0x1?'s':'')+_0x1af4bf);if(_0x2f3f2a[_0x168268(0xa5)]===_0x168268(0x1fb)||_0x2f3f2a[_0x168268(0xa5)]===_0x168268(0x1d8)||_0x2f3f2a[_0x168268(0xa5)]===_0x168268(0x147))await handleSDKOutput(_0x44e6bb,_0x2f3f2a);else{if(_0x44e6bb['length']===0x0)_0x1356cb?console[_0x168268(0x9e)](_0x168268(0xe1)+_0x1356cb):console[_0x168268(0x9e)]('No\x20workflows\x20found');else{const _0x2dd58b=_0x2f3f2a[_0x168268(0x1fa)],_0x40023d=_0x44e6bb[_0x168268(0x112)](_0x374b50=>{const _0x582f1d=_0x168268,_0x1e7e2e=a46_0x1f96c9[_0x582f1d(0x192)]('#'+_0x374b50['id']),_0x11edd7=hyperlink(_0x1e7e2e,getWorkflowUrl(_0x2dd58b,_0x374b50['id'])),_0x4631e7=_0x374b50[_0x582f1d(0x1f6)]?.['name']?a46_0x1f96c9[_0x582f1d(0x192)]('\x20('+_0x374b50[_0x582f1d(0x1f6)][_0x582f1d(0xc9)]+')'):'';return _0x582f1d(0x1ad)+_0x11edd7+'\x20'+_0x374b50[_0x582f1d(0xc9)]+_0x4631e7;});await writeOutput(_0x40023d[_0x168268(0x84)]('\x0a'),_0x2f3f2a['output'],_0x168268(0x14d));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a46_0x591dc6(0xec);['description']=a46_0x591dc6(0x131);async['execute'](_0x35ca0a){const _0x47b1b2=a46_0x591dc6,{options:_0x17fb54,args:_0x18c98b,tdx:_0x3a0cd9}=_0x35ca0a,_0xd79ff2=this['parseProjectWorkflowPattern'](_0x18c98b,_0x17fb54);if(!_0xd79ff2)return 0x1;const {projectName:_0x1d28ca,workflowName:_0x265fb8}=_0xd79ff2;if(_0x17fb54[_0x47b1b2(0x1a6)]){if(_0x1d28ca&&_0x265fb8)console[_0x47b1b2(0xb3)](_0x47b1b2(0x216)+_0x1d28ca+'.'+_0x265fb8);else _0x1d28ca&&console[_0x47b1b2(0xb3)](_0x47b1b2(0x204)+_0x1d28ca);const _0x49234d=_0x17fb54[_0x47b1b2(0xe0)];_0x49234d&&console[_0x47b1b2(0xb3)](_0x47b1b2(0x22e)+_0x49234d);}let _0x3c03ba=0x28;if(process[_0x47b1b2(0xf4)][_0x47b1b2(0xe9)]&&!_0x17fb54[_0x47b1b2(0x19b)]&&!_0x17fb54[_0x47b1b2(0xa5)]){const _0x7d4fde=process[_0x47b1b2(0xf4)][_0x47b1b2(0xbd)]||0x28;_0x3c03ba=Math[_0x47b1b2(0x13e)](0x14,Math[_0x47b1b2(0x1df)](_0x7d4fde*0x2/0x3));}const _0x673466=_0x17fb54['limit']||_0x3c03ba,_0x104e54=await withSpinner(_0x47b1b2(0x20c),()=>_0x3a0cd9[_0x47b1b2(0x1f4)][_0x47b1b2(0x1be)]({'projectName':_0x1d28ca,'workflowName':_0x265fb8,'status':_0x17fb54[_0x47b1b2(0xe0)],'fromTime':_0x17fb54[_0x47b1b2(0xc0)],'toTime':_0x17fb54['to'],'limit':_0x673466}),{'verbose':_0x17fb54[_0x47b1b2(0x1a6)]}),_0x4fe35c=_0x104e54[_0x47b1b2(0x164)];_0x4fe35c[_0x47b1b2(0xf9)]((_0x29091c,_0x265cf4)=>{const _0xdb029c=_0x47b1b2,_0x3c2904=_0x29091c[_0xdb029c(0x1a5)]||'',_0x53794d=_0x265cf4[_0xdb029c(0x1a5)]||'';return _0x53794d[_0xdb029c(0x21d)](_0x3c2904);});_0x4fe35c['length']>=_0x673466?console[_0x47b1b2(0xb3)](_0x47b1b2(0x217)+_0x4fe35c[_0x47b1b2(0x1ff)]+_0x47b1b2(0x165)+a46_0x1f96c9[_0x47b1b2(0x192)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x47b1b2(0xb3)](_0x47b1b2(0x182)+_0x4fe35c[_0x47b1b2(0x1ff)]+_0x47b1b2(0x99)+(_0x4fe35c[_0x47b1b2(0x1ff)]!==0x1?'s':''));if(_0x17fb54[_0x47b1b2(0xa5)]===_0x47b1b2(0x1fb)||_0x17fb54[_0x47b1b2(0xa5)]===_0x47b1b2(0x1d8)||_0x17fb54[_0x47b1b2(0xa5)]===_0x47b1b2(0x147))await handleSDKOutput(_0x4fe35c,_0x17fb54);else{if(!process[_0x47b1b2(0xf4)][_0x47b1b2(0xe9)]||_0x17fb54['output']){if(_0x4fe35c[_0x47b1b2(0x1ff)]===0x0){if(_0x1d28ca&&_0x265fb8)console[_0x47b1b2(0x9e)](_0x47b1b2(0x1b0)+_0x1d28ca+'.'+_0x265fb8);else _0x1d28ca?console['log'](_0x47b1b2(0x181)+_0x1d28ca):console[_0x47b1b2(0x9e)](_0x47b1b2(0xcb));}else{const _0x42580b=_0x17fb54[_0x47b1b2(0x1fa)],_0x26b1e3=this[_0x47b1b2(0x170)](_0x4fe35c,_0x42580b);_0x17fb54[_0x47b1b2(0x19b)]?await writeOutput(_0x26b1e3,_0x17fb54['output'],_0x47b1b2(0x14d)):console['log'](_0x26b1e3);}!_0x1d28ca&&(console[_0x47b1b2(0xb3)](''),console['error'](a46_0x1f96c9[_0x47b1b2(0x192)](_0x47b1b2(0xfd))),console[_0x47b1b2(0xb3)](a46_0x1f96c9['dim'](_0x47b1b2(0xac))+'or'+a46_0x1f96c9[_0x47b1b2(0x192)](_0x47b1b2(0xd5))));}else{if(_0x4fe35c[_0x47b1b2(0x1ff)]===0x0){if(_0x1d28ca&&_0x265fb8)console['log'](_0x47b1b2(0x1b0)+_0x1d28ca+'.'+_0x265fb8);else _0x1d28ca?console['log'](_0x47b1b2(0x181)+_0x1d28ca):console[_0x47b1b2(0x9e)](_0x47b1b2(0xcb));}else await this[_0x47b1b2(0xdb)](_0x4fe35c,_0x35ca0a,_0x1d28ca);}}return 0x0;}['renderSessionsTimeline'](_0x9d8224,_0x3b6af0){const _0x2d87ec=a46_0x591dc6,_0x1e08ff=[],_0x42d3fa=new Map();let _0x59ef64=Infinity,_0x464bee=-Infinity;for(const _0x5a9f78 of _0x9d8224){if(_0x5a9f78['lastAttempt']?.['createdAt']){const _0x2a8c34=new Date(_0x5a9f78[_0x2d87ec(0xae)][_0x2d87ec(0x154)])[_0x2d87ec(0xa4)](),_0x3116b5=_0x5a9f78[_0x2d87ec(0xae)]['finishedAt']?new Date(_0x5a9f78[_0x2d87ec(0xae)]['finishedAt'])['getTime']():Date['now'](),_0xc06d48=_0x5a9f78[_0x2d87ec(0x1f6)]?.[_0x2d87ec(0xc9)]||_0x2d87ec(0x144);!_0x42d3fa[_0x2d87ec(0x8f)](_0xc06d48)&&_0x42d3fa[_0x2d87ec(0x1f8)](_0xc06d48,[]),_0x42d3fa['get'](_0xc06d48)[_0x2d87ec(0x1dd)]({'session':_0x5a9f78,'startTime':_0x2a8c34,'endTime':_0x3116b5,'duration':_0x3116b5-_0x2a8c34}),_0x59ef64=Math[_0x2d87ec(0x80)](_0x59ef64,_0x2a8c34),_0x464bee=Math[_0x2d87ec(0x13e)](_0x464bee,_0x3116b5);}}if(_0x42d3fa[_0x2d87ec(0xf1)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x59b8ad=process[_0x2d87ec(0xf4)][_0x2d87ec(0x1ae)]||0x78,_0x304f7d=0x1e,_0x7fecea=0x32,_0x1d02a1=0x4,_0x29f68b=Math[_0x2d87ec(0x80)](_0x7fecea,Math[_0x2d87ec(0x13e)](_0x304f7d,Math[_0x2d87ec(0x1df)](_0x59b8ad*0.3))),_0x432718=_0x59b8ad-_0x29f68b-TIMELINE_CONFIG[_0x2d87ec(0xd8)]-0x3-_0x1d02a1,_0x2bcd2a=_0x464bee-_0x59ef64,_0x62b588=_0x2bcd2a/_0x29f68b,_0x50409c=renderTimeAxis({'startTime':_0x59ef64,'endTime':_0x464bee,'durationMs':_0x2bcd2a,'msPerChar':_0x62b588},_0x29f68b),_0x50e04d=[];for(const _0x5eb984 of _0x42d3fa[_0x2d87ec(0x93)]()){_0x50e04d['push'](..._0x5eb984);}_0x50e04d[_0x2d87ec(0xf9)]((_0x2950b6,_0x43d694)=>_0x43d694[_0x2d87ec(0x136)]-_0x2950b6[_0x2d87ec(0x136)]);const _0x57b55a=new Date(_0x59ef64),_0x1ee1ba=formatDate(_0x57b55a),_0x1ea236=_0x1d02a1+TIMELINE_CONFIG[_0x2d87ec(0x1dc)]+TIMELINE_CONFIG[_0x2d87ec(0x1e3)]+_0x432718,_0x3bbe00='\x20'[_0x2d87ec(0x20d)](_0x1ea236-_0x1ee1ba[_0x2d87ec(0x1ff)]),_0x3bb67f=_0x3bbe00+a46_0x1f96c9['dim'](_0x1ee1ba)+'\x20'+_0x50409c;_0x1e08ff[_0x2d87ec(0x1dd)](_0x3bb67f);const _0x1b0ac0=0x16;let _0x38adaf=0x0;for(const _0x574060 of _0x50e04d){const _0x381a07=_0x574060[_0x2d87ec(0xd7)][_0x2d87ec(0x1f6)]?.['name']||'?',_0x3d3a04=Math[_0x2d87ec(0x80)](stringWidth(_0x381a07),_0x1b0ac0);_0x38adaf=Math['max'](_0x38adaf,_0x3d3a04);}for(const _0x11d869 of _0x50e04d){const {session:_0x2c7c2f,startTime:_0x43b9b9,endTime:_0x5efb85,duration:_0x5d171e}=_0x11d869,_0x32ded9=_0x2c7c2f['project']?.['id'],_0x5b77a1=_0x2c7c2f['id'],_0x55288c=_0x2c7c2f['project']?.['name']||'?',_0x1d830f=_0x2c7c2f[_0x2d87ec(0x1f4)]?.[_0x2d87ec(0xc9)]||'?';let _0x6158b6,_0x26012b;if(_0x2c7c2f[_0x2d87ec(0xae)]){const _0x2140d8=_0x2c7c2f['lastAttempt'];!_0x2140d8['done']?(_0x6158b6=_0x2140d8[_0x2d87ec(0x118)]?'🛑':'🔄',_0x26012b=_0x2140d8[_0x2d87ec(0x118)]?a46_0x1f96c9[_0x2d87ec(0x15c)]:a46_0x1f96c9['blue']):(_0x6158b6=_0x2140d8[_0x2d87ec(0xb1)]?'✅':'❌',_0x26012b=_0x2140d8[_0x2d87ec(0xb1)]?a46_0x1f96c9[_0x2d87ec(0x17f)]:a46_0x1f96c9[_0x2d87ec(0xb9)]);}else _0x6158b6='⏳',_0x26012b=a46_0x1f96c9[_0x2d87ec(0x192)];const _0x1f36fe='#'+_0x5b77a1,_0x54d12d=_0x32ded9?hyperlink(_0x1f36fe,getWorkflowSessionUrl(_0x3b6af0,_0x32ded9,_0x5b77a1)):_0x1f36fe;let _0x71fbdc=_0x55288c;stringWidth(_0x55288c)>_0x1b0ac0&&(_0x71fbdc=_0x55288c[_0x2d87ec(0x130)](0x0,_0x1b0ac0-0x1)+'…');const _0x1ddbf1=a46_0x1f96c9[_0x2d87ec(0x192)](_0x71fbdc),_0x523810=stringWidth(_0x71fbdc),_0x3b895f='\x20'[_0x2d87ec(0x20d)](_0x38adaf-stringWidth(_0x71fbdc)+0x2),_0x400bdf='('+formatElapsed(_0x5d171e)+')',_0x23423e=stringWidth(_0x400bdf),_0x2caad1=stringWidth(_0x1f36fe),_0x322df7=_0x2caad1+0x1+_0x523810+_0x3b895f[_0x2d87ec(0x1ff)],_0x2a8380=_0x432718-_0x322df7-_0x23423e-0x1-0x8;let _0x58bc6d=_0x1d830f;stringWidth(_0x58bc6d)>_0x2a8380&&(_0x58bc6d=_0x58bc6d[_0x2d87ec(0x130)](0x0,_0x2a8380-0x1)+'…');const _0x23c9b2=_0x54d12d+'\x20'+_0x1ddbf1+_0x3b895f+_0x58bc6d,_0x412f02=stringWidth(_0x23c9b2),_0x2b0bbd=_0x432718-_0x412f02-_0x23423e,_0x22a3c6=_0x23c9b2+'\x20'[_0x2d87ec(0x20d)](Math[_0x2d87ec(0x13e)](0x1,_0x2b0bbd))+a46_0x1f96c9[_0x2d87ec(0x192)](_0x400bdf),_0x49b450=Math[_0x2d87ec(0x1df)]((_0x43b9b9-_0x59ef64)/_0x62b588),_0x2b027e=Math['floor']((_0x5efb85-_0x59ef64)/_0x62b588),_0x3710c4=Math['max'](_0x49b450+0x1,_0x2b027e),_0x22bf54=new Array(_0x29f68b)['fill']('\x20');for(let _0x8dffd7=_0x49b450;_0x8dffd7<Math[_0x2d87ec(0x80)](_0x3710c4,_0x29f68b);_0x8dffd7++){_0x22bf54[_0x8dffd7]='─';}const _0x44789e=_0x22bf54[_0x2d87ec(0x112)](_0x3d5518=>_0x3d5518==='\x20'?'\x20':_0x26012b(_0x3d5518))[_0x2d87ec(0x84)]('');_0x1e08ff[_0x2d87ec(0x1dd)](_0x6158b6+'\x20'+_0x22a3c6+'│'+_0x44789e+'│');}return _0x1e08ff[_0x2d87ec(0x84)]('\x0a');}async[a46_0x591dc6(0xdb)](_0x187fcd,_0x1eb7ac,_0x440d52){const _0x516a89=a46_0x591dc6,{options:_0x3e10d2,tdx:_0x55308a}=_0x1eb7ac,_0xad612c=_0x3e10d2[_0x516a89(0x1fa)],{timelineRows:_0x1d0fd9,timeAxisHeader:_0xe7956}=this['generateSessionTimelineRows'](_0x187fcd,_0xad612c),_0x3a7d6a=_0x1d0fd9[_0x516a89(0x214)](_0x119c4e=>_0x119c4e['attemptId']);if(_0x3a7d6a[_0x516a89(0x1ff)]===0x0){const _0x4beac0=this['renderSessionsTimeline'](_0x187fcd,_0xad612c);console[_0x516a89(0x9e)](_0x4beac0);!_0x440d52&&(console[_0x516a89(0xb3)](''),console[_0x516a89(0xb3)](a46_0x1f96c9[_0x516a89(0x192)](_0x516a89(0xfd))),console['error'](a46_0x1f96c9[_0x516a89(0x192)](_0x516a89(0xac))+'or'+a46_0x1f96c9[_0x516a89(0x192)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xe7956&&console[_0x516a89(0x9e)](_0xe7956);const _0x3f06db=_0x1d0fd9[_0x516a89(0x214)](_0x55a4c5=>_0x55a4c5['attemptId'])['map'](_0xf79821=>({'title':_0xf79821[_0x516a89(0x12a)],'value':_0xf79821[_0x516a89(0x1c8)]})),_0x2ffa02=process[_0x516a89(0xf4)][_0x516a89(0xbd)]||0x3c,_0x5e423e=Math[_0x516a89(0x13e)](0x28,Math['floor'](_0x2ffa02*0x2/0x3)),_0x4f742e=await a46_0x1147d5({'type':'autocomplete','name':'attemptId','message':_0x516a89(0x1ce),'choices':_0x3f06db,'initial':-0x1,'limit':_0x5e423e,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x52b20a,_0x1b47dd)=>{const _0xc58f3c=_0x516a89;if(!_0x52b20a)return Promise[_0xc58f3c(0xde)](_0x1b47dd);const _0x3b77ed=_0x1b47dd[_0xc58f3c(0x214)](_0x500456=>{const _0x3f5f19=_0xc58f3c,_0x902fe5=_0x500456;return _0x902fe5[_0x3f5f19(0x1f1)][_0x3f5f19(0x1c4)]()[_0x3f5f19(0x18c)](_0x52b20a['toLowerCase']());});return Promise[_0xc58f3c(0xde)](_0x3b77ed);}}),_0x597cbd=()=>{const _0x44935f=_0x516a89;process[_0x44935f(0xf4)]['write'](_0x44935f(0x127)),process[_0x44935f(0xf4)][_0x44935f(0xeb)](_0x44935f(0x127)),process[_0x44935f(0xf4)]['write'](_0x44935f(0x127));},_0x8281f4=_0x4f742e&&_0x4f742e[_0x516a89(0x1c8)]&&_0x4f742e['attemptId']!==null&&_0x4f742e[_0x516a89(0x1c8)]['trim']()!=='';if(!_0x8281f4){_0x597cbd(),console[_0x516a89(0x9e)](a46_0x1f96c9[_0x516a89(0x192)]('Cancelled'));return;}_0x597cbd();const _0x40f2db=_0x187fcd['find'](_0x356f36=>_0x356f36['lastAttempt']?.['id']===_0x4f742e[_0x516a89(0x1c8)]);if(_0x40f2db){const _0x12168d=_0x40f2db[_0x516a89(0x1f6)]?.[_0x516a89(0xc9)]||'?',_0x2c6a11=_0x40f2db[_0x516a89(0x1f4)]?.[_0x516a89(0xc9)]||'?';console[_0x516a89(0x9e)]('Project:\x20'+a46_0x1f96c9['dim'](_0x12168d)+_0x516a89(0xdc)+a46_0x1f96c9[_0x516a89(0x192)](_0x2c6a11));}const _0x76d1f7=new WorkflowTimelineCommand();await _0x76d1f7[_0x516a89(0x1a1)]({'args':[],'options':{..._0x3e10d2,'attemptId':_0x4f742e[_0x516a89(0x1c8)]},'tdx':_0x55308a});}[a46_0x591dc6(0x1d6)](_0xb1b5aa,_0x31d5c3){const _0x4fb884=a46_0x591dc6,_0x4fe1c1=new Map();for(const _0xd65bb7 of _0xb1b5aa){_0xd65bb7['id']&&_0xd65bb7[_0x4fb884(0xae)]?.['id']&&_0x4fe1c1[_0x4fb884(0x1f8)](_0xd65bb7['id'],_0xd65bb7[_0x4fb884(0xae)]['id']);}const _0x418003=[];let _0x5c43dd='';const _0x45d5a8=this[_0x4fb884(0x170)](_0xb1b5aa,_0x31d5c3),_0x4703dc=_0x45d5a8[_0x4fb884(0x1a4)]('\x0a');for(const _0x4a6860 of _0x4703dc){if(_0x4a6860[_0x4fb884(0x175)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x4a6860['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x5c43dd=_0x4a6860;else{if(_0x4a6860[_0x4fb884(0x1d0)](/^[✅❌🔄🛑⏳]/)){const _0x4e2f84=_0x4a6860[_0x4fb884(0x1d0)](/#(\d+)/),_0x1e8c13=_0x4e2f84?_0x4e2f84[0x1]:null,_0x1dfaca=_0x1e8c13?_0x4fe1c1['get'](_0x1e8c13)||null:null,_0x57582a=_0xb1b5aa[_0x4fb884(0x1a2)](_0x35ddfc=>_0x35ddfc['id']===_0x1e8c13),_0x4963f3=_0x57582a?.[_0x4fb884(0x1f6)]?.['name']||'';_0x418003[_0x4fb884(0x1dd)]({'displayLine':_0x4a6860,'attemptId':_0x1dfaca,'projectName':_0x4963f3});}}}return{'timelineRows':_0x418003,'timeAxisHeader':_0x5c43dd};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]='workflow:attempts';['description']=a46_0x591dc6(0xcc);async[a46_0x591dc6(0x1a1)](_0x2a0c3d){const _0x135a3c=a46_0x591dc6,{options:_0x5db1df,args:_0x348d5d,tdx:_0x3d86cf}=_0x2a0c3d,_0xf59eb=this[_0x135a3c(0x1e1)](_0x348d5d,_0x5db1df);if(!_0xf59eb)return 0x1;const {projectName:_0x636b6d,workflowName:_0x385655}=_0xf59eb,_0x26981c=_0x5db1df[_0x135a3c(0x1cf)];if(_0x5db1df[_0x135a3c(0x1a6)]){if(_0x636b6d&&_0x385655)console[_0x135a3c(0xb3)](_0x135a3c(0x216)+_0x636b6d+'.'+_0x385655);else _0x636b6d&&console[_0x135a3c(0xb3)](_0x135a3c(0x204)+_0x636b6d);_0x26981c&&console[_0x135a3c(0xb3)](_0x135a3c(0x126));}const _0x3db5d0=await withSpinner(_0x135a3c(0x230),()=>_0x3d86cf[_0x135a3c(0x1f4)][_0x135a3c(0xe7)]({'projectName':_0x636b6d,'workflowName':_0x385655,'includeRetried':_0x26981c,'limit':_0x5db1df[_0x135a3c(0xa1)]}),{'verbose':_0x5db1df[_0x135a3c(0x1a6)]}),_0x463e55=_0x3db5d0[_0x135a3c(0x164)],_0x4a2025=_0x5db1df[_0x135a3c(0xa1)]||0x64,_0xe58a93=_0x463e55['length']>=_0x4a2025?a46_0x1f96c9[_0x135a3c(0x192)](_0x135a3c(0x179)):'';console[_0x135a3c(0xb3)](_0x135a3c(0x182)+_0x463e55['length']+_0x135a3c(0x100)+(_0x463e55['length']!==0x1?'s':'')+_0xe58a93);if(_0x5db1df['format']===_0x135a3c(0x1fb)||_0x5db1df['format']===_0x135a3c(0x1d8)||_0x5db1df[_0x135a3c(0xa5)]==='table')await handleSDKOutput(_0x463e55,_0x5db1df);else{if(_0x463e55['length']===0x0){if(_0x636b6d&&_0x385655)console['log'](_0x135a3c(0x94)+_0x636b6d+'.'+_0x385655);else _0x636b6d?console[_0x135a3c(0x9e)](_0x135a3c(0x158)+_0x636b6d):console[_0x135a3c(0x9e)](_0x135a3c(0x9d));}else{const _0x313ed1=_0x5db1df[_0x135a3c(0x1fa)],_0xe5333a=_0x463e55[_0x135a3c(0x112)](_0x15c85f=>{const _0x5b917a=_0x135a3c,_0x261baa=a46_0x1f96c9[_0x5b917a(0x192)]('#'+_0x15c85f['id']),_0x3f11ab=_0x15c85f['project']?.['id'],_0x18c85a=_0x15c85f[_0x5b917a(0x22d)]||_0x15c85f['sessionId'],_0xa89771=_0x3f11ab&&_0x18c85a?hyperlink(_0x261baa,getWorkflowAttemptUrl(_0x313ed1,_0x3f11ab,_0x18c85a,_0x15c85f['id'])):_0x261baa,{icon:_0x5d93fa,text:_0x3c9bf8}=getAttemptStatusDisplay(_0x15c85f),_0x4597e8=(_0x15c85f[_0x5b917a(0x1f6)]?.[_0x5b917a(0xc9)]||'?')+'.'+(_0x15c85f[_0x5b917a(0x1f4)]?.[_0x5b917a(0xc9)]||'?'),_0x289a26=_0x15c85f[_0x5b917a(0x1a5)]?a46_0x1f96c9[_0x5b917a(0x192)](_0x15c85f[_0x5b917a(0x1a5)]):'';return(_0xa89771+'\x20'+_0x5d93fa+(_0x3c9bf8?'\x20'+_0x3c9bf8:'')+'\x20'+_0x4597e8+'\x20'+_0x289a26)[_0x5b917a(0xb8)]();});await writeOutput(_0xe5333a[_0x135a3c(0x84)]('\x0a'),_0x5db1df[_0x135a3c(0x19b)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a46_0x591dc6(0xc9)]='workflow:attempt';[a46_0x591dc6(0x193)]='Show\x20specific\x20attempt\x20details';async[a46_0x591dc6(0x1a1)](_0x15c85b){const _0x288aa2=a46_0x591dc6,{options:_0x1fd21b,args:_0x133913,tdx:_0x48ab47}=_0x15c85b,_0x1949e7=_0x133913[0x0];if(!_0x1949e7)return console[_0x288aa2(0xb3)](_0x288aa2(0x10e)),0x1;_0x1fd21b['verbose']&&console['error'](_0x288aa2(0x10f)+_0x1949e7);const _0x49fa79=await withSpinner(_0x288aa2(0x1e2),()=>_0x48ab47[_0x288aa2(0x1f4)][_0x288aa2(0x95)](_0x1949e7),{'verbose':_0x1fd21b[_0x288aa2(0x1a6)]}),_0x53cab0=_0x49fa79['data'];let _0x358e43;!_0x53cab0['done']?_0x358e43=_0x53cab0[_0x288aa2(0x118)]?'canceling':'running':_0x358e43=_0x53cab0[_0x288aa2(0xb1)]?_0x288aa2(0xb1):'error';let _0x2b442f;if(_0x53cab0[_0x288aa2(0x154)]&&_0x53cab0[_0x288aa2(0x152)]){const _0x4b3771=new Date(_0x53cab0['createdAt'])[_0x288aa2(0xa4)](),_0x53f5e5=new Date(_0x53cab0[_0x288aa2(0x152)])[_0x288aa2(0xa4)]();_0x2b442f=Math[_0x288aa2(0x91)]((_0x53f5e5-_0x4b3771)/0x3e8);}const _0x117071={'attempt_id':_0x53cab0['id'],'status':_0x358e43,..._0x53cab0[_0x288aa2(0x1b4)]!==undefined&&{'index':_0x53cab0[_0x288aa2(0x1b4)]},..._0x53cab0['project']&&{'project':_0x53cab0[_0x288aa2(0x1f6)][_0x288aa2(0xc9)]},..._0x53cab0[_0x288aa2(0x1f4)]&&{'workflow':_0x53cab0[_0x288aa2(0x1f4)][_0x288aa2(0xc9)]},..._0x53cab0[_0x288aa2(0xee)]&&{'session_id':_0x53cab0[_0x288aa2(0xee)]},..._0x53cab0['sessionTime']&&{'session_time':_0x53cab0[_0x288aa2(0x1a5)]},..._0x53cab0['retryAttemptName']&&{'retry_attempt':_0x53cab0[_0x288aa2(0x148)]},..._0x2b442f!==undefined&&{'duration_sec':_0x2b442f},..._0x53cab0[_0x288aa2(0x154)]&&{'created_at':_0x53cab0[_0x288aa2(0x154)]},..._0x53cab0[_0x288aa2(0x152)]&&{'finished_at':_0x53cab0['finishedAt']},...Object[_0x288aa2(0x1b9)](_0x53cab0[_0x288aa2(0xd4)])['length']>0x0&&{'params':_0x53cab0[_0x288aa2(0xd4)]}};return await handleSingleObjectOutput(_0x117071,_0x1fd21b),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x166);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x115);async[a46_0x591dc6(0x1a1)](_0x1004c2){const _0x2d498e=a46_0x591dc6,{options:_0x5923ef,args:_0x3db45b,tdx:_0x3461dd}=_0x1004c2,_0x3cfe7d=_0x3db45b[0x0];if(!_0x3cfe7d)return console[_0x2d498e(0xb3)](_0x2d498e(0x10e)),0x1;const _0x3db895=_0x5923ef[_0x2d498e(0x198)];_0x5923ef[_0x2d498e(0x1a6)]&&(console[_0x2d498e(0xb3)]('Attempt\x20ID:\x20'+_0x3cfe7d),_0x3db895&&console[_0x2d498e(0xb3)](_0x2d498e(0x189)));const _0x41b8f7=await withSpinner(_0x2d498e(0x199),()=>_0x3461dd[_0x2d498e(0x1f4)][_0x2d498e(0x14a)](_0x3cfe7d,_0x3db895||![]),{'verbose':_0x5923ef[_0x2d498e(0x1a6)]}),_0x5ddff3=_0x41b8f7[_0x2d498e(0x164)];return console[_0x2d498e(0xb3)](_0x2d498e(0x182)+_0x5ddff3[_0x2d498e(0x1ff)]+_0x2d498e(0x81)+(_0x5ddff3[_0x2d498e(0x1ff)]!==0x1?'s':'')),await handleSDKOutput(_0x5ddff3,_0x5923ef),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x21c);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1c1);async['execute'](_0x1dacd0){const _0x4daee9=a46_0x591dc6,{options:_0x21bc50,args:_0x78d20e,tdx:_0x4df8b8}=_0x1dacd0,_0x23b26f=_0x78d20e[0x0];let _0x59ebac=_0x78d20e[0x1];if(!_0x23b26f)return console[_0x4daee9(0xb3)](_0x4daee9(0x10e)),0x1;_0x21bc50[_0x4daee9(0x1a6)]&&(console[_0x4daee9(0xb3)]('Attempt\x20ID:\x20'+_0x23b26f),_0x59ebac&&console['error'](_0x4daee9(0x212)+_0x59ebac));const _0x43b57c=await withSpinner(_0x4daee9(0x1eb),()=>_0x4df8b8['workflow']['logFiles'](_0x23b26f,_0x59ebac),{'verbose':_0x21bc50[_0x4daee9(0x1a6)]}),_0xe94d8a=_0x43b57c['data'];if(_0xe94d8a[_0x4daee9(0x1ff)]===0x0)return console['error'](_0x4daee9(0x9a)),0x0;if(!_0x59ebac&&(_0x21bc50[_0x4daee9(0x1fb)]||_0x21bc50[_0x4daee9(0xa5)]))return await handleSDKOutput(_0xe94d8a,_0x21bc50),0x0;if(!_0x59ebac){const _0x20eb8d=_0xe94d8a['map'](_0x504d25=>({'title':_0x504d25[_0x4daee9(0x9f)]+'\x20('+formatBytes(_0x504d25[_0x4daee9(0x224)])+')','value':_0x504d25[_0x4daee9(0x9f)]})),_0x3598e3=await a46_0x1147d5({'type':_0x4daee9(0x188),'name':_0x4daee9(0x1ea),'message':_0x4daee9(0xa8),'choices':_0x20eb8d});if(!_0x3598e3[_0x4daee9(0x1ea)])return console[_0x4daee9(0xb3)]('Cancelled'),0x0;_0x59ebac=_0x3598e3[_0x4daee9(0x1ea)];}const _0x4906ad=await withSpinner(_0x4daee9(0x103),()=>_0x4df8b8[_0x4daee9(0x1f4)]['logs'](_0x23b26f,_0x59ebac),{'verbose':_0x21bc50[_0x4daee9(0x1a6)]}),_0x43a7c6=_0x4906ad[_0x4daee9(0x164)];return _0x43a7c6?console[_0x4daee9(0x9e)](_0x43a7c6):console[_0x4daee9(0xb3)](_0x4daee9(0x219)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x178);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x206);async[a46_0x591dc6(0x1a1)](_0xc468db){const _0x4da579=a46_0x591dc6,{options:_0xd50f31,args:_0x55f3bd,tdx:_0x1b6269}=_0xc468db,_0x40c194=_0x55f3bd[0x0];if(!_0x40c194)return console[_0x4da579(0xb3)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x38a3d4=_0xd50f31[_0x4da579(0x174)];_0xd50f31['verbose']&&(console[_0x4da579(0xb3)](_0x4da579(0x10f)+_0x40c194),_0x38a3d4&&console['error'](_0x4da579(0x18f)+_0x38a3d4));if(!_0xd50f31['yes']){if(!isInteractive())return console['error'](a46_0x1f96c9[_0x4da579(0xb9)](_0x4da579(0x218)),_0x4da579(0x195)),console['error'](a46_0x1f96c9[_0x4da579(0x192)](_0x4da579(0x1e6))),0x1;const _0x6dba1a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x40c194+'?');if(!_0x6dba1a)return console['error'](a46_0x1f96c9['yellow'](_0x4da579(0x200))),0x1;}const _0x4d5ada=await withSpinner(_0x4da579(0x14f),()=>_0x1b6269[_0x4da579(0x1f4)]['kill'](_0x40c194,_0x38a3d4),{'verbose':_0xd50f31['verbose']}),_0x4256bc=_0x4d5ada[_0x4da579(0x164)];return console[_0x4da579(0xb3)]('✔\x20'+_0x4256bc),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0xcd);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1c0);async[a46_0x591dc6(0x1a1)](_0x556f75){const _0x26eb84=a46_0x591dc6,{options:_0x14b4b9,args:_0x1e5217,tdx:_0x214b21}=_0x556f75,_0xb11a88=_0x1e5217[0x0];if(!_0xb11a88)return console[_0x26eb84(0xb3)](_0x26eb84(0x15f)),console[_0x26eb84(0xb3)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2cc6e9=![],_0x4668e8=_0xb11a88;if(_0xb11a88[_0x26eb84(0x175)](_0x26eb84(0x1ef)))_0x2cc6e9=!![],_0x4668e8=_0xb11a88[_0x26eb84(0x201)](0x8);else{if(_0xb11a88[_0x26eb84(0x175)](_0x26eb84(0x141)))_0x2cc6e9=![],_0x4668e8=_0xb11a88['substring'](0x8);else return console[_0x26eb84(0xb3)](_0x26eb84(0x16f)),console[_0x26eb84(0xb3)](_0x26eb84(0x10a)),0x1;}const _0x43da21=_0x14b4b9[_0x26eb84(0x1b6)],_0x489c5d=_0x14b4b9[_0x26eb84(0x1d4)],_0x57284a=_0x14b4b9['params'],_0x5d06f9=_0x14b4b9[_0x26eb84(0x128)];_0x14b4b9['verbose']&&(console[_0x26eb84(0xb3)](_0x26eb84(0x1a7)+(_0x2cc6e9?_0x26eb84(0xd7):_0x26eb84(0x95))+'\x20'+_0x4668e8),_0x43da21&&console['error'](_0x26eb84(0xbf)+_0x43da21),_0x489c5d&&console[_0x26eb84(0xb3)](_0x26eb84(0x140)+_0x489c5d),_0x57284a&&console['error']('Params:\x20'+_0x57284a),_0x5d06f9&&console[_0x26eb84(0xb3)](_0x26eb84(0x22f)));let _0x33d5ae;if(_0x57284a)try{if(_0x57284a['startsWith']('@')){const _0x4f33d0=await import(_0x26eb84(0xe6)),_0x6a0960=_0x57284a[_0x26eb84(0x201)](0x1),_0x23e9cb=await _0x4f33d0['readFile'](_0x6a0960,'utf-8');_0x33d5ae=JSON[_0x26eb84(0x116)](_0x23e9cb);}else _0x33d5ae=JSON[_0x26eb84(0x116)](_0x57284a);}catch{return console[_0x26eb84(0xb3)](_0x26eb84(0x211)),0x1;}if(!_0x14b4b9[_0x26eb84(0x1cd)]){if(!isInteractive())return console[_0x26eb84(0xb3)](a46_0x1f96c9['red']('\x0aError:'),_0x26eb84(0x195)),console['error'](a46_0x1f96c9[_0x26eb84(0x192)](_0x26eb84(0x1e6))),0x1;const _0x4f3c58=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2cc6e9?_0x26eb84(0xd7):'attempt')+'\x20'+_0x4668e8+'?');if(!_0x4f3c58)return console[_0x26eb84(0xb3)](a46_0x1f96c9[_0x26eb84(0x15c)](_0x26eb84(0x200))),0x1;}let _0x24dd13;_0x2cc6e9?_0x24dd13=await withSpinner('Retrying\x20session...',()=>_0x214b21[_0x26eb84(0x1f4)][_0x26eb84(0x1d3)](_0x4668e8,{'fromTask':_0x43da21,'retryParams':_0x33d5ae}),{'verbose':_0x14b4b9[_0x26eb84(0x1a6)]}):_0x24dd13=await withSpinner(_0x26eb84(0x13f),()=>_0x214b21['workflow'][_0x26eb84(0x8e)](_0x4668e8,{'resumeFrom':_0x489c5d,'retryParams':_0x33d5ae,'force':_0x5d06f9}),{'verbose':_0x14b4b9[_0x26eb84(0x1a6)]});const _0x277f77=_0x24dd13[_0x26eb84(0x164)];return console['error'](_0x26eb84(0x114)),console[_0x26eb84(0xb3)](_0x26eb84(0x223)+_0x277f77['attemptId']),console[_0x26eb84(0xb3)](_0x26eb84(0x1d7)+_0x277f77[_0x26eb84(0xee)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x119);['description']=a46_0x591dc6(0x1aa);async[a46_0x591dc6(0x1a1)](_0x228ec0){const _0x357d29=a46_0x591dc6,{options:_0x5106ab,args:_0x54201e,tdx:_0x19bd46}=_0x228ec0;let _0x1d1641=_0x54201e[0x0];if(!_0x1d1641){const _0x82f783=this[_0x357d29(0x203)]([],_0x5106ab),_0x1b1c54=await withSpinner(_0x357d29(0x157),()=>_0x19bd46[_0x357d29(0x1f4)]['workflows'](_0x82f783,{'limit':_0x5106ab[_0x357d29(0xa1)]}),{'verbose':_0x5106ab[_0x357d29(0x1a6)]}),_0x171b95=_0x1b1c54[_0x357d29(0x164)];if(_0x171b95[_0x357d29(0x1ff)]===0x0)return console[_0x357d29(0xb3)](_0x357d29(0x92)),!_0x82f783&&console[_0x357d29(0xb3)](a46_0x1f96c9[_0x357d29(0x192)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x47c2f2=_0x171b95[_0x357d29(0x112)](_0x2517e6=>({'title':_0x2517e6['project']?.[_0x357d29(0xc9)]+'.'+_0x2517e6[_0x357d29(0xc9)],'value':_0x2517e6[_0x357d29(0x1f6)]?.[_0x357d29(0xc9)]+'.'+_0x2517e6['name'],'description':_0x2517e6[_0x357d29(0x11b)]?'revision:\x20'+_0x2517e6['revision']:undefined})),_0x5b1ebf=await a46_0x1147d5({'type':'select','name':_0x357d29(0x1f4),'message':_0x357d29(0x21e),'choices':_0x47c2f2});if(!_0x5b1ebf[_0x357d29(0x1f4)])return 0x1;_0x1d1641=_0x5b1ebf['workflow'];}if(!_0x1d1641[_0x357d29(0x18c)]('.')){const _0x5a7ff6=this[_0x357d29(0x203)]([],_0x5106ab);if(_0x5a7ff6)_0x1d1641=_0x5a7ff6+'.'+_0x1d1641;else return console['error'](a46_0x1f96c9[_0x357d29(0xb9)](_0x357d29(0x1a9)),_0x357d29(0x221)),console[_0x357d29(0xb3)](a46_0x1f96c9[_0x357d29(0x192)](_0x357d29(0x83))),0x1;}const _0x33de10=_0x5106ab[_0x357d29(0x1d5)],_0x4d3d35=_0x5106ab[_0x357d29(0x1a5)],_0xebedaa={};if(_0x33de10&&Array[_0x357d29(0x1ba)](_0x33de10))for(const _0x1bb4a6 of _0x33de10){const _0x388322=_0x1bb4a6['indexOf']('=');if(_0x388322===-0x1)return console[_0x357d29(0xb3)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x1bb4a6),console[_0x357d29(0xb3)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x5e1ecd=_0x1bb4a6[_0x357d29(0x201)](0x0,_0x388322),_0x28c2bf=_0x1bb4a6[_0x357d29(0x201)](_0x388322+0x1);try{_0xebedaa[_0x5e1ecd]=JSON[_0x357d29(0x116)](_0x28c2bf);}catch{_0xebedaa[_0x5e1ecd]=_0x28c2bf;}}_0x5106ab[_0x357d29(0x1a6)]&&(console[_0x357d29(0xb3)](_0x357d29(0x1b8)+_0x1d1641),Object['keys'](_0xebedaa)['length']>0x0&&console['error'](_0x357d29(0x1de)+JSON[_0x357d29(0x19d)](_0xebedaa)),_0x4d3d35&&console[_0x357d29(0xb3)](_0x357d29(0x10c)+_0x4d3d35));const _0x39d8a5=await withSpinner(_0x357d29(0x117),()=>_0x19bd46[_0x357d29(0x1f4)][_0x357d29(0x1d9)](_0x1d1641,_0xebedaa,{'sessionTime':_0x4d3d35}),{'verbose':_0x5106ab['verbose']}),_0x41bb84=_0x39d8a5[_0x357d29(0x164)];console[_0x357d29(0xb3)](_0x357d29(0x13c)),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x41bb84['id']),console[_0x357d29(0xb3)](_0x357d29(0x1d7)+_0x41bb84[_0x357d29(0xee)]),console[_0x357d29(0xb3)]('\x20\x20Project:\x20'+_0x41bb84['project']?.[_0x357d29(0xc9)]),console[_0x357d29(0xb3)](_0x357d29(0x18b)+_0x41bb84[_0x357d29(0x1f4)]?.[_0x357d29(0xc9)]);if(_0x41bb84[_0x357d29(0x1f6)]?.['id']&&_0x41bb84[_0x357d29(0xee)]&&_0x41bb84['id']){const _0x56047a=_0x5106ab['site'],_0x1a24c5=getConsoleUrl(_0x56047a,'/app/workflows/'+_0x41bb84[_0x357d29(0x1f6)]['id']+'/sessions/'+_0x41bb84[_0x357d29(0xee)]+_0x357d29(0xa7)+_0x41bb84['id']);console[_0x357d29(0xb3)](_0x357d29(0x19f)+a46_0x1f96c9[_0x357d29(0xd9)](_0x1a24c5));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a46_0x591dc6(0xab);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x97);async[a46_0x591dc6(0x1a1)](_0x5bed36){const _0x456e89=a46_0x591dc6,{options:_0x38c476,args:_0x465dd5,tdx:_0x14cde4}=_0x5bed36,_0x3f8f10=_0x465dd5[0x0],_0x57d838=_0x465dd5[0x1]||'.';if(!_0x3f8f10)return console['error'](_0x456e89(0x1b5)),console[_0x456e89(0xb3)](_0x456e89(0x1e0)),0x1;const _0x57f28c=_0x38c476[_0x456e89(0x11b)];_0x38c476['verbose']&&(console['error'](_0x456e89(0xb0)+_0x3f8f10),console[_0x456e89(0xb3)](_0x456e89(0xe3)+_0x57d838),_0x57f28c&&console[_0x456e89(0xb3)](_0x456e89(0x1d1)+_0x57f28c));const _0x2f8893=await withSpinner('Downloading\x20project\x20'+_0x3f8f10+_0x456e89(0x12f),()=>_0x14cde4[_0x456e89(0x1f4)][_0x456e89(0x16e)](_0x3f8f10,_0x57d838,{'revision':_0x57f28c}),{'verbose':_0x38c476[_0x456e89(0x1a6)]}),_0x3623d3=_0x2f8893[_0x456e89(0x164)];return console[_0x456e89(0xb3)](_0x456e89(0x123)+_0x3623d3['projectName']),console[_0x456e89(0xb3)](_0x456e89(0x145)+_0x3623d3[_0x456e89(0x11b)]),console[_0x456e89(0xb3)](_0x456e89(0xf8)+_0x3623d3['filesExtracted']),console[_0x456e89(0xb3)]('\x20\x20Location:\x20'+_0x57d838+'/'+_0x3623d3[_0x456e89(0x191)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x13a);[a46_0x591dc6(0x193)]=a46_0x591dc6(0xc8);async[a46_0x591dc6(0x1a1)](_0x3773c1){const _0x18e74e=a46_0x591dc6,{options:_0x8ed5bc,args:_0x430e52,tdx:_0x4232d6}=_0x3773c1;let _0x144db8='.',_0x1f402b=_0x8ed5bc[_0x18e74e(0xc9)];if(_0x430e52[0x0]){const {promises:_0x173ad5}=await import('fs');try{const _0x39d674=await _0x173ad5[_0x18e74e(0x190)](_0x430e52[0x0]);if(_0x39d674[_0x18e74e(0xaf)]())_0x144db8=_0x430e52[0x0];else return console['error'](_0x18e74e(0x15b)+_0x430e52[0x0]+_0x18e74e(0x18d)),0x1;}catch{_0x1f402b=_0x430e52[0x0],_0x144db8='.';}}const _0xd0c305=_0x8ed5bc[_0x18e74e(0x11b)],_0x26a97b=_0x8ed5bc[_0x18e74e(0x124)];_0x8ed5bc[_0x18e74e(0x1a6)]&&(console[_0x18e74e(0xb3)](_0x18e74e(0x20e)+_0x144db8),_0x1f402b&&console[_0x18e74e(0xb3)](_0x18e74e(0x1c5)+_0x1f402b),_0xd0c305&&console[_0x18e74e(0xb3)](_0x18e74e(0x1d1)+_0xd0c305),_0x26a97b&&console[_0x18e74e(0xb3)](_0x18e74e(0x10d)));const _0x48dd58=await withSpinner(_0x18e74e(0xfb),()=>_0x4232d6['workflow'][_0x18e74e(0x1dd)](_0x144db8,{'projectName':_0x1f402b,'revision':_0xd0c305,'skipValidation':_0x26a97b}),{'verbose':_0x8ed5bc['verbose']}),_0x38db18=_0x48dd58[_0x18e74e(0x164)];return console['error'](_0x18e74e(0x202)+_0x38db18[_0x18e74e(0x191)]),console[_0x18e74e(0xb3)](_0x18e74e(0x169)+_0x38db18[_0x18e74e(0xd2)]),console['error'](_0x18e74e(0x145)+_0x38db18[_0x18e74e(0x11b)]),await this['showWorkflowConsoleUrl'](_0x4232d6,_0x38db18['projectName'],_0x8ed5bc[_0x18e74e(0x1fa)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a46_0x591dc6(0xc9)]='workflow:pull';[a46_0x591dc6(0x193)]=a46_0x591dc6(0x8b);async[a46_0x591dc6(0x1a1)](_0x451730){const _0x1d62e6=a46_0x591dc6,{options:_0x122910,args:_0xc5d21c,tdx:_0x5f2d66}=_0x451730,_0x34ec84=_0xc5d21c[0x0],_0x49d441=_0xc5d21c[0x1];if(!_0x34ec84)return console[_0x1d62e6(0xb3)](a46_0x1f96c9['red'](_0x1d62e6(0x1a9)),_0x1d62e6(0x1b3)),console['error'](a46_0x1f96c9['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2b52c6=_0x122910[_0x1d62e6(0x11b)];_0x122910['verbose']&&(console[_0x1d62e6(0xb3)](_0x1d62e6(0xb0)+_0x34ec84),_0x49d441&&console[_0x1d62e6(0xb3)](_0x1d62e6(0x96)+_0x49d441),_0x2b52c6&&console[_0x1d62e6(0xb3)](_0x1d62e6(0x1d1)+_0x2b52c6),_0x122910[_0x1d62e6(0x18a)]&&console[_0x1d62e6(0xb3)]('Dry\x20run:\x20yes'));const _0xfd7d81=await withSpinner(_0x1d62e6(0x82)+_0x34ec84+_0x1d62e6(0x12f),()=>_0x5f2d66[_0x1d62e6(0x1f4)][_0x1d62e6(0x107)](_0x34ec84,{'targetDir':_0x49d441,'revision':_0x2b52c6}),{'verbose':_0x122910[_0x1d62e6(0x1a6)]}),_0x497671=_0xfd7d81['data'];_0x497671[_0x1d62e6(0x155)]?console['error'](_0x1d62e6(0x7f)+_0x497671[_0x1d62e6(0x191)]):console[_0x1d62e6(0xb3)](_0x1d62e6(0x159)+_0x497671['projectName']);console['error'](_0x1d62e6(0x145)+_0x497671[_0x1d62e6(0x11b)]),console[_0x1d62e6(0xb3)](_0x1d62e6(0x1ed)+(a46_0x14a963['relative'](process[_0x1d62e6(0xb7)](),_0x497671['targetDir'])||'.')),console[_0x1d62e6(0xb3)](_0x1d62e6(0x1f5)+a46_0x1f96c9['green']('+'+_0x497671[_0x1d62e6(0x1cb)][_0x1d62e6(0x205)]+_0x1d62e6(0xc3))+',\x20'+(a46_0x1f96c9[_0x1d62e6(0x15c)]('~'+_0x497671[_0x1d62e6(0x1cb)][_0x1d62e6(0x9b)]+_0x1d62e6(0x1bf))+',\x20')+(a46_0x1f96c9['red']('-'+_0x497671[_0x1d62e6(0x1cb)][_0x1d62e6(0xd3)]+_0x1d62e6(0x19a))+',\x20')+(''+a46_0x1f96c9['dim'](_0x497671[_0x1d62e6(0x1cb)][_0x1d62e6(0xf7)]+_0x1d62e6(0x160))));for(const _0x5e9917 of _0x497671[_0x1d62e6(0x1ee)]){_0x5e9917[_0x1d62e6(0x1e7)]===_0x1d62e6(0x9b)&&_0x5e9917['diff']&&(console['error']('\x0a'+a46_0x1f96c9['cyan']('---\x20'+_0x5e9917[_0x1d62e6(0x167)])),console['error'](_0x5e9917['diff']));}if(!_0x497671['hasChanges'])return saveSessionContext({'workflow_project':_0x497671[_0x1d62e6(0x191)]},_0x122910['session']),console['error'](a46_0x1f96c9[_0x1d62e6(0x17f)](_0x1d62e6(0xbc))),console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0x192)](_0x1d62e6(0x1e4)+_0x497671[_0x1d62e6(0x191)])),0x0;if(_0x122910['dryRun'])return console['error'](a46_0x1f96c9[_0x1d62e6(0x15c)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x122910['yes']){if(!isInteractive())return console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0xb9)](_0x1d62e6(0x218)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0x192)](_0x1d62e6(0x1e6))),0x1;const _0x2da3f7=await confirmKey(_0x1d62e6(0x17a));if(!_0x2da3f7)return console['error'](a46_0x1f96c9['yellow'](_0x1d62e6(0x200)),_0x1d62e6(0x12e)),0x1;}await withSpinner(_0x1d62e6(0xda),()=>_0x5f2d66['workflow'][_0x1d62e6(0x163)](_0x497671,{'revision':_0x2b52c6}),{'verbose':_0x122910[_0x1d62e6(0x1a6)]}),saveSessionContext({'workflow_project':_0x497671[_0x1d62e6(0x191)]},_0x122910[_0x1d62e6(0xd7)]),console[_0x1d62e6(0xb3)](a46_0x1f96c9['green'](_0x1d62e6(0xc2)));const _0x151795=a46_0x14a963[_0x1d62e6(0x15d)](process[_0x1d62e6(0xb7)](),_0x497671[_0x1d62e6(0xea)])||'.';return console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0x192)](_0x1d62e6(0x106)+_0x151795)),console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0x192)](_0x1d62e6(0x1e4)+_0x497671[_0x1d62e6(0x191)])),0x0;}}function a46_0x5415(){const _0x4df00d=['Updating\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','name','preparePushProject','No\x20sessions\x20found','List\x20workflow\x20attempts','workflow:retry','pollTimeline','\x20secret','\x0a✔\x20Attempt\x20complete','Warning:','projectId','deleted','params','\x20\x20tdx\x20wf\x20use\x20<project>','fileCount','session','GUTTER','cyan','Writing\x20files...','navigateSessionsInteractive',',\x20Workflow:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','resolve','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','status','No\x20workflows\x20found\x20in\x20project:\x20','done','Output\x20directory:\x20','3608104obsHCo','indexOf','fs/promises','attempts','Loading\x20session...','isTTY','targetDir','write','workflow:sessions','padStart','sessionId','resolveProjectDir','✔\x20Project\x20updated','size','Key\x20cannot\x20be\x20empty','renderSingleTimeline','stdout','icon','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','unchanged','\x20\x20Files\x20extracted:\x20','sort','\x0aDry\x20run\x20-\x20no\x20project\x20created','Pushing\x20workflow\x20project...','\x20has\x20no\x20attempts','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20-\x20','\x20attempt','existingProjectId','toISOString','Downloading\x20logs...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','workflow:secrets:set','\x20\x20Location:\x20','pullProject','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','setSecret','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:push','Session\x20time:\x20','Validation:\x20skipped','Error:\x20Attempt\x20ID\x20is\x20required','Attempt\x20ID:\x20','MAX_TIMELINE_WIDTH','basename','map','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','✔\x20Retry\x20started','Show\x20tasks\x20for\x20an\x20attempt','parse','Starting\x20workflow\x20run...','cancelRequested','workflow:run','newProjectId','revision','getFullYear','Usage:\x20tdx\x20wf\x20use\x20<project>','sys','sourceProjectName','white','\x20logs','blue','✔\x20Downloaded\x20','skipValidation','\x22?\x20This\x20cannot\x20be\x20undone.','Include\x20retried:\x20yes','\x1b[1A\x1b[2K','force','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','displayLine','clear','workflowProject','workflowName','-\x20no\x20files\x20written','...','slice','List\x20workflow\x20execution\x20sessions','Invalid\x20format:\x20','List\x20all\x20workflow\x20projects','⚠\x20Showing\x20first\x20','Dry\x20run:\x20yes','startTime','workflow:secrets:delete','Tip:\x20cd\x20to\x20workflows/','MAX_TASKS_DISPLAY','workflow:upload','155012xkNTPu','✔\x20Workflow\x20run\x20started','showWorkflowConsoleUrl','max','Retrying\x20attempt...','Resume\x20from:\x20','attempt:','buildTimelineData','\x20to\x20see\x20detailed\x20logs','(unknown)','\x20\x20Revision:\x20','canceling','table','retryAttemptName','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','tasks','tdx\x20wf\x20attempt\x20','✔\x20Project:\x20','list','MIN_TIMELINE_WIDTH','Killing\x20attempt...','newProjectName','diff','finishedAt','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','createdAt','isNewProject','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Loading\x20workflows...','No\x20attempts\x20found\x20in\x20project:\x20','→\x20Project:\x20','\x20\x20Project:\x20','Error:\x20','yellow','relative','---\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20unchanged','Cloning\x20to\x20','Session\x20','applyPullProject','data','\x20sessions\x20','workflow:tasks','path','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20\x20Project\x20ID:\x20','Auto-selected\x20latest\x20session:\x20','TASK_NAME_WIDTH','\x20(system)','planned','download','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','renderSessionsTimeline','targetExists','\x27...','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','reason','startsWith','workflow:secrets:list','end','workflow:kill','\x20(use\x20--limit\x20to\x20show\x20more)','\x0aApply\x20these\x20changes?','LABEL_MIN_SPACING','✔\x20Workflow\x20project\x20context\x20cleared.','\x0a✔\x20No\x20changes\x20to\x20push','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','green','\x0a⚠\x20Project\x20\x22','No\x20sessions\x20found\x20in\x20project:\x20','✔\x20Found\x20','149345FpIFXX','345112LIANEe','running','listSecrets','fill','select','Including\x20subtasks:\x20yes','dryRun','\x20\x20Workflow:\x20','includes','\x20is\x20not\x20a\x20directory','message','Reason:\x20','stat','projectName','dim','description','No\x20workflow\x20projects\x20found','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Analyzing\x20project...','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','includeSubtasks','Getting\x20attempt\x20tasks...','\x20deleted','output','context','stringify','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','\x20\x20Console:\x20','\x0aClone\x20\x22','execute','find','110OmSGNC','split','sessionTime','verbose','Target:\x20','15dBgttN','Error:','Start\x20a\x20workflow\x20run','.\x20Expected\x20format:\x20KEY=VALUE','requireProject','📋\x20','columns','Pushing\x20project...','No\x20sessions\x20found\x20for:\x20','Analyzing\x20changes...','✔\x20Clone\x20complete','Project\x20name\x20is\x20required','index','Error:\x20Project\x20name\x20is\x20required','fromTask','No\x20projects\x20match\x20pattern:\x20','Workflow:\x20','keys','isArray','8346888BUzrdn','workflow:workflows','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','sessions','\x20modified','Retry\x20a\x20session\x20or\x20attempt','Show\x20logs\x20for\x20a\x20workflow\x20attempt','workflow:timeline','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','toLowerCase','Project\x20name:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x27\x20from\x20project\x20\x27','attemptId','pending','total','summary','window','yes','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','includeRetried','match','Revision:\x20','9noQfED','retrySession','resumeFrom','param','generateSessionTimelineRows','\x20\x20Session\x20ID:\x20','jsonl','run','workflow:clone','\x20project','ICON_WIDTH','push','Parameters:\x20','floor','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','parseProjectWorkflowPattern','Getting\x20attempt\x20details...','ICON_SPACING','\x20\x20Session\x20context\x20set\x20to:\x20','List\x20workflows','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','type','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','2529307dtHAnp','task','Fetching\x20log\x20files...','hasChanges','\x20\x20Target:\x20','changes','session:','fullName','title','startedAt','updatedAt','workflow','\x20\x20Changes:\x20','project','Listing\x20workflow\x20projects...','set','start','site','json','Deleting\x20project\x20','Key:\x20','some','length','Cancelled','substring','✔\x20Pushed\x20','resolveProject','Filter:\x20project=','new','Kill\x20a\x20running\x20attempt','splice','\x20workflow','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','12mXLAUt','now','Listing\x20workflow\x20sessions...','repeat','Project\x20directory:\x20','Session\x20not\x20found:\x20','\x0aPolling...\x20(','Error:\x20Invalid\x20JSON\x20in\x20--params','Task\x20name:\x20','Resolving\x20project\x20\x27','filter','Error:\x20Secret\x20key\x20is\x20required','Filter:\x20','✔\x20Showing\x20','\x0aError:','No\x20log\x20content\x20found','\x22\x20with\x20new\x20revision?','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','workflow:logs','localeCompare','Select\x20a\x20workflow\x20to\x20run','key','text','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:use','\x20\x20New\x20attempt\x20ID:\x20','fileSize','Listing\x20secrets...','\x22\x20already\x20exists\x20(ID:\x20','follow','executePushProject','workflow:delete','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflows','duration','session_id','Status:\x20','Force:\x20yes','Listing\x20workflow\x20attempts...','→\x20New\x20project:\x20','min','\x20task','Pulling\x20project\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','join','group_error','Attempt:\x20','✔\x20Secret\x20\x27','all','getDate','Project\x20filter:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','delete','retryAttempt','has','✔\x20Deleted\x20project\x20','round','No\x20workflows\x20found','values','No\x20attempts\x20found\x20for:\x20','attempt','Target\x20directory:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','metadata','\x20session','No\x20log\x20files\x20found\x20for\x20this\x20attempt','modified','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','No\x20attempts\x20found','log','taskName','-\x20nothing\x20pushed','limit','renderTimeline','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','getTime','format','Loading\x20sessions...','/attempt/','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','New\x20project\x20name:\x20','workflow:download','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','lastAttempt','isDirectory','Project:\x20','success','state','error','Using\x20attempt\x20','getMonth','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','cwd','trimEnd','red','Source\x20directory:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x0a✔\x20Already\x20up\x20to\x20date','rows','No\x20workflow\x20sessions\x20found','From\x20task:\x20','from','295980XcOXjO','✔\x20Pull\x20complete','\x20new','msPerChar','Listing\x20workflows...','Deleting\x20secret...'];a46_0x5415=function(){return _0x4df00d;};return a46_0x5415();}export class WorkflowPushCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x10b);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1bd);async[a46_0x591dc6(0x1a1)](_0x20ed33){const _0x101a6b=a46_0x591dc6,{options:_0x24d268,args:_0x16115c,tdx:_0x36eb71}=_0x20ed33,_0x3909ce=this[_0x101a6b(0xef)](_0x16115c,_0x24d268),_0x127ae6=_0x24d268[_0x101a6b(0x11b)],_0x4e8dc5=_0x24d268[_0x101a6b(0x124)];_0x24d268['verbose']&&(_0x3909ce&&console[_0x101a6b(0xb3)](_0x101a6b(0xba)+_0x3909ce),_0x127ae6&&console[_0x101a6b(0xb3)]('Revision:\x20'+_0x127ae6),_0x24d268[_0x101a6b(0x18a)]&&console[_0x101a6b(0xb3)](_0x101a6b(0x135)),_0x4e8dc5&&console[_0x101a6b(0xb3)](_0x101a6b(0x10d)));let _0x50e42b;try{_0x50e42b=await withSpinner(_0x101a6b(0x1b1),()=>_0x36eb71[_0x101a6b(0x1f4)][_0x101a6b(0xca)]({'sourceDir':_0x3909ce,'revision':_0x127ae6,'skipValidation':_0x4e8dc5}),{'verbose':_0x24d268[_0x101a6b(0x1a6)]});}catch(_0x431245){if(_0x431245 instanceof Error&&_0x431245[_0x101a6b(0x18e)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0xb9)](_0x101a6b(0x1a9)),_0x101a6b(0xa3)),_0x24d268['workflowProject']?console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x192)](_0x101a6b(0x138)+_0x24d268[_0x101a6b(0x12c)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x24d268[_0x101a6b(0x12c)]+'\x27')):console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x192)](_0x101a6b(0x1c3))),0x1;throw _0x431245;}const _0x34f961=_0x50e42b['data'];console[_0x101a6b(0xb3)](_0x101a6b(0x14c)+_0x34f961['projectName']),console[_0x101a6b(0xb3)]('\x20\x20Source:\x20'+_0x34f961['sourceDir']),console[_0x101a6b(0xb3)](_0x101a6b(0x145)+_0x34f961['revision']),console['error'](_0x101a6b(0x1f5)+a46_0x1f96c9[_0x101a6b(0x17f)]('+'+_0x34f961['summary'][_0x101a6b(0x205)]+_0x101a6b(0xc3))+',\x20'+(a46_0x1f96c9[_0x101a6b(0x15c)]('~'+_0x34f961[_0x101a6b(0x1cb)]['modified']+_0x101a6b(0x1bf))+',\x20')+(a46_0x1f96c9[_0x101a6b(0xb9)]('-'+_0x34f961[_0x101a6b(0x1cb)][_0x101a6b(0xd3)]+_0x101a6b(0x19a))+',\x20')+(''+a46_0x1f96c9[_0x101a6b(0x192)](_0x34f961[_0x101a6b(0x1cb)][_0x101a6b(0xf7)]+_0x101a6b(0x160))));for(const _0x2bb642 of _0x34f961[_0x101a6b(0x1ee)]){_0x2bb642[_0x101a6b(0x1e7)]==='modified'&&_0x2bb642[_0x101a6b(0x151)]&&(console[_0x101a6b(0xb3)]('\x0a'+a46_0x1f96c9[_0x101a6b(0xd9)](_0x101a6b(0x15e)+_0x2bb642[_0x101a6b(0x167)])),console[_0x101a6b(0xb3)](_0x2bb642[_0x101a6b(0x151)]));}if(!_0x34f961[_0x101a6b(0x1ec)])return console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x17f)](_0x101a6b(0x17d))),await this[_0x101a6b(0x13d)](_0x36eb71,_0x34f961[_0x101a6b(0x191)],_0x24d268[_0x101a6b(0x1fa)]),0x0;if(_0x24d268[_0x101a6b(0x18a)])return console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x15c)](_0x101a6b(0x1c6))),0x0;if(!_0x24d268[_0x101a6b(0x1cd)]){if(!isInteractive())return console['error'](a46_0x1f96c9['red'](_0x101a6b(0x218)),_0x101a6b(0x195)),console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x192)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x253e4d=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x253e4d)return console['error'](a46_0x1f96c9['yellow'](_0x101a6b(0x200)),_0x101a6b(0xa0)),0x1;}const _0x244315=await withSpinner(_0x101a6b(0x1af),()=>_0x36eb71[_0x101a6b(0x1f4)][_0x101a6b(0x228)](_0x34f961),{'verbose':_0x24d268[_0x101a6b(0x1a6)]}),_0x4fb920=_0x244315['data'];return console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x17f)]('✔\x20Push\x20complete')),console['error']('\x20\x20Project\x20ID:\x20'+_0x4fb920[_0x101a6b(0xd2)]),console[_0x101a6b(0xb3)](_0x101a6b(0x145)+_0x4fb920[_0x101a6b(0x11b)]),await this[_0x101a6b(0x13d)](_0x36eb71,_0x4fb920['projectName'],_0x24d268[_0x101a6b(0x1fa)]),0x0;}}function a46_0x2532(_0x4b16d4,_0x228a88){_0x4b16d4=_0x4b16d4-0x7f;const _0x5415d2=a46_0x5415();let _0x253266=_0x5415d2[_0x4b16d4];return _0x253266;}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x1da);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x129);async['execute'](_0x511e27){const _0xaa6c73=a46_0x591dc6,{options:_0x53155b,args:_0x227b09,tdx:_0x1467d2}=_0x511e27,_0x229af7=this['resolveProjectDir'](_0x227b09,_0x53155b),_0x2a5d9f=_0x53155b[_0xaa6c73(0xc9)],_0x258363=_0x53155b[_0xaa6c73(0x11b)],_0x5f5121=_0x53155b[_0xaa6c73(0x124)];if(!_0x229af7)return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0xb9)](_0xaa6c73(0x1a9)),'Source\x20directory\x20is\x20required'),console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x192)](_0xaa6c73(0xf6))),console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x192)](_0xaa6c73(0x21b))),0x1;if(!_0x2a5d9f)return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0xb9)](_0xaa6c73(0x1a9)),_0xaa6c73(0xdd)),console[_0xaa6c73(0xb3)](a46_0x1f96c9['dim'](_0xaa6c73(0xf6))),0x1;_0x53155b[_0xaa6c73(0x1a6)]&&(console['error']('Source\x20directory:\x20'+_0x229af7),console[_0xaa6c73(0xb3)](_0xaa6c73(0xaa)+_0x2a5d9f),_0x258363&&console[_0xaa6c73(0xb3)]('Revision:\x20'+_0x258363),_0x53155b[_0xaa6c73(0x18a)]&&console[_0xaa6c73(0xb3)]('Dry\x20run:\x20yes'),_0x5f5121&&console[_0xaa6c73(0xb3)]('Validation:\x20skipped'));const _0xe3dc0d=await withSpinner(_0xaa6c73(0x196),()=>_0x1467d2[_0xaa6c73(0x1f4)]['prepareCloneProject'](_0x229af7,_0x2a5d9f,{'revision':_0x258363,'skipValidation':_0x5f5121}),{'verbose':_0x53155b['verbose']}),_0x1b716f=_0xe3dc0d[_0xaa6c73(0x164)];console[_0xaa6c73(0xb3)]('Source:\x20'+_0x1b716f['sourceDir']);_0x1b716f[_0xaa6c73(0x11f)]&&console[_0xaa6c73(0xb3)]('Source\x20project:\x20'+_0x1b716f['sourceProjectName']);console['error'](_0xaa6c73(0xaa)+_0x1b716f[_0xaa6c73(0x150)]),console[_0xaa6c73(0xb3)](_0xaa6c73(0x1d1)+_0x1b716f[_0xaa6c73(0x11b)]),console['error']('Files\x20to\x20upload:\x20'+_0x1b716f[_0xaa6c73(0xd6)]);_0x1b716f[_0xaa6c73(0x171)]&&(console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x15c)](_0xaa6c73(0x180)+_0x1b716f[_0xaa6c73(0x150)]+_0xaa6c73(0x226)+_0x1b716f[_0xaa6c73(0x101)]+')')),console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x15c)](_0xaa6c73(0xa9))));if(_0x53155b['dryRun'])return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x15c)](_0xaa6c73(0xfa))),0x0;if(!_0x53155b['yes']){if(!isInteractive())return console[_0xaa6c73(0xb3)](a46_0x1f96c9['red'](_0xaa6c73(0x218)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x192)](_0xaa6c73(0x1e6))),0x1;const _0x2aa901=_0x1b716f[_0xaa6c73(0x11f)]||a46_0x14a963[_0xaa6c73(0x111)](_0x229af7),_0x41680a=_0x1b716f[_0xaa6c73(0x171)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x2a5d9f+_0xaa6c73(0x21a):_0xaa6c73(0x1a0)+_0x2aa901+'\x22\x20to\x20new\x20project\x20\x22'+_0x2a5d9f+'\x22?',_0x48511d=await confirmKey(_0x41680a);if(!_0x48511d)return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x15c)](_0xaa6c73(0x200))),0x1;}const _0xd3d402=await withSpinner(_0x1b716f[_0xaa6c73(0x171)]?_0xaa6c73(0xc7)+_0x2a5d9f+_0xaa6c73(0x12f):_0xaa6c73(0x161)+_0x2a5d9f+_0xaa6c73(0x12f),()=>_0x1467d2[_0xaa6c73(0x1f4)]['executeCloneProject'](_0x1b716f),{'verbose':_0x53155b[_0xaa6c73(0x1a6)]}),_0xfa6e75=_0xd3d402['data'];return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x17f)](_0x1b716f['targetExists']?_0xaa6c73(0xf0):_0xaa6c73(0x1b2))),console[_0xaa6c73(0xb3)](_0xaa6c73(0x15a)+_0xfa6e75['newProjectName']),console['error'](_0xaa6c73(0x169)+_0xfa6e75[_0xaa6c73(0x11a)]),console[_0xaa6c73(0xb3)](_0xaa6c73(0x145)+_0xfa6e75[_0xaa6c73(0x11b)]),await this[_0xaa6c73(0x13d)](_0x1467d2,_0xfa6e75[_0xaa6c73(0x150)],_0x53155b[_0xaa6c73(0x1fa)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x229);[a46_0x591dc6(0x193)]=a46_0x591dc6(0xad);async[a46_0x591dc6(0x1a1)](_0x35407a){const _0x77adb0=a46_0x591dc6,{options:_0x28657a,args:_0x507d6f,tdx:_0x621581}=_0x35407a,_0x5a75e1=_0x507d6f[0x0];if(!_0x5a75e1)return console['error'](_0x77adb0(0x17e)),console[_0x77adb0(0xb3)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x28657a['verbose']&&console['error'](_0x77adb0(0xb0)+_0x5a75e1);if(!_0x28657a[_0x77adb0(0x1cd)]){if(!isInteractive())return console[_0x77adb0(0xb3)](a46_0x1f96c9[_0x77adb0(0xb9)](_0x77adb0(0x218)),_0x77adb0(0x195)),console[_0x77adb0(0xb3)](a46_0x1f96c9[_0x77adb0(0x192)](_0x77adb0(0x1e6))),0x1;const _0x2f5367=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x5a75e1+_0x77adb0(0x125));if(!_0x2f5367)return console[_0x77adb0(0xb3)](a46_0x1f96c9[_0x77adb0(0x15c)](_0x77adb0(0x200))),0x1;}const _0x16ff8c=await withSpinner(_0x77adb0(0x1fc)+_0x5a75e1+_0x77adb0(0x12f),()=>_0x621581[_0x77adb0(0x1f4)][_0x77adb0(0x8d)](_0x5a75e1),{'verbose':_0x28657a[_0x77adb0(0x1a6)]}),_0x4f70d6=_0x16ff8c['data'];return console[_0x77adb0(0xb3)](_0x77adb0(0x90)+_0x4f70d6[_0x77adb0(0x191)]),console[_0x77adb0(0xb3)](_0x77adb0(0x169)+_0x4f70d6[_0x77adb0(0xd2)]),0x0;}}export function parseKeyValue(_0xc606e4){const _0x419b2c=a46_0x591dc6,_0x42a4ba=_0xc606e4[_0x419b2c(0xe5)]('=');if(_0x42a4ba===-0x1)throw new Error(_0x419b2c(0x132)+_0xc606e4+_0x419b2c(0x1ab));const _0x3f7e8d=_0xc606e4[_0x419b2c(0x201)](0x0,_0x42a4ba),_0x50eb01=_0xc606e4[_0x419b2c(0x201)](_0x42a4ba+0x1);if(!_0x3f7e8d)throw new Error(_0x419b2c(0xf2));return{'key':_0x3f7e8d,'value':_0x50eb01};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x176);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1e8);async['execute'](_0x48c514){const _0x5ea267=a46_0x591dc6,{options:_0x488049,args:_0x1e7197,tdx:_0x5c7f0e}=_0x48c514,_0x3f3989=this['requireProject'](_0x1e7197,_0x488049);if(!_0x3f3989)return 0x1;_0x488049[_0x5ea267(0x1a6)]&&console['error'](_0x5ea267(0xb0)+_0x3f3989);const _0x2ac552=await withSpinner(_0x5ea267(0x225),()=>_0x5c7f0e[_0x5ea267(0x1f4)][_0x5ea267(0x186)](_0x3f3989),{'verbose':_0x488049[_0x5ea267(0x1a6)]}),{secrets:_0x285934}=_0x2ac552[_0x5ea267(0x164)];return console[_0x5ea267(0xb3)](_0x5ea267(0x182)+_0x285934[_0x5ea267(0x1ff)]+_0x5ea267(0xcf)+(_0x285934['length']!==0x1?'s':'')),await handleSDKOutput(_0x285934,_0x488049),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a46_0x591dc6(0x105);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x149);async['execute'](_0x541e64){const _0x48817e=a46_0x591dc6,{options:_0x57a14f,args:_0x403ade,tdx:_0x2a9bfb}=_0x541e64;let _0x4afdb2,_0x29ba21;if(_0x403ade['length']>=0x2)_0x4afdb2=_0x403ade[0x0],_0x29ba21=_0x403ade[0x1];else{if(_0x403ade[_0x48817e(0x1ff)]===0x1&&_0x57a14f[_0x48817e(0x12c)])_0x4afdb2=_0x57a14f[_0x48817e(0x12c)],_0x29ba21=_0x403ade[0x0];else return _0x403ade[_0x48817e(0x1ff)]===0x1?(console['error'](_0x48817e(0x1b5)),console[_0x48817e(0xb3)](_0x48817e(0x83)),0x1):(console[_0x48817e(0xb3)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x48817e(0xb3)](_0x48817e(0x9c)),0x1);}let _0x4e0c2f,_0x445cbb;try{({key:_0x4e0c2f,value:_0x445cbb}=parseKeyValue(_0x29ba21));}catch(_0x222332){return _0x222332 instanceof Error&&console[_0x48817e(0xb3)](a46_0x1f96c9['red'](_0x48817e(0x1a9)),_0x222332[_0x48817e(0x18e)]),0x1;}_0x57a14f[_0x48817e(0x1a6)]&&(console[_0x48817e(0xb3)](_0x48817e(0xb0)+_0x4afdb2),console['error'](_0x48817e(0x1fd)+_0x4e0c2f));const _0x141511=await withSpinner('Setting\x20secret...',()=>_0x2a9bfb[_0x48817e(0x1f4)][_0x48817e(0x109)](_0x4afdb2,_0x4e0c2f,_0x445cbb),{'verbose':_0x57a14f[_0x48817e(0x1a6)]}),_0xdc055=_0x141511[_0x48817e(0x164)];return console[_0x48817e(0xb3)](_0x48817e(0x87)+_0xdc055[_0x48817e(0x21f)]+_0x48817e(0x197)+_0xdc055[_0x48817e(0x191)]+'\x27'),(_0x57a14f[_0x48817e(0x1fb)]||_0x57a14f['jsonl'])&&await handleSingleObjectOutput(_0xdc055,_0x57a14f),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x137);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x22a);async[a46_0x591dc6(0x1a1)](_0x30a400){const _0x1d210a=a46_0x591dc6,{options:_0x30bdab,args:_0x57bb64,tdx:_0x193785}=_0x30a400;let _0x129784,_0x366049;if(_0x57bb64[_0x1d210a(0x1ff)]>=0x2)_0x129784=_0x57bb64[0x0],_0x366049=_0x57bb64[0x1];else{if(_0x57bb64[_0x1d210a(0x1ff)]===0x1&&_0x30bdab['workflowProject'])_0x129784=_0x30bdab[_0x1d210a(0x12c)],_0x366049=_0x57bb64[0x0];else return _0x57bb64['length']===0x1?(console[_0x1d210a(0xb3)](_0x1d210a(0x1b5)),console[_0x1d210a(0xb3)](_0x1d210a(0x83)),0x1):(console[_0x1d210a(0xb3)](_0x1d210a(0x215)),console[_0x1d210a(0xb3)](_0x1d210a(0x108)),0x1);}_0x30bdab['verbose']&&(console[_0x1d210a(0xb3)](_0x1d210a(0xb0)+_0x129784),console[_0x1d210a(0xb3)]('Key:\x20'+_0x366049));if(!_0x30bdab[_0x1d210a(0x1cd)]){if(!isInteractive())return console[_0x1d210a(0xb3)](a46_0x1f96c9[_0x1d210a(0xb9)](_0x1d210a(0x218)),_0x1d210a(0x195)),console[_0x1d210a(0xb3)](a46_0x1f96c9[_0x1d210a(0x192)](_0x1d210a(0x1e6))),0x1;const _0x2c4418=await confirmKey(_0x1d210a(0x209)+_0x366049+_0x1d210a(0x1c7)+_0x129784+'\x27?');if(!_0x2c4418)return console[_0x1d210a(0xb3)](a46_0x1f96c9['yellow'](_0x1d210a(0x200))),0x1;}const _0x3be673=await withSpinner(_0x1d210a(0xc6),()=>_0x193785['workflow']['deleteSecret'](_0x129784,_0x366049),{'verbose':_0x30bdab[_0x1d210a(0x1a6)]}),_0x3fa871=_0x3be673[_0x1d210a(0x164)];return console['error'](_0x1d210a(0x87)+_0x3fa871[_0x1d210a(0x21f)]+_0x1d210a(0x113)+_0x3fa871[_0x1d210a(0x191)]+'\x27'),(_0x30bdab['json']||_0x30bdab[_0x1d210a(0x1d8)])&&await handleSingleObjectOutput(_0x3fa871,_0x30bdab),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(_0x4d6956){const _0x318b2f=a46_0x591dc6,_0x291eca=Math[_0x318b2f(0x1df)](_0x4d6956/0x3e8),_0x1d2032=Math[_0x318b2f(0x1df)](_0x291eca/0x3c),_0x118473=Math[_0x318b2f(0x1df)](_0x1d2032/0x3c),_0x4d3966=Math['floor'](_0x118473/0x18);if(_0x4d3966>0x0){const _0x19e9fd=_0x118473%0x18;return _0x19e9fd>0x0?_0x4d3966+'d\x20'+_0x19e9fd+'h':_0x4d3966+'d';}else{if(_0x118473>0x0){const _0x50f46e=_0x1d2032%0x3c;return _0x50f46e>0x0?_0x118473+'h\x20'+_0x50f46e+'m':_0x118473+'h';}else{if(_0x1d2032>0x0){const _0x32fad8=_0x291eca%0x3c;return _0x32fad8>0x0?_0x1d2032+'m\x20'+_0x32fad8+'s':_0x1d2032+'m';}else return _0x291eca+'s';}}}function formatTimestamp(_0x164b2b,_0x477106){const _0x42959c=a46_0x591dc6,_0x4d7de0=new Date(_0x164b2b),_0x401497=String(_0x4d7de0['getHours']())['padStart'](0x2,'0'),_0x52b2a6=String(_0x4d7de0['getMinutes']())[_0x42959c(0xed)](0x2,'0'),_0x1c9773=_0x401497+':'+_0x52b2a6,_0x1ed625=_0x4d7de0[_0x42959c(0x11c)]()===_0x477106[_0x42959c(0x11c)]()&&_0x4d7de0[_0x42959c(0xb5)]()===_0x477106['getMonth']()&&_0x4d7de0[_0x42959c(0x89)]()===_0x477106['getDate']();if(_0x1ed625)return _0x1c9773;else{const _0x549d49=String(_0x4d7de0[_0x42959c(0xb5)]()+0x1)[_0x42959c(0xed)](0x2,'0'),_0x70420e=String(_0x4d7de0['getDate']())[_0x42959c(0xed)](0x2,'0');return _0x549d49+'-'+_0x70420e+'\x20'+_0x1c9773;}}function formatDate(_0x484673){const _0x171ad2=a46_0x591dc6,_0x223867=_0x484673[_0x171ad2(0x11c)](),_0x5549f2=String(_0x484673[_0x171ad2(0xb5)]()+0x1)['padStart'](0x2,'0'),_0xb24153=String(_0x484673['getDate']())[_0x171ad2(0xed)](0x2,'0');return _0x223867+'-'+_0x5549f2+'-'+_0xb24153;}function getTaskStateIcon(_0x412f1f){const _0x1ab5a7={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1ab5a7[_0x412f1f]||'⚪';}function getBarChar(_0x23db8d){const _0x5c8c42=a46_0x591dc6;return _0x23db8d===_0x5c8c42(0xb3)||_0x23db8d===_0x5c8c42(0x85)?'×':'─';}function getBarColor(_0x129267){const _0x205c27=a46_0x591dc6,_0x21d1a6={'success':a46_0x1f96c9[_0x205c27(0x17f)],'error':a46_0x1f96c9['red'],'group_error':a46_0x1f96c9[_0x205c27(0xb9)],'running':a46_0x1f96c9[_0x205c27(0x122)],'blocked':a46_0x1f96c9['yellow'],'planned':a46_0x1f96c9[_0x205c27(0x192)],'canceling':a46_0x1f96c9[_0x205c27(0x15c)]};return _0x21d1a6[_0x129267]||a46_0x1f96c9[_0x205c27(0x120)];}function parseTaskName(_0x269d39){const _0x2fd023=a46_0x591dc6;let _0x1b0857=_0x269d39['replace'](/^\++/,'');const _0x33ec6d=_0x1b0857[_0x2fd023(0x1a4)]('+'),_0x11c9a7=_0x33ec6d[_0x2fd023(0x1ff)]>0x1?_0x33ec6d['length']-0x2:0x0,_0x500725=_0x33ec6d[_0x33ec6d['length']-0x1]||_0x1b0857;return{'level':_0x11c9a7,'name':'+'+_0x500725};}function truncateTaskName(_0x3d993b,_0x50853d){const _0xbb01bf=a46_0x591dc6,_0x2d3636=stringWidth(_0x3d993b);if(_0x2d3636<=_0x50853d)return _0x3d993b;let _0x434bae=_0x3d993b;while(stringWidth(_0x434bae+'…')>_0x50853d&&_0x434bae[_0xbb01bf(0x1ff)]>0x0){_0x434bae=_0x434bae[_0xbb01bf(0x130)](0x0,-0x1);}return _0x434bae+'…';}function calculateTimeScale(_0x357a78,_0x44569c){const _0xc60444=a46_0x591dc6;return{'startTime':_0x357a78[_0xc60444(0x1f9)],'endTime':_0x357a78[_0xc60444(0x177)],'durationMs':_0x357a78[_0xc60444(0x22c)],'msPerChar':_0x357a78[_0xc60444(0x22c)]/_0x44569c};}function timeToPosition(_0x3f457d,_0x93e0a0,_0x357df8){const _0x41e1db=a46_0x591dc6,_0x48d351=_0x3f457d-_0x93e0a0[_0x41e1db(0x136)],_0x22eeaa=Math[_0x41e1db(0x1df)](_0x48d351/_0x93e0a0[_0x41e1db(0xc4)]);return Math[_0x41e1db(0x13e)](0x0,Math[_0x41e1db(0x80)](_0x22eeaa,_0x357df8));}function renderTimeAxis(_0x45b9b8,_0x500a03){const _0x57eeb3=a46_0x591dc6,_0x9cdb9f=Math[_0x57eeb3(0x80)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x57eeb3(0x13e)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x57eeb3(0x1df)](_0x500a03/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x4858d1=_0x45b9b8['durationMs']/(_0x9cdb9f-0x1),_0x437d36=new Date(_0x45b9b8[_0x57eeb3(0x136)]),_0x3770fc=[];for(let _0x52ad37=0x0;_0x52ad37<_0x9cdb9f;_0x52ad37++){const _0x563aa5=_0x45b9b8[_0x57eeb3(0x136)]+_0x52ad37*_0x4858d1,_0x239119=timeToPosition(_0x563aa5,_0x45b9b8,_0x500a03),_0x33af50=formatTimestamp(_0x563aa5,_0x437d36);_0x3770fc[_0x57eeb3(0x1dd)]({'pos':_0x239119,'text':_0x33af50});}const _0x522c5d=new Array(_0x500a03)['fill']('\x20');let _0xd56e35=-0x1;for(const {pos:_0x46cc30,text:_0x45f942}of _0x3770fc){let _0x3b0c61=Math['max'](0x0,_0x46cc30-Math[_0x57eeb3(0x1df)](_0x45f942[_0x57eeb3(0x1ff)]/0x2));_0x3b0c61<=_0xd56e35+TIMELINE_CONFIG[_0x57eeb3(0x17b)]&&(_0x3b0c61=_0xd56e35+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x3b0c61+_0x45f942[_0x57eeb3(0x1ff)]>_0x500a03&&(_0x3b0c61=_0x500a03-_0x45f942['length']);if(_0x3b0c61>=0x0&&_0x3b0c61+_0x45f942[_0x57eeb3(0x1ff)]<=_0x500a03&&_0x3b0c61>_0xd56e35){for(let _0x122703=0x0;_0x122703<_0x45f942['length'];_0x122703++){_0x522c5d[_0x3b0c61+_0x122703]=_0x45f942[_0x122703];}_0xd56e35=_0x3b0c61+_0x45f942[_0x57eeb3(0x1ff)]-0x1;}}return _0x522c5d[_0x57eeb3(0x84)]('');}function renderTaskRow(_0x2a25ca,_0x2c3506,_0x5a7754,_0x41a5a9){const _0x4e8606=a46_0x591dc6,{level:_0x3edb52,name:_0x2a36ca}=parseTaskName(_0x2a25ca[_0x4e8606(0xc9)]),_0x378c78='\x20'[_0x4e8606(0x20d)](_0x3edb52),_0x2d8919=_0x2a25ca[_0x4e8606(0x1cc)]?'('+formatElapsed(_0x2a25ca[_0x4e8606(0x1cc)][_0x4e8606(0x22c)])+')':'',_0x2a3981=stringWidth(_0x2d8919),_0x2efba8=_0x3edb52*0x1,_0x57480e=_0x41a5a9-_0x2efba8-_0x2a3981-0x1,_0x18a197=truncateTaskName(_0x2a36ca,_0x57480e),_0x41905e=_0x378c78+_0x18a197,_0x2755bd=stringWidth(_0x41905e),_0x464669=_0x41a5a9-_0x2755bd-_0x2a3981,_0x3be83f=_0x41905e+'\x20'[_0x4e8606(0x20d)](Math[_0x4e8606(0x13e)](0x1,_0x464669))+a46_0x1f96c9['dim'](_0x2d8919),_0x18c578=getTaskStateIcon(_0x2a25ca['state']),_0x39318f=new Array(_0x5a7754)[_0x4e8606(0x187)]('\x20');if(_0x2a25ca[_0x4e8606(0x1cc)]){const _0x4ba5ec=timeToPosition(_0x2a25ca[_0x4e8606(0x1cc)][_0x4e8606(0x1f9)],_0x2c3506,_0x5a7754),_0x59b05b=timeToPosition(_0x2a25ca[_0x4e8606(0x1cc)]['end'],_0x2c3506,_0x5a7754),_0x35f798=getBarChar(_0x2a25ca[_0x4e8606(0xb2)]),_0x216068=Math['max'](_0x4ba5ec+0x1,_0x59b05b);for(let _0x20c21f=_0x4ba5ec;_0x20c21f<Math[_0x4e8606(0x80)](_0x216068,_0x5a7754);_0x20c21f++){_0x39318f[_0x20c21f]=_0x35f798;}}const _0xa0edbd=getBarColor(_0x2a25ca[_0x4e8606(0xb2)]),_0x2a0926=_0x39318f[_0x4e8606(0x112)](_0x52a672=>_0x52a672==='\x20'?'\x20':_0xa0edbd(_0x52a672))['join']('');return _0x18c578+'\x20'+_0x3be83f+'│'+_0x2a0926+'│';}function calculateStats(_0x36e205){const _0x4b01d4=a46_0x591dc6,_0x1b08f0={'total':_0x36e205[_0x4b01d4(0x1ff)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1bc202 of _0x36e205){if(_0x1bc202['state']===_0x4b01d4(0xb1))_0x1b08f0[_0x4b01d4(0xb1)]++;else{if(_0x1bc202[_0x4b01d4(0xb2)]===_0x4b01d4(0xb3)||_0x1bc202[_0x4b01d4(0xb2)]==='group_error')_0x1b08f0[_0x4b01d4(0xb3)]++;else _0x1bc202[_0x4b01d4(0xb2)]===_0x4b01d4(0x185)?_0x1b08f0[_0x4b01d4(0x185)]++:_0x1b08f0['pending']++;}}return _0x1b08f0;}function formatStats(_0x3f57ec){const _0x2984b9=a46_0x591dc6;return['Total:\x20'+_0x3f57ec[_0x2984b9(0x1ca)],'✅\x20'+_0x3f57ec[_0x2984b9(0xb1)],'❌\x20'+_0x3f57ec[_0x2984b9(0xb3)],'🔄\x20'+_0x3f57ec[_0x2984b9(0x185)],'⏳\x20'+_0x3f57ec[_0x2984b9(0x1c9)]][_0x2984b9(0x84)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a46_0x591dc6(0x1c2);['description']=a46_0x591dc6(0x168);async['execute'](_0x52c25c){const _0x15b007=a46_0x591dc6,{options:_0x2e2c31,args:_0x478a02,tdx:_0x1a2613}=_0x52c25c;let _0x3c2189,_0x5403b2,_0x5327fe=![];if(_0x478a02[0x0]){if(_0x478a02[0x0][_0x15b007(0x18c)]('.')){const _0x259f0f=this[_0x15b007(0x1e1)](_0x478a02,_0x2e2c31);if(!_0x259f0f)return 0x1;_0x3c2189=_0x259f0f[_0x15b007(0x191)],_0x5403b2=_0x259f0f[_0x15b007(0x12d)];}else{_0x5403b2=_0x478a02[0x0],_0x3c2189=_0x2e2c31[_0x15b007(0x12c)];if(!_0x3c2189)return console[_0x15b007(0xb3)](a46_0x1f96c9['red'](_0x15b007(0x1a9)),_0x15b007(0x153)),0x1;_0x5327fe=!![];}}else{const _0x1e8ecc=this['parseProjectWorkflowPattern'](_0x478a02,_0x2e2c31);if(!_0x1e8ecc)return 0x1;_0x3c2189=_0x1e8ecc[_0x15b007(0x191)],_0x5403b2=_0x1e8ecc[_0x15b007(0x12d)];}if(_0x2e2c31[_0x15b007(0x1a6)]){if(_0x3c2189&&_0x5403b2)console[_0x15b007(0xb3)]('Filter:\x20'+_0x3c2189+'.'+_0x5403b2);else _0x3c2189&&console['error'](_0x15b007(0x204)+_0x3c2189);}const _0x355a97=_0x2e2c31[_0x15b007(0x1c8)],_0x40ec71=_0x2e2c31[_0x15b007(0xee)];if(_0x355a97){_0x40ec71&&console[_0x15b007(0xb3)](a46_0x1f96c9[_0x15b007(0x15c)](_0x15b007(0xd1)),_0x15b007(0xdf));const _0x1dcf97=_0x2e2c31[_0x15b007(0x227)];return _0x1dcf97?await this[_0x15b007(0xce)](_0x52c25c,_0x355a97):await this[_0x15b007(0xf3)](_0x52c25c,_0x355a97,_0x2e2c31),0x0;}if(_0x40ec71){const _0x572cdc=await withSpinner(_0x15b007(0xe8),()=>_0x1a2613['workflow']['sessions']({'projectName':_0x3c2189,'workflowName':_0x5403b2,'limit':0x64}),{'verbose':_0x2e2c31[_0x15b007(0x1a6)]}),_0x45f22e=_0x572cdc[_0x15b007(0x164)][_0x15b007(0x1a2)](_0x29b14b=>_0x29b14b['id']===_0x40ec71);if(!_0x45f22e)return console[_0x15b007(0xb3)](a46_0x1f96c9[_0x15b007(0xb9)]('Error:'),_0x15b007(0x20f)+_0x40ec71),0x1;if(!_0x45f22e['lastAttempt']?.['id'])return console[_0x15b007(0xb3)](a46_0x1f96c9['red'](_0x15b007(0x1a9)),_0x15b007(0x162)+_0x40ec71+_0x15b007(0xfc)),0x1;const _0x5e132b=_0x45f22e['lastAttempt']['id'];_0x2e2c31['verbose']&&console[_0x15b007(0xb3)](_0x15b007(0xb4)+_0x5e132b+'\x20from\x20session\x20'+_0x40ec71);const _0x45b306=_0x2e2c31[_0x15b007(0x227)];return _0x45b306?await this['pollTimeline'](_0x52c25c,_0x5e132b):await this[_0x15b007(0xf3)](_0x52c25c,_0x5e132b,_0x2e2c31),0x0;}const _0x3beada=await withSpinner(_0x15b007(0xa6),()=>_0x1a2613[_0x15b007(0x1f4)][_0x15b007(0x1be)]({'projectName':_0x3c2189,'workflowName':_0x5403b2,'limit':_0x2e2c31[_0x15b007(0xa1)]||0x32}),{'verbose':_0x2e2c31[_0x15b007(0x1a6)]}),_0x538402=_0x3beada[_0x15b007(0x164)];if(_0x538402[_0x15b007(0x1ff)]===0x0){if(_0x3c2189&&_0x5403b2)console[_0x15b007(0xb3)](_0x15b007(0x1b0)+_0x3c2189+'.'+_0x5403b2);else _0x3c2189?console[_0x15b007(0xb3)](_0x15b007(0x181)+_0x3c2189):(console['error'](_0x15b007(0xbe)),console['error'](a46_0x1f96c9['dim'](_0x15b007(0x8c))));return 0x0;}_0x538402[_0x15b007(0xf9)]((_0x1c2c30,_0xd15ae)=>{const _0x53fb43=_0x15b007,_0xc858d0=_0x1c2c30[_0x53fb43(0x1a5)]||'',_0x3a309e=_0xd15ae[_0x53fb43(0x1a5)]||'';return _0x3a309e['localeCompare'](_0xc858d0);});if(_0x2e2c31[_0x15b007(0x1fb)]||_0x2e2c31[_0x15b007(0x1d8)])return await handleSDKOutput(_0x538402,_0x2e2c31),0x0;let _0x56c8b5;if(_0x5327fe){const _0x56c17e=_0x538402[0x0];if(!_0x56c17e[_0x15b007(0xae)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x56c8b5=_0x56c17e[_0x15b007(0xae)]['id'],_0x2e2c31[_0x15b007(0x1a6)]&&console[_0x15b007(0xb3)](_0x15b007(0x16a)+_0x56c17e['sessionTime']);}else{const _0x2f545c=_0x538402['map'](_0x51315c=>{const _0x846fa3=_0x15b007,_0x1fb9ea=getAttemptStatusDisplay(_0x51315c[_0x846fa3(0xae)]);return{'title':_0x51315c[_0x846fa3(0x1f6)]?.[_0x846fa3(0xc9)]+'.'+_0x51315c[_0x846fa3(0x1f4)]?.[_0x846fa3(0xc9)]+_0x846fa3(0xff)+_0x51315c[_0x846fa3(0x1a5)]+'\x20'+_0x1fb9ea[_0x846fa3(0xf5)],'value':_0x51315c[_0x846fa3(0xae)]?.['id']||'','description':_0x1fb9ea[_0x846fa3(0x220)]};}),_0x3e74c1=await a46_0x1147d5({'type':'select','name':_0x15b007(0x1c8),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2f545c[_0x15b007(0x214)](_0x568ed9=>_0x568ed9['value']!=='')});if(!_0x3e74c1['attemptId'])return 0x0;_0x56c8b5=_0x3e74c1['attemptId'];}const _0x2eb482=_0x2e2c31[_0x15b007(0x227)];return _0x2eb482?await this[_0x15b007(0xce)](_0x52c25c,_0x56c8b5):await this['renderSingleTimeline'](_0x52c25c,_0x56c8b5,_0x2e2c31),0x0;}async[a46_0x591dc6(0xf3)](_0x257268,_0x54a38d,_0x36b4b9){const _0x4bd3e8=a46_0x591dc6,{tdx:_0x1166b0}=_0x257268;let _0x2928a3,_0x43160d;try{[_0x2928a3,_0x43160d]=await Promise[_0x4bd3e8(0x88)]([_0x1166b0[_0x4bd3e8(0x1f4)]['attempt'](_0x54a38d),_0x1166b0[_0x4bd3e8(0x1f4)][_0x4bd3e8(0x14a)](_0x54a38d,![])]);}catch(_0x57bec1){console[_0x4bd3e8(0xb3)](a46_0x1f96c9[_0x4bd3e8(0xb9)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x36b4b9[_0x4bd3e8(0x1a6)]&&console['error'](_0x57bec1);throw _0x57bec1;}if(_0x36b4b9[_0x4bd3e8(0x1fb)]||_0x36b4b9['jsonl']){const _0x19744a=this[_0x4bd3e8(0x142)](_0x2928a3,_0x43160d);await handleSDKOutput([_0x19744a],_0x36b4b9);return;}const _0x348055=_0x1166b0[_0x4bd3e8(0x19c)][_0x4bd3e8(0x1fa)],_0xd1752c=this[_0x4bd3e8(0xa2)](_0x2928a3,_0x43160d,_0x348055);console['log'](_0xd1752c);}async[a46_0x591dc6(0xce)](_0x3067aa,_0x4b4253){const _0x23f49d=a46_0x591dc6,{tdx:_0x5acc37}=_0x3067aa,_0x3f9b1d=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x42ce4d=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x99f558=0x0;while(_0x99f558<_0x42ce4d){process[_0x23f49d(0xf4)][_0x23f49d(0xe9)]&&process[_0x23f49d(0xf4)][_0x23f49d(0xeb)]('\x1bc');let _0x7a9d12,_0x35ab1e;try{[_0x7a9d12,_0x35ab1e]=await Promise['all']([_0x5acc37[_0x23f49d(0x1f4)][_0x23f49d(0x95)](_0x4b4253),_0x5acc37[_0x23f49d(0x1f4)][_0x23f49d(0x14a)](_0x4b4253,![])]);}catch(_0x4c21aa){console[_0x23f49d(0xb3)](a46_0x1f96c9[_0x23f49d(0xb9)](_0x23f49d(0x156)));_0x99f558>0x0&&console[_0x23f49d(0xb3)](a46_0x1f96c9[_0x23f49d(0x192)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x99f558));throw _0x4c21aa;}const _0x2d5460=_0x5acc37['context'][_0x23f49d(0x1fa)],_0x18d4ba=this[_0x23f49d(0xa2)](_0x7a9d12,_0x35ab1e,_0x2d5460);console['log'](_0x18d4ba);const _0x2de901=_0x7a9d12[_0x23f49d(0xe2)]&&_0x35ab1e['every'](_0x47531a=>_0x47531a[_0x23f49d(0xb2)]!==_0x23f49d(0x185)&&_0x47531a['state']!=='planned');if(_0x2de901){console[_0x23f49d(0xb3)](a46_0x1f96c9[_0x23f49d(0x17f)](_0x23f49d(0xd0)));break;}console[_0x23f49d(0xb3)](a46_0x1f96c9[_0x23f49d(0x192)](_0x23f49d(0x210)+_0x99f558*0x2+_0x23f49d(0xbb))),await new Promise(_0x440ce3=>setTimeout(_0x440ce3,_0x3f9b1d)),_0x99f558++;}_0x99f558>=_0x42ce4d&&console[_0x23f49d(0xb3)](a46_0x1f96c9['yellow'](_0x23f49d(0x173)));}[a46_0x591dc6(0xa2)](_0x4f5973,_0x5a9bf1,_0x4926e9){const _0xa85c74=a46_0x591dc6,_0x2165e1=[],_0x53d95e=TIMELINE_CONFIG[_0xa85c74(0x16b)],_0x1a870b=0x5,_0x2a6e02=process[_0xa85c74(0xf4)][_0xa85c74(0x1ae)]||0x78,_0x5acf47=_0x2a6e02-_0x53d95e-_0x1a870b,_0x258584=Math[_0xa85c74(0x13e)](TIMELINE_CONFIG[_0xa85c74(0x14e)],Math['min'](_0x5acf47,TIMELINE_CONFIG[_0xa85c74(0x110)])),_0x31eae7=new Date(_0x4f5973[_0xa85c74(0x154)])[_0xa85c74(0xa4)](),_0x4ebc04=_0x4f5973[_0xa85c74(0x152)]?new Date(_0x4f5973[_0xa85c74(0x152)])['getTime']():Date[_0xa85c74(0x20b)](),_0x53f2bf={'start':_0x31eae7,'end':_0x4ebc04,'duration':_0x4ebc04-_0x31eae7},_0x1a74d5=new Map(),_0x5d1fea=[];for(const _0x18dd83 of _0x5a9bf1){if(_0x18dd83['startedAt']){const _0x1e62de=new Date(_0x18dd83[_0xa85c74(0x1f2)])['getTime'](),_0x55ce1e=_0x18dd83['updatedAt']?new Date(_0x18dd83[_0xa85c74(0x1f3)])[_0xa85c74(0xa4)]():Date[_0xa85c74(0x20b)](),_0x21c64a={'start':_0x1e62de,'end':_0x55ce1e,'duration':_0x55ce1e-_0x1e62de};_0x1a74d5[_0xa85c74(0x1f8)](_0x18dd83['id'],_0x21c64a),_0x5d1fea['push']({'name':_0x18dd83[_0xa85c74(0x1f0)],'state':_0x18dd83[_0xa85c74(0xb2)]||'unknown','window':_0x21c64a});}else _0x5d1fea[_0xa85c74(0x1dd)]({'name':_0x18dd83[_0xa85c74(0x1f0)],'state':_0x18dd83[_0xa85c74(0xb2)]||_0xa85c74(0x16d),'window':undefined});}_0x5d1fea['sort']((_0x417744,_0x223d6b)=>{const _0x2fe4e7=_0xa85c74;if(!_0x417744[_0x2fe4e7(0x1cc)])return 0x1;if(!_0x223d6b[_0x2fe4e7(0x1cc)])return-0x1;return _0x417744[_0x2fe4e7(0x1cc)]['start']-_0x223d6b['window'][_0x2fe4e7(0x1f9)];});const _0x523b76=_0x5d1fea[_0xa85c74(0x1ff)],_0x5cbcc9=_0x523b76>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x5cbcc9&&_0x5d1fea[_0xa85c74(0x207)](TIMELINE_CONFIG[_0xa85c74(0x139)]);const _0x2c43ab=calculateTimeScale(_0x53f2bf,_0x258584),_0x9ed2a8=_0x4f5973[_0xa85c74(0xe2)]?_0x4f5973[_0xa85c74(0xb1)]?a46_0x1f96c9[_0xa85c74(0x17f)](_0xa85c74(0xb1)):a46_0x1f96c9[_0xa85c74(0xb9)](_0xa85c74(0xb3)):a46_0x1f96c9[_0xa85c74(0x122)]('running'),_0x4a8cb4=_0x4f5973[_0xa85c74(0x1f6)]?.['id'],_0x51f3da=_0x4f5973[_0xa85c74(0xee)];let _0x2a5eed;if(_0x4a8cb4&&_0x51f3da){const _0x3abe28=getWorkflowAttemptUrl(_0x4926e9,_0x4a8cb4,_0x51f3da,_0x4f5973['id']);_0x2a5eed=hyperlink(a46_0x1f96c9[_0xa85c74(0x192)](_0x4f5973['id']),_0x3abe28);}else _0x2a5eed=a46_0x1f96c9[_0xa85c74(0x192)](_0x4f5973['id']);_0x2165e1[_0xa85c74(0x1dd)](_0xa85c74(0x86)+_0x2a5eed+_0xa85c74(0xff)+_0x9ed2a8+_0xa85c74(0xff)+formatElapsed(_0x53f2bf[_0xa85c74(0x22c)]));if(_0x5d1fea['length']>0x0){const _0x11f384=renderTimeAxis(_0x2c43ab,_0x258584),_0x5093ab=new Date(_0x53f2bf[_0xa85c74(0x1f9)]),_0x6781f5=formatDate(_0x5093ab),_0x90687a=TIMELINE_CONFIG[_0xa85c74(0x1dc)]+TIMELINE_CONFIG[_0xa85c74(0x1e3)]+_0x53d95e,_0x578a70=_0x6781f5[_0xa85c74(0xed)](_0x90687a),_0x56e8f9=a46_0x1f96c9[_0xa85c74(0x192)](_0x578a70);_0x2165e1[_0xa85c74(0x1dd)](_0x56e8f9+'\x20'+_0x11f384);for(const _0x5572f9 of _0x5d1fea){_0x2165e1[_0xa85c74(0x1dd)](renderTaskRow(_0x5572f9,_0x2c43ab,_0x258584,_0x53d95e));}const _0x1040d4=calculateStats(_0x5d1fea);_0x2165e1[_0xa85c74(0x1dd)](formatStats(_0x1040d4)),_0x5cbcc9&&_0x2165e1[_0xa85c74(0x1dd)](a46_0x1f96c9['yellow'](_0xa85c74(0x134)+TIMELINE_CONFIG[_0xa85c74(0x139)]+'\x20of\x20'+_0x523b76+'\x20tasks')),_0x2165e1[_0xa85c74(0x1dd)](''),_0x2165e1[_0xa85c74(0x1dd)](a46_0x1f96c9['dim']('💡\x20Tip:\x20Use\x20')+(_0xa85c74(0x14b)+_0x4f5973['id']+_0xa85c74(0x121))+a46_0x1f96c9[_0xa85c74(0x192)](_0xa85c74(0x143)));}else _0x2165e1['push'](_0xa85c74(0xb6));return _0x2165e1[_0xa85c74(0x84)]('\x0a');}['buildTimelineData'](_0x660512,_0x9fc5bf){const _0x302563=a46_0x591dc6,_0x1fb1b4=new Date(_0x660512[_0x302563(0x154)])[_0x302563(0xa4)](),_0xa2484a=_0x660512[_0x302563(0x152)]?new Date(_0x660512[_0x302563(0x152)])[_0x302563(0xa4)]():Date[_0x302563(0x20b)](),_0x37bac6=_0xa2484a-_0x1fb1b4,_0x182e12=[];for(const _0x42185b of _0x9fc5bf){if(_0x42185b[_0x302563(0x1f2)]){const _0x2a3dbf=new Date(_0x42185b[_0x302563(0x1f2)])[_0x302563(0xa4)](),_0x47c554=_0x42185b['updatedAt']?new Date(_0x42185b[_0x302563(0x1f3)])[_0x302563(0xa4)]():Date[_0x302563(0x20b)]();_0x182e12['push']({'name':_0x42185b[_0x302563(0x1f0)],'state':_0x42185b[_0x302563(0xb2)]||'unknown','window':{'start':_0x2a3dbf,'end':_0x47c554,'duration':_0x47c554-_0x2a3dbf}});}else _0x182e12['push']({'name':_0x42185b[_0x302563(0x1f0)],'state':_0x42185b[_0x302563(0xb2)]||_0x302563(0x16d),'window':undefined});}const _0x4c0cb6=calculateStats(_0x182e12);return{'attempt':{'id':_0x660512['id'],'status':_0x660512[_0x302563(0xe2)]?_0x660512['success']?_0x302563(0xb1):_0x302563(0xb3):_0x302563(0x185),'createdAt':_0x660512['createdAt'],'finishedAt':_0x660512[_0x302563(0x152)],'duration_ms':_0x37bac6},'tasks':_0x182e12[_0x302563(0x112)](_0x3416ae=>({'name':_0x3416ae[_0x302563(0xc9)],'state':_0x3416ae[_0x302563(0xb2)],'startedAt':_0x3416ae['window']?new Date(_0x3416ae[_0x302563(0x1cc)][_0x302563(0x1f9)])['toISOString']():null,'updatedAt':_0x3416ae['window']?new Date(_0x3416ae[_0x302563(0x1cc)][_0x302563(0x177)])[_0x302563(0x102)]():null,'duration_ms':_0x3416ae[_0x302563(0x1cc)]?.[_0x302563(0x22c)]||null})),'stats':_0x4c0cb6};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x424ea5,_0x519599){const _0xa5bf93=a47_0x586f,_0x3675d7=_0x424ea5();while(!![]){try{const _0x33b6cf=-parseInt(_0xa5bf93(0x1bc))/0x1+parseInt(_0xa5bf93(0x1c2))/0x2+parseInt(_0xa5bf93(0x1b6))/0x3+parseInt(_0xa5bf93(0x1ba))/0x4+parseInt(_0xa5bf93(0x1c0))/0x5*(-parseInt(_0xa5bf93(0x1b9))/0x6)+-parseInt(_0xa5bf93(0x1c1))/0x7*(parseInt(_0xa5bf93(0x1c3))/0x8)+parseInt(_0xa5bf93(0x1b5))/0x9*(parseInt(_0xa5bf93(0x1bb))/0xa);if(_0x33b6cf===_0x519599)break;else _0x3675d7['push'](_0x3675d7['shift']());}catch(_0x1e2831){_0x3675d7['push'](_0x3675d7['shift']());}}}(a47_0x25f4,0x5cd37));import{platform}from'os';import{getAPIKey}from'./config.js';function a47_0x25f4(){const _0x333394=['7MktvEb','345584sRQJeN','4265232TtWvga','replace','version','9xuQIwZ','146934iAQLoV','length','Authorization','594DQUrOH','2230108sysduZ','13134120YZRWWr','653848qbPMRe','TD1\x20','X-Trino-User',';\x20node/','26540zinarU'];a47_0x25f4=function(){return _0x333394;};return a47_0x25f4();}import{getVersion}from'./version.js';function a47_0x586f(_0x490ce1,_0x45ffe5){_0x490ce1=_0x490ce1-0x1b5;const _0x25f492=a47_0x25f4();let _0x586f51=_0x25f492[_0x490ce1];return _0x586f51;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x39ed53=a47_0x586f,_0x567768=getVersion(),_0x6d8b26=platform(),_0x2ba524=process[_0x39ed53(0x1c5)][_0x39ed53(0x1c4)]('v','');return'tdx/'+_0x567768+'\x20('+_0x6d8b26+_0x39ed53(0x1bf)+_0x2ba524+')';}export function getAuthHeaders(_0x26a40e,_0x4755a7){const _0x1cab8e=a47_0x586f,_0x3ec9dc=getVersion(),_0x5cc67e={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x3ec9dc};return _0x4755a7&&(_0x5cc67e[_0x1cab8e(0x1b8)]=_0x1cab8e(0x1bd)+_0x4755a7),_0x5cc67e;}export function toHeaderRecord(_0x52f249){const _0x18a1ef={};for(const [_0x4bb0c0,_0x3d0612]of Object['entries'](_0x52f249)){_0x3d0612!==undefined&&(_0x18a1ef[_0x4bb0c0]=_0x3d0612);}return _0x18a1ef;}export function getTrinoHeaders(_0x4fbb1e,_0x42ef0f){const _0x363788=a47_0x586f,_0x3dccd7=getAuthHeaders(_0x4fbb1e,_0x42ef0f),_0x233e24=toHeaderRecord(_0x3dccd7);return delete _0x233e24[_0x363788(0x1b8)],_0x42ef0f&&(_0x233e24[_0x363788(0x1be)]=_0x42ef0f),_0x233e24;}export function hasAPIKey(_0x22027d){const _0x2a9ce5=a47_0x586f,_0x587a98=getAPIKey();return _0x587a98!==undefined&&_0x587a98[_0x2a9ce5(0x1b7)]>0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2b64ab,_0x3f961b){const _0x2eee09=a48_0x42ae,_0x18a9b0=_0x2b64ab();while(!![]){try{const _0x226417=-parseInt(_0x2eee09(0x15b))/0x1*(parseInt(_0x2eee09(0x130))/0x2)+-parseInt(_0x2eee09(0x14e))/0x3+parseInt(_0x2eee09(0x134))/0x4+-parseInt(_0x2eee09(0x147))/0x5+-parseInt(_0x2eee09(0x148))/0x6+-parseInt(_0x2eee09(0x124))/0x7*(-parseInt(_0x2eee09(0x121))/0x8)+-parseInt(_0x2eee09(0x13d))/0x9*(-parseInt(_0x2eee09(0x136))/0xa);if(_0x226417===_0x3f961b)break;else _0x18a9b0['push'](_0x18a9b0['shift']());}catch(_0x173dd3){_0x18a9b0['push'](_0x18a9b0['shift']());}}}(a48_0x4a01,0xe05ee));import{writeFileSync}from'fs';function a48_0x42ae(_0x1c55b2,_0x516d7e){_0x1c55b2=_0x1c55b2-0x114;const _0x4a01f2=a48_0x4a01();let _0x42ae33=_0x4a01f2[_0x1c55b2];return _0x42ae33;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a48_0x5329a6 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x10d44c){const _0x552477=a48_0x42ae;return _0x10d44c[_0x552477(0x133)]===_0x552477(0x118)||_0x10d44c['format']===_0x552477(0x13e)||_0x10d44c['format']===_0x552477(0x137)||_0x10d44c[_0x552477(0x133)]===_0x552477(0x120)||_0x10d44c['json']===!![]||_0x10d44c[_0x552477(0x13e)]===!![]||_0x10d44c[_0x552477(0x137)]===!![]||_0x10d44c['table']===!![];}export function parseOutputOptions(_0x42b084){const _0x1d3eb5=a48_0x42ae;return{'format':_0x42b084[_0x1d3eb5(0x133)]||'table','output':_0x42b084['output']||'','limit':_0x42b084['limit'],'color':_0x42b084['color'],'noColor':_0x42b084[_0x1d3eb5(0x116)]};}function convertSDKResultToQueryResult(_0x5db948){const _0x314735=a48_0x42ae,_0x1d472c=[];if(_0x5db948['length']>0x0){const _0x55e3c8=_0x5db948[0x0];for(const [_0x422993,_0x465fc1]of Object[_0x314735(0x11b)](_0x55e3c8)){let _0x49e971=_0x314735(0x140);if(typeof _0x465fc1==='number')_0x49e971=Number[_0x314735(0x15a)](_0x465fc1)?_0x314735(0x11c):_0x314735(0x143);else{if(typeof _0x465fc1===_0x314735(0x129))_0x49e971=_0x314735(0x129);else _0x465fc1===null&&(_0x49e971=_0x314735(0x140));}_0x1d472c[_0x314735(0x14b)]({'name':_0x422993,'type':_0x49e971});}}return{'queryId':_0x314735(0x157),'columns':_0x1d472c,'data':_0x5db948,'stats':{'state':_0x314735(0x158),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5db948[_0x314735(0x141)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x218c62,_0x30b3ee){const _0x212255=convertSDKResultToQueryResult(_0x218c62);return formatQueryOutput(_0x212255,_0x30b3ee);}export async function formatQueryOutput(_0x56b677,_0x38715f){const _0x3813f1=a48_0x42ae,{format:_0x123bc1,limit:_0x38a8ee,output:_0x46c435,color:_0x23faaa,noColor:_0x5d9787}=_0x38715f,_0x7b2bc5=Boolean(_0x46c435)&&!_0x23faaa,_0x2f4e86={'color':_0x23faaa,'noColor':_0x5d9787||_0x7b2bc5};if(_0x123bc1===_0x3813f1(0x120)){const _0x596950=shouldUseLess(_0x123bc1,_0x46c435);return formatAsTable(_0x56b677,_0x38a8ee,_0x596950,_0x2f4e86);}else{if(_0x123bc1===_0x3813f1(0x118))return formatAsJSON(_0x56b677,_0x2f4e86);else return _0x123bc1==='jsonl'?formatAsJSONL(_0x56b677,_0x2f4e86):formatQueryResult(_0x56b677,_0x123bc1);}}function shouldUseLess(_0x3839e4,_0x1c49f2){const _0x566586=a48_0x42ae;return(_0x3839e4===_0x566586(0x120)||_0x3839e4===_0x566586(0x156))&&process[_0x566586(0x159)][_0x566586(0x12c)]&&!_0x1c49f2;}export function resolveOutputOptions(_0x5c2178){const _0x496263=a48_0x42ae,_0x2dccc5=resolveOutputFormat(_0x5c2178[_0x496263(0x133)],_0x5c2178[_0x496263(0x132)],_0x496263(0x120));let _0xc973e2=typeof _0x5c2178[_0x496263(0x127)]===_0x496263(0x14c)?_0x5c2178['limit']:parseInt(_0x5c2178[_0x496263(0x127)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x120431=_0x5c2178[_0x496263(0x132)]||'';return shouldUseLess(_0x2dccc5,_0x120431)&&(_0xc973e2=Infinity),{'format':_0x2dccc5,'output':_0x120431,'limit':_0xc973e2,'color':_0x5c2178[_0x496263(0x154)],'noColor':_0x5c2178[_0x496263(0x116)]};}export function writeOutput(_0x107f3a,_0x528a4f,_0x25a331){const _0x410370=a48_0x42ae;return _0x528a4f?(writeFileSync(_0x528a4f,_0x107f3a),console[_0x410370(0x138)]('Results\x20saved\x20to\x20'+_0x528a4f),Promise[_0x410370(0x115)]()):shouldUseLess(_0x25a331||'','')?new Promise(_0x2da0e6=>{const _0x51fb86=_0x410370,_0x9f065b=spawn(_0x51fb86(0x15d),[_0x51fb86(0x15c)],{'stdio':[_0x51fb86(0x155),_0x51fb86(0x135),_0x51fb86(0x135)]});let _0x2cdc2e=![];_0x9f065b['on'](_0x51fb86(0x138),()=>{const _0x57e1cc=_0x51fb86;!_0x2cdc2e&&(_0x2cdc2e=!![],console[_0x57e1cc(0x12b)](_0x107f3a),_0x2da0e6());}),_0x9f065b['on'](_0x51fb86(0x11f),()=>{!_0x2cdc2e&&(_0x2cdc2e=!![],_0x2da0e6());}),_0x9f065b['on'](_0x51fb86(0x152),()=>{const _0x21b672=_0x51fb86;!_0x2cdc2e&&_0x9f065b[_0x21b672(0x15e)]&&(_0x9f065b['stdin']['on'](_0x21b672(0x138),()=>{}),_0x9f065b['stdin'][_0x21b672(0x13c)](_0x107f3a),_0x9f065b['stdin'][_0x21b672(0x13a)]());}),!_0x9f065b[_0x51fb86(0x15e)]&&(!_0x2cdc2e&&(_0x2cdc2e=!![],console[_0x51fb86(0x12b)](_0x107f3a),_0x2da0e6()));}):(console['log'](_0x107f3a),Promise[_0x410370(0x115)]());}export async function handleSDKOutput(_0x21735e,_0x26a1a9){const _0x146617=a48_0x42ae,_0x3d6310=resolveOutputOptions(_0x26a1a9),_0x5eeab8=await formatSDKOutput(_0x21735e,_0x3d6310);await writeOutput(_0x5eeab8,_0x3d6310[_0x146617(0x132)]||undefined,_0x3d6310[_0x146617(0x133)]);}export async function handleQueryOutput(_0x4a7e27,_0x2ad843){const _0x3fd269=a48_0x42ae,_0x390ae6=resolveOutputOptions(_0x2ad843),_0x2af64a=await formatQueryOutput(_0x4a7e27,_0x390ae6);await writeOutput(_0x2af64a,_0x390ae6[_0x3fd269(0x132)]||undefined,_0x390ae6[_0x3fd269(0x133)]);}async function formatSingleObject(_0x504ad3,_0x1e6658){const _0x613e5e=a48_0x42ae,{format:_0x477a55,color:_0x2bb076,noColor:_0x32d780}=_0x1e6658,_0x17b3a5={'color':_0x2bb076,'noColor':_0x32d780};if(_0x477a55===_0x613e5e(0x118)){if(shouldUseColor(_0x17b3a5))return colorizeJSON(_0x504ad3,_0x17b3a5);return JSON[_0x613e5e(0x145)](_0x504ad3,null,0x2);}else{if(_0x477a55==='jsonl'){if(shouldUseColor(_0x17b3a5))return colorizeJSONCompact(_0x504ad3,_0x17b3a5);return JSON[_0x613e5e(0x145)](_0x504ad3);}else{if(_0x477a55==='tsv')return Object[_0x613e5e(0x11b)](_0x504ad3)[_0x613e5e(0x12e)](([_0x203e89,_0x4303a5])=>_0x203e89+'\x09'+_0x4303a5)[_0x613e5e(0x14a)]('\x0a');else{const _0x3d107c=Object[_0x613e5e(0x11b)](_0x504ad3);if(_0x3d107c[_0x613e5e(0x141)]===0x0)return'No\x20data';const _0x262786=_0x504ad3[_0x613e5e(0x14d)],_0x30939b=_0x504ad3[_0x613e5e(0x126)],_0x211bb7=_0x504ad3['params'],_0x4c70de=_0x504ad3['rule'],_0x3349d4=_0x30939b?typeof _0x30939b===_0x613e5e(0x153)?_0x30939b:JSON[_0x613e5e(0x145)](_0x30939b,null,0x2):undefined,_0x22ea63=_0x211bb7&&Object['keys'](_0x211bb7)[_0x613e5e(0x141)]>0x0?JSON['stringify'](_0x211bb7,null,0x2):undefined,_0x52214f=_0x4c70de&&Object[_0x613e5e(0x11a)](_0x4c70de)[_0x613e5e(0x141)]>0x0?JSON[_0x613e5e(0x145)](_0x4c70de,null,0x2):undefined,_0x139921=_0x3d107c[_0x613e5e(0x139)](([_0x466643])=>_0x466643!==_0x613e5e(0x14d)&&_0x466643!=='query'&&_0x466643!==_0x613e5e(0x12a)&&_0x466643!==_0x613e5e(0x117)),_0x123a32=Math[_0x613e5e(0x125)](..._0x139921[_0x613e5e(0x12e)](([_0x4d302e])=>_0x4d302e[_0x613e5e(0x141)])),_0x5e7173=Math[_0x613e5e(0x125)](..._0x139921['map'](([,_0x249360])=>{const _0x581629=_0x613e5e;try{const _0x57bb25=_0x249360===null||_0x249360===undefined?'':typeof _0x249360==='object'?JSON[_0x581629(0x145)](_0x249360):String(_0x249360),_0x4b11a7=_0x57bb25[_0x581629(0x12f)]('\x0a');return Math[_0x581629(0x125)](..._0x4b11a7[_0x581629(0x12e)](_0x313502=>_0x313502['length']),0x0);}catch{return 0x0;}}),0x14),_0x3929db=[];_0x3929db['push'](colorBorder('┌─'+'─'[_0x613e5e(0x142)](_0x123a32)+_0x613e5e(0x122)+'─'[_0x613e5e(0x142)](_0x5e7173)+'─┐',_0x17b3a5)),_0x139921[_0x613e5e(0x11e)](([_0x9a9938,_0x5409c6])=>{const _0x441b2d=_0x613e5e;let _0x50c1f4;try{_0x50c1f4=_0x5409c6===null||_0x5409c6===undefined?'':typeof _0x5409c6==='object'?JSON['stringify'](_0x5409c6):String(_0x5409c6);}catch{_0x50c1f4=_0x441b2d(0x11d);}const _0x1fd2fc=_0x9a9938['padEnd'](_0x123a32),_0x3b7c6b=_0x50c1f4[_0x441b2d(0x12f)]('\x0a');_0x3b7c6b[_0x441b2d(0x11e)]((_0x5ba8c3,_0x3d5086)=>{const _0x513463=_0x441b2d,_0x198c6a=colorBorder('│',_0x17b3a5);_0x3d5086===0x0?_0x3929db['push'](_0x198c6a+'\x20'+_0x1fd2fc+'\x20'+_0x198c6a+'\x20'+_0x5ba8c3['padEnd'](_0x5e7173)+'\x20'+_0x198c6a):_0x3929db[_0x513463(0x14b)](_0x198c6a+'\x20'+'\x20'[_0x513463(0x142)](_0x123a32)+'\x20'+_0x198c6a+'\x20'+_0x5ba8c3[_0x513463(0x123)](_0x5e7173)+'\x20'+_0x198c6a);});}),_0x3929db[_0x613e5e(0x14b)](colorBorder('└─'+'─'[_0x613e5e(0x142)](_0x123a32)+_0x613e5e(0x131)+'─'[_0x613e5e(0x142)](_0x5e7173)+'─┘',_0x17b3a5));_0x3349d4&&(_0x3929db[_0x613e5e(0x14b)](''),_0x3929db[_0x613e5e(0x14b)](String(a48_0x5329a6['yellow']['bold'](_0x613e5e(0x150)))),_0x3929db[_0x613e5e(0x14b)](_0x3349d4));_0x22ea63&&(_0x3929db[_0x613e5e(0x14b)](''),_0x3929db[_0x613e5e(0x14b)](String(a48_0x5329a6[_0x613e5e(0x12d)][_0x613e5e(0x151)](_0x613e5e(0x13f)))),_0x3929db[_0x613e5e(0x14b)](_0x22ea63));_0x52214f&&(_0x3929db[_0x613e5e(0x14b)](''),_0x3929db[_0x613e5e(0x14b)](String(a48_0x5329a6[_0x613e5e(0x149)][_0x613e5e(0x151)](_0x613e5e(0x128)))),_0x3929db[_0x613e5e(0x14b)](_0x52214f));if(_0x262786){if(_0x262786[_0x613e5e(0x14f)]){_0x3929db[_0x613e5e(0x14b)](''),_0x3929db['push'](String(a48_0x5329a6[_0x613e5e(0x114)][_0x613e5e(0x151)](_0x613e5e(0x119))));const _0x59f13b=_0x262786['stderr']['split']('\x0a');_0x59f13b[_0x613e5e(0x11e)](_0xa54a49=>{const _0x393caa=_0x613e5e;_0xa54a49[_0x393caa(0x13b)]()&&_0x3929db[_0x393caa(0x14b)](_0xa54a49);});}if(_0x262786[_0x613e5e(0x146)]){_0x3929db['push'](''),_0x3929db[_0x613e5e(0x14b)](String(a48_0x5329a6['cyan'][_0x613e5e(0x151)](_0x613e5e(0x144))));const _0x5d26f8=_0x262786[_0x613e5e(0x146)]['split']('\x0a');_0x5d26f8[_0x613e5e(0x11e)](_0x4a5260=>{const _0x58d942=_0x613e5e;_0x4a5260[_0x58d942(0x13b)]()&&_0x3929db[_0x58d942(0x14b)](_0x4a5260);});}}return _0x3929db[_0x613e5e(0x14a)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x5c2a73,_0x382095){const _0x9b2ccd=a48_0x42ae;if(_0x382095[_0x9b2ccd(0x133)]===_0x9b2ccd(0x120)){await handleSDKOutput([_0x5c2a73],_0x382095);return;}const _0x7793d0=resolveOutputOptions(_0x382095),_0x3f1281=await formatSingleObject(_0x5c2a73,_0x7793d0);await writeOutput(_0x3f1281,_0x7793d0['output']||undefined,_0x7793d0[_0x9b2ccd(0x133)]);}function a48_0x4a01(){const _0x25da79=['debug','2303409csIAZm','stderr','[query]','bold','spawn','string','color','pipe','list','sdk-result','FINISHED','stdout','isInteger','3MQCwAU','-FXRSn','less','stdin','red','resolve','noColor','rule','json','[error]','keys','entries','bigint','[Object]','forEach','close','table','410384LWrZgW','─┬─','padEnd','217YgYQSb','max','query','limit','[rule]','boolean','params','log','isTTY','blue','map','split','174374OZrjpF','─┴─','output','format','3074592FyxRLB','inherit','460etwIAr','tsv','error','filter','end','trim','write','164034zOVGdF','jsonl','[params]','varchar','length','repeat','double','[logs]','stringify','cmdout','3358835FJSktZ','3462774XwxSUQ','magenta','join','push','number'];a48_0x4a01=function(){return _0x25da79;};return a48_0x4a01();}
|
|
1
|
+
(function(_0x5d9691,_0x3dfbb6){const _0x50a2f0=a48_0x3619,_0x473bb1=_0x5d9691();while(!![]){try{const _0x3b0b04=-parseInt(_0x50a2f0(0x1fa))/0x1*(parseInt(_0x50a2f0(0x217))/0x2)+parseInt(_0x50a2f0(0x203))/0x3+parseInt(_0x50a2f0(0x1f9))/0x4+-parseInt(_0x50a2f0(0x1ff))/0x5+-parseInt(_0x50a2f0(0x1f7))/0x6*(parseInt(_0x50a2f0(0x1e7))/0x7)+-parseInt(_0x50a2f0(0x1f0))/0x8+-parseInt(_0x50a2f0(0x228))/0x9*(-parseInt(_0x50a2f0(0x225))/0xa);if(_0x3b0b04===_0x3dfbb6)break;else _0x473bb1['push'](_0x473bb1['shift']());}catch(_0x4bafe8){_0x473bb1['push'](_0x473bb1['shift']());}}}(a48_0x545c,0x80060));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a48_0x3619(_0x449206,_0x40f1fb){_0x449206=_0x449206-0x1e6;const _0x545c5a=a48_0x545c();let _0x361995=_0x545c5a[_0x449206];return _0x361995;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a48_0x530eb2 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1cc330){const _0x3faccc=a48_0x3619;return _0x1cc330[_0x3faccc(0x206)]===_0x3faccc(0x20f)||_0x1cc330[_0x3faccc(0x206)]==='jsonl'||_0x1cc330['format']===_0x3faccc(0x210)||_0x1cc330[_0x3faccc(0x206)]===_0x3faccc(0x209)||_0x1cc330['json']===!![]||_0x1cc330[_0x3faccc(0x21f)]===!![]||_0x1cc330['tsv']===!![]||_0x1cc330[_0x3faccc(0x209)]===!![];}export function parseOutputOptions(_0x47df49){const _0x13d141=a48_0x3619;return{'format':_0x47df49['format']||_0x13d141(0x209),'output':_0x47df49[_0x13d141(0x21d)]||'','limit':_0x47df49[_0x13d141(0x226)],'color':_0x47df49[_0x13d141(0x208)],'noColor':_0x47df49['noColor']};}function convertSDKResultToQueryResult(_0x421979){const _0x158bae=a48_0x3619,_0x26b754=[];if(_0x421979[_0x158bae(0x229)]>0x0){const _0x44d395=_0x421979[0x0];for(const [_0x6b0cdd,_0x128136]of Object[_0x158bae(0x205)](_0x44d395)){let _0x41a8bb='varchar';if(typeof _0x128136===_0x158bae(0x1fc))_0x41a8bb=Number['isInteger'](_0x128136)?'bigint':_0x158bae(0x20d);else{if(typeof _0x128136===_0x158bae(0x218))_0x41a8bb='boolean';else _0x128136===null&&(_0x41a8bb=_0x158bae(0x20b));}_0x26b754['push']({'name':_0x6b0cdd,'type':_0x41a8bb});}}return{'queryId':_0x158bae(0x219),'columns':_0x26b754,'data':_0x421979,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x421979['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x411f6c,_0x3cf290){const _0x13545a=convertSDKResultToQueryResult(_0x411f6c);return formatQueryOutput(_0x13545a,_0x3cf290);}export async function formatQueryOutput(_0x1bb8ba,_0xc0e5a2){const _0x256b52=a48_0x3619,{format:_0x33eec8,limit:_0x53c65c,output:_0x80c100,color:_0x3e4506,noColor:_0x3e81cf}=_0xc0e5a2,_0x16d5d6=Boolean(_0x80c100)&&!_0x3e4506,_0x12d80f={'color':_0x3e4506,'noColor':_0x3e81cf||_0x16d5d6};if(_0x33eec8==='table'){const _0x297c3f=shouldUseLess(_0x33eec8,_0x80c100);return formatAsTable(_0x1bb8ba,_0x53c65c,_0x297c3f,_0x12d80f);}else{if(_0x33eec8===_0x256b52(0x20f))return formatAsJSON(_0x1bb8ba,_0x12d80f);else return _0x33eec8===_0x256b52(0x21f)?formatAsJSONL(_0x1bb8ba,_0x12d80f):formatQueryResult(_0x1bb8ba,_0x33eec8);}}function shouldUseLess(_0x38ef59,_0xd24ad2){const _0x161b05=a48_0x3619;return(_0x38ef59===_0x161b05(0x209)||_0x38ef59===_0x161b05(0x224))&&process[_0x161b05(0x202)][_0x161b05(0x222)]&&!_0xd24ad2;}export function resolveOutputOptions(_0x159a60){const _0x2264f4=a48_0x3619,_0x138ac1=resolveOutputFormat(_0x159a60['format'],_0x159a60[_0x2264f4(0x21d)],_0x2264f4(0x209));let _0x5da469=typeof _0x159a60[_0x2264f4(0x226)]==='number'?_0x159a60[_0x2264f4(0x226)]:parseInt(_0x159a60[_0x2264f4(0x226)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x3157f2=_0x159a60[_0x2264f4(0x21d)]||'';return shouldUseLess(_0x138ac1,_0x3157f2)&&(_0x5da469=Infinity),{'format':_0x138ac1,'output':_0x3157f2,'limit':_0x5da469,'color':_0x159a60[_0x2264f4(0x208)],'noColor':_0x159a60[_0x2264f4(0x1ed)]};}function a48_0x545c(){const _0x716c5b=['push','isTTY','cmdout','list','3277190PoZnjD','limit','debug','36HAIvgs','length','rule','less','273xQrvgD','log','yellow','padEnd','stdin','keys','noColor','[Object]','bold','4650024zkEDTd','Results\x20saved\x20to\x20','filter','blue','end','stringify','spawn','63102jkKydx','[params]','1611640ULPigk','427678ktQvaX','No\x20data','number','pipe','─┴─','921015hSZmMG','join','[error]','stdout','1241685FKWGpc','trim','entries','format','split','color','table','inherit','varchar','max','double','red','json','tsv','resolve','object','stderr','close','forEach','repeat','2eTONTW','boolean','sdk-result','error','[query]','write','output','magenta','jsonl','map'];a48_0x545c=function(){return _0x716c5b;};return a48_0x545c();}export function writeOutput(_0x3dd3a4,_0x555d42,_0x44b73a){const _0xfa75d6=a48_0x3619;return _0x555d42?(writeFileSync(_0x555d42,_0x3dd3a4),console['error'](_0xfa75d6(0x1f1)+_0x555d42),Promise[_0xfa75d6(0x211)]()):shouldUseLess(_0x44b73a||'','')?new Promise(_0x384393=>{const _0x3920c2=_0xfa75d6,_0x3ee8f4=spawn(_0x3920c2(0x1e6),['-FXRSn'],{'stdio':[_0x3920c2(0x1fd),_0x3920c2(0x20a),'inherit']});let _0x1fc492=![];_0x3ee8f4['on']('error',()=>{!_0x1fc492&&(_0x1fc492=!![],console['log'](_0x3dd3a4),_0x384393());}),_0x3ee8f4['on'](_0x3920c2(0x214),()=>{!_0x1fc492&&(_0x1fc492=!![],_0x384393());}),_0x3ee8f4['on'](_0x3920c2(0x1f6),()=>{const _0x5ebb5b=_0x3920c2;!_0x1fc492&&_0x3ee8f4[_0x5ebb5b(0x1eb)]&&(_0x3ee8f4['stdin']['on'](_0x5ebb5b(0x21a),()=>{}),_0x3ee8f4[_0x5ebb5b(0x1eb)][_0x5ebb5b(0x21c)](_0x3dd3a4),_0x3ee8f4[_0x5ebb5b(0x1eb)][_0x5ebb5b(0x1f4)]());}),!_0x3ee8f4['stdin']&&(!_0x1fc492&&(_0x1fc492=!![],console[_0x3920c2(0x1e8)](_0x3dd3a4),_0x384393()));}):(console[_0xfa75d6(0x1e8)](_0x3dd3a4),Promise[_0xfa75d6(0x211)]());}export async function handleSDKOutput(_0x22f0ac,_0x5df2c2){const _0x3b8cd6=a48_0x3619,_0x3dc570=resolveOutputOptions(_0x5df2c2),_0x565aa4=await formatSDKOutput(_0x22f0ac,_0x3dc570);await writeOutput(_0x565aa4,_0x3dc570[_0x3b8cd6(0x21d)]||undefined,_0x3dc570['format']);}export async function handleQueryOutput(_0x479b95,_0x3cbc59){const _0x21c32f=a48_0x3619,_0x19cf32=resolveOutputOptions(_0x3cbc59),_0x133b55=await formatQueryOutput(_0x479b95,_0x19cf32);await writeOutput(_0x133b55,_0x19cf32[_0x21c32f(0x21d)]||undefined,_0x19cf32[_0x21c32f(0x206)]);}async function formatSingleObject(_0xeaad34,_0x56b197){const _0x4b26e1=a48_0x3619,{format:_0x5eefd9,color:_0x1b077e,noColor:_0x5eead2}=_0x56b197,_0x1b7766={'color':_0x1b077e,'noColor':_0x5eead2};if(_0x5eefd9===_0x4b26e1(0x20f)){if(shouldUseColor(_0x1b7766))return colorizeJSON(_0xeaad34,_0x1b7766);return JSON['stringify'](_0xeaad34,null,0x2);}else{if(_0x5eefd9===_0x4b26e1(0x21f)){if(shouldUseColor(_0x1b7766))return colorizeJSONCompact(_0xeaad34,_0x1b7766);return JSON[_0x4b26e1(0x1f5)](_0xeaad34);}else{if(_0x5eefd9===_0x4b26e1(0x210))return Object[_0x4b26e1(0x205)](_0xeaad34)[_0x4b26e1(0x220)](([_0x35bd30,_0x49aa2e])=>_0x35bd30+'\x09'+_0x49aa2e)[_0x4b26e1(0x200)]('\x0a');else{const _0x44eb46=Object[_0x4b26e1(0x205)](_0xeaad34);if(_0x44eb46[_0x4b26e1(0x229)]===0x0)return _0x4b26e1(0x1fb);const _0x310f87=_0xeaad34['debug'],_0x38dc67=_0xeaad34['query'],_0x12f103=_0xeaad34['params'],_0x385709=_0xeaad34['rule'],_0x51b6e8=_0x38dc67?typeof _0x38dc67==='string'?_0x38dc67:JSON[_0x4b26e1(0x1f5)](_0x38dc67,null,0x2):undefined,_0x405aee=_0x12f103&&Object[_0x4b26e1(0x1ec)](_0x12f103)[_0x4b26e1(0x229)]>0x0?JSON[_0x4b26e1(0x1f5)](_0x12f103,null,0x2):undefined,_0xc45e33=_0x385709&&Object[_0x4b26e1(0x1ec)](_0x385709)['length']>0x0?JSON[_0x4b26e1(0x1f5)](_0x385709,null,0x2):undefined,_0x2ef7ab=_0x44eb46[_0x4b26e1(0x1f2)](([_0xb00059])=>_0xb00059!==_0x4b26e1(0x227)&&_0xb00059!=='query'&&_0xb00059!=='params'&&_0xb00059!==_0x4b26e1(0x22a)),_0x11b557=Math[_0x4b26e1(0x20c)](..._0x2ef7ab['map'](([_0x5ed54b])=>_0x5ed54b[_0x4b26e1(0x229)])),_0x2fb5c1=Math['max'](..._0x2ef7ab[_0x4b26e1(0x220)](([,_0x4a2329])=>{const _0x17cfe1=_0x4b26e1;try{const _0x13e058=_0x4a2329===null||_0x4a2329===undefined?'':typeof _0x4a2329==='object'?JSON[_0x17cfe1(0x1f5)](_0x4a2329):String(_0x4a2329),_0x43144a=_0x13e058[_0x17cfe1(0x207)]('\x0a');return Math[_0x17cfe1(0x20c)](..._0x43144a[_0x17cfe1(0x220)](_0x74501c=>_0x74501c[_0x17cfe1(0x229)]),0x0);}catch{return 0x0;}}),0x14),_0xdc505c=[];_0xdc505c['push'](colorBorder('┌─'+'─'[_0x4b26e1(0x216)](_0x11b557)+'─┬─'+'─'[_0x4b26e1(0x216)](_0x2fb5c1)+'─┐',_0x1b7766)),_0x2ef7ab[_0x4b26e1(0x215)](([_0x8e29ce,_0x6371e4])=>{const _0x311ab0=_0x4b26e1;let _0x67b9c6;try{_0x67b9c6=_0x6371e4===null||_0x6371e4===undefined?'':typeof _0x6371e4===_0x311ab0(0x212)?JSON[_0x311ab0(0x1f5)](_0x6371e4):String(_0x6371e4);}catch{_0x67b9c6=_0x311ab0(0x1ee);}const _0x1bdf23=_0x8e29ce[_0x311ab0(0x1ea)](_0x11b557),_0x5b704f=_0x67b9c6['split']('\x0a');_0x5b704f[_0x311ab0(0x215)]((_0xc71323,_0x5e33c1)=>{const _0x3a597f=_0x311ab0,_0x72cffc=colorBorder('│',_0x1b7766);_0x5e33c1===0x0?_0xdc505c[_0x3a597f(0x221)](_0x72cffc+'\x20'+_0x1bdf23+'\x20'+_0x72cffc+'\x20'+_0xc71323[_0x3a597f(0x1ea)](_0x2fb5c1)+'\x20'+_0x72cffc):_0xdc505c['push'](_0x72cffc+'\x20'+'\x20'[_0x3a597f(0x216)](_0x11b557)+'\x20'+_0x72cffc+'\x20'+_0xc71323[_0x3a597f(0x1ea)](_0x2fb5c1)+'\x20'+_0x72cffc);});}),_0xdc505c[_0x4b26e1(0x221)](colorBorder('└─'+'─'[_0x4b26e1(0x216)](_0x11b557)+_0x4b26e1(0x1fe)+'─'[_0x4b26e1(0x216)](_0x2fb5c1)+'─┘',_0x1b7766));_0x51b6e8&&(_0xdc505c['push'](''),_0xdc505c['push'](String(a48_0x530eb2[_0x4b26e1(0x1e9)][_0x4b26e1(0x1ef)](_0x4b26e1(0x21b)))),_0xdc505c[_0x4b26e1(0x221)](_0x51b6e8));_0x405aee&&(_0xdc505c[_0x4b26e1(0x221)](''),_0xdc505c[_0x4b26e1(0x221)](String(a48_0x530eb2[_0x4b26e1(0x1f3)][_0x4b26e1(0x1ef)](_0x4b26e1(0x1f8)))),_0xdc505c[_0x4b26e1(0x221)](_0x405aee));_0xc45e33&&(_0xdc505c[_0x4b26e1(0x221)](''),_0xdc505c[_0x4b26e1(0x221)](String(a48_0x530eb2[_0x4b26e1(0x21e)]['bold']('[rule]'))),_0xdc505c[_0x4b26e1(0x221)](_0xc45e33));if(_0x310f87){if(_0x310f87['stderr']){_0xdc505c['push'](''),_0xdc505c[_0x4b26e1(0x221)](String(a48_0x530eb2[_0x4b26e1(0x20e)][_0x4b26e1(0x1ef)](_0x4b26e1(0x201))));const _0x2f9768=_0x310f87[_0x4b26e1(0x213)][_0x4b26e1(0x207)]('\x0a');_0x2f9768['forEach'](_0x1d0c78=>{const _0x470a3a=_0x4b26e1;_0x1d0c78[_0x470a3a(0x204)]()&&_0xdc505c[_0x470a3a(0x221)](_0x1d0c78);});}if(_0x310f87[_0x4b26e1(0x223)]){_0xdc505c['push'](''),_0xdc505c['push'](String(a48_0x530eb2['cyan']['bold']('[logs]')));const _0x3a96e2=_0x310f87[_0x4b26e1(0x223)][_0x4b26e1(0x207)]('\x0a');_0x3a96e2[_0x4b26e1(0x215)](_0x70239b=>{const _0x429099=_0x4b26e1;_0x70239b[_0x429099(0x204)]()&&_0xdc505c['push'](_0x70239b);});}}return _0xdc505c[_0x4b26e1(0x200)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x1dc3a7,_0x3f3b9e){const _0xb40dc2=a48_0x3619;if(_0x3f3b9e['format']==='table'){await handleSDKOutput([_0x1dc3a7],_0x3f3b9e);return;}const _0xe5b0a7=resolveOutputOptions(_0x3f3b9e),_0x5a7eb1=await formatSingleObject(_0x1dc3a7,_0xe5b0a7);await writeOutput(_0x5a7eb1,_0xe5b0a7[_0xb40dc2(0x21d)]||undefined,_0xe5b0a7[_0xb40dc2(0x206)]);}
|