@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,15 @@
|
|
|
1
|
+
export declare function architecture(): {
|
|
2
|
+
host_arch: string;
|
|
3
|
+
process_arch: NodeJS.Architecture;
|
|
4
|
+
node_os_machine: string;
|
|
5
|
+
architecture_source: string;
|
|
6
|
+
native_machine?: undefined;
|
|
7
|
+
emulated_machine?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
host_arch: string;
|
|
10
|
+
process_arch: NodeJS.Architecture;
|
|
11
|
+
node_os_machine: string;
|
|
12
|
+
architecture_source: string;
|
|
13
|
+
native_machine: number | undefined;
|
|
14
|
+
emulated_machine: number | undefined;
|
|
15
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { machine } from 'node:os';
|
|
2
|
+
import { library, winError } from './native.js';
|
|
3
|
+
export function architecture() {
|
|
4
|
+
const nodeMachine = machine();
|
|
5
|
+
if (process.platform !== 'win32')
|
|
6
|
+
return {
|
|
7
|
+
host_arch: nodeMachine === 'x86_64' ? 'x64' : nodeMachine,
|
|
8
|
+
process_arch: process.arch, node_os_machine: nodeMachine, architecture_source: 'os.machine',
|
|
9
|
+
};
|
|
10
|
+
// os.machine() can describe the emulated x64 view. IsWow64Process2
|
|
11
|
+
// explicitly returns the native machine independently of the process ABI.
|
|
12
|
+
const k = library('kernel32.dll');
|
|
13
|
+
const handle = k.func('void *GetCurrentProcess()')();
|
|
14
|
+
const processMachine = [0], nativeMachine = [0];
|
|
15
|
+
if (!k.func('bool IsWow64Process2(void *process, _Out_ uint16_t *processMachine, _Out_ uint16_t *nativeMachine)')(handle, processMachine, nativeMachine))
|
|
16
|
+
throw winError('IsWow64Process2');
|
|
17
|
+
const names = { 0x14c: 'ia32', 0x8664: 'x64', 0xaa64: 'arm64' };
|
|
18
|
+
return { host_arch: names[nativeMachine[0]] ?? `machine-${nativeMachine[0]}`, process_arch: process.arch,
|
|
19
|
+
node_os_machine: nodeMachine, architecture_source: 'IsWow64Process2',
|
|
20
|
+
native_machine: nativeMachine[0], emulated_machine: processMachine[0] };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=architecture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architecture.js","sourceRoot":"","sources":["../../src/architecture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,YAAY;IAC1B,MAAM,WAAW,GAAG,OAAO,EAAE,CAAC;IAC9B,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO;YACvC,SAAS,EAAE,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW;YACzD,YAAY,EAAE,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE,YAAY;SAC5F,CAAC;IACF,mEAAmE;IACnE,0EAA0E;IAC1E,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC;IACrD,MAAM,cAAc,GAAG,CAAC,CAAC,CAAC,EAAE,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,oGAAoG,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,CAAC;QAAE,MAAM,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC5L,MAAM,KAAK,GAA2B,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACxF,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAE,CAAC,IAAI,WAAW,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI;QACvG,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE,iBAAiB;QACpE,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { library, int64, nativeApi, nativeFunction } from './native.js';
|
|
3
|
+
let readPosix;
|
|
4
|
+
let timespec;
|
|
5
|
+
function posixTime(id) {
|
|
6
|
+
if (!readPosix) {
|
|
7
|
+
const api = nativeApi();
|
|
8
|
+
timespec ??= api.struct('StatuslineTimespec', { sec: 'int64_t', nsec: 'int64_t' });
|
|
9
|
+
readPosix = library(process.platform === 'darwin' ? '/usr/lib/libSystem.B.dylib' : 'libc.so.6').func('clock_gettime', 'int', ['int', api.out(api.pointer(timespec))]);
|
|
10
|
+
}
|
|
11
|
+
const out = { sec: 0, nsec: 0 };
|
|
12
|
+
if (readPosix(id, out))
|
|
13
|
+
throw new Error('clock_gettime');
|
|
14
|
+
return int64(out.sec) * 1000000000n + int64(out.nsec);
|
|
15
|
+
}
|
|
16
|
+
let readTimebase;
|
|
17
|
+
let timebaseType;
|
|
18
|
+
function timebase(out) {
|
|
19
|
+
if (!readTimebase) {
|
|
20
|
+
const api = nativeApi();
|
|
21
|
+
timebaseType ??= api.struct('StatuslineTimebase', { numer: 'uint32_t', denom: 'uint32_t' });
|
|
22
|
+
readTimebase = library('/usr/lib/libSystem.B.dylib').func('mach_timebase_info', 'int', [api.out(api.pointer(timebaseType))]);
|
|
23
|
+
}
|
|
24
|
+
return readTimebase(out);
|
|
25
|
+
}
|
|
26
|
+
function guid(raw) {
|
|
27
|
+
return [raw.readUInt32LE(0).toString(16).padStart(8, '0'), raw.readUInt16LE(4).toString(16).padStart(4, '0'),
|
|
28
|
+
raw.readUInt16LE(6).toString(16).padStart(4, '0'), raw.subarray(8, 10).toString('hex'), raw.subarray(10, 16).toString('hex')].join('-');
|
|
29
|
+
}
|
|
30
|
+
export function windowsBootId(environment, sequence) {
|
|
31
|
+
if (environment.length !== 32 || environment.subarray(0, 16).every(x => x === 0) || sequence.length !== 4 || sequence.readUInt32LE() === 0) {
|
|
32
|
+
throw new Error('Windows boot identity unavailable');
|
|
33
|
+
}
|
|
34
|
+
return `windows:v2:${guid(environment)}:${sequence.readUInt32LE()}`;
|
|
35
|
+
}
|
|
36
|
+
export function nativeSample() {
|
|
37
|
+
if (process.platform === 'win32') {
|
|
38
|
+
const kernel = (signature) => nativeFunction('kernel32.dll', signature);
|
|
39
|
+
const wall = Buffer.alloc(8);
|
|
40
|
+
kernel('void GetSystemTimePreciseAsFileTime(_Out_ void *time)')(wall);
|
|
41
|
+
const wall_ns = (wall.readBigUInt64LE() - 116444736000000000n) * 100n;
|
|
42
|
+
try {
|
|
43
|
+
const boot_ns = int64(kernel('uint64_t GetTickCount64()')()) * 1000000n;
|
|
44
|
+
const env = Buffer.alloc(32), size = [0];
|
|
45
|
+
const status = nativeFunction('ntdll.dll', 'int32_t NtQuerySystemInformation(uint32_t cls, _Out_ void *data, uint32_t size, _Out_ uint32_t *length)')(90, env, env.length, size);
|
|
46
|
+
if (status < 0 || size[0] !== env.length || boot_ns > wall_ns)
|
|
47
|
+
throw new Error('boot identity');
|
|
48
|
+
// WDK KUSER_SHARED_DATA.BootId: OS-loader boot sequence at user-page
|
|
49
|
+
// offset 0x2c4 (x64 / ARM64, including x64 emulation). Read only our own
|
|
50
|
+
// process via the checked API; an inaccessible page degrades safely.
|
|
51
|
+
const sequence = Buffer.alloc(4), count = [0];
|
|
52
|
+
const current = kernel('void *GetCurrentProcess()')();
|
|
53
|
+
if (!kernel('int32_t ReadProcessMemory(void *process, uintptr_t base, _Out_ void *buffer, size_t size, _Out_ size_t *count)')(current, 0x7ffe02c4, sequence, sequence.length, count) || count[0] !== sequence.length)
|
|
54
|
+
throw new Error('boot sequence');
|
|
55
|
+
return { wall_ns, boot_ns, boot_id: windowsBootId(env, sequence) };
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return { wall_ns, boot_ns: null, boot_id: null };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const wall_ns = posixTime(0);
|
|
62
|
+
if (process.platform === 'linux') {
|
|
63
|
+
let boot_ns = null, boot_id = null;
|
|
64
|
+
try {
|
|
65
|
+
boot_ns = posixTime(7);
|
|
66
|
+
}
|
|
67
|
+
catch { /* CLOCK_BOOTTIME unavailable */ }
|
|
68
|
+
try {
|
|
69
|
+
boot_id = readFileSync('/proc/sys/kernel/random/boot_id', 'ascii').trim() || null;
|
|
70
|
+
}
|
|
71
|
+
catch { /* unavailable */ }
|
|
72
|
+
return { wall_ns, boot_ns, boot_id };
|
|
73
|
+
}
|
|
74
|
+
if (process.platform === 'darwin') {
|
|
75
|
+
try {
|
|
76
|
+
const lib = (signature) => nativeFunction('/usr/lib/libSystem.B.dylib', signature);
|
|
77
|
+
const tb = { numer: 0, denom: 0 }, uuid = Buffer.alloc(128), len = [128];
|
|
78
|
+
if (timebase(tb) || tb.numer <= 0 || tb.denom <= 0)
|
|
79
|
+
throw new Error('timebase');
|
|
80
|
+
if (lib('int sysctlbyname(const char *name, _Out_ void *oldp, _Inout_ size_t *len, const void *newp, size_t size)')('kern.bootsessionuuid', uuid, len, null, 0))
|
|
81
|
+
throw new Error('boot UUID');
|
|
82
|
+
const id = uuid.toString('ascii').split('\0')[0].toLowerCase();
|
|
83
|
+
if (!/^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/.test(id))
|
|
84
|
+
throw new Error('invalid UUID');
|
|
85
|
+
const ticks = int64(lib('uint64_t mach_continuous_time()')());
|
|
86
|
+
return { wall_ns, boot_ns: ticks * BigInt(tb.numer) / BigInt(tb.denom), boot_id: 'darwin:' + id };
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return { wall_ns, boot_ns: null, boot_id: null };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return { wall_ns, boot_ns: null, boot_id: null };
|
|
93
|
+
}
|
|
94
|
+
export function sample(read = nativeSample) {
|
|
95
|
+
try {
|
|
96
|
+
return read();
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return { wall_ns: BigInt(Date.now()) * 1000000n, boot_ns: null, boot_id: null };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=clocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clocks.js","sourceRoot":"","sources":["../../src/clocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIxE,IAAI,SAAmF,CAAC;AACxF,IAAI,QAAgC,CAAC;AACrC,SAAS,SAAS,CAAC,EAAU;IAC3B,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;QACxB,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACnF,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC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IAAI,CAAC,6CAA6C,CAAC,IAAI,CAAC,EAAE,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;YAC7F,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,iCAAiC,CAAC,EAAE,CAAC,CAAC;YAC9D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,GAAG,EAAE,EAAE,CAAC;QACpG,CAAC;QAAC,MAAM,CAAC;YAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAAC,CAAC;IAC/D,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACnD,CAAC;AACD,MAAM,UAAU,MAAM,CAAC,OAAqB,YAAY;IACtD,IAAI,CAAC;QAAC,OAAO,IAAI,EAAE,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,QAAU,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAAC,CAAC;AACrH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LaunchSpec } from './launch.js';
|
|
2
|
+
export interface CommandResult {
|
|
3
|
+
code: number | null;
|
|
4
|
+
stdout: Buffer;
|
|
5
|
+
stderr: Buffer;
|
|
6
|
+
}
|
|
7
|
+
export interface CommandOptions {
|
|
8
|
+
timeoutMs: number;
|
|
9
|
+
environment?: NodeJS.ProcessEnv;
|
|
10
|
+
}
|
|
11
|
+
export type CommandRunner = (spec: LaunchSpec, options: CommandOptions) => CommandResult;
|
|
12
|
+
export declare class CommandTimeout extends Error {
|
|
13
|
+
}
|
|
14
|
+
/** Exact argv, UTF-8 bytes, no shell and no extra console on Windows. */
|
|
15
|
+
export declare const runCommand: CommandRunner;
|
|
16
|
+
export declare function monotonicMilliseconds(): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
export class CommandTimeout extends Error {
|
|
3
|
+
}
|
|
4
|
+
/** Exact argv, UTF-8 bytes, no shell and no extra console on Windows. */
|
|
5
|
+
export const runCommand = (spec, options) => {
|
|
6
|
+
if (options.timeoutMs <= 0)
|
|
7
|
+
throw new CommandTimeout('Command deadline expired');
|
|
8
|
+
const result = spawnSync(spec.executable, [...spec.args], { timeout: Math.max(1, Math.ceil(options.timeoutMs)),
|
|
9
|
+
env: options.environment ?? process.env, windowsHide: true, maxBuffer: Number.MAX_SAFE_INTEGER, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
10
|
+
if (result.error) {
|
|
11
|
+
if (result.error.code === 'ETIMEDOUT')
|
|
12
|
+
throw new CommandTimeout('Command deadline expired');
|
|
13
|
+
throw result.error;
|
|
14
|
+
}
|
|
15
|
+
return { code: result.status, stdout: result.stdout, stderr: result.stderr };
|
|
16
|
+
};
|
|
17
|
+
export function monotonicMilliseconds() { return performance.now(); }
|
|
18
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAY/C,MAAM,OAAO,cAAe,SAAQ,KAAK;CACxC;AACD,yEAAyE;AACzE,MAAM,CAAC,MAAM,UAAU,GAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,OAAO,CAAC,SAAS,IAAI,CAAC;QACtB,MAAM,IAAI,cAAc,CAAC,0BAA0B,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1G,GAAG,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACzI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,IAAK,MAAM,CAAC,KAA+B,CAAC,IAAI,KAAK,WAAW;YAC5D,MAAM,IAAI,cAAc,CAAC,0BAA0B,CAAC,CAAC;QACzD,MAAM,MAAM,CAAC,KAAK,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AACjF,CAAC,CAAC;AACF,MAAM,UAAU,qBAAqB,KAAa,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LaunchSpec } from './launch.js';
|
|
2
|
+
export declare function expandUser(value: string): string;
|
|
3
|
+
export declare function normalizedPath(value: string): string;
|
|
4
|
+
export declare function resolvedPath(value: string): string;
|
|
5
|
+
export declare function which(name: string, environment?: NodeJS.ProcessEnv): string | null;
|
|
6
|
+
/** POSIX shlex tokenization, used for identity only; this never executes a shell. */
|
|
7
|
+
export declare function splitCommand(value: unknown): string[] | null;
|
|
8
|
+
export declare function quoteArgument(value: string): string;
|
|
9
|
+
export declare function commandFor(launch: LaunchSpec, operation: string): string;
|
|
10
|
+
export declare function ownedCommand(command: unknown, operation: string, launch: LaunchSpec): boolean;
|
|
11
|
+
export declare function claudeLaunch(executable?: string, windows?: boolean, find?: typeof which): LaunchSpec;
|
|
12
|
+
export declare function detectClaudeVersion(): readonly number[] | null;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { accessSync, constants, realpathSync, readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { delimiter, dirname, extname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
export function expandUser(value) {
|
|
6
|
+
return value === '~' ? homedir() : /^~[/\\]/u.test(value) ? join(homedir(), value.slice(2)) : value;
|
|
7
|
+
}
|
|
8
|
+
export function normalizedPath(value) {
|
|
9
|
+
const path = resolve(expandUser(value));
|
|
10
|
+
return process.platform === 'win32' ? path.toLowerCase() : path;
|
|
11
|
+
}
|
|
12
|
+
export function resolvedPath(value) {
|
|
13
|
+
const path = resolve(expandUser(value));
|
|
14
|
+
try {
|
|
15
|
+
return realpathSync.native(path);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
const parent = dirname(path);
|
|
19
|
+
return parent === path ? path : join(resolvedPath(parent), relative(parent, path));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function which(name, environment = process.env) {
|
|
23
|
+
if (name.includes('\0'))
|
|
24
|
+
return null;
|
|
25
|
+
const paths = /[/\\]/u.test(name) ? [''] : (environment.PATH ?? '').split(delimiter);
|
|
26
|
+
const extensions = process.platform === 'win32' ? (environment.PATHEXT ?? '.COM;.EXE;.BAT;.CMD').split(';') : [''];
|
|
27
|
+
for (const folder of paths)
|
|
28
|
+
for (const suffix of ['', ...extensions.filter(e => !name.toLowerCase().endsWith(e.toLowerCase()))]) {
|
|
29
|
+
const path = resolve(folder, name + suffix);
|
|
30
|
+
try {
|
|
31
|
+
if (statSync(path).isFile()) {
|
|
32
|
+
accessSync(path, process.platform === 'win32' ? constants.F_OK : constants.X_OK);
|
|
33
|
+
return path;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch { /* Try the next PATH entry. */ }
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
/** POSIX shlex tokenization, used for identity only; this never executes a shell. */
|
|
41
|
+
export function splitCommand(value) {
|
|
42
|
+
if (typeof value !== 'string')
|
|
43
|
+
return null;
|
|
44
|
+
let quote = '', word = '', active = false;
|
|
45
|
+
const result = [];
|
|
46
|
+
for (let i = 0; i < value.length; i++) {
|
|
47
|
+
const c = value[i];
|
|
48
|
+
if (!quote && /[ \t\r\n]/u.test(c)) {
|
|
49
|
+
if (active)
|
|
50
|
+
result.push(word);
|
|
51
|
+
word = '';
|
|
52
|
+
active = false;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (c === quote) {
|
|
56
|
+
quote = '';
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (!quote && (c === "'" || c === '"')) {
|
|
60
|
+
quote = c;
|
|
61
|
+
active = true;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (c === '\\' && quote !== "'") {
|
|
65
|
+
const next = value[++i];
|
|
66
|
+
if (next === undefined)
|
|
67
|
+
return null;
|
|
68
|
+
if (quote === '"' && next !== '"' && next !== '\\')
|
|
69
|
+
word += '\\';
|
|
70
|
+
word += next;
|
|
71
|
+
active = true;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
word += c;
|
|
75
|
+
active = true;
|
|
76
|
+
}
|
|
77
|
+
if (quote)
|
|
78
|
+
return null;
|
|
79
|
+
if (active)
|
|
80
|
+
result.push(word);
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
export function quoteArgument(value) {
|
|
84
|
+
if (/[\0\r\n]/u.test(value))
|
|
85
|
+
throw new TypeError('Unsafe command argument');
|
|
86
|
+
return '"' + value.replace(/[\\"$`]/gu, '\\$&') + '"';
|
|
87
|
+
}
|
|
88
|
+
export function commandFor(launch, operation) {
|
|
89
|
+
if (!['render', 'render-subagents', 'hook', 'slash-hook'].includes(operation))
|
|
90
|
+
throw new TypeError('Unsupported command operation');
|
|
91
|
+
if (process.platform === 'win32' && !launch.args.length)
|
|
92
|
+
return `claude-statusline.exe ${operation}`;
|
|
93
|
+
return [...[launch.executable, ...launch.args].map(quoteArgument), operation].join(' ');
|
|
94
|
+
}
|
|
95
|
+
export function ownedCommand(command, operation, launch) {
|
|
96
|
+
const argv = splitCommand(command);
|
|
97
|
+
if (!argv || argv.length !== launch.args.length + 2 || argv.at(-1) !== operation)
|
|
98
|
+
return false;
|
|
99
|
+
if (JSON.stringify(argv) === JSON.stringify(splitCommand(commandFor(launch, operation))))
|
|
100
|
+
return true;
|
|
101
|
+
if (argv.slice(1, -1).some((arg, index) => arg !== launch.args[index]))
|
|
102
|
+
return false;
|
|
103
|
+
let candidate = argv[0];
|
|
104
|
+
if (!launch.args.length && !/[/\\]/u.test(candidate) && (candidate === 'claude-statusline' || candidate.toLowerCase() === 'claude-statusline.exe'))
|
|
105
|
+
return true;
|
|
106
|
+
if (normalizedPath(candidate) === normalizedPath(launch.executable))
|
|
107
|
+
return true;
|
|
108
|
+
const decoded = candidate.replaceAll('\\$', '$').replaceAll('\\`', '`');
|
|
109
|
+
if (typeof command === 'string' && command.trim() === commandFor({ executable: decoded, args: launch.args }, operation))
|
|
110
|
+
candidate = decoded;
|
|
111
|
+
if (normalizedPath(resolvedPath(candidate)) === normalizedPath(resolvedPath(launch.executable)))
|
|
112
|
+
return true;
|
|
113
|
+
const found = which(candidate);
|
|
114
|
+
return found !== null && normalizedPath(found) === normalizedPath(launch.executable);
|
|
115
|
+
}
|
|
116
|
+
export function claudeLaunch(executable = 'claude', windows = process.platform === 'win32', find = which) {
|
|
117
|
+
let found = find(executable);
|
|
118
|
+
if (!found)
|
|
119
|
+
throw new Error('errors.capabilities.claude_code_is_not_in_path');
|
|
120
|
+
// npm installs a POSIX shim beside the Windows .cmd entry. An extensionless
|
|
121
|
+
// PATH hit must not be handed to CreateProcessW as if it were a PE binary.
|
|
122
|
+
if (windows && !extname(found)) {
|
|
123
|
+
const wrapper = find(found + '.cmd');
|
|
124
|
+
if (wrapper && normalizedPath(wrapper) === normalizedPath(found + '.cmd'))
|
|
125
|
+
found = wrapper;
|
|
126
|
+
}
|
|
127
|
+
const path = resolvedPath(found);
|
|
128
|
+
if (!windows || !['.cmd', '.bat'].includes(extname(path).toLowerCase()))
|
|
129
|
+
return { executable: path, args: [] };
|
|
130
|
+
for (const root of [join(dirname(path), 'node_modules/@anthropic-ai/claude-code'), join(dirname(dirname(path)), '@anthropic-ai/claude-code')]) {
|
|
131
|
+
try {
|
|
132
|
+
const data = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
|
133
|
+
const entry = typeof data.bin === 'string' ? data.bin : data.bin?.claude;
|
|
134
|
+
if (typeof entry !== 'string')
|
|
135
|
+
continue;
|
|
136
|
+
const target = resolvedPath(join(root, entry)), rel = relative(resolvedPath(root), target);
|
|
137
|
+
if (rel.startsWith('..') || isAbsolute(rel) || !statSync(target).isFile())
|
|
138
|
+
continue;
|
|
139
|
+
if (extname(target).toLowerCase() === '.exe')
|
|
140
|
+
return { executable: target, args: [] };
|
|
141
|
+
const node = find('node');
|
|
142
|
+
if (node && ['.js', '.cjs', '.mjs'].includes(extname(target).toLowerCase()))
|
|
143
|
+
return { executable: resolvedPath(node), args: [target] };
|
|
144
|
+
}
|
|
145
|
+
catch { /* A malformed shim cannot authorize shell execution. */ }
|
|
146
|
+
}
|
|
147
|
+
throw new Error('errors.capabilities.cannot_safely_resolve_claude_batch_wrapper_use');
|
|
148
|
+
}
|
|
149
|
+
export function detectClaudeVersion() {
|
|
150
|
+
try {
|
|
151
|
+
const launch = claudeLaunch();
|
|
152
|
+
const result = spawnSync(launch.executable, [...launch.args, '--version'], { encoding: 'utf8', timeout: 5000, windowsHide: true, shell: false });
|
|
153
|
+
const match = result.stdout?.match(/(?<!\d)(\d+)\.(\d+)\.(\d+)(?!\d)/u);
|
|
154
|
+
return result.status === 0 && match ? match.slice(1).map(Number) : null;
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,UAAU,UAAU,CAAC,KAAa;IACpC,OAAO,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACxG,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,KAAa;IACxC,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACxC,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACpE,CAAC;AACD,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC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AAC,WAAW,EAAE,CAAC;gBACvE,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QAClE,CAAC;QACD,MAAM,CAAC,CAAC,wDAAwD,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;AAC1F,CAAC;AACD,MAAM,UAAU,mBAAmB;IAC/B,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACjJ,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACxE,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5E,CAAC;IACD,MAAM,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function errorDescription(error: unknown): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const MESSAGES = {
|
|
2
|
+
EACCES: [13, 'Permission denied'], EPERM: [1, 'Operation not permitted'], ENOENT: [2, 'No such file or directory'],
|
|
3
|
+
EEXIST: [17, 'File exists'], EISDIR: [21, 'Is a directory'], ENOTDIR: [20, 'Not a directory'], ENOSPC: [28, 'No space left on device'],
|
|
4
|
+
EROFS: [30, 'Read-only file system'], EINVAL: [22, 'Invalid argument'], EMFILE: [24, 'Too many open files'], ELOOP: [40, 'Too many levels of symbolic links'],
|
|
5
|
+
};
|
|
6
|
+
function repr(value) {
|
|
7
|
+
const quote = value.includes("'") && !value.includes('"') ? '"' : "'";
|
|
8
|
+
return quote + value.replaceAll('\\', '\\\\').replaceAll(quote, '\\' + quote).replaceAll('\n', '\\n').replaceAll('\r', '\\r').replaceAll('\t', '\\t') + quote;
|
|
9
|
+
}
|
|
10
|
+
export function errorDescription(error) {
|
|
11
|
+
if (!(error instanceof Error))
|
|
12
|
+
return String(error);
|
|
13
|
+
const e = error;
|
|
14
|
+
const message = e.code && MESSAGES[e.code];
|
|
15
|
+
if (!message)
|
|
16
|
+
return error.message;
|
|
17
|
+
return `[Errno ${message[0]}] ${message[1]}` + (e.path === undefined ? '' : ': ' + repr(e.path)) + (e.dest === undefined ? '' : ' -> ' + repr(e.dest));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAGR;IACF,MAAM,EAAE,CAAC,EAAE,EAAE,mBAAmB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,2BAA2B,CAAC;IAClH,MAAM,EAAE,CAAC,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,yBAAyB,CAAC;IACtI,KAAK,EAAE,CAAC,EAAE,EAAE,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC,EAAE,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 -0,0 +1,8 @@
|
|
|
1
|
+
export declare function privateDirectory(path: string): void;
|
|
2
|
+
export declare function isLinkOrReparse(path: string): boolean;
|
|
3
|
+
export declare function lock(path: string): () => void;
|
|
4
|
+
export declare function withLock<T>(path: string, action: () => T): T;
|
|
5
|
+
export declare function retryWindows(operation: () => void, windows?: boolean, sleep?: (ms: number) => "ok" | "not-equal" | "timed-out"): void;
|
|
6
|
+
export declare function syncDirectory(path: string): boolean | null;
|
|
7
|
+
export declare function atomicWrite(path: string, content: string | Buffer, stage?: (name: string) => void): boolean | null;
|
|
8
|
+
export declare function durableUnlink(path: string): void;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import { dirname, basename, join, resolve } from 'node:path';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import { library, nativeApi, nativeFunction, winError } from './native.js';
|
|
5
|
+
export function privateDirectory(path) {
|
|
6
|
+
fs.mkdirSync(path, { recursive: true, mode: 0o700 });
|
|
7
|
+
if (process.platform !== 'win32') {
|
|
8
|
+
try {
|
|
9
|
+
fs.chmodSync(path, 0o700);
|
|
10
|
+
}
|
|
11
|
+
catch { /* Match best-effort legacy permissions. */ }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function isLinkOrReparse(path) {
|
|
15
|
+
try {
|
|
16
|
+
if (fs.lstatSync(path).isSymbolicLink())
|
|
17
|
+
return true;
|
|
18
|
+
if (process.platform === 'win32') {
|
|
19
|
+
const attr = library('kernel32.dll').func('uint32_t GetFileAttributesW(const char16_t *path)')(path);
|
|
20
|
+
return attr !== 0xffffffff && Boolean(attr & 0x400);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
if (e.code !== 'ENOENT')
|
|
25
|
+
throw e;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const held = new Set();
|
|
30
|
+
export function lock(path) {
|
|
31
|
+
const key = process.platform === 'win32' ? resolve(path).toLowerCase() : resolve(path);
|
|
32
|
+
if (held.has(key))
|
|
33
|
+
throw new Error('Recursive acquisition of a synchronous file lock');
|
|
34
|
+
const release = acquire(path);
|
|
35
|
+
held.add(key);
|
|
36
|
+
let active = true;
|
|
37
|
+
return () => { if (active) {
|
|
38
|
+
active = false;
|
|
39
|
+
try {
|
|
40
|
+
release();
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
held.delete(key);
|
|
44
|
+
}
|
|
45
|
+
} };
|
|
46
|
+
}
|
|
47
|
+
export function withLock(path, action) {
|
|
48
|
+
const release = lock(path);
|
|
49
|
+
try {
|
|
50
|
+
const result = action();
|
|
51
|
+
if (result !== null && typeof result === 'object' && 'then' in result)
|
|
52
|
+
throw new TypeError('File lock callbacks must be synchronous');
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
release();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function acquire(path) {
|
|
60
|
+
fs.mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
61
|
+
if (isLinkOrReparse(path))
|
|
62
|
+
throw new Error('Unsafe lock target');
|
|
63
|
+
if (process.platform === 'win32') {
|
|
64
|
+
const k = library('kernel32.dll');
|
|
65
|
+
const h = k.func('void *CreateFileW(const char16_t *path, uint32_t access, uint32_t share, void *security, uint32_t disposition, uint32_t flags, void *template)')(path, 0xc0000000, 7, null, 4, 0x80, null);
|
|
66
|
+
if (!h || nativeApi().address(h) === 0xffffffffffffffffn)
|
|
67
|
+
throw winError('CreateFileW');
|
|
68
|
+
const close = () => { k.func('bool CloseHandle(void *handle)')(h); };
|
|
69
|
+
// Same byte-range namespace as Python's msvcrt.locking, including empty files.
|
|
70
|
+
if (!k.func('bool LockFileEx(void *handle, uint32_t flags, uint32_t reserved, uint32_t low, uint32_t high, _Inout_ void *overlapped)')(h, 2, 0, 1, 0, Buffer.alloc(32))) {
|
|
71
|
+
const error = winError('LockFileEx');
|
|
72
|
+
close();
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
return close;
|
|
76
|
+
}
|
|
77
|
+
const fd = fs.openSync(path, fs.constants.O_CREAT | fs.constants.O_RDWR | fs.constants.O_NOFOLLOW, 0o600);
|
|
78
|
+
try {
|
|
79
|
+
fs.fchmodSync(fd, 0o600);
|
|
80
|
+
const flock = nativeFunction(process.platform === 'darwin' ? '/usr/lib/libSystem.B.dylib' : 'libc.so.6', 'int flock(int fd, int op)');
|
|
81
|
+
if (flock(fd, 2))
|
|
82
|
+
throw new Error('flock failed');
|
|
83
|
+
return () => fs.closeSync(fd);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
fs.closeSync(fd);
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export function retryWindows(operation, windows = process.platform === 'win32', sleep = (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms)) {
|
|
91
|
+
for (const delay of [10, 20, 40, 80, 160, null]) {
|
|
92
|
+
try {
|
|
93
|
+
operation();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
const e = error;
|
|
98
|
+
if (!windows || delay === null || !([5, 32, 33].includes(e.winerror) || ['EACCES', 'EPERM'].includes(e.code)))
|
|
99
|
+
throw error;
|
|
100
|
+
sleep(delay);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export function syncDirectory(path) {
|
|
105
|
+
if (process.platform === 'win32')
|
|
106
|
+
return null;
|
|
107
|
+
const fd = fs.openSync(dirname(path), 'r');
|
|
108
|
+
try {
|
|
109
|
+
fs.fsyncSync(fd);
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
if (process.platform === 'darwin' && ['EINVAL', 'ENOTSUP', 'EOPNOTSUPP'].includes(e.code))
|
|
114
|
+
return false;
|
|
115
|
+
throw e;
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
fs.closeSync(fd);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export function atomicWrite(path, content, stage = () => { }) {
|
|
122
|
+
fs.mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
123
|
+
if (isLinkOrReparse(path))
|
|
124
|
+
throw new Error('Unsafe publication target');
|
|
125
|
+
const temporary = join(dirname(path), `.${basename(path)}.statusline-${randomUUID()}.tmp`);
|
|
126
|
+
let fd = fs.openSync(temporary, 'wx', 0o600);
|
|
127
|
+
try {
|
|
128
|
+
fs.writeFileSync(fd, content);
|
|
129
|
+
stage('written');
|
|
130
|
+
fs.fsyncSync(fd);
|
|
131
|
+
stage('synced');
|
|
132
|
+
fs.closeSync(fd);
|
|
133
|
+
fd = undefined;
|
|
134
|
+
stage('before-replace');
|
|
135
|
+
retryWindows(() => fs.renameSync(temporary, path));
|
|
136
|
+
stage('replaced');
|
|
137
|
+
return syncDirectory(path);
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
if (fd !== undefined)
|
|
141
|
+
fs.closeSync(fd);
|
|
142
|
+
try {
|
|
143
|
+
retryWindows(() => fs.unlinkSync(temporary));
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
if (e.code !== 'ENOENT')
|
|
147
|
+
throw e;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export function durableUnlink(path) {
|
|
152
|
+
if (isLinkOrReparse(path))
|
|
153
|
+
throw new Error('Unsafe deletion target');
|
|
154
|
+
try {
|
|
155
|
+
retryWindows(() => fs.unlinkSync(path));
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
if (error.code === 'ENOENT')
|
|
159
|
+
return;
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
syncDirectory(path);
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -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AAC;IAAC,CAAC;IAC9F,aAAa,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { canonical } from '@fbincon/statusline-core/json';
|
|
3
|
+
export function sha256(value) { return createHash('sha256').update(value).digest('hex'); }
|
|
4
|
+
export function revision(value) { return sha256(canonical(value)); }
|
|
5
|
+
//# sourceMappingURL=hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,MAAM,UAAU,MAAM,CAAC,KAA0B,IAAY,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACvH,MAAM,UAAU,QAAQ,CAAC,KAAc,IAAY,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|