@saadnvd1/agent-os 0.3.551 → 0.3.553
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/app/api/approvals/hook/route.ts +34 -0
- package/app/api/approvals/route.ts +52 -0
- package/app/api/devices/network/route.ts +2 -2
- package/app/api/sessions/[id]/summarize/route.ts +2 -1
- package/app/page.tsx +11 -2
- package/app/pair/page.tsx +3 -2
- package/components/Approvals/NoApprovalsBadge.tsx +22 -0
- package/components/Chat/AccessPicker.tsx +13 -1
- package/components/SessionList/SidebarHeader.tsx +2 -0
- package/components/Settings/NoApprovalsSection.test.ts +115 -0
- package/components/Settings/NoApprovalsSection.tsx +103 -0
- package/components/Settings/SettingsDialog.test.ts +3 -0
- package/components/Settings/SettingsDialog.tsx +9 -0
- package/data/approvals/index.ts +56 -0
- package/lib/approvals/enable.ts +64 -0
- package/lib/approvals/no-approvals.ts +119 -0
- package/lib/chat/events.ts +2 -0
- package/lib/chat/settings.ts +17 -2
- package/lib/chat/worker/host.ts +49 -4
- package/lib/db/migrations.ts +18 -0
- package/lib/models/plan-step.ts +36 -7
- package/lib/orchestrator/asks.ts +42 -5
- package/lib/orchestrator/brakes.ts +11 -0
- package/lib/orchestrator/brief.ts +7 -1
- package/lib/orchestrator/merge-approvals.ts +10 -1
- package/lib/orchestrator/presence-binding.ts +3 -0
- package/lib/orchestrator/review.ts +12 -1
- package/lib/orchestrator/signoff.ts +15 -1
- package/lib/security/network-state.ts +2 -2
- package/lib/security/presence.ts +1 -0
- package/lib/settings-url.ts +1 -0
- package/package.json +1 -1
- package/scripts/claude-status-hook.sh +25 -1
|
@@ -82,6 +82,25 @@ EOF
|
|
|
82
82
|
case "$out" in '{"hookSpecificOutput"'*) printf '%s\n' "$out" ;; esac
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
# No approvals mode: AgentOS answers a permission request with Claude's own
|
|
86
|
+
# allow decision, and says nothing when the mode is off. Prints the decision
|
|
87
|
+
# and returns 0 only when it was given.
|
|
88
|
+
autoallow() {
|
|
89
|
+
where="${AGENTOS_URL:-http://127.0.0.1:3011}/api/approvals/hook?session=$AGENTOS_SESSION_ID"
|
|
90
|
+
auth=
|
|
91
|
+
[ -z "$AGENTOS_TOKEN" ] ||
|
|
92
|
+
auth="header = \"Authorization: Bearer $AGENTOS_TOKEN\""
|
|
93
|
+
out=$(printf '%s' "$input" | curl -s --max-time 2 -K /dev/fd/3 \
|
|
94
|
+
-H 'Content-Type: application/json' --data-binary @- "$where" 2>/dev/null 3<<EOF
|
|
95
|
+
$auth
|
|
96
|
+
EOF
|
|
97
|
+
)
|
|
98
|
+
case "$out" in
|
|
99
|
+
'{"hookSpecificOutput"'*) printf '%s\n' "$out"; return 0 ;;
|
|
100
|
+
esac
|
|
101
|
+
return 1
|
|
102
|
+
}
|
|
103
|
+
|
|
85
104
|
# Commands that take down every session on the machine, the agent's own
|
|
86
105
|
# included. Inside tmux, $TMUX names the real server and wins over
|
|
87
106
|
# TMUX_TMPDIR, so `tmux kill-server` there kills it; only an explicit -S or -L
|
|
@@ -126,7 +145,12 @@ case "$event" in
|
|
|
126
145
|
esac
|
|
127
146
|
;;
|
|
128
147
|
# Claude asks permission for its own questions too: still a question.
|
|
129
|
-
PermissionRequest)
|
|
148
|
+
PermissionRequest)
|
|
149
|
+
case "$(field tool_name)" in
|
|
150
|
+
AskUserQuestion) asking ;;
|
|
151
|
+
*) autoallow && report "state=working" || asking ;;
|
|
152
|
+
esac
|
|
153
|
+
;;
|
|
130
154
|
Notification)
|
|
131
155
|
message=$(field message)
|
|
132
156
|
# PermissionRequest already said which tool; older Claude Code versions
|