@floegence/floe-webapp-protocol 0.14.4 → 0.15.1

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/dist/index2.js CHANGED
@@ -1,15 +1,16 @@
1
- import { createContext as T, onCleanup as E, createComponent as P, useContext as k } from "solid-js";
2
- import { createStore as A } from "solid-js/store";
3
- import { requestChannelGrant as W } from "./index4.js";
4
- const R = T();
5
- function x(c) {
6
- return c?.enabled ? {
1
+ import { createContext as E, onCleanup as P, createComponent as k, useContext as A } from "solid-js";
2
+ import { createStore as W } from "solid-js/store";
3
+ import { requestChannelGrant as j } from "./index4.js";
4
+ import { redevenV1Contract as I } from "./index6.js";
5
+ const f = E();
6
+ function R(a) {
7
+ return a?.enabled ? {
7
8
  enabled: !0,
8
- maxAttempts: Math.max(1, c.maxAttempts ?? 5),
9
- initialDelayMs: Math.max(0, c.initialDelayMs ?? 500),
10
- maxDelayMs: Math.max(0, c.maxDelayMs ?? 1e4),
11
- factor: Math.max(1, c.factor ?? 1.8),
12
- jitterRatio: Math.max(0, c.jitterRatio ?? 0.2)
9
+ maxAttempts: Math.max(1, a.maxAttempts ?? 5),
10
+ initialDelayMs: Math.max(0, a.initialDelayMs ?? 500),
11
+ maxDelayMs: Math.max(0, a.maxDelayMs ?? 1e4),
12
+ factor: Math.max(1, a.factor ?? 1.8),
13
+ jitterRatio: Math.max(0, a.jitterRatio ?? 0.2)
13
14
  } : {
14
15
  enabled: !1,
15
16
  maxAttempts: 1,
@@ -19,48 +20,48 @@ function x(c) {
19
20
  jitterRatio: 0.2
20
21
  };
21
22
  }
22
- function j(c, a) {
23
- const s = Math.min(a.maxDelayMs, a.initialDelayMs * Math.pow(a.factor, c)), l = a.jitterRatio <= 0 ? 0 : s * a.jitterRatio * (Math.random() * 2 - 1);
24
- return Math.max(0, Math.round(s + l));
23
+ function S(a, c) {
24
+ const l = Math.min(c.maxDelayMs, c.initialDelayMs * Math.pow(c.factor, a)), h = c.jitterRatio <= 0 ? 0 : l * c.jitterRatio * (Math.random() * 2 - 1);
25
+ return Math.max(0, Math.round(l + h));
25
26
  }
26
- function H(c) {
27
- const [a, s] = A({
27
+ function _(a) {
28
+ const [c, l] = W({
28
29
  status: "disconnected",
29
30
  error: null,
30
31
  client: null
31
- });
32
- let l = 0, i = null, u = null, m = null;
33
- const h = () => {
32
+ }), h = a.contract ?? I;
33
+ let s = 0, i = null, u = null, m = null;
34
+ const p = () => {
34
35
  u && (clearTimeout(u), u = null), m?.(), m = null;
35
- }, f = (n) => new Promise((t) => {
36
+ }, v = (n) => new Promise((t) => {
36
37
  m = t, u = setTimeout(() => {
37
38
  u = null, m = null, t();
38
39
  }, n);
39
- }), M = () => {
40
- h(), i = null, l += 1, a.client && a.client.close(), s({
40
+ }), w = () => {
41
+ p(), i = null, s += 1, c.client && c.client.close(), l({
41
42
  status: "disconnected",
42
43
  error: null,
43
44
  client: null
44
45
  });
45
46
  }, y = (n, t, r) => {
46
- if (n !== l || i !== t || a.status !== "connected") return;
47
- if (!x(t.autoReconnect).enabled) {
48
- s({
47
+ if (n !== s || i !== t || c.status !== "connected") return;
48
+ if (!R(t.autoReconnect).enabled) {
49
+ l({
49
50
  status: "error",
50
51
  error: r,
51
52
  client: null
52
53
  });
53
54
  return;
54
55
  }
55
- h(), l += 1;
56
- const o = l;
57
- s({
56
+ p(), s += 1;
57
+ const o = s;
58
+ l({
58
59
  status: "connecting",
59
60
  error: r,
60
61
  client: null
61
- }), w(o, t).catch(() => {
62
+ }), x(o, t).catch(() => {
62
63
  });
63
- }, b = (n, t) => {
64
+ }, C = (n, t) => {
64
65
  const r = t.observer;
65
66
  return {
66
67
  onConnect: (...e) => r?.onConnect?.(...e),
@@ -75,34 +76,34 @@ function H(c) {
75
76
  onRpcCall: (...e) => r?.onRpcCall?.(...e),
76
77
  onRpcNotify: (...e) => r?.onRpcNotify?.(...e)
77
78
  };
78
- }, v = async (n, t) => {
79
+ }, b = async (n, t) => {
79
80
  const {
80
81
  connectTunnelBrowser: r,
81
82
  connectDirectBrowser: e
82
83
  } = await import("@floegence/flowersec-core/browser"), o = {
83
- observer: b(n, t),
84
+ observer: C(n, t),
84
85
  keepaliveIntervalMs: t.keepaliveIntervalMs ?? 15e3,
85
86
  connectTimeoutMs: t.connectTimeoutMs ?? 1e4,
86
87
  handshakeTimeoutMs: t.handshakeTimeoutMs ?? 1e4
87
88
  };
88
89
  if ((t.mode ?? "tunnel") === "tunnel") {
89
- const p = t.grant ?? (t.controlplane ? await W(t.controlplane) : null);
90
- if (!p)
91
- throw new Error("Tunnel mode requires `grant` or `controlplane` config");
92
- return r(p, o);
90
+ const M = (t.getGrant ? await t.getGrant() : null) ?? t.grant ?? (t.controlplane ? await j(t.controlplane) : null);
91
+ if (!M)
92
+ throw new Error("Tunnel mode requires `getGrant`, `grant`, or `controlplane` config");
93
+ return r(M, o);
93
94
  }
94
95
  if (!t.directInfo)
95
96
  throw new Error("Direct mode requires `directInfo`");
96
97
  return e(t.directInfo, o);
97
- }, w = async (n, t) => {
98
- const r = x(t.autoReconnect);
98
+ }, x = async (n, t) => {
99
+ const r = R(t.autoReconnect);
99
100
  let e = 0;
100
101
  for (; ; ) {
101
- if (n !== l || i !== t) return;
102
+ if (n !== s || i !== t) return;
102
103
  e += 1;
103
104
  try {
104
- const o = await v(n, t);
105
- if (n !== l) {
105
+ const o = await b(n, t);
106
+ if (n !== s) {
106
107
  o.close();
107
108
  return;
108
109
  }
@@ -110,7 +111,7 @@ function H(c) {
110
111
  o.close();
111
112
  return;
112
113
  }
113
- s({
114
+ l({
114
115
  status: "connected",
115
116
  client: o,
116
117
  error: null
@@ -118,55 +119,56 @@ function H(c) {
118
119
  return;
119
120
  } catch (o) {
120
121
  const d = o instanceof Error ? o : new Error(String(o));
121
- if (n !== l || i !== t) return;
122
+ if (n !== s || i !== t) return;
122
123
  if (!(r.enabled && e < r.maxAttempts))
123
- throw s({
124
+ throw l({
124
125
  status: "error",
125
126
  error: d,
126
127
  client: null
127
128
  }), d;
128
- s({
129
+ l({
129
130
  status: "connecting",
130
131
  error: d,
131
132
  client: null
132
133
  });
133
- const D = j(e - 1, r);
134
- await f(D);
134
+ const T = S(e - 1, r);
135
+ await v(T);
135
136
  }
136
137
  }
137
- }, C = {
138
- status: () => a.status,
139
- error: () => a.error,
140
- client: () => a.client,
138
+ }, D = {
139
+ status: () => c.status,
140
+ error: () => c.error,
141
+ client: () => c.client,
142
+ contract: () => h,
141
143
  connect: async (n) => {
142
- h(), l += 1;
143
- const t = l;
144
- i = n, a.client && a.client.close(), s({
144
+ p(), s += 1;
145
+ const t = s;
146
+ i = n, c.client && c.client.close(), l({
145
147
  status: "connecting",
146
148
  error: null,
147
149
  client: null
148
- }), await w(t, n);
150
+ }), await x(t, n);
149
151
  },
150
152
  disconnect: () => {
151
- M();
153
+ w();
152
154
  }
153
155
  };
154
- return E(() => {
155
- M();
156
- }), P(R.Provider, {
157
- value: C,
156
+ return P(() => {
157
+ w();
158
+ }), k(f.Provider, {
159
+ value: D,
158
160
  get children() {
159
- return c.children;
161
+ return a.children;
160
162
  }
161
163
  });
162
164
  }
163
- function N() {
164
- const c = k(R);
165
- if (!c)
165
+ function $() {
166
+ const a = A(f);
167
+ if (!a)
166
168
  throw new Error("useProtocol must be used within a ProtocolProvider");
167
- return c;
169
+ return a;
168
170
  }
169
171
  export {
170
- H as ProtocolProvider,
171
- N as useProtocol
172
+ _ as ProtocolProvider,
173
+ $ as useProtocol
172
174
  };
package/dist/index3.js CHANGED
@@ -1,52 +1,57 @@
1
- import { useProtocol as l } from "./index2.js";
2
- import { TypeIds as t } from "./index5.js";
3
- class i extends Error {
1
+ import { useProtocol as u } from "./index2.js";
2
+ import { redevenV1Contract as p } from "./index6.js";
3
+ class d extends Error {
4
4
  constructor() {
5
5
  super("Not connected"), this.name = "ProtocolNotConnectedError";
6
6
  }
7
7
  }
8
- class n extends Error {
8
+ class a extends Error {
9
9
  typeId;
10
10
  code;
11
- constructor(r) {
12
- super(r.message ?? `RPC error: ${r.code}`, { cause: r.cause }), this.name = "RpcError", this.typeId = r.typeId, this.code = r.code;
11
+ constructor(o) {
12
+ super(o.message ?? `RPC error: ${o.code}`, { cause: o.cause }), this.name = "RpcError", this.typeId = o.typeId, this.code = o.code;
13
13
  }
14
14
  }
15
- function u() {
16
- const c = l(), r = async (e, a) => {
17
- const s = c.client();
18
- if (!s)
19
- throw new i();
20
- let o;
15
+ function f(c) {
16
+ return { call: async (e, n) => {
17
+ const t = c.client();
18
+ if (!t) throw new d();
19
+ let r;
21
20
  try {
22
- o = await s.rpc.call(e, a);
23
- } catch (d) {
24
- throw new n({ typeId: e, code: -1, message: "RPC transport error", cause: d });
21
+ r = await t.rpc.call(e, n);
22
+ } catch (l) {
23
+ throw new a({ typeId: e, code: -1, message: "RPC transport error", cause: l });
25
24
  }
26
- if (o.error)
27
- throw new n({
25
+ if (r.error)
26
+ throw new a({
28
27
  typeId: e,
29
- code: o.error.code,
30
- message: o.error.message ?? `RPC error: ${o.error.code}`,
31
- cause: o.error
28
+ code: r.error.code,
29
+ message: r.error.message ?? `RPC error: ${r.error.code}`,
30
+ cause: r.error
32
31
  });
33
- return o.payload;
34
- };
35
- return {
36
- // File system operations
37
- fs: {
38
- list: (e) => r(t.FS_LIST, e),
39
- readFile: (e) => r(t.FS_READ_FILE, e),
40
- writeFile: (e) => r(t.FS_WRITE_FILE, e),
41
- delete: (e) => r(t.FS_DELETE, e),
42
- getHome: () => r(t.FS_GET_HOME, {})
43
- },
44
- // Raw call for custom operations
45
- call: r
46
- };
32
+ return r.payload;
33
+ }, notify: async (e, n) => {
34
+ const t = c.client();
35
+ if (t)
36
+ try {
37
+ await t.rpc.notify(e, n);
38
+ } catch (r) {
39
+ throw new a({ typeId: e, code: -1, message: "RPC notify transport error", cause: r });
40
+ }
41
+ }, onNotify: (e, n) => {
42
+ const t = c.client();
43
+ return t ? t.rpc.onNotify(e, (r) => {
44
+ n(r);
45
+ }) : () => {
46
+ };
47
+ } };
48
+ }
49
+ function m(c) {
50
+ const o = u(), i = c?.contract ?? o.contract() ?? p, s = f(o), e = i.createRpc(s);
51
+ return Object.assign(e, s);
47
52
  }
48
53
  export {
49
- i as ProtocolNotConnectedError,
50
- n as RpcError,
51
- u as useRpc
54
+ d as ProtocolNotConnectedError,
55
+ a as RpcError,
56
+ m as useRpc
52
57
  };
package/dist/index4.js CHANGED
@@ -2,6 +2,8 @@ import { assertChannelInitGrant as r } from "@floegence/flowersec-core";
2
2
  async function o(t) {
3
3
  const n = await fetch(`${t.baseUrl}/v1/channel/init`, {
4
4
  method: "POST",
5
+ credentials: "omit",
6
+ cache: "no-store",
5
7
  headers: { "Content-Type": "application/json" },
6
8
  body: JSON.stringify({ endpoint_id: t.endpointId })
7
9
  });
package/dist/index5.js CHANGED
@@ -1,28 +1,34 @@
1
- const E = {
2
- // File system operations
3
- FS_LIST: 1001,
4
- FS_READ_FILE: 1002,
5
- FS_WRITE_FILE: 1003,
6
- FS_DELETE: 1006,
7
- FS_GET_HOME: 1010
8
- }, S = {
9
- // File system operations
10
- FS_CREATE_FILE: 1004,
11
- FS_CREATE_DIR: 1005,
12
- FS_RENAME: 1007,
13
- FS_MOVE: 1008,
14
- FS_COPY: 1009,
15
- // Terminal operations
16
- TERMINAL_SESSION_CREATE: 2001,
17
- TERMINAL_SESSION_LIST: 2002,
18
- TERMINAL_SESSION_ATTACH: 2003,
19
- TERMINAL_DATA: 2004,
20
- // Bidirectional notification
21
- // System operations
22
- SYSTEM_INFO: 3001,
23
- SYSTEM_EXEC: 3002
1
+ const e = {
2
+ fs: {
3
+ list: 1001,
4
+ readFile: 1002,
5
+ writeFile: 1003,
6
+ rename: 1004,
7
+ copy: 1005,
8
+ delete: 1006,
9
+ getHome: 1010
10
+ },
11
+ terminal: {
12
+ sessionCreate: 2001,
13
+ sessionList: 2002,
14
+ sessionAttach: 2003,
15
+ output: 2004,
16
+ // notify (agent -> client)
17
+ resize: 2005,
18
+ // notify (client -> agent)
19
+ input: 2006,
20
+ // notify (client -> agent)
21
+ history: 2007,
22
+ clear: 2008,
23
+ sessionDelete: 2009,
24
+ nameUpdate: 2010,
25
+ // notify (agent -> client)
26
+ sessionStats: 2011
27
+ },
28
+ monitor: {
29
+ sysMonitor: 3001
30
+ }
24
31
  };
25
32
  export {
26
- S as ReservedTypeIds,
27
- E as TypeIds
33
+ e as redevenV1TypeIds
28
34
  };
package/dist/index6.js ADDED
@@ -0,0 +1,108 @@
1
+ import { redevenV1TypeIds as n } from "./index5.js";
2
+ import { toWireFsDeleteRequest as m, fromWireFsDeleteResponse as p, toWireFsCopyRequest as y, fromWireFsCopyResponse as f, toWireFsRenameRequest as u, fromWireFsRenameResponse as d, toWireFsWriteFileRequest as R, fromWireFsWriteFileResponse as W, toWireFsReadFileRequest as w, fromWireFsReadFileResponse as T, toWireFsListRequest as F, fromWireFsListResponse as S, fromWireFsGetHomeResponse as q } from "./index7.js";
3
+ import { toWireSysMonitorRequest as v, fromWireSysMonitorResponse as h } from "./index8.js";
4
+ import { fromWireTerminalNameUpdateNotify as C, fromWireTerminalOutputNotify as N, toWireTerminalInputNotify as l, toWireTerminalResizeNotify as g, toWireTerminalSessionStatsRequest as U, fromWireTerminalSessionStatsResponse as x, toWireTerminalSessionDeleteRequest as A, fromWireTerminalSessionDeleteResponse as D, toWireTerminalClearRequest as H, fromWireTerminalClearResponse as E, toWireTerminalHistoryRequest as I, fromWireTerminalHistoryResponse as L, toWireTerminalSessionAttachRequest as M, fromWireTerminalSessionAttachResponse as z, fromWireTerminalSessionListResponse as V, toWireTerminalSessionCreateRequest as b, fromWireTerminalSessionCreateResponse as O } from "./index9.js";
5
+ function G(o) {
6
+ const r = String(o ?? "");
7
+ if (r === "") return new Uint8Array();
8
+ if (typeof TextEncoder < "u")
9
+ return new TextEncoder().encode(r);
10
+ throw new Error("TextEncoder is not available in this environment");
11
+ }
12
+ function _(o) {
13
+ const r = o.call, a = o.notify, c = o.onNotify;
14
+ return {
15
+ fs: {
16
+ getHome: async () => {
17
+ const e = await r(n.fs.getHome, {});
18
+ return q(e);
19
+ },
20
+ list: async (e) => {
21
+ const s = F(e), t = await r(n.fs.list, s);
22
+ return S(t);
23
+ },
24
+ readFile: async (e) => {
25
+ const s = w(e), t = await r(n.fs.readFile, s);
26
+ return T(t);
27
+ },
28
+ writeFile: async (e) => {
29
+ const s = R(e), t = await r(n.fs.writeFile, s);
30
+ return W(t);
31
+ },
32
+ rename: async (e) => {
33
+ const s = u(e), t = await r(n.fs.rename, s);
34
+ return d(t);
35
+ },
36
+ copy: async (e) => {
37
+ const s = y(e), t = await r(n.fs.copy, s);
38
+ return f(t);
39
+ },
40
+ delete: async (e) => {
41
+ const s = m(e), t = await r(n.fs.delete, s);
42
+ return p(t);
43
+ }
44
+ },
45
+ terminal: {
46
+ createSession: async (e) => {
47
+ const s = b(e), t = await r(n.terminal.sessionCreate, s);
48
+ return O(t);
49
+ },
50
+ listSessions: async () => {
51
+ const e = await r(n.terminal.sessionList, {});
52
+ return V(e);
53
+ },
54
+ attach: async (e) => {
55
+ const s = M(e), t = await r(n.terminal.sessionAttach, s);
56
+ return z(t);
57
+ },
58
+ history: async (e) => {
59
+ const s = I(e), t = await r(n.terminal.history, s);
60
+ return L(t);
61
+ },
62
+ clear: async (e) => {
63
+ const s = H(e), t = await r(n.terminal.clear, s);
64
+ return E(t);
65
+ },
66
+ deleteSession: async (e) => {
67
+ const s = A(e), t = await r(n.terminal.sessionDelete, s);
68
+ return D(t);
69
+ },
70
+ getSessionStats: async (e) => {
71
+ const s = U(e), t = await r(n.terminal.sessionStats, s);
72
+ return x(t);
73
+ },
74
+ resize: async ({ sessionId: e, connId: s, cols: t, rows: i }) => {
75
+ await a(n.terminal.resize, g({ sessionId: e, connId: s, cols: t, rows: i }));
76
+ },
77
+ sendInput: async ({ sessionId: e, connId: s, data: t }) => {
78
+ !(t instanceof Uint8Array) || t.length === 0 || await a(n.terminal.input, l({ sessionId: e, connId: s, data: t }));
79
+ },
80
+ sendTextInput: async ({ sessionId: e, connId: s, text: t }) => {
81
+ const i = G(t);
82
+ i.length !== 0 && await a(n.terminal.input, l({ sessionId: e, connId: s, data: i }));
83
+ },
84
+ onOutput: (e) => c(n.terminal.output, (s) => {
85
+ const t = N(s);
86
+ t && e(t);
87
+ }),
88
+ onNameUpdate: (e) => c(n.terminal.nameUpdate, (s) => {
89
+ const t = C(s);
90
+ t && e(t);
91
+ })
92
+ },
93
+ monitor: {
94
+ getSysMonitor: async (e = {}) => {
95
+ const s = v(e), t = await r(n.monitor.sysMonitor, s);
96
+ return h(t);
97
+ }
98
+ }
99
+ };
100
+ }
101
+ const K = {
102
+ id: "redeven_v1",
103
+ createRpc: (o) => _(o)
104
+ };
105
+ export {
106
+ _ as createRedevenV1Rpc,
107
+ K as redevenV1Contract
108
+ };
package/dist/index7.js ADDED
@@ -0,0 +1,94 @@
1
+ function s(e) {
2
+ return {
3
+ path: e.path,
4
+ show_hidden: typeof e.showHidden == "boolean" ? e.showHidden : void 0
5
+ };
6
+ }
7
+ function o(e) {
8
+ return {
9
+ entries: (Array.isArray(e?.entries) ? e.entries : []).map((t) => ({
10
+ name: String(t?.name ?? ""),
11
+ path: String(t?.path ?? ""),
12
+ isDirectory: !!(t?.is_directory ?? !1),
13
+ size: Number(t?.size ?? 0),
14
+ modifiedAt: Number(t?.modified_at ?? 0),
15
+ createdAt: Number(t?.created_at ?? 0),
16
+ permissions: typeof t?.permissions == "string" ? t.permissions : void 0
17
+ }))
18
+ };
19
+ }
20
+ function i(e) {
21
+ return {
22
+ path: e.path,
23
+ encoding: e.encoding
24
+ };
25
+ }
26
+ function r(e) {
27
+ return {
28
+ content: String(e?.content ?? ""),
29
+ encoding: String(e?.encoding ?? "utf8")
30
+ };
31
+ }
32
+ function a(e) {
33
+ return {
34
+ path: e.path,
35
+ content: e.content,
36
+ encoding: e.encoding,
37
+ create_dirs: typeof e.createDirs == "boolean" ? e.createDirs : void 0
38
+ };
39
+ }
40
+ function c(e) {
41
+ return { success: !!(e?.success ?? !1) };
42
+ }
43
+ function u(e) {
44
+ return {
45
+ path: e.path,
46
+ recursive: typeof e.recursive == "boolean" ? e.recursive : void 0
47
+ };
48
+ }
49
+ function f(e) {
50
+ return { success: !!(e?.success ?? !1) };
51
+ }
52
+ function p(e) {
53
+ return {
54
+ old_path: e.oldPath,
55
+ new_path: e.newPath
56
+ };
57
+ }
58
+ function d(e) {
59
+ return {
60
+ success: !!(e?.success ?? !1),
61
+ newPath: String(e?.new_path ?? "")
62
+ };
63
+ }
64
+ function h(e) {
65
+ return {
66
+ source_path: e.sourcePath,
67
+ dest_path: e.destPath,
68
+ overwrite: typeof e.overwrite == "boolean" ? e.overwrite : void 0
69
+ };
70
+ }
71
+ function l(e) {
72
+ return {
73
+ success: !!(e?.success ?? !1),
74
+ newPath: String(e?.new_path ?? "")
75
+ };
76
+ }
77
+ function m(e) {
78
+ return { path: String(e?.path ?? "") };
79
+ }
80
+ export {
81
+ l as fromWireFsCopyResponse,
82
+ f as fromWireFsDeleteResponse,
83
+ m as fromWireFsGetHomeResponse,
84
+ o as fromWireFsListResponse,
85
+ r as fromWireFsReadFileResponse,
86
+ d as fromWireFsRenameResponse,
87
+ c as fromWireFsWriteFileResponse,
88
+ h as toWireFsCopyRequest,
89
+ u as toWireFsDeleteRequest,
90
+ s as toWireFsListRequest,
91
+ i as toWireFsReadFileRequest,
92
+ p as toWireFsRenameRequest,
93
+ a as toWireFsWriteFileRequest
94
+ };
package/dist/index8.js ADDED
@@ -0,0 +1,28 @@
1
+ function o(e) {
2
+ return { sort_by: e.sortBy };
3
+ }
4
+ function n(e) {
5
+ const t = Array.isArray(e?.processes) ? e.processes : [];
6
+ return {
7
+ cpuUsage: Number(e?.cpu_usage ?? 0),
8
+ cpuCores: Number(e?.cpu_cores ?? 0),
9
+ loadAverage: Array.isArray(e?.load_average) ? e.load_average.map((r) => Number(r)) : void 0,
10
+ networkBytesReceived: Number(e?.network_bytes_received ?? 0),
11
+ networkBytesSent: Number(e?.network_bytes_sent ?? 0),
12
+ networkSpeedReceived: Number(e?.network_speed_received ?? 0),
13
+ networkSpeedSent: Number(e?.network_speed_sent ?? 0),
14
+ platform: String(e?.platform ?? ""),
15
+ processes: t.map((r) => ({
16
+ pid: Number(r?.pid ?? 0),
17
+ name: String(r?.name ?? ""),
18
+ cpuPercent: Number(r?.cpu_percent ?? 0),
19
+ memoryBytes: Number(r?.memory_bytes ?? 0),
20
+ username: String(r?.username ?? "")
21
+ })),
22
+ timestampMs: Number(e?.timestamp_ms ?? 0)
23
+ };
24
+ }
25
+ export {
26
+ n as fromWireSysMonitorResponse,
27
+ o as toWireSysMonitorRequest
28
+ };