@fbincon/claude-code-statusline 0.0.0-stage → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LICENSE-Unicode.txt +39 -0
- package/LICENSE-Wcwidth.txt +27 -0
- package/README.md +90 -2
- package/bin/claude-statusline.js +2 -0
- package/candidate.json +1238 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.d.ts +35 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js +228 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js +72 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +140 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js +101 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js +96 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js +80 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.d.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js +99 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.d.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js +134 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +89 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.js +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.js +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js +67 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js +63 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js +153 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.d.ts +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +142 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js +91 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js +109 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.d.ts +60 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js +12 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js +234 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js +41 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.d.ts +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js +92 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.d.ts +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js +91 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js +94 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.d.ts +22 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js +197 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.d.ts +7 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js +134 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.d.ts +58 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +144 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js +125 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js +55 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +95 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js +48 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.d.ts +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js +162 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.d.ts +37 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.d.ts +9 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js +241 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.d.ts +16 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js +90 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.d.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js +80 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js +59 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js +70 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.d.ts +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.d.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js +227 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +144 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/package.json +17 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-config/SKILL.md +80 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-configure/SKILL.md +19 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +37 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/hooks.json +6 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +820 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +503 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/forms.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +198 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/messages.ts +101 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +218 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +29 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +254 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +167 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/guidance.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/import-review.ts +55 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/instances.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/navigation.ts +98 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/numeric.ts +42 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/search.ts +114 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +276 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-unicode.ts +92 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +6842 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/index.ts +40 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/messages.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/presentation.ts +62 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/launch.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preferences.ts +61 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preview-preferences.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +124 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/unicode.ts +121 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +47 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +159 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +84 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/surface.ts +89 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/catalog.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/preview.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/section.ts +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/shortcuts.ts +83 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/layout.ts +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/styled-text.ts +56 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/text.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/theme.ts +27 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/hooks.json +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/observe.ts +279 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/checklists.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/costs.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/generated-contracts.ts +18 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/identity.ts +14 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/launch.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/queue.ts +68 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/streams.ts +28 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/timing.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.d.ts +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js +72 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +86 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +3462 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js +17 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +232 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js +48 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +104 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +99 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +80 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.d.ts +29 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +159 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +34 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.d.ts +15 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js +55 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +33 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +663 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +401 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +251 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +146 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js +17 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.d.ts +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js +53 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.d.ts +37 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js +122 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +6841 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +6841 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js +38 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js +31 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.js +137 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.js +56 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.js +165 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.js +47 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.d.ts +21 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js +105 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js +50 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js +49 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js +58 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js +34 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.d.ts +49 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +399 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.d.ts +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js +176 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js +29 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js +93 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js +46 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.d.ts +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js +76 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.d.ts +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +98 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.d.ts +67 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js +116 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +305 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js +33 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js +52 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js +115 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js +104 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.d.ts +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js +196 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js +45 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js +228 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js +145 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js +70 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js +110 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js +75 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js +121 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.d.ts +43 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js +198 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js +192 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js +245 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js +28 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js +183 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.d.ts +64 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js +263 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js +103 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js +50 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js +75 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.d.ts +12 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js +93 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js +178 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/package.json +8 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/languages.json +7 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-Hant.json +1367 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.d.ts +15 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js +22 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js +102 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.d.ts +16 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js +18 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.js +160 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.d.ts +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.js +19 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.d.ts +8 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js +164 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.js +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.js +14 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.js +21 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js +31 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.d.ts +15 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js +36 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.d.ts +17 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js +44 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js +48 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js +67 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.d.ts +42 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js +180 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.d.ts +11 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js +81 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.d.ts +32 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js +157 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.d.ts +18 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js +150 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.d.ts +6 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js +39 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.d.ts +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js +82 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/package.json +8 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.d.ts +16 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +213 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.d.ts +30 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.js +34 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.d.ts +28 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js +126 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +52 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +352 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/package.json +16 -0
- package/node_modules/@koromix/koffi-darwin-arm64/README.md +6 -0
- package/node_modules/@koromix/koffi-darwin-arm64/darwin_arm64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-arm64/index.js +1 -0
- package/node_modules/@koromix/koffi-darwin-arm64/package.json +24 -0
- package/node_modules/@koromix/koffi-darwin-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-darwin-x64/darwin_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-x64/index.js +1 -0
- package/node_modules/@koromix/koffi-darwin-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-linux-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-linux-x64/index.js +198 -0
- package/node_modules/@koromix/koffi-linux-x64/linux_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-linux-x64/musl_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-linux-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-win32-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-win32-x64/index.js +1 -0
- package/node_modules/@koromix/koffi-win32-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.lib +0 -0
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.node +0 -0
- package/node_modules/koffi/LICENSE.txt +22 -0
- package/node_modules/koffi/README.md +46 -0
- package/node_modules/koffi/index.cjs +1 -0
- package/node_modules/koffi/index.d.ts +390 -0
- package/node_modules/koffi/index.js +2 -0
- package/node_modules/koffi/indirect.cjs +1 -0
- package/node_modules/koffi/indirect.js +2 -0
- package/node_modules/koffi/package.json +73 -0
- package/node_modules/koffi/src/koffi/index.cjs +327 -0
- package/node_modules/koffi/src/koffi/index.js +312 -0
- package/node_modules/koffi/src/koffi/indirect.cjs +326 -0
- package/node_modules/koffi/src/koffi/indirect.js +311 -0
- package/node_modules/koffi/src/koffi/src/static.cjs +170 -0
- package/node_modules/koffi/src/koffi/src/static.js +173 -0
- package/node_modules/lossless-json/LICENSE.md +9 -0
- package/node_modules/lossless-json/README.md +549 -0
- package/node_modules/lossless-json/lib/esm/LosslessNumber.js +92 -0
- package/node_modules/lossless-json/lib/esm/LosslessNumber.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/config.js +9 -0
- package/node_modules/lossless-json/lib/esm/config.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/index.js +9 -0
- package/node_modules/lossless-json/lib/esm/index.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/numberParsers.js +9 -0
- package/node_modules/lossless-json/lib/esm/numberParsers.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/package.json +3 -0
- package/node_modules/lossless-json/lib/esm/parse.js +346 -0
- package/node_modules/lossless-json/lib/esm/parse.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/revive.js +57 -0
- package/node_modules/lossless-json/lib/esm/revive.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/reviveDate.js +10 -0
- package/node_modules/lossless-json/lib/esm/reviveDate.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/stringify.js +166 -0
- package/node_modules/lossless-json/lib/esm/stringify.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/types.js +2 -0
- package/node_modules/lossless-json/lib/esm/types.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/utils.js +236 -0
- package/node_modules/lossless-json/lib/esm/utils.js.map +1 -0
- package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts +40 -0
- package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/config.d.ts +13 -0
- package/node_modules/lossless-json/lib/types/config.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/index.d.ts +9 -0
- package/node_modules/lossless-json/lib/types/index.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/numberParsers.d.ts +4 -0
- package/node_modules/lossless-json/lib/types/numberParsers.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/parse.d.ts +33 -0
- package/node_modules/lossless-json/lib/types/parse.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/revive.d.ts +13 -0
- package/node_modules/lossless-json/lib/types/revive.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/reviveDate.d.ts +5 -0
- package/node_modules/lossless-json/lib/types/reviveDate.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/stringify.d.ts +37 -0
- package/node_modules/lossless-json/lib/types/stringify.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/types.d.ts +61 -0
- package/node_modules/lossless-json/lib/types/types.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/utils.d.ts +79 -0
- package/node_modules/lossless-json/lib/types/utils.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/umd/lossless-json.js +1 -0
- package/node_modules/lossless-json/lib/umd/lossless-json.js.map +1 -0
- package/node_modules/lossless-json/lib/umd/package.json +3 -0
- package/node_modules/lossless-json/package.json +89 -0
- package/package.json +57 -4
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { numeric, own, truth, dictionary, maxNumber, minNumber } from '../values.js';
|
|
2
|
+
import * as model from './model.js';
|
|
3
|
+
import { owner, pendingOwner, turnKey } from './ownership.js';
|
|
4
|
+
import { applyRequest, reconcileRequests } from './requests.js';
|
|
5
|
+
export function trimTable(values, maximum, stamp = 'updated_at_ms') {
|
|
6
|
+
const keys = Object.keys(values);
|
|
7
|
+
if (keys.length > maximum)
|
|
8
|
+
for (const key of keys.sort((a, b) => (numeric(values[a][stamp]) ?? 0) - (numeric(values[b][stamp]) ?? 0)).slice(0, -maximum))
|
|
9
|
+
delete values[key];
|
|
10
|
+
}
|
|
11
|
+
export function applyObservation(state, o, metadataOnly = false) {
|
|
12
|
+
const epoch = o.epoch, kind = o.kind, stamp = o.observed_at_ms;
|
|
13
|
+
if (!Object.hasOwn(state.epochs, epoch)) {
|
|
14
|
+
if (kind !== 'heartbeat')
|
|
15
|
+
return false;
|
|
16
|
+
const loaded = o.payload.loaded_at_ms;
|
|
17
|
+
if (state.loaded_at_ms !== null && numeric(loaded) <= numeric(state.loaded_at_ms))
|
|
18
|
+
return false;
|
|
19
|
+
state.epochs[epoch] = { seen: [], floor: -1, high: -1, updated_at_ms: loaded };
|
|
20
|
+
Object.assign(state, { epoch, loaded_at_ms: loaded, heartbeat_at_ms: null, invalidated: null, current_prompt_id: null, permission: null,
|
|
21
|
+
active_prompt_id: null, current_main_turn_id: null, agent_snapshot: null, checklists: dictionary(), prompt_aliases: dictionary(), prompt_links: dictionary() });
|
|
22
|
+
for (const prompt of Object.values(state.prompts))
|
|
23
|
+
if (!truth(prompt.terminal))
|
|
24
|
+
prompt.complete = false;
|
|
25
|
+
trimTable(state.epochs, model.MAX_EPOCHS);
|
|
26
|
+
}
|
|
27
|
+
const ledger = state.epochs[epoch], seq = numeric(o.seq);
|
|
28
|
+
if (seq <= numeric(ledger.floor) || ledger.seen.some(value => numeric(value) === seq))
|
|
29
|
+
return false;
|
|
30
|
+
const gap = seq > numeric(ledger.high) + 1;
|
|
31
|
+
ledger.seen.push(o.seq);
|
|
32
|
+
ledger.seen.sort((a, b) => numeric(a) - numeric(b));
|
|
33
|
+
ledger.high = maxNumber(o.seq, ledger.high);
|
|
34
|
+
if (ledger.seen.length > model.MAX_SEEN) {
|
|
35
|
+
ledger.floor = ledger.seen[ledger.seen.length - model.MAX_SEEN - 1];
|
|
36
|
+
ledger.seen = ledger.seen.slice(-model.MAX_SEEN);
|
|
37
|
+
}
|
|
38
|
+
const current = epoch === state.epoch;
|
|
39
|
+
if (metadataOnly)
|
|
40
|
+
return true;
|
|
41
|
+
if (kind === 'heartbeat') {
|
|
42
|
+
if (current && (state.heartbeat_at_ms === null || numeric(stamp) >= numeric(state.heartbeat_at_ms))) {
|
|
43
|
+
state.heartbeat_at_ms = stamp;
|
|
44
|
+
state.host_version = o.payload.host_version;
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
if (kind === 'invalidate') {
|
|
49
|
+
if (current)
|
|
50
|
+
state.invalidated = o.payload.reason;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
const promptId = o.prompt_id;
|
|
54
|
+
if (kind === 'prompt') {
|
|
55
|
+
if (!current)
|
|
56
|
+
return true;
|
|
57
|
+
const previous = own(state.prompts, state.current_prompt_id);
|
|
58
|
+
if (previous && numeric(previous.updated_at_ms) > numeric(stamp))
|
|
59
|
+
return true;
|
|
60
|
+
if (!Object.hasOwn(state.prompts, promptId))
|
|
61
|
+
state.prompts[promptId] = { updated_at_ms: stamp, started_at_ms: stamp, epoch, source: o.source, complete: !gap, terminal: false };
|
|
62
|
+
state.current_prompt_id = promptId;
|
|
63
|
+
trimTable(state.prompts, model.MAX_PROMPTS);
|
|
64
|
+
}
|
|
65
|
+
else if (kind === 'permission') {
|
|
66
|
+
const previous = state.permission;
|
|
67
|
+
if (current && o.agent_id === null && (previous === null || numeric(stamp) >= numeric(previous.observed_at_ms)))
|
|
68
|
+
state.permission = { ...o.payload, observed_at_ms: stamp, source: o.source };
|
|
69
|
+
}
|
|
70
|
+
else if (kind === 'prompt_link') {
|
|
71
|
+
const target = o.payload.message_id;
|
|
72
|
+
if (current) {
|
|
73
|
+
state.prompt_links[promptId] = target;
|
|
74
|
+
while (Object.keys(state.prompt_links).length > model.MAX_AGENTS)
|
|
75
|
+
delete state.prompt_links[Object.keys(state.prompt_links)[0]];
|
|
76
|
+
state.prompt_aliases[promptId] = target;
|
|
77
|
+
if (!Object.hasOwn(state.prompts, target) && !Object.hasOwn(state.prompts, promptId)) {
|
|
78
|
+
state.prompts[target] = { epoch, started_at_ms: stamp, updated_at_ms: stamp, complete: !gap, terminal: false, source: 'otel' };
|
|
79
|
+
state.current_prompt_id = target;
|
|
80
|
+
trimTable(state.prompts, model.MAX_PROMPTS);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else if (kind === 'prompt_alias') {
|
|
85
|
+
const agent = own(state.agents, o.payload.agent_id), fresh = !Object.hasOwn(state.prompt_aliases, promptId);
|
|
86
|
+
if (current && !Object.hasOwn(state.prompts, promptId)) {
|
|
87
|
+
state.prompt_aliases[promptId] = agent && agent.epoch === epoch ? agent.prompt_id : { agent_id: o.payload.agent_id, epoch };
|
|
88
|
+
while (Object.keys(state.prompt_aliases).length > model.MAX_AGENTS)
|
|
89
|
+
delete state.prompt_aliases[Object.keys(state.prompt_aliases)[0]];
|
|
90
|
+
}
|
|
91
|
+
if (current && fresh && o.source === 'classic_hook' && o.agent_id === null && agent && agent.ended_at_ms !== null) {
|
|
92
|
+
const target = agent.prompt_id, prompt = own(state.prompts, target);
|
|
93
|
+
if (prompt) {
|
|
94
|
+
prompt.terminal = false;
|
|
95
|
+
state.active_prompt_id = target;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else if (['wait_start', 'wait_end', 'wait_unknown'].includes(kind)) {
|
|
100
|
+
state.wait_events[epoch + ':' + seq] = { ...o };
|
|
101
|
+
trimTable(state.wait_events, model.MAX_SEEN, 'observed_at_ms');
|
|
102
|
+
}
|
|
103
|
+
else if (kind === 'turn_start' || kind === 'turn_end') {
|
|
104
|
+
if (!current)
|
|
105
|
+
return true;
|
|
106
|
+
const key = turnKey(epoch, o.turn_id, o.agent_id);
|
|
107
|
+
let turn = own(state.turns, key);
|
|
108
|
+
if (!turn) {
|
|
109
|
+
let target = owner(state, o);
|
|
110
|
+
if (target === null && o.agent_id === null)
|
|
111
|
+
target = pendingOwner(state, epoch);
|
|
112
|
+
turn = { prompt_id: target, agent_id: o.agent_id, started_at_ms: stamp, ended_at_ms: null, status: 'running', updated_at_ms: stamp, epoch };
|
|
113
|
+
state.turns[key] = turn;
|
|
114
|
+
if (current && o.agent_id === null) {
|
|
115
|
+
state.current_main_turn_id = key;
|
|
116
|
+
state.active_prompt_id = target;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (kind === 'turn_end' && turn.ended_at_ms === null && numeric(stamp) >= numeric(turn.started_at_ms)) {
|
|
120
|
+
Object.assign(turn, { ended_at_ms: stamp, status: o.payload.status, updated_at_ms: stamp });
|
|
121
|
+
if (Object.hasOwn(o.payload, 'duration_ms')) {
|
|
122
|
+
turn.duration_ms = o.payload.duration_ms;
|
|
123
|
+
turn.wait_coverage = o.payload.wait_coverage;
|
|
124
|
+
}
|
|
125
|
+
const prompt = own(state.prompts, turn.prompt_id);
|
|
126
|
+
if (prompt && o.agent_id === null)
|
|
127
|
+
prompt.terminal = !Object.values(state.agents).some(agent => agent.prompt_id === turn.prompt_id && agent.ended_at_ms === null);
|
|
128
|
+
}
|
|
129
|
+
trimTable(state.turns, model.MAX_TURNS);
|
|
130
|
+
}
|
|
131
|
+
else if (kind === 'agents') {
|
|
132
|
+
const previous = state.agent_snapshot;
|
|
133
|
+
if (current && (previous === null || numeric(stamp) >= numeric(previous.observed_at_ms)))
|
|
134
|
+
state.agent_snapshot = { agents: o.payload.agents, observed_at_ms: stamp };
|
|
135
|
+
}
|
|
136
|
+
else if (kind === 'tool_start' || kind === 'tool_end') {
|
|
137
|
+
const target = owner(state, o), key = epoch + ':' + o.request_id;
|
|
138
|
+
let record = own(state.tools, key);
|
|
139
|
+
if (!record) {
|
|
140
|
+
record = { prompt_id: target, agent_id: o.agent_id, name: o.payload.name, started_at_ms: stamp, updated_at_ms: stamp, status: 'started', turn_key: o.turn_id ? turnKey(epoch, o.turn_id, o.agent_id) : null };
|
|
141
|
+
state.tools[key] = record;
|
|
142
|
+
}
|
|
143
|
+
if (record.prompt_id === null)
|
|
144
|
+
record.prompt_id = target;
|
|
145
|
+
if (target === null || record.prompt_id === target) {
|
|
146
|
+
if (kind === 'tool_start')
|
|
147
|
+
record.started_at_ms = minNumber(record.started_at_ms, stamp);
|
|
148
|
+
else {
|
|
149
|
+
const ranks = ['started', 'success', 'error', 'denied', 'interrupted'];
|
|
150
|
+
if (ranks.indexOf(o.payload.status) > ranks.indexOf(record.status))
|
|
151
|
+
record.status = o.payload.status;
|
|
152
|
+
}
|
|
153
|
+
record.updated_at_ms = maxNumber(stamp, record.updated_at_ms);
|
|
154
|
+
trimTable(state.tools, model.MAX_TOOLS);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else if (kind === 'task_snapshot' || kind === 'task_update') {
|
|
158
|
+
const target = owner(state, o);
|
|
159
|
+
if (current && (target || o.turn_id) && o.agent_id === null) {
|
|
160
|
+
const provider = (target || turnKey(epoch, o.turn_id)) + ':' + o.payload.provider;
|
|
161
|
+
let previous = own(state.checklists, provider);
|
|
162
|
+
if (!previous) {
|
|
163
|
+
previous = { prompt_id: target, turn_key: o.turn_id ? turnKey(epoch, o.turn_id) : null, tasks: dictionary(), complete: false, updated_at_ms: 0 };
|
|
164
|
+
state.checklists[provider] = previous;
|
|
165
|
+
}
|
|
166
|
+
if (numeric(stamp) >= numeric(previous.updated_at_ms)) {
|
|
167
|
+
if (kind === 'task_snapshot') {
|
|
168
|
+
previous.tasks = dictionary(o.payload.tasks.filter(row => row.status !== 'deleted').map(row => [row.id, row.status]));
|
|
169
|
+
previous.complete = true;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
const tasks = previous.tasks, task = o.payload.id, status = o.payload.status;
|
|
173
|
+
if (status === 'deleted')
|
|
174
|
+
delete tasks[task];
|
|
175
|
+
else {
|
|
176
|
+
if (!Object.hasOwn(tasks, task))
|
|
177
|
+
previous.complete = false;
|
|
178
|
+
if (Object.keys(tasks).length < model.MAX_TASKS || Object.hasOwn(tasks, task))
|
|
179
|
+
tasks[task] = status;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
previous.updated_at_ms = stamp;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else if (kind === 'agent_start' || kind === 'agent_end') {
|
|
187
|
+
const agentId = o.agent_id, target = owner(state, o, kind === 'agent_start' && o.source === 'native');
|
|
188
|
+
let record = own(state.agents, agentId);
|
|
189
|
+
if (!record) {
|
|
190
|
+
record = { prompt_id: target, epoch, started_at_ms: null, ended_at_ms: null, status: null, updated_at_ms: stamp, parent_agent_id: o.parent_agent_id, parent_turn_key: o.turn_id && o.source === 'native' ? turnKey(epoch, o.turn_id, o.parent_agent_id) : null };
|
|
191
|
+
state.agents[agentId] = record;
|
|
192
|
+
}
|
|
193
|
+
if (target !== null && record.prompt_id !== target) {
|
|
194
|
+
if (kind === 'agent_start' && o.source === 'native' && target)
|
|
195
|
+
record.prompt_id = target;
|
|
196
|
+
else
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
if (record.epoch !== epoch)
|
|
200
|
+
return true;
|
|
201
|
+
if (kind === 'agent_start' && o.source === 'native') {
|
|
202
|
+
record.parent_agent_id = o.parent_agent_id;
|
|
203
|
+
record.parent_turn_key = o.turn_id ? turnKey(epoch, o.turn_id, o.parent_agent_id) : null;
|
|
204
|
+
for (const turn of Object.values(state.turns))
|
|
205
|
+
if (turn.agent_id === agentId && turn.prompt_id === null)
|
|
206
|
+
turn.prompt_id = target;
|
|
207
|
+
reconcileRequests(state, agentId, target);
|
|
208
|
+
}
|
|
209
|
+
const field = kind === 'agent_start' ? 'started_at_ms' : 'ended_at_ms', observed = o.payload[field];
|
|
210
|
+
if (record[field] === null || numeric(observed) < numeric(record[field]))
|
|
211
|
+
record[field] = observed;
|
|
212
|
+
if (kind === 'agent_end') {
|
|
213
|
+
const rank = [null, 'completed', 'failed', 'killed', 'interrupted'];
|
|
214
|
+
if (rank.indexOf(o.payload.status) > rank.indexOf(record.status))
|
|
215
|
+
record.status = o.payload.status;
|
|
216
|
+
}
|
|
217
|
+
record.updated_at_ms = maxNumber(stamp, record.updated_at_ms);
|
|
218
|
+
trimTable(state.agents, model.MAX_AGENTS);
|
|
219
|
+
}
|
|
220
|
+
else if (['request_start', 'request_first', 'request_end', 'request_cost', 'turn_usage'].includes(kind))
|
|
221
|
+
applyRequest(state, o);
|
|
222
|
+
if (gap && current)
|
|
223
|
+
for (const prompt of Object.values(state.prompts))
|
|
224
|
+
if (!truth(prompt.terminal))
|
|
225
|
+
prompt.complete = false;
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=reducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../../src/runtime/live/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAChG,OAAO,KA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CAAC;YAC7C,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;gBACvB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;IACpC,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LosslessNumber } from '../../json.js';
|
|
2
|
+
import { type Observation } from './model.js';
|
|
3
|
+
import type { LiveState } from './state.js';
|
|
4
|
+
export declare const ITEMS: readonly ["ttft", "output-rate", "prompt-input-tokens", "prompt-output-tokens", "prompt-cost"];
|
|
5
|
+
export declare function key(o: Observation): string;
|
|
6
|
+
export declare function applyRequest(state: LiveState, o: Observation): void;
|
|
7
|
+
export declare function reconcileRequests(state: LiveState, agentId: unknown, promptId: unknown): void;
|
|
8
|
+
export declare function reconcileCosts(state: LiveState): void;
|
|
9
|
+
export interface PointOptions {
|
|
10
|
+
source?: string | null;
|
|
11
|
+
at?: unknown;
|
|
12
|
+
partial?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface Point {
|
|
15
|
+
value: unknown;
|
|
16
|
+
reason: string | null;
|
|
17
|
+
source: string | null;
|
|
18
|
+
observed_at_ms: unknown;
|
|
19
|
+
partial: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function point(value?: unknown, reason?: string | null, options?: PointOptions): Point;
|
|
22
|
+
/** Preserve integer sums; finite floats use compensated summation. */
|
|
23
|
+
export declare function sumNumbers(values: readonly unknown[]): bigint | LosslessNumber;
|
|
24
|
+
export declare function requestMetrics(state: LiveState, selected: string | null, live: boolean, terminal: boolean): Record<string, Point>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { equalSettings } from '../../json-equality.js';
|
|
2
|
+
import { LosslessNumber, pythonFloat } from '../../json.js';
|
|
3
|
+
import { divideIntegers } from '../../numbers.js';
|
|
4
|
+
import { int, numeric, object, own, maxNumber, truth } from '../values.js';
|
|
5
|
+
import { float } from '../transcript.js';
|
|
6
|
+
import { MAX_REQUESTS, USAGE_KEYS } from './model.js';
|
|
7
|
+
import { owner, canonicalPrompt, turnKey } from './ownership.js';
|
|
8
|
+
export const ITEMS = ['ttft', 'output-rate', 'prompt-input-tokens', 'prompt-output-tokens', 'prompt-cost'];
|
|
9
|
+
export function key(o) { return o.epoch + ':' + o.request_id; }
|
|
10
|
+
function bounded(state, rows) {
|
|
11
|
+
while (Object.keys(rows).length > MAX_REQUESTS) {
|
|
12
|
+
const oldest = Object.keys(rows).reduce((a, b) => numeric(rows[b].updated_at_ms) < numeric(rows[a].updated_at_ms) ? b : a);
|
|
13
|
+
const old = rows[oldest];
|
|
14
|
+
delete rows[oldest];
|
|
15
|
+
const prompt = typeof old.prompt_id === 'string' ? own(state.prompts, old.prompt_id) : undefined;
|
|
16
|
+
if (prompt)
|
|
17
|
+
prompt.complete = false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function applyRequest(state, o) {
|
|
21
|
+
const stamp = o.observed_at_ms, kind = o.kind, target = owner(state, o);
|
|
22
|
+
if (kind === 'turn_usage') {
|
|
23
|
+
const turn = own(state.turns, turnKey(o.epoch, o.turn_id, o.agent_id));
|
|
24
|
+
if (turn)
|
|
25
|
+
turn.usage = o.payload.usage;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (kind === 'request_cost') {
|
|
29
|
+
if (target !== null && !Object.values(state.turns).some(turn => turn.prompt_id === target))
|
|
30
|
+
return;
|
|
31
|
+
const previous = own(state.costs, o.request_id);
|
|
32
|
+
const value = { prompt_id: target, owner_alias: o.prompt_id, cost_usd: o.payload.cost_usd, usage: o.payload.usage, updated_at_ms: stamp, request_key: o.turn_id ? key(o) : null, conflict: false };
|
|
33
|
+
if (!previous)
|
|
34
|
+
state.costs[o.request_id] = value;
|
|
35
|
+
else if (['cost_usd', 'usage'].some(k => !equalSettings(previous[k], value[k])) || previous.owner_alias !== value.owner_alias && previous.prompt_id !== target)
|
|
36
|
+
previous.conflict = true;
|
|
37
|
+
bounded(state, state.costs);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let request = own(state.requests, key(o));
|
|
41
|
+
if (!request) {
|
|
42
|
+
request = { prompt_id: target, agent_id: o.agent_id, turn_key: turnKey(o.epoch, o.turn_id, o.agent_id), epoch: o.epoch, started_at_ms: null, first_at_ms: null, ended_at_ms: null, usage: null, native: false, status: null, conflict: false, updated_at_ms: stamp };
|
|
43
|
+
state.requests[key(o)] = request;
|
|
44
|
+
}
|
|
45
|
+
if (request.prompt_id === null)
|
|
46
|
+
request.prompt_id = target;
|
|
47
|
+
if (target !== null && request.prompt_id !== target) {
|
|
48
|
+
request.conflict = true;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const field = kind === 'request_start' ? 'started_at_ms' : kind === 'request_first' ? 'first_at_ms' : 'ended_at_ms';
|
|
52
|
+
if (request[field] === null)
|
|
53
|
+
request[field] = stamp;
|
|
54
|
+
if (kind === 'request_end') {
|
|
55
|
+
if (request.status === null)
|
|
56
|
+
Object.assign(request, o.payload);
|
|
57
|
+
else if (['usage', 'native', 'status'].some(k => !equalSettings(request[k], o.payload[k])))
|
|
58
|
+
request.conflict = true;
|
|
59
|
+
}
|
|
60
|
+
request.updated_at_ms = maxNumber(stamp, request.updated_at_ms);
|
|
61
|
+
bounded(state, state.requests);
|
|
62
|
+
}
|
|
63
|
+
export function reconcileRequests(state, agentId, promptId) {
|
|
64
|
+
for (const request of Object.values(state.requests))
|
|
65
|
+
if (request.agent_id === agentId && request.epoch === state.epoch && request.prompt_id === null)
|
|
66
|
+
request.prompt_id = promptId;
|
|
67
|
+
}
|
|
68
|
+
export function reconcileCosts(state) {
|
|
69
|
+
for (const row of Object.values(state.costs))
|
|
70
|
+
if (row.prompt_id === null) {
|
|
71
|
+
const target = canonicalPrompt(state, row.owner_alias);
|
|
72
|
+
if (target && Object.values(state.turns).some(turn => turn.prompt_id === target && numeric(turn.started_at_ms) <= numeric(row.updated_at_ms)))
|
|
73
|
+
row.prompt_id = target;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export function point(value = null, reason = null, options = {}) {
|
|
77
|
+
return { value, reason, source: options.source ?? null, observed_at_ms: options.at ?? null, partial: options.partial ?? false };
|
|
78
|
+
}
|
|
79
|
+
function latest(rows, field) { return rows.reduce((best, row) => numeric(row[field]) > numeric(best[field]) ? row : best); }
|
|
80
|
+
function sumIntegers(rows, fields) { return rows.reduce((total, row) => total + fields.reduce((sum, field) => sum + int(row.usage[field]), 0n), 0n); }
|
|
81
|
+
/** Preserve integer sums; finite floats use compensated summation. */
|
|
82
|
+
export function sumNumbers(values) {
|
|
83
|
+
let integer = 0n, high = 0, low = 0, floating = false;
|
|
84
|
+
for (const value of values) {
|
|
85
|
+
const whole = int(value);
|
|
86
|
+
if (!floating && whole !== null) {
|
|
87
|
+
integer += whole;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (!floating) {
|
|
91
|
+
high = Number(integer);
|
|
92
|
+
floating = true;
|
|
93
|
+
}
|
|
94
|
+
const x = numeric(value), next = high + x;
|
|
95
|
+
low += Math.abs(high) >= Math.abs(x) ? (high - next) + x : (x - next) + high;
|
|
96
|
+
high = next;
|
|
97
|
+
}
|
|
98
|
+
return floating ? new LosslessNumber(pythonFloat(Number.isFinite(low) && low !== 0 ? high + low : high)) : integer;
|
|
99
|
+
}
|
|
100
|
+
export function requestMetrics(state, selected, live, terminal) {
|
|
101
|
+
reconcileCosts(state);
|
|
102
|
+
const points = Object.fromEntries(ITEMS.map(item => [item, point(null, 'not_observed')]));
|
|
103
|
+
if (selected === null || !live && !terminal)
|
|
104
|
+
return points;
|
|
105
|
+
const rows = Object.fromEntries(Object.entries(state.requests).filter(([, row]) => row.prompt_id === selected)), values = Object.values(rows);
|
|
106
|
+
const main = values.filter(row => row.agent_id === null && row.started_at_ms !== null);
|
|
107
|
+
if (main.length) {
|
|
108
|
+
const last = latest(main, 'started_at_ms'), start = numeric(last.started_at_ms), first = numeric(last.first_at_ms), end = numeric(last.ended_at_ms);
|
|
109
|
+
const badClock = first !== null && first < start || end !== null && end < start || first !== null && end !== null && first > end;
|
|
110
|
+
const reason = truth(last.conflict) ? 'inconsistent_request' : badClock ? 'abnormal_clock' : last.status !== null && !truth(last.native) ? 'synthetic_response' : 'missing_stream';
|
|
111
|
+
points.ttft = !truth(last.conflict) && !badClock && first !== null ? point(float((first - start) / 1000), null, { source: 'native.turn.step', at: last.first_at_ms }) : point(null, reason);
|
|
112
|
+
if (!truth(last.conflict) && !badClock && truth(last.native) && object(last.usage) && end !== null && end > start) {
|
|
113
|
+
const tokens = int(last.usage.output_tokens) * 1000n, startInt = int(last.started_at_ms), endInt = int(last.ended_at_ms);
|
|
114
|
+
const rate = startInt !== null && endInt !== null ? divideIntegers(tokens, endInt - startInt) : Number(tokens) / (end - start);
|
|
115
|
+
points['output-rate'] = point(float(rate), null, { source: 'native.turn.step', at: last.ended_at_ms });
|
|
116
|
+
}
|
|
117
|
+
else
|
|
118
|
+
points['output-rate'] = point(null, end === start ? 'abnormal_clock' : reason);
|
|
119
|
+
}
|
|
120
|
+
const valid = values.filter(row => truth(row.native) && row.usage !== null && !truth(row.conflict));
|
|
121
|
+
const prompt = own(state.prompts, selected) ?? {};
|
|
122
|
+
let partial = !terminal || !truth(prompt.complete) || valid.length !== values.length;
|
|
123
|
+
for (const [identity, agent] of Object.entries(state.agents))
|
|
124
|
+
if (agent.prompt_id === selected && (agent.ended_at_ms === null || !valid.some(row => row.agent_id === identity)))
|
|
125
|
+
partial = true;
|
|
126
|
+
const turns = Object.values(state.turns).filter(turn => turn.prompt_id === selected);
|
|
127
|
+
for (const turn of turns) {
|
|
128
|
+
const turnRows = valid.filter(row => own(state.turns, row.turn_key) === turn), totals = Object.fromEntries(USAGE_KEYS.map(key => [key, sumIntegers(turnRows, [key])]));
|
|
129
|
+
if (turn.usage == null || turn.ended_at_ms == null || !equalSettings(totals, turn.usage))
|
|
130
|
+
partial = true;
|
|
131
|
+
}
|
|
132
|
+
if (valid.length) {
|
|
133
|
+
const at = latest(valid, 'updated_at_ms').updated_at_ms;
|
|
134
|
+
points['prompt-input-tokens'] = point(sumIntegers(valid, ['input_tokens', 'cache_read_input_tokens', 'cache_creation_input_tokens']), partial ? 'incomplete' : null, { source: 'native.requests', at, partial });
|
|
135
|
+
points['prompt-output-tokens'] = point(sumIntegers(valid, ['output_tokens']), partial ? 'incomplete' : null, { source: 'native.requests', at, partial });
|
|
136
|
+
}
|
|
137
|
+
const costs = Object.values(state.costs).filter(row => row.prompt_id === selected && !truth(row.conflict));
|
|
138
|
+
if (costs.length) {
|
|
139
|
+
const joined = new Set(costs.filter(row => typeof row.request_key === 'string' && Object.hasOwn(rows, row.request_key)).map(row => row.request_key));
|
|
140
|
+
const costPartial = partial || !values.length || joined.size !== values.length;
|
|
141
|
+
points['prompt-cost'] = point(sumNumbers(costs.map(row => row.cost_usd)), costPartial ? 'request_join_unavailable' : null, { source: 'otel.api_request', at: latest(costs, 'updated_at_ms').updated_at_ms, partial: costPartial });
|
|
142
|
+
}
|
|
143
|
+
return points;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/runtime/live/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAa,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAoB,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,eAAe,E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C,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3G,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QACrJ,MAAM,WAAW,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC;QAC/E,MAAM,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IACvO,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type TaskStore } from '../tasks/model.js';
|
|
2
|
+
import { type LiveState } from './state.js';
|
|
3
|
+
import { type Point } from './requests.js';
|
|
4
|
+
export declare const LIVE_ITEMS: string[];
|
|
5
|
+
export declare function unavailable(reason: string): Record<string, Point>;
|
|
6
|
+
export declare function resolveMetrics(state: LiveState | null, history: TaskStore | null, promptId: string | null, nowMs: number, enabled?: boolean): Record<string, Point>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { numeric, truth, own } from '../values.js';
|
|
2
|
+
import { findTurn } from '../tasks/model.js';
|
|
3
|
+
import { canonicalPrompt } from './ownership.js';
|
|
4
|
+
import { reconcileBindings } from './bindings.js';
|
|
5
|
+
import { fresh } from './state.js';
|
|
6
|
+
import { STALE_MS } from './model.js';
|
|
7
|
+
import { ITEMS, point, requestMetrics } from './requests.js';
|
|
8
|
+
export const LIVE_ITEMS = ['run-state', 'permission-mode', 'active-agents', 'task-progress', 'last-tool', ...ITEMS];
|
|
9
|
+
function latest(rows, field) { return rows.reduce((best, row) => numeric(row[field]) > numeric(best[field]) ? row : best); }
|
|
10
|
+
export function unavailable(reason) { return Object.fromEntries(LIVE_ITEMS.map(item => [item, point(null, reason)])); }
|
|
11
|
+
export function resolveMetrics(state, history, promptId, nowMs, enabled = true) {
|
|
12
|
+
let reason = !enabled ? 'runtime_disabled' : state === null ? 'not_observed' : truth(state.invalidated) ? state.invalidated : fresh(state, nowMs) ? null : 'stale';
|
|
13
|
+
let result = unavailable(reason ?? 'not_observed');
|
|
14
|
+
if (state === null || !enabled)
|
|
15
|
+
return result;
|
|
16
|
+
reconcileBindings(state, history);
|
|
17
|
+
const selected = canonicalPrompt(state, promptId || state.active_prompt_id || state.current_prompt_id), prompt = own(state.prompts, selected);
|
|
18
|
+
if (prompt && prompt.epoch !== state.epoch && !truth(prompt.terminal)) {
|
|
19
|
+
reason = 'incomplete';
|
|
20
|
+
result = unavailable(reason);
|
|
21
|
+
}
|
|
22
|
+
const record = selected && history ? findTurn(history, selected) : null;
|
|
23
|
+
const turns = Object.values(state.turns).filter(row => row.prompt_id === selected && row.agent_id === null), turn = turns.length ? latest(turns, 'started_at_ms') : null;
|
|
24
|
+
let run = null;
|
|
25
|
+
if (record && (reason === null || ['completed', 'failed', 'interrupted'].includes(record.status))) {
|
|
26
|
+
if (['completed', 'failed', 'interrupted', 'unknown'].includes(record.status))
|
|
27
|
+
run = record.status;
|
|
28
|
+
else if (record.status === 'running')
|
|
29
|
+
run = record.phase === 'waiting_subagents' ? 'waiting agents' : record.phase === 'resuming_main' ? 'main wrap-up' : null;
|
|
30
|
+
}
|
|
31
|
+
if (run === null && turn && (reason === null || ['completed', 'failed', 'interrupted'].includes(turn.status)))
|
|
32
|
+
run = turn.status === 'running' ? 'main' : turn.status;
|
|
33
|
+
if (run === null && selected && reason === null && state.prompts[selected].epoch === state.epoch)
|
|
34
|
+
run = 'queued';
|
|
35
|
+
result['run-state'] = point(run, run !== null ? null : reason ?? 'not_observed', { source: 'lifecycle/native', at: state.heartbeat_at_ms });
|
|
36
|
+
const mode = state.permission;
|
|
37
|
+
if (reason === null && mode && (truth(mode.live) || nowMs - numeric(mode.observed_at_ms) >= 0 && nowMs - numeric(mode.observed_at_ms) <= STALE_MS)) {
|
|
38
|
+
result['permission-mode'] = point(mode.mode, truth(mode.live) ? null : 'observed_only', { source: mode.source, at: mode.observed_at_ms, partial: !truth(mode.live) });
|
|
39
|
+
}
|
|
40
|
+
const snapshot = state.agent_snapshot;
|
|
41
|
+
if (reason === null && selected && snapshot && nowMs - numeric(snapshot.observed_at_ms) >= 0 && nowMs - numeric(snapshot.observed_at_ms) <= STALE_MS) {
|
|
42
|
+
let count = 0, incomplete = false;
|
|
43
|
+
for (const agent of snapshot.agents) {
|
|
44
|
+
if (!['pending', 'running', 'waiting'].includes(agent.status))
|
|
45
|
+
continue;
|
|
46
|
+
const owned = own(state.agents, agent.id);
|
|
47
|
+
if (!truth(agent.local) || !owned || owned.epoch !== state.epoch)
|
|
48
|
+
incomplete = true;
|
|
49
|
+
else if (owned.prompt_id === selected)
|
|
50
|
+
count++;
|
|
51
|
+
}
|
|
52
|
+
result['active-agents'] = point(count, incomplete ? 'ambiguous_owner' : null, { source: 'native.agent.list', at: snapshot.observed_at_ms, partial: incomplete });
|
|
53
|
+
}
|
|
54
|
+
const lists = Object.values(state.checklists).filter(row => row.prompt_id === selected), historical = turn !== null && ['completed', 'failed', 'interrupted'].includes(turn.status);
|
|
55
|
+
Object.assign(result, requestMetrics(state, selected, reason === null, Boolean(prompt && truth(prompt.terminal))));
|
|
56
|
+
if (lists.length && (reason === null || historical)) {
|
|
57
|
+
const complete = lists.filter(row => truth(row.complete)), checklist = latest(complete.length ? complete : lists, 'updated_at_ms'), tasks = checklist.tasks;
|
|
58
|
+
const counts = { completed: Object.values(tasks).filter(status => status === 'completed').length, total: Object.keys(tasks).length };
|
|
59
|
+
result['task-progress'] = point(counts, truth(checklist.complete) ? null : 'incomplete', { source: 'native.checklist', at: checklist.updated_at_ms, partial: !truth(checklist.complete) });
|
|
60
|
+
}
|
|
61
|
+
const tools = Object.values(state.tools).filter(tool => tool.prompt_id === selected && tool.agent_id === null);
|
|
62
|
+
if (tools.length && (reason === null || historical)) {
|
|
63
|
+
const tool = latest(tools, 'started_at_ms');
|
|
64
|
+
if (reason !== null && tool.status === 'started')
|
|
65
|
+
return result;
|
|
66
|
+
result['last-tool'] = point({ name: tool.name, status: tool.status }, null, { source: 'native.tool', at: tool.updated_at_ms });
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../../src/runtime/live/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAU,GAAG,EAAa,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAkB,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,EAAkB,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,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AE,CAAC;QACrI,MAAM,CAAC,eAAe,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,EAAE,SAAS,CAAC,aAAa,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/L,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;IAC/G,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,UAAU,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QAC5C,IAAI,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;YAC5C,OAAO,MAAM,CAAC;QAClB,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IACnI,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Data } from '../values.js';
|
|
2
|
+
import * as model from './model.js';
|
|
3
|
+
export interface Ledger extends Data {
|
|
4
|
+
seen: unknown[];
|
|
5
|
+
floor: unknown;
|
|
6
|
+
high: unknown;
|
|
7
|
+
updated_at_ms: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface LiveState extends Data {
|
|
10
|
+
session_id: string;
|
|
11
|
+
epoch: string | null;
|
|
12
|
+
loaded_at_ms: unknown;
|
|
13
|
+
heartbeat_at_ms: unknown;
|
|
14
|
+
host_version: unknown;
|
|
15
|
+
invalidated: unknown;
|
|
16
|
+
current_prompt_id: string | null;
|
|
17
|
+
active_prompt_id: string | null;
|
|
18
|
+
current_main_turn_id: string | null;
|
|
19
|
+
epochs: Record<string, Ledger>;
|
|
20
|
+
prompts: Record<string, Data>;
|
|
21
|
+
agents: Record<string, Data>;
|
|
22
|
+
permission: Data | null;
|
|
23
|
+
turns: Record<string, Data>;
|
|
24
|
+
tools: Record<string, Data>;
|
|
25
|
+
checklists: Record<string, Data>;
|
|
26
|
+
prompt_aliases: Data;
|
|
27
|
+
prompt_links: Record<string, string>;
|
|
28
|
+
agent_snapshot: Data | null;
|
|
29
|
+
requests: Record<string, Data>;
|
|
30
|
+
costs: Record<string, Data>;
|
|
31
|
+
wait_events: Record<string, model.Observation>;
|
|
32
|
+
}
|
|
33
|
+
export declare function empty(sessionId: string): LiveState;
|
|
34
|
+
export declare function validateState(value: unknown, sessionId: string): LiveState | null;
|
|
35
|
+
export declare function validateViews(state: LiveState): void;
|
|
36
|
+
export declare function fresh(state: LiveState | null, nowMs: number): boolean;
|