@onlooker-community/schema 0.1.0 → 1.2.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/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 +43 -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
|
@@ -1,126 +1,142 @@
|
|
|
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
|
-
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://onlooker.community/schemas/payload/plugins-safety.json",
|
|
4
|
+
"title": "Safety plugin payloads",
|
|
5
|
+
"description": "Payload schemas for sentinel.*, tribunal.*, and warden.* events.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"sentinel.blocked": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"required": ["command", "risk_level", "matched_pattern"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"command": { "type": "string" },
|
|
13
|
+
"risk_level": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": ["critical", "high", "medium"]
|
|
16
|
+
},
|
|
17
|
+
"matched_pattern": { "type": "string" },
|
|
18
|
+
"reason": { "type": "string" }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"sentinel.allowed": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"required": ["command", "risk_level"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"command": { "type": "string" },
|
|
27
|
+
"risk_level": { "type": "string", "enum": ["low", "none"] },
|
|
28
|
+
"review_required": { "type": "boolean" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"sentinel.reviewed": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": ["command", "decision"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"command": { "type": "string" },
|
|
37
|
+
"decision": { "type": "string", "enum": ["approved", "rejected"] },
|
|
38
|
+
"review_duration_ms": { "type": "integer", "minimum": 0 }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"tribunal.verdict": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"required": ["task_id", "score", "passed", "judge_type"],
|
|
45
|
+
"properties": {
|
|
46
|
+
"task_id": { "type": "string" },
|
|
47
|
+
"score": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
48
|
+
"passed": { "type": "boolean" },
|
|
49
|
+
"judge_type": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"enum": [
|
|
52
|
+
"standard",
|
|
53
|
+
"security",
|
|
54
|
+
"maintainability",
|
|
55
|
+
"adversarial",
|
|
56
|
+
"domain",
|
|
57
|
+
"meta"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"feedback_summary": { "type": "string" },
|
|
61
|
+
"file_path": { "type": "string" }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"tribunal.actor.complete": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": ["task_id", "success"],
|
|
68
|
+
"properties": {
|
|
69
|
+
"task_id": { "type": "string" },
|
|
70
|
+
"success": { "type": "boolean" },
|
|
71
|
+
"duration_ms": { "type": "integer", "minimum": 0 },
|
|
72
|
+
"skepticism_rounds": { "type": "integer", "minimum": 0 }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"tribunal.meta.complete": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"required": ["task_id", "verdict_quality", "bias_detected"],
|
|
79
|
+
"properties": {
|
|
80
|
+
"task_id": { "type": "string" },
|
|
81
|
+
"verdict_quality": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"enum": ["sound", "questionable", "biased"]
|
|
84
|
+
},
|
|
85
|
+
"bias_detected": { "type": "boolean" },
|
|
86
|
+
"override_recommendation": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"enum": ["accept", "reject", "re-evaluate"]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"warden.threat.detected": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"required": ["source_type", "threat_type", "confidence"],
|
|
96
|
+
"properties": {
|
|
97
|
+
"source_type": { "type": "string", "enum": ["web_fetch", "file_read"] },
|
|
98
|
+
"threat_type": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"enum": [
|
|
101
|
+
"prompt_injection",
|
|
102
|
+
"instruction_override",
|
|
103
|
+
"credential_exfiltration",
|
|
104
|
+
"command_injection",
|
|
105
|
+
"social_engineering"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"confidence": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
109
|
+
"source_url": { "type": "string" },
|
|
110
|
+
"source_path": { "type": "string" },
|
|
111
|
+
"snippet": { "type": "string" }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"warden.threat.cleared": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"additionalProperties": false,
|
|
117
|
+
"required": ["source_type"],
|
|
118
|
+
"properties": {
|
|
119
|
+
"source_type": { "type": "string", "enum": ["web_fetch", "file_read"] },
|
|
120
|
+
"cleared_by": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": ["timeout", "user_override", "subsequent_scan_clean"]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"warden.gate.blocked": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"additionalProperties": false,
|
|
129
|
+
"required": ["blocked_operation", "threat_source_type"],
|
|
130
|
+
"properties": {
|
|
131
|
+
"blocked_operation": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"enum": ["tool.file.write", "tool.file.edit", "tool.shell.exec"]
|
|
134
|
+
},
|
|
135
|
+
"threat_source_type": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"enum": ["web_fetch", "file_read"]
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
126
142
|
}
|
|
@@ -1,54 +1,54 @@
|
|
|
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
|
-
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://onlooker.community/schemas/payload/session.json",
|
|
4
|
+
"title": "Session payloads",
|
|
5
|
+
"description": "Payload schemas for the session.* event family.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"session.start": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"required": ["working_directory"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"working_directory": { "type": "string" },
|
|
13
|
+
"git_branch": { "type": "string" },
|
|
14
|
+
"git_commit": { "type": "string" },
|
|
15
|
+
"resume_of_session_id": { "type": "string" }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"session.end": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"required": ["duration_ms", "turn_count"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"duration_ms": { "type": "integer", "minimum": 0 },
|
|
24
|
+
"turn_count": { "type": "integer", "minimum": 0 },
|
|
25
|
+
"total_cost_usd": { "type": "number", "minimum": 0 },
|
|
26
|
+
"total_tokens": { "type": "integer", "minimum": 0 },
|
|
27
|
+
"end_reason": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"enum": ["user_exit", "timeout", "error", "task_complete", "unknown"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"session.compact": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["tokens_before", "tokens_after"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"tokens_before": { "type": "integer", "minimum": 0 },
|
|
39
|
+
"tokens_after": { "type": "integer", "minimum": 0 },
|
|
40
|
+
"compression_ratio": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"session.prompt": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": ["turn_number"],
|
|
47
|
+
"properties": {
|
|
48
|
+
"turn_number": { "type": "integer", "minimum": 1 },
|
|
49
|
+
"input_summary": { "type": "string" },
|
|
50
|
+
"context_tokens": { "type": "integer", "minimum": 0 }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
54
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://onlooker.community/schemas/payload/task.json",
|
|
4
|
+
"title": "Task payloads",
|
|
5
|
+
"description": "Payload schemas for the task.* event family.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"task.start": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"task_summary": { "type": "string" }
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"task.complete": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"required": ["success"],
|
|
18
|
+
"properties": {
|
|
19
|
+
"success": { "type": "boolean", "const": true },
|
|
20
|
+
"duration_ms": { "type": "integer", "minimum": 0 },
|
|
21
|
+
"output_summary": { "type": "string" }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"task.fail": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["success"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"success": { "type": "boolean", "const": false },
|
|
30
|
+
"duration_ms": { "type": "integer", "minimum": 0 },
|
|
31
|
+
"failure_reason": { "type": "string" },
|
|
32
|
+
"attempts": { "type": "integer", "minimum": 0 }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,85 +1,85 @@
|
|
|
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
|
-
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://onlooker.community/schemas/payload/tool.json",
|
|
4
|
+
"title": "Tool payloads",
|
|
5
|
+
"description": "Payload schemas for the tool.* event family.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"tool.file.read": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"required": ["path"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"path": { "type": "string" },
|
|
13
|
+
"lines_read": { "type": "integer", "minimum": 0 },
|
|
14
|
+
"file_size_bytes": { "type": "integer", "minimum": 0 }
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"tool.file.write": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"additionalProperties": false,
|
|
20
|
+
"required": ["path", "operation"],
|
|
21
|
+
"properties": {
|
|
22
|
+
"path": { "type": "string" },
|
|
23
|
+
"operation": { "type": "string", "enum": ["create", "overwrite"] },
|
|
24
|
+
"bytes_written": { "type": "integer", "minimum": 0 },
|
|
25
|
+
"lines_written": { "type": "integer", "minimum": 0 }
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"tool.file.edit": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"required": ["path"],
|
|
32
|
+
"properties": {
|
|
33
|
+
"path": { "type": "string" },
|
|
34
|
+
"lines_changed": { "type": "integer", "minimum": 0 }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"tool.shell.exec": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"required": ["command"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"command": { "type": "string" },
|
|
43
|
+
"exit_code": { "type": "integer" },
|
|
44
|
+
"duration_ms": { "type": "integer", "minimum": 0 },
|
|
45
|
+
"working_directory": { "type": "string" },
|
|
46
|
+
"blocked": { "type": "boolean" }
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"tool.web.fetch": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"required": ["url"],
|
|
53
|
+
"properties": {
|
|
54
|
+
"url": { "type": "string", "format": "uri" },
|
|
55
|
+
"status_code": { "type": "integer", "minimum": 100, "maximum": 599 },
|
|
56
|
+
"response_bytes": { "type": "integer", "minimum": 0 },
|
|
57
|
+
"blocked": { "type": "boolean" }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"tool.agent.spawn": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"required": ["subagent_id"],
|
|
64
|
+
"properties": {
|
|
65
|
+
"subagent_id": { "type": "string" },
|
|
66
|
+
"agent_name": { "type": "string" },
|
|
67
|
+
"task_summary": { "type": "string" },
|
|
68
|
+
"blocked": { "type": "boolean" }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"tool.agent.complete": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": ["subagent_id", "success"],
|
|
75
|
+
"properties": {
|
|
76
|
+
"subagent_id": { "type": "string" },
|
|
77
|
+
"success": { "type": "boolean" },
|
|
78
|
+
"agent_name": { "type": "string" },
|
|
79
|
+
"duration_ms": { "type": "integer", "minimum": 0 },
|
|
80
|
+
"cost_usd": { "type": "number", "minimum": 0 },
|
|
81
|
+
"output_summary": { "type": "string" }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
85
|
}
|