@naylence/agent-sdk 0.3.4-test.714 → 0.3.4-test.715
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/browser/index.js +42 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/cjs/naylence/agent/configs.d.ts +3 -3
- package/dist/cjs/naylence/agent/configs.js +42 -3
- package/dist/cjs/naylence/agent/configs.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/naylence/agent/configs.d.ts +3 -3
- package/dist/esm/naylence/agent/configs.js +42 -3
- package/dist/esm/naylence/agent/configs.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +2 -2
- package/dist/types/naylence/agent/configs.d.ts +3 -3
- package/dist/types/naylence/agent/configs.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -55748,8 +55748,47 @@
|
|
|
55748
55748
|
}
|
|
55749
55749
|
|
|
55750
55750
|
const SENTINEL_PORT = 8000;
|
|
55751
|
+
const ENV_PLUGIN_KEY = 'FAME_PLUGINS';
|
|
55752
|
+
const DEFAULT_PLUGINS = ['@naylence/runtime'];
|
|
55753
|
+
function getEnvRecords() {
|
|
55754
|
+
const records = [];
|
|
55755
|
+
if (typeof globalThis !== 'undefined') {
|
|
55756
|
+
const candidateProcess = globalThis.process;
|
|
55757
|
+
if (candidateProcess?.env && typeof candidateProcess.env === 'object') {
|
|
55758
|
+
records.push(candidateProcess.env);
|
|
55759
|
+
}
|
|
55760
|
+
const browserEnv = globalThis.__ENV__;
|
|
55761
|
+
if (browserEnv && typeof browserEnv === 'object') {
|
|
55762
|
+
records.push(browserEnv);
|
|
55763
|
+
}
|
|
55764
|
+
}
|
|
55765
|
+
return records;
|
|
55766
|
+
}
|
|
55767
|
+
function parseEnvPluginList(raw) {
|
|
55768
|
+
if (typeof raw !== 'string' || raw.trim().length === 0) {
|
|
55769
|
+
return [];
|
|
55770
|
+
}
|
|
55771
|
+
return raw
|
|
55772
|
+
.split(/[,\s]+/u)
|
|
55773
|
+
.map((entry) => entry.trim())
|
|
55774
|
+
.filter((entry) => entry.length > 0);
|
|
55775
|
+
}
|
|
55776
|
+
function computeConfiguredPlugins() {
|
|
55777
|
+
const resolved = new Set();
|
|
55778
|
+
for (const plugin of DEFAULT_PLUGINS) {
|
|
55779
|
+
resolved.add(plugin);
|
|
55780
|
+
}
|
|
55781
|
+
for (const record of getEnvRecords()) {
|
|
55782
|
+
const raw = record?.[ENV_PLUGIN_KEY];
|
|
55783
|
+
for (const plugin of parseEnvPluginList(raw)) {
|
|
55784
|
+
resolved.add(plugin);
|
|
55785
|
+
}
|
|
55786
|
+
}
|
|
55787
|
+
return Array.from(resolved);
|
|
55788
|
+
}
|
|
55789
|
+
const COMMON_PLUGINS = computeConfiguredPlugins();
|
|
55751
55790
|
const CLIENT_CONFIG = {
|
|
55752
|
-
plugins:
|
|
55791
|
+
plugins: COMMON_PLUGINS,
|
|
55753
55792
|
node: {
|
|
55754
55793
|
security: {
|
|
55755
55794
|
type: 'SecurityProfile',
|
|
@@ -55770,7 +55809,7 @@
|
|
|
55770
55809
|
},
|
|
55771
55810
|
};
|
|
55772
55811
|
const NODE_CONFIG = {
|
|
55773
|
-
plugins:
|
|
55812
|
+
plugins: COMMON_PLUGINS,
|
|
55774
55813
|
node: {
|
|
55775
55814
|
type: 'Node',
|
|
55776
55815
|
id: '${env:FAME_NODE_ID:}',
|
|
@@ -55795,7 +55834,7 @@
|
|
|
55795
55834
|
},
|
|
55796
55835
|
};
|
|
55797
55836
|
const SENTINEL_CONFIG = {
|
|
55798
|
-
plugins:
|
|
55837
|
+
plugins: COMMON_PLUGINS,
|
|
55799
55838
|
node: {
|
|
55800
55839
|
type: 'Sentinel',
|
|
55801
55840
|
id: '${env:FAME_NODE_ID:}',
|