@onlooker-community/schema 0.1.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 +20 -0
- package/dist/event-types.d.ts.map +1 -1
- package/dist/event-types.js.map +1 -1
- package/dist/generated-types.d.ts +380 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +15 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +7 -5
- package/dist/validate.js.map +1 -1
- package/package.json +46 -30
- package/schemas/event.v1.json +134 -134
- package/schemas/payload/plugins-memory.json +172 -172
- package/schemas/payload/plugins-ops.json +255 -244
- package/schemas/payload/plugins-safety.json +140 -124
- package/schemas/payload/session.json +52 -52
- package/schemas/payload/task.json +36 -0
- package/schemas/payload/tool.json +83 -83
package/package.json
CHANGED
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
"name": "@onlooker-community/schema",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Canonical event schema for the Onlooker ecosystem",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./schemas/*": "./schemas/*"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"schemas"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc -p tsconfig.build.json && npm run generate-types",
|
|
21
|
+
"generate-types": "node scripts/generate-types.js",
|
|
22
|
+
"ci": "npx @biomejs/biome ci",
|
|
23
|
+
"lint": "npx @biomejs/biome lint",
|
|
24
|
+
"lint:fix": "npx @biomejs/biome lint --fix",
|
|
25
|
+
"format": "npx @biomejs/biome format",
|
|
26
|
+
"format:fix": "npx @biomejs/biome format --write",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"test:coverage": "vitest run --coverage",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
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",
|
|
33
|
+
"prepublishOnly": "npm run build && npm run validate-schemas && npm test"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"ajv": "^8.17.1",
|
|
37
|
+
"ajv-formats": "^3.0.1"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@biomejs/biome": "2.4.14",
|
|
41
|
+
"@types/node": "^20.0.0",
|
|
42
|
+
"@vitest/coverage-v8": "^1.6.1",
|
|
43
|
+
"json-schema-to-typescript": "^15.0.4",
|
|
44
|
+
"typescript": "^5.0.0",
|
|
45
|
+
"vitest": "^1.0.0",
|
|
46
|
+
"wrangler": "^4.14.0"
|
|
47
|
+
}
|
|
32
48
|
}
|
package/schemas/event.v1.json
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.onlooker.dev/schemas/event.v1.json",
|
|
4
|
+
"title": "OnlookerEvent",
|
|
5
|
+
"description": "Canonical event envelope for the Onlooker ecosystem.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"id",
|
|
9
|
+
"schema_version",
|
|
10
|
+
"runtime",
|
|
11
|
+
"plugin",
|
|
12
|
+
"machine_id",
|
|
13
|
+
"timestamp",
|
|
14
|
+
"session_id",
|
|
15
|
+
"sequence",
|
|
16
|
+
"event_type",
|
|
17
|
+
"payload"
|
|
18
|
+
],
|
|
19
|
+
"additionalProperties": false,
|
|
20
|
+
"properties": {
|
|
21
|
+
"id": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"format": "uuid",
|
|
24
|
+
"description": "Unique event identifier (UUID)."
|
|
25
|
+
},
|
|
26
|
+
"schema_version": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"const": "1.0",
|
|
29
|
+
"description": "Schema version. Always \"1.0\" for this envelope."
|
|
30
|
+
},
|
|
31
|
+
"runtime": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"enum": ["claude-code", "cursor", "copilot", "gemini", "custom"],
|
|
34
|
+
"description": "Runtime that produced the event."
|
|
35
|
+
},
|
|
36
|
+
"adapter_id": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "Optional identifier of the adapter that translated a runtime-specific event to canonical form."
|
|
39
|
+
},
|
|
40
|
+
"plugin": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Plugin name that emitted the event."
|
|
43
|
+
},
|
|
44
|
+
"machine_id": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"format": "uuid",
|
|
47
|
+
"description": "Stable, anonymous machine identifier (UUID)."
|
|
48
|
+
},
|
|
49
|
+
"timestamp": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"format": "date-time",
|
|
52
|
+
"description": "ISO 8601 / RFC 3339 timestamp in UTC."
|
|
53
|
+
},
|
|
54
|
+
"session_id": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Session identifier."
|
|
57
|
+
},
|
|
58
|
+
"sequence": {
|
|
59
|
+
"type": "integer",
|
|
60
|
+
"minimum": 0,
|
|
61
|
+
"description": "Monotonically increasing sequence number within the emitting process."
|
|
62
|
+
},
|
|
63
|
+
"event_type": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"enum": [
|
|
66
|
+
"session.start",
|
|
67
|
+
"session.end",
|
|
68
|
+
"session.compact",
|
|
69
|
+
"session.prompt",
|
|
70
|
+
"task.start",
|
|
71
|
+
"task.complete",
|
|
72
|
+
"task.fail",
|
|
73
|
+
"tool.file.read",
|
|
74
|
+
"tool.file.write",
|
|
75
|
+
"tool.file.edit",
|
|
76
|
+
"tool.shell.exec",
|
|
77
|
+
"tool.web.fetch",
|
|
78
|
+
"tool.agent.spawn",
|
|
79
|
+
"tool.agent.complete",
|
|
80
|
+
"sentinel.blocked",
|
|
81
|
+
"sentinel.allowed",
|
|
82
|
+
"sentinel.reviewed",
|
|
83
|
+
"tribunal.verdict",
|
|
84
|
+
"tribunal.actor.complete",
|
|
85
|
+
"tribunal.meta.complete",
|
|
86
|
+
"warden.threat.detected",
|
|
87
|
+
"warden.threat.cleared",
|
|
88
|
+
"warden.gate.blocked",
|
|
89
|
+
"oracle.calibration.requested",
|
|
90
|
+
"oracle.calibration.complete",
|
|
91
|
+
"archivist.extract.complete",
|
|
92
|
+
"archivist.inject.complete",
|
|
93
|
+
"relay.handoff.captured",
|
|
94
|
+
"relay.handoff.injected",
|
|
95
|
+
"scribe.capture.complete",
|
|
96
|
+
"scribe.distill.complete",
|
|
97
|
+
"cues.matched",
|
|
98
|
+
"cues.applied",
|
|
99
|
+
"ledger.budget.warning",
|
|
100
|
+
"ledger.budget.exceeded",
|
|
101
|
+
"ledger.session.complete",
|
|
102
|
+
"echo.suite.started",
|
|
103
|
+
"echo.suite.complete",
|
|
104
|
+
"echo.regression.detected",
|
|
105
|
+
"cartographer.audit.complete",
|
|
106
|
+
"cartographer.issue.found",
|
|
107
|
+
"counsel.brief.generated",
|
|
108
|
+
"onlooker.session.summary",
|
|
109
|
+
"meridian.hint.generated",
|
|
110
|
+
"meridian.hint.delivered",
|
|
111
|
+
"meridian.outcome.recorded",
|
|
112
|
+
"meridian.reliance.measured",
|
|
113
|
+
"meridian.lesson.curated",
|
|
114
|
+
"meridian.playbook.updated"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"payload": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"description": "Event-type-specific payload. Validated separately against per-type schemas."
|
|
120
|
+
},
|
|
121
|
+
"cost_usd": {
|
|
122
|
+
"type": "number",
|
|
123
|
+
"minimum": 0,
|
|
124
|
+
"description": "Monetary cost in USD attributable to this event."
|
|
125
|
+
},
|
|
126
|
+
"token_count": {
|
|
127
|
+
"type": "integer",
|
|
128
|
+
"minimum": 0,
|
|
129
|
+
"description": "Token count attributable to this event."
|
|
130
|
+
},
|
|
131
|
+
"redacted": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"description": "Whether sensitive payload fields have been stripped."
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
136
|
}
|