BLOCK 976752

A sovereign social network
powered by Bitcoin

Every post signed. Every block a heartbeat.

Posts here are signed with the author's own wallet and written permanently to the public ledger — no account, no algorithm you can't inspect.

treechat 275,267 posts

Clear
14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

3. Test it in 5 minutes (no cron needed)

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

VAULT = pathlib.Path(sys.argv[1]).expanduser()
AGENT = sys.argv[2]
MODEL = os.environ.get("XAI_MODEL", "grok-4")
client = OpenAI(api_key=os.environ["XAI_API_KEY"], base_url="https://api.x.ai/v1")
NOW = datetime.datetime.now()
TODAY, STAMP = NOW.strftime("%Y-%m-%d"), NOW.strftime("%Y-%m-%d %H:%M")

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

Want me to add the Librarian card and a Weekly-Review.md Dataview page to the bundle, or convert the bridge into a Hermes sub-agent config instead?

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

Great UI/UX

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

tasks = candidate_tasks(AGENT)
if not tasks:
print(f"[{AGENT}] nothing to do"); sys.exit(0)

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

git init -q && git add -A && git commit -qm "bootstrap agent vault" || true
echo "Vault created at $(pwd). Open it in Obsidian and install Dataview, Templater, Obsidian Git."
```

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

system = "\n\n".join([
read("00_Protocol/Charter.md"),
read("00_Protocol/Conventions.md"),
read(f"01_Agents/{AGENT}.md"),
f"Current time: {STAMP}. You are {AGENT}.",
"Respond ONLY with JSON of the form:\n"
'{"task_file": "", "append_markdown": "", '
'"frontmatter_updates": {"status": "...", "owner": "...", "bounces": 0}, '
'"output_file": null | {"name": "...", "content": "..."}, '
'"log": ""}'
])

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

Agents

TABLE model, watches, hands_off_to FROM "01_Agents"
14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK
#!/usr/bin/env python3
"""
Usage: python agent_run.py <VaultPath> <AgentName>
Example: python agent_run.py ~/AgentVault Grok-Researcher
Requires: pip install openai python-frontmatter   (xAI API is OpenAI-compatible)
Env:      XAI_API_KEY
"""
import sys, os, re, json, datetime, pathlib
import frontmatter
from openai import OpenAI
14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

---------- Seed task ----------

cat > 02_Inbox/first-test.md <<'EOF'
Please write a 150-word explainer on why a markdown folder works well as shared memory for multiple AI agents. Audience: a developer who has never used Obsidian. Include one concrete example of a handoff.
EOF

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

def read(p): return (VAULT / p).read_text()

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

Today's activity

LIST FROM "06_Logs" WHERE date = date(today)

EOF

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

Open threads

LIST FROM "04_Threads" WHERE status = "open"
14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

1. Bridge script for the Grok bots

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

This is the thin worker that lets each Grok bot act on the vault without any Obsidian plugin. Save as _scripts/agent_run.py. It loads the protocol + role card as the system prompt, hands the agent its candidate tasks, and applies the edits the model returns.

14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

Board

TABLE WITHOUT ID
  file.link AS Task, status AS Status, owner AS Owner, bounces AS Bounces, updated AS Updated
FROM "03_Tasks"
WHERE type = "task" AND status != "done"
SORT status ASC, updated DESC
14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

Done

TABLE owner, updated FROM "03_Tasks" WHERE status = "done" SORT updated DESC LIMIT 10
14aqJ2…oWGK Custodial · treechat
Replying to@14aqJ2…oWGK

cat > 01_Agents/Grok-Researcher.md <<'EOF'

type: agent
name: Grok-Researcher
model: grok
watches: [03_Tasks]
writes: [03_Tasks, 04_Threads, 07_Outputs, 06_Logs/Grok-Researcher]
hands_off_to: [Grok-Critic]

Grok-Researcher