@elizaos/shared 2.0.0-alpha.538 → 2.0.3-beta.2
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/api/route-helpers.js +2 -0
- package/api/route-helpers.js.map +1 -0
- package/app-hero-art.d.ts.map +1 -1
- package/app-hero-art.js +5 -13
- package/app-hero-art.js.map +1 -1
- 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/{onboarding-presets.characters.d.ts → character-presets.characters.d.ts} +2 -2
- package/character-presets.characters.d.ts.map +1 -0
- package/{onboarding-presets.characters.js → character-presets.characters.js} +1 -1
- package/character-presets.characters.js.map +1 -0
- package/{onboarding-presets.d.ts → character-presets.d.ts} +7 -5
- package/character-presets.d.ts.map +1 -0
- package/{onboarding-presets.js → character-presets.js} +53 -58
- package/character-presets.js.map +1 -0
- package/{onboarding-presets.shared.d.ts → character-presets.shared.d.ts} +1 -1
- package/character-presets.shared.d.ts.map +1 -0
- package/{onboarding-presets.shared.js → character-presets.shared.js} +1 -1
- 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 +5 -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.d.ts +8 -0
- package/config/allowed-hosts.d.ts.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 +75 -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 +74 -0
- package/config/boot-config-store.d.ts.map +1 -0
- package/config/boot-config-store.js +121 -0
- package/config/boot-config-store.js.map +1 -0
- package/config/boot-config.d.ts +6 -0
- package/config/boot-config.d.ts.map +1 -0
- package/config/boot-config.js +6 -0
- package/config/boot-config.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 +371 -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-paths.d.ts +11 -0
- package/config/config-paths.d.ts.map +1 -0
- package/config/config-paths.js +74 -0
- package/config/config-paths.js.map +1 -0
- package/config/config.d.ts +11 -0
- package/config/config.d.ts.map +1 -0
- package/config/config.js +23 -0
- package/config/config.js.map +1 -0
- package/config/distribution-profile.d.ts +16 -0
- package/config/distribution-profile.d.ts.map +1 -0
- package/config/distribution-profile.js +29 -0
- package/config/distribution-profile.js.map +1 -0
- package/config/env-vars.d.ts +2 -0
- package/config/env-vars.d.ts.map +1 -0
- package/config/env-vars.js +2 -0
- package/config/env-vars.js.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.d.ts +4 -0
- package/config/plugin-auto-enable-engine.d.ts.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-auto-enable.d.ts +2 -0
- package/config/plugin-auto-enable.d.ts.map +1 -0
- package/config/plugin-auto-enable.js +8 -0
- package/config/plugin-auto-enable.js.map +1 -0
- package/config/plugin-manifest.d.ts +89 -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/plugin-ui-spec.d.ts +42 -0
- package/config/plugin-ui-spec.d.ts.map +1 -0
- package/config/plugin-ui-spec.js +257 -0
- package/config/plugin-ui-spec.js.map +1 -0
- package/config/runtime-mode.d.ts +54 -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/runtime-overrides.d.ts +16 -0
- package/config/runtime-overrides.d.ts.map +1 -0
- package/config/runtime-overrides.js +49 -0
- package/config/runtime-overrides.js.map +1 -0
- package/config/schema.d.ts +7 -0
- package/config/schema.d.ts.map +1 -0
- package/config/schema.js +30 -0
- package/config/schema.js.map +1 -0
- package/config/types.agent-defaults.d.ts +6 -1
- package/config/types.agent-defaults.d.ts.map +1 -1
- package/config/types.agents.d.ts +9 -4
- package/config/types.agents.d.ts.map +1 -1
- package/config/types.eliza.d.ts +27 -49
- package/config/types.eliza.d.ts.map +1 -1
- package/config/types.messages.d.ts +2 -2
- package/config/types.messages.d.ts.map +1 -1
- package/config/types.tools.d.ts +2 -2
- package/config/types.tools.d.ts.map +1 -1
- package/config/ui-spec.d.ts +164 -0
- package/config/ui-spec.d.ts.map +1 -0
- package/config/ui-spec.js +14 -0
- package/config/ui-spec.js.map +1 -0
- package/config/wechat-config.d.ts +2 -0
- package/config/wechat-config.d.ts.map +1 -0
- package/config/wechat-config.js +2 -0
- package/config/wechat-config.js.map +1 -0
- package/config/zod-schema.agent-runtime.d.ts +1087 -0
- package/config/zod-schema.agent-runtime.d.ts.map +1 -0
- package/config/zod-schema.agent-runtime.js +764 -0
- package/config/zod-schema.agent-runtime.js.map +1 -0
- package/config/zod-schema.core.d.ts +1048 -0
- package/config/zod-schema.core.d.ts.map +1 -0
- package/config/zod-schema.core.js +707 -0
- package/config/zod-schema.core.js.map +1 -0
- package/connector-cred-types.d.ts +3 -3
- package/connector-cred-types.js +4 -4
- package/connectors.d.ts +0 -8
- package/connectors.d.ts.map +1 -1
- package/connectors.js +26 -50
- package/connectors.js.map +1 -1
- 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 +883 -3
- package/contracts/apps.d.ts.map +1 -1
- package/contracts/apps.js +278 -40
- package/contracts/apps.js.map +1 -1
- 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/awareness.d.ts +1 -1
- 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 +7 -7
- package/contracts/cloud-topology.js.map +1 -1
- package/contracts/config.d.ts +52 -4
- package/contracts/config.d.ts.map +1 -1
- 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 +2 -2
- package/contracts/content-pack.d.ts.map +1 -1
- package/contracts/content-pack.js +1 -1
- package/contracts/conversation-routes.d.ts +195 -0
- package/contracts/conversation-routes.d.ts.map +1 -0
- package/contracts/conversation-routes.js +107 -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/feature-result.d.ts +24 -0
- package/contracts/feature-result.d.ts.map +1 -0
- package/contracts/feature-result.js +7 -0
- package/contracts/feature-result.js.map +1 -0
- package/contracts/{onboarding.d.ts → first-run-options.d.ts} +172 -69
- package/contracts/first-run-options.d.ts.map +1 -0
- package/contracts/{onboarding.js → first-run-options.js} +222 -91
- 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 +30 -3
- package/contracts/index.d.ts.map +1 -1
- package/contracts/index.js +30 -3
- package/contracts/index.js.map +1 -1
- 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 +81 -11
- package/contracts/permissions.d.ts.map +1 -1
- package/contracts/permissions.js +37 -1
- package/contracts/permissions.js.map +1 -1
- package/contracts/{lifeops.d.ts → personal-assistant.d.ts} +368 -170
- package/contracts/personal-assistant.d.ts.map +1 -0
- package/contracts/{lifeops.js → personal-assistant.js} +39 -13
- 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 +7 -121
- package/contracts/service-routing.d.ts.map +1 -1
- package/contracts/service-routing.js +19 -12
- package/contracts/service-routing.js.map +1 -1
- 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 +0 -2
- package/contracts/theme.d.ts.map +1 -1
- package/contracts/theme.js +0 -2
- package/contracts/theme.js.map +1 -1
- 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 +12 -570
- package/contracts/wallet.d.ts.map +1 -1
- package/contracts/wallet.js +139 -0
- package/contracts/wallet.js.map +1 -1
- 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 +1 -1
- package/dev-settings-banner-style.js +2 -2
- package/dev-settings-banner-style.js.map +1 -1
- package/dev-settings-figlet-heading.d.ts.map +1 -1
- package/dev-settings-figlet-heading.js +1 -8
- package/dev-settings-figlet-heading.js.map +1 -1
- 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 +1 -4
- package/env-utils.d.ts.map +1 -1
- package/env-utils.js +9 -1
- package/env-utils.js.map +1 -1
- 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/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 +2711 -748
- package/i18n/generated/validation-keyword-data.d.ts.map +1 -1
- package/i18n/generated/validation-keyword-data.js +2711 -748
- package/i18n/generated/validation-keyword-data.js.map +1 -1
- package/i18n/keyword-matching.d.ts.map +1 -1
- package/i18n/keyword-matching.js +4 -1
- package/i18n/keyword-matching.js.map +1 -1
- package/index.d.ts +82 -7
- package/index.d.ts.map +1 -1
- package/index.js +109 -13
- package/index.js.map +1 -1
- 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 +97 -0
- package/local-inference/catalog.d.ts.map +1 -0
- package/local-inference/catalog.js +510 -0
- package/local-inference/catalog.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/index.d.ts +21 -0
- package/local-inference/index.d.ts.map +1 -0
- package/local-inference/index.js +18 -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.d.ts.map +1 -0
- package/local-inference/paths.js +40 -0
- package/local-inference/paths.js.map +1 -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 +38 -0
- package/local-inference/routing-preferences.d.ts.map +1 -0
- package/local-inference/routing-preferences.js +90 -0
- package/local-inference/routing-preferences.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 +510 -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/verify.d.ts +39 -0
- package/local-inference/verify.d.ts.map +1 -0
- package/local-inference/verify.js +105 -0
- package/local-inference/verify.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 +746 -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/package.json +111 -160
- package/platform/is-native-server.d.ts +9 -0
- package/platform/is-native-server.d.ts.map +1 -0
- package/platform/is-native-server.js +12 -0
- package/platform/is-native-server.js.map +1 -0
- package/restart.d.ts +2 -1
- package/restart.d.ts.map +1 -1
- package/restart.js +3 -2
- package/restart.js.map +1 -1
- package/runtime-env.d.ts +2 -2
- package/runtime-env.d.ts.map +1 -1
- package/runtime-env.js +15 -7
- package/runtime-env.js.map +1 -1
- package/self-edit.d.ts +4 -4
- package/self-edit.d.ts.map +1 -1
- package/self-edit.js +5 -5
- package/self-edit.js.map +1 -1
- package/settings-debug.d.ts.map +1 -1
- package/settings-debug.js +45 -38
- package/settings-debug.js.map +1 -1
- package/spoken-text.d.ts.map +1 -1
- package/spoken-text.js +3 -2
- package/spoken-text.js.map +1 -1
- package/steward-session-client/index.d.ts +172 -0
- package/steward-session-client/index.d.ts.map +1 -0
- package/steward-session-client/index.js +248 -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/terminal/links.d.ts +9 -0
- package/terminal/links.d.ts.map +1 -0
- package/terminal/links.js +21 -0
- package/terminal/links.js.map +1 -0
- package/terminal/palette.d.ts +11 -0
- package/terminal/palette.d.ts.map +1 -0
- package/terminal/palette.js +13 -0
- package/terminal/palette.js.map +1 -0
- package/terminal/theme.d.ts +17 -0
- package/terminal/theme.d.ts.map +1 -0
- package/terminal/theme.js +25 -0
- package/terminal/theme.js.map +1 -0
- package/test-support/process-helpers.d.ts +13 -0
- package/test-support/process-helpers.d.ts.map +1 -0
- package/test-support/process-helpers.js +24 -0
- package/test-support/process-helpers.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 +139 -0
- package/transcripts.d.ts.map +1 -0
- package/transcripts.js +162 -0
- package/transcripts.js.map +1 -0
- package/type-guards.d.ts +1 -23
- package/type-guards.d.ts.map +1 -1
- package/type-guards.js +6 -23
- package/type-guards.js.map +1 -1
- package/types/index.d.ts +654 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +5 -0
- package/types/index.js.map +1 -0
- package/utils/asset-url.d.ts +24 -0
- package/utils/asset-url.d.ts.map +1 -0
- package/utils/asset-url.js +151 -0
- package/utils/asset-url.js.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.d.ts.map +1 -0
- package/utils/browser-tab-kit-types.js +23 -0
- package/utils/browser-tab-kit-types.js.map +1 -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/character-message-examples.d.ts +7 -0
- package/utils/character-message-examples.d.ts.map +1 -0
- package/utils/character-message-examples.js +123 -0
- package/utils/character-message-examples.js.map +1 -0
- package/utils/cloud-status.d.ts +3 -0
- package/utils/cloud-status.d.ts.map +1 -0
- package/utils/cloud-status.js +11 -0
- package/utils/cloud-status.js.map +1 -0
- package/utils/documents-upload-image.d.ts +27 -0
- package/utils/documents-upload-image.d.ts.map +1 -0
- package/utils/documents-upload-image.js +147 -0
- package/utils/documents-upload-image.js.map +1 -0
- package/utils/eliza-cloud-model-route.d.ts +3 -0
- package/utils/eliza-cloud-model-route.d.ts.map +1 -0
- package/utils/eliza-cloud-model-route.js +10 -0
- package/utils/eliza-cloud-model-route.js.map +1 -0
- package/utils/eliza-globals.d.ts +13 -0
- package/utils/eliza-globals.d.ts.map +1 -0
- package/utils/eliza-globals.js +49 -0
- package/utils/eliza-globals.js.map +1 -0
- package/utils/eliza-root.d.ts +9 -0
- package/utils/eliza-root.d.ts.map +1 -0
- package/utils/eliza-root.js +102 -0
- package/utils/eliza-root.js.map +1 -0
- package/utils/env.d.ts +34 -0
- package/utils/env.d.ts.map +1 -0
- package/utils/env.js +142 -0
- package/utils/env.js.map +1 -0
- package/utils/errors.d.ts +13 -0
- package/utils/errors.d.ts.map +1 -0
- package/utils/errors.js +26 -0
- package/utils/errors.js.map +1 -0
- package/utils/exec-safety.d.ts +2 -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/labels.d.ts +6 -0
- package/utils/labels.d.ts.map +1 -0
- package/utils/labels.js +42 -0
- package/utils/labels.js.map +1 -0
- package/utils/log-prefix.d.ts +2 -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.d.ts.map +1 -0
- package/utils/name-tokens.js +37 -0
- package/utils/name-tokens.js.map +1 -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 +26 -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/owner-name.d.ts +3 -0
- package/utils/owner-name.d.ts.map +1 -0
- package/utils/owner-name.js +8 -0
- package/utils/owner-name.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/rate-limiter.d.ts +32 -0
- package/utils/rate-limiter.d.ts.map +1 -0
- package/utils/rate-limiter.js +53 -0
- package/utils/rate-limiter.js.map +1 -0
- package/utils/serialise.d.ts +12 -0
- package/utils/serialise.d.ts.map +1 -0
- package/utils/serialise.js +22 -0
- package/utils/serialise.js.map +1 -0
- package/utils/sql-compat.d.ts +10 -0
- package/utils/sql-compat.d.ts.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/subscription-auth.d.ts +9 -0
- package/utils/subscription-auth.d.ts.map +1 -0
- package/utils/subscription-auth.js +49 -0
- package/utils/subscription-auth.js.map +1 -0
- package/utils/trajectory-format.d.ts +6 -0
- package/utils/trajectory-format.d.ts.map +1 -0
- package/utils/trajectory-format.js +44 -0
- package/utils/trajectory-format.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 +360 -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/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-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/contracts/lifeops-extensions.d.ts +0 -340
- package/contracts/lifeops-extensions.d.ts.map +0 -1
- package/contracts/lifeops-extensions.js +0 -37
- package/contracts/lifeops-extensions.js.map +0 -1
- package/contracts/lifeops.d.ts.map +0 -1
- package/contracts/lifeops.js.map +0 -1
- package/contracts/onboarding.d.ts.map +0 -1
- package/contracts/onboarding.js.map +0 -1
- package/contracts/scratchpad.d.ts +0 -136
- package/contracts/scratchpad.d.ts.map +0 -1
- package/contracts/scratchpad.js +0 -91
- package/contracts/scratchpad.js.map +0 -1
- package/eliza-core-roles.d.ts +0 -79
- package/eliza-core-roles.d.ts.map +0 -1
- package/eliza-core-roles.js +0 -600
- package/eliza-core-roles.js.map +0 -1
- package/env-utils.impl.d.ts +0 -2
- package/env-utils.impl.d.ts.map +0 -1
- package/env-utils.impl.js +0 -10
- package/env-utils.impl.js.map +0 -1
- package/onboarding-presets.characters.d.ts.map +0 -1
- package/onboarding-presets.characters.js.map +0 -1
- package/onboarding-presets.d.ts.map +0 -1
- package/onboarding-presets.js.map +0 -1
- package/onboarding-presets.shared.d.ts.map +0 -1
- package/onboarding-presets.shared.js.map +0 -1
- package/themes/index.d.ts +0 -7
- package/themes/index.d.ts.map +0 -1
- package/themes/index.js +0 -6
- package/themes/index.js.map +0 -1
- package/themes/presets.d.ts +0 -15
- package/themes/presets.d.ts.map +0 -1
- package/themes/presets.js +0 -789
- package/themes/presets.js.map +0 -1
- package/types.d.ts +0 -27
- package/types.d.ts.map +0 -1
- package/types.js +0 -2
- package/types.js.map +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network-policy bridge — used by the voice-model auto-updater and the
|
|
3
|
+
* model downloader to decide whether a multi-GB pull is allowed to proceed
|
|
4
|
+
* without prompting the user.
|
|
5
|
+
*
|
|
6
|
+
* Per R5-versioning §4 (per-platform download policy):
|
|
7
|
+
*
|
|
8
|
+
* - Android: `NetworkCapabilities.hasCapability(NET_CAPABILITY_NOT_METERED)`.
|
|
9
|
+
* Android explicitly warns against equating cellular = metered (a user
|
|
10
|
+
* can have unmetered cellular, or a metered Wi-Fi hotspot), so the
|
|
11
|
+
* metered flag is mandatory, not derived from connection type.
|
|
12
|
+
* - iOS: `NWPathMonitor.path.isExpensive` — Apple's "treat as metered" flag.
|
|
13
|
+
* - Desktop (Electron/Electrobun): WinRT `NetworkCostType`, NetworkManager
|
|
14
|
+
* dbus `ActiveConnection.Metered`, or macOS `NWPathMonitor` via the
|
|
15
|
+
* native bridge.
|
|
16
|
+
* - Headless server / CLI: skip auto-update entirely; explicit
|
|
17
|
+
* `eliza models update` only.
|
|
18
|
+
*
|
|
19
|
+
* The actual platform shims are wired in `plugin-local-inference`'s
|
|
20
|
+
* `services/network-policy.ts`. This module defines the platform-agnostic
|
|
21
|
+
* decision contract and ships a pure `evaluateNetworkPolicy` that lets
|
|
22
|
+
* higher-level code unit-test the decision rule without a runtime.
|
|
23
|
+
*/
|
|
24
|
+
export const DEFAULT_NETWORK_POLICY_PREFERENCES = {
|
|
25
|
+
autoUpdateOnWifi: true,
|
|
26
|
+
autoUpdateOnCellular: false,
|
|
27
|
+
autoUpdateOnMetered: false,
|
|
28
|
+
quietHours: [{ start: "22:00", end: "08:00" }],
|
|
29
|
+
};
|
|
30
|
+
/** Classify the raw state into one of the five canonical classes. */
|
|
31
|
+
export function classifyNetwork(state) {
|
|
32
|
+
if (state.connectionType === "none")
|
|
33
|
+
return "unknown";
|
|
34
|
+
if (state.connectionType === "cellular")
|
|
35
|
+
return "cellular";
|
|
36
|
+
if (state.connectionType === "wifi") {
|
|
37
|
+
if (state.metered === true)
|
|
38
|
+
return "wifi-metered";
|
|
39
|
+
if (state.metered === false)
|
|
40
|
+
return "wifi-unmetered";
|
|
41
|
+
return "unknown";
|
|
42
|
+
}
|
|
43
|
+
if (state.connectionType === "ethernet") {
|
|
44
|
+
if (state.metered === true)
|
|
45
|
+
return "ethernet-metered";
|
|
46
|
+
if (state.metered === false)
|
|
47
|
+
return "ethernet-unmetered";
|
|
48
|
+
return "unknown";
|
|
49
|
+
}
|
|
50
|
+
return "unknown";
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Apply the user prefs + estimated transfer size to a classified network
|
|
54
|
+
* state. The decision rule:
|
|
55
|
+
*
|
|
56
|
+
* - cellular: ask unless `autoUpdateOnCellular === true`.
|
|
57
|
+
* - any `*-metered`: ask unless `autoUpdateOnMetered === true`.
|
|
58
|
+
* - `wifi-unmetered`: auto if `autoUpdateOnWifi === true`, else ask.
|
|
59
|
+
* - `ethernet-unmetered`: always auto (desktop wired link).
|
|
60
|
+
* - `unknown`: ask (mobile default; desktop callers can override).
|
|
61
|
+
*
|
|
62
|
+
* Quiet hours (if active) downgrade all `auto` decisions to `ask`.
|
|
63
|
+
*/
|
|
64
|
+
export function applyNetworkPolicy(klass, prefs, estimatedBytes, options) {
|
|
65
|
+
if (options?.isHeadless === true) {
|
|
66
|
+
return {
|
|
67
|
+
class: klass,
|
|
68
|
+
allow: false,
|
|
69
|
+
reason: "headless-explicit-only",
|
|
70
|
+
estimatedBytes,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const reasonForAsk = () => {
|
|
74
|
+
if (klass === "cellular")
|
|
75
|
+
return "cellular-ask";
|
|
76
|
+
if (klass === "wifi-metered" || klass === "ethernet-metered") {
|
|
77
|
+
return "metered-ask";
|
|
78
|
+
}
|
|
79
|
+
return "metered-ask";
|
|
80
|
+
};
|
|
81
|
+
let autoAllowed;
|
|
82
|
+
switch (klass) {
|
|
83
|
+
case "ethernet-unmetered":
|
|
84
|
+
autoAllowed = true;
|
|
85
|
+
break;
|
|
86
|
+
case "wifi-unmetered":
|
|
87
|
+
autoAllowed = prefs.autoUpdateOnWifi;
|
|
88
|
+
break;
|
|
89
|
+
case "wifi-metered":
|
|
90
|
+
case "ethernet-metered":
|
|
91
|
+
autoAllowed = prefs.autoUpdateOnMetered;
|
|
92
|
+
break;
|
|
93
|
+
case "cellular":
|
|
94
|
+
autoAllowed = prefs.autoUpdateOnCellular;
|
|
95
|
+
break;
|
|
96
|
+
case "unknown":
|
|
97
|
+
autoAllowed = false;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (autoAllowed &&
|
|
101
|
+
inQuietHours(prefs.quietHours, options?.now ?? new Date())) {
|
|
102
|
+
autoAllowed = false;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
class: klass,
|
|
106
|
+
allow: autoAllowed,
|
|
107
|
+
reason: autoAllowed ? "auto" : reasonForAsk(),
|
|
108
|
+
estimatedBytes,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function parseClock(hhmm) {
|
|
112
|
+
const m = /^(\d{1,2}):(\d{2})$/.exec(hhmm);
|
|
113
|
+
if (!m)
|
|
114
|
+
return null;
|
|
115
|
+
const h = Number(m[1]);
|
|
116
|
+
const min = Number(m[2]);
|
|
117
|
+
if (!Number.isFinite(h) || !Number.isFinite(min))
|
|
118
|
+
return null;
|
|
119
|
+
if (h < 0 || h > 23 || min < 0 || min > 59)
|
|
120
|
+
return null;
|
|
121
|
+
return h * 60 + min;
|
|
122
|
+
}
|
|
123
|
+
/** True if `now` falls inside any quiet-hours window. */
|
|
124
|
+
export function inQuietHours(windows, now) {
|
|
125
|
+
if (windows.length === 0)
|
|
126
|
+
return false;
|
|
127
|
+
const minutes = now.getHours() * 60 + now.getMinutes();
|
|
128
|
+
for (const w of windows) {
|
|
129
|
+
const start = parseClock(w.start);
|
|
130
|
+
const end = parseClock(w.end);
|
|
131
|
+
if (start === null || end === null)
|
|
132
|
+
continue;
|
|
133
|
+
if (start === end)
|
|
134
|
+
continue;
|
|
135
|
+
if (start < end) {
|
|
136
|
+
if (minutes >= start && minutes < end)
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// Window crosses midnight: e.g. 22:00 -> 08:00.
|
|
141
|
+
if (minutes >= start || minutes < end)
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Convenience composition for callers that have a raw state + prefs +
|
|
149
|
+
* estimated size in hand and want a single decision.
|
|
150
|
+
*/
|
|
151
|
+
export function evaluateNetworkPolicy(state, prefs, estimatedBytes, options) {
|
|
152
|
+
return applyNetworkPolicy(classifyNetwork(state), prefs, estimatedBytes, options);
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=network-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-policy.js","sourceRoot":"","sources":["../../src/local-inference/network-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AA0DH,MAAM,CAAC,MAAM,kCAAkC,GAA6B;IAC1E,gBAAgB,EAAE,IAAI;IACtB,oBAAoB,EAAE,KAAK;IAC3B,mBAAmB,EAAE,KAAK;IAC1B,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;CAC/C,CAAC;AAsBF,qEAAqE;AACrE,MAAM,UAAU,eAAe,CAAC,KAAsB;IACpD,IAAI,KAAK,CAAC,cAAc,KAAK,MAAM;QAAE,OAAO,SAAS,CAAC;IACtD,IAAI,KAAK,CAAC,cAAc,KAAK,UAAU;QAAE,OAAO,UAAU,CAAC;IAC3D,IAAI,KAAK,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;QACpC,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;YAAE,OAAO,cAAc,CAAC;QAClD,IAAI,KAA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AC;IACvD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI;YAAE,SAAS;QAC7C,IAAI,KAAK,KAAK,GAAG;YAAE,SAAS;QAC5B,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;YAChB,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG;gBAAE,OAAO,IAAI,CAAC;QACrD,CAAC;aAAM,CAAC;YACN,gDAAgD;YAChD,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,GAAG,GAAG;gBAAE,OAAO,IAAI,CAAC;QACrD,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAsB,EACtB,KAA+B,EAC/B,cAAsB,EACtB,OAA8C;IAE9C,OAAO,kBAAkB,CACvB,eAAe,CAAC,KAAK,CAAC,EACtB,KAAK,EACL,cAAc,EACd,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path resolution for the local-inference service.
|
|
3
|
+
*
|
|
4
|
+
* All Eliza-owned files live under `<state-dir>/local-inference/` to match
|
|
5
|
+
* the convention established by `plugin-installer.ts` and the rest of
|
|
6
|
+
* app-core. We never write to paths outside of this root.
|
|
7
|
+
*
|
|
8
|
+
* `<state-dir>` follows the canonical `ELIZA_STATE_DIR` > XDG state
|
|
9
|
+
* precedence;
|
|
10
|
+
* on AOSP, `ELIZA_STATE_DIR` is set by `ElizaAgentService.java` to
|
|
11
|
+
* `/data/data/<pkg>/files/.eliza` so models land at
|
|
12
|
+
* `<that>/local-inference/models/` and not under a stray homedir-derived
|
|
13
|
+
* path.
|
|
14
|
+
*/
|
|
15
|
+
export declare function localInferenceRoot(): string;
|
|
16
|
+
/** Directory for models Eliza downloaded itself. Safe to delete. */
|
|
17
|
+
export declare function elizaModelsDir(): string;
|
|
18
|
+
/** JSON file tracking installed-model metadata (downloaded + discovered). */
|
|
19
|
+
export declare function registryPath(): string;
|
|
20
|
+
/** Partial-download staging directory; files here are resume candidates. */
|
|
21
|
+
export declare function downloadsStagingDir(): string;
|
|
22
|
+
/** True when `target` is inside Eliza's local-inference root. */
|
|
23
|
+
export declare function isWithinElizaRoot(target: string): boolean;
|
|
24
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/local-inference/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,oEAAoE;AACpE,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKzD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path resolution for the local-inference service.
|
|
3
|
+
*
|
|
4
|
+
* All Eliza-owned files live under `<state-dir>/local-inference/` to match
|
|
5
|
+
* the convention established by `plugin-installer.ts` and the rest of
|
|
6
|
+
* app-core. We never write to paths outside of this root.
|
|
7
|
+
*
|
|
8
|
+
* `<state-dir>` follows the canonical `ELIZA_STATE_DIR` > XDG state
|
|
9
|
+
* precedence;
|
|
10
|
+
* on AOSP, `ELIZA_STATE_DIR` is set by `ElizaAgentService.java` to
|
|
11
|
+
* `/data/data/<pkg>/files/.eliza` so models land at
|
|
12
|
+
* `<that>/local-inference/models/` and not under a stray homedir-derived
|
|
13
|
+
* path.
|
|
14
|
+
*/
|
|
15
|
+
import path from "node:path";
|
|
16
|
+
import { resolveStateDir } from "@elizaos/core";
|
|
17
|
+
export function localInferenceRoot() {
|
|
18
|
+
return path.join(resolveStateDir(), "local-inference");
|
|
19
|
+
}
|
|
20
|
+
/** Directory for models Eliza downloaded itself. Safe to delete. */
|
|
21
|
+
export function elizaModelsDir() {
|
|
22
|
+
return path.join(localInferenceRoot(), "models");
|
|
23
|
+
}
|
|
24
|
+
/** JSON file tracking installed-model metadata (downloaded + discovered). */
|
|
25
|
+
export function registryPath() {
|
|
26
|
+
return path.join(localInferenceRoot(), "registry.json");
|
|
27
|
+
}
|
|
28
|
+
/** Partial-download staging directory; files here are resume candidates. */
|
|
29
|
+
export function downloadsStagingDir() {
|
|
30
|
+
return path.join(localInferenceRoot(), "downloads");
|
|
31
|
+
}
|
|
32
|
+
/** True when `target` is inside Eliza's local-inference root. */
|
|
33
|
+
export function isWithinElizaRoot(target) {
|
|
34
|
+
const root = path.resolve(localInferenceRoot());
|
|
35
|
+
const resolved = path.resolve(target);
|
|
36
|
+
if (resolved === root)
|
|
37
|
+
return false;
|
|
38
|
+
return resolved.startsWith(`${root}${path.sep}`);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/local-inference/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,iBAAiB,CAAC,CAAC;AACzD,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,QAAQ,CAAC,CAAC;AACnD,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,eAAe,CAAC,CAAC;AAC1D,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,WAAW,CAAC,CAAC;AACtD,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACpC,OAAO,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-registry **data-only** contracts shared between the agent
|
|
3
|
+
* server and UI clients. Everything in this file must remain free of
|
|
4
|
+
* runtime-only capabilities (no methods, no callables) so the same types
|
|
5
|
+
* can be referenced by mobile/browser UI bundles without implying Node.js
|
|
6
|
+
* I/O.
|
|
7
|
+
*
|
|
8
|
+
* The runtime-side `ProviderDefinition` (which adds a callable
|
|
9
|
+
* `getEnableState()` reading env vars / fs / device-bridge sockets)
|
|
10
|
+
* extends `ProviderMeta` and lives in
|
|
11
|
+
* `@elizaos/app-core/src/services/local-inference/providers.ts` — it is
|
|
12
|
+
* the authoritative source for `/api/local-inference/providers`.
|
|
13
|
+
*
|
|
14
|
+
* UI consumers (`client-local-inference.ts`, `ios-local-agent-kernel.ts`)
|
|
15
|
+
* only see `ProviderStatus` (the response shape) and `ProviderMeta` /
|
|
16
|
+
* `ProviderEnableState` / `ProviderId` — never the runtime definition.
|
|
17
|
+
*/
|
|
18
|
+
import type { AgentModelSlot } from "./types.js";
|
|
19
|
+
export type ProviderId = "eliza-local-inference" | "eliza-device-bridge" | "capacitor-llama" | "anthropic-subscription" | "openai-codex" | "gemini-cli" | "zai-coding" | "kimi-coding" | "deepseek-coding" | "anthropic" | "openai" | "deepseek" | "nearai" | "zai" | "moonshot" | "grok" | "elizacloud" | "google" | "mistral";
|
|
20
|
+
export interface ProviderEnableState {
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
/** Short reason, e.g. "API key set", "Device connected", "No API key". */
|
|
23
|
+
reason: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Data-only provider descriptor. UI-safe — contains no runtime methods.
|
|
27
|
+
* The server-side `ProviderDefinition` (in `@elizaos/app-core`) extends
|
|
28
|
+
* this with a `getEnableState()` callable.
|
|
29
|
+
*/
|
|
30
|
+
export interface ProviderMeta {
|
|
31
|
+
id: ProviderId;
|
|
32
|
+
label: string;
|
|
33
|
+
kind: "cloud-api" | "cloud-subscription" | "local" | "device-bridge";
|
|
34
|
+
/** Short blurb shown in the UI. */
|
|
35
|
+
description: string;
|
|
36
|
+
/** Agent slots this provider can plausibly serve. */
|
|
37
|
+
supportedSlots: AgentModelSlot[];
|
|
38
|
+
/**
|
|
39
|
+
* Link to the settings UI where enable/configure actually happens.
|
|
40
|
+
* UI sends the user here via anchor-scroll when they click "Configure".
|
|
41
|
+
* `null` means the provider has no separate config surface.
|
|
42
|
+
*/
|
|
43
|
+
configureHref: string | null;
|
|
44
|
+
}
|
|
45
|
+
export interface ProviderStatus {
|
|
46
|
+
id: ProviderId;
|
|
47
|
+
label: string;
|
|
48
|
+
kind: ProviderMeta["kind"];
|
|
49
|
+
description: string;
|
|
50
|
+
supportedSlots: AgentModelSlot[];
|
|
51
|
+
configureHref: string | null;
|
|
52
|
+
enableState: ProviderEnableState;
|
|
53
|
+
/** Registered model types this provider has handlers for, right now. */
|
|
54
|
+
registeredSlots: string[];
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=providers-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers-types.d.ts","sourceRoot":"","sources":["../../src/local-inference/providers-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,UAAU,GAClB,uBAAuB,GACvB,qBAAqB,GACrB,iBAAiB,GACjB,wBAAwB,GACxB,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,KAAK,GACL,UAAU,GACV,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,GAAG,oBAAoB,GAAG,OAAO,GAAG,eAAe,CAAC;IACrE,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC;;;;OAIG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,mBAAmB,CAAC;IACjC,wEAAwE;IACxE,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-registry **data-only** contracts shared between the agent
|
|
3
|
+
* server and UI clients. Everything in this file must remain free of
|
|
4
|
+
* runtime-only capabilities (no methods, no callables) so the same types
|
|
5
|
+
* can be referenced by mobile/browser UI bundles without implying Node.js
|
|
6
|
+
* I/O.
|
|
7
|
+
*
|
|
8
|
+
* The runtime-side `ProviderDefinition` (which adds a callable
|
|
9
|
+
* `getEnableState()` reading env vars / fs / device-bridge sockets)
|
|
10
|
+
* extends `ProviderMeta` and lives in
|
|
11
|
+
* `@elizaos/app-core/src/services/local-inference/providers.ts` — it is
|
|
12
|
+
* the authoritative source for `/api/local-inference/providers`.
|
|
13
|
+
*
|
|
14
|
+
* UI consumers (`client-local-inference.ts`, `ios-local-agent-kernel.ts`)
|
|
15
|
+
* only see `ProviderStatus` (the response shape) and `ProviderMeta` /
|
|
16
|
+
* `ProviderEnableState` / `ProviderId` — never the runtime definition.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=providers-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers-types.js","sourceRoot":"","sources":["../../src/local-inference/providers-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-model-type user override: "for TEXT_LARGE, prefer this provider".
|
|
3
|
+
*
|
|
4
|
+
* Persisted to `$STATE_DIR/local-inference/routing.json` and read by the
|
|
5
|
+
* router-handler (see `router-handler.ts`) to pick a provider at dispatch
|
|
6
|
+
* time. When a slot has no override, the runtime's native priority order
|
|
7
|
+
* wins — i.e. this is layered over the existing registration priority
|
|
8
|
+
* rather than replacing it.
|
|
9
|
+
*/
|
|
10
|
+
import type { AgentModelSlot } from "./types.js";
|
|
11
|
+
export type RoutingPolicy = "manual" | "auto" | "cheapest" | "fastest" | "prefer-local" | "round-robin";
|
|
12
|
+
/**
|
|
13
|
+
* The full set of selectable policies, in display order. Kept as a runtime
|
|
14
|
+
* value (not just a type) so route-layer validation and the settings UI share
|
|
15
|
+
* one source of truth for "which policies are accepted".
|
|
16
|
+
*/
|
|
17
|
+
export declare const ROUTING_POLICIES: readonly RoutingPolicy[];
|
|
18
|
+
export declare function isRoutingPolicy(value: unknown): value is RoutingPolicy;
|
|
19
|
+
export declare const DEFAULT_ROUTING_POLICY: RoutingPolicy;
|
|
20
|
+
export interface RoutingPreferences {
|
|
21
|
+
/**
|
|
22
|
+
* Explicit provider override per agent slot. Empty record = no overrides,
|
|
23
|
+
* runtime picks the highest-priority registered handler.
|
|
24
|
+
*/
|
|
25
|
+
preferredProvider: Partial<Record<AgentModelSlot, string>>;
|
|
26
|
+
/**
|
|
27
|
+
* Per-slot policy. "manual" honours `preferredProvider` verbatim;
|
|
28
|
+
* everything else lets the router-handler compute a winner from the
|
|
29
|
+
* policy rule set. Absent = "prefer-local" so local models and
|
|
30
|
+
* subscriptions are tried before direct paid APIs and managed cloud.
|
|
31
|
+
*/
|
|
32
|
+
policy: Partial<Record<AgentModelSlot, RoutingPolicy>>;
|
|
33
|
+
}
|
|
34
|
+
export declare function readRoutingPreferences(): Promise<RoutingPreferences>;
|
|
35
|
+
export declare function writeRoutingPreferences(prefs: RoutingPreferences): Promise<void>;
|
|
36
|
+
export declare function setPreferredProvider(slot: AgentModelSlot, provider: string | null): Promise<RoutingPreferences>;
|
|
37
|
+
export declare function setPolicy(slot: AgentModelSlot, policy: RoutingPolicy | null): Promise<RoutingPreferences>;
|
|
38
|
+
//# sourceMappingURL=routing-preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-preferences.d.ts","sourceRoot":"","sources":["../../src/local-inference/routing-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,MAAM,GACN,UAAU,GACV,SAAS,GACT,cAAc,GACd,aAAa,CAAC;AAElB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAO3C,CAAC;AAEX,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAKtE;AAED,eAAO,MAAM,sBAAsB,EAAE,aAA8B,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;CACxD;AAiBD,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAY1E;AAED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAa7B;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,aAAa,GAAG,IAAI,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAa7B"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-model-type user override: "for TEXT_LARGE, prefer this provider".
|
|
3
|
+
*
|
|
4
|
+
* Persisted to `$STATE_DIR/local-inference/routing.json` and read by the
|
|
5
|
+
* router-handler (see `router-handler.ts`) to pick a provider at dispatch
|
|
6
|
+
* time. When a slot has no override, the runtime's native priority order
|
|
7
|
+
* wins — i.e. this is layered over the existing registration priority
|
|
8
|
+
* rather than replacing it.
|
|
9
|
+
*/
|
|
10
|
+
import fs from "node:fs/promises";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { localInferenceRoot } from "./paths.js";
|
|
13
|
+
/**
|
|
14
|
+
* The full set of selectable policies, in display order. Kept as a runtime
|
|
15
|
+
* value (not just a type) so route-layer validation and the settings UI share
|
|
16
|
+
* one source of truth for "which policies are accepted".
|
|
17
|
+
*/
|
|
18
|
+
export const ROUTING_POLICIES = [
|
|
19
|
+
"manual",
|
|
20
|
+
"auto",
|
|
21
|
+
"cheapest",
|
|
22
|
+
"fastest",
|
|
23
|
+
"prefer-local",
|
|
24
|
+
"round-robin",
|
|
25
|
+
];
|
|
26
|
+
export function isRoutingPolicy(value) {
|
|
27
|
+
return (typeof value === "string" &&
|
|
28
|
+
ROUTING_POLICIES.includes(value));
|
|
29
|
+
}
|
|
30
|
+
export const DEFAULT_ROUTING_POLICY = "prefer-local";
|
|
31
|
+
const EMPTY = { preferredProvider: {}, policy: {} };
|
|
32
|
+
function routingPath() {
|
|
33
|
+
return path.join(localInferenceRoot(), "routing.json");
|
|
34
|
+
}
|
|
35
|
+
async function ensureRoot() {
|
|
36
|
+
await fs.mkdir(localInferenceRoot(), { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
export async function readRoutingPreferences() {
|
|
39
|
+
try {
|
|
40
|
+
const raw = await fs.readFile(routingPath(), "utf8");
|
|
41
|
+
const parsed = JSON.parse(raw);
|
|
42
|
+
if (parsed?.version !== 1 || !parsed.preferences)
|
|
43
|
+
return EMPTY;
|
|
44
|
+
return {
|
|
45
|
+
preferredProvider: parsed.preferences.preferredProvider,
|
|
46
|
+
policy: parsed.preferences.policy,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return EMPTY;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export async function writeRoutingPreferences(prefs) {
|
|
54
|
+
await ensureRoot();
|
|
55
|
+
const payload = { version: 1, preferences: prefs };
|
|
56
|
+
const tmp = `${routingPath()}.tmp`;
|
|
57
|
+
await fs.writeFile(tmp, JSON.stringify(payload, null, 2), "utf8");
|
|
58
|
+
await fs.rename(tmp, routingPath());
|
|
59
|
+
}
|
|
60
|
+
export async function setPreferredProvider(slot, provider) {
|
|
61
|
+
const current = await readRoutingPreferences();
|
|
62
|
+
const next = {
|
|
63
|
+
preferredProvider: { ...current.preferredProvider },
|
|
64
|
+
policy: { ...current.policy },
|
|
65
|
+
};
|
|
66
|
+
if (provider) {
|
|
67
|
+
next.preferredProvider[slot] = provider;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
delete next.preferredProvider[slot];
|
|
71
|
+
}
|
|
72
|
+
await writeRoutingPreferences(next);
|
|
73
|
+
return next;
|
|
74
|
+
}
|
|
75
|
+
export async function setPolicy(slot, policy) {
|
|
76
|
+
const current = await readRoutingPreferences();
|
|
77
|
+
const next = {
|
|
78
|
+
preferredProvider: { ...current.preferredProvider },
|
|
79
|
+
policy: { ...current.policy },
|
|
80
|
+
};
|
|
81
|
+
if (policy) {
|
|
82
|
+
next.policy[slot] = policy;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
delete next.policy[slot];
|
|
86
|
+
}
|
|
87
|
+
await writeRoutingPreferences(next);
|
|
88
|
+
return next;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=routing-preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-preferences.js","sourceRoot":"","sources":["../../src/local-inference/routing-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAWhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,QAAQ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,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-generation throughput differencing for the on-device inference path.
|
|
3
|
+
*
|
|
4
|
+
* The device bridge carries the raw counters for every on-device generation
|
|
5
|
+
* (`promptTokens`, `outputTokens`, `durationMs`, and — when the device measured
|
|
6
|
+
* it — `ttftMs`, the time to the first decoded token). This module turns those
|
|
7
|
+
* counters into the two throughput numbers a profiling harness actually wants:
|
|
8
|
+
*
|
|
9
|
+
* - **prefill tokens/sec** — prompt-processing throughput. The model reads the
|
|
10
|
+
* whole prompt before emitting the first token, so `ttftMs` *is* the prefill
|
|
11
|
+
* wall-clock; prefill tok/s = `promptTokens / (ttftMs / 1000)`.
|
|
12
|
+
* - **decode tokens/sec** — generation throughput. The decode phase runs from
|
|
13
|
+
* the first token to completion, so decode tok/s =
|
|
14
|
+
* `outputTokens / ((durationMs - ttftMs) / 1000)`.
|
|
15
|
+
*
|
|
16
|
+
* When the device could not measure `ttftMs` (the non-streaming Capacitor llama
|
|
17
|
+
* path before per-token timing lands), prefill and decode cannot be separated —
|
|
18
|
+
* those fields are reported as `null` and only the combined throughput
|
|
19
|
+
* (`outputTokens / durationMs`) is filled. Per the repo architecture rules
|
|
20
|
+
* (AGENTS.md §3/§7) a quantity that could not be measured is recorded as `null`,
|
|
21
|
+
* never as a fabricated `0`.
|
|
22
|
+
*
|
|
23
|
+
* Shared between the agent-side device bridge
|
|
24
|
+
* (`@elizaos/plugin-local-inference/services/device-bridge`) and the UI client
|
|
25
|
+
* (`@elizaos/ui/services/local-inference/device-bridge`) — both hand-synced
|
|
26
|
+
* copies import this single source rather than re-implementing the math.
|
|
27
|
+
*/
|
|
28
|
+
/** Raw per-generation counters as carried by the device-bridge wire. */
|
|
29
|
+
export interface GenerationCounters {
|
|
30
|
+
/** Prompt tokens the device processed during prefill. */
|
|
31
|
+
promptTokens: number;
|
|
32
|
+
/** Tokens the device decoded (generated). */
|
|
33
|
+
outputTokens: number;
|
|
34
|
+
/** Total wall-clock for the generation, in milliseconds. */
|
|
35
|
+
durationMs: number;
|
|
36
|
+
/**
|
|
37
|
+
* Time to first decoded token, in milliseconds, when the device measured it.
|
|
38
|
+
* Equals the prefill wall-clock. Absent on the non-streaming path.
|
|
39
|
+
*/
|
|
40
|
+
ttftMs?: number | null;
|
|
41
|
+
}
|
|
42
|
+
/** Differenced throughput for a single on-device generation. */
|
|
43
|
+
export interface GenerationThroughput {
|
|
44
|
+
/** Prefill (prompt-processing) throughput, tok/s, or null when unmeasurable. */
|
|
45
|
+
prefillTokensPerSecond: number | null;
|
|
46
|
+
/** Decode (generation) throughput, tok/s, or null when unmeasurable. */
|
|
47
|
+
decodeTokensPerSecond: number | null;
|
|
48
|
+
/**
|
|
49
|
+
* Whole-generation throughput, tok/s = outputTokens / durationMs. Always
|
|
50
|
+
* filled when at least one token was decoded in a positive duration, even
|
|
51
|
+
* when `ttftMs` is missing — this is the fallback signal for the
|
|
52
|
+
* non-streaming path.
|
|
53
|
+
*/
|
|
54
|
+
combinedTokensPerSecond: number | null;
|
|
55
|
+
/** Echoed TTFT, ms, or null when the device did not measure it. */
|
|
56
|
+
ttftMs: number | null;
|
|
57
|
+
/** Derived decode wall-clock (durationMs − ttftMs), ms, or null. */
|
|
58
|
+
decodeMs: number | null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Difference raw generation counters into prefill / decode / combined tok/s.
|
|
62
|
+
*
|
|
63
|
+
* Pure and synchronous. Every output field is `null` unless the inputs make it
|
|
64
|
+
* genuinely computable — never a fabricated zero.
|
|
65
|
+
*/
|
|
66
|
+
export declare function computeGenerationThroughput(counters: GenerationCounters): GenerationThroughput;
|
|
67
|
+
/**
|
|
68
|
+
* Validate the raw counter shape before differencing. The wire is hand-synced
|
|
69
|
+
* between the agent and the device client, so a malformed frame should be
|
|
70
|
+
* rejected at the boundary (and the metric dropped) rather than silently
|
|
71
|
+
* producing garbage throughput.
|
|
72
|
+
*/
|
|
73
|
+
export declare function isGenerationCounters(value: unknown): value is GenerationCounters;
|
|
74
|
+
//# sourceMappingURL=throughput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throughput.d.ts","sourceRoot":"","sources":["../../src/local-inference/throughput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,gFAAgF;IAChF,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,wEAAwE;IACxE,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;;;OAKG;IACH,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,mEAAmE;IACnE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAYD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,CAmCtB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,kBAAkB,CAS7B"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-generation throughput differencing for the on-device inference path.
|
|
3
|
+
*
|
|
4
|
+
* The device bridge carries the raw counters for every on-device generation
|
|
5
|
+
* (`promptTokens`, `outputTokens`, `durationMs`, and — when the device measured
|
|
6
|
+
* it — `ttftMs`, the time to the first decoded token). This module turns those
|
|
7
|
+
* counters into the two throughput numbers a profiling harness actually wants:
|
|
8
|
+
*
|
|
9
|
+
* - **prefill tokens/sec** — prompt-processing throughput. The model reads the
|
|
10
|
+
* whole prompt before emitting the first token, so `ttftMs` *is* the prefill
|
|
11
|
+
* wall-clock; prefill tok/s = `promptTokens / (ttftMs / 1000)`.
|
|
12
|
+
* - **decode tokens/sec** — generation throughput. The decode phase runs from
|
|
13
|
+
* the first token to completion, so decode tok/s =
|
|
14
|
+
* `outputTokens / ((durationMs - ttftMs) / 1000)`.
|
|
15
|
+
*
|
|
16
|
+
* When the device could not measure `ttftMs` (the non-streaming Capacitor llama
|
|
17
|
+
* path before per-token timing lands), prefill and decode cannot be separated —
|
|
18
|
+
* those fields are reported as `null` and only the combined throughput
|
|
19
|
+
* (`outputTokens / durationMs`) is filled. Per the repo architecture rules
|
|
20
|
+
* (AGENTS.md §3/§7) a quantity that could not be measured is recorded as `null`,
|
|
21
|
+
* never as a fabricated `0`.
|
|
22
|
+
*
|
|
23
|
+
* Shared between the agent-side device bridge
|
|
24
|
+
* (`@elizaos/plugin-local-inference/services/device-bridge`) and the UI client
|
|
25
|
+
* (`@elizaos/ui/services/local-inference/device-bridge`) — both hand-synced
|
|
26
|
+
* copies import this single source rather than re-implementing the math.
|
|
27
|
+
*/
|
|
28
|
+
const MS_PER_SECOND = 1000;
|
|
29
|
+
function isPositive(value) {
|
|
30
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
|
31
|
+
}
|
|
32
|
+
function isNonNegativeCount(value) {
|
|
33
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Difference raw generation counters into prefill / decode / combined tok/s.
|
|
37
|
+
*
|
|
38
|
+
* Pure and synchronous. Every output field is `null` unless the inputs make it
|
|
39
|
+
* genuinely computable — never a fabricated zero.
|
|
40
|
+
*/
|
|
41
|
+
export function computeGenerationThroughput(counters) {
|
|
42
|
+
const { promptTokens, outputTokens, durationMs } = counters;
|
|
43
|
+
const ttftMs = isPositive(counters.ttftMs) && counters.ttftMs < durationMs
|
|
44
|
+
? counters.ttftMs
|
|
45
|
+
: null;
|
|
46
|
+
// Combined throughput needs a positive duration and ≥1 decoded token. Zero
|
|
47
|
+
// decoded tokens means there was no decode to measure — report null, not 0.
|
|
48
|
+
const combinedTokensPerSecond = isPositive(durationMs) && isPositive(outputTokens)
|
|
49
|
+
? outputTokens / (durationMs / MS_PER_SECOND)
|
|
50
|
+
: null;
|
|
51
|
+
// Prefill throughput needs a measured TTFT and ≥1 prompt token.
|
|
52
|
+
const prefillTokensPerSecond = ttftMs !== null && isPositive(promptTokens)
|
|
53
|
+
? promptTokens / (ttftMs / MS_PER_SECOND)
|
|
54
|
+
: null;
|
|
55
|
+
// Decode throughput needs a measured TTFT (so we can subtract prefill) and a
|
|
56
|
+
// positive remaining window with ≥1 decoded token.
|
|
57
|
+
const decodeMs = ttftMs !== null ? durationMs - ttftMs : null;
|
|
58
|
+
const decodeTokensPerSecond = decodeMs !== null && isPositive(decodeMs) && isPositive(outputTokens)
|
|
59
|
+
? outputTokens / (decodeMs / MS_PER_SECOND)
|
|
60
|
+
: null;
|
|
61
|
+
return {
|
|
62
|
+
prefillTokensPerSecond,
|
|
63
|
+
decodeTokensPerSecond,
|
|
64
|
+
combinedTokensPerSecond,
|
|
65
|
+
ttftMs,
|
|
66
|
+
decodeMs: decodeMs !== null && isPositive(decodeMs) ? decodeMs : null,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Validate the raw counter shape before differencing. The wire is hand-synced
|
|
71
|
+
* between the agent and the device client, so a malformed frame should be
|
|
72
|
+
* rejected at the boundary (and the metric dropped) rather than silently
|
|
73
|
+
* producing garbage throughput.
|
|
74
|
+
*/
|
|
75
|
+
export function isGenerationCounters(value) {
|
|
76
|
+
if (!value || typeof value !== "object")
|
|
77
|
+
return false;
|
|
78
|
+
const v = value;
|
|
79
|
+
return (isNonNegativeCount(v.promptTokens) &&
|
|
80
|
+
isNonNegativeCount(v.outputTokens) &&
|
|
81
|
+
isNonNegativeCount(v.durationMs) &&
|
|
82
|
+
(v.ttftMs == null || isNonNegativeCount(v.ttftMs)));
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=throughput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throughput.js","sourceRoot":"","sources":["../../src/local-inference/throughput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAoCH,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B,SAAS,UAAU,CAAC,KAAgC;IAClD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAgC;IAC1D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAA4B;IAE5B,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;IAC5D,MAAM,MAAM,GACV,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,UAAU;QACzD,CAAC,CAAC,QAAQ,CAAC,MAAM;QACjB,CAAC,CAAC,IAAI,CAAC;IAEX,2EAA2E;IAC3E,4EAA4E;IAC5E,MAAM,uBAAuB,GAC3B,UAAU,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,YAAY,CAAC;QAChD,CA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