@onthink/prompt-observer 0.1.1 → 0.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/PROMPT_OBSERVER.md +36 -8
- package/README.md +46 -14
- package/bin/prompt-observer.mjs +734 -246
- package/package.json +2 -1
- package/pricing/models.json +23 -0
- package/schema/event.schema.json +48 -84
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onthink/prompt-observer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A dependency-free prompt observability contract and CLI for coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"files": [
|
|
37
37
|
"bin/",
|
|
38
38
|
"schema/",
|
|
39
|
+
"pricing/",
|
|
39
40
|
"PROMPT_OBSERVER.md",
|
|
40
41
|
"README.md",
|
|
41
42
|
"LICENSE"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1.0",
|
|
3
|
+
"updated_at": "2026-09-13",
|
|
4
|
+
"currency": "USD",
|
|
5
|
+
"unit_tokens": 1000000,
|
|
6
|
+
"source_url": "https://developers.openai.com/api/docs/models/compare",
|
|
7
|
+
"notes": "Standard text-token rates only. Cached input, tools, long-context premiums, subscriptions, and provider-specific discounts are excluded.",
|
|
8
|
+
"models": {
|
|
9
|
+
"gpt-6-astra": { "input_usd": 10, "output_usd": 50 },
|
|
10
|
+
"gpt-5.6": { "input_usd": 4, "output_usd": 20 },
|
|
11
|
+
"gpt-5.6-sol": { "input_usd": 4, "output_usd": 20 },
|
|
12
|
+
"gpt-5.6-terra": { "input_usd": 2, "output_usd": 12 },
|
|
13
|
+
"gpt-5.6-luna": { "input_usd": 0.2, "output_usd": 1.2 },
|
|
14
|
+
"gpt-5.2": { "input_usd": 1.75, "output_usd": 14 },
|
|
15
|
+
"gpt-5.2-chat-latest": { "input_usd": 1.75, "output_usd": 14 },
|
|
16
|
+
"gpt-5.1": { "input_usd": 1.25, "output_usd": 10 },
|
|
17
|
+
"gpt-5.1-chat-latest": { "input_usd": 1.25, "output_usd": 10 },
|
|
18
|
+
"gpt-5": { "input_usd": 1.25, "output_usd": 10 },
|
|
19
|
+
"gpt-5-chat-latest": { "input_usd": 1.25, "output_usd": 10 },
|
|
20
|
+
"gpt-5-mini": { "input_usd": 0.25, "output_usd": 2 },
|
|
21
|
+
"gpt-5-nano": { "input_usd": 0.05, "output_usd": 0.4 }
|
|
22
|
+
}
|
|
23
|
+
}
|
package/schema/event.schema.json
CHANGED
|
@@ -1,47 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://prompt-observer.local/schema/event-1.
|
|
3
|
+
"$id": "https://prompt-observer.local/schema/event-1.1.json",
|
|
4
4
|
"title": "Prompt Observer Event",
|
|
5
|
+
"description": "Supports legacy 1.0 events and structured 1.1 events.",
|
|
5
6
|
"type": "object",
|
|
6
7
|
"additionalProperties": false,
|
|
7
8
|
"required": [
|
|
8
|
-
"schema_version",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"intent_clarity",
|
|
14
|
-
"context_sufficiency",
|
|
15
|
-
"scope_definition",
|
|
16
|
-
"constraints_quality",
|
|
17
|
-
"acceptance_criteria",
|
|
18
|
-
"verification_plan",
|
|
19
|
-
"ambiguity_risk",
|
|
20
|
-
"strengths",
|
|
21
|
-
"weaknesses",
|
|
22
|
-
"improvement_suggestions",
|
|
23
|
-
"execution_signals",
|
|
24
|
-
"usage"
|
|
9
|
+
"schema_version", "event_id", "timestamp", "task_type", "prompt_summary",
|
|
10
|
+
"intent_clarity", "context_sufficiency", "scope_definition",
|
|
11
|
+
"constraints_quality", "acceptance_criteria", "verification_plan",
|
|
12
|
+
"ambiguity_risk", "strengths", "weaknesses", "improvement_suggestions",
|
|
13
|
+
"execution_signals", "usage"
|
|
25
14
|
],
|
|
26
15
|
"properties": {
|
|
27
|
-
"schema_version": { "
|
|
28
|
-
"event_id": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$"
|
|
31
|
-
},
|
|
16
|
+
"schema_version": { "enum": ["1.0", "1.1"] },
|
|
17
|
+
"event_id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$" },
|
|
32
18
|
"timestamp": { "type": "string", "format": "date-time" },
|
|
33
|
-
"task_type": {
|
|
34
|
-
"enum": [
|
|
35
|
-
"coding",
|
|
36
|
-
"debugging",
|
|
37
|
-
"planning",
|
|
38
|
-
"review",
|
|
39
|
-
"testing",
|
|
40
|
-
"documentation",
|
|
41
|
-
"refactoring",
|
|
42
|
-
"other"
|
|
43
|
-
]
|
|
44
|
-
},
|
|
19
|
+
"task_type": { "enum": ["coding", "debugging", "planning", "review", "testing", "documentation", "refactoring", "other"] },
|
|
45
20
|
"prompt_summary": { "type": "string", "minLength": 1, "maxLength": 500 },
|
|
46
21
|
"intent_clarity": { "$ref": "#/$defs/score" },
|
|
47
22
|
"context_sufficiency": { "$ref": "#/$defs/score" },
|
|
@@ -50,59 +25,30 @@
|
|
|
50
25
|
"acceptance_criteria": { "$ref": "#/$defs/score" },
|
|
51
26
|
"verification_plan": { "$ref": "#/$defs/score" },
|
|
52
27
|
"ambiguity_risk": { "enum": ["low", "medium", "high"] },
|
|
53
|
-
"strengths": {
|
|
54
|
-
"type": "array",
|
|
55
|
-
"items": { "$ref": "#/$defs/shortText" },
|
|
56
|
-
"maxItems": 10
|
|
57
|
-
},
|
|
28
|
+
"strengths": { "type": "array", "maxItems": 10 },
|
|
58
29
|
"weaknesses": {
|
|
59
|
-
"type": "array",
|
|
60
|
-
"maxItems": 10,
|
|
30
|
+
"type": "array", "maxItems": 10,
|
|
61
31
|
"items": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"additionalProperties": false,
|
|
32
|
+
"type": "object", "additionalProperties": false,
|
|
64
33
|
"required": ["category", "severity", "message"],
|
|
65
34
|
"properties": {
|
|
66
|
-
"category": {
|
|
67
|
-
"enum": [
|
|
68
|
-
"missing_context",
|
|
69
|
-
"ambiguous_goal",
|
|
70
|
-
"undefined_scope",
|
|
71
|
-
"missing_constraints",
|
|
72
|
-
"missing_acceptance_criteria",
|
|
73
|
-
"missing_verification",
|
|
74
|
-
"missing_output_format",
|
|
75
|
-
"conflicting_requirements",
|
|
76
|
-
"other"
|
|
77
|
-
]
|
|
78
|
-
},
|
|
35
|
+
"category": { "$ref": "#/$defs/weaknessCategory" },
|
|
79
36
|
"severity": { "enum": ["low", "medium", "high"] },
|
|
80
37
|
"message": { "$ref": "#/$defs/shortText" }
|
|
81
38
|
}
|
|
82
39
|
}
|
|
83
40
|
},
|
|
84
|
-
"improvement_suggestions": {
|
|
85
|
-
"type": "array",
|
|
86
|
-
"items": { "$ref": "#/$defs/shortText" },
|
|
87
|
-
"maxItems": 10
|
|
88
|
-
},
|
|
41
|
+
"improvement_suggestions": { "type": "array", "maxItems": 10 },
|
|
89
42
|
"execution_signals": {
|
|
90
|
-
"type": "object",
|
|
91
|
-
"additionalProperties": false,
|
|
43
|
+
"type": "object", "additionalProperties": false,
|
|
92
44
|
"required": ["result_status", "files_changed", "tests_run"],
|
|
93
45
|
"properties": {
|
|
94
46
|
"result_status": { "enum": ["completed", "partial", "blocked"] },
|
|
95
|
-
"files_changed": {
|
|
96
|
-
"type": "array",
|
|
97
|
-
"items": { "type": "string", "minLength": 1, "maxLength": 500 },
|
|
98
|
-
"maxItems": 500
|
|
99
|
-
},
|
|
47
|
+
"files_changed": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 500 }, "maxItems": 500 },
|
|
100
48
|
"tests_run": {
|
|
101
|
-
"type": "array",
|
|
102
|
-
"maxItems": 100,
|
|
49
|
+
"type": "array", "maxItems": 100,
|
|
103
50
|
"items": {
|
|
104
|
-
"type": "object",
|
|
105
|
-
"additionalProperties": false,
|
|
51
|
+
"type": "object", "additionalProperties": false,
|
|
106
52
|
"required": ["name", "status"],
|
|
107
53
|
"properties": {
|
|
108
54
|
"name": { "type": "string", "minLength": 1, "maxLength": 500 },
|
|
@@ -113,16 +59,8 @@
|
|
|
113
59
|
}
|
|
114
60
|
},
|
|
115
61
|
"usage": {
|
|
116
|
-
"type": "object",
|
|
117
|
-
"
|
|
118
|
-
"required": [
|
|
119
|
-
"model",
|
|
120
|
-
"input_tokens",
|
|
121
|
-
"output_tokens",
|
|
122
|
-
"cost_usd",
|
|
123
|
-
"source",
|
|
124
|
-
"estimation_method"
|
|
125
|
-
],
|
|
62
|
+
"type": "object", "additionalProperties": false,
|
|
63
|
+
"required": ["model", "input_tokens", "output_tokens", "cost_usd", "source", "estimation_method"],
|
|
126
64
|
"properties": {
|
|
127
65
|
"model": { "type": ["string", "null"], "maxLength": 200 },
|
|
128
66
|
"input_tokens": { "type": ["integer", "null"], "minimum": 0 },
|
|
@@ -133,8 +71,34 @@
|
|
|
133
71
|
}
|
|
134
72
|
}
|
|
135
73
|
},
|
|
74
|
+
"allOf": [
|
|
75
|
+
{
|
|
76
|
+
"if": { "properties": { "schema_version": { "const": "1.0" } } },
|
|
77
|
+
"then": { "properties": {
|
|
78
|
+
"strengths": { "items": { "$ref": "#/$defs/shortText" } },
|
|
79
|
+
"improvement_suggestions": { "items": { "$ref": "#/$defs/shortText" } }
|
|
80
|
+
} }
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"if": { "properties": { "schema_version": { "const": "1.1" } } },
|
|
84
|
+
"then": { "properties": {
|
|
85
|
+
"strengths": { "items": { "$ref": "#/$defs/insight" } },
|
|
86
|
+
"improvement_suggestions": { "items": { "$ref": "#/$defs/insight" } }
|
|
87
|
+
} }
|
|
88
|
+
}
|
|
89
|
+
],
|
|
136
90
|
"$defs": {
|
|
137
91
|
"score": { "type": "integer", "minimum": 0, "maximum": 10 },
|
|
138
|
-
"shortText": { "type": "string", "minLength": 1, "maxLength": 500 }
|
|
92
|
+
"shortText": { "type": "string", "minLength": 1, "maxLength": 500 },
|
|
93
|
+
"insightCategory": { "enum": ["intent_clarity", "context_sufficiency", "scope_definition", "constraints_quality", "acceptance_criteria", "verification_plan", "output_format", "other"] },
|
|
94
|
+
"weaknessCategory": { "enum": ["missing_context", "ambiguous_goal", "undefined_scope", "missing_constraints", "missing_acceptance_criteria", "missing_verification", "missing_output_format", "conflicting_requirements", "other"] },
|
|
95
|
+
"insight": {
|
|
96
|
+
"type": "object", "additionalProperties": false,
|
|
97
|
+
"required": ["category", "message"],
|
|
98
|
+
"properties": {
|
|
99
|
+
"category": { "$ref": "#/$defs/insightCategory" },
|
|
100
|
+
"message": { "$ref": "#/$defs/shortText" }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
139
103
|
}
|
|
140
104
|
}
|