@aibexhq/aibex-link 0.0.5 → 0.0.7
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/index.js +2129 -101
- package/dist/terminal-host.js +9 -3
- package/package.json +1 -1
package/dist/terminal-host.js
CHANGED
|
@@ -101,7 +101,13 @@ const TYPES = /* @__PURE__ */ new Set([
|
|
|
101
101
|
"host",
|
|
102
102
|
"shutdown"
|
|
103
103
|
]);
|
|
104
|
-
const
|
|
104
|
+
const TERMINAL_SIGNALS = /* @__PURE__ */ new Set([
|
|
105
|
+
"SIGHUP",
|
|
106
|
+
"SIGINT",
|
|
107
|
+
"SIGQUIT",
|
|
108
|
+
"SIGTERM",
|
|
109
|
+
"SIGKILL"
|
|
110
|
+
]);
|
|
105
111
|
const TERMINAL_ID = /^term_[a-z2-7]{16}$/u;
|
|
106
112
|
const BASE64 = /^[A-Za-z0-9+/]*={0,2}$/u;
|
|
107
113
|
class RequestError extends Error {
|
|
@@ -352,10 +358,10 @@ function parseFields(id, type, fields) {
|
|
|
352
358
|
case "kill": {
|
|
353
359
|
const terminal = fields.terminal(true);
|
|
354
360
|
const signal = fields.string("signal", false) ?? TERMINAL_DEFAULTS.signal;
|
|
355
|
-
if (!
|
|
361
|
+
if (!TERMINAL_SIGNALS.has(signal)) {
|
|
356
362
|
throw new RequestError(
|
|
357
363
|
"bad-request",
|
|
358
|
-
`signal must be one of ${[...
|
|
364
|
+
`signal must be one of ${[...TERMINAL_SIGNALS].join(", ")}`
|
|
359
365
|
);
|
|
360
366
|
}
|
|
361
367
|
return {
|