@fbincon/claude-code-statusline 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -78
- package/candidate.json +476 -342
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js +23 -5
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +43 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/observations.js +5 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/observations.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js +8 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js +22 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +2 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js +2 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js +14 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/management/arguments.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/arguments.js +56 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/bootstrap.d.ts +7 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/bootstrap.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/bootstrap.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/configuration.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/configuration.js +123 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/configuration.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/first-entry.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/first-entry.js +170 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/first-entry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/integration-runner.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/integration-runner.js +51 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/integration-runner.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/integration.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/integration.js +23 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/integration.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/restore.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/restore.js +62 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/restore.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/service.d.ts +18 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/service.js +319 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/store.d.ts +53 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/store.js +117 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/worker-entry.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/worker-entry.js +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/worker-entry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js +9 -10
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js +11 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage-index.js +2 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage-index.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.d.ts +35 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic.d.ts +12 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic.js +99 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js +5 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.js +4 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/lifecycle.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/lifecycle.js +12 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/lifecycle.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js +6 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.d.ts +9 -4
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js +84 -18
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +9 -5
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +3 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/cost-rate.ts +9 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +6 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +3 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/group-manager.ts +102 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/groups.ts +89 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/indicators.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-manager.ts +20 -17
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-validation.ts +5 -4
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +23 -11
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +630 -6
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/presentation.ts +3 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +21 -17
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +5 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +7 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/observe.ts +27 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/generated-contracts.ts +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +6 -6
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +123 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +168 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +22 -12
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +8 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +8 -6
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +42 -9
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +5 -5
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +3 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +10 -5
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/cost-rate.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/cost-rate.js +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/cost-rate.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +5 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +3 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/group-manager.d.ts +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/group-manager.js +131 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/group-manager.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.js +103 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/indicators.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/indicators.js +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/indicators.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.d.ts +3 -2
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js +20 -11
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js +6 -4
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js +20 -4
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +624 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +630 -6
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +5 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +5 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +5 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +5 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js +5 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js +5 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/management/compatibility.d.ts +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/management/compatibility.js +77 -0
- package/node_modules/@fbincon/statusline-core/dist/src/management/compatibility.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/management/package.d.ts +41 -0
- package/node_modules/@fbincon/statusline-core/dist/src/management/package.js +15 -0
- package/node_modules/@fbincon/statusline-core/dist/src/management/package.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/release.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.d.ts +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.js +6 -3
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/groups.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/groups.js +124 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/groups.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/indicators.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/indicators.js +48 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/indicators.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +12 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +11 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/trace.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.d.ts +2 -1
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js +2 -1
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +105 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +105 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +105 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +105 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-HK.json +105 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-TW.json +105 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/command.d.ts +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/files.d.ts +4 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js +12 -7
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/git.d.ts +31 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/git.js +180 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/npm.d.ts +44 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/npm.js +229 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/npm.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/package-copy.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/package-copy.js +49 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/package-copy.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/remove-tree.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/remove-tree.js +51 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/remove-tree.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js +18 -3
- package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.js +24 -2
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/capabilities.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/capabilities.js +20 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/capabilities.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.d.ts +3 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js +5 -2
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.d.ts +3 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js +20 -3
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.d.ts +3 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.js +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js +5 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js +6 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js +2 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js +6 -7
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/setup.d.ts +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/setup.js +6 -4
- package/node_modules/@fbincon/statusline-tui/dist/src/setup.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +12 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -1
- package/package.json +47 -1
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { PackageError } from '@fbincon/statusline-core/management/package';
|
|
6
|
+
import { compatibility, compareVersions, runtimeCompatibility } from '@fbincon/statusline-core/management/compatibility';
|
|
7
|
+
import { t } from '@fbincon/statusline-core/i18n/messages';
|
|
8
|
+
import { Npm, productIdentity, productRoot, writablePrefix, within, verifyArchive, globalPackageRoot } from '@fbincon/statusline-platform/npm';
|
|
9
|
+
import { lock, atomicWrite } from '@fbincon/statusline-platform/files';
|
|
10
|
+
import { copyPackage } from '@fbincon/statusline-platform/package-copy';
|
|
11
|
+
import { removeTree } from '@fbincon/statusline-platform/remove-tree';
|
|
12
|
+
import { detectClaudeVersion, resolvedPath, which, sameLaunchEntry } from '@fbincon/statusline-platform/commands';
|
|
13
|
+
import { readPreferences } from '../config/preferences.js';
|
|
14
|
+
import { createStorage } from '../config/storage.js';
|
|
15
|
+
import { previousBinding } from '../integration/ownership.js';
|
|
16
|
+
import { assertClear } from '../recovery/journal.js';
|
|
17
|
+
import { safeTarget } from '../integration/paths.js';
|
|
18
|
+
import { managementOptions } from './arguments.js';
|
|
19
|
+
import { confirmPackage } from './first-entry.js';
|
|
20
|
+
import { pendingPath, startOperation, saveOperation, recordInstallation, finishOperation, operationPath, readInstallation, readOperation, observeOperation } from './store.js';
|
|
21
|
+
import { configurationBytes, configurationHashes, configurationCompatibility, assertConfiguration, saveSnapshot } from './configuration.js';
|
|
22
|
+
import { refreshIntegration } from './integration.js';
|
|
23
|
+
import { restoreConfiguration } from './restore.js';
|
|
24
|
+
import { ArgumentError } from '../config/arguments.js';
|
|
25
|
+
import { processMatches } from '@fbincon/statusline-platform/processes';
|
|
26
|
+
export function mutationAuthorized(flags, tty) {
|
|
27
|
+
if (flags.check || flags.dryRun)
|
|
28
|
+
return;
|
|
29
|
+
if (!tty && (!flags.yes || !flags.prefix || !flags.restoreConfig && !flags.version))
|
|
30
|
+
throw new PackageError('noninteractive');
|
|
31
|
+
}
|
|
32
|
+
function currentPackage(layout) {
|
|
33
|
+
const current = productIdentity(layout.root, layout.prefix);
|
|
34
|
+
if (!current)
|
|
35
|
+
throw new PackageError('not_installed');
|
|
36
|
+
return current;
|
|
37
|
+
}
|
|
38
|
+
function sameIdentity(current, before) {
|
|
39
|
+
return current.version === before.version && current.root === before.root && current.entry === before.entry && current.prefix === before.prefix && current.inventory_sha256 === before.inventory_sha256;
|
|
40
|
+
}
|
|
41
|
+
function selection(flags, before, history) {
|
|
42
|
+
if (flags.version)
|
|
43
|
+
return { selector: flags.version, channel: flags.command === 'rollback' ? history?.previousChannel ?? (flags.version.includes('-') ? null : 'latest') : history?.channel ?? (flags.version.includes('-') ? null : 'latest') };
|
|
44
|
+
if (flags.command === 'rollback') {
|
|
45
|
+
if (!history?.previous || history.current.version !== before.version)
|
|
46
|
+
throw new PackageError('no_previous');
|
|
47
|
+
return { selector: history.previous.version, channel: history.previousChannel ?? (history.previous.version.includes('-') ? null : 'latest') };
|
|
48
|
+
}
|
|
49
|
+
const channel = flags.channel ?? history?.channel ?? (before.version.includes('-') ? null : 'latest');
|
|
50
|
+
if (!channel)
|
|
51
|
+
throw new PackageError('channel');
|
|
52
|
+
return { selector: channel, channel };
|
|
53
|
+
}
|
|
54
|
+
function installedCompatibility(current) {
|
|
55
|
+
const manifest = JSON.parse(fs.readFileSync(join(current.root, 'package.json'), 'utf8'));
|
|
56
|
+
return compatibility(manifest.statuslineCompatibility, current.version);
|
|
57
|
+
}
|
|
58
|
+
function observedPackage(layout, operation) {
|
|
59
|
+
if (operation.executors?.some(p => processMatches(p.pid, p.token)))
|
|
60
|
+
throw new PackageError('busy');
|
|
61
|
+
try {
|
|
62
|
+
const identity = productIdentity(layout.root, layout.prefix);
|
|
63
|
+
if (identity && ![operation.before?.version, operation.version].includes(identity.version))
|
|
64
|
+
throw new PackageError('conflict');
|
|
65
|
+
return { identity, state: identity?.version ?? 'absent' };
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (error instanceof PackageError && error.code === 'conflict')
|
|
69
|
+
throw error;
|
|
70
|
+
const manifest = join(layout.root, 'package.json');
|
|
71
|
+
if (fs.existsSync(manifest)) {
|
|
72
|
+
const value = JSON.parse(fs.readFileSync(manifest, 'utf8'));
|
|
73
|
+
if (value.name !== '@fbincon/claude-code-statusline' || ![operation.version, operation.before?.version].includes(value.version))
|
|
74
|
+
throw new PackageError('identity');
|
|
75
|
+
}
|
|
76
|
+
return { identity: null, state: 'incomplete' };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function targetIntegration(configDir, before, flags, origin, layout, env) {
|
|
80
|
+
const binding = previousBinding(configDir, createStorage()), launch = { executable: process.execPath, args: [before.entry] };
|
|
81
|
+
if (binding && (binding.args.length !== 1 || resolvedPath(binding.args[0]) !== resolvedPath(before.entry)))
|
|
82
|
+
throw new PackageError('prefix_ambiguous');
|
|
83
|
+
if (!flags.prefix) {
|
|
84
|
+
const active = which('claude-statusline', env);
|
|
85
|
+
if (active && !sameLaunchEntry(active, launch))
|
|
86
|
+
throw new PackageError('prefix_ambiguous');
|
|
87
|
+
if (!within(origin, layout.cache)) {
|
|
88
|
+
const originIdentity = productIdentity(origin);
|
|
89
|
+
if (originIdentity && origin !== before.root && origin.includes(process.platform === 'win32' ? 'node_modules' : 'lib/node_modules'))
|
|
90
|
+
throw new PackageError('prefix_ambiguous');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return binding !== null;
|
|
94
|
+
}
|
|
95
|
+
export async function manage(argv, options) {
|
|
96
|
+
const { stdout, stderr } = options, environment = options.environment ?? process.env;
|
|
97
|
+
let flags, language = 'en', temporary, release, operation;
|
|
98
|
+
const controller = new AbortController(), cancel = () => controller.abort();
|
|
99
|
+
process.on('SIGINT', cancel);
|
|
100
|
+
process.on('SIGTERM', cancel);
|
|
101
|
+
try {
|
|
102
|
+
flags = managementOptions(argv);
|
|
103
|
+
const requestedDirectory = flags.configDir ?? environment.CLAUDE_CONFIG_DIR;
|
|
104
|
+
const configDir = resolvedPath(requestedDirectory?.trim() ? requestedDirectory : '~/.claude');
|
|
105
|
+
language = flags.language ?? readPreferences(configDir, createStorage()).ui_language;
|
|
106
|
+
mutationAuthorized(flags, options.tty ?? !!(process.stdin.isTTY && process.stdout.isTTY));
|
|
107
|
+
if (flags.restoreConfig && flags.prefix) {
|
|
108
|
+
const prefix = resolvedPath(flags.prefix);
|
|
109
|
+
if (within(configDir, globalPackageRoot(prefix)))
|
|
110
|
+
throw new PackageError('prefix');
|
|
111
|
+
return await restoreConfiguration(flags, configDir, prefix, language, stdout, options.confirm, controller.signal);
|
|
112
|
+
}
|
|
113
|
+
const npm = options.npm ?? new Npm(environment, undefined, undefined, controller.signal), layout = await npm.layout(flags.prefix);
|
|
114
|
+
if (within(configDir, layout.root))
|
|
115
|
+
throw new PackageError('prefix');
|
|
116
|
+
if (flags.restoreConfig)
|
|
117
|
+
return await restoreConfiguration(flags, configDir, layout.prefix, language, stdout, options.confirm, controller.signal);
|
|
118
|
+
let before = null;
|
|
119
|
+
if (!flags.package)
|
|
120
|
+
before = currentPackage(layout);
|
|
121
|
+
const recordedHistory = readInstallation(configDir, layout.prefix);
|
|
122
|
+
const history = flags.package || before && recordedHistory && sameIdentity(before, recordedHistory.current) ? recordedHistory : null;
|
|
123
|
+
if (before && history)
|
|
124
|
+
before = { ...before, integrity: history.current.integrity, registry: history.current.registry };
|
|
125
|
+
let target, channel, integrated, host, hashes, observed = null;
|
|
126
|
+
if (flags.package) {
|
|
127
|
+
operation = readOperation(configDir, layout.prefix);
|
|
128
|
+
if (flags.version && flags.version !== operation.version)
|
|
129
|
+
throw new PackageError('version');
|
|
130
|
+
observed = observedPackage(layout, operation).state;
|
|
131
|
+
before = operation.before;
|
|
132
|
+
target = operation.target ?? await npm.metadata(operation.version, { ...layout, registry: operation.registry });
|
|
133
|
+
channel = operation.channel ?? null;
|
|
134
|
+
integrated = operation.integrated ?? false;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
if (fs.existsSync(pendingPath(layout.prefix)))
|
|
138
|
+
throw new PackageError('pending');
|
|
139
|
+
await npm.verify(before, layout.bin);
|
|
140
|
+
installedCompatibility(before);
|
|
141
|
+
integrated = targetIntegration(configDir, before, flags, options.origin, layout, environment);
|
|
142
|
+
const selected = selection(flags, before, history);
|
|
143
|
+
channel = selected.channel;
|
|
144
|
+
target = await npm.metadata(selected.selector, layout);
|
|
145
|
+
if (flags.command === 'rollback' && !flags.version && history?.previous?.integrity && target.integrity !== history.previous.integrity)
|
|
146
|
+
throw new PackageError('integrity');
|
|
147
|
+
const direction = compareVersions(target.version, before.version);
|
|
148
|
+
if (flags.command === 'update' && direction < 0)
|
|
149
|
+
throw new PackageError('use_rollback');
|
|
150
|
+
if (flags.command === 'rollback' && direction >= 0)
|
|
151
|
+
throw new PackageError('rollback_direction');
|
|
152
|
+
}
|
|
153
|
+
host = integrated ? (options.host ?? detectClaudeVersion)() : null;
|
|
154
|
+
const bytes = configurationBytes(configDir);
|
|
155
|
+
hashes = configurationHashes(bytes);
|
|
156
|
+
const configReasons = configurationCompatibility(bytes, target.compatibility);
|
|
157
|
+
const reasons = runtimeCompatibility(target.compatibility, process.versions.node, process.platform + '-' + process.arch, host?.join('.') ?? null, integrated);
|
|
158
|
+
if (!await npm.nodeCompatible(target.nodeEngine) && !reasons.includes('runtime'))
|
|
159
|
+
reasons.push('runtime');
|
|
160
|
+
if (configReasons.length)
|
|
161
|
+
reasons.push('configuration');
|
|
162
|
+
const review = { schema_version: 1, action: flags.package ? 'recover-package' : flags.command, current: before?.version ?? null, observed_package: observed ?? before?.version ?? null, target: target.version, registry: target.registry, prefix: layout.prefix, entry: join(layout.root, 'node_modules/@fbincon/statusline-cli/dist/src/entry.js'), node: process.execPath, npm_entry: npm.entry, config_dir: configDir, node_version: process.versions.node, node_engine: target.nodeEngine, host: host?.join('.') ?? null, channel, integrated, compatibility: target.compatibility, integrity: target.integrity, compatible: !reasons.length, reasons, configuration_conflicts: configReasons, backup_id: operation?.id ?? history?.transaction ?? null, artifact_verified: false };
|
|
163
|
+
if (flags.check) {
|
|
164
|
+
stdout(JSON.stringify(review, null, 2) + '\n');
|
|
165
|
+
return reasons.length ? 2 : 0;
|
|
166
|
+
}
|
|
167
|
+
if (reasons.length) {
|
|
168
|
+
stdout(JSON.stringify(review, null, 2) + '\n');
|
|
169
|
+
if (!flags.json)
|
|
170
|
+
stderr(t('package.reason_' + reasons[0], language) + '\n');
|
|
171
|
+
return 2;
|
|
172
|
+
}
|
|
173
|
+
if (!flags.package && target.version === before.version) {
|
|
174
|
+
stdout(flags.json ? JSON.stringify({ ...review, unchanged: true }) + '\n' : t('management.current', language, { version: target.version }) + '\n');
|
|
175
|
+
return 0;
|
|
176
|
+
}
|
|
177
|
+
assertClear(configDir, true);
|
|
178
|
+
temporary = fs.realpathSync.native(fs.mkdtempSync(join(tmpdir(), 'claude-statusline-operation-')));
|
|
179
|
+
fs.chmodSync(temporary, 0o700);
|
|
180
|
+
let archive;
|
|
181
|
+
if (operation?.archive) {
|
|
182
|
+
archive = join(dirname(operationPath(operation)), operation.archive);
|
|
183
|
+
safeTarget(configDir, archive);
|
|
184
|
+
verifyArchive(archive, target);
|
|
185
|
+
}
|
|
186
|
+
else
|
|
187
|
+
archive = await npm.download(target, join(temporary, 'download'));
|
|
188
|
+
const staging = join(temporary, 'staging');
|
|
189
|
+
await npm.installArchive(archive, staging);
|
|
190
|
+
const staged = await npm.validateStaged(staging, target);
|
|
191
|
+
if (flags.command === 'rollback' && !flags.version && history?.previous?.inventory_sha256 && staged.inventory_sha256 !== history.previous.inventory_sha256)
|
|
192
|
+
throw new PackageError('integrity');
|
|
193
|
+
const expected = { ...staged, prefix: layout.prefix, root: layout.root, entry: review.entry };
|
|
194
|
+
if (integrated)
|
|
195
|
+
await (options.integrate ?? refreshIntegration)(staged.root, expected, configDir, host, hashes, temporary, true, environment, controller.signal);
|
|
196
|
+
review.artifact_verified = true;
|
|
197
|
+
if (!flags.json)
|
|
198
|
+
stdout(t('management.review', language) + '\n');
|
|
199
|
+
stdout(JSON.stringify(review, null, 2) + '\n');
|
|
200
|
+
if (flags.dryRun)
|
|
201
|
+
return 0;
|
|
202
|
+
writablePrefix(layout.prefix);
|
|
203
|
+
if (!flags.yes && !await (options.confirm?.() ?? confirmPackage(language, stdout, controller.signal))) {
|
|
204
|
+
stdout(t('package.cancelled', language) + '\n');
|
|
205
|
+
return 0;
|
|
206
|
+
}
|
|
207
|
+
if (controller.signal.aborted)
|
|
208
|
+
throw new PackageError('interrupted');
|
|
209
|
+
release = lock(join(layout.prefix, '.claude-statusline-install.lock'), true);
|
|
210
|
+
assertConfiguration(configDir, hashes);
|
|
211
|
+
assertClear(configDir, true);
|
|
212
|
+
const actual = flags.package ? observedPackage(layout, operation) : { identity: productIdentity(layout.root, layout.prefix), state: null };
|
|
213
|
+
const installed = actual.identity;
|
|
214
|
+
if (flags.package) {
|
|
215
|
+
const recorded = readOperation(configDir, layout.prefix);
|
|
216
|
+
if (recorded.id !== operation.id || actual.state !== observed)
|
|
217
|
+
throw new PackageError('conflict');
|
|
218
|
+
operation = recorded;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
if (!installed || !sameIdentity(installed, before) || fs.existsSync(pendingPath(layout.prefix)))
|
|
222
|
+
throw new PackageError('conflict');
|
|
223
|
+
operation = startOperation(configDir, layout.prefix, target.version, target.registry, before, flags.command);
|
|
224
|
+
operation.snapshot = createStorage().lock(configDir, () => { assertConfiguration(configDir, hashes); return saveSnapshot(configDir, dirname(operationPath(operation)), bytes); });
|
|
225
|
+
operation.beforeCompatibility = installedCompatibility(before);
|
|
226
|
+
operation.previousChannel = history?.channel ?? null;
|
|
227
|
+
}
|
|
228
|
+
if (operation.before && !operation.snapshot) {
|
|
229
|
+
if (!installed || installed.version !== operation.before.version)
|
|
230
|
+
throw new PackageError('backup');
|
|
231
|
+
operation.snapshot = createStorage().lock(configDir, () => { assertConfiguration(configDir, hashes); return saveSnapshot(configDir, dirname(operationPath(operation)), bytes); });
|
|
232
|
+
operation.beforeCompatibility = installedCompatibility(installed);
|
|
233
|
+
}
|
|
234
|
+
const runnerRoot = productRoot(fileURLToPath(import.meta.url)), recoveryRunner = join(dirname(operationPath(operation)), 'recovery-runner');
|
|
235
|
+
if (runnerRoot && !fs.existsSync(recoveryRunner)) {
|
|
236
|
+
safeTarget(configDir, recoveryRunner);
|
|
237
|
+
const staging = fs.mkdtempSync(join(dirname(recoveryRunner), '.runner-'));
|
|
238
|
+
try {
|
|
239
|
+
const copied = join(staging, 'package');
|
|
240
|
+
copyPackage(runnerRoot, copied);
|
|
241
|
+
if (!productIdentity(copied))
|
|
242
|
+
throw new PackageError('identity');
|
|
243
|
+
fs.renameSync(copied, recoveryRunner);
|
|
244
|
+
}
|
|
245
|
+
finally {
|
|
246
|
+
removeTree(staging);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
operation.target = target;
|
|
250
|
+
operation.channel = channel;
|
|
251
|
+
operation.integrated = integrated;
|
|
252
|
+
const savedArchive = join(dirname(operationPath(operation)), 'target.tgz');
|
|
253
|
+
safeTarget(configDir, savedArchive);
|
|
254
|
+
if (archive !== savedArchive)
|
|
255
|
+
atomicWrite(savedArchive, fs.readFileSync(archive));
|
|
256
|
+
operation.archive = 'target.tgz';
|
|
257
|
+
operation.results = { package: false, integration: false };
|
|
258
|
+
saveOperation(operation);
|
|
259
|
+
const observeProcess = observeOperation(operation);
|
|
260
|
+
npm.onProcess = observeProcess;
|
|
261
|
+
options.checkpoint?.('reviewed', operation);
|
|
262
|
+
verifyArchive(savedArchive, target);
|
|
263
|
+
if (installed?.version !== target.version) {
|
|
264
|
+
operation.stage = 'installing';
|
|
265
|
+
saveOperation(operation);
|
|
266
|
+
options.checkpoint?.('installing', operation);
|
|
267
|
+
await npm.installArchive(savedArchive, layout.prefix);
|
|
268
|
+
}
|
|
269
|
+
operation.after = await npm.validateStaged(layout.prefix, target);
|
|
270
|
+
operation.stage = 'package_verified';
|
|
271
|
+
operation.results.package = true;
|
|
272
|
+
saveOperation(operation);
|
|
273
|
+
options.checkpoint?.('package_verified', operation);
|
|
274
|
+
assertConfiguration(configDir, hashes);
|
|
275
|
+
if (integrated) {
|
|
276
|
+
operation.stage = 'integrating';
|
|
277
|
+
saveOperation(operation);
|
|
278
|
+
options.checkpoint?.('integrating', operation);
|
|
279
|
+
await (options.integrate ?? refreshIntegration)(layout.root, operation.after, configDir, host, hashes, temporary, false, environment, controller.signal, observeProcess);
|
|
280
|
+
}
|
|
281
|
+
operation.after = await npm.validateStaged(layout.prefix, target);
|
|
282
|
+
operation.results.integration = true;
|
|
283
|
+
saveOperation(operation);
|
|
284
|
+
recordInstallation(operation);
|
|
285
|
+
finishOperation(operation);
|
|
286
|
+
stdout(t('management.complete', language, { version: target.version, prefix: layout.prefix, backup: operation.snapshot ? operation.id : '—' }) + '\n');
|
|
287
|
+
if (runnerRoot)
|
|
288
|
+
stdout(t('management.runner', language, { entry: join(recoveryRunner, 'bin/claude-statusline.js') }) + '\n');
|
|
289
|
+
return 0;
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
const reason = error instanceof PackageError ? error.code : error instanceof ArgumentError ? 'arguments' : 'io_error';
|
|
293
|
+
if (operation && operation.stage !== 'complete' && release) {
|
|
294
|
+
operation.stage = 'uncertain';
|
|
295
|
+
if (operation.results)
|
|
296
|
+
operation.results.error = reason;
|
|
297
|
+
try {
|
|
298
|
+
saveOperation(operation);
|
|
299
|
+
}
|
|
300
|
+
catch { /* Preserve the last durable phase if the journal volume is unavailable. */ }
|
|
301
|
+
}
|
|
302
|
+
const message = t('package.reason_' + reason, language);
|
|
303
|
+
if (flags?.json)
|
|
304
|
+
stdout(JSON.stringify({ schema_version: 1, error: { code: reason, message } }) + '\n');
|
|
305
|
+
else
|
|
306
|
+
stderr(t('package.failure', language, { reason: message }) + '\n');
|
|
307
|
+
if (operation && release)
|
|
308
|
+
stderr(t('management.partial', language, { id: operation.id, version: operation.version, prefix: operation.prefix, config: operation.configDir, stage: operation.stage }) + '\n');
|
|
309
|
+
return reason === 'interrupted' ? 130 : 2;
|
|
310
|
+
}
|
|
311
|
+
finally {
|
|
312
|
+
release?.();
|
|
313
|
+
process.off('SIGINT', cancel);
|
|
314
|
+
process.off('SIGTERM', cancel);
|
|
315
|
+
if (temporary)
|
|
316
|
+
removeTree(temporary);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/management/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAA4C,MAAM,6CAA6C,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzH,OAAO,EAAE,CAAC,EAAiB,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAwC,MAAM,kCAAkC,CAAC;AACrL,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAA0B,MAAM,gBAAgB,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AAC,iBAAiB,GAAG,MAAM,EAAE,QAAQ,CAAC,CAAC;QACxD,IAAI,KAAK,EAAE,IAAI;YACX,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;;YAEvF,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACvE,IAAI,SAAS,IAAI,OAAO;YACpB,MAAM,CAAC,CAAC,CAAC,oBAAoB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACtL,OAAO,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;YACO,CAAC;QACL,OAAO,EAAE,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC/B,IAAI,SAAS;YACT,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type PackageIdentity } from '@fbincon/statusline-core/management/package';
|
|
2
|
+
import type { PackageCompatibility } from '@fbincon/statusline-core/management/compatibility';
|
|
3
|
+
import type { RegistryPackage } from '@fbincon/statusline-platform/npm';
|
|
4
|
+
import type { ConfigHashes } from './configuration.js';
|
|
5
|
+
export declare const MANAGEMENT_ROOT = "statusline_runtime/package-management";
|
|
6
|
+
export interface PackageOperation {
|
|
7
|
+
schema_version: 1;
|
|
8
|
+
id: string;
|
|
9
|
+
configDir: string;
|
|
10
|
+
prefix: string;
|
|
11
|
+
action: 'install' | 'update' | 'rollback';
|
|
12
|
+
version: string;
|
|
13
|
+
registry: string;
|
|
14
|
+
before: PackageIdentity | null;
|
|
15
|
+
after: PackageIdentity | null;
|
|
16
|
+
stage: 'reviewed' | 'installing' | 'package_verified' | 'integrating' | 'complete' | 'uncertain';
|
|
17
|
+
created: string;
|
|
18
|
+
target?: RegistryPackage;
|
|
19
|
+
archive?: string;
|
|
20
|
+
snapshot?: ConfigHashes;
|
|
21
|
+
beforeCompatibility?: PackageCompatibility;
|
|
22
|
+
integrated?: boolean;
|
|
23
|
+
channel?: 'latest' | 'beta' | null;
|
|
24
|
+
previousChannel?: 'latest' | 'beta' | null;
|
|
25
|
+
results?: {
|
|
26
|
+
package: boolean;
|
|
27
|
+
integration: boolean;
|
|
28
|
+
error?: string;
|
|
29
|
+
};
|
|
30
|
+
executors?: {
|
|
31
|
+
pid: number;
|
|
32
|
+
token: string;
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
export declare const prefixKey: (prefix: string) => string;
|
|
36
|
+
export declare const pendingPath: (prefix: string) => string;
|
|
37
|
+
export declare function operationPath(operation: PackageOperation): string;
|
|
38
|
+
export declare function saveOperation(operation: PackageOperation): void;
|
|
39
|
+
export declare function startOperation(configDir: string, prefix: string, version: string, registry: string, before: PackageIdentity | null, action?: PackageOperation['action']): PackageOperation;
|
|
40
|
+
export declare function recordInstallation(operation: PackageOperation): void;
|
|
41
|
+
export declare function finishOperation(operation: PackageOperation): void;
|
|
42
|
+
export declare function observeOperation(operation: PackageOperation): (pid: number | null) => void;
|
|
43
|
+
export declare function createPrefix(prefix: string): void;
|
|
44
|
+
export interface InstallationRecord {
|
|
45
|
+
schema_version: 1;
|
|
46
|
+
current: PackageIdentity;
|
|
47
|
+
previous: PackageIdentity | null;
|
|
48
|
+
transaction: string;
|
|
49
|
+
channel: 'latest' | 'beta' | null;
|
|
50
|
+
previousChannel?: 'latest' | 'beta' | null;
|
|
51
|
+
}
|
|
52
|
+
export declare function readInstallation(configDir: string, prefix: string): InstallationRecord | null;
|
|
53
|
+
export declare function readOperation(configDir: string, prefix: string, id?: string): PackageOperation;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
+
import { atomicWrite, privateDirectory, durableUnlink } from '@fbincon/statusline-platform/files';
|
|
5
|
+
import { PackageError } from '@fbincon/statusline-core/management/package';
|
|
6
|
+
import { safeTarget } from '../integration/paths.js';
|
|
7
|
+
import { readRegular } from '../recovery/journal.js';
|
|
8
|
+
import { exactVersion } from '@fbincon/statusline-core/management/package';
|
|
9
|
+
import { compatibility } from '@fbincon/statusline-core/management/compatibility';
|
|
10
|
+
import { globalPackageRoot } from '@fbincon/statusline-platform/npm';
|
|
11
|
+
import { processToken, processMatches } from '@fbincon/statusline-platform/processes';
|
|
12
|
+
export const MANAGEMENT_ROOT = 'statusline_runtime/package-management';
|
|
13
|
+
export const prefixKey = (prefix) => createHash('sha256').update(prefix).digest('hex');
|
|
14
|
+
export const pendingPath = (prefix) => join(prefix, '.claude-statusline-operation.json');
|
|
15
|
+
export function operationPath(operation) { return join(operation.configDir, MANAGEMENT_ROOT, 'transactions', operation.id, 'operation.json'); }
|
|
16
|
+
export function saveOperation(operation) {
|
|
17
|
+
const path = operationPath(operation);
|
|
18
|
+
safeTarget(operation.configDir, path);
|
|
19
|
+
atomicWrite(path, JSON.stringify(operation, null, 2) + '\n');
|
|
20
|
+
}
|
|
21
|
+
export function startOperation(configDir, prefix, version, registry, before, action = 'install') {
|
|
22
|
+
if (fs.existsSync(pendingPath(prefix)))
|
|
23
|
+
throw new PackageError('pending');
|
|
24
|
+
const operation = { schema_version: 1, id: 'pkg-' + randomUUID(), configDir, prefix, version, registry, before, after: null, action, stage: 'reviewed', created: new Date().toISOString() };
|
|
25
|
+
saveOperation(operation);
|
|
26
|
+
atomicWrite(pendingPath(prefix), JSON.stringify({ owner: 'claude-code-statusline', schema_version: 1, id: operation.id, configDir, prefix }) + '\n');
|
|
27
|
+
return operation;
|
|
28
|
+
}
|
|
29
|
+
export function recordInstallation(operation) {
|
|
30
|
+
if (!operation.after)
|
|
31
|
+
throw new PackageError('identity');
|
|
32
|
+
const path = join(operation.configDir, MANAGEMENT_ROOT, 'installations', prefixKey(operation.prefix) + '.json');
|
|
33
|
+
safeTarget(operation.configDir, path);
|
|
34
|
+
atomicWrite(path, JSON.stringify({ schema_version: 1, current: operation.after, previous: operation.before, transaction: operation.id, channel: operation.channel ?? (operation.after.version.includes('-') ? null : 'latest'), previousChannel: operation.previousChannel ?? null }, null, 2) + '\n');
|
|
35
|
+
}
|
|
36
|
+
export function finishOperation(operation) {
|
|
37
|
+
operation.stage = 'complete';
|
|
38
|
+
saveOperation(operation);
|
|
39
|
+
durableUnlink(pendingPath(operation.prefix));
|
|
40
|
+
}
|
|
41
|
+
export function observeOperation(operation) {
|
|
42
|
+
return pid => {
|
|
43
|
+
operation.executors = (operation.executors ?? []).filter(p => processMatches(p.pid, p.token));
|
|
44
|
+
if (pid !== null) {
|
|
45
|
+
const token = processToken(pid);
|
|
46
|
+
if (!token)
|
|
47
|
+
throw new PackageError('busy');
|
|
48
|
+
operation.executors.push({ pid, token });
|
|
49
|
+
}
|
|
50
|
+
saveOperation(operation);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function createPrefix(prefix) {
|
|
54
|
+
if (!fs.existsSync(prefix))
|
|
55
|
+
privateDirectory(prefix);
|
|
56
|
+
}
|
|
57
|
+
export function readInstallation(configDir, prefix) {
|
|
58
|
+
const path = join(configDir, MANAGEMENT_ROOT, 'installations', prefixKey(prefix) + '.json');
|
|
59
|
+
safeTarget(configDir, path);
|
|
60
|
+
if (!fs.existsSync(path))
|
|
61
|
+
return null;
|
|
62
|
+
const value = JSON.parse(readRegular(path, 1024 * 1024).toString('utf8'));
|
|
63
|
+
if (value.schema_version !== 1 || !exactVersion(value.current?.version) || value.current.prefix !== prefix || value.previous && !exactVersion(value.previous.version) || ![null, 'latest', 'beta'].includes(value.channel))
|
|
64
|
+
throw new PackageError('journal');
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
export function readOperation(configDir, prefix, id) {
|
|
68
|
+
if (!id) {
|
|
69
|
+
const marker = pendingPath(prefix);
|
|
70
|
+
safeTarget(prefix, marker);
|
|
71
|
+
if (!fs.existsSync(marker))
|
|
72
|
+
throw new PackageError('no_pending');
|
|
73
|
+
const value = JSON.parse(readRegular(marker, 65536).toString('utf8'));
|
|
74
|
+
if (value.owner !== 'claude-code-statusline' || value.schema_version !== 1 || value.prefix !== prefix || value.configDir !== configDir)
|
|
75
|
+
throw new PackageError('journal');
|
|
76
|
+
id = value.id;
|
|
77
|
+
}
|
|
78
|
+
if (typeof id !== 'string' || !/^pkg-[0-9a-f-]{36}$/u.test(id))
|
|
79
|
+
throw new PackageError('journal');
|
|
80
|
+
const path = join(configDir, MANAGEMENT_ROOT, 'transactions', id, 'operation.json');
|
|
81
|
+
safeTarget(configDir, path);
|
|
82
|
+
let value;
|
|
83
|
+
try {
|
|
84
|
+
value = JSON.parse(readRegular(path, 1024 * 1024).toString('utf8'));
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
throw new PackageError('journal');
|
|
88
|
+
}
|
|
89
|
+
if (value.schema_version !== 1 || value.id !== id || value.configDir !== configDir || value.prefix !== prefix || !exactVersion(value.version) || !['install', 'update', 'rollback'].includes(value.action) || !['reviewed', 'installing', 'package_verified', 'integrating', 'complete', 'uncertain'].includes(value.stage))
|
|
90
|
+
throw new PackageError('journal');
|
|
91
|
+
for (const identity of [value.before, value.after])
|
|
92
|
+
if (identity && (!exactVersion(identity.version) || identity.prefix !== prefix || identity.root !== globalPackageRoot(prefix)))
|
|
93
|
+
throw new PackageError('journal');
|
|
94
|
+
if (value.target) {
|
|
95
|
+
if (value.target.version !== value.version || value.target.registry !== value.registry || !/^sha512-[A-Za-z0-9+/]{86}==$/u.test(value.target.integrity) || typeof value.target.nodeEngine !== 'string' || typeof value.target.legacy !== 'boolean')
|
|
96
|
+
throw new PackageError('journal');
|
|
97
|
+
compatibility(value.target.compatibility, value.target.version);
|
|
98
|
+
}
|
|
99
|
+
if (value.archive !== undefined && value.archive !== 'target.tgz')
|
|
100
|
+
throw new PackageError('journal');
|
|
101
|
+
if (value.executors && (!Array.isArray(value.executors) || value.executors.length > 16 || value.executors.some(p => !Number.isSafeInteger(p.pid) || p.pid < 1 || typeof p.token !== 'string' || p.token.length > 256)))
|
|
102
|
+
throw new PackageError('journal');
|
|
103
|
+
if (value.target && value.target.legacy !== (value.version === '3.7.0'))
|
|
104
|
+
throw new PackageError('journal');
|
|
105
|
+
try {
|
|
106
|
+
const url = new URL(value.registry);
|
|
107
|
+
if (!['https:', 'http:'].includes(url.protocol) || url.username || url.password || url.search || url.hash)
|
|
108
|
+
throw new Error();
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
throw new PackageError('journal');
|
|
112
|
+
}
|
|
113
|
+
if (value.beforeCompatibility)
|
|
114
|
+
compatibility(value.beforeCompatibility, value.before.version);
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/management/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,E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C,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;QAClN,MAAM,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACtC,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC;QACnE,MAAM,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACtC,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI;YACrG,MAAM,IAAI,KAAK,EAAE,CAAC;IAC1B,CAAC;IACD,MAAM,CAAC;QACH,MAAM,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,KAAK,CAAC,mBAAmB;QACzB,aAAa,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,MAAO,CAAC,OAAO,CAAC,CAAC;IACpE,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { manage } from './service.js';
|
|
2
|
+
const [origin, argv] = process.argv.slice(2);
|
|
3
|
+
const cancel = () => process.emit('SIGTERM');
|
|
4
|
+
process.on('message', value => {
|
|
5
|
+
if (value?.type === 'cancel')
|
|
6
|
+
cancel();
|
|
7
|
+
});
|
|
8
|
+
process.once('disconnect', cancel);
|
|
9
|
+
process.exitCode = await manage(JSON.parse(argv), { origin: origin, stdout: text => { process.stdout.write(text); }, stderr: text => { process.stderr.write(text); } });
|
|
10
|
+
process.off('disconnect', cancel);
|
|
11
|
+
if (process.connected)
|
|
12
|
+
process.disconnect();
|
|
13
|
+
//# sourceMappingURL=worker-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-entry.js","sourceRoot":"","sources":["../../../src/management/worker-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC7C,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7C,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE;IAAG,IAAK,KAAa,EAAE,IAAI,KAAK,QAAQ;QAClE,MAAM,EAAE,CAAC;AAAC,CAAC,CAAC,CAAC;AACjB,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AACnC,OAAO,CAAC,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC1K,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAClC,IAAI,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,UAAU,EAAE,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { runCommand, CommandTimeout, monotonicMilliseconds } from '@fbincon/stat
|
|
|
8
8
|
import { runtimeIO, readStored } from './io.js';
|
|
9
9
|
import { readDataJson } from './json-data.js';
|
|
10
10
|
import { decodeUtf8 } from '@fbincon/statusline-platform/utf8';
|
|
11
|
+
import { GitInvocation, GitPolicyError } from '@fbincon/statusline-platform/git';
|
|
11
12
|
function strip(raw) {
|
|
12
13
|
let start = 0, end = raw.length;
|
|
13
14
|
const space = (v) => v === 32 || v >= 9 && v <= 13;
|
|
@@ -91,13 +92,15 @@ export class GitCollector {
|
|
|
91
92
|
}
|
|
92
93
|
uncached(cwd) {
|
|
93
94
|
try {
|
|
94
|
-
const
|
|
95
|
+
const invocation = new GitInvocation(cwd, 2000, this.run, this.monotonic);
|
|
96
|
+
const policy = invocation.worktreePolicy();
|
|
97
|
+
const result = invocation.command(['status', '--porcelain=v2', '--branch', '--ahead-behind', '--renames', '--untracked-files=all'], policy);
|
|
95
98
|
if (result.code !== 0)
|
|
96
99
|
return { kind: result.stderr.toString('utf8').includes('not a git repository') ? 'not_repo' : 'error' };
|
|
97
100
|
return parsePorcelain(result.stdout.toString('utf8'));
|
|
98
101
|
}
|
|
99
|
-
catch {
|
|
100
|
-
return { kind: 'error' };
|
|
102
|
+
catch (error) {
|
|
103
|
+
return error instanceof GitPolicyError ? error.reason === 'not_repo' ? { kind: 'not_repo' } : { kind: 'error', reason: error.reason } : { kind: 'error' };
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
status(cwd, session = null) {
|
|
@@ -109,15 +112,11 @@ export class GitCollector {
|
|
|
109
112
|
return result;
|
|
110
113
|
}
|
|
111
114
|
branchDiff(cwd, baseRef = null, timeoutMs = 2000) {
|
|
112
|
-
|
|
113
|
-
const git = (...args) =>
|
|
114
|
-
const remaining = deadline - this.monotonic();
|
|
115
|
-
if (remaining <= 0)
|
|
116
|
-
throw new CommandTimeout('Git deadline expired');
|
|
117
|
-
return this.run({ executable: 'git', args: ['-C', cwd, '--no-optional-locks', ...args] }, { timeoutMs: remaining });
|
|
118
|
-
};
|
|
115
|
+
let invocation;
|
|
116
|
+
const git = (...args) => invocation.command(args);
|
|
119
117
|
const commit = (ref) => { const result = git('rev-parse', '--verify', '--end-of-options', ref + '^{commit}'); return result.code === 0 ? ascii(strip(result.stdout)) : null; };
|
|
120
118
|
try {
|
|
119
|
+
invocation = new GitInvocation(cwd, timeoutMs, this.run, this.monotonic);
|
|
121
120
|
const repository = git('rev-parse', '--show-toplevel');
|
|
122
121
|
if (repository.code !== 0)
|
|
123
122
|
return { value: null, reason: 'not_repo' };
|