@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
package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/group-manager.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Generated by tools/generation/resources.ts; do not edit.
|
|
2
|
+
/** Group edits affect the display draft only; Save retains its existing boundary. */
|
|
3
|
+
import type { Editor } from './draft.ts';
|
|
4
|
+
import type { GroupDraft, Scope } from '../generated-contracts.ts';
|
|
5
|
+
import type { TextKey } from './text-input.ts';
|
|
6
|
+
import { t, type Language } from '../i18n/index.ts';
|
|
7
|
+
import { editGroup, groupScope, type GroupEdit } from './groups.ts';
|
|
8
|
+
import { newInstance } from './instances.ts';
|
|
9
|
+
import { isDraft } from '../backend.ts';
|
|
10
|
+
import { wrapText } from '../../ui/text.ts';
|
|
11
|
+
|
|
12
|
+
export interface GroupManager {
|
|
13
|
+
scope: Scope; page: 'list' | 'actions' | 'form'; cursor: number; selected: string | null;
|
|
14
|
+
first: string; last: string; primary: string; linked: boolean; shared: boolean; error: boolean;
|
|
15
|
+
}
|
|
16
|
+
export function openGroups(e: Editor): void {
|
|
17
|
+
e.groupManager = { scope: e.detail?.scope ?? (e.page === 'subagents' ? 'subagent' : 'main'), page: 'list', cursor: 0, selected: null,
|
|
18
|
+
first: '', last: '', primary: '', linked: true, shared: false, error: false };
|
|
19
|
+
}
|
|
20
|
+
const actions = ['edit', 'up', 'down', 'copy', 'ungroup'];
|
|
21
|
+
const fields = ['first', 'last', 'primary', 'linked', 'shared', 'apply'];
|
|
22
|
+
function form(e: Editor, g?: GroupDraft): void {
|
|
23
|
+
const m = e.groupManager!, target = groupScope(e.draft.display, m.scope), candidates = target.instances.filter(n => n.type_id !== 'spacer');
|
|
24
|
+
const initial = candidates.findIndex(n => n.id === e.selected[m.scope]);
|
|
25
|
+
m.first = g?.member_ids[0] ?? candidates[Math.max(0, initial)]?.id ?? '';
|
|
26
|
+
m.last = g?.member_ids.at(-1) ?? candidates[Math.min(candidates.length - 1, Math.max(0, initial) + 1)]?.id ?? '';
|
|
27
|
+
m.primary = g?.primary_id ?? candidates.find(n => n.id === m.first && n.type_id !== 'text')?.id ?? candidates.find(n => n.id === m.last && n.type_id !== 'text')?.id ?? '';
|
|
28
|
+
m.linked = g?.link_visibility ?? true; m.shared = g?.shared_powerline ?? false;
|
|
29
|
+
m.selected = g?.id ?? null; m.page = 'form'; m.cursor = 0; m.error = false;
|
|
30
|
+
}
|
|
31
|
+
function apply(e: Editor, edit: GroupEdit): void {
|
|
32
|
+
const m = e.groupManager!;
|
|
33
|
+
try {
|
|
34
|
+
const display = editGroup(e.draft.display, m.scope, edit, () => newInstance('text', groupScope(e.draft.display, m.scope).instances).id);
|
|
35
|
+
if (!isDraft({ ...e.draft, display })) throw new Error('invalid');
|
|
36
|
+
e.draft = { ...e.draft, display }; e.order[m.scope] = groupScope(display, m.scope).instances.map(n => n.id);
|
|
37
|
+
m.page = 'list'; m.cursor = 0; m.error = false;
|
|
38
|
+
} catch { m.error = true; }
|
|
39
|
+
}
|
|
40
|
+
export function groupsKey(e: Editor, event: TextKey): null {
|
|
41
|
+
const m = e.groupManager!;
|
|
42
|
+
if (event.text || event.paste || event.meta || event.overflow) return null;
|
|
43
|
+
const key = event.key === 'return' ? 'enter' : event.key;
|
|
44
|
+
if (key === 'escape' || event.ctrl && key.toLowerCase() === 'g') {
|
|
45
|
+
if (m.page === 'list') e.groupManager = null;
|
|
46
|
+
else { m.page = 'list'; m.cursor = 0; m.error = false; }
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
if (event.ctrl) return null;
|
|
50
|
+
const target = groupScope(e.draft.display, m.scope);
|
|
51
|
+
const length = m.page === 'list' ? target.groups.length + 2 : m.page === 'actions' ? actions.length : fields.length;
|
|
52
|
+
if (key === 'up' || key === 'down' || key === 'tab') m.cursor = Math.max(0, Math.min(length - 1, m.cursor + (key === 'up' ? -1 : 1)));
|
|
53
|
+
if (key === 'home') m.cursor = 0;
|
|
54
|
+
if (key === 'end') m.cursor = length - 1;
|
|
55
|
+
if (m.page === 'list') {
|
|
56
|
+
if (m.cursor === 0 && ['left', 'right', 'enter'].includes(key)) { m.scope = m.scope === 'main' ? 'subagent' : 'main'; m.error = false; }
|
|
57
|
+
else if (key === 'enter') {
|
|
58
|
+
const g = target.groups[m.cursor - 1];
|
|
59
|
+
if (g) { m.selected = g.id; m.page = 'actions'; m.cursor = 0; }
|
|
60
|
+
else form(e);
|
|
61
|
+
}
|
|
62
|
+
} else if (m.page === 'actions' && key === 'enter') {
|
|
63
|
+
const g = target.groups.find(g => g.id === m.selected)!;
|
|
64
|
+
if (actions[m.cursor] === 'edit') form(e, g);
|
|
65
|
+
else if (actions[m.cursor] === 'copy' || actions[m.cursor] === 'ungroup') apply(e, { action: actions[m.cursor] as 'copy' | 'ungroup', id: g.id });
|
|
66
|
+
else {
|
|
67
|
+
const down = actions[m.cursor] === 'down', edge = target.instances.findIndex(n => n.id === (down ? g.member_ids.at(-1) : g.member_ids[0]));
|
|
68
|
+
const next = target.instances[edge + (down ? 1 : -1)];
|
|
69
|
+
if (!next) return null;
|
|
70
|
+
const adjacent = target.groups.find(g => g.member_ids.includes(next.id));
|
|
71
|
+
const anchor = adjacent ? down ? adjacent.member_ids.at(-1)! : adjacent.member_ids[0]! : next.id;
|
|
72
|
+
apply(e, { action: 'move', id: g.id, ...(down ? { after: anchor } : { before: anchor }) });
|
|
73
|
+
}
|
|
74
|
+
} else if (m.page === 'form') {
|
|
75
|
+
if (m.cursor === 5 && key === 'enter') {
|
|
76
|
+
const first = target.instances.findIndex(n => n.id === m.first), last = target.instances.findIndex(n => n.id === m.last);
|
|
77
|
+
apply(e, { action: m.selected ? 'set' : 'create', ...(m.selected ? { id: m.selected } : {}), member_ids: first < 0 || last < first ? [] : target.instances.slice(first, last + 1).map(n => n.id), primary_id: m.primary, link_visibility: m.linked, shared_powerline: m.shared });
|
|
78
|
+
} else if (['left', 'right', 'enter'].includes(key)) {
|
|
79
|
+
if (m.cursor === 3) m.linked = !m.linked;
|
|
80
|
+
else if (m.cursor === 4) m.shared = !m.shared;
|
|
81
|
+
else if (m.cursor < 3) {
|
|
82
|
+
const name = fields[m.cursor] as 'first' | 'last' | 'primary';
|
|
83
|
+
const choices = target.instances.filter(n => n.type_id !== 'spacer' && (name !== 'primary' || n.type_id !== 'text')).map(n => n.id);
|
|
84
|
+
if (choices.length) m[name] = choices[(Math.max(0, choices.indexOf(m[name])) + (key === 'left' ? choices.length - 1 : 1)) % choices.length]!;
|
|
85
|
+
}
|
|
86
|
+
m.error = false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
export function groupsView(e: Editor, language: Language, width: number, height: number): { text: string; selected?: boolean }[] {
|
|
92
|
+
const m = e.groupManager!, target = groupScope(e.draft.display, m.scope);
|
|
93
|
+
const tr = (key: string) => t('composition.groups.' + key, language);
|
|
94
|
+
const label = (id: string) => e.instance(m.scope, id) ? e.instanceLabel(m.scope, id, language) + ' (' + id + ')' : '—';
|
|
95
|
+
const values = m.page === 'list' ? [tr(m.scope), ...target.groups.map(g => label(g.primary_id) + ' · ' + g.member_ids.length), tr('create')]
|
|
96
|
+
: m.page === 'actions' ? actions.map(tr)
|
|
97
|
+
: [tr('first') + ': ' + label(m.first), tr('last') + ': ' + label(m.last), tr('primary') + ': ' + label(m.primary),
|
|
98
|
+
tr('linked') + ': ' + t('values.' + (m.linked ? 'on' : 'off'), language), tr('shared') + ': ' + t('values.' + (m.shared ? 'on' : 'off'), language), tr('apply')];
|
|
99
|
+
const note = wrapText([tr(m.error ? 'invalid' : 'help')], width), capacity = Math.max(1, height - Math.min(2, note.length));
|
|
100
|
+
const start = Math.max(0, m.cursor - capacity + 1);
|
|
101
|
+
return [...values.slice(start, start + capacity).map((text, i) => ({ text: (start + i === m.cursor ? '› ' : ' ') + text, selected: start + i === m.cursor })), ...note.slice(0, Math.max(0, height - Math.min(capacity, values.length))).map(text => ({ text }))];
|
|
102
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Generated by tools/generation/resources.ts; do not edit.
|
|
2
|
+
/** Pure grouping rules shared by configuration services and both editors. */
|
|
3
|
+
import type { DisplayDraft, GroupDraft, InstanceDraft, LayoutDraft, Scope } from '../generated-contracts.ts';
|
|
4
|
+
|
|
5
|
+
const object = (v: unknown): v is Record<string, unknown> => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
6
|
+
const id = (v: unknown): v is string => typeof v === 'string' && /^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$/.test(v);
|
|
7
|
+
export function validGroups(value: unknown, nodes: readonly InstanceDraft[], layout?: LayoutDraft): value is GroupDraft[] {
|
|
8
|
+
if (!Array.isArray(value) || value.length > nodes.length) return false;
|
|
9
|
+
const ids = new Set<string>(), members = new Set<string>(), byId = new Map(nodes.map(n => [n.id, n]));
|
|
10
|
+
return value.every(g => {
|
|
11
|
+
if (!object(g) || Object.keys(g).sort().join(',') !== 'id,link_visibility,member_ids,primary_id,shared_powerline' ||
|
|
12
|
+
!id(g.id) || ids.has(g.id) || !id(g.primary_id) || typeof g.link_visibility !== 'boolean' || typeof g.shared_powerline !== 'boolean' ||
|
|
13
|
+
!Array.isArray(g.member_ids) || g.member_ids.length < 2 || !g.member_ids.every(id) || !g.member_ids.includes(g.primary_id)) return false;
|
|
14
|
+
const primary = byId.get(g.primary_id);
|
|
15
|
+
if (!primary || ['text', 'spacer'].includes(primary.type_id)) return false;
|
|
16
|
+
const memberIds = g.member_ids as string[];
|
|
17
|
+
const start = nodes.findIndex(n => n.id === memberIds[0]);
|
|
18
|
+
if (start < 0 || !g.member_ids.every((member, index) => nodes[start + index]?.id === member && !members.has(member) && byId.get(member)?.type_id !== 'spacer')) return false;
|
|
19
|
+
if (layout?.mode === 'explicit' && !layout.rows.some(row => memberIds.every(member => row.includes(member)))) return false;
|
|
20
|
+
ids.add(g.id); g.member_ids.forEach(member => members.add(member)); return true;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function groupScope(display: DisplayDraft, scope: Scope) { return scope === 'main' ? display : display.subagents; }
|
|
24
|
+
/** Deletion dissolves a primary's group; ordering never silently removes a group. */
|
|
25
|
+
export function reconcileGroups(groups: readonly GroupDraft[], nodes: readonly InstanceDraft[]): GroupDraft[] {
|
|
26
|
+
const ids = new Set(nodes.map(n => n.id));
|
|
27
|
+
return groups.filter(g => ids.has(g.primary_id)).map(g => ({ ...g, member_ids: nodes.filter(n => g.member_ids.includes(n.id)).map(n => n.id) }))
|
|
28
|
+
.filter(g => g.member_ids.length >= 2);
|
|
29
|
+
}
|
|
30
|
+
export function insertionAfter(nodes: readonly InstanceDraft[], groups: readonly GroupDraft[], anchor: string | undefined): number {
|
|
31
|
+
if (anchor === undefined) return nodes.length;
|
|
32
|
+
const group = groups.find(g => g.member_ids.includes(anchor));
|
|
33
|
+
const index = nodes.findIndex(n => n.id === (group?.member_ids.at(-1) ?? anchor));
|
|
34
|
+
return index < 0 ? nodes.length : index + 1;
|
|
35
|
+
}
|
|
36
|
+
export interface GroupEdit {
|
|
37
|
+
action: 'create' | 'set' | 'ungroup' | 'copy' | 'move';
|
|
38
|
+
id?: string; member_ids?: string[]; primary_id?: string;
|
|
39
|
+
link_visibility?: boolean; shared_powerline?: boolean;
|
|
40
|
+
before?: string; after?: string;
|
|
41
|
+
}
|
|
42
|
+
export function editGroup(original: DisplayDraft, scope: Scope, edit: GroupEdit, nextId: () => string): DisplayDraft {
|
|
43
|
+
const display = JSON.parse(JSON.stringify(original)) as DisplayDraft, target = groupScope(display, scope);
|
|
44
|
+
const invalid = (): never => { throw new Error('composition.groups.invalid'); };
|
|
45
|
+
const fresh = () => { const value = nextId(); if (!id(value) || target.instances.some(n => n.id === value) || target.groups.some(g => g.id === value)) invalid(); return value; };
|
|
46
|
+
const group = target.groups.find(g => g.id === edit.id);
|
|
47
|
+
if (edit.action === 'create') {
|
|
48
|
+
target.groups.push({ id: edit.id ?? fresh(), member_ids: [...(edit.member_ids ?? [])], primary_id: edit.primary_id ?? '', link_visibility: edit.link_visibility ?? true, shared_powerline: edit.shared_powerline ?? false });
|
|
49
|
+
} else {
|
|
50
|
+
if (!group) invalid();
|
|
51
|
+
if (edit.action === 'ungroup') target.groups = target.groups.filter(g => g.id !== group!.id);
|
|
52
|
+
else if (edit.action === 'set') {
|
|
53
|
+
for (const key of ['primary_id', 'member_ids', 'link_visibility', 'shared_powerline'] as const)
|
|
54
|
+
if (edit[key] !== undefined) Object.assign(group!, { [key]: edit[key] });
|
|
55
|
+
} else if (edit.action === 'copy') {
|
|
56
|
+
const mapped = new Map<string, string>(), copies: InstanceDraft[] = [];
|
|
57
|
+
for (const member of group!.member_ids) {
|
|
58
|
+
const node = target.instances.find(n => n.id === member)!;
|
|
59
|
+
const copy: InstanceDraft = { ...JSON.parse(JSON.stringify(node)), id: fresh() };
|
|
60
|
+
if (copies.some(n => n.id === copy.id)) invalid();
|
|
61
|
+
mapped.set(member, copy.id); copies.push(copy);
|
|
62
|
+
}
|
|
63
|
+
const groupId = fresh();
|
|
64
|
+
if (copies.some(n => n.id === groupId)) invalid();
|
|
65
|
+
target.instances.splice(insertionAfter(target.instances, target.groups, group!.member_ids.at(-1)), 0, ...copies);
|
|
66
|
+
target.groups.push({ ...group!, id: groupId, primary_id: mapped.get(group!.primary_id)!, member_ids: copies.map(n => n.id) });
|
|
67
|
+
if (scope === 'main' && display.layout.mode === 'explicit') {
|
|
68
|
+
const row = display.layout.rows.find(row => row.includes(group!.primary_id))!;
|
|
69
|
+
row.splice(row.indexOf(group!.member_ids.at(-1)!) + 1, 0, ...copies.map(n => n.id));
|
|
70
|
+
}
|
|
71
|
+
} else if (edit.action === 'move') {
|
|
72
|
+
if ((edit.before === undefined) === (edit.after === undefined)) invalid();
|
|
73
|
+
const anchor = edit.before ?? edit.after!;
|
|
74
|
+
if (group!.member_ids.includes(anchor) || !target.instances.some(n => n.id === anchor)) invalid();
|
|
75
|
+
const moved = target.instances.filter(n => group!.member_ids.includes(n.id));
|
|
76
|
+
const left = target.instances.filter(n => !group!.member_ids.includes(n.id));
|
|
77
|
+
left.splice(left.findIndex(n => n.id === anchor) + Number(edit.after !== undefined), 0, ...moved);
|
|
78
|
+
target.instances = left;
|
|
79
|
+
if (scope === 'main' && display.layout.mode === 'explicit') {
|
|
80
|
+
display.layout.rows = display.layout.rows.map(row => row.filter(id => !group!.member_ids.includes(id))).filter(row => row.length);
|
|
81
|
+
const row = display.layout.rows.find(row => row.includes(anchor))!;
|
|
82
|
+
row.splice(row.indexOf(anchor) + Number(edit.after !== undefined), 0, ...group!.member_ids);
|
|
83
|
+
target.instances = display.layout.rows.flat().map(id => left.find(n => n.id === id)!);
|
|
84
|
+
}
|
|
85
|
+
} else invalid();
|
|
86
|
+
}
|
|
87
|
+
if (!validGroups(target.groups, target.instances, scope === 'main' ? display.layout : undefined)) invalid();
|
|
88
|
+
return display;
|
|
89
|
+
}
|
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
|
+
}
|
|
@@ -5,12 +5,13 @@ import { t, text, type Language, type LocalizedText } from '../i18n/index.ts';
|
|
|
5
5
|
import { inputKey, inputView, textInput, type TextInput, type TextKey } from './text-input.ts';
|
|
6
6
|
import { wrapText } from '../../ui/text.ts';
|
|
7
7
|
import { BackendError } from '../backend.ts';
|
|
8
|
-
type Action = 'edit' | 'review' | 'disable' | 'remove' | 'bind' | 'unbind' | 'refresh' | 'status' | 'cancel' | 'diagnose';
|
|
8
|
+
type Action = 'edit' | 'review' | 'disable' | 'remove' | 'bind' | 'unbind' | 'refresh' | 'status' | 'cancel' | 'diagnose' | 'auto-review' | 'auto-off';
|
|
9
9
|
export interface SourceManager {
|
|
10
10
|
library: SourcesResult | null;
|
|
11
11
|
context: SourceContext | null;
|
|
12
12
|
owner: string;
|
|
13
|
-
page: 'list' | 'actions' | 'kind' | 'form' | 'review' | 'remove' | 'bind' | 'unbind' | 'diagnose';
|
|
13
|
+
page: 'list' | 'actions' | 'kind' | 'form' | 'review' | 'remove' | 'bind' | 'unbind' | 'diagnose' | 'auto-review';
|
|
14
|
+
automaticInterval: number;
|
|
14
15
|
cursor: number;
|
|
15
16
|
scroll: number;
|
|
16
17
|
selected: string | null;
|
|
@@ -24,7 +25,7 @@ export interface SourceManager {
|
|
|
24
25
|
details: string[];
|
|
25
26
|
jobs: SourceJob[];
|
|
26
27
|
message: LocalizedText | null;
|
|
27
|
-
effect: 'load' | 'save' | 'review' | 'enable' | 'disable' | 'remove' | 'bind' | 'refresh' | 'status' | 'cancel' | 'diagnose' | 'close' | null;
|
|
28
|
+
effect: 'load' | 'save' | 'review' | 'enable' | 'disable' | 'remove' | 'bind' | 'refresh' | 'status' | 'cancel' | 'diagnose' | 'close' | 'auto-review' | 'auto-on' | 'auto-off' | null;
|
|
28
29
|
target: {
|
|
29
30
|
scope: Scope;
|
|
30
31
|
id: string;
|
|
@@ -35,10 +36,10 @@ export interface SourceBackend {
|
|
|
35
36
|
}
|
|
36
37
|
const external = ['external-value', 'github-pr', 'github-ci'];
|
|
37
38
|
export function openSources(editor: Editor): void {
|
|
38
|
-
editor.sources = { library: null, context: null, owner: 'editor-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2), page: 'list', cursor: 0, scroll: 0, selected: null, kind: 'json', editing: false, fields: [], review: null, details: [], jobs: [], message: null, effect: 'load', target: null };
|
|
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 };
|
|
39
40
|
}
|
|
40
41
|
function source(editor: Editor): SourceDefinition | undefined { return editor.sources!.library?.sources.find(s => s.id === editor.sources!.selected); }
|
|
41
|
-
function actions(editor: Editor): Action[] { return ['edit', 'review', ...(source(editor)?.enabled ? ['disable' as const] : []), 'bind', 'refresh', 'status', 'cancel', 'diagnose', 'remove', 'unbind']; }
|
|
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] : [])]; }
|
|
42
43
|
function targets(editor: Editor) {
|
|
43
44
|
const s = source(editor);
|
|
44
45
|
return (['main', 'subagent'] as const).flatMap(scope => (scope === 'main' ? editor.draft.display.instances : editor.draft.display.subagents.instances)
|
|
@@ -99,10 +100,11 @@ export function sourcesKey(editor: Editor, event: TextKey): 'sources' | null {
|
|
|
99
100
|
}
|
|
100
101
|
if (!plain)
|
|
101
102
|
return null;
|
|
102
|
-
if (['review', 'diagnose'].includes(m.page) && ['up', 'down', 'pageup', 'pagedown', 'home'].includes(key)) {
|
|
103
|
+
if (['review', 'diagnose', 'auto-review'].includes(m.page) && ['up', 'down', 'pageup', 'pagedown', 'home'].includes(key)) {
|
|
103
104
|
m.scroll = key === 'home' ? 0 : Math.max(0, m.scroll + (key === 'up' ? -1 : key === 'pageup' ? -8 : key === 'pagedown' ? 8 : 1));
|
|
104
105
|
return null;
|
|
105
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; }
|
|
106
108
|
if (key === 'up' || key === 'down')
|
|
107
109
|
m.cursor = Math.max(0, Math.min(count(editor) - 1, m.cursor + (key === 'up' ? -1 : 1)));
|
|
108
110
|
if (key === 'r' && m.page === 'list')
|
|
@@ -131,8 +133,8 @@ export function sourcesKey(editor: Editor, event: TextKey): 'sources' | null {
|
|
|
131
133
|
else
|
|
132
134
|
m.effect = action;
|
|
133
135
|
}
|
|
134
|
-
else if (m.page === 'review')
|
|
135
|
-
|
|
136
|
+
else if (m.page === 'review') m.effect = 'enable';
|
|
137
|
+
else if (m.page === 'auto-review') m.effect = 'auto-on';
|
|
136
138
|
else if (m.page === 'remove')
|
|
137
139
|
m.effect = 'remove';
|
|
138
140
|
else if (m.page === 'unbind') {
|
|
@@ -158,7 +160,7 @@ export async function closeSources(editor: Editor, backend: SourceBackend): Prom
|
|
|
158
160
|
if (!m)
|
|
159
161
|
return;
|
|
160
162
|
let failed: unknown;
|
|
161
|
-
for (const job of m.jobs.filter(job => job.state === 'running')) {
|
|
163
|
+
for (const job of m.jobs.filter(job => job.state === 'running' && job.owner === m.owner && job.trigger === 'manual')) {
|
|
162
164
|
try { await backend.request('source_cancel', { id: job.id }); }
|
|
163
165
|
catch (error) { failed = error; }
|
|
164
166
|
}
|
|
@@ -183,9 +185,10 @@ export async function performSourceAction(editor: Editor, backend: SourceBackend
|
|
|
183
185
|
m.context = await backend.request('source_context', { project: target?.project_root ?? (target?.target.kind === 'project' ? target.target.path : null), session: null, agent: null });
|
|
184
186
|
return;
|
|
185
187
|
}
|
|
186
|
-
if (effect === 'review') {
|
|
188
|
+
if (effect === 'review' || effect === 'auto-review') {
|
|
187
189
|
m.review = await backend.request('source_review', { id: m.selected });
|
|
188
|
-
m.page =
|
|
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));
|
|
189
192
|
m.scroll = 0;
|
|
190
193
|
return;
|
|
191
194
|
}
|
|
@@ -195,7 +198,7 @@ export async function performSourceAction(editor: Editor, backend: SourceBackend
|
|
|
195
198
|
const observed = await backend.request('source_diagnose', { id: m.selected, context });
|
|
196
199
|
const jobs = await Promise.all(observed.jobs.map(job => backend.request(effect === 'cancel' && job.state === 'running' ? 'source_cancel' : 'source_status', { id: job.id })));
|
|
197
200
|
m.jobs = m.jobs.map(job => jobs.find(updated => updated.id === job.id) ?? job);
|
|
198
|
-
m.details = jobs.map(job => `${job.id}: ${job.state} (${job.reason})`);
|
|
201
|
+
m.details = [JSON.stringify(observed.automatic, null, 2), ...jobs.map(job => `${job.id}: ${job.state} (${job.reason})`)];
|
|
199
202
|
m.page = 'diagnose';
|
|
200
203
|
m.scroll = 0;
|
|
201
204
|
return;
|
|
@@ -230,8 +233,8 @@ export async function performSourceAction(editor: Editor, backend: SourceBackend
|
|
|
230
233
|
parsed.pr = parsed.pr === '' ? null : Number(parsed.pr);
|
|
231
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 } });
|
|
232
235
|
}
|
|
233
|
-
if (effect === 'enable')
|
|
234
|
-
|
|
236
|
+
if (effect === 'enable' || effect === 'auto-on') payload.review_revision = m.review?.review_revision;
|
|
237
|
+
if (effect === 'auto-on') payload.interval_seconds = m.automaticInterval;
|
|
235
238
|
const result = await backend.request('sources_apply', payload);
|
|
236
239
|
m.library = result;
|
|
237
240
|
if (effect === 'bind' && m.target && result.binding) {
|
|
@@ -241,7 +244,7 @@ export async function performSourceAction(editor: Editor, backend: SourceBackend
|
|
|
241
244
|
m.message = text('sources.bound');
|
|
242
245
|
}
|
|
243
246
|
else
|
|
244
|
-
m.message = text('sources.saved');
|
|
247
|
+
m.message = text(effect === 'auto-on' ? 'sources.automatic_saved' : 'sources.saved');
|
|
245
248
|
m.page = 'list';
|
|
246
249
|
m.cursor = 0;
|
|
247
250
|
m.scroll = 0;
|
|
@@ -264,7 +267,7 @@ export function sourcesView(editor: Editor, language: Language, width: number, h
|
|
|
264
267
|
if (m.message)
|
|
265
268
|
add(t(m.message.key, language, m.message.params));
|
|
266
269
|
if (m.page === 'list') {
|
|
267
|
-
m.library?.sources.forEach((s, i) => add(`${s.name} · ${s.kind} · ${tr(s.enabled ? 'enabled' : 'disabled')}`, m.cursor === i));
|
|
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));
|
|
268
271
|
add('+ ' + tr('add'), m.cursor === (m.library?.sources.length ?? 0));
|
|
269
272
|
}
|
|
270
273
|
else if (m.page === 'actions')
|
|
@@ -288,7 +291,7 @@ export function sourcesView(editor: Editor, language: Language, width: number, h
|
|
|
288
291
|
else if (m.page === 'remove')
|
|
289
292
|
add(tr('remove_confirm') + ' ' + source(editor)?.name, true);
|
|
290
293
|
else {
|
|
291
|
-
const lines = m.page === 'review' ? [tr('
|
|
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;
|
|
292
295
|
const wrapped = lines.flatMap(line => wrapText([line], width));
|
|
293
296
|
const capacity = Math.max(1, height - rows.length);
|
|
294
297
|
const start = Math.min(m.scroll, Math.max(0, wrapped.length - capacity));
|
|
@@ -19,7 +19,7 @@ function definition(v: unknown): boolean {
|
|
|
19
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
20
|
}
|
|
21
21
|
function job(v: unknown): boolean {
|
|
22
|
-
return fields(v, ['version', 'id', 'source_id', 'source_revision', 'owner', 'context', 'started_at', 'deadline_at', 'state', 'reason']) && v.version ===
|
|
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
23
|
}
|
|
24
24
|
function view(v: unknown): boolean {
|
|
25
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));
|
|
@@ -34,11 +34,12 @@ export function isSourceResult(operation: string, value: unknown): boolean {
|
|
|
34
34
|
if (['source_refresh', 'source_status', 'source_cancel'].includes(operation))
|
|
35
35
|
return job(value);
|
|
36
36
|
if (operation === 'source_diagnose')
|
|
37
|
-
return fields(value, ['source', 'view', 'jobs']) && 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', 'revision', ...(operation === 'sources_apply' ? ['backup_dir', ...(Object.hasOwn(value, 'binding') ? ['binding'] : [])] : [])]))
|
|
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
39
|
return false;
|
|
40
|
-
if (value.version !==
|
|
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
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;
|
|
42
43
|
if (!value.bindings.every(b => fields(b, ['id', 'source_id']) && id(b.id) && id(b.source_id)))
|
|
43
44
|
return false;
|
|
44
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));
|
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,7 +486,7 @@ 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" | "external-value" | "github-pr" | "github-ci";
|
|
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
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";
|
|
@@ -498,7 +498,7 @@ 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", "external-value", "github-pr", "github-ci"] 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
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;
|
|
@@ -535,6 +535,7 @@ export interface CatalogItem {
|
|
|
535
535
|
capabilities?: ItemCapability;
|
|
536
536
|
}
|
|
537
537
|
export interface ItemCapability {
|
|
538
|
+
indicator?: boolean;
|
|
538
539
|
formats: string[];
|
|
539
540
|
visibility: string[];
|
|
540
541
|
link: boolean;
|
|
@@ -600,6 +601,10 @@ export interface FormattingDraft {
|
|
|
600
601
|
thresholds: ThresholdDraft;
|
|
601
602
|
}
|
|
602
603
|
export interface ItemOptionsDraft {
|
|
604
|
+
presentation?: "numeric" | "bar";
|
|
605
|
+
bar_width?: number;
|
|
606
|
+
cost_rate_basis?: 'session' | 'api';
|
|
607
|
+
bar_style?: "auto" | "unicode" | "ascii";
|
|
603
608
|
link?: 'off' | 'auto' | 'on';
|
|
604
609
|
label: string | null;
|
|
605
610
|
icon: string | null;
|
|
@@ -619,11 +624,15 @@ export interface InstanceDraft {
|
|
|
619
624
|
options: ItemOptionsDraft;
|
|
620
625
|
text: string | null;
|
|
621
626
|
}
|
|
627
|
+
export interface GroupDraft {
|
|
628
|
+
id: string; member_ids: string[]; primary_id: string; link_visibility: boolean; shared_powerline: boolean;
|
|
629
|
+
}
|
|
622
630
|
export interface LayoutDraft {
|
|
623
631
|
mode: "auto" | "explicit";
|
|
624
632
|
rows: string[][];
|
|
625
633
|
}
|
|
626
634
|
export interface SubagentDraft {
|
|
635
|
+
groups: GroupDraft[];
|
|
627
636
|
enabled: boolean;
|
|
628
637
|
instances: InstanceDraft[];
|
|
629
638
|
visibility: "all" | "running";
|
|
@@ -642,7 +651,8 @@ export interface PowerlineDraft {
|
|
|
642
651
|
color_mode: "semantic" | "continuous" | "restart";
|
|
643
652
|
}
|
|
644
653
|
export interface DisplayDraft {
|
|
645
|
-
|
|
654
|
+
groups: GroupDraft[];
|
|
655
|
+
schema_version: 13;
|
|
646
656
|
statusline_language: StatuslineLanguage;
|
|
647
657
|
instances: InstanceDraft[];
|
|
648
658
|
use_colors: boolean;
|
|
@@ -706,7 +716,9 @@ export interface SourceDefinition {
|
|
|
706
716
|
ttl_seconds: number; settings: SourceSettings; enabled: boolean; revision: string;
|
|
707
717
|
}
|
|
708
718
|
export interface SourceBinding { id: string; source_id: string }
|
|
709
|
-
export interface
|
|
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[] }
|
|
710
722
|
export interface SourcesResult extends SourceRegistry { revision: string }
|
|
711
723
|
export type SourceState = 'valid' | 'missing' | 'partial' | 'error' | 'unsupported';
|
|
712
724
|
export interface SourceObservation {
|
|
@@ -723,7 +735,7 @@ export interface SourceView {
|
|
|
723
735
|
fields?: Record<string, string | number | boolean | null>;
|
|
724
736
|
}
|
|
725
737
|
export interface SourceJob {
|
|
726
|
-
version:
|
|
738
|
+
version: 2; id: string; source_id: string; source_revision: string; owner: string; trigger: 'manual' | 'automatic'; identity: string;
|
|
727
739
|
context: SourceContext; started_at: string; deadline_at: string;
|
|
728
740
|
state: 'running' | 'completed' | 'failed' | 'cancelled'; reason: string;
|
|
729
741
|
}
|
|
@@ -734,9 +746,9 @@ export interface PreviewResult {
|
|
|
734
746
|
main: Span[][];
|
|
735
747
|
subagents: Span[][];
|
|
736
748
|
}
|
|
737
|
-
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;
|
|
738
750
|
export type SampleReason = typeof SAMPLE_REASONS[number];
|
|
739
|
-
export const EXPLAIN_REASONS = ['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;
|
|
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;
|
|
740
752
|
export interface ExplainReason { code: string; origin: 'configuration' | 'local_configuration' | 'host_capability' | 'unknown'; }
|
|
741
753
|
export interface InstanceSample { row_id: string; outcome: SampleReason; truncated: boolean; }
|
|
742
754
|
export interface ExplainInstance {
|
|
@@ -752,7 +764,7 @@ export interface ExplainResult {
|
|
|
752
764
|
preview: PreviewResult;
|
|
753
765
|
instances: ExplainInstance[];
|
|
754
766
|
}
|
|
755
|
-
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;
|
|
756
768
|
export type LayoutReason = typeof LAYOUT_REASONS[number];
|
|
757
769
|
export interface InstanceLayout { row_id: string; outcome: LayoutReason; truncated: boolean; }
|
|
758
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;
|
|
@@ -924,7 +936,7 @@ export interface ResultMap {
|
|
|
924
936
|
source_refresh: SourceJob;
|
|
925
937
|
source_status: SourceJob;
|
|
926
938
|
source_cancel: SourceJob;
|
|
927
|
-
source_diagnose: { source: SourceDefinition; view: SourceView; jobs: SourceJob[] };
|
|
939
|
+
source_diagnose: { source: SourceDefinition; view: SourceView; jobs: SourceJob[]; automatic: AutomaticStatus };
|
|
928
940
|
describe: DescribeResult;
|
|
929
941
|
read: ReadResult;
|
|
930
942
|
preview: PreviewResult;
|