@mulmoclaude/core 7.9.0 → 7.9.1
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,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mc-mulmoclaude-plugin-create
|
|
3
|
+
description: Build a MulmoClaude plugin (a gui-chat-protocol tool with its own card, also called a Mulmo App) with the user, by asking one question at a time until the idea is concrete, then scaffolding it from the npm template in this workspace, building it, installing it and trying it — and again after every change. Use when the user wants to make, build or prototype a plugin, a new tool, or a custom card for MulmoClaude or MulmoTerminal, or presses "Make a plugin" in Settings → Installed plugins. Works in whatever language the user writes in.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Make a plugin with the user
|
|
7
|
+
|
|
8
|
+
A bundled MulmoClaude preset skill (`mc-` prefix = launcher-managed; do not edit this file in the
|
|
9
|
+
workspace, it is overwritten on every server boot).
|
|
10
|
+
|
|
11
|
+
A plugin is one tool an agent can call (`TOOL_DEFINITION` + a handler that runs in the MulmoClaude
|
|
12
|
+
server) and, optionally, a card that draws the result (`View.vue`). The template
|
|
13
|
+
`create-mulmoclaude-plugin` is a working counter; you turn it into what the user wants.
|
|
14
|
+
|
|
15
|
+
The user may not be an engineer. Ask about what the tool is FOR, not about code, until step 2.
|
|
16
|
+
Answer in the language the user writes in.
|
|
17
|
+
|
|
18
|
+
## 1. Ask, one question at a time
|
|
19
|
+
|
|
20
|
+
Ask ONE question per message and wait for the answer. When an answer is vague, ask a follow-up
|
|
21
|
+
instead of guessing. Skip a question the user already answered. Cover:
|
|
22
|
+
|
|
23
|
+
1. **When should an agent call it?** One sentence. It becomes the tool's `description`.
|
|
24
|
+
2. **What does it need to be told?** Each input, its type, whether it is required. It becomes the
|
|
25
|
+
JSON Schema in `definition.ts`.
|
|
26
|
+
3. **What does it answer, and what should the card show?** The handler returns `{ message, data }`:
|
|
27
|
+
`message` is what the agent reads, `data` is what the card draws. No card is fine: then there is
|
|
28
|
+
no `data`.
|
|
29
|
+
4. **Does it keep anything?** Data that must survive goes in `files.data` (the template's counter
|
|
30
|
+
does). Should the card have buttons that act on it (`dispatch`)?
|
|
31
|
+
5. **Does it call an outside service?** Which one, and does that need a key? Plugins use the
|
|
32
|
+
runtime's `fetch`, never their own; a key must not be written into the code.
|
|
33
|
+
6. **Names.** The npm package name (e.g. `@<their-npm-user>/weather-card`, or unscoped) and the tool
|
|
34
|
+
name (camelCase, a verb: `fetchWeather`). The card's languages (en / ja).
|
|
35
|
+
|
|
36
|
+
The tool name must not be one MulmoClaude already offers: not one of your own tools (a tool you see
|
|
37
|
+
as `mcp__mulmoclaude__<name>`), and not one in `plugins/plugins.json`'s plugins. A taken name is not
|
|
38
|
+
loaded — only the server log says why — so prefer a specific name (`fetchTokyoWeather`, not `fetch`).
|
|
39
|
+
|
|
40
|
+
Finally show the whole spec on one screen (purpose, inputs, answer, card, storage, outside services,
|
|
41
|
+
names, folder) and **wait for the user's approval** before writing anything.
|
|
42
|
+
|
|
43
|
+
## 2. Scaffold
|
|
44
|
+
|
|
45
|
+
Plugins you build live in this workspace under `plugins/src/`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
mkdir -p plugins/src && cd plugins/src
|
|
49
|
+
npx create-mulmoclaude-plugin@latest <npm name>
|
|
50
|
+
cd <the folder it created>
|
|
51
|
+
yarn install
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The folder is named after the package (a scope is dropped). Read its `README.md`: it explains the
|
|
55
|
+
files and the runtime API. Then replace the counter:
|
|
56
|
+
|
|
57
|
+
- `src/definition.ts` — `name`, `description`, `parameters` from the spec.
|
|
58
|
+
- `src/index.ts` — the handler, exported under exactly the tool name. Parse its arguments with Zod.
|
|
59
|
+
Keep the template's answer shape `{ message, data }` (its `answer` helper): without `message` the
|
|
60
|
+
agent is told only "Done", and without `data` no card is drawn.
|
|
61
|
+
All I/O goes through the runtime (`files`, `fetch`, `pubsub`, `log`); the lint preset rejects
|
|
62
|
+
`node:fs`, `console` and a bare `fetch`.
|
|
63
|
+
- `src/View.vue` — draws `selectedResult.data`. Delete it (and the `viewComponent` in `src/vue.ts`)
|
|
64
|
+
only if the spec has no card.
|
|
65
|
+
- `src/lang/en.ts`, `src/lang/ja.ts` — the card's words.
|
|
66
|
+
- `README.md`, and `description` in `package.json`.
|
|
67
|
+
|
|
68
|
+
## 3. Check
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
yarn typecheck && yarn lint && yarn build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Fix every error before going on. Do not silence a rule.
|
|
75
|
+
|
|
76
|
+
## 4. Install into this workspace
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm pack
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
It prints the file it wrote (`<name>-<version>.tgz`, in the plugin's folder). Then:
|
|
83
|
+
|
|
84
|
+
- **If you have the `installWorkspacePlugin` tool**, call it with that file's path relative to the
|
|
85
|
+
workspace, e.g. `plugins/src/weather-card/weather-card-0.1.0.tgz`. Installing the same version again
|
|
86
|
+
with new contents replaces it; there is no need to bump the version.
|
|
87
|
+
- **If you do not have it**, you are running in MulmoClaude's sandbox, where installing is left to
|
|
88
|
+
the user: the plugin's code runs in the MulmoClaude server, outside the sandbox. Give the user the
|
|
89
|
+
command to run in a terminal, with the workspace's folder (`~/mulmoclaude` unless they chose
|
|
90
|
+
another):
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx mulmoclaude@latest plugin add ~/mulmoclaude/plugins/src/<folder>/<the .tgz> --yes
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Its first line names the plugin list it edits; it must be in the workspace MulmoClaude uses. If
|
|
97
|
+
not, set `MULMOCLAUDE_WORKSPACE_PATH` to that workspace for the command. Wait for them to say it
|
|
98
|
+
is done.
|
|
99
|
+
|
|
100
|
+
The running server reads the plugin list again a moment later: there is no restart. If the install
|
|
101
|
+
was refused, the reply or the command says why.
|
|
102
|
+
|
|
103
|
+
## 5. Try it
|
|
104
|
+
|
|
105
|
+
The new tool is offered **from the user's next message**, not in the turn that installed it. Say
|
|
106
|
+
so, and ask the user to send a message (for example "try it"). Then, in that turn:
|
|
107
|
+
|
|
108
|
+
- Call the tool yourself with a realistic input, and look at the card in the canvas. If the tool is
|
|
109
|
+
not there, its name was probably taken or the plugin failed to load: the server log has a
|
|
110
|
+
`[plugins/registry]` or `[plugins/runtime]` line saying why. Ask the user for it if you cannot read
|
|
111
|
+
the log, fix the cause and install again.
|
|
112
|
+
- An open MulmoClaude page loads a newly installed or changed card by itself, a moment after the
|
|
113
|
+
install. Ask the user whether it looks right. If the card is still missing or old, ask them to reload
|
|
114
|
+
the page once and tell you if that changed anything.
|
|
115
|
+
|
|
116
|
+
## 6. Change and repeat
|
|
117
|
+
|
|
118
|
+
For each change the user asks for: edit, then steps 3 and 4 again (build, pack, install), then try
|
|
119
|
+
it again. Keep going until the user is happy.
|
|
120
|
+
|
|
121
|
+
## 7. Publish (only if the user asks)
|
|
122
|
+
|
|
123
|
+
Two ways, in the template's `README.md` under "Publish":
|
|
124
|
+
|
|
125
|
+
- **npm** — the user runs `npm publish --access public` themselves (it asks for their login and a
|
|
126
|
+
one-time code, which you cannot answer). Give them the exact command and the folder.
|
|
127
|
+
- **GitHub release** — a tag matching `package.json`'s version; the template's release workflow
|
|
128
|
+
attaches the `.tgz`. Others then install with `npx mulmoclaude plugin add github:<owner>/<repo>#v<version>`
|
|
129
|
+
(or in Settings → Installed plugins).
|
|
130
|
+
|
|
131
|
+
Do not publish, push or create a repository without the user saying so.
|
|
132
|
+
|
|
133
|
+
## Where to read more
|
|
134
|
+
|
|
135
|
+
- Building plugins: https://github.com/receptron/mulmoclaude/blob/main/docs/plugin-development.md
|
|
136
|
+
- Installing plugins: https://github.com/receptron/mulmoclaude/blob/main/docs/plugin-runtime.md
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mulmoclaude/core",
|
|
3
|
-
"version": "7.9.
|
|
3
|
+
"version": "7.9.1",
|
|
4
4
|
"description": "Shared server-side core for MulmoClaude and MulmoTerminal — the always-shipped-together subsystems consolidated behind subpath exports so the two hosts can't drift. Server-only except the browser-safe ./artifacts, ./whisper/client, ./workspace-setup/slug, ./translation/client, ./remote-view, ./remote-host and ./plugin-vue entries. All host specifics are injected.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|