@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,176 @@
|
|
|
1
|
+
import { graphemes, displayWidth as plainWidth, clusterWidth, cellWidth } from '../unicode/index.js';
|
|
2
|
+
import * as styles from './styles.js';
|
|
3
|
+
export const MIN_CONTENT_WIDTH = 2, DEFAULT_TERMINAL_COLUMNS = 120, STATUSLINE_WIDTH_MARGIN = 2;
|
|
4
|
+
export const ANSI_SGR_RE = styles.SGR_RE;
|
|
5
|
+
export function strip(text) { return text.replace(ANSI_SGR_RE, ''); }
|
|
6
|
+
export function displayWidth(text) { return plainWidth(strip(text ?? '')); }
|
|
7
|
+
export function styledUnits(text) {
|
|
8
|
+
let state = styles.DEFAULT, position = 0;
|
|
9
|
+
const plain = [], states = [];
|
|
10
|
+
const append = (part) => {
|
|
11
|
+
const sgr = styles.serialize(state);
|
|
12
|
+
for (const char of part) {
|
|
13
|
+
plain.push(char);
|
|
14
|
+
states.push(sgr);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
for (const match of text.matchAll(ANSI_SGR_RE)) {
|
|
18
|
+
append(text.slice(position, match.index));
|
|
19
|
+
state = styles.advance(state, match[0]);
|
|
20
|
+
position = match.index + match[0].length;
|
|
21
|
+
}
|
|
22
|
+
append(text.slice(position));
|
|
23
|
+
const visible = plain.join('');
|
|
24
|
+
if (/^[\x20-\x7e]*$/u.test(visible))
|
|
25
|
+
return plain.map((text, i) => ({ text, width: 1, style: states[i] }));
|
|
26
|
+
const result = [];
|
|
27
|
+
position = 0;
|
|
28
|
+
for (const cluster of graphemes(visible)) {
|
|
29
|
+
const chars = [...cluster], base = Math.max(0, chars.findIndex(c => cellWidth(c) !== 0));
|
|
30
|
+
result.push({ text: cluster, width: clusterWidth(cluster), style: states[position + base] });
|
|
31
|
+
position += chars.length;
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
export function renderStyledUnits(units) {
|
|
36
|
+
const output = [];
|
|
37
|
+
let active = '';
|
|
38
|
+
for (const unit of units) {
|
|
39
|
+
if (unit.style !== active) {
|
|
40
|
+
if (active)
|
|
41
|
+
output.push(styles.RESET);
|
|
42
|
+
if (unit.style)
|
|
43
|
+
output.push(unit.style);
|
|
44
|
+
active = unit.style;
|
|
45
|
+
}
|
|
46
|
+
output.push(unit.text);
|
|
47
|
+
}
|
|
48
|
+
if (active)
|
|
49
|
+
output.push(styles.RESET);
|
|
50
|
+
return output.join('');
|
|
51
|
+
}
|
|
52
|
+
export function truncateStyled(text, width, ellipsis = '…') {
|
|
53
|
+
width = Math.max(0, Math.trunc(width));
|
|
54
|
+
if (!width)
|
|
55
|
+
return '';
|
|
56
|
+
const source = styledUnits(text);
|
|
57
|
+
if (source.reduce((n, u) => n + u.width, 0) <= width)
|
|
58
|
+
return renderStyledUnits(source);
|
|
59
|
+
let suffix = displayWidth(ellipsis);
|
|
60
|
+
if (suffix > width) {
|
|
61
|
+
ellipsis = '';
|
|
62
|
+
suffix = 0;
|
|
63
|
+
}
|
|
64
|
+
const units = [];
|
|
65
|
+
let used = 0;
|
|
66
|
+
for (const unit of source) {
|
|
67
|
+
if (used + unit.width > width - suffix)
|
|
68
|
+
break;
|
|
69
|
+
units.push(unit);
|
|
70
|
+
used += unit.width;
|
|
71
|
+
}
|
|
72
|
+
if (ellipsis)
|
|
73
|
+
units.push({ text: ellipsis, width: suffix, style: units.at(-1)?.style ?? '' });
|
|
74
|
+
return renderStyledUnits(units);
|
|
75
|
+
}
|
|
76
|
+
export function splitAnsiText(text, width, preferSlashes = false) {
|
|
77
|
+
width = Math.max(MIN_CONTENT_WIDTH, Math.trunc(width));
|
|
78
|
+
let units = styledUnits(text);
|
|
79
|
+
if (units.reduce((n, u) => n + u.width, 0) <= width)
|
|
80
|
+
return [renderStyledUnits(units)];
|
|
81
|
+
if (!units.length)
|
|
82
|
+
return [text];
|
|
83
|
+
units = units.map(u => u.width <= width ? u : { ...u, text: '…', width: 1 });
|
|
84
|
+
const chunks = [];
|
|
85
|
+
let start = 0;
|
|
86
|
+
while (start < units.length) {
|
|
87
|
+
let used = 0, end = start;
|
|
88
|
+
while (end < units.length) {
|
|
89
|
+
const next = units[end].width;
|
|
90
|
+
if (end > start && used + next > width)
|
|
91
|
+
break;
|
|
92
|
+
if (end === start && next > width) {
|
|
93
|
+
end++;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
used += next;
|
|
97
|
+
end++;
|
|
98
|
+
}
|
|
99
|
+
if (end >= units.length) {
|
|
100
|
+
chunks.push(renderStyledUnits(units.slice(start)));
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
if (preferSlashes) {
|
|
104
|
+
let slash = null;
|
|
105
|
+
for (let i = start + 1; i < end; i++)
|
|
106
|
+
if (/^[/\\]/u.test(units[i].text))
|
|
107
|
+
slash = i;
|
|
108
|
+
if (slash !== null)
|
|
109
|
+
end = slash;
|
|
110
|
+
}
|
|
111
|
+
if (end <= start)
|
|
112
|
+
end = start + 1;
|
|
113
|
+
chunks.push(renderStyledUnits(units.slice(start, end)));
|
|
114
|
+
start = end;
|
|
115
|
+
}
|
|
116
|
+
return chunks;
|
|
117
|
+
}
|
|
118
|
+
export function ensureReset(text, reset = styles.RESET) {
|
|
119
|
+
if (!reset)
|
|
120
|
+
return text;
|
|
121
|
+
const plain = strip(text);
|
|
122
|
+
if (!/^[\x20-\x7e]*$/u.test(plain)) {
|
|
123
|
+
const boundaries = new Set([0]);
|
|
124
|
+
let offset = 0;
|
|
125
|
+
for (const cluster of graphemes(plain)) {
|
|
126
|
+
offset += cluster.length;
|
|
127
|
+
boundaries.add(offset);
|
|
128
|
+
}
|
|
129
|
+
let removed = 0;
|
|
130
|
+
for (const match of text.matchAll(ANSI_SGR_RE)) {
|
|
131
|
+
if (!boundaries.has(match.index - removed)) {
|
|
132
|
+
text = renderStyledUnits(styledUnits(text));
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
removed += match[0].length;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return text.endsWith(reset) ? text : text + reset;
|
|
139
|
+
}
|
|
140
|
+
export function layoutSegments(segments, width, separator = '\x1b[90m | \x1b[0m', reset = styles.RESET) {
|
|
141
|
+
width = Math.max(MIN_CONTENT_WIDTH, Math.trunc(width));
|
|
142
|
+
const separatorWidth = displayWidth(separator), rows = [];
|
|
143
|
+
let current = '', currentWidth = 0;
|
|
144
|
+
for (const value of segments) {
|
|
145
|
+
const segment = typeof value === 'string' ? { text: value } : value;
|
|
146
|
+
if (!segment.text)
|
|
147
|
+
continue;
|
|
148
|
+
const size = displayWidth(segment.text);
|
|
149
|
+
if (size <= width) {
|
|
150
|
+
if (current && currentWidth + separatorWidth + size <= width) {
|
|
151
|
+
current += separator + segment.text;
|
|
152
|
+
currentWidth += separatorWidth + size;
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
if (current)
|
|
156
|
+
rows.push(ensureReset(current, reset));
|
|
157
|
+
current = segment.text;
|
|
158
|
+
currentWidth = size;
|
|
159
|
+
}
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (current) {
|
|
163
|
+
rows.push(ensureReset(current, reset));
|
|
164
|
+
current = '';
|
|
165
|
+
currentWidth = 0;
|
|
166
|
+
}
|
|
167
|
+
const chunks = splitAnsiText(segment.text, width, segment.prefer_slash_breaks);
|
|
168
|
+
rows.push(...chunks.slice(0, -1).map(chunk => ensureReset(chunk, reset)));
|
|
169
|
+
current = chunks.at(-1);
|
|
170
|
+
currentWidth = displayWidth(current);
|
|
171
|
+
}
|
|
172
|
+
if (current)
|
|
173
|
+
rows.push(ensureReset(current, reset));
|
|
174
|
+
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C;YACvC,OAAO,GAAG,EAAE,CAAC;YACb,YAAY,GAAG,CAAC,CAAC;QACrB,CAAC;QACD,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAC/E,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1E,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC;QACzB,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,IAAI,OAAO;QACP,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAC3C,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Data } from '../runtime/values.js';
|
|
2
|
+
import type { FormattingDraft } from '../contracts/ui.js';
|
|
3
|
+
import type { Presentation } from './language.js';
|
|
4
|
+
export declare function metric(points: Data, item: string, fmt: FormattingDraft, language: Presentation): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { object, truth, numeric, string } from '../runtime/values.js';
|
|
2
|
+
import { fixed } from '../numbers.js';
|
|
3
|
+
import { general, grouped } from './numeric-format.js';
|
|
4
|
+
import { number } from './preferences.js';
|
|
5
|
+
export function metric(points, item, fmt, language) {
|
|
6
|
+
const record = object(points[item]) ? points[item] : {};
|
|
7
|
+
let value = record.value ?? null;
|
|
8
|
+
const suffix = truth(record.partial) ? '*' : '';
|
|
9
|
+
if (value === null)
|
|
10
|
+
value = '—';
|
|
11
|
+
else if (['active-agents', 'prompt-input-tokens', 'prompt-output-tokens'].includes(item))
|
|
12
|
+
value = number(value, fmt);
|
|
13
|
+
else if (item === 'task-progress' && object(value))
|
|
14
|
+
value = string(value.completed) + '/' + string(value.total);
|
|
15
|
+
else if (item === 'last-tool' && object(value))
|
|
16
|
+
value = string(value.name) + ' ' + string(language.value('tool', value.status));
|
|
17
|
+
else if (item === 'run-state' || item === 'permission-mode')
|
|
18
|
+
value = language.value(item === 'run-state' ? 'run' : 'permission', value);
|
|
19
|
+
else if (item === 'ttft')
|
|
20
|
+
value = fixed(numeric(value), 3) + 's';
|
|
21
|
+
else if (item === 'output-rate')
|
|
22
|
+
value = general(numeric(value), 3) + ' tok/s';
|
|
23
|
+
else if (item === 'prompt-cost') {
|
|
24
|
+
const cost = numeric(value);
|
|
25
|
+
value = '$' + (cost > 0 && cost < .0001 ? general(cost, 6) : fmt.number_format === 'grouped' ? grouped(fixed(cost, 4)) : fixed(cost, 4));
|
|
26
|
+
}
|
|
27
|
+
return language.text('live.label.' + item) + ' ' + string(value) + suffix;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=live.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.js","sourceRoot":"","sources":["../../../src/rendering/live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAa,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,UAAU,MAAM,CAAC,MAAY,EAAE,IAAY,EAAE,GAAoB,EAAE,QAAsB;IAC3F,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,IAAI,KAAK,GAAY,MAAM,CA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B,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAE,CAAC;QAC7B,KAAK,GAAG,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7I,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FormattingDraft } from '../contracts/ui.js';
|
|
2
|
+
import type { Presentation } from './language.js';
|
|
3
|
+
export declare function finiteNumber(value: unknown): number | null;
|
|
4
|
+
export declare function tokenCount(value: unknown): bigint | null;
|
|
5
|
+
export declare function tokenRatio(used: unknown, capacity: unknown, language: Presentation, fmt?: FormattingDraft): string | null;
|
|
6
|
+
export declare function contextTokens(context: unknown, language: Presentation, fmt?: FormattingDraft): string | null;
|
|
7
|
+
export declare function modelName(data: unknown): string | null;
|
|
8
|
+
export declare function effortText(value: unknown): string | null;
|
|
9
|
+
export declare function liveRateWindow(data: unknown, field: string, now: number): Record<string, unknown> | null;
|
|
10
|
+
export declare function countdown(value: unknown, now: number): string | null;
|
|
11
|
+
export declare function sessionMetric(cost: unknown, item: string, fmt: FormattingDraft, language: Presentation): string | null;
|
|
12
|
+
export declare function cacheMetric(cache: unknown, item: string, now: number, fmt: FormattingDraft, language: Presentation): string | null;
|
|
13
|
+
export declare function spendMetric(window: unknown, item: string, fmt: FormattingDraft, language: Presentation): string | null;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { int, numeric, object, string } from '../runtime/values.js';
|
|
2
|
+
import { DEFAULT_FORMATTING } from '../config/defaults.js';
|
|
3
|
+
import * as formatters from './formatters.js';
|
|
4
|
+
import * as preferences from './preferences.js';
|
|
5
|
+
import { general } from './numeric-format.js';
|
|
6
|
+
export function finiteNumber(value) { const number = numeric(value); return number !== null && Number.isFinite(number) && number >= 0 ? number : null; }
|
|
7
|
+
export function tokenCount(value) { const n = int(value); return n !== null && finiteNumber(value) !== null ? n : null; }
|
|
8
|
+
export function tokenRatio(used, capacity, language, fmt = DEFAULT_FORMATTING) {
|
|
9
|
+
const count = tokenCount(used), window = tokenCount(capacity);
|
|
10
|
+
return count === null || window === null || window === 0n ? null : language.text('context.tokens', { count: preferences.number(count, fmt), window: preferences.number(window, fmt) });
|
|
11
|
+
}
|
|
12
|
+
export function contextTokens(context, language, fmt = DEFAULT_FORMATTING) {
|
|
13
|
+
if (!object(context))
|
|
14
|
+
return null;
|
|
15
|
+
let count;
|
|
16
|
+
if (Object.hasOwn(context, 'current_usage')) {
|
|
17
|
+
const usage = context.current_usage;
|
|
18
|
+
if (!object(usage))
|
|
19
|
+
return null;
|
|
20
|
+
const parts = ['input_tokens', 'cache_creation_input_tokens', 'cache_read_input_tokens'].map(field => tokenCount(usage[field]));
|
|
21
|
+
if (parts.some(v => v === null))
|
|
22
|
+
return null;
|
|
23
|
+
count = parts.reduce((n, v) => n + v, 0n);
|
|
24
|
+
}
|
|
25
|
+
else
|
|
26
|
+
count = tokenCount(context.total_input_tokens);
|
|
27
|
+
return tokenRatio(count, context.context_window_size, language, fmt);
|
|
28
|
+
}
|
|
29
|
+
export function modelName(data) { return formatters.sanitizePayloadText(formatters.deepGet(data, ['model', 'id'])) || formatters.sanitizePayloadText(formatters.deepGet(data, ['model', 'display_name'])); }
|
|
30
|
+
export function effortText(value) {
|
|
31
|
+
if (typeof value === 'string')
|
|
32
|
+
return formatters.sanitizePayloadText(value);
|
|
33
|
+
const number = finiteNumber(value);
|
|
34
|
+
return number === null ? null : int(value) === null ? general(number) : string(value);
|
|
35
|
+
}
|
|
36
|
+
export function liveRateWindow(data, field, now) {
|
|
37
|
+
const window = formatters.deepGet(data, ['rate_limits', field]);
|
|
38
|
+
if (!object(window))
|
|
39
|
+
return null;
|
|
40
|
+
if (Object.hasOwn(window, 'resets_at')) {
|
|
41
|
+
const reset = finiteNumber(window.resets_at);
|
|
42
|
+
if (reset === null || reset <= now)
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return window;
|
|
46
|
+
}
|
|
47
|
+
export function countdown(value, now) {
|
|
48
|
+
const expires = finiteNumber(value);
|
|
49
|
+
if (expires === null || expires <= now)
|
|
50
|
+
return null;
|
|
51
|
+
const seconds = BigInt(Math.ceil(expires - now));
|
|
52
|
+
return seconds >= 86400n ? `${seconds / 86400n}d ${seconds % 86400n / 3600n}h` : seconds >= 3600n ? `${seconds / 3600n}h ${seconds % 3600n / 60n}m` : seconds >= 60n ? `${seconds / 60n}m ${seconds % 60n}s` : `${seconds}s`;
|
|
53
|
+
}
|
|
54
|
+
export function sessionMetric(cost, item, fmt, language) {
|
|
55
|
+
if (!object(cost))
|
|
56
|
+
return null;
|
|
57
|
+
if (item === 'lines-changed') {
|
|
58
|
+
const added = tokenCount(cost.total_lines_added), removed = tokenCount(cost.total_lines_removed);
|
|
59
|
+
return added === null || removed === null ? null : `+${preferences.number(added, fmt, string)}/-${preferences.number(removed, fmt, string)}`;
|
|
60
|
+
}
|
|
61
|
+
const fields = { 'session-cost': 'total_cost_usd', 'session-duration': 'total_duration_ms', 'api-duration': 'total_api_duration_ms' }, number = finiteNumber(cost[fields[item]]);
|
|
62
|
+
if (number === null)
|
|
63
|
+
return null;
|
|
64
|
+
return item === 'session-cost' ? language.text('cost.session', { value: preferences.money(number, fmt) }) : language.text(item === 'session-duration' ? 'duration.session' : 'duration.api', { value: formatters.formatDuration(number / 1000) });
|
|
65
|
+
}
|
|
66
|
+
export function cacheMetric(cache, item, now, fmt, language) {
|
|
67
|
+
if (!object(cache))
|
|
68
|
+
return null;
|
|
69
|
+
if (item === 'cache-misses' || item === 'api-requests') {
|
|
70
|
+
const count = tokenCount(cache[item === 'cache-misses' ? 'misses' : 'requests']);
|
|
71
|
+
return count === null ? null : language.text(item === 'cache-misses' ? 'cache.misses' : 'api.requests', { value: preferences.number(count, fmt, string) });
|
|
72
|
+
}
|
|
73
|
+
if (cache.caching_observed === false)
|
|
74
|
+
return item === 'cache-state' ? language.text('cache.unobserved') : null;
|
|
75
|
+
if (cache.warm === false)
|
|
76
|
+
return item === 'cache-state' ? language.text('cache.cold') : null;
|
|
77
|
+
if (cache.warm !== true)
|
|
78
|
+
return null;
|
|
79
|
+
const expires = finiteNumber(cache.expires_at);
|
|
80
|
+
if (expires === null)
|
|
81
|
+
return null;
|
|
82
|
+
const remaining = countdown(expires, now);
|
|
83
|
+
return item === 'cache-state' ? language.text(remaining ? 'cache.warm' : 'cache.cold') : remaining ? language.text('cache.ttl', { value: remaining }) : null;
|
|
84
|
+
}
|
|
85
|
+
export function spendMetric(window, item, fmt, language) {
|
|
86
|
+
if (!object(window))
|
|
87
|
+
return null;
|
|
88
|
+
if (item === 'spend-period')
|
|
89
|
+
return typeof window.period === 'string' && ['daily', 'weekly', 'monthly'].includes(window.period) ? language.text('spend.period', { value: language.value('period', window.period) }) : null;
|
|
90
|
+
const used = finiteNumber(window.used_usd), limit = finiteNumber(window.limit_usd);
|
|
91
|
+
return used === null || limit === null ? null : language.text('spend.amount', { used: preferences.money(used, fmt), limit: preferences.money(limit, fmt) });
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/rendering/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,kBA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AAE,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAChK,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Python's general-format significant digits, rounded from the exact binary64. */
|
|
2
|
+
export function general(value, precision = 6) {
|
|
3
|
+
if (!Number.isFinite(value) || !Number.isSafeInteger(precision) || precision < 1 || precision > 20)
|
|
4
|
+
throw new RangeError('Invalid general format');
|
|
5
|
+
const negative = value < 0 || Object.is(value, -0), sign = negative ? '-' : '', absolute = Math.abs(value);
|
|
6
|
+
if (absolute === 0)
|
|
7
|
+
return sign + '0';
|
|
8
|
+
const view = new DataView(new ArrayBuffer(8));
|
|
9
|
+
view.setFloat64(0, absolute);
|
|
10
|
+
const bits = view.getBigUint64(0), binaryExponent = Number(bits >> 52n & 0x7ffn);
|
|
11
|
+
let numerator = (bits & 0xfffffffffffffn) + (binaryExponent ? 1n << 52n : 0n), denominator = 1n;
|
|
12
|
+
const shift = (binaryExponent || 1) - 1023 - 52;
|
|
13
|
+
if (shift >= 0)
|
|
14
|
+
numerator <<= BigInt(shift);
|
|
15
|
+
else
|
|
16
|
+
denominator <<= BigInt(-shift);
|
|
17
|
+
let exponent = Number(absolute.toExponential().split('e')[1]);
|
|
18
|
+
const atLeastPower = (power) => power >= 0 ? numerator >= denominator * 10n ** BigInt(power) : numerator * 10n ** BigInt(-power) >= denominator;
|
|
19
|
+
while (!atLeastPower(exponent))
|
|
20
|
+
exponent--;
|
|
21
|
+
while (atLeastPower(exponent + 1))
|
|
22
|
+
exponent++;
|
|
23
|
+
const places = precision - 1 - exponent;
|
|
24
|
+
if (places >= 0)
|
|
25
|
+
numerator *= 10n ** BigInt(places);
|
|
26
|
+
else
|
|
27
|
+
denominator *= 10n ** BigInt(-places);
|
|
28
|
+
let rounded = numerator / denominator;
|
|
29
|
+
const remainder = numerator % denominator;
|
|
30
|
+
if (2n * remainder > denominator || 2n * remainder === denominator && rounded % 2n !== 0n)
|
|
31
|
+
rounded++;
|
|
32
|
+
if (rounded >= 10n ** BigInt(precision)) {
|
|
33
|
+
rounded /= 10n;
|
|
34
|
+
exponent++;
|
|
35
|
+
}
|
|
36
|
+
const digits = String(rounded).padStart(precision, '0');
|
|
37
|
+
if (exponent < -4 || exponent >= precision) {
|
|
38
|
+
const fraction = digits.slice(1).replace(/0+$/u, '');
|
|
39
|
+
return sign + digits[0] + (fraction ? '.' + fraction : '') + 'e' + (exponent < 0 ? '-' : '+') + String(Math.abs(exponent)).padStart(2, '0');
|
|
40
|
+
}
|
|
41
|
+
const position = exponent + 1;
|
|
42
|
+
const text = position <= 0 ? '0.' + '0'.repeat(-position) + digits : digits.slice(0, position) + (position < digits.length ? '.' + digits.slice(position) : '');
|
|
43
|
+
return sign + (text.includes('.') ? text.replace(/0+$/u, '').replace(/\.$/u, '') : text);
|
|
44
|
+
}
|
|
45
|
+
export function grouped(value) { const [whole, fraction] = value.split('.'); return whole.replace(/\B(?=(?:\d{3})+(?!\d))/gu, ',') + (fraction === undefined ? '' : '.' + fraction); }
|
|
46
|
+
//# sourceMappingURL=numeric-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric-format.js","sourceRoot":"","sources":["../../../src/rendering/numeric-format.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,UAAU,OAAO,CAAC,KAAa,EAAE,SAAS,GAAG,CAAC;IAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,GAAG,EAAE;QAC9F,MAAM,IAAI,UAAU,CAAC,wBAAwB,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,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[90m \u00B7 \u001B[0m";
|
|
3
|
+
export interface Palette extends Record<string, string> {
|
|
4
|
+
reset: string;
|
|
5
|
+
model: string;
|
|
6
|
+
directory: string;
|
|
7
|
+
branch: string;
|
|
8
|
+
git_error: string;
|
|
9
|
+
percentage: string;
|
|
10
|
+
size: string;
|
|
11
|
+
tokens: string;
|
|
12
|
+
timer: string;
|
|
13
|
+
separator: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const DEFAULT: Palette;
|
|
16
|
+
export declare const ANSI: Palette;
|
|
17
|
+
export declare const NO_COLOR: Palette;
|
|
18
|
+
export declare function paletteFor(config: DisplayDraft): Palette;
|
|
19
|
+
export declare function styledSeparator(symbol: string, palette: Palette): string;
|
|
20
|
+
export declare function separators(config: DisplayDraft, palette: Palette): readonly [
|
|
21
|
+
string,
|
|
22
|
+
string
|
|
23
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { themedPalette } from './appearance.js';
|
|
2
|
+
export const RESET = '\x1b[0m', SEPARATOR = '\x1b[90m | \x1b[0m', JOIN = '\x1b[90m · \x1b[0m';
|
|
3
|
+
export const DEFAULT = { reset: RESET, model: '\x1b[1;38;2;246;226;183m', directory: '\x1b[1;38;2;171;223;167m', branch: '\x1b[1;38;2;200;169;238m', git_error: '\x1b[1;38;2;242;134;134m', percentage: '\x1b[1;38;2;242;181;144m', size: '\x1b[1;38;2;242;181;144m', tokens: '\x1b[1;38;2;233;144;169m', timer: '\x1b[1;38;2;142;211;211m', separator: '\x1b[90m' };
|
|
4
|
+
export const ANSI = { reset: RESET, model: '\x1b[1;33m', directory: '\x1b[1;32m', branch: '\x1b[1;35m', git_error: '\x1b[1;31m', percentage: '\x1b[1;33m', size: '\x1b[1;33m', tokens: '\x1b[1;35m', timer: '\x1b[1;36m', separator: '\x1b[90m' };
|
|
5
|
+
export const NO_COLOR = Object.fromEntries(Object.keys(DEFAULT).map(key => [key, '']));
|
|
6
|
+
export function paletteFor(config) { return !config.use_colors ? NO_COLOR : themedPalette(config.palette === 'ansi' ? ANSI : DEFAULT, config); }
|
|
7
|
+
export function styledSeparator(symbol, palette) { return palette.reset ? `${palette.separator} ${symbol} ${palette.reset}` : ` ${symbol} `; }
|
|
8
|
+
export function separators(config, palette) { return [styledSeparator(config.separator_style === 'compact' ? '·' : '|', palette), styledSeparator('·', palette)]; }
|
|
9
|
+
//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.js","sourceRoot":"","sources":["../../../src/rendering/palette.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,EAAE,SAAS,GAAG,oBAAoB,EAAE,IAAI,GAAG,oBAAoB,CAAC;AAa9F,MAAM,CAAC,MAAM,OAAO,GAAY,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,0BAA0B,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,EAAE,0BAA0B,EAAE,SAAS,EAAE,0BAA0B,EAAE,UAAU,EAAE,0BAA0B,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,0BAA0B,EAAE,KAAK,EAAE,0BAA0B,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAC9W,MAAM,CAAC,MAAM,IAAI,GAAY,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAC3P,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAY,CAAC;AAClG,MAAM,UAAU,UAAU,CAAC,MAAoB,IAAa,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AACvK,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,OAAgB,IAAY,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC;AACvK,MAAM,UAAU,UAAU,CAAC,MAAoB,EAAE,OAAgB,IAG7D,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DisplayDraft } from '../contracts/ui.js';
|
|
2
|
+
export interface Block {
|
|
3
|
+
text: string;
|
|
4
|
+
priority?: number;
|
|
5
|
+
prefer_slash_breaks?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function width(blocks: readonly Block[], padding?: number, cap?: boolean): number;
|
|
8
|
+
export declare function row(blocks: readonly Block[], config: DisplayDraft, padding?: number, cap?: boolean): string;
|
|
9
|
+
export declare function fit(values: readonly Block[], columns: number, config: DisplayDraft): string;
|
|
10
|
+
export declare function wrap(blocks: readonly Block[], columns: number, config: DisplayDraft): string[];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as styles from './styles.js';
|
|
2
|
+
import * as layout from './layout.js';
|
|
3
|
+
function edge(text, last = false) { const units = layout.styledUnits(text); return units.length ? styles.parse(units[last ? units.length - 1 : 0].style) : styles.DEFAULT; }
|
|
4
|
+
function separator(left, right, config) {
|
|
5
|
+
if (!config.use_colors)
|
|
6
|
+
return '>';
|
|
7
|
+
const a = edge(left, true), b = edge(right), arrow = config.powerline_glyph === 'powerline' && a.background !== null && !styles.sameColor(a.background, b.background);
|
|
8
|
+
return styles.serialize({ bold: false, foreground: arrow ? a.background : a.foreground, background: b.background }) + (arrow ? '\ue0b0' : '>') + styles.RESET;
|
|
9
|
+
}
|
|
10
|
+
export function width(blocks, padding = 1, cap = true) { return blocks.reduce((sum, b) => sum + layout.displayWidth(b.text) + 2 * padding, 0) + Math.max(0, blocks.length - 1) + Number(blocks.length > 0 && cap); }
|
|
11
|
+
export function row(blocks, config, padding = 1, cap = true) {
|
|
12
|
+
const result = [];
|
|
13
|
+
let previous = null;
|
|
14
|
+
for (const block of blocks) {
|
|
15
|
+
if (previous)
|
|
16
|
+
result.push(separator(previous.text, block.text, config));
|
|
17
|
+
if (padding) {
|
|
18
|
+
const left = styles.serialize(edge(block.text)) + ' '.repeat(padding) + (config.use_colors ? styles.RESET : ''), right = styles.serialize(edge(block.text, true)) + ' '.repeat(padding) + (config.use_colors ? styles.RESET : '');
|
|
19
|
+
result.push(left + block.text + right);
|
|
20
|
+
}
|
|
21
|
+
else
|
|
22
|
+
result.push(block.text);
|
|
23
|
+
previous = block;
|
|
24
|
+
}
|
|
25
|
+
if (blocks.length && cap)
|
|
26
|
+
result.push(separator(blocks.at(-1).text, '', config));
|
|
27
|
+
return layout.ensureReset(result.join(''), config.use_colors ? styles.RESET : '');
|
|
28
|
+
}
|
|
29
|
+
export function fit(values, columns, config) {
|
|
30
|
+
const blocks = [...values];
|
|
31
|
+
if (!blocks.length || columns < 1)
|
|
32
|
+
return '';
|
|
33
|
+
let padding = 1, cap = true;
|
|
34
|
+
if (width(blocks, padding, cap) > columns)
|
|
35
|
+
padding = 0;
|
|
36
|
+
if (width(blocks, padding, cap) > columns)
|
|
37
|
+
cap = false;
|
|
38
|
+
while (blocks.length > 1 && width(blocks, padding, cap) > columns) {
|
|
39
|
+
let victim = 0;
|
|
40
|
+
for (let i = 1; i < blocks.length; i++)
|
|
41
|
+
if ((blocks[i].priority ?? 50) <= (blocks[victim].priority ?? 50))
|
|
42
|
+
victim = i;
|
|
43
|
+
blocks.splice(victim, 1);
|
|
44
|
+
}
|
|
45
|
+
if (width(blocks, padding, cap) > columns)
|
|
46
|
+
blocks[0] = { ...blocks[0], text: layout.truncateStyled(blocks[0].text, columns) };
|
|
47
|
+
return row(blocks, config, padding, cap);
|
|
48
|
+
}
|
|
49
|
+
export function wrap(blocks, columns, config) {
|
|
50
|
+
columns = Math.max(2, columns);
|
|
51
|
+
const result = [];
|
|
52
|
+
let current = [], padding = columns >= 4 ? 1 : 0, cap = columns >= 4, body = columns - 2 * padding - Number(cap);
|
|
53
|
+
if (body < 2) {
|
|
54
|
+
padding = 0;
|
|
55
|
+
cap = false;
|
|
56
|
+
body = columns;
|
|
57
|
+
}
|
|
58
|
+
for (const block of blocks) {
|
|
59
|
+
if (current.length && width([...current, block], padding, cap) > columns) {
|
|
60
|
+
result.push(row(current, config, padding, cap));
|
|
61
|
+
current = [];
|
|
62
|
+
}
|
|
63
|
+
if (width([block], padding, cap) > columns) {
|
|
64
|
+
const chunks = layout.splitAnsiText(block.text, body, block.prefer_slash_breaks);
|
|
65
|
+
for (const chunk of chunks.slice(0, -1))
|
|
66
|
+
result.push(row([{ ...block, text: chunk }], config, padding, cap));
|
|
67
|
+
current = [{ ...block, text: chunks.at(-1) }];
|
|
68
|
+
}
|
|
69
|
+
else
|
|
70
|
+
current.push(block);
|
|
71
|
+
}
|
|
72
|
+
if (current.length)
|
|
73
|
+
result.push(row(current, config, padding, cap));
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=powerline.js.map
|
|
@@ -0,0 +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OptionsDraft, Scope } from '../contracts/ui.js';
|
|
2
|
+
import type { Presentation } from './language.js';
|
|
3
|
+
export declare function modelName(value: string | null, fmt: FormattingDraft): string | null;
|
|
4
|
+
export declare function number(value: unknown, fmt: FormattingDraft, legacy?: (value: unknown) => string | null): string | null;
|
|
5
|
+
export declare function money(value: number, fmt: FormattingDraft): string;
|
|
6
|
+
export type DateFormatter = (seconds: number, utc: boolean, withDate: boolean) => string | null;
|
|
7
|
+
export declare function resetTime(expires: unknown, now: number, fmt: FormattingDraft, countdown: (expires: unknown, now: number) => string | null, formatDate: DateFormatter): string | null;
|
|
8
|
+
export declare function decorate(text: string, item: string, scope: Scope, fmt: FormattingDraft, options: ItemOptionsDraft, language: Presentation): string;
|
|
9
|
+
export declare function threshold(text: string, used: number | null, fmt: FormattingDraft, config: DisplayDraft, normal: string): string;
|
|
10
|
+
export declare function optionsFor(config: DisplayDraft, id: string, scope?: Scope): readonly [
|
|
11
|
+
FormattingDraft,
|
|
12
|
+
ItemOptionsDraft
|
|
13
|
+
];
|
|
14
|
+
export declare function legacyFitting(options: readonly ItemOptionsDraft[]): boolean;
|