@fbincon/claude-code-statusline 0.0.0-stage → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LICENSE-Unicode.txt +39 -0
- package/LICENSE-Wcwidth.txt +27 -0
- package/README.md +420 -2
- package/bin/claude-statusline.js +2 -0
- package/candidate.json +1244 -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 +14 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +230 -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/dist/src/theme.d.ts +7 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/theme.js +5 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/theme.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,134 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { safeTarget } from '../integration/paths.js';
|
|
4
|
+
import { assertClear, allowedArtifact, hash, base, persist, complete, checkpoint, relativePath, readRegular, active, RecoveryRequired } from './journal.js';
|
|
5
|
+
function mode(path) {
|
|
6
|
+
if (process.platform === 'win32' || !fs.existsSync(path))
|
|
7
|
+
return null;
|
|
8
|
+
return fs.statSync(path).mode & 0o777;
|
|
9
|
+
}
|
|
10
|
+
function restoreMode(path, value) {
|
|
11
|
+
if (value === null || process.platform === 'win32')
|
|
12
|
+
return;
|
|
13
|
+
const fd = fs.openSync(path, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
|
|
14
|
+
try {
|
|
15
|
+
fs.fchmodSync(fd, value);
|
|
16
|
+
fs.fsyncSync(fd);
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
fs.closeSync(fd);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function verify(journal, io) {
|
|
23
|
+
if (active(journal))
|
|
24
|
+
throw new RecoveryRequired('Transaction owner is still running');
|
|
25
|
+
return journal.entries.map(entry => {
|
|
26
|
+
const path = join(journal.configDir, entry.path);
|
|
27
|
+
safeTarget(journal.configDir, path);
|
|
28
|
+
const actual = hash(io.read(path)), expected = journal.phase === 'committed' ? [entry.after] : [entry.before, entry.after];
|
|
29
|
+
if (!expected.includes(actual))
|
|
30
|
+
throw new RecoveryRequired('Recovery conflict; a file changed after the transaction: ' + path);
|
|
31
|
+
const actualMode = mode(path);
|
|
32
|
+
if (actualMode !== null && ![entry.mode, 0o600].includes(actualMode))
|
|
33
|
+
throw new RecoveryRequired('Recovery conflict; file permissions changed after the transaction: ' + path);
|
|
34
|
+
if (entry.snapshot === null)
|
|
35
|
+
return null;
|
|
36
|
+
const target = join(journal.configDir, entry.snapshot);
|
|
37
|
+
safeTarget(journal.configDir, target);
|
|
38
|
+
const bytes = readRegular(target);
|
|
39
|
+
if (hash(bytes) !== entry.before)
|
|
40
|
+
throw new RecoveryRequired('Backup hash mismatch; original files are left untouched: ' + target);
|
|
41
|
+
return bytes;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** All targets and snapshots are checked before the first restoration write. */
|
|
45
|
+
export function recoverFiles(journal, io, dryRun = false) {
|
|
46
|
+
const originals = verify(journal, io);
|
|
47
|
+
if (journal.phase === 'committed') {
|
|
48
|
+
if (!dryRun)
|
|
49
|
+
complete(journal);
|
|
50
|
+
return 'committed';
|
|
51
|
+
}
|
|
52
|
+
if (dryRun)
|
|
53
|
+
return 'rollback';
|
|
54
|
+
journal.phase = 'rolling-back';
|
|
55
|
+
persist(journal);
|
|
56
|
+
checkpoint('rolling-back', journal);
|
|
57
|
+
for (let i = journal.entries.length - 1; i >= 0; i--) {
|
|
58
|
+
const entry = journal.entries[i], path = join(journal.configDir, entry.path), bytes = originals[i];
|
|
59
|
+
const actual = hash(io.read(path));
|
|
60
|
+
if (![entry.before, entry.after].includes(actual))
|
|
61
|
+
throw new RecoveryRequired('Recovery target changed during restoration: ' + path);
|
|
62
|
+
if (actual !== entry.before) {
|
|
63
|
+
if (bytes === null)
|
|
64
|
+
io.remove(path);
|
|
65
|
+
else
|
|
66
|
+
io.write(path, bytes);
|
|
67
|
+
}
|
|
68
|
+
if (bytes !== null && mode(path) !== entry.mode)
|
|
69
|
+
restoreMode(path, entry.mode);
|
|
70
|
+
checkpoint('restored:' + i, journal);
|
|
71
|
+
}
|
|
72
|
+
for (const entry of journal.entries.filter(entry => entry.before === null)) {
|
|
73
|
+
for (let path = dirname(join(journal.configDir, entry.path)); path !== journal.configDir; path = dirname(path)) {
|
|
74
|
+
try {
|
|
75
|
+
safeTarget(journal.configDir, path);
|
|
76
|
+
fs.rmdirSync(path);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
complete(journal);
|
|
84
|
+
return 'rollback';
|
|
85
|
+
}
|
|
86
|
+
/** Called under the common installation lock. Immutable before-images precede the durable journal. */
|
|
87
|
+
export function commit(directory, action, changes, io, backupAbsent = true) {
|
|
88
|
+
assertClear(directory);
|
|
89
|
+
if (!changes.length)
|
|
90
|
+
return null;
|
|
91
|
+
for (const change of changes) {
|
|
92
|
+
safeTarget(directory, change.path);
|
|
93
|
+
if (!allowedArtifact(relativePath(directory, change.path)))
|
|
94
|
+
throw new Error('Unsupported transactional artifact: ' + change.path);
|
|
95
|
+
if (hash(io.read(change.path)) !== hash(change.raw))
|
|
96
|
+
throw new RecoveryRequired('Configuration changed before transaction publication');
|
|
97
|
+
}
|
|
98
|
+
const backup = backupAbsent || changes.some(change => change.raw !== null) ? io.backup(directory, action, changes) : null;
|
|
99
|
+
const journal = { ...base(directory, action, 'files'), kind: 'files', backup: backup === null ? null : relativePath(directory, backup), phase: 'prepared', progress: 0, entries: changes.map(change => ({ path: relativePath(directory, change.path), snapshot: change.raw === null ? null : relativePath(directory, join(backup, change.name + '.before')), before: hash(change.raw), after: hash(change.desired), mode: mode(change.path) })) };
|
|
100
|
+
verify(journal, io);
|
|
101
|
+
persist(journal);
|
|
102
|
+
checkpoint('prepared', journal);
|
|
103
|
+
try {
|
|
104
|
+
journal.phase = 'applying';
|
|
105
|
+
persist(journal);
|
|
106
|
+
for (let i = 0; i < changes.length; i++) {
|
|
107
|
+
const change = changes[i];
|
|
108
|
+
if (hash(io.read(change.path)) !== journal.entries[i].before)
|
|
109
|
+
throw new RecoveryRequired('Configuration changed during transaction');
|
|
110
|
+
checkpoint('before-write:' + i, journal);
|
|
111
|
+
change.desired === null ? io.remove(change.path) : io.write(change.path, change.desired);
|
|
112
|
+
journal.progress = i + 1;
|
|
113
|
+
persist(journal);
|
|
114
|
+
checkpoint('applied:' + i, journal);
|
|
115
|
+
}
|
|
116
|
+
journal.phase = 'committed';
|
|
117
|
+
persist(journal);
|
|
118
|
+
checkpoint('committed', journal);
|
|
119
|
+
complete(journal);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (journal.phase === 'committed')
|
|
123
|
+
throw new RecoveryRequired('Configuration publication needs recovery verification');
|
|
124
|
+
try {
|
|
125
|
+
recoverFiles(journal, io);
|
|
126
|
+
}
|
|
127
|
+
catch (rollback) {
|
|
128
|
+
throw new RecoveryRequired(`${String(error)}; rollback incomplete: ${String(rollback)}`);
|
|
129
|
+
}
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
return backup;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/recovery/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAoB,MAAM,cAAc,CAAC;AAC9K,SAAS,IAAI,CAAC,IAAY;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AC;QACD,MAAM,KAAK,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ConfigError } from '@fbincon/statusline-core/config/validation';
|
|
2
|
+
export declare const ROOT = "statusline_runtime/transactions";
|
|
3
|
+
export declare const hash: (raw: Buffer | null) => string | null;
|
|
4
|
+
export declare class RecoveryRequired extends ConfigError {
|
|
5
|
+
constructor(message?: string);
|
|
6
|
+
}
|
|
7
|
+
export interface Base {
|
|
8
|
+
schema_version: 1;
|
|
9
|
+
id: string;
|
|
10
|
+
configDir: string;
|
|
11
|
+
action: string;
|
|
12
|
+
created: string;
|
|
13
|
+
process: {
|
|
14
|
+
pid: number;
|
|
15
|
+
token: string;
|
|
16
|
+
};
|
|
17
|
+
kind: 'files' | 'official';
|
|
18
|
+
}
|
|
19
|
+
export interface FileEntry {
|
|
20
|
+
path: string;
|
|
21
|
+
snapshot: string | null;
|
|
22
|
+
before: string | null;
|
|
23
|
+
after: string | null;
|
|
24
|
+
mode: number | null;
|
|
25
|
+
}
|
|
26
|
+
export interface FileJournal extends Base {
|
|
27
|
+
kind: 'files';
|
|
28
|
+
backup: string | null;
|
|
29
|
+
phase: 'prepared' | 'applying' | 'rolling-back' | 'committed';
|
|
30
|
+
progress: number;
|
|
31
|
+
entries: FileEntry[];
|
|
32
|
+
}
|
|
33
|
+
export interface OfficialJournal extends Base {
|
|
34
|
+
kind: 'official';
|
|
35
|
+
spec: 'statusline-native' | 'statusline-runtime';
|
|
36
|
+
args: string[];
|
|
37
|
+
values: Record<string, string> | null;
|
|
38
|
+
before: unknown;
|
|
39
|
+
phase: 'prepared' | 'uncertain';
|
|
40
|
+
}
|
|
41
|
+
export type Journal = FileJournal | OfficialJournal;
|
|
42
|
+
export type Checkpoint = (stage: string, journal: Journal) => void;
|
|
43
|
+
/** Dependency injection for crash tests; production never reads fault-injection environment variables. */
|
|
44
|
+
export declare function observeTransactions(next: Checkpoint): () => void;
|
|
45
|
+
export declare function checkpoint(stage: string, journal: Journal): void;
|
|
46
|
+
export declare function base(directory: string, action: string, kind: Base['kind']): Base;
|
|
47
|
+
export declare function journalPath(journal: Base): string;
|
|
48
|
+
export declare function persist(journal: Journal): void;
|
|
49
|
+
export declare function complete(journal: Journal): void;
|
|
50
|
+
export declare function pending(directory: string): string[];
|
|
51
|
+
export declare function refreshIntents(directory: string): string[];
|
|
52
|
+
export declare function permitRefresh<T>(directory: string, action: () => T): T;
|
|
53
|
+
export declare function assertClear(directory: string, allowRefresh?: boolean): void;
|
|
54
|
+
export declare function active(journal: Base): boolean;
|
|
55
|
+
export declare function readRegular(path: string, maximum?: number): Buffer;
|
|
56
|
+
export declare function readJournal(directory: string, path: string): Journal;
|
|
57
|
+
export declare function allowedArtifact(path: string): boolean;
|
|
58
|
+
export declare function relativePath(directory: string, path: string): string;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import { join, dirname, relative, isAbsolute } from 'node:path';
|
|
3
|
+
import { randomUUID, createHash } from 'node:crypto';
|
|
4
|
+
import { atomicWrite, durableUnlink, privateDirectory, syncDirectory, isLinkOrReparse } from '@fbincon/statusline-platform/files';
|
|
5
|
+
import { processToken, processMatches } from '@fbincon/statusline-platform/processes';
|
|
6
|
+
import { decode } from '@fbincon/statusline-core/json';
|
|
7
|
+
import { ConfigError } from '@fbincon/statusline-core/config/validation';
|
|
8
|
+
import { decodeUtf8 } from '@fbincon/statusline-platform/utf8';
|
|
9
|
+
import { resolvedPath } from '@fbincon/statusline-platform/commands';
|
|
10
|
+
import { safeTarget } from '../integration/paths.js';
|
|
11
|
+
export const ROOT = 'statusline_runtime/transactions';
|
|
12
|
+
export const hash = (raw) => raw === null ? null : createHash('sha256').update(raw).digest('hex');
|
|
13
|
+
export class RecoveryRequired extends ConfigError {
|
|
14
|
+
constructor(message = 'An unfinished transaction requires `claude-statusline recover` before another configuration write') { super('recovery.required', { detail: message }, 'configuration_conflict'); this.message = message; this.name = 'RecoveryRequired'; }
|
|
15
|
+
}
|
|
16
|
+
let observer = () => { };
|
|
17
|
+
/** Dependency injection for crash tests; production never reads fault-injection environment variables. */
|
|
18
|
+
export function observeTransactions(next) { const previous = observer; observer = next; return () => { observer = previous; }; }
|
|
19
|
+
export function checkpoint(stage, journal) { observer(stage, journal); }
|
|
20
|
+
export function base(directory, action, kind) {
|
|
21
|
+
const token = processToken(process.pid);
|
|
22
|
+
if (!token)
|
|
23
|
+
throw new Error('Cannot establish transaction process identity');
|
|
24
|
+
return { schema_version: 1, id: 'txn-' + randomUUID(), configDir: directory, action, kind, created: new Date().toISOString(), process: { pid: process.pid, token } };
|
|
25
|
+
}
|
|
26
|
+
export function journalPath(journal) { return join(journal.configDir, ROOT, journal.id + '.json'); }
|
|
27
|
+
export function persist(journal) {
|
|
28
|
+
const path = journalPath(journal);
|
|
29
|
+
safeTarget(journal.configDir, path);
|
|
30
|
+
privateDirectory(dirname(path));
|
|
31
|
+
atomicWrite(path, JSON.stringify(journal, null, 2) + '\n');
|
|
32
|
+
syncDirectory(dirname(path));
|
|
33
|
+
syncDirectory(dirname(dirname(path)));
|
|
34
|
+
}
|
|
35
|
+
export function complete(journal) { durableUnlink(journalPath(journal)); checkpoint('cleared', journal); }
|
|
36
|
+
export function pending(directory) {
|
|
37
|
+
const root = join(directory, ROOT);
|
|
38
|
+
safeTarget(directory, root);
|
|
39
|
+
try {
|
|
40
|
+
const entries = fs.readdirSync(root);
|
|
41
|
+
if (entries.length > 4096)
|
|
42
|
+
throw new RecoveryRequired('Too many transaction artifacts; inspect recovery directory');
|
|
43
|
+
return entries.filter(name => name.endsWith('.json')).sort().map(name => join(root, name));
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error.code === 'ENOENT')
|
|
47
|
+
return [];
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const refreshing = new Set();
|
|
52
|
+
export function refreshIntents(directory) {
|
|
53
|
+
const path = join(directory, 'statusline_runtime/installation.json');
|
|
54
|
+
safeTarget(directory, path);
|
|
55
|
+
let raw;
|
|
56
|
+
try {
|
|
57
|
+
raw = readRegular(path);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
if (error.code === 'ENOENT')
|
|
61
|
+
return [];
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
const source = decodeUtf8(raw);
|
|
65
|
+
decode(source);
|
|
66
|
+
const record = JSON.parse(source);
|
|
67
|
+
if (!Object.hasOwn(record, 'refresh_disabled'))
|
|
68
|
+
return [];
|
|
69
|
+
if (record.owner !== 'claude-code-statusline' || record.schema_version !== 1 || !Array.isArray(record.refresh_disabled) || record.refresh_disabled.some((name) => !['statusline-native', 'statusline-runtime'].includes(String(name))) || new Set(record.refresh_disabled).size !== record.refresh_disabled.length)
|
|
70
|
+
throw new RecoveryRequired('Invalid plugin refresh intent');
|
|
71
|
+
return record.refresh_disabled;
|
|
72
|
+
}
|
|
73
|
+
export function permitRefresh(directory, action) {
|
|
74
|
+
const already = refreshing.has(directory);
|
|
75
|
+
refreshing.add(directory);
|
|
76
|
+
try {
|
|
77
|
+
return action();
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
if (!already)
|
|
81
|
+
refreshing.delete(directory);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export function assertClear(directory, allowRefresh = false) {
|
|
85
|
+
if (pending(directory).length || !allowRefresh && !refreshing.has(directory) && refreshIntents(directory).length)
|
|
86
|
+
throw new RecoveryRequired();
|
|
87
|
+
}
|
|
88
|
+
export function active(journal) { return journal.process.pid !== process.pid && processMatches(journal.process.pid, journal.process.token); }
|
|
89
|
+
export function readRegular(path, maximum = 32 * 1024 * 1024) {
|
|
90
|
+
const stat = fs.lstatSync(path);
|
|
91
|
+
if (!stat.isFile() || isLinkOrReparse(path) || stat.size > maximum || process.platform !== 'win32' && (stat.mode & 0o077) !== 0)
|
|
92
|
+
throw new RecoveryRequired('Unsafe, non-private or oversized recovery artifact: ' + path);
|
|
93
|
+
const fd = fs.openSync(path, fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW ?? 0));
|
|
94
|
+
try {
|
|
95
|
+
const opened = fs.fstatSync(fd);
|
|
96
|
+
if (opened.ino !== stat.ino || opened.dev !== stat.dev || !opened.isFile())
|
|
97
|
+
throw new RecoveryRequired('Recovery artifact changed while opening');
|
|
98
|
+
const bytes = fs.readFileSync(fd);
|
|
99
|
+
if (bytes.length > maximum)
|
|
100
|
+
throw new RecoveryRequired('Recovery artifact grew past its limit');
|
|
101
|
+
return bytes;
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
fs.closeSync(fd);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function record(value) { return !!value && typeof value === 'object' && !Array.isArray(value); }
|
|
108
|
+
export function readJournal(directory, path) {
|
|
109
|
+
safeTarget(directory, path);
|
|
110
|
+
// Duplicate keys are forbidden even when their values happen to agree.
|
|
111
|
+
const raw = decodeUtf8(readRegular(path, 4 * 1024 * 1024));
|
|
112
|
+
decode(raw);
|
|
113
|
+
const value = JSON.parse(raw);
|
|
114
|
+
if (!record(value) || value.schema_version !== 1 || !/^txn-[0-9a-f-]{36}$/u.test(value.id) || typeof value.configDir !== 'string' || !isAbsolute(value.configDir) || resolvedPath(value.configDir) !== resolvedPath(directory) || resolvedPath(journalPath(value)) !== resolvedPath(path) || typeof value.action !== 'string' || typeof value.created !== 'string' || !record(value.process) || !Number.isSafeInteger(value.process.pid) || value.process.pid <= 0 || typeof value.process.token !== 'string' || !['files', 'official'].includes(value.kind))
|
|
115
|
+
throw new RecoveryRequired('Untrusted recovery journal: ' + path);
|
|
116
|
+
const expected = ['schema_version', 'id', 'configDir', 'action', 'created', 'process', 'kind', ...(value.kind === 'files' ? ['backup', 'phase', 'progress', 'entries'] : ['spec', 'args', 'values', 'before', 'phase'])].sort().join(',');
|
|
117
|
+
if (Object.keys(value).sort().join(',') !== expected || Object.keys(value.process).sort().join(',') !== 'pid,token')
|
|
118
|
+
throw new RecoveryRequired('Unknown recovery fields');
|
|
119
|
+
if (value.kind === 'files') {
|
|
120
|
+
if (!['prepared', 'applying', 'rolling-back', 'committed'].includes(value.phase) || !Number.isInteger(value.progress) || !Array.isArray(value.entries) || !value.entries.length || value.entries.length > 4096 || value.progress < 0 || value.progress > value.entries.length || !(value.backup === null || typeof value.backup === 'string' && /^backups\/statusline\/cli-[A-Za-z0-9_.-]+$/u.test(value.backup)))
|
|
121
|
+
throw new RecoveryRequired('Invalid file recovery checkpoint');
|
|
122
|
+
const seen = new Set();
|
|
123
|
+
for (const entry of value.entries) {
|
|
124
|
+
if (!record(entry) || typeof entry.path !== 'string' || seen.has(entry.path) || !allowedArtifact(entry.path) || ![entry.before, entry.after].every(item => item === null || typeof item === 'string' && /^[a-f0-9]{64}$/u.test(item)) || !(entry.mode === null || Number.isInteger(entry.mode) && entry.mode >= 0 && entry.mode <= 0o777) || !(entry.snapshot === null && entry.before === null || typeof entry.snapshot === 'string' && value.backup !== null && entry.snapshot.startsWith(value.backup + '/') && entry.snapshot.endsWith('.before')))
|
|
125
|
+
throw new RecoveryRequired('Invalid file recovery entry');
|
|
126
|
+
if (Object.keys(entry).sort().join(',') !== 'after,before,mode,path,snapshot' || entry.snapshot !== null && (entry.snapshot.includes('\\') || entry.snapshot.split('/').some((part) => !part || part === '.' || part === '..')))
|
|
127
|
+
throw new RecoveryRequired('Unsafe backup snapshot path');
|
|
128
|
+
safeTarget(directory, join(directory, entry.path));
|
|
129
|
+
if (entry.snapshot !== null)
|
|
130
|
+
safeTarget(directory, join(directory, entry.snapshot));
|
|
131
|
+
seen.add(entry.path);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (!['statusline-native', 'statusline-runtime'].includes(value.spec) || !['prepared', 'uncertain'].includes(value.phase) || !Array.isArray(value.args) || value.args.some((x) => typeof x !== 'string' || /[\0\r\n]/u.test(x)) || !(value.values === null || record(value.values) && Object.values(value.values).every(x => typeof x === 'string')))
|
|
135
|
+
throw new RecoveryRequired('Invalid official operation checkpoint');
|
|
136
|
+
return { ...value, configDir: directory };
|
|
137
|
+
}
|
|
138
|
+
export function allowedArtifact(path) {
|
|
139
|
+
if (path.includes('\\') || isAbsolute(path) || path.split('/').some(x => !x || x === '.' || x === '..'))
|
|
140
|
+
return false;
|
|
141
|
+
return ['settings.json', 'claude-statusline.json', 'statusline-ui.json', 'claude-statusline-features.json', 'claude-statusline-native.json', 'claude-statusline-runtime.json', 'statusline_runtime/installation.json'].includes(path) || /^skills\/statusline-(?:config|configure)\/(?:SKILL\.md|\.claude-statusline-owner\.json)$/u.test(path) || /^statusline-(?:native|runtime)\/(?:\.claude-statusline-owner\.json|\.claude-plugin\/marketplace\.json|plugins\/statusline-(?:native|runtime)\/(?:resource-manifest\.json|\.claude-plugin\/plugin\.json|hooks\/hooks\.json|(?:hooks|lib|ui)\/.+\.ts))$/u.test(path);
|
|
142
|
+
}
|
|
143
|
+
export function relativePath(directory, path) { safeTarget(directory, path); return relative(directory, path).replaceAll('\\', '/'); }
|
|
144
|
+
//# sourceMappingURL=journal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.js","sourceRoot":"","sources":["../../../src/recovery/journal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAClI,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,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
|
|
3
|
+
/** Only inventory/configuration reads are used during recovery. Mutating argv is never replayed. */
|
|
4
|
+
export declare function reconcile(context: InstallContext, spec: ModSpec, host: Host, journal: OfficialJournal, dryRun?: boolean): 'confirmed' | 'not-applied';
|
|
5
|
+
export declare function trackedHost(context: InstallContext, spec: ModSpec, host: Host): Host;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { equalSettings } from '@fbincon/statusline-core/json-equality';
|
|
3
|
+
import { object } from '@fbincon/statusline-core/config/validation';
|
|
4
|
+
import { UnconfirmedOperation } from '@fbincon/statusline-platform/plugin-host';
|
|
5
|
+
import { resolvedPath } from '@fbincon/statusline-platform/commands';
|
|
6
|
+
import { owner, registered, cacheOwned } from '../integration/mod-ownership.js';
|
|
7
|
+
import { bindingMatches } from '../integration/mods.js';
|
|
8
|
+
import { base, persist, complete, checkpoint, assertClear, active, RecoveryRequired } from './journal.js';
|
|
9
|
+
function inspect(context, spec, host, args) {
|
|
10
|
+
const marker = owner(context.configDir, spec, context.io, true), [markets, plugins] = host.listing();
|
|
11
|
+
const [registeredMarket, row] = registered(context.configDir, spec, markets, plugins, marker);
|
|
12
|
+
let currentCache = false;
|
|
13
|
+
if (row) {
|
|
14
|
+
cacheOwned(context.configDir, spec, row, marker, context.io);
|
|
15
|
+
try {
|
|
16
|
+
cacheOwned(context.configDir, spec, row, marker, context.io, true);
|
|
17
|
+
currentCache = true;
|
|
18
|
+
}
|
|
19
|
+
catch { /* A verified historical cache is distinguishable from the new one. */ }
|
|
20
|
+
}
|
|
21
|
+
const plugin = row ? Object.fromEntries(['id', 'scope', 'version', 'installPath', 'enabled'].map(key => [key, key === 'installPath' && typeof row[key] === 'string' ? resolvedPath(row[key]) : row[key] ?? null])) : null;
|
|
22
|
+
const configured = row && ['configure', 'install', 'update'].includes(args[0] ?? '') ? host.run(['configure', spec.plugin, '--json'], undefined, true) : null;
|
|
23
|
+
return { market: registeredMarket ? { name: spec.marketplace, path: resolvedPath(join(context.configDir, spec.name)), source: 'directory' } : null, plugin, inputs: object(configured) ? configured.inputs ?? null : null, currentCache };
|
|
24
|
+
}
|
|
25
|
+
function mutation(args) {
|
|
26
|
+
return ['install', 'uninstall', 'update', 'enable', 'disable'].includes(args[0] ?? '') || args[0] === 'configure' && args.includes('--values-stdin') || args[0] === 'marketplace' && ['add', 'remove', 'update'].includes(args[1] ?? '');
|
|
27
|
+
}
|
|
28
|
+
function validate(journal, spec) {
|
|
29
|
+
const args = journal.args, operation = args[0];
|
|
30
|
+
if (!mutation(args) || operation === 'marketplace' && (args[1] === 'add' ? resolvedPath(args[2]) !== resolvedPath(join(journal.configDir, spec.name)) : args[2] !== spec.marketplace) || operation !== 'marketplace' && args[1] !== spec.plugin)
|
|
31
|
+
throw new RecoveryRequired('Untrusted official operation identity');
|
|
32
|
+
if (journal.values && (operation !== 'configure' || !args.includes('--values-stdin')))
|
|
33
|
+
throw new RecoveryRequired('Unexpected official operation values');
|
|
34
|
+
let valid = false;
|
|
35
|
+
if (operation === 'marketplace')
|
|
36
|
+
valid = args[1] === 'remove' ? args.length === 5 && args[3] === '--scope' && args[4] === 'user' : args.length === 3;
|
|
37
|
+
else if (operation === 'configure')
|
|
38
|
+
valid = args.length === 3 && args[2] === '--values-stdin' && journal.values !== null;
|
|
39
|
+
else if (operation === 'uninstall')
|
|
40
|
+
valid = args.length === 4 && args[2] === '--scope' && args[3] === 'user';
|
|
41
|
+
else if (operation === 'install')
|
|
42
|
+
valid = args.length >= 5 && args[2] === '--scope' && args[3] === 'user' && args[4] === '--json' && (args.length - 5) % 2 === 0 && args.slice(5).every((arg, index) => index % 2 ? /^[A-Za-z]+=/u.test(arg) : arg === '--config');
|
|
43
|
+
else
|
|
44
|
+
valid = args.length === 5 && args[2] === '--scope' && args[3] === 'user' && args[4] === '--json';
|
|
45
|
+
if (!valid)
|
|
46
|
+
throw new RecoveryRequired('Unsupported official operation checkpoint');
|
|
47
|
+
}
|
|
48
|
+
function expected(journal, state) {
|
|
49
|
+
const args = journal.args;
|
|
50
|
+
if (args[0] === 'marketplace')
|
|
51
|
+
return args[1] === 'remove' ? state.market === null : state.market !== null;
|
|
52
|
+
if (args[0] === 'uninstall')
|
|
53
|
+
return state.plugin === null;
|
|
54
|
+
if (!state.plugin)
|
|
55
|
+
return false;
|
|
56
|
+
if (args[0] === 'enable' || args[0] === 'disable')
|
|
57
|
+
return state.plugin.enabled === (args[0] === 'enable');
|
|
58
|
+
if (args[0] === 'configure')
|
|
59
|
+
return bindingMatches({ inputs: state.inputs }, journal.values ?? {});
|
|
60
|
+
if (!state.currentCache)
|
|
61
|
+
return false;
|
|
62
|
+
const values = Object.fromEntries(args.flatMap((value, index) => args[index - 1] === '--config' && value.includes('=') ? [[value.slice(0, value.indexOf('=')), value.slice(value.indexOf('=') + 1)]] : []));
|
|
63
|
+
return args[0] === 'update' || state.plugin.enabled === true && bindingMatches({ inputs: state.inputs }, values);
|
|
64
|
+
}
|
|
65
|
+
/** Only inventory/configuration reads are used during recovery. Mutating argv is never replayed. */
|
|
66
|
+
export function reconcile(context, spec, host, journal, dryRun = false) {
|
|
67
|
+
validate(journal, spec);
|
|
68
|
+
if (active(journal))
|
|
69
|
+
throw new RecoveryRequired('Official operation owner is still running');
|
|
70
|
+
const actual = inspect(context, spec, host, journal.args);
|
|
71
|
+
const before = structuredClone(journal.before);
|
|
72
|
+
if (object(before))
|
|
73
|
+
for (const [key, field] of [['market', 'path'], ['plugin', 'installPath']])
|
|
74
|
+
if (object(before[key]) && typeof before[key][field] === 'string')
|
|
75
|
+
before[key][field] = resolvedPath(before[key][field]);
|
|
76
|
+
const state = expected(journal, actual) ? 'confirmed' : equalSettings(actual, before) ? 'not-applied' : null;
|
|
77
|
+
if (!state)
|
|
78
|
+
throw new RecoveryRequired('Official operation is still ambiguous; inspect its inventory and binding before retrying');
|
|
79
|
+
if (!dryRun)
|
|
80
|
+
complete(journal);
|
|
81
|
+
return state;
|
|
82
|
+
}
|
|
83
|
+
export function trackedHost(context, spec, host) {
|
|
84
|
+
return {
|
|
85
|
+
listing: () => host.listing(),
|
|
86
|
+
run(args, values, json) {
|
|
87
|
+
if (!mutation(args))
|
|
88
|
+
return host.run(args, values, json);
|
|
89
|
+
return context.io.lock(context.configDir, () => {
|
|
90
|
+
assertClear(context.configDir);
|
|
91
|
+
const journal = { ...base(context.configDir, args.slice(0, 2).join(' '), 'official'), kind: 'official', spec: spec.name, args: [...args], values: values ?? null, before: inspect(context, spec, host, args), phase: 'prepared' };
|
|
92
|
+
validate(journal, spec);
|
|
93
|
+
persist(journal);
|
|
94
|
+
checkpoint('official-prepared', journal);
|
|
95
|
+
try {
|
|
96
|
+
const result = host.run(args, values, json);
|
|
97
|
+
checkpoint('official-returned', journal);
|
|
98
|
+
const actual = inspect(context, spec, host, args);
|
|
99
|
+
if (!expected(journal, actual))
|
|
100
|
+
throw new UnconfirmedOperation('Official plugin result was not confirmed by inventory and binding');
|
|
101
|
+
complete(journal);
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
if (!(error instanceof UnconfirmedOperation)) {
|
|
106
|
+
try {
|
|
107
|
+
if (equalSettings(inspect(context, spec, host, args), journal.before)) {
|
|
108
|
+
complete(journal);
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (checked) {
|
|
113
|
+
if (checked === error)
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
journal.phase = 'uncertain';
|
|
118
|
+
persist(journal);
|
|
119
|
+
throw new RecoveryRequired(String(error) + '; run `claude-statusline recover` to reconcile the official operation');
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=official.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"official.js","sourceRoot":"","sources":["../../../src/recovery/official.ts"],"names":[],"mappings":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C,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type InstallContext } from '../integration/model.js';
|
|
2
|
+
export declare function administration<T>(context: InstallContext, dryRun: boolean, action: (tracked: InstallContext) => T): T;
|
|
3
|
+
export interface RecoveryResult {
|
|
4
|
+
changed: boolean;
|
|
5
|
+
transactions: {
|
|
6
|
+
id: string;
|
|
7
|
+
kind: string;
|
|
8
|
+
outcome: string;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
11
|
+
export declare function recover(context: InstallContext, dryRun?: boolean): RecoveryResult;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { withLock } from '@fbincon/statusline-platform/files';
|
|
3
|
+
import { NATIVE, RUNTIME } from '../integration/model.js';
|
|
4
|
+
import { pending, readJournal, assertClear, refreshIntents, permitRefresh, RecoveryRequired } from './journal.js';
|
|
5
|
+
import { install } from '../integration/install.js';
|
|
6
|
+
import { safeTarget } from '../integration/paths.js';
|
|
7
|
+
import { recoverFiles } from './files.js';
|
|
8
|
+
import { reconcile, trackedHost } from './official.js';
|
|
9
|
+
export function administration(context, dryRun, action) {
|
|
10
|
+
assertClear(context.configDir, true);
|
|
11
|
+
if (dryRun)
|
|
12
|
+
return action(context);
|
|
13
|
+
const lock = join(context.configDir, 'statusline_runtime/admin.lock');
|
|
14
|
+
safeTarget(context.configDir, lock);
|
|
15
|
+
return withLock(lock, () => {
|
|
16
|
+
assertClear(context.configDir, true);
|
|
17
|
+
return permitRefresh(context.configDir, () => action({ ...context, host: spec => trackedHost(context, spec, context.host(spec)) }));
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export function recover(context, dryRun = false) {
|
|
21
|
+
const paths = pending(context.configDir);
|
|
22
|
+
const intents = refreshIntents(context.configDir);
|
|
23
|
+
if (!paths.length && !intents.length)
|
|
24
|
+
return { changed: false, transactions: [] };
|
|
25
|
+
function finishRefresh(result) {
|
|
26
|
+
const remaining = refreshIntents(context.configDir);
|
|
27
|
+
if (!remaining.length)
|
|
28
|
+
return result;
|
|
29
|
+
if (!dryRun) {
|
|
30
|
+
const installed = install(context);
|
|
31
|
+
if (installed.failed || refreshIntents(context.configDir).length)
|
|
32
|
+
throw new RecoveryRequired('Plugin refresh is still incomplete; inspect doctor and the official inventory');
|
|
33
|
+
}
|
|
34
|
+
return { changed: result.changed || !dryRun, transactions: [...result.transactions, ...remaining.map(id => ({ id, kind: 'plugin-refresh', outcome: 'restore-disabled' }))] };
|
|
35
|
+
}
|
|
36
|
+
if (!paths.length)
|
|
37
|
+
return finishRefresh({ changed: false, transactions: [] });
|
|
38
|
+
function run() {
|
|
39
|
+
const current = pending(context.configDir);
|
|
40
|
+
if (!current.length)
|
|
41
|
+
return { changed: false, transactions: [] };
|
|
42
|
+
if (current.length > 1)
|
|
43
|
+
throw new RecoveryRequired('Multiple pending transactions require inspection; no automatic ordering is assumed');
|
|
44
|
+
const journal = readJournal(context.configDir, current[0]);
|
|
45
|
+
const spec = journal.kind === 'official' && journal.spec === RUNTIME.name ? RUNTIME : NATIVE;
|
|
46
|
+
const outcome = journal.kind === 'files' ? recoverFiles(journal, context.io, dryRun) : reconcile(context, spec, context.host(spec), journal, dryRun);
|
|
47
|
+
return { changed: !dryRun, transactions: [{ id: journal.id, kind: journal.kind, outcome }] };
|
|
48
|
+
}
|
|
49
|
+
if (dryRun)
|
|
50
|
+
return finishRefresh(run());
|
|
51
|
+
const lock = join(context.configDir, 'statusline_runtime/admin.lock');
|
|
52
|
+
safeTarget(context.configDir, lock);
|
|
53
|
+
return finishRefresh(withLock(lock, () => context.io.lock(context.configDir, run)));
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/recovery/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MA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15 @@
|
|
|
1
|
+
import type { DisplayDraft } from '@fbincon/statusline-core/contracts/ui';
|
|
2
|
+
import type { RenderEnvironment } from '@fbincon/statusline-core/rendering/context';
|
|
3
|
+
import { Presentation } from '@fbincon/statusline-core/rendering/language';
|
|
4
|
+
import type { RuntimeContext } from '../runtime/context.js';
|
|
5
|
+
export interface EnvironmentOptions {
|
|
6
|
+
configDir?: string;
|
|
7
|
+
home?: string;
|
|
8
|
+
runtime?: RuntimeContext;
|
|
9
|
+
now?: () => number;
|
|
10
|
+
observations?: Partial<RenderEnvironment>;
|
|
11
|
+
}
|
|
12
|
+
export declare function presentation(language: string): Promise<Presentation>;
|
|
13
|
+
export declare function baseEnvironment(language: Presentation, options?: EnvironmentOptions): RenderEnvironment;
|
|
14
|
+
/** Import sources for enabled components only; each source is collected lazily by RenderState. */
|
|
15
|
+
export declare function renderEnvironment(config: DisplayDraft, data: unknown, options?: EnvironmentOptions, subagents?: boolean): Promise<RenderEnvironment>;
|