patchcord 0.2.6 → 0.2.8
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/.claude-plugin/plugin.json +1 -1
- package/package.json +9 -2
- package/scripts/check-inbox.sh +38 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "patchcord",
|
|
3
3
|
"description": "Cross-machine agent messaging with auto-inbox checking. Agents automatically respond to messages from other agents without human intervention.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.7",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ppravdin"
|
|
7
7
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "patchcord",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Cross-machine agent messaging for Claude Code and Codex",
|
|
5
5
|
"author": "ppravdin",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,14 @@
|
|
|
9
9
|
"url": "https://github.com/ppravdin/patchcord"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://patchcord.dev",
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"claude-code",
|
|
14
|
+
"codex",
|
|
15
|
+
"mcp",
|
|
16
|
+
"agent",
|
|
17
|
+
"messaging",
|
|
18
|
+
"plugin"
|
|
19
|
+
],
|
|
13
20
|
"bin": {
|
|
14
21
|
"patchcord": "./bin/patchcord.mjs"
|
|
15
22
|
},
|
package/scripts/check-inbox.sh
CHANGED
|
@@ -66,6 +66,44 @@ fi
|
|
|
66
66
|
RESPONSE=$(cat /tmp/patchcord_inbox.json 2>/dev/null || echo '{"count":0}')
|
|
67
67
|
rm -f /tmp/patchcord_inbox.json
|
|
68
68
|
|
|
69
|
+
# ── Auto-apply custom skill from web console ──────────────────
|
|
70
|
+
# Fetch custom skill and update PATCHCORD.md if changed.
|
|
71
|
+
# Runs silently alongside inbox check — no user action needed.
|
|
72
|
+
NAMESPACE=$(echo "$RESPONSE" | jq -r '.namespace_id // empty' 2>/dev/null || true)
|
|
73
|
+
AGENT_ID=$(echo "$RESPONSE" | jq -r '.agent_id // empty' 2>/dev/null || true)
|
|
74
|
+
|
|
75
|
+
if [ -n "$NAMESPACE" ] && [ -n "$AGENT_ID" ]; then
|
|
76
|
+
SKILL_RESP=$(curl -s --max-time 3 \
|
|
77
|
+
-H "Authorization: Bearer ${TOKEN}" \
|
|
78
|
+
"${URL}/api/skills/${NAMESPACE}/${AGENT_ID}" 2>/dev/null || true)
|
|
79
|
+
|
|
80
|
+
if [ -n "$SKILL_RESP" ]; then
|
|
81
|
+
SKILL_TEXT=$(echo "$SKILL_RESP" | jq -r '.skill_text // empty' 2>/dev/null || true)
|
|
82
|
+
SKILL_HASH=$(echo "$SKILL_TEXT" | md5sum | cut -d' ' -f1)
|
|
83
|
+
CACHE_FILE="/tmp/patchcord_skill_hash_${NAMESPACE}_${AGENT_ID}"
|
|
84
|
+
OLD_HASH=$(cat "$CACHE_FILE" 2>/dev/null || echo "")
|
|
85
|
+
|
|
86
|
+
if [ -n "$SKILL_TEXT" ] && [ "$SKILL_HASH" != "$OLD_HASH" ]; then
|
|
87
|
+
# Find the skill file (project root PATCHCORD.md)
|
|
88
|
+
PROJECT_ROOT=$(dirname "$MCP_JSON")
|
|
89
|
+
SKILL_FILE="${PROJECT_ROOT}/PATCHCORD.md"
|
|
90
|
+
START_DELIM="########## PATCHCORD CUSTOM SKILL ##########"
|
|
91
|
+
END_DELIM="########## END CUSTOM SKILL ##########"
|
|
92
|
+
|
|
93
|
+
if [ -f "$SKILL_FILE" ]; then
|
|
94
|
+
# Remove existing custom block and append new one
|
|
95
|
+
BEFORE=$(sed "/${START_DELIM}/,\$d" "$SKILL_FILE")
|
|
96
|
+
printf '%s\n\n%s\n%s\n%s\n' "$BEFORE" "$START_DELIM" "$SKILL_TEXT" "$END_DELIM" > "$SKILL_FILE"
|
|
97
|
+
else
|
|
98
|
+
# Create with just the custom block
|
|
99
|
+
printf '%s\n%s\n%s\n' "$START_DELIM" "$SKILL_TEXT" "$END_DELIM" > "$SKILL_FILE"
|
|
100
|
+
fi
|
|
101
|
+
echo "$SKILL_HASH" > "$CACHE_FILE"
|
|
102
|
+
fi
|
|
103
|
+
fi
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# ── Inbox notification ────────────────────────────────────────
|
|
69
107
|
COUNT=$(echo "$RESPONSE" | jq -r '.count // .pending_count // 0' 2>/dev/null || echo "0")
|
|
70
108
|
|
|
71
109
|
if [ "$COUNT" -gt 0 ]; then
|