@rivet-dev/agentos-browser 0.0.0-nathan-agentos-combined.e833bb7 → 0.2.0

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/driver.d.ts CHANGED
@@ -102,8 +102,11 @@ export interface BrowserDriverOptions {
102
102
  * subdirectory (F-015); pass `namespace` to use a stable, persistent namespace.
103
103
  */
104
104
  export declare function createOpfsFileSystem(namespace?: string): Promise<VirtualFileSystem>;
105
+ export interface BrowserNetworkAdapterOptions {
106
+ fetch?: typeof fetch;
107
+ }
105
108
  /** Network adapter that delegates to the browser's native `fetch`. DNS and http2 are unsupported. */
106
- export declare function createBrowserNetworkAdapter(): NetworkAdapter;
109
+ export declare function createBrowserNetworkAdapter(options?: BrowserNetworkAdapterOptions): NetworkAdapter;
107
110
  /** Recover runtime-driver options from a browser SystemDriver instance. */
108
111
  export declare function getBrowserSystemDriverOptions(systemDriver: SystemDriver): BrowserRuntimeSystemOptions;
109
112
  /** Assemble a browser-side SystemDriver with permission-wrapped adapters. */
package/dist/driver.js CHANGED
@@ -364,11 +364,13 @@ export async function createOpfsFileSystem(namespace) {
364
364
  return new OpfsFileSystem(namespace);
365
365
  }
366
366
  /** Network adapter that delegates to the browser's native `fetch`. DNS and http2 are unsupported. */
367
- export function createBrowserNetworkAdapter() {
367
+ export function createBrowserNetworkAdapter(options = {}) {
368
368
  // Use the reference captured at module load (platformFetch) so the gated
369
369
  // adapter keeps working after worker.ts shadows the guest-visible `fetch`
370
370
  // global (F-012). Fall back to the current global only if none was captured.
371
- const fetchImpl = platformFetch ?? ((...args) => fetch(...args));
371
+ const fetchImpl = options.fetch ??
372
+ platformFetch ??
373
+ ((...args) => fetch(...args));
372
374
  return {
373
375
  async fetch(url, options) {
374
376
  const response = await fetchImpl(url, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivet-dev/agentos-browser",
3
- "version": "0.0.0-nathan-agentos-combined.e833bb7",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",