@scrypted/server 0.123.30 → 0.123.32

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 (43) hide show
  1. package/dist/cluster/cluster-labels.js +1 -0
  2. package/dist/cluster/cluster-labels.js.map +1 -1
  3. package/dist/plugin/device.d.ts +60 -0
  4. package/dist/plugin/device.js +249 -0
  5. package/dist/plugin/device.js.map +1 -0
  6. package/dist/plugin/endpoint.d.ts +45 -0
  7. package/dist/plugin/endpoint.js +97 -0
  8. package/dist/plugin/endpoint.js.map +1 -0
  9. package/dist/plugin/plugin-remote-worker.js +8 -7
  10. package/dist/plugin/plugin-remote-worker.js.map +1 -1
  11. package/dist/plugin/plugin-remote.d.ts +2 -51
  12. package/dist/plugin/plugin-remote.js +6 -337
  13. package/dist/plugin/plugin-remote.js.map +1 -1
  14. package/dist/plugin/runtime/cluster-fork-worker.d.ts +3 -3
  15. package/dist/plugin/runtime/cluster-fork-worker.js +5 -1
  16. package/dist/plugin/runtime/cluster-fork-worker.js.map +1 -1
  17. package/dist/plugin/system.js +0 -1
  18. package/dist/plugin/system.js.map +1 -1
  19. package/dist/runtime.d.ts +4 -4
  20. package/dist/runtime.js +1 -1
  21. package/dist/runtime.js.map +1 -1
  22. package/dist/scrypted-cluster-main.d.ts +12 -2
  23. package/dist/scrypted-cluster-main.js +30 -4
  24. package/dist/scrypted-cluster-main.js.map +1 -1
  25. package/dist/services/cluster-fork.d.ts +2 -2
  26. package/dist/services/cluster-fork.js +4 -3
  27. package/dist/services/cluster-fork.js.map +1 -1
  28. package/package.json +2 -2
  29. package/python/cluster_labels.py +2 -2
  30. package/python/cluster_setup.py +1 -1
  31. package/python/plugin_console.py +8 -0
  32. package/python/plugin_remote.py +105 -34
  33. package/python/rpc.py +5 -4
  34. package/src/cluster/cluster-labels.ts +1 -0
  35. package/src/plugin/device.ts +261 -0
  36. package/src/plugin/endpoint.ts +109 -0
  37. package/src/plugin/plugin-remote-worker.ts +14 -10
  38. package/src/plugin/plugin-remote.ts +6 -364
  39. package/src/plugin/runtime/cluster-fork-worker.ts +10 -5
  40. package/src/plugin/system.ts +0 -1
  41. package/src/runtime.ts +4 -4
  42. package/src/scrypted-cluster-main.ts +39 -9
  43. package/src/services/cluster-fork.ts +5 -5
@@ -1,9 +1,8 @@
1
- import type { ScryptedRuntime } from "../runtime";
2
1
  import { matchesClusterLabels } from "../cluster/cluster-labels";
3
- import { ClusterForkOptions, ClusterForkParam, ClusterWorker, PeerLiveness } from "../scrypted-cluster-main";
4
- import { RpcPeer } from "../rpc";
2
+ import type { ScryptedRuntime } from "../runtime";
3
+ import type { ClusterForkOptions, ClusterForkParam, PeerLiveness, RunningClusterWorker } from "../scrypted-cluster-main";
5
4
 
6
- export class ClusterFork {
5
+ export class ClusterForkService {
7
6
  constructor(public runtime: ScryptedRuntime) { }
8
7
 
9
8
  async fork(peerLiveness: PeerLiveness, options: ClusterForkOptions, packageJson: any, zipHash: string, getZip: () => Promise<Buffer>) {
@@ -18,7 +17,7 @@ export class ClusterFork {
18
17
  });
19
18
  matchingWorkers.sort((a, b) => b.worker.labels.length - a.worker.labels.length);
20
19
 
21
- let worker: ClusterWorker;
20
+ let worker: RunningClusterWorker;
22
21
 
23
22
  // try to keep fork id affinity to single worker if present. this presents the opportunity for
24
23
  // IPC.
@@ -36,6 +35,7 @@ export class ClusterFork {
36
35
 
37
36
  const fork: ClusterForkParam = await worker.peer.getParam('fork');
38
37
  const forkResult = await fork(peerLiveness, options.runtime, packageJson, zipHash, getZip);
38
+ options.id ||= this.runtime.findPluginDevice(packageJson.name)?._id;
39
39
  worker.forks.add(options);
40
40
  forkResult.waitKilled().catch(() => { }).finally(() => {
41
41
  worker.forks.delete(options);