@fbincon/claude-code-statusline 0.0.0-stage → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LICENSE-Unicode.txt +39 -0
- package/LICENSE-Wcwidth.txt +27 -0
- package/README.md +90 -2
- package/bin/claude-statusline.js +2 -0
- package/candidate.json +1238 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.d.ts +35 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js +228 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js +72 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +140 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js +101 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js +96 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js +80 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.d.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js +99 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.d.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js +134 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +89 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.js +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.js +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js +67 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js +63 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js +153 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.d.ts +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +142 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js +91 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js +109 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.d.ts +60 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js +12 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js +234 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js +41 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.d.ts +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js +92 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.d.ts +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js +91 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js +94 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.d.ts +22 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js +197 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.d.ts +7 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js +134 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.d.ts +58 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +144 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js +125 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js +55 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +95 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js +48 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.d.ts +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js +162 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.d.ts +37 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.d.ts +9 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js +241 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.d.ts +16 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js +90 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.d.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js +80 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js +59 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js +70 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.d.ts +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.d.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js +227 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +144 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/package.json +17 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-config/SKILL.md +80 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-configure/SKILL.md +19 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +37 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/hooks.json +6 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +820 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +503 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/forms.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +198 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/messages.ts +101 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +218 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +29 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +254 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +167 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/guidance.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/import-review.ts +55 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/instances.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/navigation.ts +98 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/numeric.ts +42 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/search.ts +114 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +276 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-unicode.ts +92 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +6842 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/index.ts +40 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/messages.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/presentation.ts +62 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/launch.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preferences.ts +61 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preview-preferences.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +124 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/unicode.ts +121 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +47 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +159 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +84 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/surface.ts +89 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/catalog.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/preview.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/section.ts +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/shortcuts.ts +83 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/layout.ts +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/styled-text.ts +56 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/text.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/theme.ts +27 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/hooks.json +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/observe.ts +279 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/checklists.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/costs.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/generated-contracts.ts +18 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/identity.ts +14 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/launch.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/queue.ts +68 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/streams.ts +28 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/timing.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.d.ts +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js +72 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +86 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +3462 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js +17 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +232 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js +48 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +104 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +99 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +80 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.d.ts +29 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +159 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +34 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.d.ts +15 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js +55 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +33 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +663 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +401 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +251 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +146 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js +17 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.d.ts +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js +53 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.d.ts +37 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js +122 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +6841 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +6841 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js +38 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js +31 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.js +137 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.js +56 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.js +165 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.js +47 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.d.ts +21 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js +105 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js +50 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js +49 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js +58 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js +34 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.d.ts +49 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +399 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.d.ts +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js +176 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js +29 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js +93 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js +46 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.d.ts +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js +76 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.d.ts +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +98 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.d.ts +67 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js +116 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +305 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js +33 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js +52 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js +115 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js +104 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.d.ts +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js +196 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js +45 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js +228 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js +145 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js +70 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js +110 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js +75 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js +121 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.d.ts +43 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js +198 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js +192 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js +245 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js +28 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js +183 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.d.ts +64 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js +263 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js +103 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js +50 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js +75 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.d.ts +12 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js +93 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js +178 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/package.json +8 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/languages.json +7 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-Hant.json +1367 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.d.ts +15 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js +22 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js +102 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.d.ts +16 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js +18 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.js +160 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.d.ts +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.js +19 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.d.ts +8 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js +164 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.js +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.js +14 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.js +21 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js +31 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.d.ts +15 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js +36 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.d.ts +17 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js +44 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js +48 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js +67 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.d.ts +42 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js +180 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.d.ts +11 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js +81 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.d.ts +32 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js +157 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.d.ts +18 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js +150 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.d.ts +6 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js +39 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.d.ts +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js +82 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/package.json +8 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.d.ts +16 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +213 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.d.ts +30 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.js +34 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.d.ts +28 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js +126 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +52 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +352 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/package.json +16 -0
- package/node_modules/@koromix/koffi-darwin-arm64/README.md +6 -0
- package/node_modules/@koromix/koffi-darwin-arm64/darwin_arm64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-arm64/index.js +1 -0
- package/node_modules/@koromix/koffi-darwin-arm64/package.json +24 -0
- package/node_modules/@koromix/koffi-darwin-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-darwin-x64/darwin_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-x64/index.js +1 -0
- package/node_modules/@koromix/koffi-darwin-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-linux-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-linux-x64/index.js +198 -0
- package/node_modules/@koromix/koffi-linux-x64/linux_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-linux-x64/musl_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-linux-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-win32-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-win32-x64/index.js +1 -0
- package/node_modules/@koromix/koffi-win32-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.lib +0 -0
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.node +0 -0
- package/node_modules/koffi/LICENSE.txt +22 -0
- package/node_modules/koffi/README.md +46 -0
- package/node_modules/koffi/index.cjs +1 -0
- package/node_modules/koffi/index.d.ts +390 -0
- package/node_modules/koffi/index.js +2 -0
- package/node_modules/koffi/indirect.cjs +1 -0
- package/node_modules/koffi/indirect.js +2 -0
- package/node_modules/koffi/package.json +73 -0
- package/node_modules/koffi/src/koffi/index.cjs +327 -0
- package/node_modules/koffi/src/koffi/index.js +312 -0
- package/node_modules/koffi/src/koffi/indirect.cjs +326 -0
- package/node_modules/koffi/src/koffi/indirect.js +311 -0
- package/node_modules/koffi/src/koffi/src/static.cjs +170 -0
- package/node_modules/koffi/src/koffi/src/static.js +173 -0
- package/node_modules/lossless-json/LICENSE.md +9 -0
- package/node_modules/lossless-json/README.md +549 -0
- package/node_modules/lossless-json/lib/esm/LosslessNumber.js +92 -0
- package/node_modules/lossless-json/lib/esm/LosslessNumber.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/config.js +9 -0
- package/node_modules/lossless-json/lib/esm/config.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/index.js +9 -0
- package/node_modules/lossless-json/lib/esm/index.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/numberParsers.js +9 -0
- package/node_modules/lossless-json/lib/esm/numberParsers.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/package.json +3 -0
- package/node_modules/lossless-json/lib/esm/parse.js +346 -0
- package/node_modules/lossless-json/lib/esm/parse.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/revive.js +57 -0
- package/node_modules/lossless-json/lib/esm/revive.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/reviveDate.js +10 -0
- package/node_modules/lossless-json/lib/esm/reviveDate.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/stringify.js +166 -0
- package/node_modules/lossless-json/lib/esm/stringify.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/types.js +2 -0
- package/node_modules/lossless-json/lib/esm/types.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/utils.js +236 -0
- package/node_modules/lossless-json/lib/esm/utils.js.map +1 -0
- package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts +40 -0
- package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/config.d.ts +13 -0
- package/node_modules/lossless-json/lib/types/config.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/index.d.ts +9 -0
- package/node_modules/lossless-json/lib/types/index.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/numberParsers.d.ts +4 -0
- package/node_modules/lossless-json/lib/types/numberParsers.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/parse.d.ts +33 -0
- package/node_modules/lossless-json/lib/types/parse.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/revive.d.ts +13 -0
- package/node_modules/lossless-json/lib/types/revive.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/reviveDate.d.ts +5 -0
- package/node_modules/lossless-json/lib/types/reviveDate.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/stringify.d.ts +37 -0
- package/node_modules/lossless-json/lib/types/stringify.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/types.d.ts +61 -0
- package/node_modules/lossless-json/lib/types/types.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/utils.d.ts +79 -0
- package/node_modules/lossless-json/lib/types/utils.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/umd/lossless-json.js +1 -0
- package/node_modules/lossless-json/lib/umd/lossless-json.js.map +1 -0
- package/node_modules/lossless-json/lib/umd/package.json +3 -0
- package/node_modules/lossless-json/package.json +89 -0
- package/package.json +57 -4
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { readSync } from 'node:fs';
|
|
2
|
+
/** Consume at most limit + 1 bytes so oversized machine requests stay bounded. */
|
|
3
|
+
export function readLimitedInput(limit, descriptor = 0) {
|
|
4
|
+
const raw = Buffer.alloc(limit + 1);
|
|
5
|
+
let offset = 0;
|
|
6
|
+
while (offset < raw.length) {
|
|
7
|
+
const count = readSync(descriptor, raw, offset, raw.length - offset, null);
|
|
8
|
+
if (!count)
|
|
9
|
+
break;
|
|
10
|
+
offset += count;
|
|
11
|
+
}
|
|
12
|
+
return raw.subarray(0, offset);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,kFAAkF;AAClF,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,UAAU,GAAG,CAAC;IAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACpC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,OAAO,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK;YACN,MAAM;QACV,MAAM,IAAI,KAAK,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LaunchSpec } from '@fbincon/statusline-core/integration/binding';
|
|
2
|
+
export { binding } from '@fbincon/statusline-core/integration/binding';
|
|
3
|
+
export type { LaunchSpec } from '@fbincon/statusline-core/integration/binding';
|
|
4
|
+
export interface ProcessResult {
|
|
5
|
+
code: number | null;
|
|
6
|
+
stdout: string;
|
|
7
|
+
stderr: string;
|
|
8
|
+
timedOut: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function nodeBinding(entry: string): LaunchSpec;
|
|
11
|
+
/** Execute argv without a shell; callers explicitly supply environment and cwd when isolated. */
|
|
12
|
+
export declare function run(spec: LaunchSpec, args: readonly string[], input?: string, timeoutMs?: number, env?: NodeJS.ProcessEnv, cwd?: string): Promise<ProcessResult>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
export { binding } from '@fbincon/statusline-core/integration/binding';
|
|
3
|
+
export function nodeBinding(entry) { return { executable: process.execPath, args: [entry] }; }
|
|
4
|
+
/** Execute argv without a shell; callers explicitly supply environment and cwd when isolated. */
|
|
5
|
+
export function run(spec, args, input = '', timeoutMs = 30_000, env = process.env, cwd) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const child = spawn(spec.executable, [...spec.args, ...args], { env, cwd, windowsHide: true, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
8
|
+
let stdout = '', stderr = '', timedOut = false;
|
|
9
|
+
child.stdout.setEncoding('utf8');
|
|
10
|
+
child.stderr.setEncoding('utf8');
|
|
11
|
+
child.stdout.on('data', chunk => { stdout += chunk; });
|
|
12
|
+
child.stderr.on('data', chunk => { stderr += chunk; });
|
|
13
|
+
const timer = setTimeout(() => { timedOut = true; child.kill('SIGKILL'); }, timeoutMs);
|
|
14
|
+
child.once('error', error => { clearTimeout(timer); reject(error); });
|
|
15
|
+
child.once('close', code => { clearTimeout(timer); resolve({ code, stdout, stderr, timedOut }); });
|
|
16
|
+
child.stdin.on('error', error => { if (error.code !== 'EPIPE')
|
|
17
|
+
reject(error); });
|
|
18
|
+
child.stdin.end(input, 'utf8');
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=launch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../src/launch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AAKvE,MAAM,UAAU,WAAW,CAAC,KAAa,IAAgB,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AAElH,iGAAiG;AACjG,MAAM,UAAU,GAAG,CAAC,IAAgB,EAAE,IAAuB,EAAE,KAAK,GAAG,EAAE,EAAE,SAAS,GAAG,MAAM,EAC3F,MAAyB,OAAO,CAAC,GAAG,EAAE,GAAY;IAClD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QAChI,IAAI,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,QAAQ,GAAG,KAAK,CAAC;QAC/C,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC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published cursor. */
|
|
3
|
+
export function readCompleteLines(path, start, visit) {
|
|
4
|
+
if (start < 0n || start > BigInt(Number.MAX_SAFE_INTEGER))
|
|
5
|
+
throw new RangeError('Invalid file cursor');
|
|
6
|
+
const fd = openSync(path, 'r');
|
|
7
|
+
let position = Number(start), cursor = start, tail = Buffer.alloc(0);
|
|
8
|
+
const chunk = Buffer.allocUnsafe(64 * 1024);
|
|
9
|
+
try {
|
|
10
|
+
for (;;) {
|
|
11
|
+
const count = readSync(fd, chunk, 0, chunk.length, position);
|
|
12
|
+
if (!count)
|
|
13
|
+
break;
|
|
14
|
+
position += count;
|
|
15
|
+
const raw = tail.length ? Buffer.concat([tail, chunk.subarray(0, count)]) : Buffer.from(chunk.subarray(0, count));
|
|
16
|
+
let offset = 0, newline;
|
|
17
|
+
while ((newline = raw.indexOf(10, offset)) >= 0) {
|
|
18
|
+
const line = raw.subarray(offset, newline + 1);
|
|
19
|
+
visit(line);
|
|
20
|
+
cursor += BigInt(line.length);
|
|
21
|
+
offset = newline + 1;
|
|
22
|
+
}
|
|
23
|
+
tail = Buffer.from(raw.subarray(offset));
|
|
24
|
+
}
|
|
25
|
+
return cursor;
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
closeSync(fd);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=line-cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-cursor.js","sourceRoot":"","sources":["../../src/line-cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxD,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,KAAa,EAAE,KAA6B;IACxF,IAAI,KAAK,GAAG,EAAE,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACrD,MAAM,IAAI,UAAU,CAAC,qBAAqB,CAAC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,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;YACO,CAAC;QACL,SAAS,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type koffi from 'koffi';
|
|
2
|
+
export declare function nativeApi(): typeof koffi;
|
|
3
|
+
export declare function library(name: string): import("koffi").LibraryHandle;
|
|
4
|
+
/** Cache bindings, never clock samples, process observations or API failures. */
|
|
5
|
+
export declare function nativeFunction(name: string, signature: string): {
|
|
6
|
+
(...args: any[]): any;
|
|
7
|
+
async: (...args: any[]) => any;
|
|
8
|
+
info: {
|
|
9
|
+
name: string;
|
|
10
|
+
arguments: import("koffi").TypeObject[];
|
|
11
|
+
result: import("koffi").TypeObject;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare function int64(value: unknown): bigint;
|
|
15
|
+
export declare function winError(operation: string): Error;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
let api;
|
|
4
|
+
export function nativeApi() { return api ??= require('koffi'); }
|
|
5
|
+
const libraries = new Map();
|
|
6
|
+
export function library(name) {
|
|
7
|
+
let value = libraries.get(name);
|
|
8
|
+
if (!value) {
|
|
9
|
+
value = nativeApi().load(name);
|
|
10
|
+
libraries.set(name, value);
|
|
11
|
+
}
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
const functions = new Map();
|
|
15
|
+
/** Cache bindings, never clock samples, process observations or API failures. */
|
|
16
|
+
export function nativeFunction(name, signature) {
|
|
17
|
+
const key = name + '\0' + signature;
|
|
18
|
+
let value = functions.get(key);
|
|
19
|
+
if (!value) {
|
|
20
|
+
value = library(name).func(signature);
|
|
21
|
+
functions.set(key, value);
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
export function int64(value) {
|
|
26
|
+
if (typeof value === 'bigint')
|
|
27
|
+
return value;
|
|
28
|
+
if (typeof value === 'number' && Number.isSafeInteger(value))
|
|
29
|
+
return BigInt(value);
|
|
30
|
+
throw new TypeError('Native integer is not lossless');
|
|
31
|
+
}
|
|
32
|
+
export function winError(operation) {
|
|
33
|
+
const code = library('kernel32.dll').func('uint32_t GetLastError()')();
|
|
34
|
+
return Object.assign(new Error(`${operation}: Win32 ${code}`), { winerror: code });
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../src/native.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI,GAA6B,CAAC;AAClC,MAAM,UAAU,SAAS,KAAmB,OAAO,GAAG,KAAK,OAAO,CAAC,OAAO,CAAiB,CAAC,CAAC,CAAC;AAC9F,MAAM,SAAS,GAAG,IAAI,GAAG,EAAyC,CAAC;AACnE,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,IAAI,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,KAAK,EAAE,CAAC;QAAC,KAAK,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAAC,CAAC;IAC3E,OAAO,KAAK,CAAC;AACf,CAAC;AACD,MAAM,SAAS,GAAG,IAAI,GAAG,EAA6D,CAAC;AACvF,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,SAAiB;IAC5D,MAAM,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,IAAI,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;QAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAAC,CAAC;IACjF,OAAO,KAAK,CAAC;AACf,CAAC;AACD,MAAM,UAAU,KAAK,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACnF,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;AACxD,CAAC;AACD,MAAM,UAAU,QAAQ,CAAC,SAAiB;IACxC,MAAM,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,EAAE,CAAC;IACvE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,SAAS,WAAW,IAAI,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import type { LaunchSpec } from './launch.js';
|
|
3
|
+
export declare class UnconfirmedOperation extends Error {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
/** No shell, bounded output and time, and no retry of uncertain writes. */
|
|
7
|
+
export declare class PluginHost {
|
|
8
|
+
readonly configDir: string;
|
|
9
|
+
readonly command: LaunchSpec;
|
|
10
|
+
readonly execute: typeof spawnSync;
|
|
11
|
+
constructor(configDir: string, command?: LaunchSpec, execute?: typeof spawnSync);
|
|
12
|
+
run(args: readonly string[], values?: Record<string, string>, json?: boolean): unknown;
|
|
13
|
+
listing(): [
|
|
14
|
+
Record<string, unknown>[],
|
|
15
|
+
Record<string, unknown>[]
|
|
16
|
+
];
|
|
17
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { claudeLaunch } from './commands.js';
|
|
3
|
+
import { decodeUtf8 } from './utf8.js';
|
|
4
|
+
import { decode } from '@fbincon/statusline-core/json';
|
|
5
|
+
export class UnconfirmedOperation extends Error {
|
|
6
|
+
constructor(message) { super(message); this.name = 'UnconfirmedOperation'; }
|
|
7
|
+
}
|
|
8
|
+
/** No shell, bounded output and time, and no retry of uncertain writes. */
|
|
9
|
+
export class PluginHost {
|
|
10
|
+
configDir;
|
|
11
|
+
command;
|
|
12
|
+
execute;
|
|
13
|
+
constructor(configDir, command = claudeLaunch(), execute = spawnSync) {
|
|
14
|
+
this.configDir = configDir;
|
|
15
|
+
this.command = command;
|
|
16
|
+
this.execute = execute;
|
|
17
|
+
}
|
|
18
|
+
run(args, values, json = false) {
|
|
19
|
+
const env = { ...process.env, CLAUDE_CONFIG_DIR: this.configDir, DISABLE_AUTOUPDATER: '1' };
|
|
20
|
+
delete env.CLAUDECODE;
|
|
21
|
+
const result = this.execute(this.command.executable, [...this.command.args, 'plugin', ...args], { cwd: this.configDir, env, input: values === undefined ? undefined : JSON.stringify(values), timeout: 45000, killSignal: 'SIGKILL', maxBuffer: 4 * 1024 * 1024, shell: false, windowsHide: true });
|
|
22
|
+
if (result.error || result.signal || result.status === null)
|
|
23
|
+
throw new UnconfirmedOperation('Official plugin operation could not be confirmed: ' + args.slice(0, 2).join(' '));
|
|
24
|
+
if (result.status !== 0)
|
|
25
|
+
throw new Error('Official plugin operation refused: ' + decodeUtf8(result.stderr?.length ? result.stderr : result.stdout ?? Buffer.alloc(0)).replace(/[\x00-\x1f\x7f]/gu, ' ').slice(0, 500));
|
|
26
|
+
if (json) {
|
|
27
|
+
try {
|
|
28
|
+
return decode(decodeUtf8(result.stdout));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
throw new UnconfirmedOperation('Official plugin operation returned invalid JSON');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
listing() {
|
|
37
|
+
const markets = this.run(['marketplace', 'list', '--json'], undefined, true), plugins = this.run(['list', '--json'], undefined, true);
|
|
38
|
+
for (const value of [markets, plugins])
|
|
39
|
+
if (!Array.isArray(value) || value.some(row => row === null || typeof row !== 'object' || Array.isArray(row)))
|
|
40
|
+
throw new Error('Unexpected official plugin inventory');
|
|
41
|
+
return [markets, plugins];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=plugin-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-host.js","sourceRoot":"","sources":["../../src/plugin-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC3C,YAAY,OAAe,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC,CAAC,CAAC;CACvF;AACD,2EAA2E;AAC3E,MAAM,OAAO,UAAU;IACE;IAA4B;IAA+C;IAAhG,YAAqB,SAAiB,EAAW,UAAsB,YAAY,EAAE,EAAW,UAAU,SAAS;QAA9F,cAAS,GAAT,SAAS,CAAQ;QAAW,YAAO,GAAP,OAAO,CAA6B;QAAW,YAAO,GAAP,OAAO,CAAY;IAAI,CAAC;IACxH,GAAG,CAAC,IAAuB,EAAE,MAA+B,EA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,EAAE,GAAG,CAAC,CAAC,CAAC;QAClM,IAAI,IAAI,EAAE,CAAC;YACP,IAAI,CAAC;gBACD,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAC7C,CAAC;YACD,MAAM,CAAC;gBACH,MAAM,IAAI,oBAAoB,CAAC,iDAAiD,CAAC,CAAC;YACtF,CAAC;QACL,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO;QAIH,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QACtI,KAAK,MAAM,KAAK,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;YAClC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBACzG,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAChE,OAAO,CAAC,OAAoC,EAAE,OAAoC,CAAC,CAAC;IACxF,CAAC;CACJ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function pathName(value: string, windows?: boolean): string;
|
|
2
|
+
export declare function directory(value: string, style: string, project?: string | null, home?: string, windows?: boolean): string;
|
|
3
|
+
export declare function formatDate(seconds: number, utc: boolean, withDate: boolean): string | null;
|
|
4
|
+
export declare function hostName(): string | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { homedir, hostname } from 'node:os';
|
|
2
|
+
import { win32 } from 'node:path';
|
|
3
|
+
/** Path presentation is lexical: '..' and symlinks must not be resolved. */
|
|
4
|
+
function parts(value, windows) {
|
|
5
|
+
if (!windows) {
|
|
6
|
+
const anchor = value.startsWith('//') && !value.startsWith('///') ? '//' : value.startsWith('/') ? '/' : '';
|
|
7
|
+
return { anchor, parts: value.slice(anchor.length).split('/').filter(part => part && part !== '.') };
|
|
8
|
+
}
|
|
9
|
+
value = value.replaceAll('/', '\\');
|
|
10
|
+
const anchor = win32.parse(value).root;
|
|
11
|
+
return { anchor, parts: value.slice(anchor.length).split('\\').filter(part => part && part !== '.') };
|
|
12
|
+
}
|
|
13
|
+
export function pathName(value, windows = process.platform === 'win32') { return parts(value, windows).parts.at(-1) ?? ''; }
|
|
14
|
+
export function directory(value, style, project, home = homedir(), windows = process.platform === 'win32') {
|
|
15
|
+
if (style === 'full')
|
|
16
|
+
return value;
|
|
17
|
+
const path = parts(value, windows);
|
|
18
|
+
if (style === 'basename')
|
|
19
|
+
return path.parts.at(-1) || path.anchor || value;
|
|
20
|
+
const base = style === 'home' ? home : style === 'project-relative' ? project : null;
|
|
21
|
+
if (!base)
|
|
22
|
+
return value;
|
|
23
|
+
const parent = parts(base, windows), equal = (a, b) => windows ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
24
|
+
if (!equal(path.anchor, parent.anchor) || parent.parts.length > path.parts.length || parent.parts.some((part, i) => !equal(part, path.parts[i])))
|
|
25
|
+
return value;
|
|
26
|
+
const suffix = path.parts.slice(parent.parts.length).join('/');
|
|
27
|
+
return style === 'home' ? '~' + (suffix ? '/' + suffix : '') : suffix || '.';
|
|
28
|
+
}
|
|
29
|
+
export function formatDate(seconds, utc, withDate) {
|
|
30
|
+
const date = new Date(seconds * 1000);
|
|
31
|
+
if (!Number.isFinite(date.getTime()))
|
|
32
|
+
return null;
|
|
33
|
+
const year = utc ? date.getUTCFullYear() : date.getFullYear();
|
|
34
|
+
if (year < 1 || year > 9999)
|
|
35
|
+
return null;
|
|
36
|
+
const pad = (value) => String(value).padStart(2, '0');
|
|
37
|
+
const prefix = withDate ? `${year}-${pad((utc ? date.getUTCMonth() : date.getMonth()) + 1)}-${pad(utc ? date.getUTCDate() : date.getDate())} ` : '';
|
|
38
|
+
return prefix + pad(utc ? date.getUTCHours() : date.getHours()) + ':' + pad(utc ? date.getUTCMinutes() : date.getMinutes()) + (utc ? ' UTC' : '');
|
|
39
|
+
}
|
|
40
|
+
export function hostName() {
|
|
41
|
+
try {
|
|
42
|
+
return hostname();
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=presentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../../src/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,4EAA4E;AAC5E,SAAS,KAAK,CAAC,KAAa,EAAE,OAAgB;IAI1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5G,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;IACzG,CAAC;IACD,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC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AChB,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACpJ,OAAO,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACtJ,CAAC;AACD,MAAM,UAAU,QAAQ;IAAoB,IAAI,CAAC;QAC7C,OAAO,QAAQ,EAAE,CAAC;IACtB,CAAC;IACD,MAAM,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;AAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
3
|
+
import { library } from './native.js';
|
|
4
|
+
export function processToken(pid) {
|
|
5
|
+
if (!Number.isSafeInteger(pid) || pid <= 0)
|
|
6
|
+
return null;
|
|
7
|
+
try {
|
|
8
|
+
if (process.platform === 'linux') {
|
|
9
|
+
const stat = readFileSync(`/proc/${pid}/stat`, 'utf8');
|
|
10
|
+
return stat.slice(stat.lastIndexOf(')') + 2).split(/\s+/)[19] || null;
|
|
11
|
+
}
|
|
12
|
+
if (process.platform === 'darwin')
|
|
13
|
+
return execFileSync('/bin/ps', ['-o', 'lstart=', '-p', String(pid)], { encoding: 'utf8', timeout: 1000, env: { ...process.env, LC_ALL: 'C', TZ: 'UTC' }, stdio: ['ignore', 'pipe', 'ignore'] }).trim() || null;
|
|
14
|
+
if (process.platform === 'win32') {
|
|
15
|
+
const k = library('kernel32.dll');
|
|
16
|
+
const handle = k.func('void *OpenProcess(uint32_t access, bool inherit, uint32_t pid)')(0x1000, false, pid);
|
|
17
|
+
if (!handle)
|
|
18
|
+
return null;
|
|
19
|
+
try {
|
|
20
|
+
const created = Buffer.alloc(8), unused = [Buffer.alloc(8), Buffer.alloc(8), Buffer.alloc(8)];
|
|
21
|
+
if (!k.func('bool GetProcessTimes(void *handle, _Out_ void *created, _Out_ void *exit, _Out_ void *kernel, _Out_ void *user)')(handle, created, ...unused))
|
|
22
|
+
return null;
|
|
23
|
+
const utc = Buffer.alloc(16), local = Buffer.alloc(16), filetime = Buffer.alloc(8);
|
|
24
|
+
if (!k.func('bool FileTimeToSystemTime(const void *time, _Out_ void *system)')(created, utc) ||
|
|
25
|
+
!k.func('bool SystemTimeToTzSpecificLocalTimeEx(const void *zone, const void *utc, _Out_ void *local)')(null, utc, local) ||
|
|
26
|
+
!k.func('bool SystemTimeToFileTime(const void *system, _Out_ void *time)')(local, filetime))
|
|
27
|
+
return null;
|
|
28
|
+
const value = filetime.readBigUInt64LE() + created.readBigUInt64LE() % 10000n;
|
|
29
|
+
return String(value - value % 10n + 504911232000000000n);
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
k.func('bool CloseHandle(void *handle)')(handle);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch { /* identity must be unverifiable, never guessed */ }
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
// A Windows process object can outlive process exit while another handle is
|
|
40
|
+
// open. Creation identity is not a liveness predicate (same in the oracle).
|
|
41
|
+
export function processMatches(pid, token) {
|
|
42
|
+
if (processToken(pid) !== token)
|
|
43
|
+
return false;
|
|
44
|
+
try {
|
|
45
|
+
if (process.platform === 'win32') {
|
|
46
|
+
const k = library('kernel32.dll');
|
|
47
|
+
const h = k.func('void *OpenProcess(uint32_t access, bool inherit, uint32_t pid)')(0x100000, false, pid);
|
|
48
|
+
if (!h)
|
|
49
|
+
return false;
|
|
50
|
+
try {
|
|
51
|
+
return k.func('uint32_t WaitForSingleObject(void *handle, uint32_t ms)')(h, 0) === 258;
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
k.func('bool CloseHandle(void *handle)')(h);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (process.platform === 'linux') {
|
|
58
|
+
const raw = readFileSync(`/proc/${pid}/stat`, 'utf8');
|
|
59
|
+
return !['Z', 'X'].includes(raw.slice(raw.lastIndexOf(')') + 2)[0]);
|
|
60
|
+
}
|
|
61
|
+
return !execFileSync('/bin/ps', ['-o', 'stat=', '-p', String(pid)], { encoding: 'utf8', timeout: 1000 }).trim().startsWith('Z');
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=processes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processes.js","sourceRoot":"","sources":["../../src/processes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC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|
2
|
+
export declare const RESULT_ENV = "CLAUDE_STATUSLINE_SLASH_RESULT", DEADLINE_ENV = "CLAUDE_STATUSLINE_SLASH_DEADLINE_SECONDS";
|
|
3
|
+
export declare const REQUEST_ENV = "CLAUDE_STATUSLINE_EDITOR_REQUEST", NONCE_ENV = "CLAUDE_STATUSLINE_EDITOR_NONCE";
|
|
4
|
+
export declare const RESULT_LIMIT: number, DEADLINE_SECONDS = 570, LAUNCH_TIMEOUT = 585000;
|
|
5
|
+
export interface BridgeResult {
|
|
6
|
+
schema_version: 1;
|
|
7
|
+
outcome: 'updated' | 'already-current' | 'cancelled' | 'interrupted' | 'timed-out' | 'error';
|
|
8
|
+
exit_code: number;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Request {
|
|
12
|
+
schema_version: 1;
|
|
13
|
+
nonce: string;
|
|
14
|
+
parent: number;
|
|
15
|
+
parent_token: string;
|
|
16
|
+
startup: number;
|
|
17
|
+
expires: number;
|
|
18
|
+
configDir: string;
|
|
19
|
+
backend: LaunchSpec;
|
|
20
|
+
cwd: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class EditorRevoked extends Error {
|
|
23
|
+
constructor();
|
|
24
|
+
}
|
|
25
|
+
export declare function resultPath(configDir: string, raw: string): string;
|
|
26
|
+
export declare function readPrivate(path: string, configDir: string): Buffer;
|
|
27
|
+
export declare function readResult(path: string, configDir: string): BridgeResult;
|
|
28
|
+
export declare function writeResult(path: string, configDir: string, outcome: Omit<BridgeResult, 'schema_version'>): void;
|
|
29
|
+
export declare function deadline(env: NodeJS.ProcessEnv, now?: number): number;
|
|
30
|
+
export declare function prepare(configDir: string, backend: LaunchSpec, cwd: string, now?: number): {
|
|
31
|
+
directory: string;
|
|
32
|
+
path: string;
|
|
33
|
+
request: Request;
|
|
34
|
+
result: string;
|
|
35
|
+
};
|
|
36
|
+
export declare function requestGuard(configDir: string, path: string, nonce: string, backend: LaunchSpec, now?: number): () => void;
|
|
37
|
+
export declare function started(directory: string, configDir: string, nonce: string): {
|
|
38
|
+
pid: number;
|
|
39
|
+
token: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function cleanup(directory: string): void;
|
|
42
|
+
export declare function cleanupStale(base: string, now?: number): void;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import { atomicWrite, durableUnlink, isLinkOrReparse, privateDirectory } from '../files.js';
|
|
5
|
+
import { processToken, processMatches } from '../processes.js';
|
|
6
|
+
import { decodeUtf8 } from '../utf8.js';
|
|
7
|
+
import { decode, isLosslessNumber, safeInteger } from '@fbincon/statusline-core/json';
|
|
8
|
+
export const RESULT_ENV = 'CLAUDE_STATUSLINE_SLASH_RESULT', DEADLINE_ENV = 'CLAUDE_STATUSLINE_SLASH_DEADLINE_SECONDS';
|
|
9
|
+
export const REQUEST_ENV = 'CLAUDE_STATUSLINE_EDITOR_REQUEST', NONCE_ENV = 'CLAUDE_STATUSLINE_EDITOR_NONCE';
|
|
10
|
+
export const RESULT_LIMIT = 16 * 1024, DEADLINE_SECONDS = 570, LAUNCH_TIMEOUT = 585000;
|
|
11
|
+
export class EditorRevoked extends Error {
|
|
12
|
+
constructor() { super('Editor request revoked or parent identity changed'); this.name = 'EditorRevoked'; }
|
|
13
|
+
}
|
|
14
|
+
const json = (value) => JSON.stringify(value, null, 2) + '\n';
|
|
15
|
+
const object = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
16
|
+
function strict(raw) {
|
|
17
|
+
function value(input) {
|
|
18
|
+
if (isLosslessNumber(input))
|
|
19
|
+
return safeInteger(input);
|
|
20
|
+
if (Array.isArray(input))
|
|
21
|
+
return input.map(value);
|
|
22
|
+
if (object(input))
|
|
23
|
+
return Object.fromEntries(Object.entries(input).map(([key, item]) => [key, value(item)]));
|
|
24
|
+
return input;
|
|
25
|
+
}
|
|
26
|
+
return value(decode(decodeUtf8(raw)));
|
|
27
|
+
}
|
|
28
|
+
export function resultPath(configDir, raw) {
|
|
29
|
+
if (!isAbsolute(raw) || raw !== resolve(raw) || raw.includes('\0') || basename(raw) !== 'result.json' || dirname(dirname(raw)) !== join(configDir, 'statusline_runtime/slash_tui') || !/^invocation-[A-Za-z0-9_.-]+$/u.test(basename(dirname(raw))))
|
|
30
|
+
throw new Error('Invalid slash TUI result path');
|
|
31
|
+
for (const path of [configDir, join(configDir, 'statusline_runtime'), dirname(dirname(raw)), dirname(raw)]) {
|
|
32
|
+
if (isLinkOrReparse(path) || !fs.lstatSync(path).isDirectory())
|
|
33
|
+
throw new Error('Invalid slash TUI result directory');
|
|
34
|
+
}
|
|
35
|
+
if (process.platform !== 'win32' && (fs.statSync(dirname(raw)).mode & 0o777) !== 0o700)
|
|
36
|
+
throw new Error('Slash TUI result directory is not private');
|
|
37
|
+
return raw;
|
|
38
|
+
}
|
|
39
|
+
export function readPrivate(path, configDir) {
|
|
40
|
+
resultPath(configDir, join(dirname(path), 'result.json'));
|
|
41
|
+
const before = fs.lstatSync(path);
|
|
42
|
+
if (!before.isFile() || isLinkOrReparse(path) || before.size > RESULT_LIMIT)
|
|
43
|
+
throw new Error('Invalid or oversized invocation file');
|
|
44
|
+
if (process.platform !== 'win32' && (before.mode & 0o777) !== 0o600)
|
|
45
|
+
throw new Error('Invocation file is not private');
|
|
46
|
+
const fd = fs.openSync(path, fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW ?? 0));
|
|
47
|
+
try {
|
|
48
|
+
const after = fs.fstatSync(fd);
|
|
49
|
+
if (!after.isFile() || before.dev !== after.dev || before.ino !== after.ino || after.size > RESULT_LIMIT)
|
|
50
|
+
throw new Error('Invocation file changed while opening');
|
|
51
|
+
const buffer = Buffer.alloc(RESULT_LIMIT + 1);
|
|
52
|
+
let count = 0, read = 0;
|
|
53
|
+
while (count < buffer.length && (read = fs.readSync(fd, buffer, count, buffer.length - count, null)))
|
|
54
|
+
count += read;
|
|
55
|
+
if (count > RESULT_LIMIT)
|
|
56
|
+
throw new Error('Invocation file exceeds 16 KiB');
|
|
57
|
+
return buffer.subarray(0, count);
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
fs.closeSync(fd);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function readResult(path, configDir) {
|
|
64
|
+
const value = strict(readPrivate(path, configDir));
|
|
65
|
+
if (!object(value) || Object.keys(value).sort().join(',') !== 'exit_code,message,outcome,schema_version' || value.schema_version !== 1 || !['updated', 'already-current', 'cancelled', 'interrupted', 'timed-out', 'error'].includes(String(value.outcome)) || typeof value.exit_code !== 'number' || !Number.isInteger(value.exit_code) || value.exit_code < 0 || value.exit_code > 255 || typeof value.message !== 'string' || /[\x00-\x08\x0b-\x1f\x7f]/u.test(value.message))
|
|
66
|
+
throw new Error('Invalid interactive editor result');
|
|
67
|
+
if (['updated', 'already-current', 'cancelled', 'timed-out'].includes(String(value.outcome)) && value.exit_code !== 0)
|
|
68
|
+
throw new Error('Successful result has an abnormal exit');
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
export function writeResult(path, configDir, outcome) {
|
|
72
|
+
resultPath(configDir, path);
|
|
73
|
+
const body = json({ schema_version: 1, ...outcome });
|
|
74
|
+
if (Buffer.byteLength(body) > RESULT_LIMIT)
|
|
75
|
+
throw new Error('Interactive result exceeds 16 KiB');
|
|
76
|
+
atomicWrite(path, body);
|
|
77
|
+
}
|
|
78
|
+
export function deadline(env, now = performance.now()) {
|
|
79
|
+
const raw = env[DEADLINE_ENV] ?? '', seconds = Number(raw);
|
|
80
|
+
if (!raw.trim() || !Number.isFinite(seconds) || seconds <= 0 || seconds > DEADLINE_SECONDS)
|
|
81
|
+
throw new Error('Invalid slash TUI deadline');
|
|
82
|
+
return now + seconds * 1000;
|
|
83
|
+
}
|
|
84
|
+
export function prepare(configDir, backend, cwd, now = Date.now()) {
|
|
85
|
+
const base = join(configDir, 'statusline_runtime/slash_tui');
|
|
86
|
+
for (const path of [configDir, dirname(base), base])
|
|
87
|
+
if (isLinkOrReparse(path))
|
|
88
|
+
throw new Error('Runtime path is a symbolic link or reparse point');
|
|
89
|
+
const token = processToken(process.pid);
|
|
90
|
+
if (!token)
|
|
91
|
+
throw new Error('Cannot establish launcher parent identity');
|
|
92
|
+
privateDirectory(base);
|
|
93
|
+
cleanupStale(base, now);
|
|
94
|
+
const directory = fs.mkdtempSync(join(base, 'invocation-'));
|
|
95
|
+
if (process.platform !== 'win32')
|
|
96
|
+
fs.chmodSync(directory, 0o700);
|
|
97
|
+
const request = { schema_version: 1, nonce: randomUUID(), parent: process.pid, parent_token: token, startup: now + 30000, expires: now + LAUNCH_TIMEOUT, configDir, backend, cwd };
|
|
98
|
+
const path = join(directory, 'request.json');
|
|
99
|
+
atomicWrite(path, json(request));
|
|
100
|
+
return { directory, path, request, result: join(directory, 'result.json') };
|
|
101
|
+
}
|
|
102
|
+
export function requestGuard(configDir, path, nonce, backend, now = Date.now()) {
|
|
103
|
+
if (basename(path) !== 'request.json' || !/^[0-9a-f-]{36}$/u.test(nonce))
|
|
104
|
+
throw new Error('Invalid editor request');
|
|
105
|
+
const original = readPrivate(path, configDir), value = strict(original);
|
|
106
|
+
if (!object(value) || Object.keys(value).sort().join(',') !== 'backend,configDir,cwd,expires,nonce,parent,parent_token,schema_version,startup' || value.schema_version !== 1 || value.nonce !== nonce || value.configDir !== configDir || typeof value.cwd !== 'string' || !isAbsolute(value.cwd) || typeof value.parent !== 'number' || !Number.isSafeInteger(value.parent) || value.parent <= 0 || typeof value.parent_token !== 'string' || !value.parent_token || value.parent_token.length > 128 || typeof value.startup !== 'number' || typeof value.expires !== 'number' || !Number.isFinite(value.startup) || !Number.isFinite(value.expires) || value.startup < now || value.expires < now || value.expires - now > LAUNCH_TIMEOUT || !object(value.backend) || Object.keys(value.backend).sort().join(',') !== 'args,executable' || value.backend.executable !== backend.executable || JSON.stringify(value.backend.args) !== JSON.stringify(backend.args))
|
|
107
|
+
throw new Error('Expired or mismatched editor request');
|
|
108
|
+
const parent = value.parent, token = value.parent_token;
|
|
109
|
+
const guard = () => {
|
|
110
|
+
try {
|
|
111
|
+
if (readPrivate(path, configDir).equals(original) && processMatches(parent, token))
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
catch { /* Missing and replaced requests revoke the lease. */ }
|
|
115
|
+
throw new EditorRevoked();
|
|
116
|
+
};
|
|
117
|
+
guard();
|
|
118
|
+
const ownToken = processToken(process.pid);
|
|
119
|
+
if (!ownToken)
|
|
120
|
+
throw new Error('Cannot establish editor identity');
|
|
121
|
+
fs.writeFileSync(join(dirname(path), 'started.json'), json({ schema_version: 1, nonce, pid: process.pid, token: ownToken }), { mode: 0o600, flag: 'wx' });
|
|
122
|
+
return guard;
|
|
123
|
+
}
|
|
124
|
+
export function started(directory, configDir, nonce) {
|
|
125
|
+
const value = strict(readPrivate(join(directory, 'started.json'), configDir));
|
|
126
|
+
if (!object(value) || Object.keys(value).sort().join(',') !== 'nonce,pid,schema_version,token' || value.schema_version !== 1 || value.nonce !== nonce || typeof value.pid !== 'number' || !Number.isSafeInteger(value.pid) || value.pid <= 0 || typeof value.token !== 'string' || !value.token || value.token.length > 128)
|
|
127
|
+
throw new Error('Invalid editor handshake');
|
|
128
|
+
return { pid: value.pid, token: value.token };
|
|
129
|
+
}
|
|
130
|
+
export function cleanup(directory) {
|
|
131
|
+
// Only known files of this invocation are removed. Unknown files and links survive.
|
|
132
|
+
for (const name of ['request.json', 'started.json', 'result.json', 'terminal.command']) {
|
|
133
|
+
const path = join(directory, name);
|
|
134
|
+
try {
|
|
135
|
+
if (!isLinkOrReparse(path) && fs.lstatSync(path).isFile())
|
|
136
|
+
durableUnlink(path);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
if (error.code !== 'ENOENT')
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
fs.rmdirSync(directory);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
if (!['ENOTEMPTY', 'EEXIST', 'ENOENT'].includes(error.code ?? ''))
|
|
148
|
+
throw error;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export function cleanupStale(base, now = Date.now()) {
|
|
152
|
+
if (!fs.existsSync(base) || isLinkOrReparse(base))
|
|
153
|
+
return;
|
|
154
|
+
for (const entry of fs.readdirSync(base, { withFileTypes: true }).slice(0, 1024)) {
|
|
155
|
+
const path = join(base, entry.name);
|
|
156
|
+
if (!entry.isDirectory() || !/^invocation-[A-Za-z0-9_.-]+$/u.test(entry.name) || isLinkOrReparse(path) || now - fs.lstatSync(path).mtimeMs < 86400000)
|
|
157
|
+
continue;
|
|
158
|
+
try {
|
|
159
|
+
const names = fs.readdirSync(path);
|
|
160
|
+
if (names.some(name => !['request.json', 'started.json', 'result.json', 'terminal.command'].includes(name) || isLinkOrReparse(join(path, name)) || !fs.lstatSync(join(path, name)).isFile()))
|
|
161
|
+
continue;
|
|
162
|
+
const configDir = dirname(dirname(base));
|
|
163
|
+
if (names.includes('request.json')) {
|
|
164
|
+
const request = strict(readPrivate(join(path, 'request.json'), configDir));
|
|
165
|
+
if (processMatches(request.parent, request.parent_token))
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (names.includes('started.json')) {
|
|
169
|
+
const editor = strict(readPrivate(join(path, 'started.json'), configDir));
|
|
170
|
+
if (processMatches(editor.pid, editor.token))
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
// Python invocations predate request.json. An old directory containing
|
|
174
|
+
// only known, regular artifacts remains safe to remove.
|
|
175
|
+
cleanup(path);
|
|
176
|
+
}
|
|
177
|
+
catch { /* Unverifiable ownership is retained. */ }
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=bridge.js.map
|