Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 108 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@

# NOTE: https://github.com/haras-unicorn/mcp-nix/blob/v0.1.3/README.md
mcp-nix.url = "github:haras-unicorn/mcp-nix/refs/tags/v0.1.3";

# NOTE: https://github.com/haras-unicorn/mcp-rss/blob/v0.2.0/README.md
mcp-rss.url = "github:haras-unicorn/mcp-rss/refs/tags/v0.2.0";
};

outputs =
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sarah
# USER.md

28, trans woman, software engineer.

Expand Down
31 changes: 31 additions & 0 deletions src/modules/ai/zeroclaw/cron/DIGEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# DIGEST.md

Shared digest: fetch rules and cron job instructions.

## Cron Job Instructions

When running the digest cron job:

1. Read `DIGEST.md` from your workspace to get feeds, filters and preferences
and last run date.
2. Get all articles from feeds via `rss__get_articles` with `time_from` as the
last time this job ran from `DIGEST.md` if it exists.
3. Fetch all the fetched articles with `rss__fetch_article`.
4. Use `memory_store` to remember all the fetched articles that pass filters
from `DIGEST.md` in your workspace. Use keys like
`digest:<feed-slug>-<article-slug>` and set values as the article summary in
1-2 sentences with the link to the article at the end in the following
format: `# <title>\n\n<summary-paragraph>\n\nLink: <link>\n`.
5. Generate a report summarizing new items grouped by theme, newest first.
6. Write down when the cron job started in the workspace `DIGEST.md`.
7. Deliver the report to the configured channel.
8. If nothing is new, report a single line. If fetch fails, state plainly.

## Rules

- Report Language: English.
- Links: Keep item links in reports.
- On failure: Say so plainly. Never fabricate items.
- Tools: Never use `http_request` or `web_fetch` tools to fetch feeds or
articles. Always use `rss__get_articles` to fetch feeds and
`rss__fetch_article` to fetch articles.
62 changes: 49 additions & 13 deletions src/modules/ai/zeroclaw/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# MATRIX_HOMESERVER
# MATRIX_USER_ID
# MATRIX_PEER
# MATRIX_DIGEST_ROOM
# GIT_USER
# GIT_EMAIL
# GIT_SSH_KEY
Expand Down Expand Up @@ -101,7 +102,11 @@ in
risk_profile = "main";
runtime_profile = "main";
channels = [ "matrix.main" ];
mcp_bundles = [ "dev" ];
mcp_bundles = [
"dev"
"digest"
];
cron_jobs = [ "digest" ];
};

schema_version = 3;
Expand Down Expand Up @@ -255,6 +260,9 @@ in
"TodoWrite"
"mcp_resources"

"rss__get_articles"
"rss__fetch_article"

"nixos__nix"
"nixos__nix_versions"

Expand Down Expand Up @@ -481,16 +489,44 @@ in
];
};
}
{
name = "rss";
transport = "stdio";
command = lib.getExe inputs.mcp-rss.packages.${system}.mcp-rss;
}
];
};

mcp_bundles.dev = {
servers = [
"nixos"
"nix"
"git"
"github"
];
mcp_bundles = {
dev = {
servers = [
"nixos"
"nix"
"git"
"github"
];
};
digest = {
servers = [
"rss"
];
};
};

cron = {
digest = {
job_type = "agent";
schedule = {
kind = "cron";
expr = "0 6 * * *";
};
prompt = builtins.readFile ./cron/DIGEST.md;
delivery = {
mode = "announce";
channel = "matrix.main";
to = "$MATRIX_DIGEST_ROOM";
};
};
};

web_search = {
Expand Down Expand Up @@ -627,11 +663,11 @@ in
mv -f "${dataDir}/.config.toml.tmp" "${dataDir}/config.toml"

mkdir -p ${agentWorkspaceDir}
install -m 0644 ${./AGENTS.md} "${agentWorkspaceDir}/AGENTS.md"
install -m 0644 ${./IDENTITY.md} "${agentWorkspaceDir}/IDENTITY.md"
install -m 0644 ${./SOUL.md} "${agentWorkspaceDir}/SOUL.md"
install -m 0644 ${./TOOLS.md} "${agentWorkspaceDir}/TOOLS.md"
install -m 0644 ${./USER.md} "${agentWorkspaceDir}/USER.md"
install -m 0644 ${./agent/AGENTS.md} "${agentWorkspaceDir}/AGENTS.md"
install -m 0644 ${./agent/IDENTITY.md} "${agentWorkspaceDir}/IDENTITY.md"
install -m 0644 ${./agent/SOUL.md} "${agentWorkspaceDir}/SOUL.md"
install -m 0644 ${./agent/TOOLS.md} "${agentWorkspaceDir}/TOOLS.md"
install -m 0644 ${./agent/USER.md} "${agentWorkspaceDir}/USER.md"
'';
script = ''
zeroclaw daemon
Expand Down
Loading