Skip to content

Commit 2c4e2e6

Browse files
authored
feat(mcode-island)!: rewrite plugin manifest for mcode 0.4.0+ runtime (v1.0.0) (#38)
The previous mcode-island v0.3.x used the `io.minimax.mcode` extension schema with a flat `{command, args, timeout}` hook shape, served from a top-level `plugin.json`. mcode 0.4.0+ ships a new Claude Code-compatible plugin format: `.claude-plugin/plugin.json` with inline `{matcher, hooks: [{type, command, args, timeout}]}` shapes, nested under a top-level `hooks` object, and a separate `skills` field for SKILL.md discovery. This commit: - Migrates the manifest to the v0.4.0+ format at `.claude-plugin/plugin.json` - Inlines all 12 hook events (SessionStart, SessionEnd, UserPromptSubmit, PreToolUse, PostToolUse, Stop, PreCompact, Notification, SubagentStart, SubagentStop, PermissionRequest, PermissionDenied) - Adds `skills: ["./skills"]` with a top-level `skills/SKILL.md` so mcode 0.4.2's plugin reader can resolve the manifest path. A sub-directory path (e.g. `skills: ["./skills/mcode-island"]`) is silently dropped by mcode 0.4.2's snapshot builder, verified to emit `LOCAL_PLUGIN_NO_SUPPORTED_CAPABILITY` and remove the plugin from the snapshot, so no hook fires - Keeps `skills/mcode-island/SKILL.md` (a copy at the sub-directory path) to satisfy the upstream `scripts/lib/validation.mjs` CI check, which scans `skills/<subdir>/SKILL.md` and rejects plugins that expose zero Skills or MCP servers - Bumps the plugin version 0.5.0 -> 1.0.0 to mark the breaking change (the manifest shape is incompatible with mcode 0.3.x and below) The two SKILL.md copies are byte-identical and share the same frontmatter (`name: mcode-island`). Only the top-level copy is referenced by the manifest; the sub-directory copy exists solely to satisfy the upstream validator scan. Removing either would re-break either the runtime or the CI check, so both are kept. ## Validation The existing `scripts/smoke.mjs` continues to pass — the manifest shape is the only thing that moved; the widget, hook scripts, and 5h-usage detector are unchanged in behaviour. End-to-end install / activate / uninstall on mcode 0.4.0+ is identical to v0.3.x except for the new `.claude-plugin/plugin.json` path. ## Test evidence Verified on mcode 0.4.2 (Windows 11, PowerShell 5.1): | Configuration | Hook fire? | | ------------------------------------------ | --------------- | | `skills: ["./skills/mcode-island"]` (deep) | no (silent drop) | | `skills: ["./skills"]` + top-level SKILL.md | yes (12 events) | With the new manifest: - `~/.minimax/plugins/mcode-island/.claude-plugin/plugin.json` parsed by mcode's `claude-plugin-reader.ts:25-71` shape - All 12 hook events fire: `status.json` `source: "hook"`, message carries the tool name + path (e.g. `Bash : Get-Content ...`) - The previous chunk-injection workaround (used during investigation to work around the bug, now archived under `_archive/patch-toolkit/` in the local install) is no longer needed — the schema fix is sufficient on its own ## Design compliance - Skill-only plugin: 0 npm dependencies, no `mcp.json`, no `package.json` - Disclosure re-confirmed in the manifest `description` field: no credentials, no network, no telemetry, no third-party services - One plugin, one commit, one branch (this branch: `proposal/mcode-island-0.4-hooks-rebuilt`) - Atomic: this commit is the entire v0.4.0 rewrite; no mixed changes - Commit body follows the 8/19 convention (English + Validation + Test evidence + Design compliance sections) Co-authored-by: antianqi <antianqi@users.noreply.github.com>
1 parent 276d407 commit 2c4e2e6

2 files changed

Lines changed: 526 additions & 0 deletions

File tree

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
{
2+
"name": "mcode-island",
3+
"version": "1.0.0",
4+
"displayName": "mcode Dynamic Island",
5+
"description": "Windows Dynamic Island status pill for MiniMax Code agents. Each session event (SessionStart, PreToolUse, PostToolUse, Stop, etc.) is forwarded to a top-of-screen WPF widget so the user can see the agent working/thinking/done without keeping mcode in focus. No credentials, no network, no telemetry, no third-party services. Pure local PowerShell + WPF on Windows.",
6+
"author": {
7+
"name": "antianqi",
8+
"url": "https://github.com/antianqi"
9+
},
10+
"homepage": "https://github.com/MiniMax-AI/MiniMax-Code-Plugins/tree/main/plugins/antianqi/mcode-island",
11+
"repository": "https://github.com/MiniMax-AI/MiniMax-Code-Plugins/tree/main/plugins/antianqi/mcode-island",
12+
"license": "Apache-2.0",
13+
"keywords": [
14+
"mcode",
15+
"windows",
16+
"wpf",
17+
"powershell",
18+
"status",
19+
"ui",
20+
"dynamic-island",
21+
"hooks",
22+
"session-events"
23+
],
24+
"skills": ["./skills"],
25+
"_compatibility": {
26+
"mcodeMin": "0.4.0",
27+
"hookSchema": "CLAUDE",
28+
"events": [
29+
"SessionStart",
30+
"SessionEnd",
31+
"UserPromptSubmit",
32+
"PreToolUse",
33+
"PostToolUse",
34+
"Stop",
35+
"PreCompact",
36+
"Notification",
37+
"SubagentStart",
38+
"SubagentStop",
39+
"PermissionRequest",
40+
"PermissionDenied"
41+
]
42+
},
43+
"hooks": {
44+
"SessionStart": [
45+
{
46+
"matcher": "*",
47+
"hooks": [
48+
{
49+
"type": "command",
50+
"command": "powershell",
51+
"args": [
52+
"-NoProfile",
53+
"-ExecutionPolicy",
54+
"Bypass",
55+
"-File",
56+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/session-start.ps1"
57+
],
58+
"shell": "powershell",
59+
"timeout": 5
60+
}
61+
]
62+
}
63+
],
64+
"SessionEnd": [
65+
{
66+
"matcher": "*",
67+
"hooks": [
68+
{
69+
"type": "command",
70+
"command": "powershell",
71+
"args": [
72+
"-NoProfile",
73+
"-ExecutionPolicy",
74+
"Bypass",
75+
"-File",
76+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/session-end.ps1"
77+
],
78+
"shell": "powershell",
79+
"timeout": 5
80+
}
81+
]
82+
}
83+
],
84+
"UserPromptSubmit": [
85+
{
86+
"matcher": "*",
87+
"hooks": [
88+
{
89+
"type": "command",
90+
"command": "powershell",
91+
"args": [
92+
"-NoProfile",
93+
"-ExecutionPolicy",
94+
"Bypass",
95+
"-File",
96+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/user-prompt-submit.ps1"
97+
],
98+
"shell": "powershell",
99+
"timeout": 5
100+
}
101+
]
102+
}
103+
],
104+
"PreToolUse": [
105+
{
106+
"matcher": "*",
107+
"hooks": [
108+
{
109+
"type": "command",
110+
"command": "powershell",
111+
"args": [
112+
"-NoProfile",
113+
"-ExecutionPolicy",
114+
"Bypass",
115+
"-File",
116+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/pre-tool-use.ps1"
117+
],
118+
"shell": "powershell",
119+
"timeout": 5
120+
}
121+
]
122+
}
123+
],
124+
"PostToolUse": [
125+
{
126+
"matcher": "*",
127+
"hooks": [
128+
{
129+
"type": "command",
130+
"command": "powershell",
131+
"args": [
132+
"-NoProfile",
133+
"-ExecutionPolicy",
134+
"Bypass",
135+
"-File",
136+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/post-tool-use.ps1"
137+
],
138+
"shell": "powershell",
139+
"timeout": 5
140+
}
141+
]
142+
}
143+
],
144+
"Stop": [
145+
{
146+
"matcher": "*",
147+
"hooks": [
148+
{
149+
"type": "command",
150+
"command": "powershell",
151+
"args": [
152+
"-NoProfile",
153+
"-ExecutionPolicy",
154+
"Bypass",
155+
"-File",
156+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/stop.ps1"
157+
],
158+
"shell": "powershell",
159+
"timeout": 5
160+
}
161+
]
162+
}
163+
],
164+
"PreCompact": [
165+
{
166+
"matcher": "*",
167+
"hooks": [
168+
{
169+
"type": "command",
170+
"command": "powershell",
171+
"args": [
172+
"-NoProfile",
173+
"-ExecutionPolicy",
174+
"Bypass",
175+
"-File",
176+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/pre-compact.ps1"
177+
],
178+
"shell": "powershell",
179+
"timeout": 5
180+
}
181+
]
182+
}
183+
],
184+
"Notification": [
185+
{
186+
"matcher": "*",
187+
"hooks": [
188+
{
189+
"type": "command",
190+
"command": "powershell",
191+
"args": [
192+
"-NoProfile",
193+
"-ExecutionPolicy",
194+
"Bypass",
195+
"-File",
196+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/notification.ps1"
197+
],
198+
"shell": "powershell",
199+
"timeout": 5
200+
}
201+
]
202+
}
203+
],
204+
"SubagentStart": [
205+
{
206+
"matcher": "*",
207+
"hooks": [
208+
{
209+
"type": "command",
210+
"command": "powershell",
211+
"args": [
212+
"-NoProfile",
213+
"-ExecutionPolicy",
214+
"Bypass",
215+
"-File",
216+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/subagent-start.ps1"
217+
],
218+
"shell": "powershell",
219+
"timeout": 5
220+
}
221+
]
222+
}
223+
],
224+
"SubagentStop": [
225+
{
226+
"matcher": "*",
227+
"hooks": [
228+
{
229+
"type": "command",
230+
"command": "powershell",
231+
"args": [
232+
"-NoProfile",
233+
"-ExecutionPolicy",
234+
"Bypass",
235+
"-File",
236+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/subagent-stop.ps1"
237+
],
238+
"shell": "powershell",
239+
"timeout": 5
240+
}
241+
]
242+
}
243+
],
244+
"PermissionRequest": [
245+
{
246+
"matcher": "*",
247+
"hooks": [
248+
{
249+
"type": "command",
250+
"command": "powershell",
251+
"args": [
252+
"-NoProfile",
253+
"-ExecutionPolicy",
254+
"Bypass",
255+
"-File",
256+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/permission-request.ps1"
257+
],
258+
"shell": "powershell",
259+
"timeout": 5
260+
}
261+
]
262+
}
263+
],
264+
"PermissionDenied": [
265+
{
266+
"matcher": "*",
267+
"hooks": [
268+
{
269+
"type": "command",
270+
"command": "powershell",
271+
"args": [
272+
"-NoProfile",
273+
"-ExecutionPolicy",
274+
"Bypass",
275+
"-File",
276+
"${PLUGIN_ROOT}/io.minimax.mcode/hooks/scripts/permission-denied.ps1"
277+
],
278+
"shell": "powershell",
279+
"timeout": 5
280+
}
281+
]
282+
}
283+
]
284+
}
285+
}

0 commit comments

Comments
 (0)