@elizaos/shared 2.0.0-beta.1 → 2.0.3-beta.3
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/api/agent-api-types.d.ts +210 -0
- package/api/agent-api-types.d.ts.map +1 -0
- package/api/agent-api-types.js +11 -0
- package/api/agent-api-types.js.map +1 -0
- package/api/http-helpers.d.ts +3 -0
- package/api/http-helpers.d.ts.map +1 -0
- package/api/http-helpers.js +2 -0
- package/api/http-helpers.js.map +1 -0
- package/api/route-helpers.d.ts +2 -0
- package/api/route-helpers.d.ts.map +1 -0
- package/app-hero-art.d.ts.map +1 -0
- package/app-hero-art.js +344 -0
- package/app-hero-art.js.map +1 -0
- package/brand/index.d.ts +130 -0
- package/brand/index.d.ts.map +1 -0
- package/brand/index.js +126 -0
- package/brand/index.js.map +1 -0
- package/brand-classic/index.d.ts +158 -0
- package/brand-classic/index.d.ts.map +1 -0
- package/brand-classic/index.js +91 -0
- package/brand-classic/index.js.map +1 -0
- package/character-language.d.ts +16 -0
- package/character-language.d.ts.map +1 -0
- package/character-language.js +58 -0
- package/character-language.js.map +1 -0
- package/character-presets.characters.d.ts +22 -0
- package/character-presets.characters.d.ts.map +1 -0
- package/character-presets.characters.js +2617 -0
- package/character-presets.characters.js.map +1 -0
- package/character-presets.d.ts +42 -0
- package/character-presets.d.ts.map +1 -0
- package/character-presets.js +176 -0
- package/character-presets.js.map +1 -0
- package/character-presets.shared.d.ts +2 -0
- package/character-presets.shared.d.ts.map +1 -0
- package/character-presets.shared.js +8 -0
- package/character-presets.shared.js.map +1 -0
- package/checkout/index.d.ts +48 -0
- package/checkout/index.d.ts.map +1 -0
- package/checkout/index.js +59 -0
- package/checkout/index.js.map +1 -0
- package/cli/parse-duration.d.ts.map +1 -0
- package/cli/parse-duration.js +26 -0
- package/cli/parse-duration.js.map +1 -0
- package/config/allowed-hosts.js +44 -0
- package/config/allowed-hosts.js.map +1 -0
- package/config/api-key-prefix-hints.d.ts +24 -0
- package/config/api-key-prefix-hints.d.ts.map +1 -0
- package/config/api-key-prefix-hints.js +26 -0
- package/config/api-key-prefix-hints.js.map +1 -0
- package/config/app-config.d.ts +274 -0
- package/config/app-config.d.ts.map +1 -0
- package/config/app-config.js +64 -0
- package/config/app-config.js.map +1 -0
- package/config/app-manifest.d.ts.map +1 -0
- package/config/app-manifest.js +115 -0
- package/config/app-manifest.js.map +1 -0
- package/config/boot-config-store.d.ts +71 -0
- package/config/boot-config-store.d.ts.map +1 -0
- package/config/boot-config-store.js +77 -0
- package/config/boot-config-store.js.map +1 -0
- package/config/branding.d.ts +53 -0
- package/config/branding.d.ts.map +1 -0
- package/config/branding.js +23 -0
- package/config/branding.js.map +1 -0
- package/config/cloud-only.d.ts +8 -0
- package/config/cloud-only.d.ts.map +1 -0
- package/config/cloud-only.js +26 -0
- package/config/cloud-only.js.map +1 -0
- package/config/config-catalog.d.ts.map +1 -0
- package/config/config-catalog.js +719 -0
- package/config/config-catalog.js.map +1 -0
- package/config/config.js +23 -0
- package/config/config.js.map +1 -0
- package/config/distribution-profile.js +29 -0
- package/config/distribution-profile.js.map +1 -0
- package/config/env-vars.d.ts.map +1 -0
- package/config/index.d.ts +12 -0
- package/config/index.d.ts.map +1 -0
- package/config/index.js +15 -0
- package/config/index.js.map +1 -0
- package/config/plugin-auto-enable-engine.js +45 -0
- package/config/plugin-auto-enable-engine.js.map +1 -0
- package/config/plugin-manifest.d.ts.map +1 -0
- package/config/plugin-manifest.js +281 -0
- package/config/plugin-manifest.js.map +1 -0
- package/config/runtime-mode.d.ts.map +1 -0
- package/config/runtime-mode.js +107 -0
- package/config/runtime-mode.js.map +1 -0
- package/config/types.agent-defaults.d.ts +388 -0
- package/config/types.agent-defaults.d.ts.map +1 -0
- package/config/types.agents.d.ts +119 -0
- package/config/types.agents.d.ts.map +1 -0
- package/config/types.eliza.d.ts +689 -0
- package/config/types.eliza.d.ts.map +1 -0
- package/config/types.messages.d.ts +176 -0
- package/config/types.messages.d.ts.map +1 -0
- package/config/types.tools.d.ts +400 -0
- package/config/types.tools.d.ts.map +1 -0
- package/config/ui-spec.d.ts +164 -0
- package/config/ui-spec.d.ts.map +1 -0
- package/config/zod-schema.agent-runtime.d.ts +1087 -0
- package/config/zod-schema.core.d.ts +1048 -0
- package/connectors.d.ts +5 -0
- package/connectors.d.ts.map +1 -0
- package/connectors.js +73 -0
- package/connectors.js.map +1 -0
- package/contracts/agent-routes.d.ts +63 -0
- package/contracts/agent-routes.d.ts.map +1 -0
- package/contracts/agent-routes.js +55 -0
- package/contracts/agent-routes.js.map +1 -0
- package/contracts/app-permissions-routes.d.ts +148 -0
- package/contracts/app-permissions-routes.d.ts.map +1 -0
- package/contracts/app-permissions-routes.js +96 -0
- package/contracts/app-permissions-routes.js.map +1 -0
- package/contracts/app-permissions.d.ts +122 -0
- package/contracts/app-permissions.d.ts.map +1 -0
- package/contracts/app-permissions.js +163 -0
- package/contracts/app-permissions.js.map +1 -0
- package/contracts/apps-favorites-routes.d.ts +44 -0
- package/contracts/apps-favorites-routes.d.ts.map +1 -0
- package/contracts/apps-favorites-routes.js +48 -0
- package/contracts/apps-favorites-routes.js.map +1 -0
- package/contracts/apps-lifecycle-routes.d.ts +185 -0
- package/contracts/apps-lifecycle-routes.d.ts.map +1 -0
- package/contracts/apps-lifecycle-routes.js +204 -0
- package/contracts/apps-lifecycle-routes.js.map +1 -0
- package/contracts/apps-loading-routes.d.ts +64 -0
- package/contracts/apps-loading-routes.d.ts.map +1 -0
- package/contracts/apps-loading-routes.js +65 -0
- package/contracts/apps-loading-routes.js.map +1 -0
- package/contracts/apps-runs-routes.d.ts +33 -0
- package/contracts/apps-runs-routes.d.ts.map +1 -0
- package/contracts/apps-runs-routes.js +38 -0
- package/contracts/apps-runs-routes.js.map +1 -0
- package/contracts/apps.d.ts +1159 -0
- package/contracts/apps.d.ts.map +1 -0
- package/contracts/apps.js +400 -0
- package/contracts/apps.js.map +1 -0
- package/contracts/auth-routes.d.ts +23 -0
- package/contracts/auth-routes.d.ts.map +1 -0
- package/contracts/auth-routes.js +25 -0
- package/contracts/auth-routes.js.map +1 -0
- package/contracts/calendar.d.ts +181 -0
- package/contracts/calendar.d.ts.map +1 -0
- package/contracts/calendar.js +19 -0
- package/contracts/calendar.js.map +1 -0
- package/contracts/character-routes.d.ts +70 -0
- package/contracts/character-routes.d.ts.map +1 -0
- package/contracts/character-routes.js +49 -0
- package/contracts/character-routes.js.map +1 -0
- package/contracts/cloud-coding-containers.d.ts +432 -0
- package/contracts/cloud-coding-containers.d.ts.map +1 -0
- package/contracts/cloud-coding-containers.js +135 -0
- package/contracts/cloud-coding-containers.js.map +1 -0
- package/contracts/cloud-topology.js +72 -0
- package/contracts/cloud-topology.js.map +1 -0
- package/contracts/connector-routes.d.ts +39 -0
- package/contracts/connector-routes.d.ts.map +1 -0
- package/contracts/connector-routes.js +50 -0
- package/contracts/connector-routes.js.map +1 -0
- package/contracts/content-pack.d.ts +131 -0
- package/contracts/content-pack.d.ts.map +1 -0
- package/contracts/content-pack.js +103 -0
- package/contracts/conversation-routes.d.ts +191 -0
- package/contracts/conversation-routes.d.ts.map +1 -0
- package/contracts/conversation-routes.js +106 -0
- package/contracts/conversation-routes.js.map +1 -0
- package/contracts/diagnostics-routes.d.ts +33 -0
- package/contracts/diagnostics-routes.d.ts.map +1 -0
- package/contracts/diagnostics-routes.js +26 -0
- package/contracts/diagnostics-routes.js.map +1 -0
- package/contracts/first-run-options.d.ts +531 -0
- package/contracts/first-run-options.d.ts.map +1 -0
- package/contracts/first-run-options.js +1186 -0
- package/contracts/first-run-options.js.map +1 -0
- package/contracts/first-run-routes.d.ts +167 -0
- package/contracts/first-run-routes.d.ts.map +1 -0
- package/contracts/first-run-routes.js +115 -0
- package/contracts/first-run-routes.js.map +1 -0
- package/contracts/health.d.ts +30 -0
- package/contracts/health.d.ts.map +1 -0
- package/contracts/health.js +29 -0
- package/contracts/health.js.map +1 -0
- package/contracts/inbox-routes.d.ts +37 -0
- package/contracts/inbox-routes.d.ts.map +1 -0
- package/contracts/inbox-routes.js +44 -0
- package/contracts/inbox-routes.js.map +1 -0
- package/contracts/index.d.ts +42 -0
- package/contracts/index.d.ts.map +1 -0
- package/contracts/index.js +42 -0
- package/contracts/index.js.map +1 -0
- package/contracts/memory-routes.d.ts +27 -0
- package/contracts/memory-routes.d.ts.map +1 -0
- package/contracts/memory-routes.js +23 -0
- package/contracts/memory-routes.js.map +1 -0
- package/contracts/misc-routes.d.ts +192 -0
- package/contracts/misc-routes.d.ts.map +1 -0
- package/contracts/misc-routes.js +155 -0
- package/contracts/misc-routes.js.map +1 -0
- package/contracts/permissions-routes.d.ts +31 -0
- package/contracts/permissions-routes.d.ts.map +1 -0
- package/contracts/permissions-routes.js +34 -0
- package/contracts/permissions-routes.js.map +1 -0
- package/contracts/permissions.d.ts +109 -0
- package/contracts/permissions.d.ts.map +1 -0
- package/contracts/permissions.js +41 -0
- package/contracts/permissions.js.map +1 -0
- package/contracts/personal-assistant.d.ts +2931 -0
- package/contracts/personal-assistant.d.ts.map +1 -0
- package/contracts/personal-assistant.js +583 -0
- package/contracts/personal-assistant.js.map +1 -0
- package/contracts/plugin-routes.d.ts +105 -0
- package/contracts/plugin-routes.d.ts.map +1 -0
- package/contracts/plugin-routes.js +81 -0
- package/contracts/plugin-routes.js.map +1 -0
- package/contracts/relationships-routes.d.ts +23 -0
- package/contracts/relationships-routes.d.ts.map +1 -0
- package/contracts/relationships-routes.js +22 -0
- package/contracts/relationships-routes.js.map +1 -0
- package/contracts/service-routing.d.ts +49 -0
- package/contracts/service-routing.d.ts.map +1 -0
- package/contracts/service-routing.js +403 -0
- package/contracts/service-routing.js.map +1 -0
- package/contracts/skills-routes.d.ts +116 -0
- package/contracts/skills-routes.d.ts.map +1 -0
- package/contracts/skills-routes.js +115 -0
- package/contracts/skills-routes.js.map +1 -0
- package/contracts/subscription-routes.d.ts +47 -0
- package/contracts/subscription-routes.d.ts.map +1 -0
- package/contracts/subscription-routes.js +50 -0
- package/contracts/subscription-routes.js.map +1 -0
- package/contracts/tail-routes.d.ts +78 -0
- package/contracts/tail-routes.d.ts.map +1 -0
- package/contracts/tail-routes.js +63 -0
- package/contracts/tail-routes.js.map +1 -0
- package/contracts/theme.d.ts +134 -0
- package/contracts/theme.d.ts.map +1 -0
- package/contracts/theme.js +132 -0
- package/contracts/theme.js.map +1 -0
- package/contracts/update-status.d.ts +100 -0
- package/contracts/update-status.d.ts.map +1 -0
- package/contracts/update-status.js +45 -0
- package/contracts/update-status.js.map +1 -0
- package/contracts/wallet-routes.d.ts +82 -0
- package/contracts/wallet-routes.d.ts.map +1 -0
- package/contracts/wallet-routes.js +49 -0
- package/contracts/wallet-routes.js.map +1 -0
- package/contracts/wallet.d.ts +57 -0
- package/contracts/wallet.d.ts.map +1 -0
- package/contracts/wallet.js +200 -0
- package/contracts/wallet.js.map +1 -0
- package/contracts/workbench-routes.d.ts +231 -0
- package/contracts/workbench-routes.d.ts.map +1 -0
- package/contracts/workbench-routes.js +183 -0
- package/contracts/workbench-routes.js.map +1 -0
- package/db/drizzle-database.d.ts +13 -0
- package/db/drizzle-database.d.ts.map +1 -0
- package/db/drizzle-database.js +2 -0
- package/db/drizzle-database.js.map +1 -0
- package/dev-settings-banner-style.d.ts +14 -0
- package/dev-settings-banner-style.js +58 -0
- package/dev-settings-banner-style.js.map +1 -0
- package/dev-settings-figlet-heading.d.ts.map +1 -0
- package/dev-settings-figlet-heading.js +49 -0
- package/dev-settings-figlet-heading.js.map +1 -0
- package/elizacloud/base-url.d.ts +6 -0
- package/elizacloud/base-url.d.ts.map +1 -0
- package/elizacloud/base-url.js +65 -0
- package/elizacloud/base-url.js.map +1 -0
- package/elizacloud/cloud-provisioning.d.ts +9 -0
- package/elizacloud/cloud-provisioning.d.ts.map +1 -0
- package/elizacloud/cloud-provisioning.js +25 -0
- package/elizacloud/cloud-provisioning.js.map +1 -0
- package/elizacloud/cloud-secrets.d.ts +23 -0
- package/elizacloud/cloud-secrets.d.ts.map +1 -0
- package/elizacloud/cloud-secrets.js +51 -0
- package/elizacloud/cloud-secrets.js.map +1 -0
- package/elizacloud/index.d.ts +6 -0
- package/elizacloud/index.d.ts.map +1 -0
- package/elizacloud/index.js +6 -0
- package/elizacloud/index.js.map +1 -0
- package/elizacloud/is-cloud-reachable.d.ts +19 -0
- package/elizacloud/is-cloud-reachable.d.ts.map +1 -0
- package/elizacloud/is-cloud-reachable.js +44 -0
- package/elizacloud/is-cloud-reachable.js.map +1 -0
- package/elizacloud/server-cloud-tts.d.ts +21 -0
- package/elizacloud/server-cloud-tts.d.ts.map +1 -0
- package/elizacloud/server-cloud-tts.js +293 -0
- package/elizacloud/server-cloud-tts.js.map +1 -0
- package/email-classification/email-classifier.d.ts +57 -0
- package/email-classification/email-classifier.d.ts.map +1 -0
- package/email-classification/email-classifier.js +348 -0
- package/email-classification/email-classifier.js.map +1 -0
- package/email-classification/index.d.ts +12 -0
- package/email-classification/index.d.ts.map +1 -0
- package/email-classification/index.js +12 -0
- package/email-classification/index.js.map +1 -0
- package/email-classification/wrap-untrusted-email-content.d.ts +15 -0
- package/email-classification/wrap-untrusted-email-content.d.ts.map +1 -0
- package/email-classification/wrap-untrusted-email-content.js +24 -0
- package/email-classification/wrap-untrusted-email-content.js.map +1 -0
- package/env-utils.d.ts +11 -0
- package/env-utils.d.ts.map +1 -0
- package/env-utils.js +11 -0
- package/env-utils.js.map +1 -0
- package/events/index.d.ts +68 -0
- package/events/index.d.ts.map +1 -0
- package/events/index.js +53 -0
- package/events/index.js.map +1 -0
- package/events.d.ts +2 -0
- package/events.d.ts.map +1 -0
- package/events.js +2 -0
- package/events.js.map +1 -0
- package/format-error.d.ts +15 -0
- package/format-error.d.ts.map +1 -0
- package/format-error.js +17 -0
- package/format-error.js.map +1 -0
- package/hardware-catalog/index.d.ts +204 -0
- package/hardware-catalog/index.d.ts.map +1 -0
- package/hardware-catalog/index.js +174 -0
- package/hardware-catalog/index.js.map +1 -0
- package/i18n/generated/validation-keyword-data.d.ts +3054 -0
- package/i18n/generated/validation-keyword-data.d.ts.map +1 -0
- package/i18n/generated/validation-keyword-data.js +3058 -0
- package/i18n/generated/validation-keyword-data.js.map +1 -0
- package/i18n/keyword-matching.d.ts.map +1 -0
- package/i18n/keyword-matching.js +116 -0
- package/i18n/keyword-matching.js.map +1 -0
- package/index.d.ts +106 -0
- package/index.d.ts.map +1 -0
- package/index.js +139 -0
- package/index.js.map +1 -0
- package/knowledge-graph/entity-types.d.ts +135 -0
- package/knowledge-graph/entity-types.d.ts.map +1 -0
- package/knowledge-graph/entity-types.js +75 -0
- package/knowledge-graph/entity-types.js.map +1 -0
- package/knowledge-graph/index.d.ts +13 -0
- package/knowledge-graph/index.d.ts.map +1 -0
- package/knowledge-graph/index.js +13 -0
- package/knowledge-graph/index.js.map +1 -0
- package/knowledge-graph/merge.d.ts +76 -0
- package/knowledge-graph/merge.d.ts.map +1 -0
- package/knowledge-graph/merge.js +175 -0
- package/knowledge-graph/merge.js.map +1 -0
- package/knowledge-graph/relationship-types.d.ts +105 -0
- package/knowledge-graph/relationship-types.d.ts.map +1 -0
- package/knowledge-graph/relationship-types.js +114 -0
- package/knowledge-graph/relationship-types.js.map +1 -0
- package/lifeops-constants/index.d.ts +9 -0
- package/lifeops-constants/index.d.ts.map +1 -0
- package/lifeops-constants/index.js +9 -0
- package/lifeops-constants/index.js.map +1 -0
- package/lifeops-constants/service-constants.d.ts +79 -0
- package/lifeops-constants/service-constants.d.ts.map +1 -0
- package/lifeops-constants/service-constants.js +123 -0
- package/lifeops-constants/service-constants.js.map +1 -0
- package/lifeops-normalize/index.d.ts +12 -0
- package/lifeops-normalize/index.d.ts.map +1 -0
- package/lifeops-normalize/index.js +12 -0
- package/lifeops-normalize/index.js.map +1 -0
- package/lifeops-normalize/service-error.d.ts +14 -0
- package/lifeops-normalize/service-error.d.ts.map +1 -0
- package/lifeops-normalize/service-error.js +19 -0
- package/lifeops-normalize/service-error.js.map +1 -0
- package/lifeops-normalize/service-normalize.d.ts +38 -0
- package/lifeops-normalize/service-normalize.d.ts.map +1 -0
- package/lifeops-normalize/service-normalize.js +205 -0
- package/lifeops-normalize/service-normalize.js.map +1 -0
- package/lifeops-normalize/time-zone.d.ts +12 -0
- package/lifeops-normalize/time-zone.d.ts.map +1 -0
- package/lifeops-normalize/time-zone.js +29 -0
- package/lifeops-normalize/time-zone.js.map +1 -0
- package/local-inference/catalog.d.ts +122 -0
- package/local-inference/catalog.d.ts.map +1 -0
- package/local-inference/catalog.js +534 -0
- package/local-inference/catalog.js.map +1 -0
- package/local-inference/device-fit.d.ts +73 -0
- package/local-inference/device-fit.d.ts.map +1 -0
- package/local-inference/device-fit.js +155 -0
- package/local-inference/device-fit.js.map +1 -0
- package/local-inference/gpu-profiles.d.ts +110 -0
- package/local-inference/gpu-profiles.d.ts.map +1 -0
- package/local-inference/gpu-profiles.js +191 -0
- package/local-inference/gpu-profiles.js.map +1 -0
- package/local-inference/hf-proxy.d.ts +43 -0
- package/local-inference/hf-proxy.d.ts.map +1 -0
- package/local-inference/hf-proxy.js +50 -0
- package/local-inference/hf-proxy.js.map +1 -0
- package/local-inference/hub-auth.d.ts +26 -0
- package/local-inference/hub-auth.d.ts.map +1 -0
- package/local-inference/hub-auth.js +48 -0
- package/local-inference/hub-auth.js.map +1 -0
- package/local-inference/index.d.ts +26 -0
- package/local-inference/index.d.ts.map +1 -0
- package/local-inference/index.js +23 -0
- package/local-inference/index.js.map +1 -0
- package/local-inference/manifest-signature.d.ts +61 -0
- package/local-inference/manifest-signature.d.ts.map +1 -0
- package/local-inference/manifest-signature.js +129 -0
- package/local-inference/manifest-signature.js.map +1 -0
- package/local-inference/network-policy.d.ts +115 -0
- package/local-inference/network-policy.d.ts.map +1 -0
- package/local-inference/network-policy.js +154 -0
- package/local-inference/network-policy.js.map +1 -0
- package/local-inference/paths.d.ts +24 -0
- package/local-inference/paths.js +40 -0
- package/local-inference/providers-types.d.ts +56 -0
- package/local-inference/providers-types.d.ts.map +1 -0
- package/local-inference/providers-types.js +19 -0
- package/local-inference/providers-types.js.map +1 -0
- package/local-inference/routing-preferences.d.ts +42 -0
- package/local-inference/routing-preferences.d.ts.map +1 -0
- package/local-inference/routing-preferences.js +96 -0
- package/local-inference/routing-preferences.js.map +1 -0
- package/local-inference/runtime-class.d.ts +29 -0
- package/local-inference/runtime-class.d.ts.map +1 -0
- package/local-inference/runtime-class.js +30 -0
- package/local-inference/runtime-class.js.map +1 -0
- package/local-inference/throughput.d.ts +74 -0
- package/local-inference/throughput.d.ts.map +1 -0
- package/local-inference/throughput.js +84 -0
- package/local-inference/throughput.js.map +1 -0
- package/local-inference/types.d.ts +548 -0
- package/local-inference/types.d.ts.map +1 -0
- package/local-inference/types.js +22 -0
- package/local-inference/types.js.map +1 -0
- package/local-inference/voice-models.d.ts +156 -0
- package/local-inference/voice-models.d.ts.map +1 -0
- package/local-inference/voice-models.js +769 -0
- package/local-inference/voice-models.js.map +1 -0
- package/local-inference-gpu/gpu-overrides.d.ts +97 -0
- package/local-inference-gpu/gpu-overrides.d.ts.map +1 -0
- package/local-inference-gpu/gpu-overrides.js +76 -0
- package/local-inference-gpu/gpu-overrides.js.map +1 -0
- package/local-inference-gpu/gpu-profile-loader.d.ts +83 -0
- package/local-inference-gpu/gpu-profile-loader.d.ts.map +1 -0
- package/local-inference-gpu/gpu-profile-loader.js +196 -0
- package/local-inference-gpu/gpu-profile-loader.js.map +1 -0
- package/local-inference-gpu/gpu-profile-schema.d.ts +208 -0
- package/local-inference-gpu/gpu-profile-schema.d.ts.map +1 -0
- package/local-inference-gpu/gpu-profile-schema.js +123 -0
- package/local-inference-gpu/gpu-profile-schema.js.map +1 -0
- package/local-inference-gpu/gpu-tier-detect.d.ts +61 -0
- package/local-inference-gpu/gpu-tier-detect.d.ts.map +1 -0
- package/local-inference-gpu/gpu-tier-detect.js +93 -0
- package/local-inference-gpu/gpu-tier-detect.js.map +1 -0
- package/local-inference-gpu/gpu-tier-profiles.d.ts +110 -0
- package/local-inference-gpu/gpu-tier-profiles.d.ts.map +1 -0
- package/local-inference-gpu/gpu-tier-profiles.js +235 -0
- package/local-inference-gpu/gpu-tier-profiles.js.map +1 -0
- package/loopback-trust.d.ts +73 -0
- package/loopback-trust.d.ts.map +1 -0
- package/loopback-trust.js +241 -0
- package/loopback-trust.js.map +1 -0
- package/package.json +208 -30
- package/restart.d.ts +28 -0
- package/restart.d.ts.map +1 -0
- package/restart.js +30 -0
- package/restart.js.map +1 -0
- package/runtime-env.d.ts +84 -0
- package/runtime-env.d.ts.map +1 -0
- package/runtime-env.js +270 -0
- package/runtime-env.js.map +1 -0
- package/self-edit.d.ts +64 -0
- package/self-edit.d.ts.map +1 -0
- package/self-edit.js +133 -0
- package/self-edit.js.map +1 -0
- package/settings-debug.d.ts +9 -0
- package/settings-debug.d.ts.map +1 -0
- package/settings-debug.js +9 -0
- package/settings-debug.js.map +1 -0
- package/spoken-text.d.ts.map +1 -0
- package/spoken-text.js +58 -0
- package/spoken-text.js.map +1 -0
- package/steward-session-client/index.d.ts +150 -0
- package/steward-session-client/index.d.ts.map +1 -0
- package/steward-session-client/index.js +192 -0
- package/steward-session-client/index.js.map +1 -0
- package/steward-session-client/steward-oauth-pkce.d.ts +24 -0
- package/steward-session-client/steward-oauth-pkce.d.ts.map +1 -0
- package/steward-session-client/steward-oauth-pkce.js +105 -0
- package/steward-session-client/steward-oauth-pkce.js.map +1 -0
- package/test-env-config.d.ts +81 -0
- package/test-env-config.d.ts.map +1 -0
- package/test-env-config.js +125 -0
- package/test-env-config.js.map +1 -0
- package/test-support/test-helpers.d.ts +79 -0
- package/test-support/test-helpers.d.ts.map +1 -0
- package/test-support/test-helpers.js +341 -0
- package/test-support/test-helpers.js.map +1 -0
- package/transcripts.d.ts +141 -0
- package/transcripts.d.ts.map +1 -0
- package/transcripts.js +162 -0
- package/transcripts.js.map +1 -0
- package/type-guards.d.ts +7 -0
- package/type-guards.d.ts.map +1 -0
- package/type-guards.js +27 -0
- package/type-guards.js.map +1 -0
- package/types/index.d.ts +654 -0
- package/types/index.d.ts.map +1 -0
- package/utils/assistant-text.d.ts +13 -0
- package/utils/assistant-text.d.ts.map +1 -0
- package/utils/assistant-text.js +292 -0
- package/utils/assistant-text.js.map +1 -0
- package/utils/browser-tab-kit-types.d.ts +81 -0
- package/utils/browser-tab-kit-types.js +23 -0
- package/utils/browser-tabs-renderer-registry.d.ts +56 -0
- package/utils/browser-tabs-renderer-registry.d.ts.map +1 -0
- package/utils/browser-tabs-renderer-registry.js +1282 -0
- package/utils/browser-tabs-renderer-registry.js.map +1 -0
- package/utils/documents-upload-image.js +147 -0
- package/utils/documents-upload-image.js.map +1 -0
- package/utils/env.d.ts +35 -0
- package/utils/env.d.ts.map +1 -0
- package/utils/env.js +133 -0
- package/utils/env.js.map +1 -0
- package/utils/errors.d.ts +14 -0
- package/utils/errors.d.ts.map +1 -0
- package/utils/errors.js +23 -0
- package/utils/errors.js.map +1 -0
- package/utils/exec-safety.d.ts.map +1 -0
- package/utils/exec-safety.js +25 -0
- package/utils/exec-safety.js.map +1 -0
- package/utils/format.d.ts +85 -0
- package/utils/format.d.ts.map +1 -0
- package/utils/format.js +140 -0
- package/utils/format.js.map +1 -0
- package/utils/log-prefix.d.ts.map +1 -0
- package/utils/log-prefix.js +44 -0
- package/utils/log-prefix.js.map +1 -0
- package/utils/name-tokens.d.ts +24 -0
- package/utils/name-tokens.js +37 -0
- package/utils/namespace-defaults.d.ts +10 -0
- package/utils/namespace-defaults.d.ts.map +1 -0
- package/utils/namespace-defaults.js +17 -0
- package/utils/namespace-defaults.js.map +1 -0
- package/utils/number-parsing.d.ts.map +1 -0
- package/utils/number-parsing.js +57 -0
- package/utils/number-parsing.js.map +1 -0
- package/utils/permission-deep-links.d.ts +35 -0
- package/utils/permission-deep-links.d.ts.map +1 -0
- package/utils/permission-deep-links.js +95 -0
- package/utils/permission-deep-links.js.map +1 -0
- package/utils/serialise.js +22 -0
- package/utils/serialise.js.map +1 -0
- package/utils/sql-compat.js +112 -0
- package/utils/sql-compat.js.map +1 -0
- package/utils/streaming-text.d.ts +9 -0
- package/utils/streaming-text.d.ts.map +1 -0
- package/utils/streaming-text.js +116 -0
- package/utils/streaming-text.js.map +1 -0
- package/utils/string-hash.d.ts +11 -0
- package/utils/string-hash.d.ts.map +1 -0
- package/utils/string-hash.js +17 -0
- package/utils/string-hash.js.map +1 -0
- package/utils/tts-debug.d.ts +10 -0
- package/utils/tts-debug.d.ts.map +1 -0
- package/utils/tts-debug.js +73 -0
- package/utils/tts-debug.js.map +1 -0
- package/view-hero-art.d.ts +75 -0
- package/view-hero-art.d.ts.map +1 -0
- package/view-hero-art.js +354 -0
- package/view-hero-art.js.map +1 -0
- package/voice/first-sentence-snip.d.ts +68 -0
- package/voice/first-sentence-snip.d.ts.map +1 -0
- package/voice/first-sentence-snip.js +284 -0
- package/voice/first-sentence-snip.js.map +1 -0
- package/voice/owner-inference.d.ts +57 -0
- package/voice/owner-inference.d.ts.map +1 -0
- package/voice/owner-inference.js +73 -0
- package/voice/owner-inference.js.map +1 -0
- package/voice/respond-gate.d.ts +88 -0
- package/voice/respond-gate.d.ts.map +1 -0
- package/voice/respond-gate.js +139 -0
- package/voice/respond-gate.js.map +1 -0
- package/voice/voice-cancellation-token.d.ts +127 -0
- package/voice/voice-cancellation-token.d.ts.map +1 -0
- package/voice/voice-cancellation-token.js +186 -0
- package/voice/voice-cancellation-token.js.map +1 -0
- package/voice-eot.d.ts +42 -0
- package/voice-eot.d.ts.map +1 -0
- package/voice-eot.js +158 -0
- package/voice-eot.js.map +1 -0
- package/voice-wer.d.ts +19 -0
- package/voice-wer.d.ts.map +1 -0
- package/voice-wer.js +42 -0
- package/voice-wer.js.map +1 -0
- package/voice.d.ts +55 -0
- package/voice.d.ts.map +1 -0
- package/voice.js +337 -0
- package/voice.js.map +1 -0
- package/dist/api/chat-contracts.d.ts +0 -2
- package/dist/api/chat-contracts.d.ts.map +0 -1
- package/dist/api/chat-contracts.js +0 -2
- package/dist/api/chat-contracts.js.map +0 -1
- package/dist/api/http-helpers.d.ts +0 -50
- package/dist/api/http-helpers.d.ts.map +0 -1
- package/dist/api/http-helpers.js +0 -168
- package/dist/api/http-helpers.js.map +0 -1
- package/dist/api/route-helpers.d.ts +0 -16
- package/dist/api/route-helpers.d.ts.map +0 -1
- package/dist/app-hero-art.d.ts.map +0 -1
- package/dist/app-hero-art.js +0 -358
- package/dist/app-hero-art.js.map +0 -1
- package/dist/cli/parse-duration.d.ts.map +0 -1
- package/dist/cli/parse-duration.js +0 -28
- package/dist/cli/parse-duration.js.map +0 -1
- package/dist/config/allowed-hosts.js +0 -44
- package/dist/config/allowed-hosts.js.map +0 -1
- package/dist/config/api-key-prefix-hints.d.ts +0 -25
- package/dist/config/api-key-prefix-hints.d.ts.map +0 -1
- package/dist/config/api-key-prefix-hints.js +0 -27
- package/dist/config/api-key-prefix-hints.js.map +0 -1
- package/dist/config/app-config.d.ts +0 -273
- package/dist/config/app-config.d.ts.map +0 -1
- package/dist/config/app-config.js +0 -32
- package/dist/config/app-config.js.map +0 -1
- package/dist/config/app-manifest.d.ts.map +0 -1
- package/dist/config/app-manifest.js +0 -109
- package/dist/config/app-manifest.js.map +0 -1
- package/dist/config/boot-config-react.d.ts +0 -5
- package/dist/config/boot-config-react.d.ts.map +0 -1
- package/dist/config/boot-config-react.js +0 -8
- package/dist/config/boot-config-react.js.map +0 -1
- package/dist/config/boot-config-store.d.ts +0 -74
- package/dist/config/boot-config-store.d.ts.map +0 -1
- package/dist/config/boot-config-store.js +0 -121
- package/dist/config/boot-config-store.js.map +0 -1
- package/dist/config/branding-react.d.ts +0 -4
- package/dist/config/branding-react.d.ts.map +0 -1
- package/dist/config/branding-react.js +0 -12
- package/dist/config/branding-react.js.map +0 -1
- package/dist/config/branding.d.ts +0 -53
- package/dist/config/branding.d.ts.map +0 -1
- package/dist/config/branding.js +0 -23
- package/dist/config/branding.js.map +0 -1
- package/dist/config/cloud-only.d.ts +0 -6
- package/dist/config/cloud-only.d.ts.map +0 -1
- package/dist/config/cloud-only.js +0 -16
- package/dist/config/cloud-only.js.map +0 -1
- package/dist/config/config-catalog.d.ts.map +0 -1
- package/dist/config/config-catalog.js +0 -710
- package/dist/config/config-catalog.js.map +0 -1
- package/dist/config/config.js +0 -23
- package/dist/config/config.js.map +0 -1
- package/dist/config/distribution-profile.js +0 -29
- package/dist/config/distribution-profile.js.map +0 -1
- package/dist/config/env-vars.d.ts.map +0 -1
- package/dist/config/index.d.ts +0 -14
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -17
- package/dist/config/index.js.map +0 -1
- package/dist/config/plugin-auto-enable-engine.js +0 -45
- package/dist/config/plugin-auto-enable-engine.js.map +0 -1
- package/dist/config/plugin-manifest.d.ts.map +0 -1
- package/dist/config/plugin-manifest.js +0 -272
- package/dist/config/plugin-manifest.js.map +0 -1
- package/dist/config/runtime-mode.d.ts.map +0 -1
- package/dist/config/runtime-mode.js +0 -103
- package/dist/config/runtime-mode.js.map +0 -1
- package/dist/config/types.agent-defaults.d.ts +0 -383
- package/dist/config/types.agent-defaults.d.ts.map +0 -1
- package/dist/config/types.agents.d.ts +0 -114
- package/dist/config/types.agents.d.ts.map +0 -1
- package/dist/config/types.eliza.d.ts +0 -689
- package/dist/config/types.eliza.d.ts.map +0 -1
- package/dist/config/types.messages.d.ts +0 -176
- package/dist/config/types.messages.d.ts.map +0 -1
- package/dist/config/types.tools.d.ts +0 -400
- package/dist/config/types.tools.d.ts.map +0 -1
- package/dist/config/ui-spec.d.ts +0 -164
- package/dist/config/ui-spec.d.ts.map +0 -1
- package/dist/config/zod-schema.agent-runtime.d.ts +0 -1087
- package/dist/config/zod-schema.core.d.ts +0 -1048
- package/dist/connectors.d.ts +0 -2
- package/dist/connectors.d.ts.map +0 -1
- package/dist/connectors.js +0 -2
- package/dist/connectors.js.map +0 -1
- package/dist/contracts/apps.d.ts +0 -279
- package/dist/contracts/apps.d.ts.map +0 -1
- package/dist/contracts/apps.js +0 -218
- package/dist/contracts/apps.js.map +0 -1
- package/dist/contracts/cloud-topology.js +0 -72
- package/dist/contracts/cloud-topology.js.map +0 -1
- package/dist/contracts/content-pack.d.ts +0 -131
- package/dist/contracts/content-pack.d.ts.map +0 -1
- package/dist/contracts/content-pack.js +0 -103
- package/dist/contracts/health.d.ts +0 -30
- package/dist/contracts/health.d.ts.map +0 -1
- package/dist/contracts/health.js +0 -29
- package/dist/contracts/health.js.map +0 -1
- package/dist/contracts/index.d.ts +0 -16
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js +0 -16
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/lifeops.d.ts +0 -3140
- package/dist/contracts/lifeops.d.ts.map +0 -1
- package/dist/contracts/lifeops.js +0 -587
- package/dist/contracts/lifeops.js.map +0 -1
- package/dist/contracts/onboarding.d.ts +0 -507
- package/dist/contracts/onboarding.d.ts.map +0 -1
- package/dist/contracts/onboarding.js +0 -1141
- package/dist/contracts/onboarding.js.map +0 -1
- package/dist/contracts/permissions.d.ts +0 -121
- package/dist/contracts/permissions.d.ts.map +0 -1
- package/dist/contracts/permissions.js +0 -31
- package/dist/contracts/permissions.js.map +0 -1
- package/dist/contracts/service-routing.d.ts +0 -155
- package/dist/contracts/service-routing.d.ts.map +0 -1
- package/dist/contracts/service-routing.js +0 -395
- package/dist/contracts/service-routing.js.map +0 -1
- package/dist/contracts/theme.d.ts +0 -136
- package/dist/contracts/theme.d.ts.map +0 -1
- package/dist/contracts/theme.js +0 -134
- package/dist/contracts/theme.js.map +0 -1
- package/dist/contracts/wallet.d.ts +0 -622
- package/dist/contracts/wallet.d.ts.map +0 -1
- package/dist/contracts/wallet.js +0 -194
- package/dist/contracts/wallet.js.map +0 -1
- package/dist/dev-settings-banner-style.d.ts +0 -14
- package/dist/dev-settings-banner-style.js +0 -58
- package/dist/dev-settings-banner-style.js.map +0 -1
- package/dist/dev-settings-figlet-heading.d.ts.map +0 -1
- package/dist/dev-settings-figlet-heading.js +0 -56
- package/dist/dev-settings-figlet-heading.js.map +0 -1
- package/dist/env-utils.d.ts +0 -2
- package/dist/env-utils.d.ts.map +0 -1
- package/dist/env-utils.js +0 -13
- package/dist/env-utils.js.map +0 -1
- package/dist/events/index.d.ts +0 -62
- package/dist/events/index.d.ts.map +0 -1
- package/dist/events/index.js +0 -52
- package/dist/events/index.js.map +0 -1
- package/dist/format-error.d.ts +0 -14
- package/dist/format-error.d.ts.map +0 -1
- package/dist/format-error.js +0 -18
- package/dist/format-error.js.map +0 -1
- package/dist/i18n/generated/validation-keyword-data.d.ts +0 -3080
- package/dist/i18n/generated/validation-keyword-data.d.ts.map +0 -1
- package/dist/i18n/generated/validation-keyword-data.js +0 -3084
- package/dist/i18n/generated/validation-keyword-data.js.map +0 -1
- package/dist/i18n/keyword-matching.d.ts.map +0 -1
- package/dist/i18n/keyword-matching.js +0 -113
- package/dist/i18n/keyword-matching.js.map +0 -1
- package/dist/index.d.ts +0 -93
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -105
- package/dist/index.js.map +0 -1
- package/dist/local-inference/index.d.ts +0 -16
- package/dist/local-inference/index.d.ts.map +0 -1
- package/dist/local-inference/index.js +0 -16
- package/dist/local-inference/index.js.map +0 -1
- package/dist/local-inference/paths.d.ts +0 -24
- package/dist/local-inference/paths.js +0 -40
- package/dist/local-inference/routing-preferences.d.ts +0 -31
- package/dist/local-inference/routing-preferences.d.ts.map +0 -1
- package/dist/local-inference/routing-preferences.js +0 -73
- package/dist/local-inference/routing-preferences.js.map +0 -1
- package/dist/local-inference/types.d.ts +0 -62
- package/dist/local-inference/types.d.ts.map +0 -1
- package/dist/local-inference/types.js +0 -25
- package/dist/local-inference/types.js.map +0 -1
- package/dist/onboarding-presets.characters.d.ts +0 -22
- package/dist/onboarding-presets.characters.d.ts.map +0 -1
- package/dist/onboarding-presets.characters.js +0 -2617
- package/dist/onboarding-presets.characters.js.map +0 -1
- package/dist/onboarding-presets.d.ts +0 -40
- package/dist/onboarding-presets.d.ts.map +0 -1
- package/dist/onboarding-presets.js +0 -181
- package/dist/onboarding-presets.js.map +0 -1
- package/dist/onboarding-presets.shared.d.ts +0 -2
- package/dist/onboarding-presets.shared.d.ts.map +0 -1
- package/dist/onboarding-presets.shared.js +0 -8
- package/dist/onboarding-presets.shared.js.map +0 -1
- package/dist/package.json +0 -50
- package/dist/restart.d.ts +0 -27
- package/dist/restart.d.ts.map +0 -1
- package/dist/restart.js +0 -29
- package/dist/restart.js.map +0 -1
- package/dist/runtime-env.d.ts +0 -84
- package/dist/runtime-env.d.ts.map +0 -1
- package/dist/runtime-env.js +0 -262
- package/dist/runtime-env.js.map +0 -1
- package/dist/self-edit.d.ts +0 -64
- package/dist/self-edit.d.ts.map +0 -1
- package/dist/self-edit.js +0 -133
- package/dist/self-edit.js.map +0 -1
- package/dist/settings-debug.d.ts +0 -20
- package/dist/settings-debug.d.ts.map +0 -1
- package/dist/settings-debug.js +0 -122
- package/dist/settings-debug.js.map +0 -1
- package/dist/spoken-text.d.ts.map +0 -1
- package/dist/spoken-text.js +0 -57
- package/dist/spoken-text.js.map +0 -1
- package/dist/test-support/test-helpers.d.ts +0 -112
- package/dist/test-support/test-helpers.d.ts.map +0 -1
- package/dist/test-support/test-helpers.js +0 -416
- package/dist/test-support/test-helpers.js.map +0 -1
- package/dist/themes/index.d.ts +0 -7
- package/dist/themes/index.d.ts.map +0 -1
- package/dist/themes/index.js +0 -6
- package/dist/themes/index.js.map +0 -1
- package/dist/themes/presets.d.ts +0 -15
- package/dist/themes/presets.d.ts.map +0 -1
- package/dist/themes/presets.js +0 -789
- package/dist/themes/presets.js.map +0 -1
- package/dist/type-guards.d.ts +0 -30
- package/dist/type-guards.d.ts.map +0 -1
- package/dist/type-guards.js +0 -50
- package/dist/type-guards.js.map +0 -1
- package/dist/types/index.d.ts +0 -655
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/assistant-text.d.ts +0 -2
- package/dist/utils/assistant-text.d.ts.map +0 -1
- package/dist/utils/assistant-text.js +0 -168
- package/dist/utils/assistant-text.js.map +0 -1
- package/dist/utils/browser-tab-kit-types.d.ts +0 -81
- package/dist/utils/browser-tab-kit-types.js +0 -23
- package/dist/utils/browser-tabs-renderer-registry.d.ts +0 -56
- package/dist/utils/browser-tabs-renderer-registry.d.ts.map +0 -1
- package/dist/utils/browser-tabs-renderer-registry.js +0 -962
- package/dist/utils/browser-tabs-renderer-registry.js.map +0 -1
- package/dist/utils/documents-upload-image.js +0 -147
- package/dist/utils/documents-upload-image.js.map +0 -1
- package/dist/utils/env.d.ts +0 -34
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/env.js +0 -131
- package/dist/utils/env.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -13
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -26
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/exec-safety.d.ts.map +0 -1
- package/dist/utils/exec-safety.js +0 -22
- package/dist/utils/exec-safety.js.map +0 -1
- package/dist/utils/format.d.ts +0 -66
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/format.js +0 -122
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/index.d.ts +0 -12
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -12
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/log-prefix.d.ts.map +0 -1
- package/dist/utils/log-prefix.js +0 -54
- package/dist/utils/log-prefix.js.map +0 -1
- package/dist/utils/name-tokens.d.ts +0 -24
- package/dist/utils/name-tokens.js +0 -37
- package/dist/utils/namespace-defaults.d.ts +0 -6
- package/dist/utils/namespace-defaults.d.ts.map +0 -1
- package/dist/utils/namespace-defaults.js +0 -16
- package/dist/utils/namespace-defaults.js.map +0 -1
- package/dist/utils/number-parsing.d.ts.map +0 -1
- package/dist/utils/number-parsing.js +0 -52
- package/dist/utils/number-parsing.js.map +0 -1
- package/dist/utils/permission-deep-links.d.ts +0 -34
- package/dist/utils/permission-deep-links.d.ts.map +0 -1
- package/dist/utils/permission-deep-links.js +0 -84
- package/dist/utils/permission-deep-links.js.map +0 -1
- package/dist/utils/serialise.js +0 -22
- package/dist/utils/serialise.js.map +0 -1
- package/dist/utils/sql-compat.js +0 -112
- package/dist/utils/sql-compat.js.map +0 -1
- package/dist/utils/streaming-text.d.ts +0 -9
- package/dist/utils/streaming-text.d.ts.map +0 -1
- package/dist/utils/streaming-text.js +0 -113
- package/dist/utils/streaming-text.js.map +0 -1
- package/dist/utils/tts-debug.d.ts +0 -9
- package/dist/utils/tts-debug.d.ts.map +0 -1
- package/dist/utils/tts-debug.js +0 -70
- package/dist/utils/tts-debug.js.map +0 -1
- package/dist/voice.d.ts +0 -40
- package/dist/voice.d.ts.map +0 -1
- package/dist/voice.js +0 -296
- package/dist/voice.js.map +0 -1
- /package/{dist/api → api}/route-helpers.js +0 -0
- /package/{dist/api → api}/route-helpers.js.map +0 -0
- /package/{dist/app-hero-art.d.ts → app-hero-art.d.ts} +0 -0
- /package/{dist/awareness → awareness}/index.d.ts +0 -0
- /package/{dist/awareness → awareness}/index.d.ts.map +0 -0
- /package/{dist/awareness → awareness}/index.js +0 -0
- /package/{dist/awareness → awareness}/index.js.map +0 -0
- /package/{dist/awareness → awareness}/registry.d.ts +0 -0
- /package/{dist/awareness → awareness}/registry.d.ts.map +0 -0
- /package/{dist/awareness → awareness}/registry.js +0 -0
- /package/{dist/awareness → awareness}/registry.js.map +0 -0
- /package/{dist/cli → cli}/parse-duration.d.ts +0 -0
- /package/{dist/config → config}/allowed-hosts.d.ts +0 -0
- /package/{dist/config → config}/allowed-hosts.d.ts.map +0 -0
- /package/{dist/config → config}/app-manifest.d.ts +0 -0
- /package/{dist/config → config}/boot-config.d.ts +0 -0
- /package/{dist/config → config}/boot-config.d.ts.map +0 -0
- /package/{dist/config → config}/boot-config.js +0 -0
- /package/{dist/config → config}/boot-config.js.map +0 -0
- /package/{dist/config → config}/config-catalog.d.ts +0 -0
- /package/{dist/config → config}/config-paths.d.ts +0 -0
- /package/{dist/config → config}/config-paths.d.ts.map +0 -0
- /package/{dist/config → config}/config-paths.js +0 -0
- /package/{dist/config → config}/config-paths.js.map +0 -0
- /package/{dist/config → config}/config.d.ts +0 -0
- /package/{dist/config → config}/config.d.ts.map +0 -0
- /package/{dist/config → config}/distribution-profile.d.ts +0 -0
- /package/{dist/config → config}/distribution-profile.d.ts.map +0 -0
- /package/{dist/config → config}/env-vars.d.ts +0 -0
- /package/{dist/config → config}/env-vars.js +0 -0
- /package/{dist/config → config}/env-vars.js.map +0 -0
- /package/{dist/config → config}/plugin-auto-enable-engine.d.ts +0 -0
- /package/{dist/config → config}/plugin-auto-enable-engine.d.ts.map +0 -0
- /package/{dist/config → config}/plugin-auto-enable.d.ts +0 -0
- /package/{dist/config → config}/plugin-auto-enable.d.ts.map +0 -0
- /package/{dist/config → config}/plugin-auto-enable.js +0 -0
- /package/{dist/config → config}/plugin-auto-enable.js.map +0 -0
- /package/{dist/config → config}/plugin-manifest.d.ts +0 -0
- /package/{dist/config → config}/plugin-ui-spec.d.ts +0 -0
- /package/{dist/config → config}/plugin-ui-spec.d.ts.map +0 -0
- /package/{dist/config → config}/plugin-ui-spec.js +0 -0
- /package/{dist/config → config}/plugin-ui-spec.js.map +0 -0
- /package/{dist/config → config}/runtime-mode.d.ts +0 -0
- /package/{dist/config → config}/runtime-overrides.d.ts +0 -0
- /package/{dist/config → config}/runtime-overrides.d.ts.map +0 -0
- /package/{dist/config → config}/runtime-overrides.js +0 -0
- /package/{dist/config → config}/runtime-overrides.js.map +0 -0
- /package/{dist/config → config}/schema.d.ts +0 -0
- /package/{dist/config → config}/schema.d.ts.map +0 -0
- /package/{dist/config → config}/schema.js +0 -0
- /package/{dist/config → config}/schema.js.map +0 -0
- /package/{dist/config → config}/types.agent-defaults.js +0 -0
- /package/{dist/config → config}/types.agent-defaults.js.map +0 -0
- /package/{dist/config → config}/types.agents.js +0 -0
- /package/{dist/config → config}/types.agents.js.map +0 -0
- /package/{dist/config → config}/types.d.ts +0 -0
- /package/{dist/config → config}/types.d.ts.map +0 -0
- /package/{dist/config → config}/types.eliza.js +0 -0
- /package/{dist/config → config}/types.eliza.js.map +0 -0
- /package/{dist/config → config}/types.gateway.d.ts +0 -0
- /package/{dist/config → config}/types.gateway.d.ts.map +0 -0
- /package/{dist/config → config}/types.gateway.js +0 -0
- /package/{dist/config → config}/types.gateway.js.map +0 -0
- /package/{dist/config → config}/types.hooks.d.ts +0 -0
- /package/{dist/config → config}/types.hooks.d.ts.map +0 -0
- /package/{dist/config → config}/types.hooks.js +0 -0
- /package/{dist/config → config}/types.hooks.js.map +0 -0
- /package/{dist/config → config}/types.js +0 -0
- /package/{dist/config → config}/types.js.map +0 -0
- /package/{dist/config → config}/types.messages.js +0 -0
- /package/{dist/config → config}/types.messages.js.map +0 -0
- /package/{dist/config → config}/types.tools.js +0 -0
- /package/{dist/config → config}/types.tools.js.map +0 -0
- /package/{dist/config → config}/ui-spec.js +0 -0
- /package/{dist/config → config}/ui-spec.js.map +0 -0
- /package/{dist/config → config}/wechat-config.d.ts +0 -0
- /package/{dist/config → config}/wechat-config.d.ts.map +0 -0
- /package/{dist/config → config}/wechat-config.js +0 -0
- /package/{dist/config → config}/wechat-config.js.map +0 -0
- /package/{dist/config → config}/zod-schema.agent-runtime.d.ts.map +0 -0
- /package/{dist/config → config}/zod-schema.agent-runtime.js +0 -0
- /package/{dist/config → config}/zod-schema.agent-runtime.js.map +0 -0
- /package/{dist/config → config}/zod-schema.core.d.ts.map +0 -0
- /package/{dist/config → config}/zod-schema.core.js +0 -0
- /package/{dist/config → config}/zod-schema.core.js.map +0 -0
- /package/{dist/connector-cred-types.d.ts → connector-cred-types.d.ts} +0 -0
- /package/{dist/connector-cred-types.d.ts.map → connector-cred-types.d.ts.map} +0 -0
- /package/{dist/connector-cred-types.js → connector-cred-types.js} +0 -0
- /package/{dist/connector-cred-types.js.map → connector-cred-types.js.map} +0 -0
- /package/{dist/contracts → contracts}/awareness.d.ts +0 -0
- /package/{dist/contracts → contracts}/awareness.d.ts.map +0 -0
- /package/{dist/contracts → contracts}/awareness.js +0 -0
- /package/{dist/contracts → contracts}/awareness.js.map +0 -0
- /package/{dist/contracts → contracts}/cloud-topology.d.ts +0 -0
- /package/{dist/contracts → contracts}/cloud-topology.d.ts.map +0 -0
- /package/{dist/contracts → contracts}/config.d.ts +0 -0
- /package/{dist/contracts → contracts}/config.d.ts.map +0 -0
- /package/{dist/contracts → contracts}/config.js +0 -0
- /package/{dist/contracts → contracts}/config.js.map +0 -0
- /package/{dist/contracts → contracts}/content-pack.js.map +0 -0
- /package/{dist/contracts → contracts}/drop.d.ts +0 -0
- /package/{dist/contracts → contracts}/drop.d.ts.map +0 -0
- /package/{dist/contracts → contracts}/drop.js +0 -0
- /package/{dist/contracts → contracts}/drop.js.map +0 -0
- /package/{dist/contracts → contracts}/feature-result.d.ts +0 -0
- /package/{dist/contracts → contracts}/feature-result.d.ts.map +0 -0
- /package/{dist/contracts → contracts}/feature-result.js +0 -0
- /package/{dist/contracts → contracts}/feature-result.js.map +0 -0
- /package/{dist/contracts → contracts}/inbox.d.ts +0 -0
- /package/{dist/contracts → contracts}/inbox.d.ts.map +0 -0
- /package/{dist/contracts → contracts}/inbox.js +0 -0
- /package/{dist/contracts → contracts}/inbox.js.map +0 -0
- /package/{dist/contracts → contracts}/lifeops-connector-degradation.d.ts +0 -0
- /package/{dist/contracts → contracts}/lifeops-connector-degradation.d.ts.map +0 -0
- /package/{dist/contracts → contracts}/lifeops-connector-degradation.js +0 -0
- /package/{dist/contracts → contracts}/lifeops-connector-degradation.js.map +0 -0
- /package/{dist/contracts → contracts}/verification.d.ts +0 -0
- /package/{dist/contracts → contracts}/verification.d.ts.map +0 -0
- /package/{dist/contracts → contracts}/verification.js +0 -0
- /package/{dist/contracts → contracts}/verification.js.map +0 -0
- /package/{dist/dev-settings-banner-style.d.ts.map → dev-settings-banner-style.d.ts.map} +0 -0
- /package/{dist/dev-settings-figlet-heading.d.ts → dev-settings-figlet-heading.d.ts} +0 -0
- /package/{dist/dev-settings-table.d.ts → dev-settings-table.d.ts} +0 -0
- /package/{dist/dev-settings-table.d.ts.map → dev-settings-table.d.ts.map} +0 -0
- /package/{dist/dev-settings-table.js → dev-settings-table.js} +0 -0
- /package/{dist/dev-settings-table.js.map → dev-settings-table.js.map} +0 -0
- /package/{dist/i18n → i18n}/keyword-matching.d.ts +0 -0
- /package/{dist/i18n → i18n}/validation-keywords.d.ts +0 -0
- /package/{dist/i18n → i18n}/validation-keywords.d.ts.map +0 -0
- /package/{dist/i18n → i18n}/validation-keywords.js +0 -0
- /package/{dist/i18n → i18n}/validation-keywords.js.map +0 -0
- /package/{dist/local-inference → local-inference}/paths.d.ts.map +0 -0
- /package/{dist/local-inference → local-inference}/paths.js.map +0 -0
- /package/{dist/local-inference → local-inference}/verify.d.ts +0 -0
- /package/{dist/local-inference → local-inference}/verify.d.ts.map +0 -0
- /package/{dist/local-inference → local-inference}/verify.js +0 -0
- /package/{dist/local-inference → local-inference}/verify.js.map +0 -0
- /package/{dist/platform → platform}/is-native-server.d.ts +0 -0
- /package/{dist/platform → platform}/is-native-server.d.ts.map +0 -0
- /package/{dist/platform → platform}/is-native-server.js +0 -0
- /package/{dist/platform → platform}/is-native-server.js.map +0 -0
- /package/{dist/recent-messages-state.d.ts → recent-messages-state.d.ts} +0 -0
- /package/{dist/recent-messages-state.d.ts.map → recent-messages-state.d.ts.map} +0 -0
- /package/{dist/recent-messages-state.js → recent-messages-state.js} +0 -0
- /package/{dist/recent-messages-state.js.map → recent-messages-state.js.map} +0 -0
- /package/{dist/spoken-text.d.ts → spoken-text.d.ts} +0 -0
- /package/{dist/terminal → terminal}/links.d.ts +0 -0
- /package/{dist/terminal → terminal}/links.d.ts.map +0 -0
- /package/{dist/terminal → terminal}/links.js +0 -0
- /package/{dist/terminal → terminal}/links.js.map +0 -0
- /package/{dist/terminal → terminal}/palette.d.ts +0 -0
- /package/{dist/terminal → terminal}/palette.d.ts.map +0 -0
- /package/{dist/terminal → terminal}/palette.js +0 -0
- /package/{dist/terminal → terminal}/palette.js.map +0 -0
- /package/{dist/terminal → terminal}/theme.d.ts +0 -0
- /package/{dist/terminal → terminal}/theme.d.ts.map +0 -0
- /package/{dist/terminal → terminal}/theme.js +0 -0
- /package/{dist/terminal → terminal}/theme.js.map +0 -0
- /package/{dist/test-support → test-support}/process-helpers.d.ts +0 -0
- /package/{dist/test-support → test-support}/process-helpers.d.ts.map +0 -0
- /package/{dist/test-support → test-support}/process-helpers.js +0 -0
- /package/{dist/test-support → test-support}/process-helpers.js.map +0 -0
- /package/{dist/types → types}/index.js +0 -0
- /package/{dist/types → types}/index.js.map +0 -0
- /package/{dist/utils → utils}/asset-url.d.ts +0 -0
- /package/{dist/utils → utils}/asset-url.d.ts.map +0 -0
- /package/{dist/utils → utils}/asset-url.js +0 -0
- /package/{dist/utils → utils}/asset-url.js.map +0 -0
- /package/{dist/utils → utils}/browser-tab-kit-types.d.ts.map +0 -0
- /package/{dist/utils → utils}/browser-tab-kit-types.js.map +0 -0
- /package/{dist/utils → utils}/character-message-examples.d.ts +0 -0
- /package/{dist/utils → utils}/character-message-examples.d.ts.map +0 -0
- /package/{dist/utils → utils}/character-message-examples.js +0 -0
- /package/{dist/utils → utils}/character-message-examples.js.map +0 -0
- /package/{dist/utils → utils}/cloud-status.d.ts +0 -0
- /package/{dist/utils → utils}/cloud-status.d.ts.map +0 -0
- /package/{dist/utils → utils}/cloud-status.js +0 -0
- /package/{dist/utils → utils}/cloud-status.js.map +0 -0
- /package/{dist/utils → utils}/documents-upload-image.d.ts +0 -0
- /package/{dist/utils → utils}/documents-upload-image.d.ts.map +0 -0
- /package/{dist/utils → utils}/eliza-cloud-model-route.d.ts +0 -0
- /package/{dist/utils → utils}/eliza-cloud-model-route.d.ts.map +0 -0
- /package/{dist/utils → utils}/eliza-cloud-model-route.js +0 -0
- /package/{dist/utils → utils}/eliza-cloud-model-route.js.map +0 -0
- /package/{dist/utils → utils}/eliza-globals.d.ts +0 -0
- /package/{dist/utils → utils}/eliza-globals.d.ts.map +0 -0
- /package/{dist/utils → utils}/eliza-globals.js +0 -0
- /package/{dist/utils → utils}/eliza-globals.js.map +0 -0
- /package/{dist/utils → utils}/eliza-root.d.ts +0 -0
- /package/{dist/utils → utils}/eliza-root.d.ts.map +0 -0
- /package/{dist/utils → utils}/eliza-root.js +0 -0
- /package/{dist/utils → utils}/eliza-root.js.map +0 -0
- /package/{dist/utils → utils}/exec-safety.d.ts +0 -0
- /package/{dist/utils → utils}/labels.d.ts +0 -0
- /package/{dist/utils → utils}/labels.d.ts.map +0 -0
- /package/{dist/utils → utils}/labels.js +0 -0
- /package/{dist/utils → utils}/labels.js.map +0 -0
- /package/{dist/utils → utils}/log-prefix.d.ts +0 -0
- /package/{dist/utils → utils}/name-tokens.d.ts.map +0 -0
- /package/{dist/utils → utils}/name-tokens.js.map +0 -0
- /package/{dist/utils → utils}/number-parsing.d.ts +0 -0
- /package/{dist/utils → utils}/owner-name.d.ts +0 -0
- /package/{dist/utils → utils}/owner-name.d.ts.map +0 -0
- /package/{dist/utils → utils}/owner-name.js +0 -0
- /package/{dist/utils → utils}/owner-name.js.map +0 -0
- /package/{dist/utils → utils}/rate-limiter.d.ts +0 -0
- /package/{dist/utils → utils}/rate-limiter.d.ts.map +0 -0
- /package/{dist/utils → utils}/rate-limiter.js +0 -0
- /package/{dist/utils → utils}/rate-limiter.js.map +0 -0
- /package/{dist/utils → utils}/serialise.d.ts +0 -0
- /package/{dist/utils → utils}/serialise.d.ts.map +0 -0
- /package/{dist/utils → utils}/sql-compat.d.ts +0 -0
- /package/{dist/utils → utils}/sql-compat.d.ts.map +0 -0
- /package/{dist/utils → utils}/subscription-auth.d.ts +0 -0
- /package/{dist/utils → utils}/subscription-auth.d.ts.map +0 -0
- /package/{dist/utils → utils}/subscription-auth.js +0 -0
- /package/{dist/utils → utils}/subscription-auth.js.map +0 -0
- /package/{dist/utils → utils}/trajectory-format.d.ts +0 -0
- /package/{dist/utils → utils}/trajectory-format.d.ts.map +0 -0
- /package/{dist/utils → utils}/trajectory-format.js +0 -0
- /package/{dist/utils → utils}/trajectory-format.js.map +0 -0
- /package/{dist/validation-keywords.d.ts → validation-keywords.d.ts} +0 -0
- /package/{dist/validation-keywords.d.ts.map → validation-keywords.d.ts.map} +0 -0
- /package/{dist/validation-keywords.js → validation-keywords.js} +0 -0
- /package/{dist/validation-keywords.js.map → validation-keywords.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respond-gate.js","sourceRoot":"","sources":["../../src/voice/respond-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,6EAA6E;AAC7E,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;CACL,CAAC,CAAC;AAEH,wEAAwE;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AACnC,uEAAuE;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C,SAAS,KAAK,CAAC,IAAY;IACzB,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;SAC9B,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AAgBD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAAkB,EAClB,UAAgC,EAAE;IAElC,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEjC,uEAAuE;I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W,GAAmC,CAAC,gBAAgB;QACnE,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,oBAAoB,GAAG,6BAA6B;YACpD,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,CAAC;IAEd,MAAM,MAAM,GAAG,WAAW;QACxB,CAAC,CAAC,2BAA2B;QAC7B,CAAC,CAAC,OAAO,CAAC,cAAc;YACtB,CAAC,CAAC,yBAAyB;YAC3B,CAAC,CAAC,OAAO;gBACP,CAAC,CAAC,4BAA4B;gBAC9B,CAAC,CAAC,gBAAgB,CAAC;IAEzB,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical voice cancellation token.
|
|
3
|
+
*
|
|
4
|
+
* Wave 3 W3-9 — one token per voice turn, fanned out to every layer that can
|
|
5
|
+
* cancel: VAD start-of-speech (barge-in), turn-detector EOT revocation,
|
|
6
|
+
* planner-loop / message-handler yield points, MtpLlamaServer slot abort,
|
|
7
|
+
* TTS playback. Built on top of `AbortController` so any consumer that
|
|
8
|
+
* already understands `AbortSignal` (fetch / FFI / model calls) gets cancel
|
|
9
|
+
* for free.
|
|
10
|
+
*
|
|
11
|
+
* Invariants:
|
|
12
|
+
* - One token per `runId` (one utterance).
|
|
13
|
+
* - `abort()` is idempotent. The first reason wins; subsequent calls are
|
|
14
|
+
* ignored and leave the recorded reason unchanged.
|
|
15
|
+
* - `signal.aborted === true` after the first `abort()`.
|
|
16
|
+
* - Token is forward-compatible with the legacy `BargeInCancelToken`
|
|
17
|
+
* shape (`cancelled`, `reason`, `signal`) so existing voice pipeline
|
|
18
|
+
* consumers can adopt the canonical type without a wider refactor.
|
|
19
|
+
*
|
|
20
|
+
* This file deliberately has no runtime imports (no `@elizaos/core`, no
|
|
21
|
+
* voice-engine imports). It is the bottom of the cancellation stack — every
|
|
22
|
+
* layer above (runtime, plugin, app) imports this type, never the reverse.
|
|
23
|
+
*/
|
|
24
|
+
/** Why a voice turn was cancelled. Stable enum — telemetry depends on it. */
|
|
25
|
+
export type VoiceCancellationReason = "barge-in" | "eot-revoked" | "user-cancel" | "timeout" | "external";
|
|
26
|
+
/**
|
|
27
|
+
* Listener fired exactly once when the token transitions from active →
|
|
28
|
+
* aborted. Listeners added after abort fire synchronously with the recorded
|
|
29
|
+
* reason.
|
|
30
|
+
*/
|
|
31
|
+
export type VoiceCancellationListener = (reason: VoiceCancellationReason) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Per-turn cancellation handle. Carries a stable `runId`, the optional slot
|
|
34
|
+
* id the LM is running against (for slot-abort), and a standard `AbortSignal`
|
|
35
|
+
* for fetch / model layers.
|
|
36
|
+
*/
|
|
37
|
+
export interface VoiceCancellationToken {
|
|
38
|
+
/** Stable per-utterance id. Mirrors the voice state machine's turn id. */
|
|
39
|
+
readonly runId: string;
|
|
40
|
+
/**
|
|
41
|
+
* The MtpLlamaServer slot the optimistic LM is running on, when known.
|
|
42
|
+
* `abort()` fans this out to the slot-abort path on the inference server.
|
|
43
|
+
*/
|
|
44
|
+
readonly slot?: number;
|
|
45
|
+
/** True once `abort()` has fired. Cheap polling field. */
|
|
46
|
+
readonly aborted: boolean;
|
|
47
|
+
/** Set when `abort()` fires; null while active. */
|
|
48
|
+
readonly reason: VoiceCancellationReason | null;
|
|
49
|
+
/** Standard `AbortSignal` for fetch / model / FFI consumers. */
|
|
50
|
+
readonly signal: AbortSignal;
|
|
51
|
+
/**
|
|
52
|
+
* Trip the token. Idempotent. First call wins; subsequent calls are
|
|
53
|
+
* ignored. Fires every registered `onAbort` listener synchronously.
|
|
54
|
+
*/
|
|
55
|
+
abort(reason: VoiceCancellationReason): void;
|
|
56
|
+
/**
|
|
57
|
+
* Subscribe to abort. Returns an unsubscribe function. Listeners
|
|
58
|
+
* registered after the token has aborted fire synchronously with the
|
|
59
|
+
* recorded reason.
|
|
60
|
+
*/
|
|
61
|
+
onAbort(listener: VoiceCancellationListener): () => void;
|
|
62
|
+
}
|
|
63
|
+
export interface CreateVoiceCancellationTokenOptions {
|
|
64
|
+
runId: string;
|
|
65
|
+
slot?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Optional pre-existing `AbortSignal` to also honor. When this signal
|
|
68
|
+
* aborts (e.g. the runtime's per-turn signal from
|
|
69
|
+
* `TurnControllerRegistry`), the voice token aborts with reason
|
|
70
|
+
* `"external"` so the voice loop sees the runtime abort.
|
|
71
|
+
*/
|
|
72
|
+
linkSignal?: AbortSignal;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Construct a fresh voice cancellation token.
|
|
76
|
+
*
|
|
77
|
+
* Implementation note: a single `AbortController` backs the public `signal`.
|
|
78
|
+
* Listener bookkeeping lives next to the controller (rather than via the
|
|
79
|
+
* `AbortSignal`'s native `addEventListener`) because we want to:
|
|
80
|
+
* 1. Guarantee listeners fire even when the abort was triggered by a
|
|
81
|
+
* linked signal (the native `addEventListener` path also works, but
|
|
82
|
+
* this is cheaper and gives us synchronous semantics for
|
|
83
|
+
* after-abort `onAbort` registrations).
|
|
84
|
+
* 2. Surface the `reason` enum, not a raw `DOMException` from the
|
|
85
|
+
* AbortSignal.
|
|
86
|
+
*/
|
|
87
|
+
export declare function createVoiceCancellationToken(opts: CreateVoiceCancellationTokenOptions): VoiceCancellationToken;
|
|
88
|
+
/**
|
|
89
|
+
* Already-aborted token. Useful as a zero-cost default for code paths that
|
|
90
|
+
* have no live voice session but still want to type-thread a token through.
|
|
91
|
+
* The `runId` is the empty string — callers that depend on a stable id must
|
|
92
|
+
* pass their own.
|
|
93
|
+
*/
|
|
94
|
+
export declare function createAbortedVoiceCancellationToken(reason?: VoiceCancellationReason): VoiceCancellationToken;
|
|
95
|
+
/**
|
|
96
|
+
* Per-room registry. Keeps the active voice token for each `roomId` so
|
|
97
|
+
* unrelated layers (the message handler, an HTTP route, the audio sink)
|
|
98
|
+
* can fetch the live token without holding a reference. Mirrors the shape
|
|
99
|
+
* of `TurnControllerRegistry` in `@elizaos/core/runtime/turn-controller`.
|
|
100
|
+
*/
|
|
101
|
+
export declare class VoiceCancellationRegistry {
|
|
102
|
+
private readonly byRoom;
|
|
103
|
+
/**
|
|
104
|
+
* Replace the active token for `roomId`. The previous token (if any) is
|
|
105
|
+
* aborted with `"external"` so any orphaned background work cleans up.
|
|
106
|
+
* Returns the new token.
|
|
107
|
+
*/
|
|
108
|
+
arm(roomId: string, opts: CreateVoiceCancellationTokenOptions): VoiceCancellationToken;
|
|
109
|
+
/** Fetch the active token for `roomId`, or null. */
|
|
110
|
+
current(roomId: string): VoiceCancellationToken | null;
|
|
111
|
+
/**
|
|
112
|
+
* Abort the active token for `roomId`. Returns true if a live token was
|
|
113
|
+
* aborted. Returns false when there is no active token or it's already aborted.
|
|
114
|
+
*/
|
|
115
|
+
abort(roomId: string, reason: VoiceCancellationReason): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Abort every active token. Used by lifecycle shutdown (the runtime's
|
|
118
|
+
* `abortInflightInference` hook fires this so the voice loop drops in
|
|
119
|
+
* sync with the runtime).
|
|
120
|
+
*/
|
|
121
|
+
abortAll(reason: VoiceCancellationReason): string[];
|
|
122
|
+
/** Snapshot of live room ids. Diagnostic. */
|
|
123
|
+
activeRoomIds(): string[];
|
|
124
|
+
/** Test seam: drop everything. */
|
|
125
|
+
clear(): void;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=voice-cancellation-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-cancellation-token.d.ts","sourceRoot":"","sources":["../../src/voice/voice-cancellation-token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,6EAA6E;AAC7E,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,aAAa,GACb,aAAa,GACb,SAAS,GACT,UAAU,CAAC;AAEf;;;;GAIG;AACH,MAAM,MAAM,yBA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AO;IAO/D;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,uBAAuB,GAAG,MAAM,EAAE;IAWnD,6CAA6C;IAC7C,aAAa,IAAI,MAAM,EAAE;IAOzB,kCAAkC;IAClC,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical voice cancellation token.
|
|
3
|
+
*
|
|
4
|
+
* Wave 3 W3-9 — one token per voice turn, fanned out to every layer that can
|
|
5
|
+
* cancel: VAD start-of-speech (barge-in), turn-detector EOT revocation,
|
|
6
|
+
* planner-loop / message-handler yield points, MtpLlamaServer slot abort,
|
|
7
|
+
* TTS playback. Built on top of `AbortController` so any consumer that
|
|
8
|
+
* already understands `AbortSignal` (fetch / FFI / model calls) gets cancel
|
|
9
|
+
* for free.
|
|
10
|
+
*
|
|
11
|
+
* Invariants:
|
|
12
|
+
* - One token per `runId` (one utterance).
|
|
13
|
+
* - `abort()` is idempotent. The first reason wins; subsequent calls are
|
|
14
|
+
* ignored and leave the recorded reason unchanged.
|
|
15
|
+
* - `signal.aborted === true` after the first `abort()`.
|
|
16
|
+
* - Token is forward-compatible with the legacy `BargeInCancelToken`
|
|
17
|
+
* shape (`cancelled`, `reason`, `signal`) so existing voice pipeline
|
|
18
|
+
* consumers can adopt the canonical type without a wider refactor.
|
|
19
|
+
*
|
|
20
|
+
* This file deliberately has no runtime imports (no `@elizaos/core`, no
|
|
21
|
+
* voice-engine imports). It is the bottom of the cancellation stack — every
|
|
22
|
+
* layer above (runtime, plugin, app) imports this type, never the reverse.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Construct a fresh voice cancellation token.
|
|
26
|
+
*
|
|
27
|
+
* Implementation note: a single `AbortController` backs the public `signal`.
|
|
28
|
+
* Listener bookkeeping lives next to the controller (rather than via the
|
|
29
|
+
* `AbortSignal`'s native `addEventListener`) because we want to:
|
|
30
|
+
* 1. Guarantee listeners fire even when the abort was triggered by a
|
|
31
|
+
* linked signal (the native `addEventListener` path also works, but
|
|
32
|
+
* this is cheaper and gives us synchronous semantics for
|
|
33
|
+
* after-abort `onAbort` registrations).
|
|
34
|
+
* 2. Surface the `reason` enum, not a raw `DOMException` from the
|
|
35
|
+
* AbortSignal.
|
|
36
|
+
*/
|
|
37
|
+
export function createVoiceCancellationToken(opts) {
|
|
38
|
+
const controller = new AbortController();
|
|
39
|
+
const listeners = new Set();
|
|
40
|
+
const state = { aborted: false, reason: null };
|
|
41
|
+
const trip = (reason) => {
|
|
42
|
+
if (state.aborted)
|
|
43
|
+
return;
|
|
44
|
+
state.aborted = true;
|
|
45
|
+
state.reason = reason;
|
|
46
|
+
// Call listeners BEFORE aborting the controller so a listener that
|
|
47
|
+
// itself awaits the signal sees the same reason this token recorded
|
|
48
|
+
// (otherwise listeners that observe `signal.aborted` could race).
|
|
49
|
+
for (const listener of Array.from(listeners)) {
|
|
50
|
+
try {
|
|
51
|
+
listener(reason);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Listener errors are swallowed; telemetry should not affect
|
|
55
|
+
// cancellation propagation.
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
controller.abort();
|
|
59
|
+
};
|
|
60
|
+
if (opts.linkSignal) {
|
|
61
|
+
if (opts.linkSignal.aborted) {
|
|
62
|
+
trip("external");
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
const onLinkAbort = () => trip("external");
|
|
66
|
+
opts.linkSignal.addEventListener("abort", onLinkAbort, { once: true });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const token = {
|
|
70
|
+
runId: opts.runId,
|
|
71
|
+
...(opts.slot !== undefined ? { slot: opts.slot } : {}),
|
|
72
|
+
get aborted() {
|
|
73
|
+
return state.aborted;
|
|
74
|
+
},
|
|
75
|
+
get reason() {
|
|
76
|
+
return state.reason;
|
|
77
|
+
},
|
|
78
|
+
signal: controller.signal,
|
|
79
|
+
abort(reason) {
|
|
80
|
+
trip(reason);
|
|
81
|
+
},
|
|
82
|
+
onAbort(listener) {
|
|
83
|
+
if (state.aborted) {
|
|
84
|
+
// Synchronous after-abort fan-out. Caller may still want the
|
|
85
|
+
// hook even though the token already aborted — fire once.
|
|
86
|
+
const reason = state.reason ?? "external";
|
|
87
|
+
try {
|
|
88
|
+
listener(reason);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// see above
|
|
92
|
+
}
|
|
93
|
+
return () => undefined;
|
|
94
|
+
}
|
|
95
|
+
listeners.add(listener);
|
|
96
|
+
return () => {
|
|
97
|
+
listeners.delete(listener);
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
return token;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Already-aborted token. Useful as a zero-cost default for code paths that
|
|
105
|
+
* have no live voice session but still want to type-thread a token through.
|
|
106
|
+
* The `runId` is the empty string — callers that depend on a stable id must
|
|
107
|
+
* pass their own.
|
|
108
|
+
*/
|
|
109
|
+
export function createAbortedVoiceCancellationToken(reason = "external") {
|
|
110
|
+
const t = createVoiceCancellationToken({ runId: "" });
|
|
111
|
+
t.abort(reason);
|
|
112
|
+
return t;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Per-room registry. Keeps the active voice token for each `roomId` so
|
|
116
|
+
* unrelated layers (the message handler, an HTTP route, the audio sink)
|
|
117
|
+
* can fetch the live token without holding a reference. Mirrors the shape
|
|
118
|
+
* of `TurnControllerRegistry` in `@elizaos/core/runtime/turn-controller`.
|
|
119
|
+
*/
|
|
120
|
+
export class VoiceCancellationRegistry {
|
|
121
|
+
byRoom = new Map();
|
|
122
|
+
/**
|
|
123
|
+
* Replace the active token for `roomId`. The previous token (if any) is
|
|
124
|
+
* aborted with `"external"` so any orphaned background work cleans up.
|
|
125
|
+
* Returns the new token.
|
|
126
|
+
*/
|
|
127
|
+
arm(roomId, opts) {
|
|
128
|
+
const previous = this.byRoom.get(roomId);
|
|
129
|
+
if (previous && !previous.aborted) {
|
|
130
|
+
previous.abort("external");
|
|
131
|
+
}
|
|
132
|
+
const token = createVoiceCancellationToken(opts);
|
|
133
|
+
this.byRoom.set(roomId, token);
|
|
134
|
+
// Self-clean: when the token aborts, drop it from the map IF it is
|
|
135
|
+
// still the active one. (Tokens that have been replaced via a later
|
|
136
|
+
// `arm()` will already be evicted.)
|
|
137
|
+
token.onAbort(() => {
|
|
138
|
+
if (this.byRoom.get(roomId) === token) {
|
|
139
|
+
this.byRoom.delete(roomId);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return token;
|
|
143
|
+
}
|
|
144
|
+
/** Fetch the active token for `roomId`, or null. */
|
|
145
|
+
current(roomId) {
|
|
146
|
+
return this.byRoom.get(roomId) ?? null;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Abort the active token for `roomId`. Returns true if a live token was
|
|
150
|
+
* aborted. Returns false when there is no active token or it's already aborted.
|
|
151
|
+
*/
|
|
152
|
+
abort(roomId, reason) {
|
|
153
|
+
const token = this.byRoom.get(roomId);
|
|
154
|
+
if (!token || token.aborted)
|
|
155
|
+
return false;
|
|
156
|
+
token.abort(reason);
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Abort every active token. Used by lifecycle shutdown (the runtime's
|
|
161
|
+
* `abortInflightInference` hook fires this so the voice loop drops in
|
|
162
|
+
* sync with the runtime).
|
|
163
|
+
*/
|
|
164
|
+
abortAll(reason) {
|
|
165
|
+
const aborted = [];
|
|
166
|
+
for (const [roomId, token] of Array.from(this.byRoom.entries())) {
|
|
167
|
+
if (!token.aborted) {
|
|
168
|
+
token.abort(reason);
|
|
169
|
+
aborted.push(roomId);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return aborted;
|
|
173
|
+
}
|
|
174
|
+
/** Snapshot of live room ids. Diagnostic. */
|
|
175
|
+
activeRoomIds() {
|
|
176
|
+
return Array.from(this.byRoom.keys()).filter((roomId) => {
|
|
177
|
+
const token = this.byRoom.get(roomId);
|
|
178
|
+
return token !== undefined && !token.aborted;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/** Test seam: drop everything. */
|
|
182
|
+
clear() {
|
|
183
|
+
this.byRoom.clear();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=voice-cancellation-token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-cancellation-token.js","sourceRoot":"","sources":["../../src/voice/voice-cancellation-token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAoEH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,4BAA4B,CAC1C,IAAyC;IAEzC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,IAAI,GAAG,EAA6B,CAAC;IACvD,MAAM,KAAK,GAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAE9D,MAAM,IAAI,GAAG,CAAC,MAA+B,EAAQ,EAAE;QACrD,IAAI,KAAK,CAAC,OAAO;YAAE,OAAO;QAC1B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACrB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,mEAAmE;QACnE,oEAAoE;QACpE,kEAAkE;QAClE,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC;gBACH,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;YAAC,MAAM,CAAC;gBACP,6DAA6D;gBAC7D,4BAA4B;YAC9B,CAAC;QACH,CAAC;QACD,UAAU,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC,CAAC;IAEF,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,IAAI,IAAI,CAAC,UAAU,CAA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AAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO;YAAE,OAAO,KAAK,CAAC;QAC1C,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAA+B;QACtC,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACnB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACpB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,6CAA6C;IAC7C,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;YACtD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACtC,OAAO,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,kCAAkC;IAClC,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF"}
|
package/voice-eot.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heuristic end-of-turn (EOT) scoring — the single source of truth (#8786).
|
|
3
|
+
*
|
|
4
|
+
* The semantic "is the speaker done?" syntactic heuristic used to be implemented
|
|
5
|
+
* twice with drifted behavior: the UI shell capture path
|
|
6
|
+
* (`packages/ui/src/voice/end-of-turn.ts:scoreEndOfTurn`) and the plugin's
|
|
7
|
+
* Tier-3 classifier (`plugin-local-inference .../voice/eot-classifier.ts:
|
|
8
|
+
* HeuristicEotClassifier`). The two had diverged — different rule ORDERING
|
|
9
|
+
* (the plugin scored a 2-word trail-off like "and so" as a complete short
|
|
10
|
+
* command; the UI correctly held it), a missing ellipsis rule on the plugin
|
|
11
|
+
* side, and a different question-tag set. This module is the one canonical
|
|
12
|
+
* implementation both surfaces consume.
|
|
13
|
+
*
|
|
14
|
+
* It lives in `@elizaos/shared` (which both already depend on), is pure +
|
|
15
|
+
* browser-safe (no Node deps), and ships via the `@elizaos/shared/voice-eot`
|
|
16
|
+
* subpath without pulling the whole barrel — mirroring `voice-wer`.
|
|
17
|
+
*
|
|
18
|
+
* The fused composite EOT (ABI v11, `CompositeEotClassifier`) is preferred when
|
|
19
|
+
* the loaded native build wires the semantic model; it blends THIS heuristic as
|
|
20
|
+
* its high-precision syntactic co-signal, so consolidating here also feeds the
|
|
21
|
+
* model path one definition.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Probability in [0,1] that `transcript` is a COMPLETE turn (the speaker is
|
|
25
|
+
* done). High → commit; low → the utterance trails off, keep listening.
|
|
26
|
+
*
|
|
27
|
+
* Rules fire in priority order; the first match wins:
|
|
28
|
+
*
|
|
29
|
+
* 1 Trailing ellipsis ("…" / "..") 0.20 (trail-off)
|
|
30
|
+
* 2 Sentence-final punctuation (. ! ?) 0.95
|
|
31
|
+
* 3 Question-tag suffix ("right?", "yeah", "correct") 0.85
|
|
32
|
+
* 4 Trailing conjunction (and / but / because / …) 0.15 (mid-clause)
|
|
33
|
+
* 5 Trailing preposition / article (to / the / with …) 0.20 (incomplete NP)
|
|
34
|
+
* 6 Short utterance (< 3 words, no trail-off) 0.70 (command/ack)
|
|
35
|
+
* 7 No signal 0.50
|
|
36
|
+
*
|
|
37
|
+
* Note the conjunction/preposition checks precede the short-utterance rule so a
|
|
38
|
+
* 2-word trail-off ("and so", "going to") is NOT misread as a complete short
|
|
39
|
+
* command.
|
|
40
|
+
*/
|
|
41
|
+
export declare function scoreEndOfTurnHeuristic(transcript: string): number;
|
|
42
|
+
//# sourceMappingURL=voice-eot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-eot.d.ts","sourceRoot":"","sources":["../src/voice-eot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAqFH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAkClE"}
|
package/voice-eot.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heuristic end-of-turn (EOT) scoring — the single source of truth (#8786).
|
|
3
|
+
*
|
|
4
|
+
* The semantic "is the speaker done?" syntactic heuristic used to be implemented
|
|
5
|
+
* twice with drifted behavior: the UI shell capture path
|
|
6
|
+
* (`packages/ui/src/voice/end-of-turn.ts:scoreEndOfTurn`) and the plugin's
|
|
7
|
+
* Tier-3 classifier (`plugin-local-inference .../voice/eot-classifier.ts:
|
|
8
|
+
* HeuristicEotClassifier`). The two had diverged — different rule ORDERING
|
|
9
|
+
* (the plugin scored a 2-word trail-off like "and so" as a complete short
|
|
10
|
+
* command; the UI correctly held it), a missing ellipsis rule on the plugin
|
|
11
|
+
* side, and a different question-tag set. This module is the one canonical
|
|
12
|
+
* implementation both surfaces consume.
|
|
13
|
+
*
|
|
14
|
+
* It lives in `@elizaos/shared` (which both already depend on), is pure +
|
|
15
|
+
* browser-safe (no Node deps), and ships via the `@elizaos/shared/voice-eot`
|
|
16
|
+
* subpath without pulling the whole barrel — mirroring `voice-wer`.
|
|
17
|
+
*
|
|
18
|
+
* The fused composite EOT (ABI v11, `CompositeEotClassifier`) is preferred when
|
|
19
|
+
* the loaded native build wires the semantic model; it blends THIS heuristic as
|
|
20
|
+
* its high-precision syntactic co-signal, so consolidating here also feeds the
|
|
21
|
+
* model path one definition.
|
|
22
|
+
*/
|
|
23
|
+
/** Conjunctions that strongly suggest the speaker is mid-clause. */
|
|
24
|
+
const TRAILING_CONJUNCTIONS = new Set([
|
|
25
|
+
"and",
|
|
26
|
+
"but",
|
|
27
|
+
"or",
|
|
28
|
+
"nor",
|
|
29
|
+
"yet",
|
|
30
|
+
"so",
|
|
31
|
+
"because",
|
|
32
|
+
"although",
|
|
33
|
+
"though",
|
|
34
|
+
"while",
|
|
35
|
+
"whereas",
|
|
36
|
+
"if",
|
|
37
|
+
"unless",
|
|
38
|
+
"until",
|
|
39
|
+
"since",
|
|
40
|
+
"when",
|
|
41
|
+
"where",
|
|
42
|
+
"which",
|
|
43
|
+
"that",
|
|
44
|
+
"who",
|
|
45
|
+
"whom",
|
|
46
|
+
"whose",
|
|
47
|
+
]);
|
|
48
|
+
/** Prepositions / articles that imply an incomplete noun phrase follows. */
|
|
49
|
+
const TRAILING_INCOMPLETE = new Set([
|
|
50
|
+
"a",
|
|
51
|
+
"an",
|
|
52
|
+
"the",
|
|
53
|
+
"to",
|
|
54
|
+
"of",
|
|
55
|
+
"in",
|
|
56
|
+
"on",
|
|
57
|
+
"at",
|
|
58
|
+
"by",
|
|
59
|
+
"for",
|
|
60
|
+
"with",
|
|
61
|
+
"from",
|
|
62
|
+
"into",
|
|
63
|
+
"about",
|
|
64
|
+
"through",
|
|
65
|
+
"between",
|
|
66
|
+
"against",
|
|
67
|
+
"during",
|
|
68
|
+
"before",
|
|
69
|
+
"after",
|
|
70
|
+
"without",
|
|
71
|
+
"under",
|
|
72
|
+
"over",
|
|
73
|
+
"above",
|
|
74
|
+
"below",
|
|
75
|
+
"around",
|
|
76
|
+
"beside",
|
|
77
|
+
"beyond",
|
|
78
|
+
"like",
|
|
79
|
+
"near",
|
|
80
|
+
"past",
|
|
81
|
+
"via",
|
|
82
|
+
]);
|
|
83
|
+
/**
|
|
84
|
+
* Question-tag suffixes that end an utterance (matched case-insensitively).
|
|
85
|
+
* The union of both prior surfaces: punctuated forms (the UI set) plus the
|
|
86
|
+
* bare forms (`right` / `yeah` / `correct`) the plugin relied on for the
|
|
87
|
+
* no-trailing-`?` case. A punctuated tag is also caught by the sentence-final
|
|
88
|
+
* punctuation rule, which fires first.
|
|
89
|
+
*/
|
|
90
|
+
const QUESTION_TAGS = [
|
|
91
|
+
"right?",
|
|
92
|
+
"yeah?",
|
|
93
|
+
"ok?",
|
|
94
|
+
"okay?",
|
|
95
|
+
"correct?",
|
|
96
|
+
"hm?",
|
|
97
|
+
"huh?",
|
|
98
|
+
"eh?",
|
|
99
|
+
"right",
|
|
100
|
+
"yeah",
|
|
101
|
+
"correct",
|
|
102
|
+
];
|
|
103
|
+
/**
|
|
104
|
+
* Probability in [0,1] that `transcript` is a COMPLETE turn (the speaker is
|
|
105
|
+
* done). High → commit; low → the utterance trails off, keep listening.
|
|
106
|
+
*
|
|
107
|
+
* Rules fire in priority order; the first match wins:
|
|
108
|
+
*
|
|
109
|
+
* 1 Trailing ellipsis ("…" / "..") 0.20 (trail-off)
|
|
110
|
+
* 2 Sentence-final punctuation (. ! ?) 0.95
|
|
111
|
+
* 3 Question-tag suffix ("right?", "yeah", "correct") 0.85
|
|
112
|
+
* 4 Trailing conjunction (and / but / because / …) 0.15 (mid-clause)
|
|
113
|
+
* 5 Trailing preposition / article (to / the / with …) 0.20 (incomplete NP)
|
|
114
|
+
* 6 Short utterance (< 3 words, no trail-off) 0.70 (command/ack)
|
|
115
|
+
* 7 No signal 0.50
|
|
116
|
+
*
|
|
117
|
+
* Note the conjunction/preposition checks precede the short-utterance rule so a
|
|
118
|
+
* 2-word trail-off ("and so", "going to") is NOT misread as a complete short
|
|
119
|
+
* command.
|
|
120
|
+
*/
|
|
121
|
+
export function scoreEndOfTurnHeuristic(transcript) {
|
|
122
|
+
const text = transcript.trim();
|
|
123
|
+
if (text.length === 0)
|
|
124
|
+
return 0.5;
|
|
125
|
+
// A trailing ellipsis is the strongest trail-off signal — the speaker paused
|
|
126
|
+
// mid-thought. Checked BEFORE sentence-final punctuation, since "..." ends in ".".
|
|
127
|
+
if (/(\.{2,}|…)$/.test(text))
|
|
128
|
+
return 0.2;
|
|
129
|
+
// Sentence-final punctuation → almost certainly done.
|
|
130
|
+
if (/[.!?]$/.test(text))
|
|
131
|
+
return 0.95;
|
|
132
|
+
const lower = text.toLowerCase();
|
|
133
|
+
for (const tag of QUESTION_TAGS) {
|
|
134
|
+
if (lower.endsWith(tag))
|
|
135
|
+
return 0.85;
|
|
136
|
+
}
|
|
137
|
+
const words = lower
|
|
138
|
+
.replace(/[^a-z0-9'\s-]/gi, "")
|
|
139
|
+
.split(/\s+/)
|
|
140
|
+
.filter(Boolean);
|
|
141
|
+
if (words.length === 0)
|
|
142
|
+
return 0.5;
|
|
143
|
+
const lastWord = words[words.length - 1].replace(/[',;:-]+$/, "");
|
|
144
|
+
// Trailing conjunction / preposition / article → mid-clause, the speaker is
|
|
145
|
+
// continuing. Checked BEFORE the short-utterance rule so a 2-word trail-off
|
|
146
|
+
// ("going to", "and so") is NOT misread as a complete short command.
|
|
147
|
+
if (TRAILING_CONJUNCTIONS.has(lastWord))
|
|
148
|
+
return 0.15;
|
|
149
|
+
if (TRAILING_INCOMPLETE.has(lastWord))
|
|
150
|
+
return 0.2;
|
|
151
|
+
// Short utterance that doesn't trail off (a command / acknowledgement) →
|
|
152
|
+
// likely complete ("go home", "yes", "stop").
|
|
153
|
+
if (words.length < 3)
|
|
154
|
+
return 0.7;
|
|
155
|
+
// No strong signal either way — the recognizer's silence is enough.
|
|
156
|
+
return 0.5;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=voice-eot.js.map
|
package/voice-eot.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-eot.js","sourceRoot":"","sources":["../src/voice-eot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAE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DAAsD;IACtD,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAErC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACjC,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;IACvC,CAAC;IAED,MAAM,KAAK,GAAG,KAAK;SAChB,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;SAC9B,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,OAAO,CAAC,CAAC;IACnB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAEnC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAClE,4EAA4E;IAC5E,4EAA4E;IAC5E,qEAAqE;IACrE,IAAI,qBAAqB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IACrD,IAAI,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO,GAAG,CAAC;IAElD,yEAAyE;IACzE,8CAA8C;IAC9C,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAEjC,oEAAoE;IACpE,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/voice-wer.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Word-error-rate scoring — the single source of truth (#8785).
|
|
3
|
+
*
|
|
4
|
+
* Both the headless metric library (plugin-local-inference `e2e-harness.ts`) and
|
|
5
|
+
* the headful self-test (ui `voice-selftest-harness.ts`) need WER; this used to
|
|
6
|
+
* be implemented twice with subtly different normalization. It lives in
|
|
7
|
+
* `@elizaos/shared` (which both already depend on) so there is exactly one
|
|
8
|
+
* definition. Pure + browser-safe (no Node deps), so it ships in the UI bundle
|
|
9
|
+
* via the `@elizaos/shared/voice-wer` subpath without pulling the whole barrel.
|
|
10
|
+
*/
|
|
11
|
+
/** Lowercase, strip punctuation (keep letters/numbers/apostrophes), collapse WS. */
|
|
12
|
+
export declare function normalizeWerText(text: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Levenshtein word-error-rate of `hypothesis` against `reference`
|
|
15
|
+
* (substitutions + insertions + deletions, divided by reference word count).
|
|
16
|
+
* An empty reference scores 0 against an empty hypothesis, else 1.
|
|
17
|
+
*/
|
|
18
|
+
export declare function wordErrorRate(reference: string, hypothesis: string): number;
|
|
19
|
+
//# sourceMappingURL=voice-wer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-wer.d.ts","sourceRoot":"","sources":["../src/voice-wer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAgB3E"}
|
package/voice-wer.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Word-error-rate scoring — the single source of truth (#8785).
|
|
3
|
+
*
|
|
4
|
+
* Both the headless metric library (plugin-local-inference `e2e-harness.ts`) and
|
|
5
|
+
* the headful self-test (ui `voice-selftest-harness.ts`) need WER; this used to
|
|
6
|
+
* be implemented twice with subtly different normalization. It lives in
|
|
7
|
+
* `@elizaos/shared` (which both already depend on) so there is exactly one
|
|
8
|
+
* definition. Pure + browser-safe (no Node deps), so it ships in the UI bundle
|
|
9
|
+
* via the `@elizaos/shared/voice-wer` subpath without pulling the whole barrel.
|
|
10
|
+
*/
|
|
11
|
+
/** Lowercase, strip punctuation (keep letters/numbers/apostrophes), collapse WS. */
|
|
12
|
+
export function normalizeWerText(text) {
|
|
13
|
+
return text
|
|
14
|
+
.toLowerCase()
|
|
15
|
+
.replace(/[^\p{L}\p{N}'\s]/gu, " ")
|
|
16
|
+
.replace(/\s+/g, " ")
|
|
17
|
+
.trim();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Levenshtein word-error-rate of `hypothesis` against `reference`
|
|
21
|
+
* (substitutions + insertions + deletions, divided by reference word count).
|
|
22
|
+
* An empty reference scores 0 against an empty hypothesis, else 1.
|
|
23
|
+
*/
|
|
24
|
+
export function wordErrorRate(reference, hypothesis) {
|
|
25
|
+
const refWords = normalizeWerText(reference).split(" ").filter(Boolean);
|
|
26
|
+
const hypWords = normalizeWerText(hypothesis).split(" ").filter(Boolean);
|
|
27
|
+
if (refWords.length === 0)
|
|
28
|
+
return hypWords.length === 0 ? 0 : 1;
|
|
29
|
+
const prev = Array.from({ length: hypWords.length + 1 }, (_, i) => i);
|
|
30
|
+
const curr = new Array(hypWords.length + 1).fill(0);
|
|
31
|
+
for (let i = 1; i <= refWords.length; i++) {
|
|
32
|
+
curr[0] = i;
|
|
33
|
+
for (let j = 1; j <= hypWords.length; j++) {
|
|
34
|
+
const cost = refWords[i - 1] === hypWords[j - 1] ? 0 : 1;
|
|
35
|
+
curr[j] = Math.min(prev[j] + 1, curr[j - 1] + 1, prev[j - 1] + cost);
|
|
36
|
+
}
|
|
37
|
+
for (let j = 0; j < curr.length; j++)
|
|
38
|
+
prev[j] = curr[j];
|
|
39
|
+
}
|
|
40
|
+
return prev[hypWords.length] / refWords.length;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=voice-wer.js.map
|
package/voice-wer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-wer.js","sourceRoot":"","sources":["../src/voice-wer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,oFAAoF;AACpF,MAAM,UAA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