Context:
Currently, Neo.config.useAiClient is a boolean. This means the Neural Link is either always on or always off for a given configuration file. To support safer deployments (e.g., enabling AI only in 'development' but not 'production' using the same config file), we need environment-aware configuration similar to useServiceWorker.
Scope:
- Update
src/DefaultConfig.mjs:
- Change
useAiClient type definition to Boolean|String|String[].
- Document the usage (e.g.,
'development', ['development', 'dist/esm']).
- Update
src/worker/App.mjs:
- In
onRegisterNeoConfig, implement logic to compare useAiClient value against Neo.config.environment.
- Only import/initialize
Neo.ai.Client if the environment matches.
Goal:
Allow developers to restrict Neural Link access to specific environments.
Context: Currently,
Neo.config.useAiClientis a boolean. This means the Neural Link is either always on or always off for a given configuration file. To support safer deployments (e.g., enabling AI only in 'development' but not 'production' using the same config file), we need environment-aware configuration similar touseServiceWorker.Scope:
src/DefaultConfig.mjs:useAiClienttype definition toBoolean|String|String[].'development',['development', 'dist/esm']).src/worker/App.mjs:onRegisterNeoConfig, implement logic to compareuseAiClientvalue againstNeo.config.environment.Neo.ai.Clientif the environment matches.Goal: Allow developers to restrict Neural Link access to specific environments.