@pingvinen/donna-assistant 0.9.1 → 0.11.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/README.md +33 -3
- package/package.json +1 -1
- package/src/donna-tools.cjs +429 -0
- package/src/installer.cjs +26 -4
- package/stubs/claude-code/donna/add-follow-up-task.md +17 -0
- package/stubs/claude-code/donna/remove-tool.md +17 -0
- package/workflows/add-task.md +15 -75
- package/workflows/add-tool.md +58 -91
- package/workflows/adjust-tool.md +22 -132
- package/workflows/begin-the-day.md +59 -92
- package/workflows/done.md +16 -74
- package/workflows/focus.md +21 -95
- package/workflows/follow-up.md +163 -0
- package/workflows/relearn-tools.md +60 -91
- package/workflows/remove-tool.md +93 -0
- package/workflows/run-tools.md +26 -99
- package/workflows/set-role.md +12 -61
package/workflows/add-task.md
CHANGED
|
@@ -4,62 +4,25 @@
|
|
|
4
4
|
Capture a new task to today's daily journal file in the storage repo and commit it to git.
|
|
5
5
|
</objective>
|
|
6
6
|
|
|
7
|
-
<step name="
|
|
8
|
-
Read `~/.config/donna/config.md`.
|
|
9
|
-
|
|
10
|
-
If the file does not exist, print:
|
|
11
|
-
```
|
|
12
|
-
✗ Donna is not configured. Run /donna:setup first.
|
|
13
|
-
```
|
|
14
|
-
Stop.
|
|
15
|
-
|
|
16
|
-
Extract the `storage_repo`, `daily_folder` (default: `daily`), and `auto_push` (default: false) fields from the YAML frontmatter.
|
|
17
|
-
|
|
18
|
-
**Obsidian sync:** Check if `<storage_repo>/.obsidian/daily-notes.json` exists.
|
|
19
|
-
- If it exists and has a `folder` field that differs from `<daily_folder>`: update `<daily_folder>` to match Obsidian's value, and update `~/.config/donna/config.md` with the new `daily_folder`. Print `✓ Synced daily folder with Obsidian: <daily_folder>`.
|
|
20
|
-
- If `<storage_repo>/.obsidian/` exists but `daily-notes.json` does not exist or has no `folder` field: write `<storage_repo>/.obsidian/daily-notes.json` with `{"folder":"<daily_folder>"}`. Print `✓ Configured Obsidian daily notes to use <daily_folder>/`.
|
|
21
|
-
- Otherwise: do nothing.
|
|
22
|
-
</step>
|
|
23
|
-
|
|
24
|
-
<step name="check-pending-migrations">
|
|
25
|
-
Read `~/.donna/state.md` with the Read tool. If the file does not exist or has no `pending_migrations` field in its YAML frontmatter, skip this step.
|
|
26
|
-
|
|
27
|
-
For each entry in `pending_migrations`:
|
|
28
|
-
|
|
29
|
-
**`move-standing-files`:** Move standing files from storage repo root to donna/ subfolder.
|
|
30
|
-
|
|
7
|
+
<step name="init">
|
|
31
8
|
Run via Bash:
|
|
32
9
|
```bash
|
|
33
|
-
|
|
34
|
-
DONNA_DIR="$STORAGE_REPO/donna"
|
|
35
|
-
MOVED=0
|
|
36
|
-
|
|
37
|
-
mkdir -p "$DONNA_DIR"
|
|
38
|
-
for FILE in role.md recurring.md role-research.md; do
|
|
39
|
-
if [ -f "$STORAGE_REPO/$FILE" ] && [ ! -f "$DONNA_DIR/$FILE" ]; then
|
|
40
|
-
mv "$STORAGE_REPO/$FILE" "$DONNA_DIR/$FILE"
|
|
41
|
-
echo "Moved $FILE to donna/$FILE"
|
|
42
|
-
MOVED=$((MOVED + 1))
|
|
43
|
-
fi
|
|
44
|
-
done
|
|
45
|
-
|
|
46
|
-
echo "MOVED=$MOVED"
|
|
10
|
+
INIT=$(node ~/.donna/donna-tools.cjs init)
|
|
47
11
|
```
|
|
48
12
|
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
git -C <storage_repo> add -A
|
|
52
|
-
git -C <storage_repo> diff --cached --quiet || git -C <storage_repo> commit -m "donna(migrate): move standing files to donna/ subfolder"
|
|
13
|
+
Parse the JSON response. If the `error` field is `"not_configured"`, print:
|
|
53
14
|
```
|
|
15
|
+
x Donna is not configured. Run /donna:setup first.
|
|
16
|
+
```
|
|
17
|
+
Stop.
|
|
54
18
|
|
|
55
|
-
|
|
19
|
+
Extract `storage_repo`, `daily_folder`, `auto_push` from the JSON.
|
|
56
20
|
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
pending_migrations: []
|
|
61
|
-
---
|
|
21
|
+
If `update_available` is non-null, print:
|
|
22
|
+
```
|
|
23
|
+
Donna v<update_available> available -- run npx @pingvinen/donna-assistant to update
|
|
62
24
|
```
|
|
25
|
+
Continue normally.
|
|
63
26
|
</step>
|
|
64
27
|
|
|
65
28
|
<step name="get-description">
|
|
@@ -74,17 +37,11 @@ Store the response as `<description>`.
|
|
|
74
37
|
</step>
|
|
75
38
|
|
|
76
39
|
<step name="ensure-daily-file">
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
date +%Y-%m-%d
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Store the result as `<date>`. Construct the daily file path: `<storage_repo>/<daily_folder>/<date>.md`.
|
|
83
|
-
|
|
84
|
-
Run via Bash to ensure the daily folder exists:
|
|
40
|
+
Get the daily file path via donna-tools:
|
|
85
41
|
```bash
|
|
86
|
-
|
|
42
|
+
DAILY_PATH=$(node ~/.donna/donna-tools.cjs daily-path | node -e "process.stdin.resume();let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>console.log(JSON.parse(d).path))")
|
|
87
43
|
```
|
|
44
|
+
Store the result as `<daily_file_path>`. Extract `<date>` from the filename (last path component without `.md`).
|
|
88
45
|
|
|
89
46
|
If the daily file does not exist, create it with the Write tool using this content (substituting the actual date):
|
|
90
47
|
```markdown
|
|
@@ -107,24 +64,7 @@ Write the updated file with the Write tool.
|
|
|
107
64
|
<step name="git-commit">
|
|
108
65
|
Run via Bash:
|
|
109
66
|
```bash
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Check whether there is anything to commit:
|
|
114
|
-
```bash
|
|
115
|
-
git -C <storage_repo> status --porcelain
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
If the output is empty, skip the commit and continue.
|
|
119
|
-
|
|
120
|
-
Otherwise, run:
|
|
121
|
-
```bash
|
|
122
|
-
git -C <storage_repo> commit -m "donna(add-task): <description>"
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
If `auto_push` is true in config, also run:
|
|
126
|
-
```bash
|
|
127
|
-
git -C <storage_repo> push
|
|
67
|
+
node ~/.donna/donna-tools.cjs commit "donna(task): added <description>" --files <daily_folder>/<date>.md
|
|
128
68
|
```
|
|
129
69
|
</step>
|
|
130
70
|
|
package/workflows/add-tool.md
CHANGED
|
@@ -4,82 +4,25 @@
|
|
|
4
4
|
Declare an external tool (CLI, REST API, GraphQL API, or MCP server), verify its connectivity, learn its capabilities, and persist the result to tools.md in the storage repo.
|
|
5
5
|
</objective>
|
|
6
6
|
|
|
7
|
-
<step name="
|
|
8
|
-
Read `~/.config/donna/config.md`.
|
|
9
|
-
|
|
10
|
-
If the file does not exist, print:
|
|
11
|
-
```
|
|
12
|
-
✗ Donna is not configured. Run /donna:setup first.
|
|
13
|
-
```
|
|
14
|
-
Stop.
|
|
15
|
-
|
|
16
|
-
Extract the `storage_repo`, `daily_folder` (default: `daily`), and `auto_push` (default: false) fields from the YAML frontmatter.
|
|
17
|
-
|
|
18
|
-
**Obsidian sync:** Check if `<storage_repo>/.obsidian/daily-notes.json` exists.
|
|
19
|
-
- If it exists and has a `folder` field that differs from `<daily_folder>`: update `<daily_folder>` to match Obsidian's value, and update `~/.config/donna/config.md` with the new `daily_folder`. Print `✓ Synced daily folder with Obsidian: <daily_folder>`.
|
|
20
|
-
- If `<storage_repo>/.obsidian/` exists but `daily-notes.json` does not exist or has no `folder` field: write `<storage_repo>/.obsidian/daily-notes.json` with `{"folder":"<daily_folder>"}`. Print `✓ Configured Obsidian daily notes to use <daily_folder>/`.
|
|
21
|
-
- Otherwise: do nothing.
|
|
22
|
-
</step>
|
|
23
|
-
|
|
24
|
-
<step name="check-pending-migrations">
|
|
25
|
-
Read `~/.donna/state.md` with the Read tool. If the file does not exist or has no `pending_migrations` field in its YAML frontmatter, skip this step.
|
|
26
|
-
|
|
27
|
-
For each entry in `pending_migrations`:
|
|
28
|
-
|
|
29
|
-
**`move-standing-files`:** Move standing files from storage repo root to donna/ subfolder.
|
|
30
|
-
|
|
7
|
+
<step name="init">
|
|
31
8
|
Run via Bash:
|
|
32
9
|
```bash
|
|
33
|
-
|
|
34
|
-
DONNA_DIR="$STORAGE_REPO/donna"
|
|
35
|
-
MOVED=0
|
|
36
|
-
|
|
37
|
-
mkdir -p "$DONNA_DIR"
|
|
38
|
-
for FILE in role.md recurring.md role-research.md; do
|
|
39
|
-
if [ -f "$STORAGE_REPO/$FILE" ] && [ ! -f "$DONNA_DIR/$FILE" ]; then
|
|
40
|
-
mv "$STORAGE_REPO/$FILE" "$DONNA_DIR/$FILE"
|
|
41
|
-
echo "Moved $FILE to donna/$FILE"
|
|
42
|
-
MOVED=$((MOVED + 1))
|
|
43
|
-
fi
|
|
44
|
-
done
|
|
45
|
-
|
|
46
|
-
echo "MOVED=$MOVED"
|
|
10
|
+
INIT=$(node ~/.donna/donna-tools.cjs init)
|
|
47
11
|
```
|
|
48
12
|
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
git -C <storage_repo> add -A
|
|
52
|
-
git -C <storage_repo> diff --cached --quiet || git -C <storage_repo> commit -m "donna(migrate): move standing files to donna/ subfolder"
|
|
13
|
+
Parse the JSON response. If the `error` field is `"not_configured"`, print:
|
|
53
14
|
```
|
|
54
|
-
|
|
55
|
-
If `auto_push` is true in config, also push.
|
|
56
|
-
|
|
57
|
-
**`backfill-tool-type`:** Backfill `type` on existing tool sections in tools.md using heuristic detection.
|
|
58
|
-
|
|
59
|
-
Read `<storage_repo>/donna/tools.md` with the Read tool. If the file does not exist or has no tool sections, skip this handler.
|
|
60
|
-
|
|
61
|
-
For each tool section (starting with `## <tool_name>`), check if a `- type:` line already exists. If the `- type:` line is missing, detect the correct type:
|
|
62
|
-
|
|
63
|
-
1. If the tool section contains a `- command:` line where the value starts with `mcp:` (e.g., `- command: mcp:linear`), insert `- type: mcp` immediately after the `- command:` line.
|
|
64
|
-
2. Else, if the tool section contains a `- base_url:` line:
|
|
65
|
-
- If the capabilities section contains entries that look like GraphQL queries (contain `query {` or `mutation {`), insert `- type: graphql` immediately after `## <tool_name>` (REST/GraphQL tools have no `- command:` line).
|
|
66
|
-
- Otherwise, insert `- type: rest` immediately after `## <tool_name>`.
|
|
67
|
-
3. Else (no `mcp:` prefix, no `base_url` field), insert `- type: cli` immediately after the `- command:` line.
|
|
68
|
-
|
|
69
|
-
Write the updated file back with the Write tool. If any changes were made, commit:
|
|
70
|
-
```bash
|
|
71
|
-
git -C <storage_repo> add -A
|
|
72
|
-
git -C <storage_repo> diff --cached --quiet || git -C <storage_repo> commit -m "donna(migrate): backfill tool types on existing tools"
|
|
15
|
+
x Donna is not configured. Run /donna:setup first.
|
|
73
16
|
```
|
|
17
|
+
Stop.
|
|
74
18
|
|
|
75
|
-
|
|
19
|
+
Extract `storage_repo`, `daily_folder`, `auto_push` from the JSON.
|
|
76
20
|
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
pending_migrations: []
|
|
81
|
-
---
|
|
21
|
+
If `update_available` is non-null, print:
|
|
22
|
+
```
|
|
23
|
+
Donna v<update_available> available -- run npx @pingvinen/donna-assistant to update
|
|
82
24
|
```
|
|
25
|
+
Continue normally.
|
|
83
26
|
</step>
|
|
84
27
|
|
|
85
28
|
<step name="detect-noted-tools">
|
|
@@ -163,11 +106,11 @@ Store the output as `<version>`. If the command does not support `--version`, st
|
|
|
163
106
|
<step name="auth-test">
|
|
164
107
|
**If `<tool_type>` is `cli`:**
|
|
165
108
|
|
|
166
|
-
For well-known tools, run the appropriate auth test via Bash
|
|
109
|
+
For well-known tools, run the appropriate auth test via Bash (set the Bash tool's `timeout` parameter to `10000`):
|
|
167
110
|
|
|
168
|
-
- `gh`: `
|
|
169
|
-
- `jira`: `
|
|
170
|
-
- `kubectl`: `
|
|
111
|
+
- `gh`: run `gh api user --jq '.login' 2>&1` via Bash with `timeout: 10000`
|
|
112
|
+
- `jira`: run `jira me 2>&1` via Bash with `timeout: 10000`
|
|
113
|
+
- `kubectl`: run `kubectl auth whoami 2>&1` via Bash with `timeout: 10000`
|
|
171
114
|
- Other tools: skip auth test, print `ℹ No known auth test for <command>. Verify manually.`
|
|
172
115
|
|
|
173
116
|
On success (exit 0): print `✓ Authenticated as <output>`.
|
|
@@ -219,7 +162,7 @@ Write the updated secrets.md.
|
|
|
219
162
|
Read `<storage_repo>/.gitignore` with the Read tool. If the file does not exist or does not contain `donna/secrets.md`, append `donna/secrets.md` to `.gitignore` and write back. If `.gitignore` does not exist, create it with `donna/secrets.md` as its sole content.
|
|
220
163
|
|
|
221
164
|
**Validate API connectivity:**
|
|
222
|
-
|
|
165
|
+
Resolve the secret via Bash: `node ~/.donna/donna-tools.cjs resolve-secret <auth_secret>`. Parse the JSON response. If `error` is `"key_not_found"` or `"placeholder_value"`, print:
|
|
223
166
|
```
|
|
224
167
|
! No secret set for <auth_secret> — edit donna/secrets.md before testing connectivity.
|
|
225
168
|
```
|
|
@@ -300,7 +243,48 @@ If `<scope>` is set, replace `--all-namespaces` with `-n <namespace>` for each n
|
|
|
300
243
|
- list-pods: `kubectl get pods --all-namespaces --field-selector=status.phase!=Succeeded -o wide`
|
|
301
244
|
- list-failing: `kubectl get pods --all-namespaces --field-selector=status.phase=Failed -o wide`
|
|
302
245
|
|
|
303
|
-
For **unknown tools**,
|
|
246
|
+
For **unknown tools**, use a cascading approach to learn capabilities. Each stage builds on the previous. Stop when 3-5 relevant capabilities have been identified.
|
|
247
|
+
|
|
248
|
+
**Stage 1 — Local docs:**
|
|
249
|
+
Attempt to find local documentation for the tool:
|
|
250
|
+
```bash
|
|
251
|
+
TOOL_PATH=$(which <command> 2>/dev/null)
|
|
252
|
+
```
|
|
253
|
+
If found, check for README or docs in the tool's package directory:
|
|
254
|
+
```bash
|
|
255
|
+
TOOL_DIR=$(dirname "$(dirname "$TOOL_PATH")")
|
|
256
|
+
ls "$TOOL_DIR"/README* "$TOOL_DIR"/doc* "$TOOL_DIR"/docs* 2>/dev/null | head -5
|
|
257
|
+
```
|
|
258
|
+
If doc files exist, read the entry-point doc (prefer README, then docs/index or equivalent). Then follow internal links, references, or "see also" pointers to the sections most relevant to daily task management. Use Claude's understanding to navigate — don't stop at a fixed line count.
|
|
259
|
+
|
|
260
|
+
**Stage 2 — CLI help (baseline):**
|
|
261
|
+
Run `<command> --help 2>&1 | head -80` via Bash. If the help output lists subcommands, also run `<command> <subcommand> --help` for the 3-5 most relevant-looking subcommands. Combine with any Stage 1 findings. Use Claude's understanding to identify 3-5 capabilities relevant to daily task management. If `<scope>` is set, incorporate the scope into CLI invocations.
|
|
262
|
+
|
|
263
|
+
**Stage 3 — Web docs (if stages 1-2 found fewer than 3 capabilities):**
|
|
264
|
+
If fewer than 3 capabilities identified so far, attempt to fetch the tool's documentation from the web. Use WebFetch on common doc URLs:
|
|
265
|
+
- `https://<command>.dev` or `https://<command>.io`
|
|
266
|
+
- The homepage URL from `<command> --help` output if one was printed
|
|
267
|
+
|
|
268
|
+
If a docs page is found, follow links to CLI reference, commands, or API sections rather than reading only the landing page. Extract additional capabilities from those deeper pages.
|
|
269
|
+
|
|
270
|
+
**Stage 4 — Source code analysis (user opt-in per D-09):**
|
|
271
|
+
After stages 1-3, if the tool path was found in Stage 1, print the number of capabilities discovered and ask the user:
|
|
272
|
+
|
|
273
|
+
Use AskUserQuestion:
|
|
274
|
+
```
|
|
275
|
+
Found <N> capabilities from docs and help output. Want me to analyze <command>'s source code for more?
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
If the user says yes:
|
|
279
|
+
- Read the main entry point (e.g., bin/<command>, cli.js, main.py)
|
|
280
|
+
- Follow imports/requires to command registration, subcommand definitions, or handler modules
|
|
281
|
+
- Navigate into the files that define actual commands and actions — don't stop at the entry point
|
|
282
|
+
- Identify additional capabilities from function names, subcommands, or API surface
|
|
283
|
+
- Add any new relevant capabilities to the list
|
|
284
|
+
|
|
285
|
+
If the user says no, continue with what was found.
|
|
286
|
+
|
|
287
|
+
Format each capability as `name: <cli invocation>`.
|
|
304
288
|
|
|
305
289
|
**If `<tool_type>` is `rest`:**
|
|
306
290
|
|
|
@@ -433,24 +417,7 @@ If a section for this tool already exists in tools.md, replace it entirely. Writ
|
|
|
433
417
|
<step name="git-commit">
|
|
434
418
|
Run via Bash:
|
|
435
419
|
```bash
|
|
436
|
-
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
Check whether there is anything to commit:
|
|
440
|
-
```bash
|
|
441
|
-
git -C <storage_repo> status --porcelain
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
If the output is empty, skip the commit and continue.
|
|
445
|
-
|
|
446
|
-
Otherwise, run:
|
|
447
|
-
```bash
|
|
448
|
-
git -C <storage_repo> commit -m "donna(add-tool): added <tool_name>"
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
If `auto_push` is true in config, also run:
|
|
452
|
-
```bash
|
|
453
|
-
git -C <storage_repo> push
|
|
420
|
+
node ~/.donna/donna-tools.cjs commit "donna(add-tool): registered <tool_name>" --files donna/tools.md
|
|
454
421
|
```
|
|
455
422
|
</step>
|
|
456
423
|
|
package/workflows/adjust-tool.md
CHANGED
|
@@ -1,85 +1,28 @@
|
|
|
1
1
|
# Donna Adjust-Tool Workflow
|
|
2
2
|
|
|
3
3
|
<objective>
|
|
4
|
-
Edit an existing registered tool's configuration — scope, capabilities, auth/secrets,
|
|
4
|
+
Edit an existing registered tool's configuration — scope, capabilities, auth/secrets, or command.
|
|
5
5
|
</objective>
|
|
6
6
|
|
|
7
|
-
<step name="
|
|
8
|
-
Read `~/.config/donna/config.md`.
|
|
9
|
-
|
|
10
|
-
If the file does not exist, print:
|
|
11
|
-
```
|
|
12
|
-
✗ Donna is not configured. Run /donna:setup first.
|
|
13
|
-
```
|
|
14
|
-
Stop.
|
|
15
|
-
|
|
16
|
-
Extract the `storage_repo`, `daily_folder` (default: `daily`), and `auto_push` (default: false) fields from the YAML frontmatter.
|
|
17
|
-
|
|
18
|
-
**Obsidian sync:** Check if `<storage_repo>/.obsidian/daily-notes.json` exists.
|
|
19
|
-
- If it exists and has a `folder` field that differs from `<daily_folder>`: update `<daily_folder>` to match Obsidian's value, and update `~/.config/donna/config.md` with the new `daily_folder`. Print `✓ Synced daily folder with Obsidian: <daily_folder>`.
|
|
20
|
-
- If `<storage_repo>/.obsidian/` exists but `daily-notes.json` does not exist or has no `folder` field: write `<storage_repo>/.obsidian/daily-notes.json` with `{"folder":"<daily_folder>"}`. Print `✓ Configured Obsidian daily notes to use <daily_folder>/`.
|
|
21
|
-
- Otherwise: do nothing.
|
|
22
|
-
</step>
|
|
23
|
-
|
|
24
|
-
<step name="check-pending-migrations">
|
|
25
|
-
Read `~/.donna/state.md` with the Read tool. If the file does not exist or has no `pending_migrations` field in its YAML frontmatter, skip this step.
|
|
26
|
-
|
|
27
|
-
For each entry in `pending_migrations`:
|
|
28
|
-
|
|
29
|
-
**`move-standing-files`:** Move standing files from storage repo root to donna/ subfolder.
|
|
30
|
-
|
|
7
|
+
<step name="init">
|
|
31
8
|
Run via Bash:
|
|
32
9
|
```bash
|
|
33
|
-
|
|
34
|
-
DONNA_DIR="$STORAGE_REPO/donna"
|
|
35
|
-
MOVED=0
|
|
36
|
-
|
|
37
|
-
mkdir -p "$DONNA_DIR"
|
|
38
|
-
for FILE in role.md recurring.md role-research.md; do
|
|
39
|
-
if [ -f "$STORAGE_REPO/$FILE" ] && [ ! -f "$DONNA_DIR/$FILE" ]; then
|
|
40
|
-
mv "$STORAGE_REPO/$FILE" "$DONNA_DIR/$FILE"
|
|
41
|
-
echo "Moved $FILE to donna/$FILE"
|
|
42
|
-
MOVED=$((MOVED + 1))
|
|
43
|
-
fi
|
|
44
|
-
done
|
|
45
|
-
|
|
46
|
-
echo "MOVED=$MOVED"
|
|
10
|
+
INIT=$(node ~/.donna/donna-tools.cjs init)
|
|
47
11
|
```
|
|
48
12
|
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
git -C <storage_repo> add -A
|
|
52
|
-
git -C <storage_repo> diff --cached --quiet || git -C <storage_repo> commit -m "donna(migrate): move standing files to donna/ subfolder"
|
|
13
|
+
Parse the JSON response. If the `error` field is `"not_configured"`, print:
|
|
53
14
|
```
|
|
54
|
-
|
|
55
|
-
If `auto_push` is true in config, also push.
|
|
56
|
-
|
|
57
|
-
**`backfill-tool-type`:** Backfill `type` on existing tool sections in tools.md using heuristic detection.
|
|
58
|
-
|
|
59
|
-
Read `<storage_repo>/donna/tools.md` with the Read tool. If the file does not exist or has no tool sections, skip this handler.
|
|
60
|
-
|
|
61
|
-
For each tool section (starting with `## <tool_name>`), check if a `- type:` line already exists. If the `- type:` line is missing, detect the correct type:
|
|
62
|
-
|
|
63
|
-
1. If the tool section contains a `- command:` line where the value starts with `mcp:` (e.g., `- command: mcp:linear`), insert `- type: mcp` immediately after the `- command:` line.
|
|
64
|
-
2. Else, if the tool section contains a `- base_url:` line:
|
|
65
|
-
- If the capabilities section contains entries that look like GraphQL queries (contain `query {` or `mutation {`), insert `- type: graphql` immediately after `## <tool_name>` (REST/GraphQL tools have no `- command:` line).
|
|
66
|
-
- Otherwise, insert `- type: rest` immediately after `## <tool_name>`.
|
|
67
|
-
3. Else (no `mcp:` prefix, no `base_url` field), insert `- type: cli` immediately after the `- command:` line.
|
|
68
|
-
|
|
69
|
-
Write the updated file back with the Write tool. If any changes were made, commit:
|
|
70
|
-
```bash
|
|
71
|
-
git -C <storage_repo> add -A
|
|
72
|
-
git -C <storage_repo> diff --cached --quiet || git -C <storage_repo> commit -m "donna(migrate): backfill tool types on existing tools"
|
|
15
|
+
x Donna is not configured. Run /donna:setup first.
|
|
73
16
|
```
|
|
17
|
+
Stop.
|
|
74
18
|
|
|
75
|
-
|
|
19
|
+
Extract `storage_repo`, `daily_folder`, `auto_push` from the JSON.
|
|
76
20
|
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
pending_migrations: []
|
|
81
|
-
---
|
|
21
|
+
If `update_available` is non-null, print:
|
|
22
|
+
```
|
|
23
|
+
Donna v<update_available> available -- run npx @pingvinen/donna-assistant to update
|
|
82
24
|
```
|
|
25
|
+
Continue normally.
|
|
83
26
|
</step>
|
|
84
27
|
|
|
85
28
|
<step name="read-tools-md">
|
|
@@ -133,9 +76,18 @@ What would you like to change?
|
|
|
133
76
|
2. capabilities — add, remove, or modify capability commands
|
|
134
77
|
3. command — the CLI command or base URL
|
|
135
78
|
4. auth — auth test command or API secrets
|
|
136
|
-
5. type — tool type (cli, rest, graphql, mcp)
|
|
137
79
|
```
|
|
138
80
|
Store as `<change_choice>`.
|
|
81
|
+
|
|
82
|
+
**If the user asks to change the type** (response mentions "type", "change type", "switch type", etc.):
|
|
83
|
+
Print:
|
|
84
|
+
```
|
|
85
|
+
Tool type cannot be changed in-place — it affects how capabilities are learned and how the tool is invoked. To change a tool's type, remove and re-add:
|
|
86
|
+
|
|
87
|
+
1. /donna:remove-tool <tool_name>
|
|
88
|
+
2. /donna:add-tool <tool_name>
|
|
89
|
+
```
|
|
90
|
+
Stop — do not proceed to apply-change.
|
|
139
91
|
</step>
|
|
140
92
|
|
|
141
93
|
<step name="apply-change">
|
|
@@ -166,51 +118,6 @@ For type=cli: Use AskUserQuestion to update auth_test command.
|
|
|
166
118
|
For type=rest|graphql: Print `Edit your secrets in <storage_repo>/donna/secrets.md directly. The auth_secret field references the key name in that file.` Use AskUserQuestion to update `auth_secret` field name if needed.
|
|
167
119
|
For type=mcp: Print `MCP server auth is managed in Claude Code settings, not in Donna.`
|
|
168
120
|
|
|
169
|
-
**5. type:**
|
|
170
|
-
Use AskUserQuestion:
|
|
171
|
-
```
|
|
172
|
-
What is the correct type for <tool_name>? (cli, rest, graphql, mcp) Current: <type>
|
|
173
|
-
```
|
|
174
|
-
Store new value as `<new_type>`.
|
|
175
|
-
|
|
176
|
-
If `<new_type>` differs from `<type>`, check for capability format mismatches:
|
|
177
|
-
|
|
178
|
-
**Detect format mismatches:**
|
|
179
|
-
For each capability line (`- <name>: <invocation>`), check if the invocation matches the expected format for `<new_type>`:
|
|
180
|
-
- `cli`: invocation should be a shell command (no `mcp:` prefix, no `GET /` or `POST /` pattern, no `query {` pattern)
|
|
181
|
-
- `rest`: invocation should match `<METHOD> /path` pattern (e.g., `GET /repos/...`)
|
|
182
|
-
- `graphql`: invocation should contain `query {` or `mutation {`
|
|
183
|
-
- `mcp`: invocation should match `mcp:<server>/<tool>` pattern
|
|
184
|
-
|
|
185
|
-
If ANY capability does not match the expected format for `<new_type>`, print:
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
⚠ Capability format mismatch detected. Current capabilities are in <type> format but type is changing to <new_type>.
|
|
189
|
-
|
|
190
|
-
Mismatched capabilities:
|
|
191
|
-
<list each mismatched capability with its current invocation>
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
Use AskUserQuestion:
|
|
195
|
-
```
|
|
196
|
-
How would you like to fix the capabilities?
|
|
197
|
-
```
|
|
198
|
-
Suggest these options:
|
|
199
|
-
1. Re-enter capabilities manually (interactive editor)
|
|
200
|
-
2. Clear all capabilities (start fresh with adjust-tool later)
|
|
201
|
-
3. Keep as-is (may cause runtime errors)
|
|
202
|
-
|
|
203
|
-
If option 1: Present the same interactive capabilities editing loop (show numbered list, accept "remove N", "add name: invocation", "edit N new_invocation", "done"). Pre-populate with existing capability NAMES but empty invocations so the user only needs to type the new format.
|
|
204
|
-
|
|
205
|
-
If option 2: Clear the capabilities section entirely. Print `✓ Capabilities cleared. Run /donna:adjust-tool <tool_name> to add new capabilities.`
|
|
206
|
-
|
|
207
|
-
If option 3: Print `⚠ Keeping mismatched capabilities — runtime errors may occur.`
|
|
208
|
-
|
|
209
|
-
**Update structural fields when type changes:**
|
|
210
|
-
- Changing TO rest/graphql: ensure `base_url`, `auth_header`, `auth_secret` fields exist. If missing, prompt for them (same prompts as add-tool).
|
|
211
|
-
- Changing TO mcp: remove `command`, `version`, `base_url`, `auth_header`, `auth_secret` fields if present.
|
|
212
|
-
- Changing TO cli: ensure `command`, `version` fields exist. If missing, prompt for command and run version check.
|
|
213
|
-
- Changing FROM rest/graphql: remove `base_url`, `auth_header`, `auth_secret` fields.
|
|
214
121
|
</step>
|
|
215
122
|
|
|
216
123
|
<step name="write-tools-md">
|
|
@@ -220,24 +127,7 @@ Read `<storage_repo>/donna/tools.md`. Update only the `<selected_tool>` section
|
|
|
220
127
|
<step name="git-commit">
|
|
221
128
|
Run via Bash:
|
|
222
129
|
```bash
|
|
223
|
-
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
Check whether there is anything to commit:
|
|
227
|
-
```bash
|
|
228
|
-
git -C <storage_repo> status --porcelain
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
If the output is empty, skip the commit and continue.
|
|
232
|
-
|
|
233
|
-
Otherwise, run:
|
|
234
|
-
```bash
|
|
235
|
-
git -C <storage_repo> commit -m "donna(adjust-tool): updated <tool_name> (<change_description>)"
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
If `auto_push` is true in config, also run:
|
|
239
|
-
```bash
|
|
240
|
-
git -C <storage_repo> push
|
|
130
|
+
node ~/.donna/donna-tools.cjs commit "donna(adjust-tool): updated <tool_name> (<change_description>)" --files donna/tools.md
|
|
241
131
|
```
|
|
242
132
|
</step>
|
|
243
133
|
|