@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,101 @@
|
|
|
1
|
+
import { DEFAULT_HOST } from '@fbincon/statusline-core/config/draft';
|
|
2
|
+
import { ConfigError, clone, fail, object } from '@fbincon/statusline-core/config/validation';
|
|
3
|
+
import { safeInteger } from '@fbincon/statusline-core/json';
|
|
4
|
+
import { normalizedPath, ownedCommand, splitCommand, which } from '@fbincon/statusline-platform/commands';
|
|
5
|
+
export function installationIdentity(settings, launch) {
|
|
6
|
+
return Object.fromEntries([['statusLine', 'render'], ['subagentStatusLine', 'render-subagents']].map(([key, operation]) => {
|
|
7
|
+
const current = settings[key] ?? null;
|
|
8
|
+
if (current === null)
|
|
9
|
+
return [key, { state: 'absent' }];
|
|
10
|
+
if (!object(current))
|
|
11
|
+
return [key, { state: 'foreign', value: current }];
|
|
12
|
+
const command = current.command ?? null, argv = splitCommand(command);
|
|
13
|
+
const owned = current.type === 'command' && ownedCommand(command, operation, launch);
|
|
14
|
+
let normalized = command;
|
|
15
|
+
if (argv?.length) {
|
|
16
|
+
let program = argv[0];
|
|
17
|
+
if (owned && /[/\\]/u.test(program))
|
|
18
|
+
program = launch.executable;
|
|
19
|
+
normalized = [normalizedPath(which(program) ?? program), ...argv.slice(1)];
|
|
20
|
+
}
|
|
21
|
+
return [key, { state: owned ? 'owned' : 'foreign', type: current.type ?? null, command: normalized }];
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
export function hostFromSettings(settings, launch) {
|
|
25
|
+
const current = settings.statusLine;
|
|
26
|
+
if (!object(current) || current.type !== 'command' || !ownedCommand(current.command, 'render', launch))
|
|
27
|
+
return { host: clone(DEFAULT_HOST), installed: false };
|
|
28
|
+
let padding, refresh;
|
|
29
|
+
try {
|
|
30
|
+
padding = safeInteger(current.padding ?? (Object.hasOwn(current, 'padding') ? null : 0), 0, 32);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return fail('errors.host.installed_statusline_padding_is_outside_0_through');
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
refresh = current.refreshInterval == null ? 'event' : safeInteger(current.refreshInterval, 1, 3600);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return fail('errors.host.installed_statusline_refreshinterval_is_outside_1_through');
|
|
40
|
+
}
|
|
41
|
+
const hide = Object.hasOwn(current, 'hideVimModeIndicator') ? current.hideVimModeIndicator : false;
|
|
42
|
+
if (typeof hide !== 'boolean')
|
|
43
|
+
fail('errors.host.installed_statusline_hidevimmodeindicator_must_be_true_or');
|
|
44
|
+
return { host: { padding, refresh_interval: refresh, hide_vim_mode_indicator: hide }, installed: true };
|
|
45
|
+
}
|
|
46
|
+
export function settingsWithHost(settings, launch, host) {
|
|
47
|
+
const current = settings.statusLine;
|
|
48
|
+
if (!object(current) || current.type !== 'command' || !ownedCommand(current.command, 'render', launch)) {
|
|
49
|
+
throw new ConfigError('errors.host.renderer_not_installed', {}, current == null ? 'not_installed' : 'ownership_mismatch');
|
|
50
|
+
}
|
|
51
|
+
const updated = clone(settings), line = clone(current);
|
|
52
|
+
if (host.padding)
|
|
53
|
+
line.padding = host.padding;
|
|
54
|
+
else
|
|
55
|
+
delete line.padding;
|
|
56
|
+
if (host.refresh_interval === 'event')
|
|
57
|
+
delete line.refreshInterval;
|
|
58
|
+
else
|
|
59
|
+
line.refreshInterval = host.refresh_interval;
|
|
60
|
+
if (host.hide_vim_mode_indicator)
|
|
61
|
+
line.hideVimModeIndicator = true;
|
|
62
|
+
else
|
|
63
|
+
delete line.hideVimModeIndicator;
|
|
64
|
+
updated.statusLine = line;
|
|
65
|
+
return updated;
|
|
66
|
+
}
|
|
67
|
+
export function toggle(value, name) {
|
|
68
|
+
if (typeof value === 'boolean')
|
|
69
|
+
return value;
|
|
70
|
+
if (typeof value === 'string') {
|
|
71
|
+
if (['on', 'true'].includes(value.toLowerCase()))
|
|
72
|
+
return true;
|
|
73
|
+
if (['off', 'false'].includes(value.toLowerCase()))
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return fail('errors.host.must_be_on_or_off', { name });
|
|
77
|
+
}
|
|
78
|
+
export function hostOption(host, option, value) {
|
|
79
|
+
const updated = clone(host);
|
|
80
|
+
if (option === 'hide-vim-mode-indicator')
|
|
81
|
+
updated.hide_vim_mode_indicator = toggle(value, option);
|
|
82
|
+
else if (option === 'refresh-interval' && typeof value === 'string' && value.toLowerCase() === 'event')
|
|
83
|
+
updated.refresh_interval = 'event';
|
|
84
|
+
else if (option === 'padding' || option === 'refresh-interval') {
|
|
85
|
+
const parsed = typeof value === 'string' && /^[+-]?\d+$/u.test(value.trim()) ? Number(value) : value;
|
|
86
|
+
try {
|
|
87
|
+
const number = safeInteger(parsed, option === 'padding' ? 0 : 1, option === 'padding' ? 32 : 3600);
|
|
88
|
+
if (option === 'padding')
|
|
89
|
+
updated.padding = number;
|
|
90
|
+
else
|
|
91
|
+
updated.refresh_interval = number;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
fail(option === 'padding' ? 'errors.host.padding_must_be_an_integer_from_0' : 'errors.host.refresh_interval_must_be_event_or_an');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else
|
|
98
|
+
fail('errors.host.unknown_host_option', { option });
|
|
99
|
+
return updated;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../../src/config/host.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,KA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MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACrG,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACnG,IAAI,MAAM,KAAK,SAAS;gBACpB,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;gBAEzB,OAAO,CAAC,gBAAgB,GAAG,MAAM,CAAC;QAC1C,CAAC;QACD,MAAM,CAAC;YACH,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,+CAA+C,CAAC,CAAC,CAAC,kDAAkD,CAAC,CAAC;QACtI,CAAC;IACL,CAAC;;QAEG,IAAI,CAAC,iCAAiC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACxD,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DisplayDraft, Scope } from '@fbincon/statusline-core/contracts/ui';
|
|
2
|
+
import { ConfigurationService, type MutationResult } from './service.js';
|
|
3
|
+
export declare const DISPLAY_OPTIONS: string[];
|
|
4
|
+
export declare const HOST_OPTIONS: string[];
|
|
5
|
+
export declare const OPTIONS: string[];
|
|
6
|
+
export declare function legacyIds(config: DisplayDraft, scope: Scope, types: readonly string[], bulk?: boolean): string[];
|
|
7
|
+
export declare function selectedItems(config: DisplayDraft, scope: Scope, action: string, types: readonly string[]): DisplayDraft;
|
|
8
|
+
export declare function selection(service: ConfigurationService, scope: Scope, action: string, types: readonly string[]): MutationResult;
|
|
9
|
+
export declare function displayOption(config: DisplayDraft, option: string, value: unknown): DisplayDraft;
|
|
10
|
+
export declare function setOption(service: ConfigurationService, option: string, value: unknown): MutationResult;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { validateItems, defaultItem } from '@fbincon/statusline-core/config/display';
|
|
2
|
+
import { FORMAT_CHOICES } from '@fbincon/statusline-core/config/formatting';
|
|
3
|
+
import { clone, fail } from '@fbincon/statusline-core/config/validation';
|
|
4
|
+
import { legacyId, scoped, updateDisplay, updateSubagents } from '@fbincon/statusline-core/config/instances';
|
|
5
|
+
import { hostOption, settingsWithHost, toggle } from './host.js';
|
|
6
|
+
import { UNCHANGED } from './service.js';
|
|
7
|
+
export const DISPLAY_OPTIONS = [
|
|
8
|
+
'statusline-language', 'branch-diff-base', 'colors', 'palette', 'theme', 'powerline-glyph', 'directory-style', 'separator-style', 'scope-labels', 'subagent-statusline',
|
|
9
|
+
...Object.keys(FORMAT_CHOICES).map(key => key.replaceAll('_', '-')), 'threshold-colors', 'warning-threshold', 'critical-threshold',
|
|
10
|
+
'subagent-visibility', 'subagent-hide-completed', 'subagent-row-limit', 'subagent-task-max-width',
|
|
11
|
+
];
|
|
12
|
+
export const HOST_OPTIONS = ['padding', 'refresh-interval', 'hide-vim-mode-indicator'];
|
|
13
|
+
export const OPTIONS = [...DISPLAY_OPTIONS, ...HOST_OPTIONS].sort();
|
|
14
|
+
export function legacyIds(config, scope, types, bulk = false) {
|
|
15
|
+
const nodes = scoped(config, scope).instances;
|
|
16
|
+
if (bulk && (nodes.some(node => ['text', 'spacer'].includes(node.type_id)) || new Set(nodes.map(node => node.type_id)).size !== nodes.length))
|
|
17
|
+
fail('composition.errors.legacy', { scope });
|
|
18
|
+
return types.map(type => legacyId(config, scope, type, true));
|
|
19
|
+
}
|
|
20
|
+
function replaceScope(config, scope, nodes) {
|
|
21
|
+
return scope === 'main' ? updateDisplay(config, { instances: nodes }) : updateDisplay(config, { subagents: updateSubagents(config.subagents, { instances: nodes }) });
|
|
22
|
+
}
|
|
23
|
+
export function selectedItems(config, scope, action, types) {
|
|
24
|
+
const selected = legacyIds(config, scope, validateItems(types, scope), ['set-items', 'order'].includes(action));
|
|
25
|
+
const target = scoped(config, scope), current = target.instances.filter(node => node.enabled).map(node => node.id);
|
|
26
|
+
if (action === 'order' && (selected.length !== current.length || selected.some(id => !current.includes(id))))
|
|
27
|
+
fail('errors.service.order_must_contain_every_enabled_item_exactly', { value0: '' });
|
|
28
|
+
if (action === 'enable' || action === 'disable') {
|
|
29
|
+
const nodes = clone(target.instances);
|
|
30
|
+
const structural = (scope === 'main' && config.layout.mode === 'explicit') || nodes.some(node => ['text', 'spacer'].includes(node.type_id)) || new Set(nodes.map(node => node.type_id)).size !== nodes.length;
|
|
31
|
+
for (const id of selected) {
|
|
32
|
+
const index = nodes.findIndex(node => node.id === id), node = nodes[index];
|
|
33
|
+
if (!node) {
|
|
34
|
+
if (action === 'enable')
|
|
35
|
+
nodes.push({ id, type_id: id, enabled: true, text: null, options: defaultItem() });
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (node.enabled === (action === 'enable'))
|
|
39
|
+
continue;
|
|
40
|
+
node.enabled = action === 'enable';
|
|
41
|
+
if (action === 'enable' && !structural) {
|
|
42
|
+
nodes.splice(index, 1);
|
|
43
|
+
nodes.push(node);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return replaceScope(config, scope, nodes);
|
|
47
|
+
}
|
|
48
|
+
return scope === 'main' ? updateDisplay(config, { items: selected }) : updateDisplay(config, { subagents: updateSubagents(config.subagents, { items: selected }) });
|
|
49
|
+
}
|
|
50
|
+
export function selection(service, scope, action, types) {
|
|
51
|
+
validateItems(types, scope);
|
|
52
|
+
return service.mutate(`config-${scope === 'subagent' ? 'subagents-' : ''}${action}`, config => [selectedItems(config, scope, action, types), UNCHANGED]);
|
|
53
|
+
}
|
|
54
|
+
function commandInteger(value, key) {
|
|
55
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
56
|
+
return Math.trunc(value);
|
|
57
|
+
if (typeof value === 'string' && /^[+-]?\d+$/u.test(value.trim()))
|
|
58
|
+
return Number(value);
|
|
59
|
+
return fail(key);
|
|
60
|
+
}
|
|
61
|
+
export function displayOption(config, option, value) {
|
|
62
|
+
if (option === 'branch-diff-base')
|
|
63
|
+
return updateDisplay(config, { metrics: { branch_diff_base_ref: value === 'auto' ? null : value } });
|
|
64
|
+
if (option.startsWith('subagent-') && option !== 'subagent-statusline') {
|
|
65
|
+
const key = option.slice('subagent-'.length).replaceAll('-', '_');
|
|
66
|
+
if (key === 'hide_completed') {
|
|
67
|
+
if (!['on', 'off', true, false].includes(value))
|
|
68
|
+
fail('errors.advanced.hide_completed_must_be_on_off');
|
|
69
|
+
value = value === 'on' || value === true;
|
|
70
|
+
}
|
|
71
|
+
else if (['row_limit', 'task_max_width'].includes(key))
|
|
72
|
+
value = value === 'none' || value === null ? null : commandInteger(value, 'errors.advanced.limit_must_be_an_integer_or_none');
|
|
73
|
+
return updateDisplay(config, { subagents: updateSubagents(config.subagents, { [key]: value }) });
|
|
74
|
+
}
|
|
75
|
+
const name = option.replaceAll('-', '_');
|
|
76
|
+
if (Object.hasOwn(FORMAT_CHOICES, name))
|
|
77
|
+
return updateDisplay(config, { formatting: { ...config.formatting, [name]: value } });
|
|
78
|
+
if (['threshold-colors', 'warning-threshold', 'critical-threshold'].includes(option)) {
|
|
79
|
+
const key = option === 'threshold-colors' ? 'enabled' : option === 'warning-threshold' ? 'warning' : 'critical';
|
|
80
|
+
value = key === 'enabled' ? toggle(value, option) : commandInteger(value, 'errors.service.threshold_must_be_an_integer');
|
|
81
|
+
return updateDisplay(config, { formatting: { ...config.formatting, thresholds: { ...config.formatting.thresholds, [key]: value } } });
|
|
82
|
+
}
|
|
83
|
+
if (option === 'colors')
|
|
84
|
+
return updateDisplay(config, { use_colors: toggle(value, option) });
|
|
85
|
+
if (option === 'subagent-statusline')
|
|
86
|
+
return updateDisplay(config, { subagents: updateSubagents(config.subagents, { enabled: toggle(value, option) }) });
|
|
87
|
+
if (['theme', 'powerline-glyph', 'palette', 'directory-style', 'separator-style', 'scope-labels', 'statusline-language'].includes(option))
|
|
88
|
+
return updateDisplay(config, { [name]: value });
|
|
89
|
+
return fail('errors.service.unknown_display_option', { option });
|
|
90
|
+
}
|
|
91
|
+
export function setOption(service, option, value) {
|
|
92
|
+
if (!OPTIONS.includes(option))
|
|
93
|
+
fail('errors.service.unknown_option_expected_one_of', { value0: OPTIONS.join(', ') });
|
|
94
|
+
return service.mutate(`config-set-${option}`, (display, settings, host) => DISPLAY_OPTIONS.includes(option) ? [displayOption(display, option, value), UNCHANGED] : [UNCHANGED, settingsWithHost(settings, service.context.launch, hostOption(host, option, value))]);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/config/operations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC7G,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAwB,SAAS,EAAuB,MAAM,cAAc,CAAC;AACpF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB;IACvK,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB;IAClI,qBAAqB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CAAC,cAAc,MAAM,EAAE,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACzQ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Language } from '@fbincon/statusline-core/i18n/registry';
|
|
2
|
+
import { type LocalizedText } from '@fbincon/statusline-core/i18n/messages';
|
|
3
|
+
import { type Storage } from './storage.js';
|
|
4
|
+
export declare const UI_FILENAME = "statusline-ui.json";
|
|
5
|
+
export interface Preferences {
|
|
6
|
+
schema_version: 1;
|
|
7
|
+
ui_language: Language;
|
|
8
|
+
warning: LocalizedText | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function readPreferences(directory: string, io?: Storage): Preferences;
|
|
11
|
+
export declare function setLanguage(directory: string, language: unknown, io?: Storage): Preferences;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { integer } from '@fbincon/statusline-core/json';
|
|
3
|
+
import { readJson } from '@fbincon/statusline-core/json-read';
|
|
4
|
+
import { isSchema } from '@fbincon/statusline-core/config/display';
|
|
5
|
+
import { ConfigError, object, fail } from '@fbincon/statusline-core/config/validation';
|
|
6
|
+
import { LANGUAGES } from '@fbincon/statusline-core/i18n/registry';
|
|
7
|
+
import { text } from '@fbincon/statusline-core/i18n/messages';
|
|
8
|
+
import { artifact, createStorage, decodeUtf8, errorDetail, jsonBytes } from './storage.js';
|
|
9
|
+
import { commit } from '../recovery/files.js';
|
|
10
|
+
import { assertClear } from '../recovery/journal.js';
|
|
11
|
+
export const UI_FILENAME = 'statusline-ui.json';
|
|
12
|
+
function decode(raw) {
|
|
13
|
+
return readJson(decodeUtf8(raw), { duplicate() { throw new Error('duplicate preference key'); }, constant(value) { throw new Error(value); } });
|
|
14
|
+
}
|
|
15
|
+
function valid(data) {
|
|
16
|
+
return object(data) && Object.keys(data).length === 2 && isSchema(data.schema_version, 1) && typeof data.ui_language === 'string' && LANGUAGES.includes(data.ui_language);
|
|
17
|
+
}
|
|
18
|
+
export function readPreferences(directory, io = createStorage()) {
|
|
19
|
+
const path = join(directory, UI_FILENAME), base = { schema_version: 1, ui_language: 'en' };
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = io.read(path);
|
|
23
|
+
}
|
|
24
|
+
catch (detail) {
|
|
25
|
+
return { ...base, warning: text('preferences.read_failed', { path, detail: errorDetail(detail) }) };
|
|
26
|
+
}
|
|
27
|
+
if (raw === null)
|
|
28
|
+
return { ...base, warning: null };
|
|
29
|
+
try {
|
|
30
|
+
const data = decode(raw);
|
|
31
|
+
if (!valid(data))
|
|
32
|
+
throw new Error('unsupported or invalid preferences');
|
|
33
|
+
return { schema_version: 1, ui_language: data.ui_language, warning: null };
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return { ...base, warning: text('preferences.invalid', { path }) };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function setLanguage(directory, language, io = createStorage()) {
|
|
40
|
+
if (typeof language !== 'string' || !LANGUAGES.includes(language))
|
|
41
|
+
fail('preferences.unsupported_language', { language });
|
|
42
|
+
const path = join(directory, UI_FILENAME);
|
|
43
|
+
try {
|
|
44
|
+
io.lock(directory, () => {
|
|
45
|
+
assertClear(directory);
|
|
46
|
+
const raw = io.read(path);
|
|
47
|
+
if (raw !== null) {
|
|
48
|
+
let data = null;
|
|
49
|
+
try {
|
|
50
|
+
data = decode(raw);
|
|
51
|
+
}
|
|
52
|
+
catch { /* Corrupt preferences are repairable. */ }
|
|
53
|
+
if (object(data)) {
|
|
54
|
+
let version;
|
|
55
|
+
try {
|
|
56
|
+
version = integer(data.schema_version);
|
|
57
|
+
}
|
|
58
|
+
catch { /* Invalid schema is repairable. */ }
|
|
59
|
+
if (version !== undefined && version > 1n)
|
|
60
|
+
fail('preferences.future_schema', { version });
|
|
61
|
+
}
|
|
62
|
+
if (valid(data) && data.ui_language === language)
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
commit(directory, 'ui-language', [{ ...artifact(path, raw), desired: jsonBytes({ schema_version: 1, ui_language: language }) }], io, raw !== null);
|
|
67
|
+
}
|
|
68
|
+
catch (detail) {
|
|
69
|
+
throw detail;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (detail) {
|
|
74
|
+
if (detail instanceof ConfigError)
|
|
75
|
+
throw detail;
|
|
76
|
+
throw new ConfigError('preferences.write_failed', { path, detail: errorDetail(detail) }, 'io_error');
|
|
77
|
+
}
|
|
78
|
+
return { schema_version: 1, ui_language: language, warning: null };
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../../src/config/preferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,SAAS,EAAiB,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,IAAI,EAAsB,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE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
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DisplayDraft, Draft, HostDraft } from '@fbincon/statusline-core/contracts/ui';
|
|
2
|
+
import type { LaunchSpec } from '@fbincon/statusline-platform/launch';
|
|
3
|
+
import { type Storage } from './storage.js';
|
|
4
|
+
export interface ConfigurationContext {
|
|
5
|
+
configDir: string;
|
|
6
|
+
launch: LaunchSpec;
|
|
7
|
+
hostVersion: () => readonly number[] | null;
|
|
8
|
+
}
|
|
9
|
+
export interface EffectiveConfig {
|
|
10
|
+
scope: 'user';
|
|
11
|
+
config_path: string;
|
|
12
|
+
installed: boolean;
|
|
13
|
+
display: DisplayDraft;
|
|
14
|
+
host: HostDraft;
|
|
15
|
+
subagent_statusline: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
installed: boolean;
|
|
18
|
+
state: string;
|
|
19
|
+
};
|
|
20
|
+
revision: string;
|
|
21
|
+
installation: Record<string, Record<string, unknown>>;
|
|
22
|
+
}
|
|
23
|
+
export interface MutationResult {
|
|
24
|
+
changed: boolean;
|
|
25
|
+
effective: EffectiveConfig;
|
|
26
|
+
backup_dir: string | null;
|
|
27
|
+
}
|
|
28
|
+
export declare const UNCHANGED: unique symbol, DELETE: unique symbol;
|
|
29
|
+
export type Mutation = (display: DisplayDraft, settings: Record<string, unknown>, host: HostDraft, installed: boolean) => readonly [
|
|
30
|
+
DisplayDraft | typeof UNCHANGED | typeof DELETE,
|
|
31
|
+
Record<string, unknown> | typeof UNCHANGED
|
|
32
|
+
];
|
|
33
|
+
export declare function atLeast(version: readonly number[] | null, required: readonly number[]): boolean;
|
|
34
|
+
export declare function publicConfig(effective: EffectiveConfig): Omit<EffectiveConfig, 'revision' | 'installation'>;
|
|
35
|
+
export declare function draft(effective: EffectiveConfig): Draft;
|
|
36
|
+
export declare class ConfigurationService {
|
|
37
|
+
readonly context: ConfigurationContext;
|
|
38
|
+
readonly io: Storage;
|
|
39
|
+
constructor(context: ConfigurationContext, io?: Storage);
|
|
40
|
+
snapshot(display: DisplayDraft, settings: Record<string, unknown>): EffectiveConfig;
|
|
41
|
+
read(): EffectiveConfig;
|
|
42
|
+
mutate(action: string, mutation: Mutation, tolerateInvalidDisplay?: boolean): MutationResult;
|
|
43
|
+
apply(value: unknown, expectedRevision?: string, beforeCommit?: () => void): MutationResult;
|
|
44
|
+
reset(): MutationResult;
|
|
45
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { CONFIG_FILENAME, defaultDisplay, validateDisplay } from '@fbincon/statusline-core/config/display';
|
|
3
|
+
import { DEFAULT_HOST, validateDraft } from '@fbincon/statusline-core/config/draft';
|
|
4
|
+
import { ConfigError } from '@fbincon/statusline-core/config/validation';
|
|
5
|
+
import { equalSettings } from '@fbincon/statusline-core/json-equality';
|
|
6
|
+
import { pythonJson } from '@fbincon/statusline-core/json-text';
|
|
7
|
+
import { revision } from '@fbincon/statusline-platform/hash';
|
|
8
|
+
import { hostFromSettings, installationIdentity, settingsWithHost } from './host.js';
|
|
9
|
+
import { artifact, createStorage, errorDetail, jsonBytes, readDisplay, readSettings } from './storage.js';
|
|
10
|
+
import { commit } from '../recovery/files.js';
|
|
11
|
+
import { assertClear } from '../recovery/journal.js';
|
|
12
|
+
export const UNCHANGED = Symbol('unchanged'), DELETE = Symbol('delete');
|
|
13
|
+
export function atLeast(version, required) {
|
|
14
|
+
if (!version)
|
|
15
|
+
return false;
|
|
16
|
+
for (let i = 0; i < required.length; i++) {
|
|
17
|
+
if ((version[i] ?? 0) !== required[i])
|
|
18
|
+
return (version[i] ?? 0) > required[i];
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export function publicConfig(effective) {
|
|
23
|
+
const { revision: _revision, installation: _installation, ...result } = effective;
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
export function draft(effective) { return { display: effective.display, host: effective.host }; }
|
|
27
|
+
export class ConfigurationService {
|
|
28
|
+
context;
|
|
29
|
+
io;
|
|
30
|
+
constructor(context, io = createStorage()) {
|
|
31
|
+
this.context = context;
|
|
32
|
+
this.io = io;
|
|
33
|
+
}
|
|
34
|
+
snapshot(display, settings) {
|
|
35
|
+
const { configDir, launch } = this.context;
|
|
36
|
+
const { host, installed } = hostFromSettings(settings, launch);
|
|
37
|
+
const installation = installationIdentity(settings, launch);
|
|
38
|
+
const state = atLeast(this.context.hostVersion(), [2, 1, 205]) ? String(installation.subagentStatusLine.state) : 'unsupported';
|
|
39
|
+
return {
|
|
40
|
+
scope: 'user', config_path: join(configDir, CONFIG_FILENAME), installed, display, host,
|
|
41
|
+
subagent_statusline: { enabled: display.subagents.enabled, installed: state === 'owned', state },
|
|
42
|
+
revision: revision({ revision_version: 1, display, host, installation }), installation,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
read() {
|
|
46
|
+
return this.io.lock(this.context.configDir, () => {
|
|
47
|
+
const [display] = readDisplay(this.context.configDir, this.io);
|
|
48
|
+
const [settings] = readSettings(this.context.configDir, this.io);
|
|
49
|
+
return this.snapshot(display, settings);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
mutate(action, mutation, tolerateInvalidDisplay = false) {
|
|
53
|
+
const { configDir, launch } = this.context;
|
|
54
|
+
return this.io.lock(configDir, () => {
|
|
55
|
+
assertClear(configDir);
|
|
56
|
+
const [display, displayRaw] = readDisplay(configDir, this.io, tolerateInvalidDisplay);
|
|
57
|
+
const [settings, settingsRaw] = readSettings(configDir, this.io);
|
|
58
|
+
const { host, installed } = hostFromSettings(settings, launch);
|
|
59
|
+
const [newDisplay, newSettings] = mutation(display, settings, host, installed);
|
|
60
|
+
const displayBytes = newDisplay === DELETE ? null : newDisplay === UNCHANGED ? displayRaw : jsonBytes(validateDisplay(newDisplay));
|
|
61
|
+
const displayChanged = newDisplay !== UNCHANGED && (displayBytes === null ? displayRaw !== null : !displayRaw?.equals(displayBytes));
|
|
62
|
+
// Settings use semantic comparison, retaining unrelated values and their original bytes on a no-op.
|
|
63
|
+
const settingsChanged = newSettings !== UNCHANGED && !equalSettings(newSettings, settings);
|
|
64
|
+
if (!displayChanged && !settingsChanged)
|
|
65
|
+
return { changed: false, effective: this.snapshot(display, settings), backup_dir: null };
|
|
66
|
+
const displayPath = join(configDir, CONFIG_FILENAME), settingsPath = join(configDir, 'settings.json');
|
|
67
|
+
const artifacts = [...(displayChanged ? [artifact(displayPath, displayRaw)] : []), ...(settingsChanged ? [artifact(settingsPath, settingsRaw)] : [])];
|
|
68
|
+
let backup;
|
|
69
|
+
try {
|
|
70
|
+
backup = commit(configDir, action, artifacts.map(item => ({ ...item, desired: item.path === settingsPath ? Buffer.from(pythonJson(newSettings, { ensureAscii: false, indent: 2, allowNan: true }) + '\n') : displayBytes })), this.io);
|
|
71
|
+
}
|
|
72
|
+
catch (exc) {
|
|
73
|
+
throw new ConfigError('errors.service.configuration_update_failed', { exc: errorDetail(exc), suffix: '' }, 'io_error');
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
changed: true,
|
|
77
|
+
effective: this.snapshot(newDisplay === DELETE ? defaultDisplay() : newDisplay === UNCHANGED ? display : newDisplay, newSettings === UNCHANGED ? settings : newSettings),
|
|
78
|
+
backup_dir: backup,
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
apply(value, expectedRevision, beforeCommit) {
|
|
83
|
+
const parsed = validateDraft(value, true);
|
|
84
|
+
return this.mutate('config-apply', (display, settings, host) => {
|
|
85
|
+
beforeCommit?.();
|
|
86
|
+
const installation = installationIdentity(settings, this.context.launch);
|
|
87
|
+
const current = revision({ revision_version: 1, display, host, installation });
|
|
88
|
+
if (expectedRevision !== undefined && current !== expectedRevision)
|
|
89
|
+
throw new ConfigError('errors.service.status_line_configuration_changed_while_the_editor', {}, 'configuration_conflict');
|
|
90
|
+
if (installation.subagentStatusLine.state === 'foreign')
|
|
91
|
+
throw new ConfigError('errors.service.claude_code_subagentstatusline_belongs_to_another_renderer', {}, 'ownership_mismatch');
|
|
92
|
+
return [parsed.display, settingsWithHost(settings, this.context.launch, parsed.host)];
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
reset() {
|
|
96
|
+
return this.mutate('config-reset', (_display, settings, _host, installed) => [DELETE, installed ? settingsWithHost(settings, this.context.launch, DEFAULT_HOST) : UNCHANGED], true);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/config/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC3G,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAgB,MAAM,cAAc,CAAC;AACxH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAyBrD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAKxE,MAAM,UAAU,OAAO,CAAC,OAAiC,EAAE,QAA2B;I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CAAC,EAAE,IAAI,CAAC,CAAC;IACxL,CAAC;CACJ"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { decodeUtf8 } from '@fbincon/statusline-platform/utf8';
|
|
2
|
+
import { errorDescription } from '@fbincon/statusline-platform/errors';
|
|
3
|
+
export { decodeUtf8 };
|
|
4
|
+
import type { DisplayDraft } from '@fbincon/statusline-core/contracts/ui';
|
|
5
|
+
export interface Artifact {
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
raw: Buffer | null;
|
|
9
|
+
}
|
|
10
|
+
export interface Storage {
|
|
11
|
+
read(path: string): Buffer | null;
|
|
12
|
+
write(path: string, raw: Buffer): void;
|
|
13
|
+
remove(path: string): void;
|
|
14
|
+
lock<T>(directory: string, action: () => T): T;
|
|
15
|
+
backup(directory: string, action: string, artifacts: Artifact[]): string;
|
|
16
|
+
}
|
|
17
|
+
export declare function jsonBytes(value: unknown): Buffer;
|
|
18
|
+
export declare const errorDetail: typeof errorDescription;
|
|
19
|
+
export { privateDirectory } from '@fbincon/statusline-platform/files';
|
|
20
|
+
export declare function timestamp(now: Date): string;
|
|
21
|
+
export declare function createStorage(now?: () => Date): Storage;
|
|
22
|
+
export declare function readDisplay(directory: string, io: Storage, tolerateInvalid?: boolean): [
|
|
23
|
+
DisplayDraft,
|
|
24
|
+
Buffer | null
|
|
25
|
+
];
|
|
26
|
+
export declare function readSettings(directory: string, io: Storage): [
|
|
27
|
+
Record<string, unknown>,
|
|
28
|
+
Buffer | null
|
|
29
|
+
];
|
|
30
|
+
export declare function artifact(path: string, raw: Buffer | null): Artifact;
|