@al8b/runtime 0.1.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 +87 -0
- package/dist/assets/constructors.d.mts +6 -0
- package/dist/assets/constructors.d.ts +6 -0
- package/dist/assets/constructors.js +40 -0
- package/dist/assets/constructors.js.map +1 -0
- package/dist/assets/constructors.mjs +12 -0
- package/dist/assets/constructors.mjs.map +1 -0
- package/dist/assets/index.d.mts +11 -0
- package/dist/assets/index.d.ts +11 -0
- package/dist/assets/index.js +276 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/assets/index.mjs +247 -0
- package/dist/assets/index.mjs.map +1 -0
- package/dist/assets/loader.d.mts +83 -0
- package/dist/assets/loader.d.ts +83 -0
- package/dist/assets/loader.js +260 -0
- package/dist/assets/loader.js.map +1 -0
- package/dist/assets/loader.mjs +237 -0
- package/dist/assets/loader.mjs.map +1 -0
- package/dist/browser/index.js +16599 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/index.min.js +171 -0
- package/dist/constants.d.mts +16 -0
- package/dist/constants.d.ts +16 -0
- package/dist/constants.js +49 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +18 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/core/api-factory.d.mts +63 -0
- package/dist/core/api-factory.d.ts +63 -0
- package/dist/core/api-factory.js +239 -0
- package/dist/core/api-factory.js.map +1 -0
- package/dist/core/api-factory.mjs +214 -0
- package/dist/core/api-factory.mjs.map +1 -0
- package/dist/core/assets-registry.d.mts +14 -0
- package/dist/core/assets-registry.d.ts +14 -0
- package/dist/core/assets-registry.js +64 -0
- package/dist/core/assets-registry.js.map +1 -0
- package/dist/core/assets-registry.mjs +41 -0
- package/dist/core/assets-registry.mjs.map +1 -0
- package/dist/core/controller.d.mts +109 -0
- package/dist/core/controller.d.ts +109 -0
- package/dist/core/controller.js +1782 -0
- package/dist/core/controller.js.map +1 -0
- package/dist/core/controller.mjs +1758 -0
- package/dist/core/controller.mjs.map +1 -0
- package/dist/core/debug-logger.d.mts +35 -0
- package/dist/core/debug-logger.d.ts +35 -0
- package/dist/core/debug-logger.js +177 -0
- package/dist/core/debug-logger.js.map +1 -0
- package/dist/core/debug-logger.mjs +154 -0
- package/dist/core/debug-logger.mjs.map +1 -0
- package/dist/core/error-handler.d.mts +25 -0
- package/dist/core/error-handler.d.ts +25 -0
- package/dist/core/error-handler.js +106 -0
- package/dist/core/error-handler.js.map +1 -0
- package/dist/core/error-handler.mjs +81 -0
- package/dist/core/error-handler.mjs.map +1 -0
- package/dist/core/index.d.mts +14 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.js +1782 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/index.mjs +1757 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/hot-reload/index.d.mts +7 -0
- package/dist/hot-reload/index.d.ts +7 -0
- package/dist/hot-reload/index.js +103 -0
- package/dist/hot-reload/index.js.map +1 -0
- package/dist/hot-reload/index.mjs +78 -0
- package/dist/hot-reload/index.mjs.map +1 -0
- package/dist/hot-reload/updater.d.mts +33 -0
- package/dist/hot-reload/updater.d.ts +33 -0
- package/dist/hot-reload/updater.js +101 -0
- package/dist/hot-reload/updater.js.map +1 -0
- package/dist/hot-reload/updater.mjs +78 -0
- package/dist/hot-reload/updater.mjs.map +1 -0
- package/dist/index.d.mts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +1859 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1817 -0
- package/dist/index.mjs.map +1 -0
- package/dist/input/index.d.mts +2 -0
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +79 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/index.mjs +54 -0
- package/dist/input/index.mjs.map +1 -0
- package/dist/input/manager.d.mts +37 -0
- package/dist/input/manager.d.ts +37 -0
- package/dist/input/manager.js +77 -0
- package/dist/input/manager.js.map +1 -0
- package/dist/input/manager.mjs +54 -0
- package/dist/input/manager.mjs.map +1 -0
- package/dist/loop/game-loop.d.mts +63 -0
- package/dist/loop/game-loop.d.ts +63 -0
- package/dist/loop/game-loop.js +156 -0
- package/dist/loop/game-loop.js.map +1 -0
- package/dist/loop/game-loop.mjs +131 -0
- package/dist/loop/game-loop.mjs.map +1 -0
- package/dist/loop/index.d.mts +1 -0
- package/dist/loop/index.d.ts +1 -0
- package/dist/loop/index.js +156 -0
- package/dist/loop/index.js.map +1 -0
- package/dist/loop/index.mjs +131 -0
- package/dist/loop/index.mjs.map +1 -0
- package/dist/storage/index.d.mts +1 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +31 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/index.mjs +6 -0
- package/dist/storage/index.mjs.map +1 -0
- package/dist/system/api.d.mts +28 -0
- package/dist/system/api.d.ts +28 -0
- package/dist/system/api.js +126 -0
- package/dist/system/api.js.map +1 -0
- package/dist/system/api.mjs +101 -0
- package/dist/system/api.mjs.map +1 -0
- package/dist/system/index.d.mts +2 -0
- package/dist/system/index.d.ts +2 -0
- package/dist/system/index.js +126 -0
- package/dist/system/index.js.map +1 -0
- package/dist/system/index.mjs +101 -0
- package/dist/system/index.mjs.map +1 -0
- package/dist/types/assets.d.mts +43 -0
- package/dist/types/assets.d.ts +43 -0
- package/dist/types/assets.js +19 -0
- package/dist/types/assets.js.map +1 -0
- package/dist/types/assets.mjs +1 -0
- package/dist/types/assets.mjs.map +1 -0
- package/dist/types/bridge.d.mts +66 -0
- package/dist/types/bridge.d.ts +66 -0
- package/dist/types/bridge.js +19 -0
- package/dist/types/bridge.js.map +1 -0
- package/dist/types/bridge.mjs +1 -0
- package/dist/types/bridge.mjs.map +1 -0
- package/dist/types/index.d.mts +6 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/runtime.d.mts +71 -0
- package/dist/types/runtime.d.ts +71 -0
- package/dist/types/runtime.js +19 -0
- package/dist/types/runtime.js.map +1 -0
- package/dist/types/runtime.mjs +1 -0
- package/dist/types/runtime.mjs.map +1 -0
- package/dist/types/vm.d.mts +1 -0
- package/dist/types/vm.d.ts +1 -0
- package/dist/types/vm.js +19 -0
- package/dist/types/vm.js.map +1 -0
- package/dist/types/vm.mjs +1 -0
- package/dist/types/vm.mjs.map +1 -0
- package/dist/utils/deep-clone.d.mts +14 -0
- package/dist/utils/deep-clone.d.ts +14 -0
- package/dist/utils/deep-clone.js +42 -0
- package/dist/utils/deep-clone.js.map +1 -0
- package/dist/utils/deep-clone.mjs +19 -0
- package/dist/utils/deep-clone.mjs.map +1 -0
- package/dist/utils/index.d.mts +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +156 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +129 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/object-pool.d.mts +66 -0
- package/dist/utils/object-pool.d.ts +66 -0
- package/dist/utils/object-pool.js +113 -0
- package/dist/utils/object-pool.js.map +1 -0
- package/dist/utils/object-pool.mjs +90 -0
- package/dist/utils/object-pool.mjs.map +1 -0
- package/dist/utils/shallow-equal.d.mts +15 -0
- package/dist/utils/shallow-equal.d.ts +15 -0
- package/dist/utils/shallow-equal.js +53 -0
- package/dist/utils/shallow-equal.js.map +1 -0
- package/dist/utils/shallow-equal.mjs +30 -0
- package/dist/utils/shallow-equal.mjs.map +1 -0
- package/dist/vm/index.d.mts +1 -0
- package/dist/vm/index.d.ts +1 -0
- package/dist/vm/index.js +37 -0
- package/dist/vm/index.js.map +1 -0
- package/dist/vm/index.mjs +9 -0
- package/dist/vm/index.mjs.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/system/index.ts","../../src/constants.ts","../../src/system/api.ts"],"sourcesContent":["/**\n * System API exports\n */\n\nexport { System } from \"./api\";\n","/** Default frames per second */\nexport const DEFAULT_FPS = 60;\n\n/** Default update rate (updates per second) */\nexport const DEFAULT_UPDATE_RATE = 60;\n\n/** Frame time in milliseconds at 60 FPS */\nexport const FRAME_TIME_MS = 1000 / DEFAULT_FPS;\n\n/** Threshold in ms to detect long pauses (tab switch, etc.) */\nexport const PAUSE_THRESHOLD_MS = 160;\n\n/** Default tile/block size in pixels */\nexport const DEFAULT_BLOCK_SIZE = 16;\n\n/** Minimum interval between loading bar redraws in ms (~60fps) */\nexport const LOADING_BAR_THROTTLE_MS = 16;\n\n/** Timeout in ms for individual asset loads (sprite/map HTTP requests) */\nexport const ASSET_LOAD_TIMEOUT_MS = 30_000;\n","/**\n * System API - System information and control\n */\n\nimport type { SystemAPI } from \"@al8b/vm\";\nimport { DEFAULT_FPS, DEFAULT_UPDATE_RATE } from \"../constants\";\n\nexport class System {\n\tprivate systemAPI: SystemAPI;\n\n\tconstructor() {\n\t\t// Create system API with mutable state\n\t\tthis.systemAPI = {\n\t\t\t// Time\n\t\t\tget time() {\n\t\t\t\treturn Date.now();\n\t\t\t},\n\n\t\t\t// FPS\n\t\t\tfps: DEFAULT_FPS,\n\n\t\t\t// CPU load\n\t\t\tcpu_load: 0,\n\n\t\t\t// Update rate\n\t\t\tupdate_rate: DEFAULT_UPDATE_RATE,\n\n\t\t\t// Language\n\t\t\tget language() {\n\t\t\t\treturn typeof navigator !== \"undefined\" ? navigator.language : \"en\";\n\t\t\t},\n\n\t\t\t// Input availability\n\t\t\tinputs: {\n\t\t\t\tget keyboard() {\n\t\t\t\t\treturn 1;\n\t\t\t\t},\n\t\t\t\tget mouse() {\n\t\t\t\t\treturn 1;\n\t\t\t\t},\n\t\t\t\tget touch() {\n\t\t\t\t\treturn typeof window !== \"undefined\" && \"ontouchstart\" in window ? 1 : 0;\n\t\t\t\t},\n\t\t\t\tget gamepad() {\n\t\t\t\t\treturn typeof navigator !== \"undefined\" && typeof navigator.getGamepads === \"function\" ? 1 : 0;\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Loading progress\n\t\t\tloading: 0,\n\n\t\t\t// Utility functions\n\t\t\tprompt: (text: string, callback: (result: string) => void) => {\n\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\tconst result = window.prompt(text);\n\t\t\t\t\tif (result !== null && callback) {\n\t\t\t\t\t\tcallback(result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tsay: (text: string) => {\n\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\twindow.alert(text);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// File drop support\n\t\t\tfile: {\n\t\t\t\tdropped: 0,\n\t\t\t},\n\n\t\t\t// JavaScript interop (placeholder for future use)\n\t\t\tjavascript: {},\n\n\t\t\t// Additional flags\n\t\t\tdisable_autofullscreen: 0,\n\t\t\tpreemptive: 1,\n\t\t};\n\t}\n\n\t/**\n\t * Get system API for game code\n\t */\n\tgetAPI(): SystemAPI {\n\t\treturn this.systemAPI;\n\t}\n\n\t/**\n\t * Update FPS\n\t */\n\tsetFPS(fps: number): void {\n\t\tthis.systemAPI.fps = fps;\n\t}\n\n\t/**\n\t * Update CPU load\n\t */\n\tsetCPULoad(load: number): void {\n\t\tthis.systemAPI.cpu_load = load;\n\t}\n\n\t/**\n\t * Update loading progress\n\t */\n\tsetLoading(progress: number): void {\n\t\tthis.systemAPI.loading = progress;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACCO,IAAMA,cAAc;AAGpB,IAAMC,sBAAsB;AAG5B,IAAMC,gBAAgB,MAAOF;;;ACA7B,IAAMG,SAAN,MAAMA;EAPb,OAOaA;;;EACJC;EAER,cAAc;AAEb,SAAKA,YAAY;;MAEhB,IAAIC,OAAO;AACV,eAAOC,KAAKC,IAAG;MAChB;;MAGAC,KAAKC;;MAGLC,UAAU;;MAGVC,aAAaC;;MAGb,IAAIC,WAAW;AACd,eAAO,OAAOC,cAAc,cAAcA,UAAUD,WAAW;MAChE;;MAGAE,QAAQ;QACP,IAAIC,WAAW;AACd,iBAAO;QACR;QACA,IAAIC,QAAQ;AACX,iBAAO;QACR;QACA,IAAIC,QAAQ;AACX,iBAAO,OAAOC,WAAW,eAAe,kBAAkBA,SAAS,IAAI;QACxE;QACA,IAAIC,UAAU;AACb,iBAAO,OAAON,cAAc,eAAe,OAAOA,UAAUO,gBAAgB,aAAa,IAAI;QAC9F;MACD;;MAGAC,SAAS;;MAGTC,QAAQ,wBAACC,MAAcC,aAAAA;AACtB,YAAI,OAAON,WAAW,aAAa;AAClC,gBAAMO,SAASP,OAAOI,OAAOC,IAAAA;AAC7B,cAAIE,WAAW,QAAQD,UAAU;AAChCA,qBAASC,MAAAA;UACV;QACD;MACD,GAPQ;MASRC,KAAK,wBAACH,SAAAA;AACL,YAAI,OAAOL,WAAW,aAAa;AAClCA,iBAAOS,MAAMJ,IAAAA;QACd;MACD,GAJK;;MAOLK,MAAM;QACLC,SAAS;MACV;;MAGAC,YAAY,CAAC;;MAGbC,wBAAwB;MACxBC,YAAY;IACb;EACD;;;;EAKAC,SAAoB;AACnB,WAAO,KAAK9B;EACb;;;;EAKA+B,OAAO3B,KAAmB;AACzB,SAAKJ,UAAUI,MAAMA;EACtB;;;;EAKA4B,WAAWC,MAAoB;AAC9B,SAAKjC,UAAUM,WAAW2B;EAC3B;;;;EAKAC,WAAWC,UAAwB;AAClC,SAAKnC,UAAUkB,UAAUiB;EAC1B;AACD;","names":["DEFAULT_FPS","DEFAULT_UPDATE_RATE","FRAME_TIME_MS","System","systemAPI","time","Date","now","fps","DEFAULT_FPS","cpu_load","update_rate","DEFAULT_UPDATE_RATE","language","navigator","inputs","keyboard","mouse","touch","window","gamepad","getGamepads","loading","prompt","text","callback","result","say","alert","file","dropped","javascript","disable_autofullscreen","preemptive","getAPI","setFPS","setCPULoad","load","setLoading","progress"]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/constants.ts
|
|
5
|
+
var DEFAULT_FPS = 60;
|
|
6
|
+
var DEFAULT_UPDATE_RATE = 60;
|
|
7
|
+
var FRAME_TIME_MS = 1e3 / DEFAULT_FPS;
|
|
8
|
+
|
|
9
|
+
// src/system/api.ts
|
|
10
|
+
var System = class {
|
|
11
|
+
static {
|
|
12
|
+
__name(this, "System");
|
|
13
|
+
}
|
|
14
|
+
systemAPI;
|
|
15
|
+
constructor() {
|
|
16
|
+
this.systemAPI = {
|
|
17
|
+
// Time
|
|
18
|
+
get time() {
|
|
19
|
+
return Date.now();
|
|
20
|
+
},
|
|
21
|
+
// FPS
|
|
22
|
+
fps: DEFAULT_FPS,
|
|
23
|
+
// CPU load
|
|
24
|
+
cpu_load: 0,
|
|
25
|
+
// Update rate
|
|
26
|
+
update_rate: DEFAULT_UPDATE_RATE,
|
|
27
|
+
// Language
|
|
28
|
+
get language() {
|
|
29
|
+
return typeof navigator !== "undefined" ? navigator.language : "en";
|
|
30
|
+
},
|
|
31
|
+
// Input availability
|
|
32
|
+
inputs: {
|
|
33
|
+
get keyboard() {
|
|
34
|
+
return 1;
|
|
35
|
+
},
|
|
36
|
+
get mouse() {
|
|
37
|
+
return 1;
|
|
38
|
+
},
|
|
39
|
+
get touch() {
|
|
40
|
+
return typeof window !== "undefined" && "ontouchstart" in window ? 1 : 0;
|
|
41
|
+
},
|
|
42
|
+
get gamepad() {
|
|
43
|
+
return typeof navigator !== "undefined" && typeof navigator.getGamepads === "function" ? 1 : 0;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
// Loading progress
|
|
47
|
+
loading: 0,
|
|
48
|
+
// Utility functions
|
|
49
|
+
prompt: /* @__PURE__ */ __name((text, callback) => {
|
|
50
|
+
if (typeof window !== "undefined") {
|
|
51
|
+
const result = window.prompt(text);
|
|
52
|
+
if (result !== null && callback) {
|
|
53
|
+
callback(result);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, "prompt"),
|
|
57
|
+
say: /* @__PURE__ */ __name((text) => {
|
|
58
|
+
if (typeof window !== "undefined") {
|
|
59
|
+
window.alert(text);
|
|
60
|
+
}
|
|
61
|
+
}, "say"),
|
|
62
|
+
// File drop support
|
|
63
|
+
file: {
|
|
64
|
+
dropped: 0
|
|
65
|
+
},
|
|
66
|
+
// JavaScript interop (placeholder for future use)
|
|
67
|
+
javascript: {},
|
|
68
|
+
// Additional flags
|
|
69
|
+
disable_autofullscreen: 0,
|
|
70
|
+
preemptive: 1
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get system API for game code
|
|
75
|
+
*/
|
|
76
|
+
getAPI() {
|
|
77
|
+
return this.systemAPI;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Update FPS
|
|
81
|
+
*/
|
|
82
|
+
setFPS(fps) {
|
|
83
|
+
this.systemAPI.fps = fps;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Update CPU load
|
|
87
|
+
*/
|
|
88
|
+
setCPULoad(load) {
|
|
89
|
+
this.systemAPI.cpu_load = load;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Update loading progress
|
|
93
|
+
*/
|
|
94
|
+
setLoading(progress) {
|
|
95
|
+
this.systemAPI.loading = progress;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
export {
|
|
99
|
+
System
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/constants.ts","../../src/system/api.ts"],"sourcesContent":["/** Default frames per second */\nexport const DEFAULT_FPS = 60;\n\n/** Default update rate (updates per second) */\nexport const DEFAULT_UPDATE_RATE = 60;\n\n/** Frame time in milliseconds at 60 FPS */\nexport const FRAME_TIME_MS = 1000 / DEFAULT_FPS;\n\n/** Threshold in ms to detect long pauses (tab switch, etc.) */\nexport const PAUSE_THRESHOLD_MS = 160;\n\n/** Default tile/block size in pixels */\nexport const DEFAULT_BLOCK_SIZE = 16;\n\n/** Minimum interval between loading bar redraws in ms (~60fps) */\nexport const LOADING_BAR_THROTTLE_MS = 16;\n\n/** Timeout in ms for individual asset loads (sprite/map HTTP requests) */\nexport const ASSET_LOAD_TIMEOUT_MS = 30_000;\n","/**\n * System API - System information and control\n */\n\nimport type { SystemAPI } from \"@al8b/vm\";\nimport { DEFAULT_FPS, DEFAULT_UPDATE_RATE } from \"../constants\";\n\nexport class System {\n\tprivate systemAPI: SystemAPI;\n\n\tconstructor() {\n\t\t// Create system API with mutable state\n\t\tthis.systemAPI = {\n\t\t\t// Time\n\t\t\tget time() {\n\t\t\t\treturn Date.now();\n\t\t\t},\n\n\t\t\t// FPS\n\t\t\tfps: DEFAULT_FPS,\n\n\t\t\t// CPU load\n\t\t\tcpu_load: 0,\n\n\t\t\t// Update rate\n\t\t\tupdate_rate: DEFAULT_UPDATE_RATE,\n\n\t\t\t// Language\n\t\t\tget language() {\n\t\t\t\treturn typeof navigator !== \"undefined\" ? navigator.language : \"en\";\n\t\t\t},\n\n\t\t\t// Input availability\n\t\t\tinputs: {\n\t\t\t\tget keyboard() {\n\t\t\t\t\treturn 1;\n\t\t\t\t},\n\t\t\t\tget mouse() {\n\t\t\t\t\treturn 1;\n\t\t\t\t},\n\t\t\t\tget touch() {\n\t\t\t\t\treturn typeof window !== \"undefined\" && \"ontouchstart\" in window ? 1 : 0;\n\t\t\t\t},\n\t\t\t\tget gamepad() {\n\t\t\t\t\treturn typeof navigator !== \"undefined\" && typeof navigator.getGamepads === \"function\" ? 1 : 0;\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// Loading progress\n\t\t\tloading: 0,\n\n\t\t\t// Utility functions\n\t\t\tprompt: (text: string, callback: (result: string) => void) => {\n\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\tconst result = window.prompt(text);\n\t\t\t\t\tif (result !== null && callback) {\n\t\t\t\t\t\tcallback(result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tsay: (text: string) => {\n\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\twindow.alert(text);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// File drop support\n\t\t\tfile: {\n\t\t\t\tdropped: 0,\n\t\t\t},\n\n\t\t\t// JavaScript interop (placeholder for future use)\n\t\t\tjavascript: {},\n\n\t\t\t// Additional flags\n\t\t\tdisable_autofullscreen: 0,\n\t\t\tpreemptive: 1,\n\t\t};\n\t}\n\n\t/**\n\t * Get system API for game code\n\t */\n\tgetAPI(): SystemAPI {\n\t\treturn this.systemAPI;\n\t}\n\n\t/**\n\t * Update FPS\n\t */\n\tsetFPS(fps: number): void {\n\t\tthis.systemAPI.fps = fps;\n\t}\n\n\t/**\n\t * Update CPU load\n\t */\n\tsetCPULoad(load: number): void {\n\t\tthis.systemAPI.cpu_load = load;\n\t}\n\n\t/**\n\t * Update loading progress\n\t */\n\tsetLoading(progress: number): void {\n\t\tthis.systemAPI.loading = progress;\n\t}\n}\n"],"mappings":";;;;AACO,IAAMA,cAAc;AAGpB,IAAMC,sBAAsB;AAG5B,IAAMC,gBAAgB,MAAOF;;;ACA7B,IAAMG,SAAN,MAAMA;EAPb,OAOaA;;;EACJC;EAER,cAAc;AAEb,SAAKA,YAAY;;MAEhB,IAAIC,OAAO;AACV,eAAOC,KAAKC,IAAG;MAChB;;MAGAC,KAAKC;;MAGLC,UAAU;;MAGVC,aAAaC;;MAGb,IAAIC,WAAW;AACd,eAAO,OAAOC,cAAc,cAAcA,UAAUD,WAAW;MAChE;;MAGAE,QAAQ;QACP,IAAIC,WAAW;AACd,iBAAO;QACR;QACA,IAAIC,QAAQ;AACX,iBAAO;QACR;QACA,IAAIC,QAAQ;AACX,iBAAO,OAAOC,WAAW,eAAe,kBAAkBA,SAAS,IAAI;QACxE;QACA,IAAIC,UAAU;AACb,iBAAO,OAAON,cAAc,eAAe,OAAOA,UAAUO,gBAAgB,aAAa,IAAI;QAC9F;MACD;;MAGAC,SAAS;;MAGTC,QAAQ,wBAACC,MAAcC,aAAAA;AACtB,YAAI,OAAON,WAAW,aAAa;AAClC,gBAAMO,SAASP,OAAOI,OAAOC,IAAAA;AAC7B,cAAIE,WAAW,QAAQD,UAAU;AAChCA,qBAASC,MAAAA;UACV;QACD;MACD,GAPQ;MASRC,KAAK,wBAACH,SAAAA;AACL,YAAI,OAAOL,WAAW,aAAa;AAClCA,iBAAOS,MAAMJ,IAAAA;QACd;MACD,GAJK;;MAOLK,MAAM;QACLC,SAAS;MACV;;MAGAC,YAAY,CAAC;;MAGbC,wBAAwB;MACxBC,YAAY;IACb;EACD;;;;EAKAC,SAAoB;AACnB,WAAO,KAAK9B;EACb;;;;EAKA+B,OAAO3B,KAAmB;AACzB,SAAKJ,UAAUI,MAAMA;EACtB;;;;EAKA4B,WAAWC,MAAoB;AAC9B,SAAKjC,UAAUM,WAAW2B;EAC3B;;;;EAKAC,WAAWC,UAAwB;AAClC,SAAKnC,UAAUkB,UAAUiB;EAC1B;AACD;","names":["DEFAULT_FPS","DEFAULT_UPDATE_RATE","FRAME_TIME_MS","System","systemAPI","time","Date","now","fps","DEFAULT_FPS","cpu_load","update_rate","DEFAULT_UPDATE_RATE","language","navigator","inputs","keyboard","mouse","touch","window","gamepad","getGamepads","loading","prompt","text","callback","result","say","alert","file","dropped","javascript","disable_autofullscreen","preemptive","getAPI","setFPS","setCPULoad","load","setLoading","progress"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset type definitions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Resources metadata
|
|
6
|
+
*/
|
|
7
|
+
interface Resources {
|
|
8
|
+
/** Image/sprite resources */
|
|
9
|
+
images?: ResourceFile[];
|
|
10
|
+
/** Map resources */
|
|
11
|
+
maps?: ResourceFile[];
|
|
12
|
+
/** Sound resources */
|
|
13
|
+
sounds?: ResourceFile[];
|
|
14
|
+
/** Music resources */
|
|
15
|
+
music?: ResourceFile[];
|
|
16
|
+
/** Generic asset resources */
|
|
17
|
+
assets?: ResourceFile[];
|
|
18
|
+
/** Source code files */
|
|
19
|
+
sources?: ResourceFile[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Resource file metadata
|
|
23
|
+
*/
|
|
24
|
+
interface ResourceFile {
|
|
25
|
+
/** File name */
|
|
26
|
+
file: string;
|
|
27
|
+
/** Version/hash for cache busting */
|
|
28
|
+
version?: string | number;
|
|
29
|
+
/** Additional properties (for sprites, etc) */
|
|
30
|
+
properties?: any;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Asset collections
|
|
34
|
+
*/
|
|
35
|
+
interface AssetCollections {
|
|
36
|
+
sprites: Record<string, any>;
|
|
37
|
+
maps: Record<string, any>;
|
|
38
|
+
sounds: Record<string, any>;
|
|
39
|
+
music: Record<string, any>;
|
|
40
|
+
assets: Record<string, any>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type { AssetCollections, ResourceFile, Resources };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset type definitions
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Resources metadata
|
|
6
|
+
*/
|
|
7
|
+
interface Resources {
|
|
8
|
+
/** Image/sprite resources */
|
|
9
|
+
images?: ResourceFile[];
|
|
10
|
+
/** Map resources */
|
|
11
|
+
maps?: ResourceFile[];
|
|
12
|
+
/** Sound resources */
|
|
13
|
+
sounds?: ResourceFile[];
|
|
14
|
+
/** Music resources */
|
|
15
|
+
music?: ResourceFile[];
|
|
16
|
+
/** Generic asset resources */
|
|
17
|
+
assets?: ResourceFile[];
|
|
18
|
+
/** Source code files */
|
|
19
|
+
sources?: ResourceFile[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Resource file metadata
|
|
23
|
+
*/
|
|
24
|
+
interface ResourceFile {
|
|
25
|
+
/** File name */
|
|
26
|
+
file: string;
|
|
27
|
+
/** Version/hash for cache busting */
|
|
28
|
+
version?: string | number;
|
|
29
|
+
/** Additional properties (for sprites, etc) */
|
|
30
|
+
properties?: any;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Asset collections
|
|
34
|
+
*/
|
|
35
|
+
interface AssetCollections {
|
|
36
|
+
sprites: Record<string, any>;
|
|
37
|
+
maps: Record<string, any>;
|
|
38
|
+
sounds: Record<string, any>;
|
|
39
|
+
music: Record<string, any>;
|
|
40
|
+
assets: Record<string, any>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type { AssetCollections, ResourceFile, Resources };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/assets.ts
|
|
17
|
+
var assets_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(assets_exports);
|
|
19
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/assets.ts"],"sourcesContent":["/**\n * Asset type definitions\n */\n\n/**\n * Resources metadata\n */\nexport interface Resources {\n\t/** Image/sprite resources */\n\timages?: ResourceFile[];\n\t/** Map resources */\n\tmaps?: ResourceFile[];\n\t/** Sound resources */\n\tsounds?: ResourceFile[];\n\t/** Music resources */\n\tmusic?: ResourceFile[];\n\t/** Generic asset resources */\n\tassets?: ResourceFile[];\n\t/** Source code files */\n\tsources?: ResourceFile[];\n}\n\n/**\n * Resource file metadata\n */\nexport interface ResourceFile {\n\t/** File name */\n\tfile: string;\n\t/** Version/hash for cache busting */\n\tversion?: string | number;\n\t/** Additional properties (for sprites, etc) */\n\tproperties?: any;\n}\n\n/**\n * Asset collections\n */\nexport interface AssetCollections {\n\tsprites: Record<string, any>;\n\tmaps: Record<string, any>;\n\tsounds: Record<string, any>;\n\tmusic: Record<string, any>;\n\tassets: Record<string, any>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=assets.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { StateSnapshot } from '@al8b/time';
|
|
2
|
+
|
|
3
|
+
type HostEventSource = "host" | "backend" | "realtime";
|
|
4
|
+
interface HostEvent {
|
|
5
|
+
type: string;
|
|
6
|
+
payload?: unknown;
|
|
7
|
+
requestId?: string;
|
|
8
|
+
source?: HostEventSource;
|
|
9
|
+
}
|
|
10
|
+
interface RuntimeSessionSnapshot {
|
|
11
|
+
user?: {
|
|
12
|
+
id: string;
|
|
13
|
+
displayName?: string;
|
|
14
|
+
roles?: string[];
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
} | null;
|
|
17
|
+
player?: {
|
|
18
|
+
id: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
slot?: string;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
} | null;
|
|
23
|
+
game?: {
|
|
24
|
+
id: string;
|
|
25
|
+
slug?: string;
|
|
26
|
+
version?: string;
|
|
27
|
+
} | null;
|
|
28
|
+
room?: {
|
|
29
|
+
id: string;
|
|
30
|
+
role?: string;
|
|
31
|
+
metadata?: Record<string, unknown>;
|
|
32
|
+
} | null;
|
|
33
|
+
}
|
|
34
|
+
interface RuntimeSnapshotMeta {
|
|
35
|
+
slot?: string;
|
|
36
|
+
label?: string;
|
|
37
|
+
metadata?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
interface RuntimeSnapshot {
|
|
40
|
+
version: 1;
|
|
41
|
+
global: StateSnapshot;
|
|
42
|
+
session: RuntimeSessionSnapshot | null;
|
|
43
|
+
router: {
|
|
44
|
+
path: string;
|
|
45
|
+
sceneName: string | null;
|
|
46
|
+
};
|
|
47
|
+
system: {
|
|
48
|
+
updateRate: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
interface RuntimeResetOptions {
|
|
52
|
+
preserveStorage?: boolean;
|
|
53
|
+
preserveSession?: boolean;
|
|
54
|
+
preserveSnapshot?: boolean;
|
|
55
|
+
reinitializeSources?: boolean;
|
|
56
|
+
}
|
|
57
|
+
interface RuntimeBridge {
|
|
58
|
+
request?<TResponse = unknown>(name: string, payload?: unknown): Promise<TResponse> | TResponse;
|
|
59
|
+
emit?(name: string, payload?: unknown): void;
|
|
60
|
+
subscribe?(handler: (event: HostEvent) => void): (() => void) | void;
|
|
61
|
+
getSession?(): Promise<RuntimeSessionSnapshot | null> | RuntimeSessionSnapshot | null;
|
|
62
|
+
saveSnapshot?(snapshot: RuntimeSnapshot, meta?: RuntimeSnapshotMeta): Promise<void> | void;
|
|
63
|
+
loadSnapshot?(meta?: RuntimeSnapshotMeta): Promise<RuntimeSnapshot | null> | RuntimeSnapshot | null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type { HostEvent, HostEventSource, RuntimeBridge, RuntimeResetOptions, RuntimeSessionSnapshot, RuntimeSnapshot, RuntimeSnapshotMeta };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { StateSnapshot } from '@al8b/time';
|
|
2
|
+
|
|
3
|
+
type HostEventSource = "host" | "backend" | "realtime";
|
|
4
|
+
interface HostEvent {
|
|
5
|
+
type: string;
|
|
6
|
+
payload?: unknown;
|
|
7
|
+
requestId?: string;
|
|
8
|
+
source?: HostEventSource;
|
|
9
|
+
}
|
|
10
|
+
interface RuntimeSessionSnapshot {
|
|
11
|
+
user?: {
|
|
12
|
+
id: string;
|
|
13
|
+
displayName?: string;
|
|
14
|
+
roles?: string[];
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
} | null;
|
|
17
|
+
player?: {
|
|
18
|
+
id: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
slot?: string;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
} | null;
|
|
23
|
+
game?: {
|
|
24
|
+
id: string;
|
|
25
|
+
slug?: string;
|
|
26
|
+
version?: string;
|
|
27
|
+
} | null;
|
|
28
|
+
room?: {
|
|
29
|
+
id: string;
|
|
30
|
+
role?: string;
|
|
31
|
+
metadata?: Record<string, unknown>;
|
|
32
|
+
} | null;
|
|
33
|
+
}
|
|
34
|
+
interface RuntimeSnapshotMeta {
|
|
35
|
+
slot?: string;
|
|
36
|
+
label?: string;
|
|
37
|
+
metadata?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
interface RuntimeSnapshot {
|
|
40
|
+
version: 1;
|
|
41
|
+
global: StateSnapshot;
|
|
42
|
+
session: RuntimeSessionSnapshot | null;
|
|
43
|
+
router: {
|
|
44
|
+
path: string;
|
|
45
|
+
sceneName: string | null;
|
|
46
|
+
};
|
|
47
|
+
system: {
|
|
48
|
+
updateRate: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
interface RuntimeResetOptions {
|
|
52
|
+
preserveStorage?: boolean;
|
|
53
|
+
preserveSession?: boolean;
|
|
54
|
+
preserveSnapshot?: boolean;
|
|
55
|
+
reinitializeSources?: boolean;
|
|
56
|
+
}
|
|
57
|
+
interface RuntimeBridge {
|
|
58
|
+
request?<TResponse = unknown>(name: string, payload?: unknown): Promise<TResponse> | TResponse;
|
|
59
|
+
emit?(name: string, payload?: unknown): void;
|
|
60
|
+
subscribe?(handler: (event: HostEvent) => void): (() => void) | void;
|
|
61
|
+
getSession?(): Promise<RuntimeSessionSnapshot | null> | RuntimeSessionSnapshot | null;
|
|
62
|
+
saveSnapshot?(snapshot: RuntimeSnapshot, meta?: RuntimeSnapshotMeta): Promise<void> | void;
|
|
63
|
+
loadSnapshot?(meta?: RuntimeSnapshotMeta): Promise<RuntimeSnapshot | null> | RuntimeSnapshot | null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type { HostEvent, HostEventSource, RuntimeBridge, RuntimeResetOptions, RuntimeSessionSnapshot, RuntimeSnapshot, RuntimeSnapshotMeta };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/bridge.ts
|
|
17
|
+
var bridge_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(bridge_exports);
|
|
19
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/bridge.ts"],"sourcesContent":["import type { StateSnapshot } from \"@al8b/time\";\n\nexport type HostEventSource = \"host\" | \"backend\" | \"realtime\";\n\nexport interface HostEvent {\n\ttype: string;\n\tpayload?: unknown;\n\trequestId?: string;\n\tsource?: HostEventSource;\n}\n\nexport interface RuntimeSessionSnapshot {\n\tuser?: {\n\t\tid: string;\n\t\tdisplayName?: string;\n\t\troles?: string[];\n\t\tmetadata?: Record<string, unknown>;\n\t} | null;\n\tplayer?: {\n\t\tid: string;\n\t\tname?: string;\n\t\tslot?: string;\n\t\tmetadata?: Record<string, unknown>;\n\t} | null;\n\tgame?: {\n\t\tid: string;\n\t\tslug?: string;\n\t\tversion?: string;\n\t} | null;\n\troom?: {\n\t\tid: string;\n\t\trole?: string;\n\t\tmetadata?: Record<string, unknown>;\n\t} | null;\n}\n\nexport interface RuntimeSnapshotMeta {\n\tslot?: string;\n\tlabel?: string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport interface RuntimeSnapshot {\n\tversion: 1;\n\tglobal: StateSnapshot;\n\tsession: RuntimeSessionSnapshot | null;\n\trouter: {\n\t\tpath: string;\n\t\tsceneName: string | null;\n\t};\n\tsystem: {\n\t\tupdateRate: number;\n\t};\n}\n\nexport interface RuntimeResetOptions {\n\tpreserveStorage?: boolean;\n\tpreserveSession?: boolean;\n\tpreserveSnapshot?: boolean;\n\treinitializeSources?: boolean;\n}\n\nexport interface RuntimeBridge {\n\trequest?<TResponse = unknown>(name: string, payload?: unknown): Promise<TResponse> | TResponse;\n\temit?(name: string, payload?: unknown): void;\n\tsubscribe?(handler: (event: HostEvent) => void): (() => void) | void;\n\tgetSession?(): Promise<RuntimeSessionSnapshot | null> | RuntimeSessionSnapshot | null;\n\tsaveSnapshot?(snapshot: RuntimeSnapshot, meta?: RuntimeSnapshotMeta): Promise<void> | void;\n\tloadSnapshot?(meta?: RuntimeSnapshotMeta): Promise<RuntimeSnapshot | null> | RuntimeSnapshot | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8DA;;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=bridge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AssetCollections, ResourceFile, Resources } from './assets.mjs';
|
|
2
|
+
export { InputDebugSetting, RuntimeDebugOptions, RuntimeListener, RuntimeOptions } from './runtime.mjs';
|
|
3
|
+
export { HostEvent, HostEventSource, RuntimeBridge, RuntimeResetOptions, RuntimeSessionSnapshot, RuntimeSnapshot, RuntimeSnapshotMeta } from './bridge.mjs';
|
|
4
|
+
export { ErrorInfo, GlobalAPI, MetaFunctions, SystemAPI, VMContext, VMWarnings, WarningInfo } from '@al8b/vm';
|
|
5
|
+
import '@al8b/framework-shared';
|
|
6
|
+
import '@al8b/time';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AssetCollections, ResourceFile, Resources } from './assets.js';
|
|
2
|
+
export { InputDebugSetting, RuntimeDebugOptions, RuntimeListener, RuntimeOptions } from './runtime.js';
|
|
3
|
+
export { HostEvent, HostEventSource, RuntimeBridge, RuntimeResetOptions, RuntimeSessionSnapshot, RuntimeSnapshot, RuntimeSnapshotMeta } from './bridge.js';
|
|
4
|
+
export { ErrorInfo, GlobalAPI, MetaFunctions, SystemAPI, VMContext, VMWarnings, WarningInfo } from '@al8b/vm';
|
|
5
|
+
import '@al8b/framework-shared';
|
|
6
|
+
import '@al8b/time';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/index.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * Type definitions for @al8b/runtime\n */\n\nexport type {\n\tAssetCollections,\n\tResourceFile,\n\tResources,\n} from \"./assets\";\nexport type {\n\tErrorInfo,\n\tInputDebugSetting,\n\tRuntimeDebugOptions,\n\tRuntimeListener,\n\tRuntimeOptions,\n} from \"./runtime\";\nexport type {\n\tHostEvent,\n\tHostEventSource,\n\tRuntimeBridge,\n\tRuntimeResetOptions,\n\tRuntimeSessionSnapshot,\n\tRuntimeSnapshot,\n\tRuntimeSnapshotMeta,\n} from \"./bridge\";\nexport type { GlobalAPI, MetaFunctions, SystemAPI, VMContext, VMWarnings, WarningInfo } from \"./vm\";\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Resources } from './assets.mjs';
|
|
2
|
+
import { CompiledModuleArtifact, SerializedRoutineData } from '@al8b/framework-shared';
|
|
3
|
+
import { ErrorInfo } from '@al8b/vm';
|
|
4
|
+
export { ErrorInfo } from '@al8b/vm';
|
|
5
|
+
import { RuntimeBridge, RuntimeSessionSnapshot } from './bridge.mjs';
|
|
6
|
+
import '@al8b/time';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Runtime type definitions
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Runtime configuration options
|
|
14
|
+
*/
|
|
15
|
+
type InputDebugSetting = boolean | {
|
|
16
|
+
keyboard?: boolean;
|
|
17
|
+
mouse?: boolean;
|
|
18
|
+
touch?: boolean;
|
|
19
|
+
gamepad?: boolean;
|
|
20
|
+
};
|
|
21
|
+
interface RuntimeDebugOptions {
|
|
22
|
+
/** Input debug logging configuration */
|
|
23
|
+
input?: InputDebugSetting;
|
|
24
|
+
/** Log screen/canvas state changes */
|
|
25
|
+
screen?: boolean;
|
|
26
|
+
/** Detailed lifecycle logs for runtime startup and control */
|
|
27
|
+
lifecycle?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface RuntimeOptions {
|
|
30
|
+
/** Base URL for loading assets */
|
|
31
|
+
url?: string;
|
|
32
|
+
/** Source code files (for development) */
|
|
33
|
+
sources?: Record<string, string>;
|
|
34
|
+
/** Pre-compiled routines (for production) */
|
|
35
|
+
compiledRoutines?: Record<string, CompiledModuleArtifact | SerializedRoutineData>;
|
|
36
|
+
/** Resources metadata */
|
|
37
|
+
resources?: Resources;
|
|
38
|
+
/** Environment variables (key-value pairs) */
|
|
39
|
+
env?: Record<string, string>;
|
|
40
|
+
/** Listener for events (logging, errors) */
|
|
41
|
+
listener?: RuntimeListener;
|
|
42
|
+
/** Host bridge for platform and backend integrations */
|
|
43
|
+
bridge?: RuntimeBridge;
|
|
44
|
+
/** Initial session context supplied by the host */
|
|
45
|
+
initialSession?: RuntimeSessionSnapshot | null;
|
|
46
|
+
/** Canvas element to use */
|
|
47
|
+
canvas?: HTMLCanvasElement;
|
|
48
|
+
/** Screen width */
|
|
49
|
+
width?: number;
|
|
50
|
+
/** Screen height */
|
|
51
|
+
height?: number;
|
|
52
|
+
/** Namespace for localStorage */
|
|
53
|
+
namespace?: string;
|
|
54
|
+
/** Preserve localStorage on reset */
|
|
55
|
+
preserveStorage?: boolean;
|
|
56
|
+
/** Debug toggles */
|
|
57
|
+
debug?: RuntimeDebugOptions;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Runtime listener for events
|
|
61
|
+
*/
|
|
62
|
+
interface RuntimeListener {
|
|
63
|
+
/** Log message */
|
|
64
|
+
log?: (message: string) => void;
|
|
65
|
+
/** Report error */
|
|
66
|
+
reportError?: (error: ErrorInfo) => void;
|
|
67
|
+
/** Code paused (system.pause called) */
|
|
68
|
+
codePaused?: () => void;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { type InputDebugSetting, Resources, type RuntimeDebugOptions, type RuntimeListener, type RuntimeOptions };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Resources } from './assets.js';
|
|
2
|
+
import { CompiledModuleArtifact, SerializedRoutineData } from '@al8b/framework-shared';
|
|
3
|
+
import { ErrorInfo } from '@al8b/vm';
|
|
4
|
+
export { ErrorInfo } from '@al8b/vm';
|
|
5
|
+
import { RuntimeBridge, RuntimeSessionSnapshot } from './bridge.js';
|
|
6
|
+
import '@al8b/time';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Runtime type definitions
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Runtime configuration options
|
|
14
|
+
*/
|
|
15
|
+
type InputDebugSetting = boolean | {
|
|
16
|
+
keyboard?: boolean;
|
|
17
|
+
mouse?: boolean;
|
|
18
|
+
touch?: boolean;
|
|
19
|
+
gamepad?: boolean;
|
|
20
|
+
};
|
|
21
|
+
interface RuntimeDebugOptions {
|
|
22
|
+
/** Input debug logging configuration */
|
|
23
|
+
input?: InputDebugSetting;
|
|
24
|
+
/** Log screen/canvas state changes */
|
|
25
|
+
screen?: boolean;
|
|
26
|
+
/** Detailed lifecycle logs for runtime startup and control */
|
|
27
|
+
lifecycle?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface RuntimeOptions {
|
|
30
|
+
/** Base URL for loading assets */
|
|
31
|
+
url?: string;
|
|
32
|
+
/** Source code files (for development) */
|
|
33
|
+
sources?: Record<string, string>;
|
|
34
|
+
/** Pre-compiled routines (for production) */
|
|
35
|
+
compiledRoutines?: Record<string, CompiledModuleArtifact | SerializedRoutineData>;
|
|
36
|
+
/** Resources metadata */
|
|
37
|
+
resources?: Resources;
|
|
38
|
+
/** Environment variables (key-value pairs) */
|
|
39
|
+
env?: Record<string, string>;
|
|
40
|
+
/** Listener for events (logging, errors) */
|
|
41
|
+
listener?: RuntimeListener;
|
|
42
|
+
/** Host bridge for platform and backend integrations */
|
|
43
|
+
bridge?: RuntimeBridge;
|
|
44
|
+
/** Initial session context supplied by the host */
|
|
45
|
+
initialSession?: RuntimeSessionSnapshot | null;
|
|
46
|
+
/** Canvas element to use */
|
|
47
|
+
canvas?: HTMLCanvasElement;
|
|
48
|
+
/** Screen width */
|
|
49
|
+
width?: number;
|
|
50
|
+
/** Screen height */
|
|
51
|
+
height?: number;
|
|
52
|
+
/** Namespace for localStorage */
|
|
53
|
+
namespace?: string;
|
|
54
|
+
/** Preserve localStorage on reset */
|
|
55
|
+
preserveStorage?: boolean;
|
|
56
|
+
/** Debug toggles */
|
|
57
|
+
debug?: RuntimeDebugOptions;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Runtime listener for events
|
|
61
|
+
*/
|
|
62
|
+
interface RuntimeListener {
|
|
63
|
+
/** Log message */
|
|
64
|
+
log?: (message: string) => void;
|
|
65
|
+
/** Report error */
|
|
66
|
+
reportError?: (error: ErrorInfo) => void;
|
|
67
|
+
/** Code paused (system.pause called) */
|
|
68
|
+
codePaused?: () => void;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { type InputDebugSetting, Resources, type RuntimeDebugOptions, type RuntimeListener, type RuntimeOptions };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/runtime.ts
|
|
17
|
+
var runtime_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(runtime_exports);
|
|
19
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/runtime.ts"],"sourcesContent":["/**\n * Runtime type definitions\n */\n\nimport type { CompiledModuleArtifact, SerializedRoutineData } from \"@al8b/framework-shared\";\nimport type { ErrorInfo } from \"@al8b/vm\";\nimport type { Resources } from \"./assets\";\nimport type { RuntimeBridge, RuntimeSessionSnapshot } from \"./bridge\";\n\nexport type { ErrorInfo, Resources };\n\n/**\n * Runtime configuration options\n */\nexport type InputDebugSetting =\n\t| boolean\n\t| {\n\t\t\tkeyboard?: boolean;\n\t\t\tmouse?: boolean;\n\t\t\ttouch?: boolean;\n\t\t\tgamepad?: boolean;\n\t };\n\nexport interface RuntimeDebugOptions {\n\t/** Input debug logging configuration */\n\tinput?: InputDebugSetting;\n\t/** Log screen/canvas state changes */\n\tscreen?: boolean;\n\t/** Detailed lifecycle logs for runtime startup and control */\n\tlifecycle?: boolean;\n}\n\nexport interface RuntimeOptions {\n\t/** Base URL for loading assets */\n\turl?: string;\n\t/** Source code files (for development) */\n\tsources?: Record<string, string>;\n\t/** Pre-compiled routines (for production) */\n\tcompiledRoutines?: Record<string, CompiledModuleArtifact | SerializedRoutineData>;\n\t/** Resources metadata */\n\tresources?: Resources;\n\t/** Environment variables (key-value pairs) */\n\tenv?: Record<string, string>;\n\t/** Listener for events (logging, errors) */\n\tlistener?: RuntimeListener;\n\t/** Host bridge for platform and backend integrations */\n\tbridge?: RuntimeBridge;\n\t/** Initial session context supplied by the host */\n\tinitialSession?: RuntimeSessionSnapshot | null;\n\t/** Canvas element to use */\n\tcanvas?: HTMLCanvasElement;\n\t/** Screen width */\n\twidth?: number;\n\t/** Screen height */\n\theight?: number;\n\t/** Namespace for localStorage */\n\tnamespace?: string;\n\t/** Preserve localStorage on reset */\n\tpreserveStorage?: boolean;\n\t/** Debug toggles */\n\tdebug?: RuntimeDebugOptions;\n}\n\n/**\n * Runtime listener for events\n */\nexport interface RuntimeListener {\n\t/** Log message */\n\tlog?: (message: string) => void;\n\t/** Report error */\n\treportError?: (error: ErrorInfo) => void;\n\t/** Code paused (system.pause called) */\n\tcodePaused?: () => void;\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ErrorInfo, GlobalAPI, MetaFunctions, SystemAPI, VMContext, VMWarnings, WarningInfo } from '@al8b/vm';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ErrorInfo, GlobalAPI, MetaFunctions, SystemAPI, VMContext, VMWarnings, WarningInfo } from '@al8b/vm';
|