@suveren/gateway 0.3.2 → 0.3.4

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 (42) hide show
  1. package/dist/control-plane/index.mjs +2 -2
  2. package/dist/mcp-server/http.mjs +73 -68
  3. package/dist/ui/assets/index-mg8gMTzG.js +105 -0
  4. package/dist/ui/index.html +1 -1
  5. package/node_modules/@hap/core/dist/index.d.mts +7 -2
  6. package/node_modules/@hap/core/dist/index.d.ts +7 -2
  7. package/node_modules/@hap/core/dist/index.js +2 -2
  8. package/node_modules/@hap/core/dist/index.mjs +2 -2
  9. package/node_modules/@hap/core/package.json +1 -1
  10. package/node_modules/@hap/core/src/identity.ts +9 -4
  11. package/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
  12. package/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/utf32.js +10 -3
  13. package/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/package.json +2 -2
  14. package/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/types/encodings.d.ts +2 -0
  15. package/node_modules/@types/node/README.md +1 -1
  16. package/node_modules/@types/node/buffer.d.ts +64 -25
  17. package/node_modules/@types/node/crypto.d.ts +18 -5
  18. package/node_modules/@types/node/diagnostics_channel.d.ts +237 -3
  19. package/node_modules/@types/node/dns.d.ts +1 -1
  20. package/node_modules/@types/node/ffi.d.ts +486 -0
  21. package/node_modules/@types/node/fs/promises.d.ts +3 -0
  22. package/node_modules/@types/node/fs.d.ts +21 -6
  23. package/node_modules/@types/node/http.d.ts +25 -0
  24. package/node_modules/@types/node/index.d.ts +1 -0
  25. package/node_modules/@types/node/package.json +2 -2
  26. package/node_modules/@types/node/process.d.ts +14 -1
  27. package/node_modules/@types/node/quic.d.ts +92 -11
  28. package/node_modules/@types/node/sqlite.d.ts +55 -0
  29. package/node_modules/@types/node/stream/iter.d.ts +150 -0
  30. package/node_modules/@types/node/stream.d.ts +32 -0
  31. package/node_modules/@types/node/test.d.ts +112 -2
  32. package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
  33. package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
  34. package/node_modules/@types/node/util.d.ts +19 -2
  35. package/node_modules/@types/node/v8.d.ts +84 -2
  36. package/node_modules/@types/node/worker_threads.d.ts +8 -7
  37. package/node_modules/raw-body/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
  38. package/node_modules/raw-body/node_modules/iconv-lite/encodings/utf32.js +10 -3
  39. package/node_modules/raw-body/node_modules/iconv-lite/package.json +2 -2
  40. package/node_modules/raw-body/node_modules/iconv-lite/types/encodings.d.ts +2 -0
  41. package/package.json +2 -2
  42. package/dist/ui/assets/index-RkZBhIxU.js +0 -105
