@checkstack/satellite-common 0.5.2 → 0.6.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 CHANGED
@@ -1,5 +1,67 @@
1
1
  # @checkstack/satellite-common
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 35bc682: feat(healthcheck): expose check + system run-context to script collectors
8
+
9
+ Script health checks can now read which check and system a run is for.
10
+ Previously shell scripts got only a curated env whitelist and inline
11
+ scripts only `context.config`, so a script had no built-in way to know
12
+ its own check name or the system it was checking.
13
+
14
+ - `@checkstack/backend-api`: new `CollectorRunContext` type
15
+ (`{ check: { id, name, intervalSeconds }, system: { id, name } }`) and
16
+ an optional `runContext` param on `CollectorStrategy.execute`. Optional,
17
+ so existing collector implementations are unaffected.
18
+ - Shell-script collector: injects reserved `CHECKSTACK_CHECK_ID`,
19
+ `CHECKSTACK_CHECK_NAME`, `CHECKSTACK_CHECK_INTERVAL_SECONDS`,
20
+ `CHECKSTACK_SYSTEM_ID`, `CHECKSTACK_SYSTEM_NAME` env vars (user-supplied
21
+ `env` still wins on collision).
22
+ - Inline-script collector: exposes `context.check` and `context.system`
23
+ alongside `context.config`; the inline-script editor now types them for
24
+ autocomplete.
25
+ - Shell editors (health-check collectors and automation shell actions) now
26
+ also suggest the user's own `env` (JSON) keys as `$NAME` completions, via
27
+ the new exported `customShellEnvVars` helper. Keys that aren't valid shell
28
+ identifiers are omitted.
29
+ - Fix: the Typefox `CodeEditor` captured a stale `onChange` at editor start,
30
+ so editing one `DynamicForm` field reverted sibling fields changed since
31
+ mount (e.g. typing in a shell `script` field wiped an unsaved `env` value,
32
+ or deleted a sibling automation action added after mount). The change
33
+ handler now routes through a ref to the current `onChange`.
34
+ - Fix: focusing a JSON editor threw "LanguageStatusService.addStatus is not
35
+ supported" because the standalone service set omitted `ILanguageStatusService`.
36
+ That one service is now registered via `serviceOverrides`.
37
+ - Fix: the automation trigger card nested a `<Badge>` (a `<div>`) inside a
38
+ `<p>`, producing a `validateDOMNesting` warning. Switched the wrapper to a
39
+ `<div>`.
40
+ - Local runs (`queue-executor`) and satellite runs both populate the
41
+ context. `SatelliteAssignment` (and the `getAssignmentsForSatellite`
42
+ RPC output) gained optional `configName` / `systemName` so the metadata
43
+ reaches satellite-side execution; `HealthCheckService` resolves the
44
+ system name via the catalog client.
45
+
46
+ BREAKING CHANGE: `createHealthCheckRouter` now requires a `catalogClient`
47
+ option (used to resolve system names for satellite assignments). Update
48
+ call sites to pass the catalog RPC client.
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [6d52276]
53
+ - Updated dependencies [35bc682]
54
+ - @checkstack/common@0.12.0
55
+ - @checkstack/healthcheck-common@1.3.0
56
+ - @checkstack/signal-common@0.2.5
57
+
58
+ ## 0.5.3
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [ba07ae2]
63
+ - @checkstack/healthcheck-common@1.2.0
64
+
3
65
  ## 0.5.2
4
66
 
5
67
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/satellite-common",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,16 +9,16 @@
9
9
  }
10
10
  },
11
11
  "dependencies": {
12
- "@checkstack/common": "0.10.0",
13
- "@checkstack/healthcheck-common": "1.1.1",
14
- "@checkstack/signal-common": "0.2.3",
12
+ "@checkstack/common": "0.11.0",
13
+ "@checkstack/healthcheck-common": "1.2.0",
14
+ "@checkstack/signal-common": "0.2.4",
15
15
  "@orpc/contract": "^1.13.14",
16
16
  "zod": "^4.2.1"
17
17
  },
18
18
  "devDependencies": {
19
19
  "typescript": "^5.7.2",
20
20
  "@checkstack/tsconfig": "0.0.7",
21
- "@checkstack/scripts": "0.3.2"
21
+ "@checkstack/scripts": "0.3.3"
22
22
  },
23
23
  "scripts": {
24
24
  "typecheck": "tsgo -b",
@@ -0,0 +1,30 @@
1
+ import { describe, test, expect } from "bun:test";
2
+ import { SatelliteAssignmentSchema } from "./protocol";
3
+
4
+ describe("SatelliteAssignmentSchema", () => {
5
+ const base = {
6
+ configId: "config-1",
7
+ systemId: "system-1",
8
+ strategyId: "http",
9
+ config: {},
10
+ intervalSeconds: 60,
11
+ };
12
+
13
+ test("parses an assignment WITH configName and systemName", () => {
14
+ const parsed = SatelliteAssignmentSchema.parse({
15
+ ...base,
16
+ configName: "API health",
17
+ systemName: "Production API",
18
+ });
19
+
20
+ expect(parsed.configName).toBe("API health");
21
+ expect(parsed.systemName).toBe("Production API");
22
+ });
23
+
24
+ test("parses an assignment WITHOUT configName and systemName (optional)", () => {
25
+ const parsed = SatelliteAssignmentSchema.parse(base);
26
+
27
+ expect(parsed.configName).toBeUndefined();
28
+ expect(parsed.systemName).toBeUndefined();
29
+ });
30
+ });
package/src/protocol.ts CHANGED
@@ -38,6 +38,9 @@ export const SatelliteAssignmentSchema = z.object({
38
38
  config: z.record(z.string(), z.unknown()),
39
39
  collectors: z.array(SatelliteCollectorConfigSchema).optional(),
40
40
  intervalSeconds: z.number(),
41
+ /** Curated run-context metadata. Optional for version-skew safety. */
42
+ configName: z.string().optional(),
43
+ systemName: z.string().optional(),
41
44
  });
42
45
 
43
46
  export type SatelliteAssignment = z.infer<typeof SatelliteAssignmentSchema>;