@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,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-sentence snip helper for the TTS first-line cache.
|
|
3
|
+
*
|
|
4
|
+
* Pure, deterministic, no I/O. Both the local runtime and the Eliza Cloud
|
|
5
|
+
* `/api/v1/voice/tts` route call into this module so that byte-equal sentence
|
|
6
|
+
* text on either side maps to byte-equal cache keys.
|
|
7
|
+
*
|
|
8
|
+
* Algorithm summary (see R4 §2 in `.swarm/research/R4-tts-cache.md`):
|
|
9
|
+
* 1. Trim leading whitespace.
|
|
10
|
+
* 2. Walk char-by-char, tracking quote depth (skip terminators inside
|
|
11
|
+
* `"..."`/`'...'`/`“...”`), decimal context (digit-`.`-digit isn't a
|
|
12
|
+
* boundary), and abbreviation context (e.g. `Mr.`, `e.g.`, `U.S.`).
|
|
13
|
+
* 3. First surviving terminator (`.`/`!`/`?`/`…`/`。`/`!`/`?`) or `\n`
|
|
14
|
+
* ends the sentence. Consume any contiguous run of terminators that
|
|
15
|
+
* follow (so `"Wait..."` stays intact).
|
|
16
|
+
* 4. If no terminator and no newline → null (don't cache unterminated text).
|
|
17
|
+
* 5. Apply ≤10-word filter on the normalised form. If wordCount > 10,
|
|
18
|
+
* return null (don't cache).
|
|
19
|
+
*
|
|
20
|
+
* `FIRST_SENTENCE_SNIP_VERSION` is part of the cache key — bumping it
|
|
21
|
+
* invalidates every existing cached entry.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Cache-key algorithm version. Bump when the snip/normalise logic changes
|
|
25
|
+
* in a way that would produce different keys for the same input. Local and
|
|
26
|
+
* cloud caches re-key off this constant, so a bump rolls the entire cache.
|
|
27
|
+
*/
|
|
28
|
+
export const FIRST_SENTENCE_SNIP_VERSION = "1";
|
|
29
|
+
/**
|
|
30
|
+
* Maximum word count (Unicode-aware) for a cacheable first-sentence snip.
|
|
31
|
+
* Beyond this the bytes won't repeat often enough to amortise the cache.
|
|
32
|
+
*/
|
|
33
|
+
export const FIRST_SENTENCE_MAX_WORDS = 10;
|
|
34
|
+
const ABBREVIATIONS = new Set([
|
|
35
|
+
"mr",
|
|
36
|
+
"mrs",
|
|
37
|
+
"ms",
|
|
38
|
+
"mx",
|
|
39
|
+
"dr",
|
|
40
|
+
"st",
|
|
41
|
+
"jr",
|
|
42
|
+
"sr",
|
|
43
|
+
"prof",
|
|
44
|
+
"vs",
|
|
45
|
+
"etc",
|
|
46
|
+
"eg",
|
|
47
|
+
"ie",
|
|
48
|
+
"fig",
|
|
49
|
+
"no",
|
|
50
|
+
"vol",
|
|
51
|
+
"ch",
|
|
52
|
+
"pt",
|
|
53
|
+
"co",
|
|
54
|
+
"inc",
|
|
55
|
+
"ltd",
|
|
56
|
+
"us",
|
|
57
|
+
"uk",
|
|
58
|
+
"usa",
|
|
59
|
+
]);
|
|
60
|
+
/**
|
|
61
|
+
* Terminator chars that end a sentence. Includes CJK `。!?` so multilingual
|
|
62
|
+
* inputs aren't refused.
|
|
63
|
+
*/
|
|
64
|
+
const TERMINATOR_REGEX = /[.!?…。!?]/u;
|
|
65
|
+
const QUOTE_PAIRS = new Map([
|
|
66
|
+
['"', '"'],
|
|
67
|
+
["'", "'"],
|
|
68
|
+
["“", "”"],
|
|
69
|
+
["‘", "’"],
|
|
70
|
+
["«", "»"],
|
|
71
|
+
["「", "」"],
|
|
72
|
+
["『", "』"],
|
|
73
|
+
]);
|
|
74
|
+
const CLOSE_QUOTES = new Set(QUOTE_PAIRS.values());
|
|
75
|
+
function isDigit(ch) {
|
|
76
|
+
return ch >= "0" && ch <= "9";
|
|
77
|
+
}
|
|
78
|
+
function isAlpha(ch) {
|
|
79
|
+
if (!ch)
|
|
80
|
+
return false;
|
|
81
|
+
const code = ch.charCodeAt(0);
|
|
82
|
+
return ((code >= 65 && code <= 90) || // A-Z
|
|
83
|
+
(code >= 97 && code <= 122) // a-z
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Lower-case + strip dots from a token to compare against `ABBREVIATIONS`.
|
|
88
|
+
* Used to detect things like `Mr.` / `U.S.` / `e.g.` where the dot is part of
|
|
89
|
+
* an abbreviation rather than a sentence terminator.
|
|
90
|
+
*/
|
|
91
|
+
function isAbbrevToken(token) {
|
|
92
|
+
if (token.length === 0 || token.length > 6)
|
|
93
|
+
return false;
|
|
94
|
+
const lower = token.toLowerCase().replace(/\./g, "");
|
|
95
|
+
if (!lower)
|
|
96
|
+
return false;
|
|
97
|
+
return ABBREVIATIONS.has(lower);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Walk the input forwards looking for the first sentence-terminating position.
|
|
101
|
+
* Returns the *inclusive* end index of the terminator run (so the snip is
|
|
102
|
+
* `text.slice(start, endInclusive + 1)`), or -1 if no terminator was found.
|
|
103
|
+
*
|
|
104
|
+
* `start` is the position after any leading whitespace.
|
|
105
|
+
*/
|
|
106
|
+
function findTerminatorEnd(text, start) {
|
|
107
|
+
let i = start;
|
|
108
|
+
const quoteStack = [];
|
|
109
|
+
while (i < text.length) {
|
|
110
|
+
const ch = text[i] ?? "";
|
|
111
|
+
// Newline acts as a soft terminator (e.g. message body broken into lines).
|
|
112
|
+
if (ch === "\n") {
|
|
113
|
+
// Strip trailing whitespace from the run by returning index of \n.
|
|
114
|
+
return i;
|
|
115
|
+
}
|
|
116
|
+
// Open / close quotes for skipping terminators inside.
|
|
117
|
+
const closer = QUOTE_PAIRS.get(ch);
|
|
118
|
+
if (closer && closer !== ch) {
|
|
119
|
+
// Asymmetric pair → push the expected closer.
|
|
120
|
+
quoteStack.push(closer);
|
|
121
|
+
i++;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (quoteStack.length > 0 && ch === quoteStack[quoteStack.length - 1]) {
|
|
125
|
+
quoteStack.pop();
|
|
126
|
+
i++;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
// Symmetric ASCII quotes: toggle stack only when not already inside an
|
|
130
|
+
// asymmetric quote.
|
|
131
|
+
//
|
|
132
|
+
// Apostrophes (`'`) are NEVER treated as quote delimiters when they sit
|
|
133
|
+
// between two letters (contractions like `it's`, possessives like
|
|
134
|
+
// `Eliza's`) — otherwise a stray apostrophe would swallow the rest of
|
|
135
|
+
// the input and we'd never find a terminator.
|
|
136
|
+
if (ch === "'" && quoteStack.length === 0) {
|
|
137
|
+
const prev = i > 0 ? text[i - 1] : "";
|
|
138
|
+
const next = i + 1 < text.length ? text[i + 1] : "";
|
|
139
|
+
if (!(isAlpha(prev) && isAlpha(next))) {
|
|
140
|
+
quoteStack.push(ch);
|
|
141
|
+
}
|
|
142
|
+
i++;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (ch === '"' && quoteStack.length === 0) {
|
|
146
|
+
quoteStack.push(ch);
|
|
147
|
+
i++;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (quoteStack.length > 0 &&
|
|
151
|
+
CLOSE_QUOTES.has(quoteStack[quoteStack.length - 1] ?? "") &&
|
|
152
|
+
ch === quoteStack[quoteStack.length - 1]) {
|
|
153
|
+
quoteStack.pop();
|
|
154
|
+
i++;
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
// Skip everything inside quotes.
|
|
158
|
+
if (quoteStack.length > 0) {
|
|
159
|
+
i++;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (!TERMINATOR_REGEX.test(ch)) {
|
|
163
|
+
i++;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
// Candidate terminator. Apply guards.
|
|
167
|
+
if (ch === ".") {
|
|
168
|
+
// Decimal context: digit . digit
|
|
169
|
+
const prev = i > 0 ? text[i - 1] : "";
|
|
170
|
+
const next = i + 1 < text.length ? text[i + 1] : "";
|
|
171
|
+
if (isDigit(prev) && isDigit(next)) {
|
|
172
|
+
i++;
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
// Abbreviation context: look backwards for an alpha run, possibly
|
|
176
|
+
// with internal dots (e.g. `U.S.`). Bound the look-back to 6 chars.
|
|
177
|
+
let j = i - 1;
|
|
178
|
+
let token = "";
|
|
179
|
+
while (j >= 0 && j >= i - 6) {
|
|
180
|
+
const tj = text[j] ?? "";
|
|
181
|
+
if (isAlpha(tj) || tj === ".") {
|
|
182
|
+
token = tj + token;
|
|
183
|
+
j--;
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
if (token && isAbbrevToken(token)) {
|
|
189
|
+
i++;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
// Also: avoid treating mid-word dot as terminator if followed
|
|
193
|
+
// immediately by alpha and no whitespace (e.g. "foo.bar"
|
|
194
|
+
// shouldn't terminate). Cache hit rate is more important than
|
|
195
|
+
// being clever here — conservative: skip.
|
|
196
|
+
if (isAlpha(next)) {
|
|
197
|
+
i++;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// Valid terminator. Consume any contiguous run of terminator chars so
|
|
202
|
+
// `Wait...` stays intact, then return the inclusive end.
|
|
203
|
+
let end = i;
|
|
204
|
+
while (end + 1 < text.length) {
|
|
205
|
+
const nxt = text[end + 1] ?? "";
|
|
206
|
+
if (TERMINATOR_REGEX.test(nxt)) {
|
|
207
|
+
end++;
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
return end;
|
|
213
|
+
}
|
|
214
|
+
return -1;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Unicode-aware word count. Hyphenated words and apostrophe-internal words
|
|
218
|
+
* count as one (e.g. "twenty-three" → 1, "it's" → 1). Dotted acronyms with
|
|
219
|
+
* single-letter segments (e.g. "U.S.", "U.S.A.") count as one word. Decimal
|
|
220
|
+
* numbers like "3.14" count as one word.
|
|
221
|
+
*/
|
|
222
|
+
export function wordCount(s) {
|
|
223
|
+
if (!s)
|
|
224
|
+
return 0;
|
|
225
|
+
const matches = s.match(
|
|
226
|
+
// In priority order:
|
|
227
|
+
// - decimal number (digits . digits, possibly multi-segment)
|
|
228
|
+
// - dotted acronym (≥2 single-letter dot pairs)
|
|
229
|
+
// - regular word with optional hyphen/apostrophe internal joiners
|
|
230
|
+
/\p{N}+(?:\.\p{N}+)+|(?:\p{L}\.){2,}|[\p{L}\p{N}]+(?:[’'-][\p{L}\p{N}]+)*/gu);
|
|
231
|
+
return matches ? matches.length : 0;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Normalise a snip for cache-key purposes. NFC + lower-case + collapse
|
|
235
|
+
* whitespace + strip trailing terminators/whitespace. Apostrophes preserved.
|
|
236
|
+
*/
|
|
237
|
+
export function normalizeForKey(snip) {
|
|
238
|
+
let s = snip.normalize("NFC");
|
|
239
|
+
// Trim leading whitespace including zero-width space (U+200B).
|
|
240
|
+
s = s.replace(/^[\s]+/u, "").replace(/[\s]+$/u, "");
|
|
241
|
+
s = s.toLowerCase();
|
|
242
|
+
s = s.replace(/\s+/gu, " ");
|
|
243
|
+
// Strip trailing terminator/whitespace run. CJK terminators included.
|
|
244
|
+
s = s.replace(/[\s.!?…。!?]+$/gu, "");
|
|
245
|
+
return s;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Attempt to snip the first sentence from `text`. Returns `null` if:
|
|
249
|
+
* - input is empty / whitespace only
|
|
250
|
+
* - no sentence-terminator found
|
|
251
|
+
* - normalised snip has > 10 words
|
|
252
|
+
* - normalised snip is empty after stripping terminators
|
|
253
|
+
*
|
|
254
|
+
* Otherwise returns a `FirstSentenceSnipResult` carrying the raw and
|
|
255
|
+
* normalised forms plus the word count.
|
|
256
|
+
*/
|
|
257
|
+
export function firstSentenceSnip(text) {
|
|
258
|
+
if (typeof text !== "string" || text.length === 0)
|
|
259
|
+
return null;
|
|
260
|
+
// Find start after leading whitespace (incl. zero-width space).
|
|
261
|
+
const trimMatch = /^[\s]+/u.exec(text);
|
|
262
|
+
const start = trimMatch ? trimMatch[0].length : 0;
|
|
263
|
+
if (start >= text.length)
|
|
264
|
+
return null;
|
|
265
|
+
const end = findTerminatorEnd(text, start);
|
|
266
|
+
if (end < 0)
|
|
267
|
+
return null;
|
|
268
|
+
const raw = text.slice(start, end + 1);
|
|
269
|
+
const normalized = normalizeForKey(raw);
|
|
270
|
+
if (!normalized)
|
|
271
|
+
return null;
|
|
272
|
+
const wc = wordCount(normalized);
|
|
273
|
+
if (wc === 0)
|
|
274
|
+
return null;
|
|
275
|
+
if (wc > FIRST_SENTENCE_MAX_WORDS)
|
|
276
|
+
return null;
|
|
277
|
+
return {
|
|
278
|
+
raw,
|
|
279
|
+
normalized,
|
|
280
|
+
wordCount: wc,
|
|
281
|
+
endOffset: end + 1,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=first-sentence-snip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-sentence-snip.js","sourceRoot":"","sources":["../../src/voice/first-sentence-snip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAY,CAAC;AAGxD;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAW,CAAC;AAEpD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAS;IACpC,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,I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,OAAO,IAAI,CAAC;IAE/D,gEAAgE;IAChE,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,IAAI,KAAK,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEtC,MAAM,GAAG,GAAG,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3C,IAAI,GAAG,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE7B,MAAM,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,IAAI,EAAE,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1B,IAAI,EAAE,GAAG,wBAAwB;QAAE,OAAO,IAAI,CAAC;IAE/C,OAAO;QACL,GAAG;QACH,UAAU;QACV,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,GAAG,GAAG,CAAC;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner-candidate inference for voice (#8785).
|
|
3
|
+
*
|
|
4
|
+
* "How does the agent know which speaker is the device OWNER?" Today the owner
|
|
5
|
+
* entity must be enrolled explicitly (the first-run voice flow). But when no
|
|
6
|
+
* owner is set, the agent should still be able to FORM a hypothesis from what it
|
|
7
|
+
* hears — the person who speaks to it most, most confidently, and clearly more
|
|
8
|
+
* than anyone else is the likely owner. This is the pure decision logic a
|
|
9
|
+
* provider/evaluator runs when the owner is unknown: it accumulates recognized
|
|
10
|
+
* voice turns and proposes a candidate only when the evidence is both sufficient
|
|
11
|
+
* (enough confident observations) and unambiguous (a clear lead over the
|
|
12
|
+
* runner-up). Otherwise it stays UNDECIDED — it never guesses an owner from one
|
|
13
|
+
* stray turn, because a wrong owner is a security and personalization hazard.
|
|
14
|
+
*
|
|
15
|
+
* Pure (no I/O, no models); the runtime feeds it the diarized/recognized
|
|
16
|
+
* observations and acts on a decided candidate (e.g. prompt to confirm, or set
|
|
17
|
+
* the owner setting). The Voice Workbench exercises the SAME function so the
|
|
18
|
+
* inference is benchmarked, not just shipped.
|
|
19
|
+
*/
|
|
20
|
+
/** One recognized voice turn: which enrolled/clustered speaker, how confident. */
|
|
21
|
+
export interface OwnerObservation {
|
|
22
|
+
/** The entity/cluster the recognized voice resolved to (null = unrecognized). */
|
|
23
|
+
entityId: string | null;
|
|
24
|
+
/** Recognition confidence 0..1 (cosine-rescaled by the attribution pipeline). */
|
|
25
|
+
confidence: number;
|
|
26
|
+
}
|
|
27
|
+
export interface OwnerInferenceOptions {
|
|
28
|
+
/** Minimum qualifying observations before any candidate is proposed. */
|
|
29
|
+
minObservations?: number;
|
|
30
|
+
/** Confidence floor; observations below it don't count toward a candidate. */
|
|
31
|
+
minConfidence?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Minimum lead (in confidence-weighted score) the top speaker must hold over
|
|
34
|
+
* the runner-up to be unambiguous. Prevents naming an owner in a two-equals
|
|
35
|
+
* household.
|
|
36
|
+
*/
|
|
37
|
+
minMargin?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface OwnerInferenceResult {
|
|
40
|
+
/** The proposed owner entity, or null when the evidence is insufficient. */
|
|
41
|
+
ownerEntityId: string | null;
|
|
42
|
+
/** Confidence-weighted share of the proposed owner (0..1), 0 when undecided. */
|
|
43
|
+
share: number;
|
|
44
|
+
/** Number of qualifying (confident, recognized) observations considered. */
|
|
45
|
+
qualifyingObservations: number;
|
|
46
|
+
/** Why the function decided / declined — surfaced for the provider's logs. */
|
|
47
|
+
reason: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Propose the most likely owner from recognized voice observations, or stay
|
|
51
|
+
* undecided. A candidate is returned only when there are at least
|
|
52
|
+
* `minObservations` confident, recognized turns AND the top speaker leads the
|
|
53
|
+
* runner-up by at least `minMargin` (confidence-weighted). Ties and thin
|
|
54
|
+
* evidence yield `ownerEntityId: null`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveOwnerCandidate(observations: ReadonlyArray<OwnerObservation>, options?: OwnerInferenceOptions): OwnerInferenceResult;
|
|
57
|
+
//# sourceMappingURL=owner-inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-inference.d.ts","sourceRoot":"","sources":["../../src/voice/owner-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,kFAAkF;AAClF,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,sBAAsB,EAAE,MAAM,CAAC;IAC/B,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAC7C,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CA4CtB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner-candidate inference for voice (#8785).
|
|
3
|
+
*
|
|
4
|
+
* "How does the agent know which speaker is the device OWNER?" Today the owner
|
|
5
|
+
* entity must be enrolled explicitly (the first-run voice flow). But when no
|
|
6
|
+
* owner is set, the agent should still be able to FORM a hypothesis from what it
|
|
7
|
+
* hears — the person who speaks to it most, most confidently, and clearly more
|
|
8
|
+
* than anyone else is the likely owner. This is the pure decision logic a
|
|
9
|
+
* provider/evaluator runs when the owner is unknown: it accumulates recognized
|
|
10
|
+
* voice turns and proposes a candidate only when the evidence is both sufficient
|
|
11
|
+
* (enough confident observations) and unambiguous (a clear lead over the
|
|
12
|
+
* runner-up). Otherwise it stays UNDECIDED — it never guesses an owner from one
|
|
13
|
+
* stray turn, because a wrong owner is a security and personalization hazard.
|
|
14
|
+
*
|
|
15
|
+
* Pure (no I/O, no models); the runtime feeds it the diarized/recognized
|
|
16
|
+
* observations and acts on a decided candidate (e.g. prompt to confirm, or set
|
|
17
|
+
* the owner setting). The Voice Workbench exercises the SAME function so the
|
|
18
|
+
* inference is benchmarked, not just shipped.
|
|
19
|
+
*/
|
|
20
|
+
const DEFAULT_MIN_OBSERVATIONS = 3;
|
|
21
|
+
const DEFAULT_MIN_CONFIDENCE = 0.7;
|
|
22
|
+
const DEFAULT_MIN_MARGIN = 1;
|
|
23
|
+
/**
|
|
24
|
+
* Propose the most likely owner from recognized voice observations, or stay
|
|
25
|
+
* undecided. A candidate is returned only when there are at least
|
|
26
|
+
* `minObservations` confident, recognized turns AND the top speaker leads the
|
|
27
|
+
* runner-up by at least `minMargin` (confidence-weighted). Ties and thin
|
|
28
|
+
* evidence yield `ownerEntityId: null`.
|
|
29
|
+
*/
|
|
30
|
+
export function resolveOwnerCandidate(observations, options = {}) {
|
|
31
|
+
const minObservations = options.minObservations ?? DEFAULT_MIN_OBSERVATIONS;
|
|
32
|
+
const minConfidence = options.minConfidence ?? DEFAULT_MIN_CONFIDENCE;
|
|
33
|
+
const minMargin = options.minMargin ?? DEFAULT_MIN_MARGIN;
|
|
34
|
+
const scores = new Map();
|
|
35
|
+
let qualifying = 0;
|
|
36
|
+
let totalScore = 0;
|
|
37
|
+
for (const obs of observations) {
|
|
38
|
+
if (obs.entityId === null)
|
|
39
|
+
continue;
|
|
40
|
+
if (!(obs.confidence >= minConfidence))
|
|
41
|
+
continue;
|
|
42
|
+
qualifying += 1;
|
|
43
|
+
const next = (scores.get(obs.entityId) ?? 0) + obs.confidence;
|
|
44
|
+
scores.set(obs.entityId, next);
|
|
45
|
+
totalScore += obs.confidence;
|
|
46
|
+
}
|
|
47
|
+
if (qualifying < minObservations) {
|
|
48
|
+
return {
|
|
49
|
+
ownerEntityId: null,
|
|
50
|
+
share: 0,
|
|
51
|
+
qualifyingObservations: qualifying,
|
|
52
|
+
reason: `insufficient evidence (${qualifying}/${minObservations} confident observations)`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const ranked = [...scores.entries()].sort((a, b) => b[1] - a[1]);
|
|
56
|
+
const [topId, topScore] = ranked[0];
|
|
57
|
+
const runnerUpScore = ranked[1]?.[1] ?? 0;
|
|
58
|
+
if (topScore - runnerUpScore < minMargin) {
|
|
59
|
+
return {
|
|
60
|
+
ownerEntityId: null,
|
|
61
|
+
share: totalScore > 0 ? topScore / totalScore : 0,
|
|
62
|
+
qualifyingObservations: qualifying,
|
|
63
|
+
reason: `ambiguous lead (top ${topScore.toFixed(2)} vs runner-up ${runnerUpScore.toFixed(2)}, margin < ${minMargin})`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
ownerEntityId: topId,
|
|
68
|
+
share: totalScore > 0 ? topScore / totalScore : 0,
|
|
69
|
+
qualifyingObservations: qualifying,
|
|
70
|
+
reason: `dominant speaker (${topScore.toFixed(2)} of ${totalScore.toFixed(2)} over ${qualifying} observations)`,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=owner-inference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-inference.js","sourceRoot":"","sources":["../../src/voice/owner-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAkCH,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACnC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,YAA6C,EAC7C,UAAiC,EAAE;IAEnC,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,wBAAwB,CAAC;IAC5E,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,sBAAsB,CAAC;IACtE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,kBAAkB,CAAC;IAE1D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,IAAI,GAAG,CAAC,QAAQ,KAAK,IAAI;YAAE,SAAS;QACpC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI,aAAa,CAAC;YAAE,SAAS;QACjD,UAAU,IAAI,CAAC,CAAC;QAChB,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC;QAC9D,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC/B,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC;IAC/B,CAAC;IAED,IAAI,UAAU,GAAG,eAAe,EAAE,CAAC;QACjC,OAAO;YACL,aAAa,EAAE,IA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shouldRespond / echo-rejection gate for always-on voice.
|
|
3
|
+
*
|
|
4
|
+
* In always-on ("hands-free") mode the mic is open continuously, so the
|
|
5
|
+
* recognizer transcribes EVERYTHING it hears — the agent's own text-to-speech
|
|
6
|
+
* bleeding back into the mic, the speaker's disfluent thinking noises ("um…"),
|
|
7
|
+
* and other people in the room. Sending those as turns makes the agent reply to
|
|
8
|
+
* itself, to filler, or to a bystander — the "responding when it's not
|
|
9
|
+
* appropriate" problem.
|
|
10
|
+
*
|
|
11
|
+
* This is the SINGLE definition of that gate, shared by:
|
|
12
|
+
* - the UI shell capture loop (`@elizaos/ui` `voice/should-respond` +
|
|
13
|
+
* `voice/voice-turn-signal` re-export from here), and
|
|
14
|
+
* - the Voice Workbench headless runner (the plugin's real-decision-logic
|
|
15
|
+
* services adapter calls these so the benchmark exercises the SAME code the
|
|
16
|
+
* client runs — no drift between what we test and what we ship).
|
|
17
|
+
*
|
|
18
|
+
* Pure (no DOM, no I/O); the only dependency is the canonical syntactic EOT
|
|
19
|
+
* heuristic in `@elizaos/shared/voice-eot`.
|
|
20
|
+
*/
|
|
21
|
+
/** How recent the agent's reply must be for the echo guard to apply. */
|
|
22
|
+
export declare const ECHO_WINDOW_MS = 9000;
|
|
23
|
+
/** Word-overlap fraction above which a turn is treated as TTS echo. */
|
|
24
|
+
export declare const ECHO_OVERLAP_THRESHOLD = 0.7;
|
|
25
|
+
export interface ShouldRespondContext {
|
|
26
|
+
/** The agent's most recent spoken reply, for the echo guard. */
|
|
27
|
+
recentAgentReply?: string;
|
|
28
|
+
/** Age of that reply in ms; the echo guard applies while it's recent. */
|
|
29
|
+
replyAgeMs?: number;
|
|
30
|
+
/**
|
|
31
|
+
* True while the agent is CURRENTLY speaking. Forces the echo guard on
|
|
32
|
+
* regardless of `replyAgeMs`, because a long reply's TTS is actively bleeding
|
|
33
|
+
* into the open mic even though its message was created many seconds ago (the
|
|
34
|
+
* age-only window would have already expired mid-speech).
|
|
35
|
+
*/
|
|
36
|
+
agentSpeaking?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether a transcribed voice turn should be sent to the agent (i.e. warrants a
|
|
40
|
+
* response). Returns false for pure disfluency and for near-verbatim echoes of
|
|
41
|
+
* the agent's recent speech.
|
|
42
|
+
*/
|
|
43
|
+
export declare function shouldRespondToVoiceTurn(transcript: string, context?: ShouldRespondContext): boolean;
|
|
44
|
+
/** Mirrors the server-side VoiceTurnSignalMetadata shape the gate parses. */
|
|
45
|
+
export interface VoiceTurnSignal {
|
|
46
|
+
endOfTurnProbability: number;
|
|
47
|
+
nextSpeaker: "agent" | "user" | "unknown";
|
|
48
|
+
agentShouldSpeak: boolean;
|
|
49
|
+
source: string;
|
|
50
|
+
}
|
|
51
|
+
/** Live speaker attribution from diarization (only where audio frames exist). */
|
|
52
|
+
export interface VoiceTurnSpeakerAttribution {
|
|
53
|
+
/** Enrolled entity this turn was attributed to, or null when unknown. */
|
|
54
|
+
entityId: string | null;
|
|
55
|
+
/** Match confidence 0..1 (cosine-rescaled by the attribution pipeline). */
|
|
56
|
+
confidence: number;
|
|
57
|
+
/** True when attributed to the device owner / primary enrolled speaker. */
|
|
58
|
+
isOwner?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface BuildVoiceTurnSignalContext extends ShouldRespondContext {
|
|
61
|
+
/** Speaker attribution for this turn (diarization; desktop/server only). */
|
|
62
|
+
speaker?: VoiceTurnSpeakerAttribution;
|
|
63
|
+
/** True when a wake word ("hey eliza") fired within the recent listen window. */
|
|
64
|
+
wakeWordActive?: boolean;
|
|
65
|
+
/** Entity ids the agent answers to without a wake word (owner + enrolled). */
|
|
66
|
+
knownSpeakerEntityIds?: readonly string[];
|
|
67
|
+
/**
|
|
68
|
+
* Cosine similarity (0..1) of THIS turn's speaker embedding against the
|
|
69
|
+
* agent's own TTS-voice imprint, when the speaker encoder is available. High =
|
|
70
|
+
* the agent is hearing ITSELF (its TTS bled back into the mic). This is the
|
|
71
|
+
* ACOUSTIC self-echo signal — it catches an echo the transcript word-overlap
|
|
72
|
+
* guard misses (a mis-transcribed echo whose words don't match the reply).
|
|
73
|
+
*/
|
|
74
|
+
selfVoiceSimilarity?: number;
|
|
75
|
+
}
|
|
76
|
+
/** Server SUPPRESS threshold for EOT — below this reads as "user still talking". */
|
|
77
|
+
export declare const SERVER_EOT_SUPPRESS_THRESHOLD = 0.4;
|
|
78
|
+
/** Only a CONFIDENT bystander attribution is allowed to silence a turn. */
|
|
79
|
+
export declare const BYSTANDER_SUPPRESS_CONFIDENCE = 0.7;
|
|
80
|
+
/**
|
|
81
|
+
* Cosine at/above which an incoming turn is treated as the agent's OWN voice and
|
|
82
|
+
* hard-suppressed. WeSpeaker enrolls the device owner at ~0.78; the agent's own
|
|
83
|
+
* TTS imprint is a tighter, single-source match, so a slightly lower bar is
|
|
84
|
+
* safe and catches echo the transcript guard cannot.
|
|
85
|
+
*/
|
|
86
|
+
export declare const AGENT_SELF_VOICE_THRESHOLD = 0.7;
|
|
87
|
+
export declare function buildVoiceTurnSignal(transcript: string, context?: BuildVoiceTurnSignalContext): VoiceTurnSignal;
|
|
88
|
+
//# sourceMappingURL=respond-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"respond-gate.d.ts","sourceRoot":"","sources":["../../src/voice/respond-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAqBH,wEAAwE;AACxE,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAU1C,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAuBT;AAED,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iFAAiF;AACjF,MAAM,WAAW,2BAA2B;IAC1C,yEAAyE;IACzE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,4EAA4E;IAC5E,OAAO,CAAC,EAAE,2BAA2B,CAAC;IACtC,iFAAiF;IACjF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8EAA8E;IAC9E,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,oFAAoF;AACpF,eAAO,MAAM,6BAA6B,MAAM,CAAC;AACjD,2EAA2E;AAC3E,eAAO,MAAM,6BAA6B,MAAM,CAAC;AACjD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,2BAAgC,GACxC,eAAe,CA0DjB"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical client-side shouldRespond / echo-rejection gate for always-on voice.
|
|
3
|
+
*
|
|
4
|
+
* In always-on ("hands-free") mode the mic is open continuously, so the
|
|
5
|
+
* recognizer transcribes EVERYTHING it hears — the agent's own text-to-speech
|
|
6
|
+
* bleeding back into the mic, the speaker's disfluent thinking noises ("um…"),
|
|
7
|
+
* and other people in the room. Sending those as turns makes the agent reply to
|
|
8
|
+
* itself, to filler, or to a bystander — the "responding when it's not
|
|
9
|
+
* appropriate" problem.
|
|
10
|
+
*
|
|
11
|
+
* This is the SINGLE definition of that gate, shared by:
|
|
12
|
+
* - the UI shell capture loop (`@elizaos/ui` `voice/should-respond` +
|
|
13
|
+
* `voice/voice-turn-signal` re-export from here), and
|
|
14
|
+
* - the Voice Workbench headless runner (the plugin's real-decision-logic
|
|
15
|
+
* services adapter calls these so the benchmark exercises the SAME code the
|
|
16
|
+
* client runs — no drift between what we test and what we ship).
|
|
17
|
+
*
|
|
18
|
+
* Pure (no DOM, no I/O); the only dependency is the canonical syntactic EOT
|
|
19
|
+
* heuristic in `@elizaos/shared/voice-eot`.
|
|
20
|
+
*/
|
|
21
|
+
import { scoreEndOfTurnHeuristic } from "../voice-eot.js";
|
|
22
|
+
/** Pure disfluencies — never a meaningful turn on their own. NOT answers. */
|
|
23
|
+
const DISFLUENCIES = new Set([
|
|
24
|
+
"um",
|
|
25
|
+
"uh",
|
|
26
|
+
"uhh",
|
|
27
|
+
"uhm",
|
|
28
|
+
"umm",
|
|
29
|
+
"hmm",
|
|
30
|
+
"hm",
|
|
31
|
+
"mm",
|
|
32
|
+
"mmm",
|
|
33
|
+
"er",
|
|
34
|
+
"erm",
|
|
35
|
+
"ah",
|
|
36
|
+
"eh",
|
|
37
|
+
]);
|
|
38
|
+
/** How recent the agent's reply must be for the echo guard to apply. */
|
|
39
|
+
export const ECHO_WINDOW_MS = 9000;
|
|
40
|
+
/** Word-overlap fraction above which a turn is treated as TTS echo. */
|
|
41
|
+
export const ECHO_OVERLAP_THRESHOLD = 0.7;
|
|
42
|
+
function words(text) {
|
|
43
|
+
return text
|
|
44
|
+
.toLowerCase()
|
|
45
|
+
.replace(/[^a-z0-9'\s-]/gi, "")
|
|
46
|
+
.split(/\s+/)
|
|
47
|
+
.filter(Boolean);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Whether a transcribed voice turn should be sent to the agent (i.e. warrants a
|
|
51
|
+
* response). Returns false for pure disfluency and for near-verbatim echoes of
|
|
52
|
+
* the agent's recent speech.
|
|
53
|
+
*/
|
|
54
|
+
export function shouldRespondToVoiceTurn(transcript, context = {}) {
|
|
55
|
+
const w = words(transcript);
|
|
56
|
+
if (w.length === 0)
|
|
57
|
+
return false;
|
|
58
|
+
// Pure disfluency ("um", "uh huh"… with nothing substantive) → ignore.
|
|
59
|
+
if (w.every((word) => DISFLUENCIES.has(word)))
|
|
60
|
+
return false;
|
|
61
|
+
// Self-echo: the agent's own TTS heard back through the mic. Only consider it
|
|
62
|
+
// while the reply is recent, and only for multi-word turns (a one-word answer
|
|
63
|
+
// shouldn't be suppressed just because the word also appears in the reply).
|
|
64
|
+
const reply = context.recentAgentReply?.trim();
|
|
65
|
+
const age = context.replyAgeMs ?? Number.POSITIVE_INFINITY;
|
|
66
|
+
const echoActive = context.agentSpeaking === true || age <= ECHO_WINDOW_MS;
|
|
67
|
+
if (reply && echoActive && w.length >= 2) {
|
|
68
|
+
const replyWords = new Set(words(reply));
|
|
69
|
+
if (replyWords.size > 0) {
|
|
70
|
+
const overlap = w.filter((word) => replyWords.has(word)).length / w.length;
|
|
71
|
+
if (overlap >= ECHO_OVERLAP_THRESHOLD)
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
/** Server SUPPRESS threshold for EOT — below this reads as "user still talking". */
|
|
78
|
+
export const SERVER_EOT_SUPPRESS_THRESHOLD = 0.4;
|
|
79
|
+
/** Only a CONFIDENT bystander attribution is allowed to silence a turn. */
|
|
80
|
+
export const BYSTANDER_SUPPRESS_CONFIDENCE = 0.7;
|
|
81
|
+
/**
|
|
82
|
+
* Cosine at/above which an incoming turn is treated as the agent's OWN voice and
|
|
83
|
+
* hard-suppressed. WeSpeaker enrolls the device owner at ~0.78; the agent's own
|
|
84
|
+
* TTS imprint is a tighter, single-source match, so a slightly lower bar is
|
|
85
|
+
* safe and catches echo the transcript guard cannot.
|
|
86
|
+
*/
|
|
87
|
+
export const AGENT_SELF_VOICE_THRESHOLD = 0.7;
|
|
88
|
+
export function buildVoiceTurnSignal(transcript, context = {}) {
|
|
89
|
+
const endOfTurnProbability = scoreEndOfTurnHeuristic(transcript);
|
|
90
|
+
// Transcript-level gate: the agent's own TTS echoed back through the mic, or
|
|
91
|
+
// pure thinking-noise ("um", "uh").
|
|
92
|
+
let agentShouldSpeak = shouldRespondToVoiceTurn(transcript, context);
|
|
93
|
+
// Audio-frame gate (only when diarization attributed the turn): a CONFIDENT
|
|
94
|
+
// bystander — someone who is neither the owner nor an enrolled speaker — who
|
|
95
|
+
// did NOT say the wake word is cross-talk, not a turn addressed to the agent.
|
|
96
|
+
// An uncertain attribution must never silence a real turn (fail open).
|
|
97
|
+
const speaker = context.speaker;
|
|
98
|
+
if (agentShouldSpeak && speaker && context.wakeWordActive !== true) {
|
|
99
|
+
const known = new Set(context.knownSpeakerEntityIds ?? []);
|
|
100
|
+
const enrolled = speaker.isOwner === true ||
|
|
101
|
+
(speaker.entityId !== null && known.has(speaker.entityId));
|
|
102
|
+
const confidentBystander = !enrolled &&
|
|
103
|
+
speaker.entityId !== null &&
|
|
104
|
+
speaker.confidence >= BYSTANDER_SUPPRESS_CONFIDENCE;
|
|
105
|
+
if (confidentBystander)
|
|
106
|
+
agentShouldSpeak = false;
|
|
107
|
+
}
|
|
108
|
+
// The wake word is an explicit address: it overrides bystander doubt and a
|
|
109
|
+
// soft echo/disfluency miss, because the user deliberately summoned the agent.
|
|
110
|
+
if (context.wakeWordActive === true)
|
|
111
|
+
agentShouldSpeak = true;
|
|
112
|
+
// Acoustic self-voice rejection: if the incoming voice MATCHES the agent's own
|
|
113
|
+
// TTS imprint while it is (or just was) speaking, it is the agent hearing
|
|
114
|
+
// itself — hard-suppress, even past the wake word. This is definitive (the
|
|
115
|
+
// owner cannot sound like the agent's synthetic voice) and catches the echo
|
|
116
|
+
// the transcript word-overlap guard misses (e.g. a mis-transcribed echo, or a
|
|
117
|
+
// "hey eliza" that the agent itself spoke).
|
|
118
|
+
const replyRecent = context.agentSpeaking === true ||
|
|
119
|
+
(context.replyAgeMs ?? Number.POSITIVE_INFINITY) <= ECHO_WINDOW_MS;
|
|
120
|
+
const isSelfVoice = context.selfVoiceSimilarity !== undefined &&
|
|
121
|
+
context.selfVoiceSimilarity >= AGENT_SELF_VOICE_THRESHOLD &&
|
|
122
|
+
replyRecent;
|
|
123
|
+
if (isSelfVoice)
|
|
124
|
+
agentShouldSpeak = false;
|
|
125
|
+
const nextSpeaker = !agentShouldSpeak
|
|
126
|
+
? "user"
|
|
127
|
+
: endOfTurnProbability < SERVER_EOT_SUPPRESS_THRESHOLD
|
|
128
|
+
? "user"
|
|
129
|
+
: "agent";
|
|
130
|
+
const source = isSelfVoice
|
|
131
|
+
? "client-ambient+self-voice"
|
|
132
|
+
: context.wakeWordActive
|
|
133
|
+
? "client-ambient+wakeword"
|
|
134
|
+
: speaker
|
|
135
|
+
? "client-ambient+diarization"
|
|
136
|
+
: "client-ambient";
|
|
137
|
+
return { endOfTurnProbability, nextSpeaker, agentShouldSpeak, source };
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=respond-gate.js.map
|