@checkstack/backend-api 0.11.1 → 0.12.0
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/CHANGELOG.md +40 -0
- package/package.json +5 -5
- package/src/core-services.ts +2 -0
- package/src/index.ts +1 -0
- package/src/ws-registry.ts +70 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @checkstack/backend-api
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 26d8bae: Distributed satellite health checks and Assignment IDE page
|
|
8
|
+
|
|
9
|
+
**Satellite System**
|
|
10
|
+
|
|
11
|
+
- New `satellite-backend`, `satellite-common`, `satellite-frontend`, and `satellite` agent packages for distributed health check execution
|
|
12
|
+
- WebSocket-based satellite connectivity with authentication, heartbeats, and live configuration push
|
|
13
|
+
- Satellite management UI with create dialog, status badges, and list page
|
|
14
|
+
|
|
15
|
+
**Live Configuration Updates**
|
|
16
|
+
|
|
17
|
+
- Added `assignmentChanged` hook to `healthcheck-backend` for cross-plugin communication
|
|
18
|
+
- `satellite-backend` subscribes to assignment changes and pushes config updates to connected satellites in real-time
|
|
19
|
+
|
|
20
|
+
**Assignment IDE Page**
|
|
21
|
+
|
|
22
|
+
- Replaced the 1028-line modal-based `SystemHealthCheckAssignment` component with a full-page IDE layout
|
|
23
|
+
- New modular components: `AssignmentTree`, `GeneralPanel`, `ThresholdsPanel`, `RetentionPanel`, `ExecutionPanel`
|
|
24
|
+
- Added unassign capability and sorted assignment lists for stable ordering
|
|
25
|
+
|
|
26
|
+
**Shared IDE Primitives**
|
|
27
|
+
|
|
28
|
+
- Extracted `IDETreeNode`, `IDETreeSection`, `IDEStatusBar`, `IDELayout` to `@checkstack/ui` for cross-plugin reuse
|
|
29
|
+
- Migrated existing health check IDE editor to use shared primitives
|
|
30
|
+
|
|
31
|
+
**Infrastructure**
|
|
32
|
+
|
|
33
|
+
- Added `Dockerfile.satellite` for containerized satellite deployment
|
|
34
|
+
- WebSocket route registry in `@checkstack/backend` and `@checkstack/backend-api`
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies [26d8bae]
|
|
39
|
+
- Updated dependencies [26d8bae]
|
|
40
|
+
- @checkstack/healthcheck-common@0.11.0
|
|
41
|
+
- @checkstack/queue-api@0.2.13
|
|
42
|
+
|
|
3
43
|
## 0.11.1
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/backend-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"lint:code": "eslint . --max-warnings 0"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@checkstack/common": "0.6.
|
|
13
|
-
"@checkstack/healthcheck-common": "0.10.
|
|
14
|
-
"@checkstack/queue-api": "0.2.
|
|
15
|
-
"@checkstack/signal-common": "0.1.
|
|
12
|
+
"@checkstack/common": "0.6.5",
|
|
13
|
+
"@checkstack/healthcheck-common": "0.10.1",
|
|
14
|
+
"@checkstack/queue-api": "0.2.12",
|
|
15
|
+
"@checkstack/signal-common": "0.1.9",
|
|
16
16
|
"@orpc/client": "^1.13.14",
|
|
17
17
|
"@orpc/contract": "^1.13.14",
|
|
18
18
|
"@orpc/openapi": "^1.13.2",
|
package/src/core-services.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
RpcClient,
|
|
15
15
|
} from "./types";
|
|
16
16
|
import type { EventBus } from "./event-bus-types";
|
|
17
|
+
import type { WebSocketRouteRegistry } from "./ws-registry";
|
|
17
18
|
|
|
18
19
|
export * from "./types";
|
|
19
20
|
|
|
@@ -43,4 +44,5 @@ export const coreServices = {
|
|
|
43
44
|
config: createServiceRef<ConfigService>("core.config"),
|
|
44
45
|
eventBus: createServiceRef<EventBus>("core.eventBus"),
|
|
45
46
|
signalService: createServiceRef<SignalService>("core.signalService"),
|
|
47
|
+
wsRegistry: createServiceRef<WebSocketRouteRegistry>("core.wsRegistry"),
|
|
46
48
|
};
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A generic interface for a WebSocket connection managed by the core server.
|
|
3
|
+
* Plugins interact with WebSocket clients through this adapter, insulating
|
|
4
|
+
* them from the underlying Bun WebSocket API.
|
|
5
|
+
*/
|
|
6
|
+
export interface WsConnection {
|
|
7
|
+
/** Send a string message to the client */
|
|
8
|
+
send(data: string): void;
|
|
9
|
+
/** Close the connection */
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Per-connection handlers returned by a route handler's `onConnection` callback.
|
|
15
|
+
* These closures capture the connection's state (e.g., auth state, session data).
|
|
16
|
+
*/
|
|
17
|
+
export interface WsConnectionHandlers {
|
|
18
|
+
onMessage: (message: string) => void | Promise<void>;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A WebSocket route handler registered by a plugin.
|
|
24
|
+
* The core server calls `onConnection` when a new WebSocket is opened on
|
|
25
|
+
* the handler's registered path, and the handler returns per-connection
|
|
26
|
+
* event callbacks.
|
|
27
|
+
*/
|
|
28
|
+
export interface WebSocketRouteHandler {
|
|
29
|
+
/**
|
|
30
|
+
* Called when a new WebSocket connection opens on this route.
|
|
31
|
+
* Return per-connection message/close handlers.
|
|
32
|
+
*/
|
|
33
|
+
onConnection(ws: WsConnection): WsConnectionHandlers;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Scoped registry for plugin WebSocket route handlers.
|
|
38
|
+
* Each plugin receives a scoped instance (via factory) that auto-prefixes
|
|
39
|
+
* the pluginId — just like the RPC service.
|
|
40
|
+
*
|
|
41
|
+
* Plugins register handlers with a local path segment, and the core server
|
|
42
|
+
* makes them available under `/api/ws/{pluginId}{path}`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* // In satellite-backend init (pluginId "satellite" is auto-prefixed):
|
|
47
|
+
* wsRegistry.register("/", handler);
|
|
48
|
+
* // → Available at /api/ws/satellite
|
|
49
|
+
*
|
|
50
|
+
* wsRegistry.register("/connect", handler);
|
|
51
|
+
* // → Available at /api/ws/satellite/connect
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export interface WebSocketRouteRegistry {
|
|
55
|
+
/**
|
|
56
|
+
* Register a WebSocket route handler at the given path.
|
|
57
|
+
* The pluginId prefix is applied automatically by the scoped factory.
|
|
58
|
+
*/
|
|
59
|
+
register(path: string, handler: WebSocketRouteHandler): void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Core-level store for all registered WS routes.
|
|
64
|
+
* The backend server uses this to look up handlers during WebSocket upgrade.
|
|
65
|
+
* Not exposed to plugins — they interact via the scoped `WebSocketRouteRegistry`.
|
|
66
|
+
*/
|
|
67
|
+
export interface WebSocketRouteStore {
|
|
68
|
+
/** Look up a handler by full path (e.g., "satellite" or "satellite/connect"). */
|
|
69
|
+
getHandler(fullPath: string): WebSocketRouteHandler | undefined;
|
|
70
|
+
}
|