@ai-ecoverse/slicc-kernel 1.111.0 → 1.112.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.
@@ -2515,7 +2515,7 @@ var KERNEL_VERSION, OS_RELEASE;
2515
2515
  var init_version = __esm({
2516
2516
  "src/version.ts"() {
2517
2517
  "use strict";
2518
- KERNEL_VERSION = true ? "1.111.0" : "0.0.0-dev";
2518
+ KERNEL_VERSION = true ? "1.112.0" : "0.0.0-dev";
2519
2519
  OS_RELEASE = "6.0.0-slicc";
2520
2520
  }
2521
2521
  });
@@ -0,0 +1,5 @@
1
+ import type { KernelFs } from '../../fs/types.js';
2
+ export type HostsTable = ReadonlyMap<string, readonly string[]>;
3
+ export declare const HOSTS_PATH = "/etc/hosts";
4
+ export declare function parseHosts(text: string): HostsTable;
5
+ export declare function hostsReader(fs: Pick<KernelFs, 'stat' | 'readFile'>, path?: string): () => Promise<HostsTable | undefined>;
@@ -1,3 +1,4 @@
1
+ import type { HostsTable } from './hosts-file.js';
1
2
  import { type Routes } from './routes.js';
2
3
  import { type NetworkUplink, type ResolveFamily } from './uplink.js';
3
4
  export declare const RESOLVE_TTL_MAX = 60;
@@ -10,6 +11,7 @@ export interface ResolverOptions {
10
11
  timeoutMs?: number;
11
12
  log?: (message: string) => void;
12
13
  hostname?: string;
14
+ hosts?: () => Promise<HostsTable | undefined>;
13
15
  }
14
16
  export declare function hostsEntry(name: string, own?: readonly string[]): string | undefined;
15
17
  export declare class Resolver {
@@ -21,7 +23,9 @@ export declare class Resolver {
21
23
  private readonly own;
22
24
  private readonly cache;
23
25
  private readonly pending;
26
+ private readonly hosts;
24
27
  constructor(options: ResolverOptions);
28
+ private fromFile;
25
29
  resolve(name: string, family: ResolveFamily, blocking?: () => AbortSignal): Promise<string[]>;
26
30
  private lookup;
27
31
  private usable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-kernel",
3
- "version": "1.111.0",
3
+ "version": "1.112.0",
4
4
  "description": "SLICC's wasm-realm kernel: run Emscripten programs in the browser against OPFS, with fork, spawn, pipes and waitpid",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",