nuxt-ai-ready 2.5.2 → 3.0.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/README.md +13 -12
- package/dist/chunks/agent-skills.mjs +35 -12
- package/dist/chunks/prerender.mjs +35 -24
- package/dist/cli.mjs +5 -2
- package/dist/module.d.mts +4 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +8 -4
- package/dist/runtime/app/index.d.ts +3 -0
- package/dist/runtime/app/index.js +2 -0
- package/dist/runtime/cache-control.d.ts +2 -0
- package/dist/runtime/cache-control.js +11 -0
- package/dist/runtime/llms-txt-utils.js +1 -1
- package/dist/runtime/server/db/context.d.ts +13 -0
- package/dist/runtime/server/db/drizzle/client.d.ts +6 -7
- package/dist/runtime/server/db/drizzle/client.js +13 -2
- package/dist/runtime/server/db/drizzle/providers/bun.d.ts +2 -2
- package/dist/runtime/server/db/drizzle/providers/bun.js +2 -2
- package/dist/runtime/server/db/drizzle/providers/d1.d.ts +2 -2
- package/dist/runtime/server/db/drizzle/providers/d1.js +3 -2
- package/dist/runtime/server/db/drizzle/providers/libsql.d.ts +2 -2
- package/dist/runtime/server/db/drizzle/providers/libsql.js +2 -2
- package/dist/runtime/server/db/drizzle/providers/neon.d.ts +2 -2
- package/dist/runtime/server/db/drizzle/providers/neon.js +2 -2
- package/dist/runtime/server/db/drizzle/providers/node-sqlite.d.ts +2 -2
- package/dist/runtime/server/db/drizzle/providers/node-sqlite.js +2 -2
- package/dist/runtime/server/db/drizzle/providers/postgres.d.ts +2 -2
- package/dist/runtime/server/db/drizzle/providers/postgres.js +2 -2
- package/dist/runtime/server/db/drizzle/queries.d.ts +27 -27
- package/dist/runtime/server/db/drizzle/queries.js +6 -5
- package/dist/runtime/server/db/drizzle/raw.d.ts +2 -6
- package/dist/runtime/server/db/index.d.ts +1 -1
- package/dist/runtime/server/db/index.js +1 -1
- package/dist/runtime/server/db/queries.d.ts +36 -36
- package/dist/runtime/server/db/queries.js +8 -9
- package/dist/runtime/server/db/seed.d.ts +2 -2
- package/dist/runtime/server/db/seed.js +4 -3
- package/dist/runtime/server/db/shared.d.ts +8 -0
- package/dist/runtime/server/db/shared.js +8 -2
- package/dist/runtime/server/index.d.ts +2 -0
- package/dist/runtime/server/index.js +17 -0
- package/dist/runtime/server/mcp/tools/get-page-markdown.js +1 -1
- package/dist/runtime/server/mcp/tools/list-pages.js +1 -1
- package/dist/runtime/server/mcp/tools/search-pages.js +1 -1
- package/dist/runtime/server/middleware/markdown.js +3 -3
- package/dist/runtime/server/middleware/markdown.prerender.js +1 -1
- package/dist/runtime/server/plugins/db-lifecycle-nitro3.d.ts +2 -0
- package/dist/runtime/server/plugins/db-lifecycle-nitro3.js +16 -0
- package/dist/runtime/server/plugins/html-capture.prerender.js +6 -4
- package/dist/runtime/server/plugins/link-header-nitro3.d.ts +2 -0
- package/dist/runtime/server/plugins/link-header-nitro3.js +20 -0
- package/dist/runtime/server/plugins/link-header.d.ts +6 -0
- package/dist/runtime/server/plugins/link-header.js +7 -11
- package/dist/runtime/server/plugins/markdown-negotiation.js +8 -1
- package/dist/runtime/server/plugins/sitemap-seeder.js +3 -3
- package/dist/runtime/server/routes/agent-skills-artifact.d.ts +1 -1
- package/dist/runtime/server/routes/agent-skills-artifact.js +10 -10
- package/dist/runtime/server/routes/agent-skills-index.d.ts +1 -1
- package/dist/runtime/server/routes/agent-skills-index.js +7 -6
- package/dist/runtime/server/routes/ai-catalog.d.ts +2 -1
- package/dist/runtime/server/routes/ai-catalog.js +7 -8
- package/dist/runtime/server/routes/api-catalog.d.ts +3 -1
- package/dist/runtime/server/routes/api-catalog.js +12 -12
- package/dist/runtime/server/routes/llms-full.txt.get.js +1 -1
- package/dist/runtime/server/routes/mcp-server-card.d.ts +1 -1
- package/dist/runtime/server/routes/mcp-server-card.js +7 -8
- package/dist/runtime/server/utils/checkStale.d.ts +2 -2
- package/dist/runtime/server/utils/cloudflare-prerendered.d.ts +3 -0
- package/dist/runtime/server/utils/cloudflare-prerendered.js +23 -0
- package/dist/runtime/server/utils/cloudflare.d.ts +5 -5
- package/dist/runtime/server/utils/cloudflare.js +31 -7
- package/dist/runtime/server/utils/content-negotiation.d.ts +5 -3
- package/dist/runtime/server/utils/content-negotiation.js +8 -7
- package/dist/runtime/server/utils/context.d.ts +3 -3
- package/dist/runtime/server/utils/context.js +1 -1
- package/dist/runtime/server/utils/discovery-response.d.ts +2 -0
- package/dist/runtime/server/utils/link-header.d.ts +5 -3
- package/dist/runtime/server/utils/link-header.js +26 -2
- package/dist/runtime/server/utils/markdown-request.d.ts +4 -3
- package/dist/runtime/server/utils/markdown-request.js +15 -13
- package/dist/runtime/server/utils/negotiation-decision.d.ts +4 -0
- package/dist/runtime/server/utils/negotiation-decision.js +6 -5
- package/dist/runtime/server/utils/negotiation-response.d.ts +1 -1
- package/dist/runtime/server/utils/negotiation-response.js +63 -23
- package/dist/runtime/server/utils/prerender-html.d.ts +2 -1
- package/dist/runtime/server/utils/prerender-html.js +3 -1
- package/dist/runtime/types.d.ts +15 -7
- package/dist/shared/nuxt-ai-ready.B3hAuOLQ.mjs +29 -0
- package/dist/shared/{nuxt-ai-ready.CLSWou20.mjs → nuxt-ai-ready.C34F0LJo.mjs} +560 -219
- package/package.json +85 -20
- package/skills/nuxt-ai-ready/SKILL.md +26 -12
- package/skills/nuxt-ai-ready/references/runtime-indexing.md +7 -6
- package/dist/runtime/server/db/drizzle/providers/sqlite.d.ts +0 -8
- package/dist/runtime/server/db/drizzle/providers/sqlite.js +0 -15
- package/node_modules/@mdream/js/LICENSE.md +0 -9
- package/node_modules/@mdream/js/README.md +0 -792
- package/node_modules/@mdream/js/bin/mdream.mjs +0 -2
- package/node_modules/@mdream/js/dist/_chunks/const.mjs +0 -134
- package/node_modules/@mdream/js/dist/_chunks/index.d.mts +0 -9
- package/node_modules/@mdream/js/dist/_chunks/markdown-processor.mjs +0 -1968
- package/node_modules/@mdream/js/dist/_chunks/minimal.d.mts +0 -6
- package/node_modules/@mdream/js/dist/_chunks/parse.mjs +0 -2756
- package/node_modules/@mdream/js/dist/_chunks/plugins.mjs +0 -725
- package/node_modules/@mdream/js/dist/_chunks/resolve-plugins.mjs +0 -44
- package/node_modules/@mdream/js/dist/_chunks/stream.mjs +0 -37
- package/node_modules/@mdream/js/dist/_chunks/types.d.mts +0 -473
- package/node_modules/@mdream/js/dist/cli.d.mts +0 -1
- package/node_modules/@mdream/js/dist/cli.mjs +0 -32
- package/node_modules/@mdream/js/dist/core.d.mts +0 -15
- package/node_modules/@mdream/js/dist/core.mjs +0 -28
- package/node_modules/@mdream/js/dist/index.d.mts +0 -4
- package/node_modules/@mdream/js/dist/index.mjs +0 -58
- package/node_modules/@mdream/js/dist/llms-txt.d.mts +0 -86
- package/node_modules/@mdream/js/dist/llms-txt.mjs +0 -308
- package/node_modules/@mdream/js/dist/negotiate.d.mts +0 -35
- package/node_modules/@mdream/js/dist/negotiate.mjs +0 -121
- package/node_modules/@mdream/js/dist/parse.d.mts +0 -90
- package/node_modules/@mdream/js/dist/parse.mjs +0 -2
- package/node_modules/@mdream/js/dist/plugins.d.mts +0 -85
- package/node_modules/@mdream/js/dist/plugins.mjs +0 -2
- package/node_modules/@mdream/js/dist/preset/minimal.d.mts +0 -2
- package/node_modules/@mdream/js/dist/preset/minimal.mjs +0 -33
- package/node_modules/@mdream/js/dist/splitter.d.mts +0 -18
- package/node_modules/@mdream/js/dist/splitter.mjs +0 -194
- package/node_modules/@mdream/js/package.json +0 -103
- package/node_modules/cac/LICENSE +0 -21
- package/node_modules/cac/README.md +0 -492
- package/node_modules/cac/dist/index.d.ts +0 -196
- package/node_modules/cac/dist/index.js +0 -638
- package/node_modules/cac/package.json +0 -72
- package/node_modules/mdream/LICENSE.md +0 -9
- package/node_modules/mdream/README.md +0 -1091
- package/node_modules/mdream/bin/mdream.mjs +0 -46
- package/node_modules/mdream/dist/browser.d.mts +0 -105
- package/node_modules/mdream/dist/browser.mjs +0 -262
- package/node_modules/mdream/dist/edge.d.mts +0 -100
- package/node_modules/mdream/dist/edge.mjs +0 -250
- package/node_modules/mdream/dist/iife.js +0 -605
- package/node_modules/mdream/dist/index.d.mts +0 -89
- package/node_modules/mdream/dist/index.mjs +0 -184
- package/node_modules/mdream/dist/wasm.d.mts +0 -100
- package/node_modules/mdream/dist/wasm.mjs +0 -140
- package/node_modules/mdream/dist/worker.d.mts +0 -101
- package/node_modules/mdream/dist/worker.mjs +0 -217
- package/node_modules/mdream/napi/index.d.mts +0 -127
- package/node_modules/mdream/napi/index.d.ts +0 -127
- package/node_modules/mdream/napi/index.mjs +0 -725
- package/node_modules/mdream/napi/rust.android-arm-eabi.node +0 -0
- package/node_modules/mdream/napi/rust.android-arm64.node +0 -0
- package/node_modules/mdream/napi/rust.darwin-arm64.node +0 -0
- package/node_modules/mdream/napi/rust.darwin-x64.node +0 -0
- package/node_modules/mdream/napi/rust.freebsd-x64.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm-gnueabihf.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm64-gnu.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm64-musl.node +0 -0
- package/node_modules/mdream/napi/rust.linux-x64-gnu.node +0 -0
- package/node_modules/mdream/napi/rust.linux-x64-musl.node +0 -0
- package/node_modules/mdream/napi/rust.wasi.cjs +0 -2144
- package/node_modules/mdream/napi/rust.wasm32-wasi.wasm +0 -0
- package/node_modules/mdream/napi/rust.win32-arm64-msvc.node +0 -0
- package/node_modules/mdream/napi/rust.win32-x64-msvc.node +0 -0
- package/node_modules/mdream/node_modules/@emnapi/core/LICENSE +0 -21
- package/node_modules/mdream/node_modules/@emnapi/core/README.md +0 -1
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.d.ts +0 -392
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.d.ts +0 -392
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.js +0 -8351
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.js +0 -7268
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.d.ts +0 -5
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.js +0 -843
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.d.ts +0 -4
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.js +0 -3
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.d.ts +0 -5
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.js +0 -1010
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.d.ts +0 -5
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.js +0 -1446
- package/node_modules/mdream/node_modules/@emnapi/core/package.json +0 -39
- package/node_modules/mdream/node_modules/@emnapi/core/rollup.config.js +0 -60
- package/node_modules/mdream/node_modules/@emnapi/runtime/LICENSE +0 -21
- package/node_modules/mdream/node_modules/@emnapi/runtime/README.md +0 -1
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.d.ts +0 -833
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js +0 -2306
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js.map +0 -1
- package/node_modules/mdream/node_modules/@emnapi/runtime/index.cjs +0 -63
- package/node_modules/mdream/node_modules/@emnapi/runtime/package.json +0 -39
- package/node_modules/mdream/node_modules/@emnapi/runtime/rollup.config.js +0 -25
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/LICENSE +0 -21
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/README.md +0 -203
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +0 -236
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +0 -1086
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/package.json +0 -35
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/rollup.config.js +0 -6
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +0 -1472
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +0 -1470
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +0 -237
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs.js +0 -18260
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +0 -317
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/package.json +0 -67
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.cjs +0 -39
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.js +0 -36
- package/node_modules/mdream/node_modules/@tybys/wasm-util/LICENSE +0 -21
- package/node_modules/mdream/node_modules/@tybys/wasm-util/README.md +0 -193
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/tsdoc-metadata.json +0 -11
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.d.ts +0 -423
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +0 -2932
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +0 -2932
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +0 -1
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.js +0 -2954
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +0 -1
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/asyncify.js +0 -158
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/index.js +0 -13
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/jspi.js +0 -46
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/load.js +0 -97
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/memory.js +0 -35
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/error.js +0 -103
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fd.js +0 -268
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fs.js +0 -3
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/index.js +0 -192
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/path.js +0 -316
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +0 -1599
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/rights.js +0 -141
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/types.js +0 -220
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/util.js +0 -128
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/webassembly.js +0 -13
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/asyncify.mjs +0 -153
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/index.mjs +0 -9
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/jspi.mjs +0 -39
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/load.mjs +0 -89
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/memory.mjs +0 -28
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/error.mjs +0 -97
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fd.mjs +0 -256
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fs.mjs +0 -1
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/index.mjs +0 -186
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/path.mjs +0 -310
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +0 -1593
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/rights.mjs +0 -135
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/types.mjs +0 -216
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/util.mjs +0 -113
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/webassembly.mjs +0 -9
- package/node_modules/mdream/node_modules/@tybys/wasm-util/package.json +0 -58
- package/node_modules/mdream/node_modules/tslib/CopyrightNotice.txt +0 -15
- package/node_modules/mdream/node_modules/tslib/LICENSE.txt +0 -12
- package/node_modules/mdream/node_modules/tslib/README.md +0 -164
- package/node_modules/mdream/node_modules/tslib/SECURITY.md +0 -41
- package/node_modules/mdream/node_modules/tslib/modules/index.d.ts +0 -38
- package/node_modules/mdream/node_modules/tslib/modules/index.js +0 -70
- package/node_modules/mdream/node_modules/tslib/modules/package.json +0 -3
- package/node_modules/mdream/node_modules/tslib/package.json +0 -47
- package/node_modules/mdream/node_modules/tslib/tslib.d.ts +0 -460
- package/node_modules/mdream/node_modules/tslib/tslib.es6.html +0 -1
- package/node_modules/mdream/node_modules/tslib/tslib.es6.js +0 -402
- package/node_modules/mdream/node_modules/tslib/tslib.es6.mjs +0 -401
- package/node_modules/mdream/node_modules/tslib/tslib.html +0 -1
- package/node_modules/mdream/node_modules/tslib/tslib.js +0 -484
- package/node_modules/mdream/package.json +0 -110
- package/node_modules/mdream/skills/mdream/SKILL.md +0 -124
- package/node_modules/mdream/skills/mdream/references/runtimes.md +0 -49
- package/node_modules/mdream/wasm/mdream_edge.d.ts +0 -90
- package/node_modules/mdream/wasm/mdream_edge.js +0 -517
- package/node_modules/mdream/wasm/mdream_edge_bg.wasm +0 -0
- package/node_modules/mdream/wasm/mdream_edge_bg.wasm.d.ts +0 -20
- package/node_modules/mdream/wasm/package.json +0 -17
- package/node_modules/mdream/wasm-bundler/mdream_edge.d.ts +0 -45
- package/node_modules/mdream/wasm-bundler/mdream_edge.js +0 -13
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.js +0 -413
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm +0 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm.d.ts +0 -20
- package/node_modules/mdream/wasm-bundler/package.json +0 -19
- package/node_modules/pathe/LICENSE +0 -70
- package/node_modules/pathe/README.md +0 -73
- package/node_modules/pathe/dist/index.cjs +0 -39
- package/node_modules/pathe/dist/index.d.cts +0 -47
- package/node_modules/pathe/dist/index.d.mts +0 -47
- package/node_modules/pathe/dist/index.d.ts +0 -47
- package/node_modules/pathe/dist/index.mjs +0 -19
- package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +0 -266
- package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -249
- package/node_modules/pathe/dist/utils.cjs +0 -82
- package/node_modules/pathe/dist/utils.d.cts +0 -32
- package/node_modules/pathe/dist/utils.d.mts +0 -32
- package/node_modules/pathe/dist/utils.d.ts +0 -32
- package/node_modules/pathe/dist/utils.mjs +0 -77
- package/node_modules/pathe/package.json +0 -61
- package/node_modules/pathe/utils.d.ts +0 -1
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { WasiError } from "./error.mjs";
|
|
2
|
-
import { WasiErrno, WasiRights, WasiFileType } from "./types.mjs";
|
|
3
|
-
export const RIGHTS_ALL = WasiRights.FD_DATASYNC |
|
|
4
|
-
WasiRights.FD_READ |
|
|
5
|
-
WasiRights.FD_SEEK |
|
|
6
|
-
WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
7
|
-
WasiRights.FD_SYNC |
|
|
8
|
-
WasiRights.FD_TELL |
|
|
9
|
-
WasiRights.FD_WRITE |
|
|
10
|
-
WasiRights.FD_ADVISE |
|
|
11
|
-
WasiRights.FD_ALLOCATE |
|
|
12
|
-
WasiRights.PATH_CREATE_DIRECTORY |
|
|
13
|
-
WasiRights.PATH_CREATE_FILE |
|
|
14
|
-
WasiRights.PATH_LINK_SOURCE |
|
|
15
|
-
WasiRights.PATH_LINK_TARGET |
|
|
16
|
-
WasiRights.PATH_OPEN |
|
|
17
|
-
WasiRights.FD_READDIR |
|
|
18
|
-
WasiRights.PATH_READLINK |
|
|
19
|
-
WasiRights.PATH_RENAME_SOURCE |
|
|
20
|
-
WasiRights.PATH_RENAME_TARGET |
|
|
21
|
-
WasiRights.PATH_FILESTAT_GET |
|
|
22
|
-
WasiRights.PATH_FILESTAT_SET_SIZE |
|
|
23
|
-
WasiRights.PATH_FILESTAT_SET_TIMES |
|
|
24
|
-
WasiRights.FD_FILESTAT_GET |
|
|
25
|
-
WasiRights.FD_FILESTAT_SET_TIMES |
|
|
26
|
-
WasiRights.FD_FILESTAT_SET_SIZE |
|
|
27
|
-
WasiRights.PATH_SYMLINK |
|
|
28
|
-
WasiRights.PATH_UNLINK_FILE |
|
|
29
|
-
WasiRights.PATH_REMOVE_DIRECTORY |
|
|
30
|
-
WasiRights.POLL_FD_READWRITE |
|
|
31
|
-
WasiRights.SOCK_SHUTDOWN |
|
|
32
|
-
WasiRights.SOCK_ACCEPT;
|
|
33
|
-
export const BLOCK_DEVICE_BASE = RIGHTS_ALL;
|
|
34
|
-
export const BLOCK_DEVICE_INHERITING = RIGHTS_ALL;
|
|
35
|
-
export const CHARACTER_DEVICE_BASE = RIGHTS_ALL;
|
|
36
|
-
export const CHARACTER_DEVICE_INHERITING = RIGHTS_ALL;
|
|
37
|
-
export const REGULAR_FILE_BASE = WasiRights.FD_DATASYNC |
|
|
38
|
-
WasiRights.FD_READ |
|
|
39
|
-
WasiRights.FD_SEEK |
|
|
40
|
-
WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
41
|
-
WasiRights.FD_SYNC |
|
|
42
|
-
WasiRights.FD_TELL |
|
|
43
|
-
WasiRights.FD_WRITE |
|
|
44
|
-
WasiRights.FD_ADVISE |
|
|
45
|
-
WasiRights.FD_ALLOCATE |
|
|
46
|
-
WasiRights.FD_FILESTAT_GET |
|
|
47
|
-
WasiRights.FD_FILESTAT_SET_SIZE |
|
|
48
|
-
WasiRights.FD_FILESTAT_SET_TIMES |
|
|
49
|
-
WasiRights.POLL_FD_READWRITE;
|
|
50
|
-
export const REGULAR_FILE_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
51
|
-
export const DIRECTORY_BASE = WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
52
|
-
WasiRights.FD_SYNC |
|
|
53
|
-
WasiRights.FD_ADVISE |
|
|
54
|
-
WasiRights.PATH_CREATE_DIRECTORY |
|
|
55
|
-
WasiRights.PATH_CREATE_FILE |
|
|
56
|
-
WasiRights.PATH_LINK_SOURCE |
|
|
57
|
-
WasiRights.PATH_LINK_TARGET |
|
|
58
|
-
WasiRights.PATH_OPEN |
|
|
59
|
-
WasiRights.FD_READDIR |
|
|
60
|
-
WasiRights.PATH_READLINK |
|
|
61
|
-
WasiRights.PATH_RENAME_SOURCE |
|
|
62
|
-
WasiRights.PATH_RENAME_TARGET |
|
|
63
|
-
WasiRights.PATH_FILESTAT_GET |
|
|
64
|
-
WasiRights.PATH_FILESTAT_SET_SIZE |
|
|
65
|
-
WasiRights.PATH_FILESTAT_SET_TIMES |
|
|
66
|
-
WasiRights.FD_FILESTAT_GET |
|
|
67
|
-
WasiRights.FD_FILESTAT_SET_TIMES |
|
|
68
|
-
WasiRights.PATH_SYMLINK |
|
|
69
|
-
WasiRights.PATH_UNLINK_FILE |
|
|
70
|
-
WasiRights.PATH_REMOVE_DIRECTORY |
|
|
71
|
-
WasiRights.POLL_FD_READWRITE;
|
|
72
|
-
export const DIRECTORY_INHERITING = DIRECTORY_BASE | REGULAR_FILE_BASE;
|
|
73
|
-
export const SOCKET_BASE = (WasiRights.FD_READ |
|
|
74
|
-
WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
75
|
-
WasiRights.FD_WRITE |
|
|
76
|
-
WasiRights.FD_FILESTAT_GET |
|
|
77
|
-
WasiRights.POLL_FD_READWRITE |
|
|
78
|
-
WasiRights.SOCK_SHUTDOWN);
|
|
79
|
-
export const SOCKET_INHERITING = RIGHTS_ALL;
|
|
80
|
-
export const TTY_BASE = WasiRights.FD_READ |
|
|
81
|
-
WasiRights.FD_FDSTAT_SET_FLAGS |
|
|
82
|
-
WasiRights.FD_WRITE |
|
|
83
|
-
WasiRights.FD_FILESTAT_GET |
|
|
84
|
-
WasiRights.POLL_FD_READWRITE;
|
|
85
|
-
export const TTY_INHERITING = /*#__PURE__*/ BigInt(0);
|
|
86
|
-
export function getRights(stdio, fd, flags, type) {
|
|
87
|
-
const ret = {
|
|
88
|
-
base: BigInt(0),
|
|
89
|
-
inheriting: BigInt(0)
|
|
90
|
-
};
|
|
91
|
-
if (type === WasiFileType.UNKNOWN) {
|
|
92
|
-
throw new WasiError('Unknown file type', WasiErrno.EINVAL);
|
|
93
|
-
}
|
|
94
|
-
switch (type) {
|
|
95
|
-
case WasiFileType.REGULAR_FILE:
|
|
96
|
-
ret.base = REGULAR_FILE_BASE;
|
|
97
|
-
ret.inheriting = REGULAR_FILE_INHERITING;
|
|
98
|
-
break;
|
|
99
|
-
case WasiFileType.DIRECTORY:
|
|
100
|
-
ret.base = DIRECTORY_BASE;
|
|
101
|
-
ret.inheriting = DIRECTORY_INHERITING;
|
|
102
|
-
break;
|
|
103
|
-
case WasiFileType.SOCKET_STREAM:
|
|
104
|
-
case WasiFileType.SOCKET_DGRAM:
|
|
105
|
-
ret.base = SOCKET_BASE;
|
|
106
|
-
ret.inheriting = SOCKET_INHERITING;
|
|
107
|
-
break;
|
|
108
|
-
case WasiFileType.CHARACTER_DEVICE:
|
|
109
|
-
if (stdio.indexOf(fd) !== -1) {
|
|
110
|
-
ret.base = TTY_BASE;
|
|
111
|
-
ret.inheriting = TTY_INHERITING;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
ret.base = CHARACTER_DEVICE_BASE;
|
|
115
|
-
ret.inheriting = CHARACTER_DEVICE_INHERITING;
|
|
116
|
-
}
|
|
117
|
-
break;
|
|
118
|
-
case WasiFileType.BLOCK_DEVICE:
|
|
119
|
-
ret.base = BLOCK_DEVICE_BASE;
|
|
120
|
-
ret.inheriting = BLOCK_DEVICE_INHERITING;
|
|
121
|
-
break;
|
|
122
|
-
default:
|
|
123
|
-
ret.base = BigInt(0);
|
|
124
|
-
ret.inheriting = BigInt(0);
|
|
125
|
-
}
|
|
126
|
-
/* Disable read/write bits depending on access mode. */
|
|
127
|
-
const read_or_write_only = flags & (0 | 1 | 2);
|
|
128
|
-
if (read_or_write_only === 0) {
|
|
129
|
-
ret.base &= ~WasiRights.FD_WRITE;
|
|
130
|
-
}
|
|
131
|
-
else if (read_or_write_only === 1) {
|
|
132
|
-
ret.base &= ~WasiRights.FD_READ;
|
|
133
|
-
}
|
|
134
|
-
return ret;
|
|
135
|
-
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
/* eslint-disable spaced-comment */
|
|
2
|
-
export var WasiErrno;
|
|
3
|
-
(function (WasiErrno) {
|
|
4
|
-
WasiErrno[WasiErrno["ESUCCESS"] = 0] = "ESUCCESS";
|
|
5
|
-
WasiErrno[WasiErrno["E2BIG"] = 1] = "E2BIG";
|
|
6
|
-
WasiErrno[WasiErrno["EACCES"] = 2] = "EACCES";
|
|
7
|
-
WasiErrno[WasiErrno["EADDRINUSE"] = 3] = "EADDRINUSE";
|
|
8
|
-
WasiErrno[WasiErrno["EADDRNOTAVAIL"] = 4] = "EADDRNOTAVAIL";
|
|
9
|
-
WasiErrno[WasiErrno["EAFNOSUPPORT"] = 5] = "EAFNOSUPPORT";
|
|
10
|
-
WasiErrno[WasiErrno["EAGAIN"] = 6] = "EAGAIN";
|
|
11
|
-
WasiErrno[WasiErrno["EALREADY"] = 7] = "EALREADY";
|
|
12
|
-
WasiErrno[WasiErrno["EBADF"] = 8] = "EBADF";
|
|
13
|
-
WasiErrno[WasiErrno["EBADMSG"] = 9] = "EBADMSG";
|
|
14
|
-
WasiErrno[WasiErrno["EBUSY"] = 10] = "EBUSY";
|
|
15
|
-
WasiErrno[WasiErrno["ECANCELED"] = 11] = "ECANCELED";
|
|
16
|
-
WasiErrno[WasiErrno["ECHILD"] = 12] = "ECHILD";
|
|
17
|
-
WasiErrno[WasiErrno["ECONNABORTED"] = 13] = "ECONNABORTED";
|
|
18
|
-
WasiErrno[WasiErrno["ECONNREFUSED"] = 14] = "ECONNREFUSED";
|
|
19
|
-
WasiErrno[WasiErrno["ECONNRESET"] = 15] = "ECONNRESET";
|
|
20
|
-
WasiErrno[WasiErrno["EDEADLK"] = 16] = "EDEADLK";
|
|
21
|
-
WasiErrno[WasiErrno["EDESTADDRREQ"] = 17] = "EDESTADDRREQ";
|
|
22
|
-
WasiErrno[WasiErrno["EDOM"] = 18] = "EDOM";
|
|
23
|
-
WasiErrno[WasiErrno["EDQUOT"] = 19] = "EDQUOT";
|
|
24
|
-
WasiErrno[WasiErrno["EEXIST"] = 20] = "EEXIST";
|
|
25
|
-
WasiErrno[WasiErrno["EFAULT"] = 21] = "EFAULT";
|
|
26
|
-
WasiErrno[WasiErrno["EFBIG"] = 22] = "EFBIG";
|
|
27
|
-
WasiErrno[WasiErrno["EHOSTUNREACH"] = 23] = "EHOSTUNREACH";
|
|
28
|
-
WasiErrno[WasiErrno["EIDRM"] = 24] = "EIDRM";
|
|
29
|
-
WasiErrno[WasiErrno["EILSEQ"] = 25] = "EILSEQ";
|
|
30
|
-
WasiErrno[WasiErrno["EINPROGRESS"] = 26] = "EINPROGRESS";
|
|
31
|
-
WasiErrno[WasiErrno["EINTR"] = 27] = "EINTR";
|
|
32
|
-
WasiErrno[WasiErrno["EINVAL"] = 28] = "EINVAL";
|
|
33
|
-
WasiErrno[WasiErrno["EIO"] = 29] = "EIO";
|
|
34
|
-
WasiErrno[WasiErrno["EISCONN"] = 30] = "EISCONN";
|
|
35
|
-
WasiErrno[WasiErrno["EISDIR"] = 31] = "EISDIR";
|
|
36
|
-
WasiErrno[WasiErrno["ELOOP"] = 32] = "ELOOP";
|
|
37
|
-
WasiErrno[WasiErrno["EMFILE"] = 33] = "EMFILE";
|
|
38
|
-
WasiErrno[WasiErrno["EMLINK"] = 34] = "EMLINK";
|
|
39
|
-
WasiErrno[WasiErrno["EMSGSIZE"] = 35] = "EMSGSIZE";
|
|
40
|
-
WasiErrno[WasiErrno["EMULTIHOP"] = 36] = "EMULTIHOP";
|
|
41
|
-
WasiErrno[WasiErrno["ENAMETOOLONG"] = 37] = "ENAMETOOLONG";
|
|
42
|
-
WasiErrno[WasiErrno["ENETDOWN"] = 38] = "ENETDOWN";
|
|
43
|
-
WasiErrno[WasiErrno["ENETRESET"] = 39] = "ENETRESET";
|
|
44
|
-
WasiErrno[WasiErrno["ENETUNREACH"] = 40] = "ENETUNREACH";
|
|
45
|
-
WasiErrno[WasiErrno["ENFILE"] = 41] = "ENFILE";
|
|
46
|
-
WasiErrno[WasiErrno["ENOBUFS"] = 42] = "ENOBUFS";
|
|
47
|
-
WasiErrno[WasiErrno["ENODEV"] = 43] = "ENODEV";
|
|
48
|
-
WasiErrno[WasiErrno["ENOENT"] = 44] = "ENOENT";
|
|
49
|
-
WasiErrno[WasiErrno["ENOEXEC"] = 45] = "ENOEXEC";
|
|
50
|
-
WasiErrno[WasiErrno["ENOLCK"] = 46] = "ENOLCK";
|
|
51
|
-
WasiErrno[WasiErrno["ENOLINK"] = 47] = "ENOLINK";
|
|
52
|
-
WasiErrno[WasiErrno["ENOMEM"] = 48] = "ENOMEM";
|
|
53
|
-
WasiErrno[WasiErrno["ENOMSG"] = 49] = "ENOMSG";
|
|
54
|
-
WasiErrno[WasiErrno["ENOPROTOOPT"] = 50] = "ENOPROTOOPT";
|
|
55
|
-
WasiErrno[WasiErrno["ENOSPC"] = 51] = "ENOSPC";
|
|
56
|
-
WasiErrno[WasiErrno["ENOSYS"] = 52] = "ENOSYS";
|
|
57
|
-
WasiErrno[WasiErrno["ENOTCONN"] = 53] = "ENOTCONN";
|
|
58
|
-
WasiErrno[WasiErrno["ENOTDIR"] = 54] = "ENOTDIR";
|
|
59
|
-
WasiErrno[WasiErrno["ENOTEMPTY"] = 55] = "ENOTEMPTY";
|
|
60
|
-
WasiErrno[WasiErrno["ENOTRECOVERABLE"] = 56] = "ENOTRECOVERABLE";
|
|
61
|
-
WasiErrno[WasiErrno["ENOTSOCK"] = 57] = "ENOTSOCK";
|
|
62
|
-
WasiErrno[WasiErrno["ENOTSUP"] = 58] = "ENOTSUP";
|
|
63
|
-
WasiErrno[WasiErrno["ENOTTY"] = 59] = "ENOTTY";
|
|
64
|
-
WasiErrno[WasiErrno["ENXIO"] = 60] = "ENXIO";
|
|
65
|
-
WasiErrno[WasiErrno["EOVERFLOW"] = 61] = "EOVERFLOW";
|
|
66
|
-
WasiErrno[WasiErrno["EOWNERDEAD"] = 62] = "EOWNERDEAD";
|
|
67
|
-
WasiErrno[WasiErrno["EPERM"] = 63] = "EPERM";
|
|
68
|
-
WasiErrno[WasiErrno["EPIPE"] = 64] = "EPIPE";
|
|
69
|
-
WasiErrno[WasiErrno["EPROTO"] = 65] = "EPROTO";
|
|
70
|
-
WasiErrno[WasiErrno["EPROTONOSUPPORT"] = 66] = "EPROTONOSUPPORT";
|
|
71
|
-
WasiErrno[WasiErrno["EPROTOTYPE"] = 67] = "EPROTOTYPE";
|
|
72
|
-
WasiErrno[WasiErrno["ERANGE"] = 68] = "ERANGE";
|
|
73
|
-
WasiErrno[WasiErrno["EROFS"] = 69] = "EROFS";
|
|
74
|
-
WasiErrno[WasiErrno["ESPIPE"] = 70] = "ESPIPE";
|
|
75
|
-
WasiErrno[WasiErrno["ESRCH"] = 71] = "ESRCH";
|
|
76
|
-
WasiErrno[WasiErrno["ESTALE"] = 72] = "ESTALE";
|
|
77
|
-
WasiErrno[WasiErrno["ETIMEDOUT"] = 73] = "ETIMEDOUT";
|
|
78
|
-
WasiErrno[WasiErrno["ETXTBSY"] = 74] = "ETXTBSY";
|
|
79
|
-
WasiErrno[WasiErrno["EXDEV"] = 75] = "EXDEV";
|
|
80
|
-
WasiErrno[WasiErrno["ENOTCAPABLE"] = 76] = "ENOTCAPABLE";
|
|
81
|
-
})(WasiErrno || (WasiErrno = {}));
|
|
82
|
-
export var WasiFileType;
|
|
83
|
-
(function (WasiFileType) {
|
|
84
|
-
WasiFileType[WasiFileType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
85
|
-
WasiFileType[WasiFileType["BLOCK_DEVICE"] = 1] = "BLOCK_DEVICE";
|
|
86
|
-
WasiFileType[WasiFileType["CHARACTER_DEVICE"] = 2] = "CHARACTER_DEVICE";
|
|
87
|
-
WasiFileType[WasiFileType["DIRECTORY"] = 3] = "DIRECTORY";
|
|
88
|
-
WasiFileType[WasiFileType["REGULAR_FILE"] = 4] = "REGULAR_FILE";
|
|
89
|
-
WasiFileType[WasiFileType["SOCKET_DGRAM"] = 5] = "SOCKET_DGRAM";
|
|
90
|
-
WasiFileType[WasiFileType["SOCKET_STREAM"] = 6] = "SOCKET_STREAM";
|
|
91
|
-
WasiFileType[WasiFileType["SYMBOLIC_LINK"] = 7] = "SYMBOLIC_LINK";
|
|
92
|
-
})(WasiFileType || (WasiFileType = {}));
|
|
93
|
-
const FD_DATASYNC = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(0));
|
|
94
|
-
const FD_READ = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(1));
|
|
95
|
-
const FD_SEEK = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(2));
|
|
96
|
-
const FD_FDSTAT_SET_FLAGS = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(3));
|
|
97
|
-
const FD_SYNC = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(4));
|
|
98
|
-
const FD_TELL = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(5));
|
|
99
|
-
const FD_WRITE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(6));
|
|
100
|
-
const FD_ADVISE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(7));
|
|
101
|
-
const FD_ALLOCATE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(8));
|
|
102
|
-
const PATH_CREATE_DIRECTORY = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(9));
|
|
103
|
-
const PATH_CREATE_FILE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(10));
|
|
104
|
-
const PATH_LINK_SOURCE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(11));
|
|
105
|
-
const PATH_LINK_TARGET = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(12));
|
|
106
|
-
const PATH_OPEN = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(13));
|
|
107
|
-
const FD_READDIR = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(14));
|
|
108
|
-
const PATH_READLINK = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(15));
|
|
109
|
-
const PATH_RENAME_SOURCE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(16));
|
|
110
|
-
const PATH_RENAME_TARGET = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(17));
|
|
111
|
-
const PATH_FILESTAT_GET = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(18));
|
|
112
|
-
const PATH_FILESTAT_SET_SIZE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(19));
|
|
113
|
-
const PATH_FILESTAT_SET_TIMES = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(20));
|
|
114
|
-
const FD_FILESTAT_GET = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(21));
|
|
115
|
-
const FD_FILESTAT_SET_SIZE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(22));
|
|
116
|
-
const FD_FILESTAT_SET_TIMES = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(23));
|
|
117
|
-
const PATH_SYMLINK = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(24));
|
|
118
|
-
const PATH_REMOVE_DIRECTORY = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(25));
|
|
119
|
-
const PATH_UNLINK_FILE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(26));
|
|
120
|
-
const POLL_FD_READWRITE = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(27));
|
|
121
|
-
const SOCK_SHUTDOWN = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(28));
|
|
122
|
-
const SOCK_ACCEPT = ( /*#__PURE__*/BigInt(1) << /*#__PURE__*/ BigInt(29));
|
|
123
|
-
export const WasiRights = {
|
|
124
|
-
FD_DATASYNC,
|
|
125
|
-
FD_READ,
|
|
126
|
-
FD_SEEK,
|
|
127
|
-
FD_FDSTAT_SET_FLAGS,
|
|
128
|
-
FD_SYNC,
|
|
129
|
-
FD_TELL,
|
|
130
|
-
FD_WRITE,
|
|
131
|
-
FD_ADVISE,
|
|
132
|
-
FD_ALLOCATE,
|
|
133
|
-
PATH_CREATE_DIRECTORY,
|
|
134
|
-
PATH_CREATE_FILE,
|
|
135
|
-
PATH_LINK_SOURCE,
|
|
136
|
-
PATH_LINK_TARGET,
|
|
137
|
-
PATH_OPEN,
|
|
138
|
-
FD_READDIR,
|
|
139
|
-
PATH_READLINK,
|
|
140
|
-
PATH_RENAME_SOURCE,
|
|
141
|
-
PATH_RENAME_TARGET,
|
|
142
|
-
PATH_FILESTAT_GET,
|
|
143
|
-
PATH_FILESTAT_SET_SIZE,
|
|
144
|
-
PATH_FILESTAT_SET_TIMES,
|
|
145
|
-
FD_FILESTAT_GET,
|
|
146
|
-
FD_FILESTAT_SET_SIZE,
|
|
147
|
-
FD_FILESTAT_SET_TIMES,
|
|
148
|
-
PATH_SYMLINK,
|
|
149
|
-
PATH_REMOVE_DIRECTORY,
|
|
150
|
-
PATH_UNLINK_FILE,
|
|
151
|
-
POLL_FD_READWRITE,
|
|
152
|
-
SOCK_SHUTDOWN,
|
|
153
|
-
SOCK_ACCEPT
|
|
154
|
-
};
|
|
155
|
-
export var WasiWhence;
|
|
156
|
-
(function (WasiWhence) {
|
|
157
|
-
WasiWhence[WasiWhence["SET"] = 0] = "SET";
|
|
158
|
-
WasiWhence[WasiWhence["CUR"] = 1] = "CUR";
|
|
159
|
-
WasiWhence[WasiWhence["END"] = 2] = "END";
|
|
160
|
-
})(WasiWhence || (WasiWhence = {}));
|
|
161
|
-
export var FileControlFlag;
|
|
162
|
-
(function (FileControlFlag) {
|
|
163
|
-
FileControlFlag[FileControlFlag["O_RDONLY"] = 0] = "O_RDONLY";
|
|
164
|
-
FileControlFlag[FileControlFlag["O_WRONLY"] = 1] = "O_WRONLY";
|
|
165
|
-
FileControlFlag[FileControlFlag["O_RDWR"] = 2] = "O_RDWR";
|
|
166
|
-
FileControlFlag[FileControlFlag["O_CREAT"] = 64] = "O_CREAT";
|
|
167
|
-
FileControlFlag[FileControlFlag["O_EXCL"] = 128] = "O_EXCL";
|
|
168
|
-
FileControlFlag[FileControlFlag["O_NOCTTY"] = 256] = "O_NOCTTY";
|
|
169
|
-
FileControlFlag[FileControlFlag["O_TRUNC"] = 512] = "O_TRUNC";
|
|
170
|
-
FileControlFlag[FileControlFlag["O_APPEND"] = 1024] = "O_APPEND";
|
|
171
|
-
FileControlFlag[FileControlFlag["O_DIRECTORY"] = 65536] = "O_DIRECTORY";
|
|
172
|
-
FileControlFlag[FileControlFlag["O_NOATIME"] = 262144] = "O_NOATIME";
|
|
173
|
-
FileControlFlag[FileControlFlag["O_NOFOLLOW"] = 131072] = "O_NOFOLLOW";
|
|
174
|
-
FileControlFlag[FileControlFlag["O_SYNC"] = 1052672] = "O_SYNC";
|
|
175
|
-
FileControlFlag[FileControlFlag["O_DIRECT"] = 16384] = "O_DIRECT";
|
|
176
|
-
FileControlFlag[FileControlFlag["O_NONBLOCK"] = 2048] = "O_NONBLOCK";
|
|
177
|
-
})(FileControlFlag || (FileControlFlag = {}));
|
|
178
|
-
export var WasiFileControlFlag;
|
|
179
|
-
(function (WasiFileControlFlag) {
|
|
180
|
-
WasiFileControlFlag[WasiFileControlFlag["O_CREAT"] = 1] = "O_CREAT";
|
|
181
|
-
WasiFileControlFlag[WasiFileControlFlag["O_DIRECTORY"] = 2] = "O_DIRECTORY";
|
|
182
|
-
WasiFileControlFlag[WasiFileControlFlag["O_EXCL"] = 4] = "O_EXCL";
|
|
183
|
-
WasiFileControlFlag[WasiFileControlFlag["O_TRUNC"] = 8] = "O_TRUNC";
|
|
184
|
-
})(WasiFileControlFlag || (WasiFileControlFlag = {}));
|
|
185
|
-
export var WasiFdFlag;
|
|
186
|
-
(function (WasiFdFlag) {
|
|
187
|
-
WasiFdFlag[WasiFdFlag["APPEND"] = 1] = "APPEND";
|
|
188
|
-
WasiFdFlag[WasiFdFlag["DSYNC"] = 2] = "DSYNC";
|
|
189
|
-
WasiFdFlag[WasiFdFlag["NONBLOCK"] = 4] = "NONBLOCK";
|
|
190
|
-
WasiFdFlag[WasiFdFlag["RSYNC"] = 8] = "RSYNC";
|
|
191
|
-
WasiFdFlag[WasiFdFlag["SYNC"] = 16] = "SYNC";
|
|
192
|
-
})(WasiFdFlag || (WasiFdFlag = {}));
|
|
193
|
-
export var WasiClockid;
|
|
194
|
-
(function (WasiClockid) {
|
|
195
|
-
WasiClockid[WasiClockid["REALTIME"] = 0] = "REALTIME";
|
|
196
|
-
WasiClockid[WasiClockid["MONOTONIC"] = 1] = "MONOTONIC";
|
|
197
|
-
WasiClockid[WasiClockid["PROCESS_CPUTIME_ID"] = 2] = "PROCESS_CPUTIME_ID";
|
|
198
|
-
WasiClockid[WasiClockid["THREAD_CPUTIME_ID"] = 3] = "THREAD_CPUTIME_ID";
|
|
199
|
-
})(WasiClockid || (WasiClockid = {}));
|
|
200
|
-
export var WasiFstFlag;
|
|
201
|
-
(function (WasiFstFlag) {
|
|
202
|
-
WasiFstFlag[WasiFstFlag["SET_ATIM"] = 1] = "SET_ATIM";
|
|
203
|
-
WasiFstFlag[WasiFstFlag["SET_ATIM_NOW"] = 2] = "SET_ATIM_NOW";
|
|
204
|
-
WasiFstFlag[WasiFstFlag["SET_MTIM"] = 4] = "SET_MTIM";
|
|
205
|
-
WasiFstFlag[WasiFstFlag["SET_MTIM_NOW"] = 8] = "SET_MTIM_NOW";
|
|
206
|
-
})(WasiFstFlag || (WasiFstFlag = {}));
|
|
207
|
-
export var WasiEventType;
|
|
208
|
-
(function (WasiEventType) {
|
|
209
|
-
WasiEventType[WasiEventType["CLOCK"] = 0] = "CLOCK";
|
|
210
|
-
WasiEventType[WasiEventType["FD_READ"] = 1] = "FD_READ";
|
|
211
|
-
WasiEventType[WasiEventType["FD_WRITE"] = 2] = "FD_WRITE";
|
|
212
|
-
})(WasiEventType || (WasiEventType = {}));
|
|
213
|
-
export var WasiSubclockflags;
|
|
214
|
-
(function (WasiSubclockflags) {
|
|
215
|
-
WasiSubclockflags[WasiSubclockflags["ABSTIME"] = 1] = "ABSTIME";
|
|
216
|
-
})(WasiSubclockflags || (WasiSubclockflags = {}));
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/* eslint-disable spaced-comment */
|
|
2
|
-
export function validateObject(value, name) {
|
|
3
|
-
if (value === null || typeof value !== 'object') {
|
|
4
|
-
throw new TypeError(`${name} must be an object. Received ${value === null ? 'null' : typeof value}`);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export function validateArray(value, name) {
|
|
8
|
-
if (!Array.isArray(value)) {
|
|
9
|
-
throw new TypeError(`${name} must be an array. Received ${value === null ? 'null' : typeof value}`);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export function validateBoolean(value, name) {
|
|
13
|
-
if (typeof value !== 'boolean') {
|
|
14
|
-
throw new TypeError(`${name} must be a boolean. Received ${value === null ? 'null' : typeof value}`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export function validateString(value, name) {
|
|
18
|
-
if (typeof value !== 'string') {
|
|
19
|
-
throw new TypeError(`${name} must be a string. Received ${value === null ? 'null' : typeof value}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export function validateFunction(value, name) {
|
|
23
|
-
if (typeof value !== 'function') {
|
|
24
|
-
throw new TypeError(`${name} must be a function. Received ${value === null ? 'null' : typeof value}`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export function validateUndefined(value, name) {
|
|
28
|
-
if (value !== undefined) {
|
|
29
|
-
throw new TypeError(`${name} must be undefined. Received ${value === null ? 'null' : typeof value}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export function validateInt32(value, name, min = -2147483648, max = 2147483647) {
|
|
33
|
-
if (typeof value !== 'number') {
|
|
34
|
-
throw new TypeError(`${name} must be a number. Received ${value === null ? 'null' : typeof value}`);
|
|
35
|
-
}
|
|
36
|
-
if (!Number.isInteger(value)) {
|
|
37
|
-
throw new RangeError(`${name} must be a integer.`);
|
|
38
|
-
}
|
|
39
|
-
if (value < min || value > max) {
|
|
40
|
-
throw new RangeError(`${name} must be >= ${min} && <= ${max}. Received ${value}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export function isPromiseLike(obj) {
|
|
44
|
-
return !!(obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function');
|
|
45
|
-
}
|
|
46
|
-
export function wrapInstanceExports(exports, mapFn) {
|
|
47
|
-
const newExports = Object.create(null);
|
|
48
|
-
Object.keys(exports).forEach(name => {
|
|
49
|
-
const exportValue = exports[name];
|
|
50
|
-
Object.defineProperty(newExports, name, {
|
|
51
|
-
enumerable: true,
|
|
52
|
-
value: mapFn(exportValue, name)
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
return newExports;
|
|
56
|
-
}
|
|
57
|
-
const _require = /*#__PURE__*/ (function () {
|
|
58
|
-
let nativeRequire;
|
|
59
|
-
if (typeof __webpack_public_path__ !== 'undefined') {
|
|
60
|
-
nativeRequire = (function () {
|
|
61
|
-
return typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : undefined;
|
|
62
|
-
})();
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
nativeRequire = (function () {
|
|
66
|
-
return typeof __webpack_public_path__ !== 'undefined' ? (typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : undefined) : (typeof require !== 'undefined' ? require : undefined);
|
|
67
|
-
})();
|
|
68
|
-
}
|
|
69
|
-
return nativeRequire;
|
|
70
|
-
})();
|
|
71
|
-
export const isMainThread = /*#__PURE__*/ (function () {
|
|
72
|
-
let worker_threads;
|
|
73
|
-
try {
|
|
74
|
-
worker_threads = _require('worker_threads');
|
|
75
|
-
}
|
|
76
|
-
catch (_) { }
|
|
77
|
-
if (!worker_threads) {
|
|
78
|
-
return typeof importScripts === 'undefined';
|
|
79
|
-
}
|
|
80
|
-
return worker_threads.isMainThread;
|
|
81
|
-
})();
|
|
82
|
-
export const postMsg = isMainThread
|
|
83
|
-
? () => { }
|
|
84
|
-
: /*#__PURE__*/ (function () {
|
|
85
|
-
let worker_threads;
|
|
86
|
-
try {
|
|
87
|
-
worker_threads = _require('worker_threads');
|
|
88
|
-
}
|
|
89
|
-
catch (_) { }
|
|
90
|
-
if (!worker_threads) {
|
|
91
|
-
return postMessage;
|
|
92
|
-
}
|
|
93
|
-
return function postMessage(data) {
|
|
94
|
-
worker_threads.parentPort.postMessage({ data });
|
|
95
|
-
};
|
|
96
|
-
})();
|
|
97
|
-
export function sleepBreakIf(delay, breakIf) {
|
|
98
|
-
const start = Date.now();
|
|
99
|
-
const end = start + delay;
|
|
100
|
-
let ret = false;
|
|
101
|
-
while (Date.now() < end) {
|
|
102
|
-
if (breakIf()) {
|
|
103
|
-
ret = true;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return ret;
|
|
108
|
-
}
|
|
109
|
-
export function unsharedSlice(view, start, end) {
|
|
110
|
-
return ((typeof SharedArrayBuffer === 'function' && view.buffer instanceof SharedArrayBuffer) || (Object.prototype.toString.call(view.buffer.constructor) === '[object SharedArrayBuffer]'))
|
|
111
|
-
? view.slice(start, end)
|
|
112
|
-
: view.subarray(start, end);
|
|
113
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const _WebAssembly = typeof WebAssembly !== 'undefined'
|
|
2
|
-
? WebAssembly
|
|
3
|
-
: typeof WXWebAssembly !== 'undefined'
|
|
4
|
-
? WXWebAssembly
|
|
5
|
-
: undefined;
|
|
6
|
-
if (!_WebAssembly) {
|
|
7
|
-
throw new Error('WebAssembly is not supported in this environment');
|
|
8
|
-
}
|
|
9
|
-
export { _WebAssembly };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tybys/wasm-util",
|
|
3
|
-
"version": "0.10.4",
|
|
4
|
-
"description": "WASI polyfill for browser and some wasm util",
|
|
5
|
-
"main": "./lib/cjs/index.js",
|
|
6
|
-
"module": "./dist/wasm-util.esm-bundler.js",
|
|
7
|
-
"types": "./dist/wasm-util.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"module": "./dist/wasm-util.esm-bundler.js",
|
|
11
|
-
"import": "./lib/mjs/index.mjs",
|
|
12
|
-
"require": "./lib/cjs/index.js",
|
|
13
|
-
"types": "./dist/wasm-util.d.ts"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "tsgo build",
|
|
18
|
-
"watch": "tsgo watch",
|
|
19
|
-
"test": "jest",
|
|
20
|
-
"lint": "eslint ./src/**/*.{ts,js} --fix",
|
|
21
|
-
"prepare": "npm run build"
|
|
22
|
-
},
|
|
23
|
-
"publishConfig": {
|
|
24
|
-
"access": "public"
|
|
25
|
-
},
|
|
26
|
-
"keywords": [
|
|
27
|
-
"wasm",
|
|
28
|
-
"webassembly",
|
|
29
|
-
"wasi",
|
|
30
|
-
"polyfill"
|
|
31
|
-
],
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "https://github.com/toyobayashi/wasm-util.git"
|
|
35
|
-
},
|
|
36
|
-
"author": "toyobayashi",
|
|
37
|
-
"license": "MIT",
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"tslib": "^2.4.0"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@tybys/ts-transform-module-specifier": "^0.0.2",
|
|
43
|
-
"@tybys/ts-transform-pure-class": "^0.1.1",
|
|
44
|
-
"@tybys/tsgo": "^1.1.0",
|
|
45
|
-
"@types/node": "^14.14.31",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^5.40.1",
|
|
47
|
-
"@typescript-eslint/parser": "^5.40.1",
|
|
48
|
-
"eslint": "^8.25.0",
|
|
49
|
-
"eslint-config-standard-with-typescript": "^23.0.0",
|
|
50
|
-
"eslint-plugin-import": "^2.26.0",
|
|
51
|
-
"eslint-plugin-n": "^15.3.0",
|
|
52
|
-
"eslint-plugin-promise": "^6.1.0",
|
|
53
|
-
"memfs-browser": "^3.4.13000",
|
|
54
|
-
"mocha": "^10.1.0",
|
|
55
|
-
"ts-node": "^10.9.1",
|
|
56
|
-
"typescript": "~4.8.3"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) Microsoft Corporation.
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
4
|
-
purpose with or without fee is hereby granted.
|
|
5
|
-
|
|
6
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
8
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
9
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
10
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
11
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
12
|
-
PERFORMANCE OF THIS SOFTWARE.
|