@xyo-network/xl1-system-status 4.0.11 → 4.0.14

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/README.md CHANGED
@@ -1,16 +1,116 @@
1
+ [![logo][]](https://xyo.network)
2
+
1
3
  # @xyo-network/xl1-system-status
2
4
 
3
- System status publishers for XYO Layer One.
5
+ [![npm-badge][]][npm-link]
6
+ [![license-badge][]][license-link]
7
+
8
+ > Console and HTTP system-status publishers for XL1 services.
9
+
10
+ ## Description
11
+
12
+ XL1 is the XYO Layer One blockchain protocol. This package publishes
13
+ `SystemStatusRunner` state to operational sinks: console logs and HTTP health
14
+ endpoints.
15
+
16
+ It does not own the status model itself. The runner, viewer, and protocol
17
+ interfaces live in `@xyo-network/xl1-protocol/protocol-lib`.
18
+
19
+ ## Install
20
+
21
+ Using npm:
22
+
23
+ ```sh
24
+ npm i --save @xyo-network/xl1-system-status
25
+ ```
26
+
27
+ Using yarn:
28
+
29
+ ```sh
30
+ yarn add @xyo-network/xl1-system-status
31
+ ```
32
+
33
+ Using pnpm:
34
+
35
+ ```sh
36
+ pnpm add @xyo-network/xl1-system-status
37
+ ```
38
+
39
+ Using bun:
40
+
41
+ ```sh
42
+ bun add @xyo-network/xl1-system-status
43
+ ```
44
+
45
+ ## Usage
46
+
47
+ Publish status to Kubernetes-style HTTP probes:
48
+
49
+ ```ts
50
+ import { HttpSystemStatusPublisher } from '@xyo-network/xl1-system-status'
51
+
52
+ const publisher = new HttpSystemStatusPublisher(statusRunner, { port: 8081 })
53
+
54
+ await publisher.start()
55
+ ```
56
+
57
+ Available HTTP endpoints:
58
+
59
+ - `/healthz` - 200 when global status is `started`.
60
+ - `/livez` - 200 while the process is running.
61
+ - `/readyz` - 200 when ready, 503 during startup or shutdown.
62
+ - `/status` - JSON status snapshot.
63
+
64
+ ## Documentation
65
+
66
+ Exports include:
67
+
68
+ - `ConsoleSystemStatusPublisher` - logs global status transitions.
69
+ - `HttpSystemStatusPublisher` - serves health endpoints and logs transitions.
70
+ - `resolveStatusProbe` - pure probe routing helper for tests and alternate servers.
71
+
72
+ Publishers are plain start/stop observers. They do not report their own
73
+ lifecycle into the runner, so they cannot make `/healthz` pass before the real
74
+ service stack has started.
75
+
76
+ ## AI Agent Skills
77
+
78
+ Install the recommended XL1/XYO skills with [Skills.sh](https://skills.sh):
79
+
80
+ ```sh
81
+ npx skills add XYOracleNetwork/xyo-skills --all
82
+ ```
83
+
84
+ In XY toolchain repos, the equivalent convenience command is:
85
+
86
+ ```sh
87
+ pnpm xy skills defaults
88
+ pnpm xy skills lint --fix
89
+ ```
90
+
91
+ For XL1 work, ask your agent to use `xyo-knowledge`, `xl1-knowledge`, and
92
+ `xl1-patterns`. These skills cover XYO primitives, XL1 chain and gateway APIs,
93
+ and application patterns for XL1 dApps.
94
+
95
+ ## Building Locally
96
+
97
+ ```sh
98
+ pnpm xy build @xyo-network/xl1-system-status
99
+ pnpm xy test @xyo-network/xl1-system-status
100
+ pnpm xy lint @xyo-network/xl1-system-status
101
+ ```
102
+
103
+ ## License
104
+
105
+ See the [LICENSE](./LICENSE) file for license rights and limitations
106
+ (LGPL-3.0-only).
4
107
 
5
- The status model itself — the `SystemStatusRunner` hub, the `SystemStatusViewer`
6
- read facade, and their interfaces — lives in `@xyo-network/xl1-protocol-lib` and
7
- `@xyo-network/xl1-protocol-sdk`. This package provides the **publishers** that
8
- emit that status outward:
108
+ ## Credits
9
109
 
10
- - `ConsoleSystemStatusPublisher` — logs global status transitions via a logger.
11
- - `HttpSystemStatusPublisher` — serves Kubernetes-style probes (`/healthz`,
12
- `/livez`, `/readyz`) plus a `/status` JSON snapshot over `node:http`.
110
+ [Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)
13
111
 
14
- Both are plain start/stop observers (not creatable providers): they read the
15
- Runner and never report their own lifecycle into it, so they cannot skew the
16
- aggregate status (no false `/healthz` 200).
112
+ [npm-badge]: https://img.shields.io/npm/v/@xyo-network/xl1-system-status.svg
113
+ [npm-link]: https://www.npmjs.com/package/@xyo-network/xl1-system-status
114
+ [license-badge]: https://img.shields.io/npm/l/@xyo-network/xl1-system-status.svg
115
+ [license-link]: ./LICENSE
116
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
@@ -1,5 +1,5 @@
1
1
  import type { Logger } from '@ariestools/sdk';
2
- import type { SystemStatusPublisher, SystemStatusRunner } from '@xyo-network/xl1-protocol-lib';
2
+ import type { SystemStatusPublisher, SystemStatusRunner } from '@xyo-network/xl1-protocol/protocol-lib';
3
3
  /** Options for the console system-status publisher. */
4
4
  export interface ConsoleSystemStatusPublisherOptions {
5
5
  logger?: Logger;
@@ -1 +1 @@
1
- {"version":3,"file":"ConsoleSystemStatusPublisher.d.ts","sourceRoot":"","sources":["../../src/ConsoleSystemStatusPublisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAG9F,uDAAuD;AACvD,MAAM,WAAW,mCAAmC;IAClD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,4BAA6B,YAAW,qBAAqB;IACxE,QAAQ,CAAC,OAAO,0BAA+B;IAE/C,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;gBAE/B,MAAM,EAAE,kBAAkB,EAAE,OAAO,GAAE,mCAAwC;IAKzF,KAAK,IAAI,IAAI;IAUb,IAAI,IAAI,IAAI;CAGb"}
1
+ {"version":3,"file":"ConsoleSystemStatusPublisher.d.ts","sourceRoot":"","sources":["../../src/ConsoleSystemStatusPublisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAGvG,uDAAuD;AACvD,MAAM,WAAW,mCAAmC;IAClD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,4BAA6B,YAAW,qBAAqB;IACxE,QAAQ,CAAC,OAAO,0BAA+B;IAE/C,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;gBAE/B,MAAM,EAAE,kBAAkB,EAAE,OAAO,GAAE,mCAAwC;IAKzF,KAAK,IAAI,IAAI;IAUb,IAAI,IAAI,IAAI;CAGb"}
@@ -1,5 +1,5 @@
1
1
  import type { Logger } from '@ariestools/sdk';
2
- import type { SystemStatusPublisher, SystemStatusRunner, SystemStatusViewerMethods } from '@xyo-network/xl1-protocol-lib';
2
+ import type { SystemStatusPublisher, SystemStatusRunner, SystemStatusViewerMethods } from '@xyo-network/xl1-protocol/protocol-lib';
3
3
  /** Options for the HTTP system-status publisher. */
4
4
  export interface HttpSystemStatusPublisherOptions {
5
5
  host?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"HttpSystemStatusPublisher.d.ts","sourceRoot":"","sources":["../../src/HttpSystemStatusPublisher.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EACV,qBAAqB,EAAE,kBAAkB,EAAE,yBAAyB,EACrE,MAAM,+BAA+B,CAAA;AAGtC,oDAAoD;AACpD,MAAM,WAAW,gCAAgC;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED,gEAAgE;AAChE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAA;IACb,UA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,QAAQ,CAAC,OAAO,0BAA+B;IAE/C,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;gBAE/B,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,gCAAgC;IAK3E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,OAAO,CAAC,aAAa;CAItB"}
@@ -1,5 +1,5 @@
1
1
  // src/ConsoleSystemStatusPublisher.ts
2
- import { SystemStatusPublisherMoniker } from "@xyo-network/xl1-protocol-lib";
2
+ import { SystemStatusPublisherMoniker } from "@xyo-network/xl1-protocol/protocol-lib";
3
3
  var ConsoleSystemStatusPublisher = class {
4
4
  moniker = SystemStatusPublisherMoniker;
5
5
  _started = false;
@@ -25,7 +25,7 @@ var ConsoleSystemStatusPublisher = class {
25
25
 
26
26
  // src/HttpSystemStatusPublisher.ts
27
27
  import http from "node:http";
28
- import { SystemStatusPublisherMoniker as SystemStatusPublisherMoniker2 } from "@xyo-network/xl1-protocol-lib";
28
+ import { SystemStatusPublisherMoniker as SystemStatusPublisherMoniker2 } from "@xyo-network/xl1-protocol/protocol-lib";
29
29
  function resolveStatusProbe(status, url) {
30
30
  switch (url) {
31
31
  case "/healthz": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ConsoleSystemStatusPublisher.ts", "../../src/HttpSystemStatusPublisher.ts"],
4
- "sourcesContent": ["import type { Logger } from '@ariestools/sdk'\nimport type { SystemStatusPublisher, SystemStatusRunner } from '@xyo-network/xl1-protocol-lib'\nimport { SystemStatusPublisherMoniker } from '@xyo-network/xl1-protocol-lib'\n\n/** Options for the console system-status publisher. */\nexport interface ConsoleSystemStatusPublisherOptions {\n logger?: Logger\n}\n\n/**\n * Publishes system status to the console by subscribing to the Runner's global\n * status transitions.\n *\n * It is a plain start/stop observer \u2014 NOT a CreatableProvider \u2014 so it never\n * reports its own lifecycle into the Runner. A self-reporting publisher would\n * report itself `started` before any real service is up, falsely flipping the\n * aggregate status to `started` (and any HTTP `/healthz` derived from it to\n * 200). Being a plain observer keeps the global status reflecting only the\n * actual services.\n */\nexport class ConsoleSystemStatusPublisher implements SystemStatusPublisher {\n readonly moniker = SystemStatusPublisherMoniker\n\n private _started = false\n private readonly options: ConsoleSystemStatusPublisherOptions\n private readonly status: SystemStatusRunner\n\n constructor(status: SystemStatusRunner, options: ConsoleSystemStatusPublisherOptions = {}) {\n this.status = status\n this.options = options\n }\n\n start(): void {\n this._started = true\n const { logger } = this.options\n this.status.onGlobalTransition({}, (from, to) => {\n if (!this._started) return\n logger?.log(`System status: ${from} -> ${to}`)\n if (to === 'started') logger?.log('All services started.')\n })\n }\n\n stop(): void {\n this._started = false\n }\n}\n", "import type {\n IncomingMessage, Server, ServerResponse,\n} from 'node:http'\nimport http from 'node:http'\n\nimport type { Logger } from '@ariestools/sdk'\nimport type {\n SystemStatusPublisher, SystemStatusRunner, SystemStatusViewerMethods,\n} from '@xyo-network/xl1-protocol-lib'\nimport { SystemStatusPublisherMoniker } from '@xyo-network/xl1-protocol-lib'\n\n/** Options for the HTTP system-status publisher. */\nexport interface HttpSystemStatusPublisherOptions {\n host?: string\n logger?: Logger\n port: number\n}\n\n/** A resolved probe response (HTTP status code + JSON body). */\nexport interface StatusProbeResponse {\n body: unknown\n statusCode: number\n}\n\n/**\n * Pure routing for the status probe endpoints. Extracted from the HTTP server\n * so the routing logic is testable without binding a socket.\n */\nexport function resolveStatusProbe(status: SystemStatusViewerMethods, url: string): StatusProbeResponse {\n switch (url) {\n case '/healthz': {\n const global = status.getGlobalStatus()\n return { statusCode: global === 'started' ? 200 : 500, body: { status: global } }\n }\n case '/livez': {\n return { statusCode: 200, body: { status: 'live' } }\n }\n case '/readyz': {\n if (status.isShuttingDown()) return { statusCode: 503, body: { status: 'shutting-down' } }\n if (status.isReady()) return { statusCode: 200, body: { status: 'ready' } }\n return { statusCode: 503, body: { status: 'pending' } }\n }\n case '/status': {\n return { statusCode: 200, body: status.snapshot() }\n }\n default: {\n return { statusCode: 404, body: { status: 'not found' } }\n }\n }\n}\n\nconst sendJson = (res: ServerResponse, statusCode: number, body: unknown): void => {\n res.writeHead(statusCode, { 'Content-Type': 'application/json' })\n res.end(JSON.stringify(body))\n}\n\n/**\n * Publishes system status over HTTP with Kubernetes-style probes plus a richer\n * `/status` snapshot:\n * - `/healthz` \u2014 200 once the global status is `started`, otherwise 500.\n * - `/livez` \u2014 200 unconditionally while the process is running.\n * - `/readyz` \u2014 503 while shutting down, 200 once `isReady()`, else 503.\n * - `/status` \u2014 200 with the full status snapshot as JSON.\n *\n * It publishes to two sinks: the HTTP endpoints above, and the logger (it logs\n * each global status transition via the Runner's subscription).\n *\n * It is a plain start/stop observer (not a CreatableProvider) so it does not\n * report its own lifecycle into the Runner \u2014 keeping the global status (and\n * thus `/healthz`) reflecting only the actual services.\n */\nexport class HttpSystemStatusPublisher implements SystemStatusPublisher {\n readonly moniker = SystemStatusPublisherMoniker\n\n private _server: Server | undefined\n private _started = false\n private readonly options: HttpSystemStatusPublisherOptions\n private readonly status: SystemStatusRunner\n\n constructor(status: SystemStatusRunner, options: HttpSystemStatusPublisherOptions) {\n this.status = status\n this.options = options\n }\n\n async start(): Promise<void> {\n this._started = true\n const {\n host, logger, port,\n } = this.options\n // Console sink: log every global status transition via the logger.\n this.status.onGlobalTransition({}, (from, to) => {\n if (!this._started) return\n logger?.log(`System status: ${from} -> ${to}`)\n })\n const server = http.createServer((req, res) => this.handleRequest(req, res))\n await new Promise<void>((resolve, reject) => {\n server.once('error', reject)\n server.listen(port, host, () => {\n logger?.log(`System status HTTP server running on http://${host ?? 'localhost'}:${port}`)\n logger?.log(' - /healthz')\n logger?.log(' - /livez')\n logger?.log(' - /readyz')\n logger?.log(' - /status')\n resolve()\n })\n })\n this._server = server\n }\n\n async stop(): Promise<void> {\n this._started = false\n const server = this._server\n this._server = undefined\n if (server !== undefined) {\n await new Promise<void>((resolve) => {\n server.close(() => resolve())\n })\n }\n }\n\n private handleRequest(req: IncomingMessage, res: ServerResponse): void {\n const { statusCode, body } = resolveStatusProbe(this.status, req.url ?? '')\n sendJson(res, statusCode, body)\n }\n}\n"],
4
+ "sourcesContent": ["import type { Logger } from '@ariestools/sdk'\nimport type { SystemStatusPublisher, SystemStatusRunner } from '@xyo-network/xl1-protocol/protocol-lib'\nimport { SystemStatusPublisherMoniker } from '@xyo-network/xl1-protocol/protocol-lib'\n\n/** Options for the console system-status publisher. */\nexport interface ConsoleSystemStatusPublisherOptions {\n logger?: Logger\n}\n\n/**\n * Publishes system status to the console by subscribing to the Runner's global\n * status transitions.\n *\n * It is a plain start/stop observer \u2014 NOT a CreatableProvider \u2014 so it never\n * reports its own lifecycle into the Runner. A self-reporting publisher would\n * report itself `started` before any real service is up, falsely flipping the\n * aggregate status to `started` (and any HTTP `/healthz` derived from it to\n * 200). Being a plain observer keeps the global status reflecting only the\n * actual services.\n */\nexport class ConsoleSystemStatusPublisher implements SystemStatusPublisher {\n readonly moniker = SystemStatusPublisherMoniker\n\n private _started = false\n private readonly options: ConsoleSystemStatusPublisherOptions\n private readonly status: SystemStatusRunner\n\n constructor(status: SystemStatusRunner, options: ConsoleSystemStatusPublisherOptions = {}) {\n this.status = status\n this.options = options\n }\n\n start(): void {\n this._started = true\n const { logger } = this.options\n this.status.onGlobalTransition({}, (from, to) => {\n if (!this._started) return\n logger?.log(`System status: ${from} -> ${to}`)\n if (to === 'started') logger?.log('All services started.')\n })\n }\n\n stop(): void {\n this._started = false\n }\n}\n", "import type {\n IncomingMessage, Server, ServerResponse,\n} from 'node:http'\nimport http from 'node:http'\n\nimport type { Logger } from '@ariestools/sdk'\nimport type {\n SystemStatusPublisher, SystemStatusRunner, SystemStatusViewerMethods,\n} from '@xyo-network/xl1-protocol/protocol-lib'\nimport { SystemStatusPublisherMoniker } from '@xyo-network/xl1-protocol/protocol-lib'\n\n/** Options for the HTTP system-status publisher. */\nexport interface HttpSystemStatusPublisherOptions {\n host?: string\n logger?: Logger\n port: number\n}\n\n/** A resolved probe response (HTTP status code + JSON body). */\nexport interface StatusProbeResponse {\n body: unknown\n statusCode: number\n}\n\n/**\n * Pure routing for the status probe endpoints. Extracted from the HTTP server\n * so the routing logic is testable without binding a socket.\n */\nexport function resolveStatusProbe(status: SystemStatusViewerMethods, url: string): StatusProbeResponse {\n switch (url) {\n case '/healthz': {\n const global = status.getGlobalStatus()\n return { statusCode: global === 'started' ? 200 : 500, body: { status: global } }\n }\n case '/livez': {\n return { statusCode: 200, body: { status: 'live' } }\n }\n case '/readyz': {\n if (status.isShuttingDown()) return { statusCode: 503, body: { status: 'shutting-down' } }\n if (status.isReady()) return { statusCode: 200, body: { status: 'ready' } }\n return { statusCode: 503, body: { status: 'pending' } }\n }\n case '/status': {\n return { statusCode: 200, body: status.snapshot() }\n }\n default: {\n return { statusCode: 404, body: { status: 'not found' } }\n }\n }\n}\n\nconst sendJson = (res: ServerResponse, statusCode: number, body: unknown): void => {\n res.writeHead(statusCode, { 'Content-Type': 'application/json' })\n res.end(JSON.stringify(body))\n}\n\n/**\n * Publishes system status over HTTP with Kubernetes-style probes plus a richer\n * `/status` snapshot:\n * - `/healthz` \u2014 200 once the global status is `started`, otherwise 500.\n * - `/livez` \u2014 200 unconditionally while the process is running.\n * - `/readyz` \u2014 503 while shutting down, 200 once `isReady()`, else 503.\n * - `/status` \u2014 200 with the full status snapshot as JSON.\n *\n * It publishes to two sinks: the HTTP endpoints above, and the logger (it logs\n * each global status transition via the Runner's subscription).\n *\n * It is a plain start/stop observer (not a CreatableProvider) so it does not\n * report its own lifecycle into the Runner \u2014 keeping the global status (and\n * thus `/healthz`) reflecting only the actual services.\n */\nexport class HttpSystemStatusPublisher implements SystemStatusPublisher {\n readonly moniker = SystemStatusPublisherMoniker\n\n private _server: Server | undefined\n private _started = false\n private readonly options: HttpSystemStatusPublisherOptions\n private readonly status: SystemStatusRunner\n\n constructor(status: SystemStatusRunner, options: HttpSystemStatusPublisherOptions) {\n this.status = status\n this.options = options\n }\n\n async start(): Promise<void> {\n this._started = true\n const {\n host, logger, port,\n } = this.options\n // Console sink: log every global status transition via the logger.\n this.status.onGlobalTransition({}, (from, to) => {\n if (!this._started) return\n logger?.log(`System status: ${from} -> ${to}`)\n })\n const server = http.createServer((req, res) => this.handleRequest(req, res))\n await new Promise<void>((resolve, reject) => {\n server.once('error', reject)\n server.listen(port, host, () => {\n logger?.log(`System status HTTP server running on http://${host ?? 'localhost'}:${port}`)\n logger?.log(' - /healthz')\n logger?.log(' - /livez')\n logger?.log(' - /readyz')\n logger?.log(' - /status')\n resolve()\n })\n })\n this._server = server\n }\n\n async stop(): Promise<void> {\n this._started = false\n const server = this._server\n this._server = undefined\n if (server !== undefined) {\n await new Promise<void>((resolve) => {\n server.close(() => resolve())\n })\n }\n }\n\n private handleRequest(req: IncomingMessage, res: ServerResponse): void {\n const { statusCode, body } = resolveStatusProbe(this.status, req.url ?? '')\n sendJson(res, statusCode, body)\n }\n}\n"],
5
5
  "mappings": ";AAEA,SAAS,oCAAoC;AAkBtC,IAAM,+BAAN,MAAoE;AAAA,EAChE,UAAU;AAAA,EAEX,WAAW;AAAA,EACF;AAAA,EACA;AAAA,EAEjB,YAAY,QAA4B,UAA+C,CAAC,GAAG;AACzF,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,QAAc;AACZ,SAAK,WAAW;AAChB,UAAM,EAAE,OAAO,IAAI,KAAK;AACxB,SAAK,OAAO,mBAAmB,CAAC,GAAG,CAAC,MAAM,OAAO;AAC/C,UAAI,CAAC,KAAK,SAAU;AACpB,cAAQ,IAAI,kBAAkB,IAAI,OAAO,EAAE,EAAE;AAC7C,UAAI,OAAO,UAAW,SAAQ,IAAI,uBAAuB;AAAA,IAC3D,CAAC;AAAA,EACH;AAAA,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AAChB,UAAM;AAAA,MACJ;AAAA,MAAM;AAAA,MAAQ;AAAA,IAChB,IAAI,KAAK;AAET,SAAK,OAAO,mBAAmB,CAAC,GAAG,CAAC,MAAM,OAAO;AAC/C,UAAI,CAAC,KAAK,SAAU;AACpB,cAAQ,IAAI,kBAAkB,IAAI,OAAO,EAAE,EAAE;AAAA,IAC/C,CAAC;AACD,UAAM,SAAS,KAAK,aAAa,CAAC,KAAK,QAAQ,KAAK,cAAc,KAAK,GAAG,CAAC;AAC3E,UAAM,IAAI,QAAc,CAAC,SAAS,WAAW;AAC3C,aAAO,KAAK,SAAS,MAAM;AAC3B,aAAO,OAAO,MAAM,MAAM,MAAM;AAC9B,gBAAQ,IAAI,+CAA+C,QAAQ,WAAW,IAAI,IAAI,EAAE;AACxF,gBAAQ,IAAI,aAAa;AACzB,gBAAQ,IAAI,WAAW;AACvB,gBAAQ,IAAI,YAAY;AACxB,gBAAQ,IAAI,YAAY;AACxB,gBAAQ;AAAA,MACV,CAAC;AAAA,IACH,CAAC;AACD,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAM,OAAsB;AAC1B,SAAK,WAAW;AAChB,UAAM,SAAS,KAAK;AACpB,SAAK,UAAU;AACf,QAAI,WAAW,QAAW;AACxB,YAAM,IAAI,QAAc,CAAC,YAAY;AACnC,eAAO,MAAM,MAAM,QAAQ,CAAC;AAAA,MAC9B,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEQ,cAAc,KAAsB,KAA2B;AACrE,UAAM,EAAE,YAAY,KAAK,IAAI,mBAAmB,KAAK,QAAQ,IAAI,OAAO,EAAE;AAC1E,aAAS,KAAK,YAAY,IAAI;AAAA,EAChC;AACF;",
6
6
  "names": ["SystemStatusPublisherMoniker"]
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/xl1-system-status",
4
- "version": "4.0.11",
4
+ "version": "4.0.14",
5
5
  "description": "XYO Layer One system status publishers (console + HTTP health endpoints)",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -35,42 +35,41 @@
35
35
  "README.md"
36
36
  ],
37
37
  "dependencies": {
38
- "@xyo-network/xl1-protocol-lib": "~4.0.11"
38
+ "@xyo-network/xl1-protocol": "~4.0.14"
39
39
  },
40
40
  "devDependencies": {
41
- "@ariestools/sdk": "~7.0.8",
41
+ "@ariestools/sdk": "~8.0.3",
42
+ "@ariestools/threads": "~8.0.3",
43
+ "@ariestools/toolchain": "~8.6.12",
44
+ "@ariestools/tsconfig": "~8.6.12",
42
45
  "@bitauth/libauth": "~3.0.0",
46
+ "@metamask/json-rpc-engine": "~10.5.0",
43
47
  "@metamask/providers": "~22.1.1",
44
48
  "@noble/post-quantum": "~0.6.1",
45
49
  "@opentelemetry/api": "~1.9.1",
46
50
  "@opentelemetry/sdk-trace-base": "~2.9.0",
47
51
  "@scure/base": "~2.2.0",
48
52
  "@scure/bip39": "~2.2.0",
49
- "@xylabs/geo": "~7.0.8",
50
- "@xylabs/threads": "~7.0.8",
51
- "@xylabs/toolchain": "~8.6.2",
52
- "@xylabs/tsconfig": "~8.6.2",
53
- "@xyo-network/sdk": "~7.0.8",
54
- "@xyo-network/sdk-protocol": "~7.0.13",
53
+ "@xyo-network/sdk": "~7.0.11",
54
+ "@xyo-network/sdk-protocol": "~7.0.15",
55
55
  "ajv": "~8.20.0",
56
56
  "async-mutex": "~0.5.0",
57
- "cosmiconfig": "~9.0.2",
58
57
  "debug": "~4.4.3",
59
58
  "eslint": "~10.6.0",
60
59
  "ethers": "~6.17.0",
61
60
  "hash-wasm": "~4.12.0",
62
61
  "idb": "~8.0.3",
63
- "lru-cache": "~11.5.1",
64
62
  "observable-fns": "~0.6.1",
65
63
  "typescript": "~6.0.3",
66
64
  "vite": "~8.1.3",
67
- "vitest": "~4.1.9",
65
+ "vitest": "~4.1.10",
68
66
  "webextension-polyfill": "~0.12.0",
69
67
  "zod": "~4.4.3",
70
- "@xyo-network/xl1-protocol-sdk": "~4.0.11"
68
+ "@xyo-network/xl1-sdk": "~4.0.14"
71
69
  },
72
70
  "peerDependencies": {
73
- "@ariestools/sdk": "^7.0.8",
71
+ "@ariestools/sdk": "^8.0.3",
72
+ "@ariestools/threads": "^8.0.3",
74
73
  "@bitauth/libauth": "^3.0.0",
75
74
  "@metamask/providers": "^22.1.1",
76
75
  "@noble/post-quantum": "^0.6.1",
@@ -78,17 +77,14 @@
78
77
  "@opentelemetry/sdk-trace-base": "^2.9.0",
79
78
  "@scure/base": "^2.2.0",
80
79
  "@scure/bip39": "^2.2.0",
81
- "@xylabs/geo": "^7.0.8",
82
- "@xylabs/threads": "^7.0.8",
83
- "@xyo-network/sdk": "^7.0.8",
84
- "@xyo-network/sdk-protocol": "^7.0.13",
80
+ "@xyo-network/sdk": "^7.0.11",
81
+ "@xyo-network/sdk-protocol": "^7.0.15",
85
82
  "ajv": "^8.20.0",
86
83
  "async-mutex": "^0.5.0",
87
84
  "debug": "^4.4.3",
88
85
  "ethers": "^6.17.0",
89
86
  "hash-wasm": "^4.12.0",
90
87
  "idb": "^8.0.3",
91
- "lru-cache": "^11.5.1",
92
88
  "observable-fns": "^0.6.1",
93
89
  "webextension-polyfill": "^0.12.0",
94
90
  "zod": "^4.4.3"