@hasna/uptime 0.1.2 → 0.1.3

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
@@ -6,6 +6,30 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.3] - 2026-06-28
10
+
11
+ ### Added
12
+
13
+ - Private/local probe identities, check jobs, fenced signed submissions, and
14
+ probe signing helpers exported from `@hasna/uptime/probes`.
15
+ - CLI commands for `uptime probes create`, `uptime probes jobs create`,
16
+ `uptime probes jobs claim`, and `uptime probes submit`.
17
+ - Local API and MCP probe surfaces for public-key enrollment, job
18
+ creation/claiming, and signed result submission.
19
+
20
+ ### Changed
21
+
22
+ - Bumped the local SQLite schema to version 2 while keeping schema version 1
23
+ backups restorable when they are only missing the new probe tables.
24
+ - Hosted probe ingest fails closed until cloud check jobs, workspace stores, and
25
+ audit logging are implemented.
26
+
27
+ ### Security
28
+
29
+ - API and MCP probe enrollment require caller-managed public keys; generated
30
+ private keys are written only by the CLI to an explicit private-key file.
31
+ - Probe job reads redact fencing tokens outside the claim response.
32
+
9
33
  ## [0.1.2] - 2026-06-28
10
34
 
11
35
  ### Fixed
package/README.md CHANGED
@@ -31,6 +31,27 @@ uptime incidents
31
31
  uptime serve --port 3899 --check
32
32
  ```
33
33
 
34
+ Private/local probes can submit signed results from another machine:
35
+
36
+ ```bash
37
+ uptime probes create spark01 --private-key-file ./spark01-probe.key.pem
38
+ uptime probes jobs create --monitor <monitor-id> --schedule-slot 2026-06-28T12:00:00Z
39
+ uptime probes jobs claim <job-id> --probe <probe-id>
40
+ uptime probes submit \
41
+ --probe <probe-id> \
42
+ --job <job-id> \
43
+ --schedule-slot 2026-06-28T12:00:00Z \
44
+ --fencing-token <claim-fencing-token> \
45
+ --monitor <monitor-id> \
46
+ --monitor-revision <claim-monitor-revision> \
47
+ --private-key-file ./spark01-probe.key.pem \
48
+ --status up
49
+ ```
50
+
51
+ Generated probe private keys are written only to the explicit
52
+ `--private-key-file` path. API and MCP probe enrollment require caller-managed
53
+ public keys.
54
+
34
55
  The local dashboard and API bind to `127.0.0.1` by default:
35
56
 
36
57
  ```bash
@@ -70,7 +91,9 @@ claude mcp add --scope user uptime -- uptime-mcp
70
91
  ```
71
92
 
72
93
  The MCP server exposes monitor CRUD, check execution, summary, incident, and
73
- result tools, plus an `uptime_send_report` tool for report delivery.
94
+ result tools, an `uptime_send_report` tool for report delivery, and local probe
95
+ tools for public-key enrollment, job creation/claiming, and signed result
96
+ submission.
74
97
 
75
98
  ## SDK
76
99
 
@@ -100,6 +123,8 @@ await uptime.sendReport({
100
123
  });
101
124
  ```
102
125
 
126
+ Probe agents can import signing helpers from `@hasna/uptime/probes`.
127
+
103
128
  ## API
104
129
 
105
130
  Run `uptime serve` and use:
@@ -115,6 +140,17 @@ Run `uptime serve` and use:
115
140
  - `POST /api/monitors/:id/check`
116
141
  - `GET /api/incidents`
117
142
  - `GET /api/results?monitorId=<id>&limit=100`
143
+ - `GET /api/probes`
144
+ - `POST /api/probes`
145
+ - `POST /api/probes/jobs`
146
+ - `GET /api/probes/jobs/:id`
147
+ - `POST /api/probes/jobs/:id/claim`
148
+ - `POST /api/probes/results`
149
+
150
+ Hosted `/api/v1/probes*` routes currently fail closed with `501` until cloud
151
+ check jobs, workspace stores, and audit logging are implemented. Local job reads
152
+ redact fencing tokens; the claim response is the only API response that returns
153
+ the active fencing token.
118
154
 
119
155
  ## Scope
120
156
 
@@ -129,11 +165,14 @@ First release:
129
165
  - local dashboard/API
130
166
  - CLI, MCP, SDK, and tests
131
167
  - Optional report delivery through Open Mailery, Open Telephony, and Open Logs
168
+ - Private/local probe identities, check jobs, signed submissions, and fenced
169
+ result recording for internal agents
132
170
 
133
171
  Non-goals for this first release:
134
172
 
135
173
  - Sentry-style exception tracing
136
174
  - hosted multi-tenant SaaS billing
175
+ - hosted probe ingest before cloud check jobs and workspace-scoped storage
137
176
  - synthetic browser journeys
138
177
  - public incident pages
139
178
  - provider-owned delivery configuration; Open Uptime sends through existing
package/dist/api.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { UptimeService, type UptimeServiceOptions } from "./service.js";
2
+ import { type UptimeRuntimeMode } from "./store.js";
2
3
  import type { SchedulerHandle } from "./types.js";
3
4
  export interface ServeOptions extends UptimeServiceOptions {
4
5
  host?: string;
@@ -6,13 +7,24 @@ export interface ServeOptions extends UptimeServiceOptions {
6
7
  check?: boolean;
7
8
  service?: UptimeService;
8
9
  apiToken?: string;
10
+ hostedToken?: string;
11
+ hostedTokens?: HostedToken[];
9
12
  allowUnsafeRemoteMutations?: boolean;
10
13
  }
11
14
  export interface CreateApiHandlerOptions {
12
15
  apiToken?: string;
16
+ hostedToken?: string;
17
+ hostedTokens?: HostedToken[];
13
18
  allowUnsafeRemoteMutations?: boolean;
14
19
  fetchImpl?: typeof fetch;
15
20
  trustedLoopback?: boolean;
21
+ mode?: UptimeRuntimeMode;
22
+ }
23
+ export type HostedScope = "uptime:read" | "uptime:write" | "uptime:probe" | "uptime:report" | "uptime:admin";
24
+ export interface HostedToken {
25
+ token: string;
26
+ scopes: HostedScope[];
27
+ workspaceId?: string;
16
28
  }
17
29
  export declare function createApiHandler(service: UptimeService, options?: CreateApiHandlerOptions): (request: Request) => Promise<Response>;
18
30
  export declare function serveUptime(options?: ServeOptions): {
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,E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