@naylence/agent-sdk 0.3.4-test.712 → 0.3.4-test.713

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.
@@ -5596,7 +5596,7 @@
5596
5596
  Expressions.setting = Expressions.config;
5597
5597
 
5598
5598
  const isNodeEnvironment$1 = typeof process !== 'undefined' && Boolean(process?.versions?.node);
5599
- let cachedNodeRequire = null;
5599
+ let cachedNodeRequire$1 = null;
5600
5600
  let cachedPathToFileURL = null;
5601
5601
  function getGlobalDynamicImporter() {
5602
5602
  try {
@@ -5663,7 +5663,7 @@
5663
5663
  if (!isNodeEnvironment$1) {
5664
5664
  return null;
5665
5665
  }
5666
- if (!cachedNodeRequire) {
5666
+ if (!cachedNodeRequire$1) {
5667
5667
  try {
5668
5668
  const [{ createRequire }, urlModule] = await Promise.all([
5669
5669
  import('node:module'),
@@ -5672,20 +5672,20 @@
5672
5672
  cachedPathToFileURL = urlModule.pathToFileURL;
5673
5673
  const baseUrl = cachedPathToFileURL(`${process.cwd()}/`);
5674
5674
  const virtualEntry = new URL('./__naylence_plugin_resolver__.js', baseUrl);
5675
- cachedNodeRequire = createRequire(virtualEntry);
5675
+ cachedNodeRequire$1 = createRequire(virtualEntry);
5676
5676
  }
5677
5677
  catch (error) {
5678
5678
  if (process?.env?.FAME_PLUGINS_DEBUG) {
5679
5679
  console.warn('[plugins] unable to create require from cwd', error);
5680
5680
  }
5681
- cachedNodeRequire = null;
5681
+ cachedNodeRequire$1 = null;
5682
5682
  }
5683
5683
  }
5684
- if (!cachedNodeRequire) {
5684
+ if (!cachedNodeRequire$1) {
5685
5685
  return null;
5686
5686
  }
5687
5687
  try {
5688
- const resolved = cachedNodeRequire.resolve(specifier);
5688
+ const resolved = cachedNodeRequire$1.resolve(specifier);
5689
5689
  if (!cachedPathToFileURL) {
5690
5690
  const { pathToFileURL } = (await import('node:url'));
5691
5691
  cachedPathToFileURL = pathToFileURL;
@@ -15671,12 +15671,12 @@
15671
15671
  // --- END ENV SHIM ---
15672
15672
 
15673
15673
  // This file is auto-generated during build - do not edit manually
15674
- // Generated from package.json version: 0.3.5-test.913
15674
+ // Generated from package.json version: 0.3.5-test.914
15675
15675
  /**
15676
15676
  * The package version, injected at build time.
15677
15677
  * @internal
15678
15678
  */
15679
- const VERSION$1 = '0.3.5-test.913';
15679
+ const VERSION$1 = '0.3.5-test.914';
15680
15680
 
15681
15681
  /**
15682
15682
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -27725,47 +27725,51 @@
27725
27725
  return undefined;
27726
27726
  }
27727
27727
  })();
27728
- // Shared flag that allows synchronous waiting for the Node-specific require shim
27729
- const requireReadyFlag = isNode && typeof SharedArrayBuffer !== 'undefined'
27730
- ? new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))
27731
- : null;
27732
- if (requireReadyFlag) {
27733
- // 0 means initializing, 1 means ready (success or failure)
27734
- Atomics.store(requireReadyFlag, 0, 0);
27735
- // Prepare a CommonJS-style require when running in pure ESM contexts
27736
- void (async () => {
27737
- try {
27738
- if (typeof require !== 'function') {
27739
- const moduleNamespace = (await Promise.resolve().then(function () { return _nodeResolve_empty; }));
27740
- const createRequire = moduleNamespace.createRequire;
27741
- if (typeof createRequire === 'function') {
27742
- const fallbackPath = `${process.cwd()}/.__naylence_require_shim__.mjs`;
27743
- const nodeRequire = createRequire(currentModuleUrl ?? fallbackPath);
27744
- globalThis.require = nodeRequire;
27745
- }
27746
- }
27728
+ let cachedNodeRequire = typeof require === 'function' ? require : null;
27729
+ function fileUrlToPath(url) {
27730
+ try {
27731
+ const parsed = new URL(url);
27732
+ if (parsed.protocol !== 'file:') {
27733
+ return null;
27747
27734
  }
27748
- catch {
27749
- // Ignore failures getFsModule will surface a helpful error when needed
27750
- }
27751
- })()
27752
- .catch(() => {
27753
- // Ignore async errors – the ready flag will still unblock consumers
27754
- })
27755
- .finally(() => {
27756
- Atomics.store(requireReadyFlag, 0, 1);
27757
- Atomics.notify(requireReadyFlag, 0);
27758
- });
27735
+ let pathname = parsed.pathname;
27736
+ if (typeof process !== 'undefined' &&
27737
+ process.platform === 'win32' &&
27738
+ pathname.startsWith('/')) {
27739
+ pathname = pathname.slice(1);
27740
+ }
27741
+ return decodeURIComponent(pathname);
27742
+ }
27743
+ catch {
27744
+ return null;
27745
+ }
27759
27746
  }
27760
- function ensureRequireReady() {
27761
- if (!requireReadyFlag) {
27762
- return;
27747
+ function getNodeRequire() {
27748
+ if (cachedNodeRequire) {
27749
+ return cachedNodeRequire;
27763
27750
  }
27764
- if (Atomics.load(requireReadyFlag, 0) === 1) {
27765
- return;
27751
+ if (!isNode) {
27752
+ return null;
27753
+ }
27754
+ const processBinding = process.binding;
27755
+ if (typeof processBinding !== 'function') {
27756
+ return null;
27757
+ }
27758
+ try {
27759
+ const moduleWrap = processBinding('module_wrap');
27760
+ if (typeof moduleWrap?.createRequire !== 'function') {
27761
+ return null;
27762
+ }
27763
+ const modulePathFromUrl = currentModuleUrl
27764
+ ? fileUrlToPath(currentModuleUrl)
27765
+ : null;
27766
+ const requireSource = modulePathFromUrl ?? `${process.cwd()}/.naylence-require-shim.js`;
27767
+ cachedNodeRequire = moduleWrap.createRequire(requireSource);
27768
+ return cachedNodeRequire;
27769
+ }
27770
+ catch {
27771
+ return null;
27766
27772
  }
27767
- // Block until the asynchronous loader finishes initialising
27768
- Atomics.wait(requireReadyFlag, 0, 0);
27769
27773
  }
27770
27774
  function getFsModule() {
27771
27775
  if (cachedFsModule) {
@@ -27774,10 +27778,10 @@
27774
27778
  if (!isNode) {
27775
27779
  throw new Error('File system access is not available in this environment');
27776
27780
  }
27777
- ensureRequireReady();
27778
- if (typeof require === 'function') {
27781
+ const nodeRequire = typeof require === 'function' ? require : getNodeRequire();
27782
+ if (nodeRequire) {
27779
27783
  try {
27780
- cachedFsModule = require(fsModuleSpecifier);
27784
+ cachedFsModule = nodeRequire(fsModuleSpecifier);
27781
27785
  return cachedFsModule;
27782
27786
  }
27783
27787
  catch (error) {