@navios/commander-tui 1.1.0 → 1.3.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/CHANGELOG.md +44 -0
- package/README.md +69 -1
- package/dist/base/src/adapters/index.d.ts +2 -0
- package/dist/base/src/adapters/index.d.ts.map +1 -0
- package/dist/base/src/adapters/interface.d.ts +45 -0
- package/dist/base/src/adapters/interface.d.ts.map +1 -0
- package/dist/base/src/components/index.d.ts +2 -0
- package/dist/base/src/components/index.d.ts.map +1 -0
- package/dist/base/src/context/index.d.ts +2 -0
- package/dist/base/src/context/index.d.ts.map +1 -0
- package/dist/base/src/factories/index.d.ts +3 -0
- package/dist/base/src/factories/index.d.ts.map +1 -0
- package/dist/base/src/factories/isomorphic-logger.factory.d.ts +8 -0
- package/dist/base/src/factories/isomorphic-logger.factory.d.ts.map +1 -0
- package/dist/base/src/factories/screen.factory.d.ts +8 -0
- package/dist/base/src/factories/screen.factory.d.ts.map +1 -0
- package/dist/base/src/filter/filter_engine.d.ts +19 -0
- package/dist/base/src/filter/filter_engine.d.ts.map +1 -0
- package/dist/base/src/filter/index.d.ts +2 -0
- package/dist/base/src/filter/index.d.ts.map +1 -0
- package/dist/base/src/hooks/index.d.ts +2 -0
- package/dist/base/src/hooks/index.d.ts.map +1 -0
- package/dist/base/src/index.d.ts +16 -0
- package/dist/base/src/index.d.ts.map +1 -0
- package/dist/base/src/interfaces/index.d.ts +2 -0
- package/dist/base/src/interfaces/index.d.ts.map +1 -0
- package/dist/base/src/interfaces/isomorphic-logger.d.ts +9 -0
- package/dist/base/src/interfaces/isomorphic-logger.d.ts.map +1 -0
- package/dist/base/src/keyboard/create_bindings.d.ts +26 -0
- package/dist/base/src/keyboard/create_bindings.d.ts.map +1 -0
- package/dist/base/src/keyboard/index.d.ts +3 -0
- package/dist/base/src/keyboard/index.d.ts.map +1 -0
- package/dist/base/src/keyboard/keyboard_manager.d.ts +63 -0
- package/dist/base/src/keyboard/keyboard_manager.d.ts.map +1 -0
- package/dist/base/src/overrides/console.logger.override.d.ts +3 -0
- package/dist/base/src/overrides/console.logger.override.d.ts.map +1 -0
- package/dist/base/src/overrides/index.d.ts +3 -0
- package/dist/base/src/overrides/index.d.ts.map +1 -0
- package/dist/base/src/overrides/missing-adapter.override.d.ts +6 -0
- package/dist/base/src/overrides/missing-adapter.override.d.ts.map +1 -0
- package/dist/base/src/schemas/index.d.ts +4 -0
- package/dist/base/src/schemas/index.d.ts.map +1 -0
- package/dist/base/src/schemas/logger-options.d.ts +21 -0
- package/dist/base/src/schemas/logger-options.d.ts.map +1 -0
- package/dist/base/src/schemas/prompt-options.d.ts +12 -0
- package/dist/base/src/schemas/prompt-options.d.ts.map +1 -0
- package/dist/base/src/schemas/screen-options.d.ts +10 -0
- package/dist/base/src/schemas/screen-options.d.ts.map +1 -0
- package/dist/base/src/services/index.d.ts +5 -0
- package/dist/base/src/services/index.d.ts.map +1 -0
- package/dist/base/src/services/logger.d.ts +52 -0
- package/dist/base/src/services/logger.d.ts.map +1 -0
- package/dist/base/src/services/prompt.d.ts +31 -0
- package/dist/base/src/services/prompt.d.ts.map +1 -0
- package/dist/base/src/services/screen.d.ts +161 -0
- package/dist/base/src/services/screen.d.ts.map +1 -0
- package/dist/base/src/services/screen_manager.d.ts +130 -0
- package/dist/base/src/services/screen_manager.d.ts.map +1 -0
- package/dist/base/src/themes/dark.d.ts +7 -0
- package/dist/base/src/themes/dark.d.ts.map +1 -0
- package/dist/base/src/themes/high-contrast.d.ts +7 -0
- package/dist/base/src/themes/high-contrast.d.ts.map +1 -0
- package/dist/base/src/themes/index.d.ts +5 -0
- package/dist/base/src/themes/index.d.ts.map +1 -0
- package/dist/base/src/themes/light.d.ts +6 -0
- package/dist/base/src/themes/light.d.ts.map +1 -0
- package/dist/base/src/themes/utils.d.ts +22 -0
- package/dist/base/src/themes/utils.d.ts.map +1 -0
- package/dist/base/src/tokens/adapter.d.ts +9 -0
- package/dist/base/src/tokens/adapter.d.ts.map +1 -0
- package/dist/base/src/tokens/index.d.ts +6 -0
- package/dist/base/src/tokens/index.d.ts.map +1 -0
- package/dist/base/src/tokens/logger.d.ts +44 -0
- package/dist/base/src/tokens/logger.d.ts.map +1 -0
- package/dist/base/src/tokens/prompt.d.ts +12 -0
- package/dist/base/src/tokens/prompt.d.ts.map +1 -0
- package/dist/base/src/tokens/screen-manager.d.ts +8 -0
- package/dist/base/src/tokens/screen-manager.d.ts.map +1 -0
- package/dist/base/src/tokens/screen.d.ts +10 -0
- package/dist/base/src/tokens/screen.d.ts.map +1 -0
- package/dist/base/src/types/file.types.d.ts +40 -0
- package/dist/base/src/types/file.types.d.ts.map +1 -0
- package/dist/base/src/types/filter.types.d.ts +31 -0
- package/dist/base/src/types/filter.types.d.ts.map +1 -0
- package/dist/base/src/types/index.d.ts +9 -0
- package/dist/base/src/types/index.d.ts.map +1 -0
- package/dist/base/src/types/keyboard.types.d.ts +83 -0
- package/dist/base/src/types/keyboard.types.d.ts.map +1 -0
- package/dist/base/src/types/log.types.d.ts +39 -0
- package/dist/base/src/types/log.types.d.ts.map +1 -0
- package/dist/base/src/types/message.types.d.ts +82 -0
- package/dist/base/src/types/message.types.d.ts.map +1 -0
- package/dist/base/src/types/prompt.types.d.ts +85 -0
- package/dist/base/src/types/prompt.types.d.ts.map +1 -0
- package/dist/base/src/types/screen.types.d.ts +79 -0
- package/dist/base/src/types/screen.types.d.ts.map +1 -0
- package/dist/base/src/types/theme.types.d.ts +217 -0
- package/dist/base/src/types/theme.types.d.ts.map +1 -0
- package/dist/base/src/utils/colors/file-colors.d.ts +10 -0
- package/dist/base/src/utils/colors/file-colors.d.ts.map +1 -0
- package/dist/base/src/utils/colors/helpers.d.ts +26 -0
- package/dist/base/src/utils/colors/helpers.d.ts.map +1 -0
- package/dist/base/src/utils/colors/index.d.ts +8 -0
- package/dist/base/src/utils/colors/index.d.ts.map +1 -0
- package/dist/base/src/utils/colors/log-colors.d.ts +19 -0
- package/dist/base/src/utils/colors/log-colors.d.ts.map +1 -0
- package/dist/base/src/utils/colors/progress-colors.d.ts +25 -0
- package/dist/base/src/utils/colors/progress-colors.d.ts.map +1 -0
- package/dist/base/src/utils/colors/prompt-colors.d.ts +22 -0
- package/dist/base/src/utils/colors/prompt-colors.d.ts.map +1 -0
- package/dist/base/src/utils/colors/sidebar-colors.d.ts +50 -0
- package/dist/base/src/utils/colors/sidebar-colors.d.ts.map +1 -0
- package/dist/base/src/utils/colors/table-colors.d.ts +12 -0
- package/dist/base/src/utils/colors/table-colors.d.ts.map +1 -0
- package/dist/base/src/utils/filetype.d.ts +19 -0
- package/dist/base/src/utils/filetype.d.ts.map +1 -0
- package/dist/base/src/utils/format.d.ts +9 -0
- package/dist/base/src/utils/format.d.ts.map +1 -0
- package/dist/base/src/utils/index.d.ts +5 -0
- package/dist/base/src/utils/index.d.ts.map +1 -0
- package/dist/base/src/utils/stdout-printer.d.ts +6 -0
- package/dist/base/src/utils/stdout-printer.d.ts.map +1 -0
- package/dist/base/tsconfig.base.tsbuildinfo +1 -0
- package/dist/react/src/adapters/react/components/file/file_log.d.ts +35 -0
- package/dist/react/src/adapters/react/components/file/file_log.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/file/index.d.ts +2 -0
- package/dist/react/src/adapters/react/components/file/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/filter/filter_bar.d.ts +7 -0
- package/dist/react/src/adapters/react/components/filter/filter_bar.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/filter/index.d.ts +2 -0
- package/dist/react/src/adapters/react/components/filter/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/help/help_overlay.d.ts +6 -0
- package/dist/react/src/adapters/react/components/help/help_overlay.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/help/index.d.ts +2 -0
- package/dist/react/src/adapters/react/components/help/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/log/index.d.ts +2 -0
- package/dist/react/src/adapters/react/components/log/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/log/log_message.d.ts +28 -0
- package/dist/react/src/adapters/react/components/log/log_message.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/prompt/index.d.ts +3 -0
- package/dist/react/src/adapters/react/components/prompt/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/prompt/prompt_renderer.d.ts +6 -0
- package/dist/react/src/adapters/react/components/prompt/prompt_renderer.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/screen/group_renderer.d.ts +14 -0
- package/dist/react/src/adapters/react/components/screen/group_renderer.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/screen/index.d.ts +7 -0
- package/dist/react/src/adapters/react/components/screen/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/screen/loading_message.d.ts +6 -0
- package/dist/react/src/adapters/react/components/screen/loading_message.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/screen/message_renderer.d.ts +6 -0
- package/dist/react/src/adapters/react/components/screen/message_renderer.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/screen/progress_message.d.ts +6 -0
- package/dist/react/src/adapters/react/components/screen/progress_message.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/screen/screen_bridge.d.ts +14 -0
- package/dist/react/src/adapters/react/components/screen/screen_bridge.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/screen/table_message.d.ts +6 -0
- package/dist/react/src/adapters/react/components/screen/table_message.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/screen_manager_bridge.d.ts +8 -0
- package/dist/react/src/adapters/react/components/screen_manager_bridge.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/sidebar/index.d.ts +4 -0
- package/dist/react/src/adapters/react/components/sidebar/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/sidebar/sidebar.d.ts +11 -0
- package/dist/react/src/adapters/react/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/sidebar/sidebar_item.d.ts +9 -0
- package/dist/react/src/adapters/react/components/sidebar/sidebar_item.d.ts.map +1 -0
- package/dist/react/src/adapters/react/components/sidebar/sidebar_separator.d.ts +2 -0
- package/dist/react/src/adapters/react/components/sidebar/sidebar_separator.d.ts.map +1 -0
- package/dist/react/src/adapters/react/context/index.d.ts +2 -0
- package/dist/react/src/adapters/react/context/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/context/logger_context.d.ts +53 -0
- package/dist/react/src/adapters/react/context/logger_context.d.ts.map +1 -0
- package/dist/react/src/adapters/react/hooks/index.d.ts +2 -0
- package/dist/react/src/adapters/react/hooks/index.d.ts.map +1 -0
- package/dist/react/src/adapters/react/hooks/use_theme.d.ts +7 -0
- package/dist/react/src/adapters/react/hooks/use_theme.d.ts.map +1 -0
- package/dist/react/src/adapters/react/index.d.ts +13 -0
- package/dist/react/src/adapters/react/index.d.ts.map +1 -0
- package/dist/react/tsconfig.react.tsbuildinfo +1 -0
- package/dist/solid/src/adapters/solid/components/file/file_log.d.ts +35 -0
- package/dist/solid/src/adapters/solid/components/file/file_log.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/file/index.d.ts +2 -0
- package/dist/solid/src/adapters/solid/components/file/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/filter/filter_bar.d.ts +7 -0
- package/dist/solid/src/adapters/solid/components/filter/filter_bar.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/filter/index.d.ts +2 -0
- package/dist/solid/src/adapters/solid/components/filter/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/help/help_overlay.d.ts +6 -0
- package/dist/solid/src/adapters/solid/components/help/help_overlay.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/help/index.d.ts +2 -0
- package/dist/solid/src/adapters/solid/components/help/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/log/index.d.ts +2 -0
- package/dist/solid/src/adapters/solid/components/log/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/log/log_message.d.ts +31 -0
- package/dist/solid/src/adapters/solid/components/log/log_message.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/prompt/index.d.ts +3 -0
- package/dist/solid/src/adapters/solid/components/prompt/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/prompt/prompt_renderer.d.ts +6 -0
- package/dist/solid/src/adapters/solid/components/prompt/prompt_renderer.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/screen/group_renderer.d.ts +14 -0
- package/dist/solid/src/adapters/solid/components/screen/group_renderer.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/screen/index.d.ts +7 -0
- package/dist/solid/src/adapters/solid/components/screen/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/screen/loading_message.d.ts +6 -0
- package/dist/solid/src/adapters/solid/components/screen/loading_message.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/screen/message_renderer.d.ts +6 -0
- package/dist/solid/src/adapters/solid/components/screen/message_renderer.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/screen/progress_message.d.ts +6 -0
- package/dist/solid/src/adapters/solid/components/screen/progress_message.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/screen/screen_bridge.d.ts +14 -0
- package/dist/solid/src/adapters/solid/components/screen/screen_bridge.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/screen/table_message.d.ts +6 -0
- package/dist/solid/src/adapters/solid/components/screen/table_message.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/screen_manager_bridge.d.ts +8 -0
- package/dist/solid/src/adapters/solid/components/screen_manager_bridge.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/sidebar/index.d.ts +4 -0
- package/dist/solid/src/adapters/solid/components/sidebar/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/sidebar/sidebar.d.ts +11 -0
- package/dist/solid/src/adapters/solid/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/sidebar/sidebar_item.d.ts +9 -0
- package/dist/solid/src/adapters/solid/components/sidebar/sidebar_item.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/components/sidebar/sidebar_separator.d.ts +2 -0
- package/dist/solid/src/adapters/solid/components/sidebar/sidebar_separator.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/context/index.d.ts +3 -0
- package/dist/solid/src/adapters/solid/context/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/context/logger_context.d.ts +52 -0
- package/dist/solid/src/adapters/solid/context/logger_context.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/hooks/index.d.ts +2 -0
- package/dist/solid/src/adapters/solid/hooks/index.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/hooks/use_theme.d.ts +7 -0
- package/dist/solid/src/adapters/solid/hooks/use_theme.d.ts.map +1 -0
- package/dist/solid/src/adapters/solid/index.d.ts +13 -0
- package/dist/solid/src/adapters/solid/index.d.ts.map +1 -0
- package/dist/solid/tsconfig.solid.tsbuildinfo +1 -0
- package/dist/tsconfig.base.tsbuildinfo +1 -0
- package/dist/tsconfig.react.tsbuildinfo +1 -0
- package/dist/tsconfig.solid.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/lib/adapters/react/index.cjs +1768 -0
- package/lib/adapters/react/index.cjs.map +1 -0
- package/lib/adapters/react/index.d.cts +80 -0
- package/lib/adapters/react/index.d.mts +80 -0
- package/lib/adapters/react/index.mjs +1760 -0
- package/lib/adapters/react/index.mjs.map +1 -0
- package/lib/adapters/solid/index.cjs +3855 -0
- package/lib/adapters/solid/index.cjs.map +1 -0
- package/lib/adapters/solid/index.d.cts +74 -0
- package/lib/adapters/solid/index.d.mts +74 -0
- package/lib/adapters/solid/index.mjs +3847 -0
- package/lib/adapters/solid/index.mjs.map +1 -0
- package/lib/filter_engine-DXqu9Vaq.cjs +1836 -0
- package/lib/filter_engine-DXqu9Vaq.cjs.map +1 -0
- package/lib/filter_engine-DmqhEhpA.mjs +1609 -0
- package/lib/filter_engine-DmqhEhpA.mjs.map +1 -0
- package/lib/index.cjs +1693 -1087
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +274 -1129
- package/lib/index.d.mts +294 -1149
- package/lib/index.mjs +1640 -1032
- package/lib/index.mjs.map +1 -1
- package/lib/interface-CTHQ08aY.d.mts +699 -0
- package/lib/interface-DQEIz9Mb.d.cts +699 -0
- package/package.json +25 -1
- package/project.json +2 -2
- package/src/__tests__/components/filter_bar.spec.tsx +1 -1
- package/src/__tests__/components/loading_message.spec.tsx +1 -1
- package/src/__tests__/components/log_message.spec.tsx +1 -1
- package/src/__tests__/components/progress_message.spec.tsx +1 -1
- package/src/__tests__/components/prompt_renderer.spec.tsx +1 -1
- package/src/__tests__/components/sidebar.spec.tsx +1 -1
- package/src/__tests__/services/logger.spec.ts +5 -3
- package/src/__tests__/utils/render-utils.tsx +1 -1
- package/src/adapters/index.ts +2 -0
- package/src/adapters/interface.ts +50 -0
- package/src/{components → adapters/react/components}/file/file_log.tsx +2 -2
- package/src/{components → adapters/react/components}/filter/filter_bar.tsx +2 -2
- package/src/{components → adapters/react/components}/help/help_overlay.tsx +2 -2
- package/src/{components → adapters/react/components}/log/log_message.tsx +2 -2
- package/src/{components → adapters/react/components}/prompt/prompt_renderer.tsx +1 -1
- package/src/{components → adapters/react/components}/screen/group_renderer.tsx +1 -1
- package/src/{components → adapters/react/components}/screen/loading_message.tsx +2 -3
- package/src/{components → adapters/react/components}/screen/message_renderer.tsx +1 -1
- package/src/{components → adapters/react/components}/screen/progress_message.tsx +1 -1
- package/src/{components → adapters/react/components}/screen/screen_bridge.tsx +2 -2
- package/src/{components → adapters/react/components}/screen/table_message.tsx +2 -2
- package/src/{components → adapters/react/components}/screen_manager_bridge.tsx +5 -5
- package/src/{components → adapters/react/components}/sidebar/sidebar.tsx +1 -1
- package/src/{components → adapters/react/components}/sidebar/sidebar_item.tsx +1 -1
- package/src/adapters/react/context/index.ts +1 -0
- package/src/{context → adapters/react/context}/logger_context.tsx +2 -2
- package/src/adapters/react/hooks/index.ts +1 -0
- package/src/{hooks → adapters/react/hooks}/use_theme.ts +1 -1
- package/src/adapters/react/index.ts +39 -0
- package/src/adapters/solid/components/file/file_log.tsx +221 -0
- package/src/adapters/solid/components/file/index.ts +1 -0
- package/src/adapters/solid/components/filter/filter_bar.tsx +84 -0
- package/src/adapters/solid/components/filter/index.ts +1 -0
- package/src/adapters/solid/components/help/help_overlay.tsx +106 -0
- package/src/adapters/solid/components/help/index.ts +1 -0
- package/src/adapters/solid/components/log/index.ts +1 -0
- package/src/adapters/solid/components/log/log_message.tsx +92 -0
- package/src/adapters/solid/components/prompt/index.ts +2 -0
- package/src/adapters/solid/components/prompt/prompt_renderer.tsx +350 -0
- package/src/adapters/solid/components/screen/group_renderer.tsx +61 -0
- package/src/adapters/solid/components/screen/index.ts +6 -0
- package/src/adapters/solid/components/screen/loading_message.tsx +39 -0
- package/src/adapters/solid/components/screen/message_renderer.tsx +122 -0
- package/src/adapters/solid/components/screen/progress_message.tsx +61 -0
- package/src/adapters/solid/components/screen/screen_bridge.tsx +155 -0
- package/src/adapters/solid/components/screen/table_message.tsx +58 -0
- package/src/adapters/solid/components/screen_manager_bridge.tsx +243 -0
- package/src/adapters/solid/components/sidebar/index.ts +3 -0
- package/src/adapters/solid/components/sidebar/sidebar.tsx +108 -0
- package/src/adapters/solid/components/sidebar/sidebar_item.tsx +55 -0
- package/src/adapters/solid/components/sidebar/sidebar_separator.tsx +13 -0
- package/src/adapters/solid/context/index.ts +2 -0
- package/src/adapters/solid/context/logger_context.tsx +95 -0
- package/src/adapters/solid/hooks/index.ts +1 -0
- package/src/adapters/solid/hooks/use_theme.ts +12 -0
- package/src/adapters/solid/index.tsx +43 -0
- package/src/adapters/solid/jsx.d.ts +98 -0
- package/src/components/index.ts +3 -15
- package/src/context/index.ts +3 -1
- package/src/factories/index.ts +1 -0
- package/src/factories/isomorphic-logger.factory.ts +22 -0
- package/src/factories/screen.factory.ts +2 -2
- package/src/hooks/index.ts +3 -1
- package/src/index.ts +10 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/isomorphic-logger.ts +9 -0
- package/src/keyboard/create_bindings.ts +2 -2
- package/src/overrides/index.ts +1 -0
- package/src/overrides/missing-adapter.override.ts +20 -0
- package/src/services/index.ts +1 -1
- package/src/services/logger.ts +1 -1
- package/src/services/screen.ts +3 -3
- package/src/services/{screen_manager.tsx → screen_manager.ts} +22 -11
- package/src/tokens/adapter.ts +10 -0
- package/src/tokens/index.ts +2 -0
- package/src/tokens/logger.ts +9 -0
- package/src/tokens/screen-manager.ts +9 -0
- package/src/types/screen.types.ts +1 -1
- package/src/utils/format.ts +3 -2
- package/tsconfig.base.json +31 -0
- package/tsconfig.json +6 -12
- package/tsconfig.react.json +16 -0
- package/tsconfig.solid.json +16 -0
- package/tsdown.config.mts +69 -16
- package/vitest.config.mts +20 -0
- package/lib/index.d.cts.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/screen_manager_bridge-Cp2p1Ix3.cjs +0 -3
- package/lib/screen_manager_bridge-D2BBwKcF.mjs +0 -3046
- package/lib/screen_manager_bridge-D2BBwKcF.mjs.map +0 -1
- package/lib/screen_manager_bridge-DT-l0rxa.mjs +0 -3
- package/lib/screen_manager_bridge-hMUrLiBP.cjs +0 -3369
- package/lib/screen_manager_bridge-hMUrLiBP.cjs.map +0 -1
- /package/src/{components → adapters/react/components}/file/index.ts +0 -0
- /package/src/{components → adapters/react/components}/filter/index.ts +0 -0
- /package/src/{components → adapters/react/components}/help/index.ts +0 -0
- /package/src/{components → adapters/react/components}/log/index.ts +0 -0
- /package/src/{components → adapters/react/components}/prompt/index.ts +0 -0
- /package/src/{components → adapters/react/components}/screen/index.ts +0 -0
- /package/src/{components → adapters/react/components}/sidebar/index.ts +0 -0
- /package/src/{components → adapters/react/components}/sidebar/sidebar_separator.tsx +0 -0
package/lib/index.cjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
let _opentui_react_jsx_runtime = require("@opentui/react/jsx-runtime");
|
|
1
|
+
const require_filter_engine = require('./filter_engine-DXqu9Vaq.cjs');
|
|
3
2
|
let _opentui_core = require("@opentui/core");
|
|
4
|
-
let _opentui_react = require("@opentui/react");
|
|
5
3
|
let _navios_core = require("@navios/core");
|
|
6
4
|
|
|
7
5
|
//#region ../../node_modules/zod/v4/core/core.js
|
|
@@ -3761,7 +3759,7 @@ const ScreenOptionsSchema = object({
|
|
|
3761
3759
|
const LoggerOptionsSchema = object({
|
|
3762
3760
|
screen: ScreenOptionsSchema.or(string()).optional().default("default"),
|
|
3763
3761
|
context: string().optional(),
|
|
3764
|
-
enabledLevels: array(_enum(
|
|
3762
|
+
enabledLevels: array(_enum(require_filter_engine.ALL_LOG_LEVELS)).default(require_filter_engine.ALL_LOG_LEVELS)
|
|
3765
3763
|
});
|
|
3766
3764
|
|
|
3767
3765
|
//#endregion
|
|
@@ -3775,434 +3773,321 @@ const Screen = _navios_core.InjectionToken.create("ScreenOptions", ScreenOptions
|
|
|
3775
3773
|
//#endregion
|
|
3776
3774
|
//#region src/tokens/logger.ts
|
|
3777
3775
|
const ScreenLogger = _navios_core.InjectionToken.create("ScreenLoggerInstance", LoggerOptionsSchema);
|
|
3776
|
+
/**
|
|
3777
|
+
* Isomorphic logger token for shared logger between TUI and Server.
|
|
3778
|
+
* This token is used to inject the logger instance into the application.
|
|
3779
|
+
*/ const IsomorphicLogger = _navios_core.InjectionToken.create("IsomorphicLogger", LoggerOptionsSchema);
|
|
3778
3780
|
|
|
3779
3781
|
//#endregion
|
|
3780
3782
|
//#region src/tokens/prompt.ts
|
|
3781
3783
|
const Prompt = _navios_core.InjectionToken.create("Prompt", PromptOptionsSchema);
|
|
3782
3784
|
|
|
3783
3785
|
//#endregion
|
|
3784
|
-
//#region src/
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
activePrompt = null;
|
|
3800
|
-
constructor(id, options) {
|
|
3801
|
-
this.id = id;
|
|
3802
|
-
this.name = options.name;
|
|
3803
|
-
this.icon = options.icon;
|
|
3804
|
-
this.badgeCount = options.badgeCount ?? 0;
|
|
3805
|
-
this.hidden = options.hidden ?? false;
|
|
3806
|
-
if (options.static) this.status = "static";
|
|
3807
|
-
}
|
|
3808
|
-
incrementVersion() {
|
|
3809
|
-
this.version++;
|
|
3810
|
-
}
|
|
3811
|
-
getVersion() {
|
|
3812
|
-
return this.version;
|
|
3813
|
-
}
|
|
3814
|
-
/**
|
|
3815
|
-
* Internal: Set the manager reference
|
|
3816
|
-
*/ _setManager(manager) {
|
|
3817
|
-
this.manager = manager;
|
|
3818
|
-
}
|
|
3819
|
-
/**
|
|
3820
|
-
* Internal: Set the print function for stdout output
|
|
3821
|
-
*/ _setPrintFn(fn) {
|
|
3822
|
-
this.printFn = fn;
|
|
3823
|
-
}
|
|
3824
|
-
getId() {
|
|
3825
|
-
return this.id;
|
|
3826
|
-
}
|
|
3827
|
-
getName() {
|
|
3828
|
-
return this.name;
|
|
3829
|
-
}
|
|
3830
|
-
getIcon() {
|
|
3831
|
-
return this.icon;
|
|
3832
|
-
}
|
|
3833
|
-
getBadgeCount() {
|
|
3834
|
-
return this.badgeCount;
|
|
3835
|
-
}
|
|
3836
|
-
setBadgeCount(count) {
|
|
3837
|
-
this.badgeCount = count;
|
|
3838
|
-
this.notifyChange();
|
|
3839
|
-
return this;
|
|
3840
|
-
}
|
|
3841
|
-
isHidden() {
|
|
3842
|
-
return this.hidden;
|
|
3843
|
-
}
|
|
3844
|
-
setHidden(hidden) {
|
|
3845
|
-
this.hidden = hidden;
|
|
3846
|
-
this.manager?.onScreenVisibilityChanged(this);
|
|
3847
|
-
this.notifyChange();
|
|
3848
|
-
return this;
|
|
3849
|
-
}
|
|
3850
|
-
show() {
|
|
3851
|
-
return this.setHidden(false);
|
|
3852
|
-
}
|
|
3853
|
-
hide() {
|
|
3854
|
-
return this.setHidden(true);
|
|
3855
|
-
}
|
|
3856
|
-
getStatus() {
|
|
3857
|
-
return this.status;
|
|
3786
|
+
//#region src/tokens/screen-manager.ts
|
|
3787
|
+
/**
|
|
3788
|
+
* Injection token for the ScreenManager singleton.
|
|
3789
|
+
* Used for dependency injection without requiring direct import of the class.
|
|
3790
|
+
*/ const ScreenManager = _navios_core.InjectionToken.create("ScreenManager");
|
|
3791
|
+
|
|
3792
|
+
//#endregion
|
|
3793
|
+
//#region src/factories/isomorphic-logger.factory.ts
|
|
3794
|
+
function applyDecs2203RFactory$6() {
|
|
3795
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
3796
|
+
return function addInitializer(initializer$2) {
|
|
3797
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
3798
|
+
assertCallable(initializer$2, "An initializer");
|
|
3799
|
+
initializers.push(initializer$2);
|
|
3800
|
+
};
|
|
3858
3801
|
}
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3802
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
3803
|
+
var kindStr;
|
|
3804
|
+
switch (kind) {
|
|
3805
|
+
case 1:
|
|
3806
|
+
kindStr = "accessor";
|
|
3807
|
+
break;
|
|
3808
|
+
case 2:
|
|
3809
|
+
kindStr = "method";
|
|
3810
|
+
break;
|
|
3811
|
+
case 3:
|
|
3812
|
+
kindStr = "getter";
|
|
3813
|
+
break;
|
|
3814
|
+
case 4:
|
|
3815
|
+
kindStr = "setter";
|
|
3816
|
+
break;
|
|
3817
|
+
default: kindStr = "field";
|
|
3867
3818
|
}
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
* Get all messages for rendering
|
|
3888
|
-
*/ getMessages() {
|
|
3889
|
-
return [...this.messages];
|
|
3890
|
-
}
|
|
3891
|
-
/**
|
|
3892
|
-
* Add a message to the screen (internal use by Logger)
|
|
3893
|
-
*/ addMessage(message) {
|
|
3894
|
-
this.messages.push(message);
|
|
3895
|
-
this.incrementVersion();
|
|
3896
|
-
this.notifyChange();
|
|
3897
|
-
}
|
|
3898
|
-
/**
|
|
3899
|
-
* Update a loading message (internal use by Logger)
|
|
3900
|
-
*/ updateMessage(id, updates) {
|
|
3901
|
-
const index = this.messages.findIndex((m) => m.id === id);
|
|
3902
|
-
if (index !== -1) {
|
|
3903
|
-
this.messages[index] = {
|
|
3904
|
-
...this.messages[index],
|
|
3905
|
-
...updates
|
|
3819
|
+
var ctx = {
|
|
3820
|
+
kind: kindStr,
|
|
3821
|
+
name: isPrivate ? "#" + name : name,
|
|
3822
|
+
static: isStatic,
|
|
3823
|
+
private: isPrivate,
|
|
3824
|
+
metadata
|
|
3825
|
+
};
|
|
3826
|
+
var decoratorFinishedRef = { v: false };
|
|
3827
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
3828
|
+
var get, set;
|
|
3829
|
+
if (kind === 0) if (isPrivate) {
|
|
3830
|
+
get = desc.get;
|
|
3831
|
+
set = desc.set;
|
|
3832
|
+
} else {
|
|
3833
|
+
get = function() {
|
|
3834
|
+
return this[name];
|
|
3835
|
+
};
|
|
3836
|
+
set = function(v) {
|
|
3837
|
+
this[name] = v;
|
|
3906
3838
|
};
|
|
3907
|
-
this.incrementVersion();
|
|
3908
|
-
this.notifyChange();
|
|
3909
3839
|
}
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
this.messages[index] = {
|
|
3917
|
-
...this.messages[index],
|
|
3918
|
-
...updates
|
|
3840
|
+
else if (kind === 2) get = function() {
|
|
3841
|
+
return desc.value;
|
|
3842
|
+
};
|
|
3843
|
+
else {
|
|
3844
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
3845
|
+
return desc.get.call(this);
|
|
3919
3846
|
};
|
|
3920
|
-
|
|
3921
|
-
|
|
3847
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
3848
|
+
desc.set.call(this, v);
|
|
3849
|
+
};
|
|
3850
|
+
}
|
|
3851
|
+
ctx.access = get && set ? {
|
|
3852
|
+
get,
|
|
3853
|
+
set
|
|
3854
|
+
} : get ? { get } : { set };
|
|
3855
|
+
try {
|
|
3856
|
+
return dec(value, ctx);
|
|
3857
|
+
} finally {
|
|
3858
|
+
decoratorFinishedRef.v = true;
|
|
3922
3859
|
}
|
|
3923
3860
|
}
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
*/ clear() {
|
|
3927
|
-
this.messages = [];
|
|
3928
|
-
this.incrementVersion();
|
|
3929
|
-
this.notifyChange();
|
|
3930
|
-
return this;
|
|
3861
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
3862
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
3931
3863
|
}
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
* Returns a promise that resolves when the user responds
|
|
3935
|
-
*/ _addPrompt(prompt) {
|
|
3936
|
-
return new Promise((resolve) => {
|
|
3937
|
-
const pending = {
|
|
3938
|
-
data: prompt,
|
|
3939
|
-
resolve
|
|
3940
|
-
};
|
|
3941
|
-
if (!this.manager?.isTuiBound()) {
|
|
3942
|
-
this.resolvePromptWithDefault(prompt, resolve);
|
|
3943
|
-
return;
|
|
3944
|
-
}
|
|
3945
|
-
if (prompt.timeout && prompt.timeoutStarted) pending.timeoutId = setTimeout(() => {
|
|
3946
|
-
if (this.activePrompt === pending) {
|
|
3947
|
-
this.resolvePromptWithDefault(prompt, resolve);
|
|
3948
|
-
this.activePrompt = null;
|
|
3949
|
-
this.activateNextPrompt();
|
|
3950
|
-
this.incrementVersion();
|
|
3951
|
-
this.notifyChange();
|
|
3952
|
-
} else {
|
|
3953
|
-
const idx = this.promptQueue.indexOf(pending);
|
|
3954
|
-
if (idx !== -1) {
|
|
3955
|
-
this.promptQueue.splice(idx, 1);
|
|
3956
|
-
this.resolvePromptWithDefault(prompt, resolve);
|
|
3957
|
-
this.incrementVersion();
|
|
3958
|
-
}
|
|
3959
|
-
}
|
|
3960
|
-
}, prompt.timeout);
|
|
3961
|
-
this.promptQueue.push(pending);
|
|
3962
|
-
if (!this.activePrompt) this.activateNextPrompt();
|
|
3963
|
-
});
|
|
3864
|
+
function assertCallable(fn, hint) {
|
|
3865
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
3964
3866
|
}
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
case "multiChoice":
|
|
3979
|
-
resolve(prompt.choices.filter((_, i) => prompt.selectedIndices.has(i)).map((c) => c.value));
|
|
3980
|
-
break;
|
|
3981
|
-
}
|
|
3982
|
-
}
|
|
3983
|
-
/**
|
|
3984
|
-
* Get the currently active prompt (for rendering)
|
|
3985
|
-
*/ getActivePrompt() {
|
|
3986
|
-
return this.activePrompt?.data ?? null;
|
|
3987
|
-
}
|
|
3988
|
-
/**
|
|
3989
|
-
* Check if this screen has an active prompt
|
|
3990
|
-
*/ hasActivePrompt() {
|
|
3991
|
-
return this.activePrompt !== null;
|
|
3992
|
-
}
|
|
3993
|
-
/**
|
|
3994
|
-
* Update prompt selection (for keyboard navigation)
|
|
3995
|
-
*/ updatePromptSelection(index) {
|
|
3996
|
-
if (!this.activePrompt) return;
|
|
3997
|
-
const prompt = this.activePrompt.data;
|
|
3998
|
-
if (prompt.type === "choice") {
|
|
3999
|
-
const maxIndex = prompt.choices.length - 1;
|
|
4000
|
-
prompt.selectedIndex = Math.max(0, Math.min(index, maxIndex));
|
|
4001
|
-
} else if (prompt.type === "multiChoice") {
|
|
4002
|
-
const maxIndex = prompt.choices.length - 1;
|
|
4003
|
-
prompt.focusedIndex = Math.max(0, Math.min(index, maxIndex));
|
|
4004
|
-
} else if (prompt.type === "confirm") prompt.selectedValue = index === 0;
|
|
4005
|
-
this.notifyChange();
|
|
4006
|
-
}
|
|
4007
|
-
/**
|
|
4008
|
-
* Navigate prompt selection up
|
|
4009
|
-
*/ promptNavigateUp() {
|
|
4010
|
-
if (!this.activePrompt) return;
|
|
4011
|
-
const prompt = this.activePrompt.data;
|
|
4012
|
-
if (prompt.type === "choice") this.updatePromptSelection(prompt.selectedIndex - 1);
|
|
4013
|
-
else if (prompt.type === "multiChoice") this.updatePromptSelection(prompt.focusedIndex - 1);
|
|
4014
|
-
else if (prompt.type === "confirm") this.updatePromptSelection(prompt.selectedValue ? 0 : 1);
|
|
4015
|
-
}
|
|
4016
|
-
/**
|
|
4017
|
-
* Navigate prompt selection down
|
|
4018
|
-
*/ promptNavigateDown() {
|
|
4019
|
-
if (!this.activePrompt) return;
|
|
4020
|
-
const prompt = this.activePrompt.data;
|
|
4021
|
-
if (prompt.type === "choice") this.updatePromptSelection(prompt.selectedIndex + 1);
|
|
4022
|
-
else if (prompt.type === "multiChoice") this.updatePromptSelection(prompt.focusedIndex + 1);
|
|
4023
|
-
else if (prompt.type === "confirm") this.updatePromptSelection(prompt.selectedValue ? 0 : 1);
|
|
4024
|
-
}
|
|
4025
|
-
/**
|
|
4026
|
-
* Toggle left/right for confirm prompts
|
|
4027
|
-
*/ promptNavigateLeft() {
|
|
4028
|
-
if (!this.activePrompt) return;
|
|
4029
|
-
const prompt = this.activePrompt.data;
|
|
4030
|
-
if (prompt.type === "confirm") {
|
|
4031
|
-
prompt.selectedValue = true;
|
|
4032
|
-
this.notifyChange();
|
|
4033
|
-
}
|
|
4034
|
-
}
|
|
4035
|
-
promptNavigateRight() {
|
|
4036
|
-
if (!this.activePrompt) return;
|
|
4037
|
-
const prompt = this.activePrompt.data;
|
|
4038
|
-
if (prompt.type === "confirm") {
|
|
4039
|
-
prompt.selectedValue = false;
|
|
4040
|
-
this.notifyChange();
|
|
4041
|
-
}
|
|
4042
|
-
}
|
|
4043
|
-
/**
|
|
4044
|
-
* Toggle selection for multiChoice prompts
|
|
4045
|
-
*/ promptToggleSelection() {
|
|
4046
|
-
if (!this.activePrompt) return;
|
|
4047
|
-
const prompt = this.activePrompt.data;
|
|
4048
|
-
if (prompt.type === "multiChoice") {
|
|
4049
|
-
const p = prompt;
|
|
4050
|
-
if (p.selectedIndices.has(p.focusedIndex)) p.selectedIndices.delete(p.focusedIndex);
|
|
4051
|
-
else if (p.selectedIndices.size < p.maxSelect) p.selectedIndices.add(p.focusedIndex);
|
|
4052
|
-
this.notifyChange();
|
|
3867
|
+
function assertValidReturnValue(kind, value) {
|
|
3868
|
+
var type = typeof value;
|
|
3869
|
+
if (kind === 1) {
|
|
3870
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
3871
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
3872
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
3873
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
3874
|
+
} else if (type !== "function") {
|
|
3875
|
+
var hint;
|
|
3876
|
+
if (kind === 0) hint = "field";
|
|
3877
|
+
else if (kind === 10) hint = "class";
|
|
3878
|
+
else hint = "method";
|
|
3879
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
4053
3880
|
}
|
|
4054
3881
|
}
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
3882
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
3883
|
+
var decs = decInfo[0];
|
|
3884
|
+
var desc, init, value;
|
|
3885
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
3886
|
+
get: decInfo[3],
|
|
3887
|
+
set: decInfo[4]
|
|
3888
|
+
};
|
|
3889
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
3890
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
3891
|
+
else desc = { value: decInfo[3] };
|
|
3892
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
3893
|
+
if (kind === 1) value = {
|
|
3894
|
+
get: desc.get,
|
|
3895
|
+
set: desc.set
|
|
3896
|
+
};
|
|
3897
|
+
else if (kind === 2) value = desc.value;
|
|
3898
|
+
else if (kind === 3) value = desc.get;
|
|
3899
|
+
else if (kind === 4) value = desc.set;
|
|
3900
|
+
var newValue, get, set;
|
|
3901
|
+
if (typeof decs === "function") {
|
|
3902
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
3903
|
+
if (newValue !== void 0) {
|
|
3904
|
+
assertValidReturnValue(kind, newValue);
|
|
3905
|
+
if (kind === 0) init = newValue;
|
|
3906
|
+
else if (kind === 1) {
|
|
3907
|
+
init = newValue.init;
|
|
3908
|
+
get = newValue.get || value.get;
|
|
3909
|
+
set = newValue.set || value.set;
|
|
3910
|
+
value = {
|
|
3911
|
+
get,
|
|
3912
|
+
set
|
|
3913
|
+
};
|
|
3914
|
+
} else value = newValue;
|
|
3915
|
+
}
|
|
3916
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
3917
|
+
var dec = decs[i];
|
|
3918
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
3919
|
+
if (newValue !== void 0) {
|
|
3920
|
+
assertValidReturnValue(kind, newValue);
|
|
3921
|
+
var newInit;
|
|
3922
|
+
if (kind === 0) newInit = newValue;
|
|
3923
|
+
else if (kind === 1) {
|
|
3924
|
+
newInit = newValue.init;
|
|
3925
|
+
get = newValue.get || value.get;
|
|
3926
|
+
set = newValue.set || value.set;
|
|
3927
|
+
value = {
|
|
3928
|
+
get,
|
|
3929
|
+
set
|
|
3930
|
+
};
|
|
3931
|
+
} else value = newValue;
|
|
3932
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
3933
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
3934
|
+
else init.push(newInit);
|
|
4066
3935
|
}
|
|
4067
|
-
} else if (prompt.type === "input") return true;
|
|
4068
|
-
return false;
|
|
4069
|
-
}
|
|
4070
|
-
/**
|
|
4071
|
-
* Exit input mode for choice prompts
|
|
4072
|
-
*/ promptExitInputMode() {
|
|
4073
|
-
if (!this.activePrompt) return;
|
|
4074
|
-
const prompt = this.activePrompt.data;
|
|
4075
|
-
if (prompt.type === "choice" && prompt.inputMode) {
|
|
4076
|
-
prompt.inputMode = false;
|
|
4077
|
-
this.notifyChange();
|
|
4078
|
-
}
|
|
4079
|
-
}
|
|
4080
|
-
/**
|
|
4081
|
-
* Check if prompt is in input mode
|
|
4082
|
-
*/ isPromptInInputMode() {
|
|
4083
|
-
if (!this.activePrompt) return false;
|
|
4084
|
-
const prompt = this.activePrompt.data;
|
|
4085
|
-
if (prompt.type === "choice") return prompt.inputMode;
|
|
4086
|
-
if (prompt.type === "input") return true;
|
|
4087
|
-
return false;
|
|
4088
|
-
}
|
|
4089
|
-
/**
|
|
4090
|
-
* Update input value for choice prompts
|
|
4091
|
-
*/ promptUpdateInput(value) {
|
|
4092
|
-
if (!this.activePrompt) return;
|
|
4093
|
-
const prompt = this.activePrompt.data;
|
|
4094
|
-
if (prompt.type === "choice" && prompt.inputMode) {
|
|
4095
|
-
prompt.inputValue = value;
|
|
4096
|
-
this.notifyChange();
|
|
4097
|
-
} else if (prompt.type === "input") {
|
|
4098
|
-
prompt.value = value;
|
|
4099
|
-
this.notifyChange();
|
|
4100
3936
|
}
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
3937
|
+
if (kind === 0 || kind === 1) {
|
|
3938
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
3939
|
+
return init$1;
|
|
3940
|
+
};
|
|
3941
|
+
else if (typeof init !== "function") {
|
|
3942
|
+
var ownInitializers = init;
|
|
3943
|
+
init = function(instance, init$1) {
|
|
3944
|
+
var value$1 = init$1;
|
|
3945
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
3946
|
+
return value$1;
|
|
3947
|
+
};
|
|
3948
|
+
} else {
|
|
3949
|
+
var originalInitializer = init;
|
|
3950
|
+
init = function(instance, init$1) {
|
|
3951
|
+
return originalInitializer.call(instance, init$1);
|
|
3952
|
+
};
|
|
3953
|
+
}
|
|
3954
|
+
ret.push(init);
|
|
4113
3955
|
}
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
3956
|
+
if (kind !== 0) {
|
|
3957
|
+
if (kind === 1) {
|
|
3958
|
+
desc.get = value.get;
|
|
3959
|
+
desc.set = value.set;
|
|
3960
|
+
} else if (kind === 2) desc.value = value;
|
|
3961
|
+
else if (kind === 3) desc.get = value;
|
|
3962
|
+
else if (kind === 4) desc.set = value;
|
|
3963
|
+
if (isPrivate) if (kind === 1) {
|
|
3964
|
+
ret.push(function(instance, args) {
|
|
3965
|
+
return value.get.call(instance, args);
|
|
3966
|
+
});
|
|
3967
|
+
ret.push(function(instance, args) {
|
|
3968
|
+
return value.set.call(instance, args);
|
|
3969
|
+
});
|
|
3970
|
+
} else if (kind === 2) ret.push(value);
|
|
3971
|
+
else ret.push(function(instance, args) {
|
|
3972
|
+
return value.call(instance, args);
|
|
3973
|
+
});
|
|
3974
|
+
else Object.defineProperty(base, name, desc);
|
|
4126
3975
|
}
|
|
4127
3976
|
}
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
3977
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
3978
|
+
var ret = [];
|
|
3979
|
+
var protoInitializers;
|
|
3980
|
+
var staticInitializers;
|
|
3981
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
3982
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
3983
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
3984
|
+
var decInfo = decInfos[i];
|
|
3985
|
+
if (!Array.isArray(decInfo)) continue;
|
|
3986
|
+
var kind = decInfo[1];
|
|
3987
|
+
var name = decInfo[2];
|
|
3988
|
+
var isPrivate = decInfo.length > 3;
|
|
3989
|
+
var isStatic = kind >= 5;
|
|
3990
|
+
var base;
|
|
3991
|
+
var initializers;
|
|
3992
|
+
if (isStatic) {
|
|
3993
|
+
base = Class;
|
|
3994
|
+
kind = kind - 5;
|
|
3995
|
+
staticInitializers = staticInitializers || [];
|
|
3996
|
+
initializers = staticInitializers;
|
|
3997
|
+
} else {
|
|
3998
|
+
base = Class.prototype;
|
|
3999
|
+
protoInitializers = protoInitializers || [];
|
|
4000
|
+
initializers = protoInitializers;
|
|
4151
4001
|
}
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
this.activePrompt.resolve(prompt.value);
|
|
4159
|
-
break;
|
|
4160
|
-
case "multiChoice": {
|
|
4161
|
-
const values = prompt.choices.filter((_, i) => prompt.selectedIndices.has(i)).map((c) => c.value);
|
|
4162
|
-
prompt.resolvedValues = values;
|
|
4163
|
-
this.activePrompt.resolve(values);
|
|
4164
|
-
break;
|
|
4002
|
+
if (kind !== 0 && !isPrivate) {
|
|
4003
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
4004
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
4005
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
4006
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
4007
|
+
else existingNonFields.set(name, true);
|
|
4165
4008
|
}
|
|
4009
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
4166
4010
|
}
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
this.notifyChange();
|
|
4011
|
+
pushInitializers(ret, protoInitializers);
|
|
4012
|
+
pushInitializers(ret, staticInitializers);
|
|
4013
|
+
return ret;
|
|
4171
4014
|
}
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4015
|
+
function pushInitializers(ret, initializers) {
|
|
4016
|
+
if (initializers) ret.push(function(instance) {
|
|
4017
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
4018
|
+
return instance;
|
|
4019
|
+
});
|
|
4020
|
+
}
|
|
4021
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
4022
|
+
if (classDecs.length > 0) {
|
|
4023
|
+
var initializers = [];
|
|
4024
|
+
var newClass = targetClass;
|
|
4025
|
+
var name = targetClass.name;
|
|
4026
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
4027
|
+
var decoratorFinishedRef = { v: false };
|
|
4028
|
+
try {
|
|
4029
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
4030
|
+
kind: "class",
|
|
4031
|
+
name,
|
|
4032
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
4033
|
+
metadata
|
|
4034
|
+
});
|
|
4035
|
+
} finally {
|
|
4036
|
+
decoratorFinishedRef.v = true;
|
|
4037
|
+
}
|
|
4038
|
+
if (nextNewClass !== void 0) {
|
|
4039
|
+
assertValidReturnValue(10, nextNewClass);
|
|
4040
|
+
newClass = nextNewClass;
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4043
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
4044
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
4045
|
+
}];
|
|
4180
4046
|
}
|
|
4181
4047
|
}
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4048
|
+
function defineMetadata(Class, metadata) {
|
|
4049
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
4050
|
+
configurable: true,
|
|
4051
|
+
enumerable: true,
|
|
4052
|
+
value: metadata
|
|
4053
|
+
});
|
|
4187
4054
|
}
|
|
4188
|
-
|
|
4189
|
-
|
|
4055
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
4056
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
4057
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
4058
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
4059
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
4060
|
+
return {
|
|
4061
|
+
e,
|
|
4062
|
+
get c() {
|
|
4063
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
4064
|
+
}
|
|
4065
|
+
};
|
|
4066
|
+
};
|
|
4067
|
+
}
|
|
4068
|
+
function _apply_decs_2203_r$6(targetClass, memberDecs, classDecs, parentClass) {
|
|
4069
|
+
return (_apply_decs_2203_r$6 = applyDecs2203RFactory$6())(targetClass, memberDecs, classDecs, parentClass);
|
|
4070
|
+
}
|
|
4071
|
+
var _dec$5, _initClass$5;
|
|
4072
|
+
let _IsomorphicLoggerFactory;
|
|
4073
|
+
_dec$5 = (0, _navios_core.Factory)({ token: IsomorphicLogger });
|
|
4074
|
+
var IsomorphicLoggerFactory = class {
|
|
4075
|
+
static {
|
|
4076
|
+
({c: [_IsomorphicLoggerFactory, _initClass$5]} = _apply_decs_2203_r$6(this, [], [_dec$5]));
|
|
4190
4077
|
}
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
this.hasPrinted = true;
|
|
4199
|
-
}
|
|
4078
|
+
screenManager = (0, _navios_core.inject)(ScreenManager);
|
|
4079
|
+
async create(ctx, options) {
|
|
4080
|
+
if (this.screenManager.isTuiBound()) return ctx.inject(ScreenLogger, options);
|
|
4081
|
+
return ctx.inject(_navios_core.Logger, { context: options.context });
|
|
4082
|
+
}
|
|
4083
|
+
static {
|
|
4084
|
+
_initClass$5();
|
|
4200
4085
|
}
|
|
4201
4086
|
};
|
|
4202
4087
|
|
|
4203
4088
|
//#endregion
|
|
4204
|
-
//#region src/
|
|
4205
|
-
function applyDecs2203RFactory$
|
|
4089
|
+
//#region src/factories/screen.factory.ts
|
|
4090
|
+
function applyDecs2203RFactory$5() {
|
|
4206
4091
|
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
4207
4092
|
return function addInitializer(initializer$2) {
|
|
4208
4093
|
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
@@ -4476,260 +4361,358 @@ function applyDecs2203RFactory$4() {
|
|
|
4476
4361
|
};
|
|
4477
4362
|
};
|
|
4478
4363
|
}
|
|
4479
|
-
function _apply_decs_2203_r$
|
|
4480
|
-
return (_apply_decs_2203_r$
|
|
4364
|
+
function _apply_decs_2203_r$5(targetClass, memberDecs, classDecs, parentClass) {
|
|
4365
|
+
return (_apply_decs_2203_r$5 = applyDecs2203RFactory$5())(targetClass, memberDecs, classDecs, parentClass);
|
|
4481
4366
|
}
|
|
4482
|
-
var _dec$
|
|
4483
|
-
let
|
|
4484
|
-
_dec$
|
|
4485
|
-
var
|
|
4367
|
+
var _dec$4, _initClass$4;
|
|
4368
|
+
let _ScreenFactory;
|
|
4369
|
+
_dec$4 = (0, _navios_core.Factory)({ token: Screen });
|
|
4370
|
+
var ScreenFactory = class {
|
|
4486
4371
|
static {
|
|
4487
|
-
({c: [
|
|
4488
|
-
}
|
|
4489
|
-
screens = /* @__PURE__ */ new Map();
|
|
4490
|
-
screenOrder = [];
|
|
4491
|
-
activeScreenId = null;
|
|
4492
|
-
renderer = null;
|
|
4493
|
-
root = null;
|
|
4494
|
-
isBound = false;
|
|
4495
|
-
changeListeners = /* @__PURE__ */ new Set();
|
|
4496
|
-
bindOptions = {};
|
|
4497
|
-
autoCloseTimer = null;
|
|
4498
|
-
theme;
|
|
4499
|
-
focusArea = "content";
|
|
4500
|
-
selectedIndex = 0;
|
|
4501
|
-
/**
|
|
4502
|
-
* Create a new screen and return it
|
|
4503
|
-
*/ createScreen(options) {
|
|
4504
|
-
const id = `screen-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
4505
|
-
const screen = new ScreenInstance(id, options);
|
|
4506
|
-
screen._setManager(this);
|
|
4507
|
-
screen._setPrintFn(require_screen_manager_bridge.printMessagesToStdout);
|
|
4508
|
-
screen.onChange(() => this.notifyChange());
|
|
4509
|
-
this.screens.set(id, screen);
|
|
4510
|
-
this.screenOrder.push(id);
|
|
4511
|
-
if (!this.activeScreenId && !screen.isHidden()) this.activeScreenId = id;
|
|
4512
|
-
this.notifyChange();
|
|
4513
|
-
return screen;
|
|
4514
|
-
}
|
|
4515
|
-
getScreenByName(name) {
|
|
4516
|
-
const id = Array.from(this.screens.keys()).find((id$1) => this.screens.get(id$1)?.getName() === name);
|
|
4517
|
-
return id ? this.screens.get(id) : void 0;
|
|
4372
|
+
({c: [_ScreenFactory, _initClass$4]} = _apply_decs_2203_r$5(this, [], [_dec$4]));
|
|
4518
4373
|
}
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
this.screens.delete(id);
|
|
4525
|
-
this.screenOrder = this.screenOrder.filter((sid) => sid !== id);
|
|
4526
|
-
if (this.activeScreenId === id) this.activeScreenId = this.getScreens()[0]?.getId() ?? null;
|
|
4527
|
-
const visibleScreens = this.getScreens();
|
|
4528
|
-
if (this.selectedIndex >= visibleScreens.length) this.selectedIndex = Math.max(0, visibleScreens.length - 1);
|
|
4529
|
-
this.notifyChange();
|
|
4374
|
+
screenManager = (0, _navios_core.inject)(ScreenManager);
|
|
4375
|
+
create(ctx, options) {
|
|
4376
|
+
const screen = this.screenManager.getScreenByName(options.name);
|
|
4377
|
+
if (screen) return screen;
|
|
4378
|
+
return this.screenManager.createScreen(options);
|
|
4530
4379
|
}
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
*/ async bind(options) {
|
|
4534
|
-
if (this.isBound) return;
|
|
4535
|
-
this.bindOptions = options ?? {};
|
|
4536
|
-
if (options?.theme) this.theme = typeof options.theme === "string" ? require_screen_manager_bridge.getThemePreset(options.theme) : options.theme;
|
|
4537
|
-
this.renderer = await (0, _opentui_core.createCliRenderer)({
|
|
4538
|
-
exitOnCtrlC: options?.exitOnCtrlC ?? true,
|
|
4539
|
-
useAlternateScreen: true,
|
|
4540
|
-
useMouse: options?.useMouse ?? false
|
|
4541
|
-
});
|
|
4542
|
-
this.root = (0, _opentui_react.createRoot)(this.renderer);
|
|
4543
|
-
this.isBound = true;
|
|
4544
|
-
this.render();
|
|
4380
|
+
static {
|
|
4381
|
+
_initClass$4();
|
|
4545
4382
|
}
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4383
|
+
};
|
|
4384
|
+
|
|
4385
|
+
//#endregion
|
|
4386
|
+
//#region src/overrides/console.logger.override.ts
|
|
4387
|
+
function applyDecs2203RFactory$4() {
|
|
4388
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
4389
|
+
return function addInitializer(initializer$2) {
|
|
4390
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
4391
|
+
assertCallable(initializer$2, "An initializer");
|
|
4392
|
+
initializers.push(initializer$2);
|
|
4393
|
+
};
|
|
4550
4394
|
}
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4395
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
4396
|
+
var kindStr;
|
|
4397
|
+
switch (kind) {
|
|
4398
|
+
case 1:
|
|
4399
|
+
kindStr = "accessor";
|
|
4400
|
+
break;
|
|
4401
|
+
case 2:
|
|
4402
|
+
kindStr = "method";
|
|
4403
|
+
break;
|
|
4404
|
+
case 3:
|
|
4405
|
+
kindStr = "getter";
|
|
4406
|
+
break;
|
|
4407
|
+
case 4:
|
|
4408
|
+
kindStr = "setter";
|
|
4409
|
+
break;
|
|
4410
|
+
default: kindStr = "field";
|
|
4559
4411
|
}
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4412
|
+
var ctx = {
|
|
4413
|
+
kind: kindStr,
|
|
4414
|
+
name: isPrivate ? "#" + name : name,
|
|
4415
|
+
static: isStatic,
|
|
4416
|
+
private: isPrivate,
|
|
4417
|
+
metadata
|
|
4418
|
+
};
|
|
4419
|
+
var decoratorFinishedRef = { v: false };
|
|
4420
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
4421
|
+
var get, set;
|
|
4422
|
+
if (kind === 0) if (isPrivate) {
|
|
4423
|
+
get = desc.get;
|
|
4424
|
+
set = desc.set;
|
|
4425
|
+
} else {
|
|
4426
|
+
get = function() {
|
|
4427
|
+
return this[name];
|
|
4428
|
+
};
|
|
4429
|
+
set = function(v) {
|
|
4430
|
+
this[name] = v;
|
|
4431
|
+
};
|
|
4432
|
+
}
|
|
4433
|
+
else if (kind === 2) get = function() {
|
|
4434
|
+
return desc.value;
|
|
4435
|
+
};
|
|
4436
|
+
else {
|
|
4437
|
+
if (kind === 1 || kind === 3) get = function() {
|
|
4438
|
+
return desc.get.call(this);
|
|
4439
|
+
};
|
|
4440
|
+
if (kind === 1 || kind === 4) set = function(v) {
|
|
4441
|
+
desc.set.call(this, v);
|
|
4442
|
+
};
|
|
4443
|
+
}
|
|
4444
|
+
ctx.access = get && set ? {
|
|
4445
|
+
get,
|
|
4446
|
+
set
|
|
4447
|
+
} : get ? { get } : { set };
|
|
4448
|
+
try {
|
|
4449
|
+
return dec(value, ctx);
|
|
4450
|
+
} finally {
|
|
4451
|
+
decoratorFinishedRef.v = true;
|
|
4574
4452
|
}
|
|
4575
4453
|
}
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
*/ isTuiBound() {
|
|
4579
|
-
return this.isBound;
|
|
4580
|
-
}
|
|
4581
|
-
/**
|
|
4582
|
-
* Called by Screen when a prompt becomes active
|
|
4583
|
-
* Focuses the screen and switches to content area
|
|
4584
|
-
*/ onScreenPromptActivated(screen) {
|
|
4585
|
-
this.setActiveScreen(screen);
|
|
4586
|
-
this.focusArea = "content";
|
|
4587
|
-
this.notifyChange();
|
|
4588
|
-
}
|
|
4589
|
-
/**
|
|
4590
|
-
* Check if any screen has an active prompt
|
|
4591
|
-
*/ hasActivePrompt() {
|
|
4592
|
-
for (const screen of this.screens.values()) if (screen.hasActivePrompt()) return true;
|
|
4593
|
-
return false;
|
|
4454
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
4455
|
+
if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
4594
4456
|
}
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
*/ getScreenWithActivePrompt() {
|
|
4598
|
-
for (const screen of this.screens.values()) if (screen.hasActivePrompt()) return screen;
|
|
4599
|
-
return null;
|
|
4457
|
+
function assertCallable(fn, hint) {
|
|
4458
|
+
if (typeof fn !== "function") throw new TypeError(hint + " must be a function");
|
|
4600
4459
|
}
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4460
|
+
function assertValidReturnValue(kind, value) {
|
|
4461
|
+
var type = typeof value;
|
|
4462
|
+
if (kind === 1) {
|
|
4463
|
+
if (type !== "object" || value === null) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
4464
|
+
if (value.get !== void 0) assertCallable(value.get, "accessor.get");
|
|
4465
|
+
if (value.set !== void 0) assertCallable(value.set, "accessor.set");
|
|
4466
|
+
if (value.init !== void 0) assertCallable(value.init, "accessor.init");
|
|
4467
|
+
} else if (type !== "function") {
|
|
4468
|
+
var hint;
|
|
4469
|
+
if (kind === 0) hint = "field";
|
|
4470
|
+
else if (kind === 10) hint = "class";
|
|
4471
|
+
else hint = "method";
|
|
4472
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
4608
4473
|
}
|
|
4609
|
-
const visibleScreens = this.getScreens();
|
|
4610
|
-
if (this.selectedIndex >= visibleScreens.length) this.selectedIndex = Math.max(0, visibleScreens.length - 1);
|
|
4611
|
-
this.notifyChange();
|
|
4612
4474
|
}
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4475
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
4476
|
+
var decs = decInfo[0];
|
|
4477
|
+
var desc, init, value;
|
|
4478
|
+
if (isPrivate) if (kind === 0 || kind === 1) desc = {
|
|
4479
|
+
get: decInfo[3],
|
|
4480
|
+
set: decInfo[4]
|
|
4481
|
+
};
|
|
4482
|
+
else if (kind === 3) desc = { get: decInfo[3] };
|
|
4483
|
+
else if (kind === 4) desc = { set: decInfo[3] };
|
|
4484
|
+
else desc = { value: decInfo[3] };
|
|
4485
|
+
else if (kind !== 0) desc = Object.getOwnPropertyDescriptor(base, name);
|
|
4486
|
+
if (kind === 1) value = {
|
|
4487
|
+
get: desc.get,
|
|
4488
|
+
set: desc.set
|
|
4489
|
+
};
|
|
4490
|
+
else if (kind === 2) value = desc.value;
|
|
4491
|
+
else if (kind === 3) value = desc.get;
|
|
4492
|
+
else if (kind === 4) value = desc.set;
|
|
4493
|
+
var newValue, get, set;
|
|
4494
|
+
if (typeof decs === "function") {
|
|
4495
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
4496
|
+
if (newValue !== void 0) {
|
|
4497
|
+
assertValidReturnValue(kind, newValue);
|
|
4498
|
+
if (kind === 0) init = newValue;
|
|
4499
|
+
else if (kind === 1) {
|
|
4500
|
+
init = newValue.init;
|
|
4501
|
+
get = newValue.get || value.get;
|
|
4502
|
+
set = newValue.set || value.set;
|
|
4503
|
+
value = {
|
|
4504
|
+
get,
|
|
4505
|
+
set
|
|
4506
|
+
};
|
|
4507
|
+
} else value = newValue;
|
|
4508
|
+
}
|
|
4509
|
+
} else for (var i = decs.length - 1; i >= 0; i--) {
|
|
4510
|
+
var dec = decs[i];
|
|
4511
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
4512
|
+
if (newValue !== void 0) {
|
|
4513
|
+
assertValidReturnValue(kind, newValue);
|
|
4514
|
+
var newInit;
|
|
4515
|
+
if (kind === 0) newInit = newValue;
|
|
4516
|
+
else if (kind === 1) {
|
|
4517
|
+
newInit = newValue.init;
|
|
4518
|
+
get = newValue.get || value.get;
|
|
4519
|
+
set = newValue.set || value.set;
|
|
4520
|
+
value = {
|
|
4521
|
+
get,
|
|
4522
|
+
set
|
|
4523
|
+
};
|
|
4524
|
+
} else value = newValue;
|
|
4525
|
+
if (newInit !== void 0) if (init === void 0) init = newInit;
|
|
4526
|
+
else if (typeof init === "function") init = [init, newInit];
|
|
4527
|
+
else init.push(newInit);
|
|
4528
|
+
}
|
|
4624
4529
|
}
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4530
|
+
if (kind === 0 || kind === 1) {
|
|
4531
|
+
if (init === void 0) init = function(instance, init$1) {
|
|
4532
|
+
return init$1;
|
|
4533
|
+
};
|
|
4534
|
+
else if (typeof init !== "function") {
|
|
4535
|
+
var ownInitializers = init;
|
|
4536
|
+
init = function(instance, init$1) {
|
|
4537
|
+
var value$1 = init$1;
|
|
4538
|
+
for (var i$1 = 0; i$1 < ownInitializers.length; i$1++) value$1 = ownInitializers[i$1].call(instance, value$1);
|
|
4539
|
+
return value$1;
|
|
4540
|
+
};
|
|
4541
|
+
} else {
|
|
4542
|
+
var originalInitializer = init;
|
|
4543
|
+
init = function(instance, init$1) {
|
|
4544
|
+
return originalInitializer.call(instance, init$1);
|
|
4545
|
+
};
|
|
4546
|
+
}
|
|
4547
|
+
ret.push(init);
|
|
4637
4548
|
}
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4549
|
+
if (kind !== 0) {
|
|
4550
|
+
if (kind === 1) {
|
|
4551
|
+
desc.get = value.get;
|
|
4552
|
+
desc.set = value.set;
|
|
4553
|
+
} else if (kind === 2) desc.value = value;
|
|
4554
|
+
else if (kind === 3) desc.get = value;
|
|
4555
|
+
else if (kind === 4) desc.set = value;
|
|
4556
|
+
if (isPrivate) if (kind === 1) {
|
|
4557
|
+
ret.push(function(instance, args) {
|
|
4558
|
+
return value.get.call(instance, args);
|
|
4559
|
+
});
|
|
4560
|
+
ret.push(function(instance, args) {
|
|
4561
|
+
return value.set.call(instance, args);
|
|
4562
|
+
});
|
|
4563
|
+
} else if (kind === 2) ret.push(value);
|
|
4564
|
+
else ret.push(function(instance, args) {
|
|
4565
|
+
return value.call(instance, args);
|
|
4566
|
+
});
|
|
4567
|
+
else Object.defineProperty(base, name, desc);
|
|
4641
4568
|
}
|
|
4642
|
-
const delay = typeof autoClose === "number" ? autoClose : 5e3;
|
|
4643
|
-
this.autoCloseTimer = setTimeout(() => {
|
|
4644
|
-
this.unbind();
|
|
4645
|
-
}, delay);
|
|
4646
|
-
}
|
|
4647
|
-
/**
|
|
4648
|
-
* Get visible screens in display order (excludes hidden screens)
|
|
4649
|
-
*/ getScreens() {
|
|
4650
|
-
return this.screenOrder.map((id) => this.screens.get(id)).filter((s) => s !== void 0 && !s.isHidden());
|
|
4651
|
-
}
|
|
4652
|
-
/**
|
|
4653
|
-
* Get all screens in display order (includes hidden screens)
|
|
4654
|
-
*/ getAllScreens() {
|
|
4655
|
-
return this.screenOrder.map((id) => this.screens.get(id)).filter((s) => s !== void 0);
|
|
4656
|
-
}
|
|
4657
|
-
/**
|
|
4658
|
-
* Get the active screen
|
|
4659
|
-
*/ getActiveScreen() {
|
|
4660
|
-
return this.activeScreenId ? this.screens.get(this.activeScreenId) ?? null : null;
|
|
4661
|
-
}
|
|
4662
|
-
/**
|
|
4663
|
-
* Set the active screen
|
|
4664
|
-
*/ setActiveScreen(screen) {
|
|
4665
|
-
this.activeScreenId = screen.getId();
|
|
4666
|
-
this.notifyChange();
|
|
4667
|
-
}
|
|
4668
|
-
/**
|
|
4669
|
-
* Get bind options
|
|
4670
|
-
*/ getBindOptions() {
|
|
4671
|
-
return this.bindOptions;
|
|
4672
|
-
}
|
|
4673
|
-
/**
|
|
4674
|
-
* Set focus area (sidebar or content)
|
|
4675
|
-
*/ setFocusArea(area) {
|
|
4676
|
-
this.focusArea = area;
|
|
4677
|
-
this.notifyChange();
|
|
4678
|
-
}
|
|
4679
|
-
/**
|
|
4680
|
-
* Set selected index in sidebar
|
|
4681
|
-
*/ setSelectedIndex(index) {
|
|
4682
|
-
const visibleScreens = this.getScreens();
|
|
4683
|
-
this.selectedIndex = Math.max(0, Math.min(index, visibleScreens.length - 1));
|
|
4684
|
-
this.notifyChange();
|
|
4685
4569
|
}
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4570
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
4571
|
+
var ret = [];
|
|
4572
|
+
var protoInitializers;
|
|
4573
|
+
var staticInitializers;
|
|
4574
|
+
var existingProtoNonFields = /* @__PURE__ */ new Map();
|
|
4575
|
+
var existingStaticNonFields = /* @__PURE__ */ new Map();
|
|
4576
|
+
for (var i = 0; i < decInfos.length; i++) {
|
|
4577
|
+
var decInfo = decInfos[i];
|
|
4578
|
+
if (!Array.isArray(decInfo)) continue;
|
|
4579
|
+
var kind = decInfo[1];
|
|
4580
|
+
var name = decInfo[2];
|
|
4581
|
+
var isPrivate = decInfo.length > 3;
|
|
4582
|
+
var isStatic = kind >= 5;
|
|
4583
|
+
var base;
|
|
4584
|
+
var initializers;
|
|
4585
|
+
if (isStatic) {
|
|
4586
|
+
base = Class;
|
|
4587
|
+
kind = kind - 5;
|
|
4588
|
+
staticInitializers = staticInitializers || [];
|
|
4589
|
+
initializers = staticInitializers;
|
|
4590
|
+
} else {
|
|
4591
|
+
base = Class.prototype;
|
|
4592
|
+
protoInitializers = protoInitializers || [];
|
|
4593
|
+
initializers = protoInitializers;
|
|
4594
|
+
}
|
|
4595
|
+
if (kind !== 0 && !isPrivate) {
|
|
4596
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
4597
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
4598
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
4599
|
+
else if (!existingKind && kind > 2) existingNonFields.set(name, kind);
|
|
4600
|
+
else existingNonFields.set(name, true);
|
|
4601
|
+
}
|
|
4602
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
4603
|
+
}
|
|
4604
|
+
pushInitializers(ret, protoInitializers);
|
|
4605
|
+
pushInitializers(ret, staticInitializers);
|
|
4606
|
+
return ret;
|
|
4690
4607
|
}
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4608
|
+
function pushInitializers(ret, initializers) {
|
|
4609
|
+
if (initializers) ret.push(function(instance) {
|
|
4610
|
+
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
|
|
4611
|
+
return instance;
|
|
4612
|
+
});
|
|
4695
4613
|
}
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4614
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
4615
|
+
if (classDecs.length > 0) {
|
|
4616
|
+
var initializers = [];
|
|
4617
|
+
var newClass = targetClass;
|
|
4618
|
+
var name = targetClass.name;
|
|
4619
|
+
for (var i = classDecs.length - 1; i >= 0; i--) {
|
|
4620
|
+
var decoratorFinishedRef = { v: false };
|
|
4621
|
+
try {
|
|
4622
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
4623
|
+
kind: "class",
|
|
4624
|
+
name,
|
|
4625
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
4626
|
+
metadata
|
|
4627
|
+
});
|
|
4628
|
+
} finally {
|
|
4629
|
+
decoratorFinishedRef.v = true;
|
|
4630
|
+
}
|
|
4631
|
+
if (nextNewClass !== void 0) {
|
|
4632
|
+
assertValidReturnValue(10, nextNewClass);
|
|
4633
|
+
newClass = nextNewClass;
|
|
4634
|
+
}
|
|
4635
|
+
}
|
|
4636
|
+
return [defineMetadata(newClass, metadata), function() {
|
|
4637
|
+
for (var i$1 = 0; i$1 < initializers.length; i$1++) initializers[i$1].call(newClass);
|
|
4638
|
+
}];
|
|
4639
|
+
}
|
|
4701
4640
|
}
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4641
|
+
function defineMetadata(Class, metadata) {
|
|
4642
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
4643
|
+
configurable: true,
|
|
4644
|
+
enumerable: true,
|
|
4645
|
+
value: metadata
|
|
4646
|
+
});
|
|
4707
4647
|
}
|
|
4648
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
4649
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
4650
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
4651
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
4652
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
4653
|
+
return {
|
|
4654
|
+
e,
|
|
4655
|
+
get c() {
|
|
4656
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
4657
|
+
}
|
|
4658
|
+
};
|
|
4659
|
+
};
|
|
4660
|
+
}
|
|
4661
|
+
function _apply_decs_2203_r$4(targetClass, memberDecs, classDecs, parentClass) {
|
|
4662
|
+
return (_apply_decs_2203_r$4 = applyDecs2203RFactory$4())(targetClass, memberDecs, classDecs, parentClass);
|
|
4663
|
+
}
|
|
4664
|
+
function overrideConsoleLogger(hidden = false) {
|
|
4665
|
+
var _dec$6, _initClass$6;
|
|
4666
|
+
let _ConsoleLoggerOverride;
|
|
4667
|
+
_dec$6 = (0, _navios_core.Injectable)({
|
|
4668
|
+
token: _navios_core.LoggerOutput,
|
|
4669
|
+
priority: 1e3
|
|
4670
|
+
});
|
|
4708
4671
|
/**
|
|
4709
|
-
*
|
|
4710
|
-
*/
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4672
|
+
* Override the ConsoleLogger service to use the ScreenLogger service instead of the default ConsoleLogger service.
|
|
4673
|
+
*/ class ConsoleLoggerOverride {
|
|
4674
|
+
static {
|
|
4675
|
+
({c: [_ConsoleLoggerOverride, _initClass$6]} = _apply_decs_2203_r$4(this, [], [_dec$6]));
|
|
4676
|
+
}
|
|
4677
|
+
logger = (0, _navios_core.inject)(ScreenLogger, { screen: {
|
|
4678
|
+
name: "internal",
|
|
4679
|
+
icon: "💻",
|
|
4680
|
+
hidden,
|
|
4681
|
+
static: true
|
|
4682
|
+
} });
|
|
4683
|
+
setup(options) {
|
|
4684
|
+
this.logger.setLogLevels(options.logLevels ?? require_filter_engine.ALL_LOG_LEVELS);
|
|
4685
|
+
}
|
|
4686
|
+
log(message) {
|
|
4687
|
+
this.logger.log(message);
|
|
4688
|
+
}
|
|
4689
|
+
error(message) {
|
|
4690
|
+
this.logger.error(message);
|
|
4691
|
+
}
|
|
4692
|
+
warn(message) {
|
|
4693
|
+
this.logger.warn(message);
|
|
4694
|
+
}
|
|
4695
|
+
debug(message) {
|
|
4696
|
+
this.logger.debug(message);
|
|
4697
|
+
}
|
|
4698
|
+
fatal(message) {
|
|
4699
|
+
this.logger.fatal(message);
|
|
4700
|
+
}
|
|
4701
|
+
verbose(message) {
|
|
4702
|
+
this.logger.verbose(message);
|
|
4703
|
+
}
|
|
4704
|
+
setLogLevels(levels) {
|
|
4705
|
+
this.logger.setLogLevels(levels);
|
|
4706
|
+
}
|
|
4707
|
+
static {
|
|
4708
|
+
_initClass$6();
|
|
4709
|
+
}
|
|
4728
4710
|
}
|
|
4729
|
-
|
|
4711
|
+
return _ConsoleLoggerOverride;
|
|
4712
|
+
}
|
|
4730
4713
|
|
|
4731
4714
|
//#endregion
|
|
4732
|
-
//#region src/
|
|
4715
|
+
//#region src/overrides/missing-adapter.override.ts
|
|
4733
4716
|
function applyDecs2203RFactory$3() {
|
|
4734
4717
|
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
4735
4718
|
return function addInitializer(initializer$2) {
|
|
@@ -4984,282 +4967,472 @@ function applyDecs2203RFactory$3() {
|
|
|
4984
4967
|
}];
|
|
4985
4968
|
}
|
|
4986
4969
|
}
|
|
4987
|
-
function defineMetadata(Class, metadata) {
|
|
4988
|
-
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
4989
|
-
configurable: true,
|
|
4990
|
-
enumerable: true,
|
|
4991
|
-
value: metadata
|
|
4992
|
-
});
|
|
4970
|
+
function defineMetadata(Class, metadata) {
|
|
4971
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
4972
|
+
configurable: true,
|
|
4973
|
+
enumerable: true,
|
|
4974
|
+
value: metadata
|
|
4975
|
+
});
|
|
4976
|
+
}
|
|
4977
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
4978
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
4979
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
4980
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
4981
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
4982
|
+
return {
|
|
4983
|
+
e,
|
|
4984
|
+
get c() {
|
|
4985
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
4986
|
+
}
|
|
4987
|
+
};
|
|
4988
|
+
};
|
|
4989
|
+
}
|
|
4990
|
+
function _apply_decs_2203_r$3(targetClass, memberDecs, classDecs, parentClass) {
|
|
4991
|
+
return (_apply_decs_2203_r$3 = applyDecs2203RFactory$3())(targetClass, memberDecs, classDecs, parentClass);
|
|
4992
|
+
}
|
|
4993
|
+
var _dec$3, _initClass$3;
|
|
4994
|
+
let _MissingAdapterOverride;
|
|
4995
|
+
_dec$3 = (0, _navios_core.Injectable)({
|
|
4996
|
+
token: require_filter_engine.Adapter,
|
|
4997
|
+
priority: -100
|
|
4998
|
+
});
|
|
4999
|
+
var MissingAdapterOverride = class {
|
|
5000
|
+
static {
|
|
5001
|
+
({c: [_MissingAdapterOverride, _initClass$3]} = _apply_decs_2203_r$3(this, [], [_dec$3]));
|
|
5002
|
+
}
|
|
5003
|
+
createRoot() {
|
|
5004
|
+
throw new Error("Adapter not registered, add import statement for @navios/commander-tui/adapters/react or @navios/commander-tui/adapters/solid to your module");
|
|
5005
|
+
}
|
|
5006
|
+
renderToRoot() {
|
|
5007
|
+
throw new Error("Adapter not registered, add import statement for @navios/commander-tui/adapters/react or @navios/commander-tui/adapters/solid to your module");
|
|
5008
|
+
}
|
|
5009
|
+
static {
|
|
5010
|
+
_initClass$3();
|
|
5011
|
+
}
|
|
5012
|
+
};
|
|
5013
|
+
|
|
5014
|
+
//#endregion
|
|
5015
|
+
//#region src/services/screen.ts
|
|
5016
|
+
var ScreenInstance = class {
|
|
5017
|
+
id;
|
|
5018
|
+
name;
|
|
5019
|
+
icon;
|
|
5020
|
+
badgeCount = 0;
|
|
5021
|
+
status = "waiting";
|
|
5022
|
+
hidden = false;
|
|
5023
|
+
messages = [];
|
|
5024
|
+
manager = null;
|
|
5025
|
+
changeListeners = /* @__PURE__ */ new Set();
|
|
5026
|
+
printFn = null;
|
|
5027
|
+
hasPrinted = false;
|
|
5028
|
+
version = 0;
|
|
5029
|
+
promptQueue = [];
|
|
5030
|
+
activePrompt = null;
|
|
5031
|
+
constructor(id, options) {
|
|
5032
|
+
this.id = id;
|
|
5033
|
+
this.name = options.name;
|
|
5034
|
+
this.icon = options.icon;
|
|
5035
|
+
this.badgeCount = options.badgeCount ?? 0;
|
|
5036
|
+
this.hidden = options.hidden ?? false;
|
|
5037
|
+
if (options.static) this.status = "static";
|
|
5038
|
+
}
|
|
5039
|
+
incrementVersion() {
|
|
5040
|
+
this.version++;
|
|
5041
|
+
}
|
|
5042
|
+
getVersion() {
|
|
5043
|
+
return this.version;
|
|
5044
|
+
}
|
|
5045
|
+
/**
|
|
5046
|
+
* Internal: Set the manager reference
|
|
5047
|
+
*/ _setManager(manager) {
|
|
5048
|
+
this.manager = manager;
|
|
5049
|
+
}
|
|
5050
|
+
/**
|
|
5051
|
+
* Internal: Set the print function for stdout output
|
|
5052
|
+
*/ _setPrintFn(fn) {
|
|
5053
|
+
this.printFn = fn;
|
|
5054
|
+
}
|
|
5055
|
+
getId() {
|
|
5056
|
+
return this.id;
|
|
5057
|
+
}
|
|
5058
|
+
getName() {
|
|
5059
|
+
return this.name;
|
|
5060
|
+
}
|
|
5061
|
+
getIcon() {
|
|
5062
|
+
return this.icon;
|
|
5063
|
+
}
|
|
5064
|
+
getBadgeCount() {
|
|
5065
|
+
return this.badgeCount;
|
|
5066
|
+
}
|
|
5067
|
+
setBadgeCount(count) {
|
|
5068
|
+
this.badgeCount = count;
|
|
5069
|
+
this.notifyChange();
|
|
5070
|
+
return this;
|
|
5071
|
+
}
|
|
5072
|
+
isHidden() {
|
|
5073
|
+
return this.hidden;
|
|
5074
|
+
}
|
|
5075
|
+
setHidden(hidden) {
|
|
5076
|
+
this.hidden = hidden;
|
|
5077
|
+
this.manager?.onScreenVisibilityChanged(this);
|
|
5078
|
+
this.notifyChange();
|
|
5079
|
+
return this;
|
|
5080
|
+
}
|
|
5081
|
+
show() {
|
|
5082
|
+
return this.setHidden(false);
|
|
5083
|
+
}
|
|
5084
|
+
hide() {
|
|
5085
|
+
return this.setHidden(true);
|
|
5086
|
+
}
|
|
5087
|
+
getStatus() {
|
|
5088
|
+
return this.status;
|
|
5089
|
+
}
|
|
5090
|
+
/**
|
|
5091
|
+
* Set screen status. When success/fail and TUI is not bound, prints to stdout/stderr
|
|
5092
|
+
*/ setStatus(status) {
|
|
5093
|
+
const wasComplete = this.status === "success" || this.status === "fail";
|
|
5094
|
+
this.status = status;
|
|
5095
|
+
if (!wasComplete && (status === "success" || status === "fail")) {
|
|
5096
|
+
if (!this.manager?.isTuiBound()) this.printToConsole();
|
|
5097
|
+
this.manager?.onScreenCompleted(this);
|
|
5098
|
+
}
|
|
5099
|
+
this.notifyChange();
|
|
5100
|
+
return this;
|
|
5101
|
+
}
|
|
5102
|
+
/**
|
|
5103
|
+
* Check if this screen is complete (success or fail)
|
|
5104
|
+
*/ isComplete() {
|
|
5105
|
+
return this.status === "success" || this.status === "fail";
|
|
4993
5106
|
}
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
4999
|
-
return {
|
|
5000
|
-
e,
|
|
5001
|
-
get c() {
|
|
5002
|
-
return applyClassDecs(targetClass, classDecs, metadata);
|
|
5003
|
-
}
|
|
5004
|
-
};
|
|
5005
|
-
};
|
|
5006
|
-
}
|
|
5007
|
-
function _apply_decs_2203_r$3(targetClass, memberDecs, classDecs, parentClass) {
|
|
5008
|
-
return (_apply_decs_2203_r$3 = applyDecs2203RFactory$3())(targetClass, memberDecs, classDecs, parentClass);
|
|
5009
|
-
}
|
|
5010
|
-
var _dec$2, _initClass$2;
|
|
5011
|
-
let messageIdCounter = 0;
|
|
5012
|
-
function generateId() {
|
|
5013
|
-
return `msg-${++messageIdCounter}`;
|
|
5014
|
-
}
|
|
5015
|
-
let _ScreenLoggerInstance;
|
|
5016
|
-
_dec$2 = (0, _navios_core.Injectable)({ token: ScreenLogger });
|
|
5017
|
-
var ScreenLoggerInstance = class {
|
|
5018
|
-
static {
|
|
5019
|
-
({c: [_ScreenLoggerInstance, _initClass$2]} = _apply_decs_2203_r$3(this, [], [_dec$2]));
|
|
5107
|
+
/**
|
|
5108
|
+
* Check if this screen has been printed to console
|
|
5109
|
+
*/ hasPrintedToConsole() {
|
|
5110
|
+
return this.hasPrinted;
|
|
5020
5111
|
}
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
this.
|
|
5112
|
+
/**
|
|
5113
|
+
* Force print to console (called when TUI unbinds)
|
|
5114
|
+
*/ _flushToConsole(force = false) {
|
|
5115
|
+
if (!this.hasPrinted && (this.isComplete() || force)) this.printToConsole();
|
|
5025
5116
|
}
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
return this.enabledLevels.has(level);
|
|
5117
|
+
/**
|
|
5118
|
+
* Get all messages for rendering
|
|
5119
|
+
*/ getMessages() {
|
|
5120
|
+
return [...this.messages];
|
|
5031
5121
|
}
|
|
5032
|
-
|
|
5033
|
-
|
|
5122
|
+
/**
|
|
5123
|
+
* Add a message to the screen (internal use by Logger)
|
|
5124
|
+
*/ addMessage(message) {
|
|
5125
|
+
this.messages.push(message);
|
|
5126
|
+
this.incrementVersion();
|
|
5127
|
+
this.notifyChange();
|
|
5034
5128
|
}
|
|
5035
|
-
|
|
5036
|
-
|
|
5129
|
+
/**
|
|
5130
|
+
* Update a loading message (internal use by Logger)
|
|
5131
|
+
*/ updateMessage(id, updates) {
|
|
5132
|
+
const index = this.messages.findIndex((m) => m.id === id);
|
|
5133
|
+
if (index !== -1) {
|
|
5134
|
+
this.messages[index] = {
|
|
5135
|
+
...this.messages[index],
|
|
5136
|
+
...updates
|
|
5137
|
+
};
|
|
5138
|
+
this.incrementVersion();
|
|
5139
|
+
this.notifyChange();
|
|
5140
|
+
}
|
|
5141
|
+
}
|
|
5142
|
+
/**
|
|
5143
|
+
* Update a progress message (internal use by Logger)
|
|
5144
|
+
*/ updateProgressMessage(id, updates) {
|
|
5145
|
+
const index = this.messages.findIndex((m) => m.id === id);
|
|
5146
|
+
if (index !== -1) {
|
|
5147
|
+
this.messages[index] = {
|
|
5148
|
+
...this.messages[index],
|
|
5149
|
+
...updates
|
|
5150
|
+
};
|
|
5151
|
+
this.incrementVersion();
|
|
5152
|
+
this.notifyChange();
|
|
5153
|
+
}
|
|
5154
|
+
}
|
|
5155
|
+
/**
|
|
5156
|
+
* Clear all messages
|
|
5157
|
+
*/ clear() {
|
|
5158
|
+
this.messages = [];
|
|
5159
|
+
this.incrementVersion();
|
|
5160
|
+
this.notifyChange();
|
|
5037
5161
|
return this;
|
|
5038
5162
|
}
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5163
|
+
/**
|
|
5164
|
+
* Add a prompt to the queue (internal use by Prompt class)
|
|
5165
|
+
* Returns a promise that resolves when the user responds
|
|
5166
|
+
*/ _addPrompt(prompt) {
|
|
5167
|
+
return new Promise((resolve) => {
|
|
5168
|
+
const pending = {
|
|
5169
|
+
data: prompt,
|
|
5170
|
+
resolve
|
|
5171
|
+
};
|
|
5172
|
+
if (!this.manager?.isTuiBound()) {
|
|
5173
|
+
this.resolvePromptWithDefault(prompt, resolve);
|
|
5174
|
+
return;
|
|
5175
|
+
}
|
|
5176
|
+
if (prompt.timeout && prompt.timeoutStarted) pending.timeoutId = setTimeout(() => {
|
|
5177
|
+
if (this.activePrompt === pending) {
|
|
5178
|
+
this.resolvePromptWithDefault(prompt, resolve);
|
|
5179
|
+
this.activePrompt = null;
|
|
5180
|
+
this.activateNextPrompt();
|
|
5181
|
+
this.incrementVersion();
|
|
5182
|
+
this.notifyChange();
|
|
5183
|
+
} else {
|
|
5184
|
+
const idx = this.promptQueue.indexOf(pending);
|
|
5185
|
+
if (idx !== -1) {
|
|
5186
|
+
this.promptQueue.splice(idx, 1);
|
|
5187
|
+
this.resolvePromptWithDefault(prompt, resolve);
|
|
5188
|
+
this.incrementVersion();
|
|
5189
|
+
}
|
|
5190
|
+
}
|
|
5191
|
+
}, prompt.timeout);
|
|
5192
|
+
this.promptQueue.push(pending);
|
|
5193
|
+
if (!this.activePrompt) this.activateNextPrompt();
|
|
5194
|
+
});
|
|
5042
5195
|
}
|
|
5043
|
-
|
|
5044
|
-
|
|
5196
|
+
/**
|
|
5197
|
+
* Resolve a prompt with its default value
|
|
5198
|
+
*/ resolvePromptWithDefault(prompt, resolve) {
|
|
5199
|
+
switch (prompt.type) {
|
|
5200
|
+
case "choice":
|
|
5201
|
+
resolve(prompt.defaultChoice);
|
|
5202
|
+
break;
|
|
5203
|
+
case "confirm":
|
|
5204
|
+
resolve(prompt.defaultValue);
|
|
5205
|
+
break;
|
|
5206
|
+
case "input":
|
|
5207
|
+
resolve(prompt.defaultValue);
|
|
5208
|
+
break;
|
|
5209
|
+
case "multiChoice":
|
|
5210
|
+
resolve(prompt.choices.filter((_, i) => prompt.selectedIndices.has(i)).map((c) => c.value));
|
|
5211
|
+
break;
|
|
5212
|
+
}
|
|
5045
5213
|
}
|
|
5046
|
-
|
|
5047
|
-
|
|
5214
|
+
/**
|
|
5215
|
+
* Get the currently active prompt (for rendering)
|
|
5216
|
+
*/ getActivePrompt() {
|
|
5217
|
+
return this.activePrompt?.data ?? null;
|
|
5048
5218
|
}
|
|
5049
|
-
|
|
5050
|
-
|
|
5219
|
+
/**
|
|
5220
|
+
* Check if this screen has an active prompt
|
|
5221
|
+
*/ hasActivePrompt() {
|
|
5222
|
+
return this.activePrompt !== null;
|
|
5051
5223
|
}
|
|
5052
|
-
|
|
5053
|
-
|
|
5224
|
+
/**
|
|
5225
|
+
* Update prompt selection (for keyboard navigation)
|
|
5226
|
+
*/ updatePromptSelection(index) {
|
|
5227
|
+
if (!this.activePrompt) return;
|
|
5228
|
+
const prompt = this.activePrompt.data;
|
|
5229
|
+
if (prompt.type === "choice") {
|
|
5230
|
+
const maxIndex = prompt.choices.length - 1;
|
|
5231
|
+
prompt.selectedIndex = Math.max(0, Math.min(index, maxIndex));
|
|
5232
|
+
} else if (prompt.type === "multiChoice") {
|
|
5233
|
+
const maxIndex = prompt.choices.length - 1;
|
|
5234
|
+
prompt.focusedIndex = Math.max(0, Math.min(index, maxIndex));
|
|
5235
|
+
} else if (prompt.type === "confirm") prompt.selectedValue = index === 0;
|
|
5236
|
+
this.notifyChange();
|
|
5054
5237
|
}
|
|
5055
|
-
|
|
5056
|
-
|
|
5238
|
+
/**
|
|
5239
|
+
* Navigate prompt selection up
|
|
5240
|
+
*/ promptNavigateUp() {
|
|
5241
|
+
if (!this.activePrompt) return;
|
|
5242
|
+
const prompt = this.activePrompt.data;
|
|
5243
|
+
if (prompt.type === "choice") this.updatePromptSelection(prompt.selectedIndex - 1);
|
|
5244
|
+
else if (prompt.type === "multiChoice") this.updatePromptSelection(prompt.focusedIndex - 1);
|
|
5245
|
+
else if (prompt.type === "confirm") this.updatePromptSelection(prompt.selectedValue ? 0 : 1);
|
|
5057
5246
|
}
|
|
5058
|
-
|
|
5059
|
-
|
|
5247
|
+
/**
|
|
5248
|
+
* Navigate prompt selection down
|
|
5249
|
+
*/ promptNavigateDown() {
|
|
5250
|
+
if (!this.activePrompt) return;
|
|
5251
|
+
const prompt = this.activePrompt.data;
|
|
5252
|
+
if (prompt.type === "choice") this.updatePromptSelection(prompt.selectedIndex + 1);
|
|
5253
|
+
else if (prompt.type === "multiChoice") this.updatePromptSelection(prompt.focusedIndex + 1);
|
|
5254
|
+
else if (prompt.type === "confirm") this.updatePromptSelection(prompt.selectedValue ? 0 : 1);
|
|
5060
5255
|
}
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
label: label ?? this.context,
|
|
5071
|
-
trace,
|
|
5072
|
-
variant
|
|
5073
|
-
};
|
|
5074
|
-
this.screen.addMessage(message);
|
|
5075
|
-
return this;
|
|
5256
|
+
/**
|
|
5257
|
+
* Toggle left/right for confirm prompts
|
|
5258
|
+
*/ promptNavigateLeft() {
|
|
5259
|
+
if (!this.activePrompt) return;
|
|
5260
|
+
const prompt = this.activePrompt.data;
|
|
5261
|
+
if (prompt.type === "confirm") {
|
|
5262
|
+
prompt.selectedValue = true;
|
|
5263
|
+
this.notifyChange();
|
|
5264
|
+
}
|
|
5076
5265
|
}
|
|
5077
|
-
|
|
5078
|
-
if (!this.
|
|
5079
|
-
const
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5266
|
+
promptNavigateRight() {
|
|
5267
|
+
if (!this.activePrompt) return;
|
|
5268
|
+
const prompt = this.activePrompt.data;
|
|
5269
|
+
if (prompt.type === "confirm") {
|
|
5270
|
+
prompt.selectedValue = false;
|
|
5271
|
+
this.notifyChange();
|
|
5272
|
+
}
|
|
5273
|
+
}
|
|
5274
|
+
/**
|
|
5275
|
+
* Toggle selection for multiChoice prompts
|
|
5276
|
+
*/ promptToggleSelection() {
|
|
5277
|
+
if (!this.activePrompt) return;
|
|
5278
|
+
const prompt = this.activePrompt.data;
|
|
5279
|
+
if (prompt.type === "multiChoice") {
|
|
5280
|
+
const p = prompt;
|
|
5281
|
+
if (p.selectedIndices.has(p.focusedIndex)) p.selectedIndices.delete(p.focusedIndex);
|
|
5282
|
+
else if (p.selectedIndices.size < p.maxSelect) p.selectedIndices.add(p.focusedIndex);
|
|
5283
|
+
this.notifyChange();
|
|
5284
|
+
}
|
|
5285
|
+
}
|
|
5286
|
+
/**
|
|
5287
|
+
* Enter input mode for choice prompts (if current selection allows input)
|
|
5288
|
+
* or for input prompts (always)
|
|
5289
|
+
*/ promptEnterInputMode() {
|
|
5290
|
+
if (!this.activePrompt) return false;
|
|
5291
|
+
const prompt = this.activePrompt.data;
|
|
5292
|
+
if (prompt.type === "choice") {
|
|
5293
|
+
if (prompt.choices[prompt.selectedIndex]?.input) {
|
|
5294
|
+
prompt.inputMode = true;
|
|
5295
|
+
this.notifyChange();
|
|
5296
|
+
return true;
|
|
5297
|
+
}
|
|
5298
|
+
} else if (prompt.type === "input") return true;
|
|
5299
|
+
return false;
|
|
5088
5300
|
}
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
};
|
|
5099
|
-
this.screen.addMessage(message);
|
|
5100
|
-
return this;
|
|
5301
|
+
/**
|
|
5302
|
+
* Exit input mode for choice prompts
|
|
5303
|
+
*/ promptExitInputMode() {
|
|
5304
|
+
if (!this.activePrompt) return;
|
|
5305
|
+
const prompt = this.activePrompt.data;
|
|
5306
|
+
if (prompt.type === "choice" && prompt.inputMode) {
|
|
5307
|
+
prompt.inputMode = false;
|
|
5308
|
+
this.notifyChange();
|
|
5309
|
+
}
|
|
5101
5310
|
}
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
errorLines,
|
|
5111
|
-
startLine
|
|
5112
|
-
};
|
|
5113
|
-
this.screen.addMessage(message);
|
|
5114
|
-
return this;
|
|
5311
|
+
/**
|
|
5312
|
+
* Check if prompt is in input mode
|
|
5313
|
+
*/ isPromptInInputMode() {
|
|
5314
|
+
if (!this.activePrompt) return false;
|
|
5315
|
+
const prompt = this.activePrompt.data;
|
|
5316
|
+
if (prompt.type === "choice") return prompt.inputMode;
|
|
5317
|
+
if (prompt.type === "input") return true;
|
|
5318
|
+
return false;
|
|
5115
5319
|
}
|
|
5116
5320
|
/**
|
|
5117
|
-
*
|
|
5118
|
-
*/
|
|
5119
|
-
|
|
5120
|
-
const
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
this.screen.addMessage(loadingMessage);
|
|
5128
|
-
try {
|
|
5129
|
-
const result = await promise;
|
|
5130
|
-
const successContent = typeof options.success === "function" ? options.success(result) : options.success;
|
|
5131
|
-
this.screen.updateMessage(id, {
|
|
5132
|
-
status: "success",
|
|
5133
|
-
resolvedContent: successContent
|
|
5134
|
-
});
|
|
5135
|
-
return result;
|
|
5136
|
-
} catch (err) {
|
|
5137
|
-
const error = err instanceof Error ? err : new Error(String(err));
|
|
5138
|
-
const errorContent = typeof options.error === "function" ? options.error(error) : options.error;
|
|
5139
|
-
this.screen.updateMessage(id, {
|
|
5140
|
-
status: "fail",
|
|
5141
|
-
resolvedContent: errorContent
|
|
5142
|
-
});
|
|
5143
|
-
throw err;
|
|
5321
|
+
* Update input value for choice prompts
|
|
5322
|
+
*/ promptUpdateInput(value) {
|
|
5323
|
+
if (!this.activePrompt) return;
|
|
5324
|
+
const prompt = this.activePrompt.data;
|
|
5325
|
+
if (prompt.type === "choice" && prompt.inputMode) {
|
|
5326
|
+
prompt.inputValue = value;
|
|
5327
|
+
this.notifyChange();
|
|
5328
|
+
} else if (prompt.type === "input") {
|
|
5329
|
+
prompt.value = value;
|
|
5330
|
+
this.notifyChange();
|
|
5144
5331
|
}
|
|
5145
5332
|
}
|
|
5146
5333
|
/**
|
|
5147
|
-
*
|
|
5148
|
-
*/
|
|
5149
|
-
|
|
5150
|
-
const
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
return {
|
|
5159
|
-
success: (resolvedMessage) => {
|
|
5160
|
-
this.screen.updateMessage(id, {
|
|
5161
|
-
status: "success",
|
|
5162
|
-
resolvedContent: resolvedMessage
|
|
5163
|
-
});
|
|
5164
|
-
},
|
|
5165
|
-
fail: (resolvedMessage) => {
|
|
5166
|
-
this.screen.updateMessage(id, {
|
|
5167
|
-
status: "fail",
|
|
5168
|
-
resolvedContent: resolvedMessage
|
|
5169
|
-
});
|
|
5170
|
-
}
|
|
5171
|
-
};
|
|
5334
|
+
* Append character to input
|
|
5335
|
+
*/ promptAppendInput(char) {
|
|
5336
|
+
if (!this.activePrompt) return;
|
|
5337
|
+
const prompt = this.activePrompt.data;
|
|
5338
|
+
if (prompt.type === "choice" && prompt.inputMode) {
|
|
5339
|
+
prompt.inputValue += char;
|
|
5340
|
+
this.notifyChange();
|
|
5341
|
+
} else if (prompt.type === "input") {
|
|
5342
|
+
prompt.value += char;
|
|
5343
|
+
this.notifyChange();
|
|
5344
|
+
}
|
|
5172
5345
|
}
|
|
5173
5346
|
/**
|
|
5174
|
-
*
|
|
5175
|
-
*/
|
|
5176
|
-
|
|
5177
|
-
const
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
};
|
|
5186
|
-
this.screen.addMessage(progressMessage);
|
|
5187
|
-
return {
|
|
5188
|
-
update: (current, newLabel) => {
|
|
5189
|
-
this.screen.updateProgressMessage(id, {
|
|
5190
|
-
current,
|
|
5191
|
-
label: newLabel ?? label
|
|
5192
|
-
});
|
|
5193
|
-
},
|
|
5194
|
-
complete: (message) => {
|
|
5195
|
-
this.screen.updateProgressMessage(id, {
|
|
5196
|
-
current: options.total,
|
|
5197
|
-
status: "complete",
|
|
5198
|
-
resolvedContent: message
|
|
5199
|
-
});
|
|
5200
|
-
},
|
|
5201
|
-
fail: (message) => {
|
|
5202
|
-
this.screen.updateProgressMessage(id, {
|
|
5203
|
-
status: "failed",
|
|
5204
|
-
resolvedContent: message
|
|
5205
|
-
});
|
|
5206
|
-
}
|
|
5207
|
-
};
|
|
5347
|
+
* Delete last character from input
|
|
5348
|
+
*/ promptDeleteLastChar() {
|
|
5349
|
+
if (!this.activePrompt) return;
|
|
5350
|
+
const prompt = this.activePrompt.data;
|
|
5351
|
+
if (prompt.type === "choice" && prompt.inputMode) {
|
|
5352
|
+
prompt.inputValue = prompt.inputValue.slice(0, -1);
|
|
5353
|
+
this.notifyChange();
|
|
5354
|
+
} else if (prompt.type === "input") {
|
|
5355
|
+
prompt.value = prompt.value.slice(0, -1);
|
|
5356
|
+
this.notifyChange();
|
|
5357
|
+
}
|
|
5208
5358
|
}
|
|
5209
5359
|
/**
|
|
5210
|
-
*
|
|
5211
|
-
*/
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
label,
|
|
5217
|
-
collapsed: false,
|
|
5218
|
-
isEnd: false
|
|
5219
|
-
};
|
|
5220
|
-
this.screen.addMessage(message);
|
|
5221
|
-
return this;
|
|
5360
|
+
* Check if multiChoice prompt can be submitted (meets minSelect requirement)
|
|
5361
|
+
*/ canSubmitPrompt() {
|
|
5362
|
+
if (!this.activePrompt) return false;
|
|
5363
|
+
const prompt = this.activePrompt.data;
|
|
5364
|
+
if (prompt.type === "multiChoice") return prompt.selectedIndices.size >= prompt.minSelect;
|
|
5365
|
+
return true;
|
|
5222
5366
|
}
|
|
5223
5367
|
/**
|
|
5224
|
-
*
|
|
5225
|
-
*/
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5368
|
+
* Submit the current prompt selection
|
|
5369
|
+
*/ promptSubmit() {
|
|
5370
|
+
if (!this.activePrompt) return;
|
|
5371
|
+
const prompt = this.activePrompt.data;
|
|
5372
|
+
if (!this.canSubmitPrompt()) return;
|
|
5373
|
+
prompt.resolved = true;
|
|
5374
|
+
if (this.activePrompt.timeoutId) clearTimeout(this.activePrompt.timeoutId);
|
|
5375
|
+
switch (prompt.type) {
|
|
5376
|
+
case "choice": {
|
|
5377
|
+
const choice = prompt.choices[prompt.selectedIndex];
|
|
5378
|
+
const value = choice?.input && prompt.inputValue ? prompt.inputValue : choice?.value ?? "";
|
|
5379
|
+
prompt.resolvedValue = value;
|
|
5380
|
+
this.activePrompt.resolve(value);
|
|
5381
|
+
break;
|
|
5382
|
+
}
|
|
5383
|
+
case "confirm":
|
|
5384
|
+
prompt.resolvedValue = prompt.selectedValue;
|
|
5385
|
+
this.activePrompt.resolve(prompt.selectedValue);
|
|
5386
|
+
break;
|
|
5387
|
+
case "input":
|
|
5388
|
+
prompt.resolvedValue = prompt.value;
|
|
5389
|
+
this.activePrompt.resolve(prompt.value);
|
|
5390
|
+
break;
|
|
5391
|
+
case "multiChoice": {
|
|
5392
|
+
const values = prompt.choices.filter((_, i) => prompt.selectedIndices.has(i)).map((c) => c.value);
|
|
5393
|
+
prompt.resolvedValues = values;
|
|
5394
|
+
this.activePrompt.resolve(values);
|
|
5395
|
+
break;
|
|
5396
|
+
}
|
|
5397
|
+
}
|
|
5398
|
+
this.activePrompt = null;
|
|
5399
|
+
this.activateNextPrompt();
|
|
5400
|
+
this.incrementVersion();
|
|
5401
|
+
this.notifyChange();
|
|
5236
5402
|
}
|
|
5237
5403
|
/**
|
|
5238
|
-
*
|
|
5239
|
-
*/
|
|
5240
|
-
if (
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
id: generateId(),
|
|
5247
|
-
type: "table",
|
|
5248
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
5249
|
-
headers,
|
|
5250
|
-
rows,
|
|
5251
|
-
title: options?.title
|
|
5252
|
-
};
|
|
5253
|
-
this.screen.addMessage(message);
|
|
5254
|
-
return this;
|
|
5404
|
+
* Activate the next prompt in the queue
|
|
5405
|
+
*/ activateNextPrompt() {
|
|
5406
|
+
if (this.promptQueue.length > 0) {
|
|
5407
|
+
this.activePrompt = this.promptQueue.shift();
|
|
5408
|
+
this.manager?.onScreenPromptActivated(this);
|
|
5409
|
+
this.incrementVersion();
|
|
5410
|
+
this.notifyChange();
|
|
5411
|
+
}
|
|
5255
5412
|
}
|
|
5256
|
-
|
|
5257
|
-
|
|
5413
|
+
/**
|
|
5414
|
+
* Register a change listener for re-renders
|
|
5415
|
+
*/ onChange(listener) {
|
|
5416
|
+
this.changeListeners.add(listener);
|
|
5417
|
+
return () => this.changeListeners.delete(listener);
|
|
5418
|
+
}
|
|
5419
|
+
notifyChange() {
|
|
5420
|
+
this.changeListeners.forEach((listener) => listener());
|
|
5421
|
+
}
|
|
5422
|
+
/**
|
|
5423
|
+
* Print all messages to stdout/stderr with ANSI colors
|
|
5424
|
+
*/ printToConsole() {
|
|
5425
|
+
if (this.hasPrinted) return;
|
|
5426
|
+
const isError = this.status === "fail";
|
|
5427
|
+
if (this.printFn) {
|
|
5428
|
+
this.printFn(this.messages, this.name, isError);
|
|
5429
|
+
this.hasPrinted = true;
|
|
5430
|
+
}
|
|
5258
5431
|
}
|
|
5259
5432
|
};
|
|
5260
5433
|
|
|
5261
5434
|
//#endregion
|
|
5262
|
-
//#region src/services/
|
|
5435
|
+
//#region src/services/screen_manager.ts
|
|
5263
5436
|
function applyDecs2203RFactory$2() {
|
|
5264
5437
|
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
5265
5438
|
return function addInitializer(initializer$2) {
|
|
@@ -5537,113 +5710,260 @@ function applyDecs2203RFactory$2() {
|
|
|
5537
5710
|
function _apply_decs_2203_r$2(targetClass, memberDecs, classDecs, parentClass) {
|
|
5538
5711
|
return (_apply_decs_2203_r$2 = applyDecs2203RFactory$2())(targetClass, memberDecs, classDecs, parentClass);
|
|
5539
5712
|
}
|
|
5540
|
-
var _dec$
|
|
5541
|
-
let
|
|
5542
|
-
_dec$
|
|
5543
|
-
var
|
|
5713
|
+
var _dec$2, _initClass$2;
|
|
5714
|
+
let _ScreenManagerInstance;
|
|
5715
|
+
_dec$2 = (0, _navios_core.Injectable)({ token: ScreenManager });
|
|
5716
|
+
var ScreenManagerInstance = class {
|
|
5544
5717
|
static {
|
|
5545
|
-
({c: [
|
|
5718
|
+
({c: [_ScreenManagerInstance, _initClass$2]} = _apply_decs_2203_r$2(this, [], [_dec$2]));
|
|
5546
5719
|
}
|
|
5547
|
-
|
|
5548
|
-
|
|
5720
|
+
screens = /* @__PURE__ */ new Map();
|
|
5721
|
+
screenOrder = [];
|
|
5722
|
+
activeScreenId = null;
|
|
5723
|
+
renderer = null;
|
|
5724
|
+
root = null;
|
|
5725
|
+
adapter = (0, _navios_core.inject)(require_filter_engine.Adapter);
|
|
5726
|
+
isBound = false;
|
|
5727
|
+
changeListeners = /* @__PURE__ */ new Set();
|
|
5728
|
+
bindOptions = {};
|
|
5729
|
+
autoCloseTimer = null;
|
|
5730
|
+
theme;
|
|
5731
|
+
focusArea = "content";
|
|
5732
|
+
selectedIndex = 0;
|
|
5733
|
+
/**
|
|
5734
|
+
* Create a new screen and return it
|
|
5735
|
+
*/ createScreen(options) {
|
|
5736
|
+
const id = `screen-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
5737
|
+
const screen = new ScreenInstance(id, options);
|
|
5738
|
+
screen._setManager(this);
|
|
5739
|
+
screen._setPrintFn(require_filter_engine.printMessagesToStdout);
|
|
5740
|
+
screen.onChange(() => this.notifyChange());
|
|
5741
|
+
this.screens.set(id, screen);
|
|
5742
|
+
this.screenOrder.push(id);
|
|
5743
|
+
if (!this.activeScreenId && !screen.isHidden()) this.activeScreenId = id;
|
|
5744
|
+
this.notifyChange();
|
|
5745
|
+
return screen;
|
|
5746
|
+
}
|
|
5747
|
+
getScreenByName(name) {
|
|
5748
|
+
const id = Array.from(this.screens.keys()).find((id$1) => this.screens.get(id$1)?.getName() === name);
|
|
5749
|
+
return id ? this.screens.get(id) : void 0;
|
|
5549
5750
|
}
|
|
5550
|
-
screen;
|
|
5551
5751
|
/**
|
|
5552
|
-
*
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5752
|
+
* Remove a screen dynamically
|
|
5753
|
+
*/ removeScreen(screen) {
|
|
5754
|
+
const id = screen.getId();
|
|
5755
|
+
if (!this.screens.has(id)) return;
|
|
5756
|
+
this.screens.delete(id);
|
|
5757
|
+
this.screenOrder = this.screenOrder.filter((sid) => sid !== id);
|
|
5758
|
+
if (this.activeScreenId === id) this.activeScreenId = this.getScreens()[0]?.getId() ?? null;
|
|
5759
|
+
const visibleScreens = this.getScreens();
|
|
5760
|
+
if (this.selectedIndex >= visibleScreens.length) this.selectedIndex = Math.max(0, visibleScreens.length - 1);
|
|
5761
|
+
this.notifyChange();
|
|
5762
|
+
}
|
|
5763
|
+
/**
|
|
5764
|
+
* Non-blocking bind - starts TUI rendering in background
|
|
5765
|
+
*/ async bind(options) {
|
|
5766
|
+
if (this.isBound) return;
|
|
5767
|
+
this.bindOptions = options ?? {};
|
|
5768
|
+
if (options?.theme) this.theme = typeof options.theme === "string" ? require_filter_engine.getThemePreset(options.theme) : options.theme;
|
|
5769
|
+
this.renderer = await (0, _opentui_core.createCliRenderer)({
|
|
5770
|
+
exitOnCtrlC: options?.exitOnCtrlC ?? true,
|
|
5771
|
+
useAlternateScreen: true,
|
|
5772
|
+
useMouse: options?.useMouse ?? true
|
|
5773
|
+
});
|
|
5774
|
+
this.root = await this.adapter.createRoot(this.renderer);
|
|
5775
|
+
this.isBound = true;
|
|
5776
|
+
this.render();
|
|
5777
|
+
}
|
|
5778
|
+
/**
|
|
5779
|
+
* Get the configured theme
|
|
5780
|
+
*/ getTheme() {
|
|
5781
|
+
return this.theme;
|
|
5782
|
+
}
|
|
5783
|
+
onServiceDestroy() {
|
|
5784
|
+
this.unbind();
|
|
5785
|
+
}
|
|
5786
|
+
/**
|
|
5787
|
+
* Stop TUI rendering and cleanup
|
|
5788
|
+
* Flushes all completed screens to stdout/stderr
|
|
5789
|
+
*/ unbind() {
|
|
5790
|
+
if (!this.isBound) return;
|
|
5791
|
+
if (this.autoCloseTimer) {
|
|
5792
|
+
clearTimeout(this.autoCloseTimer);
|
|
5793
|
+
this.autoCloseTimer = null;
|
|
5794
|
+
}
|
|
5795
|
+
this.root?.unmount();
|
|
5796
|
+
if (this.renderer && "disableMouse" in this.renderer) this.renderer.disableMouse();
|
|
5797
|
+
this.renderer?.destroy();
|
|
5798
|
+
this.renderer = null;
|
|
5799
|
+
this.root = null;
|
|
5800
|
+
this.isBound = false;
|
|
5801
|
+
this.flushCompletedScreens();
|
|
5802
|
+
}
|
|
5803
|
+
/**
|
|
5804
|
+
* Print all completed screens that haven't been printed yet
|
|
5805
|
+
*/ flushCompletedScreens() {
|
|
5806
|
+
for (const id of this.screenOrder) {
|
|
5807
|
+
const screen = this.screens.get(id);
|
|
5808
|
+
if (screen && !screen.hasPrintedToConsole()) screen._flushToConsole(true);
|
|
5809
|
+
}
|
|
5810
|
+
}
|
|
5811
|
+
/**
|
|
5812
|
+
* Check if TUI is currently bound
|
|
5813
|
+
*/ isTuiBound() {
|
|
5814
|
+
return this.isBound;
|
|
5815
|
+
}
|
|
5816
|
+
/**
|
|
5817
|
+
* Called by Screen when a prompt becomes active
|
|
5818
|
+
* Focuses the screen and switches to content area
|
|
5819
|
+
*/ onScreenPromptActivated(screen) {
|
|
5820
|
+
this.setActiveScreen(screen);
|
|
5821
|
+
this.focusArea = "content";
|
|
5822
|
+
this.notifyChange();
|
|
5823
|
+
}
|
|
5824
|
+
/**
|
|
5825
|
+
* Check if any screen has an active prompt
|
|
5826
|
+
*/ hasActivePrompt() {
|
|
5827
|
+
for (const screen of this.screens.values()) if (screen.hasActivePrompt()) return true;
|
|
5828
|
+
return false;
|
|
5829
|
+
}
|
|
5830
|
+
/**
|
|
5831
|
+
* Get the screen with an active prompt (if any)
|
|
5832
|
+
*/ getScreenWithActivePrompt() {
|
|
5833
|
+
for (const screen of this.screens.values()) if (screen.hasActivePrompt()) return screen;
|
|
5834
|
+
return null;
|
|
5835
|
+
}
|
|
5836
|
+
/**
|
|
5837
|
+
* Called by Screen when visibility changes
|
|
5838
|
+
* Handles switching active screen if needed
|
|
5839
|
+
*/ onScreenVisibilityChanged(screen) {
|
|
5840
|
+
if (screen.isHidden() && this.activeScreenId === screen.getId()) {
|
|
5841
|
+
this.activeScreenId = this.getScreens()[0]?.getId() ?? null;
|
|
5842
|
+
this.selectedIndex = 0;
|
|
5843
|
+
}
|
|
5844
|
+
const visibleScreens = this.getScreens();
|
|
5845
|
+
if (this.selectedIndex >= visibleScreens.length) this.selectedIndex = Math.max(0, visibleScreens.length - 1);
|
|
5846
|
+
this.notifyChange();
|
|
5847
|
+
}
|
|
5848
|
+
/**
|
|
5849
|
+
* Called by Screen when status becomes success/fail
|
|
5850
|
+
* Moves completed screens to end of sidebar list
|
|
5851
|
+
*/ onScreenCompleted(screen) {
|
|
5852
|
+
const id = screen.getId();
|
|
5853
|
+
const index = this.screenOrder.indexOf(id);
|
|
5854
|
+
if (index !== -1) {
|
|
5855
|
+
this.screenOrder.splice(index, 1);
|
|
5856
|
+
this.screenOrder.push(id);
|
|
5857
|
+
const visibleScreens = this.getScreens();
|
|
5858
|
+
if (this.selectedIndex >= visibleScreens.length) this.selectedIndex = Math.max(0, visibleScreens.length - 1);
|
|
5859
|
+
}
|
|
5860
|
+
this.notifyChange();
|
|
5861
|
+
}
|
|
5862
|
+
/**
|
|
5863
|
+
* Check if all screens are successful (or only static) and start auto-close timer if enabled.
|
|
5864
|
+
* Static screens are ignored in this calculation.
|
|
5865
|
+
* If there are only static screens, the timer will trigger after the delay with no new activity.
|
|
5866
|
+
*/ checkAutoClose() {
|
|
5867
|
+
const autoClose = this.bindOptions.autoClose;
|
|
5868
|
+
if (!autoClose || !this.isBound) return;
|
|
5869
|
+
if (this.autoCloseTimer) {
|
|
5870
|
+
clearTimeout(this.autoCloseTimer);
|
|
5871
|
+
this.autoCloseTimer = null;
|
|
5872
|
+
}
|
|
5873
|
+
const nonStaticScreens = this.getScreens().filter((s) => s.getStatus() !== "static");
|
|
5874
|
+
if (nonStaticScreens.length > 0) {
|
|
5875
|
+
if (!nonStaticScreens.every((s) => s.getStatus() === "success")) return;
|
|
5876
|
+
}
|
|
5877
|
+
const delay = typeof autoClose === "number" ? autoClose : 5e3;
|
|
5878
|
+
this.autoCloseTimer = setTimeout(() => {
|
|
5879
|
+
this.unbind();
|
|
5880
|
+
}, delay);
|
|
5881
|
+
}
|
|
5882
|
+
/**
|
|
5883
|
+
* Get visible screens in display order (excludes hidden screens)
|
|
5884
|
+
*/ getScreens() {
|
|
5885
|
+
return this.screenOrder.map((id) => this.screens.get(id)).filter((s) => s !== void 0 && !s.isHidden());
|
|
5886
|
+
}
|
|
5887
|
+
/**
|
|
5888
|
+
* Get all screens in display order (includes hidden screens)
|
|
5889
|
+
*/ getAllScreens() {
|
|
5890
|
+
return this.screenOrder.map((id) => this.screens.get(id)).filter((s) => s !== void 0);
|
|
5891
|
+
}
|
|
5892
|
+
/**
|
|
5893
|
+
* Get the active screen
|
|
5894
|
+
*/ getActiveScreen() {
|
|
5895
|
+
return this.activeScreenId ? this.screens.get(this.activeScreenId) ?? null : null;
|
|
5896
|
+
}
|
|
5897
|
+
/**
|
|
5898
|
+
* Set the active screen
|
|
5899
|
+
*/ setActiveScreen(screen) {
|
|
5900
|
+
this.activeScreenId = screen.getId();
|
|
5901
|
+
this.notifyChange();
|
|
5902
|
+
}
|
|
5903
|
+
/**
|
|
5904
|
+
* Get bind options
|
|
5905
|
+
*/ getBindOptions() {
|
|
5906
|
+
return this.bindOptions;
|
|
5907
|
+
}
|
|
5908
|
+
/**
|
|
5909
|
+
* Set focus area (sidebar or content)
|
|
5910
|
+
*/ setFocusArea(area) {
|
|
5911
|
+
this.focusArea = area;
|
|
5912
|
+
this.notifyChange();
|
|
5913
|
+
}
|
|
5914
|
+
/**
|
|
5915
|
+
* Set selected index in sidebar
|
|
5916
|
+
*/ setSelectedIndex(index) {
|
|
5917
|
+
const visibleScreens = this.getScreens();
|
|
5918
|
+
this.selectedIndex = Math.max(0, Math.min(index, visibleScreens.length - 1));
|
|
5919
|
+
this.notifyChange();
|
|
5920
|
+
}
|
|
5921
|
+
/**
|
|
5922
|
+
* Navigate sidebar up
|
|
5923
|
+
*/ navigateUp() {
|
|
5924
|
+
this.setSelectedIndex(this.selectedIndex - 1);
|
|
5925
|
+
}
|
|
5926
|
+
/**
|
|
5927
|
+
* Navigate sidebar down
|
|
5928
|
+
*/ navigateDown() {
|
|
5929
|
+
this.setSelectedIndex(this.selectedIndex + 1);
|
|
5573
5930
|
}
|
|
5574
5931
|
/**
|
|
5575
|
-
*
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
const prompt = {
|
|
5580
|
-
type: "confirm",
|
|
5581
|
-
id: `prompt-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
5582
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
5583
|
-
question,
|
|
5584
|
-
confirmText,
|
|
5585
|
-
cancelText,
|
|
5586
|
-
defaultValue,
|
|
5587
|
-
selectedValue: defaultValue,
|
|
5588
|
-
resolved: false,
|
|
5589
|
-
timeout,
|
|
5590
|
-
timeoutStarted: timeout ? Date.now() : void 0
|
|
5591
|
-
};
|
|
5592
|
-
return this.screen._addPrompt(prompt);
|
|
5932
|
+
* Select the currently highlighted screen
|
|
5933
|
+
*/ selectCurrent() {
|
|
5934
|
+
const screen = this.getScreens()[this.selectedIndex];
|
|
5935
|
+
if (screen) this.setActiveScreen(screen);
|
|
5593
5936
|
}
|
|
5594
5937
|
/**
|
|
5595
|
-
*
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
const prompt = {
|
|
5600
|
-
type: "input",
|
|
5601
|
-
id: `prompt-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
5602
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
5603
|
-
question,
|
|
5604
|
-
placeholder,
|
|
5605
|
-
defaultValue,
|
|
5606
|
-
value: defaultValue,
|
|
5607
|
-
resolved: false,
|
|
5608
|
-
timeout,
|
|
5609
|
-
timeoutStarted: timeout ? Date.now() : void 0
|
|
5610
|
-
};
|
|
5611
|
-
return this.screen._addPrompt(prompt);
|
|
5938
|
+
* Toggle focus between sidebar and content
|
|
5939
|
+
*/ toggleFocus() {
|
|
5940
|
+
this.focusArea = this.focusArea === "sidebar" ? "content" : "sidebar";
|
|
5941
|
+
this.notifyChange();
|
|
5612
5942
|
}
|
|
5613
5943
|
/**
|
|
5614
|
-
*
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5944
|
+
* Register a change listener for re-renders
|
|
5945
|
+
*/ onChange(listener) {
|
|
5946
|
+
this.changeListeners.add(listener);
|
|
5947
|
+
return () => this.changeListeners.delete(listener);
|
|
5948
|
+
}
|
|
5949
|
+
notifyChange() {
|
|
5950
|
+
this.checkAutoClose();
|
|
5951
|
+
this.changeListeners.forEach((listener) => listener());
|
|
5952
|
+
}
|
|
5953
|
+
render() {
|
|
5954
|
+
if (!this.root) return;
|
|
5955
|
+
this.adapter.renderToRoot(this.root, {
|
|
5956
|
+
manager: this,
|
|
5957
|
+
theme: this.theme
|
|
5623
5958
|
});
|
|
5624
|
-
const prompt = {
|
|
5625
|
-
type: "multiChoice",
|
|
5626
|
-
id: `prompt-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
5627
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
5628
|
-
question,
|
|
5629
|
-
choices,
|
|
5630
|
-
selectedIndices,
|
|
5631
|
-
focusedIndex: 0,
|
|
5632
|
-
minSelect,
|
|
5633
|
-
maxSelect,
|
|
5634
|
-
resolved: false,
|
|
5635
|
-
timeout,
|
|
5636
|
-
timeoutStarted: timeout ? Date.now() : void 0
|
|
5637
|
-
};
|
|
5638
|
-
return this.screen._addPrompt(prompt);
|
|
5639
5959
|
}
|
|
5640
5960
|
static {
|
|
5641
|
-
_initClass$
|
|
5961
|
+
_initClass$2();
|
|
5642
5962
|
}
|
|
5643
5963
|
};
|
|
5644
5964
|
|
|
5645
5965
|
//#endregion
|
|
5646
|
-
//#region src/
|
|
5966
|
+
//#region src/services/logger.ts
|
|
5647
5967
|
function applyDecs2203RFactory$1() {
|
|
5648
5968
|
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
5649
5969
|
return function addInitializer(initializer$2) {
|
|
@@ -5905,42 +6225,275 @@ function applyDecs2203RFactory$1() {
|
|
|
5905
6225
|
value: metadata
|
|
5906
6226
|
});
|
|
5907
6227
|
}
|
|
5908
|
-
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
5909
|
-
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
5910
|
-
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
5911
|
-
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
5912
|
-
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
6228
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
6229
|
+
if (parentClass !== void 0) var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
6230
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
6231
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
6232
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
6233
|
+
return {
|
|
6234
|
+
e,
|
|
6235
|
+
get c() {
|
|
6236
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
6237
|
+
}
|
|
6238
|
+
};
|
|
6239
|
+
};
|
|
6240
|
+
}
|
|
6241
|
+
function _apply_decs_2203_r$1(targetClass, memberDecs, classDecs, parentClass) {
|
|
6242
|
+
return (_apply_decs_2203_r$1 = applyDecs2203RFactory$1())(targetClass, memberDecs, classDecs, parentClass);
|
|
6243
|
+
}
|
|
6244
|
+
var _dec$1, _initClass$1;
|
|
6245
|
+
let messageIdCounter = 0;
|
|
6246
|
+
function generateId() {
|
|
6247
|
+
return `msg-${++messageIdCounter}`;
|
|
6248
|
+
}
|
|
6249
|
+
let _ScreenLoggerInstance;
|
|
6250
|
+
_dec$1 = (0, _navios_core.Injectable)({ token: ScreenLogger });
|
|
6251
|
+
var ScreenLoggerInstance = class {
|
|
6252
|
+
static {
|
|
6253
|
+
({c: [_ScreenLoggerInstance, _initClass$1]} = _apply_decs_2203_r$1(this, [], [_dec$1]));
|
|
6254
|
+
}
|
|
6255
|
+
constructor(options) {
|
|
6256
|
+
this.screen = (0, _navios_core.inject)(Screen, typeof options.screen === "string" ? { name: options.screen } : options.screen);
|
|
6257
|
+
this.context = options.context;
|
|
6258
|
+
this.enabledLevels = new Set(options.enabledLevels);
|
|
6259
|
+
}
|
|
6260
|
+
screen;
|
|
6261
|
+
context;
|
|
6262
|
+
enabledLevels;
|
|
6263
|
+
isLevelEnabled(level) {
|
|
6264
|
+
return this.enabledLevels.has(level);
|
|
6265
|
+
}
|
|
6266
|
+
verbose(msg, label) {
|
|
6267
|
+
return this.write("verbose", msg, label);
|
|
6268
|
+
}
|
|
6269
|
+
setLogLevels(levels) {
|
|
6270
|
+
this.enabledLevels = new Set(levels);
|
|
6271
|
+
return this;
|
|
6272
|
+
}
|
|
6273
|
+
trace(msg, label) {
|
|
6274
|
+
const trace = require_filter_engine.captureTrace(1);
|
|
6275
|
+
return this.write("verbose", msg, label, trace, "trace");
|
|
6276
|
+
}
|
|
6277
|
+
debug(msg, label) {
|
|
6278
|
+
return this.write("debug", msg, label);
|
|
6279
|
+
}
|
|
6280
|
+
log(msg, label) {
|
|
6281
|
+
return this.write("log", msg, label);
|
|
6282
|
+
}
|
|
6283
|
+
success(msg, label) {
|
|
6284
|
+
return this.write("log", msg, label, void 0, "success");
|
|
6285
|
+
}
|
|
6286
|
+
warn(msg, label) {
|
|
6287
|
+
return this.write("warn", msg, label);
|
|
6288
|
+
}
|
|
6289
|
+
error(msg, label) {
|
|
6290
|
+
return this.write("error", msg, label);
|
|
6291
|
+
}
|
|
6292
|
+
fatal(msg, label) {
|
|
6293
|
+
return this.write("fatal", msg, label);
|
|
6294
|
+
}
|
|
6295
|
+
write(level, content, label, trace, variant) {
|
|
6296
|
+
if (!this.isLevelEnabled(level)) return this;
|
|
6297
|
+
const formattedContent = typeof content === "object" ? require_filter_engine.formatObject(content) : content;
|
|
6298
|
+
const message = {
|
|
6299
|
+
id: generateId(),
|
|
6300
|
+
type: "log",
|
|
6301
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6302
|
+
level,
|
|
6303
|
+
content: formattedContent,
|
|
6304
|
+
label: label ?? this.context,
|
|
6305
|
+
trace,
|
|
6306
|
+
variant
|
|
6307
|
+
};
|
|
6308
|
+
this.screen.addMessage(message);
|
|
6309
|
+
return this;
|
|
6310
|
+
}
|
|
6311
|
+
file(path, content) {
|
|
6312
|
+
if (!this.isLevelEnabled("debug")) return this;
|
|
6313
|
+
const message = {
|
|
6314
|
+
id: generateId(),
|
|
6315
|
+
type: "file",
|
|
6316
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6317
|
+
filePath: path,
|
|
6318
|
+
content
|
|
6319
|
+
};
|
|
6320
|
+
this.screen.addMessage(message);
|
|
6321
|
+
return this;
|
|
6322
|
+
}
|
|
6323
|
+
diff(path, diffContent, view) {
|
|
6324
|
+
if (!this.isLevelEnabled("debug")) return this;
|
|
6325
|
+
const message = {
|
|
6326
|
+
id: generateId(),
|
|
6327
|
+
type: "diff",
|
|
6328
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6329
|
+
filePath: path,
|
|
6330
|
+
diff: diffContent,
|
|
6331
|
+
view
|
|
6332
|
+
};
|
|
6333
|
+
this.screen.addMessage(message);
|
|
6334
|
+
return this;
|
|
6335
|
+
}
|
|
6336
|
+
fileError(path, content, errorLines, startLine = 1) {
|
|
6337
|
+
if (!this.isLevelEnabled("debug")) return this;
|
|
6338
|
+
const message = {
|
|
6339
|
+
id: generateId(),
|
|
6340
|
+
type: "fileError",
|
|
6341
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6342
|
+
filePath: path,
|
|
6343
|
+
content,
|
|
6344
|
+
errorLines,
|
|
6345
|
+
startLine
|
|
6346
|
+
};
|
|
6347
|
+
this.screen.addMessage(message);
|
|
6348
|
+
return this;
|
|
6349
|
+
}
|
|
6350
|
+
/**
|
|
6351
|
+
* Sonner-like promise handling
|
|
6352
|
+
*/ async promise(promise, options) {
|
|
6353
|
+
const id = generateId();
|
|
6354
|
+
const loadingMessage = {
|
|
6355
|
+
id,
|
|
6356
|
+
type: "loading",
|
|
6357
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6358
|
+
content: options.loading,
|
|
6359
|
+
status: "loading"
|
|
6360
|
+
};
|
|
6361
|
+
this.screen.addMessage(loadingMessage);
|
|
6362
|
+
try {
|
|
6363
|
+
const result = await promise;
|
|
6364
|
+
const successContent = typeof options.success === "function" ? options.success(result) : options.success;
|
|
6365
|
+
this.screen.updateMessage(id, {
|
|
6366
|
+
status: "success",
|
|
6367
|
+
resolvedContent: successContent
|
|
6368
|
+
});
|
|
6369
|
+
return result;
|
|
6370
|
+
} catch (err) {
|
|
6371
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
6372
|
+
const errorContent = typeof options.error === "function" ? options.error(error) : options.error;
|
|
6373
|
+
this.screen.updateMessage(id, {
|
|
6374
|
+
status: "fail",
|
|
6375
|
+
resolvedContent: errorContent
|
|
6376
|
+
});
|
|
6377
|
+
throw err;
|
|
6378
|
+
}
|
|
6379
|
+
}
|
|
6380
|
+
/**
|
|
6381
|
+
* Create a loading message with manual resolution
|
|
6382
|
+
*/ loading(message) {
|
|
6383
|
+
const id = generateId();
|
|
6384
|
+
const loadingMessage = {
|
|
6385
|
+
id,
|
|
6386
|
+
type: "loading",
|
|
6387
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6388
|
+
content: message,
|
|
6389
|
+
status: "loading"
|
|
6390
|
+
};
|
|
6391
|
+
this.screen.addMessage(loadingMessage);
|
|
6392
|
+
return {
|
|
6393
|
+
success: (resolvedMessage) => {
|
|
6394
|
+
this.screen.updateMessage(id, {
|
|
6395
|
+
status: "success",
|
|
6396
|
+
resolvedContent: resolvedMessage
|
|
6397
|
+
});
|
|
6398
|
+
},
|
|
6399
|
+
fail: (resolvedMessage) => {
|
|
6400
|
+
this.screen.updateMessage(id, {
|
|
6401
|
+
status: "fail",
|
|
6402
|
+
resolvedContent: resolvedMessage
|
|
6403
|
+
});
|
|
6404
|
+
}
|
|
6405
|
+
};
|
|
6406
|
+
}
|
|
6407
|
+
/**
|
|
6408
|
+
* Create a progress bar with manual updates
|
|
6409
|
+
*/ progress(label, options) {
|
|
6410
|
+
const id = generateId();
|
|
6411
|
+
const progressMessage = {
|
|
6412
|
+
id,
|
|
6413
|
+
type: "progress",
|
|
6414
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6415
|
+
label,
|
|
6416
|
+
current: 0,
|
|
6417
|
+
total: options.total,
|
|
6418
|
+
status: "active"
|
|
6419
|
+
};
|
|
6420
|
+
this.screen.addMessage(progressMessage);
|
|
5913
6421
|
return {
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
6422
|
+
update: (current, newLabel) => {
|
|
6423
|
+
this.screen.updateProgressMessage(id, {
|
|
6424
|
+
current,
|
|
6425
|
+
label: newLabel ?? label
|
|
6426
|
+
});
|
|
6427
|
+
},
|
|
6428
|
+
complete: (message) => {
|
|
6429
|
+
this.screen.updateProgressMessage(id, {
|
|
6430
|
+
current: options.total,
|
|
6431
|
+
status: "complete",
|
|
6432
|
+
resolvedContent: message
|
|
6433
|
+
});
|
|
6434
|
+
},
|
|
6435
|
+
fail: (message) => {
|
|
6436
|
+
this.screen.updateProgressMessage(id, {
|
|
6437
|
+
status: "failed",
|
|
6438
|
+
resolvedContent: message
|
|
6439
|
+
});
|
|
5917
6440
|
}
|
|
5918
6441
|
};
|
|
5919
|
-
};
|
|
5920
|
-
}
|
|
5921
|
-
function _apply_decs_2203_r$1(targetClass, memberDecs, classDecs, parentClass) {
|
|
5922
|
-
return (_apply_decs_2203_r$1 = applyDecs2203RFactory$1())(targetClass, memberDecs, classDecs, parentClass);
|
|
5923
|
-
}
|
|
5924
|
-
var _dec, _initClass;
|
|
5925
|
-
let _ScreenFactory;
|
|
5926
|
-
_dec = (0, _navios_core.Factory)({ token: Screen });
|
|
5927
|
-
var ScreenFactory = class {
|
|
5928
|
-
static {
|
|
5929
|
-
({c: [_ScreenFactory, _initClass]} = _apply_decs_2203_r$1(this, [], [_dec]));
|
|
5930
6442
|
}
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
6443
|
+
/**
|
|
6444
|
+
* Start a collapsible log group
|
|
6445
|
+
*/ group(label) {
|
|
6446
|
+
const message = {
|
|
6447
|
+
id: generateId(),
|
|
6448
|
+
type: "group",
|
|
6449
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6450
|
+
label,
|
|
6451
|
+
collapsed: false,
|
|
6452
|
+
isEnd: false
|
|
6453
|
+
};
|
|
6454
|
+
this.screen.addMessage(message);
|
|
6455
|
+
return this;
|
|
6456
|
+
}
|
|
6457
|
+
/**
|
|
6458
|
+
* End the current log group
|
|
6459
|
+
*/ groupEnd() {
|
|
6460
|
+
const message = {
|
|
6461
|
+
id: generateId(),
|
|
6462
|
+
type: "group",
|
|
6463
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6464
|
+
label: "",
|
|
6465
|
+
collapsed: false,
|
|
6466
|
+
isEnd: true
|
|
6467
|
+
};
|
|
6468
|
+
this.screen.addMessage(message);
|
|
6469
|
+
return this;
|
|
6470
|
+
}
|
|
6471
|
+
/**
|
|
6472
|
+
* Display tabular data
|
|
6473
|
+
*/ table(data, options) {
|
|
6474
|
+
if (data.length === 0) return this;
|
|
6475
|
+
const firstRow = data[0];
|
|
6476
|
+
if (!firstRow) return this;
|
|
6477
|
+
const headers = Object.keys(firstRow);
|
|
6478
|
+
const rows = data.map((row) => headers.map((h) => String(row[h] ?? "")));
|
|
6479
|
+
const message = {
|
|
6480
|
+
id: generateId(),
|
|
6481
|
+
type: "table",
|
|
6482
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6483
|
+
headers,
|
|
6484
|
+
rows,
|
|
6485
|
+
title: options?.title
|
|
6486
|
+
};
|
|
6487
|
+
this.screen.addMessage(message);
|
|
6488
|
+
return this;
|
|
5936
6489
|
}
|
|
5937
6490
|
static {
|
|
5938
|
-
_initClass();
|
|
6491
|
+
_initClass$1();
|
|
5939
6492
|
}
|
|
5940
6493
|
};
|
|
5941
6494
|
|
|
5942
6495
|
//#endregion
|
|
5943
|
-
//#region src/
|
|
6496
|
+
//#region src/services/prompt.ts
|
|
5944
6497
|
function applyDecs2203RFactory() {
|
|
5945
6498
|
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
5946
6499
|
return function addInitializer(initializer$2) {
|
|
@@ -6218,77 +6771,138 @@ function applyDecs2203RFactory() {
|
|
|
6218
6771
|
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
6219
6772
|
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
6220
6773
|
}
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
}
|
|
6774
|
+
var _dec, _initClass;
|
|
6775
|
+
let _PromptInstance;
|
|
6776
|
+
_dec = (0, _navios_core.Injectable)({ token: Prompt });
|
|
6777
|
+
var PromptInstance = class {
|
|
6778
|
+
static {
|
|
6779
|
+
({c: [_PromptInstance, _initClass]} = _apply_decs_2203_r(this, [], [_dec]));
|
|
6780
|
+
}
|
|
6781
|
+
constructor(options) {
|
|
6782
|
+
this.screen = (0, _navios_core.inject)(Screen, typeof options.screen === "string" ? { name: options.screen } : options.screen);
|
|
6783
|
+
}
|
|
6784
|
+
screen;
|
|
6228
6785
|
/**
|
|
6229
|
-
*
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
}
|
|
6249
|
-
|
|
6250
|
-
this.logger.warn(message);
|
|
6251
|
-
}
|
|
6252
|
-
debug(message) {
|
|
6253
|
-
this.logger.debug(message);
|
|
6254
|
-
}
|
|
6255
|
-
fatal(message) {
|
|
6256
|
-
this.logger.fatal(message);
|
|
6257
|
-
}
|
|
6258
|
-
verbose(message) {
|
|
6259
|
-
this.logger.verbose(message);
|
|
6260
|
-
}
|
|
6261
|
-
setLogLevels(levels) {
|
|
6262
|
-
this.logger.setLogLevels(levels);
|
|
6263
|
-
}
|
|
6264
|
-
static {
|
|
6265
|
-
_initClass$4();
|
|
6266
|
-
}
|
|
6786
|
+
* Display a choice prompt and wait for user selection.
|
|
6787
|
+
* Returns the selected value (or input text if an input option was selected).
|
|
6788
|
+
*/ async choice(options) {
|
|
6789
|
+
const { question, choices, defaultChoice, timeout } = options;
|
|
6790
|
+
if (choices.length === 0) throw new Error("Choices array cannot be empty");
|
|
6791
|
+
const defaultIndex = defaultChoice ? choices.findIndex((c) => c.value === defaultChoice) : 0;
|
|
6792
|
+
const prompt = {
|
|
6793
|
+
type: "choice",
|
|
6794
|
+
id: `prompt-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
6795
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6796
|
+
question,
|
|
6797
|
+
choices,
|
|
6798
|
+
defaultChoice: defaultChoice ?? choices[0]?.value ?? "",
|
|
6799
|
+
selectedIndex: Math.max(0, defaultIndex),
|
|
6800
|
+
inputMode: false,
|
|
6801
|
+
inputValue: "",
|
|
6802
|
+
resolved: false,
|
|
6803
|
+
timeout,
|
|
6804
|
+
timeoutStarted: timeout ? Date.now() : void 0
|
|
6805
|
+
};
|
|
6806
|
+
return this.screen._addPrompt(prompt);
|
|
6267
6807
|
}
|
|
6268
|
-
|
|
6269
|
-
|
|
6808
|
+
/**
|
|
6809
|
+
* Display a confirmation prompt and wait for user response.
|
|
6810
|
+
* Returns true for confirm, false for cancel.
|
|
6811
|
+
*/ async confirm(options) {
|
|
6812
|
+
const { question, confirmText = "Yes", cancelText = "No", defaultValue = true, timeout } = options;
|
|
6813
|
+
const prompt = {
|
|
6814
|
+
type: "confirm",
|
|
6815
|
+
id: `prompt-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
6816
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6817
|
+
question,
|
|
6818
|
+
confirmText,
|
|
6819
|
+
cancelText,
|
|
6820
|
+
defaultValue,
|
|
6821
|
+
selectedValue: defaultValue,
|
|
6822
|
+
resolved: false,
|
|
6823
|
+
timeout,
|
|
6824
|
+
timeoutStarted: timeout ? Date.now() : void 0
|
|
6825
|
+
};
|
|
6826
|
+
return this.screen._addPrompt(prompt);
|
|
6827
|
+
}
|
|
6828
|
+
/**
|
|
6829
|
+
* Display a text input prompt and wait for user input.
|
|
6830
|
+
* Returns the entered text.
|
|
6831
|
+
*/ async input(options) {
|
|
6832
|
+
const { question, placeholder = "", defaultValue = "", timeout } = options;
|
|
6833
|
+
const prompt = {
|
|
6834
|
+
type: "input",
|
|
6835
|
+
id: `prompt-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
6836
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6837
|
+
question,
|
|
6838
|
+
placeholder,
|
|
6839
|
+
defaultValue,
|
|
6840
|
+
value: defaultValue,
|
|
6841
|
+
resolved: false,
|
|
6842
|
+
timeout,
|
|
6843
|
+
timeoutStarted: timeout ? Date.now() : void 0
|
|
6844
|
+
};
|
|
6845
|
+
return this.screen._addPrompt(prompt);
|
|
6846
|
+
}
|
|
6847
|
+
/**
|
|
6848
|
+
* Display a multi-select choice prompt.
|
|
6849
|
+
* Returns an array of selected values.
|
|
6850
|
+
*/ async multiChoice(options) {
|
|
6851
|
+
const { question, choices, defaultChoices = [], minSelect = 0, maxSelect = choices.length, timeout } = options;
|
|
6852
|
+
if (choices.length === 0) throw new Error("Choices array cannot be empty");
|
|
6853
|
+
const selectedIndices = /* @__PURE__ */ new Set();
|
|
6854
|
+
defaultChoices.forEach((value) => {
|
|
6855
|
+
const index = choices.findIndex((c) => c.value === value);
|
|
6856
|
+
if (index !== -1) selectedIndices.add(index);
|
|
6857
|
+
});
|
|
6858
|
+
const prompt = {
|
|
6859
|
+
type: "multiChoice",
|
|
6860
|
+
id: `prompt-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
6861
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
6862
|
+
question,
|
|
6863
|
+
choices,
|
|
6864
|
+
selectedIndices,
|
|
6865
|
+
focusedIndex: 0,
|
|
6866
|
+
minSelect,
|
|
6867
|
+
maxSelect,
|
|
6868
|
+
resolved: false,
|
|
6869
|
+
timeout,
|
|
6870
|
+
timeoutStarted: timeout ? Date.now() : void 0
|
|
6871
|
+
};
|
|
6872
|
+
return this.screen._addPrompt(prompt);
|
|
6873
|
+
}
|
|
6874
|
+
static {
|
|
6875
|
+
_initClass();
|
|
6876
|
+
}
|
|
6877
|
+
};
|
|
6270
6878
|
|
|
6271
6879
|
//#endregion
|
|
6272
|
-
exports.ALL_LOG_LEVELS =
|
|
6273
|
-
exports.
|
|
6274
|
-
exports.
|
|
6275
|
-
exports.
|
|
6276
|
-
exports.
|
|
6277
|
-
exports.
|
|
6278
|
-
exports.FilterEngine =
|
|
6279
|
-
exports.GROUP_COLORS =
|
|
6280
|
-
exports.
|
|
6281
|
-
exports.
|
|
6282
|
-
exports
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6880
|
+
exports.ALL_LOG_LEVELS = require_filter_engine.ALL_LOG_LEVELS;
|
|
6881
|
+
exports.Adapter = require_filter_engine.Adapter;
|
|
6882
|
+
exports.COMMON_FILETYPES = require_filter_engine.COMMON_FILETYPES;
|
|
6883
|
+
exports.DEFAULT_LOG_LEVEL_COLORS = require_filter_engine.DEFAULT_LOG_LEVEL_COLORS;
|
|
6884
|
+
exports.ERROR_HIGHLIGHT_COLORS = require_filter_engine.ERROR_HIGHLIGHT_COLORS;
|
|
6885
|
+
exports.FILE_COLORS = require_filter_engine.FILE_COLORS;
|
|
6886
|
+
exports.FilterEngine = require_filter_engine.FilterEngine;
|
|
6887
|
+
exports.GROUP_COLORS = require_filter_engine.GROUP_COLORS;
|
|
6888
|
+
exports.HEADER_COLORS = require_filter_engine.HEADER_COLORS;
|
|
6889
|
+
exports.IsomorphicLogger = IsomorphicLogger;
|
|
6890
|
+
Object.defineProperty(exports, 'IsomorphicLoggerFactory', {
|
|
6891
|
+
enumerable: true,
|
|
6892
|
+
get: function () {
|
|
6893
|
+
return _IsomorphicLoggerFactory;
|
|
6894
|
+
}
|
|
6895
|
+
});
|
|
6896
|
+
exports.KeyboardManager = require_filter_engine.KeyboardManager;
|
|
6286
6897
|
exports.LoggerOptionsSchema = LoggerOptionsSchema;
|
|
6287
|
-
exports
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6898
|
+
Object.defineProperty(exports, 'MissingAdapterOverride', {
|
|
6899
|
+
enumerable: true,
|
|
6900
|
+
get: function () {
|
|
6901
|
+
return _MissingAdapterOverride;
|
|
6902
|
+
}
|
|
6903
|
+
});
|
|
6904
|
+
exports.PROGRESS_COLORS = require_filter_engine.PROGRESS_COLORS;
|
|
6905
|
+
exports.PROMPT_COLORS = require_filter_engine.PROMPT_COLORS;
|
|
6292
6906
|
exports.Prompt = Prompt;
|
|
6293
6907
|
Object.defineProperty(exports, 'PromptInstance', {
|
|
6294
6908
|
enumerable: true,
|
|
@@ -6297,12 +6911,10 @@ Object.defineProperty(exports, 'PromptInstance', {
|
|
|
6297
6911
|
}
|
|
6298
6912
|
});
|
|
6299
6913
|
exports.PromptOptionsSchema = PromptOptionsSchema;
|
|
6300
|
-
exports.
|
|
6301
|
-
exports.
|
|
6302
|
-
exports.
|
|
6303
|
-
exports.STATUS_INDICATORS = require_screen_manager_bridge.STATUS_INDICATORS;
|
|
6914
|
+
exports.SEPARATOR_COLORS = require_filter_engine.SEPARATOR_COLORS;
|
|
6915
|
+
exports.SIDEBAR_COLORS = require_filter_engine.SIDEBAR_COLORS;
|
|
6916
|
+
exports.STATUS_INDICATORS = require_filter_engine.STATUS_INDICATORS;
|
|
6304
6917
|
exports.Screen = Screen;
|
|
6305
|
-
exports.ScreenBridge = require_screen_manager_bridge.ScreenBridge;
|
|
6306
6918
|
Object.defineProperty(exports, 'ScreenFactory', {
|
|
6307
6919
|
enumerable: true,
|
|
6308
6920
|
get: function () {
|
|
@@ -6317,42 +6929,36 @@ Object.defineProperty(exports, 'ScreenLoggerInstance', {
|
|
|
6317
6929
|
return _ScreenLoggerInstance;
|
|
6318
6930
|
}
|
|
6319
6931
|
});
|
|
6320
|
-
|
|
6932
|
+
exports.ScreenManager = ScreenManager;
|
|
6933
|
+
Object.defineProperty(exports, 'ScreenManagerInstance', {
|
|
6321
6934
|
enumerable: true,
|
|
6322
6935
|
get: function () {
|
|
6323
|
-
return
|
|
6936
|
+
return _ScreenManagerInstance;
|
|
6324
6937
|
}
|
|
6325
6938
|
});
|
|
6326
|
-
exports.ScreenManagerBridge = require_screen_manager_bridge.ScreenManagerBridge;
|
|
6327
6939
|
exports.ScreenOptionsSchema = ScreenOptionsSchema;
|
|
6328
|
-
exports.
|
|
6329
|
-
exports.
|
|
6330
|
-
exports.
|
|
6331
|
-
exports.
|
|
6332
|
-
exports.
|
|
6333
|
-
exports.
|
|
6334
|
-
exports.
|
|
6335
|
-
exports.
|
|
6336
|
-
exports.
|
|
6337
|
-
exports.
|
|
6338
|
-
exports.
|
|
6339
|
-
exports.
|
|
6340
|
-
exports.
|
|
6341
|
-
exports.
|
|
6342
|
-
exports.
|
|
6343
|
-
exports.
|
|
6344
|
-
exports.
|
|
6345
|
-
exports.
|
|
6346
|
-
exports.
|
|
6347
|
-
exports.
|
|
6348
|
-
exports.hasActiveFilter = require_screen_manager_bridge.hasActiveFilter;
|
|
6349
|
-
exports.highContrastTheme = require_screen_manager_bridge.highContrastTheme;
|
|
6350
|
-
exports.lightTheme = require_screen_manager_bridge.lightTheme;
|
|
6351
|
-
exports.mergeThemes = require_screen_manager_bridge.mergeThemes;
|
|
6940
|
+
exports.TABLE_COLORS = require_filter_engine.TABLE_COLORS;
|
|
6941
|
+
exports.VARIANT_COLORS = require_filter_engine.VARIANT_COLORS;
|
|
6942
|
+
exports.captureTrace = require_filter_engine.captureTrace;
|
|
6943
|
+
exports.createBorderColor = require_filter_engine.createBorderColor;
|
|
6944
|
+
exports.createDefaultBindings = require_filter_engine.createDefaultBindings;
|
|
6945
|
+
exports.createDefaultFilterState = require_filter_engine.createDefaultFilterState;
|
|
6946
|
+
exports.createTheme = require_filter_engine.createTheme;
|
|
6947
|
+
exports.createThemeFrom = require_filter_engine.createThemeFrom;
|
|
6948
|
+
exports.createTintedColor = require_filter_engine.createTintedColor;
|
|
6949
|
+
exports.darkTheme = require_filter_engine.darkTheme;
|
|
6950
|
+
exports.formatKeyBinding = require_filter_engine.formatKeyBinding;
|
|
6951
|
+
exports.formatObject = require_filter_engine.formatObject;
|
|
6952
|
+
exports.getFileName = require_filter_engine.getFileName;
|
|
6953
|
+
exports.getLogLevelColors = require_filter_engine.getLogLevelColors;
|
|
6954
|
+
exports.getThemePreset = require_filter_engine.getThemePreset;
|
|
6955
|
+
exports.handlePrintableInput = require_filter_engine.handlePrintableInput;
|
|
6956
|
+
exports.hasActiveFilter = require_filter_engine.hasActiveFilter;
|
|
6957
|
+
exports.highContrastTheme = require_filter_engine.highContrastTheme;
|
|
6958
|
+
exports.lightTheme = require_filter_engine.lightTheme;
|
|
6959
|
+
exports.mergeThemes = require_filter_engine.mergeThemes;
|
|
6352
6960
|
exports.overrideConsoleLogger = overrideConsoleLogger;
|
|
6353
|
-
exports.printMessagesToStdout =
|
|
6354
|
-
exports.resolveFiletype =
|
|
6355
|
-
exports.resolveTheme =
|
|
6356
|
-
exports.useLoggerContext = require_screen_manager_bridge.useLoggerContext;
|
|
6357
|
-
exports.useTheme = require_screen_manager_bridge.useTheme;
|
|
6961
|
+
exports.printMessagesToStdout = require_filter_engine.printMessagesToStdout;
|
|
6962
|
+
exports.resolveFiletype = require_filter_engine.resolveFiletype;
|
|
6963
|
+
exports.resolveTheme = require_filter_engine.resolveTheme;
|
|
6358
6964
|
//# sourceMappingURL=index.cjs.map
|