@onlooker-community/schema 1.2.0 → 1.3.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/README.md CHANGED
@@ -128,6 +128,26 @@ node -p "require.resolve('@onlooker-community/schema/schemas/event.v1.json')"
128
128
  - Removing an event type, making an optional field required, tightening an enum, or changing `additionalProperties` is a **major** release and bumps `schema_version`.
129
129
  - Payload schemas for `task.start`, `task.complete`, and `task.fail` are intentionally minimal in `1.0.0` and will be filled in during the `1.x` line.
130
130
 
131
+ ## Hosted JSON Schema URLs
132
+
133
+ Each schema file declares a canonical `$id` under `https://schema.onlooker.dev/schemas/…` (for example `https://schema.onlooker.dev/schemas/event.v1.json`). Those paths are served as static assets from a Cloudflare Worker.
134
+
135
+ Local preview:
136
+
137
+ ```bash
138
+ npm run prepare:assets
139
+ npx wrangler dev
140
+ # e.g. http://localhost:8787/schemas/event.v1.json
141
+ ```
142
+
143
+ Deploy (requires [Wrangler](https://developers.cloudflare.com/workers/wrangler/) login or API token):
144
+
145
+ ```bash
146
+ npm run deploy:schemas
147
+ ```
148
+
149
+ CI deploys when a GitHub release is published (after a successful `v*.*.*` tag release and npm publish) via `.github/workflows/deploy-schemas.yml`. Set repository secrets `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID`, then attach the custom domain `schema.onlooker.dev` to the `onlooker-schemas` Worker in the Cloudflare dashboard.
150
+
131
151
  ## Development
132
152
 
133
153
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlooker-community/schema",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Canonical event schema for the Onlooker ecosystem",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,6 +28,8 @@
28
28
  "test:coverage": "vitest run --coverage",
29
29
  "typecheck": "tsc --noEmit",
30
30
  "validate-schemas": "node scripts/validate-schemas.js",
31
+ "prepare:assets": "node scripts/prepare-static-assets.js",
32
+ "deploy:schemas": "npm run validate-schemas && npm run prepare:assets && wrangler deploy",
31
33
  "prepublishOnly": "npm run build && npm run validate-schemas && npm test"
32
34
  },
33
35
  "dependencies": {
@@ -40,6 +42,7 @@
40
42
  "@vitest/coverage-v8": "^1.6.1",
41
43
  "json-schema-to-typescript": "^15.0.4",
42
44
  "typescript": "^5.0.0",
43
- "vitest": "^1.0.0"
45
+ "vitest": "^1.0.0",
46
+ "wrangler": "^4.14.0"
44
47
  }
45
48
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://onlooker.community/schemas/event.v1.json",
3
+ "$id": "https://schema.onlooker.dev/schemas/event.v1.json",
4
4
  "title": "OnlookerEvent",
5
5
  "description": "Canonical event envelope for the Onlooker ecosystem.",
6
6
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://onlooker.community/schemas/payload/plugins-memory.json",
3
+ "$id": "https://schema.onlooker.dev/schemas/payload/plugins-memory.json",
4
4
  "title": "Memory plugin payloads",
5
5
  "description": "Payload schemas for archivist.*, relay.*, scribe.*, oracle.*, cues.*, and cartographer.* events.",
6
6
  "$defs": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://onlooker.community/schemas/payload/plugins-ops.json",
3
+ "$id": "https://schema.onlooker.dev/schemas/payload/plugins-ops.json",
4
4
  "title": "Ops plugin payloads",
5
5
  "description": "Payload schemas for ledger.*, echo.*, counsel.*, onlooker.*, and meridian.* events.",
6
6
  "$defs": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://onlooker.community/schemas/payload/plugins-safety.json",
3
+ "$id": "https://schema.onlooker.dev/schemas/payload/plugins-safety.json",
4
4
  "title": "Safety plugin payloads",
5
5
  "description": "Payload schemas for sentinel.*, tribunal.*, and warden.* events.",
6
6
  "$defs": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://onlooker.community/schemas/payload/session.json",
3
+ "$id": "https://schema.onlooker.dev/schemas/payload/session.json",
4
4
  "title": "Session payloads",
5
5
  "description": "Payload schemas for the session.* event family.",
6
6
  "$defs": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://onlooker.community/schemas/payload/task.json",
3
+ "$id": "https://schema.onlooker.dev/schemas/payload/task.json",
4
4
  "title": "Task payloads",
5
5
  "description": "Payload schemas for the task.* event family.",
6
6
  "$defs": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://onlooker.community/schemas/payload/tool.json",
3
+ "$id": "https://schema.onlooker.dev/schemas/payload/tool.json",
4
4
  "title": "Tool payloads",
5
5
  "description": "Payload schemas for the tool.* event family.",
6
6
  "$defs": {