codex-plugin-doctor 0.3.0 → 0.5.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.
@@ -0,0 +1,237 @@
1
+ import readline from "node:readline";
2
+
3
+ const rl = readline.createInterface({
4
+ input: process.stdin,
5
+ crlfDelay: Infinity
6
+ });
7
+
8
+ rl.on("line", (line) => {
9
+ const message = JSON.parse(line);
10
+ const cursor = message.params?.cursor;
11
+
12
+ if (message.method === "initialize") {
13
+ process.stdout.write(
14
+ `${JSON.stringify({
15
+ jsonrpc: "2.0",
16
+ id: message.id,
17
+ result: {
18
+ protocolVersion: "2025-11-25",
19
+ capabilities: {
20
+ tools: {},
21
+ resources: {},
22
+ prompts: {}
23
+ },
24
+ serverInfo: {
25
+ name: "doctor-runtime-server",
26
+ version: "1.0.0"
27
+ }
28
+ }
29
+ })}\n`
30
+ );
31
+ return;
32
+ }
33
+
34
+ if (message.method === "tools/list") {
35
+ process.stdout.write(
36
+ `${JSON.stringify({
37
+ jsonrpc: "2.0",
38
+ id: message.id,
39
+ result:
40
+ cursor === "tools-page-2"
41
+ ? {
42
+ tools: [
43
+ {
44
+ name: "format_status",
45
+ description: "Return a formatted health status.",
46
+ inputSchema: {
47
+ type: "object",
48
+ properties: {},
49
+ required: []
50
+ }
51
+ }
52
+ ]
53
+ }
54
+ : {
55
+ tools: [
56
+ {
57
+ name: "ping",
58
+ description: "Return a healthcheck response.",
59
+ inputSchema: {
60
+ type: "object",
61
+ properties: {},
62
+ required: []
63
+ }
64
+ }
65
+ ],
66
+ nextCursor: "tools-page-2"
67
+ }
68
+ })}\n`
69
+ );
70
+ return;
71
+ }
72
+
73
+ if (message.method === "tools/call") {
74
+ process.stdout.write(
75
+ `${JSON.stringify({
76
+ jsonrpc: "2.0",
77
+ id: message.id,
78
+ result: {
79
+ content: [
80
+ {
81
+ type: "text",
82
+ text: "doctor-runtime-ok"
83
+ }
84
+ ]
85
+ }
86
+ })}\n`
87
+ );
88
+ return;
89
+ }
90
+
91
+ if (message.method === "resources/list") {
92
+ process.stdout.write(
93
+ `${JSON.stringify({
94
+ jsonrpc: "2.0",
95
+ id: message.id,
96
+ result:
97
+ cursor === "resources-page-2"
98
+ ? {
99
+ resources: [
100
+ {
101
+ name: "workspace-license",
102
+ uri: "file:///workspace/LICENSE"
103
+ }
104
+ ]
105
+ }
106
+ : {
107
+ resources: [
108
+ {
109
+ name: "workspace-readme",
110
+ uri: "file:///workspace/README.md"
111
+ }
112
+ ],
113
+ nextCursor: "resources-page-2"
114
+ }
115
+ })}\n`
116
+ );
117
+ return;
118
+ }
119
+
120
+ if (message.method === "resources/read") {
121
+ process.stdout.write(
122
+ `${JSON.stringify({
123
+ jsonrpc: "2.0",
124
+ id: message.id,
125
+ result: {
126
+ contents: [
127
+ {
128
+ uri: "file:///workspace/README.md",
129
+ text: "# Workspace README"
130
+ }
131
+ ]
132
+ }
133
+ })}\n`
134
+ );
135
+ return;
136
+ }
137
+
138
+ if (message.method === "resources/templates/list") {
139
+ process.stdout.write(
140
+ `${JSON.stringify({
141
+ jsonrpc: "2.0",
142
+ id: message.id,
143
+ result:
144
+ cursor === "templates-page-2"
145
+ ? {
146
+ resourceTemplates: [
147
+ {
148
+ name: "log",
149
+ uriTemplate: "file:///workspace/logs/{name}.log"
150
+ }
151
+ ]
152
+ }
153
+ : {
154
+ resourceTemplates: [
155
+ {
156
+ name: "doc",
157
+ uriTemplate: "file:///workspace/docs/{name}.md"
158
+ }
159
+ ],
160
+ nextCursor: "templates-page-2"
161
+ }
162
+ })}\n`
163
+ );
164
+ return;
165
+ }
166
+
167
+ if (message.method === "prompts/list") {
168
+ process.stdout.write(
169
+ `${JSON.stringify({
170
+ jsonrpc: "2.0",
171
+ id: message.id,
172
+ result:
173
+ cursor === "prompts-page-2"
174
+ ? {
175
+ prompts: [
176
+ {
177
+ name: "summary",
178
+ description: "Summarize the current change."
179
+ }
180
+ ]
181
+ }
182
+ : {
183
+ prompts: [
184
+ {
185
+ name: "code_review",
186
+ description: "Review code for bugs.",
187
+ arguments: [
188
+ {
189
+ name: "diff",
190
+ required: true
191
+ }
192
+ ]
193
+ }
194
+ ],
195
+ nextCursor: "prompts-page-2"
196
+ }
197
+ })}\n`
198
+ );
199
+ return;
200
+ }
201
+
202
+ if (message.method === "prompts/get") {
203
+ if (message.params?.arguments?.diff !== "codex-plugin-doctor-probe") {
204
+ process.stdout.write(
205
+ `${JSON.stringify({
206
+ jsonrpc: "2.0",
207
+ id: message.id,
208
+ error: {
209
+ code: -32602,
210
+ message: "Missing required diff argument"
211
+ }
212
+ })}\n`
213
+ );
214
+ return;
215
+ }
216
+
217
+ process.stdout.write(
218
+ `${JSON.stringify({
219
+ jsonrpc: "2.0",
220
+ id: message.id,
221
+ result: {
222
+ description: "Prompt for code review",
223
+ messages: [
224
+ {
225
+ role: "user",
226
+ content: {
227
+ type: "text",
228
+ text: "Review this diff for bugs."
229
+ }
230
+ }
231
+ ]
232
+ }
233
+ })}\n`
234
+ );
235
+ }
236
+ });
237
+
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: context-check
3
+ description: Validate the current repository context before taking action.
4
+ ---
5
+
6
+ Use this skill when you need to confirm repository structure, expected files, and project readiness before deeper work begins.
7
+
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "codex-doctor-starter",
3
+ "version": "1.0.0",
4
+ "description": "Minimal Codex Doctor sample plugin for local validation.",
5
+ "skills": "./skills/"
6
+ }
7
+
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: repo-scan
3
+ description: Scan the repository and summarize the main components.
4
+ ---
5
+
6
+ Use this skill when you need a quick high-level map of the current repository.
7
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-plugin-doctor",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "CLI-first validator for Codex plugins, skills, and MCP package surfaces with runtime MCP protocol validation.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,8 @@
16
16
  "./package.json": "./package.json"
17
17
  },
18
18
  "files": [
19
- "dist"
19
+ "dist",
20
+ "examples"
20
21
  ],
21
22
  "scripts": {
22
23
  "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",