@elizaos/shared 2.0.0-alpha.538 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/chat-contracts.d.ts +2 -0
- package/dist/api/chat-contracts.d.ts.map +1 -0
- package/dist/api/chat-contracts.js +2 -0
- package/dist/api/chat-contracts.js.map +1 -0
- package/dist/api/http-helpers.d.ts +50 -0
- package/dist/api/http-helpers.d.ts.map +1 -0
- package/dist/api/http-helpers.js +168 -0
- package/dist/api/http-helpers.js.map +1 -0
- package/dist/api/route-helpers.d.ts +16 -0
- package/dist/api/route-helpers.d.ts.map +1 -0
- package/dist/api/route-helpers.js +2 -0
- package/dist/api/route-helpers.js.map +1 -0
- package/dist/cli/parse-duration.d.ts +5 -0
- package/dist/cli/parse-duration.d.ts.map +1 -0
- package/dist/cli/parse-duration.js +28 -0
- package/dist/cli/parse-duration.js.map +1 -0
- package/dist/config/allowed-hosts.d.ts +8 -0
- package/dist/config/allowed-hosts.d.ts.map +1 -0
- package/dist/config/allowed-hosts.js +44 -0
- package/dist/config/allowed-hosts.js.map +1 -0
- package/dist/config/api-key-prefix-hints.d.ts +25 -0
- package/dist/config/api-key-prefix-hints.d.ts.map +1 -0
- package/dist/config/api-key-prefix-hints.js +27 -0
- package/dist/config/api-key-prefix-hints.js.map +1 -0
- package/dist/config/app-config.d.ts +273 -0
- package/dist/config/app-config.d.ts.map +1 -0
- package/dist/config/app-config.js +32 -0
- package/dist/config/app-config.js.map +1 -0
- package/dist/config/app-manifest.d.ts +75 -0
- package/dist/config/app-manifest.d.ts.map +1 -0
- package/dist/config/app-manifest.js +109 -0
- package/dist/config/app-manifest.js.map +1 -0
- package/dist/config/boot-config-react.d.ts +5 -0
- package/dist/config/boot-config-react.d.ts.map +1 -0
- package/dist/config/boot-config-react.js +8 -0
- package/dist/config/boot-config-react.js.map +1 -0
- package/dist/config/boot-config-store.d.ts +74 -0
- package/dist/config/boot-config-store.d.ts.map +1 -0
- package/dist/config/boot-config-store.js +121 -0
- package/dist/config/boot-config-store.js.map +1 -0
- package/dist/config/boot-config.d.ts +6 -0
- package/dist/config/boot-config.d.ts.map +1 -0
- package/dist/config/boot-config.js +6 -0
- package/dist/config/boot-config.js.map +1 -0
- package/dist/config/branding-react.d.ts +4 -0
- package/dist/config/branding-react.d.ts.map +1 -0
- package/dist/config/branding-react.js +12 -0
- package/dist/config/branding-react.js.map +1 -0
- package/dist/config/branding.d.ts +53 -0
- package/dist/config/branding.d.ts.map +1 -0
- package/dist/config/branding.js +23 -0
- package/dist/config/branding.js.map +1 -0
- package/dist/config/cloud-only.d.ts +6 -0
- package/dist/config/cloud-only.d.ts.map +1 -0
- package/dist/config/cloud-only.js +16 -0
- package/dist/config/cloud-only.js.map +1 -0
- package/dist/config/config-catalog.d.ts +371 -0
- package/dist/config/config-catalog.d.ts.map +1 -0
- package/dist/config/config-catalog.js +710 -0
- package/dist/config/config-catalog.js.map +1 -0
- package/dist/config/config-paths.d.ts +11 -0
- package/dist/config/config-paths.d.ts.map +1 -0
- package/dist/config/config-paths.js +74 -0
- package/dist/config/config-paths.js.map +1 -0
- package/dist/config/config.d.ts +11 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +23 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/distribution-profile.d.ts +16 -0
- package/dist/config/distribution-profile.d.ts.map +1 -0
- package/dist/config/distribution-profile.js +29 -0
- package/dist/config/distribution-profile.js.map +1 -0
- package/dist/config/env-vars.d.ts +2 -0
- package/dist/config/env-vars.d.ts.map +1 -0
- package/dist/config/env-vars.js +2 -0
- package/dist/config/env-vars.js.map +1 -0
- package/dist/config/index.d.ts +14 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +17 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/plugin-auto-enable-engine.d.ts +4 -0
- package/dist/config/plugin-auto-enable-engine.d.ts.map +1 -0
- package/dist/config/plugin-auto-enable-engine.js +45 -0
- package/dist/config/plugin-auto-enable-engine.js.map +1 -0
- package/dist/config/plugin-auto-enable.d.ts +2 -0
- package/dist/config/plugin-auto-enable.d.ts.map +1 -0
- package/dist/config/plugin-auto-enable.js +8 -0
- package/dist/config/plugin-auto-enable.js.map +1 -0
- package/dist/config/plugin-manifest.d.ts +89 -0
- package/dist/config/plugin-manifest.d.ts.map +1 -0
- package/dist/config/plugin-manifest.js +272 -0
- package/dist/config/plugin-manifest.js.map +1 -0
- package/dist/config/plugin-ui-spec.d.ts +42 -0
- package/dist/config/plugin-ui-spec.d.ts.map +1 -0
- package/dist/config/plugin-ui-spec.js +257 -0
- package/dist/config/plugin-ui-spec.js.map +1 -0
- package/dist/config/runtime-mode.d.ts +54 -0
- package/dist/config/runtime-mode.d.ts.map +1 -0
- package/dist/config/runtime-mode.js +103 -0
- package/dist/config/runtime-mode.js.map +1 -0
- package/dist/config/runtime-overrides.d.ts +16 -0
- package/dist/config/runtime-overrides.d.ts.map +1 -0
- package/dist/config/runtime-overrides.js +49 -0
- package/dist/config/runtime-overrides.js.map +1 -0
- package/dist/config/schema.d.ts +7 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +30 -0
- package/dist/config/schema.js.map +1 -0
- package/{config → dist/config}/types.eliza.d.ts +16 -38
- package/dist/config/types.eliza.d.ts.map +1 -0
- package/{config → dist/config}/types.messages.d.ts +1 -1
- package/{config → dist/config}/types.tools.d.ts +1 -1
- package/dist/config/ui-spec.d.ts +164 -0
- package/dist/config/ui-spec.d.ts.map +1 -0
- package/dist/config/ui-spec.js +14 -0
- package/dist/config/ui-spec.js.map +1 -0
- package/dist/config/wechat-config.d.ts +2 -0
- package/dist/config/wechat-config.d.ts.map +1 -0
- package/dist/config/wechat-config.js +2 -0
- package/dist/config/wechat-config.js.map +1 -0
- package/dist/config/zod-schema.agent-runtime.d.ts +1087 -0
- package/dist/config/zod-schema.agent-runtime.d.ts.map +1 -0
- package/dist/config/zod-schema.agent-runtime.js +764 -0
- package/dist/config/zod-schema.agent-runtime.js.map +1 -0
- package/dist/config/zod-schema.core.d.ts +1048 -0
- package/dist/config/zod-schema.core.d.ts.map +1 -0
- package/dist/config/zod-schema.core.js +707 -0
- package/dist/config/zod-schema.core.js.map +1 -0
- package/{connector-cred-types.d.ts → dist/connector-cred-types.d.ts} +3 -3
- package/{connector-cred-types.js → dist/connector-cred-types.js} +4 -4
- package/dist/connectors.d.ts +2 -0
- package/dist/connectors.d.ts.map +1 -0
- package/dist/connectors.js +2 -0
- package/dist/connectors.js.map +1 -0
- package/{contracts → dist/contracts}/apps.d.ts +8 -1
- package/dist/contracts/apps.d.ts.map +1 -0
- package/{contracts → dist/contracts}/apps.js +9 -10
- package/dist/contracts/apps.js.map +1 -0
- package/{contracts → dist/contracts}/awareness.d.ts +1 -1
- package/{contracts → dist/contracts}/config.d.ts +52 -4
- package/dist/contracts/config.d.ts.map +1 -0
- package/dist/contracts/feature-result.d.ts +24 -0
- package/dist/contracts/feature-result.d.ts.map +1 -0
- package/dist/contracts/feature-result.js +7 -0
- package/dist/contracts/feature-result.js.map +1 -0
- package/dist/contracts/health.d.ts +30 -0
- package/dist/contracts/health.d.ts.map +1 -0
- package/dist/contracts/health.js +29 -0
- package/dist/contracts/health.js.map +1 -0
- package/{contracts → dist/contracts}/index.d.ts +2 -1
- package/{contracts → dist/contracts}/index.d.ts.map +1 -1
- package/{contracts → dist/contracts}/index.js +2 -1
- package/dist/contracts/index.js.map +1 -0
- package/{contracts → dist/contracts}/lifeops.d.ts +410 -3
- package/dist/contracts/lifeops.d.ts.map +1 -0
- package/{contracts → dist/contracts}/lifeops.js +35 -5
- package/dist/contracts/lifeops.js.map +1 -0
- package/{contracts → dist/contracts}/onboarding.d.ts +85 -6
- package/dist/contracts/onboarding.d.ts.map +1 -0
- package/{contracts → dist/contracts}/onboarding.js +99 -13
- package/{contracts → dist/contracts}/onboarding.js.map +1 -1
- package/dist/contracts/permissions.d.ts +121 -0
- package/dist/contracts/permissions.d.ts.map +1 -0
- package/dist/contracts/permissions.js +31 -0
- package/dist/contracts/permissions.js.map +1 -0
- package/{contracts → dist/contracts}/service-routing.d.ts +3 -11
- package/dist/contracts/service-routing.d.ts.map +1 -0
- package/{contracts → dist/contracts}/service-routing.js +10 -11
- package/dist/contracts/service-routing.js.map +1 -0
- package/{contracts → dist/contracts}/wallet.d.ts +7 -0
- package/dist/contracts/wallet.d.ts.map +1 -0
- package/dist/contracts/wallet.js +194 -0
- package/dist/contracts/wallet.js.map +1 -0
- package/{env-utils.impl.d.ts → dist/env-utils.d.ts} +1 -1
- package/dist/env-utils.d.ts.map +1 -0
- package/{env-utils.impl.js → dist/env-utils.js} +4 -1
- package/dist/env-utils.js.map +1 -0
- package/dist/events/index.d.ts +62 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +52 -0
- package/dist/events/index.js.map +1 -0
- package/dist/i18n/generated/validation-keyword-data.d.ts +3080 -0
- package/dist/i18n/generated/validation-keyword-data.d.ts.map +1 -0
- package/dist/i18n/generated/validation-keyword-data.js +3084 -0
- package/dist/i18n/generated/validation-keyword-data.js.map +1 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/local-inference/index.d.ts +16 -0
- package/dist/local-inference/index.d.ts.map +1 -0
- package/dist/local-inference/index.js +16 -0
- package/dist/local-inference/index.js.map +1 -0
- package/dist/local-inference/paths.d.ts +24 -0
- package/dist/local-inference/paths.d.ts.map +1 -0
- package/dist/local-inference/paths.js +40 -0
- package/dist/local-inference/paths.js.map +1 -0
- package/dist/local-inference/routing-preferences.d.ts +31 -0
- package/dist/local-inference/routing-preferences.d.ts.map +1 -0
- package/dist/local-inference/routing-preferences.js +73 -0
- package/dist/local-inference/routing-preferences.js.map +1 -0
- package/dist/local-inference/types.d.ts +62 -0
- package/dist/local-inference/types.d.ts.map +1 -0
- package/dist/local-inference/types.js +25 -0
- package/dist/local-inference/types.js.map +1 -0
- package/dist/local-inference/verify.d.ts +39 -0
- package/dist/local-inference/verify.d.ts.map +1 -0
- package/dist/local-inference/verify.js +105 -0
- package/dist/local-inference/verify.js.map +1 -0
- package/dist/package.json +50 -0
- package/dist/platform/is-native-server.d.ts +9 -0
- package/dist/platform/is-native-server.d.ts.map +1 -0
- package/dist/platform/is-native-server.js +12 -0
- package/dist/platform/is-native-server.js.map +1 -0
- package/{runtime-env.js → dist/runtime-env.js} +2 -2
- package/{runtime-env.js.map → dist/runtime-env.js.map} +1 -1
- package/{self-edit.js → dist/self-edit.js} +1 -1
- package/{self-edit.js.map → dist/self-edit.js.map} +1 -1
- package/{settings-debug.d.ts.map → dist/settings-debug.d.ts.map} +1 -1
- package/{settings-debug.js → dist/settings-debug.js} +45 -38
- package/dist/settings-debug.js.map +1 -0
- package/{spoken-text.js → dist/spoken-text.js} +1 -1
- package/{spoken-text.js.map → dist/spoken-text.js.map} +1 -1
- package/dist/terminal/links.d.ts +9 -0
- package/dist/terminal/links.d.ts.map +1 -0
- package/dist/terminal/links.js +21 -0
- package/dist/terminal/links.js.map +1 -0
- package/dist/terminal/palette.d.ts +11 -0
- package/dist/terminal/palette.d.ts.map +1 -0
- package/dist/terminal/palette.js +13 -0
- package/dist/terminal/palette.js.map +1 -0
- package/dist/terminal/theme.d.ts +17 -0
- package/dist/terminal/theme.d.ts.map +1 -0
- package/dist/terminal/theme.js +25 -0
- package/dist/terminal/theme.js.map +1 -0
- package/dist/test-support/process-helpers.d.ts +13 -0
- package/dist/test-support/process-helpers.d.ts.map +1 -0
- package/dist/test-support/process-helpers.js +24 -0
- package/dist/test-support/process-helpers.js.map +1 -0
- package/dist/test-support/test-helpers.d.ts +112 -0
- package/dist/test-support/test-helpers.d.ts.map +1 -0
- package/dist/test-support/test-helpers.js +416 -0
- package/dist/test-support/test-helpers.js.map +1 -0
- package/{type-guards.d.ts → dist/type-guards.d.ts} +1 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/{type-guards.js → dist/type-guards.js} +6 -0
- package/dist/type-guards.js.map +1 -0
- package/dist/types/index.d.ts +655 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/asset-url.d.ts +24 -0
- package/dist/utils/asset-url.d.ts.map +1 -0
- package/dist/utils/asset-url.js +151 -0
- package/dist/utils/asset-url.js.map +1 -0
- package/dist/utils/assistant-text.d.ts +2 -0
- package/dist/utils/assistant-text.d.ts.map +1 -0
- package/dist/utils/assistant-text.js +168 -0
- package/dist/utils/assistant-text.js.map +1 -0
- package/dist/utils/browser-tab-kit-types.d.ts +81 -0
- package/dist/utils/browser-tab-kit-types.d.ts.map +1 -0
- package/dist/utils/browser-tab-kit-types.js +23 -0
- package/dist/utils/browser-tab-kit-types.js.map +1 -0
- package/dist/utils/browser-tabs-renderer-registry.d.ts +56 -0
- package/dist/utils/browser-tabs-renderer-registry.d.ts.map +1 -0
- package/dist/utils/browser-tabs-renderer-registry.js +962 -0
- package/{i18n/generated/validation-keyword-data.d.ts.map → dist/utils/browser-tabs-renderer-registry.js.map} +1 -1
- package/dist/utils/character-message-examples.d.ts +7 -0
- package/dist/utils/character-message-examples.d.ts.map +1 -0
- package/dist/utils/character-message-examples.js +123 -0
- package/dist/utils/character-message-examples.js.map +1 -0
- package/dist/utils/cloud-status.d.ts +3 -0
- package/dist/utils/cloud-status.d.ts.map +1 -0
- package/dist/utils/cloud-status.js +11 -0
- package/dist/utils/cloud-status.js.map +1 -0
- package/dist/utils/documents-upload-image.d.ts +27 -0
- package/dist/utils/documents-upload-image.d.ts.map +1 -0
- package/dist/utils/documents-upload-image.js +147 -0
- package/dist/utils/documents-upload-image.js.map +1 -0
- package/dist/utils/eliza-cloud-model-route.d.ts +3 -0
- package/dist/utils/eliza-cloud-model-route.d.ts.map +1 -0
- package/dist/utils/eliza-cloud-model-route.js +10 -0
- package/dist/utils/eliza-cloud-model-route.js.map +1 -0
- package/dist/utils/eliza-globals.d.ts +13 -0
- package/dist/utils/eliza-globals.d.ts.map +1 -0
- package/dist/utils/eliza-globals.js +49 -0
- package/dist/utils/eliza-globals.js.map +1 -0
- package/dist/utils/eliza-root.d.ts +9 -0
- package/dist/utils/eliza-root.d.ts.map +1 -0
- package/dist/utils/eliza-root.js +102 -0
- package/dist/utils/eliza-root.js.map +1 -0
- package/dist/utils/env.d.ts +34 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +131 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/errors.d.ts +13 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +26 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/exec-safety.d.ts +2 -0
- package/dist/utils/exec-safety.d.ts.map +1 -0
- package/dist/utils/exec-safety.js +22 -0
- package/dist/utils/exec-safety.js.map +1 -0
- package/dist/utils/format.d.ts +66 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +122 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/labels.d.ts +6 -0
- package/dist/utils/labels.d.ts.map +1 -0
- package/dist/utils/labels.js +42 -0
- package/dist/utils/labels.js.map +1 -0
- package/dist/utils/log-prefix.d.ts +2 -0
- package/dist/utils/log-prefix.d.ts.map +1 -0
- package/dist/utils/log-prefix.js +54 -0
- package/dist/utils/log-prefix.js.map +1 -0
- package/dist/utils/name-tokens.d.ts +24 -0
- package/dist/utils/name-tokens.d.ts.map +1 -0
- package/dist/utils/name-tokens.js +37 -0
- package/dist/utils/name-tokens.js.map +1 -0
- package/dist/utils/namespace-defaults.d.ts +6 -0
- package/dist/utils/namespace-defaults.d.ts.map +1 -0
- package/dist/utils/namespace-defaults.js +16 -0
- package/dist/utils/namespace-defaults.js.map +1 -0
- package/dist/utils/number-parsing.d.ts +26 -0
- package/dist/utils/number-parsing.d.ts.map +1 -0
- package/dist/utils/number-parsing.js +52 -0
- package/dist/utils/number-parsing.js.map +1 -0
- package/dist/utils/owner-name.d.ts +3 -0
- package/dist/utils/owner-name.d.ts.map +1 -0
- package/dist/utils/owner-name.js +8 -0
- package/dist/utils/owner-name.js.map +1 -0
- package/dist/utils/permission-deep-links.d.ts +34 -0
- package/dist/utils/permission-deep-links.d.ts.map +1 -0
- package/dist/utils/permission-deep-links.js +84 -0
- package/dist/utils/permission-deep-links.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +32 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +53 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/serialise.d.ts +12 -0
- package/dist/utils/serialise.d.ts.map +1 -0
- package/dist/utils/serialise.js +22 -0
- package/dist/utils/serialise.js.map +1 -0
- package/dist/utils/sql-compat.d.ts +10 -0
- package/dist/utils/sql-compat.d.ts.map +1 -0
- package/dist/utils/sql-compat.js +112 -0
- package/dist/utils/sql-compat.js.map +1 -0
- package/dist/utils/streaming-text.d.ts +9 -0
- package/dist/utils/streaming-text.d.ts.map +1 -0
- package/dist/utils/streaming-text.js +113 -0
- package/dist/utils/streaming-text.js.map +1 -0
- package/dist/utils/subscription-auth.d.ts +9 -0
- package/dist/utils/subscription-auth.d.ts.map +1 -0
- package/dist/utils/subscription-auth.js +49 -0
- package/dist/utils/subscription-auth.js.map +1 -0
- package/dist/utils/trajectory-format.d.ts +6 -0
- package/dist/utils/trajectory-format.d.ts.map +1 -0
- package/dist/utils/trajectory-format.js +44 -0
- package/dist/utils/trajectory-format.js.map +1 -0
- package/dist/utils/tts-debug.d.ts +9 -0
- package/dist/utils/tts-debug.d.ts.map +1 -0
- package/dist/utils/tts-debug.js +70 -0
- package/dist/utils/tts-debug.js.map +1 -0
- package/dist/voice.d.ts +40 -0
- package/dist/voice.d.ts.map +1 -0
- package/dist/voice.js +296 -0
- package/dist/voice.js.map +1 -0
- package/package.json +33 -179
- package/config/types.eliza.d.ts.map +0 -1
- package/connectors.d.ts +0 -13
- package/connectors.d.ts.map +0 -1
- package/connectors.js +0 -97
- package/connectors.js.map +0 -1
- package/contracts/apps.d.ts.map +0 -1
- package/contracts/apps.js.map +0 -1
- package/contracts/config.d.ts.map +0 -1
- package/contracts/index.js.map +0 -1
- 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/permissions.d.ts +0 -39
- package/contracts/permissions.d.ts.map +0 -1
- package/contracts/permissions.js +0 -5
- package/contracts/permissions.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/contracts/service-routing.d.ts.map +0 -1
- package/contracts/service-routing.js.map +0 -1
- package/contracts/wallet.d.ts.map +0 -1
- package/contracts/wallet.js +0 -61
- package/contracts/wallet.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.d.ts +0 -5
- package/env-utils.d.ts.map +0 -1
- package/env-utils.impl.d.ts.map +0 -1
- package/env-utils.impl.js.map +0 -1
- package/env-utils.js +0 -5
- package/env-utils.js.map +0 -1
- package/i18n/generated/validation-keyword-data.d.ts +0 -1091
- package/i18n/generated/validation-keyword-data.js +0 -1095
- package/i18n/generated/validation-keyword-data.js.map +0 -1
- package/index.d.ts +0 -28
- package/index.d.ts.map +0 -1
- package/index.js +0 -40
- package/index.js.map +0 -1
- package/settings-debug.js.map +0 -1
- package/type-guards.d.ts.map +0 -1
- package/type-guards.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
- /package/{app-hero-art.d.ts → dist/app-hero-art.d.ts} +0 -0
- /package/{app-hero-art.d.ts.map → dist/app-hero-art.d.ts.map} +0 -0
- /package/{app-hero-art.js → dist/app-hero-art.js} +0 -0
- /package/{app-hero-art.js.map → dist/app-hero-art.js.map} +0 -0
- /package/{awareness → dist/awareness}/index.d.ts +0 -0
- /package/{awareness → dist/awareness}/index.d.ts.map +0 -0
- /package/{awareness → dist/awareness}/index.js +0 -0
- /package/{awareness → dist/awareness}/index.js.map +0 -0
- /package/{awareness → dist/awareness}/registry.d.ts +0 -0
- /package/{awareness → dist/awareness}/registry.d.ts.map +0 -0
- /package/{awareness → dist/awareness}/registry.js +0 -0
- /package/{awareness → dist/awareness}/registry.js.map +0 -0
- /package/{config → dist/config}/types.agent-defaults.d.ts +0 -0
- /package/{config → dist/config}/types.agent-defaults.d.ts.map +0 -0
- /package/{config → dist/config}/types.agent-defaults.js +0 -0
- /package/{config → dist/config}/types.agent-defaults.js.map +0 -0
- /package/{config → dist/config}/types.agents.d.ts +0 -0
- /package/{config → dist/config}/types.agents.d.ts.map +0 -0
- /package/{config → dist/config}/types.agents.js +0 -0
- /package/{config → dist/config}/types.agents.js.map +0 -0
- /package/{config → dist/config}/types.d.ts +0 -0
- /package/{config → dist/config}/types.d.ts.map +0 -0
- /package/{config → dist/config}/types.eliza.js +0 -0
- /package/{config → dist/config}/types.eliza.js.map +0 -0
- /package/{config → dist/config}/types.gateway.d.ts +0 -0
- /package/{config → dist/config}/types.gateway.d.ts.map +0 -0
- /package/{config → dist/config}/types.gateway.js +0 -0
- /package/{config → dist/config}/types.gateway.js.map +0 -0
- /package/{config → dist/config}/types.hooks.d.ts +0 -0
- /package/{config → dist/config}/types.hooks.d.ts.map +0 -0
- /package/{config → dist/config}/types.hooks.js +0 -0
- /package/{config → dist/config}/types.hooks.js.map +0 -0
- /package/{config → dist/config}/types.js +0 -0
- /package/{config → dist/config}/types.js.map +0 -0
- /package/{config → dist/config}/types.messages.d.ts.map +0 -0
- /package/{config → dist/config}/types.messages.js +0 -0
- /package/{config → dist/config}/types.messages.js.map +0 -0
- /package/{config → dist/config}/types.tools.d.ts.map +0 -0
- /package/{config → dist/config}/types.tools.js +0 -0
- /package/{config → dist/config}/types.tools.js.map +0 -0
- /package/{connector-cred-types.d.ts.map → dist/connector-cred-types.d.ts.map} +0 -0
- /package/{connector-cred-types.js.map → dist/connector-cred-types.js.map} +0 -0
- /package/{contracts → dist/contracts}/awareness.d.ts.map +0 -0
- /package/{contracts → dist/contracts}/awareness.js +0 -0
- /package/{contracts → dist/contracts}/awareness.js.map +0 -0
- /package/{contracts → dist/contracts}/cloud-topology.d.ts +0 -0
- /package/{contracts → dist/contracts}/cloud-topology.d.ts.map +0 -0
- /package/{contracts → dist/contracts}/cloud-topology.js +0 -0
- /package/{contracts → dist/contracts}/cloud-topology.js.map +0 -0
- /package/{contracts → dist/contracts}/config.js +0 -0
- /package/{contracts → dist/contracts}/config.js.map +0 -0
- /package/{contracts → dist/contracts}/content-pack.d.ts +0 -0
- /package/{contracts → dist/contracts}/content-pack.d.ts.map +0 -0
- /package/{contracts → dist/contracts}/content-pack.js +0 -0
- /package/{contracts → dist/contracts}/content-pack.js.map +0 -0
- /package/{contracts → dist/contracts}/drop.d.ts +0 -0
- /package/{contracts → dist/contracts}/drop.d.ts.map +0 -0
- /package/{contracts → dist/contracts}/drop.js +0 -0
- /package/{contracts → dist/contracts}/drop.js.map +0 -0
- /package/{contracts → dist/contracts}/inbox.d.ts +0 -0
- /package/{contracts → dist/contracts}/inbox.d.ts.map +0 -0
- /package/{contracts → dist/contracts}/inbox.js +0 -0
- /package/{contracts → dist/contracts}/inbox.js.map +0 -0
- /package/{contracts → dist/contracts}/lifeops-connector-degradation.d.ts +0 -0
- /package/{contracts → dist/contracts}/lifeops-connector-degradation.d.ts.map +0 -0
- /package/{contracts → dist/contracts}/lifeops-connector-degradation.js +0 -0
- /package/{contracts → dist/contracts}/lifeops-connector-degradation.js.map +0 -0
- /package/{contracts → dist/contracts}/theme.d.ts +0 -0
- /package/{contracts → dist/contracts}/theme.d.ts.map +0 -0
- /package/{contracts → dist/contracts}/theme.js +0 -0
- /package/{contracts → dist/contracts}/theme.js.map +0 -0
- /package/{contracts → dist/contracts}/verification.d.ts +0 -0
- /package/{contracts → dist/contracts}/verification.d.ts.map +0 -0
- /package/{contracts → dist/contracts}/verification.js +0 -0
- /package/{contracts → dist/contracts}/verification.js.map +0 -0
- /package/{dev-settings-banner-style.d.ts → dist/dev-settings-banner-style.d.ts} +0 -0
- /package/{dev-settings-banner-style.d.ts.map → dist/dev-settings-banner-style.d.ts.map} +0 -0
- /package/{dev-settings-banner-style.js → dist/dev-settings-banner-style.js} +0 -0
- /package/{dev-settings-banner-style.js.map → dist/dev-settings-banner-style.js.map} +0 -0
- /package/{dev-settings-figlet-heading.d.ts → dist/dev-settings-figlet-heading.d.ts} +0 -0
- /package/{dev-settings-figlet-heading.d.ts.map → dist/dev-settings-figlet-heading.d.ts.map} +0 -0
- /package/{dev-settings-figlet-heading.js → dist/dev-settings-figlet-heading.js} +0 -0
- /package/{dev-settings-figlet-heading.js.map → dist/dev-settings-figlet-heading.js.map} +0 -0
- /package/{dev-settings-table.d.ts → dist/dev-settings-table.d.ts} +0 -0
- /package/{dev-settings-table.d.ts.map → dist/dev-settings-table.d.ts.map} +0 -0
- /package/{dev-settings-table.js → dist/dev-settings-table.js} +0 -0
- /package/{dev-settings-table.js.map → dist/dev-settings-table.js.map} +0 -0
- /package/{format-error.d.ts → dist/format-error.d.ts} +0 -0
- /package/{format-error.d.ts.map → dist/format-error.d.ts.map} +0 -0
- /package/{format-error.js → dist/format-error.js} +0 -0
- /package/{format-error.js.map → dist/format-error.js.map} +0 -0
- /package/{i18n → dist/i18n}/keyword-matching.d.ts +0 -0
- /package/{i18n → dist/i18n}/keyword-matching.d.ts.map +0 -0
- /package/{i18n → dist/i18n}/keyword-matching.js +0 -0
- /package/{i18n → dist/i18n}/keyword-matching.js.map +0 -0
- /package/{i18n → dist/i18n}/validation-keywords.d.ts +0 -0
- /package/{i18n → dist/i18n}/validation-keywords.d.ts.map +0 -0
- /package/{i18n → dist/i18n}/validation-keywords.js +0 -0
- /package/{i18n → dist/i18n}/validation-keywords.js.map +0 -0
- /package/{onboarding-presets.characters.d.ts → dist/onboarding-presets.characters.d.ts} +0 -0
- /package/{onboarding-presets.characters.d.ts.map → dist/onboarding-presets.characters.d.ts.map} +0 -0
- /package/{onboarding-presets.characters.js → dist/onboarding-presets.characters.js} +0 -0
- /package/{onboarding-presets.characters.js.map → dist/onboarding-presets.characters.js.map} +0 -0
- /package/{onboarding-presets.d.ts → dist/onboarding-presets.d.ts} +0 -0
- /package/{onboarding-presets.d.ts.map → dist/onboarding-presets.d.ts.map} +0 -0
- /package/{onboarding-presets.js → dist/onboarding-presets.js} +0 -0
- /package/{onboarding-presets.js.map → dist/onboarding-presets.js.map} +0 -0
- /package/{onboarding-presets.shared.d.ts → dist/onboarding-presets.shared.d.ts} +0 -0
- /package/{onboarding-presets.shared.d.ts.map → dist/onboarding-presets.shared.d.ts.map} +0 -0
- /package/{onboarding-presets.shared.js → dist/onboarding-presets.shared.js} +0 -0
- /package/{onboarding-presets.shared.js.map → dist/onboarding-presets.shared.js.map} +0 -0
- /package/{recent-messages-state.d.ts → dist/recent-messages-state.d.ts} +0 -0
- /package/{recent-messages-state.d.ts.map → dist/recent-messages-state.d.ts.map} +0 -0
- /package/{recent-messages-state.js → dist/recent-messages-state.js} +0 -0
- /package/{recent-messages-state.js.map → dist/recent-messages-state.js.map} +0 -0
- /package/{restart.d.ts → dist/restart.d.ts} +0 -0
- /package/{restart.d.ts.map → dist/restart.d.ts.map} +0 -0
- /package/{restart.js → dist/restart.js} +0 -0
- /package/{restart.js.map → dist/restart.js.map} +0 -0
- /package/{runtime-env.d.ts → dist/runtime-env.d.ts} +0 -0
- /package/{runtime-env.d.ts.map → dist/runtime-env.d.ts.map} +0 -0
- /package/{self-edit.d.ts → dist/self-edit.d.ts} +0 -0
- /package/{self-edit.d.ts.map → dist/self-edit.d.ts.map} +0 -0
- /package/{settings-debug.d.ts → dist/settings-debug.d.ts} +0 -0
- /package/{spoken-text.d.ts → dist/spoken-text.d.ts} +0 -0
- /package/{spoken-text.d.ts.map → dist/spoken-text.d.ts.map} +0 -0
- /package/{themes → dist/themes}/index.d.ts +0 -0
- /package/{themes → dist/themes}/index.d.ts.map +0 -0
- /package/{themes → dist/themes}/index.js +0 -0
- /package/{themes → dist/themes}/index.js.map +0 -0
- /package/{themes → dist/themes}/presets.d.ts +0 -0
- /package/{themes → dist/themes}/presets.d.ts.map +0 -0
- /package/{themes → dist/themes}/presets.js +0 -0
- /package/{themes → dist/themes}/presets.js.map +0 -0
- /package/{validation-keywords.d.ts → dist/validation-keywords.d.ts} +0 -0
- /package/{validation-keywords.d.ts.map → dist/validation-keywords.d.ts.map} +0 -0
- /package/{validation-keywords.js → dist/validation-keywords.js} +0 -0
- /package/{validation-keywords.js.map → dist/validation-keywords.js.map} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// CLI palette tokens for CLI/UI theming.
|
|
2
|
+
// Keep in sync with docs/cli/index.md (CLI palette section).
|
|
3
|
+
export const CLI_PALETTE = {
|
|
4
|
+
accent: "#FF5A2D",
|
|
5
|
+
accentBright: "#FF7A3D",
|
|
6
|
+
accentDim: "#D14A22",
|
|
7
|
+
info: "#FF8A5B",
|
|
8
|
+
success: "#2FBF71",
|
|
9
|
+
warn: "#FFB020",
|
|
10
|
+
error: "#E23D2D",
|
|
11
|
+
muted: "#8B7F77",
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.js","sourceRoot":"","sources":["../../src/terminal/palette.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,SAAS;IACjB,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;CACR,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const theme: {
|
|
2
|
+
readonly accent: import("chalk").ChalkInstance;
|
|
3
|
+
readonly accentBright: import("chalk").ChalkInstance;
|
|
4
|
+
readonly accentDim: import("chalk").ChalkInstance;
|
|
5
|
+
readonly info: import("chalk").ChalkInstance;
|
|
6
|
+
readonly success: import("chalk").ChalkInstance;
|
|
7
|
+
readonly warn: import("chalk").ChalkInstance;
|
|
8
|
+
readonly error: import("chalk").ChalkInstance;
|
|
9
|
+
readonly muted: import("chalk").ChalkInstance;
|
|
10
|
+
readonly heading: import("chalk").ChalkInstance;
|
|
11
|
+
readonly command: import("chalk").ChalkInstance;
|
|
12
|
+
readonly option: import("chalk").ChalkInstance;
|
|
13
|
+
};
|
|
14
|
+
export declare const cyberGreen: import("chalk").ChalkInstance;
|
|
15
|
+
export declare const isRich: () => boolean;
|
|
16
|
+
export declare const colorize: (rich: boolean, color: (value: string) => string, value: string) => string;
|
|
17
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/terminal/theme.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,KAAK;;;;;;;;;;;;CAYR,CAAC;AAEX,eAAO,MAAM,UAAU,+BAAiB,CAAC;AAEzC,eAAO,MAAM,MAAM,eAAqC,CAAC;AAEzD,eAAO,MAAM,QAAQ,GACnB,MAAM,OAAO,EACb,OAAO,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAChC,OAAO,MAAM,WACmB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import chalk, { Chalk } from "chalk";
|
|
2
|
+
import { CLI_PALETTE } from "./palette.js";
|
|
3
|
+
const hasForceColor = typeof process.env.FORCE_COLOR === "string" &&
|
|
4
|
+
process.env.FORCE_COLOR.trim().length > 0 &&
|
|
5
|
+
process.env.FORCE_COLOR.trim() !== "0";
|
|
6
|
+
const hasNoColor = process.env.NO_COLOR !== undefined;
|
|
7
|
+
const baseChalk = hasNoColor && !hasForceColor ? new Chalk({ level: 0 }) : chalk;
|
|
8
|
+
const hex = (value) => baseChalk.hex(value);
|
|
9
|
+
export const theme = {
|
|
10
|
+
accent: hex(CLI_PALETTE.accent),
|
|
11
|
+
accentBright: hex(CLI_PALETTE.accentBright),
|
|
12
|
+
accentDim: hex(CLI_PALETTE.accentDim),
|
|
13
|
+
info: hex(CLI_PALETTE.info),
|
|
14
|
+
success: hex(CLI_PALETTE.success),
|
|
15
|
+
warn: hex(CLI_PALETTE.warn),
|
|
16
|
+
error: hex(CLI_PALETTE.error),
|
|
17
|
+
muted: hex(CLI_PALETTE.muted),
|
|
18
|
+
heading: baseChalk.bold.hex(CLI_PALETTE.accent),
|
|
19
|
+
command: hex(CLI_PALETTE.accentBright),
|
|
20
|
+
option: hex(CLI_PALETTE.warn),
|
|
21
|
+
};
|
|
22
|
+
export const cyberGreen = hex("#00FF41");
|
|
23
|
+
export const isRich = () => Boolean(baseChalk.level > 0);
|
|
24
|
+
export const colorize = (rich, color, value) => (rich ? color(value) : value);
|
|
25
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/terminal/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,aAAa,GACjB,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,QAAQ;IAC3C,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC;AAEzC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC;AAEtD,MAAM,SAAS,GACb,UAAU,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAEjE,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;IAC/B,YAAY,EAAE,GAAG,CAAC,WAAW,CAAC,YAAY,CAAC;IAC3C,SAAS,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC;IACrC,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC;IAC3B,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC;IACjC,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC;IAC3B,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC;IAC7B,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC;IAC7B,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,YAAY,CAAC;IACtC,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC;CACrB,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,IAAa,EACb,KAAgC,EAChC,KAAa,EACb,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
|
+
type MockSpawnOptions = {
|
|
3
|
+
exitCode: number;
|
|
4
|
+
stderrOutput?: string;
|
|
5
|
+
emitError?: Error;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Create a lightweight mocked ChildProcess that emits either an error event
|
|
9
|
+
* or a close event (with optional stderr output) on the next tick.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createMockChildProcess(options: MockSpawnOptions): ChildProcess;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=process-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-helpers.d.ts","sourceRoot":"","sources":["../../src/test-support/process-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,GACxB,YAAY,CAmBd"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
/**
|
|
3
|
+
* Create a lightweight mocked ChildProcess that emits either an error event
|
|
4
|
+
* or a close event (with optional stderr output) on the next tick.
|
|
5
|
+
*/
|
|
6
|
+
export function createMockChildProcess(options) {
|
|
7
|
+
const child = new EventEmitter();
|
|
8
|
+
const stderrEmitter = new EventEmitter();
|
|
9
|
+
Object.defineProperty(child, "stderr", { value: stderrEmitter });
|
|
10
|
+
Object.defineProperty(child, "stdin", { value: null });
|
|
11
|
+
Object.defineProperty(child, "stdout", { value: null });
|
|
12
|
+
process.nextTick(() => {
|
|
13
|
+
if (options.emitError) {
|
|
14
|
+
child.emit("error", options.emitError);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (options.stderrOutput) {
|
|
18
|
+
stderrEmitter.emit("data", Buffer.from(options.stderrOutput));
|
|
19
|
+
}
|
|
20
|
+
child.emit("close", options.exitCode);
|
|
21
|
+
});
|
|
22
|
+
return child;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=process-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-helpers.js","sourceRoot":"","sources":["../../src/test-support/process-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3C;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAyB;IAEzB,MAAM,KAAK,GAAG,IAAI,YAAY,EAAkB,CAAC;IACjD,MAAM,aAAa,GAAG,IAAI,YAAY,EAAE,CAAC;IACzC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;IACjE,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAExD,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;QACpB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;YACvC,OAAO;QACT,CAAC;QACD,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACzB,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;QAChE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type http from "node:http";
|
|
2
|
+
/** Standardized test result for mocked updater checks. */
|
|
3
|
+
export type MockUpdateCheckResult = {
|
|
4
|
+
updateAvailable: boolean;
|
|
5
|
+
currentVersion: string;
|
|
6
|
+
latestVersion: string | null;
|
|
7
|
+
channel: string;
|
|
8
|
+
distTag: string;
|
|
9
|
+
cached: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
};
|
|
12
|
+
/** Snapshot and restore the configured environment variables around a test. */
|
|
13
|
+
export declare function createEnvSandbox(keys: readonly string[]): {
|
|
14
|
+
clear: () => void;
|
|
15
|
+
restore: () => void;
|
|
16
|
+
};
|
|
17
|
+
export type PluginModuleShape = {
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
default?: unknown;
|
|
20
|
+
plugin?: unknown;
|
|
21
|
+
};
|
|
22
|
+
/** Loose plugin-shape predicate used in dynamic test imports across suites. */
|
|
23
|
+
export declare function looksLikePlugin(value: unknown): value is {
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
/** Extract a plugin-like object from a dynamic module export shape. */
|
|
27
|
+
export declare function extractPlugin(mod: PluginModuleShape): {
|
|
28
|
+
name: string;
|
|
29
|
+
} | null;
|
|
30
|
+
/** Check whether a package name can be resolved for dynamic import. */
|
|
31
|
+
export declare function isPackageImportResolvable(packageName: string): boolean;
|
|
32
|
+
/** Check whether a dependency specifier should be treated as a workspace-local version. */
|
|
33
|
+
export declare function isWorkspaceDependency(version: string | undefined): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve the Discord plugin import specifier.
|
|
36
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveDiscordPluginImportSpecifier(): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Resolve the Telegram plugin import specifier.
|
|
41
|
+
* Prefers package resolution, then falls back to node_modules ESM entry
|
|
42
|
+
* (the telegram plugin is ESM-only so CJS require.resolve fails), then
|
|
43
|
+
* falls back to local plugin checkout paths.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveTelegramPluginImportSpecifier(): string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Resolve the Lens plugin import specifier.
|
|
48
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
49
|
+
* Uses both CJS require.resolve and a direct node_modules check for ESM-only packages.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveLensPluginImportSpecifier(): string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Resolve the Farcaster plugin import specifier.
|
|
54
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveFarcasterPluginImportSpecifier(): string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Resolve the Nostr plugin import specifier.
|
|
59
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
60
|
+
*/
|
|
61
|
+
export declare function resolveNostrPluginImportSpecifier(): string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the Matrix plugin import specifier.
|
|
64
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveMatrixPluginImportSpecifier(): string | null;
|
|
67
|
+
/**
|
|
68
|
+
* Resolve the Feishu plugin import specifier.
|
|
69
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveFeishuPluginImportSpecifier(): string | null;
|
|
72
|
+
export declare function resolveWechatPluginImportSpecifier(): string | null;
|
|
73
|
+
/** Build a mock update check result with deterministic defaults. */
|
|
74
|
+
export declare function buildMockUpdateCheckResult(overrides?: Partial<MockUpdateCheckResult>): MockUpdateCheckResult;
|
|
75
|
+
/** Small utility to wait for asynchronous side-effects in tests. */
|
|
76
|
+
export declare function waitMs(ms: number): Promise<void>;
|
|
77
|
+
type MockResponsePayload<T> = {
|
|
78
|
+
res: MockHttpServerResponse;
|
|
79
|
+
getStatus: () => number;
|
|
80
|
+
getJson: () => T;
|
|
81
|
+
};
|
|
82
|
+
type MockHttpServerResponse = http.ServerResponse & {
|
|
83
|
+
_status: number;
|
|
84
|
+
_body: string;
|
|
85
|
+
writeHead: (statusCode: number) => void;
|
|
86
|
+
};
|
|
87
|
+
type MockBodyChunk = string | Buffer;
|
|
88
|
+
export type MockRequestOptions = {
|
|
89
|
+
method?: string;
|
|
90
|
+
url?: string;
|
|
91
|
+
headers?: Record<string, string>;
|
|
92
|
+
body?: unknown;
|
|
93
|
+
bodyChunks?: MockBodyChunk[];
|
|
94
|
+
json?: boolean;
|
|
95
|
+
};
|
|
96
|
+
/** Create a lightweight mocked HTTP response used by handler tests. */
|
|
97
|
+
export declare function createMockHttpResponse<T = unknown>(): MockResponsePayload<T>;
|
|
98
|
+
export declare function createMockHeadersRequest(headers?: Record<string, string>, options?: Omit<MockRequestOptions, "headers" | "body">): http.IncomingMessage & {
|
|
99
|
+
destroy: () => void;
|
|
100
|
+
};
|
|
101
|
+
export declare function createMockIncomingMessage({ method, url, headers, body, bodyChunks, json, }: MockRequestOptions): http.IncomingMessage & {
|
|
102
|
+
destroy: () => void;
|
|
103
|
+
};
|
|
104
|
+
export declare function createMockJsonRequest(body: unknown, options?: Omit<MockRequestOptions, "body" | "json">): http.IncomingMessage & {
|
|
105
|
+
destroy: () => void;
|
|
106
|
+
};
|
|
107
|
+
/** Return true when optional plugin imports are intentionally unavailable in this env. */
|
|
108
|
+
export declare function isOptionalImportError(error: unknown, extraMarkers?: readonly string[]): boolean;
|
|
109
|
+
/** Safely import optional plugin modules while allowing hard failures to bubble. */
|
|
110
|
+
export declare function tryOptionalDynamicImport<T>(moduleName: string, markers?: readonly string[]): Promise<T | null>;
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=test-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/test-support/test-helpers.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
import { EventEmitter } from "node:events";
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import { ServerResponse } from "node:http";
|
|
12
|
+
import { createRequire } from "node:module";
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
15
|
+
/**
|
|
16
|
+
* Test helper utilities shared across unit tests.
|
|
17
|
+
*/
|
|
18
|
+
const OPTIONAL_IMPORT_ERROR_MARKERS = [
|
|
19
|
+
"Cannot find module",
|
|
20
|
+
"Cannot find package",
|
|
21
|
+
"ERR_MODULE_NOT_FOUND",
|
|
22
|
+
"MODULE_NOT_FOUND",
|
|
23
|
+
"Dynamic require of",
|
|
24
|
+
"native addon module",
|
|
25
|
+
"Failed to resolve entry",
|
|
26
|
+
"tfjs_binding",
|
|
27
|
+
"NAPI_MODULE_NOT_FOUND",
|
|
28
|
+
"spec not found",
|
|
29
|
+
];
|
|
30
|
+
/** Snapshot and restore the configured environment variables around a test. */
|
|
31
|
+
export function createEnvSandbox(keys) {
|
|
32
|
+
const backup = {};
|
|
33
|
+
function clear() {
|
|
34
|
+
for (const key of keys) {
|
|
35
|
+
backup[key] = process.env[key];
|
|
36
|
+
delete process.env[key];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function restore() {
|
|
40
|
+
for (const key of keys) {
|
|
41
|
+
if (backup[key] === undefined) {
|
|
42
|
+
delete process.env[key];
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
process.env[key] = backup[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return { clear, restore };
|
|
50
|
+
}
|
|
51
|
+
/** Loose plugin-shape predicate used in dynamic test imports across suites. */
|
|
52
|
+
export function looksLikePlugin(value) {
|
|
53
|
+
return (value != null &&
|
|
54
|
+
typeof value === "object" &&
|
|
55
|
+
typeof value.name === "string");
|
|
56
|
+
}
|
|
57
|
+
/** Extract a plugin-like object from a dynamic module export shape. */
|
|
58
|
+
export function extractPlugin(mod) {
|
|
59
|
+
if (looksLikePlugin(mod.default))
|
|
60
|
+
return mod.default;
|
|
61
|
+
if (looksLikePlugin(mod.plugin))
|
|
62
|
+
return mod.plugin;
|
|
63
|
+
if (looksLikePlugin(mod))
|
|
64
|
+
return mod;
|
|
65
|
+
for (const key of Object.keys(mod)) {
|
|
66
|
+
if (key === "default" || key === "plugin")
|
|
67
|
+
continue;
|
|
68
|
+
if (looksLikePlugin(mod[key]))
|
|
69
|
+
return mod[key];
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
/** Check whether a package name can be resolved for dynamic import. */
|
|
74
|
+
export function isPackageImportResolvable(packageName) {
|
|
75
|
+
const require = createRequire(import.meta.url);
|
|
76
|
+
try {
|
|
77
|
+
require.resolve(packageName);
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** Check whether a dependency specifier should be treated as a workspace-local version. */
|
|
85
|
+
export function isWorkspaceDependency(version) {
|
|
86
|
+
return (typeof version === "string" &&
|
|
87
|
+
(version.startsWith(".") || version.startsWith("workspace:")));
|
|
88
|
+
}
|
|
89
|
+
const DISCORD_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-discord";
|
|
90
|
+
const DISCORD_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
|
|
91
|
+
"../plugins/plugin-discord/dist/index",
|
|
92
|
+
];
|
|
93
|
+
/**
|
|
94
|
+
* Resolve the Discord plugin import specifier.
|
|
95
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
96
|
+
*/
|
|
97
|
+
export function resolveDiscordPluginImportSpecifier() {
|
|
98
|
+
if (isPackageImportResolvable(DISCORD_PLUGIN_PACKAGE_NAME)) {
|
|
99
|
+
return DISCORD_PLUGIN_PACKAGE_NAME;
|
|
100
|
+
}
|
|
101
|
+
const helperDir = path.dirname(fileURLToPath(import.meta.url));
|
|
102
|
+
const packageRoot = path.resolve(helperDir, "..", "..");
|
|
103
|
+
for (const relativeEntryPath of DISCORD_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
104
|
+
const absoluteEntryPath = path.resolve(packageRoot, relativeEntryPath);
|
|
105
|
+
if (existsSync(absoluteEntryPath)) {
|
|
106
|
+
return pathToFileURL(absoluteEntryPath).href;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
const TELEGRAM_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-telegram";
|
|
112
|
+
const TELEGRAM_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
|
|
113
|
+
"../plugins/plugin-telegram/dist/index",
|
|
114
|
+
];
|
|
115
|
+
/**
|
|
116
|
+
* Resolve the Telegram plugin import specifier.
|
|
117
|
+
* Prefers package resolution, then falls back to node_modules ESM entry
|
|
118
|
+
* (the telegram plugin is ESM-only so CJS require.resolve fails), then
|
|
119
|
+
* falls back to local plugin checkout paths.
|
|
120
|
+
*/
|
|
121
|
+
export function resolveTelegramPluginImportSpecifier() {
|
|
122
|
+
if (isPackageImportResolvable(TELEGRAM_PLUGIN_PACKAGE_NAME)) {
|
|
123
|
+
return TELEGRAM_PLUGIN_PACKAGE_NAME;
|
|
124
|
+
}
|
|
125
|
+
const helperDir = path.dirname(fileURLToPath(import.meta.url));
|
|
126
|
+
const packageRoot = path.resolve(helperDir, "..", "..");
|
|
127
|
+
// ESM-only: try direct node_modules entry
|
|
128
|
+
const nodeModulesEntry = path.resolve(packageRoot, "node_modules", "@elizaos", "plugin-telegram", "dist", "index.js");
|
|
129
|
+
if (existsSync(nodeModulesEntry)) {
|
|
130
|
+
return pathToFileURL(nodeModulesEntry).href;
|
|
131
|
+
}
|
|
132
|
+
for (const relativeEntryPath of TELEGRAM_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
133
|
+
const absoluteEntryPath = path.resolve(packageRoot, relativeEntryPath);
|
|
134
|
+
if (existsSync(absoluteEntryPath)) {
|
|
135
|
+
return pathToFileURL(absoluteEntryPath).href;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
const LENS_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-lens";
|
|
141
|
+
const LENS_PLUGIN_FALLBACK_PACKAGE = "@elizaos-plugins/client-lens";
|
|
142
|
+
const LENS_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
|
|
143
|
+
"../plugins/plugin-lens/dist/index",
|
|
144
|
+
"../../client-lens/dist/index",
|
|
145
|
+
"../../client-lens/src/index",
|
|
146
|
+
];
|
|
147
|
+
/**
|
|
148
|
+
* Resolve the Lens plugin import specifier.
|
|
149
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
150
|
+
* Uses both CJS require.resolve and a direct node_modules check for ESM-only packages.
|
|
151
|
+
*/
|
|
152
|
+
export function resolveLensPluginImportSpecifier() {
|
|
153
|
+
if (isPackageImportResolvable(LENS_PLUGIN_PACKAGE_NAME)) {
|
|
154
|
+
return LENS_PLUGIN_PACKAGE_NAME;
|
|
155
|
+
}
|
|
156
|
+
if (isPackageImportResolvable(LENS_PLUGIN_FALLBACK_PACKAGE)) {
|
|
157
|
+
return LENS_PLUGIN_FALLBACK_PACKAGE;
|
|
158
|
+
}
|
|
159
|
+
const helperDir = path.dirname(fileURLToPath(import.meta.url));
|
|
160
|
+
const packageRoot = path.resolve(helperDir, "..", "..");
|
|
161
|
+
const nodeModulesSourceEntry = path.resolve(packageRoot, "node_modules", "@elizaos-plugins", "client-lens", "src", "index.ts");
|
|
162
|
+
if (existsSync(nodeModulesSourceEntry)) {
|
|
163
|
+
return pathToFileURL(nodeModulesSourceEntry).href;
|
|
164
|
+
}
|
|
165
|
+
const nodeModulesDistEntry = path.resolve(packageRoot, "node_modules", "@elizaos-plugins", "client-lens", "dist", "index.js");
|
|
166
|
+
if (existsSync(nodeModulesDistEntry)) {
|
|
167
|
+
return pathToFileURL(nodeModulesDistEntry).href;
|
|
168
|
+
}
|
|
169
|
+
for (const relativeEntryPath of LENS_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
170
|
+
const absoluteEntryPath = path.resolve(packageRoot, relativeEntryPath);
|
|
171
|
+
if (existsSync(absoluteEntryPath)) {
|
|
172
|
+
return pathToFileURL(absoluteEntryPath).href;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
const FARCASTER_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-farcaster";
|
|
178
|
+
const FARCASTER_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
|
|
179
|
+
"../plugins/plugin-farcaster/dist/node/index.node.js",
|
|
180
|
+
];
|
|
181
|
+
/**
|
|
182
|
+
* Resolve the Farcaster plugin import specifier.
|
|
183
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
184
|
+
*/
|
|
185
|
+
export function resolveFarcasterPluginImportSpecifier() {
|
|
186
|
+
if (isPackageImportResolvable(FARCASTER_PLUGIN_PACKAGE_NAME)) {
|
|
187
|
+
return FARCASTER_PLUGIN_PACKAGE_NAME;
|
|
188
|
+
}
|
|
189
|
+
const helperDir = path.dirname(fileURLToPath(import.meta.url));
|
|
190
|
+
const packageRoot = path.resolve(helperDir, "..", "..");
|
|
191
|
+
for (const relativeEntryPath of FARCASTER_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
192
|
+
const absoluteEntryPath = path.resolve(packageRoot, relativeEntryPath);
|
|
193
|
+
if (existsSync(absoluteEntryPath)) {
|
|
194
|
+
return pathToFileURL(absoluteEntryPath).href;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
const NOSTR_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-nostr";
|
|
200
|
+
const NOSTR_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
|
|
201
|
+
"../plugins/plugin-nostr/dist/index",
|
|
202
|
+
];
|
|
203
|
+
/**
|
|
204
|
+
* Resolve the Nostr plugin import specifier.
|
|
205
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
206
|
+
*/
|
|
207
|
+
export function resolveNostrPluginImportSpecifier() {
|
|
208
|
+
if (isPackageImportResolvable(NOSTR_PLUGIN_PACKAGE_NAME)) {
|
|
209
|
+
return NOSTR_PLUGIN_PACKAGE_NAME;
|
|
210
|
+
}
|
|
211
|
+
const helperDir = path.dirname(fileURLToPath(import.meta.url));
|
|
212
|
+
const packageRoot = path.resolve(helperDir, "..", "..");
|
|
213
|
+
for (const relativeEntryPath of NOSTR_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
214
|
+
const absoluteEntryPath = path.resolve(packageRoot, relativeEntryPath);
|
|
215
|
+
if (existsSync(absoluteEntryPath)) {
|
|
216
|
+
return pathToFileURL(absoluteEntryPath).href;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
const MATRIX_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-matrix";
|
|
222
|
+
const MATRIX_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
|
|
223
|
+
"../plugins/plugin-matrix/dist/index",
|
|
224
|
+
];
|
|
225
|
+
/**
|
|
226
|
+
* Resolve the Matrix plugin import specifier.
|
|
227
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
228
|
+
*/
|
|
229
|
+
export function resolveMatrixPluginImportSpecifier() {
|
|
230
|
+
if (isPackageImportResolvable(MATRIX_PLUGIN_PACKAGE_NAME)) {
|
|
231
|
+
return MATRIX_PLUGIN_PACKAGE_NAME;
|
|
232
|
+
}
|
|
233
|
+
const helperDir = path.dirname(fileURLToPath(import.meta.url));
|
|
234
|
+
const packageRoot = path.resolve(helperDir, "..", "..");
|
|
235
|
+
for (const relativeEntryPath of MATRIX_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
236
|
+
const absoluteEntryPath = path.resolve(packageRoot, relativeEntryPath);
|
|
237
|
+
if (existsSync(absoluteEntryPath)) {
|
|
238
|
+
return pathToFileURL(absoluteEntryPath).href;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
const FEISHU_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-feishu";
|
|
244
|
+
const FEISHU_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
|
|
245
|
+
"../plugins/plugin-feishu/dist/index",
|
|
246
|
+
];
|
|
247
|
+
/**
|
|
248
|
+
* Resolve the Feishu plugin import specifier.
|
|
249
|
+
* Prefers package resolution, then falls back to local plugin checkout paths.
|
|
250
|
+
*/
|
|
251
|
+
export function resolveFeishuPluginImportSpecifier() {
|
|
252
|
+
if (isPackageImportResolvable(FEISHU_PLUGIN_PACKAGE_NAME)) {
|
|
253
|
+
return FEISHU_PLUGIN_PACKAGE_NAME;
|
|
254
|
+
}
|
|
255
|
+
const helperDir = path.dirname(fileURLToPath(import.meta.url));
|
|
256
|
+
const packageRoot = path.resolve(helperDir, "..", "..");
|
|
257
|
+
const nodeModulesDistEntry = path.resolve(packageRoot, "node_modules", "@elizaos", "plugin-feishu", "dist", "index.js");
|
|
258
|
+
if (existsSync(nodeModulesDistEntry)) {
|
|
259
|
+
return pathToFileURL(nodeModulesDistEntry).href;
|
|
260
|
+
}
|
|
261
|
+
for (const relativeEntryPath of FEISHU_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
262
|
+
const absoluteEntryPath = path.resolve(packageRoot, relativeEntryPath);
|
|
263
|
+
if (existsSync(absoluteEntryPath)) {
|
|
264
|
+
return pathToFileURL(absoluteEntryPath).href;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
const WECHAT_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-wechat";
|
|
270
|
+
const WECHAT_PLUGIN_LEGACY_PACKAGE_NAME = "@elizaai/plugin-wechat";
|
|
271
|
+
const WECHAT_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
|
|
272
|
+
"src/index.ts",
|
|
273
|
+
"dist/index.js",
|
|
274
|
+
];
|
|
275
|
+
export function resolveWechatPluginImportSpecifier() {
|
|
276
|
+
if (isPackageImportResolvable(WECHAT_PLUGIN_PACKAGE_NAME)) {
|
|
277
|
+
return WECHAT_PLUGIN_PACKAGE_NAME;
|
|
278
|
+
}
|
|
279
|
+
if (isPackageImportResolvable(WECHAT_PLUGIN_LEGACY_PACKAGE_NAME)) {
|
|
280
|
+
return WECHAT_PLUGIN_LEGACY_PACKAGE_NAME;
|
|
281
|
+
}
|
|
282
|
+
const helperDir = path.dirname(fileURLToPath(import.meta.url));
|
|
283
|
+
const packageRoot = path.resolve(helperDir, "..", "..");
|
|
284
|
+
// Check node_modules for either the canonical or legacy package name.
|
|
285
|
+
for (const packageName of [
|
|
286
|
+
WECHAT_PLUGIN_PACKAGE_NAME,
|
|
287
|
+
WECHAT_PLUGIN_LEGACY_PACKAGE_NAME,
|
|
288
|
+
]) {
|
|
289
|
+
const packageSegments = packageName.split("/");
|
|
290
|
+
for (const relativeEntryPath of WECHAT_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
291
|
+
const nodeModulesEntry = path.resolve(packageRoot, "node_modules", ...packageSegments, relativeEntryPath);
|
|
292
|
+
if (existsSync(nodeModulesEntry)) {
|
|
293
|
+
return pathToFileURL(nodeModulesEntry).href;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
for (const relativeEntryPath of WECHAT_PLUGIN_LOCAL_ENTRY_CANDIDATES) {
|
|
298
|
+
const nodeModulesEntry = path.resolve(packageRoot, "node_modules", "@elizaos", "plugin-wechat", relativeEntryPath);
|
|
299
|
+
if (existsSync(nodeModulesEntry)) {
|
|
300
|
+
return pathToFileURL(nodeModulesEntry).href;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
/** Build a mock update check result with deterministic defaults. */
|
|
306
|
+
export function buildMockUpdateCheckResult(overrides = {}) {
|
|
307
|
+
return {
|
|
308
|
+
updateAvailable: false,
|
|
309
|
+
currentVersion: "2.0.0",
|
|
310
|
+
latestVersion: "2.0.0",
|
|
311
|
+
channel: "stable",
|
|
312
|
+
distTag: "latest",
|
|
313
|
+
cached: false,
|
|
314
|
+
error: null,
|
|
315
|
+
...overrides,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
/** Small utility to wait for asynchronous side-effects in tests. */
|
|
319
|
+
export function waitMs(ms) {
|
|
320
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
321
|
+
}
|
|
322
|
+
/** Create a lightweight mocked HTTP response used by handler tests. */
|
|
323
|
+
export function createMockHttpResponse() {
|
|
324
|
+
let statusCode = 200;
|
|
325
|
+
let legacyStatus = 0;
|
|
326
|
+
let payload = "";
|
|
327
|
+
const res = Object.create(ServerResponse.prototype);
|
|
328
|
+
Object.defineProperty(res, "statusCode", {
|
|
329
|
+
get() {
|
|
330
|
+
return statusCode;
|
|
331
|
+
},
|
|
332
|
+
set(value) {
|
|
333
|
+
statusCode = value;
|
|
334
|
+
legacyStatus = value;
|
|
335
|
+
},
|
|
336
|
+
configurable: true,
|
|
337
|
+
});
|
|
338
|
+
res._status = legacyStatus;
|
|
339
|
+
res._body = payload;
|
|
340
|
+
res.setHeader = () => res;
|
|
341
|
+
res.writeHead = ((value) => {
|
|
342
|
+
statusCode = value;
|
|
343
|
+
legacyStatus = value;
|
|
344
|
+
return res;
|
|
345
|
+
});
|
|
346
|
+
res.end = ((chunk) => {
|
|
347
|
+
payload = chunk ? chunk.toString() : "";
|
|
348
|
+
res._body = payload;
|
|
349
|
+
legacyStatus = statusCode;
|
|
350
|
+
res._status = legacyStatus;
|
|
351
|
+
return res;
|
|
352
|
+
});
|
|
353
|
+
return {
|
|
354
|
+
res,
|
|
355
|
+
getStatus: () => statusCode,
|
|
356
|
+
getJson: () => (payload ? JSON.parse(payload) : null),
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
export function createMockHeadersRequest(headers = {}, options = {}) {
|
|
360
|
+
return createMockIncomingMessage({
|
|
361
|
+
...options,
|
|
362
|
+
headers,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
export function createMockIncomingMessage({ method = "GET", url = "/", headers = { host: "localhost:2138" }, body, bodyChunks, json = false, }) {
|
|
366
|
+
const req = new EventEmitter();
|
|
367
|
+
req.method = method;
|
|
368
|
+
req.url = url;
|
|
369
|
+
req.headers = headers;
|
|
370
|
+
req.destroy = ((_) => req);
|
|
371
|
+
const chunks = [];
|
|
372
|
+
if (bodyChunks !== undefined) {
|
|
373
|
+
for (const chunk of bodyChunks) {
|
|
374
|
+
chunks.push(typeof chunk === "string" ? Buffer.from(chunk, "utf-8") : chunk);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
else if (body !== undefined) {
|
|
378
|
+
const encoded = typeof body === "string"
|
|
379
|
+
? Buffer.from(body, "utf-8")
|
|
380
|
+
: body instanceof Buffer
|
|
381
|
+
? body
|
|
382
|
+
: json
|
|
383
|
+
? Buffer.from(JSON.stringify(body), "utf-8")
|
|
384
|
+
: Buffer.from(String(body), "utf-8");
|
|
385
|
+
chunks.push(encoded);
|
|
386
|
+
}
|
|
387
|
+
for (const chunk of chunks) {
|
|
388
|
+
queueMicrotask(() => req.emit("data", chunk));
|
|
389
|
+
}
|
|
390
|
+
queueMicrotask(() => req.emit("end"));
|
|
391
|
+
return req;
|
|
392
|
+
}
|
|
393
|
+
export function createMockJsonRequest(body, options = {}) {
|
|
394
|
+
return createMockIncomingMessage({
|
|
395
|
+
...options,
|
|
396
|
+
body,
|
|
397
|
+
json: true,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
/** Return true when optional plugin imports are intentionally unavailable in this env. */
|
|
401
|
+
export function isOptionalImportError(error, extraMarkers = []) {
|
|
402
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
403
|
+
return OPTIONAL_IMPORT_ERROR_MARKERS.concat(extraMarkers).some((marker) => message.includes(marker));
|
|
404
|
+
}
|
|
405
|
+
/** Safely import optional plugin modules while allowing hard failures to bubble. */
|
|
406
|
+
export async function tryOptionalDynamicImport(moduleName, markers) {
|
|
407
|
+
try {
|
|
408
|
+
return (await import(__rewriteRelativeImportExtension(/* @vite-ignore */ moduleName)));
|
|
409
|
+
}
|
|
410
|
+
catch (error) {
|
|
411
|
+
if (isOptionalImportError(error, markers))
|
|
412
|
+
return null;
|
|
413
|
+
throw error;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
//# sourceMappingURL=test-helpers.js.map
|