@scrypted/server 0.115.24 → 0.115.26

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.
Files changed (41) hide show
  1. package/dist/plugin/plugin-console.d.ts +2 -2
  2. package/dist/plugin/plugin-console.js +0 -4
  3. package/dist/plugin/plugin-console.js.map +1 -1
  4. package/dist/plugin/runtime/electron/electron-plugin-preload.d.ts +1 -0
  5. package/dist/plugin/runtime/electron/electron-plugin-preload.js +58 -0
  6. package/dist/plugin/runtime/electron/electron-plugin-preload.js.map +1 -0
  7. package/dist/plugin/runtime/electron/electron-plugin-remote.d.ts +1 -0
  8. package/dist/plugin/runtime/electron/electron-plugin-remote.js +76 -0
  9. package/dist/plugin/runtime/electron/electron-plugin-remote.js.map +1 -0
  10. package/dist/plugin/runtime/{deno-worker.d.ts → electron-worker.d.ts} +2 -3
  11. package/dist/plugin/runtime/electron-worker.js +84 -0
  12. package/dist/plugin/runtime/electron-worker.js.map +1 -0
  13. package/dist/plugin/runtime/runtime-host.js +2 -2
  14. package/dist/plugin/runtime/runtime-host.js.map +1 -1
  15. package/dist/rpc.d.ts +1 -1
  16. package/dist/rpc.js +2 -2
  17. package/dist/rpc.js.map +1 -1
  18. package/dist/runtime.js +1 -1
  19. package/dist/runtime.js.map +1 -1
  20. package/dist/scrypted-main-exports.js +1 -1
  21. package/dist/scrypted-main-exports.js.map +1 -1
  22. package/dist/scrypted-main.js +1 -4
  23. package/dist/scrypted-main.js.map +1 -1
  24. package/dist/scrypted-plugin-main.js +2 -1
  25. package/dist/scrypted-plugin-main.js.map +1 -1
  26. package/electron/electron-plugin.html +6 -0
  27. package/package.json +5 -4
  28. package/src/plugin/plugin-console.ts +2 -8
  29. package/src/plugin/runtime/electron/electron-plugin-preload.ts +66 -0
  30. package/src/plugin/runtime/electron/electron-plugin-remote.ts +83 -0
  31. package/src/plugin/runtime/{deno-worker.ts → electron-worker.ts} +40 -23
  32. package/src/plugin/runtime/runtime-host.ts +2 -2
  33. package/src/rpc.ts +2 -2
  34. package/src/runtime.ts +1 -6
  35. package/src/scrypted-main-exports.ts +1 -1
  36. package/src/scrypted-main.ts +1 -4
  37. package/src/scrypted-plugin-main.ts +2 -1
  38. package/deno/deno-plugin-remote.js +0 -5
  39. package/deno/package.json +0 -3
  40. package/dist/plugin/runtime/deno-worker.js +0 -74
  41. package/dist/plugin/runtime/deno-worker.js.map +0 -1
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DenoWorker = void 0;
7
- const deno_1 = require("@scrypted/deno");
8
- const child_process_1 = __importDefault(require("child_process"));
9
- const path_1 = __importDefault(require("path"));
10
- const child_process_worker_1 = require("./child-process-worker");
11
- class DenoWorker extends child_process_worker_1.ChildProcessWorker {
12
- serializer;
13
- constructor(mainFilename, pluginId, options) {
14
- super(pluginId, options);
15
- const { env, pluginDebug } = options;
16
- const execArgv = [];
17
- if (pluginDebug) {
18
- execArgv.push(`--inspect=0.0.0.0:${pluginDebug.inspectPort}`);
19
- }
20
- const args = [
21
- '--unstable-byonm', '--unstable-bare-node-builtins', '--unstable-sloppy-imports', '--unstable-webgpu',
22
- 'run',
23
- ...execArgv,
24
- '--allow-all',
25
- path_1.default.join(__dirname, '../../../deno', 'deno-plugin-remote.js'),
26
- // TODO: send this across.
27
- // mainFilename.replace('dist', 'src').replace('.js', '.ts'),
28
- 'child', this.pluginId
29
- ];
30
- this.worker = child_process_1.default.spawn((0, deno_1.getDenoPath)(), args, {
31
- // stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe'],
32
- stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
33
- env: Object.assign({
34
- SCRYPTED_MAIN_FILENAME: mainFilename,
35
- RUST_BACKTRACE: "full",
36
- }, process.env, env),
37
- serialization: 'json',
38
- // execArgv,
39
- });
40
- this.setupWorker();
41
- }
42
- setupRpcPeer(peer) {
43
- this.worker.on('message', (message, sendHandle) => {
44
- if (message.type && sendHandle) {
45
- peer.handleMessage(message, {
46
- sendHandle,
47
- });
48
- }
49
- else if (sendHandle) {
50
- this.emit('rpc', message, sendHandle);
51
- }
52
- else {
53
- peer.handleMessage(message);
54
- }
55
- });
56
- peer.transportSafeArgumentTypes.add(Buffer.name);
57
- peer.transportSafeArgumentTypes.add(Uint8Array.name);
58
- }
59
- send(message, reject, serializationContext) {
60
- try {
61
- if (!this.worker)
62
- throw new Error('fork worker has been killed');
63
- this.worker.send(message, serializationContext?.sendHandle, e => {
64
- if (e && reject)
65
- reject(e);
66
- });
67
- }
68
- catch (e) {
69
- reject?.(e);
70
- }
71
- }
72
- }
73
- exports.DenoWorker = DenoWorker;
74
- //# sourceMappingURL=deno-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deno-worker.js","sourceRoot":"","sources":["../../../src/plugin/runtime/deno-worker.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA6C;AAC7C,kEAA0C;AAC1C,gDAAwB;AAGxB,iEAA4D;AAG5D,MAAa,UAAW,SAAQ,yCAAkB;IAC9C,UAAU,CAA+C;IAEzD,YAAY,YAAoB,EAAE,QAAgB,EAAE,OAA6B;QAC7E,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEzB,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;QAErC,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,IAAI,WAAW,EAAE,CAAC;YACd,QAAQ,CAAC,IAAI,CAAC,qBAAqB,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,MAAM,IAAI,GAAG;YACT,kBAAkB,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,mBAAmB;YACrG,KAAK;YACL,GAAG,QAAQ;YACX,aAAa;YACb,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,EAAE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