mirror of
https://github.com/dtzp555-max/memory-continuity.git
synced 2026-07-19 09:42:42 +00:00
fix: add install record for provenance tracking
post-install.sh now writes plugins.installs with source:"path" so OpenClaw recognizes the plugin origin. Eliminates both the allow-list and provenance warnings on fresh install. Script is now fully idempotent — always refreshes allow/installs/entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,8 +60,9 @@ bash scripts/post-install.sh
|
|||||||
The installer will:
|
The installer will:
|
||||||
1. Copy the plugin to `~/.openclaw/extensions/memory-continuity/`
|
1. Copy the plugin to `~/.openclaw/extensions/memory-continuity/`
|
||||||
2. Add the plugin entry to `~/.openclaw/openclaw.json`
|
2. Add the plugin entry to `~/.openclaw/openclaw.json`
|
||||||
3. Add `memory-continuity` to `plugins.allow` (trust list — eliminates provenance warnings)
|
3. Add `memory-continuity` to `plugins.allow` (trust list)
|
||||||
4. Restart the gateway
|
4. Add install record to `plugins.installs` (provenance tracking)
|
||||||
|
5. Restart the gateway
|
||||||
|
|
||||||
No npm install, no API keys, no external database.
|
No npm install, no API keys, no external database.
|
||||||
|
|
||||||
|
|||||||
+10
-16
@@ -51,20 +51,7 @@ if [[ ! -f "$CONFIG_FILE" ]]; then
|
|||||||
echo " You'll need to manually add the plugin entry."
|
echo " You'll need to manually add the plugin entry."
|
||||||
else
|
else
|
||||||
# Check if memory-continuity entry already exists
|
# Check if memory-continuity entry already exists
|
||||||
if python3 -c "
|
# Always ensure allow list, install record, and entry are present (idempotent)
|
||||||
import json, sys
|
|
||||||
with open('$CONFIG_FILE') as f:
|
|
||||||
data = json.load(f)
|
|
||||||
entries = data.get('plugins', {}).get('entries', {})
|
|
||||||
if 'memory-continuity' in entries:
|
|
||||||
print('exists')
|
|
||||||
sys.exit(0)
|
|
||||||
else:
|
|
||||||
sys.exit(1)
|
|
||||||
" 2>/dev/null; then
|
|
||||||
echo " Plugin entry already exists in config"
|
|
||||||
else
|
|
||||||
# Add the plugin entry and plugins.allow trust list
|
|
||||||
python3 -c "
|
python3 -c "
|
||||||
import json
|
import json
|
||||||
path = '$CONFIG_FILE'
|
path = '$CONFIG_FILE'
|
||||||
@@ -90,11 +77,18 @@ data['plugins']['entries']['memory-continuity'] = {
|
|||||||
'autoExtract': True
|
'autoExtract': True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# Add install record for provenance tracking (eliminates untracked-code warning)
|
||||||
|
if 'installs' not in data['plugins']:
|
||||||
|
data['plugins']['installs'] = {}
|
||||||
|
data['plugins']['installs']['memory-continuity'] = {
|
||||||
|
'source': 'path',
|
||||||
|
'installPath': '~/.openclaw/extensions/memory-continuity',
|
||||||
|
'sourcePath': '$REPO_DIR'
|
||||||
|
}
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
json.dump(data, f, indent=2)
|
json.dump(data, f, indent=2)
|
||||||
print(' Added plugin entry and trust config')
|
print(' Added plugin entry, trust config, and install record')
|
||||||
" 2>/dev/null || echo " WARNING: Could not update config automatically. Add manually."
|
" 2>/dev/null || echo " WARNING: Could not update config automatically. Add manually."
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 3: Restart gateway
|
# Step 3: Restart gateway
|
||||||
|
|||||||
Reference in New Issue
Block a user