@treasuredata/tdx 0.28.8 → 0.29.0
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.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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.d.ts +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.d.ts +33 -0
- package/dist/sdk/segment/segment-validator.d.ts.map +1 -0
- package/dist/sdk/segment/segment-validator.js +1 -0
- package/dist/sdk/segment/segment-validator.js.map +1 -0
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +5 -179
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.d.ts +259 -0
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/segment-schema.js +1 -0
- package/dist/sdk/segment/types/segment-schema.js.map +1 -0
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +27 -10
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +11 -2
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a45_0x21ea83=a45_0x3adb;(function(_0x49e88c,_0x18b12b){const _0x156c92=a45_0x3adb,_0x17d085=_0x49e88c();while(!![]){try{const _0x1dcc5c=parseInt(_0x156c92(0x1dc))/0x1+parseInt(_0x156c92(0x1d6))/0x2+-parseInt(_0x156c92(0x1ca))/0x3+-parseInt(_0x156c92(0x1ac))/0x4+parseInt(_0x156c92(0x19d))/0x5*(parseInt(_0x156c92(0x1db))/0x6)+-parseInt(_0x156c92(0x1e4))/0x7*(-parseInt(_0x156c92(0x19e))/0x8)+-parseInt(_0x156c92(0x1d5))/0x9*(parseInt(_0x156c92(0x1e6))/0xa);if(_0x1dcc5c===_0x18b12b)break;else _0x17d085['push'](_0x17d085['shift']());}catch(_0x38cd3d){_0x17d085['push'](_0x17d085['shift']());}}}(a45_0x4b39,0x699e5));import{BaseCommand}from'./command.js';import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a45_0x3adb(_0x4324ef,_0x4ea230){_0x4324ef=_0x4324ef-0x19d;const _0x4b3943=a45_0x4b39();let _0x3adb7b=_0x4b3943[_0x4324ef];return _0x3adb7b;}import{withSpinner}from'../utils/spinner.js';import a45_0x46408a from'chalk';import*as a45_0x26ede3 from'node:path';function a45_0x4b39(){const _0x4bf27a=['parent_segment','31050lPLTSc','136DIWwKP','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','default','validate','session','Session\x20profile\x20set\x20to:\x20','site','release_channel','resolveWorkspaceId','display','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','dim','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','1578392tBlKoB','(session:\x20','Session\x20context\x20','Error:\x20Profile\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','tdx','next','clear','use','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','engage_workspace','.\x20Must\x20be\x20one\x20of:\x20','Session\x20llm_project\x20set\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','\x0aSaved\x20to:\x20','\x27\x20does\x20not\x20exist','Session\x20engage_workspace\x20set\x20to:\x20','error','Session\x20database\x20set\x20to:\x20','Default\x20site\x20set\x20to:\x20','Verifying\x20workspace\x20\x27','length','llm_agent','\x27\x20to\x20save\x20permanently','stable','cleared','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','Release\x20channel\x20set\x20to:\x20','1481205aSFHQc','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','join','\x27...','message','profile','displayWithSources','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','Default\x20profile\x20set\x20to:\x20','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','green','522FODEDY','1138470CqRRUF','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','execute','log','Session\x20parent_segment\x20set\x20to:\x20','36aJoJIG','690787WWPbNI','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','Invalid\x20release\x20channel:\x20','debug','llm_project','Session\x20agent\x20set\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','157934IIHdVO','Session\x20site\x20set\x20to:\x20','62050uDxzWR','code','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','database','agent','tdx.json','name','engage'];a45_0x4b39=function(){return _0x4bf27a;};return a45_0x4b39();}export class UseCommand extends BaseCommand{[a45_0x21ea83(0x1ec)]=a45_0x21ea83(0x1b6);['description']='Set\x20session-level\x20context';[a45_0x21ea83(0x1a1)](_0x12bd7c){const _0x56b353=a45_0x21ea83,{args:_0x2dd755,options:_0x2df202}=_0x12bd7c,_0x1ecb7a=_0x2df202[_0x56b353(0x1a0)];if(_0x2dd755['length']===0x0)return undefined;if(_0x2dd755[_0x56b353(0x1c3)]===0x1)return _0x56b353(0x1e8)+_0x56b353(0x1b0)+_0x56b353(0x1bb)+_0x56b353(0x1e3)+_0x56b353(0x1de)+_0x56b353(0x1ab)+_0x56b353(0x1b7)+_0x56b353(0x1b1);const _0x1f6e6c=_0x2dd755[0x0],_0x3391ad=[_0x56b353(0x1a4),_0x56b353(0x1e9),_0x56b353(0x1ee),'llm_project',_0x56b353(0x1ea),_0x56b353(0x1cf),_0x56b353(0x1b8),_0x56b353(0x1a5)];if(!_0x3391ad['includes'](_0x1f6e6c))return'Invalid\x20resource:\x20'+_0x1f6e6c+_0x56b353(0x1b9)+_0x3391ad[_0x56b353(0x1cc)](',\x20');if(_0x1ecb7a&&_0x1f6e6c!==_0x56b353(0x1a4)&&_0x1f6e6c!==_0x56b353(0x1cf)&&_0x1f6e6c!==_0x56b353(0x1a5))return _0x56b353(0x1b2);if(_0x1f6e6c===_0x56b353(0x1a5)&&!_0x1ecb7a)return'release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>';if(_0x1f6e6c===_0x56b353(0x1a5)){const _0x37f2ba=_0x2dd755[0x1];if(_0x37f2ba!==_0x56b353(0x1c6)&&_0x37f2ba!==_0x56b353(0x1b4))return _0x56b353(0x1df)+_0x37f2ba+_0x56b353(0x1d7);}return undefined;}async[a45_0x21ea83(0x1d8)](_0x57c918){const _0x45a75f=a45_0x21ea83,{args:_0x2a7327,options:_0x1d5d19}=_0x57c918,_0x1e3a5c=_0x1d5d19[_0x45a75f(0x1e0)],_0x37b41f=_0x1d5d19[_0x45a75f(0x1b5)],_0xe1a417=_0x1d5d19[_0x45a75f(0x1a0)];cleanExpiredSessions();try{if(_0x37b41f){clearSessionContext(_0x1d5d19[_0x45a75f(0x1a2)]);const _0x1a1e43=getSessionID(_0x1d5d19[_0x45a75f(0x1a2)]);return console[_0x45a75f(0x1d9)](_0x45a75f(0x1ae)+a45_0x46408a[_0x45a75f(0x1d4)](_0x45a75f(0x1c7))+'\x20'+a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1ad)+_0x1a1e43+')')),0x0;}if(_0x2a7327['length']===0x0){const _0x290830=new GlobalContext(_0x1d5d19);return _0x1e3a5c?_0x290830[_0x45a75f(0x1d0)]():_0x290830[_0x45a75f(0x1a7)](),console[_0x45a75f(0x1d9)](a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1dd))),console['log'](a45_0x46408a[_0x45a75f(0x1a9)]('Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel')),console[_0x45a75f(0x1d9)](a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1cb))),0x0;}const _0xf55ee5=_0x2a7327[0x0],_0x464bb0=_0x2a7327[0x1],_0x13e3a0=a45_0x26ede3[_0x45a75f(0x1cc)](getConfigDir(),_0x45a75f(0x1eb));if(_0xe1a417){if(_0xf55ee5===_0x45a75f(0x1a4))return saveDefaultSiteToUserConfig(_0x464bb0),console['log'](_0x45a75f(0x1c1)+a45_0x46408a[_0x45a75f(0x1d4)](_0x464bb0)),console[_0x45a75f(0x1d9)](a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1bc)+_0x13e3a0)),0x0;if(_0xf55ee5===_0x45a75f(0x1cf)){if(!profileExists(_0x464bb0))return console[_0x45a75f(0x1bf)](_0x45a75f(0x1af)+_0x464bb0+'\x27\x20does\x20not\x20exist'),console[_0x45a75f(0x1bf)](_0x45a75f(0x1a8)),0x1;return saveActiveProfileToUserConfig(_0x464bb0),console[_0x45a75f(0x1d9)](_0x45a75f(0x1d2)+a45_0x46408a[_0x45a75f(0x1d4)](_0x464bb0)),console[_0x45a75f(0x1d9)](a45_0x46408a[_0x45a75f(0x1a9)]('\x0aSaved\x20to:\x20'+_0x13e3a0)),0x0;}if(_0xf55ee5===_0x45a75f(0x1a5))return saveReleaseChannel(_0x464bb0),console[_0x45a75f(0x1d9)](_0x45a75f(0x1c9)+a45_0x46408a['green'](_0x464bb0)),console[_0x45a75f(0x1d9)](a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1bc)+_0x13e3a0)),_0x464bb0==='next'?(console[_0x45a75f(0x1d9)](a45_0x46408a[_0x45a75f(0x1a9)]('\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.')),console['log'](a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1c8)))):console['log'](a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1d3))),0x0;}if(_0xf55ee5===_0x45a75f(0x1a4)){const _0x577b66=getSessionID(_0x1d5d19[_0x45a75f(0x1a2)]);return saveSessionContext({'site':_0x464bb0},_0x1d5d19[_0x45a75f(0x1a2)]),console[_0x45a75f(0x1d9)](_0x45a75f(0x1e5)+a45_0x46408a[_0x45a75f(0x1d4)](_0x464bb0)+'\x20'+a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1ad)+_0x577b66+')')),console[_0x45a75f(0x1d9)](a45_0x46408a['dim'](_0x45a75f(0x1d1)+_0x464bb0+_0x45a75f(0x1c5))),0x0;}if(_0xf55ee5==='profile'){if(!profileExists(_0x464bb0))return console[_0x45a75f(0x1bf)](_0x45a75f(0x1af)+_0x464bb0+_0x45a75f(0x1bd)),console[_0x45a75f(0x1bf)](_0x45a75f(0x1a8)),0x1;const _0x2b29ba=getSessionID(_0x1d5d19['session']);return saveSessionContext({'profile':_0x464bb0},_0x1d5d19['session']),console['log'](_0x45a75f(0x1a3)+a45_0x46408a[_0x45a75f(0x1d4)](_0x464bb0)+'\x20'+a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1ad)+_0x2b29ba+')')),console[_0x45a75f(0x1d9)](a45_0x46408a[_0x45a75f(0x1a9)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20'+_0x464bb0+_0x45a75f(0x1c5))),0x0;}const _0x52bd8f={},_0x1f1ce2=getSessionID(_0x1d5d19['session']);switch(_0xf55ee5){case _0x45a75f(0x1e9):_0x52bd8f['database']=_0x464bb0,console[_0x45a75f(0x1d9)](_0x45a75f(0x1c0)+a45_0x46408a['green'](_0x464bb0)+'\x20'+a45_0x46408a['dim']('(session:\x20'+_0x1f1ce2+')'));break;case _0x45a75f(0x1ee):_0x52bd8f[_0x45a75f(0x1ee)]=_0x464bb0,console[_0x45a75f(0x1d9)](_0x45a75f(0x1da)+a45_0x46408a[_0x45a75f(0x1d4)](_0x464bb0)+'\x20'+a45_0x46408a['dim']('(session:\x20'+_0x1f1ce2+')'));break;case _0x45a75f(0x1e1):_0x52bd8f[_0x45a75f(0x1e1)]=_0x464bb0,console[_0x45a75f(0x1d9)](_0x45a75f(0x1ba)+a45_0x46408a[_0x45a75f(0x1d4)](_0x464bb0)+'\x20'+a45_0x46408a[_0x45a75f(0x1a9)]('(session:\x20'+_0x1f1ce2+')'));break;case _0x45a75f(0x1ea):{const {projectName:_0xd57192,agentName:_0x5af20b}=parseAgentRef(_0x464bb0);_0x5af20b?(_0x52bd8f['llm_project']=_0xd57192,_0x52bd8f[_0x45a75f(0x1c4)]=_0x5af20b,console[_0x45a75f(0x1d9)](_0x45a75f(0x1ba)+a45_0x46408a[_0x45a75f(0x1d4)](_0xd57192)+'\x20'+a45_0x46408a[_0x45a75f(0x1a9)]('(session:\x20'+_0x1f1ce2+')')),console[_0x45a75f(0x1d9)](_0x45a75f(0x1e2)+a45_0x46408a[_0x45a75f(0x1d4)](_0x5af20b)+'\x20'+a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1ad)+_0x1f1ce2+')'))):(_0x52bd8f['llm_agent']=_0x464bb0,console['log'](_0x45a75f(0x1e2)+a45_0x46408a[_0x45a75f(0x1d4)](_0x464bb0)+'\x20'+a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x1ad)+_0x1f1ce2+')')));break;}case'engage_workspace':{try{await withSpinner(_0x45a75f(0x1c2)+_0x464bb0+_0x45a75f(0x1cd),()=>_0x57c918[_0x45a75f(0x1b3)][_0x45a75f(0x1ed)][_0x45a75f(0x1a6)](_0x464bb0));}catch(_0x261675){if(_0x261675 instanceof SDKError&&(_0x261675[_0x45a75f(0x1e7)]===ErrorCode['NOT_FOUND']||_0x261675['code']===ErrorCode['INVALID_ARGUMENT']))return console['error']('Error:\x20'+_0x261675[_0x45a75f(0x1ce)]),console[_0x45a75f(0x1bf)](_0x45a75f(0x1aa)),0x1;throw _0x261675;}_0x52bd8f['engage_workspace']=_0x464bb0,console[_0x45a75f(0x1d9)](_0x45a75f(0x1be)+a45_0x46408a[_0x45a75f(0x1d4)](_0x464bb0)+'\x20'+a45_0x46408a['dim'](_0x45a75f(0x1ad)+_0x1f1ce2+')'));break;}}return saveSessionContext(_0x52bd8f,_0x1d5d19[_0x45a75f(0x1a2)]),console['log'](a45_0x46408a[_0x45a75f(0x1a9)](_0x45a75f(0x19f))),0x0;}catch(_0x47e56d){return _0x47e56d instanceof Error&&console['error']('Error:\x20'+_0x47e56d['message']),0x1;}}}
|
|
1
|
+
const a45_0x1786e1=a45_0x5e43;(function(_0x1c095b,_0x5ed9e1){const _0x11af8b=a45_0x5e43,_0x5aa81b=_0x1c095b();while(!![]){try{const _0x226455=-parseInt(_0x11af8b(0x118))/0x1+-parseInt(_0x11af8b(0x10b))/0x2*(-parseInt(_0x11af8b(0xf1))/0x3)+parseInt(_0x11af8b(0x105))/0x4+parseInt(_0x11af8b(0x125))/0x5+parseInt(_0x11af8b(0xf3))/0x6+-parseInt(_0x11af8b(0x100))/0x7+parseInt(_0x11af8b(0x114))/0x8*(parseInt(_0x11af8b(0xf6))/0x9);if(_0x226455===_0x5ed9e1)break;else _0x5aa81b['push'](_0x5aa81b['shift']());}catch(_0x2d9469){_0x5aa81b['push'](_0x5aa81b['shift']());}}}(a45_0x3e84,0x2e017));import{BaseCommand}from'./command.js';import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';function a45_0x5e43(_0x438bbd,_0x4e72e7){_0x438bbd=_0x438bbd-0xef;const _0x3e84e2=a45_0x3e84();let _0x5e431c=_0x3e84e2[_0x438bbd];return _0x5e431c;}import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a45_0x2050aa from'chalk';import*as a45_0x2c6348 from'node:path';function a45_0x3e84(){const _0x26be62=['\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','1766DzCUJP','displayWithSources','Session\x20llm_project\x20set\x20to:\x20','tdx.json','stable','engage','llm_project','default','Session\x20site\x20set\x20to:\x20','8dDXQpk','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','message','llm_agent','33937ctibPE','database','cleared','parent_segment','code','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','site','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','Set\x20session-level\x20context','361310DqhVMQ','Session\x20parent_segment\x20set\x20to:\x20','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel\x0a','Session\x20agent\x20set\x20to:\x20','Error:\x20','profile','length','\x27\x20does\x20not\x20exist','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','\x0aSaved\x20to:\x20','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','Error:\x20Profile\x20\x27','INVALID_ARGUMENT','use','Session\x20database\x20set\x20to:\x20','tdx','Default\x20site\x20set\x20to:\x20','engage_workspace','(session:\x20','next','session','includes','description','resolveWorkspaceId','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','name','141vREVMP','validate','420690kiEefQ','Session\x20context\x20','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','1674477ZHuVEq','join','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','release_channel','dim','error','display','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Invalid\x20resource:\x20','agent','1826279eEIdsU','Release\x20channel\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','clear','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','453368mzKgKI','log','Default\x20profile\x20set\x20to:\x20','Session\x20profile\x20set\x20to:\x20','execute'];a45_0x3e84=function(){return _0x26be62;};return a45_0x3e84();}export class UseCommand extends BaseCommand{[a45_0x1786e1(0xf0)]=a45_0x1786e1(0x132);[a45_0x1786e1(0x13b)]=a45_0x1786e1(0x124);[a45_0x1786e1(0xf2)](_0x1f479c){const _0x50f79a=a45_0x1786e1,{args:_0x4c8e4d,options:_0x51c968}=_0x1f479c,_0x1939c0=_0x51c968[_0x50f79a(0x112)];if(_0x4c8e4d['length']===0x0)return undefined;if(_0x4c8e4d[_0x50f79a(0x12b)]===0x1)return _0x50f79a(0x11f)+_0x50f79a(0x10a)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x50f79a(0x11e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a'+_0x50f79a(0x127)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x3ed1cc=_0x4c8e4d[0x0],_0x2b068d=[_0x50f79a(0x122),_0x50f79a(0x119),_0x50f79a(0x11b),_0x50f79a(0x111),_0x50f79a(0xff),'profile',_0x50f79a(0x136),_0x50f79a(0xf9)];if(!_0x2b068d[_0x50f79a(0x13a)](_0x3ed1cc))return _0x50f79a(0xfe)+_0x3ed1cc+_0x50f79a(0x102)+_0x2b068d[_0x50f79a(0xf7)](',\x20');if(_0x1939c0&&_0x3ed1cc!=='site'&&_0x3ed1cc!==_0x50f79a(0x12a)&&_0x3ed1cc!==_0x50f79a(0xf9))return _0x50f79a(0x120);if(_0x3ed1cc==='release_channel'&&!_0x1939c0)return _0x50f79a(0xf8);if(_0x3ed1cc===_0x50f79a(0xf9)){const _0x2cb3b0=_0x4c8e4d[0x1];if(_0x2cb3b0!==_0x50f79a(0x10f)&&_0x2cb3b0!==_0x50f79a(0x138))return'Invalid\x20release\x20channel:\x20'+_0x2cb3b0+'.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.';}return undefined;}async[a45_0x1786e1(0x109)](_0x5f02d8){const _0x164376=a45_0x1786e1,{args:_0x410e20,options:_0x5b82ff}=_0x5f02d8,_0xfe258a=_0x5b82ff['debug'],_0x4db637=_0x5b82ff[_0x164376(0x103)],_0xd10b32=_0x5b82ff['default'];cleanExpiredSessions();try{if(_0x4db637){clearSessionContext(_0x5b82ff[_0x164376(0x139)]);const _0xa0d3de=getSessionID(_0x5b82ff[_0x164376(0x139)]);return console[_0x164376(0x106)](_0x164376(0xf4)+a45_0x2050aa[_0x164376(0x11d)](_0x164376(0x11a))+'\x20'+a45_0x2050aa['dim']('(session:\x20'+_0xa0d3de+')')),0x0;}if(_0x410e20[_0x164376(0x12b)]===0x0){const _0x103a6b=new GlobalContext(_0x5b82ff);return _0xfe258a?_0x103a6b[_0x164376(0x10c)]():_0x103a6b[_0x164376(0xfc)](),console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x123))),console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x115))),console[_0x164376(0x106)](a45_0x2050aa['dim'](_0x164376(0x104))),0x0;}const _0x148db0=_0x410e20[0x0],_0x3ddd69=_0x410e20[0x1],_0x4e5388=a45_0x2c6348[_0x164376(0xf7)](getConfigDir(),_0x164376(0x10e));if(_0xd10b32){if(_0x148db0===_0x164376(0x122))return saveDefaultSiteToUserConfig(_0x3ddd69),console[_0x164376(0x106)](_0x164376(0x135)+a45_0x2050aa[_0x164376(0x11d)](_0x3ddd69)),console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x12e)+_0x4e5388)),0x0;if(_0x148db0==='profile'){if(!profileExists(_0x3ddd69))return console['error'](_0x164376(0x130)+_0x3ddd69+_0x164376(0x12c)),console[_0x164376(0xfb)](_0x164376(0xef)),0x1;return saveActiveProfileToUserConfig(_0x3ddd69),console[_0x164376(0x106)](_0x164376(0x107)+a45_0x2050aa[_0x164376(0x11d)](_0x3ddd69)),console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x12e)+_0x4e5388)),0x0;}if(_0x148db0===_0x164376(0xf9))return saveReleaseChannel(_0x3ddd69),console[_0x164376(0x106)](_0x164376(0x101)+a45_0x2050aa['green'](_0x3ddd69)),console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x12e)+_0x4e5388)),_0x3ddd69===_0x164376(0x138)?(console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0xf5))),console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x121)))):console['log'](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x12f))),0x0;}if(_0x148db0===_0x164376(0x122)){const _0x3de402=getSessionID(_0x5b82ff[_0x164376(0x139)]);return saveSessionContext({'site':_0x3ddd69},_0x5b82ff[_0x164376(0x139)]),console[_0x164376(0x106)](_0x164376(0x113)+a45_0x2050aa[_0x164376(0x11d)](_0x3ddd69)+'\x20'+a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x137)+_0x3de402+')')),console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0x3ddd69+'\x27\x20to\x20save\x20permanently')),0x0;}if(_0x148db0===_0x164376(0x12a)){if(!profileExists(_0x3ddd69))return console[_0x164376(0xfb)]('Error:\x20Profile\x20\x27'+_0x3ddd69+'\x27\x20does\x20not\x20exist'),console[_0x164376(0xfb)](_0x164376(0xef)),0x1;const _0x94e0a7=getSessionID(_0x5b82ff[_0x164376(0x139)]);return saveSessionContext({'profile':_0x3ddd69},_0x5b82ff[_0x164376(0x139)]),console['log'](_0x164376(0x108)+a45_0x2050aa[_0x164376(0x11d)](_0x3ddd69)+'\x20'+a45_0x2050aa['dim'](_0x164376(0x137)+_0x94e0a7+')')),console[_0x164376(0x106)](a45_0x2050aa[_0x164376(0xfa)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20'+_0x3ddd69+'\x27\x20to\x20save\x20permanently')),0x0;}const _0x2c3f6f={},_0xaaafbc=getSessionID(_0x5b82ff[_0x164376(0x139)]);switch(_0x148db0){case _0x164376(0x119):_0x2c3f6f[_0x164376(0x119)]=_0x3ddd69,console['log'](_0x164376(0x133)+a45_0x2050aa[_0x164376(0x11d)](_0x3ddd69)+'\x20'+a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x137)+_0xaaafbc+')'));break;case'parent_segment':_0x2c3f6f['parent_segment']=_0x3ddd69,console[_0x164376(0x106)](_0x164376(0x126)+a45_0x2050aa['green'](_0x3ddd69)+'\x20'+a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x137)+_0xaaafbc+')'));break;case'llm_project':_0x2c3f6f[_0x164376(0x111)]=_0x3ddd69,console[_0x164376(0x106)]('Session\x20llm_project\x20set\x20to:\x20'+a45_0x2050aa[_0x164376(0x11d)](_0x3ddd69)+'\x20'+a45_0x2050aa['dim'](_0x164376(0x137)+_0xaaafbc+')'));break;case _0x164376(0xff):{const {projectName:_0xe22122,agentName:_0x5a64e3}=parseAgentRef(_0x3ddd69);_0x5a64e3?(_0x2c3f6f[_0x164376(0x111)]=_0xe22122,_0x2c3f6f[_0x164376(0x117)]=_0x5a64e3,console['log'](_0x164376(0x10d)+a45_0x2050aa[_0x164376(0x11d)](_0xe22122)+'\x20'+a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x137)+_0xaaafbc+')')),console[_0x164376(0x106)](_0x164376(0x128)+a45_0x2050aa[_0x164376(0x11d)](_0x5a64e3)+'\x20'+a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x137)+_0xaaafbc+')'))):(_0x2c3f6f['llm_agent']=_0x3ddd69,console[_0x164376(0x106)](_0x164376(0x128)+a45_0x2050aa['green'](_0x3ddd69)+'\x20'+a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x137)+_0xaaafbc+')')));break;}case'engage_workspace':{try{await withSpinner('Verifying\x20workspace\x20\x27'+_0x3ddd69+'\x27...',()=>_0x5f02d8[_0x164376(0x134)][_0x164376(0x110)][_0x164376(0x13c)](_0x3ddd69));}catch(_0x18749f){if(_0x18749f instanceof SDKError&&(_0x18749f['code']===ErrorCode['NOT_FOUND']||_0x18749f[_0x164376(0x11c)]===ErrorCode[_0x164376(0x131)]))return console[_0x164376(0xfb)]('Error:\x20'+_0x18749f[_0x164376(0x116)]),console['error'](_0x164376(0x12d)),0x1;throw _0x18749f;}_0x2c3f6f['engage_workspace']=_0x3ddd69,console['log']('Session\x20engage_workspace\x20set\x20to:\x20'+a45_0x2050aa['green'](_0x3ddd69)+'\x20'+a45_0x2050aa[_0x164376(0xfa)](_0x164376(0x137)+_0xaaafbc+')'));break;}}return saveSessionContext(_0x2c3f6f,_0x5b82ff[_0x164376(0x139)]),console['log'](a45_0x2050aa[_0x164376(0xfa)](_0x164376(0xfd))),0x0;}catch(_0x13059b){return _0x13059b instanceof Error&&console[_0x164376(0xfb)](_0x164376(0x129)+_0x13059b[_0x164376(0x116)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a46_0x58d9(){const _0x54b55c=['\x20\x20Cause:\x20','4420WcmOWM','Error:\x20','Fetching\x20user\x20info...','65799tUItLJ','790146TZFptD','description','26034450vqJElp','List\x20all\x20users\x20in\x20the\x20account','name','message','1960758DsAbXU','execute','✔\x20Found\x20','cause','Listing\x20users...','16vImkUO','length','585447JfzdaV','2094rPSRDM','user','data','getCurrent','3069964AXrhvK','\x20user','Show\x20current\x20user\x20information','error','50zbwXUO','verbose'];a46_0x58d9=function(){return _0x54b55c;};return a46_0x58d9();}const a46_0x26f572=a46_0x1c9a;(function(_0x51fe50,_0x46be13){const _0x4f8b84=a46_0x1c9a,_0x2138bd=_0x51fe50();while(!![]){try{const _0x19cc74=-parseInt(_0x4f8b84(0x12b))/0x1+parseInt(_0x4f8b84(0x134))/0x2*(-parseInt(_0x4f8b84(0x11d))/0x3)+-parseInt(_0x4f8b84(0x130))/0x4+parseInt(_0x4f8b84(0x11a))/0x5*(-parseInt(_0x4f8b84(0x12c))/0x6)+-parseInt(_0x4f8b84(0x11e))/0x7*(parseInt(_0x4f8b84(0x129))/0x8)+parseInt(_0x4f8b84(0x124))/0x9+parseInt(_0x4f8b84(0x120))/0xa;if(_0x19cc74===_0x46be13)break;else _0x2138bd['push'](_0x2138bd['shift']());}catch(_0x58274e){_0x2138bd['push'](_0x2138bd['shift']());}}}(a46_0x58d9,0x5e2ec));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a46_0x1c9a(_0x2c9072,_0x4e26ae){_0x2c9072=_0x2c9072-0x118;const _0x58d96b=a46_0x58d9();let _0x1c9a0a=_0x58d96b[_0x2c9072];return _0x1c9a0a;}export class UserCommand extends BaseCommand{['name']='user';[a46_0x26f572(0x11f)]=a46_0x26f572(0x132);async[a46_0x26f572(0x125)](_0x1b4978){const _0x1f9361=a46_0x26f572,{options:_0x5a1e8c,tdx:_0x24cc89}=_0x1b4978;try{const _0x5585b8=await withSpinner(_0x1f9361(0x11c),()=>_0x24cc89[_0x1f9361(0x12d)][_0x1f9361(0x12f)](),{'verbose':_0x5a1e8c['verbose']}),_0x98aad6=_0x5585b8[_0x1f9361(0x12e)];return await handleSingleObjectOutput(_0x98aad6,_0x5a1e8c),0x0;}catch(_0x25dc4a){if(_0x25dc4a instanceof SDKError)return console[_0x1f9361(0x133)](_0x1f9361(0x11b)+_0x25dc4a[_0x1f9361(0x123)]),_0x25dc4a[_0x1f9361(0x127)]&&console[_0x1f9361(0x133)](_0x1f9361(0x119)+_0x25dc4a[_0x1f9361(0x127)]),0x1;throw _0x25dc4a;}}}export class UserListCommand extends BaseCommand{[a46_0x26f572(0x122)]='user\x20list';[a46_0x26f572(0x11f)]=a46_0x26f572(0x121);async[a46_0x26f572(0x125)](_0x48e74f){const _0x3efa8c=a46_0x26f572,{options:_0x52b432,tdx:_0x10008f}=_0x48e74f;try{const _0x428930=await withSpinner(_0x3efa8c(0x128),()=>_0x10008f['user']['list'](),{'verbose':_0x52b432[_0x3efa8c(0x118)]}),_0x4e04b4=_0x428930[_0x3efa8c(0x12e)];return console['error'](_0x3efa8c(0x126)+_0x4e04b4[_0x3efa8c(0x12a)]+_0x3efa8c(0x131)+(_0x4e04b4[_0x3efa8c(0x12a)]!==0x1?'s':'')),await handleSDKOutput(_0x4e04b4,_0x52b432),0x0;}catch(_0x3a8e23){if(_0x3a8e23 instanceof SDKError)return console['error'](_0x3efa8c(0x11b)+_0x3a8e23['message']),_0x3a8e23[_0x3efa8c(0x127)]&&console['error'](_0x3efa8c(0x119)+_0x3a8e23[_0x3efa8c(0x127)]),0x1;throw _0x3a8e23;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a47_0x2c35ad=a47_0xe19c;(function(_0x4b8556,_0x30bb8d){const _0x4a52e5=a47_0xe19c,_0x50b824=_0x4b8556();while(!![]){try{const _0xd86a0=parseInt(_0x4a52e5(0xb8))/0x1+parseInt(_0x4a52e5(0x1e0))/0x2*(-parseInt(_0x4a52e5(0x236))/0x3)+-parseInt(_0x4a52e5(0xc1))/0x4*(parseInt(_0x4a52e5(0x163))/0x5)+-parseInt(_0x4a52e5(0x211))/0x6+-parseInt(_0x4a52e5(0xe4))/0x7+parseInt(_0x4a52e5(0x19f))/0x8+parseInt(_0x4a52e5(0x1fa))/0x9;if(_0xd86a0===_0x30bb8d)break;else _0x50b824['push'](_0x50b824['shift']());}catch(_0x1a458f){_0x50b824['push'](_0x50b824['shift']());}}}(a47_0x508d,0xc8441));import a47_0x351cd8 from'chalk';import{existsSync}from'fs';import a47_0x50b226 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a47_0x27490a from'prompts';function getAttemptStatusDisplay(_0x39e594){const _0x2e0143=a47_0xe19c;if(!_0x39e594)return{'icon':'⏳','text':''};const {done:_0x4c3f36,success:_0x4797a1,cancelRequested:_0x4e8f29}=_0x39e594;if(!_0x4c3f36)return _0x4e8f29?{'icon':'🛑','text':a47_0x351cd8['yellow']('canceling')}:{'icon':'🔄','text':a47_0x351cd8['blue']('running')};if(_0x4797a1)return{'icon':'✅','text':a47_0x351cd8[_0x2e0143(0x12b)]('success')};return{'icon':'❌','text':a47_0x351cd8[_0x2e0143(0x1bb)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a47_0x2c35ad(0x116)](_0x4a2396,_0x4f5d2f,_0x892782=0x0){const _0x22972b=a47_0x2c35ad;return _0x4a2396[_0x892782]||_0x4f5d2f[_0x22972b(0xe6)];}[a47_0x2c35ad(0x1fe)](_0x285d45,_0x420dab,_0x6e3967=0x0){const _0x34ca64=a47_0x2c35ad,_0x3bdad5=this[_0x34ca64(0x116)](_0x285d45,_0x420dab,_0x6e3967);if(!_0x3bdad5)return console['error'](a47_0x351cd8[_0x34ca64(0x1bb)](_0x34ca64(0x1de)),_0x34ca64(0x14c)),console[_0x34ca64(0xfb)](a47_0x351cd8['dim'](_0x34ca64(0xdd))),null;return _0x3bdad5;}['parseProjectWorkflowPattern'](_0x494e90,_0x43a6d5){const _0x2a291b=a47_0x2c35ad;if(_0x494e90[0x0]){const _0x405c9e=_0x494e90[0x0][_0x2a291b(0x1b9)]('.');if(_0x405c9e[_0x2a291b(0x21f)]===0x1)return{'projectName':_0x405c9e[0x0],'workflowName':undefined};else return _0x405c9e[_0x2a291b(0x21f)]===0x2?{'projectName':_0x405c9e[0x0],'workflowName':_0x405c9e[0x1]}:(console[_0x2a291b(0xfb)](a47_0x351cd8[_0x2a291b(0x1bb)](_0x2a291b(0x1de)),_0x2a291b(0x216)),null);}return{'projectName':_0x43a6d5[_0x2a291b(0xe6)],'workflowName':undefined};}[a47_0x2c35ad(0x1af)](_0x38aac1,_0x4b961e,_0x4a90a7=0x0){const _0x49797c=a47_0x2c35ad;if(_0x38aac1[_0x4a90a7])return _0x38aac1[_0x4a90a7];if(_0x4b961e['workflowProject']){const _0x59ebc9=a47_0x50b226['join'](process[_0x49797c(0x196)](),_0x49797c(0x20f),_0x4b961e['workflowProject']);if(existsSync(a47_0x50b226[_0x49797c(0x110)](_0x59ebc9,_0x49797c(0x19a))))return _0x59ebc9;}return undefined;}async[a47_0x2c35ad(0x194)](_0x9a6598,_0x33f817,_0x181355){const _0x410ac6=a47_0x2c35ad;try{const _0x181a06=await _0x9a6598[_0x410ac6(0xce)][_0x410ac6(0x20f)](_0x33f817,{'limit':0x1});if(_0x181a06[_0x410ac6(0x21f)]>0x0){const _0x259671=_0x181a06[0x0]['id'],_0xf276db=getWorkflowUrl(_0x181355,_0x259671);console[_0x410ac6(0xfb)](_0x410ac6(0x191)+a47_0x351cd8[_0x410ac6(0x19d)](_0xf276db));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';['description']=a47_0x2c35ad(0x19b);async[a47_0x2c35ad(0x243)](_0x9bdb61){const _0x2c836e=a47_0x2c35ad,{options:_0x43c904,args:_0x16aa2c,tdx:_0x1964bb}=_0x9bdb61,_0x22e2c1=_0x16aa2c[0x0],_0x1f5a61=_0x43c904[_0x2c836e(0x1d0)];if(_0x1f5a61)return saveSessionContext({'workflow_project':undefined},_0x43c904[_0x2c836e(0x23d)]),console[_0x2c836e(0xda)](a47_0x351cd8[_0x2c836e(0x12b)](_0x2c836e(0x1e8))),0x0;if(!_0x22e2c1)return console['error'](a47_0x351cd8[_0x2c836e(0x1bb)]('Error:'),'Project\x20name\x20is\x20required'),console['error'](a47_0x351cd8[_0x2c836e(0x1e5)](_0x2c836e(0x1d2))),console[_0x2c836e(0xfb)](a47_0x351cd8['dim'](_0x2c836e(0x1c3))),0x1;const _0x56b308=await withSpinner('Resolving\x20project\x20\x27'+_0x22e2c1+'\x27...',()=>_0x1964bb['workflow'][_0x2c836e(0x1a6)](_0x22e2c1),{'verbose':_0x43c904[_0x2c836e(0x19e)]}),{name:_0x39edb1}=_0x56b308[_0x2c836e(0x230)];return saveSessionContext({'workflow_project':_0x39edb1},_0x43c904[_0x2c836e(0x23d)]),console['log'](a47_0x351cd8[_0x2c836e(0x12b)](_0x2c836e(0x248)+a47_0x351cd8[_0x2c836e(0x19d)](_0x39edb1))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x21e);['description']='List\x20all\x20workflow\x20projects';async[a47_0x2c35ad(0x243)](_0xe241c){const _0x294177=a47_0x2c35ad,{options:_0x45d48d,args:_0x5ad882,tdx:_0x16d5b0}=_0xe241c,_0x50b7cd=_0x5ad882[0x0];_0x45d48d[_0x294177(0x19e)]&&_0x50b7cd&&console[_0x294177(0xfb)](_0x294177(0x192)+_0x50b7cd);const _0x1ddf5a=await withSpinner(_0x294177(0x1bf),()=>_0x16d5b0['workflow'][_0x294177(0x17d)](_0x50b7cd,{'limit':_0x45d48d[_0x294177(0x25e)]}),{'verbose':_0x45d48d[_0x294177(0x19e)]});let _0x10aa90=_0x1ddf5a[_0x294177(0x230)];_0x10aa90['sort']((_0x1d5fa7,_0x1909b3)=>_0x1d5fa7['name'][_0x294177(0x142)](_0x1909b3[_0x294177(0x1f1)]));const _0x129bde=_0x45d48d[_0x294177(0x25e)]||0x64,_0x4193ea=_0x10aa90[_0x294177(0x21f)]>=_0x129bde?a47_0x351cd8[_0x294177(0x1e5)](_0x294177(0xc3)):'';console[_0x294177(0xfb)]('✔\x20Found\x20'+_0x10aa90[_0x294177(0x21f)]+'\x20project'+(_0x10aa90['length']!==0x1?'s':'')+_0x4193ea);if(_0x45d48d[_0x294177(0x117)]===_0x294177(0x1b3)||_0x45d48d[_0x294177(0x117)]==='jsonl'||_0x45d48d['format']===_0x294177(0xeb))await handleSDKOutput(_0x10aa90,_0x45d48d);else{if(_0x10aa90[_0x294177(0x21f)]===0x0)_0x50b7cd?console['log'](_0x294177(0x128)+_0x50b7cd):console[_0x294177(0xda)]('No\x20workflow\x20projects\x20found');else{const _0x2676c0=_0x10aa90[_0x294177(0x1c4)](_0x121e75=>{const _0x5be616=_0x294177,_0x2376ee=_0x121e75[_0x5be616(0x14b)]?.[_0x5be616(0xd1)](_0x35cc8c=>_0x35cc8c[_0x5be616(0x15e)]==='sys'),_0x3560a6=_0x2376ee?a47_0x351cd8[_0x5be616(0x1e5)](_0x5be616(0x17c)):'';return _0x5be616(0xd2)+_0x121e75['name']+_0x3560a6;});await writeOutput(_0x2676c0['join']('\x0a'),_0x45d48d[_0x294177(0x185)],_0x294177(0x124));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0xc9);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0xd6);async['execute'](_0x1fd24a){const _0x27985e=a47_0x2c35ad,{options:_0x23696a,args:_0x8b70da,tdx:_0xdb3b7c}=_0x1fd24a,_0x1eb900=this['resolveProject'](_0x8b70da,_0x23696a);_0x23696a[_0x27985e(0x19e)]&&_0x1eb900&&console[_0x27985e(0xfb)](_0x27985e(0xbd)+_0x1eb900);const _0x2c958b=await withSpinner(_0x27985e(0x245),()=>_0xdb3b7c[_0x27985e(0xce)][_0x27985e(0x20f)](_0x1eb900,{'limit':_0x23696a['limit']}),{'verbose':_0x23696a[_0x27985e(0x19e)]});let _0x286720=_0x2c958b[_0x27985e(0x230)];_0x286720[_0x27985e(0xba)]((_0x571c7a,_0x17f30a)=>{const _0x55762b=_0x27985e,_0xa6b87d=_0x571c7a[_0x55762b(0x1f1)]['localeCompare'](_0x17f30a[_0x55762b(0x1f1)]);if(_0xa6b87d!==0x0)return _0xa6b87d;return(_0x571c7a[_0x55762b(0x255)]?.['name']||'')[_0x55762b(0x142)](_0x17f30a[_0x55762b(0x255)]?.[_0x55762b(0x1f1)]||'');});const _0x182d1a=_0x23696a[_0x27985e(0x25e)]||0x64,_0x4b7eab=_0x286720[_0x27985e(0x21f)]>=_0x182d1a?a47_0x351cd8['dim'](_0x27985e(0xc3)):'';console[_0x27985e(0xfb)]('✔\x20Found\x20'+_0x286720[_0x27985e(0x21f)]+_0x27985e(0x238)+(_0x286720[_0x27985e(0x21f)]!==0x1?'s':'')+_0x4b7eab);if(_0x23696a['format']===_0x27985e(0x1b3)||_0x23696a[_0x27985e(0x117)]===_0x27985e(0x1aa)||_0x23696a['format']===_0x27985e(0xeb))await handleSDKOutput(_0x286720,_0x23696a);else{if(_0x286720[_0x27985e(0x21f)]===0x0)_0x1eb900?console[_0x27985e(0xda)](_0x27985e(0x144)+_0x1eb900):console[_0x27985e(0xda)](_0x27985e(0x112));else{const _0xbbfc31=_0x23696a[_0x27985e(0xd3)],_0x3e5fd1=_0x286720[_0x27985e(0x1c4)](_0x5b8ae9=>{const _0x401e7e=_0x27985e,_0xbf861b=a47_0x351cd8[_0x401e7e(0x1e5)]('#'+_0x5b8ae9['id']),_0x3e342=hyperlink(_0xbf861b,getWorkflowUrl(_0xbbfc31,_0x5b8ae9['id'])),_0x2c7cbc=_0x5b8ae9['project']?.[_0x401e7e(0x1f1)]?a47_0x351cd8['dim']('\x20('+_0x5b8ae9[_0x401e7e(0x255)]['name']+')'):'';return _0x401e7e(0x172)+_0x3e342+'\x20'+_0x5b8ae9[_0x401e7e(0x1f1)]+_0x2c7cbc;});await writeOutput(_0x3e5fd1[_0x27985e(0x110)]('\x0a'),_0x23696a['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]='workflow:sessions';[a47_0x2c35ad(0x20d)]='List\x20workflow\x20execution\x20sessions';async[a47_0x2c35ad(0x243)](_0x4ff047){const _0x55cd42=a47_0x2c35ad,{options:_0x2b99ce,args:_0x3af860,tdx:_0x2dbafd}=_0x4ff047,_0xfb3cfb=this[_0x55cd42(0x204)](_0x3af860,_0x2b99ce);if(!_0xfb3cfb)return 0x1;const {projectName:_0x5b170f,workflowName:_0x1364af}=_0xfb3cfb;if(_0x2b99ce[_0x55cd42(0x19e)]){if(_0x5b170f&&_0x1364af)console[_0x55cd42(0xfb)](_0x55cd42(0xb6)+_0x5b170f+'.'+_0x1364af);else _0x5b170f&&console[_0x55cd42(0xfb)](_0x55cd42(0xfe)+_0x5b170f);const _0x413851=_0x2b99ce[_0x55cd42(0x106)];_0x413851&&console[_0x55cd42(0xfb)](_0x55cd42(0x1e9)+_0x413851);}let _0x398f69=0x28;if(process[_0x55cd42(0x214)]['isTTY']&&!_0x2b99ce['output']&&!_0x2b99ce[_0x55cd42(0x117)]){const _0x31939b=process[_0x55cd42(0x214)][_0x55cd42(0x19c)]||0x28;_0x398f69=Math[_0x55cd42(0x137)](0x14,Math[_0x55cd42(0x1c6)](_0x31939b*0x2/0x3));}const _0x2e53a4=_0x2b99ce[_0x55cd42(0x25e)]||_0x398f69,_0x2ade73=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x2dbafd[_0x55cd42(0xce)][_0x55cd42(0x1f6)]({'projectName':_0x5b170f,'workflowName':_0x1364af,'status':_0x2b99ce[_0x55cd42(0x106)],'fromTime':_0x2b99ce[_0x55cd42(0x1a8)],'toTime':_0x2b99ce['to'],'limit':_0x2e53a4}),{'verbose':_0x2b99ce[_0x55cd42(0x19e)]}),_0x1edfd9=_0x2ade73[_0x55cd42(0x230)];_0x1edfd9['sort']((_0x49bb4c,_0x270629)=>{const _0x26d1b4=_0x55cd42,_0xf724d8=_0x49bb4c[_0x26d1b4(0x1f0)]||'',_0x16c2a6=_0x270629[_0x26d1b4(0x1f0)]||'';return _0x16c2a6['localeCompare'](_0xf724d8);});_0x1edfd9[_0x55cd42(0x21f)]>=_0x2e53a4?console[_0x55cd42(0xfb)](_0x55cd42(0x208)+_0x1edfd9[_0x55cd42(0x21f)]+'\x20sessions\x20'+a47_0x351cd8[_0x55cd42(0x1e5)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x55cd42(0xe3)+_0x1edfd9[_0x55cd42(0x21f)]+_0x55cd42(0x153)+(_0x1edfd9[_0x55cd42(0x21f)]!==0x1?'s':''));if(_0x2b99ce[_0x55cd42(0x117)]===_0x55cd42(0x1b3)||_0x2b99ce[_0x55cd42(0x117)]===_0x55cd42(0x1aa)||_0x2b99ce[_0x55cd42(0x117)]===_0x55cd42(0xeb))await handleSDKOutput(_0x1edfd9,_0x2b99ce);else{if(!process[_0x55cd42(0x214)][_0x55cd42(0x241)]||_0x2b99ce[_0x55cd42(0x185)]){if(_0x1edfd9[_0x55cd42(0x21f)]===0x0){if(_0x5b170f&&_0x1364af)console[_0x55cd42(0xda)](_0x55cd42(0x1ec)+_0x5b170f+'.'+_0x1364af);else _0x5b170f?console[_0x55cd42(0xda)](_0x55cd42(0x17e)+_0x5b170f):console[_0x55cd42(0xda)](_0x55cd42(0x184));}else{const _0x586666=_0x2b99ce[_0x55cd42(0xd3)],_0x1a9643=this[_0x55cd42(0x1f7)](_0x1edfd9,_0x586666);_0x2b99ce[_0x55cd42(0x185)]?await writeOutput(_0x1a9643,_0x2b99ce[_0x55cd42(0x185)],_0x55cd42(0x124)):console[_0x55cd42(0xda)](_0x1a9643);}!_0x5b170f&&(console[_0x55cd42(0xfb)](''),console['error'](a47_0x351cd8[_0x55cd42(0x1e5)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x55cd42(0xfb)](a47_0x351cd8[_0x55cd42(0x1e5)](_0x55cd42(0xf5))+'or'+a47_0x351cd8[_0x55cd42(0x1e5)](_0x55cd42(0x104))));}else{if(_0x1edfd9[_0x55cd42(0x21f)]===0x0){if(_0x5b170f&&_0x1364af)console[_0x55cd42(0xda)](_0x55cd42(0x1ec)+_0x5b170f+'.'+_0x1364af);else _0x5b170f?console[_0x55cd42(0xda)](_0x55cd42(0x17e)+_0x5b170f):console[_0x55cd42(0xda)]('No\x20sessions\x20found');}else await this[_0x55cd42(0x1a5)](_0x1edfd9,_0x4ff047,_0x5b170f);}}return 0x0;}['renderSessionsTimeline'](_0x3493f7,_0x30fe36){const _0xd2da6b=a47_0x2c35ad,_0x58ec4c=[],_0x5f0390=new Map();let _0x339ed3=Infinity,_0x3ba936=-Infinity;for(const _0x40b309 of _0x3493f7){if(_0x40b309[_0xd2da6b(0x1a9)]?.['createdAt']){const _0x24afc7=new Date(_0x40b309[_0xd2da6b(0x1a9)][_0xd2da6b(0x180)])[_0xd2da6b(0x129)](),_0x5624c2=_0x40b309['lastAttempt'][_0xd2da6b(0x17b)]?new Date(_0x40b309[_0xd2da6b(0x1a9)][_0xd2da6b(0x17b)])[_0xd2da6b(0x129)]():Date[_0xd2da6b(0x1eb)](),_0x86b03d=_0x40b309[_0xd2da6b(0x255)]?.[_0xd2da6b(0x1f1)]||_0xd2da6b(0x14f);!_0x5f0390[_0xd2da6b(0x11c)](_0x86b03d)&&_0x5f0390['set'](_0x86b03d,[]),_0x5f0390[_0xd2da6b(0x23e)](_0x86b03d)[_0xd2da6b(0x1cf)]({'session':_0x40b309,'startTime':_0x24afc7,'endTime':_0x5624c2,'duration':_0x5624c2-_0x24afc7}),_0x339ed3=Math['min'](_0x339ed3,_0x24afc7),_0x3ba936=Math[_0xd2da6b(0x137)](_0x3ba936,_0x5624c2);}}if(_0x5f0390[_0xd2da6b(0x1be)]===0x0)return _0xd2da6b(0x237);const _0x12533c=process[_0xd2da6b(0x214)][_0xd2da6b(0x10a)]||0x78,_0x15ca77=0x1e,_0x1de49d=0x32,_0x124ba3=0x4,_0x683a04=Math['min'](_0x1de49d,Math['max'](_0x15ca77,Math[_0xd2da6b(0x1c6)](_0x12533c*0.3))),_0x1d899f=_0x12533c-_0x683a04-TIMELINE_CONFIG['GUTTER']-0x3-_0x124ba3,_0x208a7a=_0x3ba936-_0x339ed3,_0x192e6d=_0x208a7a/_0x683a04,_0x20730e=renderTimeAxis({'startTime':_0x339ed3,'endTime':_0x3ba936,'durationMs':_0x208a7a,'msPerChar':_0x192e6d},_0x683a04),_0x5ab2f6=[];for(const _0x2c4ea1 of _0x5f0390[_0xd2da6b(0xfd)]()){_0x5ab2f6[_0xd2da6b(0x1cf)](..._0x2c4ea1);}_0x5ab2f6[_0xd2da6b(0xba)]((_0x551a10,_0x7c3972)=>_0x7c3972[_0xd2da6b(0x23a)]-_0x551a10[_0xd2da6b(0x23a)]);const _0x3a1c93=new Date(_0x339ed3),_0x54a227=formatDate(_0x3a1c93),_0x221cd8=_0x124ba3+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0xd2da6b(0x14e)]+_0x1d899f,_0x11ee0c='\x20'[_0xd2da6b(0xc6)](_0x221cd8-_0x54a227[_0xd2da6b(0x21f)]),_0x1e56e1=_0x11ee0c+a47_0x351cd8[_0xd2da6b(0x1e5)](_0x54a227)+'\x20'+_0x20730e;_0x58ec4c['push'](_0x1e56e1);const _0x46a9f3=0x16;let _0x47a167=0x0;for(const _0xbdd1b1 of _0x5ab2f6){const _0x62013c=_0xbdd1b1[_0xd2da6b(0x23d)][_0xd2da6b(0x255)]?.[_0xd2da6b(0x1f1)]||'?',_0x316c35=Math[_0xd2da6b(0xb7)](stringWidth(_0x62013c),_0x46a9f3);_0x47a167=Math['max'](_0x47a167,_0x316c35);}for(const _0x58f268 of _0x5ab2f6){const {session:_0x1e454d,startTime:_0x5718da,endTime:_0x2ea8de,duration:_0xa9549b}=_0x58f268,_0x1a4ee5=_0x1e454d[_0xd2da6b(0x255)]?.['id'],_0x3bb91e=_0x1e454d['id'],_0x390551=_0x1e454d[_0xd2da6b(0x255)]?.[_0xd2da6b(0x1f1)]||'?',_0x27b85e=_0x1e454d[_0xd2da6b(0xce)]?.['name']||'?';let _0x4dd94a,_0xcf83fe;if(_0x1e454d['lastAttempt']){const _0x6b95c9=_0x1e454d[_0xd2da6b(0x1a9)];!_0x6b95c9[_0xd2da6b(0x11d)]?(_0x4dd94a=_0x6b95c9[_0xd2da6b(0x1db)]?'🛑':'🔄',_0xcf83fe=_0x6b95c9[_0xd2da6b(0x1db)]?a47_0x351cd8[_0xd2da6b(0x143)]:a47_0x351cd8[_0xd2da6b(0x1c8)]):(_0x4dd94a=_0x6b95c9['success']?'✅':'❌',_0xcf83fe=_0x6b95c9[_0xd2da6b(0xc7)]?a47_0x351cd8['green']:a47_0x351cd8[_0xd2da6b(0x1bb)]);}else _0x4dd94a='⏳',_0xcf83fe=a47_0x351cd8[_0xd2da6b(0x1e5)];const _0x17eb45='#'+_0x3bb91e,_0x1baf6a=_0x1a4ee5?hyperlink(_0x17eb45,getWorkflowSessionUrl(_0x30fe36,_0x1a4ee5,_0x3bb91e)):_0x17eb45;let _0x2f872c=_0x390551;stringWidth(_0x390551)>_0x46a9f3&&(_0x2f872c=_0x390551['slice'](0x0,_0x46a9f3-0x1)+'…');const _0x510caa=a47_0x351cd8['dim'](_0x2f872c),_0x56376a=stringWidth(_0x2f872c),_0x3b8506='\x20'['repeat'](_0x47a167-stringWidth(_0x2f872c)+0x2),_0x57cfe7='('+formatElapsed(_0xa9549b)+')',_0x82e843=stringWidth(_0x57cfe7),_0x211ec2=stringWidth(_0x17eb45),_0x5c57b1=_0x211ec2+0x1+_0x56376a+_0x3b8506[_0xd2da6b(0x21f)],_0x527f01=_0x1d899f-_0x5c57b1-_0x82e843-0x1-0x8;let _0x4df7b9=_0x27b85e;stringWidth(_0x4df7b9)>_0x527f01&&(_0x4df7b9=_0x4df7b9[_0xd2da6b(0x232)](0x0,_0x527f01-0x1)+'…');const _0x5ea7d2=_0x1baf6a+'\x20'+_0x510caa+_0x3b8506+_0x4df7b9,_0x30a640=stringWidth(_0x5ea7d2),_0x5d37a8=_0x1d899f-_0x30a640-_0x82e843,_0x2b1a19=_0x5ea7d2+'\x20'[_0xd2da6b(0xc6)](Math[_0xd2da6b(0x137)](0x1,_0x5d37a8))+a47_0x351cd8[_0xd2da6b(0x1e5)](_0x57cfe7),_0xf62fdc=Math[_0xd2da6b(0x1c6)]((_0x5718da-_0x339ed3)/_0x192e6d),_0x377d5e=Math[_0xd2da6b(0x1c6)]((_0x2ea8de-_0x339ed3)/_0x192e6d),_0x254b49=Math[_0xd2da6b(0x137)](_0xf62fdc+0x1,_0x377d5e),_0x491526=new Array(_0x683a04)[_0xd2da6b(0x21a)]('\x20');for(let _0x416200=_0xf62fdc;_0x416200<Math[_0xd2da6b(0xb7)](_0x254b49,_0x683a04);_0x416200++){_0x491526[_0x416200]='─';}const _0x4cbd0b=_0x491526[_0xd2da6b(0x1c4)](_0x2e891=>_0x2e891==='\x20'?'\x20':_0xcf83fe(_0x2e891))[_0xd2da6b(0x110)]('');_0x58ec4c[_0xd2da6b(0x1cf)](_0x4dd94a+'\x20'+_0x2b1a19+'│'+_0x4cbd0b+'│');}return _0x58ec4c['join']('\x0a');}async[a47_0x2c35ad(0x1a5)](_0x3fb561,_0x1163c5,_0x2fb22a){const _0x3d2a4e=a47_0x2c35ad,{options:_0xf12cf,tdx:_0x653441}=_0x1163c5,_0x480388=_0xf12cf[_0x3d2a4e(0xd3)],{timelineRows:_0x12ccd9,timeAxisHeader:_0x482842}=this[_0x3d2a4e(0xcc)](_0x3fb561,_0x480388),_0x1c22d=_0x12ccd9['filter'](_0x295a33=>_0x295a33['attemptId']);if(_0x1c22d[_0x3d2a4e(0x21f)]===0x0){const _0x2d18c2=this[_0x3d2a4e(0x1f7)](_0x3fb561,_0x480388);console['log'](_0x2d18c2);!_0x2fb22a&&(console[_0x3d2a4e(0xfb)](''),console[_0x3d2a4e(0xfb)](a47_0x351cd8[_0x3d2a4e(0x1e5)](_0x3d2a4e(0x134))),console[_0x3d2a4e(0xfb)](a47_0x351cd8[_0x3d2a4e(0x1e5)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a47_0x351cd8[_0x3d2a4e(0x1e5)](_0x3d2a4e(0x104))));return;}_0x482842&&console[_0x3d2a4e(0xda)](_0x482842);const _0x5a3421=_0x12ccd9['filter'](_0x4b66ed=>_0x4b66ed[_0x3d2a4e(0x16d)])[_0x3d2a4e(0x1c4)](_0x31ce38=>({'title':_0x31ce38[_0x3d2a4e(0x21c)],'value':_0x31ce38[_0x3d2a4e(0x16d)]})),_0x1afe0d=process[_0x3d2a4e(0x214)]['rows']||0x3c,_0x3021e4=Math['max'](0x28,Math[_0x3d2a4e(0x1c6)](_0x1afe0d*0x2/0x3)),_0x4938c2=await a47_0x27490a({'type':_0x3d2a4e(0x18d),'name':_0x3d2a4e(0x16d),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x5a3421,'initial':-0x1,'limit':_0x3021e4,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x311124,_0x3cf8f7)=>{const _0x5b6e82=_0x3d2a4e;if(!_0x311124)return Promise[_0x5b6e82(0x212)](_0x3cf8f7);const _0x1c8f7b=_0x3cf8f7[_0x5b6e82(0x154)](_0x2370eb=>{const _0x48bf8f=_0x5b6e82,_0x374b1c=_0x2370eb;return _0x374b1c[_0x48bf8f(0x18f)][_0x48bf8f(0x13e)]()['includes'](_0x311124[_0x48bf8f(0x13e)]());});return Promise['resolve'](_0x1c8f7b);}}),_0x38c578=()=>{const _0x3e61f7=_0x3d2a4e;process[_0x3e61f7(0x214)][_0x3e61f7(0x131)](_0x3e61f7(0x25c)),process[_0x3e61f7(0x214)][_0x3e61f7(0x131)](_0x3e61f7(0x25c)),process[_0x3e61f7(0x214)][_0x3e61f7(0x131)](_0x3e61f7(0x25c));},_0x12f238=_0x4938c2&&_0x4938c2['attemptId']&&_0x4938c2[_0x3d2a4e(0x16d)]!==null&&_0x4938c2[_0x3d2a4e(0x16d)][_0x3d2a4e(0x190)]()!=='';if(!_0x12f238){_0x38c578(),console[_0x3d2a4e(0xda)](a47_0x351cd8['dim'](_0x3d2a4e(0xd4)));return;}_0x38c578();const _0x8bd707=_0x3fb561[_0x3d2a4e(0xfc)](_0x24d91b=>_0x24d91b[_0x3d2a4e(0x1a9)]?.['id']===_0x4938c2[_0x3d2a4e(0x16d)]);if(_0x8bd707){const _0x38ba9e=_0x8bd707[_0x3d2a4e(0x255)]?.[_0x3d2a4e(0x1f1)]||'?',_0x4ea06b=_0x8bd707[_0x3d2a4e(0xce)]?.[_0x3d2a4e(0x1f1)]||'?';console['log'](_0x3d2a4e(0x1ff)+a47_0x351cd8[_0x3d2a4e(0x1e5)](_0x38ba9e)+_0x3d2a4e(0x1c1)+a47_0x351cd8[_0x3d2a4e(0x1e5)](_0x4ea06b));}const _0x19b7bc=new WorkflowTimelineCommand();await _0x19b7bc['execute']({'args':[],'options':{..._0xf12cf,'attemptId':_0x4938c2[_0x3d2a4e(0x16d)]},'tdx':_0x653441});}['generateSessionTimelineRows'](_0x36ec46,_0x159eb3){const _0x14d2a3=a47_0x2c35ad,_0xba7223=new Map();for(const _0x4d5e77 of _0x36ec46){_0x4d5e77['id']&&_0x4d5e77[_0x14d2a3(0x1a9)]?.['id']&&_0xba7223['set'](_0x4d5e77['id'],_0x4d5e77[_0x14d2a3(0x1a9)]['id']);}const _0xa066c3=[];let _0x520bd5='';const _0x26c250=this[_0x14d2a3(0x1f7)](_0x36ec46,_0x159eb3),_0x3b113f=_0x26c250['split']('\x0a');for(const _0x36af6f of _0x3b113f){if(_0x36af6f[_0x14d2a3(0x148)](_0x14d2a3(0x1b2))||_0x36af6f[_0x14d2a3(0x16c)](/^\s+\d{4}-\d{2}-\d{2}/))_0x520bd5=_0x36af6f;else{if(_0x36af6f[_0x14d2a3(0x16c)](/^[✅❌🔄🛑⏳]/)){const _0x338dc6=_0x36af6f[_0x14d2a3(0x16c)](/#(\d+)/),_0x260153=_0x338dc6?_0x338dc6[0x1]:null,_0x578837=_0x260153?_0xba7223[_0x14d2a3(0x23e)](_0x260153)||null:null,_0x2c5451=_0x36ec46['find'](_0x2afe0f=>_0x2afe0f['id']===_0x260153),_0x5df305=_0x2c5451?.[_0x14d2a3(0x255)]?.['name']||'';_0xa066c3[_0x14d2a3(0x1cf)]({'displayLine':_0x36af6f,'attemptId':_0x578837,'projectName':_0x5df305});}}}return{'timelineRows':_0xa066c3,'timeAxisHeader':_0x520bd5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]='workflow:attempts';[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0xd0);async['execute'](_0x4f8676){const _0x2dbbab=a47_0x2c35ad,{options:_0x5a3ac9,args:_0x3eb2d3,tdx:_0x1ae18d}=_0x4f8676,_0x562e3c=this[_0x2dbbab(0x204)](_0x3eb2d3,_0x5a3ac9);if(!_0x562e3c)return 0x1;const {projectName:_0x323a9f,workflowName:_0x171549}=_0x562e3c,_0x31b01d=_0x5a3ac9[_0x2dbbab(0x166)];if(_0x5a3ac9[_0x2dbbab(0x19e)]){if(_0x323a9f&&_0x171549)console['error'](_0x2dbbab(0xb6)+_0x323a9f+'.'+_0x171549);else _0x323a9f&&console[_0x2dbbab(0xfb)](_0x2dbbab(0xfe)+_0x323a9f);_0x31b01d&&console['error'](_0x2dbbab(0x10f));}const _0x5cff43=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x1ae18d[_0x2dbbab(0xce)][_0x2dbbab(0x1dc)]({'projectName':_0x323a9f,'workflowName':_0x171549,'includeRetried':_0x31b01d,'limit':_0x5a3ac9[_0x2dbbab(0x25e)]}),{'verbose':_0x5a3ac9['verbose']}),_0x3c6ff6=_0x5cff43[_0x2dbbab(0x230)],_0x178c55=_0x5a3ac9['limit']||0x64,_0x51ae21=_0x3c6ff6[_0x2dbbab(0x21f)]>=_0x178c55?a47_0x351cd8[_0x2dbbab(0x1e5)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2dbbab(0xfb)](_0x2dbbab(0xe3)+_0x3c6ff6[_0x2dbbab(0x21f)]+_0x2dbbab(0x121)+(_0x3c6ff6[_0x2dbbab(0x21f)]!==0x1?'s':'')+_0x51ae21);if(_0x5a3ac9[_0x2dbbab(0x117)]===_0x2dbbab(0x1b3)||_0x5a3ac9[_0x2dbbab(0x117)]===_0x2dbbab(0x1aa)||_0x5a3ac9[_0x2dbbab(0x117)]===_0x2dbbab(0xeb))await handleSDKOutput(_0x3c6ff6,_0x5a3ac9);else{if(_0x3c6ff6[_0x2dbbab(0x21f)]===0x0){if(_0x323a9f&&_0x171549)console[_0x2dbbab(0xda)](_0x2dbbab(0xb3)+_0x323a9f+'.'+_0x171549);else _0x323a9f?console[_0x2dbbab(0xda)](_0x2dbbab(0x227)+_0x323a9f):console[_0x2dbbab(0xda)]('No\x20attempts\x20found');}else{const _0x51b01b=_0x5a3ac9['site'],_0x40a708=_0x3c6ff6[_0x2dbbab(0x1c4)](_0x2edfd2=>{const _0x1395c6=_0x2dbbab,_0xb46d15=a47_0x351cd8['dim']('#'+_0x2edfd2['id']),_0x4d6d58=_0x2edfd2[_0x1395c6(0x255)]?.['id'],_0x160be8=_0x2edfd2[_0x1395c6(0x257)]||_0x2edfd2[_0x1395c6(0x165)],_0x41d4c2=_0x4d6d58&&_0x160be8?hyperlink(_0xb46d15,getWorkflowAttemptUrl(_0x51b01b,_0x4d6d58,_0x160be8,_0x2edfd2['id'])):_0xb46d15,{icon:_0x4d4d73,text:_0xe89065}=getAttemptStatusDisplay(_0x2edfd2),_0x5d9b17=(_0x2edfd2[_0x1395c6(0x255)]?.[_0x1395c6(0x1f1)]||'?')+'.'+(_0x2edfd2[_0x1395c6(0xce)]?.['name']||'?'),_0x1c6c0e=_0x2edfd2[_0x1395c6(0x1f0)]?a47_0x351cd8['dim'](_0x2edfd2[_0x1395c6(0x1f0)]):'';return(_0x41d4c2+'\x20'+_0x4d4d73+(_0xe89065?'\x20'+_0xe89065:'')+'\x20'+_0x5d9b17+'\x20'+_0x1c6c0e)['trimEnd']();});await writeOutput(_0x40a708[_0x2dbbab(0x110)]('\x0a'),_0x5a3ac9['output'],_0x2dbbab(0x124));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x206);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x12f);async[a47_0x2c35ad(0x243)](_0x54abcc){const _0x517747=a47_0x2c35ad,{options:_0x1f70ed,args:_0x33d9e1,tdx:_0x45b059}=_0x54abcc,_0x5ba2c1=_0x33d9e1[0x0];if(!_0x5ba2c1)return console['error'](_0x517747(0x164)),0x1;_0x1f70ed[_0x517747(0x19e)]&&console[_0x517747(0xfb)]('Attempt\x20ID:\x20'+_0x5ba2c1);const _0xcd46ec=await withSpinner(_0x517747(0x1e6),()=>_0x45b059[_0x517747(0xce)][_0x517747(0x200)](_0x5ba2c1),{'verbose':_0x1f70ed[_0x517747(0x19e)]}),_0x4ccfa4=_0xcd46ec[_0x517747(0x230)];let _0x2dabed;!_0x4ccfa4['done']?_0x2dabed=_0x4ccfa4['cancelRequested']?_0x517747(0x167):'running':_0x2dabed=_0x4ccfa4[_0x517747(0xc7)]?'success':_0x517747(0xfb);let _0x5d2077;if(_0x4ccfa4[_0x517747(0x180)]&&_0x4ccfa4[_0x517747(0x17b)]){const _0x23aaac=new Date(_0x4ccfa4['createdAt'])[_0x517747(0x129)](),_0xb54b3f=new Date(_0x4ccfa4[_0x517747(0x17b)])[_0x517747(0x129)]();_0x5d2077=Math[_0x517747(0x16f)]((_0xb54b3f-_0x23aaac)/0x3e8);}const _0x468865={'attempt_id':_0x4ccfa4['id'],'status':_0x2dabed,..._0x4ccfa4[_0x517747(0x24f)]!==undefined&&{'index':_0x4ccfa4[_0x517747(0x24f)]},..._0x4ccfa4[_0x517747(0x255)]&&{'project':_0x4ccfa4[_0x517747(0x255)][_0x517747(0x1f1)]},..._0x4ccfa4[_0x517747(0xce)]&&{'workflow':_0x4ccfa4[_0x517747(0xce)]['name']},..._0x4ccfa4[_0x517747(0x165)]&&{'session_id':_0x4ccfa4[_0x517747(0x165)]},..._0x4ccfa4[_0x517747(0x1f0)]&&{'session_time':_0x4ccfa4[_0x517747(0x1f0)]},..._0x4ccfa4[_0x517747(0x1d5)]&&{'retry_attempt':_0x4ccfa4[_0x517747(0x1d5)]},..._0x5d2077!==undefined&&{'duration_sec':_0x5d2077},..._0x4ccfa4[_0x517747(0x180)]&&{'created_at':_0x4ccfa4['createdAt']},..._0x4ccfa4[_0x517747(0x17b)]&&{'finished_at':_0x4ccfa4['finishedAt']},...Object[_0x517747(0x207)](_0x4ccfa4[_0x517747(0x252)])[_0x517747(0x21f)]>0x0&&{'params':_0x4ccfa4[_0x517747(0x252)]}};return await handleSingleObjectOutput(_0x468865,_0x1f70ed),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a47_0x2c35ad(0x197);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x141);async[a47_0x2c35ad(0x243)](_0x47fe9b){const _0x5191c5=a47_0x2c35ad,{options:_0x47e874,args:_0x116be3,tdx:_0x36e7fb}=_0x47fe9b,_0x135280=_0x116be3[0x0];if(!_0x135280)return console[_0x5191c5(0xfb)](_0x5191c5(0x164)),0x1;const _0x5d6b51=_0x47e874[_0x5191c5(0x1ae)];_0x47e874[_0x5191c5(0x19e)]&&(console[_0x5191c5(0xfb)](_0x5191c5(0x22e)+_0x135280),_0x5d6b51&&console['error'](_0x5191c5(0x118)));const _0x169b56=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x36e7fb['workflow'][_0x5191c5(0x139)](_0x135280,_0x5d6b51||![]),{'verbose':_0x47e874['verbose']}),_0x347100=_0x169b56[_0x5191c5(0x230)];return console['error'](_0x5191c5(0xe3)+_0x347100[_0x5191c5(0x21f)]+'\x20task'+(_0x347100[_0x5191c5(0x21f)]!==0x1?'s':'')),await handleSDKOutput(_0x347100,_0x47e874),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a47_0x2c35ad(0x1d6);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x1c9);async[a47_0x2c35ad(0x243)](_0x3add79){const _0x2f87dd=a47_0x2c35ad,{options:_0x53bbca,args:_0x39210b,tdx:_0x1c00fa}=_0x3add79,_0x2e21c8=_0x39210b[0x0];let _0x7c2571=_0x39210b[0x1];if(!_0x2e21c8)return console[_0x2f87dd(0xfb)](_0x2f87dd(0x164)),0x1;_0x53bbca[_0x2f87dd(0x19e)]&&(console[_0x2f87dd(0xfb)](_0x2f87dd(0x22e)+_0x2e21c8),_0x7c2571&&console[_0x2f87dd(0xfb)](_0x2f87dd(0x17a)+_0x7c2571));const _0x1d919b=await withSpinner(_0x2f87dd(0xbb),()=>_0x1c00fa[_0x2f87dd(0xce)][_0x2f87dd(0x24a)](_0x2e21c8,_0x7c2571),{'verbose':_0x53bbca[_0x2f87dd(0x19e)]}),_0x34f79a=_0x1d919b[_0x2f87dd(0x230)];if(_0x34f79a[_0x2f87dd(0x21f)]===0x0)return console[_0x2f87dd(0xfb)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x7c2571&&(_0x53bbca['json']||_0x53bbca[_0x2f87dd(0x117)]))return await handleSDKOutput(_0x34f79a,_0x53bbca),0x0;if(!_0x7c2571){const _0x5e99c9=_0x34f79a['map'](_0x1733f4=>({'title':_0x1733f4['taskName']+'\x20('+formatBytes(_0x1733f4[_0x2f87dd(0x120)])+')','value':_0x1733f4[_0x2f87dd(0x13d)]})),_0x3c7473=await a47_0x27490a({'type':'select','name':_0x2f87dd(0xca),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x5e99c9});if(!_0x3c7473['task'])return console[_0x2f87dd(0xfb)](_0x2f87dd(0xd4)),0x0;_0x7c2571=_0x3c7473[_0x2f87dd(0xca)];}const _0x58cf2f=await withSpinner(_0x2f87dd(0x222),()=>_0x1c00fa[_0x2f87dd(0xce)][_0x2f87dd(0xe1)](_0x2e21c8,_0x7c2571),{'verbose':_0x53bbca[_0x2f87dd(0x19e)]}),_0x2bccdc=_0x58cf2f[_0x2f87dd(0x230)];return _0x2bccdc?console[_0x2f87dd(0xda)](_0x2bccdc):console['error']('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x157);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x210);async['execute'](_0x5bb3b3){const _0xca6a6d=a47_0x2c35ad,{options:_0x4d2144,args:_0x564c2d,tdx:_0x1f2256}=_0x5bb3b3,_0x37889c=_0x564c2d[0x0];if(!_0x37889c)return console[_0xca6a6d(0xfb)](_0xca6a6d(0x164)),0x1;const _0x3282b8=_0x4d2144[_0xca6a6d(0xcf)];_0x4d2144[_0xca6a6d(0x19e)]&&(console[_0xca6a6d(0xfb)](_0xca6a6d(0x22e)+_0x37889c),_0x3282b8&&console['error'](_0xca6a6d(0x1f4)+_0x3282b8));if(!_0x4d2144[_0xca6a6d(0x205)]){if(!isInteractive())return console[_0xca6a6d(0xfb)](a47_0x351cd8['red'](_0xca6a6d(0x109)),_0xca6a6d(0xdc)),console[_0xca6a6d(0xfb)](a47_0x351cd8[_0xca6a6d(0x1e5)](_0xca6a6d(0x25b))),0x1;const _0x1b204f=await confirmKey(_0xca6a6d(0x1c7)+_0x37889c+'?');if(!_0x1b204f)return console['error'](a47_0x351cd8[_0xca6a6d(0x143)](_0xca6a6d(0xd4))),0x1;}const _0x4960f5=await withSpinner('Killing\x20attempt...',()=>_0x1f2256[_0xca6a6d(0xce)]['kill'](_0x37889c,_0x3282b8),{'verbose':_0x4d2144['verbose']}),_0x18f225=_0x4960f5[_0xca6a6d(0x230)];return console[_0xca6a6d(0xfb)]('✔\x20'+_0x18f225),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x119);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x22c);async[a47_0x2c35ad(0x243)](_0x219089){const _0x2ddce4=a47_0x2c35ad,{options:_0x25557d,args:_0x3d2d1f,tdx:_0x2c3016}=_0x219089,_0x11973f=_0x3d2d1f[0x0];if(!_0x11973f)return console[_0x2ddce4(0xfb)](_0x2ddce4(0xc0)),console[_0x2ddce4(0xfb)](_0x2ddce4(0x14a)),0x1;let _0xfd1999=![],_0x35a7b7=_0x11973f;if(_0x11973f[_0x2ddce4(0x148)](_0x2ddce4(0x13c)))_0xfd1999=!![],_0x35a7b7=_0x11973f[_0x2ddce4(0xd7)](0x8);else{if(_0x11973f['startsWith'](_0x2ddce4(0x11b)))_0xfd1999=![],_0x35a7b7=_0x11973f['substring'](0x8);else return console[_0x2ddce4(0xfb)](_0x2ddce4(0x127)),console['error'](_0x2ddce4(0x14a)),0x1;}const _0x53350f=_0x25557d[_0x2ddce4(0x199)],_0x3cdffa=_0x25557d[_0x2ddce4(0xd5)],_0x5a7856=_0x25557d[_0x2ddce4(0x252)],_0x4303bf=_0x25557d[_0x2ddce4(0x1ab)];_0x25557d['verbose']&&(console[_0x2ddce4(0xfb)](_0x2ddce4(0x1c5)+(_0xfd1999?_0x2ddce4(0x23d):'attempt')+'\x20'+_0x35a7b7),_0x53350f&&console[_0x2ddce4(0xfb)](_0x2ddce4(0x1ea)+_0x53350f),_0x3cdffa&&console[_0x2ddce4(0xfb)](_0x2ddce4(0x258)+_0x3cdffa),_0x5a7856&&console['error']('Params:\x20'+_0x5a7856),_0x4303bf&&console[_0x2ddce4(0xfb)](_0x2ddce4(0xdf)));let _0x28e20e;if(_0x5a7856)try{if(_0x5a7856[_0x2ddce4(0x148)]('@')){const _0x333b95=await import('fs/promises'),_0x5ea0c3=_0x5a7856[_0x2ddce4(0xd7)](0x1),_0x573151=await _0x333b95[_0x2ddce4(0x16a)](_0x5ea0c3,_0x2ddce4(0x18e));_0x28e20e=JSON[_0x2ddce4(0x10e)](_0x573151);}else _0x28e20e=JSON[_0x2ddce4(0x10e)](_0x5a7856);}catch{return console['error'](_0x2ddce4(0x213)),0x1;}if(!_0x25557d[_0x2ddce4(0x205)]){if(!isInteractive())return console[_0x2ddce4(0xfb)](a47_0x351cd8[_0x2ddce4(0x1bb)](_0x2ddce4(0x109)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2ddce4(0xfb)](a47_0x351cd8[_0x2ddce4(0x1e5)](_0x2ddce4(0x25b))),0x1;const _0x29140e=await confirmKey(_0x2ddce4(0x20c)+(_0xfd1999?_0x2ddce4(0x23d):_0x2ddce4(0x200))+'\x20'+_0x35a7b7+'?');if(!_0x29140e)return console[_0x2ddce4(0xfb)](a47_0x351cd8[_0x2ddce4(0x143)](_0x2ddce4(0xd4))),0x1;}let _0x3c72b4;_0xfd1999?_0x3c72b4=await withSpinner(_0x2ddce4(0xf4),()=>_0x2c3016[_0x2ddce4(0xce)][_0x2ddce4(0x1f2)](_0x35a7b7,{'fromTask':_0x53350f,'retryParams':_0x28e20e}),{'verbose':_0x25557d[_0x2ddce4(0x19e)]}):_0x3c72b4=await withSpinner(_0x2ddce4(0x140),()=>_0x2c3016[_0x2ddce4(0xce)][_0x2ddce4(0xde)](_0x35a7b7,{'resumeFrom':_0x3cdffa,'retryParams':_0x28e20e,'force':_0x4303bf}),{'verbose':_0x25557d[_0x2ddce4(0x19e)]});const _0x53e4db=_0x3c72b4['data'];return console[_0x2ddce4(0xfb)](_0x2ddce4(0x1a2)),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0x53e4db[_0x2ddce4(0x16d)]),console[_0x2ddce4(0xfb)](_0x2ddce4(0x229)+_0x53e4db[_0x2ddce4(0x165)]),0x0;}}function a47_0x508d(){const _0x4096d1=['site','Cancelled','resumeFrom','List\x20workflows','substring','-\x20nothing\x20pushed','Output\x20directory:\x20','log','Warning:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','retryAttempt','Force:\x20yes','path','logs','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','✔\x20Found\x20','10055353NmUBHZ','Revision:\x20','workflowProject','\x20\x20Project:\x20','💡\x20Tip:\x20Use\x20','duration','POLL_INTERVAL_MS','table','Cloning\x20to\x20','\x20new','No\x20workflow\x20sessions\x20found','executePushProject','group_error','Key\x20cannot\x20be\x20empty','Latest\x20session\x20has\x20no\x20attempt','\x20is\x20not\x20a\x20directory','Retrying\x20session...','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Source:\x20','\x27\x20from\x20project\x20\x27','filesExtracted','window','error','find','values','Filter:\x20project=','pending','Downloading\x20project\x20','white','renderSingleTimeline','MAX_LABEL_COUNT','\x20\x20tdx\x20wf\x20use\x20<project>','getFullYear','status','fileCount','Session\x20','\x0aError:','columns','⚠\x20Showing\x20first\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x20tasks','parse','Include\x20retried:\x20yes','join','✔\x20Project:\x20','No\x20workflows\x20found','Starting\x20workflow\x20run...','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','deleteSecret','resolveProject','format','Including\x20subtasks:\x20yes','workflow:retry','isDirectory','attempt:','has','done','workflow:secrets:delete','-\x20no\x20files\x20written','fileSize','\x20attempt','\x22?\x20This\x20cannot\x20be\x20undone.','download','list','diff','Total:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','No\x20projects\x20match\x20pattern:\x20','getTime','fullName','green','Error:\x20Secret\x20key\x20is\x20required','✔\x20Project\x20updated','type','Show\x20specific\x20attempt\x20details','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','write','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','targetDir','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20Session\x20context\x20set\x20to:\x20','✔\x20Workflow\x20run\x20started','max','Pushing\x20workflow\x20project...','tasks','delete','toISOString','session:','taskName','toLowerCase','\x0aDry\x20run\x20-\x20no\x20project\x20created','Retrying\x20attempt...','Show\x20tasks\x20for\x20an\x20attempt','localeCompare','yellow','No\x20workflows\x20found\x20in\x20project:\x20','\x20from\x20session\x20','summary','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','startsWith','LABEL_WIDTH_DIVISOR','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','metadata','Project\x20name\x20is\x20required','\x0aClone\x20\x22','ICON_SPACING','(unknown)','Loading\x20sessions...','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','param','\x20session','filter','/app/workflows/','workflow:upload','workflow:kill','all','Deleting\x20secret...','executeCloneProject','hasChanges','run','Setting\x20secret...','key','\x20\x20Attempt\x20ID:\x20','Select\x20a\x20workflow\x20to\x20run','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Pulling\x20project\x20','595KxkGIw','Error:\x20Attempt\x20ID\x20is\x20required','sessionId','includeRetried','canceling','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','✔\x20Pushed\x20','readFile','state','match','attemptId','...','round','\x20\x20Location:\x20','tdx\x20wf\x20attempt\x20','📋\x20','listSecrets','workflow:pull','Project\x20name:\x20','\x0aPush\x20these\x20changes?','\x0a✔\x20Already\x20up\x20to\x20date','workflow:delete','buildTimelineData','Task\x20name:\x20','finishedAt','\x20(system)','projects','No\x20sessions\x20found\x20in\x20project:\x20','Loading\x20workflows...','createdAt','every','select','Workflow:\x20','No\x20sessions\x20found','output','projectId','Source\x20directory:\x20','✔\x20Downloaded\x20','LABEL_MIN_SPACING','\x20logs','revision:\x20','\x20\x20Target:\x20','autocomplete','utf-8','title','trim','\x20\x20Console:\x20','Pattern:\x20','Error:\x20Project\x20name\x20is\x20required','showWorkflowConsoleUrl','Expected\x20format:\x20--param\x20key=value','cwd','workflow:tasks','\x20\x20Workflow:\x20','fromTask','tdx.json','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','rows','cyan','verbose','8696960rQPmHa','sourceProjectName','Key:\x20','✔\x20Retry\x20started','\x22\x20to\x20new\x20project\x20\x22','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','navigateSessionsInteractive','resolveProjectId','message','from','lastAttempt','jsonl','force','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Tip:\x20cd\x20to\x20workflows/','includeSubtasks','resolveProjectDir','\x20deleted','revision','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','json','workflowName','Using\x20attempt\x20','getMonth','\x22\x20with\x20new\x20revision?','dryRun','split','changes','red','/sessions/','Session\x20not\x20found:\x20','size','Listing\x20workflow\x20projects...','startedAt',',\x20Workflow:\x20','\x20secret','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','map','Target:\x20','floor','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','blue','Show\x20logs\x20for\x20a\x20workflow\x20attempt','isNewProject','pollTimeline','updatedAt','\x20-\x20','Source\x20project:\x20','push','clear','Dry\x20run:\x20yes','Usage:\x20tdx\x20wf\x20use\x20<project>','Writing\x20files...','running','retryAttemptName','workflow:logs','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Validation:\x20skipped','Deleting\x20project\x20','unchanged','cancelRequested','attempts','Updating\x20','Error:','Error:\x20Invalid\x20parameter\x20format:\x20','10VRnBcy','\x0aFailed\x20to\x20fetch\x20attempt\x20data','New\x20project\x20name:\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','dim','Getting\x20attempt\x20details...','targetExists','✔\x20Workflow\x20project\x20context\x20cleared.','Status:\x20','From\x20task:\x20','now','No\x20sessions\x20found\x20for:\x20','\x0a✔\x20No\x20changes\x20to\x20push','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','.\x20Expected\x20format:\x20KEY=VALUE','sessionTime','name','retrySession','skipValidation','Reason:\x20','icon','sessions','renderSessionsTimeline','Invalid\x20format:\x20','follow','36822195RNExEu','msPerChar','deleted','getMinutes','requireProject','Project:\x20','attempt','projectName','Source\x20directory\x20is\x20required','TASK_NAME_WIDTH','parseProjectWorkflowPattern','yes','workflow:attempt','keys','✔\x20Showing\x20','\x20\x20Revision:\x20','padStart','sourceDir','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','description','Source:\x20','workflows','Kill\x20a\x20running\x20attempt','4556388BEJwVe','resolve','Error:\x20Invalid\x20JSON\x20in\x20--params','stdout','\x20\x20Changes:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','renderTimeline','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','fill','\x0a⚠\x20Project\x20\x22','displayLine','workflow:download','workflow:projects','length','\x0aApply\x20these\x20changes?','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Downloading\x20logs...','text','end','Usage:\x20workflow:delete\x20<project-name-or-id>','newProjectName','No\x20attempts\x20found\x20in\x20project:\x20','relative','\x20\x20Session\x20ID:\x20','includes','durationMs','Retry\x20a\x20session\x20or\x20attempt','Analyzing\x20changes...','Attempt\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','data','total','slice','start','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20unchanged','977910jxSWnr','No\x20sessions\x20with\x20timing\x20information','\x20workflow','setSecret','startTime','\x20modified','---\x20','session','get','\x0aDry\x20run\x20-\x20nothing\x20pushed','ICON_WIDTH','isTTY','MAX_POLL_ITERATIONS','execute','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Listing\x20workflows...','context','\x20\x20Project\x20ID:\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','getDate','logFiles','Project\x20directory:\x20','✔\x20Deleted\x20project\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20of\x20','index','pullProject','existingProjectId','params','stat','Analyzing\x20project...','project','✔\x20Secret\x20\x27','session_id','Resume\x20from:\x20','Session\x20time:\x20','\x20to\x20see\x20detailed\x20logs','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x1b[1A\x1b[2K','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','limit','workflow:push','prepareCloneProject','modified','No\x20attempts\x20found\x20for:\x20','\x0aUpdate\x20existing\x20project\x20\x22','unknown','Filter:\x20','min','543420nvVzKY','indexOf','sort','Fetching\x20log\x20files...','✔\x20Clone\x20complete','Project\x20filter:\x20','set','workflow:run','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','36164DRNubY','replace','\x20(use\x20--limit\x20to\x20show\x20more)','Error:\x20KEY=VALUE\x20is\x20required','MAX_TASKS_DISPLAY','repeat','success','basename','workflow:workflows','task','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','generateSessionTimelineRows','\x0a✔\x20Attempt\x20complete','workflow','reason','List\x20workflow\x20attempts','some','📁\x20'];a47_0x508d=function(){return _0x4096d1;};return a47_0x508d();}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a47_0x2c35ad(0xbf);['description']='Start\x20a\x20workflow\x20run';async[a47_0x2c35ad(0x243)](_0x4b12c0){const _0x1e8330=a47_0x2c35ad,{options:_0x382a77,args:_0x3f22a8,tdx:_0x3e7934}=_0x4b12c0;let _0x2f8d4c=_0x3f22a8[0x0];if(!_0x2f8d4c){const _0x52baaa=this[_0x1e8330(0x116)]([],_0x382a77),_0x32d9f4=await withSpinner(_0x1e8330(0x17f),()=>_0x3e7934[_0x1e8330(0xce)][_0x1e8330(0x20f)](_0x52baaa,{'limit':_0x382a77[_0x1e8330(0x25e)]}),{'verbose':_0x382a77[_0x1e8330(0x19e)]}),_0x11e9b2=_0x32d9f4[_0x1e8330(0x230)];if(_0x11e9b2[_0x1e8330(0x21f)]===0x0)return console[_0x1e8330(0xfb)](_0x1e8330(0x112)),!_0x52baaa&&console[_0x1e8330(0xfb)](a47_0x351cd8['dim'](_0x1e8330(0xdd))),0x1;const _0x2b09e4=_0x11e9b2[_0x1e8330(0x1c4)](_0x465d91=>({'title':_0x465d91[_0x1e8330(0x255)]?.[_0x1e8330(0x1f1)]+'.'+_0x465d91[_0x1e8330(0x1f1)],'value':_0x465d91[_0x1e8330(0x255)]?.[_0x1e8330(0x1f1)]+'.'+_0x465d91[_0x1e8330(0x1f1)],'description':_0x465d91[_0x1e8330(0x1b1)]?_0x1e8330(0x18b)+_0x465d91[_0x1e8330(0x1b1)]:undefined})),_0x1597ec=await a47_0x27490a({'type':_0x1e8330(0x182),'name':'workflow','message':_0x1e8330(0x160),'choices':_0x2b09e4});if(!_0x1597ec[_0x1e8330(0xce)])return 0x1;_0x2f8d4c=_0x1597ec[_0x1e8330(0xce)];}if(!_0x2f8d4c[_0x1e8330(0x22a)]('.')){const _0x444f6c=this[_0x1e8330(0x116)]([],_0x382a77);if(_0x444f6c)_0x2f8d4c=_0x444f6c+'.'+_0x2f8d4c;else return console['error'](a47_0x351cd8[_0x1e8330(0x1bb)](_0x1e8330(0x1de)),_0x1e8330(0xe2)),console[_0x1e8330(0xfb)](a47_0x351cd8[_0x1e8330(0x1e5)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x107947=_0x382a77[_0x1e8330(0x152)],_0x3b105a=_0x382a77[_0x1e8330(0x1f0)],_0x5b5eb5={};if(_0x107947&&Array['isArray'](_0x107947))for(const _0x1b97fc of _0x107947){const _0x3b2b78=_0x1b97fc[_0x1e8330(0xb9)]('=');if(_0x3b2b78===-0x1)return console[_0x1e8330(0xfb)](_0x1e8330(0x1df)+_0x1b97fc),console['error'](_0x1e8330(0x195)),0x1;const _0x4da822=_0x1b97fc['substring'](0x0,_0x3b2b78),_0x3c0100=_0x1b97fc['substring'](_0x3b2b78+0x1);try{_0x5b5eb5[_0x4da822]=JSON['parse'](_0x3c0100);}catch{_0x5b5eb5[_0x4da822]=_0x3c0100;}}_0x382a77[_0x1e8330(0x19e)]&&(console[_0x1e8330(0xfb)](_0x1e8330(0x183)+_0x2f8d4c),Object[_0x1e8330(0x207)](_0x5b5eb5)[_0x1e8330(0x21f)]>0x0&&console[_0x1e8330(0xfb)]('Parameters:\x20'+JSON['stringify'](_0x5b5eb5)),_0x3b105a&&console[_0x1e8330(0xfb)](_0x1e8330(0x259)+_0x3b105a));const _0x55f0fd=await withSpinner(_0x1e8330(0x113),()=>_0x3e7934[_0x1e8330(0xce)][_0x1e8330(0x15c)](_0x2f8d4c,_0x5b5eb5,{'sessionTime':_0x3b105a}),{'verbose':_0x382a77[_0x1e8330(0x19e)]}),_0x2b08e6=_0x55f0fd['data'];console[_0x1e8330(0xfb)](_0x1e8330(0x136)),console[_0x1e8330(0xfb)](_0x1e8330(0x15f)+_0x2b08e6['id']),console[_0x1e8330(0xfb)](_0x1e8330(0x229)+_0x2b08e6[_0x1e8330(0x165)]),console['error']('\x20\x20Project:\x20'+_0x2b08e6[_0x1e8330(0x255)]?.[_0x1e8330(0x1f1)]),console[_0x1e8330(0xfb)](_0x1e8330(0x198)+_0x2b08e6[_0x1e8330(0xce)]?.[_0x1e8330(0x1f1)]);if(_0x2b08e6[_0x1e8330(0x255)]?.['id']&&_0x2b08e6['sessionId']&&_0x2b08e6['id']){const _0xaa3b44=_0x382a77['site'],_0x30fa52=getConsoleUrl(_0xaa3b44,_0x1e8330(0x155)+_0x2b08e6['project']['id']+_0x1e8330(0x1bc)+_0x2b08e6['sessionId']+'/attempt/'+_0x2b08e6['id']);console[_0x1e8330(0xfb)](_0x1e8330(0x191)+a47_0x351cd8[_0x1e8330(0x19d)](_0x30fa52));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x21d);[a47_0x2c35ad(0x20d)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a47_0x2c35ad(0x243)](_0x45750c){const _0x470b03=a47_0x2c35ad,{options:_0x4d7759,args:_0x2234ef,tdx:_0x428535}=_0x45750c,_0x5e2471=_0x2234ef[0x0],_0x4d508e=_0x2234ef[0x1]||'.';if(!_0x5e2471)return console[_0x470b03(0xfb)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x470b03(0xfb)](_0x470b03(0x1e4)),0x1;const _0x452924=_0x4d7759[_0x470b03(0x1b1)];_0x4d7759[_0x470b03(0x19e)]&&(console[_0x470b03(0xfb)](_0x470b03(0x1ff)+_0x5e2471),console[_0x470b03(0xfb)](_0x470b03(0xd9)+_0x4d508e),_0x452924&&console[_0x470b03(0xfb)](_0x470b03(0xe5)+_0x452924));const _0x1977d5=await withSpinner(_0x470b03(0x100)+_0x5e2471+_0x470b03(0x16e),()=>_0x428535[_0x470b03(0xce)][_0x470b03(0x123)](_0x5e2471,_0x4d508e,{'revision':_0x452924}),{'verbose':_0x4d7759['verbose']}),_0x17bea9=_0x1977d5[_0x470b03(0x230)];return console[_0x470b03(0xfb)](_0x470b03(0x188)+_0x17bea9['projectName']),console[_0x470b03(0xfb)](_0x470b03(0x209)+_0x17bea9[_0x470b03(0x1b1)]),console[_0x470b03(0xfb)]('\x20\x20Files\x20extracted:\x20'+_0x17bea9[_0x470b03(0xf9)]),console[_0x470b03(0xfb)](_0x470b03(0x170)+_0x4d508e+'/'+_0x17bea9[_0x470b03(0x201)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x156);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x244);async[a47_0x2c35ad(0x243)](_0x146fcc){const _0x24e909=a47_0x2c35ad,{options:_0x32e890,args:_0x202923,tdx:_0x2ec611}=_0x146fcc;let _0x4fca57='.',_0x1d4ef9=_0x32e890[_0x24e909(0x1f1)];if(_0x202923[0x0]){const {promises:_0x1d02eb}=await import('fs');try{const _0x312b88=await _0x1d02eb[_0x24e909(0x253)](_0x202923[0x0]);if(_0x312b88[_0x24e909(0x11a)]())_0x4fca57=_0x202923[0x0];else return console[_0x24e909(0xfb)]('Error:\x20'+_0x202923[0x0]+_0x24e909(0xf3)),0x1;}catch{_0x1d4ef9=_0x202923[0x0],_0x4fca57='.';}}const _0x86c5b0=_0x32e890[_0x24e909(0x1b1)],_0x580989=_0x32e890[_0x24e909(0x1f3)];_0x32e890['verbose']&&(console[_0x24e909(0xfb)](_0x24e909(0x24b)+_0x4fca57),_0x1d4ef9&&console[_0x24e909(0xfb)](_0x24e909(0x175)+_0x1d4ef9),_0x86c5b0&&console[_0x24e909(0xfb)]('Revision:\x20'+_0x86c5b0),_0x580989&&console[_0x24e909(0xfb)]('Validation:\x20skipped'));const _0x3ec6f8=await withSpinner(_0x24e909(0x138),()=>_0x2ec611[_0x24e909(0xce)][_0x24e909(0x1cf)](_0x4fca57,{'projectName':_0x1d4ef9,'revision':_0x86c5b0,'skipValidation':_0x580989}),{'verbose':_0x32e890[_0x24e909(0x19e)]}),_0x4e591e=_0x3ec6f8[_0x24e909(0x230)];return console[_0x24e909(0xfb)](_0x24e909(0x169)+_0x4e591e[_0x24e909(0x201)]),console[_0x24e909(0xfb)](_0x24e909(0x247)+_0x4e591e[_0x24e909(0x186)]),console['error'](_0x24e909(0x209)+_0x4e591e['revision']),await this[_0x24e909(0x194)](_0x2ec611,_0x4e591e[_0x24e909(0x201)],_0x32e890[_0x24e909(0xd3)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a47_0x2c35ad(0x174);[a47_0x2c35ad(0x20d)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x105533){const _0x2687dc=a47_0x2c35ad,{options:_0x5ac5f3,args:_0xbd9441,tdx:_0x1e31a3}=_0x105533,_0xbca073=_0xbd9441[0x0],_0x3b324e=_0xbd9441[0x1];if(!_0xbca073)return console[_0x2687dc(0xfb)](a47_0x351cd8[_0x2687dc(0x1bb)](_0x2687dc(0x1de)),_0x2687dc(0x14c)),console['error'](a47_0x351cd8[_0x2687dc(0x1e5)](_0x2687dc(0x114))),0x1;const _0x37f5b1=_0x5ac5f3['revision'];_0x5ac5f3['verbose']&&(console[_0x2687dc(0xfb)](_0x2687dc(0x1ff)+_0xbca073),_0x3b324e&&console[_0x2687dc(0xfb)]('Target\x20directory:\x20'+_0x3b324e),_0x37f5b1&&console[_0x2687dc(0xfb)]('Revision:\x20'+_0x37f5b1),_0x5ac5f3[_0x2687dc(0x1b8)]&&console[_0x2687dc(0xfb)](_0x2687dc(0x1d1)));const _0x54f68f=await withSpinner(_0x2687dc(0x162)+_0xbca073+_0x2687dc(0x16e),()=>_0x1e31a3['workflow'][_0x2687dc(0x250)](_0xbca073,{'targetDir':_0x3b324e,'revision':_0x37f5b1}),{'verbose':_0x5ac5f3[_0x2687dc(0x19e)]}),_0x365691=_0x54f68f[_0x2687dc(0x230)];_0x365691[_0x2687dc(0x1ca)]?console[_0x2687dc(0xfb)]('→\x20New\x20project:\x20'+_0x365691[_0x2687dc(0x201)]):console['error']('→\x20Project:\x20'+_0x365691['projectName']);console[_0x2687dc(0xfb)](_0x2687dc(0x209)+_0x365691[_0x2687dc(0x1b1)]),console[_0x2687dc(0xfb)](_0x2687dc(0x18c)+(a47_0x50b226[_0x2687dc(0x228)](process[_0x2687dc(0x196)](),_0x365691['targetDir'])||'.')),console['error'](_0x2687dc(0x215)+a47_0x351cd8[_0x2687dc(0x12b)]('+'+_0x365691['summary']['new']+_0x2687dc(0xed))+',\x20'+(a47_0x351cd8[_0x2687dc(0x143)]('~'+_0x365691[_0x2687dc(0x146)][_0x2687dc(0xb2)]+_0x2687dc(0x23b))+',\x20')+(a47_0x351cd8[_0x2687dc(0x1bb)]('-'+_0x365691['summary'][_0x2687dc(0x1fc)]+_0x2687dc(0x1b0))+',\x20')+(''+a47_0x351cd8['dim'](_0x365691[_0x2687dc(0x146)][_0x2687dc(0x1da)]+'\x20unchanged')));for(const _0x315eef of _0x365691[_0x2687dc(0x1ba)]){_0x315eef[_0x2687dc(0x12e)]===_0x2687dc(0xb2)&&_0x315eef[_0x2687dc(0x125)]&&(console[_0x2687dc(0xfb)]('\x0a'+a47_0x351cd8['cyan'](_0x2687dc(0x23c)+_0x315eef[_0x2687dc(0xe0)])),console[_0x2687dc(0xfb)](_0x315eef[_0x2687dc(0x125)]));}if(!_0x365691[_0x2687dc(0x15b)])return saveSessionContext({'workflow_project':_0x365691[_0x2687dc(0x201)]},_0x5ac5f3[_0x2687dc(0x23d)]),console[_0x2687dc(0xfb)](a47_0x351cd8[_0x2687dc(0x12b)](_0x2687dc(0x177))),console[_0x2687dc(0xfb)](a47_0x351cd8[_0x2687dc(0x1e5)](_0x2687dc(0x135)+_0x365691[_0x2687dc(0x201)])),0x0;if(_0x5ac5f3['dryRun'])return console['error'](a47_0x351cd8['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x5ac5f3[_0x2687dc(0x205)]){if(!isInteractive())return console[_0x2687dc(0xfb)](a47_0x351cd8[_0x2687dc(0x1bb)](_0x2687dc(0x109)),_0x2687dc(0xdc)),console[_0x2687dc(0xfb)](a47_0x351cd8[_0x2687dc(0x1e5)](_0x2687dc(0x25b))),0x1;const _0x24d827=await confirmKey(_0x2687dc(0x220));if(!_0x24d827)return console[_0x2687dc(0xfb)](a47_0x351cd8['yellow'](_0x2687dc(0xd4)),_0x2687dc(0x11f)),0x1;}await withSpinner(_0x2687dc(0x1d3),()=>_0x1e31a3[_0x2687dc(0xce)]['applyPullProject'](_0x365691,{'revision':_0x37f5b1}),{'verbose':_0x5ac5f3[_0x2687dc(0x19e)]}),saveSessionContext({'workflow_project':_0x365691['projectName']},_0x5ac5f3[_0x2687dc(0x23d)]),console[_0x2687dc(0xfb)](a47_0x351cd8['green']('✔\x20Pull\x20complete'));const _0x70e874=a47_0x50b226[_0x2687dc(0x228)](process[_0x2687dc(0x196)](),_0x365691[_0x2687dc(0x133)])||'.';return console['error'](a47_0x351cd8[_0x2687dc(0x1e5)](_0x2687dc(0x170)+_0x70e874)),console[_0x2687dc(0xfb)](a47_0x351cd8[_0x2687dc(0x1e5)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x365691[_0x2687dc(0x201)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x25f);['description']=a47_0x2c35ad(0x161);async[a47_0x2c35ad(0x243)](_0x46db78){const _0x5957ca=a47_0x2c35ad,{options:_0x2cca81,args:_0x47add3,tdx:_0x110cf1}=_0x46db78,_0x3c9f6e=this['resolveProjectDir'](_0x47add3,_0x2cca81),_0x526c6a=_0x2cca81['revision'],_0x92bf3c=_0x2cca81[_0x5957ca(0x1f3)];_0x2cca81[_0x5957ca(0x19e)]&&(_0x3c9f6e&&console[_0x5957ca(0xfb)](_0x5957ca(0x187)+_0x3c9f6e),_0x526c6a&&console[_0x5957ca(0xfb)](_0x5957ca(0xe5)+_0x526c6a),_0x2cca81[_0x5957ca(0x1b8)]&&console[_0x5957ca(0xfb)](_0x5957ca(0x1d1)),_0x92bf3c&&console[_0x5957ca(0xfb)](_0x5957ca(0x1d8)));let _0x3bef57;try{_0x3bef57=await withSpinner(_0x5957ca(0x22d),()=>_0x110cf1['workflow']['preparePushProject']({'sourceDir':_0x3c9f6e,'revision':_0x526c6a,'skipValidation':_0x92bf3c}),{'verbose':_0x2cca81[_0x5957ca(0x19e)]});}catch(_0xc5eef2){if(_0xc5eef2 instanceof Error&&_0xc5eef2['message'][_0x5957ca(0x22a)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x5957ca(0xfb)](a47_0x351cd8[_0x5957ca(0x1bb)](_0x5957ca(0x1de)),_0x5957ca(0x1d7)),_0x2cca81['workflowProject']?console['error'](a47_0x351cd8[_0x5957ca(0x1e5)](_0x5957ca(0x1ad)+_0x2cca81[_0x5957ca(0xe6)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x2cca81[_0x5957ca(0xe6)]+'\x27')):console[_0x5957ca(0xfb)](a47_0x351cd8['dim'](_0x5957ca(0x151))),0x1;throw _0xc5eef2;}const _0x47bc4c=_0x3bef57[_0x5957ca(0x230)];console[_0x5957ca(0xfb)](_0x5957ca(0x111)+_0x47bc4c[_0x5957ca(0x201)]),console[_0x5957ca(0xfb)](_0x5957ca(0xf7)+_0x47bc4c[_0x5957ca(0x20b)]),console[_0x5957ca(0xfb)]('\x20\x20Revision:\x20'+_0x47bc4c[_0x5957ca(0x1b1)]),console[_0x5957ca(0xfb)](_0x5957ca(0x215)+a47_0x351cd8[_0x5957ca(0x12b)]('+'+_0x47bc4c['summary']['new']+_0x5957ca(0xed))+',\x20'+(a47_0x351cd8[_0x5957ca(0x143)]('~'+_0x47bc4c[_0x5957ca(0x146)][_0x5957ca(0xb2)]+'\x20modified')+',\x20')+(a47_0x351cd8['red']('-'+_0x47bc4c['summary']['deleted']+'\x20deleted')+',\x20')+(''+a47_0x351cd8[_0x5957ca(0x1e5)](_0x47bc4c[_0x5957ca(0x146)][_0x5957ca(0x1da)]+_0x5957ca(0x235))));for(const _0x3651b0 of _0x47bc4c[_0x5957ca(0x1ba)]){_0x3651b0[_0x5957ca(0x12e)]===_0x5957ca(0xb2)&&_0x3651b0['diff']&&(console[_0x5957ca(0xfb)]('\x0a'+a47_0x351cd8[_0x5957ca(0x19d)]('---\x20'+_0x3651b0[_0x5957ca(0xe0)])),console[_0x5957ca(0xfb)](_0x3651b0[_0x5957ca(0x125)]));}if(!_0x47bc4c[_0x5957ca(0x15b)])return console[_0x5957ca(0xfb)](a47_0x351cd8[_0x5957ca(0x12b)](_0x5957ca(0x1ed))),await this['showWorkflowConsoleUrl'](_0x110cf1,_0x47bc4c[_0x5957ca(0x201)],_0x2cca81[_0x5957ca(0xd3)]),0x0;if(_0x2cca81[_0x5957ca(0x1b8)])return console['error'](a47_0x351cd8[_0x5957ca(0x143)](_0x5957ca(0x23f))),0x0;if(!_0x2cca81[_0x5957ca(0x205)]){if(!isInteractive())return console[_0x5957ca(0xfb)](a47_0x351cd8[_0x5957ca(0x1bb)](_0x5957ca(0x109)),_0x5957ca(0xdc)),console[_0x5957ca(0xfb)](a47_0x351cd8[_0x5957ca(0x1e5)](_0x5957ca(0x25b))),0x1;const _0x4643ef=await confirmKey(_0x5957ca(0x176));if(!_0x4643ef)return console[_0x5957ca(0xfb)](a47_0x351cd8[_0x5957ca(0x143)](_0x5957ca(0xd4)),_0x5957ca(0xd8)),0x1;}const _0x19bd58=await withSpinner('Pushing\x20project...',()=>_0x110cf1[_0x5957ca(0xce)][_0x5957ca(0xef)](_0x47bc4c),{'verbose':_0x2cca81[_0x5957ca(0x19e)]}),_0x4c7e87=_0x19bd58[_0x5957ca(0x230)];return console['error'](a47_0x351cd8[_0x5957ca(0x12b)]('✔\x20Push\x20complete')),console[_0x5957ca(0xfb)](_0x5957ca(0x247)+_0x4c7e87[_0x5957ca(0x186)]),console[_0x5957ca(0xfb)]('\x20\x20Revision:\x20'+_0x4c7e87[_0x5957ca(0x1b1)]),await this['showWorkflowConsoleUrl'](_0x110cf1,_0x4c7e87['projectName'],_0x2cca81[_0x5957ca(0xd3)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]='workflow:clone';[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x147);async[a47_0x2c35ad(0x243)](_0x4b6545){const _0x5d3dd5=a47_0x2c35ad,{options:_0x864cd3,args:_0x4a2b03,tdx:_0x1e2477}=_0x4b6545,_0xad6843=this[_0x5d3dd5(0x1af)](_0x4a2b03,_0x864cd3),_0x57a8e0=_0x864cd3[_0x5d3dd5(0x1f1)],_0x285fc6=_0x864cd3[_0x5d3dd5(0x1b1)],_0x29444e=_0x864cd3[_0x5d3dd5(0x1f3)];if(!_0xad6843)return console[_0x5d3dd5(0xfb)](a47_0x351cd8[_0x5d3dd5(0x1bb)](_0x5d3dd5(0x1de)),_0x5d3dd5(0x202)),console[_0x5d3dd5(0xfb)](a47_0x351cd8[_0x5d3dd5(0x1e5)](_0x5d3dd5(0x1ac))),console[_0x5d3dd5(0xfb)](a47_0x351cd8[_0x5d3dd5(0x1e5)](_0x5d3dd5(0x22f))),0x1;if(!_0x57a8e0)return console['error'](a47_0x351cd8[_0x5d3dd5(0x1bb)]('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x5d3dd5(0xfb)](a47_0x351cd8[_0x5d3dd5(0x1e5)](_0x5d3dd5(0x1ac))),0x1;_0x864cd3[_0x5d3dd5(0x19e)]&&(console['error'](_0x5d3dd5(0x187)+_0xad6843),console[_0x5d3dd5(0xfb)](_0x5d3dd5(0x1e2)+_0x57a8e0),_0x285fc6&&console[_0x5d3dd5(0xfb)](_0x5d3dd5(0xe5)+_0x285fc6),_0x864cd3[_0x5d3dd5(0x1b8)]&&console['error'](_0x5d3dd5(0x1d1)),_0x29444e&&console[_0x5d3dd5(0xfb)](_0x5d3dd5(0x1d8)));const _0x308c3d=await withSpinner(_0x5d3dd5(0x254),()=>_0x1e2477[_0x5d3dd5(0xce)][_0x5d3dd5(0xb1)](_0xad6843,_0x57a8e0,{'revision':_0x285fc6,'skipValidation':_0x29444e}),{'verbose':_0x864cd3['verbose']}),_0x377613=_0x308c3d[_0x5d3dd5(0x230)];console[_0x5d3dd5(0xfb)](_0x5d3dd5(0x20e)+_0x377613[_0x5d3dd5(0x20b)]);_0x377613[_0x5d3dd5(0x1a0)]&&console[_0x5d3dd5(0xfb)](_0x5d3dd5(0x1ce)+_0x377613[_0x5d3dd5(0x1a0)]);console[_0x5d3dd5(0xfb)](_0x5d3dd5(0x1e2)+_0x377613[_0x5d3dd5(0x226)]),console[_0x5d3dd5(0xfb)](_0x5d3dd5(0xe5)+_0x377613['revision']),console[_0x5d3dd5(0xfb)]('Files\x20to\x20upload:\x20'+_0x377613[_0x5d3dd5(0x107)]);_0x377613[_0x5d3dd5(0x1e7)]&&(console[_0x5d3dd5(0xfb)](a47_0x351cd8[_0x5d3dd5(0x143)](_0x5d3dd5(0x21b)+_0x377613[_0x5d3dd5(0x226)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x377613[_0x5d3dd5(0x251)]+')')),console[_0x5d3dd5(0xfb)](a47_0x351cd8[_0x5d3dd5(0x143)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x864cd3['dryRun'])return console[_0x5d3dd5(0xfb)](a47_0x351cd8['yellow'](_0x5d3dd5(0x13f))),0x0;if(!_0x864cd3['yes']){if(!isInteractive())return console[_0x5d3dd5(0xfb)](a47_0x351cd8[_0x5d3dd5(0x1bb)](_0x5d3dd5(0x109)),_0x5d3dd5(0xdc)),console['error'](a47_0x351cd8[_0x5d3dd5(0x1e5)](_0x5d3dd5(0x25b))),0x1;const _0x5a0100=_0x377613[_0x5d3dd5(0x1a0)]||a47_0x50b226[_0x5d3dd5(0xc8)](_0xad6843),_0x4ca42b=_0x377613[_0x5d3dd5(0x1e7)]?_0x5d3dd5(0xb4)+_0x57a8e0+_0x5d3dd5(0x1b7):_0x5d3dd5(0x14d)+_0x5a0100+_0x5d3dd5(0x1a3)+_0x57a8e0+'\x22?',_0x4a7013=await confirmKey(_0x4ca42b);if(!_0x4a7013)return console[_0x5d3dd5(0xfb)](a47_0x351cd8[_0x5d3dd5(0x143)](_0x5d3dd5(0xd4))),0x1;}const _0x342efa=await withSpinner(_0x377613[_0x5d3dd5(0x1e7)]?_0x5d3dd5(0x1dd)+_0x57a8e0+_0x5d3dd5(0x16e):_0x5d3dd5(0xec)+_0x57a8e0+_0x5d3dd5(0x16e),()=>_0x1e2477[_0x5d3dd5(0xce)][_0x5d3dd5(0x15a)](_0x377613),{'verbose':_0x864cd3['verbose']}),_0x4fd517=_0x342efa[_0x5d3dd5(0x230)];return console[_0x5d3dd5(0xfb)](a47_0x351cd8['green'](_0x377613[_0x5d3dd5(0x1e7)]?_0x5d3dd5(0x12d):_0x5d3dd5(0xbc))),console[_0x5d3dd5(0xfb)](_0x5d3dd5(0xe7)+_0x4fd517[_0x5d3dd5(0x226)]),console[_0x5d3dd5(0xfb)]('\x20\x20Project\x20ID:\x20'+_0x4fd517['newProjectId']),console[_0x5d3dd5(0xfb)]('\x20\x20Revision:\x20'+_0x4fd517[_0x5d3dd5(0x1b1)]),await this['showWorkflowConsoleUrl'](_0x1e2477,_0x4fd517[_0x5d3dd5(0x226)],_0x864cd3[_0x5d3dd5(0xd3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x178);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x219);async[a47_0x2c35ad(0x243)](_0x3ffd8f){const _0x19007b=a47_0x2c35ad,{options:_0x56db03,args:_0x5a1adc,tdx:_0x48ee82}=_0x3ffd8f,_0x3e3bdd=_0x5a1adc[0x0];if(!_0x3e3bdd)return console[_0x19007b(0xfb)](_0x19007b(0xf6)),console[_0x19007b(0xfb)](_0x19007b(0x225)),0x1;_0x56db03[_0x19007b(0x19e)]&&console[_0x19007b(0xfb)](_0x19007b(0x1ff)+_0x3e3bdd);if(!_0x56db03[_0x19007b(0x205)]){if(!isInteractive())return console['error'](a47_0x351cd8['red'](_0x19007b(0x109)),_0x19007b(0xdc)),console['error'](a47_0x351cd8['dim'](_0x19007b(0x25b))),0x1;const _0x3084c9=await confirmKey(_0x19007b(0x218)+_0x3e3bdd+_0x19007b(0x122));if(!_0x3084c9)return console[_0x19007b(0xfb)](a47_0x351cd8[_0x19007b(0x143)](_0x19007b(0xd4))),0x1;}const _0xe8d92a=await withSpinner(_0x19007b(0x1d9)+_0x3e3bdd+_0x19007b(0x16e),()=>_0x48ee82['workflow'][_0x19007b(0x13a)](_0x3e3bdd),{'verbose':_0x56db03[_0x19007b(0x19e)]}),_0x5de0e2=_0xe8d92a[_0x19007b(0x230)];return console['error'](_0x19007b(0x24c)+_0x5de0e2[_0x19007b(0x201)]),console[_0x19007b(0xfb)]('\x20\x20Project\x20ID:\x20'+_0x5de0e2[_0x19007b(0x186)]),0x0;}}export function parseKeyValue(_0x1c7538){const _0x459c53=a47_0x2c35ad,_0x45e6e7=_0x1c7538['indexOf']('=');if(_0x45e6e7===-0x1)throw new Error(_0x459c53(0x1f8)+_0x1c7538+_0x459c53(0x1ef));const _0xad320c=_0x1c7538[_0x459c53(0xd7)](0x0,_0x45e6e7),_0x5646cf=_0x1c7538[_0x459c53(0xd7)](_0x45e6e7+0x1);if(!_0xad320c)throw new Error(_0x459c53(0xf1));return{'key':_0xad320c,'value':_0x5646cf};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]='workflow:secrets:list';[a47_0x2c35ad(0x20d)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a47_0x2c35ad(0x243)](_0x9b46d3){const _0x46d713=a47_0x2c35ad,{options:_0x281dcd,args:_0x30a3f3,tdx:_0x175115}=_0x9b46d3,_0x13420a=this[_0x46d713(0x1fe)](_0x30a3f3,_0x281dcd);if(!_0x13420a)return 0x1;_0x281dcd[_0x46d713(0x19e)]&&console['error']('Project:\x20'+_0x13420a);const _0x1f7046=await withSpinner('Listing\x20secrets...',()=>_0x175115[_0x46d713(0xce)][_0x46d713(0x173)](_0x13420a),{'verbose':_0x281dcd[_0x46d713(0x19e)]}),{secrets:_0x48c21a}=_0x1f7046[_0x46d713(0x230)];return console[_0x46d713(0xfb)](_0x46d713(0xe3)+_0x48c21a[_0x46d713(0x21f)]+_0x46d713(0x1c2)+(_0x48c21a['length']!==0x1?'s':'')),await handleSDKOutput(_0x48c21a,_0x281dcd),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']='workflow:secrets:set';[a47_0x2c35ad(0x20d)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a47_0x2c35ad(0x243)](_0x5ca4e7){const _0x25e556=a47_0x2c35ad,{options:_0x292f66,args:_0x3843ce,tdx:_0x50cd8e}=_0x5ca4e7;let _0x3a19d9,_0x121119;if(_0x3843ce['length']>=0x2)_0x3a19d9=_0x3843ce[0x0],_0x121119=_0x3843ce[0x1];else{if(_0x3843ce[_0x25e556(0x21f)]===0x1&&_0x292f66[_0x25e556(0xe6)])_0x3a19d9=_0x292f66[_0x25e556(0xe6)],_0x121119=_0x3843ce[0x0];else return _0x3843ce[_0x25e556(0x21f)]===0x1?(console['error'](_0x25e556(0x193)),console[_0x25e556(0xfb)](_0x25e556(0xdd)),0x1):(console['error'](_0x25e556(0xc4)),console[_0x25e556(0xfb)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x45198f,_0x479b7a;try{({key:_0x45198f,value:_0x479b7a}=parseKeyValue(_0x121119));}catch(_0x46195e){return _0x46195e instanceof Error&&console['error'](a47_0x351cd8[_0x25e556(0x1bb)](_0x25e556(0x1de)),_0x46195e[_0x25e556(0x1a7)]),0x1;}_0x292f66['verbose']&&(console[_0x25e556(0xfb)](_0x25e556(0x1ff)+_0x3a19d9),console[_0x25e556(0xfb)](_0x25e556(0x1a1)+_0x45198f));const _0x3f77b2=await withSpinner(_0x25e556(0x15d),()=>_0x50cd8e['workflow'][_0x25e556(0x239)](_0x3a19d9,_0x45198f,_0x479b7a),{'verbose':_0x292f66[_0x25e556(0x19e)]}),_0x1ab733=_0x3f77b2[_0x25e556(0x230)];return console[_0x25e556(0xfb)](_0x25e556(0x256)+_0x1ab733['key']+_0x25e556(0x1ee)+_0x1ab733[_0x25e556(0x201)]+'\x27'),(_0x292f66[_0x25e556(0x1b3)]||_0x292f66[_0x25e556(0x1aa)])&&await handleSingleObjectOutput(_0x1ab733,_0x292f66),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]=a47_0x2c35ad(0x11e);[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x168);async['execute'](_0x3295de){const _0x586628=a47_0x2c35ad,{options:_0x1b726a,args:_0x217442,tdx:_0x31a729}=_0x3295de;let _0x2f278d,_0x4e938e;if(_0x217442[_0x586628(0x21f)]>=0x2)_0x2f278d=_0x217442[0x0],_0x4e938e=_0x217442[0x1];else{if(_0x217442[_0x586628(0x21f)]===0x1&&_0x1b726a[_0x586628(0xe6)])_0x2f278d=_0x1b726a[_0x586628(0xe6)],_0x4e938e=_0x217442[0x0];else return _0x217442[_0x586628(0x21f)]===0x1?(console[_0x586628(0xfb)](_0x586628(0x193)),console['error'](_0x586628(0xdd)),0x1):(console[_0x586628(0xfb)](_0x586628(0x12c)),console[_0x586628(0xfb)](_0x586628(0x25d)),0x1);}_0x1b726a[_0x586628(0x19e)]&&(console[_0x586628(0xfb)](_0x586628(0x1ff)+_0x2f278d),console[_0x586628(0xfb)](_0x586628(0x1a1)+_0x4e938e));if(!_0x1b726a['yes']){if(!isInteractive())return console[_0x586628(0xfb)](a47_0x351cd8['red'](_0x586628(0x109)),_0x586628(0xdc)),console[_0x586628(0xfb)](a47_0x351cd8[_0x586628(0x1e5)](_0x586628(0x25b))),0x1;const _0x2cbc0c=await confirmKey(_0x586628(0x234)+_0x4e938e+_0x586628(0xf8)+_0x2f278d+'\x27?');if(!_0x2cbc0c)return console[_0x586628(0xfb)](a47_0x351cd8[_0x586628(0x143)](_0x586628(0xd4))),0x1;}const _0x319cfc=await withSpinner(_0x586628(0x159),()=>_0x31a729[_0x586628(0xce)][_0x586628(0x115)](_0x2f278d,_0x4e938e),{'verbose':_0x1b726a[_0x586628(0x19e)]}),_0x1d09ec=_0x319cfc['data'];return console[_0x586628(0xfb)]('✔\x20Secret\x20\x27'+_0x1d09ec['key']+_0x586628(0x24d)+_0x1d09ec[_0x586628(0x201)]+'\x27'),(_0x1b726a[_0x586628(0x1b3)]||_0x1b726a[_0x586628(0x1aa)])&&await handleSingleObjectOutput(_0x1d09ec,_0x1b726a),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(_0x5a40d9){const _0x1dd4ad=a47_0x2c35ad,_0x1cb96a=Math[_0x1dd4ad(0x1c6)](_0x5a40d9/0x3e8),_0x40b6e8=Math[_0x1dd4ad(0x1c6)](_0x1cb96a/0x3c),_0x1fa0ea=Math[_0x1dd4ad(0x1c6)](_0x40b6e8/0x3c),_0xc09a02=Math[_0x1dd4ad(0x1c6)](_0x1fa0ea/0x18);if(_0xc09a02>0x0){const _0x19c2b9=_0x1fa0ea%0x18;return _0x19c2b9>0x0?_0xc09a02+'d\x20'+_0x19c2b9+'h':_0xc09a02+'d';}else{if(_0x1fa0ea>0x0){const _0x5932ca=_0x40b6e8%0x3c;return _0x5932ca>0x0?_0x1fa0ea+'h\x20'+_0x5932ca+'m':_0x1fa0ea+'h';}else{if(_0x40b6e8>0x0){const _0x679134=_0x1cb96a%0x3c;return _0x679134>0x0?_0x40b6e8+'m\x20'+_0x679134+'s':_0x40b6e8+'m';}else return _0x1cb96a+'s';}}}function formatTimestamp(_0x53b33a,_0x35bd9e){const _0x3bd0c7=a47_0x2c35ad,_0x46c6f2=new Date(_0x53b33a),_0x15e782=String(_0x46c6f2['getHours']())[_0x3bd0c7(0x20a)](0x2,'0'),_0x1f5f9a=String(_0x46c6f2[_0x3bd0c7(0x1fd)]())[_0x3bd0c7(0x20a)](0x2,'0'),_0x1a2058=_0x15e782+':'+_0x1f5f9a,_0x47e0c9=_0x46c6f2[_0x3bd0c7(0x105)]()===_0x35bd9e[_0x3bd0c7(0x105)]()&&_0x46c6f2[_0x3bd0c7(0x1b6)]()===_0x35bd9e[_0x3bd0c7(0x1b6)]()&&_0x46c6f2['getDate']()===_0x35bd9e[_0x3bd0c7(0x249)]();if(_0x47e0c9)return _0x1a2058;else{const _0x361e9e=String(_0x46c6f2[_0x3bd0c7(0x1b6)]()+0x1)[_0x3bd0c7(0x20a)](0x2,'0'),_0x462a0e=String(_0x46c6f2[_0x3bd0c7(0x249)]())[_0x3bd0c7(0x20a)](0x2,'0');return _0x361e9e+'-'+_0x462a0e+'\x20'+_0x1a2058;}}function formatDate(_0x495158){const _0x3d77db=a47_0x2c35ad,_0x4ab304=_0x495158[_0x3d77db(0x105)](),_0xe64472=String(_0x495158[_0x3d77db(0x1b6)]()+0x1)['padStart'](0x2,'0'),_0x55116c=String(_0x495158[_0x3d77db(0x249)]())['padStart'](0x2,'0');return _0x4ab304+'-'+_0xe64472+'-'+_0x55116c;}function getTaskStateIcon(_0x5517c9){const _0x2af9bc={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2af9bc[_0x5517c9]||'⚪';}function getBarChar(_0x49bc4f){const _0x54648a=a47_0x2c35ad;return _0x49bc4f===_0x54648a(0xfb)||_0x49bc4f==='group_error'?'×':'─';}function getBarColor(_0x2335d6){const _0x444d38=a47_0x2c35ad,_0x4e4303={'success':a47_0x351cd8[_0x444d38(0x12b)],'error':a47_0x351cd8[_0x444d38(0x1bb)],'group_error':a47_0x351cd8[_0x444d38(0x1bb)],'running':a47_0x351cd8[_0x444d38(0x1c8)],'blocked':a47_0x351cd8['yellow'],'planned':a47_0x351cd8[_0x444d38(0x1e5)],'canceling':a47_0x351cd8[_0x444d38(0x143)]};return _0x4e4303[_0x2335d6]||a47_0x351cd8[_0x444d38(0x101)];}function parseTaskName(_0x438020){const _0x3645c6=a47_0x2c35ad;let _0x42cacd=_0x438020[_0x3645c6(0xc2)](/^\++/,'');const _0x13cd1e=_0x42cacd[_0x3645c6(0x1b9)]('+'),_0x31b4ab=_0x13cd1e[_0x3645c6(0x21f)]>0x1?_0x13cd1e[_0x3645c6(0x21f)]-0x2:0x0,_0x5d0948=_0x13cd1e[_0x13cd1e[_0x3645c6(0x21f)]-0x1]||_0x42cacd;return{'level':_0x31b4ab,'name':'+'+_0x5d0948};}function truncateTaskName(_0x513f6a,_0xbd1dc2){const _0x5a75d4=stringWidth(_0x513f6a);if(_0x5a75d4<=_0xbd1dc2)return _0x513f6a;let _0x9056fa=_0x513f6a;while(stringWidth(_0x9056fa+'…')>_0xbd1dc2&&_0x9056fa['length']>0x0){_0x9056fa=_0x9056fa['slice'](0x0,-0x1);}return _0x9056fa+'…';}function a47_0xe19c(_0x10fcd0,_0x3d6d36){_0x10fcd0=_0x10fcd0-0xb1;const _0x508d44=a47_0x508d();let _0xe19cb0=_0x508d44[_0x10fcd0];return _0xe19cb0;}function calculateTimeScale(_0x5d7397,_0x146edb){const _0x573a46=a47_0x2c35ad;return{'startTime':_0x5d7397[_0x573a46(0x233)],'endTime':_0x5d7397[_0x573a46(0x224)],'durationMs':_0x5d7397['duration'],'msPerChar':_0x5d7397['duration']/_0x146edb};}function timeToPosition(_0x82daae,_0x1125c8,_0x204f23){const _0x5f5a39=a47_0x2c35ad,_0xccd5a4=_0x82daae-_0x1125c8['startTime'],_0x4a3f5b=Math['floor'](_0xccd5a4/_0x1125c8[_0x5f5a39(0x1fb)]);return Math[_0x5f5a39(0x137)](0x0,Math[_0x5f5a39(0xb7)](_0x4a3f5b,_0x204f23));}function renderTimeAxis(_0x1662db,_0x3e207c){const _0x36f9bd=a47_0x2c35ad,_0x1aa91e=Math[_0x36f9bd(0xb7)](TIMELINE_CONFIG[_0x36f9bd(0x103)],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x36f9bd(0x1c6)](_0x3e207c/TIMELINE_CONFIG[_0x36f9bd(0x149)]))),_0x375eff=_0x1662db[_0x36f9bd(0x22b)]/(_0x1aa91e-0x1),_0x27ec4c=new Date(_0x1662db[_0x36f9bd(0x23a)]),_0x4edc1c=[];for(let _0x21d4fb=0x0;_0x21d4fb<_0x1aa91e;_0x21d4fb++){const _0x12c22e=_0x1662db[_0x36f9bd(0x23a)]+_0x21d4fb*_0x375eff,_0x14eee6=timeToPosition(_0x12c22e,_0x1662db,_0x3e207c),_0x45d12c=formatTimestamp(_0x12c22e,_0x27ec4c);_0x4edc1c[_0x36f9bd(0x1cf)]({'pos':_0x14eee6,'text':_0x45d12c});}const _0x4cd9db=new Array(_0x3e207c)[_0x36f9bd(0x21a)]('\x20');let _0x5f1bb3=-0x1;for(const {pos:_0x21d221,text:_0x3e643c}of _0x4edc1c){let _0x3c3d7c=Math['max'](0x0,_0x21d221-Math[_0x36f9bd(0x1c6)](_0x3e643c[_0x36f9bd(0x21f)]/0x2));_0x3c3d7c<=_0x5f1bb3+TIMELINE_CONFIG[_0x36f9bd(0x189)]&&(_0x3c3d7c=_0x5f1bb3+TIMELINE_CONFIG[_0x36f9bd(0x189)]+0x1);_0x3c3d7c+_0x3e643c['length']>_0x3e207c&&(_0x3c3d7c=_0x3e207c-_0x3e643c[_0x36f9bd(0x21f)]);if(_0x3c3d7c>=0x0&&_0x3c3d7c+_0x3e643c['length']<=_0x3e207c&&_0x3c3d7c>_0x5f1bb3){for(let _0x42849a=0x0;_0x42849a<_0x3e643c[_0x36f9bd(0x21f)];_0x42849a++){_0x4cd9db[_0x3c3d7c+_0x42849a]=_0x3e643c[_0x42849a];}_0x5f1bb3=_0x3c3d7c+_0x3e643c[_0x36f9bd(0x21f)]-0x1;}}return _0x4cd9db[_0x36f9bd(0x110)]('');}function renderTaskRow(_0x7e5d0c,_0x76e3a7,_0x225246,_0x4410ac){const _0x1e7751=a47_0x2c35ad,{level:_0x312736,name:_0x50cf3b}=parseTaskName(_0x7e5d0c[_0x1e7751(0x1f1)]),_0x39cb4d='\x20'[_0x1e7751(0xc6)](_0x312736),_0xa3b48f=_0x7e5d0c[_0x1e7751(0xfa)]?'('+formatElapsed(_0x7e5d0c[_0x1e7751(0xfa)][_0x1e7751(0xe9)])+')':'',_0x5d6d23=stringWidth(_0xa3b48f),_0x5bcc6d=_0x312736*0x1,_0x599b3b=_0x4410ac-_0x5bcc6d-_0x5d6d23-0x1,_0x5d3c2a=truncateTaskName(_0x50cf3b,_0x599b3b),_0xb2424d=_0x39cb4d+_0x5d3c2a,_0x56dec1=stringWidth(_0xb2424d),_0x4fafab=_0x4410ac-_0x56dec1-_0x5d6d23,_0x2b31b1=_0xb2424d+'\x20'[_0x1e7751(0xc6)](Math[_0x1e7751(0x137)](0x1,_0x4fafab))+a47_0x351cd8[_0x1e7751(0x1e5)](_0xa3b48f),_0x25ad34=getTaskStateIcon(_0x7e5d0c[_0x1e7751(0x16b)]),_0x3a14bd=new Array(_0x225246)[_0x1e7751(0x21a)]('\x20');if(_0x7e5d0c[_0x1e7751(0xfa)]){const _0x38784a=timeToPosition(_0x7e5d0c[_0x1e7751(0xfa)][_0x1e7751(0x233)],_0x76e3a7,_0x225246),_0x175d08=timeToPosition(_0x7e5d0c[_0x1e7751(0xfa)]['end'],_0x76e3a7,_0x225246),_0x8ae984=getBarChar(_0x7e5d0c[_0x1e7751(0x16b)]),_0x2f620f=Math[_0x1e7751(0x137)](_0x38784a+0x1,_0x175d08);for(let _0x4af7b8=_0x38784a;_0x4af7b8<Math[_0x1e7751(0xb7)](_0x2f620f,_0x225246);_0x4af7b8++){_0x3a14bd[_0x4af7b8]=_0x8ae984;}}const _0x21cafb=getBarColor(_0x7e5d0c[_0x1e7751(0x16b)]),_0x4f9851=_0x3a14bd['map'](_0x173132=>_0x173132==='\x20'?'\x20':_0x21cafb(_0x173132))[_0x1e7751(0x110)]('');return _0x25ad34+'\x20'+_0x2b31b1+'│'+_0x4f9851+'│';}function calculateStats(_0x377f91){const _0x52f3fa=a47_0x2c35ad,_0x2a011d={'total':_0x377f91['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xefdce3 of _0x377f91){if(_0xefdce3[_0x52f3fa(0x16b)]===_0x52f3fa(0xc7))_0x2a011d['success']++;else{if(_0xefdce3[_0x52f3fa(0x16b)]===_0x52f3fa(0xfb)||_0xefdce3[_0x52f3fa(0x16b)]===_0x52f3fa(0xf0))_0x2a011d[_0x52f3fa(0xfb)]++;else _0xefdce3[_0x52f3fa(0x16b)]===_0x52f3fa(0x1d4)?_0x2a011d[_0x52f3fa(0x1d4)]++:_0x2a011d[_0x52f3fa(0xff)]++;}}return _0x2a011d;}function formatStats(_0x49a45b){const _0x48eb10=a47_0x2c35ad;return[_0x48eb10(0x126)+_0x49a45b[_0x48eb10(0x231)],'✅\x20'+_0x49a45b[_0x48eb10(0xc7)],'❌\x20'+_0x49a45b['error'],'🔄\x20'+_0x49a45b['running'],'⏳\x20'+_0x49a45b[_0x48eb10(0xff)]][_0x48eb10(0x110)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a47_0x2c35ad(0x1f1)]='workflow:timeline';[a47_0x2c35ad(0x20d)]=a47_0x2c35ad(0x1a4);async[a47_0x2c35ad(0x243)](_0x140c64){const _0x32ae7d=a47_0x2c35ad,{options:_0x26f37b,args:_0x4062c9,tdx:_0x34ee45}=_0x140c64;let _0x3b31b7,_0x431b2e,_0x19dcee=![];if(_0x4062c9[0x0]){if(_0x4062c9[0x0][_0x32ae7d(0x22a)]('.')){const _0x320faa=this['parseProjectWorkflowPattern'](_0x4062c9,_0x26f37b);if(!_0x320faa)return 0x1;_0x3b31b7=_0x320faa[_0x32ae7d(0x201)],_0x431b2e=_0x320faa[_0x32ae7d(0x1b4)];}else{_0x431b2e=_0x4062c9[0x0],_0x3b31b7=_0x26f37b[_0x32ae7d(0xe6)];if(!_0x3b31b7)return console[_0x32ae7d(0xfb)](a47_0x351cd8[_0x32ae7d(0x1bb)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x19dcee=!![];}}else{const _0x11b0d7=this['parseProjectWorkflowPattern'](_0x4062c9,_0x26f37b);if(!_0x11b0d7)return 0x1;_0x3b31b7=_0x11b0d7['projectName'],_0x431b2e=_0x11b0d7[_0x32ae7d(0x1b4)];}if(_0x26f37b[_0x32ae7d(0x19e)]){if(_0x3b31b7&&_0x431b2e)console[_0x32ae7d(0xfb)]('Filter:\x20'+_0x3b31b7+'.'+_0x431b2e);else _0x3b31b7&&console['error'](_0x32ae7d(0xfe)+_0x3b31b7);}const _0x113f1b=_0x26f37b['attemptId'],_0x4d7ac9=_0x26f37b[_0x32ae7d(0x165)];if(_0x113f1b){_0x4d7ac9&&console[_0x32ae7d(0xfb)](a47_0x351cd8[_0x32ae7d(0x143)](_0x32ae7d(0xdb)),_0x32ae7d(0x1e3));const _0x1792cd=_0x26f37b['follow'];return _0x1792cd?await this[_0x32ae7d(0x1cb)](_0x140c64,_0x113f1b):await this[_0x32ae7d(0x102)](_0x140c64,_0x113f1b,_0x26f37b),0x0;}if(_0x4d7ac9){const _0x47cb63=await withSpinner('Loading\x20session...',()=>_0x34ee45[_0x32ae7d(0xce)][_0x32ae7d(0x1f6)]({'projectName':_0x3b31b7,'workflowName':_0x431b2e,'limit':0x64}),{'verbose':_0x26f37b['verbose']}),_0x16f1b1=_0x47cb63[_0x32ae7d(0x230)][_0x32ae7d(0xfc)](_0x2ab8c9=>_0x2ab8c9['id']===_0x4d7ac9);if(!_0x16f1b1)return console[_0x32ae7d(0xfb)](a47_0x351cd8[_0x32ae7d(0x1bb)](_0x32ae7d(0x1de)),_0x32ae7d(0x1bd)+_0x4d7ac9),0x1;if(!_0x16f1b1['lastAttempt']?.['id'])return console[_0x32ae7d(0xfb)](a47_0x351cd8['red'](_0x32ae7d(0x1de)),_0x32ae7d(0x108)+_0x4d7ac9+'\x20has\x20no\x20attempts'),0x1;const _0xe4fc7c=_0x16f1b1[_0x32ae7d(0x1a9)]['id'];_0x26f37b['verbose']&&console[_0x32ae7d(0xfb)](_0x32ae7d(0x1b5)+_0xe4fc7c+_0x32ae7d(0x145)+_0x4d7ac9);const _0x4827dd=_0x26f37b['follow'];return _0x4827dd?await this[_0x32ae7d(0x1cb)](_0x140c64,_0xe4fc7c):await this[_0x32ae7d(0x102)](_0x140c64,_0xe4fc7c,_0x26f37b),0x0;}const _0x45d57b=await withSpinner(_0x32ae7d(0x150),()=>_0x34ee45[_0x32ae7d(0xce)]['sessions']({'projectName':_0x3b31b7,'workflowName':_0x431b2e,'limit':_0x26f37b[_0x32ae7d(0x25e)]||0x32}),{'verbose':_0x26f37b[_0x32ae7d(0x19e)]}),_0x2d6115=_0x45d57b[_0x32ae7d(0x230)];if(_0x2d6115[_0x32ae7d(0x21f)]===0x0){if(_0x3b31b7&&_0x431b2e)console[_0x32ae7d(0xfb)](_0x32ae7d(0x1ec)+_0x3b31b7+'.'+_0x431b2e);else _0x3b31b7?console[_0x32ae7d(0xfb)](_0x32ae7d(0x17e)+_0x3b31b7):(console['error'](_0x32ae7d(0xee)),console['error'](a47_0x351cd8[_0x32ae7d(0x1e5)](_0x32ae7d(0x10c))));return 0x0;}_0x2d6115[_0x32ae7d(0xba)]((_0x3df52a,_0x354fdc)=>{const _0x34aad6=_0x32ae7d,_0x350940=_0x3df52a[_0x34aad6(0x1f0)]||'',_0x990105=_0x354fdc['sessionTime']||'';return _0x990105['localeCompare'](_0x350940);});if(_0x26f37b[_0x32ae7d(0x1b3)]||_0x26f37b[_0x32ae7d(0x1aa)])return await handleSDKOutput(_0x2d6115,_0x26f37b),0x0;let _0x25376a;if(_0x19dcee){const _0x1fda04=_0x2d6115[0x0];if(!_0x1fda04[_0x32ae7d(0x1a9)]?.['id'])return console[_0x32ae7d(0xfb)](_0x32ae7d(0xf2)),0x0;_0x25376a=_0x1fda04['lastAttempt']['id'],_0x26f37b[_0x32ae7d(0x19e)]&&console[_0x32ae7d(0xfb)]('Auto-selected\x20latest\x20session:\x20'+_0x1fda04[_0x32ae7d(0x1f0)]);}else{const _0x58e81a=_0x2d6115[_0x32ae7d(0x1c4)](_0x212678=>{const _0x33cc7b=_0x32ae7d,_0xf81a58=getAttemptStatusDisplay(_0x212678[_0x33cc7b(0x1a9)]);return{'title':_0x212678[_0x33cc7b(0x255)]?.[_0x33cc7b(0x1f1)]+'.'+_0x212678[_0x33cc7b(0xce)]?.[_0x33cc7b(0x1f1)]+_0x33cc7b(0x1cd)+_0x212678[_0x33cc7b(0x1f0)]+'\x20'+_0xf81a58[_0x33cc7b(0x1f5)],'value':_0x212678[_0x33cc7b(0x1a9)]?.['id']||'','description':_0xf81a58[_0x33cc7b(0x223)]};}),_0x8ed620=await a47_0x27490a({'type':_0x32ae7d(0x182),'name':_0x32ae7d(0x16d),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x58e81a[_0x32ae7d(0x154)](_0x5e713c=>_0x5e713c['value']!=='')});if(!_0x8ed620[_0x32ae7d(0x16d)])return 0x0;_0x25376a=_0x8ed620[_0x32ae7d(0x16d)];}const _0x46c767=_0x26f37b[_0x32ae7d(0x1f9)];return _0x46c767?await this[_0x32ae7d(0x1cb)](_0x140c64,_0x25376a):await this['renderSingleTimeline'](_0x140c64,_0x25376a,_0x26f37b),0x0;}async[a47_0x2c35ad(0x102)](_0x1369ef,_0x14c5a6,_0x1f13ed){const _0x12e34c=a47_0x2c35ad,{tdx:_0x1b1429}=_0x1369ef;let _0x5142a3,_0x4fdd9d;try{[_0x5142a3,_0x4fdd9d]=await Promise[_0x12e34c(0x158)]([_0x1b1429[_0x12e34c(0xce)]['attempt'](_0x14c5a6),_0x1b1429[_0x12e34c(0xce)][_0x12e34c(0x139)](_0x14c5a6,![])]);}catch(_0x5c52c0){console['error'](a47_0x351cd8[_0x12e34c(0x1bb)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x1f13ed[_0x12e34c(0x19e)]&&console[_0x12e34c(0xfb)](_0x5c52c0);throw _0x5c52c0;}if(_0x1f13ed[_0x12e34c(0x1b3)]||_0x1f13ed['jsonl']){const _0x25411e=this[_0x12e34c(0x179)](_0x5142a3,_0x4fdd9d);await handleSDKOutput([_0x25411e],_0x1f13ed);return;}const _0x3a9ddd=_0x1b1429[_0x12e34c(0x246)][_0x12e34c(0xd3)],_0x874fc5=this[_0x12e34c(0x217)](_0x5142a3,_0x4fdd9d,_0x3a9ddd);console[_0x12e34c(0xda)](_0x874fc5);}async[a47_0x2c35ad(0x1cb)](_0x1c871b,_0x377e25){const _0x5c31e5=a47_0x2c35ad,{tdx:_0x58668a}=_0x1c871b,_0x126689=TIMELINE_CONFIG[_0x5c31e5(0xea)],_0x151149=TIMELINE_CONFIG[_0x5c31e5(0x242)];let _0x3ad835=0x0;while(_0x3ad835<_0x151149){process[_0x5c31e5(0x214)][_0x5c31e5(0x241)]&&process['stdout'][_0x5c31e5(0x131)]('\x1bc');let _0x17c0b3,_0x5c3768;try{[_0x17c0b3,_0x5c3768]=await Promise[_0x5c31e5(0x158)]([_0x58668a[_0x5c31e5(0xce)]['attempt'](_0x377e25),_0x58668a[_0x5c31e5(0xce)]['tasks'](_0x377e25,![])]);}catch(_0x1dd422){console['error'](a47_0x351cd8[_0x5c31e5(0x1bb)](_0x5c31e5(0x1e1)));_0x3ad835>0x0&&console[_0x5c31e5(0xfb)](a47_0x351cd8['dim'](_0x5c31e5(0x130)+_0x3ad835));throw _0x1dd422;}const _0x45d2bb=_0x58668a[_0x5c31e5(0x246)][_0x5c31e5(0xd3)],_0x1c2ed8=this['renderTimeline'](_0x17c0b3,_0x5c3768,_0x45d2bb);console[_0x5c31e5(0xda)](_0x1c2ed8);const _0x196cb5=_0x17c0b3[_0x5c31e5(0x11d)]&&_0x5c3768[_0x5c31e5(0x181)](_0xf64b02=>_0xf64b02[_0x5c31e5(0x16b)]!=='running'&&_0xf64b02['state']!=='planned');if(_0x196cb5){console[_0x5c31e5(0xfb)](a47_0x351cd8[_0x5c31e5(0x12b)](_0x5c31e5(0xcd)));break;}console[_0x5c31e5(0xfb)](a47_0x351cd8[_0x5c31e5(0x1e5)]('\x0aPolling...\x20('+_0x3ad835*0x2+_0x5c31e5(0x221))),await new Promise(_0x154a3d=>setTimeout(_0x154a3d,_0x126689)),_0x3ad835++;}_0x3ad835>=_0x151149&&console['error'](a47_0x351cd8[_0x5c31e5(0x143)](_0x5c31e5(0x132)));}['renderTimeline'](_0x545640,_0x5a7083,_0x557213){const _0x83d537=a47_0x2c35ad,_0x40ec50=[],_0x58de23=TIMELINE_CONFIG[_0x83d537(0x203)],_0x472511=0x5,_0x2ab961=process[_0x83d537(0x214)][_0x83d537(0x10a)]||0x78,_0x2f7698=_0x2ab961-_0x58de23-_0x472511,_0x381b18=Math[_0x83d537(0x137)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x83d537(0xb7)](_0x2f7698,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x2d162a=new Date(_0x545640[_0x83d537(0x180)])[_0x83d537(0x129)](),_0x13097d=_0x545640[_0x83d537(0x17b)]?new Date(_0x545640[_0x83d537(0x17b)])['getTime']():Date[_0x83d537(0x1eb)](),_0x9b82d2={'start':_0x2d162a,'end':_0x13097d,'duration':_0x13097d-_0x2d162a},_0x5602db=new Map(),_0x33ba94=[];for(const _0x2c3c62 of _0x5a7083){if(_0x2c3c62[_0x83d537(0x1c0)]){const _0x45cf2d=new Date(_0x2c3c62[_0x83d537(0x1c0)])[_0x83d537(0x129)](),_0x15ee04=_0x2c3c62[_0x83d537(0x1cc)]?new Date(_0x2c3c62[_0x83d537(0x1cc)])[_0x83d537(0x129)]():Date[_0x83d537(0x1eb)](),_0x453745={'start':_0x45cf2d,'end':_0x15ee04,'duration':_0x15ee04-_0x45cf2d};_0x5602db[_0x83d537(0xbe)](_0x2c3c62['id'],_0x453745),_0x33ba94[_0x83d537(0x1cf)]({'name':_0x2c3c62[_0x83d537(0x12a)],'state':_0x2c3c62['state']||_0x83d537(0xb5),'window':_0x453745});}else _0x33ba94[_0x83d537(0x1cf)]({'name':_0x2c3c62['fullName'],'state':_0x2c3c62[_0x83d537(0x16b)]||'planned','window':undefined});}_0x33ba94['sort']((_0x2be71c,_0x317793)=>{const _0x5349a9=_0x83d537;if(!_0x2be71c[_0x5349a9(0xfa)])return 0x1;if(!_0x317793[_0x5349a9(0xfa)])return-0x1;return _0x2be71c['window'][_0x5349a9(0x233)]-_0x317793[_0x5349a9(0xfa)][_0x5349a9(0x233)];});const _0x47a4a9=_0x33ba94[_0x83d537(0x21f)],_0x43867f=_0x47a4a9>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x43867f&&_0x33ba94['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x475b5a=calculateTimeScale(_0x9b82d2,_0x381b18),_0x4ad321=_0x545640['done']?_0x545640[_0x83d537(0xc7)]?a47_0x351cd8['green'](_0x83d537(0xc7)):a47_0x351cd8['red'](_0x83d537(0xfb)):a47_0x351cd8['blue']('running'),_0x2a42e9=_0x545640[_0x83d537(0x255)]?.['id'],_0x58803d=_0x545640[_0x83d537(0x165)];let _0x310b58;if(_0x2a42e9&&_0x58803d){const _0x5df8ca=getWorkflowAttemptUrl(_0x557213,_0x2a42e9,_0x58803d,_0x545640['id']);_0x310b58=hyperlink(a47_0x351cd8[_0x83d537(0x1e5)](_0x545640['id']),_0x5df8ca);}else _0x310b58=a47_0x351cd8[_0x83d537(0x1e5)](_0x545640['id']);_0x40ec50[_0x83d537(0x1cf)]('Attempt:\x20'+_0x310b58+_0x83d537(0x1cd)+_0x4ad321+_0x83d537(0x1cd)+formatElapsed(_0x9b82d2[_0x83d537(0xe9)]));if(_0x33ba94[_0x83d537(0x21f)]>0x0){const _0x3f5d35=renderTimeAxis(_0x475b5a,_0x381b18),_0x1c285d=new Date(_0x9b82d2[_0x83d537(0x233)]),_0x35b14c=formatDate(_0x1c285d),_0x41c93d=TIMELINE_CONFIG[_0x83d537(0x240)]+TIMELINE_CONFIG[_0x83d537(0x14e)]+_0x58de23,_0x2fbfa5=_0x35b14c['padStart'](_0x41c93d),_0x4b6daa=a47_0x351cd8[_0x83d537(0x1e5)](_0x2fbfa5);_0x40ec50[_0x83d537(0x1cf)](_0x4b6daa+'\x20'+_0x3f5d35);for(const _0x5b93c8 of _0x33ba94){_0x40ec50['push'](renderTaskRow(_0x5b93c8,_0x475b5a,_0x381b18,_0x58de23));}const _0xbcce28=calculateStats(_0x33ba94);_0x40ec50[_0x83d537(0x1cf)](formatStats(_0xbcce28)),_0x43867f&&_0x40ec50[_0x83d537(0x1cf)](a47_0x351cd8[_0x83d537(0x143)](_0x83d537(0x10b)+TIMELINE_CONFIG[_0x83d537(0xc5)]+_0x83d537(0x24e)+_0x47a4a9+_0x83d537(0x10d))),_0x40ec50[_0x83d537(0x1cf)](''),_0x40ec50['push'](a47_0x351cd8[_0x83d537(0x1e5)](_0x83d537(0xe8))+(_0x83d537(0x171)+_0x545640['id']+_0x83d537(0x18a))+a47_0x351cd8['dim'](_0x83d537(0x25a)));}else _0x40ec50[_0x83d537(0x1cf)](_0x83d537(0xcb));return _0x40ec50[_0x83d537(0x110)]('\x0a');}['buildTimelineData'](_0x3107c6,_0x41c4a0){const _0x2d46a1=a47_0x2c35ad,_0x5ef581=new Date(_0x3107c6[_0x2d46a1(0x180)])[_0x2d46a1(0x129)](),_0xede063=_0x3107c6['finishedAt']?new Date(_0x3107c6[_0x2d46a1(0x17b)])[_0x2d46a1(0x129)]():Date[_0x2d46a1(0x1eb)](),_0x5c33f7=_0xede063-_0x5ef581,_0x52e4ae=[];for(const _0x5b8e33 of _0x41c4a0){if(_0x5b8e33['startedAt']){const _0x376fc0=new Date(_0x5b8e33[_0x2d46a1(0x1c0)])[_0x2d46a1(0x129)](),_0x2c973b=_0x5b8e33['updatedAt']?new Date(_0x5b8e33[_0x2d46a1(0x1cc)])[_0x2d46a1(0x129)]():Date[_0x2d46a1(0x1eb)]();_0x52e4ae['push']({'name':_0x5b8e33[_0x2d46a1(0x12a)],'state':_0x5b8e33['state']||_0x2d46a1(0xb5),'window':{'start':_0x376fc0,'end':_0x2c973b,'duration':_0x2c973b-_0x376fc0}});}else _0x52e4ae['push']({'name':_0x5b8e33[_0x2d46a1(0x12a)],'state':_0x5b8e33[_0x2d46a1(0x16b)]||'planned','window':undefined});}const _0x2139ba=calculateStats(_0x52e4ae);return{'attempt':{'id':_0x3107c6['id'],'status':_0x3107c6[_0x2d46a1(0x11d)]?_0x3107c6[_0x2d46a1(0xc7)]?_0x2d46a1(0xc7):_0x2d46a1(0xfb):_0x2d46a1(0x1d4),'createdAt':_0x3107c6[_0x2d46a1(0x180)],'finishedAt':_0x3107c6[_0x2d46a1(0x17b)],'duration_ms':_0x5c33f7},'tasks':_0x52e4ae['map'](_0xa5c0e9=>({'name':_0xa5c0e9[_0x2d46a1(0x1f1)],'state':_0xa5c0e9['state'],'startedAt':_0xa5c0e9[_0x2d46a1(0xfa)]?new Date(_0xa5c0e9['window']['start'])[_0x2d46a1(0x13b)]():null,'updatedAt':_0xa5c0e9[_0x2d46a1(0xfa)]?new Date(_0xa5c0e9[_0x2d46a1(0xfa)]['end'])[_0x2d46a1(0x13b)]():null,'duration_ms':_0xa5c0e9[_0x2d46a1(0xfa)]?.[_0x2d46a1(0xe9)]||null})),'stats':_0x2139ba};}}
|
|
1
|
+
const a47_0x18ff36=a47_0x1fbc;(function(_0x269d6a,_0x3d3b39){const _0x17a331=a47_0x1fbc,_0x378150=_0x269d6a();while(!![]){try{const _0x46aa12=-parseInt(_0x17a331(0x2ec))/0x1+parseInt(_0x17a331(0x239))/0x2+-parseInt(_0x17a331(0x285))/0x3*(parseInt(_0x17a331(0x1dd))/0x4)+-parseInt(_0x17a331(0x213))/0x5*(-parseInt(_0x17a331(0x2de))/0x6)+-parseInt(_0x17a331(0x2e7))/0x7*(-parseInt(_0x17a331(0x311))/0x8)+-parseInt(_0x17a331(0x18a))/0x9+parseInt(_0x17a331(0x1a8))/0xa;if(_0x46aa12===_0x3d3b39)break;else _0x378150['push'](_0x378150['shift']());}catch(_0x2b1499){_0x378150['push'](_0x378150['shift']());}}}(a47_0x146a,0x958a6));import a47_0x2bf1fc from'chalk';import{existsSync}from'fs';import a47_0x39bbb8 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a47_0x307e4a from'prompts';function getAttemptStatusDisplay(_0x90b37e){const _0x15444f=a47_0x1fbc;if(!_0x90b37e)return{'icon':'⏳','text':''};const {done:_0x30fc06,success:_0x3bdc30,cancelRequested:_0x5ee171}=_0x90b37e;if(!_0x30fc06)return _0x5ee171?{'icon':'🛑','text':a47_0x2bf1fc[_0x15444f(0x29b)](_0x15444f(0x308))}:{'icon':'🔄','text':a47_0x2bf1fc[_0x15444f(0x2a6)](_0x15444f(0x2da))};if(_0x3bdc30)return{'icon':'✅','text':a47_0x2bf1fc['green']('success')};return{'icon':'❌','text':a47_0x2bf1fc[_0x15444f(0x2be)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a47_0x18ff36(0x2a8)](_0x5ef257,_0x441167,_0x3f1e6d=0x0){const _0x17fc47=a47_0x18ff36;return _0x5ef257[_0x3f1e6d]||_0x441167[_0x17fc47(0x18b)];}[a47_0x18ff36(0x2c8)](_0x245a7a,_0x7d6c77,_0x2922f4=0x0){const _0x2a1524=a47_0x18ff36,_0x30d758=this[_0x2a1524(0x2a8)](_0x245a7a,_0x7d6c77,_0x2922f4);if(!_0x30d758)return console[_0x2a1524(0x1b7)](a47_0x2bf1fc['red'](_0x2a1524(0x2f1)),_0x2a1524(0x2cc)),console[_0x2a1524(0x1b7)](a47_0x2bf1fc['dim'](_0x2a1524(0x230))),null;return _0x30d758;}[a47_0x18ff36(0x313)](_0x346abc,_0xb62555){const _0x1f3b8f=a47_0x18ff36;if(_0x346abc[0x0]){const _0x4b3b98=_0x346abc[0x0]['split']('.');if(_0x4b3b98[_0x1f3b8f(0x1b9)]===0x1)return{'projectName':_0x4b3b98[0x0],'workflowName':undefined};else return _0x4b3b98['length']===0x2?{'projectName':_0x4b3b98[0x0],'workflowName':_0x4b3b98[0x1]}:(console[_0x1f3b8f(0x1b7)](a47_0x2bf1fc[_0x1f3b8f(0x2be)]('Error:'),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0xb62555[_0x1f3b8f(0x18b)],'workflowName':undefined};}[a47_0x18ff36(0x232)](_0xbca06c,_0x43bbaf,_0x44b791=0x0){const _0xfdb86b=a47_0x18ff36;if(_0xbca06c[_0x44b791])return _0xbca06c[_0x44b791];if(_0x43bbaf[_0xfdb86b(0x18b)]){const _0x13b369=a47_0x39bbb8[_0xfdb86b(0x2c7)](process['cwd'](),_0xfdb86b(0x2b6),_0x43bbaf['workflowProject']);if(existsSync(a47_0x39bbb8[_0xfdb86b(0x2c7)](_0x13b369,_0xfdb86b(0x320))))return _0x13b369;}return undefined;}async[a47_0x18ff36(0x2d5)](_0x1c919c,_0x1648ff,_0x413522){const _0x1ab0c1=a47_0x18ff36;try{const _0x4d3e3e=await _0x1c919c[_0x1ab0c1(0x23c)][_0x1ab0c1(0x2b6)](_0x1648ff,{'limit':0x1});if(_0x4d3e3e[_0x1ab0c1(0x1b9)]>0x0){const _0x3b3a87=_0x4d3e3e[0x0]['id'],_0x141031=getWorkflowUrl(_0x413522,_0x3b3a87);console[_0x1ab0c1(0x1b7)](_0x1ab0c1(0x31b)+a47_0x2bf1fc[_0x1ab0c1(0x299)](_0x141031));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a47_0x18ff36(0x1cd);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2bd);async[a47_0x18ff36(0x2f8)](_0x697094){const _0x252037=a47_0x18ff36,{options:_0x51f6b6,args:_0x55acdc,tdx:_0x26cd50}=_0x697094,_0x500d0b=_0x55acdc[0x0],_0xd37580=_0x51f6b6[_0x252037(0x2ea)];if(_0xd37580)return saveSessionContext({'workflow_project':undefined},_0x51f6b6[_0x252037(0x334)]),console[_0x252037(0x1f9)](a47_0x2bf1fc[_0x252037(0x1cb)](_0x252037(0x267))),0x0;if(!_0x500d0b)return console[_0x252037(0x1b7)](a47_0x2bf1fc['red'](_0x252037(0x2f1)),'Project\x20name\x20is\x20required'),console[_0x252037(0x1b7)](a47_0x2bf1fc[_0x252037(0x22a)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x252037(0x1b7)](a47_0x2bf1fc['dim'](_0x252037(0x2e9))),0x1;const _0x50b277=await withSpinner(_0x252037(0x1d9)+_0x500d0b+_0x252037(0x2b2),()=>_0x26cd50[_0x252037(0x23c)][_0x252037(0x29a)](_0x500d0b),{'verbose':_0x51f6b6['verbose']}),{name:_0xde826e}=_0x50b277[_0x252037(0x258)];return saveSessionContext({'workflow_project':_0xde826e},_0x51f6b6[_0x252037(0x334)]),console[_0x252037(0x1f9)](a47_0x2bf1fc[_0x252037(0x1cb)](_0x252037(0x2d1)+a47_0x2bf1fc[_0x252037(0x299)](_0xde826e))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a47_0x18ff36(0x324)]='workflow:projects';[a47_0x18ff36(0x321)]=a47_0x18ff36(0x1c4);async[a47_0x18ff36(0x2f8)](_0x4dcd91){const _0xdf98c4=a47_0x18ff36,{options:_0x2927b4,args:_0x292807,tdx:_0x174add}=_0x4dcd91,_0x5dc824=_0x292807[0x0];_0x2927b4[_0xdf98c4(0x1bd)]&&_0x5dc824&&console[_0xdf98c4(0x1b7)](_0xdf98c4(0x1b8)+_0x5dc824);const _0x113b45=await withSpinner(_0xdf98c4(0x2fb),()=>_0x174add[_0xdf98c4(0x23c)][_0xdf98c4(0x329)](_0x5dc824,{'limit':_0x2927b4[_0xdf98c4(0x30e)]}),{'verbose':_0x2927b4[_0xdf98c4(0x1bd)]});let _0x3427cf=_0x113b45['data'];_0x3427cf[_0xdf98c4(0x32b)]((_0x18bb7a,_0x3349ba)=>_0x18bb7a[_0xdf98c4(0x324)][_0xdf98c4(0x240)](_0x3349ba[_0xdf98c4(0x324)]));const _0xb2ad3a=_0x2927b4[_0xdf98c4(0x30e)]||0x64,_0x4a0a83=_0x3427cf[_0xdf98c4(0x1b9)]>=_0xb2ad3a?a47_0x2bf1fc[_0xdf98c4(0x22a)](_0xdf98c4(0x1df)):'';console[_0xdf98c4(0x1b7)](_0xdf98c4(0x261)+_0x3427cf['length']+_0xdf98c4(0x2dc)+(_0x3427cf[_0xdf98c4(0x1b9)]!==0x1?'s':'')+_0x4a0a83);if(_0x2927b4[_0xdf98c4(0x2f9)]==='json'||_0x2927b4[_0xdf98c4(0x2f9)]===_0xdf98c4(0x27e)||_0x2927b4[_0xdf98c4(0x2f9)]===_0xdf98c4(0x2d7))await handleSDKOutput(_0x3427cf,_0x2927b4);else{if(_0x3427cf[_0xdf98c4(0x1b9)]===0x0)_0x5dc824?console['log'](_0xdf98c4(0x202)+_0x5dc824):console[_0xdf98c4(0x1f9)](_0xdf98c4(0x30f));else{const _0x5e9044=_0x3427cf['map'](_0x2bb5c4=>{const _0x50af4b=_0xdf98c4,_0xb45fe2=_0x2bb5c4[_0x50af4b(0x1b2)]?.[_0x50af4b(0x318)](_0x467332=>_0x467332['key']===_0x50af4b(0x283)),_0x34a7de=_0xb45fe2?a47_0x2bf1fc[_0x50af4b(0x22a)](_0x50af4b(0x1cf)):'';return'📁\x20'+_0x2bb5c4['name']+_0x34a7de;});await writeOutput(_0x5e9044[_0xdf98c4(0x2c7)]('\x0a'),_0x2927b4[_0xdf98c4(0x19c)],_0xdf98c4(0x1de));}}return 0x0;}}function a47_0x1fbc(_0x42f0d5,_0x5aa2a8){_0x42f0d5=_0x42f0d5-0x187;const _0x146a8b=a47_0x146a();let _0x1fbc3e=_0x146a8b[_0x42f0d5];return _0x1fbc3e;}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]='workflow:workflows';['description']=a47_0x18ff36(0x276);async['execute'](_0x1d82a4){const _0x56ef39=a47_0x18ff36,{options:_0x42f35b,args:_0x278b47,tdx:_0x34bbcb}=_0x1d82a4,_0x14389b=this['resolveProject'](_0x278b47,_0x42f35b);_0x42f35b[_0x56ef39(0x1bd)]&&_0x14389b&&console[_0x56ef39(0x1b7)]('Project\x20filter:\x20'+_0x14389b);const _0x5a8912=await withSpinner(_0x56ef39(0x257),()=>_0x34bbcb[_0x56ef39(0x23c)][_0x56ef39(0x2b6)](_0x14389b,{'limit':_0x42f35b[_0x56ef39(0x30e)]}),{'verbose':_0x42f35b[_0x56ef39(0x1bd)]});let _0x2964f0=_0x5a8912[_0x56ef39(0x258)];_0x2964f0[_0x56ef39(0x32b)]((_0x4e50d9,_0x1d3827)=>{const _0x1dc9e4=_0x56ef39,_0x9c46e8=_0x4e50d9['name'][_0x1dc9e4(0x240)](_0x1d3827[_0x1dc9e4(0x324)]);if(_0x9c46e8!==0x0)return _0x9c46e8;return(_0x4e50d9[_0x1dc9e4(0x2b8)]?.[_0x1dc9e4(0x324)]||'')[_0x1dc9e4(0x240)](_0x1d3827[_0x1dc9e4(0x2b8)]?.[_0x1dc9e4(0x324)]||'');});const _0x1a85b5=_0x42f35b['limit']||0x64,_0x39bec3=_0x2964f0['length']>=_0x1a85b5?a47_0x2bf1fc[_0x56ef39(0x22a)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x56ef39(0x1b7)](_0x56ef39(0x261)+_0x2964f0[_0x56ef39(0x1b9)]+_0x56ef39(0x24d)+(_0x2964f0[_0x56ef39(0x1b9)]!==0x1?'s':'')+_0x39bec3);if(_0x42f35b[_0x56ef39(0x2f9)]==='json'||_0x42f35b[_0x56ef39(0x2f9)]===_0x56ef39(0x27e)||_0x42f35b['format']===_0x56ef39(0x2d7))await handleSDKOutput(_0x2964f0,_0x42f35b);else{if(_0x2964f0[_0x56ef39(0x1b9)]===0x0)_0x14389b?console[_0x56ef39(0x1f9)](_0x56ef39(0x27a)+_0x14389b):console[_0x56ef39(0x1f9)]('No\x20workflows\x20found');else{const _0x3dd33f=_0x42f35b[_0x56ef39(0x236)],_0x1913f9=_0x2964f0['map'](_0x2ee1b2=>{const _0x58297a=_0x56ef39,_0x140cc5=a47_0x2bf1fc[_0x58297a(0x22a)]('#'+_0x2ee1b2['id']),_0x25d3a5=hyperlink(_0x140cc5,getWorkflowUrl(_0x3dd33f,_0x2ee1b2['id'])),_0x2cd75b=_0x2ee1b2[_0x58297a(0x2b8)]?.[_0x58297a(0x324)]?a47_0x2bf1fc[_0x58297a(0x22a)]('\x20('+_0x2ee1b2[_0x58297a(0x2b8)]['name']+')'):'';return _0x58297a(0x1fe)+_0x25d3a5+'\x20'+_0x2ee1b2[_0x58297a(0x324)]+_0x2cd75b;});await writeOutput(_0x1913f9[_0x56ef39(0x2c7)]('\x0a'),_0x42f35b[_0x56ef39(0x19c)],_0x56ef39(0x1de));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x286);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2ed);async[a47_0x18ff36(0x2f8)](_0x253395){const _0x4d2d44=a47_0x18ff36,{options:_0x3a43a2,args:_0x3288ac,tdx:_0x5e7933}=_0x253395,_0x383820=this[_0x4d2d44(0x313)](_0x3288ac,_0x3a43a2);if(!_0x383820)return 0x1;const {projectName:_0x31da50,workflowName:_0x439bc4}=_0x383820;if(_0x3a43a2[_0x4d2d44(0x1bd)]){if(_0x31da50&&_0x439bc4)console[_0x4d2d44(0x1b7)](_0x4d2d44(0x1d2)+_0x31da50+'.'+_0x439bc4);else _0x31da50&&console[_0x4d2d44(0x1b7)]('Filter:\x20project='+_0x31da50);const _0x14b5d2=_0x3a43a2[_0x4d2d44(0x303)];_0x14b5d2&&console[_0x4d2d44(0x1b7)](_0x4d2d44(0x1e4)+_0x14b5d2);}let _0x588872=0x28;if(process[_0x4d2d44(0x2ef)][_0x4d2d44(0x29d)]&&!_0x3a43a2[_0x4d2d44(0x19c)]&&!_0x3a43a2[_0x4d2d44(0x2f9)]){const _0x502d8e=process[_0x4d2d44(0x2ef)][_0x4d2d44(0x21b)]||0x28;_0x588872=Math[_0x4d2d44(0x1f7)](0x14,Math[_0x4d2d44(0x2a3)](_0x502d8e*0x2/0x3));}const _0x397db9=_0x3a43a2[_0x4d2d44(0x30e)]||_0x588872,_0x5e0a5f=await withSpinner(_0x4d2d44(0x30c),()=>_0x5e7933[_0x4d2d44(0x23c)]['sessions']({'projectName':_0x31da50,'workflowName':_0x439bc4,'status':_0x3a43a2['status'],'fromTime':_0x3a43a2[_0x4d2d44(0x305)],'toTime':_0x3a43a2['to'],'limit':_0x397db9}),{'verbose':_0x3a43a2[_0x4d2d44(0x1bd)]}),_0x386101=_0x5e0a5f['data'];_0x386101[_0x4d2d44(0x32b)]((_0x1e38cb,_0x15741a)=>{const _0x186dcb=_0x4d2d44,_0x4b5fb8=_0x1e38cb[_0x186dcb(0x255)]||'',_0x5b785b=_0x15741a[_0x186dcb(0x255)]||'';return _0x5b785b[_0x186dcb(0x240)](_0x4b5fb8);});_0x386101['length']>=_0x397db9?console[_0x4d2d44(0x1b7)](_0x4d2d44(0x27c)+_0x386101[_0x4d2d44(0x1b9)]+_0x4d2d44(0x1e6)+a47_0x2bf1fc[_0x4d2d44(0x22a)](_0x4d2d44(0x199))):console[_0x4d2d44(0x1b7)](_0x4d2d44(0x261)+_0x386101['length']+_0x4d2d44(0x248)+(_0x386101[_0x4d2d44(0x1b9)]!==0x1?'s':''));if(_0x3a43a2['format']===_0x4d2d44(0x222)||_0x3a43a2[_0x4d2d44(0x2f9)]===_0x4d2d44(0x27e)||_0x3a43a2[_0x4d2d44(0x2f9)]==='table')await handleSDKOutput(_0x386101,_0x3a43a2);else{if(!process[_0x4d2d44(0x2ef)][_0x4d2d44(0x29d)]||_0x3a43a2['output']){if(_0x386101[_0x4d2d44(0x1b9)]===0x0){if(_0x31da50&&_0x439bc4)console[_0x4d2d44(0x1f9)](_0x4d2d44(0x23a)+_0x31da50+'.'+_0x439bc4);else _0x31da50?console[_0x4d2d44(0x1f9)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x31da50):console[_0x4d2d44(0x1f9)](_0x4d2d44(0x1f0));}else{const _0x18bc0b=_0x3a43a2[_0x4d2d44(0x236)],_0xcf7e7a=this[_0x4d2d44(0x277)](_0x386101,_0x18bc0b);_0x3a43a2['output']?await writeOutput(_0xcf7e7a,_0x3a43a2['output'],'list'):console['log'](_0xcf7e7a);}!_0x31da50&&(console[_0x4d2d44(0x1b7)](''),console[_0x4d2d44(0x1b7)](a47_0x2bf1fc[_0x4d2d44(0x22a)](_0x4d2d44(0x224))),console[_0x4d2d44(0x1b7)](a47_0x2bf1fc[_0x4d2d44(0x22a)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a47_0x2bf1fc[_0x4d2d44(0x22a)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x386101[_0x4d2d44(0x1b9)]===0x0){if(_0x31da50&&_0x439bc4)console[_0x4d2d44(0x1f9)](_0x4d2d44(0x23a)+_0x31da50+'.'+_0x439bc4);else _0x31da50?console['log'](_0x4d2d44(0x1f4)+_0x31da50):console['log'](_0x4d2d44(0x1f0));}else await this[_0x4d2d44(0x2b7)](_0x386101,_0x253395,_0x31da50);}}return 0x0;}[a47_0x18ff36(0x277)](_0x9f5659,_0x50b275){const _0x501558=a47_0x18ff36,_0x176b0e=[],_0x284b08=new Map();let _0x29b723=Infinity,_0x3872a9=-Infinity;for(const _0x34e5e5 of _0x9f5659){if(_0x34e5e5[_0x501558(0x237)]?.[_0x501558(0x282)]){const _0x2a4ad4=new Date(_0x34e5e5[_0x501558(0x237)][_0x501558(0x282)])['getTime'](),_0xb43a10=_0x34e5e5[_0x501558(0x237)]['finishedAt']?new Date(_0x34e5e5[_0x501558(0x237)]['finishedAt'])[_0x501558(0x22e)]():Date[_0x501558(0x29c)](),_0x27cc20=_0x34e5e5[_0x501558(0x2b8)]?.[_0x501558(0x324)]||'(unknown)';!_0x284b08['has'](_0x27cc20)&&_0x284b08[_0x501558(0x1a0)](_0x27cc20,[]),_0x284b08[_0x501558(0x247)](_0x27cc20)[_0x501558(0x1e7)]({'session':_0x34e5e5,'startTime':_0x2a4ad4,'endTime':_0xb43a10,'duration':_0xb43a10-_0x2a4ad4}),_0x29b723=Math[_0x501558(0x1e8)](_0x29b723,_0x2a4ad4),_0x3872a9=Math[_0x501558(0x1f7)](_0x3872a9,_0xb43a10);}}if(_0x284b08[_0x501558(0x19e)]===0x0)return _0x501558(0x293);const _0x524021=process['stdout']['columns']||0x78,_0x1a4586=0x1e,_0x3a14d7=0x32,_0x26dbdc=0x4,_0x3fc19c=Math[_0x501558(0x1e8)](_0x3a14d7,Math[_0x501558(0x1f7)](_0x1a4586,Math['floor'](_0x524021*0.3))),_0x46df90=_0x524021-_0x3fc19c-TIMELINE_CONFIG['GUTTER']-0x3-_0x26dbdc,_0x5f5861=_0x3872a9-_0x29b723,_0x21ed05=_0x5f5861/_0x3fc19c,_0x317b86=renderTimeAxis({'startTime':_0x29b723,'endTime':_0x3872a9,'durationMs':_0x5f5861,'msPerChar':_0x21ed05},_0x3fc19c),_0x112ea6=[];for(const _0x59f14e of _0x284b08[_0x501558(0x1ca)]()){_0x112ea6[_0x501558(0x1e7)](..._0x59f14e);}_0x112ea6[_0x501558(0x32b)]((_0x20930d,_0x584792)=>_0x584792[_0x501558(0x18d)]-_0x20930d[_0x501558(0x18d)]);const _0x4fd2de=new Date(_0x29b723),_0x206607=formatDate(_0x4fd2de),_0xeb4b96=_0x26dbdc+TIMELINE_CONFIG[_0x501558(0x196)]+TIMELINE_CONFIG[_0x501558(0x31c)]+_0x46df90,_0x483806='\x20'[_0x501558(0x307)](_0xeb4b96-_0x206607[_0x501558(0x1b9)]),_0x50f434=_0x483806+a47_0x2bf1fc[_0x501558(0x22a)](_0x206607)+'\x20'+_0x317b86;_0x176b0e[_0x501558(0x1e7)](_0x50f434);const _0x1f68d9=0x16;let _0x230839=0x0;for(const _0x5e79fc of _0x112ea6){const _0x5d4122=_0x5e79fc[_0x501558(0x334)][_0x501558(0x2b8)]?.[_0x501558(0x324)]||'?',_0x40ff86=Math[_0x501558(0x1e8)](stringWidth(_0x5d4122),_0x1f68d9);_0x230839=Math[_0x501558(0x1f7)](_0x230839,_0x40ff86);}for(const _0x9fa3cf of _0x112ea6){const {session:_0x28d17d,startTime:_0x1a9196,endTime:_0x318d10,duration:_0x2d2025}=_0x9fa3cf,_0x3f708d=_0x28d17d['project']?.['id'],_0x499c70=_0x28d17d['id'],_0x55aa8f=_0x28d17d[_0x501558(0x2b8)]?.[_0x501558(0x324)]||'?',_0xa020dd=_0x28d17d['workflow']?.[_0x501558(0x324)]||'?';let _0xd84653,_0x4cb8c0;if(_0x28d17d[_0x501558(0x237)]){const _0x399a24=_0x28d17d[_0x501558(0x237)];!_0x399a24['done']?(_0xd84653=_0x399a24['cancelRequested']?'🛑':'🔄',_0x4cb8c0=_0x399a24[_0x501558(0x1fd)]?a47_0x2bf1fc[_0x501558(0x29b)]:a47_0x2bf1fc[_0x501558(0x2a6)]):(_0xd84653=_0x399a24[_0x501558(0x24f)]?'✅':'❌',_0x4cb8c0=_0x399a24[_0x501558(0x24f)]?a47_0x2bf1fc['green']:a47_0x2bf1fc[_0x501558(0x2be)]);}else _0xd84653='⏳',_0x4cb8c0=a47_0x2bf1fc[_0x501558(0x22a)];const _0x526050='#'+_0x499c70,_0x4f108a=_0x3f708d?hyperlink(_0x526050,getWorkflowSessionUrl(_0x50b275,_0x3f708d,_0x499c70)):_0x526050;let _0x1ec349=_0x55aa8f;stringWidth(_0x55aa8f)>_0x1f68d9&&(_0x1ec349=_0x55aa8f[_0x501558(0x24a)](0x0,_0x1f68d9-0x1)+'…');const _0x3696eb=a47_0x2bf1fc[_0x501558(0x22a)](_0x1ec349),_0x1af857=stringWidth(_0x1ec349),_0x5377e6='\x20'[_0x501558(0x307)](_0x230839-stringWidth(_0x1ec349)+0x2),_0x50798b='('+formatElapsed(_0x2d2025)+')',_0x8dbeb5=stringWidth(_0x50798b),_0x5ecab5=stringWidth(_0x526050),_0x4bb969=_0x5ecab5+0x1+_0x1af857+_0x5377e6['length'],_0x3ad4df=_0x46df90-_0x4bb969-_0x8dbeb5-0x1-0x8;let _0x223682=_0xa020dd;stringWidth(_0x223682)>_0x3ad4df&&(_0x223682=_0x223682['slice'](0x0,_0x3ad4df-0x1)+'…');const _0x4c851e=_0x4f108a+'\x20'+_0x3696eb+_0x5377e6+_0x223682,_0x1332e9=stringWidth(_0x4c851e),_0x411acc=_0x46df90-_0x1332e9-_0x8dbeb5,_0x574f54=_0x4c851e+'\x20'[_0x501558(0x307)](Math['max'](0x1,_0x411acc))+a47_0x2bf1fc[_0x501558(0x22a)](_0x50798b),_0x12f1de=Math[_0x501558(0x2a3)]((_0x1a9196-_0x29b723)/_0x21ed05),_0xb3c30d=Math[_0x501558(0x2a3)]((_0x318d10-_0x29b723)/_0x21ed05),_0x1a2a93=Math[_0x501558(0x1f7)](_0x12f1de+0x1,_0xb3c30d),_0x16cbf6=new Array(_0x3fc19c)[_0x501558(0x2b5)]('\x20');for(let _0x4176b1=_0x12f1de;_0x4176b1<Math['min'](_0x1a2a93,_0x3fc19c);_0x4176b1++){_0x16cbf6[_0x4176b1]='─';}const _0x582381=_0x16cbf6[_0x501558(0x2b9)](_0x4c1b4d=>_0x4c1b4d==='\x20'?'\x20':_0x4cb8c0(_0x4c1b4d))[_0x501558(0x2c7)]('');_0x176b0e['push'](_0xd84653+'\x20'+_0x574f54+'│'+_0x582381+'│');}return _0x176b0e[_0x501558(0x2c7)]('\x0a');}async['navigateSessionsInteractive'](_0x401da6,_0x3d540e,_0x297633){const _0x3f5eae=a47_0x18ff36,{options:_0x2ff0d7,tdx:_0x1abaee}=_0x3d540e,_0xb0f970=_0x2ff0d7[_0x3f5eae(0x236)],{timelineRows:_0x3a6ff2,timeAxisHeader:_0x302343}=this[_0x3f5eae(0x26f)](_0x401da6,_0xb0f970),_0x1030db=_0x3a6ff2[_0x3f5eae(0x2ad)](_0x25ae21=>_0x25ae21[_0x3f5eae(0x1b6)]);if(_0x1030db[_0x3f5eae(0x1b9)]===0x0){const _0x447545=this['renderSessionsTimeline'](_0x401da6,_0xb0f970);console[_0x3f5eae(0x1f9)](_0x447545);!_0x297633&&(console[_0x3f5eae(0x1b7)](''),console['error'](a47_0x2bf1fc['dim'](_0x3f5eae(0x224))),console[_0x3f5eae(0x1b7)](a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x3f5eae(0x21c))+'or'+a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x3f5eae(0x260))));return;}_0x302343&&console[_0x3f5eae(0x1f9)](_0x302343);const _0x5467ad=_0x3a6ff2[_0x3f5eae(0x2ad)](_0x156f8c=>_0x156f8c[_0x3f5eae(0x1b6)])[_0x3f5eae(0x2b9)](_0x521d68=>({'title':_0x521d68[_0x3f5eae(0x233)],'value':_0x521d68['attemptId']})),_0x2dd25a=process[_0x3f5eae(0x2ef)][_0x3f5eae(0x21b)]||0x3c,_0x1a0154=Math[_0x3f5eae(0x1f7)](0x28,Math['floor'](_0x2dd25a*0x2/0x3)),_0x3c59b5=await a47_0x307e4a({'type':'autocomplete','name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x5467ad,'initial':-0x1,'limit':_0x1a0154,'clearFirst':!![],'fallback':{'title':_0x3f5eae(0x1e1),'value':null},'suggest':(_0x396005,_0x517170)=>{const _0x23b1e9=_0x3f5eae;if(!_0x396005)return Promise[_0x23b1e9(0x238)](_0x517170);const _0x3e1b88=_0x517170['filter'](_0x5db783=>{const _0x2f8e4c=_0x23b1e9,_0x51f54d=_0x5db783;return _0x51f54d[_0x2f8e4c(0x279)][_0x2f8e4c(0x2ae)]()['includes'](_0x396005[_0x2f8e4c(0x2ae)]());});return Promise[_0x23b1e9(0x238)](_0x3e1b88);}}),_0x364e7c=()=>{const _0x5cc4c4=_0x3f5eae;process['stdout'][_0x5cc4c4(0x275)]('\x1b[1A\x1b[2K'),process[_0x5cc4c4(0x2ef)]['write'](_0x5cc4c4(0x290)),process['stdout'][_0x5cc4c4(0x275)](_0x5cc4c4(0x290));},_0x355cc8=_0x3c59b5&&_0x3c59b5[_0x3f5eae(0x1b6)]&&_0x3c59b5[_0x3f5eae(0x1b6)]!==null&&_0x3c59b5[_0x3f5eae(0x1b6)][_0x3f5eae(0x28a)]()!=='';if(!_0x355cc8){_0x364e7c(),console['log'](a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x3f5eae(0x1a4)));return;}_0x364e7c();const _0x3edb6a=_0x401da6[_0x3f5eae(0x197)](_0x4492f6=>_0x4492f6['lastAttempt']?.['id']===_0x3c59b5[_0x3f5eae(0x1b6)]);if(_0x3edb6a){const _0x11fb53=_0x3edb6a[_0x3f5eae(0x2b8)]?.[_0x3f5eae(0x324)]||'?',_0x5f4df0=_0x3edb6a[_0x3f5eae(0x23c)]?.[_0x3f5eae(0x324)]||'?';console['log'](_0x3f5eae(0x1c8)+a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x11fb53)+_0x3f5eae(0x2dd)+a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x5f4df0));}const _0x36de86=new WorkflowTimelineCommand();await _0x36de86[_0x3f5eae(0x2f8)]({'args':[],'options':{..._0x2ff0d7,'attemptId':_0x3c59b5[_0x3f5eae(0x1b6)]},'tdx':_0x1abaee});}['generateSessionTimelineRows'](_0x49c740,_0x2e8ce4){const _0x5d4766=a47_0x18ff36,_0x55ba5c=new Map();for(const _0x146da1 of _0x49c740){_0x146da1['id']&&_0x146da1['lastAttempt']?.['id']&&_0x55ba5c[_0x5d4766(0x1a0)](_0x146da1['id'],_0x146da1['lastAttempt']['id']);}const _0x394130=[];let _0x34c70b='';const _0x58c286=this['renderSessionsTimeline'](_0x49c740,_0x2e8ce4),_0x54cb10=_0x58c286[_0x5d4766(0x1b5)]('\x0a');for(const _0x517b86 of _0x54cb10){if(_0x517b86[_0x5d4766(0x265)](_0x5d4766(0x25c))||_0x517b86[_0x5d4766(0x1a5)](/^\s+\d{4}-\d{2}-\d{2}/))_0x34c70b=_0x517b86;else{if(_0x517b86[_0x5d4766(0x1a5)](/^[✅❌🔄🛑⏳]/)){const _0x31a54a=_0x517b86['match'](/#(\d+)/),_0x436389=_0x31a54a?_0x31a54a[0x1]:null,_0x2eaf96=_0x436389?_0x55ba5c[_0x5d4766(0x247)](_0x436389)||null:null,_0x2c7fea=_0x49c740[_0x5d4766(0x197)](_0x1230a4=>_0x1230a4['id']===_0x436389),_0x55330d=_0x2c7fea?.['project']?.[_0x5d4766(0x324)]||'';_0x394130[_0x5d4766(0x1e7)]({'displayLine':_0x517b86,'attemptId':_0x2eaf96,'projectName':_0x55330d});}}}return{'timelineRows':_0x394130,'timeAxisHeader':_0x34c70b};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]='workflow:attempts';[a47_0x18ff36(0x321)]=a47_0x18ff36(0x1f1);async['execute'](_0x22846b){const _0x318c9a=a47_0x18ff36,{options:_0x34628b,args:_0x5374bf,tdx:_0x418e4d}=_0x22846b,_0x540908=this['parseProjectWorkflowPattern'](_0x5374bf,_0x34628b);if(!_0x540908)return 0x1;const {projectName:_0x5e6abc,workflowName:_0x8c71d6}=_0x540908,_0x424892=_0x34628b[_0x318c9a(0x18c)];if(_0x34628b[_0x318c9a(0x1bd)]){if(_0x5e6abc&&_0x8c71d6)console['error'](_0x318c9a(0x1d2)+_0x5e6abc+'.'+_0x8c71d6);else _0x5e6abc&&console[_0x318c9a(0x1b7)](_0x318c9a(0x24e)+_0x5e6abc);_0x424892&&console[_0x318c9a(0x1b7)](_0x318c9a(0x272));}const _0x3ad320=await withSpinner(_0x318c9a(0x259),()=>_0x418e4d[_0x318c9a(0x23c)]['attempts']({'projectName':_0x5e6abc,'workflowName':_0x8c71d6,'includeRetried':_0x424892,'limit':_0x34628b[_0x318c9a(0x30e)]}),{'verbose':_0x34628b[_0x318c9a(0x1bd)]}),_0x4386ce=_0x3ad320[_0x318c9a(0x258)],_0xcd2ab1=_0x34628b[_0x318c9a(0x30e)]||0x64,_0x3675ec=_0x4386ce[_0x318c9a(0x1b9)]>=_0xcd2ab1?a47_0x2bf1fc[_0x318c9a(0x22a)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x318c9a(0x1b7)]('✔\x20Found\x20'+_0x4386ce[_0x318c9a(0x1b9)]+_0x318c9a(0x29e)+(_0x4386ce[_0x318c9a(0x1b9)]!==0x1?'s':'')+_0x3675ec);if(_0x34628b[_0x318c9a(0x2f9)]===_0x318c9a(0x222)||_0x34628b[_0x318c9a(0x2f9)]===_0x318c9a(0x27e)||_0x34628b[_0x318c9a(0x2f9)]===_0x318c9a(0x2d7))await handleSDKOutput(_0x4386ce,_0x34628b);else{if(_0x4386ce[_0x318c9a(0x1b9)]===0x0){if(_0x5e6abc&&_0x8c71d6)console[_0x318c9a(0x1f9)](_0x318c9a(0x1dc)+_0x5e6abc+'.'+_0x8c71d6);else _0x5e6abc?console[_0x318c9a(0x1f9)](_0x318c9a(0x319)+_0x5e6abc):console[_0x318c9a(0x1f9)](_0x318c9a(0x187));}else{const _0x591846=_0x34628b[_0x318c9a(0x236)],_0x58d62d=_0x4386ce[_0x318c9a(0x2b9)](_0x462b18=>{const _0x448b6f=_0x318c9a,_0x28d22b=a47_0x2bf1fc[_0x448b6f(0x22a)]('#'+_0x462b18['id']),_0x5ac592=_0x462b18[_0x448b6f(0x2b8)]?.['id'],_0x409e37=_0x462b18['session_id']||_0x462b18[_0x448b6f(0x2d8)],_0x1209a0=_0x5ac592&&_0x409e37?hyperlink(_0x28d22b,getWorkflowAttemptUrl(_0x591846,_0x5ac592,_0x409e37,_0x462b18['id'])):_0x28d22b,{icon:_0x360cff,text:_0x2ddb1e}=getAttemptStatusDisplay(_0x462b18),_0xf4d07a=(_0x462b18[_0x448b6f(0x2b8)]?.[_0x448b6f(0x324)]||'?')+'.'+(_0x462b18['workflow']?.[_0x448b6f(0x324)]||'?'),_0x413759=_0x462b18[_0x448b6f(0x255)]?a47_0x2bf1fc['dim'](_0x462b18['sessionTime']):'';return(_0x1209a0+'\x20'+_0x360cff+(_0x2ddb1e?'\x20'+_0x2ddb1e:'')+'\x20'+_0xf4d07a+'\x20'+_0x413759)[_0x448b6f(0x323)]();});await writeOutput(_0x58d62d[_0x318c9a(0x2c7)]('\x0a'),_0x34628b['output'],_0x318c9a(0x1de));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x1fb);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x217);async['execute'](_0x5acd02){const _0x2b7962=a47_0x18ff36,{options:_0x33ebcb,args:_0x43030f,tdx:_0x53068e}=_0x5acd02,_0x1b5ff3=_0x43030f[0x0];if(!_0x1b5ff3)return console[_0x2b7962(0x1b7)](_0x2b7962(0x271)),0x1;_0x33ebcb[_0x2b7962(0x1bd)]&&console[_0x2b7962(0x1b7)]('Attempt\x20ID:\x20'+_0x1b5ff3);const _0x4f40bb=await withSpinner(_0x2b7962(0x22f),()=>_0x53068e['workflow'][_0x2b7962(0x1da)](_0x1b5ff3),{'verbose':_0x33ebcb['verbose']}),_0x33ad98=_0x4f40bb['data'];let _0xe41b5c;!_0x33ad98[_0x2b7962(0x32f)]?_0xe41b5c=_0x33ad98[_0x2b7962(0x1fd)]?_0x2b7962(0x308):'running':_0xe41b5c=_0x33ad98[_0x2b7962(0x24f)]?'success':_0x2b7962(0x1b7);let _0x293971;if(_0x33ad98['createdAt']&&_0x33ad98['finishedAt']){const _0x192330=new Date(_0x33ad98['createdAt'])[_0x2b7962(0x22e)](),_0x1c6654=new Date(_0x33ad98['finishedAt'])[_0x2b7962(0x22e)]();_0x293971=Math[_0x2b7962(0x1e5)]((_0x1c6654-_0x192330)/0x3e8);}const _0x3d19c8={'attempt_id':_0x33ad98['id'],'status':_0xe41b5c,..._0x33ad98[_0x2b7962(0x225)]!==undefined&&{'index':_0x33ad98['index']},..._0x33ad98[_0x2b7962(0x2b8)]&&{'project':_0x33ad98['project'][_0x2b7962(0x324)]},..._0x33ad98[_0x2b7962(0x23c)]&&{'workflow':_0x33ad98[_0x2b7962(0x23c)][_0x2b7962(0x324)]},..._0x33ad98[_0x2b7962(0x2d8)]&&{'session_id':_0x33ad98[_0x2b7962(0x2d8)]},..._0x33ad98[_0x2b7962(0x255)]&&{'session_time':_0x33ad98[_0x2b7962(0x255)]},..._0x33ad98[_0x2b7962(0x30d)]&&{'retry_attempt':_0x33ad98[_0x2b7962(0x30d)]},..._0x293971!==undefined&&{'duration_sec':_0x293971},..._0x33ad98[_0x2b7962(0x282)]&&{'created_at':_0x33ad98[_0x2b7962(0x282)]},..._0x33ad98['finishedAt']&&{'finished_at':_0x33ad98[_0x2b7962(0x2f0)]},...Object[_0x2b7962(0x20a)](_0x33ad98['params'])[_0x2b7962(0x1b9)]>0x0&&{'params':_0x33ad98[_0x2b7962(0x302)]}};return await handleSingleObjectOutput(_0x3d19c8,_0x33ebcb),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a47_0x18ff36(0x1a7);[a47_0x18ff36(0x321)]='Show\x20tasks\x20for\x20an\x20attempt';async[a47_0x18ff36(0x2f8)](_0x414a75){const _0x57f10e=a47_0x18ff36,{options:_0x1e57b4,args:_0x398234,tdx:_0x19b174}=_0x414a75,_0x2ddb8d=_0x398234[0x0];if(!_0x2ddb8d)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x5452ce=_0x1e57b4[_0x57f10e(0x312)];_0x1e57b4['verbose']&&(console[_0x57f10e(0x1b7)]('Attempt\x20ID:\x20'+_0x2ddb8d),_0x5452ce&&console[_0x57f10e(0x1b7)](_0x57f10e(0x241)));const _0x390459=await withSpinner(_0x57f10e(0x32d),()=>_0x19b174['workflow']['tasks'](_0x2ddb8d,_0x5452ce||![]),{'verbose':_0x1e57b4[_0x57f10e(0x1bd)]}),_0x64b925=_0x390459[_0x57f10e(0x258)];return console[_0x57f10e(0x1b7)](_0x57f10e(0x261)+_0x64b925[_0x57f10e(0x1b9)]+'\x20task'+(_0x64b925[_0x57f10e(0x1b9)]!==0x1?'s':'')),await handleSDKOutput(_0x64b925,_0x1e57b4),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x229);['description']=a47_0x18ff36(0x327);async[a47_0x18ff36(0x2f8)](_0x50fcd2){const _0xb7bfce=a47_0x18ff36,{options:_0x1b8e24,args:_0x4bf257,tdx:_0x191bc3}=_0x50fcd2,_0x487eeb=_0x4bf257[0x0];let _0x5f5438=_0x4bf257[0x1];if(!_0x487eeb)return console['error'](_0xb7bfce(0x271)),0x1;_0x1b8e24['verbose']&&(console[_0xb7bfce(0x1b7)](_0xb7bfce(0x281)+_0x487eeb),_0x5f5438&&console[_0xb7bfce(0x1b7)]('Task\x20name:\x20'+_0x5f5438));const _0x358e3c=await withSpinner(_0xb7bfce(0x2ac),()=>_0x191bc3[_0xb7bfce(0x23c)][_0xb7bfce(0x1e2)](_0x487eeb,_0x5f5438),{'verbose':_0x1b8e24[_0xb7bfce(0x1bd)]}),_0x2b5cd9=_0x358e3c[_0xb7bfce(0x258)];if(_0x2b5cd9['length']===0x0)return console[_0xb7bfce(0x1b7)](_0xb7bfce(0x331)),0x0;if(!_0x5f5438&&(_0x1b8e24[_0xb7bfce(0x222)]||_0x1b8e24[_0xb7bfce(0x2f9)]))return await handleSDKOutput(_0x2b5cd9,_0x1b8e24),0x0;if(!_0x5f5438){const _0x3d6d0f=_0x2b5cd9['map'](_0x107e0d=>({'title':_0x107e0d[_0xb7bfce(0x1c2)]+'\x20('+formatBytes(_0x107e0d[_0xb7bfce(0x1ff)])+')','value':_0x107e0d[_0xb7bfce(0x1c2)]})),_0x43e1f1=await a47_0x307e4a({'type':_0xb7bfce(0x1f8),'name':_0xb7bfce(0x231),'message':_0xb7bfce(0x218),'choices':_0x3d6d0f});if(!_0x43e1f1[_0xb7bfce(0x231)])return console['error']('Cancelled'),0x0;_0x5f5438=_0x43e1f1[_0xb7bfce(0x231)];}const _0x1242ab=await withSpinner(_0xb7bfce(0x1a6),()=>_0x191bc3['workflow'][_0xb7bfce(0x28d)](_0x487eeb,_0x5f5438),{'verbose':_0x1b8e24[_0xb7bfce(0x1bd)]}),_0x5bd48d=_0x1242ab[_0xb7bfce(0x258)];return _0x5bd48d?console[_0xb7bfce(0x1f9)](_0x5bd48d):console[_0xb7bfce(0x1b7)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x262);['description']=a47_0x18ff36(0x2f7);async[a47_0x18ff36(0x2f8)](_0x2d9815){const _0x5e178c=a47_0x18ff36,{options:_0x432146,args:_0x5c43d3,tdx:_0x22698d}=_0x2d9815,_0x59ae06=_0x5c43d3[0x0];if(!_0x59ae06)return console[_0x5e178c(0x1b7)](_0x5e178c(0x271)),0x1;const _0x46cc89=_0x432146['reason'];_0x432146[_0x5e178c(0x1bd)]&&(console[_0x5e178c(0x1b7)](_0x5e178c(0x281)+_0x59ae06),_0x46cc89&&console[_0x5e178c(0x1b7)](_0x5e178c(0x32c)+_0x46cc89));if(!_0x432146[_0x5e178c(0x316)]){if(!isInteractive())return console['error'](a47_0x2bf1fc[_0x5e178c(0x2be)](_0x5e178c(0x1db)),_0x5e178c(0x19f)),console[_0x5e178c(0x1b7)](a47_0x2bf1fc[_0x5e178c(0x22a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x217321=await confirmKey(_0x5e178c(0x335)+_0x59ae06+'?');if(!_0x217321)return console[_0x5e178c(0x1b7)](a47_0x2bf1fc['yellow']('Cancelled')),0x1;}const _0x255271=await withSpinner('Killing\x20attempt...',()=>_0x22698d[_0x5e178c(0x23c)]['kill'](_0x59ae06,_0x46cc89),{'verbose':_0x432146[_0x5e178c(0x1bd)]}),_0x3d504a=_0x255271[_0x5e178c(0x258)];return console['error']('✔\x20'+_0x3d504a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x294);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x26d);async[a47_0x18ff36(0x2f8)](_0x55d70c){const _0xf271aa=a47_0x18ff36,{options:_0x58ab5d,args:_0x34a726,tdx:_0x37f91d}=_0x55d70c,_0x2ee4d3=_0x34a726[0x0];if(!_0x2ee4d3)return console['error'](_0xf271aa(0x28c)),console[_0xf271aa(0x1b7)](_0xf271aa(0x2a5)),0x1;let _0x570fa4=![],_0x59d138=_0x2ee4d3;if(_0x2ee4d3[_0xf271aa(0x265)](_0xf271aa(0x20f)))_0x570fa4=!![],_0x59d138=_0x2ee4d3[_0xf271aa(0x314)](0x8);else{if(_0x2ee4d3[_0xf271aa(0x265)](_0xf271aa(0x1ea)))_0x570fa4=![],_0x59d138=_0x2ee4d3[_0xf271aa(0x314)](0x8);else return console[_0xf271aa(0x1b7)](_0xf271aa(0x201)),console[_0xf271aa(0x1b7)](_0xf271aa(0x2a5)),0x1;}const _0x6c4e24=_0x58ab5d[_0xf271aa(0x18f)],_0x7c31e7=_0x58ab5d['resumeFrom'],_0x59d29e=_0x58ab5d[_0xf271aa(0x302)],_0x4fc9c4=_0x58ab5d[_0xf271aa(0x2c0)];_0x58ab5d[_0xf271aa(0x1bd)]&&(console['error'](_0xf271aa(0x2f5)+(_0x570fa4?'session':_0xf271aa(0x1da))+'\x20'+_0x59d138),_0x6c4e24&&console[_0xf271aa(0x1b7)](_0xf271aa(0x26b)+_0x6c4e24),_0x7c31e7&&console[_0xf271aa(0x1b7)]('Resume\x20from:\x20'+_0x7c31e7),_0x59d29e&&console[_0xf271aa(0x1b7)]('Params:\x20'+_0x59d29e),_0x4fc9c4&&console[_0xf271aa(0x1b7)]('Force:\x20yes'));let _0xf8020a;if(_0x59d29e)try{if(_0x59d29e[_0xf271aa(0x265)]('@')){const _0x4a93af=await import('fs/promises'),_0x92d686=_0x59d29e['substring'](0x1),_0x2239df=await _0x4a93af[_0xf271aa(0x2d0)](_0x92d686,_0xf271aa(0x1d6));_0xf8020a=JSON[_0xf271aa(0x18e)](_0x2239df);}else _0xf8020a=JSON[_0xf271aa(0x18e)](_0x59d29e);}catch{return console[_0xf271aa(0x1b7)](_0xf271aa(0x27f)),0x1;}if(!_0x58ab5d[_0xf271aa(0x316)]){if(!isInteractive())return console[_0xf271aa(0x1b7)](a47_0x2bf1fc[_0xf271aa(0x2be)]('\x0aError:'),_0xf271aa(0x19f)),console['error'](a47_0x2bf1fc[_0xf271aa(0x22a)](_0xf271aa(0x2c5))),0x1;const _0x790bc=await confirmKey(_0xf271aa(0x2d6)+(_0x570fa4?'session':_0xf271aa(0x1da))+'\x20'+_0x59d138+'?');if(!_0x790bc)return console[_0xf271aa(0x1b7)](a47_0x2bf1fc[_0xf271aa(0x29b)]('Cancelled')),0x1;}let _0x1e46f0;_0x570fa4?_0x1e46f0=await withSpinner(_0xf271aa(0x1c7),()=>_0x37f91d[_0xf271aa(0x23c)][_0xf271aa(0x1d3)](_0x59d138,{'fromTask':_0x6c4e24,'retryParams':_0xf8020a}),{'verbose':_0x58ab5d[_0xf271aa(0x1bd)]}):_0x1e46f0=await withSpinner(_0xf271aa(0x2db),()=>_0x37f91d[_0xf271aa(0x23c)][_0xf271aa(0x203)](_0x59d138,{'resumeFrom':_0x7c31e7,'retryParams':_0xf8020a,'force':_0x4fc9c4}),{'verbose':_0x58ab5d[_0xf271aa(0x1bd)]});const _0x20c53e=_0x1e46f0[_0xf271aa(0x258)];return console[_0xf271aa(0x1b7)](_0xf271aa(0x2fa)),console[_0xf271aa(0x1b7)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x20c53e[_0xf271aa(0x1b6)]),console[_0xf271aa(0x1b7)](_0xf271aa(0x2ba)+_0x20c53e[_0xf271aa(0x2d8)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x1d1);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2ff);async[a47_0x18ff36(0x2f8)](_0x55ef63){const _0xa3ee3a=a47_0x18ff36,{options:_0x262ff4,args:_0x204eab,tdx:_0xbd59d0}=_0x55ef63;let _0x4fc333=_0x204eab[0x0];if(!_0x4fc333){const _0x2f88bf=this['resolveProject']([],_0x262ff4),_0x24941d=await withSpinner('Loading\x20workflows...',()=>_0xbd59d0[_0xa3ee3a(0x23c)][_0xa3ee3a(0x2b6)](_0x2f88bf,{'limit':_0x262ff4[_0xa3ee3a(0x30e)]}),{'verbose':_0x262ff4[_0xa3ee3a(0x1bd)]}),_0x30ff9=_0x24941d[_0xa3ee3a(0x258)];if(_0x30ff9[_0xa3ee3a(0x1b9)]===0x0)return console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x315)),!_0x2f88bf&&console[_0xa3ee3a(0x1b7)](a47_0x2bf1fc[_0xa3ee3a(0x22a)](_0xa3ee3a(0x230))),0x1;const _0x5c5ac9=_0x30ff9[_0xa3ee3a(0x2b9)](_0x123430=>({'title':_0x123430[_0xa3ee3a(0x2b8)]?.[_0xa3ee3a(0x324)]+'.'+_0x123430[_0xa3ee3a(0x324)],'value':_0x123430[_0xa3ee3a(0x2b8)]?.[_0xa3ee3a(0x324)]+'.'+_0x123430[_0xa3ee3a(0x324)],'description':_0x123430['revision']?'revision:\x20'+_0x123430[_0xa3ee3a(0x207)]:undefined})),_0x15231f=await a47_0x307e4a({'type':_0xa3ee3a(0x1f8),'name':_0xa3ee3a(0x23c),'message':_0xa3ee3a(0x289),'choices':_0x5c5ac9});if(!_0x15231f[_0xa3ee3a(0x23c)])return 0x1;_0x4fc333=_0x15231f['workflow'];}if(!_0x4fc333[_0xa3ee3a(0x214)]('.')){const _0x3234dc=this['resolveProject']([],_0x262ff4);if(_0x3234dc)_0x4fc333=_0x3234dc+'.'+_0x4fc333;else return console[_0xa3ee3a(0x1b7)](a47_0x2bf1fc[_0xa3ee3a(0x2be)]('Error:'),_0xa3ee3a(0x208)),console['error'](a47_0x2bf1fc['dim'](_0xa3ee3a(0x230))),0x1;}const _0x1590c9=_0x262ff4['param'],_0x5d507a=_0x262ff4[_0xa3ee3a(0x255)],_0x40ada1={};if(_0x1590c9&&Array[_0xa3ee3a(0x301)](_0x1590c9))for(const _0x5e64f9 of _0x1590c9){const _0x124f9c=_0x5e64f9[_0xa3ee3a(0x219)]('=');if(_0x124f9c===-0x1)return console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x273)+_0x5e64f9),console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x337)),0x1;const _0x20684c=_0x5e64f9[_0xa3ee3a(0x314)](0x0,_0x124f9c),_0x50304f=_0x5e64f9[_0xa3ee3a(0x314)](_0x124f9c+0x1);try{_0x40ada1[_0x20684c]=JSON[_0xa3ee3a(0x18e)](_0x50304f);}catch{_0x40ada1[_0x20684c]=_0x50304f;}}_0x262ff4[_0xa3ee3a(0x1bd)]&&(console['error'](_0xa3ee3a(0x1f6)+_0x4fc333),Object[_0xa3ee3a(0x20a)](_0x40ada1)['length']>0x0&&console['error'](_0xa3ee3a(0x2c6)+JSON[_0xa3ee3a(0x2d4)](_0x40ada1)),_0x5d507a&&console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x245)+_0x5d507a));const _0x302163=await withSpinner(_0xa3ee3a(0x21d),()=>_0xbd59d0[_0xa3ee3a(0x23c)]['run'](_0x4fc333,_0x40ada1,{'sessionTime':_0x5d507a}),{'verbose':_0x262ff4[_0xa3ee3a(0x1bd)]}),_0x1c7eab=_0x302163[_0xa3ee3a(0x258)];console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x22d)),console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x254)+_0x1c7eab['id']),console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x2ba)+_0x1c7eab[_0xa3ee3a(0x2d8)]),console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x206)+_0x1c7eab['project']?.[_0xa3ee3a(0x324)]),console['error'](_0xa3ee3a(0x300)+_0x1c7eab[_0xa3ee3a(0x23c)]?.['name']);if(_0x1c7eab['project']?.['id']&&_0x1c7eab[_0xa3ee3a(0x2d8)]&&_0x1c7eab['id']){const _0x5e6712=_0x262ff4[_0xa3ee3a(0x236)],_0x1973c3=getConsoleUrl(_0x5e6712,_0xa3ee3a(0x2a9)+_0x1c7eab['project']['id']+_0xa3ee3a(0x1a2)+_0x1c7eab[_0xa3ee3a(0x2d8)]+'/attempt/'+_0x1c7eab['id']);console['error']('\x20\x20Console:\x20'+a47_0x2bf1fc['cyan'](_0x1973c3));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a47_0x18ff36(0x324)]='workflow:download';[a47_0x18ff36(0x321)]=a47_0x18ff36(0x25e);async[a47_0x18ff36(0x2f8)](_0x1f66d0){const _0x3d2801=a47_0x18ff36,{options:_0x282abb,args:_0x5bc288,tdx:_0x3025c2}=_0x1f66d0,_0x5f5c85=_0x5bc288[0x0],_0x4967a8=_0x5bc288[0x1]||'.';if(!_0x5f5c85)return console[_0x3d2801(0x1b7)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x3d2801(0x190)),0x1;const _0x447c2b=_0x282abb['revision'];_0x282abb[_0x3d2801(0x1bd)]&&(console['error'](_0x3d2801(0x1c8)+_0x5f5c85),console['error'](_0x3d2801(0x298)+_0x4967a8),_0x447c2b&&console[_0x3d2801(0x1b7)](_0x3d2801(0x27b)+_0x447c2b));const _0x51b0a4=await withSpinner(_0x3d2801(0x310)+_0x5f5c85+'...',()=>_0x3025c2['workflow'][_0x3d2801(0x264)](_0x5f5c85,_0x4967a8,{'revision':_0x447c2b}),{'verbose':_0x282abb[_0x3d2801(0x1bd)]}),_0x1c871e=_0x51b0a4['data'];return console['error'](_0x3d2801(0x1e9)+_0x1c871e[_0x3d2801(0x2af)]),console[_0x3d2801(0x1b7)]('\x20\x20Revision:\x20'+_0x1c871e['revision']),console[_0x3d2801(0x1b7)](_0x3d2801(0x325)+_0x1c871e['filesExtracted']),console[_0x3d2801(0x1b7)]('\x20\x20Location:\x20'+_0x4967a8+'/'+_0x1c871e[_0x3d2801(0x2af)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x31f);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2bf);async[a47_0x18ff36(0x2f8)](_0x139790){const _0x2e2bc5=a47_0x18ff36,{options:_0x2c4f3f,args:_0x3c4cd3,tdx:_0x388d9b}=_0x139790;let _0xe17e6f='.',_0x5834fb=_0x2c4f3f[_0x2e2bc5(0x324)];if(_0x3c4cd3[0x0]){const {promises:_0x4a7319}=await import('fs');try{const _0x5eec65=await _0x4a7319[_0x2e2bc5(0x1d7)](_0x3c4cd3[0x0]);if(_0x5eec65[_0x2e2bc5(0x2e6)]())_0xe17e6f=_0x3c4cd3[0x0];else return console[_0x2e2bc5(0x1b7)](_0x2e2bc5(0x2bb)+_0x3c4cd3[0x0]+_0x2e2bc5(0x317)),0x1;}catch{_0x5834fb=_0x3c4cd3[0x0],_0xe17e6f='.';}}const _0x225bc3=_0x2c4f3f[_0x2e2bc5(0x207)],_0x50faf7=_0x2c4f3f[_0x2e2bc5(0x2e0)];_0x2c4f3f[_0x2e2bc5(0x1bd)]&&(console['error'](_0x2e2bc5(0x280)+_0xe17e6f),_0x5834fb&&console[_0x2e2bc5(0x1b7)]('Project\x20name:\x20'+_0x5834fb),_0x225bc3&&console['error'](_0x2e2bc5(0x27b)+_0x225bc3),_0x50faf7&&console[_0x2e2bc5(0x1b7)](_0x2e2bc5(0x242)));const _0x4d1d8b=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x388d9b['workflow'][_0x2e2bc5(0x1e7)](_0xe17e6f,{'projectName':_0x5834fb,'revision':_0x225bc3,'skipValidation':_0x50faf7}),{'verbose':_0x2c4f3f['verbose']}),_0x2c1616=_0x4d1d8b[_0x2e2bc5(0x258)];return console[_0x2e2bc5(0x1b7)](_0x2e2bc5(0x2c4)+_0x2c1616[_0x2e2bc5(0x2af)]),console[_0x2e2bc5(0x1b7)]('\x20\x20Project\x20ID:\x20'+_0x2c1616['projectId']),console[_0x2e2bc5(0x1b7)](_0x2e2bc5(0x2b3)+_0x2c1616[_0x2e2bc5(0x207)]),await this[_0x2e2bc5(0x2d5)](_0x388d9b,_0x2c1616['projectName'],_0x2c4f3f[_0x2e2bc5(0x236)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x1be);['description']=a47_0x18ff36(0x330);async[a47_0x18ff36(0x2f8)](_0x5b5c6f){const _0x3f8db7=a47_0x18ff36,{options:_0x4ecfc4,args:_0x1d7317,tdx:_0x265fe3}=_0x5b5c6f,_0x4e1361=_0x1d7317[0x0],_0x317ebd=_0x1d7317[0x1];if(!_0x4e1361)return console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x2be)](_0x3f8db7(0x2f1)),_0x3f8db7(0x2cc)),console['error'](a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x3f8db7(0x2c1))),0x1;const _0x2139e3=_0x4ecfc4[_0x3f8db7(0x207)];_0x4ecfc4[_0x3f8db7(0x1bd)]&&(console[_0x3f8db7(0x1b7)](_0x3f8db7(0x1c8)+_0x4e1361),_0x317ebd&&console[_0x3f8db7(0x1b7)]('Target\x20directory:\x20'+_0x317ebd),_0x2139e3&&console[_0x3f8db7(0x1b7)](_0x3f8db7(0x27b)+_0x2139e3),_0x4ecfc4[_0x3f8db7(0x2fe)]&&console[_0x3f8db7(0x1b7)](_0x3f8db7(0x2e4)));const _0x444af1=await withSpinner('Pulling\x20project\x20'+_0x4e1361+'...',()=>_0x265fe3[_0x3f8db7(0x23c)][_0x3f8db7(0x2d9)](_0x4e1361,{'targetDir':_0x317ebd,'revision':_0x2139e3}),{'verbose':_0x4ecfc4['verbose']}),_0x290e92=_0x444af1[_0x3f8db7(0x258)];_0x290e92['isNewProject']?console[_0x3f8db7(0x1b7)](_0x3f8db7(0x2e1)+_0x290e92[_0x3f8db7(0x2af)]):console['error'](_0x3f8db7(0x1c9)+_0x290e92[_0x3f8db7(0x2af)]);console['error'](_0x3f8db7(0x2b3)+_0x290e92[_0x3f8db7(0x207)]),console['error'](_0x3f8db7(0x1a9)+(a47_0x39bbb8['relative'](process[_0x3f8db7(0x194)](),_0x290e92[_0x3f8db7(0x336)])||'.')),console[_0x3f8db7(0x1b7)](_0x3f8db7(0x1c3)+a47_0x2bf1fc[_0x3f8db7(0x1cb)]('+'+_0x290e92['summary']['new']+'\x20new')+',\x20'+(a47_0x2bf1fc['yellow']('~'+_0x290e92[_0x3f8db7(0x246)]['modified']+_0x3f8db7(0x204))+',\x20')+(a47_0x2bf1fc[_0x3f8db7(0x2be)]('-'+_0x290e92[_0x3f8db7(0x246)][_0x3f8db7(0x2cb)]+_0x3f8db7(0x31d))+',\x20')+(''+a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x290e92[_0x3f8db7(0x246)][_0x3f8db7(0x309)]+'\x20unchanged')));for(const _0x2c6631 of _0x290e92['changes']){_0x2c6631['type']===_0x3f8db7(0x243)&&_0x2c6631['diff']&&(console[_0x3f8db7(0x1b7)]('\x0a'+a47_0x2bf1fc['cyan'](_0x3f8db7(0x23e)+_0x2c6631[_0x3f8db7(0x1aa)])),console[_0x3f8db7(0x1b7)](_0x2c6631[_0x3f8db7(0x30b)]));}if(!_0x290e92[_0x3f8db7(0x2e5)])return saveSessionContext({'workflow_project':_0x290e92[_0x3f8db7(0x2af)]},_0x4ecfc4[_0x3f8db7(0x334)]),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x1cb)](_0x3f8db7(0x256))),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x3f8db7(0x209)+_0x290e92[_0x3f8db7(0x2af)])),0x0;if(_0x4ecfc4[_0x3f8db7(0x2fe)])return console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x29b)](_0x3f8db7(0x25a))),0x0;if(!_0x4ecfc4['yes']){if(!isInteractive())return console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x2be)](_0x3f8db7(0x1db)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x3f8db7(0x2c5))),0x1;const _0x4a755a=await confirmKey(_0x3f8db7(0x2cd));if(!_0x4a755a)return console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x29b)]('Cancelled'),_0x3f8db7(0x205)),0x1;}await withSpinner(_0x3f8db7(0x2ee),()=>_0x265fe3[_0x3f8db7(0x23c)][_0x3f8db7(0x1cc)](_0x290e92,{'revision':_0x2139e3}),{'verbose':_0x4ecfc4[_0x3f8db7(0x1bd)]}),saveSessionContext({'workflow_project':_0x290e92[_0x3f8db7(0x2af)]},_0x4ecfc4[_0x3f8db7(0x334)]),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x1cb)](_0x3f8db7(0x2df)));const _0x7f5b02=a47_0x39bbb8[_0x3f8db7(0x234)](process['cwd'](),_0x290e92[_0x3f8db7(0x336)])||'.';return console['error'](a47_0x2bf1fc['dim'](_0x3f8db7(0x249)+_0x7f5b02)),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x3f8db7(0x209)+_0x290e92[_0x3f8db7(0x2af)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a47_0x18ff36(0x1d5);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x1bb);async[a47_0x18ff36(0x2f8)](_0x4b781d){const _0x3b165a=a47_0x18ff36,{options:_0xf3c339,args:_0x5bff7f,tdx:_0x14b294}=_0x4b781d,_0x2ff822=this[_0x3b165a(0x232)](_0x5bff7f,_0xf3c339),_0x4f2fcd=_0xf3c339[_0x3b165a(0x207)],_0x4e89c6=_0xf3c339[_0x3b165a(0x2e0)];_0xf3c339[_0x3b165a(0x1bd)]&&(_0x2ff822&&console['error']('Source\x20directory:\x20'+_0x2ff822),_0x4f2fcd&&console['error'](_0x3b165a(0x27b)+_0x4f2fcd),_0xf3c339[_0x3b165a(0x2fe)]&&console[_0x3b165a(0x1b7)](_0x3b165a(0x2e4)),_0x4e89c6&&console[_0x3b165a(0x1b7)]('Validation:\x20skipped'));let _0x57e419;try{_0x57e419=await withSpinner(_0x3b165a(0x268),()=>_0x14b294['workflow'][_0x3b165a(0x251)]({'sourceDir':_0x2ff822,'revision':_0x4f2fcd,'skipValidation':_0x4e89c6}),{'verbose':_0xf3c339[_0x3b165a(0x1bd)]});}catch(_0x5d67ae){if(_0x5d67ae instanceof Error&&_0x5d67ae[_0x3b165a(0x21e)][_0x3b165a(0x214)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x2be)]('Error:'),_0x3b165a(0x228)),_0xf3c339['workflowProject']?console['error'](a47_0x2bf1fc['dim'](_0x3b165a(0x31a)+_0xf3c339[_0x3b165a(0x18b)]+_0x3b165a(0x189)+_0xf3c339[_0x3b165a(0x18b)]+'\x27')):console[_0x3b165a(0x1b7)](a47_0x2bf1fc['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x5d67ae;}const _0x1dea32=_0x57e419[_0x3b165a(0x258)];console[_0x3b165a(0x1b7)](_0x3b165a(0x250)+_0x1dea32['projectName']),console['error']('\x20\x20Source:\x20'+_0x1dea32[_0x3b165a(0x22b)]),console[_0x3b165a(0x1b7)]('\x20\x20Revision:\x20'+_0x1dea32['revision']),console[_0x3b165a(0x1b7)]('\x20\x20Changes:\x20'+a47_0x2bf1fc['green']('+'+_0x1dea32['summary']['new']+_0x3b165a(0x23f))+',\x20'+(a47_0x2bf1fc[_0x3b165a(0x29b)]('~'+_0x1dea32[_0x3b165a(0x246)][_0x3b165a(0x243)]+_0x3b165a(0x204))+',\x20')+(a47_0x2bf1fc[_0x3b165a(0x2be)]('-'+_0x1dea32[_0x3b165a(0x246)]['deleted']+_0x3b165a(0x31d))+',\x20')+(''+a47_0x2bf1fc[_0x3b165a(0x22a)](_0x1dea32[_0x3b165a(0x246)][_0x3b165a(0x309)]+'\x20unchanged')));for(const _0x40d7c7 of _0x1dea32[_0x3b165a(0x326)]){_0x40d7c7[_0x3b165a(0x27d)]===_0x3b165a(0x243)&&_0x40d7c7['diff']&&(console[_0x3b165a(0x1b7)]('\x0a'+a47_0x2bf1fc['cyan'](_0x3b165a(0x23e)+_0x40d7c7['path'])),console[_0x3b165a(0x1b7)](_0x40d7c7[_0x3b165a(0x30b)]));}if(!_0x1dea32[_0x3b165a(0x2e5)])return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x1cb)](_0x3b165a(0x191))),await this[_0x3b165a(0x2d5)](_0x14b294,_0x1dea32[_0x3b165a(0x2af)],_0xf3c339[_0x3b165a(0x236)]),0x0;if(_0xf3c339[_0x3b165a(0x2fe)])return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x29b)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0xf3c339['yes']){if(!isInteractive())return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x2be)]('\x0aError:'),_0x3b165a(0x19f)),console['error'](a47_0x2bf1fc[_0x3b165a(0x22a)](_0x3b165a(0x2c5))),0x1;const _0x49db41=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x49db41)return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x29b)](_0x3b165a(0x1a4)),_0x3b165a(0x2b0)),0x1;}const _0x96e0f1=await withSpinner(_0x3b165a(0x2eb),()=>_0x14b294[_0x3b165a(0x23c)][_0x3b165a(0x2f6)](_0x1dea32),{'verbose':_0xf3c339[_0x3b165a(0x1bd)]}),_0x1edbbc=_0x96e0f1[_0x3b165a(0x258)];return console['error'](a47_0x2bf1fc[_0x3b165a(0x1cb)](_0x3b165a(0x22c))),console[_0x3b165a(0x1b7)]('\x20\x20Project\x20ID:\x20'+_0x1edbbc['projectId']),console[_0x3b165a(0x1b7)](_0x3b165a(0x2b3)+_0x1edbbc[_0x3b165a(0x207)]),await this[_0x3b165a(0x2d5)](_0x14b294,_0x1edbbc['projectName'],_0xf3c339['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';['description']=a47_0x18ff36(0x278);async[a47_0x18ff36(0x2f8)](_0x57970b){const _0x149d0c=a47_0x18ff36,{options:_0x120837,args:_0x1ede6e,tdx:_0x4dfd6d}=_0x57970b,_0x561bce=this[_0x149d0c(0x232)](_0x1ede6e,_0x120837),_0x2efdbc=_0x120837['name'],_0x54976b=_0x120837[_0x149d0c(0x207)],_0x70ec99=_0x120837['skipValidation'];if(!_0x561bce)return console[_0x149d0c(0x1b7)](a47_0x2bf1fc[_0x149d0c(0x2be)]('Error:'),_0x149d0c(0x1b3)),console[_0x149d0c(0x1b7)](a47_0x2bf1fc['dim'](_0x149d0c(0x211))),console['error'](a47_0x2bf1fc[_0x149d0c(0x22a)](_0x149d0c(0x1eb))),0x1;if(!_0x2efdbc)return console[_0x149d0c(0x1b7)](a47_0x2bf1fc['red']('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x149d0c(0x1b7)](a47_0x2bf1fc['dim'](_0x149d0c(0x211))),0x1;_0x120837[_0x149d0c(0x1bd)]&&(console['error'](_0x149d0c(0x19b)+_0x561bce),console['error'](_0x149d0c(0x2e8)+_0x2efdbc),_0x54976b&&console['error'](_0x149d0c(0x27b)+_0x54976b),_0x120837[_0x149d0c(0x2fe)]&&console[_0x149d0c(0x1b7)](_0x149d0c(0x2e4)),_0x70ec99&&console[_0x149d0c(0x1b7)](_0x149d0c(0x242)));const _0x3dede2=await withSpinner(_0x149d0c(0x19a),()=>_0x4dfd6d['workflow'][_0x149d0c(0x25d)](_0x561bce,_0x2efdbc,{'revision':_0x54976b,'skipValidation':_0x70ec99}),{'verbose':_0x120837[_0x149d0c(0x1bd)]}),_0x36dbe7=_0x3dede2[_0x149d0c(0x258)];console[_0x149d0c(0x1b7)](_0x149d0c(0x2b1)+_0x36dbe7[_0x149d0c(0x22b)]);_0x36dbe7[_0x149d0c(0x26e)]&&console['error'](_0x149d0c(0x1ab)+_0x36dbe7[_0x149d0c(0x26e)]);console[_0x149d0c(0x1b7)](_0x149d0c(0x2e8)+_0x36dbe7[_0x149d0c(0x26c)]),console[_0x149d0c(0x1b7)]('Revision:\x20'+_0x36dbe7[_0x149d0c(0x207)]),console['error'](_0x149d0c(0x2a2)+_0x36dbe7[_0x149d0c(0x24c)]);_0x36dbe7[_0x149d0c(0x2a7)]&&(console[_0x149d0c(0x1b7)](a47_0x2bf1fc[_0x149d0c(0x29b)]('\x0a⚠\x20Project\x20\x22'+_0x36dbe7[_0x149d0c(0x26c)]+_0x149d0c(0x296)+_0x36dbe7['existingProjectId']+')')),console[_0x149d0c(0x1b7)](a47_0x2bf1fc['yellow'](_0x149d0c(0x2bc))));if(_0x120837[_0x149d0c(0x2fe)])return console[_0x149d0c(0x1b7)](a47_0x2bf1fc['yellow'](_0x149d0c(0x2c9))),0x0;if(!_0x120837[_0x149d0c(0x316)]){if(!isInteractive())return console[_0x149d0c(0x1b7)](a47_0x2bf1fc['red'](_0x149d0c(0x1db)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x149d0c(0x1b7)](a47_0x2bf1fc[_0x149d0c(0x22a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x19c5f9=_0x36dbe7['sourceProjectName']||a47_0x39bbb8['basename'](_0x561bce),_0x29324a=_0x36dbe7[_0x149d0c(0x2a7)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x2efdbc+_0x149d0c(0x1d0):_0x149d0c(0x288)+_0x19c5f9+_0x149d0c(0x2ca)+_0x2efdbc+'\x22?',_0x5a104c=await confirmKey(_0x29324a);if(!_0x5a104c)return console['error'](a47_0x2bf1fc[_0x149d0c(0x29b)](_0x149d0c(0x1a4))),0x1;}const _0x1b0c25=await withSpinner(_0x36dbe7['targetExists']?_0x149d0c(0x1bf)+_0x2efdbc+_0x149d0c(0x2ce):_0x149d0c(0x1ec)+_0x2efdbc+'...',()=>_0x4dfd6d[_0x149d0c(0x23c)]['executeCloneProject'](_0x36dbe7),{'verbose':_0x120837[_0x149d0c(0x1bd)]}),_0x54c1ef=_0x1b0c25[_0x149d0c(0x258)];return console[_0x149d0c(0x1b7)](a47_0x2bf1fc[_0x149d0c(0x1cb)](_0x36dbe7[_0x149d0c(0x2a7)]?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console[_0x149d0c(0x1b7)](_0x149d0c(0x206)+_0x54c1ef[_0x149d0c(0x26c)]),console['error'](_0x149d0c(0x19d)+_0x54c1ef[_0x149d0c(0x2d3)]),console['error']('\x20\x20Revision:\x20'+_0x54c1ef[_0x149d0c(0x207)]),await this[_0x149d0c(0x2d5)](_0x4dfd6d,_0x54c1ef['newProjectName'],_0x120837[_0x149d0c(0x236)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a47_0x18ff36(0x21a);[a47_0x18ff36(0x321)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a47_0x18ff36(0x2f8)](_0x2ceeb1){const _0x50c7fb=a47_0x18ff36,{options:_0x5217cc,args:_0x5007ce,tdx:_0x311989}=_0x2ceeb1,_0x343d66=_0x5007ce[0x0];if(!_0x343d66)return console['error'](_0x50c7fb(0x1d8)),console['error'](_0x50c7fb(0x284)),0x1;_0x5217cc[_0x50c7fb(0x1bd)]&&console[_0x50c7fb(0x1b7)]('Project:\x20'+_0x343d66);if(!_0x5217cc['yes']){if(!isInteractive())return console[_0x50c7fb(0x1b7)](a47_0x2bf1fc['red'](_0x50c7fb(0x1db)),_0x50c7fb(0x19f)),console[_0x50c7fb(0x1b7)](a47_0x2bf1fc[_0x50c7fb(0x22a)](_0x50c7fb(0x2c5))),0x1;const _0x2267a0=await confirmKey(_0x50c7fb(0x2cf)+_0x343d66+_0x50c7fb(0x2f2));if(!_0x2267a0)return console[_0x50c7fb(0x1b7)](a47_0x2bf1fc[_0x50c7fb(0x29b)](_0x50c7fb(0x1a4))),0x1;}const _0x2d4550=await withSpinner(_0x50c7fb(0x1af)+_0x343d66+_0x50c7fb(0x2ce),()=>_0x311989[_0x50c7fb(0x23c)][_0x50c7fb(0x25b)](_0x343d66),{'verbose':_0x5217cc[_0x50c7fb(0x1bd)]}),_0x259c68=_0x2d4550[_0x50c7fb(0x258)];return console['error'](_0x50c7fb(0x32e)+_0x259c68[_0x50c7fb(0x2af)]),console[_0x50c7fb(0x1b7)](_0x50c7fb(0x19d)+_0x259c68[_0x50c7fb(0x244)]),0x0;}}export function parseKeyValue(_0x53cfee){const _0x4908c0=a47_0x18ff36,_0x1dbde5=_0x53cfee[_0x4908c0(0x219)]('=');if(_0x1dbde5===-0x1)throw new Error(_0x4908c0(0x1f3)+_0x53cfee+_0x4908c0(0x328));const _0x1bfed3=_0x53cfee[_0x4908c0(0x314)](0x0,_0x1dbde5),_0x151b5c=_0x53cfee['substring'](_0x1dbde5+0x1);if(!_0x1bfed3)throw new Error(_0x4908c0(0x1ac));return{'key':_0x1bfed3,'value':_0x151b5c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x220);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2f4);async[a47_0x18ff36(0x2f8)](_0x3adf8c){const _0x5952c4=a47_0x18ff36,{options:_0x275777,args:_0x2b7cb1,tdx:_0x567498}=_0x3adf8c,_0x5da783=this['requireProject'](_0x2b7cb1,_0x275777);if(!_0x5da783)return 0x1;_0x275777[_0x5952c4(0x1bd)]&&console[_0x5952c4(0x1b7)](_0x5952c4(0x1c8)+_0x5da783);const _0x5bbe6e=await withSpinner('Listing\x20secrets...',()=>_0x567498[_0x5952c4(0x23c)][_0x5952c4(0x193)](_0x5da783),{'verbose':_0x275777['verbose']}),{secrets:_0xe805b}=_0x5bbe6e['data'];return console[_0x5952c4(0x1b7)](_0x5952c4(0x261)+_0xe805b[_0x5952c4(0x1b9)]+_0x5952c4(0x2e2)+(_0xe805b['length']!==0x1?'s':'')),await handleSDKOutput(_0xe805b,_0x275777),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x1f2);['description']=a47_0x18ff36(0x269);async[a47_0x18ff36(0x2f8)](_0x93afcb){const _0x3d0e37=a47_0x18ff36,{options:_0x407dde,args:_0x421213,tdx:_0x4b403c}=_0x93afcb;let _0x12460b,_0x53f602;if(_0x421213[_0x3d0e37(0x1b9)]>=0x2)_0x12460b=_0x421213[0x0],_0x53f602=_0x421213[0x1];else{if(_0x421213[_0x3d0e37(0x1b9)]===0x1&&_0x407dde['workflowProject'])_0x12460b=_0x407dde[_0x3d0e37(0x18b)],_0x53f602=_0x421213[0x0];else return _0x421213[_0x3d0e37(0x1b9)]===0x1?(console['error'](_0x3d0e37(0x192)),console[_0x3d0e37(0x1b7)](_0x3d0e37(0x230)),0x1):(console[_0x3d0e37(0x1b7)](_0x3d0e37(0x1ce)),console[_0x3d0e37(0x1b7)](_0x3d0e37(0x210)),0x1);}let _0x1c690d,_0x3fba0e;try{({key:_0x1c690d,value:_0x3fba0e}=parseKeyValue(_0x53f602));}catch(_0x4f787d){return _0x4f787d instanceof Error&&console['error'](a47_0x2bf1fc[_0x3d0e37(0x2be)](_0x3d0e37(0x2f1)),_0x4f787d[_0x3d0e37(0x21e)]),0x1;}_0x407dde[_0x3d0e37(0x1bd)]&&(console[_0x3d0e37(0x1b7)](_0x3d0e37(0x1c8)+_0x12460b),console['error'](_0x3d0e37(0x1ae)+_0x1c690d));const _0x4be714=await withSpinner('Setting\x20secret...',()=>_0x4b403c[_0x3d0e37(0x23c)][_0x3d0e37(0x1ed)](_0x12460b,_0x1c690d,_0x3fba0e),{'verbose':_0x407dde['verbose']}),_0x515ac9=_0x4be714[_0x3d0e37(0x258)];return console[_0x3d0e37(0x1b7)](_0x3d0e37(0x1b0)+_0x515ac9['key']+_0x3d0e37(0x1ef)+_0x515ac9[_0x3d0e37(0x2af)]+'\x27'),(_0x407dde[_0x3d0e37(0x222)]||_0x407dde[_0x3d0e37(0x27e)])&&await handleSingleObjectOutput(_0x515ac9,_0x407dde),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']='workflow:secrets:delete';['description']=a47_0x18ff36(0x212);async['execute'](_0x436642){const _0x4f3aa7=a47_0x18ff36,{options:_0x574014,args:_0x3d80d8,tdx:_0x496e1d}=_0x436642;let _0x2490d9,_0x55edd7;if(_0x3d80d8['length']>=0x2)_0x2490d9=_0x3d80d8[0x0],_0x55edd7=_0x3d80d8[0x1];else{if(_0x3d80d8['length']===0x1&&_0x574014[_0x4f3aa7(0x18b)])_0x2490d9=_0x574014['workflowProject'],_0x55edd7=_0x3d80d8[0x0];else return _0x3d80d8['length']===0x1?(console[_0x4f3aa7(0x1b7)](_0x4f3aa7(0x192)),console['error'](_0x4f3aa7(0x230)),0x1):(console[_0x4f3aa7(0x1b7)](_0x4f3aa7(0x270)),console[_0x4f3aa7(0x1b7)](_0x4f3aa7(0x20e)),0x1);}_0x574014['verbose']&&(console[_0x4f3aa7(0x1b7)]('Project:\x20'+_0x2490d9),console[_0x4f3aa7(0x1b7)](_0x4f3aa7(0x1ae)+_0x55edd7));if(!_0x574014[_0x4f3aa7(0x316)]){if(!isInteractive())return console[_0x4f3aa7(0x1b7)](a47_0x2bf1fc['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4f3aa7(0x1b7)](a47_0x2bf1fc[_0x4f3aa7(0x22a)](_0x4f3aa7(0x2c5))),0x1;const _0x522ea3=await confirmKey(_0x4f3aa7(0x1c1)+_0x55edd7+_0x4f3aa7(0x23b)+_0x2490d9+'\x27?');if(!_0x522ea3)return console['error'](a47_0x2bf1fc[_0x4f3aa7(0x29b)](_0x4f3aa7(0x1a4))),0x1;}const _0x270ffd=await withSpinner('Deleting\x20secret...',()=>_0x496e1d['workflow']['deleteSecret'](_0x2490d9,_0x55edd7),{'verbose':_0x574014['verbose']}),_0x298197=_0x270ffd[_0x4f3aa7(0x258)];return console['error']('✔\x20Secret\x20\x27'+_0x298197[_0x4f3aa7(0x20c)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x298197[_0x4f3aa7(0x2af)]+'\x27'),(_0x574014[_0x4f3aa7(0x222)]||_0x574014['jsonl'])&&await handleSingleObjectOutput(_0x298197,_0x574014),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 a47_0x146a(){const _0x261830=['changes','Show\x20logs\x20for\x20a\x20workflow\x20attempt','.\x20Expected\x20format:\x20KEY=VALUE','projects','MIN_TIMELINE_WIDTH','sort','Reason:\x20','Getting\x20attempt\x20tasks...','✔\x20Deleted\x20project\x20','done','Pull\x20workflow\x20project\x20to\x20local\x20folder','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20logs','workflowName','session','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','targetDir','Expected\x20format:\x20--param\x20key=value','No\x20attempts\x20found','getHours','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','2612322NsXDDz','workflowProject','includeRetried','startTime','parse','fromTask','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x0a✔\x20No\x20changes\x20to\x20push','Error:\x20Project\x20name\x20is\x20required','listSecrets','cwd','startedAt','ICON_WIDTH','find','POLL_INTERVAL_MS','(use\x20--limit\x20to\x20see\x20more)','Analyzing\x20project...','Source\x20directory:\x20','output','\x20\x20Project\x20ID:\x20','size','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','set','value','/sessions/','Session\x20not\x20found:\x20','Cancelled','match','Downloading\x20logs...','workflow:tasks','11754220msYJZw','\x20\x20Target:\x20','path','Source\x20project:\x20','Key\x20cannot\x20be\x20empty','planned','Key:\x20','Deleting\x20project\x20','✔\x20Secret\x20\x27','Failed\x20to\x20fetch\x20attempt\x20data','metadata','Source\x20directory\x20is\x20required','🔄\x20','split','attemptId','error','Pattern:\x20','length','state','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','LABEL_WIDTH_DIVISOR','verbose','workflow:pull','Updating\x20','MAX_TASKS_DISPLAY','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','taskName','\x20\x20Changes:\x20','List\x20all\x20workflow\x20projects','total','LABEL_MIN_SPACING','Retrying\x20session...','Project:\x20','→\x20Project:\x20','values','green','applyPullProject','workflow:use','Error:\x20KEY=VALUE\x20is\x20required','\x20(system)','\x22\x20with\x20new\x20revision?','workflow:run','Filter:\x20','retrySession','end','workflow:push','utf-8','stat','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Resolving\x20project\x20\x27','attempt','\x0aError:','No\x20attempts\x20found\x20for:\x20','32cawFCG','list','\x20(use\x20--limit\x20to\x20show\x20more)','durationMs','No\x20matching\x20sessions\x20found','logFiles','MAX_LABEL_COUNT','Status:\x20','round','\x20sessions\x20','push','min','✔\x20Downloaded\x20','attempt:','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Cloning\x20to\x20','setSecret','\x20from\x20session\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','No\x20sessions\x20found','List\x20workflow\x20attempts','workflow:secrets:set','Invalid\x20format:\x20','No\x20sessions\x20found\x20in\x20project:\x20','renderTimeline','Workflow:\x20','max','select','log','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','workflow:attempt','msPerChar','cancelRequested','📋\x20','fileSize','TASK_NAME_WIDTH','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','No\x20projects\x20match\x20pattern:\x20','retryAttempt','\x20modified','-\x20no\x20files\x20written','\x20\x20Project:\x20','revision','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20\x20Session\x20context\x20set\x20to:\x20','keys','icon','key','follow','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','session:','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','4030CLnotv','includes','\x20has\x20no\x20attempts','splice','Show\x20specific\x20attempt\x20details','Select\x20a\x20task\x20to\x20view\x20logs:','indexOf','workflow:delete','rows','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Starting\x20workflow\x20run...','message','Loading\x20sessions...','workflow:secrets:list','white','json','buildTimelineData','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','index','\x0aPolling...\x20(','\x20tasks','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','workflow:logs','dim','sourceDir','✔\x20Push\x20complete','✔\x20Workflow\x20run\x20started','getTime','Getting\x20attempt\x20details...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','task','resolveProjectDir','displayLine','relative','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','site','lastAttempt','resolve','860022ffNGIg','No\x20sessions\x20found\x20for:\x20','\x27\x20from\x20project\x20\x27','workflow','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','---\x20','\x20new','localeCompare','Including\x20subtasks:\x20yes','Validation:\x20skipped','modified','projectId','Session\x20time:\x20','summary','get','\x20session','\x20\x20Location:\x20','slice','\x0aFailed\x20to\x20fetch\x20attempt\x20data','fileCount','\x20workflow','Filter:\x20project=','success','✔\x20Project:\x20','preparePushProject','Latest\x20session\x20has\x20no\x20attempt','unknown','\x20\x20Attempt\x20ID:\x20','sessionTime','\x0a✔\x20Already\x20up\x20to\x20date','Listing\x20workflows...','data','Listing\x20workflow\x20attempts...','\x0aDry\x20run\x20-\x20no\x20files\x20written','delete','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','prepareCloneProject','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Loading\x20session...','\x20\x20tdx\x20wf\x20use\x20<project>','✔\x20Found\x20','workflow:kill','\x20of\x20','download','startsWith','getMonth','✔\x20Workflow\x20project\x20context\x20cleared.','Analyzing\x20changes...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Attempt:\x20','From\x20task:\x20','newProjectName','Retry\x20a\x20session\x20or\x20attempt','sourceProjectName','generateSessionTimelineRows','Error:\x20Secret\x20key\x20is\x20required','Error:\x20Attempt\x20ID\x20is\x20required','Include\x20retried:\x20yes','Error:\x20Invalid\x20parameter\x20format:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','write','List\x20workflows','renderSessionsTimeline','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','title','No\x20workflows\x20found\x20in\x20project:\x20','Revision:\x20','✔\x20Showing\x20','type','jsonl','Error:\x20Invalid\x20JSON\x20in\x20--params','Project\x20directory:\x20','Attempt\x20ID:\x20','createdAt','sys','Usage:\x20workflow:delete\x20<project-name-or-id>','445599OPPqoT','workflow:sessions','\x20-\x20','\x0aClone\x20\x22','Select\x20a\x20workflow\x20to\x20run','trim','group_error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','logs','tasks','start','\x1b[1A\x1b[2K','💡\x20Tip:\x20Use\x20','⚠\x20Showing\x20first\x20','No\x20sessions\x20with\x20timing\x20information','workflow:retry','fullName','\x22\x20already\x20exists\x20(ID:\x20','every','Output\x20directory:\x20','cyan','resolveProjectId','yellow','now','isTTY','\x20attempt','getFullYear','padStart','Using\x20attempt\x20','Files\x20to\x20upload:\x20','floor','pending','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','blue','targetExists','resolveProject','/app/workflows/','pollTimeline','Select\x20a\x20session\x20to\x20view\x20timeline:','Fetching\x20log\x20files...','filter','toLowerCase','projectName','-\x20nothing\x20pushed','Source:\x20','\x27...','\x20\x20Revision:\x20','workflow:timeline','fill','workflows','navigateSessionsInteractive','project','map','\x20\x20Session\x20ID:\x20','Error:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','red','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','force','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','window','sessions','✔\x20Pushed\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Parameters:\x20','join','requireProject','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x22\x20to\x20new\x20project\x20\x22','deleted','Project\x20name\x20is\x20required','\x0aApply\x20these\x20changes?','...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','readFile','✔\x20Workflow\x20project\x20set\x20to:\x20','getDate','newProjectId','stringify','showWorkflowConsoleUrl','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','table','sessionId','pullProject','running','Retrying\x20attempt...','\x20project',',\x20Workflow:\x20','4098VoFXeJ','✔\x20Pull\x20complete','skipValidation','→\x20New\x20project:\x20','\x20secret','toISOString','Dry\x20run:\x20yes','hasChanges','isDirectory','1102717mPeptI','New\x20project\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','clear','Pushing\x20project...','537484pvtpkR','List\x20workflow\x20execution\x20sessions','Writing\x20files...','stdout','finishedAt','Error:','\x22?\x20This\x20cannot\x20be\x20undone.','MAX_TIMELINE_WIDTH','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Target:\x20','executePushProject','Kill\x20a\x20running\x20attempt','execute','format','✔\x20Retry\x20started','Listing\x20workflow\x20projects...','renderSingleTimeline','No\x20workflow\x20sessions\x20found','dryRun','Start\x20a\x20workflow\x20run','\x20\x20Workflow:\x20','isArray','params','status','context','from','updatedAt','repeat','canceling','unchanged','duration','diff','Listing\x20workflow\x20sessions...','retryAttemptName','limit','No\x20workflow\x20projects\x20found','Downloading\x20project\x20','24jMRgBV','includeSubtasks','parseProjectWorkflowPattern','substring','No\x20workflows\x20found','yes','\x20is\x20not\x20a\x20directory','some','No\x20attempts\x20found\x20in\x20project:\x20','Tip:\x20cd\x20to\x20workflows/','\x20\x20Console:\x20','ICON_SPACING','\x20deleted','MIN_LABEL_COUNT','workflow:upload','tdx.json','description','Total:\x20','trimEnd','name','\x20\x20Files\x20extracted:\x20'];a47_0x146a=function(){return _0x261830;};return a47_0x146a();}function formatElapsed(_0x2c5822){const _0x54eec8=a47_0x18ff36,_0x26db35=Math[_0x54eec8(0x2a3)](_0x2c5822/0x3e8),_0x25c613=Math[_0x54eec8(0x2a3)](_0x26db35/0x3c),_0x28c086=Math[_0x54eec8(0x2a3)](_0x25c613/0x3c),_0x473d18=Math['floor'](_0x28c086/0x18);if(_0x473d18>0x0){const _0x19baad=_0x28c086%0x18;return _0x19baad>0x0?_0x473d18+'d\x20'+_0x19baad+'h':_0x473d18+'d';}else{if(_0x28c086>0x0){const _0x13ccbb=_0x25c613%0x3c;return _0x13ccbb>0x0?_0x28c086+'h\x20'+_0x13ccbb+'m':_0x28c086+'h';}else{if(_0x25c613>0x0){const _0x1616d3=_0x26db35%0x3c;return _0x1616d3>0x0?_0x25c613+'m\x20'+_0x1616d3+'s':_0x25c613+'m';}else return _0x26db35+'s';}}}function formatTimestamp(_0x39419e,_0x1bfb1d){const _0x6d5ecc=a47_0x18ff36,_0x29824e=new Date(_0x39419e),_0x56a488=String(_0x29824e[_0x6d5ecc(0x188)]())[_0x6d5ecc(0x2a0)](0x2,'0'),_0x48d819=String(_0x29824e['getMinutes']())['padStart'](0x2,'0'),_0x4cb45a=_0x56a488+':'+_0x48d819,_0x45927d=_0x29824e['getFullYear']()===_0x1bfb1d[_0x6d5ecc(0x29f)]()&&_0x29824e[_0x6d5ecc(0x266)]()===_0x1bfb1d[_0x6d5ecc(0x266)]()&&_0x29824e[_0x6d5ecc(0x2d2)]()===_0x1bfb1d['getDate']();if(_0x45927d)return _0x4cb45a;else{const _0x1b92e1=String(_0x29824e[_0x6d5ecc(0x266)]()+0x1)[_0x6d5ecc(0x2a0)](0x2,'0'),_0x283e0a=String(_0x29824e['getDate']())['padStart'](0x2,'0');return _0x1b92e1+'-'+_0x283e0a+'\x20'+_0x4cb45a;}}function formatDate(_0x2fc6d5){const _0x34ef7b=a47_0x18ff36,_0x2e9e5c=_0x2fc6d5[_0x34ef7b(0x29f)](),_0x599071=String(_0x2fc6d5[_0x34ef7b(0x266)]()+0x1)[_0x34ef7b(0x2a0)](0x2,'0'),_0x56702c=String(_0x2fc6d5[_0x34ef7b(0x2d2)]())[_0x34ef7b(0x2a0)](0x2,'0');return _0x2e9e5c+'-'+_0x599071+'-'+_0x56702c;}function getTaskStateIcon(_0x5b6ace){const _0x1090b8={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1090b8[_0x5b6ace]||'⚪';}function getBarChar(_0x2f23a3){const _0x47f6a1=a47_0x18ff36;return _0x2f23a3===_0x47f6a1(0x1b7)||_0x2f23a3==='group_error'?'×':'─';}function getBarColor(_0xdc8fd5){const _0x5243ae=a47_0x18ff36,_0x533160={'success':a47_0x2bf1fc[_0x5243ae(0x1cb)],'error':a47_0x2bf1fc[_0x5243ae(0x2be)],'group_error':a47_0x2bf1fc[_0x5243ae(0x2be)],'running':a47_0x2bf1fc[_0x5243ae(0x2a6)],'blocked':a47_0x2bf1fc[_0x5243ae(0x29b)],'planned':a47_0x2bf1fc[_0x5243ae(0x22a)],'canceling':a47_0x2bf1fc['yellow']};return _0x533160[_0xdc8fd5]||a47_0x2bf1fc[_0x5243ae(0x221)];}function parseTaskName(_0x56bd94){const _0x42a18f=a47_0x18ff36;let _0x4be6e5=_0x56bd94['replace'](/^\++/,'');const _0x489432=_0x4be6e5['split']('+'),_0x19deed=_0x489432[_0x42a18f(0x1b9)]>0x1?_0x489432['length']-0x2:0x0,_0x4f090a=_0x489432[_0x489432[_0x42a18f(0x1b9)]-0x1]||_0x4be6e5;return{'level':_0x19deed,'name':'+'+_0x4f090a};}function truncateTaskName(_0xaed139,_0xf43db7){const _0xff1531=a47_0x18ff36,_0x47b48a=stringWidth(_0xaed139);if(_0x47b48a<=_0xf43db7)return _0xaed139;let _0xdf397c=_0xaed139;while(stringWidth(_0xdf397c+'…')>_0xf43db7&&_0xdf397c[_0xff1531(0x1b9)]>0x0){_0xdf397c=_0xdf397c[_0xff1531(0x24a)](0x0,-0x1);}return _0xdf397c+'…';}function calculateTimeScale(_0x3b5669,_0x51546e){const _0x1883b6=a47_0x18ff36;return{'startTime':_0x3b5669[_0x1883b6(0x28f)],'endTime':_0x3b5669['end'],'durationMs':_0x3b5669['duration'],'msPerChar':_0x3b5669[_0x1883b6(0x30a)]/_0x51546e};}function timeToPosition(_0x4e50cf,_0x4ba28b,_0x4afe6f){const _0x22bcf8=a47_0x18ff36,_0xc4638f=_0x4e50cf-_0x4ba28b[_0x22bcf8(0x18d)],_0x2307f0=Math[_0x22bcf8(0x2a3)](_0xc4638f/_0x4ba28b[_0x22bcf8(0x1fc)]);return Math[_0x22bcf8(0x1f7)](0x0,Math[_0x22bcf8(0x1e8)](_0x2307f0,_0x4afe6f));}function renderTimeAxis(_0x3ef21b,_0x45dc46){const _0x390450=a47_0x18ff36,_0x332795=Math[_0x390450(0x1e8)](TIMELINE_CONFIG[_0x390450(0x1e3)],Math['max'](TIMELINE_CONFIG[_0x390450(0x31e)],Math[_0x390450(0x2a3)](_0x45dc46/TIMELINE_CONFIG[_0x390450(0x1bc)]))),_0xbc3495=_0x3ef21b[_0x390450(0x1e0)]/(_0x332795-0x1),_0x1c6496=new Date(_0x3ef21b[_0x390450(0x18d)]),_0xa941ad=[];for(let _0x2ad90f=0x0;_0x2ad90f<_0x332795;_0x2ad90f++){const _0x70185b=_0x3ef21b['startTime']+_0x2ad90f*_0xbc3495,_0x2084aa=timeToPosition(_0x70185b,_0x3ef21b,_0x45dc46),_0x284638=formatTimestamp(_0x70185b,_0x1c6496);_0xa941ad[_0x390450(0x1e7)]({'pos':_0x2084aa,'text':_0x284638});}const _0x3018bf=new Array(_0x45dc46)[_0x390450(0x2b5)]('\x20');let _0x29d7c9=-0x1;for(const {pos:_0x4fdc16,text:_0x35d804}of _0xa941ad){let _0x3a3a32=Math['max'](0x0,_0x4fdc16-Math[_0x390450(0x2a3)](_0x35d804[_0x390450(0x1b9)]/0x2));_0x3a3a32<=_0x29d7c9+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x3a3a32=_0x29d7c9+TIMELINE_CONFIG[_0x390450(0x1c6)]+0x1);_0x3a3a32+_0x35d804[_0x390450(0x1b9)]>_0x45dc46&&(_0x3a3a32=_0x45dc46-_0x35d804[_0x390450(0x1b9)]);if(_0x3a3a32>=0x0&&_0x3a3a32+_0x35d804['length']<=_0x45dc46&&_0x3a3a32>_0x29d7c9){for(let _0x36c10f=0x0;_0x36c10f<_0x35d804[_0x390450(0x1b9)];_0x36c10f++){_0x3018bf[_0x3a3a32+_0x36c10f]=_0x35d804[_0x36c10f];}_0x29d7c9=_0x3a3a32+_0x35d804[_0x390450(0x1b9)]-0x1;}}return _0x3018bf[_0x390450(0x2c7)]('');}function renderTaskRow(_0x158014,_0x3321e1,_0xe82189,_0x3268d4){const _0x1128ea=a47_0x18ff36,{level:_0x553667,name:_0x400060}=parseTaskName(_0x158014['name']),_0x377acd='\x20'['repeat'](_0x553667),_0x23c07c=_0x158014[_0x1128ea(0x2c2)]?'('+formatElapsed(_0x158014[_0x1128ea(0x2c2)]['duration'])+')':'',_0x5d6bbb=stringWidth(_0x23c07c),_0x1096ae=_0x553667*0x1,_0x2afada=_0x3268d4-_0x1096ae-_0x5d6bbb-0x1,_0xa6fc53=truncateTaskName(_0x400060,_0x2afada),_0x554099=_0x377acd+_0xa6fc53,_0x49a3f9=stringWidth(_0x554099),_0x524eff=_0x3268d4-_0x49a3f9-_0x5d6bbb,_0x565577=_0x554099+'\x20'[_0x1128ea(0x307)](Math[_0x1128ea(0x1f7)](0x1,_0x524eff))+a47_0x2bf1fc[_0x1128ea(0x22a)](_0x23c07c),_0x13f981=getTaskStateIcon(_0x158014[_0x1128ea(0x1ba)]),_0xf8c086=new Array(_0xe82189)[_0x1128ea(0x2b5)]('\x20');if(_0x158014['window']){const _0x376f06=timeToPosition(_0x158014['window'][_0x1128ea(0x28f)],_0x3321e1,_0xe82189),_0x9d3b3b=timeToPosition(_0x158014[_0x1128ea(0x2c2)][_0x1128ea(0x1d4)],_0x3321e1,_0xe82189),_0x33df49=getBarChar(_0x158014[_0x1128ea(0x1ba)]),_0x35838e=Math[_0x1128ea(0x1f7)](_0x376f06+0x1,_0x9d3b3b);for(let _0x45277a=_0x376f06;_0x45277a<Math[_0x1128ea(0x1e8)](_0x35838e,_0xe82189);_0x45277a++){_0xf8c086[_0x45277a]=_0x33df49;}}const _0x393b15=getBarColor(_0x158014['state']),_0x220fdd=_0xf8c086[_0x1128ea(0x2b9)](_0x4246b1=>_0x4246b1==='\x20'?'\x20':_0x393b15(_0x4246b1))['join']('');return _0x13f981+'\x20'+_0x565577+'│'+_0x220fdd+'│';}function calculateStats(_0x1808de){const _0x52d501=a47_0x18ff36,_0x373f3f={'total':_0x1808de['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xa828c6 of _0x1808de){if(_0xa828c6[_0x52d501(0x1ba)]==='success')_0x373f3f[_0x52d501(0x24f)]++;else{if(_0xa828c6[_0x52d501(0x1ba)]==='error'||_0xa828c6[_0x52d501(0x1ba)]===_0x52d501(0x28b))_0x373f3f[_0x52d501(0x1b7)]++;else _0xa828c6[_0x52d501(0x1ba)]===_0x52d501(0x2da)?_0x373f3f[_0x52d501(0x2da)]++:_0x373f3f[_0x52d501(0x2a4)]++;}}return _0x373f3f;}function formatStats(_0x55ae39){const _0x22e40b=a47_0x18ff36;return[_0x22e40b(0x322)+_0x55ae39[_0x22e40b(0x1c5)],'✅\x20'+_0x55ae39[_0x22e40b(0x24f)],'❌\x20'+_0x55ae39['error'],_0x22e40b(0x1b4)+_0x55ae39[_0x22e40b(0x2da)],'⏳\x20'+_0x55ae39[_0x22e40b(0x2a4)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x2b4);['description']=a47_0x18ff36(0x274);async[a47_0x18ff36(0x2f8)](_0x210fab){const _0x4221ba=a47_0x18ff36,{options:_0x311a12,args:_0x178357,tdx:_0x31307f}=_0x210fab;let _0xe9833a,_0x23e62b,_0x353766=![];if(_0x178357[0x0]){if(_0x178357[0x0][_0x4221ba(0x214)]('.')){const _0x2b4bc3=this[_0x4221ba(0x313)](_0x178357,_0x311a12);if(!_0x2b4bc3)return 0x1;_0xe9833a=_0x2b4bc3[_0x4221ba(0x2af)],_0x23e62b=_0x2b4bc3[_0x4221ba(0x333)];}else{_0x23e62b=_0x178357[0x0],_0xe9833a=_0x311a12[_0x4221ba(0x18b)];if(!_0xe9833a)return console['error'](a47_0x2bf1fc['red'](_0x4221ba(0x2f1)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x353766=!![];}}else{const _0x14e709=this[_0x4221ba(0x313)](_0x178357,_0x311a12);if(!_0x14e709)return 0x1;_0xe9833a=_0x14e709[_0x4221ba(0x2af)],_0x23e62b=_0x14e709[_0x4221ba(0x333)];}if(_0x311a12['verbose']){if(_0xe9833a&&_0x23e62b)console[_0x4221ba(0x1b7)](_0x4221ba(0x1d2)+_0xe9833a+'.'+_0x23e62b);else _0xe9833a&&console['error'](_0x4221ba(0x24e)+_0xe9833a);}const _0x5e8bba=_0x311a12[_0x4221ba(0x1b6)],_0x576ce2=_0x311a12[_0x4221ba(0x2d8)];if(_0x5e8bba){_0x576ce2&&console['error'](a47_0x2bf1fc[_0x4221ba(0x29b)]('Warning:'),_0x4221ba(0x1fa));const _0x34cffa=_0x311a12['follow'];return _0x34cffa?await this[_0x4221ba(0x2aa)](_0x210fab,_0x5e8bba):await this['renderSingleTimeline'](_0x210fab,_0x5e8bba,_0x311a12),0x0;}if(_0x576ce2){const _0x157d98=await withSpinner(_0x4221ba(0x25f),()=>_0x31307f[_0x4221ba(0x23c)]['sessions']({'projectName':_0xe9833a,'workflowName':_0x23e62b,'limit':0x64}),{'verbose':_0x311a12[_0x4221ba(0x1bd)]}),_0x37eb8c=_0x157d98[_0x4221ba(0x258)]['find'](_0x234c2e=>_0x234c2e['id']===_0x576ce2);if(!_0x37eb8c)return console['error'](a47_0x2bf1fc[_0x4221ba(0x2be)](_0x4221ba(0x2f1)),_0x4221ba(0x1a3)+_0x576ce2),0x1;if(!_0x37eb8c[_0x4221ba(0x237)]?.['id'])return console[_0x4221ba(0x1b7)](a47_0x2bf1fc[_0x4221ba(0x2be)](_0x4221ba(0x2f1)),'Session\x20'+_0x576ce2+_0x4221ba(0x215)),0x1;const _0x93e437=_0x37eb8c[_0x4221ba(0x237)]['id'];_0x311a12[_0x4221ba(0x1bd)]&&console[_0x4221ba(0x1b7)](_0x4221ba(0x2a1)+_0x93e437+_0x4221ba(0x1ee)+_0x576ce2);const _0x582ddc=_0x311a12[_0x4221ba(0x20d)];return _0x582ddc?await this['pollTimeline'](_0x210fab,_0x93e437):await this['renderSingleTimeline'](_0x210fab,_0x93e437,_0x311a12),0x0;}const _0x4b66a0=await withSpinner(_0x4221ba(0x21f),()=>_0x31307f[_0x4221ba(0x23c)][_0x4221ba(0x2c3)]({'projectName':_0xe9833a,'workflowName':_0x23e62b,'limit':_0x311a12['limit']||0x32}),{'verbose':_0x311a12[_0x4221ba(0x1bd)]}),_0x513500=_0x4b66a0[_0x4221ba(0x258)];if(_0x513500[_0x4221ba(0x1b9)]===0x0){if(_0xe9833a&&_0x23e62b)console[_0x4221ba(0x1b7)](_0x4221ba(0x23a)+_0xe9833a+'.'+_0x23e62b);else _0xe9833a?console[_0x4221ba(0x1b7)](_0x4221ba(0x1f4)+_0xe9833a):(console[_0x4221ba(0x1b7)](_0x4221ba(0x2fd)),console[_0x4221ba(0x1b7)](a47_0x2bf1fc['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x513500['sort']((_0xfe3db2,_0x318f3e)=>{const _0x38ef15=_0x4221ba,_0x3f55f4=_0xfe3db2[_0x38ef15(0x255)]||'',_0x461f23=_0x318f3e[_0x38ef15(0x255)]||'';return _0x461f23[_0x38ef15(0x240)](_0x3f55f4);});if(_0x311a12['json']||_0x311a12['jsonl'])return await handleSDKOutput(_0x513500,_0x311a12),0x0;let _0x2a8e64;if(_0x353766){const _0x2081f6=_0x513500[0x0];if(!_0x2081f6[_0x4221ba(0x237)]?.['id'])return console[_0x4221ba(0x1b7)](_0x4221ba(0x252)),0x0;_0x2a8e64=_0x2081f6[_0x4221ba(0x237)]['id'],_0x311a12['verbose']&&console[_0x4221ba(0x1b7)]('Auto-selected\x20latest\x20session:\x20'+_0x2081f6[_0x4221ba(0x255)]);}else{const _0x398969=_0x513500[_0x4221ba(0x2b9)](_0x541826=>{const _0x4a24f1=_0x4221ba,_0x2dc4b0=getAttemptStatusDisplay(_0x541826[_0x4a24f1(0x237)]);return{'title':_0x541826[_0x4a24f1(0x2b8)]?.[_0x4a24f1(0x324)]+'.'+_0x541826[_0x4a24f1(0x23c)]?.[_0x4a24f1(0x324)]+_0x4a24f1(0x287)+_0x541826[_0x4a24f1(0x255)]+'\x20'+_0x2dc4b0[_0x4a24f1(0x20b)],'value':_0x541826[_0x4a24f1(0x237)]?.['id']||'','description':_0x2dc4b0['text']};}),_0x19d22c=await a47_0x307e4a({'type':'select','name':_0x4221ba(0x1b6),'message':_0x4221ba(0x2ab),'choices':_0x398969['filter'](_0x4b9991=>_0x4b9991[_0x4221ba(0x1a1)]!=='')});if(!_0x19d22c[_0x4221ba(0x1b6)])return 0x0;_0x2a8e64=_0x19d22c[_0x4221ba(0x1b6)];}const _0x4509da=_0x311a12['follow'];return _0x4509da?await this[_0x4221ba(0x2aa)](_0x210fab,_0x2a8e64):await this[_0x4221ba(0x2fc)](_0x210fab,_0x2a8e64,_0x311a12),0x0;}async['renderSingleTimeline'](_0x2ab9a2,_0xaf68d2,_0x9d8205){const _0x2d9eaa=a47_0x18ff36,{tdx:_0x1673cf}=_0x2ab9a2;let _0x58452d,_0x478ab6;try{[_0x58452d,_0x478ab6]=await Promise['all']([_0x1673cf[_0x2d9eaa(0x23c)][_0x2d9eaa(0x1da)](_0xaf68d2),_0x1673cf[_0x2d9eaa(0x23c)][_0x2d9eaa(0x28e)](_0xaf68d2,![])]);}catch(_0x71922e){console['error'](a47_0x2bf1fc['red'](_0x2d9eaa(0x1b1)));_0x9d8205[_0x2d9eaa(0x1bd)]&&console['error'](_0x71922e);throw _0x71922e;}if(_0x9d8205[_0x2d9eaa(0x222)]||_0x9d8205[_0x2d9eaa(0x27e)]){const _0x272eb3=this[_0x2d9eaa(0x223)](_0x58452d,_0x478ab6);await handleSDKOutput([_0x272eb3],_0x9d8205);return;}const _0x5b48c5=_0x1673cf['context'][_0x2d9eaa(0x236)],_0x113686=this[_0x2d9eaa(0x1f5)](_0x58452d,_0x478ab6,_0x5b48c5);console[_0x2d9eaa(0x1f9)](_0x113686);}async[a47_0x18ff36(0x2aa)](_0x495f68,_0x2444d6){const _0x57b67c=a47_0x18ff36,{tdx:_0x36eea1}=_0x495f68,_0x262305=TIMELINE_CONFIG[_0x57b67c(0x198)],_0x2ef80f=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x2133ae=0x0;while(_0x2133ae<_0x2ef80f){process['stdout'][_0x57b67c(0x29d)]&&process[_0x57b67c(0x2ef)][_0x57b67c(0x275)]('\x1bc');let _0xde3539,_0x4d501d;try{[_0xde3539,_0x4d501d]=await Promise['all']([_0x36eea1[_0x57b67c(0x23c)][_0x57b67c(0x1da)](_0x2444d6),_0x36eea1[_0x57b67c(0x23c)][_0x57b67c(0x28e)](_0x2444d6,![])]);}catch(_0x5b915d){console['error'](a47_0x2bf1fc[_0x57b67c(0x2be)](_0x57b67c(0x24b)));_0x2133ae>0x0&&console['error'](a47_0x2bf1fc[_0x57b67c(0x22a)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x2133ae));throw _0x5b915d;}const _0x1cd40a=_0x36eea1[_0x57b67c(0x304)][_0x57b67c(0x236)],_0x2b1f09=this[_0x57b67c(0x1f5)](_0xde3539,_0x4d501d,_0x1cd40a);console[_0x57b67c(0x1f9)](_0x2b1f09);const _0x31ba34=_0xde3539['done']&&_0x4d501d[_0x57b67c(0x297)](_0x3a741f=>_0x3a741f['state']!==_0x57b67c(0x2da)&&_0x3a741f[_0x57b67c(0x1ba)]!==_0x57b67c(0x1ad));if(_0x31ba34){console[_0x57b67c(0x1b7)](a47_0x2bf1fc[_0x57b67c(0x1cb)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x57b67c(0x1b7)](a47_0x2bf1fc[_0x57b67c(0x22a)](_0x57b67c(0x226)+_0x2133ae*0x2+_0x57b67c(0x23d))),await new Promise(_0x9c0454=>setTimeout(_0x9c0454,_0x262305)),_0x2133ae++;}_0x2133ae>=_0x2ef80f&&console[_0x57b67c(0x1b7)](a47_0x2bf1fc['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a47_0x18ff36(0x1f5)](_0x12d355,_0x500c56,_0x69dcfc){const _0x243885=a47_0x18ff36,_0x1f00fe=[],_0x108090=TIMELINE_CONFIG[_0x243885(0x200)],_0x3ea5bd=0x5,_0x4c2700=process[_0x243885(0x2ef)]['columns']||0x78,_0x11fe8e=_0x4c2700-_0x108090-_0x3ea5bd,_0x1af597=Math[_0x243885(0x1f7)](TIMELINE_CONFIG[_0x243885(0x32a)],Math[_0x243885(0x1e8)](_0x11fe8e,TIMELINE_CONFIG[_0x243885(0x2f3)])),_0x4226cd=new Date(_0x12d355[_0x243885(0x282)])[_0x243885(0x22e)](),_0x4f0d44=_0x12d355[_0x243885(0x2f0)]?new Date(_0x12d355[_0x243885(0x2f0)])[_0x243885(0x22e)]():Date['now'](),_0x1c331c={'start':_0x4226cd,'end':_0x4f0d44,'duration':_0x4f0d44-_0x4226cd},_0x1fb206=new Map(),_0x4f53a5=[];for(const _0x42b7a8 of _0x500c56){if(_0x42b7a8[_0x243885(0x195)]){const _0x16442b=new Date(_0x42b7a8[_0x243885(0x195)])[_0x243885(0x22e)](),_0x4b36d6=_0x42b7a8['updatedAt']?new Date(_0x42b7a8['updatedAt'])[_0x243885(0x22e)]():Date[_0x243885(0x29c)](),_0x40264c={'start':_0x16442b,'end':_0x4b36d6,'duration':_0x4b36d6-_0x16442b};_0x1fb206['set'](_0x42b7a8['id'],_0x40264c),_0x4f53a5['push']({'name':_0x42b7a8[_0x243885(0x295)],'state':_0x42b7a8[_0x243885(0x1ba)]||_0x243885(0x253),'window':_0x40264c});}else _0x4f53a5[_0x243885(0x1e7)]({'name':_0x42b7a8[_0x243885(0x295)],'state':_0x42b7a8[_0x243885(0x1ba)]||_0x243885(0x1ad),'window':undefined});}_0x4f53a5[_0x243885(0x32b)]((_0x2ab7f4,_0xaf5a97)=>{const _0x37177c=_0x243885;if(!_0x2ab7f4['window'])return 0x1;if(!_0xaf5a97[_0x37177c(0x2c2)])return-0x1;return _0x2ab7f4[_0x37177c(0x2c2)][_0x37177c(0x28f)]-_0xaf5a97[_0x37177c(0x2c2)][_0x37177c(0x28f)];});const _0x5c5591=_0x4f53a5[_0x243885(0x1b9)],_0x4b5e3f=_0x5c5591>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x4b5e3f&&_0x4f53a5[_0x243885(0x216)](TIMELINE_CONFIG[_0x243885(0x1c0)]);const _0x301efa=calculateTimeScale(_0x1c331c,_0x1af597),_0x48d2b2=_0x12d355[_0x243885(0x32f)]?_0x12d355[_0x243885(0x24f)]?a47_0x2bf1fc['green'](_0x243885(0x24f)):a47_0x2bf1fc[_0x243885(0x2be)]('error'):a47_0x2bf1fc[_0x243885(0x2a6)]('running'),_0x314626=_0x12d355[_0x243885(0x2b8)]?.['id'],_0x262f2b=_0x12d355['sessionId'];let _0x539348;if(_0x314626&&_0x262f2b){const _0x24371b=getWorkflowAttemptUrl(_0x69dcfc,_0x314626,_0x262f2b,_0x12d355['id']);_0x539348=hyperlink(a47_0x2bf1fc[_0x243885(0x22a)](_0x12d355['id']),_0x24371b);}else _0x539348=a47_0x2bf1fc['dim'](_0x12d355['id']);_0x1f00fe[_0x243885(0x1e7)](_0x243885(0x26a)+_0x539348+_0x243885(0x287)+_0x48d2b2+_0x243885(0x287)+formatElapsed(_0x1c331c[_0x243885(0x30a)]));if(_0x4f53a5[_0x243885(0x1b9)]>0x0){const _0xe9e954=renderTimeAxis(_0x301efa,_0x1af597),_0x13334b=new Date(_0x1c331c['start']),_0x595b82=formatDate(_0x13334b),_0x51689a=TIMELINE_CONFIG[_0x243885(0x196)]+TIMELINE_CONFIG['ICON_SPACING']+_0x108090,_0x4f1403=_0x595b82['padStart'](_0x51689a),_0xe73c9c=a47_0x2bf1fc[_0x243885(0x22a)](_0x4f1403);_0x1f00fe['push'](_0xe73c9c+'\x20'+_0xe9e954);for(const _0x138da5 of _0x4f53a5){_0x1f00fe[_0x243885(0x1e7)](renderTaskRow(_0x138da5,_0x301efa,_0x1af597,_0x108090));}const _0x1f3aae=calculateStats(_0x4f53a5);_0x1f00fe[_0x243885(0x1e7)](formatStats(_0x1f3aae)),_0x4b5e3f&&_0x1f00fe[_0x243885(0x1e7)](a47_0x2bf1fc[_0x243885(0x29b)](_0x243885(0x292)+TIMELINE_CONFIG[_0x243885(0x1c0)]+_0x243885(0x263)+_0x5c5591+_0x243885(0x227))),_0x1f00fe[_0x243885(0x1e7)](''),_0x1f00fe[_0x243885(0x1e7)](a47_0x2bf1fc['dim'](_0x243885(0x291))+('tdx\x20wf\x20attempt\x20'+_0x12d355['id']+_0x243885(0x332))+a47_0x2bf1fc['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x1f00fe[_0x243885(0x1e7)](_0x243885(0x235));return _0x1f00fe[_0x243885(0x2c7)]('\x0a');}[a47_0x18ff36(0x223)](_0x3fb841,_0x45557c){const _0x96f7cf=a47_0x18ff36,_0x1920bf=new Date(_0x3fb841[_0x96f7cf(0x282)])[_0x96f7cf(0x22e)](),_0x20a349=_0x3fb841['finishedAt']?new Date(_0x3fb841[_0x96f7cf(0x2f0)])['getTime']():Date[_0x96f7cf(0x29c)](),_0x43d890=_0x20a349-_0x1920bf,_0x1b3558=[];for(const _0x3c4750 of _0x45557c){if(_0x3c4750[_0x96f7cf(0x195)]){const _0x2268f0=new Date(_0x3c4750[_0x96f7cf(0x195)])['getTime'](),_0x25a41b=_0x3c4750[_0x96f7cf(0x306)]?new Date(_0x3c4750[_0x96f7cf(0x306)])['getTime']():Date['now']();_0x1b3558[_0x96f7cf(0x1e7)]({'name':_0x3c4750[_0x96f7cf(0x295)],'state':_0x3c4750[_0x96f7cf(0x1ba)]||'unknown','window':{'start':_0x2268f0,'end':_0x25a41b,'duration':_0x25a41b-_0x2268f0}});}else _0x1b3558[_0x96f7cf(0x1e7)]({'name':_0x3c4750[_0x96f7cf(0x295)],'state':_0x3c4750[_0x96f7cf(0x1ba)]||_0x96f7cf(0x1ad),'window':undefined});}const _0xc00f8=calculateStats(_0x1b3558);return{'attempt':{'id':_0x3fb841['id'],'status':_0x3fb841[_0x96f7cf(0x32f)]?_0x3fb841[_0x96f7cf(0x24f)]?_0x96f7cf(0x24f):_0x96f7cf(0x1b7):_0x96f7cf(0x2da),'createdAt':_0x3fb841['createdAt'],'finishedAt':_0x3fb841[_0x96f7cf(0x2f0)],'duration_ms':_0x43d890},'tasks':_0x1b3558[_0x96f7cf(0x2b9)](_0x5346ec=>({'name':_0x5346ec[_0x96f7cf(0x324)],'state':_0x5346ec[_0x96f7cf(0x1ba)],'startedAt':_0x5346ec['window']?new Date(_0x5346ec[_0x96f7cf(0x2c2)][_0x96f7cf(0x28f)])[_0x96f7cf(0x2e3)]():null,'updatedAt':_0x5346ec[_0x96f7cf(0x2c2)]?new Date(_0x5346ec[_0x96f7cf(0x2c2)]['end'])[_0x96f7cf(0x2e3)]():null,'duration_ms':_0x5346ec[_0x96f7cf(0x2c2)]?.['duration']||null})),'stats':_0xc00f8};}}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d4d23,_0x1e4dbd){const _0x1237b6=a48_0x3c13,_0x519bc9=_0x5d4d23();while(!![]){try{const _0x248037=parseInt(_0x1237b6(0xfa))/0x1*(parseInt(_0x1237b6(0xfc))/0x2)+parseInt(_0x1237b6(0x101))/0x3*(-parseInt(_0x1237b6(0x100))/0x4)+-parseInt(_0x1237b6(0xf3))/0x5*(parseInt(_0x1237b6(0xf9))/0x6)+-parseInt(_0x1237b6(0x102))/0x7+parseInt(_0x1237b6(0xf5))/0x8*(parseInt(_0x1237b6(0xff))/0x9)+parseInt(_0x1237b6(0xf6))/0xa+-parseInt(_0x1237b6(0xf8))/0xb*(parseInt(_0x1237b6(0xf0))/0xc);if(_0x248037===_0x1e4dbd)break;else _0x519bc9['push'](_0x519bc9['shift']());}catch(_0x258a91){_0x519bc9['push'](_0x519bc9['shift']());}}}(a48_0x5105,0x9c6b2));function a48_0x5105(){const _0xb992ad=['12ruLpal','replace',';\x20node/','5691940DLSWEo','tdx/','1979440HdrkZg','8402500xafwsP','Authorization','194821lpjMVs','6wwGiGb','612ZFhCfb','TD1\x20','1826HwHLSg','length','X-Trino-User','45ZjuVpx','1337660tgaaCd','6SDPnLQ','1193759OwVwXa'];a48_0x5105=function(){return _0xb992ad;};return a48_0x5105();}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0xa669a7=a48_0x3c13,_0x3ce91c=getVersion(),_0x2945c7=platform(),_0x220da1=process['version'][_0xa669a7(0xf1)]('v','');return _0xa669a7(0xf4)+_0x3ce91c+'\x20('+_0x2945c7+_0xa669a7(0xf2)+_0x220da1+')';}export function getAuthHeaders(_0x113d6a,_0x1067a2){const _0x3cb04f=a48_0x3c13,_0x143523=getVersion(),_0x42c2d2={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x143523};return _0x1067a2&&(_0x42c2d2[_0x3cb04f(0xf7)]=_0x3cb04f(0xfb)+_0x1067a2),_0x42c2d2;}export function toHeaderRecord(_0x14ce67){const _0x2eb89f={};for(const [_0x4af716,_0x500cc7]of Object['entries'](_0x14ce67)){_0x500cc7!==undefined&&(_0x2eb89f[_0x4af716]=_0x500cc7);}return _0x2eb89f;}export function getTrinoHeaders(_0x35450a,_0x50fafc){const _0x5bcc74=a48_0x3c13,_0xaec391=getAuthHeaders(_0x35450a,_0x50fafc),_0x10dbf9=toHeaderRecord(_0xaec391);return delete _0x10dbf9['Authorization'],_0x50fafc&&(_0x10dbf9[_0x5bcc74(0xfe)]=_0x50fafc),_0x10dbf9;}function a48_0x3c13(_0x4ec2d8,_0x20eeac){_0x4ec2d8=_0x4ec2d8-0xf0;const _0x5105af=a48_0x5105();let _0x3c137c=_0x5105af[_0x4ec2d8];return _0x3c137c;}export function hasAPIKey(_0x5069de){const _0xa05b7e=a48_0x3c13,_0x5d097e=getAPIKey();return _0x5d097e!==undefined&&_0x5d097e[_0xa05b7e(0xfd)]>0x0;}
|