@geravant/sinain 1.6.9 → 1.7.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geravant/sinain",
3
- "version": "1.6.9",
3
+ "version": "1.7.0",
4
4
  "description": "Ambient intelligence that sees what you see, hears what you hear, and acts on your behalf",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,3 +15,9 @@ SINAIN_HEARTBEAT_INTERVAL=900 # seconds between heartbeat ticks (15 min)
15
15
 
16
16
  # ── Workspace ──
17
17
  SINAIN_WORKSPACE=~/.openclaw/workspace # knowledge files, curation scripts, playbook
18
+
19
+ # ── Tool permissions (Claude only) ──
20
+ # Tools auto-approved without prompting (space-separated).
21
+ # Default: auto-derived from MCP config server names (e.g. mcp__sinain).
22
+ # Format: mcp__<server> (all tools) | mcp__<server>__<tool> (specific) | Bash(pattern)
23
+ # SINAIN_ALLOWED_TOOLS=mcp__sinain mcp__github Bash(git *)
@@ -29,6 +29,21 @@ HEARTBEAT_INTERVAL="${SINAIN_HEARTBEAT_INTERVAL:-900}" # 15 minutes
29
29
  AGENT="${SINAIN_AGENT:-claude}"
30
30
  WORKSPACE="${SINAIN_WORKSPACE:-$HOME/.openclaw/workspace}"
31
31
 
32
+ # Build allowed tools list for Claude's --allowedTools flag.
33
+ # SINAIN_ALLOWED_TOOLS in .env overrides; otherwise auto-derive from MCP config.
34
+ if [ -n "${SINAIN_ALLOWED_TOOLS:-}" ]; then
35
+ ALLOWED_TOOLS="$SINAIN_ALLOWED_TOOLS"
36
+ elif [ -f "$MCP_CONFIG" ]; then
37
+ ALLOWED_TOOLS=$(python3 -c "
38
+ import json
39
+ with open('$MCP_CONFIG') as f:
40
+ cfg = json.load(f)
41
+ print(' '.join('mcp__' + s for s in cfg.get('mcpServers', {})))
42
+ " 2>/dev/null || echo "mcp__sinain")
43
+ else
44
+ ALLOWED_TOOLS="mcp__sinain"
45
+ fi
46
+
32
47
  # --- Agent profiles ---
33
48
 
34
49
  # Returns 0 if the selected agent supports MCP tools natively.
@@ -51,6 +66,7 @@ invoke_agent() {
51
66
  claude)
52
67
  claude --enable-auto-mode \
53
68
  --mcp-config "$MCP_CONFIG" \
69
+ ${ALLOWED_TOOLS:+--allowedTools $ALLOWED_TOOLS} \
54
70
  --max-turns 5 --output-format text \
55
71
  -p "$prompt"
56
72
  ;;
@@ -169,6 +185,7 @@ fi
169
185
  echo "sinain bare agent started"
170
186
  echo " Agent: $AGENT ($AGENT_MODE)"
171
187
  echo " Core: $CORE_URL"
188
+ echo " Allowed: ${ALLOWED_TOOLS:-<none>}"
172
189
  echo " Poll: every ${POLL_INTERVAL}s"
173
190
  echo " Heartbeat: every ${HEARTBEAT_INTERVAL}s"
174
191
  echo " Press Ctrl+C to stop"