@world-engines/project-host 0.1.0-alpha.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/LICENSE +46 -0
- package/assets/gui/WELogo-title.svg +11 -0
- package/assets/gui/app.js +1326 -0
- package/assets/gui/index.html +118 -0
- package/assets/gui/local-preview-asset-urls.js +61 -0
- package/assets/gui/local-preview-bridge.js +393 -0
- package/assets/gui/spatial-template-panel.js +233 -0
- package/assets/gui/styles.css +115 -0
- package/assets/gui/terrain-render.js +120 -0
- package/assets/gui/workspace-status.css +17 -0
- package/assets/gui/workspace-status.js +255 -0
- package/assets/gui/world-map-globe.js +187 -0
- package/assets/gui/world-map-worker.js +62 -0
- package/assets/gui/world-map.css +30 -0
- package/assets/gui/world-map.js +2466 -0
- package/dist/account-model-proxy.d.ts +21 -0
- package/dist/account-model-proxy.js +470 -0
- package/dist/authoring-browser-runtime.d.ts +7 -0
- package/dist/authoring-browser-runtime.js +110 -0
- package/dist/authoring-ingestion.d.ts +38 -0
- package/dist/authoring-ingestion.js +410 -0
- package/dist/authoring-model-connection.d.ts +166 -0
- package/dist/authoring-model-connection.js +757 -0
- package/dist/chinese-lexical.d.ts +152 -0
- package/dist/chinese-lexical.js +555 -0
- package/dist/chromium-preview-browser-driver.d.ts +43 -0
- package/dist/chromium-preview-browser-driver.js +575 -0
- package/dist/cli/download.d.ts +12 -0
- package/dist/cli/download.js +50 -0
- package/dist/cli/dump.d.ts +32 -0
- package/dist/cli/dump.js +91 -0
- package/dist/cli/ingest.d.ts +49 -0
- package/dist/cli/ingest.js +225 -0
- package/dist/cli/review.d.ts +10 -0
- package/dist/cli/review.js +44 -0
- package/dist/cli/upload.d.ts +57 -0
- package/dist/cli/upload.js +112 -0
- package/dist/cli-command.d.ts +60 -0
- package/dist/cli-command.js +613 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +182 -0
- package/dist/desktop-authoring-runtime.d.ts +88 -0
- package/dist/desktop-authoring-runtime.js +1602 -0
- package/dist/desktop-sidecar.d.ts +11 -0
- package/dist/desktop-sidecar.js +143 -0
- package/dist/document-dump.d.ts +113 -0
- package/dist/document-dump.js +431 -0
- package/dist/document-graph-extractor.d.ts +125 -0
- package/dist/document-graph-extractor.js +588 -0
- package/dist/document-ingestion-journal.d.ts +68 -0
- package/dist/document-ingestion-journal.js +471 -0
- package/dist/document-ingestion.d.ts +183 -0
- package/dist/document-ingestion.js +976 -0
- package/dist/document-query-path-proof.d.ts +30 -0
- package/dist/document-query-path-proof.js +34 -0
- package/dist/document-query-path-renderer.d.ts +50 -0
- package/dist/document-query-path-renderer.js +75 -0
- package/dist/document-query-proof-paths.d.ts +22 -0
- package/dist/document-query-proof-paths.js +71 -0
- package/dist/document-query.d.ts +97 -0
- package/dist/document-query.js +1106 -0
- package/dist/document-relation-role.d.ts +14 -0
- package/dist/document-relation-role.js +86 -0
- package/dist/document-source.d.ts +107 -0
- package/dist/document-source.js +255 -0
- package/dist/embedding-cache.d.ts +35 -0
- package/dist/embedding-cache.js +317 -0
- package/dist/frozen-review-local-pipeline.d.ts +88 -0
- package/dist/frozen-review-local-pipeline.js +609 -0
- package/dist/frozen-review-source-capture.d.ts +15 -0
- package/dist/frozen-review-source-capture.js +551 -0
- package/dist/frozen-review-wasm-encryptor.d.ts +16 -0
- package/dist/frozen-review-wasm-encryptor.js +72 -0
- package/dist/frozen-review.d.ts +131 -0
- package/dist/frozen-review.js +802 -0
- package/dist/graph-traversal.d.ts +23 -0
- package/dist/graph-traversal.js +100 -0
- package/dist/gui/graph-layout-worker.js +1 -0
- package/dist/gui/graph-layout.wasm +0 -0
- package/dist/gui/graph.css +1 -0
- package/dist/gui/graph.js +76 -0
- package/dist/gui/plane-generation.js +112 -0
- package/dist/gui/plane-generator.js +310 -0
- package/dist/gui/plane-generator_bg.wasm +0 -0
- package/dist/gui/procedural-city.js +595 -0
- package/dist/gui/road-generation.js +129 -0
- package/dist/gui/road-parcels.js +1584 -0
- package/dist/gui/score.css +1 -0
- package/dist/gui/score.js +54 -0
- package/dist/gui/spatial-runtime.js +1231 -0
- package/dist/gui/spatial-templates.js +200 -0
- package/dist/gui/trigger.css +1 -0
- package/dist/gui/trigger.js +142 -0
- package/dist/harness-callback-transport.d.ts +17 -0
- package/dist/harness-callback-transport.js +128 -0
- package/dist/harness-document-ingestion.d.ts +77 -0
- package/dist/harness-document-ingestion.js +343 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +43 -0
- package/dist/ingestion-source-reconciliation.d.ts +88 -0
- package/dist/ingestion-source-reconciliation.js +253 -0
- package/dist/ladybug-runtime.d.ts +117 -0
- package/dist/ladybug-runtime.js +886 -0
- package/dist/local-account-embedding.d.ts +34 -0
- package/dist/local-account-embedding.js +294 -0
- package/dist/local-gallery.d.ts +35 -0
- package/dist/local-gallery.js +227 -0
- package/dist/local-gui-auth.d.ts +96 -0
- package/dist/local-gui-auth.js +703 -0
- package/dist/local-gui-contract.d.ts +53 -0
- package/dist/local-gui-contract.js +5 -0
- package/dist/local-gui-image-assets.d.ts +17 -0
- package/dist/local-gui-image-assets.js +96 -0
- package/dist/local-gui-preview-client.d.ts +3 -0
- package/dist/local-gui-preview-client.js +111 -0
- package/dist/local-gui-score.d.ts +72 -0
- package/dist/local-gui-score.js +184 -0
- package/dist/local-gui-server.d.ts +10 -0
- package/dist/local-gui-server.js +987 -0
- package/dist/local-gui-version.d.ts +17 -0
- package/dist/local-gui-version.js +147 -0
- package/dist/local-gui-workspace.d.ts +14 -0
- package/dist/local-gui-workspace.js +171 -0
- package/dist/local-model-settings.d.ts +28 -0
- package/dist/local-model-settings.js +124 -0
- package/dist/local-preview-assets.d.ts +28 -0
- package/dist/local-preview-assets.js +124 -0
- package/dist/local-preview-bound-resources.d.ts +12 -0
- package/dist/local-preview-bound-resources.js +80 -0
- package/dist/local-preview-message-store.d.ts +63 -0
- package/dist/local-preview-message-store.js +214 -0
- package/dist/local-preview-player-read-models.d.ts +47 -0
- package/dist/local-preview-player-read-models.js +90 -0
- package/dist/local-preview-projections.d.ts +61 -0
- package/dist/local-preview-projections.js +117 -0
- package/dist/local-preview-runtime.d.ts +105 -0
- package/dist/local-preview-runtime.js +553 -0
- package/dist/local-preview-session.d.ts +73 -0
- package/dist/local-preview-session.js +395 -0
- package/dist/local-preview-source.d.ts +40 -0
- package/dist/local-preview-source.js +192 -0
- package/dist/local-preview-view-events.d.ts +101 -0
- package/dist/local-preview-view-events.js +179 -0
- package/dist/local-preview-view-state-sqlite.d.ts +24 -0
- package/dist/local-preview-view-state-sqlite.js +263 -0
- package/dist/local-preview-view-state.d.ts +93 -0
- package/dist/local-preview-view-state.js +108 -0
- package/dist/local-preview-vite-config.d.ts +6 -0
- package/dist/local-preview-vite-config.js +122 -0
- package/dist/local-preview-world-effects.d.ts +9 -0
- package/dist/local-preview-world-effects.js +55 -0
- package/dist/local-preview-worldline-store.d.ts +47 -0
- package/dist/local-preview-worldline-store.js +282 -0
- package/dist/local-preview-worldlines.d.ts +95 -0
- package/dist/local-preview-worldlines.js +136 -0
- package/dist/mcp-async-dispatcher.d.ts +3 -0
- package/dist/mcp-async-dispatcher.js +129 -0
- package/dist/mcp-line-queue.d.ts +14 -0
- package/dist/mcp-line-queue.js +184 -0
- package/dist/mcp-pipe-internal.d.ts +6 -0
- package/dist/mcp-pipe-internal.js +151 -0
- package/dist/mcp-pipe-response.d.ts +14 -0
- package/dist/mcp-pipe-response.js +50 -0
- package/dist/mcp-stdio-response.d.ts +12 -0
- package/dist/mcp-stdio-response.js +27 -0
- package/dist/mcp.d.ts +27 -0
- package/dist/mcp.js +194 -0
- package/dist/prepared-embedding-cache.d.ts +38 -0
- package/dist/prepared-embedding-cache.js +238 -0
- package/dist/preview-browser-adapter.d.ts +53 -0
- package/dist/preview-browser-adapter.js +171 -0
- package/dist/preview-runtime.d.ts +67 -0
- package/dist/preview-runtime.js +460 -0
- package/dist/project-auth-transport.d.ts +27 -0
- package/dist/project-auth-transport.js +121 -0
- package/dist/project-auth.d.ts +51 -0
- package/dist/project-auth.js +108 -0
- package/dist/project-git-capture-recovery.d.ts +16 -0
- package/dist/project-git-capture-recovery.js +347 -0
- package/dist/project-git-cli.d.ts +5 -0
- package/dist/project-git-cli.js +40 -0
- package/dist/project-git-scenario-source.d.ts +10 -0
- package/dist/project-git-scenario-source.js +240 -0
- package/dist/project-git-view-source.d.ts +13 -0
- package/dist/project-git-view-source.js +134 -0
- package/dist/project-git.d.ts +97 -0
- package/dist/project-git.js +656 -0
- package/dist/project-host.d.ts +59 -0
- package/dist/project-host.js +471 -0
- package/dist/project-writer-lease.d.ts +18 -0
- package/dist/project-writer-lease.js +430 -0
- package/dist/public-error.d.ts +7 -0
- package/dist/public-error.js +61 -0
- package/dist/retrieval-benchmark.d.ts +46 -0
- package/dist/retrieval-benchmark.js +58 -0
- package/dist/safe-project-path.d.ts +8 -0
- package/dist/safe-project-path.js +93 -0
- package/dist/scenario-writer.d.ts +32 -0
- package/dist/scenario-writer.js +191 -0
- package/dist/transfer/download.d.ts +159 -0
- package/dist/transfer/download.js +598 -0
- package/dist/transfer/transport.d.ts +26 -0
- package/dist/transfer/transport.js +1 -0
- package/dist/transfer/upload.d.ts +162 -0
- package/dist/transfer/upload.js +354 -0
- package/dist/transfer-types.d.ts +95 -0
- package/dist/transfer-types.js +1 -0
- package/dist/transfer.d.ts +18 -0
- package/dist/transfer.js +273 -0
- package/dist/trigger-runtime.d.ts +121 -0
- package/dist/trigger-runtime.js +153 -0
- package/dist/vendor/wasm-core/asset-hashes.json +5 -0
- package/dist/vendor/wasm-core/wasm_core.d.ts +490 -0
- package/dist/vendor/wasm-core/wasm_core.js +1 -0
- package/dist/vendor/wasm-core/wasm_core_bg.wasm +0 -0
- package/dist/view-watcher.d.ts +9 -0
- package/dist/view-watcher.js +34 -0
- package/package.json +110 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export const PLANE_GENERATION_PROFILE = "plane-perlin-hydrology-v1";
|
|
2
|
+
export const SPHERE_GENERATION_PROFILE = "sphere-climate-v2";
|
|
3
|
+
export const SPHERE_CLIMATE_V2_IDENTITY = "sha256:76923954c7c8681a750e59d273539db5065a48a16d26c8980449891b5561cfd2";
|
|
4
|
+
export const PLANE_GENERATION_MAX_EXTENT_METERS = 1_000_000_000;
|
|
5
|
+
export const PLANE_GENERATION_MAX_ASPECT_RATIO = 64;
|
|
6
|
+
/** 生态颜色的唯一 authority;WASM 只输出稳定 biome id。 */
|
|
7
|
+
export const BIOME_PALETTE = Object.freeze([
|
|
8
|
+
{ id: "ocean", label: "海洋", color: "#1769aa" },
|
|
9
|
+
{ id: "freshwater", label: "湖泊", color: "#2f9ee5" },
|
|
10
|
+
{ id: "icecap", label: "冰盖", color: "#f7fbff" },
|
|
11
|
+
{ id: "permafrost", label: "永久冻土", color: "#b7d4d2" },
|
|
12
|
+
{ id: "tundra", label: "苔原", color: "#8f9d6a" },
|
|
13
|
+
{ id: "alpine", label: "高山", color: "#77777f" },
|
|
14
|
+
{ id: "desert", label: "荒漠", color: "#e3b341" },
|
|
15
|
+
{ id: "grassland", label: "草原", color: "#79ad45" },
|
|
16
|
+
{ id: "temperate", label: "温带林地", color: "#3f8f45" },
|
|
17
|
+
{ id: "rainforest", label: "热带雨林", color: "#075c36" },
|
|
18
|
+
]);
|
|
19
|
+
export const DEFAULT_PLANE_GENERATION = Object.freeze({
|
|
20
|
+
profile: PLANE_GENERATION_PROFILE,
|
|
21
|
+
seed: 2_050_986_450,
|
|
22
|
+
widthMeters: 100_000,
|
|
23
|
+
heightMeters: 100_000,
|
|
24
|
+
resolution: 256,
|
|
25
|
+
waterCoverage: 0.62,
|
|
26
|
+
relief: 0.38,
|
|
27
|
+
riverDensity: 0.5,
|
|
28
|
+
lakeDensity: 0.08,
|
|
29
|
+
rainfall: 1,
|
|
30
|
+
});
|
|
31
|
+
export const DEFAULT_WORLD_GENERATION = Object.freeze({
|
|
32
|
+
profile: SPHERE_GENERATION_PROFILE,
|
|
33
|
+
topology: "sphere",
|
|
34
|
+
seed: 2_050_986_450,
|
|
35
|
+
widthMeters: 40_030_000,
|
|
36
|
+
heightMeters: 20_015_000,
|
|
37
|
+
resolution: 512,
|
|
38
|
+
waterCoverage: 0.62,
|
|
39
|
+
relief: 0.38,
|
|
40
|
+
riverDensity: 0.5,
|
|
41
|
+
lakeDensity: 0.08,
|
|
42
|
+
rainfall: 1,
|
|
43
|
+
temperatureC: 30,
|
|
44
|
+
});
|
|
45
|
+
const LEGACY_KEYS = new Set([
|
|
46
|
+
"profile", "seed", "widthMeters", "heightMeters", "resolution", "waterCoverage", "relief",
|
|
47
|
+
"riverDensity", "lakeDensity", "rainfall",
|
|
48
|
+
]);
|
|
49
|
+
function isRecord(value) {
|
|
50
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
51
|
+
}
|
|
52
|
+
function finiteNumber(value, field) {
|
|
53
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
54
|
+
throw new TypeError(`${field} 必须是有限数`);
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
function boundedNumber(value, field, minimum, maximum) {
|
|
58
|
+
const number = finiteNumber(value, field);
|
|
59
|
+
if (number < minimum || number > maximum)
|
|
60
|
+
throw new RangeError(`${field} 必须位于 ${minimum}..${maximum}`);
|
|
61
|
+
return number;
|
|
62
|
+
}
|
|
63
|
+
function validateExactKeys(value, expected, label) {
|
|
64
|
+
const unknownKeys = Object.keys(value).filter((key) => !expected.has(key));
|
|
65
|
+
if (unknownKeys.length > 0)
|
|
66
|
+
throw new TypeError(`${label} 包含未知字段:${unknownKeys.join(", ")}`);
|
|
67
|
+
const missingKeys = [...expected].filter((key) => !Object.hasOwn(value, key));
|
|
68
|
+
if (missingKeys.length > 0)
|
|
69
|
+
throw new TypeError(`${label} 缺少字段:${missingKeys.join(", ")}`);
|
|
70
|
+
}
|
|
71
|
+
function validateSharedNumbers(value) {
|
|
72
|
+
const seed = finiteNumber(value.seed, "seed");
|
|
73
|
+
if (!Number.isInteger(seed) || seed < 0 || seed > 0xffff_ffff)
|
|
74
|
+
throw new RangeError("seed 必须是 uint32");
|
|
75
|
+
const widthMeters = boundedNumber(value.widthMeters, "widthMeters", 1, PLANE_GENERATION_MAX_EXTENT_METERS);
|
|
76
|
+
const heightMeters = boundedNumber(value.heightMeters, "heightMeters", 1, PLANE_GENERATION_MAX_EXTENT_METERS);
|
|
77
|
+
const resolution = finiteNumber(value.resolution, "resolution");
|
|
78
|
+
if (resolution !== 128 && resolution !== 256 && resolution !== 512) {
|
|
79
|
+
throw new RangeError("resolution 必须为 128、256 或 512");
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
seed,
|
|
83
|
+
widthMeters,
|
|
84
|
+
heightMeters,
|
|
85
|
+
resolution: resolution,
|
|
86
|
+
waterCoverage: boundedNumber(value.waterCoverage, "waterCoverage", 0, 0.95),
|
|
87
|
+
relief: boundedNumber(value.relief, "relief", 0, 1),
|
|
88
|
+
riverDensity: boundedNumber(value.riverDensity, "riverDensity", 0, 1),
|
|
89
|
+
lakeDensity: boundedNumber(value.lakeDensity, "lakeDensity", 0, 0.25),
|
|
90
|
+
rainfall: boundedNumber(value.rainfall, "rainfall", 0.1, 8),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/** 严格验证并返回按 profile 判别的 canonical 参数;未知字段不会被静默丢弃。 */
|
|
94
|
+
export function validatePlaneGeneration(value) {
|
|
95
|
+
if (!isRecord(value))
|
|
96
|
+
throw new TypeError("PlaneGenerationV1 必须是对象");
|
|
97
|
+
if (value.profile === PLANE_GENERATION_PROFILE) {
|
|
98
|
+
validateExactKeys(value, LEGACY_KEYS, "LegacyPlaneGenerationV1");
|
|
99
|
+
const shared = validateSharedNumbers(value);
|
|
100
|
+
if (Math.max(shared.widthMeters, shared.heightMeters) / Math.min(shared.widthMeters, shared.heightMeters)
|
|
101
|
+
> PLANE_GENERATION_MAX_ASPECT_RATIO) {
|
|
102
|
+
throw new RangeError(`widthMeters 与 heightMeters 的比例不得超过 ${PLANE_GENERATION_MAX_ASPECT_RATIO}:1`);
|
|
103
|
+
}
|
|
104
|
+
return Object.freeze({ profile: PLANE_GENERATION_PROFILE, ...shared });
|
|
105
|
+
}
|
|
106
|
+
// 旧球面 bytes 由 source compatibility 层只读保留;当前 authoring
|
|
107
|
+
// generation 入口不能接受或静默扁平化它们。
|
|
108
|
+
if (value.profile === SPHERE_GENERATION_PROFILE) {
|
|
109
|
+
throw new TypeError("当前空间生成仅支持平面 profile;历史球面数据不可编辑");
|
|
110
|
+
}
|
|
111
|
+
throw new TypeError(`profile 必须为 ${PLANE_GENERATION_PROFILE};当前空间生成仅支持平面`);
|
|
112
|
+
}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/* @ts-self-types="./plane-generator.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} input
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export function generate_plane_json(input) {
|
|
8
|
+
let deferred3_0;
|
|
9
|
+
let deferred3_1;
|
|
10
|
+
try {
|
|
11
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
12
|
+
const len0 = WASM_VECTOR_LEN;
|
|
13
|
+
const ret = wasm.generate_plane_json(ptr0, len0);
|
|
14
|
+
var ptr2 = ret[0];
|
|
15
|
+
var len2 = ret[1];
|
|
16
|
+
if (ret[3]) {
|
|
17
|
+
ptr2 = 0; len2 = 0;
|
|
18
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
19
|
+
}
|
|
20
|
+
deferred3_0 = ptr2;
|
|
21
|
+
deferred3_1 = len2;
|
|
22
|
+
return getStringFromWasm0(ptr2, len2);
|
|
23
|
+
} finally {
|
|
24
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 原始 terrain-roads-v1 core ABI,供行为测试和非 plane adapter 调用。
|
|
30
|
+
* @param {string} input
|
|
31
|
+
* @returns {string}
|
|
32
|
+
*/
|
|
33
|
+
export function generate_road_network_json(input) {
|
|
34
|
+
let deferred3_0;
|
|
35
|
+
let deferred3_1;
|
|
36
|
+
try {
|
|
37
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
38
|
+
const len0 = WASM_VECTOR_LEN;
|
|
39
|
+
const ret = wasm.generate_road_network_json(ptr0, len0);
|
|
40
|
+
var ptr2 = ret[0];
|
|
41
|
+
var len2 = ret[1];
|
|
42
|
+
if (ret[3]) {
|
|
43
|
+
ptr2 = 0; len2 = 0;
|
|
44
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
45
|
+
}
|
|
46
|
+
deferred3_0 = ptr2;
|
|
47
|
+
deferred3_1 = len2;
|
|
48
|
+
return getStringFromWasm0(ptr2, len2);
|
|
49
|
+
} finally {
|
|
50
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 为旧平面地形生成固定、与相机无关的道路缓存。
|
|
56
|
+
*
|
|
57
|
+
* sphere-climate-v2 尚未接入此 plane-only adapter;调用者须按 profile
|
|
58
|
+
* 明确选择适配器,不能把球面参数悄然降级为平面。
|
|
59
|
+
* @param {string} input
|
|
60
|
+
* @returns {string}
|
|
61
|
+
*/
|
|
62
|
+
export function generate_world_roads_json(input) {
|
|
63
|
+
let deferred3_0;
|
|
64
|
+
let deferred3_1;
|
|
65
|
+
try {
|
|
66
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
67
|
+
const len0 = WASM_VECTOR_LEN;
|
|
68
|
+
const ret = wasm.generate_world_roads_json(ptr0, len0);
|
|
69
|
+
var ptr2 = ret[0];
|
|
70
|
+
var len2 = ret[1];
|
|
71
|
+
if (ret[3]) {
|
|
72
|
+
ptr2 = 0; len2 = 0;
|
|
73
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
74
|
+
}
|
|
75
|
+
deferred3_0 = ptr2;
|
|
76
|
+
deferred3_1 = len2;
|
|
77
|
+
return getStringFromWasm0(ptr2, len2);
|
|
78
|
+
} finally {
|
|
79
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @param {string} input
|
|
85
|
+
* @returns {string}
|
|
86
|
+
*/
|
|
87
|
+
export function sample_plane_tile_json(input) {
|
|
88
|
+
let deferred3_0;
|
|
89
|
+
let deferred3_1;
|
|
90
|
+
try {
|
|
91
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
92
|
+
const len0 = WASM_VECTOR_LEN;
|
|
93
|
+
const ret = wasm.sample_plane_tile_json(ptr0, len0);
|
|
94
|
+
var ptr2 = ret[0];
|
|
95
|
+
var len2 = ret[1];
|
|
96
|
+
if (ret[3]) {
|
|
97
|
+
ptr2 = 0; len2 = 0;
|
|
98
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
99
|
+
}
|
|
100
|
+
deferred3_0 = ptr2;
|
|
101
|
+
deferred3_1 = len2;
|
|
102
|
+
return getStringFromWasm0(ptr2, len2);
|
|
103
|
+
} finally {
|
|
104
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function __wbg_get_imports() {
|
|
108
|
+
const import0 = {
|
|
109
|
+
__proto__: null,
|
|
110
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
111
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
112
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
113
|
+
return ret;
|
|
114
|
+
},
|
|
115
|
+
__wbindgen_init_externref_table: function() {
|
|
116
|
+
const table = wasm.__wbindgen_externrefs;
|
|
117
|
+
const offset = table.grow(4);
|
|
118
|
+
table.set(0, undefined);
|
|
119
|
+
table.set(offset + 0, undefined);
|
|
120
|
+
table.set(offset + 1, null);
|
|
121
|
+
table.set(offset + 2, true);
|
|
122
|
+
table.set(offset + 3, false);
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
__proto__: null,
|
|
127
|
+
"./plane-generator_bg.js": import0,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function getStringFromWasm0(ptr, len) {
|
|
132
|
+
return decodeText(ptr >>> 0, len);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let cachedUint8ArrayMemory0 = null;
|
|
136
|
+
function getUint8ArrayMemory0() {
|
|
137
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
138
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
139
|
+
}
|
|
140
|
+
return cachedUint8ArrayMemory0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
144
|
+
if (realloc === undefined) {
|
|
145
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
146
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
147
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
148
|
+
WASM_VECTOR_LEN = buf.length;
|
|
149
|
+
return ptr;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
let len = arg.length;
|
|
153
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
154
|
+
|
|
155
|
+
const mem = getUint8ArrayMemory0();
|
|
156
|
+
|
|
157
|
+
let offset = 0;
|
|
158
|
+
|
|
159
|
+
for (; offset < len; offset++) {
|
|
160
|
+
const code = arg.charCodeAt(offset);
|
|
161
|
+
if (code > 0x7F) break;
|
|
162
|
+
mem[ptr + offset] = code;
|
|
163
|
+
}
|
|
164
|
+
if (offset !== len) {
|
|
165
|
+
if (offset !== 0) {
|
|
166
|
+
arg = arg.slice(offset);
|
|
167
|
+
}
|
|
168
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
169
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
170
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
171
|
+
|
|
172
|
+
offset += ret.written;
|
|
173
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
WASM_VECTOR_LEN = offset;
|
|
177
|
+
return ptr;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function takeFromExternrefTable0(idx) {
|
|
181
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
182
|
+
wasm.__externref_table_dealloc(idx);
|
|
183
|
+
return value;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
187
|
+
cachedTextDecoder.decode();
|
|
188
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
189
|
+
let numBytesDecoded = 0;
|
|
190
|
+
function decodeText(ptr, len) {
|
|
191
|
+
numBytesDecoded += len;
|
|
192
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
193
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
194
|
+
cachedTextDecoder.decode();
|
|
195
|
+
numBytesDecoded = len;
|
|
196
|
+
}
|
|
197
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const cachedTextEncoder = new TextEncoder();
|
|
201
|
+
|
|
202
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
203
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
204
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
205
|
+
view.set(buf);
|
|
206
|
+
return {
|
|
207
|
+
read: arg.length,
|
|
208
|
+
written: buf.length
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
let WASM_VECTOR_LEN = 0;
|
|
214
|
+
|
|
215
|
+
let wasmModule, wasmInstance, wasm;
|
|
216
|
+
function __wbg_finalize_init(instance, module) {
|
|
217
|
+
wasmInstance = instance;
|
|
218
|
+
wasm = instance.exports;
|
|
219
|
+
wasmModule = module;
|
|
220
|
+
cachedUint8ArrayMemory0 = null;
|
|
221
|
+
wasm.__wbindgen_start();
|
|
222
|
+
return wasm;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
async function __wbg_load(module, imports) {
|
|
226
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
227
|
+
if (!module.ok) {
|
|
228
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
232
|
+
try {
|
|
233
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
234
|
+
} catch (e) {
|
|
235
|
+
const validResponse = expectedResponseType(module.type);
|
|
236
|
+
|
|
237
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
238
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
239
|
+
|
|
240
|
+
} else { throw e; }
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const bytes = await module.arrayBuffer();
|
|
245
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
246
|
+
} else {
|
|
247
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
248
|
+
|
|
249
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
250
|
+
return { instance, module };
|
|
251
|
+
} else {
|
|
252
|
+
return instance;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function expectedResponseType(type) {
|
|
257
|
+
switch (type) {
|
|
258
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
259
|
+
}
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function initSync(module) {
|
|
265
|
+
if (wasm !== undefined) return wasm;
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
if (module !== undefined) {
|
|
269
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
270
|
+
({module} = module)
|
|
271
|
+
} else {
|
|
272
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const imports = __wbg_get_imports();
|
|
277
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
278
|
+
module = new WebAssembly.Module(module);
|
|
279
|
+
}
|
|
280
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
281
|
+
return __wbg_finalize_init(instance, module);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
async function __wbg_init(module_or_path) {
|
|
285
|
+
if (wasm !== undefined) return wasm;
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
if (module_or_path !== undefined) {
|
|
289
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
290
|
+
({module_or_path} = module_or_path)
|
|
291
|
+
} else {
|
|
292
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (module_or_path === undefined) {
|
|
297
|
+
module_or_path = new URL('plane-generator_bg.wasm', import.meta.url);
|
|
298
|
+
}
|
|
299
|
+
const imports = __wbg_get_imports();
|
|
300
|
+
|
|
301
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
302
|
+
module_or_path = fetch(module_or_path);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
306
|
+
|
|
307
|
+
return __wbg_finalize_init(instance, module);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|