@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,820 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Register,
|
|
3
|
+
EngineInterface,
|
|
4
|
+
PluginOptions,
|
|
5
|
+
Timer,
|
|
6
|
+
} from 'claude-code';
|
|
7
|
+
import {
|
|
8
|
+
BackendError,
|
|
9
|
+
parseResponse,
|
|
10
|
+
processFailure,
|
|
11
|
+
requestText,
|
|
12
|
+
} from '../lib/backend.ts';
|
|
13
|
+
import { Editor, copyDraft, sameDraft } from '../lib/editor/draft.ts';
|
|
14
|
+
import { createReview } from '../lib/editor/import-review.ts';
|
|
15
|
+
import { canEdit, validPreferenceValue, preferences, preferenceChanged } from '../lib/preferences.ts';
|
|
16
|
+
import type {
|
|
17
|
+
Draft,
|
|
18
|
+
Operation,
|
|
19
|
+
ResultFor,
|
|
20
|
+
} from '../lib/generated-contracts.ts';
|
|
21
|
+
import { MIN_COLUMNS, MIN_ROWS, contentColumns } from '../ui/layout.ts';
|
|
22
|
+
import { recoveryButton, styles } from '../ui/theme.ts';
|
|
23
|
+
import { clientProps } from '../lib/session.ts';
|
|
24
|
+
import type { View } from '../lib/session.ts';
|
|
25
|
+
import { parseBatch } from '../lib/client/messages.ts';
|
|
26
|
+
import { handleKey } from '../lib/client/keys.ts';
|
|
27
|
+
import { DEFAULT_PREVIEW_BACKGROUND, PREVIEW_BACKGROUND_KEY, previewBackground } from '../lib/preview-preferences.ts';
|
|
28
|
+
import type { PreviewBackground } from '../lib/preview-preferences.ts';
|
|
29
|
+
import { text as localizedText, t } from '../lib/i18n/index.ts';
|
|
30
|
+
import type { Language } from '../lib/i18n/index.ts';
|
|
31
|
+
import { setMessage, failureMessage, setResult, viewMessage } from '../lib/i18n/messages.ts';
|
|
32
|
+
import { binding } from '../lib/launch.ts';
|
|
33
|
+
|
|
34
|
+
const PANE = 'statusline-native';
|
|
35
|
+
const COMMAND = 'statusline-configure-native';
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
async function callBackend<O extends Operation>(
|
|
39
|
+
$: EngineInterface,
|
|
40
|
+
options: PluginOptions,
|
|
41
|
+
operation: O,
|
|
42
|
+
payload: unknown = {},
|
|
43
|
+
): Promise<ResultFor<O>> {
|
|
44
|
+
try {
|
|
45
|
+
const launch = binding(options, await $.env.get('CLAUDE_STATUSLINE_NATIVE_EXECUTABLE') || undefined);
|
|
46
|
+
const directory =
|
|
47
|
+
(await $.env.get('CLAUDE_CONFIG_DIR')) ||
|
|
48
|
+
(typeof options.configDir === 'string' ? options.configDir : undefined);
|
|
49
|
+
const argv = directory
|
|
50
|
+
? [launch.executable, ...launch.args, 'ui', '--config-dir', directory]
|
|
51
|
+
: [launch.executable, ...launch.args, 'ui'];
|
|
52
|
+
const output = await $.process.run(argv, {
|
|
53
|
+
stdin: requestText(operation, payload),
|
|
54
|
+
timeoutMs: 30000,
|
|
55
|
+
});
|
|
56
|
+
const result = parseResponse(operation, output);
|
|
57
|
+
if (
|
|
58
|
+
'backend_version' in result &&
|
|
59
|
+
typeof options.backendVersion === 'string' &&
|
|
60
|
+
options.backendVersion &&
|
|
61
|
+
result.backend_version !== options.backendVersion
|
|
62
|
+
) {
|
|
63
|
+
throw new BackendError(
|
|
64
|
+
'backend_version_mismatch',
|
|
65
|
+
localizedText("native.hooks.register.the_installed_mod_and_backend_versions_differ_reinstall"),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
} catch (error) {
|
|
70
|
+
throw processFailure(error);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function emptyView(): View {
|
|
75
|
+
return {
|
|
76
|
+
language: 'en',
|
|
77
|
+
previewBackground: DEFAULT_PREVIEW_BACKGROUND,
|
|
78
|
+
editor: null,
|
|
79
|
+
input: null,
|
|
80
|
+
preview: null,
|
|
81
|
+
preferences: [],
|
|
82
|
+
preferencesError: '',
|
|
83
|
+
error: '',
|
|
84
|
+
previewError: '',
|
|
85
|
+
previewBusy: false,
|
|
86
|
+
message: '',
|
|
87
|
+
busy: '',
|
|
88
|
+
uncertain: false,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function failureText(failure: unknown): string {
|
|
93
|
+
const error = processFailure(failure);
|
|
94
|
+
return `${error.code}: ${error.message}`.replace(
|
|
95
|
+
/[\x00-\x08\x0b-\x1f\x7f]/g,
|
|
96
|
+
'',
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface Session {
|
|
101
|
+
uiLanguage: Language;
|
|
102
|
+
previewBackground: PreviewBackground;
|
|
103
|
+
ownsCommand: boolean;
|
|
104
|
+
view: View;
|
|
105
|
+
ack: number;
|
|
106
|
+
generation: number;
|
|
107
|
+
columns: number;
|
|
108
|
+
rows: number;
|
|
109
|
+
placed: boolean;
|
|
110
|
+
clientFault: string;
|
|
111
|
+
inputChain: Promise<void>;
|
|
112
|
+
epoch: number;
|
|
113
|
+
previewKey: string;
|
|
114
|
+
previewTimer: Timer | null;
|
|
115
|
+
writing: boolean;
|
|
116
|
+
pendingSave: { draft: Draft; revision: string } | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function discard(state: Session): void {
|
|
120
|
+
state.previewTimer?.cancel();
|
|
121
|
+
state.previewTimer = null;
|
|
122
|
+
state.epoch += 1;
|
|
123
|
+
state.view = emptyView();
|
|
124
|
+
state.previewKey = '';
|
|
125
|
+
state.writing = false;
|
|
126
|
+
state.pendingSave = null;
|
|
127
|
+
state.ack = 0;
|
|
128
|
+
state.placed = false;
|
|
129
|
+
state.clientFault = '';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function props(state: Session) {
|
|
133
|
+
return clientProps(
|
|
134
|
+
state.view,
|
|
135
|
+
state.epoch,
|
|
136
|
+
state.ack,
|
|
137
|
+
++state.generation,
|
|
138
|
+
state.columns,
|
|
139
|
+
state.rows,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function load(
|
|
144
|
+
$: EngineInterface,
|
|
145
|
+
state: Session,
|
|
146
|
+
options: PluginOptions,
|
|
147
|
+
) {
|
|
148
|
+
discard(state);
|
|
149
|
+
const opening = state.epoch;
|
|
150
|
+
setMessage(state.view, "busy", localizedText("native.hooks.register.loading_configuration"));
|
|
151
|
+
$.ui.invalidate('ui.render');
|
|
152
|
+
try {
|
|
153
|
+
const description = await callBackend($, options, 'describe');
|
|
154
|
+
const current = await callBackend($, options, 'read');
|
|
155
|
+
if (state.epoch !== opening) return;
|
|
156
|
+
if (description.backend_version !== current.backend_version) {
|
|
157
|
+
throw new BackendError(
|
|
158
|
+
'backend_version_mismatch',
|
|
159
|
+
localizedText("native.hooks.register.the_backend_changed_while_opening_reopen_the_editor"),
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
state.view.editor = new Editor(description, current);
|
|
163
|
+
try {
|
|
164
|
+
const preference = await callBackend($, options, 'read_ui_preferences');
|
|
165
|
+
if (state.epoch !== opening) return;
|
|
166
|
+
state.uiLanguage = preference.ui_language;
|
|
167
|
+
state.view.language = preference.ui_language;
|
|
168
|
+
if (preference.warning) setMessage(state.view, 'message', preference.warning);
|
|
169
|
+
} catch (failure) {
|
|
170
|
+
if (state.epoch === opening) {
|
|
171
|
+
state.view.language = state.uiLanguage;
|
|
172
|
+
setMessage(state.view, 'message', localizedText('native.language_read_failed', { detail: failureMessage(failure) }));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
const background = previewBackground(await $.store.get(PREVIEW_BACKGROUND_KEY));
|
|
177
|
+
if (state.epoch === opening) {
|
|
178
|
+
state.previewBackground = background;
|
|
179
|
+
state.view.previewBackground = background;
|
|
180
|
+
}
|
|
181
|
+
} catch {
|
|
182
|
+
if (state.epoch === opening) {
|
|
183
|
+
state.view.previewBackground = state.previewBackground;
|
|
184
|
+
setMessage(state.view, "message", localizedText("native.hooks.register.preview_background_preference_unavailable_using_the_last_choice"));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (!current.installed)
|
|
188
|
+
setMessage(state.view, "message", localizedText("native.hooks.register.the_renderer_is_not_installed_run_claude_statusline"));
|
|
189
|
+
try {
|
|
190
|
+
const rows = await $.config.list();
|
|
191
|
+
if (state.epoch === opening) state.view.preferences = preferences(rows);
|
|
192
|
+
} catch (failure) {
|
|
193
|
+
if (state.epoch === opening)
|
|
194
|
+
setMessage(state.view, "preferencesError", localizedText("native.hooks.register.host_preferences_unavailable", {value0: failureMessage(failure)}));
|
|
195
|
+
}
|
|
196
|
+
} catch (failure) {
|
|
197
|
+
if (state.epoch === opening) setMessage(state.view, "error", failureMessage(failure));
|
|
198
|
+
} finally {
|
|
199
|
+
if (state.epoch === opening) {
|
|
200
|
+
state.view.busy = '';
|
|
201
|
+
$.ui.invalidate('ui.render');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async function reconcile(
|
|
207
|
+
$: EngineInterface,
|
|
208
|
+
state: Session,
|
|
209
|
+
options: PluginOptions,
|
|
210
|
+
) {
|
|
211
|
+
const editor = state.view.editor;
|
|
212
|
+
const submitted = state.pendingSave;
|
|
213
|
+
if (!editor || !submitted || state.writing) return;
|
|
214
|
+
const saving = state.epoch;
|
|
215
|
+
state.writing = true;
|
|
216
|
+
setMessage(state.view, "busy", localizedText("native.hooks.register.checking_saved_configuration"));
|
|
217
|
+
$.ui.invalidate('ui.render');
|
|
218
|
+
try {
|
|
219
|
+
const current = await callBackend($, options, 'read');
|
|
220
|
+
if (state.epoch !== saving) return;
|
|
221
|
+
if (
|
|
222
|
+
sameDraft(current.draft, submitted.draft) &&
|
|
223
|
+
current.installed &&
|
|
224
|
+
JSON.stringify(current.installation) ===
|
|
225
|
+
JSON.stringify(editor.baseline.installation)
|
|
226
|
+
) {
|
|
227
|
+
editor.committed(current);
|
|
228
|
+
setMessage(state.view, "message", localizedText("native.hooks.register.the_submitted_tool_configuration_is_saved"));
|
|
229
|
+
state.view.error = '';
|
|
230
|
+
} else if (current.revision === submitted.revision) {
|
|
231
|
+
setMessage(state.view, "message", localizedText("native.hooks.register.no_tool_changes_were_committed_review_the_draft"));
|
|
232
|
+
state.view.error = '';
|
|
233
|
+
} else {
|
|
234
|
+
setMessage(state.view, "error", localizedText("native.hooks.register.configuration_conflict_saved_configuration_differs_discard_the_draft"));
|
|
235
|
+
}
|
|
236
|
+
state.pendingSave = null;
|
|
237
|
+
state.view.uncertain = false;
|
|
238
|
+
} catch (failure) {
|
|
239
|
+
if (state.epoch === saving)
|
|
240
|
+
setMessage(state.view, "error", localizedText("native.hooks.register.save_outcome_remains_unknown", {value0: failureMessage(failure)}));
|
|
241
|
+
} finally {
|
|
242
|
+
if (state.epoch === saving) {
|
|
243
|
+
state.writing = false;
|
|
244
|
+
state.view.busy = '';
|
|
245
|
+
$.ui.invalidate('ui.render');
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
async function save(
|
|
251
|
+
$: EngineInterface,
|
|
252
|
+
state: Session,
|
|
253
|
+
options: PluginOptions,
|
|
254
|
+
finish = false,
|
|
255
|
+
) {
|
|
256
|
+
const editor = state.view.editor;
|
|
257
|
+
if (!editor || state.writing || state.view.uncertain) return;
|
|
258
|
+
if (!editor.acceptNumeric()) {
|
|
259
|
+
setMessage(state.view, "error", localizedText("native.hooks.register.correct_the_numeric_fields_before_saving"));
|
|
260
|
+
editor.page = 'settings';
|
|
261
|
+
editor.setting = Object.keys(editor.fieldErrors)[0] || 'padding';
|
|
262
|
+
$.ui.invalidate('ui.render');
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const saving = state.epoch;
|
|
266
|
+
const submitted = {
|
|
267
|
+
draft: copyDraft(editor.draft),
|
|
268
|
+
revision: editor.baseline.revision,
|
|
269
|
+
};
|
|
270
|
+
state.pendingSave = submitted;
|
|
271
|
+
state.writing = true;
|
|
272
|
+
setMessage(state.view, "busy", localizedText("native.hooks.register.saving_tool_configuration"));
|
|
273
|
+
state.view.error = '';
|
|
274
|
+
let saved = false;
|
|
275
|
+
$.ui.invalidate('ui.render');
|
|
276
|
+
try {
|
|
277
|
+
const result = await callBackend($, options, 'apply', {
|
|
278
|
+
draft: submitted.draft,
|
|
279
|
+
expected_revision: submitted.revision,
|
|
280
|
+
});
|
|
281
|
+
if (state.epoch !== saving) return;
|
|
282
|
+
editor.committed(result);
|
|
283
|
+
state.pendingSave = null;
|
|
284
|
+
saved = true;
|
|
285
|
+
setMessage(state.view, "message", (result.changed ? localizedText("native.hooks.register.tool_configuration_saved_later_statusline_refreshes_use_these") : localizedText("native.hooks.register.tool_configuration_is_already_current")));
|
|
286
|
+
} catch (failure) {
|
|
287
|
+
if (state.epoch !== saving) return;
|
|
288
|
+
const error = processFailure(failure);
|
|
289
|
+
setMessage(state.view, "error", failureMessage(error));
|
|
290
|
+
const refused = [
|
|
291
|
+
'invalid_request',
|
|
292
|
+
'invalid_configuration',
|
|
293
|
+
'configuration_conflict',
|
|
294
|
+
'not_installed',
|
|
295
|
+
'ownership_mismatch',
|
|
296
|
+
'unsupported_protocol',
|
|
297
|
+
'unsupported_operation',
|
|
298
|
+
].includes(error.code);
|
|
299
|
+
state.view.uncertain = !refused;
|
|
300
|
+
if (refused) state.pendingSave = null;
|
|
301
|
+
} finally {
|
|
302
|
+
if (state.epoch === saving) {
|
|
303
|
+
state.writing = false;
|
|
304
|
+
state.view.busy = '';
|
|
305
|
+
$.ui.invalidate('ui.render');
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (finish && saved && state.epoch === saving) {
|
|
309
|
+
if (state.view.preferences.some(preferenceChanged)) {
|
|
310
|
+
editor.page = 'settings';
|
|
311
|
+
editor.advanced = true;
|
|
312
|
+
editor.setting =
|
|
313
|
+
'host-' + state.view.preferences.find(preferenceChanged)!.row.key;
|
|
314
|
+
setMessage(state.view, "message", localizedText("native.hooks.register.tool_configuration_saved_host_changes_pending_a_apply"));
|
|
315
|
+
$.ui.invalidate('ui.render');
|
|
316
|
+
} else await close($, state);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
async function transferDraft($: EngineInterface, state: Session, options: PluginOptions) {
|
|
321
|
+
const e = state.view.editor;
|
|
322
|
+
const action = e?.pendingTransfer;
|
|
323
|
+
if (!e || !action || state.writing || state.view.uncertain) return;
|
|
324
|
+
const epoch = state.epoch;
|
|
325
|
+
e.pendingTransfer = null;
|
|
326
|
+
state.writing = true;
|
|
327
|
+
setMessage(state.view, "busy", (action === 'export' ? localizedText("native.hooks.register.exporting_current_draft_may_be_unsaved") : localizedText("native.hooks.register.loading_draft")));
|
|
328
|
+
$.ui.invalidate('ui.render');
|
|
329
|
+
try {
|
|
330
|
+
if (action === 'import') {
|
|
331
|
+
const original = copyDraft(e.draft);
|
|
332
|
+
const candidate = new Editor(e.description, {...e.baseline, draft:copyDraft(e.draft)});
|
|
333
|
+
candidate.buffers = {...e.buffers};
|
|
334
|
+
if (!candidate.acceptNumeric()) { setMessage(state.view, 'message', localizedText('native.hooks.register.correct_numeric_fields_first')); return; }
|
|
335
|
+
const result = await callBackend($, options, 'review_import', {draft:copyDraft(candidate.draft), path:e.path});
|
|
336
|
+
if (state.epoch === epoch && state.view.editor === e) {
|
|
337
|
+
if (!sameDraft(e.draft, original)) { setMessage(state.view, 'message', localizedText('review.stale')); return; }
|
|
338
|
+
e.review = createReview(result);
|
|
339
|
+
state.view.preview = null;
|
|
340
|
+
state.previewKey = '';
|
|
341
|
+
state.view.message = '';
|
|
342
|
+
}
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
if (!e.acceptNumeric()) { setMessage(state.view, "message", localizedText("native.hooks.register.correct_numeric_fields_first")); return; }
|
|
346
|
+
const payload = action === 'preset' ? { draft: copyDraft(e.draft), preset: e.preset } : { draft: copyDraft(e.draft), path: e.path, overwrite: false };
|
|
347
|
+
if (action === 'export') {
|
|
348
|
+
const result = await callBackend($, options, action, payload);
|
|
349
|
+
if (state.epoch === epoch) setMessage(state.view, "message", localizedText("native.hooks.register.exported_current_draft_may_be_unsaved", {path: result.path}));
|
|
350
|
+
} else {
|
|
351
|
+
const result = await callBackend($, options, action, payload);
|
|
352
|
+
if (state.epoch === epoch) {
|
|
353
|
+
e.replaceDraft(result.draft);
|
|
354
|
+
setMessage(state.view, "message", localizedText("native.hooks.register.draft_replaced_review_preview_and_save_or_discard"));
|
|
355
|
+
state.previewKey = '';
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
} catch (failure) {
|
|
359
|
+
if (state.epoch === epoch) setMessage(state.view, "message", failureMessage(failure));
|
|
360
|
+
} finally {
|
|
361
|
+
if (state.epoch === epoch) {
|
|
362
|
+
state.writing = false;
|
|
363
|
+
state.view.busy = '';
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
async function applyPreferences(
|
|
369
|
+
$: EngineInterface,
|
|
370
|
+
state: Session,
|
|
371
|
+
options: PluginOptions,
|
|
372
|
+
) {
|
|
373
|
+
if (state.writing || state.view.uncertain) return;
|
|
374
|
+
const applying = state.epoch;
|
|
375
|
+
state.writing = true;
|
|
376
|
+
setMessage(state.view, "busy", localizedText("native.hooks.register.applying_host_preferences"));
|
|
377
|
+
state.view.message = '';
|
|
378
|
+
state.view.preferencesError = '';
|
|
379
|
+
$.ui.invalidate('ui.render');
|
|
380
|
+
try {
|
|
381
|
+
for (const preference of state.view.preferences.filter(preferenceChanged)) {
|
|
382
|
+
const rows = await $.config.list();
|
|
383
|
+
if (state.epoch !== applying) return;
|
|
384
|
+
const latest = rows.find((row) => row.key === preference.row.key);
|
|
385
|
+
if (!latest) {
|
|
386
|
+
setResult(preference, localizedText("native.hooks.register.unavailable_not_applied"));
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
if (
|
|
390
|
+
JSON.stringify(latest.value) !== JSON.stringify(preference.baseline) ||
|
|
391
|
+
latest.kind !== preference.row.kind ||
|
|
392
|
+
JSON.stringify(latest.provider) !==
|
|
393
|
+
JSON.stringify(preference.row.provider)
|
|
394
|
+
) {
|
|
395
|
+
setResult(preference, localizedText("native.hooks.register.changed_elsewhere_discard_and_reload_before_applying"));
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
preference.row = latest;
|
|
399
|
+
if (!canEdit(preference)) {
|
|
400
|
+
setResult(preference, (latest.isLocked ? localizedText("native.hooks.register.locked_by_host_policy_not_applied") : localizedText("native.hooks.register.unsupported_control_not_applied")));
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
403
|
+
if (!validPreferenceValue(preference)) {
|
|
404
|
+
setResult(preference, localizedText("native.hooks.register.value_no_longer_fits_this_row_discard_and"));
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
try {
|
|
408
|
+
const result = await $.config.set({
|
|
409
|
+
key: latest.key,
|
|
410
|
+
value: preference.value,
|
|
411
|
+
});
|
|
412
|
+
if (state.epoch !== applying) return;
|
|
413
|
+
if (result.deny !== undefined) {
|
|
414
|
+
setResult(preference, localizedText("native.hooks.register.refused", {deny: result.deny}));
|
|
415
|
+
} else {
|
|
416
|
+
preference.baseline = result.value;
|
|
417
|
+
preference.value = result.value;
|
|
418
|
+
preference.row = { ...latest, value: result.value };
|
|
419
|
+
setResult(preference, localizedText("native.hooks.register.applied"));
|
|
420
|
+
}
|
|
421
|
+
} catch (failure) {
|
|
422
|
+
if (state.epoch !== applying) return;
|
|
423
|
+
setResult(preference, localizedText("native.hooks.register.could_not_confirm_application_discard_and_reload_to", {value0: failureMessage(failure)}));
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
} catch (failure) {
|
|
427
|
+
if (state.epoch === applying)
|
|
428
|
+
setMessage(state.view, "preferencesError", failureMessage(failure));
|
|
429
|
+
} finally {
|
|
430
|
+
if (state.epoch === applying) {
|
|
431
|
+
state.writing = false;
|
|
432
|
+
state.view.busy = '';
|
|
433
|
+
$.ui.invalidate('ui.render');
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
async function close($: EngineInterface, state: Session) {
|
|
439
|
+
// A plugin's own API calls skip its hooks; guard programmatic close here too.
|
|
440
|
+
if (state.writing || state.view.uncertain) {
|
|
441
|
+
setMessage(state.view, "error", (state.writing ? localizedText("native.hooks.register.wait_for_the_apply_result_before_closing") : localizedText("native.hooks.register.check_the_saved_state_before_closing_the_save")));
|
|
442
|
+
$.ui.invalidate('ui.render');
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
try {
|
|
446
|
+
await $.ui.close({ id: PANE });
|
|
447
|
+
const open = await $.ui.panes();
|
|
448
|
+
if (!open.some((p) => p.id === PANE)) discard(state);
|
|
449
|
+
} catch (failure) {
|
|
450
|
+
setMessage(state.view, "error", failureMessage(failure));
|
|
451
|
+
$.ui.invalidate('ui.render');
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
async function openEditor(
|
|
456
|
+
$: EngineInterface,
|
|
457
|
+
state: Session,
|
|
458
|
+
options: PluginOptions,
|
|
459
|
+
) {
|
|
460
|
+
const tr = (key: string, params: Record<string, unknown> = {}) => t(key, state.view.language ?? 'en', params);
|
|
461
|
+
|
|
462
|
+
if (state.writing || state.view.uncertain)
|
|
463
|
+
return {
|
|
464
|
+
text: tr("native.hooks.register.finish_checking_the_pending_save_before_reopening_the"),
|
|
465
|
+
};
|
|
466
|
+
if (!state.placed) {
|
|
467
|
+
const opening = state.epoch + 1;
|
|
468
|
+
await load($, state, options);
|
|
469
|
+
if (state.epoch !== opening) return {};
|
|
470
|
+
}
|
|
471
|
+
const opened = await $.ui.open({
|
|
472
|
+
id: PANE,
|
|
473
|
+
title: tr("native.hooks.register.statusline_configuration"),
|
|
474
|
+
focus: true,
|
|
475
|
+
closeOnEscape: true,
|
|
476
|
+
rows: 24,
|
|
477
|
+
columns: 72,
|
|
478
|
+
});
|
|
479
|
+
state.placed = opened.isPlaced;
|
|
480
|
+
if (!opened.isPlaced) return { text: opened.reason };
|
|
481
|
+
return {};
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export const register: Register = (on, options) => {
|
|
485
|
+
const tr = (key: string, params: Record<string, unknown> = {}) => t(key, state.view.language ?? 'en', params);
|
|
486
|
+
|
|
487
|
+
const state: Session = {
|
|
488
|
+
uiLanguage: 'en',
|
|
489
|
+
previewBackground: DEFAULT_PREVIEW_BACKGROUND,
|
|
490
|
+
ownsCommand: false,
|
|
491
|
+
view: emptyView(),
|
|
492
|
+
epoch: 0,
|
|
493
|
+
ack: 0,
|
|
494
|
+
generation: 0,
|
|
495
|
+
columns: 72,
|
|
496
|
+
rows: 24,
|
|
497
|
+
placed: false,
|
|
498
|
+
clientFault: '',
|
|
499
|
+
inputChain: Promise.resolve(),
|
|
500
|
+
previewKey: '',
|
|
501
|
+
previewTimer: null,
|
|
502
|
+
writing: false,
|
|
503
|
+
pendingSave: null,
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
on('session.start', async ($, e, next) => {
|
|
507
|
+
state.ownsCommand = false;
|
|
508
|
+
discard(state);
|
|
509
|
+
const open = await $.ui.panes();
|
|
510
|
+
if (open.some((p) => p.id === PANE)) {
|
|
511
|
+
await $.ui.close({ id: PANE });
|
|
512
|
+
$.ui.toast('Statusline editor reloaded. Unsaved drafts were discarded.');
|
|
513
|
+
}
|
|
514
|
+
const commands = await $.command.list();
|
|
515
|
+
const collision = commands.find((command) => command.name === COMMAND);
|
|
516
|
+
if (collision && collision.plugin !== 'statusline-native') {
|
|
517
|
+
$.ui.log(
|
|
518
|
+
'/statusline-configure-native belongs to another command; the Client entry is inactive.',
|
|
519
|
+
);
|
|
520
|
+
} else {
|
|
521
|
+
await $.command.register({
|
|
522
|
+
name: 'statusline-configure-native',
|
|
523
|
+
description: tr("native.hooks.register.open_the_experimental_in_session_client_tui"),
|
|
524
|
+
});
|
|
525
|
+
state.ownsCommand = true;
|
|
526
|
+
}
|
|
527
|
+
return next(e);
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
on(
|
|
531
|
+
'command.run',
|
|
532
|
+
{ command: 'statusline-configure-native' },
|
|
533
|
+
async ($, e, next) => {
|
|
534
|
+
if (!state.ownsCommand) return next(e);
|
|
535
|
+
return openEditor($, state, options);
|
|
536
|
+
},
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
on('ui.close', { id: 'statusline-native' }, async ($, e, next) => {
|
|
540
|
+
if (e.origin.kind !== 'unload' && (state.writing || state.view.uncertain)) {
|
|
541
|
+
setMessage(state.view, "error", (state.writing ? localizedText("native.hooks.register.wait_for_the_apply_result_before_closing") : localizedText("native.hooks.register.check_the_saved_state_before_closing_the_save")));
|
|
542
|
+
$.ui.invalidate('ui.render');
|
|
543
|
+
return { deny: state.view.error };
|
|
544
|
+
}
|
|
545
|
+
const result = await next(e);
|
|
546
|
+
const open = await $.ui.panes();
|
|
547
|
+
if (!open.some((p) => p.id === PANE)) discard(state);
|
|
548
|
+
return result;
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
on('ui.message', { component: 'Pane' }, async ($, e, next) => {
|
|
552
|
+
if (
|
|
553
|
+
e.requestId !== PANE ||
|
|
554
|
+
e.element !== 'statusline-client' ||
|
|
555
|
+
e.module !== 'ui/client/surface.ts' ||
|
|
556
|
+
e.surface !== 'terminal' ||
|
|
557
|
+
!state.ownsCommand
|
|
558
|
+
)
|
|
559
|
+
return next(e);
|
|
560
|
+
const fault = e.data as { epoch?: unknown; fault?: unknown } | null;
|
|
561
|
+
if (
|
|
562
|
+
fault &&
|
|
563
|
+
typeof fault === 'object' &&
|
|
564
|
+
Object.keys(fault).sort().join(',') === 'epoch,fault' &&
|
|
565
|
+
fault.epoch === state.epoch &&
|
|
566
|
+
typeof fault.fault === 'string' &&
|
|
567
|
+
fault.fault.length > 0 &&
|
|
568
|
+
fault.fault.length <= 200
|
|
569
|
+
) {
|
|
570
|
+
state.clientFault = failureText(fault.fault);
|
|
571
|
+
$.ui.invalidate('ui.render');
|
|
572
|
+
return {};
|
|
573
|
+
}
|
|
574
|
+
const batch = parseBatch(e.data);
|
|
575
|
+
if (!batch) {
|
|
576
|
+
setMessage(state.view, "error", localizedText("native.hooks.register.invalid_client_input_retry_the_client_region"));
|
|
577
|
+
return { props: props(state) };
|
|
578
|
+
}
|
|
579
|
+
const run = state.inputChain.then(async () => {
|
|
580
|
+
if (batch.epoch !== state.epoch || !state.placed) return {};
|
|
581
|
+
const currentEpoch = state.epoch;
|
|
582
|
+
for (const message of batch.events) {
|
|
583
|
+
if (message.seq <= state.ack) continue;
|
|
584
|
+
if (message.seq !== state.ack + 1) {
|
|
585
|
+
setMessage(state.view, "error", localizedText("native.hooks.register.client_input_sequence_is_incomplete_retry_the_client"));
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
state.ack = message.seq;
|
|
589
|
+
state.view.message = '';
|
|
590
|
+
const effect = handleKey(
|
|
591
|
+
state.view,
|
|
592
|
+
message.event,
|
|
593
|
+
batch.columns,
|
|
594
|
+
batch.rows,
|
|
595
|
+
);
|
|
596
|
+
if (effect === 'save' || effect === 'finish') {
|
|
597
|
+
await save($, state, options, effect === 'finish');
|
|
598
|
+
} else if (effect === 'close') await close($, state);
|
|
599
|
+
else if (effect === 'reload') {
|
|
600
|
+
await load($, state, options);
|
|
601
|
+
state.placed = true;
|
|
602
|
+
} else if (effect === 'reconcile') await reconcile($, state, options);
|
|
603
|
+
else if (effect === 'transfer') await transferDraft($, state, options);
|
|
604
|
+
else if (effect === 'applyPreferences')
|
|
605
|
+
await applyPreferences($, state, options);
|
|
606
|
+
else if (effect === 'retry') state.previewKey = '';
|
|
607
|
+
else if (effect === 'reviewPreview') {
|
|
608
|
+
state.previewTimer?.cancel();
|
|
609
|
+
state.previewKey = '';
|
|
610
|
+
state.view.preview = null;
|
|
611
|
+
state.view.previewError = '';
|
|
612
|
+
}
|
|
613
|
+
else if (effect === 'uiLanguage') {
|
|
614
|
+
const requested = state.view.language ?? 'en';
|
|
615
|
+
try {
|
|
616
|
+
const preference = await callBackend($, options, 'set_ui_language', {ui_language: requested});
|
|
617
|
+
if (state.epoch === currentEpoch) {
|
|
618
|
+
state.uiLanguage = preference.ui_language;
|
|
619
|
+
state.view.language = preference.ui_language;
|
|
620
|
+
if (state.view.localized?.error?.key === 'native.language_save_failed') state.view.error = '';
|
|
621
|
+
setMessage(state.view, 'message', localizedText('native.language_saved'));
|
|
622
|
+
}
|
|
623
|
+
} catch (failure) {
|
|
624
|
+
if (state.epoch === currentEpoch) {
|
|
625
|
+
state.view.language = state.uiLanguage;
|
|
626
|
+
setMessage(state.view, 'error', localizedText('native.language_save_failed', {detail: failureMessage(failure)}));
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
else if (effect === 'previewBackground') {
|
|
631
|
+
const background = previewBackground(state.view.previewBackground);
|
|
632
|
+
try {
|
|
633
|
+
await $.store.set(PREVIEW_BACKGROUND_KEY, background);
|
|
634
|
+
if (state.epoch === currentEpoch) {
|
|
635
|
+
state.previewBackground = background;
|
|
636
|
+
if (state.view.localized?.error?.key === 'native.remember_preview_failed') state.view.error = '';
|
|
637
|
+
setMessage(state.view, "message", localizedText("native.hooks.register.preview_background_remembered_status_line_colors_unchanged"));
|
|
638
|
+
}
|
|
639
|
+
} catch {
|
|
640
|
+
if (state.epoch === currentEpoch) {
|
|
641
|
+
state.view.previewBackground = state.previewBackground;
|
|
642
|
+
setMessage(state.view, 'error', localizedText('native.remember_preview_failed'));
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
if (state.epoch !== currentEpoch) break;
|
|
647
|
+
}
|
|
648
|
+
$.ui.invalidate('ui.render');
|
|
649
|
+
if (state.epoch !== currentEpoch) return {};
|
|
650
|
+
return { props: props(state) };
|
|
651
|
+
});
|
|
652
|
+
state.inputChain = run.then(
|
|
653
|
+
() => {},
|
|
654
|
+
() => {},
|
|
655
|
+
);
|
|
656
|
+
return run;
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
on('ui.render', { component: 'Pane' }, async ($, e, next) => {
|
|
660
|
+
if (e.requestId !== PANE || !state.ownsCommand) return next(e);
|
|
661
|
+
const ui = $.ui.resolve(e);
|
|
662
|
+
if (e.surface !== 'terminal')
|
|
663
|
+
return ui.Text({
|
|
664
|
+
...styles.text,
|
|
665
|
+
children: [tr("native.hooks.register.open_this_editor_in_the_claude_code_terminal")],
|
|
666
|
+
});
|
|
667
|
+
const { Box, Text, Button, Client } = $.ui.resolve(e);
|
|
668
|
+
const width = Math.max(2, Math.min(10000, e.props.bodyColumns));
|
|
669
|
+
const height = Math.max(0, Math.min(10000, e.props.scroll.bodyRows));
|
|
670
|
+
state.columns = width;
|
|
671
|
+
state.rows = height;
|
|
672
|
+
const editor = state.view.editor;
|
|
673
|
+
const previewDraft = editor?.review?.result.draft ?? editor?.draft;
|
|
674
|
+
const previewColumns = contentColumns(width, height);
|
|
675
|
+
const key = `${state.epoch}:${previewColumns}:${previewDraft ? JSON.stringify(previewDraft) : ''}`;
|
|
676
|
+
if (
|
|
677
|
+
editor &&
|
|
678
|
+
width >= MIN_COLUMNS &&
|
|
679
|
+
height >= MIN_ROWS &&
|
|
680
|
+
!state.writing &&
|
|
681
|
+
state.previewKey !== key
|
|
682
|
+
) {
|
|
683
|
+
state.previewKey = key;
|
|
684
|
+
const requestedEpoch = state.epoch;
|
|
685
|
+
const draft = copyDraft(previewDraft!);
|
|
686
|
+
state.previewTimer?.cancel();
|
|
687
|
+
state.view.previewBusy = true;
|
|
688
|
+
state.previewTimer = $.clock.after(0, async () => {
|
|
689
|
+
try {
|
|
690
|
+
const preview = await callBackend($, options, 'preview', {
|
|
691
|
+
draft,
|
|
692
|
+
width: previewColumns,
|
|
693
|
+
});
|
|
694
|
+
if (state.epoch === requestedEpoch && state.previewKey === key) {
|
|
695
|
+
state.view.preview = preview;
|
|
696
|
+
state.view.previewError = '';
|
|
697
|
+
}
|
|
698
|
+
} catch (failure) {
|
|
699
|
+
if (state.epoch === requestedEpoch && state.previewKey === key) {
|
|
700
|
+
state.view.preview = null;
|
|
701
|
+
setMessage(state.view, "previewError", failureMessage(failure));
|
|
702
|
+
}
|
|
703
|
+
} finally {
|
|
704
|
+
if (state.epoch === requestedEpoch && state.previewKey === key) {
|
|
705
|
+
state.view.previewBusy = false;
|
|
706
|
+
state.previewTimer = null;
|
|
707
|
+
$.ui.invalidate('ui.render');
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
const retry = async () => {
|
|
713
|
+
if (state.writing || state.view.uncertain) return;
|
|
714
|
+
if (!state.view.editor) await load($, state, options);
|
|
715
|
+
else {
|
|
716
|
+
state.epoch++;
|
|
717
|
+
state.ack = 0;
|
|
718
|
+
state.clientFault = '';
|
|
719
|
+
state.view.error = '';
|
|
720
|
+
}
|
|
721
|
+
state.placed = true;
|
|
722
|
+
$.ui.invalidate('ui.render');
|
|
723
|
+
};
|
|
724
|
+
if (
|
|
725
|
+
editor &&
|
|
726
|
+
!state.clientFault &&
|
|
727
|
+
width >= MIN_COLUMNS &&
|
|
728
|
+
height >= MIN_ROWS
|
|
729
|
+
) {
|
|
730
|
+
return Box({
|
|
731
|
+
width,
|
|
732
|
+
height,
|
|
733
|
+
flexDirection: 'column',
|
|
734
|
+
children: [
|
|
735
|
+
Client({
|
|
736
|
+
key: 'statusline-client',
|
|
737
|
+
module: '../ui/client/surface.ts',
|
|
738
|
+
width,
|
|
739
|
+
height,
|
|
740
|
+
props: props(state),
|
|
741
|
+
}),
|
|
742
|
+
Box({
|
|
743
|
+
position: 'absolute',
|
|
744
|
+
top: 0,
|
|
745
|
+
right: 0,
|
|
746
|
+
width: 20,
|
|
747
|
+
height: 1,
|
|
748
|
+
flexDirection: 'row',
|
|
749
|
+
columnGap: 1,
|
|
750
|
+
children: [
|
|
751
|
+
Button({ ...recoveryButton, key: 'retry-client', label: tr("native.hooks.register.retry"), onPress: retry }),
|
|
752
|
+
Button({
|
|
753
|
+
...recoveryButton,
|
|
754
|
+
key: 'close',
|
|
755
|
+
label: tr("native.hooks.register.close"),
|
|
756
|
+
onPress: () => close($, state),
|
|
757
|
+
}),
|
|
758
|
+
],
|
|
759
|
+
}),
|
|
760
|
+
],
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
return Box({
|
|
764
|
+
backgroundColor: styles.text.backgroundColor,
|
|
765
|
+
flexDirection: 'column',
|
|
766
|
+
width,
|
|
767
|
+
// Keep the requested height while undersized; otherwise an inline host
|
|
768
|
+
// measures the short error tree and never grows it after a terminal resize.
|
|
769
|
+
height: Math.max(24, height),
|
|
770
|
+
children: [
|
|
771
|
+
Text({
|
|
772
|
+
...styles.text,
|
|
773
|
+
bold: true,
|
|
774
|
+
wrap: 'truncate',
|
|
775
|
+
children: [
|
|
776
|
+
width < MIN_COLUMNS || height < MIN_ROWS
|
|
777
|
+
? tr("native.hooks.register.resize_pane_to_32x12_draft_kept")
|
|
778
|
+
: state.clientFault
|
|
779
|
+
? tr("native.hooks.register.client_failed_received_draft_kept")
|
|
780
|
+
: viewMessage(state.view, 'busy') || tr("native.hooks.register.could_not_open_the_client_editor"),
|
|
781
|
+
],
|
|
782
|
+
}),
|
|
783
|
+
Text({
|
|
784
|
+
...styles.error,
|
|
785
|
+
wrap: 'truncate',
|
|
786
|
+
children: [state.clientFault || viewMessage(state.view, 'error') || ' '],
|
|
787
|
+
}),
|
|
788
|
+
...(state.view.uncertain
|
|
789
|
+
? [
|
|
790
|
+
Button({
|
|
791
|
+
...recoveryButton,
|
|
792
|
+
key: 'reconcile',
|
|
793
|
+
label: tr("native.hooks.register.check_saved_state"),
|
|
794
|
+
hotkey: 'k',
|
|
795
|
+
onPress: () => reconcile($, state, options),
|
|
796
|
+
}),
|
|
797
|
+
]
|
|
798
|
+
: []),
|
|
799
|
+
...(!state.view.busy && !state.view.uncertain
|
|
800
|
+
? [
|
|
801
|
+
Button({
|
|
802
|
+
...recoveryButton,
|
|
803
|
+
key: 'retry-client',
|
|
804
|
+
label: tr("native.hooks.register.retry_client"),
|
|
805
|
+
hotkey: 'r',
|
|
806
|
+
onPress: retry,
|
|
807
|
+
}),
|
|
808
|
+
]
|
|
809
|
+
: []),
|
|
810
|
+
Button({
|
|
811
|
+
...recoveryButton,
|
|
812
|
+
key: 'close',
|
|
813
|
+
label: tr("native.hooks.register.discard_pending_close"),
|
|
814
|
+
hotkey: 'q',
|
|
815
|
+
onPress: () => close($, state),
|
|
816
|
+
}),
|
|
817
|
+
],
|
|
818
|
+
});
|
|
819
|
+
});
|
|
820
|
+
};
|