ver0.4.1
This commit is contained in:
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "echo-memory",
|
"name": "echo-memory",
|
||||||
"version": "0.4.0",
|
"version": "0.4.1",
|
||||||
"description": "Persistent memory via the ECHO Obsidian vault over the Local REST API. Reads and writes notes across Claude/CoWork sessions using direct REST calls \u2014 no MCP server required. Jason's personal memory vault.",
|
"description": "Persistent memory via the ECHO Obsidian vault over the Local REST API. Reads and writes notes across Claude/CoWork sessions using direct REST calls \u2014 no MCP server required. Jason's personal memory vault.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Jason"
|
"name": "Jason"
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ After substantive activity, write a one-line entry to today's daily note's `## A
|
|||||||
|
|
||||||
1. Try to GET `journal/daily/YYYY-MM-DD.md`.
|
1. Try to GET `journal/daily/YYYY-MM-DD.md`.
|
||||||
2. If 404 — PUT a fresh daily note from the template, then PATCH.
|
2. If 404 — PUT a fresh daily note from the template, then PATCH.
|
||||||
3. If 200 but `## Agent Log` is missing — POST `\n\n## Agent Log\n` to the file to add the heading, then PATCH.
|
3. If 200 but `## Agent Log` is missing — POST `\n\n## Agent Log\n` to the file to add the heading, then PATCH. **Detect the heading by grepping the raw markdown for an anchored `^## Agent Log` line — do NOT grep the document-map JSON, whose headings are full `::`-delimited paths (e.g. `"2026-06-07::Agent Log"`); a bare `"Agent Log"` match fails there and a duplicate heading gets appended.**
|
||||||
4. PATCH-append the entry under the target `<YYYY-MM-DD>::Agent Log` (the H1 of a daily note is the date, so that's the full target path).
|
4. PATCH-append the entry under the target `<YYYY-MM-DD>::Agent Log` (the H1 of a daily note is the date, so that's the full target path).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -286,9 +286,11 @@ if [ "$HTTP" = "404" ]; then
|
|||||||
| curl -s -X PUT -H "$AUTH" -H "Content-Type: text/markdown" --data-binary @- "$DAILY"
|
| curl -s -X PUT -H "$AUTH" -H "Content-Type: text/markdown" --data-binary @- "$DAILY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 3: ensure the `## Agent Log` heading exists
|
# 3: ensure the `## Agent Log` heading exists.
|
||||||
MAP=$(curl -s -H "$AUTH" -H "Accept: application/vnd.olrapi.document-map+json" "$DAILY")
|
# Grep the RAW markdown for an anchored heading line. Do NOT grep the document-map
|
||||||
if ! printf '%s' "$MAP" | grep -q '"Agent Log"'; then
|
# JSON: its headings are full "::"-delimited paths (e.g. "2026-06-07::Agent Log"), so a
|
||||||
|
# bare '"Agent Log"' match never matches and a DUPLICATE heading gets appended each time.
|
||||||
|
if ! curl -s -H "$AUTH" "$DAILY" | grep -q '^## Agent Log'; then
|
||||||
printf '\n\n## Agent Log\n' | curl -s -X POST -H "$AUTH" -H "Content-Type: text/markdown" --data-binary @- "$DAILY"
|
printf '\n\n## Agent Log\n' | curl -s -X POST -H "$AUTH" -H "Content-Type: text/markdown" --data-binary @- "$DAILY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user