@fbincon/claude-code-statusline 0.0.0-stage → 3.0.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/LICENSE +21 -0
- package/LICENSE-Unicode.txt +39 -0
- package/LICENSE-Wcwidth.txt +27 -0
- package/README.md +420 -2
- package/bin/claude-statusline.js +2 -0
- package/candidate.json +1244 -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 +14 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +230 -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/dist/src/theme.d.ts +7 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/theme.js +5 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/theme.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,104 @@
|
|
|
1
|
+
import { int, numeric, own, truth, maxNumber, compareNumbers, multiplyInteger } from '../values.js';
|
|
2
|
+
import { float } from '../transcript.js';
|
|
3
|
+
import { divideIntegers } from '../../numbers.js';
|
|
4
|
+
import { MAX_PROMPTS } from './model.js';
|
|
5
|
+
import { canonicalPrompt } from './ownership.js';
|
|
6
|
+
import { reconcileRequests } from './requests.js';
|
|
7
|
+
/** Read existing completed task windows and explicit identities; never guess text. */
|
|
8
|
+
export function reconcileBindings(state, history) {
|
|
9
|
+
if (!history)
|
|
10
|
+
return;
|
|
11
|
+
for (const [key, turn] of Object.entries(state.turns)) {
|
|
12
|
+
if (turn.agent_id !== null || turn.prompt_id !== null)
|
|
13
|
+
continue;
|
|
14
|
+
const started = multiplyInteger(turn.started_at_ms, 1000000n);
|
|
15
|
+
const candidates = history.turns.filter(row => ['completed', 'failed', 'interrupted'].includes(row.status) && int(row.started_wall_ns) !== null && int(row.ended_wall_ns) !== null && compareNumbers(row.started_wall_ns, started) <= 0 && compareNumbers(started, row.ended_wall_ns) <= 0);
|
|
16
|
+
if (candidates.length !== 1)
|
|
17
|
+
continue;
|
|
18
|
+
const row = candidates[0], prompt = row.prompt_id, epoch = typeof turn.epoch === 'string' ? turn.epoch : key.split(':', 1)[0];
|
|
19
|
+
const ledger = own(state.epochs, epoch), startMs = divideIntegers(int(row.started_wall_ns), 1000000n);
|
|
20
|
+
const complete = ledger && numeric(ledger.floor) === -1 && ledger.seen.length === (numeric(ledger.high) ?? -2) + 1 && numeric(state.loaded_at_ms) <= startMs;
|
|
21
|
+
if (!Object.hasOwn(state.prompts, prompt))
|
|
22
|
+
state.prompts[prompt] = { epoch, started_at_ms: float(startMs), updated_at_ms: float(divideIntegers(int(row.ended_wall_ns), 1000000n)), complete: Boolean(complete), terminal: true, source: 'lifecycle_window' };
|
|
23
|
+
turn.prompt_id = prompt;
|
|
24
|
+
if (key === state.current_main_turn_id) {
|
|
25
|
+
state.active_prompt_id = prompt;
|
|
26
|
+
if (state.current_prompt_id === null)
|
|
27
|
+
state.current_prompt_id = prompt;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
for (const row of history.turns) {
|
|
31
|
+
const identities = new Set([row.prompt_id, ...row.prompt_aliases]);
|
|
32
|
+
for (const alias of [...identities]) {
|
|
33
|
+
const target = own(state.prompt_links, alias);
|
|
34
|
+
if (target !== undefined)
|
|
35
|
+
identities.add(target);
|
|
36
|
+
}
|
|
37
|
+
const candidates = Object.keys(state.prompts).filter(key => identities.has(key));
|
|
38
|
+
if (!candidates.length)
|
|
39
|
+
continue;
|
|
40
|
+
const canonical = candidates.reduce((best, key) => numeric(state.prompts[key].started_at_ms) < numeric(state.prompts[best].started_at_ms) ? key : best);
|
|
41
|
+
if (['completed', 'failed', 'interrupted'].includes(row.status)) {
|
|
42
|
+
state.prompts[canonical].terminal = true;
|
|
43
|
+
state.prompts[canonical].updated_at_ms = maxNumber(state.prompts[canonical].updated_at_ms, float(Number(int(row.ended_wall_ns) ?? 0n) / 1e6));
|
|
44
|
+
}
|
|
45
|
+
for (const alias of identities)
|
|
46
|
+
if (alias !== canonical)
|
|
47
|
+
state.prompt_aliases[alias] = canonical;
|
|
48
|
+
}
|
|
49
|
+
for (const [alias, target] of Object.entries(state.prompt_aliases)) {
|
|
50
|
+
if (typeof target !== 'string' || alias === target)
|
|
51
|
+
continue;
|
|
52
|
+
const source = own(state.prompts, alias), destination = own(state.prompts, target);
|
|
53
|
+
if (!source)
|
|
54
|
+
continue;
|
|
55
|
+
if (!destination)
|
|
56
|
+
state.prompts[target] = { ...source, source: 'explicit_prompt_link' };
|
|
57
|
+
for (const table of [state.turns, state.agents, state.requests, state.tools, state.checklists, state.costs])
|
|
58
|
+
for (const row of Object.values(table))
|
|
59
|
+
if (row.prompt_id === alias)
|
|
60
|
+
row.prompt_id = target;
|
|
61
|
+
if (state.active_prompt_id === alias)
|
|
62
|
+
state.active_prompt_id = target;
|
|
63
|
+
if (state.current_prompt_id === alias)
|
|
64
|
+
state.current_prompt_id = target;
|
|
65
|
+
delete state.prompts[alias];
|
|
66
|
+
}
|
|
67
|
+
for (let index = 0; index < 32; index++) {
|
|
68
|
+
let changed = false;
|
|
69
|
+
for (const [identity, agent] of Object.entries(state.agents)) {
|
|
70
|
+
if (agent.prompt_id !== null)
|
|
71
|
+
continue;
|
|
72
|
+
const parentTurn = own(state.turns, agent.parent_turn_key), parent = own(state.agents, agent.parent_agent_id);
|
|
73
|
+
const target = truth(parentTurn?.prompt_id) ? parentTurn.prompt_id : parent?.prompt_id ?? null;
|
|
74
|
+
if (target !== null) {
|
|
75
|
+
agent.prompt_id = target;
|
|
76
|
+
reconcileRequests(state, identity, target);
|
|
77
|
+
changed = true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (!changed)
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
for (const turn of Object.values(state.turns))
|
|
84
|
+
if (turn.prompt_id === null && truth(turn.agent_id)) {
|
|
85
|
+
const agent = own(state.agents, turn.agent_id);
|
|
86
|
+
if (agent)
|
|
87
|
+
turn.prompt_id = agent.prompt_id;
|
|
88
|
+
}
|
|
89
|
+
for (const table of [state.requests, state.tools, state.checklists])
|
|
90
|
+
for (const row of Object.values(table)) {
|
|
91
|
+
const turn = own(state.turns, row.turn_key);
|
|
92
|
+
if (row.prompt_id === null && turn)
|
|
93
|
+
row.prompt_id = turn.prompt_id;
|
|
94
|
+
}
|
|
95
|
+
for (const row of Object.values(state.costs))
|
|
96
|
+
if (row.prompt_id === null) {
|
|
97
|
+
const target = canonicalPrompt(state, row.owner_alias);
|
|
98
|
+
if (target && Object.values(state.turns).some(turn => turn.prompt_id === target && numeric(turn.started_at_ms) <= numeric(row.updated_at_ms)))
|
|
99
|
+
row.prompt_id = target;
|
|
100
|
+
}
|
|
101
|
+
for (const key of Object.keys(state.prompts).sort((a, b) => numeric(state.prompts[a].updated_at_ms) - numeric(state.prompts[b].updated_at_ms)).slice(0, -MAX_PROMPTS))
|
|
102
|
+
delete state.prompts[key];
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../../../src/runtime/live/bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,sFAAsF;AACtF,MAAM,UAAU,iBAAiB,CAAC,KAAgB,EAAE,OAAyB;IACzE,IAAI,CAAC,OAAO;QACR,OAAO;IACX,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACpD,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,SAAS,KAAK,I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K,CAAC,KAAK,CAAC;QACxC,IAAI,GAAG,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;YACvD,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,aAAa,CAAE,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAE,CAAC;gBAC3I,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC;QAC/B,CAAC;IACL,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAE,CAAC,aAAa,CAAE,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAE,CAAC,aAAa,CAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC;QACrK,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Data } from '../values.js';
|
|
2
|
+
export declare const PROTOCOL_VERSION = 2, MAX_BATCH = 256, MAX_BYTES = 1048576, MAX_SESSIONS = 100, MAX_EPOCHS = 32, MAX_SEEN = 4096, MAX_PROMPTS = 32, MAX_AGENTS = 256, MAX_TURNS = 256, MAX_TOOLS = 1024, MAX_TASKS = 1000, MAX_REQUESTS = 2048, STALE_MS = 15000;
|
|
3
|
+
export declare const TIMING_KINDS: Set<string>;
|
|
4
|
+
export declare const OBSERVATION_KEYS: string[];
|
|
5
|
+
export declare const USAGE_KEYS: string[];
|
|
6
|
+
export declare class ObservationError extends Error {
|
|
7
|
+
}
|
|
8
|
+
export declare function exact(value: unknown, keys: readonly string[], name: string): asserts value is Data;
|
|
9
|
+
export declare function text(value: unknown, name: string, nullable?: boolean, maximum?: number): string | null;
|
|
10
|
+
export declare function number(value: unknown, name: string, integer?: boolean): number;
|
|
11
|
+
export declare function usage(value: unknown): unknown;
|
|
12
|
+
export interface Observation extends Data {
|
|
13
|
+
session_id: string;
|
|
14
|
+
epoch: string;
|
|
15
|
+
seq: unknown;
|
|
16
|
+
observed_at_ms: unknown;
|
|
17
|
+
source: string;
|
|
18
|
+
kind: string;
|
|
19
|
+
prompt_id: string | null;
|
|
20
|
+
turn_id: string | null;
|
|
21
|
+
agent_id: string | null;
|
|
22
|
+
parent_agent_id: string | null;
|
|
23
|
+
request_id: string | null;
|
|
24
|
+
payload: Data;
|
|
25
|
+
}
|
|
26
|
+
export declare function validate(value: unknown): Observation;
|
|
27
|
+
export declare function validateBatch(values: unknown): Observation[];
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { int, numeric, object } from '../values.js';
|
|
2
|
+
import { scalarCompare } from '../../json.js';
|
|
3
|
+
import { trim } from '../transcript.js';
|
|
4
|
+
export const PROTOCOL_VERSION = 2, MAX_BATCH = 256, MAX_BYTES = 1048576, MAX_SESSIONS = 100, MAX_EPOCHS = 32, MAX_SEEN = 4096, MAX_PROMPTS = 32, MAX_AGENTS = 256, MAX_TURNS = 256, MAX_TOOLS = 1024, MAX_TASKS = 1000, MAX_REQUESTS = 2048, STALE_MS = 15000;
|
|
5
|
+
export const TIMING_KINDS = new Set(['heartbeat', 'invalidate', 'prompt', 'prompt_alias', 'prompt_link', 'agent_start', 'agent_end', 'turn_start', 'turn_end', 'agents', 'wait_start', 'wait_end', 'wait_unknown']);
|
|
6
|
+
export const OBSERVATION_KEYS = ['session_id', 'epoch', 'seq', 'observed_at_ms', 'source', 'kind', 'prompt_id', 'turn_id', 'agent_id', 'parent_agent_id', 'request_id', 'payload'];
|
|
7
|
+
export const USAGE_KEYS = ['input_tokens', 'output_tokens', 'cache_read_input_tokens', 'cache_creation_input_tokens'];
|
|
8
|
+
export class ObservationError extends Error {
|
|
9
|
+
}
|
|
10
|
+
export function exact(value, keys, name) {
|
|
11
|
+
if (!object(value) || Object.keys(value).length !== keys.length || !keys.every(key => Object.hasOwn(value, key)))
|
|
12
|
+
throw new ObservationError(`${name} must contain exactly: ${[...keys].sort(scalarCompare).join(', ')}`);
|
|
13
|
+
}
|
|
14
|
+
export function text(value, name, nullable = false, maximum = 256) {
|
|
15
|
+
if (nullable && value === null)
|
|
16
|
+
return null;
|
|
17
|
+
if (typeof value !== 'string' || !trim(value) || [...value].length > maximum || /[\p{Cc}\p{Cs}]/u.test(value))
|
|
18
|
+
throw new ObservationError(`${name} must be nonempty safe text (up to ${maximum} characters)`);
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
export function number(value, name, integer = false) {
|
|
22
|
+
const result = numeric(value);
|
|
23
|
+
if (result === null || result < 0 || result > Number.MAX_SAFE_INTEGER || !Number.isFinite(result) || integer && int(value) === null)
|
|
24
|
+
throw new ObservationError(`${name} must be a finite nonnegative ${integer ? 'integer' : 'number'}`);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
export function usage(value) {
|
|
28
|
+
if (value !== null) {
|
|
29
|
+
exact(value, USAGE_KEYS, 'usage');
|
|
30
|
+
for (const key of USAGE_KEYS)
|
|
31
|
+
number(value[key], key, true);
|
|
32
|
+
}
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
export function validate(value) {
|
|
36
|
+
exact(value, OBSERVATION_KEYS, 'observation');
|
|
37
|
+
for (const key of ['session_id', 'epoch'])
|
|
38
|
+
text(value[key], key);
|
|
39
|
+
for (const key of ['prompt_id', 'turn_id', 'agent_id', 'parent_agent_id', 'request_id'])
|
|
40
|
+
text(value[key], key, true);
|
|
41
|
+
number(value.seq, 'seq', true);
|
|
42
|
+
number(value.observed_at_ms, 'observed_at_ms');
|
|
43
|
+
if (!['native', 'classic_hook', 'otel'].includes(value.source))
|
|
44
|
+
throw new ObservationError('unknown observation source');
|
|
45
|
+
const payload = value.payload, kind = value.kind;
|
|
46
|
+
if (kind === 'heartbeat') {
|
|
47
|
+
exact(payload, ['host_version', 'loaded_at_ms'], 'heartbeat');
|
|
48
|
+
text(payload.host_version, 'host_version');
|
|
49
|
+
number(payload.loaded_at_ms, 'loaded_at_ms');
|
|
50
|
+
if (numeric(payload.loaded_at_ms) > numeric(value.observed_at_ms))
|
|
51
|
+
throw new ObservationError('heartbeat predates module loading');
|
|
52
|
+
if (value.source !== 'native')
|
|
53
|
+
throw new ObservationError('heartbeats require a native source');
|
|
54
|
+
}
|
|
55
|
+
else if (kind === 'invalidate') {
|
|
56
|
+
exact(payload, ['reason'], 'invalidation');
|
|
57
|
+
text(payload.reason, 'reason');
|
|
58
|
+
}
|
|
59
|
+
else if (kind === 'prompt') {
|
|
60
|
+
exact(payload, [], 'prompt');
|
|
61
|
+
text(value.prompt_id, 'prompt_id');
|
|
62
|
+
if (value.agent_id !== null)
|
|
63
|
+
throw new ObservationError('a human prompt belongs to main');
|
|
64
|
+
}
|
|
65
|
+
else if (kind === 'prompt_link') {
|
|
66
|
+
exact(payload, ['message_id'], 'official prompt link');
|
|
67
|
+
text(value.prompt_id, 'prompt_id');
|
|
68
|
+
text(payload.message_id, 'message_id');
|
|
69
|
+
if (value.source !== 'otel')
|
|
70
|
+
throw new ObservationError('prompt links require official telemetry');
|
|
71
|
+
}
|
|
72
|
+
else if (kind === 'prompt_alias') {
|
|
73
|
+
exact(payload, ['agent_id'], 'prompt alias');
|
|
74
|
+
text(value.prompt_id, 'prompt_id');
|
|
75
|
+
text(payload.agent_id, 'agent_id');
|
|
76
|
+
}
|
|
77
|
+
else if (kind === 'turn_start' || kind === 'turn_end') {
|
|
78
|
+
text(value.turn_id, 'turn_id');
|
|
79
|
+
if (kind === 'turn_start')
|
|
80
|
+
exact(payload, [], kind);
|
|
81
|
+
else {
|
|
82
|
+
exact(payload, object(payload) && Object.hasOwn(payload, 'duration_ms') ? ['status', 'duration_ms', 'wait_coverage'] : ['status'], kind);
|
|
83
|
+
if (Object.hasOwn(payload, 'duration_ms')) {
|
|
84
|
+
number(payload.duration_ms, 'native duration');
|
|
85
|
+
if (typeof payload.wait_coverage !== 'boolean')
|
|
86
|
+
throw new ObservationError('wait_coverage must be a boolean');
|
|
87
|
+
}
|
|
88
|
+
if (!['completed', 'failed', 'interrupted'].includes(payload.status))
|
|
89
|
+
throw new ObservationError('invalid turn status');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else if (kind === 'wait_start' || kind === 'wait_end' || kind === 'wait_unknown') {
|
|
93
|
+
text(value.turn_id, 'turn_id');
|
|
94
|
+
if (kind === 'wait_unknown') {
|
|
95
|
+
exact(payload, ['reason'], kind);
|
|
96
|
+
text(payload.reason, 'wait reason');
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
text(value.request_id, 'wait request id');
|
|
100
|
+
exact(payload, [], kind);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (kind === 'agents') {
|
|
104
|
+
exact(payload, ['agents'], 'agent snapshot');
|
|
105
|
+
if (!Array.isArray(payload.agents) || payload.agents.length > MAX_AGENTS)
|
|
106
|
+
throw new ObservationError('too many agents');
|
|
107
|
+
const ids = new Set();
|
|
108
|
+
for (const agent of payload.agents) {
|
|
109
|
+
exact(agent, ['id', 'parent_id', 'status', 'local'], 'agent');
|
|
110
|
+
text(agent.id, 'agent id');
|
|
111
|
+
text(agent.parent_id, 'parent_id', true);
|
|
112
|
+
if (typeof agent.local !== 'boolean' || !['pending', 'running', 'waiting', 'idle', 'completed', 'failed', 'killed'].includes(agent.status))
|
|
113
|
+
throw new ObservationError('invalid agent snapshot');
|
|
114
|
+
ids.add(agent.id);
|
|
115
|
+
}
|
|
116
|
+
if (ids.size !== payload.agents.length)
|
|
117
|
+
throw new ObservationError('duplicate agent identity');
|
|
118
|
+
}
|
|
119
|
+
else if (kind === 'tool_start' || kind === 'tool_end') {
|
|
120
|
+
text(value.request_id, 'tool use id');
|
|
121
|
+
exact(payload, kind === 'tool_start' ? ['name'] : ['name', 'status'], kind);
|
|
122
|
+
text(payload.name, 'tool name');
|
|
123
|
+
if (kind === 'tool_end' && !['success', 'error', 'denied', 'interrupted'].includes(payload.status))
|
|
124
|
+
throw new ObservationError('invalid tool outcome');
|
|
125
|
+
}
|
|
126
|
+
else if (kind === 'task_snapshot' || kind === 'task_update') {
|
|
127
|
+
exact(payload, kind === 'task_snapshot' ? ['provider', 'tasks'] : ['provider', 'id', 'status'], kind);
|
|
128
|
+
if (!['tasks', 'todos'].includes(payload.provider))
|
|
129
|
+
throw new ObservationError('unknown checklist provider');
|
|
130
|
+
const tasks = kind === 'task_snapshot' ? payload.tasks : [{ id: payload.id, status: payload.status }];
|
|
131
|
+
if (!Array.isArray(tasks) || tasks.length > MAX_TASKS)
|
|
132
|
+
throw new ObservationError('too many checklist entries');
|
|
133
|
+
const ids = new Set();
|
|
134
|
+
for (const task of tasks) {
|
|
135
|
+
exact(task, ['id', 'status'], 'task');
|
|
136
|
+
text(task.id, 'task id');
|
|
137
|
+
if (!['pending', 'in_progress', 'completed', 'deleted'].includes(task.status))
|
|
138
|
+
throw new ObservationError('invalid checklist status');
|
|
139
|
+
ids.add(task.id);
|
|
140
|
+
}
|
|
141
|
+
if (ids.size !== tasks.length)
|
|
142
|
+
throw new ObservationError('duplicate checklist identity');
|
|
143
|
+
}
|
|
144
|
+
else if (kind === 'permission') {
|
|
145
|
+
exact(payload, ['mode', 'live'], 'permission');
|
|
146
|
+
text(payload.mode, 'mode', false, 64);
|
|
147
|
+
if (typeof payload.live !== 'boolean')
|
|
148
|
+
throw new ObservationError('permission.live must be boolean');
|
|
149
|
+
if (payload.live && value.source !== 'otel')
|
|
150
|
+
throw new ObservationError('live permission requires a verified change feed');
|
|
151
|
+
}
|
|
152
|
+
else if (['request_start', 'request_first', 'request_end', 'request_cost', 'turn_usage'].includes(kind)) {
|
|
153
|
+
if (kind !== 'request_cost' && value.source !== 'native')
|
|
154
|
+
throw new ObservationError('request measurements require native observations');
|
|
155
|
+
if (kind === 'turn_usage') {
|
|
156
|
+
text(value.turn_id, 'turn_id');
|
|
157
|
+
exact(payload, ['usage'], kind);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
text(value.request_id, 'request_id');
|
|
161
|
+
if (kind !== 'request_cost')
|
|
162
|
+
text(value.turn_id, 'turn_id');
|
|
163
|
+
exact(payload, kind === 'request_start' || kind === 'request_first' ? [] : kind === 'request_end' ? ['usage', 'native', 'status'] : ['cost_usd', 'usage'], kind);
|
|
164
|
+
}
|
|
165
|
+
if (['request_end', 'request_cost', 'turn_usage'].includes(kind))
|
|
166
|
+
usage(payload.usage);
|
|
167
|
+
if (kind === 'request_end') {
|
|
168
|
+
if (typeof payload.native !== 'boolean' || !['completed', 'failed', 'interrupted'].includes(payload.status))
|
|
169
|
+
throw new ObservationError('invalid request outcome');
|
|
170
|
+
if (!payload.native && payload.usage !== null)
|
|
171
|
+
throw new ObservationError('synthetic requests cannot claim official usage');
|
|
172
|
+
}
|
|
173
|
+
if (kind === 'request_cost') {
|
|
174
|
+
if (value.source !== 'otel')
|
|
175
|
+
throw new ObservationError('cost requires official telemetry evidence');
|
|
176
|
+
number(payload.cost_usd, 'cost_usd');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else if (kind === 'agent_start' || kind === 'agent_end') {
|
|
180
|
+
const key = kind === 'agent_start' ? 'started_at_ms' : 'ended_at_ms';
|
|
181
|
+
exact(payload, kind === 'agent_start' ? [key] : [key, 'status'], kind);
|
|
182
|
+
text(value.agent_id, 'agent_id');
|
|
183
|
+
number(payload[key], key);
|
|
184
|
+
if (kind === 'agent_end' && !['completed', 'failed', 'killed', 'interrupted'].includes(payload.status))
|
|
185
|
+
throw new ObservationError('unknown terminal agent status');
|
|
186
|
+
}
|
|
187
|
+
else
|
|
188
|
+
throw new ObservationError('unknown observation kind');
|
|
189
|
+
return value;
|
|
190
|
+
}
|
|
191
|
+
export function validateBatch(values) {
|
|
192
|
+
if (!Array.isArray(values) || values.length < 1 || values.length > MAX_BATCH)
|
|
193
|
+
throw new ObservationError(`observations must contain 1 through ${MAX_BATCH} records`);
|
|
194
|
+
return values.map(validate);
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../src/runtime/live/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAa,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,SAAS,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO,EAAE,YAAY,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,EAAE,QAAQ,GAAG,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,UAAU,GAAG,GAAG,EAAE,SAAS,GAAG,GAAG,EAAE,SAAS,GAAG,IAAI,EAAE,SAAS,GAAG,IAAI,EAAE,YAAY,GAAG,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;AAC9P,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;AACpN,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAA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AQ,EAAE,UAAU,CAAC,CAAC;QACjC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;QAC1B,IAAI,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAgB,CAAC;YAC5G,MAAM,IAAI,gBAAgB,CAAC,+BAA+B,CAAC,CAAC;IACpE,CAAC;;QAEG,MAAM,IAAI,gBAAgB,CAAC,0BAA0B,CAAC,CAAC;IAC3D,OAAO,KAAoB,CAAC;AAChC,CAAC;AACD,MAAM,UAAU,aAAa,CAAC,MAAe;IACzC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,SAAS;QACxE,MAAM,IAAI,gBAAgB,CAAC,uCAAuC,SAAS,UAAU,CAAC,CAAC;IAC3F,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Observation } from './model.js';
|
|
2
|
+
import type { LiveState } from './state.js';
|
|
3
|
+
export declare function canonicalPrompt(state: LiveState, value: unknown): string | null;
|
|
4
|
+
export declare function turnKey(epoch: string, turnId: unknown, agentId?: unknown): string;
|
|
5
|
+
export declare function owner(state: LiveState, observation: Observation, parent?: boolean): string | null;
|
|
6
|
+
export declare function pendingOwner(state: LiveState, epoch: string): string | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { object, own, truth, string } from '../values.js';
|
|
2
|
+
export function canonicalPrompt(state, value) {
|
|
3
|
+
let prompt = typeof value === 'string' ? value : null;
|
|
4
|
+
for (let index = 0; index < 32; index++) {
|
|
5
|
+
let target = prompt === null ? undefined : own(state.prompt_aliases, prompt);
|
|
6
|
+
if (object(target)) {
|
|
7
|
+
const agent = typeof target.agent_id === 'string' ? own(state.agents, target.agent_id) : undefined;
|
|
8
|
+
target = agent && agent.epoch === target.epoch ? agent.prompt_id : null;
|
|
9
|
+
if (target === null)
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
if (!truth(target) || target === prompt)
|
|
13
|
+
break;
|
|
14
|
+
prompt = typeof target === 'string' ? target : null;
|
|
15
|
+
}
|
|
16
|
+
return prompt !== null && Object.hasOwn(state.prompts, prompt) ? prompt : null;
|
|
17
|
+
}
|
|
18
|
+
export function turnKey(epoch, turnId, agentId = null) { return epoch + ':' + (truth(agentId) ? string(agentId) : 'main') + ':' + string(turnId); }
|
|
19
|
+
export function owner(state, observation, parent = false) {
|
|
20
|
+
const agentId = parent ? observation.parent_agent_id : observation.agent_id;
|
|
21
|
+
if (observation.turn_id) {
|
|
22
|
+
const turn = own(state.turns, turnKey(observation.epoch, observation.turn_id, agentId));
|
|
23
|
+
if (turn)
|
|
24
|
+
return turn.prompt_id;
|
|
25
|
+
}
|
|
26
|
+
if (agentId && Object.hasOwn(state.agents, agentId)) {
|
|
27
|
+
const agent = state.agents[agentId];
|
|
28
|
+
return agent.epoch === observation.epoch ? agent.prompt_id : null;
|
|
29
|
+
}
|
|
30
|
+
const target = canonicalPrompt(state, observation.prompt_id);
|
|
31
|
+
return target && state.prompts[target].epoch === observation.epoch ? target : null;
|
|
32
|
+
}
|
|
33
|
+
export function pendingOwner(state, epoch) {
|
|
34
|
+
const bound = new Set(Object.values(state.turns).filter(turn => turn.agent_id === null).map(turn => turn.prompt_id));
|
|
35
|
+
const candidates = Object.entries(state.prompts).filter(([key, prompt]) => prompt.epoch === epoch && !bound.has(key) && !truth(prompt.terminal)).map(([key]) => key);
|
|
36
|
+
if (candidates.length === 1)
|
|
37
|
+
return candidates[0];
|
|
38
|
+
if (!candidates.length && state.active_prompt_id !== null) {
|
|
39
|
+
const prompt = own(state.prompts, state.active_prompt_id);
|
|
40
|
+
if (prompt?.epoch === epoch && !truth(prompt.terminal))
|
|
41
|
+
return state.active_prompt_id;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=ownership.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../../../src/runtime/live/ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG1D,MAAM,UAAU,eAAe,CAAC,KAAgB,EAAE,KAAc;IAC5D,IAAI,MAAM,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC;QACtC,IAAI,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC7E,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YACjB,MAAM,KAAK,GAAG,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACnG,MAAM,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;YACxE,IAAI,MAAM,KAAK,IAAI;gBACf,OAAO,IAAI,CAAC;QACpB,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,MAAM;YACnC,MAAM;QACV,MAAM,GAAG,OAAO,MAAM,KAAK,Q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,CAAC,QAAQ,CAAC;YAClD,OAAO,KAAK,CAAC,gBAAgB,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Data } from '../values.js';
|
|
2
|
+
import * as model from './model.js';
|
|
3
|
+
import type { LiveState } from './state.js';
|
|
4
|
+
export declare function trimTable(values: Record<string, Data>, maximum: number, stamp?: string): void;
|
|
5
|
+
export declare function applyObservation(state: LiveState, o: model.Observation, metadataOnly?: boolean): boolean;
|