@rlabs-inc/memory 0.5.3 → 0.5.9
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 +5 -0
- package/dist/index.js +5115 -41504
- package/dist/index.mjs +1425 -10549
- package/dist/server/index.js +3779 -12801
- package/dist/server/index.mjs +3474 -12498
- package/hooks/gemini/curation.ts +2 -1
- package/hooks/gemini/session-start.ts +6 -3
- package/hooks/gemini/user-prompt.ts +5 -7
- package/package.json +1 -1
- package/src/core/curator.ts +142 -448
- package/src/core/manager.ts +323 -546
- package/src/server/index.ts +6 -2
- package/src/utils/paths.ts +191 -0
package/hooks/gemini/curation.ts
CHANGED
|
@@ -55,9 +55,10 @@ async function main() {
|
|
|
55
55
|
const primer = result.context_text || ''
|
|
56
56
|
|
|
57
57
|
if (primer) {
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
// Log to stderr for visibility
|
|
59
|
+
console.error(`\x1b[36m[Memory] Injecting session primer (${primer.length} chars)\x1b[0m`)
|
|
60
|
+
|
|
61
|
+
// systemMessage IS supported for SessionStart
|
|
61
62
|
console.log(JSON.stringify({
|
|
62
63
|
systemMessage: primer,
|
|
63
64
|
hookSpecificOutput: {
|
|
@@ -65,6 +66,8 @@ async function main() {
|
|
|
65
66
|
additionalContext: primer
|
|
66
67
|
}
|
|
67
68
|
}))
|
|
69
|
+
} else {
|
|
70
|
+
console.log(JSON.stringify({}))
|
|
68
71
|
}
|
|
69
72
|
} catch (e) {
|
|
70
73
|
// Fail silently, but ensure we don't output invalid JSON if we crashed mid-stream
|
|
@@ -55,20 +55,18 @@ async function main() {
|
|
|
55
55
|
const context = result.context_text || ''
|
|
56
56
|
|
|
57
57
|
if (context) {
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
// Log to stderr for visibility (BeforeAgent doesn't support systemMessage)
|
|
59
|
+
console.error(`\x1b[36m[Memory] Injecting ${context.length} chars of context\x1b[0m`)
|
|
60
|
+
|
|
61
61
|
console.log(JSON.stringify({
|
|
62
|
-
decision: "allow",
|
|
63
|
-
systemMessage: context,
|
|
64
62
|
hookSpecificOutput: {
|
|
65
63
|
hookEventName: "BeforeAgent",
|
|
66
64
|
additionalContext: context
|
|
67
65
|
}
|
|
68
66
|
}))
|
|
69
67
|
} else {
|
|
70
|
-
// No memories to surface -
|
|
71
|
-
console.log(JSON.stringify({
|
|
68
|
+
// No memories to surface - output empty JSON (implicit allow)
|
|
69
|
+
console.log(JSON.stringify({}))
|
|
72
70
|
}
|
|
73
71
|
} catch {
|
|
74
72
|
// Fail safe
|