opencode-mastra-om 0.1.11 → 0.1.12
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/dist/index.js +12 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -179934,8 +179934,10 @@ var MastraPlugin = async (ctx) => {
|
|
|
179934
179934
|
};
|
|
179935
179935
|
return {
|
|
179936
179936
|
event: async ({ event }) => {
|
|
179937
|
+
omLog(`[event] received event type=${event.type}`);
|
|
179937
179938
|
if (event.type === "session.created") {
|
|
179938
179939
|
const sessionId = event.properties.info.id;
|
|
179940
|
+
omLog(`[session] creating record for ${sessionId}`);
|
|
179939
179941
|
try {
|
|
179940
179942
|
await om.getOrCreateRecord(sessionId);
|
|
179941
179943
|
omLog(`[session] initialized record for ${sessionId}`);
|
|
@@ -179985,11 +179987,16 @@ var MastraPlugin = async (ctx) => {
|
|
|
179985
179987
|
}
|
|
179986
179988
|
},
|
|
179987
179989
|
"experimental.chat.system.transform": async (input, output) => {
|
|
179990
|
+
omLog(`[system.transform] called, sessionID=${input.sessionID}`);
|
|
179988
179991
|
const sessionId = input.sessionID;
|
|
179989
|
-
if (!sessionId)
|
|
179992
|
+
if (!sessionId) {
|
|
179993
|
+
omLog(`[system.transform] no sessionId, skipping`);
|
|
179990
179994
|
return;
|
|
179995
|
+
}
|
|
179991
179996
|
try {
|
|
179997
|
+
omLog(`[system.transform] getting observations`);
|
|
179992
179998
|
const observations = await om.getObservations(sessionId);
|
|
179999
|
+
omLog(`[system.transform] got observations, length=${observations?.length ?? 0}`);
|
|
179993
180000
|
if (!observations)
|
|
179994
180001
|
return;
|
|
179995
180002
|
const optimized = optimizeObservationsForContext(observations);
|
|
@@ -180002,7 +180009,10 @@ ${optimized}
|
|
|
180002
180009
|
${OBSERVATION_CONTEXT_INSTRUCTIONS}
|
|
180003
180010
|
|
|
180004
180011
|
${OBSERVATION_CONTINUATION_HINT}`);
|
|
180005
|
-
|
|
180012
|
+
omLog(`[system.transform] done`);
|
|
180013
|
+
} catch (err) {
|
|
180014
|
+
omLog(`[system.transform] error: ${err instanceof Error ? err.message : String(err)}`);
|
|
180015
|
+
}
|
|
180006
180016
|
},
|
|
180007
180017
|
tool: {
|
|
180008
180018
|
om_status: tool5({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "opencode-mastra-om",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Enhanced Mastra Observational Memory plugin for OpenCode — persistent cross-session memory with observation, reflection, and manual trigger tools",
|