@suwujs/codex-vault 0.4.1 → 0.4.2
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 +1 -1
- package/plugin/VERSION +1 -1
- package/plugin/hooks/classify-message.py +13 -5
- package/plugin/hooks/session-start.sh +7 -11
- package/plugin/hooks/validate-write.py +5 -1
- package/vault/.codex-vault/hooks/classify-message.py +13 -5
- package/vault/.codex-vault/hooks/session-start.sh +7 -11
- package/vault/.codex-vault/hooks/validate-write.py +5 -1
package/package.json
CHANGED
package/plugin/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.2
|
|
@@ -16,6 +16,7 @@ from pathlib import Path
|
|
|
16
16
|
SIGNALS = [
|
|
17
17
|
{
|
|
18
18
|
"name": "DECISION",
|
|
19
|
+
"skill": "/dump",
|
|
19
20
|
"message": "DECISION detected — suggest the user run /dump to capture this decision",
|
|
20
21
|
"auto_message": "DECISION detected — execute /dump now to capture this decision from the user's message",
|
|
21
22
|
"patterns": [
|
|
@@ -25,6 +26,7 @@ SIGNALS = [
|
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
"name": "WIN",
|
|
29
|
+
"skill": "/dump",
|
|
28
30
|
"message": "WIN detected — suggest the user run /dump to record this achievement",
|
|
29
31
|
"auto_message": "WIN detected — execute /dump now to record this achievement from the user's message",
|
|
30
32
|
"patterns": [
|
|
@@ -34,6 +36,7 @@ SIGNALS = [
|
|
|
34
36
|
},
|
|
35
37
|
{
|
|
36
38
|
"name": "PROJECT UPDATE",
|
|
39
|
+
"skill": "/dump",
|
|
37
40
|
"message": "PROJECT UPDATE detected — suggest the user run /dump to log this progress",
|
|
38
41
|
"auto_message": "PROJECT UPDATE detected — execute /dump now to log this progress from the user's message",
|
|
39
42
|
"patterns": [
|
|
@@ -46,6 +49,7 @@ SIGNALS = [
|
|
|
46
49
|
},
|
|
47
50
|
{
|
|
48
51
|
"name": "QUERY",
|
|
52
|
+
"skill": "/recall",
|
|
49
53
|
"message": "QUERY detected — suggest the user run /recall to check existing knowledge first",
|
|
50
54
|
"auto_message": "QUERY detected — execute /recall now to search vault for relevant information before answering",
|
|
51
55
|
"patterns": [
|
|
@@ -56,6 +60,7 @@ SIGNALS = [
|
|
|
56
60
|
},
|
|
57
61
|
{
|
|
58
62
|
"name": "INGEST",
|
|
63
|
+
"skill": "/ingest",
|
|
59
64
|
"message": "INGEST detected — suggest the user run /ingest to process the source",
|
|
60
65
|
"auto_message": "INGEST detected — execute /ingest now to process the source from the user's message",
|
|
61
66
|
"patterns": [
|
|
@@ -278,13 +283,16 @@ def main():
|
|
|
278
283
|
sys.stdout.flush()
|
|
279
284
|
|
|
280
285
|
# Visible feedback to user terminal (stderr)
|
|
281
|
-
|
|
286
|
+
matched = [s for s in SIGNALS if _match(s["patterns"], prompt.lower())]
|
|
287
|
+
parts = []
|
|
288
|
+
for s in matched:
|
|
289
|
+
parts.append(f"{s['name']} → {s['skill']}")
|
|
282
290
|
if is_session_end(prompt):
|
|
283
|
-
|
|
284
|
-
if
|
|
285
|
-
label = "
|
|
291
|
+
parts.append("SESSION END → /wrap-up")
|
|
292
|
+
if parts:
|
|
293
|
+
label = ", ".join(parts)
|
|
286
294
|
icon = "🔄" if mode == "auto" else "💡"
|
|
287
|
-
print(f" {icon} vault: {label}
|
|
295
|
+
print(f" {icon} vault: {label}", file=sys.stderr)
|
|
288
296
|
|
|
289
297
|
sys.exit(0)
|
|
290
298
|
|
|
@@ -23,31 +23,27 @@ fi
|
|
|
23
23
|
# --- Visible banner (stderr → user terminal) ---
|
|
24
24
|
{
|
|
25
25
|
echo ""
|
|
26
|
-
echo "
|
|
27
|
-
echo " │ 📚 Codex-Vault · Session Context │"
|
|
28
|
-
echo " ├─────────────────────────────────────┤"
|
|
26
|
+
echo " 📚 Codex-Vault · Session Loaded"
|
|
29
27
|
|
|
30
|
-
# North Star preview
|
|
28
|
+
# North Star preview
|
|
31
29
|
if [ -f "brain/North Star.md" ]; then
|
|
32
30
|
GOAL=$(sed -n '/^## Current Focus/,/^## /{/^- ./{s/^- //;p;q;};}' "brain/North Star.md" | cut -c1-40)
|
|
33
|
-
[ -n "$GOAL" ] && echo "
|
|
31
|
+
[ -n "$GOAL" ] && echo " 🎯 $GOAL" || echo " 🎯 (set goals in North Star.md)"
|
|
34
32
|
else
|
|
35
|
-
echo "
|
|
33
|
+
echo " 🎯 (create brain/North Star.md)"
|
|
36
34
|
fi
|
|
37
35
|
|
|
38
36
|
# Active work count
|
|
39
37
|
WORK_COUNT=$(find work/active -name "*.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
40
|
-
echo "
|
|
38
|
+
echo " 📋 $WORK_COUNT active project(s)"
|
|
41
39
|
|
|
42
40
|
# Uncommitted changes count
|
|
43
41
|
CHANGE_COUNT=$(git status --short -- . 2>/dev/null | wc -l | tr -d ' ')
|
|
44
42
|
if [ "$CHANGE_COUNT" -gt 0 ]; then
|
|
45
|
-
echo "
|
|
43
|
+
echo " ✏️ $CHANGE_COUNT uncommitted change(s)"
|
|
46
44
|
else
|
|
47
|
-
echo "
|
|
45
|
+
echo " ✅ working tree clean"
|
|
48
46
|
fi
|
|
49
|
-
|
|
50
|
-
echo " ╰─────────────────────────────────────╯"
|
|
51
47
|
echo ""
|
|
52
48
|
} >&2
|
|
53
49
|
|
|
@@ -105,7 +105,11 @@ def main():
|
|
|
105
105
|
|
|
106
106
|
# Visible feedback to user terminal (stderr)
|
|
107
107
|
count = len(warnings)
|
|
108
|
-
|
|
108
|
+
first = warnings[0]
|
|
109
|
+
if count == 1:
|
|
110
|
+
print(f" ⚠️ vault: {basename} — {first}", file=sys.stderr)
|
|
111
|
+
else:
|
|
112
|
+
print(f" ⚠️ vault: {basename} — {first} (+{count - 1} more)", file=sys.stderr)
|
|
109
113
|
|
|
110
114
|
sys.exit(0)
|
|
111
115
|
|
|
@@ -16,6 +16,7 @@ from pathlib import Path
|
|
|
16
16
|
SIGNALS = [
|
|
17
17
|
{
|
|
18
18
|
"name": "DECISION",
|
|
19
|
+
"skill": "/dump",
|
|
19
20
|
"message": "DECISION detected — suggest the user run /dump to capture this decision",
|
|
20
21
|
"auto_message": "DECISION detected — execute /dump now to capture this decision from the user's message",
|
|
21
22
|
"patterns": [
|
|
@@ -25,6 +26,7 @@ SIGNALS = [
|
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
"name": "WIN",
|
|
29
|
+
"skill": "/dump",
|
|
28
30
|
"message": "WIN detected — suggest the user run /dump to record this achievement",
|
|
29
31
|
"auto_message": "WIN detected — execute /dump now to record this achievement from the user's message",
|
|
30
32
|
"patterns": [
|
|
@@ -34,6 +36,7 @@ SIGNALS = [
|
|
|
34
36
|
},
|
|
35
37
|
{
|
|
36
38
|
"name": "PROJECT UPDATE",
|
|
39
|
+
"skill": "/dump",
|
|
37
40
|
"message": "PROJECT UPDATE detected — suggest the user run /dump to log this progress",
|
|
38
41
|
"auto_message": "PROJECT UPDATE detected — execute /dump now to log this progress from the user's message",
|
|
39
42
|
"patterns": [
|
|
@@ -46,6 +49,7 @@ SIGNALS = [
|
|
|
46
49
|
},
|
|
47
50
|
{
|
|
48
51
|
"name": "QUERY",
|
|
52
|
+
"skill": "/recall",
|
|
49
53
|
"message": "QUERY detected — suggest the user run /recall to check existing knowledge first",
|
|
50
54
|
"auto_message": "QUERY detected — execute /recall now to search vault for relevant information before answering",
|
|
51
55
|
"patterns": [
|
|
@@ -56,6 +60,7 @@ SIGNALS = [
|
|
|
56
60
|
},
|
|
57
61
|
{
|
|
58
62
|
"name": "INGEST",
|
|
63
|
+
"skill": "/ingest",
|
|
59
64
|
"message": "INGEST detected — suggest the user run /ingest to process the source",
|
|
60
65
|
"auto_message": "INGEST detected — execute /ingest now to process the source from the user's message",
|
|
61
66
|
"patterns": [
|
|
@@ -278,13 +283,16 @@ def main():
|
|
|
278
283
|
sys.stdout.flush()
|
|
279
284
|
|
|
280
285
|
# Visible feedback to user terminal (stderr)
|
|
281
|
-
|
|
286
|
+
matched = [s for s in SIGNALS if _match(s["patterns"], prompt.lower())]
|
|
287
|
+
parts = []
|
|
288
|
+
for s in matched:
|
|
289
|
+
parts.append(f"{s['name']} → {s['skill']}")
|
|
282
290
|
if is_session_end(prompt):
|
|
283
|
-
|
|
284
|
-
if
|
|
285
|
-
label = "
|
|
291
|
+
parts.append("SESSION END → /wrap-up")
|
|
292
|
+
if parts:
|
|
293
|
+
label = ", ".join(parts)
|
|
286
294
|
icon = "🔄" if mode == "auto" else "💡"
|
|
287
|
-
print(f" {icon} vault: {label}
|
|
295
|
+
print(f" {icon} vault: {label}", file=sys.stderr)
|
|
288
296
|
|
|
289
297
|
sys.exit(0)
|
|
290
298
|
|
|
@@ -23,31 +23,27 @@ fi
|
|
|
23
23
|
# --- Visible banner (stderr → user terminal) ---
|
|
24
24
|
{
|
|
25
25
|
echo ""
|
|
26
|
-
echo "
|
|
27
|
-
echo " │ 📚 Codex-Vault · Session Context │"
|
|
28
|
-
echo " ├─────────────────────────────────────┤"
|
|
26
|
+
echo " 📚 Codex-Vault · Session Loaded"
|
|
29
27
|
|
|
30
|
-
# North Star preview
|
|
28
|
+
# North Star preview
|
|
31
29
|
if [ -f "brain/North Star.md" ]; then
|
|
32
30
|
GOAL=$(sed -n '/^## Current Focus/,/^## /{/^- ./{s/^- //;p;q;};}' "brain/North Star.md" | cut -c1-40)
|
|
33
|
-
[ -n "$GOAL" ] && echo "
|
|
31
|
+
[ -n "$GOAL" ] && echo " 🎯 $GOAL" || echo " 🎯 (set goals in North Star.md)"
|
|
34
32
|
else
|
|
35
|
-
echo "
|
|
33
|
+
echo " 🎯 (create brain/North Star.md)"
|
|
36
34
|
fi
|
|
37
35
|
|
|
38
36
|
# Active work count
|
|
39
37
|
WORK_COUNT=$(find work/active -name "*.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
40
|
-
echo "
|
|
38
|
+
echo " 📋 $WORK_COUNT active project(s)"
|
|
41
39
|
|
|
42
40
|
# Uncommitted changes count
|
|
43
41
|
CHANGE_COUNT=$(git status --short -- . 2>/dev/null | wc -l | tr -d ' ')
|
|
44
42
|
if [ "$CHANGE_COUNT" -gt 0 ]; then
|
|
45
|
-
echo "
|
|
43
|
+
echo " ✏️ $CHANGE_COUNT uncommitted change(s)"
|
|
46
44
|
else
|
|
47
|
-
echo "
|
|
45
|
+
echo " ✅ working tree clean"
|
|
48
46
|
fi
|
|
49
|
-
|
|
50
|
-
echo " ╰─────────────────────────────────────╯"
|
|
51
47
|
echo ""
|
|
52
48
|
} >&2
|
|
53
49
|
|
|
@@ -105,7 +105,11 @@ def main():
|
|
|
105
105
|
|
|
106
106
|
# Visible feedback to user terminal (stderr)
|
|
107
107
|
count = len(warnings)
|
|
108
|
-
|
|
108
|
+
first = warnings[0]
|
|
109
|
+
if count == 1:
|
|
110
|
+
print(f" ⚠️ vault: {basename} — {first}", file=sys.stderr)
|
|
111
|
+
else:
|
|
112
|
+
print(f" ⚠️ vault: {basename} — {first} (+{count - 1} more)", file=sys.stderr)
|
|
109
113
|
|
|
110
114
|
sys.exit(0)
|
|
111
115
|
|