@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.
@@ -1,126 +1,142 @@
1
1
  {
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": { "type": "string", "enum": ["critical", "high", "medium"] },
14
- "matched_pattern": { "type": "string" },
15
- "reason": { "type": "string" }
16
- }
17
- },
18
- "sentinel.allowed": {
19
- "type": "object",
20
- "additionalProperties": false,
21
- "required": ["command", "risk_level"],
22
- "properties": {
23
- "command": { "type": "string" },
24
- "risk_level": { "type": "string", "enum": ["low", "none"] },
25
- "review_required": { "type": "boolean" }
26
- }
27
- },
28
- "sentinel.reviewed": {
29
- "type": "object",
30
- "additionalProperties": false,
31
- "required": ["command", "decision"],
32
- "properties": {
33
- "command": { "type": "string" },
34
- "decision": { "type": "string", "enum": ["approved", "rejected"] },
35
- "review_duration_ms": { "type": "integer", "minimum": 0 }
36
- }
37
- },
38
- "tribunal.verdict": {
39
- "type": "object",
40
- "additionalProperties": false,
41
- "required": ["task_id", "score", "passed", "judge_type"],
42
- "properties": {
43
- "task_id": { "type": "string" },
44
- "score": { "type": "number", "minimum": 0, "maximum": 1 },
45
- "passed": { "type": "boolean" },
46
- "judge_type": {
47
- "type": "string",
48
- "enum": ["standard", "security", "maintainability", "adversarial", "domain", "meta"]
49
- },
50
- "feedback_summary": { "type": "string" },
51
- "file_path": { "type": "string" }
52
- }
53
- },
54
- "tribunal.actor.complete": {
55
- "type": "object",
56
- "additionalProperties": false,
57
- "required": ["task_id", "success"],
58
- "properties": {
59
- "task_id": { "type": "string" },
60
- "success": { "type": "boolean" },
61
- "duration_ms": { "type": "integer", "minimum": 0 },
62
- "skepticism_rounds": { "type": "integer", "minimum": 0 }
63
- }
64
- },
65
- "tribunal.meta.complete": {
66
- "type": "object",
67
- "additionalProperties": false,
68
- "required": ["task_id", "verdict_quality", "bias_detected"],
69
- "properties": {
70
- "task_id": { "type": "string" },
71
- "verdict_quality": { "type": "string", "enum": ["sound", "questionable", "biased"] },
72
- "bias_detected": { "type": "boolean" },
73
- "override_recommendation": {
74
- "type": "string",
75
- "enum": ["accept", "reject", "re-evaluate"]
76
- }
77
- }
78
- },
79
- "warden.threat.detected": {
80
- "type": "object",
81
- "additionalProperties": false,
82
- "required": ["source_type", "threat_type", "confidence"],
83
- "properties": {
84
- "source_type": { "type": "string", "enum": ["web_fetch", "file_read"] },
85
- "threat_type": {
86
- "type": "string",
87
- "enum": [
88
- "prompt_injection",
89
- "instruction_override",
90
- "credential_exfiltration",
91
- "command_injection",
92
- "social_engineering"
93
- ]
94
- },
95
- "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
96
- "source_url": { "type": "string" },
97
- "source_path": { "type": "string" },
98
- "snippet": { "type": "string" }
99
- }
100
- },
101
- "warden.threat.cleared": {
102
- "type": "object",
103
- "additionalProperties": false,
104
- "required": ["source_type"],
105
- "properties": {
106
- "source_type": { "type": "string", "enum": ["web_fetch", "file_read"] },
107
- "cleared_by": {
108
- "type": "string",
109
- "enum": ["timeout", "user_override", "subsequent_scan_clean"]
110
- }
111
- }
112
- },
113
- "warden.gate.blocked": {
114
- "type": "object",
115
- "additionalProperties": false,
116
- "required": ["blocked_operation", "threat_source_type"],
117
- "properties": {
118
- "blocked_operation": {
119
- "type": "string",
120
- "enum": ["tool.file.write", "tool.file.edit", "tool.shell.exec"]
121
- },
122
- "threat_source_type": { "type": "string", "enum": ["web_fetch", "file_read"] }
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
- "$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
- }
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
- "$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
- }
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
  }