@fbincon/claude-code-statusline 3.5.0 → 3.7.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 +77 -74
- package/candidate.json +437 -315
- 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/config/profiles.js +2 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profiles.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +5 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.js +24 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js +2 -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 +19 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +46 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.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/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.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js +119 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.js +35 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.js.map +1 -0
- 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.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js +118 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.d.ts +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js +425 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +2 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +30 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +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/hooks/register.ts +15 -5
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +15 -8
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +10 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +26 -6
- 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 +8 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +4 -2
- 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 +304 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-validation.ts +46 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +94 -11
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +1020 -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/lib/session.ts +2 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +23 -17
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +9 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +2 -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 +214 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +418 -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 +31 -14
- 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 +13 -10
- 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 +11 -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 +6 -2
- 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 +14 -7
- 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/config/profiles.js +2 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/profiles.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js +5 -3
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +2 -2
- 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 +170 -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.d.ts +4 -2
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +31 -6
- 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 +18 -8
- 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 +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +6 -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 +4 -2
- 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 +40 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js +279 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js +47 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.d.ts +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js +238 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.js +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +1014 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +1020 -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 +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +31 -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 +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +31 -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 +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +31 -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 +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +31 -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 +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js +31 -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 +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js +31 -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/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/appearance.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +3 -0
- 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 +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.js +35 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.js.map +1 -0
- 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 +19 -2
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js +30 -9
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.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/powerline.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.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/preview.js +3 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.d.ts +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +23 -2
- 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/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/dist/src/terminal/links.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/links.js +37 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/links.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +170 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +170 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +170 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +170 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-HK.json +170 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-TW.json +170 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/files.d.ts +3 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js +7 -2
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.d.ts +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.js +26 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-files.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js +52 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.d.ts +19 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.js +122 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.js +61 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.d.ts +3 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.js +61 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/canvas.js +3 -2
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/canvas.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js +10 -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 +8 -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 +4 -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 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +23 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -1
- package/package.json +1 -1
package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/indicators.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Generated by tools/generation/resources.ts; do not edit.
|
|
2
|
+
/** Shared, optional indicator controls. Numeric remains the saved-file default. */
|
|
3
|
+
import type { EditorField, Scope } from '../generated-contracts.ts';
|
|
4
|
+
|
|
5
|
+
export const INDICATOR_DEFAULTS = { presentation: 'numeric', bar_width: 8, bar_style: 'auto' } as const;
|
|
6
|
+
export const INDICATOR_KEYS = Object.keys(INDICATOR_DEFAULTS);
|
|
7
|
+
export function supportsIndicator(scope: Scope, id: string): boolean {
|
|
8
|
+
return ['context-used', 'context-remaining'].includes(id) || scope === 'main' && ['five-hour-limit', 'weekly-limit', 'spend-limit'].includes(id);
|
|
9
|
+
}
|
|
10
|
+
export const INDICATOR_FIELDS: EditorField[] = [
|
|
11
|
+
{ key: 'presentation', label: 'Indicator presentation', group: 'Item format', kind: 'choice', choices: ['numeric', 'bar'], minimum: 0, maximum: 0, nullable: false },
|
|
12
|
+
{ key: 'bar_width', label: 'Bar width', group: 'Item format', kind: 'integer', choices: [], minimum: 4, maximum: 20, nullable: false },
|
|
13
|
+
{ key: 'bar_style', label: 'Bar characters', group: 'Item format', kind: 'choice', choices: ['auto', 'unicode', 'ascii'], minimum: 0, maximum: 0, nullable: false },
|
|
14
|
+
];
|
|
15
|
+
export function validIndicatorOptions(value: Record<string, unknown>, scope?: Scope, id?: string): boolean {
|
|
16
|
+
if (scope && id && !supportsIndicator(scope, id) && INDICATOR_KEYS.some(key => Object.hasOwn(value, key))) return false;
|
|
17
|
+
return (value.presentation === undefined || typeof value.presentation === 'string' && ['numeric', 'bar'].includes(value.presentation)) &&
|
|
18
|
+
(value.bar_style === undefined || typeof value.bar_style === 'string' && ['auto', 'unicode', 'ascii'].includes(value.bar_style)) &&
|
|
19
|
+
(value.bar_width === undefined || typeof value.bar_width === 'number' && Number.isInteger(value.bar_width) && value.bar_width >= 4 && value.bar_width <= 20);
|
|
20
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// Generated by tools/generation/resources.ts; do not edit.
|
|
2
|
+
import type { Operation, ResultFor, SourcesResult, SourceDefinition, SourceContext, SourceJob, SourceReview, Scope } from '../generated-contracts.ts';
|
|
3
|
+
import type { Editor } from './draft.ts';
|
|
4
|
+
import { t, text, type Language, type LocalizedText } from '../i18n/index.ts';
|
|
5
|
+
import { inputKey, inputView, textInput, type TextInput, type TextKey } from './text-input.ts';
|
|
6
|
+
import { wrapText } from '../../ui/text.ts';
|
|
7
|
+
import { BackendError } from '../backend.ts';
|
|
8
|
+
type Action = 'edit' | 'review' | 'disable' | 'remove' | 'bind' | 'unbind' | 'refresh' | 'status' | 'cancel' | 'diagnose' | 'auto-review' | 'auto-off';
|
|
9
|
+
export interface SourceManager {
|
|
10
|
+
library: SourcesResult | null;
|
|
11
|
+
context: SourceContext | null;
|
|
12
|
+
owner: string;
|
|
13
|
+
page: 'list' | 'actions' | 'kind' | 'form' | 'review' | 'remove' | 'bind' | 'unbind' | 'diagnose' | 'auto-review';
|
|
14
|
+
automaticInterval: number;
|
|
15
|
+
cursor: number;
|
|
16
|
+
scroll: number;
|
|
17
|
+
selected: string | null;
|
|
18
|
+
kind: SourceDefinition['kind'];
|
|
19
|
+
editing: boolean;
|
|
20
|
+
fields: {
|
|
21
|
+
key: string;
|
|
22
|
+
input: TextInput;
|
|
23
|
+
}[];
|
|
24
|
+
review: SourceReview | null;
|
|
25
|
+
details: string[];
|
|
26
|
+
jobs: SourceJob[];
|
|
27
|
+
message: LocalizedText | null;
|
|
28
|
+
effect: 'load' | 'save' | 'review' | 'enable' | 'disable' | 'remove' | 'bind' | 'refresh' | 'status' | 'cancel' | 'diagnose' | 'close' | 'auto-review' | 'auto-on' | 'auto-off' | null;
|
|
29
|
+
target: {
|
|
30
|
+
scope: Scope;
|
|
31
|
+
id: string;
|
|
32
|
+
} | null;
|
|
33
|
+
}
|
|
34
|
+
export interface SourceBackend {
|
|
35
|
+
request<O extends Operation>(operation: O, payload?: unknown): ResultFor<O> | Promise<ResultFor<O>>;
|
|
36
|
+
}
|
|
37
|
+
const external = ['external-value', 'github-pr', 'github-ci'];
|
|
38
|
+
export function openSources(editor: Editor): void {
|
|
39
|
+
editor.sources = { library: null, context: null, owner: 'editor-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2), page: 'list', automaticInterval: 300, cursor: 0, scroll: 0, selected: null, kind: 'json', editing: false, fields: [], review: null, details: [], jobs: [], message: null, effect: 'load', target: null };
|
|
40
|
+
}
|
|
41
|
+
function source(editor: Editor): SourceDefinition | undefined { return editor.sources!.library?.sources.find(s => s.id === editor.sources!.selected); }
|
|
42
|
+
function actions(editor: Editor): Action[] { return ['edit', 'review', ...(source(editor)?.enabled ? ['disable' as const] : []), 'bind', 'refresh', 'status', 'cancel', 'diagnose', 'remove', 'unbind', ...(source(editor)?.kind === 'github' ? ['auto-review' as const, 'auto-off' as const] : [])]; }
|
|
43
|
+
function targets(editor: Editor) {
|
|
44
|
+
const s = source(editor);
|
|
45
|
+
return (['main', 'subagent'] as const).flatMap(scope => (scope === 'main' ? editor.draft.display.instances : editor.draft.display.subagents.instances)
|
|
46
|
+
.filter(node => external.includes(node.type_id) && (s?.kind === 'github' || !node.type_id.startsWith('github-')) && (editor.sources!.page !== 'unbind' || editor.sources!.library?.bindings.some(binding => binding.source_id === s?.id && binding.id === node.source?.binding))).map(node => ({ scope, id: node.id })));
|
|
47
|
+
}
|
|
48
|
+
function form(editor: Editor, kind: SourceDefinition['kind'], editing = false): void {
|
|
49
|
+
const m = editor.sources!, s = editing ? source(editor) : undefined, settings = s?.settings ?? {};
|
|
50
|
+
const common: Record<string, unknown> = { id: s?.id ?? '', name: s?.name ?? '', project: s ? s.scope.project ?? '' : m.context?.project ?? '', session: s?.scope.session ?? '', agent: s?.scope.agent ?? '', ttl_seconds: s?.ttl_seconds ?? 300 };
|
|
51
|
+
const extra = kind === 'json' ? { path: settings.path ?? '', pointer: settings.pointer ?? '/value', observed_at_pointer: settings.observed_at_pointer ?? '/observed_at', unit: settings.unit ?? '' }
|
|
52
|
+
: kind === 'github' ? { host: settings.host ?? 'github.com', repository: settings.repository ?? '', branch: settings.branch ?? m.context?.branch ?? '', account: settings.account ?? '', pr: settings.pr ?? '' }
|
|
53
|
+
: { executable: settings.executable ?? '', args: JSON.stringify(settings.args ?? []), cwd: settings.cwd ?? m.context?.project ?? '', input: JSON.stringify(settings.input ?? {}), output: settings.output ?? 'json', timeout_ms: settings.timeout_ms ?? 5000 };
|
|
54
|
+
m.kind = kind;
|
|
55
|
+
m.editing = editing;
|
|
56
|
+
m.page = 'form';
|
|
57
|
+
m.cursor = 0;
|
|
58
|
+
m.scroll = 0;
|
|
59
|
+
m.message = null;
|
|
60
|
+
m.fields = Object.entries({ ...common, ...extra }).map(([key, value]) => ({ key, input: textInput(String(value)) }));
|
|
61
|
+
}
|
|
62
|
+
function count(editor: Editor): number {
|
|
63
|
+
const m = editor.sources!;
|
|
64
|
+
return m.page === 'list' ? (m.library?.sources.length ?? 0) + 1 : m.page === 'actions' ? actions(editor).length : m.page === 'kind' ? 3 : m.page === 'form' ? m.fields.length : m.page === 'bind' || m.page === 'unbind' ? targets(editor).length : 1;
|
|
65
|
+
}
|
|
66
|
+
export function sourcesKey(editor: Editor, event: TextKey): 'sources' | null {
|
|
67
|
+
const m = editor.sources;
|
|
68
|
+
if (!m)
|
|
69
|
+
return null;
|
|
70
|
+
const key = event.key === 'return' ? 'enter' : event.key, plain = !event.text && !event.paste && !event.ctrl && !event.meta;
|
|
71
|
+
if (!event.text && !event.paste && (key === 'escape' || event.ctrl && key.toLowerCase() === 'g')) {
|
|
72
|
+
if (m.page === 'list')
|
|
73
|
+
m.effect = 'close';
|
|
74
|
+
else {
|
|
75
|
+
m.page = 'list';
|
|
76
|
+
m.cursor = 0;
|
|
77
|
+
m.scroll = 0;
|
|
78
|
+
m.message = null;
|
|
79
|
+
}
|
|
80
|
+
return m.effect ? 'sources' : null;
|
|
81
|
+
}
|
|
82
|
+
if (m.page === 'form') {
|
|
83
|
+
if (!event.text && (key === 'tab' || plain && ['up', 'down'].includes(key)))
|
|
84
|
+
m.cursor = Math.max(0, Math.min(m.fields.length - 1, m.cursor + (key === 'up' ? -1 : 1)));
|
|
85
|
+
else if (!event.text && (key === 'enter' || event.ctrl && key.toLowerCase() === 's')) {
|
|
86
|
+
if (key === 'enter' && m.cursor < m.fields.length - 1)
|
|
87
|
+
m.cursor++;
|
|
88
|
+
else
|
|
89
|
+
m.effect = 'save';
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
const field = m.fields[m.cursor]!;
|
|
93
|
+
if (!(m.editing && field.key === 'id')) {
|
|
94
|
+
const changed = inputKey(field.input.value, field.input, event, 8192);
|
|
95
|
+
field.input = changed.state;
|
|
96
|
+
m.message = changed.error ? text('input.' + changed.error, { limit: 8192 }) : null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return m.effect ? 'sources' : null;
|
|
100
|
+
}
|
|
101
|
+
if (!plain)
|
|
102
|
+
return null;
|
|
103
|
+
if (['review', 'diagnose', 'auto-review'].includes(m.page) && ['up', 'down', 'pageup', 'pagedown', 'home'].includes(key)) {
|
|
104
|
+
m.scroll = key === 'home' ? 0 : Math.max(0, m.scroll + (key === 'up' ? -1 : key === 'pageup' ? -8 : key === 'pagedown' ? 8 : 1));
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
if (m.page === 'auto-review' && ['left', 'right'].includes(key)) { m.automaticInterval = Math.max(60, Math.min(86400, m.automaticInterval + (key === 'left' ? -60 : 60))); return null; }
|
|
108
|
+
if (key === 'up' || key === 'down')
|
|
109
|
+
m.cursor = Math.max(0, Math.min(count(editor) - 1, m.cursor + (key === 'up' ? -1 : 1)));
|
|
110
|
+
if (key === 'r' && m.page === 'list')
|
|
111
|
+
m.effect = 'load';
|
|
112
|
+
if (key === 'enter') {
|
|
113
|
+
if (m.page === 'list') {
|
|
114
|
+
const selected = m.library?.sources[m.cursor];
|
|
115
|
+
if (selected) {
|
|
116
|
+
m.selected = selected.id;
|
|
117
|
+
m.page = 'actions';
|
|
118
|
+
}
|
|
119
|
+
else
|
|
120
|
+
m.page = 'kind';
|
|
121
|
+
m.cursor = 0;
|
|
122
|
+
}
|
|
123
|
+
else if (m.page === 'kind')
|
|
124
|
+
form(editor, (['json', 'github', 'command'] as const)[m.cursor]!);
|
|
125
|
+
else if (m.page === 'actions') {
|
|
126
|
+
const action = actions(editor)[m.cursor]!;
|
|
127
|
+
if (action === 'edit')
|
|
128
|
+
form(editor, source(editor)!.kind, true);
|
|
129
|
+
else if (action === 'bind' || action === 'unbind' || action === 'remove') {
|
|
130
|
+
m.page = action;
|
|
131
|
+
m.cursor = 0;
|
|
132
|
+
}
|
|
133
|
+
else
|
|
134
|
+
m.effect = action;
|
|
135
|
+
}
|
|
136
|
+
else if (m.page === 'review') m.effect = 'enable';
|
|
137
|
+
else if (m.page === 'auto-review') m.effect = 'auto-on';
|
|
138
|
+
else if (m.page === 'remove')
|
|
139
|
+
m.effect = 'remove';
|
|
140
|
+
else if (m.page === 'unbind') {
|
|
141
|
+
const target = targets(editor)[m.cursor];
|
|
142
|
+
const node = target && editor.instance(target.scope, target.id);
|
|
143
|
+
if (node?.source) {
|
|
144
|
+
node.source = { ...node.source, binding: null };
|
|
145
|
+
m.message = text('sources.bound');
|
|
146
|
+
m.page = 'list';
|
|
147
|
+
m.cursor = 0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else if (m.page === 'bind') {
|
|
151
|
+
m.target = targets(editor)[m.cursor] ?? null;
|
|
152
|
+
if (m.target)
|
|
153
|
+
m.effect = 'bind';
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return m.effect ? 'sources' : null;
|
|
157
|
+
}
|
|
158
|
+
export async function closeSources(editor: Editor, backend: SourceBackend): Promise<void> {
|
|
159
|
+
const m = editor.sources;
|
|
160
|
+
if (!m)
|
|
161
|
+
return;
|
|
162
|
+
let failed: unknown;
|
|
163
|
+
for (const job of m.jobs.filter(job => job.state === 'running' && job.owner === m.owner && job.trigger === 'manual')) {
|
|
164
|
+
try { await backend.request('source_cancel', { id: job.id }); }
|
|
165
|
+
catch (error) { failed = error; }
|
|
166
|
+
}
|
|
167
|
+
if (failed) throw failed;
|
|
168
|
+
if (editor.sources === m)
|
|
169
|
+
editor.sources = null;
|
|
170
|
+
}
|
|
171
|
+
export async function performSourceAction(editor: Editor, backend: SourceBackend): Promise<void> {
|
|
172
|
+
const m = editor.sources, effect = m?.effect;
|
|
173
|
+
if (!m || !effect)
|
|
174
|
+
return;
|
|
175
|
+
m.effect = null;
|
|
176
|
+
m.message = null;
|
|
177
|
+
try {
|
|
178
|
+
if (effect === 'close') {
|
|
179
|
+
await closeSources(editor, backend);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (effect === 'load') {
|
|
183
|
+
m.library = await backend.request('sources_read', {});
|
|
184
|
+
const target = editor.baseline.configuration;
|
|
185
|
+
m.context = await backend.request('source_context', { project: target?.project_root ?? (target?.target.kind === 'project' ? target.target.path : null), session: null, agent: null });
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (effect === 'review' || effect === 'auto-review') {
|
|
189
|
+
m.review = await backend.request('source_review', { id: m.selected });
|
|
190
|
+
m.page = effect;
|
|
191
|
+
m.automaticInterval = m.library?.automatic.find(p => p.source_id === m.selected)?.interval_seconds ?? Math.max(60, Math.min(86400, m.review.source.ttl_seconds));
|
|
192
|
+
m.scroll = 0;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (effect === 'status' || effect === 'cancel') {
|
|
196
|
+
const selected = source(editor)!;
|
|
197
|
+
const context = await backend.request('source_context', { project: selected.scope.project ?? m.context?.project ?? null, session: selected.scope.session, agent: selected.scope.agent });
|
|
198
|
+
const observed = await backend.request('source_diagnose', { id: m.selected, context });
|
|
199
|
+
const jobs = await Promise.all(observed.jobs.map(job => backend.request(effect === 'cancel' && job.state === 'running' ? 'source_cancel' : 'source_status', { id: job.id })));
|
|
200
|
+
m.jobs = m.jobs.map(job => jobs.find(updated => updated.id === job.id) ?? job);
|
|
201
|
+
m.details = [JSON.stringify(observed.automatic, null, 2), ...jobs.map(job => `${job.id}: ${job.state} (${job.reason})`)];
|
|
202
|
+
m.page = 'diagnose';
|
|
203
|
+
m.scroll = 0;
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (effect === 'refresh' || effect === 'diagnose') {
|
|
207
|
+
const selected = source(editor)!;
|
|
208
|
+
const context = await backend.request('source_context', { project: selected.scope.project ?? m.context?.project ?? null, session: selected.scope.session, agent: selected.scope.agent });
|
|
209
|
+
if (effect === 'refresh') {
|
|
210
|
+
const job = await backend.request('source_refresh', { id: m.selected, context, owner: m.owner });
|
|
211
|
+
m.jobs.push(job);
|
|
212
|
+
m.message = text('sources.refresh_started');
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
const result = await backend.request('source_diagnose', { id: m.selected, context });
|
|
216
|
+
m.details = JSON.stringify(result, null, 2).split('\n');
|
|
217
|
+
m.page = 'diagnose';
|
|
218
|
+
m.scroll = 0;
|
|
219
|
+
}
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const payload: Record<string, unknown> = { action: effect, id: m.selected, expected_revision: m.library!.revision };
|
|
223
|
+
if (effect === 'save') {
|
|
224
|
+
const values = Object.fromEntries(m.fields.map(field => [field.key, field.input.value]));
|
|
225
|
+
const { id, name, project, session, agent, ttl_seconds, ...settings } = values;
|
|
226
|
+
const parsed: Record<string, unknown> = { ...settings };
|
|
227
|
+
for (const key of ['args', 'input'])
|
|
228
|
+
if (key in parsed)
|
|
229
|
+
parsed[key] = JSON.parse(String(parsed[key]));
|
|
230
|
+
if ('timeout_ms' in parsed)
|
|
231
|
+
parsed.timeout_ms = Number(parsed.timeout_ms);
|
|
232
|
+
if ('pr' in parsed)
|
|
233
|
+
parsed.pr = parsed.pr === '' ? null : Number(parsed.pr);
|
|
234
|
+
Object.assign(payload, { action: m.editing ? 'edit' : 'add', id, source: { name: name || id, kind: m.kind, scope: { project: project || null, session: session || null, agent: agent || null }, ttl_seconds: Number(ttl_seconds), settings: parsed } });
|
|
235
|
+
}
|
|
236
|
+
if (effect === 'enable' || effect === 'auto-on') payload.review_revision = m.review?.review_revision;
|
|
237
|
+
if (effect === 'auto-on') payload.interval_seconds = m.automaticInterval;
|
|
238
|
+
const result = await backend.request('sources_apply', payload);
|
|
239
|
+
m.library = result;
|
|
240
|
+
if (effect === 'bind' && m.target && result.binding) {
|
|
241
|
+
const node = editor.instance(m.target.scope, m.target.id);
|
|
242
|
+
if (node)
|
|
243
|
+
node.source = result.binding;
|
|
244
|
+
m.message = text('sources.bound');
|
|
245
|
+
}
|
|
246
|
+
else
|
|
247
|
+
m.message = text(effect === 'auto-on' ? 'sources.automatic_saved' : 'sources.saved');
|
|
248
|
+
m.page = 'list';
|
|
249
|
+
m.cursor = 0;
|
|
250
|
+
m.scroll = 0;
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
m.message = error instanceof BackendError ? error.localization ?? text('sources.failed') : text('sources.failed');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
export function sourcesView(editor: Editor, language: Language, width: number, height: number): {
|
|
257
|
+
text: string;
|
|
258
|
+
selected: boolean;
|
|
259
|
+
}[] {
|
|
260
|
+
const m = editor.sources!;
|
|
261
|
+
const tr = (key: string) => t('sources.' + key, language), rows: {
|
|
262
|
+
text: string;
|
|
263
|
+
selected: boolean;
|
|
264
|
+
}[] = [];
|
|
265
|
+
const add = (value: string, selected = false) => rows.push({ text: value, selected });
|
|
266
|
+
add(tr('separate_save'));
|
|
267
|
+
if (m.message)
|
|
268
|
+
add(t(m.message.key, language, m.message.params));
|
|
269
|
+
if (m.page === 'list') {
|
|
270
|
+
m.library?.sources.forEach((s, i) => add(`${s.name} · ${s.kind} · ${tr(s.enabled ? 'enabled' : 'disabled')}${s.kind === 'github' ? ' · ' + tr(m.library!.automatic.some(p => p.source_id === s.id && p.enabled) ? 'automatic_on' : 'automatic_off') : ''}`, m.cursor === i));
|
|
271
|
+
add('+ ' + tr('add'), m.cursor === (m.library?.sources.length ?? 0));
|
|
272
|
+
}
|
|
273
|
+
else if (m.page === 'actions')
|
|
274
|
+
actions(editor).forEach((action, i) => add(tr(action), m.cursor === i));
|
|
275
|
+
else if (m.page === 'kind')
|
|
276
|
+
['json', 'github', 'command'].forEach((kind, i) => add(tr(kind), m.cursor === i));
|
|
277
|
+
else if (m.page === 'form') {
|
|
278
|
+
m.fields.forEach((field, i) => {
|
|
279
|
+
const label = tr('field.' + field.key) + ': ', space = Math.max(2, width - label.length);
|
|
280
|
+
const view = inputView({ ...field.input }, space);
|
|
281
|
+
add(label + view, m.cursor === i);
|
|
282
|
+
});
|
|
283
|
+
add(tr('form_help'));
|
|
284
|
+
}
|
|
285
|
+
else if (m.page === 'bind' || m.page === 'unbind') {
|
|
286
|
+
const entries = targets(editor);
|
|
287
|
+
if (!entries.length)
|
|
288
|
+
add(tr('no_components'));
|
|
289
|
+
entries.forEach((target, i) => add(`${target.scope}: ${editor.instanceLabel(target.scope, target.id, language)}`, m.cursor === i));
|
|
290
|
+
}
|
|
291
|
+
else if (m.page === 'remove')
|
|
292
|
+
add(tr('remove_confirm') + ' ' + source(editor)?.name, true);
|
|
293
|
+
else {
|
|
294
|
+
const lines = ['review', 'auto-review'].includes(m.page) ? [tr(m.page === 'auto-review' ? 'automatic_review' : 'enable_review'), ...(m.page === 'auto-review' ? [tr('interval') + ': ' + m.automaticInterval + ' s (←/→)'] : []), ...JSON.stringify(m.review?.source, null, 2).split('\n')] : m.details;
|
|
295
|
+
const wrapped = lines.flatMap(line => wrapText([line], width));
|
|
296
|
+
const capacity = Math.max(1, height - rows.length);
|
|
297
|
+
const start = Math.min(m.scroll, Math.max(0, wrapped.length - capacity));
|
|
298
|
+
wrapped.slice(start, start + capacity).forEach(line => add(line));
|
|
299
|
+
return rows;
|
|
300
|
+
}
|
|
301
|
+
const fixed = rows.slice(0, 1 + Number(!!m.message)), entries = rows.slice(fixed.length), capacity = Math.max(1, height - fixed.length);
|
|
302
|
+
const selected = Math.max(0, entries.findIndex(row => row.selected)), start = Math.max(0, selected - capacity + 1);
|
|
303
|
+
return [...fixed, ...entries.slice(start, start + capacity)];
|
|
304
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Generated by tools/generation/resources.ts; do not edit.
|
|
2
|
+
/** Strict response validation shared by the native and external source managers. */
|
|
3
|
+
const object = (v: unknown): v is Record<string, unknown> => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
4
|
+
const text = (v: unknown): v is string => typeof v === 'string' && v.length <= 16384 && !/[\p{Cc}\p{Cs}]/u.test(v);
|
|
5
|
+
const nullable = (v: unknown) => v === null || text(v);
|
|
6
|
+
const scalar = (v: unknown) => v === null || text(v) || typeof v === 'boolean' || typeof v === 'number' && Number.isFinite(v);
|
|
7
|
+
const fields = (v: unknown, keys: string[]): v is Record<string, unknown> => object(v) && Object.keys(v).length === keys.length && keys.every(key => Object.hasOwn(v, key));
|
|
8
|
+
const id = (v: unknown) => text(v) && /^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$/u.test(v);
|
|
9
|
+
const scope = (v: unknown) => fields(v, ['project', 'session', 'agent']) && Object.values(v).every(nullable) && (v.agent === null || v.session !== null);
|
|
10
|
+
export const isSourceContext = (v: unknown) => fields(v, ['project', 'session', 'agent', 'branch', 'head']) && Object.values(v).every(nullable);
|
|
11
|
+
function definition(v: unknown): boolean {
|
|
12
|
+
if (!fields(v, ['id', 'name', 'kind', 'scope', 'ttl_seconds', 'settings', 'enabled', 'revision']) || !id(v.id) || !text(v.name) || !['json', 'github', 'command'].includes(String(v.kind)) || !scope(v.scope) || !id(v.revision) || typeof v.enabled !== 'boolean' || typeof v.ttl_seconds !== 'number' || !Number.isInteger(v.ttl_seconds) || v.ttl_seconds < 1 || v.ttl_seconds > 86400 || !object(v.settings))
|
|
13
|
+
return false;
|
|
14
|
+
const s = v.settings;
|
|
15
|
+
if (v.kind === 'json')
|
|
16
|
+
return fields(s, ['path', 'pointer', 'observed_at_pointer', 'unit']) && Object.values(s).every(text);
|
|
17
|
+
if (v.kind === 'github')
|
|
18
|
+
return fields(s, ['host', 'repository', 'branch', 'account', 'pr']) && ['host', 'repository', 'branch', 'account'].every(key => text(s[key])) && (s.pr === null || typeof s.pr === 'number' && Number.isSafeInteger(s.pr) && s.pr > 0);
|
|
19
|
+
return fields(s, ['executable', 'args', 'cwd', 'input', 'output', 'timeout_ms']) && text(s.executable) && text(s.cwd) && Array.isArray(s.args) && s.args.length <= 128 && s.args.every(arg => typeof arg === 'string' && arg.length <= 8192 && !arg.includes('\0')) && object(s.input) && Object.entries(s.input).every(([key, value]) => /^[A-Za-z][A-Za-z0-9_]{0,63}$/u.test(key) && ['project', 'session', 'agent', 'branch', 'head'].includes(String(value))) && ['json', 'text'].includes(String(s.output)) && typeof s.timeout_ms === 'number' && Number.isInteger(s.timeout_ms) && s.timeout_ms >= 100 && s.timeout_ms <= 30000;
|
|
20
|
+
}
|
|
21
|
+
function job(v: unknown): boolean {
|
|
22
|
+
return fields(v, ['version', 'id', 'source_id', 'source_revision', 'owner', 'context', 'started_at', 'deadline_at', 'state', 'reason', 'trigger', 'identity']) && v.version === 2 && ['manual', 'automatic'].includes(String(v.trigger)) && typeof v.identity === 'string' && /^[a-f0-9]{64}$/.test(v.identity) && ['id', 'source_id', 'source_revision', 'owner'].every(key => id(v[key])) && isSourceContext(v.context) && text(v.started_at) && Number.isFinite(Date.parse(v.started_at)) && text(v.deadline_at) && Number.isFinite(Date.parse(v.deadline_at)) && ['running', 'completed', 'failed', 'cancelled'].includes(String(v.state)) && text(v.reason);
|
|
23
|
+
}
|
|
24
|
+
function view(v: unknown): boolean {
|
|
25
|
+
return object(v) && nullable(v.source_id) && text(v.name) && ['valid', 'missing', 'partial', 'error', 'unsupported', 'disabled', 'unbound', 'mismatch'].includes(String(v.state)) && text(v.reason) && nullable(v.observed_at) && ['current', 'stale', 'unknown'].includes(String(v.freshness)) && scalar(v.value) && nullable(v.unit) && (v.fields === undefined || object(v.fields) && Object.values(v.fields).every(scalar));
|
|
26
|
+
}
|
|
27
|
+
export function isSourceResult(operation: string, value: unknown): boolean {
|
|
28
|
+
if (!object(value))
|
|
29
|
+
return false;
|
|
30
|
+
if (operation === 'source_context')
|
|
31
|
+
return isSourceContext(value);
|
|
32
|
+
if (operation === 'source_review')
|
|
33
|
+
return fields(value, ['source', 'review_revision']) && definition(value.source) && object(value.source) && value.review_revision === value.source.revision;
|
|
34
|
+
if (['source_refresh', 'source_status', 'source_cancel'].includes(operation))
|
|
35
|
+
return job(value);
|
|
36
|
+
if (operation === 'source_diagnose')
|
|
37
|
+
return fields(value, ['source', 'view', 'jobs', 'automatic']) && object(value.automatic) && ['off', 'waiting', 'running', 'backoff', 'paused'].includes(String(value.automatic.state)) && text(value.automatic.reason) && ['next_at', 'last_attempt', 'last_success'].every(k => value.automatic && nullable((value.automatic as Record<string, unknown>)[k])) && typeof value.automatic.interval_seconds === 'number' && value.automatic.interval_seconds >= 60 && value.automatic.interval_seconds <= 86400 && definition(value.source) && view(value.view) && Array.isArray(value.jobs) && value.jobs.every(job);
|
|
38
|
+
if (!['sources_read', 'sources_apply'].includes(operation) || !fields(value, ['version', 'sources', 'bindings', 'automatic', 'revision', ...(operation === 'sources_apply' ? ['backup_dir', ...(Object.hasOwn(value, 'binding') ? ['binding'] : [])] : [])]))
|
|
39
|
+
return false;
|
|
40
|
+
if (value.version !== 2 || !text(value.revision) || !Array.isArray(value.sources) || value.sources.length > 128 || !value.sources.every(definition) || !Array.isArray(value.bindings) || value.bindings.length > 4096)
|
|
41
|
+
return false;
|
|
42
|
+
if (!Array.isArray(value.automatic) || value.automatic.length > value.sources.length || !value.automatic.every(p => fields(p, ['source_id', 'enabled', 'review_revision', 'interval_seconds', 'auth_revision']) && id(p.source_id) && typeof p.enabled === 'boolean' && id(p.review_revision) && typeof p.interval_seconds === 'number' && Number.isInteger(p.interval_seconds) && p.interval_seconds >= 60 && p.interval_seconds <= 86400 && typeof p.auth_revision === 'string' && /^[a-f0-9]{64}$/.test(p.auth_revision))) return false;
|
|
43
|
+
if (!value.bindings.every(b => fields(b, ['id', 'source_id']) && id(b.id) && id(b.source_id)))
|
|
44
|
+
return false;
|
|
45
|
+
return operation === 'sources_read' || nullable(value.backup_dir) && (value.binding === undefined || fields(value.binding, ['binding', 'hint']) && id(value.binding.binding) && text(value.binding.hint));
|
|
46
|
+
}
|
package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Generated by tools/generation/resources.ts; do not edit.
|
|
2
|
-
export const PROTOCOL_VERSION =
|
|
2
|
+
export const PROTOCOL_VERSION = 21 as const;
|
|
3
3
|
export const ITEM_DEFAULTS = {"label": null, "icon": null, "priority": 50, "max_width": null, "formatting": {}, "foreground": null, "background": null, "visibility": "always", "visibility_threshold": 70};
|
|
4
4
|
export const VISIBILITY_ITEMS = {"main": {"git": "git-dirty", "git-changes": "git-dirty", "active-agents": "nonzero", "task-progress": "nonzero", "context-used": "used-at-least", "context-remaining": "used-at-least", "five-hour-limit": "used-at-least", "weekly-limit": "used-at-least", "spend-limit": "used-at-least"}, "subagent": {"context-used": "used-at-least", "context-remaining": "used-at-least"}} as const;
|
|
5
|
-
export const GUIDANCE_KEYS = {"source_kinds": ["configuration", "official_input", "local_git", "local_system", "transcript", "local_state", "lifecycle", "native_timing", "live_metrics", "telemetry"], "scopes": ["main", "main_context", "session", "all_sessions", "task", "subagent", "subagent_context", "repository", "local", "latest_request"], "requirements": ["observed_field", "subagent_rows", "agent_context", "configured_effort", "agent_effort_optional", "git_repository", "git_upstream", "git_base", "pull_request", "worktree_session", "usage_records", "task_observation", "native_timing", "complete_waits", "live_metrics", "owned_agents", "checklist_events", "tool_events", "complete_stream", "request_coverage", "existing_telemetry", "gateway", "gateway_284", "valid_window", "warm_cache", "fast_mode", "thinking", "agent_mode", "vim_mode", "context_observation"]} as const;
|
|
5
|
+
export const GUIDANCE_KEYS = {"source_kinds": ["configuration", "official_input", "local_git", "local_system", "transcript", "local_state", "lifecycle", "native_timing", "live_metrics", "telemetry"], "scopes": ["main", "main_context", "session", "all_sessions", "task", "subagent", "subagent_context", "repository", "local", "latest_request"], "requirements": ["observed_field", "subagent_rows", "agent_context", "configured_effort", "agent_effort_optional", "git_repository", "git_upstream", "git_base", "pull_request", "worktree_session", "usage_records", "task_observation", "native_timing", "complete_waits", "live_metrics", "owned_agents", "checklist_events", "tool_events", "complete_stream", "request_coverage", "existing_telemetry", "gateway", "gateway_284", "valid_window", "warm_cache", "fast_mode", "thinking", "agent_mode", "vim_mode", "context_observation", "cost_rate"]} as const;
|
|
6
6
|
export const POWERLINE_FIELDS = [
|
|
7
7
|
{
|
|
8
8
|
"key": "powerline.padding",
|
|
@@ -486,8 +486,8 @@ export const EDITOR_FIELDS = {
|
|
|
486
486
|
export const PRESETS = [{"id": "developer", "purpose_key": "quick.purpose.developer", "requirements_key": "quick.requirements.developer", "example": false, "label": "Developer", "rows": [["model-with-effort", "current-dir", "git"], ["context-remaining", "tokens", "task-timer", "session-cost"]], "layout_mode": "explicit"}, {"id": "minimal", "purpose_key": "quick.purpose.minimal", "requirements_key": "quick.requirements.minimal", "example": false, "label": "Minimal", "rows": [["model-with-effort", "current-dir", "context-remaining", "task-timer"]], "layout_mode": "auto"}, {"id": "monitoring", "purpose_key": "quick.purpose.monitoring", "requirements_key": "quick.requirements.monitoring", "example": false, "label": "Monitoring", "rows": [["context-used", "five-hour-limit", "weekly-limit", "spend-limit"], ["five-hour-reset", "weekly-reset", "cache-state", "cache-expires"], ["session-cost", "session-duration", "api-duration", "api-requests", "cache-misses"]], "layout_mode": "explicit"}, {"id": "multi-agent", "purpose_key": "quick.purpose.multi-agent", "requirements_key": "quick.requirements.multi-agent", "example": false, "label": "Multi Agent", "rows": [["model-with-effort", "current-dir", "git"], ["context-remaining", "tokens", "task-timer"]], "layout_mode": "explicit"}, {"id": "left-right", "purpose_key": "quick.purpose.left-right", "requirements_key": "quick.requirements.left-right", "example": true, "label": "Left Right", "rows": [["model-with-effort", "git", "spacer", "context-remaining"]], "layout_mode": "explicit"}, {"id": "repeated-metrics", "purpose_key": "quick.purpose.repeated-metrics", "requirements_key": "quick.requirements.repeated-metrics", "example": true, "label": "Repeated Metrics", "rows": [["input-tokens", "input-tokens"]], "layout_mode": "explicit"}, {"id": "daily-development", "purpose_key": "quick.purpose.daily-development", "requirements_key": "quick.requirements.daily-development", "example": false, "label": "Daily Development", "rows": [["model-with-effort", "current-dir", "git", "context-remaining", "task-timer"], ["session-cost"]], "layout_mode": "explicit"}, {"id": "agent-focus", "purpose_key": "quick.purpose.agent-focus", "requirements_key": "quick.requirements.agent-focus", "example": false, "label": "Agent Focus", "rows": [["task-timer", "context-remaining", "git"], ["run-state", "task-progress", "active-agents"]], "layout_mode": "explicit"}, {"id": "quota-watch", "purpose_key": "quick.purpose.quota-watch", "requirements_key": "quick.requirements.quota-watch", "example": false, "label": "Quota Watch", "rows": [["context-used", "five-hour-limit", "weekly-limit"], ["five-hour-reset", "weekly-reset"], ["session-cost", "spend-limit", "cache-state", "cache-expires"]], "layout_mode": "explicit"}] as const;
|
|
487
487
|
export const FORMAT_CHOICES = {"model_name": ["original", "short"], "number_format": ["legacy", "compact", "full", "grouped"], "labels": ["legacy", "short", "off"], "icons": ["legacy", "unicode", "ascii", "off"], "allowance": ["remaining", "used"], "reset_format": ["countdown", "time", "datetime"], "reset_timezone": ["local", "UTC"]} as const;
|
|
488
488
|
export const FORMAT_DEFAULTS = {"model_name": "original", "number_format": "legacy", "labels": "legacy", "icons": "legacy", "allowance": "remaining", "reset_format": "countdown", "reset_timezone": "local", "thresholds": {"enabled": false, "warning": 70, "critical": 90}} as const;
|
|
489
|
-
export type MainItemId = "model-with-effort" | "model" | "effort" | "fast-mode" | "thinking" | "current-dir" | "project-name" | "hostname" | "git" | "git-branch" | "git-changes" | "git-ahead-behind" | "branch-diff" | "pr" | "repo" | "worktree" | "context-remaining" | "context-used" | "context-window-size" | "context-tokens" | "five-hour-limit" | "five-hour-reset" | "weekly-limit" | "weekly-reset" | "spend-limit" | "spend-amount" | "spend-period" | "tokens" | "input-tokens" | "output-tokens" | "prompt-cache" | "cache-state" | "cache-expires" | "cache-misses" | "cache-miss-reason" | "api-requests" | "task-timer" | "task-active-timer" | "version" | "session" | "session-name" | "session-id" | "session-id-short" | "output-style" | "cost" | "session-cost" | "session-duration" | "api-duration" | "lines-changed" | "agent" | "vim-mode" | "run-state" | "permission-mode" | "active-agents" | "task-progress" | "last-tool" | "ttft" | "output-rate" | "prompt-input-tokens" | "prompt-output-tokens" | "prompt-cost" | "text" | "spacer";
|
|
490
|
-
export type SubagentItemId = "status-elapsed" | "status" | "name" | "model-with-effort" | "model" | "effort" | "context-remaining" | "context-used" | "context-tokens" | "context-window-size" | "elapsed" | "task" | "tokens" | "current-dir" | "text" | "spacer";
|
|
489
|
+
export type MainItemId = "model-with-effort" | "model" | "effort" | "fast-mode" | "thinking" | "current-dir" | "project-name" | "hostname" | "git" | "git-branch" | "git-changes" | "git-ahead-behind" | "branch-diff" | "pr" | "repo" | "worktree" | "context-remaining" | "context-used" | "context-window-size" | "context-tokens" | "five-hour-limit" | "five-hour-reset" | "weekly-limit" | "weekly-reset" | "spend-limit" | "spend-amount" | "spend-period" | "tokens" | "input-tokens" | "output-tokens" | "prompt-cache" | "cache-state" | "cache-expires" | "cache-misses" | "cache-miss-reason" | "api-requests" | "task-timer" | "task-active-timer" | "version" | "session" | "session-name" | "session-id" | "session-id-short" | "output-style" | "cost" | "session-cost" | "session-cost-rate" | "session-duration" | "api-duration" | "lines-changed" | "agent" | "vim-mode" | "run-state" | "permission-mode" | "active-agents" | "task-progress" | "last-tool" | "ttft" | "output-rate" | "prompt-input-tokens" | "prompt-output-tokens" | "prompt-cost" | "text" | "spacer" | "external-value" | "github-pr" | "github-ci";
|
|
490
|
+
export type SubagentItemId = "status-elapsed" | "status" | "name" | "model-with-effort" | "model" | "effort" | "context-remaining" | "context-used" | "context-tokens" | "context-window-size" | "elapsed" | "task" | "tokens" | "current-dir" | "text" | "spacer" | "external-value";
|
|
491
491
|
export type Palette = "default" | "ansi";
|
|
492
492
|
export type Theme = "classic" | "dark" | "light" | "terminal";
|
|
493
493
|
export type PowerlineGlyph = "ascii" | "powerline";
|
|
@@ -498,8 +498,8 @@ export type ScopeLabels = "off" | "when-subagents" | "always";
|
|
|
498
498
|
export type StatuslineLanguage = "en" | "zh-CN" | "zh-TW" | "zh-HK" | "ja" | "ko";
|
|
499
499
|
export type Scope = "main" | "subagent";
|
|
500
500
|
export type UnavailableReason = "not_observed" | "unsupported_host" | "unknown_host_version" | "source_unavailable" | "condition_not_met" | "runtime_disabled" | "native_timing_disabled" | "wait_coverage_missing" | "stale" | "incomplete" | "ambiguous_owner" | "observed_only" | "missing_stream" | "synthetic_response" | "abnormal_clock" | "inconsistent_request" | "request_join_unavailable";
|
|
501
|
-
export const MAIN_ITEM_IDS = ["model-with-effort", "model", "effort", "fast-mode", "thinking", "current-dir", "project-name", "hostname", "git", "git-branch", "git-changes", "git-ahead-behind", "branch-diff", "pr", "repo", "worktree", "context-remaining", "context-used", "context-window-size", "context-tokens", "five-hour-limit", "five-hour-reset", "weekly-limit", "weekly-reset", "spend-limit", "spend-amount", "spend-period", "tokens", "input-tokens", "output-tokens", "prompt-cache", "cache-state", "cache-expires", "cache-misses", "cache-miss-reason", "api-requests", "task-timer", "task-active-timer", "version", "session", "session-name", "session-id", "session-id-short", "output-style", "cost", "session-cost", "session-duration", "api-duration", "lines-changed", "agent", "vim-mode", "run-state", "permission-mode", "active-agents", "task-progress", "last-tool", "ttft", "output-rate", "prompt-input-tokens", "prompt-output-tokens", "prompt-cost", "text", "spacer"] as const;
|
|
502
|
-
export const SUBAGENT_ITEM_IDS = ["status-elapsed", "status", "name", "model-with-effort", "model", "effort", "context-remaining", "context-used", "context-tokens", "context-window-size", "elapsed", "task", "tokens", "current-dir", "text", "spacer"] as const;
|
|
501
|
+
export const MAIN_ITEM_IDS = ["model-with-effort", "model", "effort", "fast-mode", "thinking", "current-dir", "project-name", "hostname", "git", "git-branch", "git-changes", "git-ahead-behind", "branch-diff", "pr", "repo", "worktree", "context-remaining", "context-used", "context-window-size", "context-tokens", "five-hour-limit", "five-hour-reset", "weekly-limit", "weekly-reset", "spend-limit", "spend-amount", "spend-period", "tokens", "input-tokens", "output-tokens", "prompt-cache", "cache-state", "cache-expires", "cache-misses", "cache-miss-reason", "api-requests", "task-timer", "task-active-timer", "version", "session", "session-name", "session-id", "session-id-short", "output-style", "cost", "session-cost", "session-cost-rate", "session-duration", "api-duration", "lines-changed", "agent", "vim-mode", "run-state", "permission-mode", "active-agents", "task-progress", "last-tool", "ttft", "output-rate", "prompt-input-tokens", "prompt-output-tokens", "prompt-cost", "text", "spacer", "external-value", "github-pr", "github-ci"] as const;
|
|
502
|
+
export const SUBAGENT_ITEM_IDS = ["status-elapsed", "status", "name", "model-with-effort", "model", "effort", "context-remaining", "context-used", "context-tokens", "context-window-size", "elapsed", "task", "tokens", "current-dir", "text", "spacer", "external-value"] as const;
|
|
503
503
|
export const PALETTE_VALUES = ["default", "ansi"] as const;
|
|
504
504
|
export const THEME_VALUES = ["classic", "dark", "light", "terminal"] as const;
|
|
505
505
|
export const POWERLINEGLYPH_VALUES = ["ascii", "powerline"] as const;
|
|
@@ -509,7 +509,7 @@ export const SEPARATORSTYLE_VALUES = ["classic", "compact", "powerline"] as cons
|
|
|
509
509
|
export const SCOPELABELS_VALUES = ["off", "when-subagents", "always"] as const;
|
|
510
510
|
export const STATUSLINELANGUAGE_VALUES = ["en", "zh-CN", "zh-TW", "zh-HK", "ja", "ko"] as const;
|
|
511
511
|
export const UNAVAILABLEREASON_VALUES = ["not_observed", "unsupported_host", "unknown_host_version", "source_unavailable", "condition_not_met", "runtime_disabled", "native_timing_disabled", "wait_coverage_missing", "stale", "incomplete", "ambiguous_owner", "observed_only", "missing_stream", "synthetic_response", "abnormal_clock", "inconsistent_request", "request_join_unavailable"] as const;
|
|
512
|
-
export type Operation = "describe" | "read" | "preview" | "apply" | "import" | "export" | "preset" | "read_ui_preferences" | "set_ui_language" | "review_import" | "explain" | "diagnose" | "profiles_read" | "profiles_apply" | "profile_import" | "profile_export" | "task_details";
|
|
512
|
+
export type Operation = "sources_read" | "sources_apply" | "source_review" | "source_context" | "source_refresh" | "source_status" | "source_cancel" | "source_diagnose" | "describe" | "read" | "preview" | "apply" | "import" | "export" | "preset" | "read_ui_preferences" | "set_ui_language" | "review_import" | "explain" | "diagnose" | "profiles_read" | "profiles_apply" | "profile_import" | "profile_export" | "task_details";
|
|
513
513
|
export interface ItemGuidance {
|
|
514
514
|
source_kinds: string[];
|
|
515
515
|
measurement_scope: string;
|
|
@@ -532,6 +532,16 @@ export interface CatalogItem {
|
|
|
532
532
|
default_enabled: boolean;
|
|
533
533
|
minimum_version_status: "verified" | "unknown";
|
|
534
534
|
guidance: ItemGuidance;
|
|
535
|
+
capabilities?: ItemCapability;
|
|
536
|
+
}
|
|
537
|
+
export interface ItemCapability {
|
|
538
|
+
indicator?: boolean;
|
|
539
|
+
formats: string[];
|
|
540
|
+
visibility: string[];
|
|
541
|
+
link: boolean;
|
|
542
|
+
source: 'none' | 'external' | 'github';
|
|
543
|
+
preview: string;
|
|
544
|
+
explanation: string;
|
|
535
545
|
}
|
|
536
546
|
export interface ChoiceOptions {
|
|
537
547
|
choices: (string | boolean)[];
|
|
@@ -591,6 +601,11 @@ export interface FormattingDraft {
|
|
|
591
601
|
thresholds: ThresholdDraft;
|
|
592
602
|
}
|
|
593
603
|
export interface ItemOptionsDraft {
|
|
604
|
+
presentation?: "numeric" | "bar";
|
|
605
|
+
bar_width?: number;
|
|
606
|
+
cost_rate_basis?: 'session' | 'api';
|
|
607
|
+
bar_style?: "auto" | "unicode" | "ascii";
|
|
608
|
+
link?: 'off' | 'auto' | 'on';
|
|
594
609
|
label: string | null;
|
|
595
610
|
icon: string | null;
|
|
596
611
|
priority: number;
|
|
@@ -602,17 +617,22 @@ export interface ItemOptionsDraft {
|
|
|
602
617
|
visibility_threshold: number;
|
|
603
618
|
}
|
|
604
619
|
export interface InstanceDraft {
|
|
620
|
+
source?: SourceReference;
|
|
605
621
|
id: string;
|
|
606
622
|
type_id: string;
|
|
607
623
|
enabled: boolean;
|
|
608
624
|
options: ItemOptionsDraft;
|
|
609
625
|
text: string | null;
|
|
610
626
|
}
|
|
627
|
+
export interface GroupDraft {
|
|
628
|
+
id: string; member_ids: string[]; primary_id: string; link_visibility: boolean; shared_powerline: boolean;
|
|
629
|
+
}
|
|
611
630
|
export interface LayoutDraft {
|
|
612
631
|
mode: "auto" | "explicit";
|
|
613
632
|
rows: string[][];
|
|
614
633
|
}
|
|
615
634
|
export interface SubagentDraft {
|
|
635
|
+
groups: GroupDraft[];
|
|
616
636
|
enabled: boolean;
|
|
617
637
|
instances: InstanceDraft[];
|
|
618
638
|
visibility: "all" | "running";
|
|
@@ -631,7 +651,8 @@ export interface PowerlineDraft {
|
|
|
631
651
|
color_mode: "semantic" | "continuous" | "restart";
|
|
632
652
|
}
|
|
633
653
|
export interface DisplayDraft {
|
|
634
|
-
|
|
654
|
+
groups: GroupDraft[];
|
|
655
|
+
schema_version: 13;
|
|
635
656
|
statusline_language: StatuslineLanguage;
|
|
636
657
|
instances: InstanceDraft[];
|
|
637
658
|
use_colors: boolean;
|
|
@@ -661,19 +682,73 @@ export interface Foreground {
|
|
|
661
682
|
value: string | number;
|
|
662
683
|
}
|
|
663
684
|
export interface Span {
|
|
685
|
+
link?: string;
|
|
664
686
|
text: string;
|
|
665
687
|
bold: boolean;
|
|
666
688
|
foreground: Foreground | null;
|
|
667
689
|
background: Foreground | null;
|
|
668
690
|
}
|
|
691
|
+
|
|
692
|
+
/** Machine-local source authorization is never part of a portable display. */
|
|
693
|
+
export interface SourceReference { binding: string | null; hint: string }
|
|
694
|
+
export type SourceKind = 'json' | 'github' | 'command';
|
|
695
|
+
export interface SourceScope { project: string | null; session: string | null; agent: string | null }
|
|
696
|
+
export interface SourceContext extends SourceScope { branch: string | null; head: string | null }
|
|
697
|
+
export interface SourceSettings {
|
|
698
|
+
path?: string;
|
|
699
|
+
pointer?: string;
|
|
700
|
+
observed_at_pointer?: string;
|
|
701
|
+
unit?: string;
|
|
702
|
+
executable?: string;
|
|
703
|
+
args?: string[];
|
|
704
|
+
cwd?: string;
|
|
705
|
+
input?: Record<string, string>;
|
|
706
|
+
output?: 'json' | 'text';
|
|
707
|
+
timeout_ms?: number;
|
|
708
|
+
host?: string;
|
|
709
|
+
repository?: string;
|
|
710
|
+
branch?: string;
|
|
711
|
+
account?: string;
|
|
712
|
+
pr?: number | null;
|
|
713
|
+
}
|
|
714
|
+
export interface SourceDefinition {
|
|
715
|
+
id: string; name: string; kind: SourceKind; scope: SourceScope;
|
|
716
|
+
ttl_seconds: number; settings: SourceSettings; enabled: boolean; revision: string;
|
|
717
|
+
}
|
|
718
|
+
export interface SourceBinding { id: string; source_id: string }
|
|
719
|
+
export interface AutomaticPolicy { source_id: string; enabled: boolean; review_revision: string; interval_seconds: number; auth_revision: string }
|
|
720
|
+
export interface AutomaticStatus { state: 'off' | 'waiting' | 'running' | 'backoff' | 'paused'; reason: string; next_at: string | null; last_attempt: string | null; last_success: string | null; interval_seconds: number }
|
|
721
|
+
export interface SourceRegistry { version: 2; sources: SourceDefinition[]; bindings: SourceBinding[]; automatic: AutomaticPolicy[] }
|
|
722
|
+
export interface SourcesResult extends SourceRegistry { revision: string }
|
|
723
|
+
export type SourceState = 'valid' | 'missing' | 'partial' | 'error' | 'unsupported';
|
|
724
|
+
export interface SourceObservation {
|
|
725
|
+
version: 1; source_id: string; source_revision: string; context: SourceContext;
|
|
726
|
+
observed_at: string | null; state: SourceState; reason: string;
|
|
727
|
+
value: string | number | boolean | null; unit: string | null;
|
|
728
|
+
fields?: Record<string, string | number | boolean | null>;
|
|
729
|
+
identity?: { host: string; repository: string; account: string; auth_revision: string };
|
|
730
|
+
}
|
|
731
|
+
export interface SourceView {
|
|
732
|
+
source_id: string | null; name: string; state: SourceState | 'disabled' | 'unbound' | 'mismatch';
|
|
733
|
+
reason: string; observed_at: string | null; freshness: 'current' | 'stale' | 'unknown';
|
|
734
|
+
value: string | number | boolean | null; unit: string | null;
|
|
735
|
+
fields?: Record<string, string | number | boolean | null>;
|
|
736
|
+
}
|
|
737
|
+
export interface SourceJob {
|
|
738
|
+
version: 2; id: string; source_id: string; source_revision: string; owner: string; trigger: 'manual' | 'automatic'; identity: string;
|
|
739
|
+
context: SourceContext; started_at: string; deadline_at: string;
|
|
740
|
+
state: 'running' | 'completed' | 'failed' | 'cancelled'; reason: string;
|
|
741
|
+
}
|
|
742
|
+
export interface SourceReview { source: SourceDefinition; review_revision: string }
|
|
743
|
+
export interface SourceMutationResult extends SourcesResult { binding?: SourceReference; backup_dir: string | null }
|
|
669
744
|
export interface PreviewResult {
|
|
670
745
|
sample: true;
|
|
671
746
|
main: Span[][];
|
|
672
747
|
subagents: Span[][];
|
|
673
748
|
}
|
|
674
|
-
export const SAMPLE_REASONS = ['sample_visible','sample_empty','sample_condition_hidden','sample_truncated','sample_priority_omitted','sample_width_omitted','sample_row_hidden','sample_spacer'] as const;
|
|
749
|
+
export const SAMPLE_REASONS = ['sample_group_hidden','sample_visible','sample_empty','sample_condition_hidden','sample_truncated','sample_priority_omitted','sample_width_omitted','sample_row_hidden','sample_spacer'] as const;
|
|
675
750
|
export type SampleReason = typeof SAMPLE_REASONS[number];
|
|
676
|
-
export const EXPLAIN_REASONS = ['configured_on','configured_off','scope_disabled','installation_owned','installation_absent','installation_foreign','installation_unknown','unknown_host_version','host_supported','unsupported_host','host_requirement_unknown','collector_unknown','native_timing_on','native_timing_off','live_metrics_on','live_metrics_off','actual_not_observed'] as const;
|
|
751
|
+
export const EXPLAIN_REASONS = ['cost_rate_session','cost_rate_api','indicator_bar','source_bound','source_unbound','configured_on','configured_off','scope_disabled','installation_owned','installation_absent','installation_foreign','installation_unknown','unknown_host_version','host_supported','unsupported_host','host_requirement_unknown','collector_unknown','native_timing_on','native_timing_off','live_metrics_on','live_metrics_off','actual_not_observed'] as const;
|
|
677
752
|
export interface ExplainReason { code: string; origin: 'configuration' | 'local_configuration' | 'host_capability' | 'unknown'; }
|
|
678
753
|
export interface InstanceSample { row_id: string; outcome: SampleReason; truncated: boolean; }
|
|
679
754
|
export interface ExplainInstance {
|
|
@@ -689,7 +764,7 @@ export interface ExplainResult {
|
|
|
689
764
|
preview: PreviewResult;
|
|
690
765
|
instances: ExplainInstance[];
|
|
691
766
|
}
|
|
692
|
-
export const LAYOUT_REASONS = ['visible','empty','condition_hidden','priority_omitted','width_omitted','row_hidden','spacer'] as const;
|
|
767
|
+
export const LAYOUT_REASONS = ['group_hidden','visible','empty','condition_hidden','priority_omitted','width_omitted','row_hidden','spacer'] as const;
|
|
693
768
|
export type LayoutReason = typeof LAYOUT_REASONS[number];
|
|
694
769
|
export interface InstanceLayout { row_id: string; outcome: LayoutReason; truncated: boolean; }
|
|
695
770
|
export const EVIDENCE_STATUSES = ['observed','not_observed','invalid_field','source_unavailable','association_unavailable','session_mismatch','prompt_mismatch','stale','partial','collector_off','input_only','newer_than_input','unsupported_host','no_misses','unidentified'] as const;
|
|
@@ -854,6 +929,14 @@ export interface ApplyResult {
|
|
|
854
929
|
configuration?: ResolvedConfiguration;
|
|
855
930
|
}
|
|
856
931
|
export interface ResultMap {
|
|
932
|
+
sources_read: SourcesResult;
|
|
933
|
+
sources_apply: SourceMutationResult;
|
|
934
|
+
source_review: SourceReview;
|
|
935
|
+
source_context: SourceContext;
|
|
936
|
+
source_refresh: SourceJob;
|
|
937
|
+
source_status: SourceJob;
|
|
938
|
+
source_cancel: SourceJob;
|
|
939
|
+
source_diagnose: { source: SourceDefinition; view: SourceView; jobs: SourceJob[]; automatic: AutomaticStatus };
|
|
857
940
|
describe: DescribeResult;
|
|
858
941
|
read: ReadResult;
|
|
859
942
|
preview: PreviewResult;
|