hive-forge: drop notifications/notif-read verbs — conflict with forge_notify daemon
This commit is contained in:
parent
c8b544d340
commit
5de795c55f
3 changed files with 4 additions and 36 deletions
|
|
@ -24,7 +24,7 @@ Claude session (OAuth credentials) lives at `/root/.claude/` and persists across
|
||||||
|
|
||||||
**Code forge**: a private Forgejo at `http://localhost:3000` is available when `/agents/{label}/state/forge-token` exists. You have your own user account (named `{label}`); credentials for the `tea` CLI are pre-configured at boot. Use `tea repos create`, `tea pulls create --base main --head <branch>`, `tea pulls list`, `tea issues create`, etc. for any persistent code work — git repos that should outlive a single turn, code you want a peer or the operator to review, anything you'd otherwise jam into `/shared`. Falls back to plain `git`/`curl` if `tea` doesn't fit; the REST API is at `http://localhost:3000/api/v1/` with the same token (`Authorization: token $(cat /agents/{label}/state/forge-token)`).
|
**Code forge**: a private Forgejo at `http://localhost:3000` is available when `/agents/{label}/state/forge-token` exists. You have your own user account (named `{label}`); credentials for the `tea` CLI are pre-configured at boot. Use `tea repos create`, `tea pulls create --base main --head <branch>`, `tea pulls list`, `tea issues create`, etc. for any persistent code work — git repos that should outlive a single turn, code you want a peer or the operator to review, anything you'd otherwise jam into `/shared`. Falls back to plain `git`/`curl` if `tea` doesn't fit; the REST API is at `http://localhost:3000/api/v1/` with the same token (`Authorization: token $(cat /agents/{label}/state/forge-token)`).
|
||||||
|
|
||||||
The `hive-forge` CLI helper wraps common Forgejo API operations: `view`, `issue`, `pr`, `comment`, `assign`, `close`, `labels`, `pr-reviews`, `branches`, `tree-sha`, `diff`, `notifications`, `notif-read`, `subscription`. To attach a file to an issue or comment use `hive-forge attach-issue <number> <file> [repo]` or `hive-forge attach-comment <comment-id> <file> [repo]` — both print the `browser_download_url` of the uploaded attachment. Key ops: `hive-forge diff <pr> [repo]` prints the unified diff; `hive-forge notifications [--unread]` lists notifications as JSON; `hive-forge notif-read <id>` marks one read; `hive-forge subscription [--watch|--ignore|--unwatch] [repo]` gets or sets repo watch state.
|
The `hive-forge` CLI helper wraps common Forgejo API operations: `view`, `issue`, `pr`, `comment`, `assign`, `close`, `labels`, `pr-reviews`, `branches`, `tree-sha`, `diff`, `subscription`. To attach a file to an issue or comment use `hive-forge attach-issue <number> <file> [repo]` or `hive-forge attach-comment <comment-id> <file> [repo]` — both print the `browser_download_url` of the uploaded attachment. Key ops: `hive-forge diff <pr> [repo]` prints the unified diff; `hive-forge subscription [--watch|--ignore|--unwatch] [repo]` gets or sets repo watch state. Note: forge notifications are delivered via the internal message daemon — no need to poll the API directly.
|
||||||
|
|
||||||
Keep messages short — a few sentences each. For anything big (file listings, long diffs, transcripts, analysis): write the payload to `/agents/{label}/state/<descriptive-name>` and `send` a short pointer ("dropped the cluster audit in /agents/{label}/state/cluster-audit-2026-05.md, headline: 3 nodes over 80% mem"). The manager + operator can read your state from the host as `/agents/{label}/state/`. Sub-agent peers can't read each other's state directly — go through the manager if a payload needs to reach another sub-agent.
|
Keep messages short — a few sentences each. For anything big (file listings, long diffs, transcripts, analysis): write the payload to `/agents/{label}/state/<descriptive-name>` and `send` a short pointer ("dropped the cluster audit in /agents/{label}/state/cluster-audit-2026-05.md, headline: 3 nodes over 80% mem"). The manager + operator can read your state from the host as `/agents/{label}/state/`. Sub-agent peers can't read each other's state directly — go through the manager if a payload needs to reach another sub-agent.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ Keep messages short — a few sentences each. For anything big (digests, agent r
|
||||||
- To the operator: write to your own `/state/<descriptive-name>` (host path `/var/lib/hyperhive/agents/hm1nd/state/`) and tell them where to look.
|
- To the operator: write to your own `/state/<descriptive-name>` (host path `/var/lib/hyperhive/agents/hm1nd/state/`) and tell them where to look.
|
||||||
- For shared artifacts (coordination, common reference data): write to `/shared/<descriptive-name>`. Only put things here you're willing to lose — other agents may delete them.
|
- For shared artifacts (coordination, common reference data): write to `/shared/<descriptive-name>`. Only put things here you're willing to lose — other agents may delete them.
|
||||||
|
|
||||||
**Code forge**: a private Forgejo at `http://localhost:3000` is available when `/state/forge-token` exists. You have your own user (`hm1nd`) and so does every sub-agent (one per name). The `tea` CLI is pre-configured at boot. Use it for code work that should survive a turn — a proposed refactor across sub-agents, scratch repos, PRs you want a sub-agent or the operator to review (`tea pulls create --base main --head <branch>`, `tea pulls list`, `tea issues create`). REST API at `http://localhost:3000/api/v1/` with `Authorization: token $(cat /state/forge-token)` for anything `tea` can't express. The `hive-forge` CLI helper wraps common operations: `view`, `issue`, `pr`, `comment`, `assign`, `close`, `labels`, `pr-reviews`, `branches`, `tree-sha`, `diff`, `notifications`, `notif-read`, `subscription`, `attach-issue`, `attach-comment`. Key: `diff <pr>` prints unified diff; `notifications [--unread]` lists notifications as JSON; `notif-read <id>` marks one read; `subscription [--watch|--ignore|--unwatch] [repo]` manages repo watch state.
|
**Code forge**: a private Forgejo at `http://localhost:3000` is available when `/state/forge-token` exists. You have your own user (`hm1nd`) and so does every sub-agent (one per name). The `tea` CLI is pre-configured at boot. Use it for code work that should survive a turn — a proposed refactor across sub-agents, scratch repos, PRs you want a sub-agent or the operator to review (`tea pulls create --base main --head <branch>`, `tea pulls list`, `tea issues create`). REST API at `http://localhost:3000/api/v1/` with `Authorization: token $(cat /state/forge-token)` for anything `tea` can't express. The `hive-forge` CLI helper wraps common operations: `view`, `issue`, `pr`, `comment`, `assign`, `close`, `labels`, `pr-reviews`, `branches`, `tree-sha`, `diff`, `subscription`, `attach-issue`, `attach-comment`. Key: `diff <pr>` prints unified diff; `subscription [--watch|--ignore|--unwatch] [repo]` manages repo watch state. Forge notifications are delivered via the internal message daemon.
|
||||||
|
|
||||||
A one-line headline + the file path beats a wall-of-text every time — it survives context compaction and the operator can read it in their own time.
|
A one-line headline + the file path beats a wall-of-text every time — it survives context compaction and the operator can read it in their own time.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -258,36 +258,6 @@ pkgs.writeShellApplication {
|
||||||
"$FORGE_API/repos/$_repo/pulls/$_n.diff"
|
"$FORGE_API/repos/$_repo/pulls/$_n.diff"
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_notifications() {
|
|
||||||
# notifications [--unread] [--limit N]
|
|
||||||
# List notifications. Without --unread, returns all (read + unread).
|
|
||||||
local _unread="" _limit="50"
|
|
||||||
while [ $# -gt 0 ]; do
|
|
||||||
case "$1" in
|
|
||||||
--unread) _unread="true"; shift ;;
|
|
||||||
--limit) _limit="$2"; shift 2 ;;
|
|
||||||
*) break ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
local _url="$FORGE_API/notifications?limit=$_limit"
|
|
||||||
if [ -z "$_unread" ]; then _url="''${_url}&all=true"; fi
|
|
||||||
forge_get "$_url" \
|
|
||||||
| jq '[.[] | {id,unread,reason,updated_at,
|
|
||||||
subject:{title:.subject.title,type:.subject.type,state:.subject.state},
|
|
||||||
repo:.repository.full_name}]'
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd_notif_read() {
|
|
||||||
# notif-read <id>
|
|
||||||
# Mark a notification thread as read.
|
|
||||||
if [ $# -lt 1 ]; then echo "usage: hive-forge notif-read <id>" >&2; exit 1; fi
|
|
||||||
${pkgs.curl}/bin/curl -sf -X PATCH \
|
|
||||||
-H "Authorization: token $_token" \
|
|
||||||
-H "Accept: application/json" \
|
|
||||||
"$FORGE_API/notifications/threads/$1" > /dev/null
|
|
||||||
echo "ok"
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd_subscription() {
|
cmd_subscription() {
|
||||||
# subscription [--watch|--ignore|--unwatch] [repo]
|
# subscription [--watch|--ignore|--unwatch] [repo]
|
||||||
# Get or set the current user's watch subscription for a repo.
|
# Get or set the current user's watch subscription for a repo.
|
||||||
|
|
@ -321,7 +291,7 @@ pkgs.writeShellApplication {
|
||||||
if [ -z "$VERB" ]; then
|
if [ -z "$VERB" ]; then
|
||||||
echo "usage: hive-forge <verb> [args...]" >&2
|
echo "usage: hive-forge <verb> [args...]" >&2
|
||||||
echo "verbs: view, issue, pr, comment, assign, close, labels, pr-reviews," >&2
|
echo "verbs: view, issue, pr, comment, assign, close, labels, pr-reviews," >&2
|
||||||
echo " branches, tree-sha, diff, notifications, notif-read, subscription," >&2
|
echo " branches, tree-sha, diff, subscription," >&2
|
||||||
echo " attach-issue, attach-comment" >&2
|
echo " attach-issue, attach-comment" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -339,15 +309,13 @@ pkgs.writeShellApplication {
|
||||||
branches) cmd_branches "$@" ;;
|
branches) cmd_branches "$@" ;;
|
||||||
tree-sha) cmd_tree_sha "$@" ;;
|
tree-sha) cmd_tree_sha "$@" ;;
|
||||||
diff) cmd_diff "$@" ;;
|
diff) cmd_diff "$@" ;;
|
||||||
notifications) cmd_notifications "$@" ;;
|
|
||||||
notif-read) cmd_notif_read "$@" ;;
|
|
||||||
subscription) cmd_subscription "$@" ;;
|
subscription) cmd_subscription "$@" ;;
|
||||||
attach-issue) cmd_attach_issue "$@" ;;
|
attach-issue) cmd_attach_issue "$@" ;;
|
||||||
attach-comment) cmd_attach_comment "$@" ;;
|
attach-comment) cmd_attach_comment "$@" ;;
|
||||||
*)
|
*)
|
||||||
echo "hive-forge: unknown verb '$VERB'" >&2
|
echo "hive-forge: unknown verb '$VERB'" >&2
|
||||||
echo "verbs: view, issue, pr, comment, assign, close, labels, pr-reviews," >&2
|
echo "verbs: view, issue, pr, comment, assign, close, labels, pr-reviews," >&2
|
||||||
echo " branches, tree-sha, diff, notifications, notif-read, subscription," >&2
|
echo " branches, tree-sha, diff, subscription," >&2
|
||||||
echo " attach-issue, attach-comment" >&2
|
echo " attach-issue, attach-comment" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue