@fbincon/claude-code-statusline 0.0.0-stage → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LICENSE-Unicode.txt +39 -0
- package/LICENSE-Wcwidth.txt +27 -0
- package/README.md +90 -2
- package/bin/claude-statusline.js +2 -0
- package/candidate.json +1238 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.d.ts +35 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js +228 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js +72 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +140 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js +101 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js +96 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js +80 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.d.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js +99 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.d.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js +134 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +89 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.js +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.js +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js +67 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js +63 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js +153 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.d.ts +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +142 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js +91 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js +109 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.d.ts +60 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js +12 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js +234 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js +41 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.d.ts +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js +92 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.d.ts +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js +91 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js +94 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.d.ts +22 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js +197 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.d.ts +7 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js +134 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.d.ts +58 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +144 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js +125 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js +55 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +95 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js +48 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.d.ts +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js +162 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.d.ts +37 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.d.ts +9 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js +241 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.d.ts +16 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js +90 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.d.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js +80 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js +59 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js +70 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.d.ts +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.d.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js +227 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +144 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/package.json +17 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-config/SKILL.md +80 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-configure/SKILL.md +19 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +37 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/hooks.json +6 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +820 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +503 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/forms.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +198 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/messages.ts +101 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +218 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +29 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +254 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +167 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/guidance.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/import-review.ts +55 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/instances.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/navigation.ts +98 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/numeric.ts +42 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/search.ts +114 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +276 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-unicode.ts +92 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +6842 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/index.ts +40 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/messages.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/presentation.ts +62 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/launch.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preferences.ts +61 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preview-preferences.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +124 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/unicode.ts +121 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +47 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +159 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +84 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/surface.ts +89 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/catalog.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/preview.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/section.ts +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/shortcuts.ts +83 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/layout.ts +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/styled-text.ts +56 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/text.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/theme.ts +27 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/hooks.json +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/observe.ts +279 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/checklists.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/costs.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/generated-contracts.ts +18 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/identity.ts +14 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/launch.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/queue.ts +68 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/streams.ts +28 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/timing.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.d.ts +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js +72 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +86 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +3462 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js +17 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +232 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js +48 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +104 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +99 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +80 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.d.ts +29 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +159 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +34 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.d.ts +15 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js +55 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +33 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +663 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +401 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +251 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +146 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js +17 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.d.ts +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js +53 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.d.ts +37 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js +122 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +6841 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +6841 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js +38 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js +31 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.js +137 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.js +56 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.js +165 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.js +47 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.d.ts +21 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js +105 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js +50 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js +49 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js +58 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js +34 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.d.ts +49 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +399 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.d.ts +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js +176 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js +29 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js +93 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js +46 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.d.ts +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js +76 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.d.ts +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +98 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.d.ts +67 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js +116 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +305 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js +33 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js +52 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js +115 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js +104 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.d.ts +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js +196 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js +45 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js +228 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js +145 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js +70 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js +110 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js +75 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js +121 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.d.ts +43 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js +198 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js +192 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js +245 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js +28 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js +183 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.d.ts +64 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js +263 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js +103 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js +50 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js +75 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.d.ts +12 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js +93 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js +178 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/package.json +8 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/languages.json +7 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-Hant.json +1367 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.d.ts +15 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js +22 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js +102 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.d.ts +16 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js +18 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.js +160 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.d.ts +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.js +19 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.d.ts +8 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js +164 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.js +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.js +14 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.js +21 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js +31 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.d.ts +15 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js +36 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.d.ts +17 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js +44 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js +48 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js +67 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.d.ts +42 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js +180 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.d.ts +11 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js +81 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.d.ts +32 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js +157 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.d.ts +18 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js +150 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.d.ts +6 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js +39 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.d.ts +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js +82 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/package.json +8 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.d.ts +16 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +213 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.d.ts +30 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.js +34 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.d.ts +28 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js +126 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +52 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +352 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/package.json +16 -0
- package/node_modules/@koromix/koffi-darwin-arm64/README.md +6 -0
- package/node_modules/@koromix/koffi-darwin-arm64/darwin_arm64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-arm64/index.js +1 -0
- package/node_modules/@koromix/koffi-darwin-arm64/package.json +24 -0
- package/node_modules/@koromix/koffi-darwin-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-darwin-x64/darwin_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-x64/index.js +1 -0
- package/node_modules/@koromix/koffi-darwin-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-linux-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-linux-x64/index.js +198 -0
- package/node_modules/@koromix/koffi-linux-x64/linux_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-linux-x64/musl_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-linux-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-win32-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-win32-x64/index.js +1 -0
- package/node_modules/@koromix/koffi-win32-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.lib +0 -0
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.node +0 -0
- package/node_modules/koffi/LICENSE.txt +22 -0
- package/node_modules/koffi/README.md +46 -0
- package/node_modules/koffi/index.cjs +1 -0
- package/node_modules/koffi/index.d.ts +390 -0
- package/node_modules/koffi/index.js +2 -0
- package/node_modules/koffi/indirect.cjs +1 -0
- package/node_modules/koffi/indirect.js +2 -0
- package/node_modules/koffi/package.json +73 -0
- package/node_modules/koffi/src/koffi/index.cjs +327 -0
- package/node_modules/koffi/src/koffi/index.js +312 -0
- package/node_modules/koffi/src/koffi/indirect.cjs +326 -0
- package/node_modules/koffi/src/koffi/indirect.js +311 -0
- package/node_modules/koffi/src/koffi/src/static.cjs +170 -0
- package/node_modules/koffi/src/koffi/src/static.js +173 -0
- package/node_modules/lossless-json/LICENSE.md +9 -0
- package/node_modules/lossless-json/README.md +549 -0
- package/node_modules/lossless-json/lib/esm/LosslessNumber.js +92 -0
- package/node_modules/lossless-json/lib/esm/LosslessNumber.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/config.js +9 -0
- package/node_modules/lossless-json/lib/esm/config.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/index.js +9 -0
- package/node_modules/lossless-json/lib/esm/index.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/numberParsers.js +9 -0
- package/node_modules/lossless-json/lib/esm/numberParsers.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/package.json +3 -0
- package/node_modules/lossless-json/lib/esm/parse.js +346 -0
- package/node_modules/lossless-json/lib/esm/parse.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/revive.js +57 -0
- package/node_modules/lossless-json/lib/esm/revive.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/reviveDate.js +10 -0
- package/node_modules/lossless-json/lib/esm/reviveDate.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/stringify.js +166 -0
- package/node_modules/lossless-json/lib/esm/stringify.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/types.js +2 -0
- package/node_modules/lossless-json/lib/esm/types.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/utils.js +236 -0
- package/node_modules/lossless-json/lib/esm/utils.js.map +1 -0
- package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts +40 -0
- package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/config.d.ts +13 -0
- package/node_modules/lossless-json/lib/types/config.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/index.d.ts +9 -0
- package/node_modules/lossless-json/lib/types/index.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/numberParsers.d.ts +4 -0
- package/node_modules/lossless-json/lib/types/numberParsers.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/parse.d.ts +33 -0
- package/node_modules/lossless-json/lib/types/parse.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/revive.d.ts +13 -0
- package/node_modules/lossless-json/lib/types/revive.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/reviveDate.d.ts +5 -0
- package/node_modules/lossless-json/lib/types/reviveDate.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/stringify.d.ts +37 -0
- package/node_modules/lossless-json/lib/types/stringify.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/types.d.ts +61 -0
- package/node_modules/lossless-json/lib/types/types.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/utils.d.ts +79 -0
- package/node_modules/lossless-json/lib/types/utils.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/umd/lossless-json.js +1 -0
- package/node_modules/lossless-json/lib/umd/lossless-json.js.map +1 -0
- package/node_modules/lossless-json/lib/umd/package.json +3 -0
- package/node_modules/lossless-json/package.json +89 -0
- package/package.json +57 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/terminal/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEtF,MAAM,CAAC,MAAM,UAAU,GAAG,gCAAgC,EAAE,YAAY,GAAG,0CAA0C,CAAC;AACtH,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,EAAE,SAAS,GAAG,gCAAgC,CAAC;AAC5G,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,GAAG,IAAI,EAAE,gBAAgB,GAAG,GAAG,EAAE,cAAc,GAAG,MAAM,CAAC;AAkBvF,MAAM,OAAO,aAAc,SAAQ,KAAK;IACpC,gBAAgB,KAAK,CAAC,mDAAmD,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC;CAC7G;AACD,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Ac,CAAC,EAAE,CAAC;gBACjC,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,SAAS,CAAC,CAAmC,CAAC;gBAC5G,IAAI,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC;oBACxC,SAAS;YACjB,CAAC;YACD,uEAAuE;YACvE,wDAAwD;YACxD,OAAO,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,CAAC,CAAC,yCAAyC,CAAC,CAAC;IACvD,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Key } from '@fbincon/statusline-core/terminal/key';
|
|
2
|
+
export type { Key } from '@fbincon/statusline-core/terminal/key';
|
|
3
|
+
/** Incremental UTF-8 and escape parsing. Paste text cannot execute control chords. */
|
|
4
|
+
export declare class KeyDecoder {
|
|
5
|
+
private decoder;
|
|
6
|
+
private buffer;
|
|
7
|
+
private pasting;
|
|
8
|
+
get pendingEscape(): boolean;
|
|
9
|
+
push(chunk: Uint8Array | string): Key[];
|
|
10
|
+
flushEscape(): Key[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { StringDecoder } from 'node:string_decoder';
|
|
2
|
+
const sequences = {
|
|
3
|
+
'[A': { key: 'up' }, '[B': { key: 'down' }, '[C': { key: 'right' }, '[D': { key: 'left' },
|
|
4
|
+
'[H': { key: 'home' }, '[F': { key: 'end' }, '[1~': { key: 'home' }, '[4~': { key: 'end' },
|
|
5
|
+
'[7~': { key: 'home' }, '[8~': { key: 'end' }, '[5~': { key: 'pageup' }, '[6~': { key: 'pagedown' },
|
|
6
|
+
'[3~': { key: 'delete' }, '[Z': { key: 'tab', shift: true },
|
|
7
|
+
OA: { key: 'up' }, OB: { key: 'down' }, OC: { key: 'right' }, OD: { key: 'left' }, OH: { key: 'home' }, OF: { key: 'end' },
|
|
8
|
+
};
|
|
9
|
+
/** Incremental UTF-8 and escape parsing. Paste text cannot execute control chords. */
|
|
10
|
+
export class KeyDecoder {
|
|
11
|
+
decoder = new StringDecoder('utf8');
|
|
12
|
+
buffer = '';
|
|
13
|
+
pasting = false;
|
|
14
|
+
get pendingEscape() { return !this.pasting && this.buffer.startsWith('\x1b'); }
|
|
15
|
+
push(chunk) {
|
|
16
|
+
this.buffer += typeof chunk === 'string' ? chunk : this.decoder.write(Buffer.from(chunk));
|
|
17
|
+
const result = [];
|
|
18
|
+
while (this.buffer) {
|
|
19
|
+
if (this.buffer.startsWith('\x1b[200~')) {
|
|
20
|
+
this.pasting = true;
|
|
21
|
+
this.buffer = this.buffer.slice(6);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (this.buffer.startsWith('\x1b[201~')) {
|
|
25
|
+
this.pasting = false;
|
|
26
|
+
this.buffer = this.buffer.slice(6);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (this.pasting) {
|
|
30
|
+
if ('\x1b[201~'.startsWith(this.buffer))
|
|
31
|
+
break;
|
|
32
|
+
const c = [...this.buffer][0];
|
|
33
|
+
this.buffer = this.buffer.slice(c.length);
|
|
34
|
+
if (!/[\p{Cc}\p{Cs}]/u.test(c))
|
|
35
|
+
result.push({ key: c, paste: true });
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (this.buffer[0] === '\x1b') {
|
|
39
|
+
if (this.buffer.length === 1)
|
|
40
|
+
break;
|
|
41
|
+
if (['[', 'O'].includes(this.buffer[1])) {
|
|
42
|
+
const end = this.buffer.slice(2).search(/[\x40-\x7e]/u);
|
|
43
|
+
if (end < 0) {
|
|
44
|
+
if (this.buffer.length > 64)
|
|
45
|
+
this.buffer = '';
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
const sequence = this.buffer.slice(1, end + 3);
|
|
49
|
+
this.buffer = this.buffer.slice(end + 3);
|
|
50
|
+
if (sequences[sequence])
|
|
51
|
+
result.push(sequences[sequence]);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
result.push({ key: 'escape' });
|
|
55
|
+
this.buffer = this.buffer.slice(1);
|
|
56
|
+
}
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const c = [...this.buffer][0];
|
|
60
|
+
this.buffer = this.buffer.slice(c.length);
|
|
61
|
+
if (c === '\r' || c === '\n')
|
|
62
|
+
result.push({ key: 'return' });
|
|
63
|
+
else if (c === '\t')
|
|
64
|
+
result.push({ key: 'tab' });
|
|
65
|
+
else if (c === '\x7f' || c === '\b')
|
|
66
|
+
result.push({ key: 'backspace' });
|
|
67
|
+
else if (c.charCodeAt(0) > 0 && c.charCodeAt(0) < 27)
|
|
68
|
+
result.push({ key: String.fromCharCode(c.charCodeAt(0) + 96), ctrl: true });
|
|
69
|
+
else if (!/[\p{Cc}\p{Cs}]/u.test(c))
|
|
70
|
+
result.push({ key: c });
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
flushEscape() {
|
|
75
|
+
if (!this.pendingEscape)
|
|
76
|
+
return [];
|
|
77
|
+
this.buffer = '';
|
|
78
|
+
return [{ key: 'escape' }];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/terminal/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,SAAS,GAAwB;IACnC,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE;IACzF,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,IAA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AAE,KAAK,EAAE,CAAC,CAAC;iBAC3B,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,IAAI;gBAC/B,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;iBACjC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE;gBAChD,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC3E,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC/B,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,WAAW;QAAY,IAAI,CAAC,IAAI,CAAC,aAAa;YAC1C,OAAO,EAAE,CAAC;QAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,CAAC;CACjE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Request } from './bridge.js';
|
|
2
|
+
export interface Launcher {
|
|
3
|
+
kind: 'windows-console' | 'tmux' | 'gnome' | 'macos-terminal';
|
|
4
|
+
executable: string;
|
|
5
|
+
pane?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Probe {
|
|
8
|
+
which(name: string): string | null;
|
|
9
|
+
directory(path: string): boolean;
|
|
10
|
+
executable(path: string): boolean;
|
|
11
|
+
run(command: string, args: string[]): {
|
|
12
|
+
code: number | null;
|
|
13
|
+
stdout: string;
|
|
14
|
+
};
|
|
15
|
+
uid(): number;
|
|
16
|
+
}
|
|
17
|
+
export declare function probe(env: NodeJS.ProcessEnv): Probe;
|
|
18
|
+
export declare function chooseLauncher(env: NodeJS.ProcessEnv, platform?: NodeJS.Platform, io?: Probe): Launcher | null;
|
|
19
|
+
export declare function workingDirectory(value: unknown): string;
|
|
20
|
+
export declare const shellQuote: (value: string) => string;
|
|
21
|
+
export declare function bridgeEnvironment(request: Request, directory: string, env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
22
|
+
export declare function launcherArguments(launcher: Launcher, request: Request, directory: string, env: NodeJS.ProcessEnv): string[];
|
|
23
|
+
export interface Running {
|
|
24
|
+
code(): number | null;
|
|
25
|
+
error(): Error | null;
|
|
26
|
+
stop(): void;
|
|
27
|
+
close(): void;
|
|
28
|
+
}
|
|
29
|
+
export declare function start(argv: string[], cwd: string, env: NodeJS.ProcessEnv): Running;
|
|
30
|
+
export declare function windowsCommand(argv: readonly string[]): string;
|
|
31
|
+
/** CREATE_NEW_CONSOLE binds real console handles and never executes an npm .cmd shim. */
|
|
32
|
+
export declare function startWindows(argv: string[], cwd: string, env: NodeJS.ProcessEnv): Running;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { isAbsolute, join } from 'node:path';
|
|
5
|
+
import { which } from '../commands.js';
|
|
6
|
+
import { library, nativeApi, winError } from '../native.js';
|
|
7
|
+
import { RESULT_ENV, DEADLINE_ENV, REQUEST_ENV, NONCE_ENV, DEADLINE_SECONDS } from './bridge.js';
|
|
8
|
+
export function probe(env) {
|
|
9
|
+
return {
|
|
10
|
+
which: name => which(name, env), directory: path => {
|
|
11
|
+
try {
|
|
12
|
+
return fs.statSync(path).isDirectory();
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
executable: path => {
|
|
19
|
+
try {
|
|
20
|
+
fs.accessSync(path, fs.constants.X_OK);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
run(command, args) { const result = spawnSync(command, args, { env, timeout: 2000, maxBuffer: 16 * 1024, encoding: 'utf8', windowsHide: true }); return { code: result.error ? null : result.status, stdout: result.stdout ?? '' }; },
|
|
28
|
+
uid: () => process.getuid?.() ?? -1,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function chooseLauncher(env, platform = process.platform, io = probe(env)) {
|
|
32
|
+
if (platform === 'win32')
|
|
33
|
+
return { kind: 'windows-console', executable: process.execPath };
|
|
34
|
+
const pane = env.TMUX_PANE ?? '', tmux = io.which('tmux');
|
|
35
|
+
if (env.TMUX && /^%\d+$/u.test(pane) && tmux) {
|
|
36
|
+
const result = io.run(tmux, ['display-message', '-p', '-t', pane, '#{pane_id}']);
|
|
37
|
+
if (result.code === 0 && result.stdout.trim() === pane)
|
|
38
|
+
return { kind: 'tmux', executable: tmux, pane };
|
|
39
|
+
}
|
|
40
|
+
if (platform === 'darwin') {
|
|
41
|
+
if (env.SSH_CONNECTION || env.SSH_TTY || !io.executable('/usr/bin/open') || !io.directory('/System/Applications/Utilities/Terminal.app'))
|
|
42
|
+
return null;
|
|
43
|
+
if (io.run('/bin/launchctl', ['print', `gui/${io.uid()}`]).code === 0)
|
|
44
|
+
return { kind: 'macos-terminal', executable: '/usr/bin/open' };
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const gnome = env.DISPLAY || env.WAYLAND_DISPLAY ? io.which('gnome-terminal') : null;
|
|
48
|
+
return gnome ? { kind: 'gnome', executable: gnome } : null;
|
|
49
|
+
}
|
|
50
|
+
export function workingDirectory(value) {
|
|
51
|
+
if (typeof value === 'string' && isAbsolute(value)) {
|
|
52
|
+
try {
|
|
53
|
+
if (fs.statSync(value).isDirectory())
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
catch { /* Use the current user's home. */ }
|
|
57
|
+
}
|
|
58
|
+
return homedir();
|
|
59
|
+
}
|
|
60
|
+
export const shellQuote = (value) => "'" + value.replaceAll("'", "'\\''") + "'";
|
|
61
|
+
export function bridgeEnvironment(request, directory, env) {
|
|
62
|
+
return { ...env, [RESULT_ENV]: join(directory, 'result.json'), [DEADLINE_ENV]: String(DEADLINE_SECONDS), [REQUEST_ENV]: join(directory, 'request.json'), [NONCE_ENV]: request.nonce, CLAUDE_CONFIG_DIR: request.configDir };
|
|
63
|
+
}
|
|
64
|
+
export function launcherArguments(launcher, request, directory, env) {
|
|
65
|
+
const command = [request.backend.executable, ...request.backend.args, 'configure', '--config-dir', request.configDir];
|
|
66
|
+
const bridge = bridgeEnvironment(request, directory, env);
|
|
67
|
+
const environment = ['PATH', RESULT_ENV, DEADLINE_ENV, REQUEST_ENV, NONCE_ENV, 'CLAUDE_CONFIG_DIR'].filter(key => bridge[key] !== undefined).map(key => `${key}=${bridge[key]}`);
|
|
68
|
+
if (launcher.kind === 'windows-console')
|
|
69
|
+
return command;
|
|
70
|
+
if (launcher.kind === 'gnome')
|
|
71
|
+
return [launcher.executable, '--tab', '--active', '--wait', '--title=Configure Status Line', `--working-directory=${request.cwd}`, '--', ...command];
|
|
72
|
+
if (launcher.kind === 'tmux')
|
|
73
|
+
return [launcher.executable, 'display-popup', '-E', '-T', 'Configure Status Line', '-w', '90%', '-h', '90%', '-d', request.cwd, '-t', launcher.pane, ['/usr/bin/env', ...environment, ...command].map(shellQuote).join(' ')];
|
|
74
|
+
const script = join(directory, 'terminal.command');
|
|
75
|
+
fs.writeFileSync(script, '#!/bin/sh\ncd ' + shellQuote(request.cwd) + '\nexec ' + ['/usr/bin/env', ...environment, ...command].map(shellQuote).join(' ') + '\n', { mode: 0o700, flag: 'wx' });
|
|
76
|
+
return [launcher.executable, '-a', 'Terminal', script];
|
|
77
|
+
}
|
|
78
|
+
export function start(argv, cwd, env) {
|
|
79
|
+
const child = spawn(argv[0], argv.slice(1), { cwd, env, stdio: ['ignore', 'pipe', 'pipe'], windowsHide: true });
|
|
80
|
+
let error = null, bytes = 0, detail = '';
|
|
81
|
+
child.once('error', value => { error = value; });
|
|
82
|
+
for (const stream of [child.stdout, child.stderr])
|
|
83
|
+
stream.on('data', (chunk) => {
|
|
84
|
+
bytes += chunk.length;
|
|
85
|
+
if (detail.length < 2000)
|
|
86
|
+
detail += chunk.toString('utf8').slice(0, 2000 - detail.length);
|
|
87
|
+
if (bytes > 64 * 1024) {
|
|
88
|
+
error = new Error('Terminal launcher output exceeded 64 KiB');
|
|
89
|
+
child.kill('SIGKILL');
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const signalCode = () => child.signalCode ? 128 + ({ SIGINT: 2, SIGTERM: 15, SIGHUP: 1 }[child.signalCode] ?? 1) : null;
|
|
93
|
+
return { code: () => child.exitCode ?? signalCode(), error: () => error, stop: () => {
|
|
94
|
+
if (child.exitCode === null && child.signalCode === null)
|
|
95
|
+
child.kill('SIGTERM');
|
|
96
|
+
}, close: () => {
|
|
97
|
+
if (child.exitCode === null && child.signalCode === null)
|
|
98
|
+
child.kill('SIGKILL');
|
|
99
|
+
child.stdout.destroy();
|
|
100
|
+
child.stderr.destroy();
|
|
101
|
+
} };
|
|
102
|
+
}
|
|
103
|
+
export function windowsCommand(argv) {
|
|
104
|
+
if (argv.some(value => value.includes('\0')))
|
|
105
|
+
throw new Error('NUL in Windows argument');
|
|
106
|
+
return argv.map(value => '"' + value.replace(/(\\*)"/gu, '$1$1\\"').replace(/(\\+)$/u, '$1$1') + '"').join(' ');
|
|
107
|
+
}
|
|
108
|
+
/** CREATE_NEW_CONSOLE binds real console handles and never executes an npm .cmd shim. */
|
|
109
|
+
export function startWindows(argv, cwd, env) {
|
|
110
|
+
if (process.platform !== 'win32' || process.arch !== 'x64')
|
|
111
|
+
throw new Error('Windows x64 console required');
|
|
112
|
+
const k = library('kernel32.dll'), line = Buffer.from(windowsCommand(argv) + '\0', 'utf16le');
|
|
113
|
+
const variables = new Map();
|
|
114
|
+
for (const [key, value] of Object.entries(env))
|
|
115
|
+
if (value !== undefined) {
|
|
116
|
+
if (/[=\0]/u.test(key) || value.includes('\0'))
|
|
117
|
+
throw new Error('Invalid Windows environment');
|
|
118
|
+
variables.set(key.toUpperCase(), [key, value]);
|
|
119
|
+
}
|
|
120
|
+
const block = Buffer.from([...variables].sort(([a], [b]) => a.localeCompare(b, 'en')).map(([, [key, value]]) => `${key}=${value}`).join('\0') + '\0\0', 'utf16le');
|
|
121
|
+
const startup = Buffer.alloc(104);
|
|
122
|
+
startup.writeUInt32LE(104);
|
|
123
|
+
const info = Buffer.alloc(24);
|
|
124
|
+
if (!k.func('bool CreateProcessW(const char16_t *app, void *command, void *processSecurity, void *threadSecurity, bool inherit, uint32_t flags, void *environment, const char16_t *cwd, void *startup, _Out_ void *info)')(argv[0], line, null, null, false, 0x410, block, cwd, startup, info))
|
|
125
|
+
throw winError('CreateProcessW');
|
|
126
|
+
const handle = nativeApi().decode(info, 'void *'), thread = nativeApi().decode(info.subarray(8), 'void *');
|
|
127
|
+
let closed = false;
|
|
128
|
+
const code = () => {
|
|
129
|
+
if (closed)
|
|
130
|
+
return null;
|
|
131
|
+
const values = [0];
|
|
132
|
+
if (!k.func('bool GetExitCodeProcess(void *handle, _Out_ uint32_t *code)')(handle, values))
|
|
133
|
+
throw winError('GetExitCodeProcess');
|
|
134
|
+
return values[0] === 259 ? null : values[0];
|
|
135
|
+
};
|
|
136
|
+
const stop = () => {
|
|
137
|
+
if (closed || code() !== null)
|
|
138
|
+
return;
|
|
139
|
+
if (!k.func('bool TerminateProcess(void *handle, uint32_t exit)')(handle, 1))
|
|
140
|
+
throw winError('TerminateProcess');
|
|
141
|
+
if (k.func('uint32_t WaitForSingleObject(void *handle, uint32_t timeout)')(handle, 5000) !== 0)
|
|
142
|
+
throw new Error('Console child termination could not be confirmed');
|
|
143
|
+
};
|
|
144
|
+
return { code, error: () => null, stop, close: () => {
|
|
145
|
+
if (!closed) {
|
|
146
|
+
try {
|
|
147
|
+
stop();
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
k.func('bool CloseHandle(void *handle)')(thread);
|
|
151
|
+
k.func('bool CloseHandle(void *handle)')(handle);
|
|
152
|
+
closed = true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} };
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=launchers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launchers.js","sourceRoot":"","sources":["../../../src/terminal/launchers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAgB,MAAM,aAAa,CAAC;AAgB/G,MAAM,UAAU,KAAK,CAAC,GAAsB;IACxC,OAAO;QACH,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE;YAAG,IAAI,CAAC;gBACvD,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;YAC3C,CAAC;YACD,MAAM,CAAC;gBACH,OAAO,KAAK,CAAC;YACjB,CAAC;QAAC,CAAC;QACH,UAAU,EAAE,IAAI,CAAC,EAAE;YAAG,IAAI,CAAC;gBACvB,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AE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE;YAAG,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC7D,IAAI,CAAC;oBACD,IAAI,EAAE,CAAC;gBACX,CAAC;wBACO,CAAC;oBACL,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,MAAM,CAAC,CAAC;oBACjD,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,MAAM,CAAC,CAAC;oBACjD,MAAM,GAAG,IAAI,CAAC;gBAClB,CAAC;YACL,CAAC;QAAC,CAAC,EAAE,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReadStream, WriteStream } from 'node:tty';
|
|
2
|
+
import { type Key } from './input.js';
|
|
3
|
+
export interface TerminalClient<T> {
|
|
4
|
+
draw(columns: number, rows: number): string;
|
|
5
|
+
key(key: Key, columns: number, rows: number): T | null | Promise<T | null>;
|
|
6
|
+
interrupted(signal: NodeJS.Signals): T;
|
|
7
|
+
timeout(): T;
|
|
8
|
+
guard?(): void;
|
|
9
|
+
}
|
|
10
|
+
export interface TerminalOptions {
|
|
11
|
+
input?: ReadStream;
|
|
12
|
+
output?: WriteStream;
|
|
13
|
+
deadline?: number;
|
|
14
|
+
now?: () => number;
|
|
15
|
+
term?: string;
|
|
16
|
+
}
|
|
17
|
+
/** The sole raw-mode owner. Exit handlers never leave a queued read keeping Node alive. */
|
|
18
|
+
export declare function terminal<T>(client: TerminalClient<T>, options?: TerminalOptions): Promise<T>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { KeyDecoder } from './input.js';
|
|
2
|
+
import { captureWindowsModes } from './windows-modes.js';
|
|
3
|
+
/** The sole raw-mode owner. Exit handlers never leave a queued read keeping Node alive. */
|
|
4
|
+
export async function terminal(client, options = {}) {
|
|
5
|
+
const input = options.input ?? process.stdin, output = options.output ?? process.stdout;
|
|
6
|
+
if (!input.isTTY || !output.isTTY || typeof input.setRawMode !== 'function')
|
|
7
|
+
throw new Error('TTY required');
|
|
8
|
+
if (process.platform !== 'win32' && (options.term ?? process.env.TERM) === 'dumb')
|
|
9
|
+
throw new Error('Interactive configuration requires an ANSI/VT terminal');
|
|
10
|
+
const now = options.now ?? (() => performance.now()), decoder = new KeyDecoder();
|
|
11
|
+
const raw = input.isRaw, flowing = input.readableFlowing;
|
|
12
|
+
const restoreConsoleModes = captureWindowsModes(input === process.stdin, output === process.stdout);
|
|
13
|
+
let escapeTimer, poll;
|
|
14
|
+
let closed = false, queued = 0, chain = Promise.resolve(), drainWait = null;
|
|
15
|
+
const size = () => [output.columns || 80, output.rows || 24];
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
const cleanup = () => {
|
|
18
|
+
if (closed)
|
|
19
|
+
return;
|
|
20
|
+
closed = true;
|
|
21
|
+
clearTimeout(escapeTimer);
|
|
22
|
+
clearInterval(poll);
|
|
23
|
+
drainWait?.();
|
|
24
|
+
input.off('data', data);
|
|
25
|
+
input.off('error', failed);
|
|
26
|
+
input.off('end', ended);
|
|
27
|
+
output.off('resize', resize);
|
|
28
|
+
output.off('error', failed);
|
|
29
|
+
for (const [signal, handler] of handlers)
|
|
30
|
+
process.off(signal, handler);
|
|
31
|
+
try {
|
|
32
|
+
input.setRawMode(raw);
|
|
33
|
+
}
|
|
34
|
+
catch { /* Continue restoring output even when input disappeared. */ }
|
|
35
|
+
input.pause();
|
|
36
|
+
if (input === process.stdin)
|
|
37
|
+
input.destroy();
|
|
38
|
+
else if (flowing === true)
|
|
39
|
+
input.resume();
|
|
40
|
+
try {
|
|
41
|
+
output.write('\x1b[0m\x1b[?2004l\x1b[?25h\x1b[?1049l');
|
|
42
|
+
}
|
|
43
|
+
catch { /* A closed terminal cannot receive restoration bytes. */ }
|
|
44
|
+
try {
|
|
45
|
+
restoreConsoleModes();
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
return error;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const finish = (value) => { const error = cleanup(); error ? reject(error) : resolve(value); };
|
|
52
|
+
const failed = (error) => { const restoration = cleanup(); reject(restoration ? new AggregateError([error, restoration], 'Terminal cleanup failed') : error); };
|
|
53
|
+
const ended = () => finish(client.interrupted('SIGHUP'));
|
|
54
|
+
const draw = async () => {
|
|
55
|
+
if (closed)
|
|
56
|
+
return;
|
|
57
|
+
try {
|
|
58
|
+
const content = client.draw(...size());
|
|
59
|
+
await new Promise(resolve => {
|
|
60
|
+
const done = () => {
|
|
61
|
+
output.off('drain', done);
|
|
62
|
+
if (drainWait === done)
|
|
63
|
+
drainWait = null;
|
|
64
|
+
resolve();
|
|
65
|
+
};
|
|
66
|
+
drainWait = done;
|
|
67
|
+
if (output.write(content))
|
|
68
|
+
done();
|
|
69
|
+
else
|
|
70
|
+
output.once('drain', done);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
failed(error);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const enqueue = (keys) => {
|
|
78
|
+
if (!keys.length || closed)
|
|
79
|
+
return;
|
|
80
|
+
if (queued + keys.length > 4096) {
|
|
81
|
+
failed(new Error('Terminal input queue exceeded its bound'));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
queued += keys.length;
|
|
85
|
+
chain = chain.then(async () => {
|
|
86
|
+
for (const key of keys) {
|
|
87
|
+
queued--;
|
|
88
|
+
if (closed)
|
|
89
|
+
return;
|
|
90
|
+
client.guard?.();
|
|
91
|
+
if (options.deadline !== undefined && now() >= options.deadline) {
|
|
92
|
+
finish(client.timeout());
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const value = await client.key(key, ...size());
|
|
96
|
+
if (closed)
|
|
97
|
+
return;
|
|
98
|
+
if (value !== null) {
|
|
99
|
+
finish(value);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
await draw();
|
|
104
|
+
}).catch(failed);
|
|
105
|
+
};
|
|
106
|
+
const data = (chunk) => {
|
|
107
|
+
if (closed)
|
|
108
|
+
return;
|
|
109
|
+
clearTimeout(escapeTimer);
|
|
110
|
+
enqueue(decoder.push(chunk));
|
|
111
|
+
if (decoder.pendingEscape)
|
|
112
|
+
escapeTimer = setTimeout(() => enqueue(decoder.flushEscape()), 25);
|
|
113
|
+
};
|
|
114
|
+
const resize = () => enqueue([{ key: 'resize' }]);
|
|
115
|
+
const signals = process.platform === 'win32' ? ['SIGINT', 'SIGTERM', 'SIGBREAK'] : ['SIGINT', 'SIGTERM', 'SIGHUP'];
|
|
116
|
+
const handlers = signals.map(signal => [signal, () => finish(client.interrupted(signal))]);
|
|
117
|
+
try {
|
|
118
|
+
client.guard?.();
|
|
119
|
+
input.setRawMode(true);
|
|
120
|
+
input.on('data', data);
|
|
121
|
+
input.on('error', failed);
|
|
122
|
+
input.on('end', ended);
|
|
123
|
+
output.on('resize', resize);
|
|
124
|
+
output.on('error', failed);
|
|
125
|
+
for (const [signal, handler] of handlers)
|
|
126
|
+
process.on(signal, handler);
|
|
127
|
+
output.write('\x1b[?1049h\x1b[?25l\x1b[?2004h');
|
|
128
|
+
chain = draw();
|
|
129
|
+
if (closed)
|
|
130
|
+
return;
|
|
131
|
+
input.resume();
|
|
132
|
+
poll = setInterval(() => {
|
|
133
|
+
if (closed)
|
|
134
|
+
return;
|
|
135
|
+
try {
|
|
136
|
+
client.guard?.();
|
|
137
|
+
if (options.deadline !== undefined && now() >= options.deadline)
|
|
138
|
+
finish(client.timeout());
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
failed(error);
|
|
142
|
+
}
|
|
143
|
+
}, 250);
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
failed(error);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1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M,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC3B,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,QAAQ;gBACpC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YAChD,KAAK,GAAG,IAAI,EAAE,CAAC;YACf,IAAI,MAAM;gBACN,OAAO;YACX,KAAK,CAAC,MAAM,EAAE,CAAC;YACf,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE;gBACpB,IAAI,MAAM;oBACN,OAAO;gBACX,IAAI,CAAC;oBACD,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;oBACjB,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,GAAG,EAAE,IAAI,OAAO,CAAC,QAAQ;wBAC3D,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;gBACjC,CAAC;gBACD,OAAO,KAAK,EAAE,CAAC;oBACX,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;YACL,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** libuv's normal mode is a fixed mask, not the caller's complete console mode.
|
|
2
|
+
* Restore the original standard-handle masks after Node stops raw input.
|
|
3
|
+
* https://learn.microsoft.com/en-us/windows/console/setconsolemode
|
|
4
|
+
* https://github.com/libuv/libuv/blob/v1.51.0/src/win/tty.c#L341
|
|
5
|
+
*/
|
|
6
|
+
export declare function captureWindowsModes(standardInput: boolean, standardOutput: boolean): () => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { nativeFunction, winError } from '../native.js';
|
|
2
|
+
/** libuv's normal mode is a fixed mask, not the caller's complete console mode.
|
|
3
|
+
* Restore the original standard-handle masks after Node stops raw input.
|
|
4
|
+
* https://learn.microsoft.com/en-us/windows/console/setconsolemode
|
|
5
|
+
* https://github.com/libuv/libuv/blob/v1.51.0/src/win/tty.c#L341
|
|
6
|
+
*/
|
|
7
|
+
export function captureWindowsModes(standardInput, standardOutput) {
|
|
8
|
+
if (process.platform !== 'win32' || !standardInput || !standardOutput)
|
|
9
|
+
return () => { };
|
|
10
|
+
const getHandle = nativeFunction('kernel32.dll', 'void *GetStdHandle(uint32_t kind)');
|
|
11
|
+
const getMode = nativeFunction('kernel32.dll', 'bool GetConsoleMode(void *handle, _Out_ uint32_t *mode)');
|
|
12
|
+
const setMode = nativeFunction('kernel32.dll', 'bool SetConsoleMode(void *handle, uint32_t mode)');
|
|
13
|
+
const snapshots = [0xfffffff6, 0xfffffff5].map(kind => {
|
|
14
|
+
const handle = getHandle(kind), mode = [0];
|
|
15
|
+
if (!getMode(handle, mode))
|
|
16
|
+
throw winError('GetConsoleMode');
|
|
17
|
+
return { handle, mode: mode[0] };
|
|
18
|
+
});
|
|
19
|
+
return () => {
|
|
20
|
+
let failure;
|
|
21
|
+
for (const saved of snapshots) {
|
|
22
|
+
try {
|
|
23
|
+
if (!setMode(saved.handle, saved.mode))
|
|
24
|
+
throw winError('SetConsoleMode');
|
|
25
|
+
const actual = [0];
|
|
26
|
+
if (!getMode(saved.handle, actual))
|
|
27
|
+
throw winError('GetConsoleMode');
|
|
28
|
+
if (actual[0] !== saved.mode)
|
|
29
|
+
throw new Error('Console mode restoration did not match its original flags');
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
failure ??= error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (failure)
|
|
36
|
+
throw failure;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=windows-modes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-modes.js","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EAAE,MAAM,CAAC;oBAC9B,MAAM,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBACrC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI;oBACxB,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;YACrF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAAC,OAAO,KAAK,KAAK,CAAC;YAAC,CAAC;QAC1C,CAAC;QACD,IAAI,OAAO;YAAE,MAAM,OAAO,CAAC;IAC/B,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Fatal UTF-8 decoding with Python-compatible public error descriptions. */
|
|
2
|
+
export declare function decodeUtf8(raw: Uint8Array): string;
|
|
3
|
+
export declare function decodeUtf8Sig(raw: Uint8Array): string;
|
|
4
|
+
/** json.loads(bytes) detects UTF-8/16/32; text-mode legacy readers stay UTF-8. */
|
|
5
|
+
export declare function decodeJsonBytes(raw: Uint8Array): string;
|