@@ -974,6 +974,8 @@ declare module "node:util" {
974
974
  * `reason`.
975
975
  *
976
976
  * ```js
977
+ * import util from 'node:util';
978
+ *
977
979
  * function fn() {
978
980
  * return Promise.reject(null);
979
981
  * }
@@ -1246,13 +1248,28 @@ declare module "node:util" {
1246
1248
  *
1247
1249
  * The special format value `none` applies no additional styling to the text.
1248
1250
  *
1251
+ * In addition to predefined color names, `util.styleText()` supports hex color
1252
+ * strings using ANSI TrueColor (24-bit) escape sequences. Hex colors can be
1253
+ * specified in either 3-digit (`#RGB`) or 6-digit (`#RRGGBB`) format:
1254
+ *
1255
+ * ```js
1256
+ * import { styleText } from 'node:util';
1257
+ *
1258
+ * // 6-digit hex color
1259
+ * console.log(styleText('#ff5733', 'Orange text'));
1260
+ *
1261
+ * // 3-digit hex color (shorthand)
1262
+ * console.log(styleText('#f00', 'Red text'));
1263
+ * ```
1264
+ *
1249
1265
  * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v26.x/api/util.html#modifiers).
1250
- * @param format A text format or an Array of text formats defined in `util.inspect.colors`.
1266
+ * @param format A text format or an Array of text formats defined in `util.inspect.colors`, or a hex color in `#RGB`
1267
+ * or `#RRGGBB` form.
1251
1268
  * @param text The text to to be formatted.
1252
1269
  * @since v20.12.0
1253
1270
  */
1254
1271
  export function styleText(
1255
- format: InspectColor | readonly InspectColor[],
1272
+ format: InspectColor | readonly InspectColor[] | `#${string}`,
1256
1273
  text: string,
1257
1274
  options?: StyleTextOptions,
1258
1275
  ): string;
@@ -412,6 +412,21 @@ declare module "node:v8" {
412
412
  */
413
413
  [Symbol.dispose](): void;
414
414
  }
415
+ /**
416
+ * @since v26.1.0
417
+ */
418
+ interface SyncHeapProfileHandle {
419
+ /**
420
+ * Stopping collecting the profile and return the profile data.
421
+ * @since v26.1.0
422
+ */
423
+ stop(): string;
424
+ /**
425
+ * Stopping collecting the profile and the profile will be discarded.
426
+ * @since v26.1.0
427
+ */
428
+ [Symbol.dispose](): void;
429
+ }
415
430
  /**
416
431
  * @since v24.8.0
417
432
  */
@@ -444,18 +459,85 @@ declare module "node:v8" {
444
459
  */
445
460
  [Symbol.asyncDispose](): Promise<void>;
446
461
  }
462
+ interface CPUProfileOptions {
463
+ /**
464
+ * Requested sampling interval in milliseconds. **Default:** `0`.
465
+ */
466
+ sampleInterval?: number | undefined;
467
+ /**
468
+ * Maximum number of samples to keep before older
469
+ * entries are discarded. **Default:** `4294967295`.
470
+ */
471
+ maxBufferSize?: number | undefined;
472
+ }
447
473
  /**
448
474
  * Starting a CPU profile then return a `SyncCPUProfileHandle` object.
449
475
  * This API supports `using` syntax.
450
476
  *
451
477
  * ```js
452
- * const handle = v8.startCpuProfile();
478
+ * const handle = v8.startCpuProfile({ sampleInterval: 1, maxBufferSize: 10_000 });
453
479
  * const profile = handle.stop();
454
480
  * console.log(profile);
455
481
  * ```
456
482
  * @since v25.0.0
457
483
  */
458
- function startCpuProfile(): SyncCPUProfileHandle;
484
+ function startCpuProfile(options?: CPUProfileOptions): SyncCPUProfileHandle;
485
+ interface HeapProfileOptions {
486
+ /**
487
+ * The average sampling interval in bytes.
488
+ * **Default:** `524288` (512 KiB).
489
+ */
490
+ sampleInterval?: number | undefined;
491
+ /**
492
+ * The maximum stack depth for samples.
493
+ * **Default:** `16`.
494
+ */
495
+ stackDepth?: number | undefined;
496
+ /**
497
+ * Force garbage collection before taking the profile.
498
+ * **Default:** `false`.
499
+ */
500
+ forceGC?: boolean | undefined;
501
+ /**
502
+ * Include objects collected
503
+ * by major GC. **Default:** `false`.
504
+ */
505
+ includeObjectsCollectedByMajorGC?: boolean | undefined;
506
+ /**
507
+ * Include objects collected
508
+ * by minor GC. **Default:** `false`.
509
+ */
510
+ includeObjectsCollectedByMinorGC?: boolean | undefined;
511
+ }
512
+ /**
513
+ * Starting a heap profile then return a `SyncHeapProfileHandle` object.
514
+ * This API supports `using` syntax.
515
+ *
516
+ * ```js
517
+ * import v8 from 'node:v8';
518
+ *
519
+ * const handle = v8.startHeapProfile();
520
+ * const profile = handle.stop();
521
+ * console.log(profile);
522
+ * ```
523
+ *
524
+ * With custom parameters:
525
+ *
526
+ * ```js
527
+ * import v8 from 'node:v8';
528
+ *
529
+ * const handle = v8.startHeapProfile({
530
+ * sampleInterval: 1024,
531
+ * stackDepth: 8,
532
+ * forceGC: true,
533
+ * includeObjectsCollectedByMajorGC: true,
534
+ * });
535
+ * const profile = handle.stop();
536
+ * console.log(profile);
537
+ * ```
538
+ * @since v26.1.0
539
+ */
540
+ function startHeapProfile(options?: HeapProfileOptions): SyncHeapProfileHandle;
459
541
  /**
460
542
  * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string.
461
543
  * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true;
@@ -10,7 +10,7 @@ declare module "node:worker_threads" {
10
10
  import { Readable, Writable } from "node:stream";
11
11
  import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
12
12
  import { URL } from "node:url";
13
- import { CPUProfileHandle, HeapInfo, HeapProfileHandle } from "node:v8";
13
+ import { CPUProfileHandle, CPUProfileOptions, HeapInfo, HeapProfileHandle, HeapProfileOptions } from "node:v8";
14
14
  import { Context } from "node:vm";
15
15
  import { MessageEvent } from "undici-types";
16
16
  const isInternalThread: boolean;
@@ -259,7 +259,7 @@ declare module "node:worker_threads" {
259
259
  * `, { eval: true });
260
260
  *
261
261
  * worker.on('online', async () => {
262
- * const handle = await worker.startCpuProfile();
262
+ * const handle = await worker.startCpuProfile({ sampleInterval: 1 });
263
263
  * const profile = await handle.stop();
264
264
  * console.log(profile);
265
265
  * worker.terminate();
@@ -283,16 +283,16 @@ declare module "node:worker_threads" {
283
283
  * ```
284
284
  * @since v24.8.0
285
285
  */
286
- startCpuProfile(): Promise<CPUProfileHandle>;
286
+ startCpuProfile(options?: CPUProfileOptions): Promise<CPUProfileHandle>;
287
287
  /**
288
288
  * Starting a Heap profile then return a Promise that fulfills with an error
289
289
  * or an `HeapProfileHandle` object. This API supports `await using` syntax.
290
290
  *
291
291
  * ```js
292
- * const { Worker } = require('node:worker_threads');
292
+ * import { Worker } from 'node:worker_threads';
293
293
  *
294
294
  * const worker = new Worker(`
295
- * const { parentPort } = require('worker_threads');
295
+ * const { parentPort } = require('node:worker_threads');
296
296
  * parentPort.on('message', () => {});
297
297
  * `, { eval: true });
298
298
  *
@@ -307,7 +307,7 @@ declare module "node:worker_threads" {
307
307
  * `await using` example.
308
308
  *
309
309
  * ```js
310
- * const { Worker } = require('node:worker_threads');
310
+ * import { Worker } from 'node:worker_threads';
311
311
  *
312
312
  * const w = new Worker(`
313
313
  * const { parentPort } = require('node:worker_threads');
@@ -319,8 +319,9 @@ declare module "node:worker_threads" {
319
319
  * await using handle = await w.startHeapProfile();
320
320
  * });
321
321
  * ```
322
+ * @since v24.9.0
322
323
  */
323
- startHeapProfile(): Promise<HeapProfileHandle>;
324
+ startHeapProfile(options?: HeapProfileOptions): Promise<HeapProfileHandle>;
324
325
  /**
325
326
  * Calls `worker.terminate()` when the dispose scope is exited.
326
327
  *
@@ -109,6 +109,8 @@ module.exports = {
109
109
 
110
110
  hebrew: "iso88598",
111
111
  hebrew8: "iso88598",
112
+ iso88598i: "iso88598",
113
+ iso88598e: "iso88598",
112
114
 
113
115
  turkish: "iso88599",
114
116
  turkish8: "iso88599",
@@ -31,7 +31,9 @@ function Utf32Encoder (options, codec) {
31
31
 
32
32
  Utf32Encoder.prototype.write = function (str) {
33
33
  var src = Buffer.from(str, "ucs2")
34
- var dst = Buffer.alloc(src.length * 2)
34
+ // src.length * 2 covers this chunk's code units (4 bytes each); the extra 4 bytes leave room for a
35
+ // high surrogate held over from a previous chunk, which is flushed ahead of this chunk's units.
36
+ var dst = Buffer.alloc(src.length * 2 + 4)
35
37
  var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE
36
38
  var offset = 0
37
39
 
@@ -113,9 +115,9 @@ Utf32Decoder.prototype.write = function (src) {
113
115
  // NOTE: codepoint is a signed int32 and can be negative.
114
116
  // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer).
115
117
  if (isLE) {
116
- codepoint = overflow[i] | (overflow[i + 1] << 8) | (overflow[i + 2] << 16) | (overflow[i + 3] << 24)
118
+ codepoint = overflow[0] | (overflow[1] << 8) | (overflow[2] << 16) | (overflow[3] << 24)
117
119
  } else {
118
- codepoint = overflow[i + 3] | (overflow[i + 2] << 8) | (overflow[i + 1] << 16) | (overflow[i] << 24)
120
+ codepoint = overflow[3] | (overflow[2] << 8) | (overflow[1] << 16) | (overflow[0] << 24)
119
121
  }
120
122
  overflow.length = 0
121
123
 
@@ -169,7 +171,12 @@ function _writeCodepoint (dst, offset, codepoint, badChar) {
169
171
  };
170
172
 
171
173
  Utf32Decoder.prototype.end = function () {
174
+ if (this.overflow.length === 0) { return }
175
+
176
+ // A leftover, incomplete 4-byte code unit at the end of the input is ill-formed. Substitute a
177
+ // single U+FFFD (Unicode Standard conformance clause C10) instead of silently dropping the bytes.
172
178
  this.overflow.length = 0
179
+ return String.fromCharCode(this.badChar)
173
180
  }
174
181
 
175
182
  // == UTF-32 Auto codec =============================================================
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "iconv-lite",
3
3
  "description": "Convert character encodings in pure javascript.",
4
- "version": "0.7.2",
4
+ "version": "0.7.3",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "iconv",
@@ -46,7 +46,7 @@
46
46
  "stream": false
47
47
  },
48
48
  "devDependencies": {
49
- "@arethetypeswrong/cli": "^0.17.4",
49
+ "@arethetypeswrong/cli": "^0.18.4",
50
50
  "@stylistic/eslint-plugin": "^5.1.0",
51
51
  "@stylistic/eslint-plugin-js": "^4.1.0",
52
52
  "@types/node": "^24.0.12",
@@ -276,6 +276,8 @@ export type Encoding =
276
276
  | "iso88596"
277
277
  | "iso88597"
278
278
  | "iso88598"
279
+ | "iso88598e"
280
+ | "iso88598i"
279
281
  | "iso88599"
280
282
  | "isoceltic"
281
283
  | "isoir100"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suveren/gateway",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Suveren gateway — local agent gateway built in compliance with the Human Agency Protocol (HAP). Runs the UI, control plane, and MCP server in one Node process.",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -23,7 +23,7 @@
23
23
  "node": ">=20"
24
24
  },
25
25
  "dependencies": {
26
- "@hap/core": "npm:@humanagencyp/hap-core@^0.6.0",
26
+ "@hap/core": "npm:@humanagencyp/hap-core@^0.6.1",
27
27
  "@hpke/core": "^1.9.0",
28
28
  "express": "^4.18.0",
29
29
  "http-proxy-middleware": "^3.0.0",