@nanobpm/nano-agent-graph-engine 0.0.0-stage → 0.17.1
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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +21 -0
- package/.mcp.json +8 -0
- package/README.md +525 -2
- package/dist/cli.js +55815 -0
- package/dist/explorer-app.html +196 -0
- package/dist/explorer.html +196 -0
- package/dist/guide.md +147 -0
- package/dist/index.js +1256 -0
- package/dist/layout-thread.js +12806 -0
- package/dist/nanobpmn_engine_bg.wasm +0 -0
- package/dist/step-thread.js +55 -0
- package/dist/typecheck/agent-graph-engine/agents.d.ts +120 -0
- package/dist/typecheck/agent-graph-engine/index.d.ts +124 -0
- package/dist/typecheck/agent-graph-engine/input.d.ts +57 -0
- package/dist/typecheck/agent-graph-engine/paths.d.ts +35 -0
- package/dist/typecheck/lib.decorators.d.ts +384 -0
- package/dist/typecheck/lib.decorators.legacy.d.ts +22 -0
- package/dist/typecheck/lib.es2015.collection.d.ts +147 -0
- package/dist/typecheck/lib.es2015.core.d.ts +597 -0
- package/dist/typecheck/lib.es2015.d.ts +28 -0
- package/dist/typecheck/lib.es2015.generator.d.ts +77 -0
- package/dist/typecheck/lib.es2015.iterable.d.ts +605 -0
- package/dist/typecheck/lib.es2015.promise.d.ts +81 -0
- package/dist/typecheck/lib.es2015.proxy.d.ts +128 -0
- package/dist/typecheck/lib.es2015.reflect.d.ts +144 -0
- package/dist/typecheck/lib.es2015.symbol.d.ts +46 -0
- package/dist/typecheck/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/dist/typecheck/lib.es2016.array.include.d.ts +116 -0
- package/dist/typecheck/lib.es2016.d.ts +21 -0
- package/dist/typecheck/lib.es2016.full.d.ts +23 -0
- package/dist/typecheck/lib.es2016.intl.d.ts +31 -0
- package/dist/typecheck/lib.es2017.arraybuffer.d.ts +21 -0
- package/dist/typecheck/lib.es2017.d.ts +26 -0
- package/dist/typecheck/lib.es2017.date.d.ts +31 -0
- package/dist/typecheck/lib.es2017.full.d.ts +23 -0
- package/dist/typecheck/lib.es2017.intl.d.ts +44 -0
- package/dist/typecheck/lib.es2017.object.d.ts +49 -0
- package/dist/typecheck/lib.es2017.sharedmemory.d.ts +135 -0
- package/dist/typecheck/lib.es2017.string.d.ts +45 -0
- package/dist/typecheck/lib.es2017.typedarrays.d.ts +53 -0
- package/dist/typecheck/lib.es2018.asyncgenerator.d.ts +77 -0
- package/dist/typecheck/lib.es2018.asynciterable.d.ts +53 -0
- package/dist/typecheck/lib.es2018.d.ts +24 -0
- package/dist/typecheck/lib.es2018.full.d.ts +24 -0
- package/dist/typecheck/lib.es2018.intl.d.ts +83 -0
- package/dist/typecheck/lib.es2018.promise.d.ts +30 -0
- package/dist/typecheck/lib.es2018.regexp.d.ts +37 -0
- package/dist/typecheck/lib.es2019.array.d.ts +79 -0
- package/dist/typecheck/lib.es2019.d.ts +24 -0
- package/dist/typecheck/lib.es2019.full.d.ts +24 -0
- package/dist/typecheck/lib.es2019.intl.d.ts +23 -0
- package/dist/typecheck/lib.es2019.object.d.ts +33 -0
- package/dist/typecheck/lib.es2019.string.d.ts +37 -0
- package/dist/typecheck/lib.es2019.symbol.d.ts +24 -0
- package/dist/typecheck/lib.es2020.bigint.d.ts +765 -0
- package/dist/typecheck/lib.es2020.d.ts +27 -0
- package/dist/typecheck/lib.es2020.date.d.ts +42 -0
- package/dist/typecheck/lib.es2020.full.d.ts +24 -0
- package/dist/typecheck/lib.es2020.intl.d.ts +474 -0
- package/dist/typecheck/lib.es2020.number.d.ts +28 -0
- package/dist/typecheck/lib.es2020.promise.d.ts +47 -0
- package/dist/typecheck/lib.es2020.sharedmemory.d.ts +99 -0
- package/dist/typecheck/lib.es2020.string.d.ts +44 -0
- package/dist/typecheck/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/dist/typecheck/lib.es2021.d.ts +23 -0
- package/dist/typecheck/lib.es2021.full.d.ts +24 -0
- package/dist/typecheck/lib.es2021.intl.d.ts +166 -0
- package/dist/typecheck/lib.es2021.promise.d.ts +48 -0
- package/dist/typecheck/lib.es2021.string.d.ts +33 -0
- package/dist/typecheck/lib.es2021.weakref.d.ts +78 -0
- package/dist/typecheck/lib.es2022.array.d.ts +121 -0
- package/dist/typecheck/lib.es2022.d.ts +25 -0
- package/dist/typecheck/lib.es2022.error.d.ts +75 -0
- package/dist/typecheck/lib.es2022.full.d.ts +24 -0
- package/dist/typecheck/lib.es2022.intl.d.ts +145 -0
- package/dist/typecheck/lib.es2022.object.d.ts +26 -0
- package/dist/typecheck/lib.es2022.regexp.d.ts +39 -0
- package/dist/typecheck/lib.es2022.string.d.ts +25 -0
- package/dist/typecheck/lib.es2023.array.d.ts +924 -0
- package/dist/typecheck/lib.es2023.collection.d.ts +21 -0
- package/dist/typecheck/lib.es2023.d.ts +22 -0
- package/dist/typecheck/lib.es2023.full.d.ts +24 -0
- package/dist/typecheck/lib.es2023.intl.d.ts +56 -0
- package/dist/typecheck/lib.es2024.arraybuffer.d.ts +65 -0
- package/dist/typecheck/lib.es2024.collection.d.ts +29 -0
- package/dist/typecheck/lib.es2024.d.ts +26 -0
- package/dist/typecheck/lib.es2024.full.d.ts +24 -0
- package/dist/typecheck/lib.es2024.object.d.ts +29 -0
- package/dist/typecheck/lib.es2024.promise.d.ts +35 -0
- package/dist/typecheck/lib.es2024.regexp.d.ts +25 -0
- package/dist/typecheck/lib.es2024.sharedmemory.d.ts +68 -0
- package/dist/typecheck/lib.es2024.string.d.ts +29 -0
- package/dist/typecheck/lib.es5.d.ts +4601 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/client.d.ts +169 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/declarative.d.ts +366 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/envelope.d.ts +77 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/imperative.d.ts +32 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/index.d.ts +14 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/io-mapping.d.ts +32 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/layout.d.ts +22 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/boundary.d.ts +63 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/branch.d.ts +11 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/break.d.ts +8 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/continue.d.ts +8 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/end.d.ts +40 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/forEach.d.ts +24 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/human.d.ts +44 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/index.d.ts +15 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/loop.d.ts +9 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/parallel.d.ts +9 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/race.d.ts +54 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/registry.d.ts +33 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/run.d.ts +12 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/signal.d.ts +11 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/switch.d.ts +11 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/task.d.ts +82 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/nodes/timer.d.ts +9 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/diff.d.ts +8 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/index.d.ts +8 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/normalize.d.ts +19 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/parity.d.ts +28 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/test-support/xml.d.ts +17 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/types.d.ts +146 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/worker.d.ts +92 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/dist/xml.d.ts +14 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/package.json +65 -0
- package/dist/typecheck/node_modules/@nanobpm/workflow/src/bpmn-auto-layout.d.ts +10 -0
- package/dist/typecheck/node_modules/@types/node/assert/strict.d.ts +68 -0
- package/dist/typecheck/node_modules/@types/node/assert.d.ts +1077 -0
- package/dist/typecheck/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/dist/typecheck/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/dist/typecheck/node_modules/@types/node/buffer.d.ts +1800 -0
- package/dist/typecheck/node_modules/@types/node/child_process.d.ts +1361 -0
- package/dist/typecheck/node_modules/@types/node/cluster.d.ts +432 -0
- package/dist/typecheck/node_modules/@types/node/console.d.ts +93 -0
- package/dist/typecheck/node_modules/@types/node/constants.d.ts +14 -0
- package/dist/typecheck/node_modules/@types/node/crypto.d.ts +3964 -0
- package/dist/typecheck/node_modules/@types/node/dgram.d.ts +652 -0
- package/dist/typecheck/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
- package/dist/typecheck/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/dist/typecheck/node_modules/@types/node/dns.d.ts +876 -0
- package/dist/typecheck/node_modules/@types/node/domain.d.ts +150 -0
- package/dist/typecheck/node_modules/@types/node/events.d.ts +1008 -0
- package/dist/typecheck/node_modules/@types/node/ffi.d.ts +500 -0
- package/dist/typecheck/node_modules/@types/node/fs/promises.d.ts +1477 -0
- package/dist/typecheck/node_modules/@types/node/fs.d.ts +4803 -0
- package/dist/typecheck/node_modules/@types/node/globals.d.ts +150 -0
- package/dist/typecheck/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/dist/typecheck/node_modules/@types/node/http.d.ts +2218 -0
- package/dist/typecheck/node_modules/@types/node/http2.d.ts +2498 -0
- package/dist/typecheck/node_modules/@types/node/https.d.ts +400 -0
- package/dist/typecheck/node_modules/@types/node/index.d.ts +116 -0
- package/dist/typecheck/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/dist/typecheck/node_modules/@types/node/inspector.d.ts +265 -0
- package/dist/typecheck/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/dist/typecheck/node_modules/@types/node/module.d.ts +726 -0
- package/dist/typecheck/node_modules/@types/node/net.d.ts +1074 -0
- package/dist/typecheck/node_modules/@types/node/os.d.ts +498 -0
- package/dist/typecheck/node_modules/@types/node/package.json +140 -0
- package/dist/typecheck/node_modules/@types/node/path/posix.d.ts +8 -0
- package/dist/typecheck/node_modules/@types/node/path/win32.d.ts +8 -0
- package/dist/typecheck/node_modules/@types/node/path.d.ts +178 -0
- package/dist/typecheck/node_modules/@types/node/perf_hooks.d.ts +617 -0
- package/dist/typecheck/node_modules/@types/node/process.d.ts +2269 -0
- package/dist/typecheck/node_modules/@types/node/punycode.d.ts +89 -0
- package/dist/typecheck/node_modules/@types/node/querystring.d.ts +139 -0
- package/dist/typecheck/node_modules/@types/node/quic.d.ts +2191 -0
- package/dist/typecheck/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/dist/typecheck/node_modules/@types/node/readline.d.ts +508 -0
- package/dist/typecheck/node_modules/@types/node/repl.d.ts +420 -0
- package/dist/typecheck/node_modules/@types/node/sea.d.ts +47 -0
- package/dist/typecheck/node_modules/@types/node/sqlite.d.ts +1140 -0
- package/dist/typecheck/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/dist/typecheck/node_modules/@types/node/stream/iter.d.ts +449 -0
- package/dist/typecheck/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/dist/typecheck/node_modules/@types/node/stream/web.d.ts +320 -0
- package/dist/typecheck/node_modules/@types/node/stream.d.ts +1806 -0
- package/dist/typecheck/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/dist/typecheck/node_modules/@types/node/test/reporters.d.ts +60 -0
- package/dist/typecheck/node_modules/@types/node/test.d.ts +2558 -0
- package/dist/typecheck/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/dist/typecheck/node_modules/@types/node/timers.d.ts +149 -0
- package/dist/typecheck/node_modules/@types/node/tls.d.ts +1232 -0
- package/dist/typecheck/node_modules/@types/node/trace_events.d.ts +103 -0
- package/dist/typecheck/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +467 -0
- package/dist/typecheck/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/dist/typecheck/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/dist/typecheck/node_modules/@types/node/ts5.6/index.d.ts +118 -0
- package/dist/typecheck/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/dist/typecheck/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/dist/typecheck/node_modules/@types/node/tty.d.ts +226 -0
- package/dist/typecheck/node_modules/@types/node/url.d.ts +556 -0
- package/dist/typecheck/node_modules/@types/node/util/types.d.ts +558 -0
- package/dist/typecheck/node_modules/@types/node/util.d.ts +1680 -0
- package/dist/typecheck/node_modules/@types/node/v8.d.ts +1059 -0
- package/dist/typecheck/node_modules/@types/node/vfs.d.ts +211 -0
- package/dist/typecheck/node_modules/@types/node/vm.d.ts +1137 -0
- package/dist/typecheck/node_modules/@types/node/wasi.d.ts +131 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/streams.d.ts +119 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/dist/typecheck/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/dist/typecheck/node_modules/@types/node/worker_threads.d.ts +672 -0
- package/dist/typecheck/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/dist/typecheck/node_modules/@types/node/zlib.d.ts +1364 -0
- package/dist/typecheck/node_modules/undici-types/agent.d.ts +30 -0
- package/dist/typecheck/node_modules/undici-types/api.d.ts +43 -0
- package/dist/typecheck/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/dist/typecheck/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/dist/typecheck/node_modules/undici-types/cache.d.ts +36 -0
- package/dist/typecheck/node_modules/undici-types/client-stats.d.ts +15 -0
- package/dist/typecheck/node_modules/undici-types/client.d.ts +134 -0
- package/dist/typecheck/node_modules/undici-types/connector.d.ts +37 -0
- package/dist/typecheck/node_modules/undici-types/content-type.d.ts +21 -0
- package/dist/typecheck/node_modules/undici-types/cookies.d.ts +30 -0
- package/dist/typecheck/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/dist/typecheck/node_modules/undici-types/dispatcher.d.ts +253 -0
- package/dist/typecheck/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/dist/typecheck/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/dist/typecheck/node_modules/undici-types/errors.d.ts +187 -0
- package/dist/typecheck/node_modules/undici-types/eventsource.d.ts +66 -0
- package/dist/typecheck/node_modules/undici-types/fetch.d.ts +235 -0
- package/dist/typecheck/node_modules/undici-types/formdata.d.ts +108 -0
- package/dist/typecheck/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/dist/typecheck/node_modules/undici-types/global-origin.d.ts +7 -0
- package/dist/typecheck/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/dist/typecheck/node_modules/undici-types/handlers.d.ts +16 -0
- package/dist/typecheck/node_modules/undici-types/header.d.ts +165 -0
- package/dist/typecheck/node_modules/undici-types/index.d.ts +93 -0
- package/dist/typecheck/node_modules/undici-types/interceptors.d.ts +80 -0
- package/dist/typecheck/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/dist/typecheck/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/dist/typecheck/node_modules/undici-types/mock-client.d.ts +27 -0
- package/dist/typecheck/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/dist/typecheck/node_modules/undici-types/mock-interceptor.d.ts +98 -0
- package/dist/typecheck/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/dist/typecheck/node_modules/undici-types/package.json +55 -0
- package/dist/typecheck/node_modules/undici-types/patch.d.ts +29 -0
- package/dist/typecheck/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/dist/typecheck/node_modules/undici-types/pool.d.ts +39 -0
- package/dist/typecheck/node_modules/undici-types/proxy-agent.d.ts +36 -0
- package/dist/typecheck/node_modules/undici-types/readable.d.ts +68 -0
- package/dist/typecheck/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/dist/typecheck/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/dist/typecheck/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/dist/typecheck/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/dist/typecheck/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/dist/typecheck/node_modules/undici-types/util.d.ts +18 -0
- package/dist/typecheck/node_modules/undici-types/utility.d.ts +7 -0
- package/dist/typecheck/node_modules/undici-types/webidl.d.ts +346 -0
- package/dist/typecheck/node_modules/undici-types/websocket.d.ts +188 -0
- package/dist/typecheck/ts.cjs +446 -0
- package/hooks/hooks.json +30 -0
- package/hooks/mod.js +461 -0
- package/package.json +80 -4
- package/skills/agent-graph/SKILL.md +47 -0
- package/skills/agent-graph-authoring/SKILL.md +147 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
declare module "node:vfs" {
|
|
2
|
+
/**
|
|
3
|
+
* Convenience factory equivalent to `new VirtualFileSystem(provider, options)`.
|
|
4
|
+
*
|
|
5
|
+
* ```js
|
|
6
|
+
* const vfs = require('node:vfs');
|
|
7
|
+
*
|
|
8
|
+
* // Default in-memory provider
|
|
9
|
+
* const memoryVfs = vfs.create();
|
|
10
|
+
*
|
|
11
|
+
* // Explicit provider
|
|
12
|
+
* const realVfs = vfs.create(new vfs.RealFSProvider('/tmp/sandbox'));
|
|
13
|
+
* ```
|
|
14
|
+
* @since v26.4.0
|
|
15
|
+
* @param provider The provider to use. **Default:** `new MemoryProvider()`.
|
|
16
|
+
*/
|
|
17
|
+
function create(provider?: VirtualProvider, options?: VirtualFileSystemOptions): VirtualFileSystem;
|
|
18
|
+
function create(options: VirtualFileSystemOptions): VirtualFileSystem;
|
|
19
|
+
interface VirtualFileSystemOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Whether to emit the experimental warning. **Default:** `true`.
|
|
22
|
+
*/
|
|
23
|
+
emitExperimentalWarning?: boolean | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A `VirtualFileSystem` wraps a {@link VirtualProvider} and exposes a
|
|
27
|
+
* `node:fs`-like API. Each instance maintains its own file tree.
|
|
28
|
+
* @since v26.4.0
|
|
29
|
+
*/
|
|
30
|
+
class VirtualFileSystem {
|
|
31
|
+
/**
|
|
32
|
+
* @param provider The provider to use. **Default:** `new MemoryProvider()`.
|
|
33
|
+
*/
|
|
34
|
+
constructor(provider?: VirtualProvider, options?: VirtualFileSystemOptions);
|
|
35
|
+
constructor(options: VirtualFileSystemOptions);
|
|
36
|
+
/**
|
|
37
|
+
* The provider backing this VFS instance.
|
|
38
|
+
* @since v26.4.0
|
|
39
|
+
*/
|
|
40
|
+
readonly provider: VirtualProvider;
|
|
41
|
+
/**
|
|
42
|
+
* `true` when the underlying provider is read-only.
|
|
43
|
+
* @since v26.4.0
|
|
44
|
+
*/
|
|
45
|
+
readonly readonly: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface VirtualFileSystem extends
|
|
48
|
+
// Synchronous API
|
|
49
|
+
Pick<
|
|
50
|
+
typeof import("node:fs"),
|
|
51
|
+
| "existsSync"
|
|
52
|
+
| "statSync"
|
|
53
|
+
| "lstatSync"
|
|
54
|
+
| "readFileSync"
|
|
55
|
+
| "writeFileSync"
|
|
56
|
+
| "appendFileSync"
|
|
57
|
+
| "readdirSync"
|
|
58
|
+
| "mkdirSync"
|
|
59
|
+
| "rmdirSync"
|
|
60
|
+
| "unlinkSync"
|
|
61
|
+
| "renameSync"
|
|
62
|
+
| "copyFileSync"
|
|
63
|
+
| "realpathSync"
|
|
64
|
+
| "readlinkSync"
|
|
65
|
+
| "symlinkSync"
|
|
66
|
+
| "accessSync"
|
|
67
|
+
| "rmSync"
|
|
68
|
+
| "truncateSync"
|
|
69
|
+
| "ftruncateSync"
|
|
70
|
+
| "linkSync"
|
|
71
|
+
| "chmodSync"
|
|
72
|
+
| "chownSync"
|
|
73
|
+
| "utimesSync"
|
|
74
|
+
| "lutimesSync"
|
|
75
|
+
| "mkdtempSync"
|
|
76
|
+
| "opendirSync"
|
|
77
|
+
| "openAsBlob"
|
|
78
|
+
| "openSync"
|
|
79
|
+
| "closeSync"
|
|
80
|
+
| "readSync"
|
|
81
|
+
| "writeSync"
|
|
82
|
+
| "fstatSync"
|
|
83
|
+
| "createReadStream"
|
|
84
|
+
| "createWriteStream"
|
|
85
|
+
| "watch"
|
|
86
|
+
| "watchFile"
|
|
87
|
+
| "unwatchFile"
|
|
88
|
+
>,
|
|
89
|
+
// Callback API
|
|
90
|
+
Pick<
|
|
91
|
+
typeof import("node:fs"),
|
|
92
|
+
| "readFile"
|
|
93
|
+
| "writeFile"
|
|
94
|
+
| "stat"
|
|
95
|
+
| "lstat"
|
|
96
|
+
| "readdir"
|
|
97
|
+
| "realpath"
|
|
98
|
+
| "readlink"
|
|
99
|
+
| "access"
|
|
100
|
+
| "open"
|
|
101
|
+
| "close"
|
|
102
|
+
| "read"
|
|
103
|
+
| "write"
|
|
104
|
+
| "rm"
|
|
105
|
+
| "fstat"
|
|
106
|
+
| "truncate"
|
|
107
|
+
| "ftruncate"
|
|
108
|
+
| "link"
|
|
109
|
+
| "mkdtemp"
|
|
110
|
+
| "opendir"
|
|
111
|
+
>
|
|
112
|
+
{
|
|
113
|
+
// Promise API
|
|
114
|
+
readonly promises: Pick<
|
|
115
|
+
typeof import("node:fs/promises"),
|
|
116
|
+
| "readFile"
|
|
117
|
+
| "writeFile"
|
|
118
|
+
| "appendFile"
|
|
119
|
+
| "stat"
|
|
120
|
+
| "lstat"
|
|
121
|
+
| "readdir"
|
|
122
|
+
| "mkdir"
|
|
123
|
+
| "rmdir"
|
|
124
|
+
| "unlink"
|
|
125
|
+
| "rename"
|
|
126
|
+
| "copyFile"
|
|
127
|
+
| "realpath"
|
|
128
|
+
| "readlink"
|
|
129
|
+
| "symlink"
|
|
130
|
+
| "access"
|
|
131
|
+
| "rm"
|
|
132
|
+
| "truncate"
|
|
133
|
+
| "link"
|
|
134
|
+
| "mkdtemp"
|
|
135
|
+
| "chmod"
|
|
136
|
+
| "chown"
|
|
137
|
+
| "lchown"
|
|
138
|
+
| "utimes"
|
|
139
|
+
| "lutimes"
|
|
140
|
+
| "open"
|
|
141
|
+
| "lchmod"
|
|
142
|
+
| "watch"
|
|
143
|
+
>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The base class for all VFS providers. Subclasses implement the essential
|
|
147
|
+
* primitives (such as `open`, `stat`, `readdir`, `mkdir`, `rmdir`, `unlink`,
|
|
148
|
+
* `rename`, etc.) and inherit default implementations of the derived
|
|
149
|
+
* methods (such as `readFile`, `writeFile`, `exists`, `copyFile`, `access`, etc.).
|
|
150
|
+
* @since v26.4.0
|
|
151
|
+
*/
|
|
152
|
+
abstract class VirtualProvider {
|
|
153
|
+
get readonly(): boolean;
|
|
154
|
+
get supportsSymlinks(): boolean;
|
|
155
|
+
get supportsWatch(): boolean;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The default in-memory provider. Stores files, directories, and symbolic
|
|
159
|
+
* links in a `Map`-backed tree, supports symlinks (`supportsSymlinks ===
|
|
160
|
+
* true`), and supports watching (`supportsWatch === true`).
|
|
161
|
+
* @since v26.4.0
|
|
162
|
+
*/
|
|
163
|
+
class MemoryProvider extends VirtualProvider {
|
|
164
|
+
/**
|
|
165
|
+
* Locks the provider into read-only mode. Subsequent writes through any
|
|
166
|
+
* `VirtualFileSystem` using this provider throw `EROFS`. There is no
|
|
167
|
+
* way to revert the provider to writable.
|
|
168
|
+
*
|
|
169
|
+
* ```js
|
|
170
|
+
* const vfs = require('node:vfs');
|
|
171
|
+
*
|
|
172
|
+
* const provider = new vfs.MemoryProvider();
|
|
173
|
+
* const myVfs = vfs.create(provider);
|
|
174
|
+
* myVfs.writeFileSync('/seed.txt', 'initial');
|
|
175
|
+
*
|
|
176
|
+
* provider.setReadOnly();
|
|
177
|
+
*
|
|
178
|
+
* myVfs.writeFileSync('/x.txt', 'fail'); // throws EROFS
|
|
179
|
+
* ```
|
|
180
|
+
* @since v26.4.0
|
|
181
|
+
*/
|
|
182
|
+
setReadOnly(): void;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* A provider that wraps a directory (i.e. one on the actual file system) and
|
|
186
|
+
* exposes its contents through the VFS API. All VFS paths are resolved relative to
|
|
187
|
+
* the root and verified to stay inside it; symbolic links resolving outside the
|
|
188
|
+
* root are rejected. This path mapping is not a sandbox or access-control
|
|
189
|
+
* mechanism.
|
|
190
|
+
* @since v26.4.0
|
|
191
|
+
*/
|
|
192
|
+
class RealFSProvider extends VirtualProvider {
|
|
193
|
+
/**
|
|
194
|
+
* ```js
|
|
195
|
+
* const vfs = require('node:vfs');
|
|
196
|
+
*
|
|
197
|
+
* const realVfs = vfs.create(new vfs.RealFSProvider('/tmp/vfs-root'));
|
|
198
|
+
* realVfs.writeFileSync('/file.txt', 'hello'); // writes /tmp/vfs-root/file.txt
|
|
199
|
+
* ```
|
|
200
|
+
* @since v26.4.0
|
|
201
|
+
* @param rootPath The absolute file-system path to use as the root.
|
|
202
|
+
* Must be a non-empty string.
|
|
203
|
+
*/
|
|
204
|
+
constructor(rootPath: string);
|
|
205
|
+
/**
|
|
206
|
+
* The resolved absolute path used as the root.
|
|
207
|
+
* @since v26.4.0
|
|
208
|
+
*/
|
|
209
|
+
readonly rootPath: string;
|
|
210
|
+
}
|
|
211
|
+
}
|