@pingvinen/donna-assistant 0.9.0 → 0.10.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 +31 -3
- package/package.json +1 -1
- package/src/donna-tools.cjs +429 -0
- package/src/installer.cjs +26 -4
- 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 +22 -92
- package/workflows/done.md +16 -74
- package/workflows/focus.md +21 -95
- 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/run-tools.md
CHANGED
|
@@ -4,82 +4,25 @@
|
|
|
4
4
|
Execute all configured external tool commands, pull fresh data, and smart-merge results into today's daily file. Does not run the full begin-the-day carry-forward or recurring task logic — this is a mid-day update only.
|
|
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
|
-
```markdown
|
|
79
|
-
---
|
|
80
|
-
pending_migrations: []
|
|
81
|
-
---
|
|
21
|
+
If `update_available` is non-null, print:
|
|
82
22
|
```
|
|
23
|
+
Donna v<update_available> available -- run npx @pingvinen/donna-assistant to update
|
|
24
|
+
```
|
|
25
|
+
Continue normally.
|
|
83
26
|
</step>
|
|
84
27
|
|
|
85
28
|
<step name="read-tools-md">
|
|
@@ -95,13 +38,11 @@ Store the parsed tools and their capabilities as `<registered_tools>`.
|
|
|
95
38
|
</step>
|
|
96
39
|
|
|
97
40
|
<step name="find-daily-file">
|
|
98
|
-
Get
|
|
41
|
+
Get the daily file path via donna-tools:
|
|
99
42
|
```bash
|
|
100
|
-
|
|
43
|
+
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))")
|
|
101
44
|
```
|
|
102
|
-
Store as `<today
|
|
103
|
-
|
|
104
|
-
Construct the path: `<storage_repo>/<daily_folder>/<today>.md`.
|
|
45
|
+
Store the result as `<daily_file_path>`. Extract `<today>` from the filename (last path component without `.md`).
|
|
105
46
|
|
|
106
47
|
If the file does not exist, print:
|
|
107
48
|
```
|
|
@@ -143,9 +84,9 @@ If the `## From Tools` section does not exist in today's file, set `<existing_to
|
|
|
143
84
|
|
|
144
85
|
For `type: cli` capabilities (format: `<name>: <cli_invocation>`):
|
|
145
86
|
|
|
146
|
-
Run the capability command via Bash
|
|
87
|
+
Run the capability command via Bash (set the Bash tool's `timeout` parameter to `10000`):
|
|
147
88
|
```bash
|
|
148
|
-
|
|
89
|
+
<capability_command> 2>&1
|
|
149
90
|
```
|
|
150
91
|
|
|
151
92
|
**On success (exit 0):** Parse the output into task entries. Every task line MUST include both a tool tag and a descriptive link.
|
|
@@ -174,11 +115,14 @@ For other tools: use Claude's understanding to extract task-like items from the
|
|
|
174
115
|
Continue to the next capability. Never retry.
|
|
175
116
|
|
|
176
117
|
For `type: rest` capabilities (format: `<name>: <METHOD> /path`):
|
|
177
|
-
1.
|
|
178
|
-
2. Resolve the `auth_secret` key to get the actual secret value. If the key is not found in secrets.md or the value is `REPLACE_WITH_YOUR_SECRET`, add warning `! <tool_name>: missing secret <auth_secret> — edit donna/secrets.md` and skip this tool.
|
|
179
|
-
3. For each capability, run via Bash with a 10-second timeout:
|
|
118
|
+
1. Resolve the auth secret via Bash:
|
|
180
119
|
```bash
|
|
181
|
-
|
|
120
|
+
node ~/.donna/donna-tools.cjs resolve-secret <auth_secret>
|
|
121
|
+
```
|
|
122
|
+
2. Parse the JSON response. If `error` is `"key_not_found"` or `"placeholder_value"`, add warning `! <tool_name>: missing secret <auth_secret> — edit donna/secrets.md` and skip this tool. Otherwise extract the `value` field as `<resolved_secret>`.
|
|
123
|
+
3. For each capability, run via Bash (set the Bash tool's `timeout` parameter to `10000`):
|
|
124
|
+
```bash
|
|
125
|
+
curl -s -H "<auth_header>: <resolved_secret>" "<base_url><path>" 2>&1
|
|
182
126
|
```
|
|
183
127
|
4. Parse the JSON response using Claude's understanding to extract task-like items. Format:
|
|
184
128
|
`- [ ] (<tool_name>) <description> [<identifier>](<url>)`
|
|
@@ -189,9 +133,9 @@ Continue. Never retry.
|
|
|
189
133
|
|
|
190
134
|
For `type: graphql` capabilities (format: `<name>: <graphql_query>`):
|
|
191
135
|
1. Same secrets resolution as REST.
|
|
192
|
-
2. For each capability, run via Bash
|
|
136
|
+
2. For each capability, run via Bash (set the Bash tool's `timeout` parameter to `10000`):
|
|
193
137
|
```bash
|
|
194
|
-
|
|
138
|
+
curl -s -X POST -H "<auth_header>: <resolved_secret>" -H "Content-Type: application/json" -d '{"query":"<graphql_query>"}' "<base_url>" 2>&1
|
|
195
139
|
```
|
|
196
140
|
3. Parse the JSON response to extract task-like items. Same format as REST.
|
|
197
141
|
|
|
@@ -223,7 +167,7 @@ For each URL in `<existing_tool_lines>`:
|
|
|
223
167
|
1. If the line is `[x]` (user manually checked): **KEEP AS-IS** — user intent wins (Rule 1). Do not change regardless of tool state.
|
|
224
168
|
2. If the line is `[ ]` AND the URL exists in `<fresh_tool_tasks>`: **KEEP OPEN** — item is still active (Rule 2).
|
|
225
169
|
3. If the line is `[ ]` AND the URL is NOT in `<fresh_tool_tasks>`: the item was removed from the tool (reassigned, deleted, or closed).
|
|
226
|
-
- For gh items: check if the PR/issue was closed or merged via Bash
|
|
170
|
+
- For gh items: check if the PR/issue was closed or merged via Bash (set the Bash tool's `timeout` parameter to `10000`): `gh pr view <number> --json state --jq '.state' 2>/dev/null || gh issue view <number> --json state --jq '.state' 2>/dev/null`
|
|
227
171
|
- If closed or merged: change to `- [x] (<tool>) <description> [<identifier>](<url>) (<reason>)` and move to `## Resolved` (Rule 3a).
|
|
228
172
|
- If status check fails or item simply no longer appears: move to `## Resolved` with `(removed)` (Rule 3b).
|
|
229
173
|
|
|
@@ -244,24 +188,7 @@ If `## From Tools` does not yet exist in the file, add it after the `## Tasks` s
|
|
|
244
188
|
<step name="git-commit">
|
|
245
189
|
Run via Bash:
|
|
246
190
|
```bash
|
|
247
|
-
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
Check whether there is anything to commit:
|
|
251
|
-
```bash
|
|
252
|
-
git -C <storage_repo> status --porcelain
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
If the output is empty, skip the commit and continue.
|
|
256
|
-
|
|
257
|
-
Otherwise, run:
|
|
258
|
-
```bash
|
|
259
|
-
git -C <storage_repo> commit -m "donna(run-tools): refreshed tool data for <today>"
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
If `auto_push` is true in config, also run:
|
|
263
|
-
```bash
|
|
264
|
-
git -C <storage_repo> push
|
|
191
|
+
node ~/.donna/donna-tools.cjs commit "donna(tools): refreshed tool data" --files <daily_folder>/<today>.md
|
|
265
192
|
```
|
|
266
193
|
</step>
|
|
267
194
|
|
package/workflows/set-role.md
CHANGED
|
@@ -4,57 +4,25 @@
|
|
|
4
4
|
Define the user's job role, research recurring tasks and tools for that role using WebSearch, present findings for approval, and persist role definition and recurring tasks to 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` and `auto_push` (default: false) fields from the YAML frontmatter.
|
|
17
|
-
</step>
|
|
18
|
-
|
|
19
|
-
<step name="check-pending-migrations">
|
|
20
|
-
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.
|
|
21
|
-
|
|
22
|
-
For each entry in `pending_migrations`:
|
|
23
|
-
|
|
24
|
-
**`move-standing-files`:** Move standing files from storage repo root to donna/ subfolder.
|
|
25
|
-
|
|
7
|
+
<step name="init">
|
|
26
8
|
Run via Bash:
|
|
27
9
|
```bash
|
|
28
|
-
|
|
29
|
-
DONNA_DIR="$STORAGE_REPO/donna"
|
|
30
|
-
MOVED=0
|
|
31
|
-
|
|
32
|
-
mkdir -p "$DONNA_DIR"
|
|
33
|
-
for FILE in role.md recurring.md role-research.md; do
|
|
34
|
-
if [ -f "$STORAGE_REPO/$FILE" ] && [ ! -f "$DONNA_DIR/$FILE" ]; then
|
|
35
|
-
mv "$STORAGE_REPO/$FILE" "$DONNA_DIR/$FILE"
|
|
36
|
-
echo "Moved $FILE to donna/$FILE"
|
|
37
|
-
MOVED=$((MOVED + 1))
|
|
38
|
-
fi
|
|
39
|
-
done
|
|
40
|
-
|
|
41
|
-
echo "MOVED=$MOVED"
|
|
10
|
+
INIT=$(node ~/.donna/donna-tools.cjs init)
|
|
42
11
|
```
|
|
43
12
|
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
git -C <storage_repo> add -A
|
|
47
|
-
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:
|
|
48
14
|
```
|
|
15
|
+
x Donna is not configured. Run /donna:setup first.
|
|
16
|
+
```
|
|
17
|
+
Stop.
|
|
49
18
|
|
|
50
|
-
|
|
19
|
+
Extract `storage_repo`, `daily_folder`, `auto_push` from the JSON.
|
|
51
20
|
|
|
52
|
-
|
|
53
|
-
```markdown
|
|
54
|
-
---
|
|
55
|
-
pending_migrations: []
|
|
56
|
-
---
|
|
21
|
+
If `update_available` is non-null, print:
|
|
57
22
|
```
|
|
23
|
+
Donna v<update_available> available -- run npx @pingvinen/donna-assistant to update
|
|
24
|
+
```
|
|
25
|
+
Continue normally.
|
|
58
26
|
</step>
|
|
59
27
|
|
|
60
28
|
<step name="check-existing-role">
|
|
@@ -252,24 +220,7 @@ If this is a diff-update (user chose option 2 in rerun-menu):
|
|
|
252
220
|
<step name="git-commit">
|
|
253
221
|
Run via Bash:
|
|
254
222
|
```bash
|
|
255
|
-
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
Check whether there is anything to commit:
|
|
259
|
-
```bash
|
|
260
|
-
git -C <storage_repo> status --porcelain
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
If the output is empty, skip the commit and continue.
|
|
264
|
-
|
|
265
|
-
Otherwise, run:
|
|
266
|
-
```bash
|
|
267
|
-
git -C <storage_repo> commit -m "donna(set-role): define role as <job_title>"
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
If `auto_push` is true in config, also run:
|
|
271
|
-
```bash
|
|
272
|
-
git -C <storage_repo> push
|
|
223
|
+
node ~/.donna/donna-tools.cjs commit "donna(role): updated role definition" --files donna/role.md donna/recurring.md
|
|
273
224
|
```
|
|
274
225
|
</step>
|
|
275
226
|
|