zhuyuan-ice-gl-zy001/BRIDGE/host-adapters/doubao/zy-doubao-wake-read.sh

16 lines
758 B
Shell
Executable file

#!/bin/bash
# Doubao thin adapter: read one page, then optionally route one level.
set -euo pipefail
ROOT="/Volumes/JZAO/HoloLake/persona-runtime/continuity-memory"
STORE="$ROOT/persona-daily-fractal/ICE-P-ZY001"
TOOL="/Volumes/JZAO/HoloLake/persona-runtime/repo-012-main/server-tools/persona-daily-fractal-memory/persona-daily-memory.mjs"
QUERY="${1:-}"
node "$TOOL" current --allowed-root "$ROOT" --store "$STORE"
node "$TOOL" read-day --allowed-root "$ROOT" --store "$STORE"
if [ -n "$QUERY" ]; then
DATE=$(node "$TOOL" current --allowed-root "$ROOT" --store "$STORE" | python3 -c 'import json,sys; print(json.load(sys.stdin)["current_day"])')
node "$TOOL" route --allowed-root "$ROOT" --store "$STORE" --scope day --id "$DATE" --query "$QUERY"
fi