@mastra/opencode 0.0.2-alpha.0 → 0.0.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/CHANGELOG.md +43 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @mastra/opencode
|
|
2
2
|
|
|
3
|
+
## 0.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @mastra/opencode: Add opencode plugin for Observational Memory integration ([#12925](https://github.com/mastra-ai/mastra/pull/12925))
|
|
8
|
+
|
|
9
|
+
Added standalone `observe()` API that accepts external messages directly, so integrations can trigger observation without duplicating messages into Mastra's storage.
|
|
10
|
+
|
|
11
|
+
**New exports:**
|
|
12
|
+
- `ObserveHooks` — lifecycle callbacks (`onObservationStart`, `onObservationEnd`, `onReflectionStart`, `onReflectionEnd`) for hooking into observation/reflection cycles
|
|
13
|
+
- `OBSERVATION_CONTEXT_PROMPT` — preamble that introduces the observations block
|
|
14
|
+
- `OBSERVATION_CONTEXT_INSTRUCTIONS` — rules for interpreting observations (placed after the `<observations>` block)
|
|
15
|
+
- `OBSERVATION_CONTINUATION_HINT` — behavioral guidance that prevents models from awkwardly acknowledging the memory system
|
|
16
|
+
- `getOrCreateRecord()` — now public, allows eager record initialization before the first observation cycle
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { ObservationalMemory } from '@mastra/memory/processors';
|
|
20
|
+
|
|
21
|
+
const om = new ObservationalMemory({ storage, model: 'google/gemini-2.5-flash' });
|
|
22
|
+
|
|
23
|
+
// Eagerly initialize a record
|
|
24
|
+
await om.getOrCreateRecord(threadId);
|
|
25
|
+
|
|
26
|
+
// Pass messages directly with lifecycle hooks
|
|
27
|
+
await om.observe({
|
|
28
|
+
threadId,
|
|
29
|
+
messages: myMessages,
|
|
30
|
+
hooks: {
|
|
31
|
+
onObservationStart: () => console.log('Observing...'),
|
|
32
|
+
onObservationEnd: () => console.log('Done!'),
|
|
33
|
+
onReflectionStart: () => console.log('Reflecting...'),
|
|
34
|
+
onReflectionEnd: () => console.log('Reflected!'),
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Breaking:** `observe()` now takes an object param instead of positional args. Update calls from `observe(threadId, resourceId)` to `observe({ threadId, resourceId })`.
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [[`7ef618f`](https://github.com/mastra-ai/mastra/commit/7ef618f3c49c27e2f6b27d7f564c557c0734325b), [`b373564`](https://github.com/mastra-ai/mastra/commit/b37356491d43b4d53067f10cb669abaf2502f218), [`927c2af`](https://github.com/mastra-ai/mastra/commit/927c2af9792286c122e04409efce0f3c804f777f), [`927c2af`](https://github.com/mastra-ai/mastra/commit/927c2af9792286c122e04409efce0f3c804f777f), [`b896b41`](https://github.com/mastra-ai/mastra/commit/b896b41343de7fcc14442fb40fe82d189e65bbe2), [`6415277`](https://github.com/mastra-ai/mastra/commit/6415277a438faa00db2af850ead5dee25f40c428), [`191bc3a`](https://github.com/mastra-ai/mastra/commit/191bc3adfdbe4b262dbc93b7d9c3d6c6a3c8ef92), [`0831bbb`](https://github.com/mastra-ai/mastra/commit/0831bbb5bc750c18e9b22b45f18687c964b70828), [`74fb394`](https://github.com/mastra-ai/mastra/commit/74fb3944f51f55e1fc1ca65eede4254d8fe72aa3), [`63f7eda`](https://github.com/mastra-ai/mastra/commit/63f7eda605eb3e0c8c35ee3912ffe7c999c69f69), [`a5b67a3`](https://github.com/mastra-ai/mastra/commit/a5b67a3589a74415feb663a55d1858324a2afde9), [`877b02c`](https://github.com/mastra-ai/mastra/commit/877b02cdbb15e199184c7f2b8f217be8d3ebada7), [`cb8c38e`](https://github.com/mastra-ai/mastra/commit/cb8c38e6f855ad190383a7112ba95abef072d490), [`7567222`](https://github.com/mastra-ai/mastra/commit/7567222b1366f0d39980594792dd9d5060bfe2ab), [`af71458`](https://github.com/mastra-ai/mastra/commit/af71458e3b566f09c11d0e5a0a836dc818e7a24a), [`eb36bd8`](https://github.com/mastra-ai/mastra/commit/eb36bd8c52fcd6ec9674ac3b7a6412405b5983e1), [`3cbf121`](https://github.com/mastra-ai/mastra/commit/3cbf121f55418141924754a83102aade89835947)]:
|
|
42
|
+
- @mastra/core@1.4.0
|
|
43
|
+
- @mastra/libsql@1.4.0
|
|
44
|
+
- @mastra/memory@1.3.0
|
|
45
|
+
|
|
3
46
|
## 0.0.2-alpha.0
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/opencode",
|
|
3
|
-
"version": "0.0.2
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "OpenCode plugin for Mastra Observational Memory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"node": ">=22.13.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@mastra/memory": "1.3.0
|
|
46
|
-
"@mastra/core": "1.4.0
|
|
47
|
-
"@mastra/libsql": "1.4.0
|
|
45
|
+
"@mastra/memory": "1.3.0",
|
|
46
|
+
"@mastra/core": "1.4.0",
|
|
47
|
+
"@mastra/libsql": "1.4.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@opencode-ai/plugin": "*"
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"tsup": "^8.5.1",
|
|
56
56
|
"typescript": "^5.9.3",
|
|
57
57
|
"vitest": "4.0.16",
|
|
58
|
-
"@internal/
|
|
59
|
-
"@internal/
|
|
58
|
+
"@internal/lint": "0.0.59",
|
|
59
|
+
"@internal/types-builder": "0.0.34"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build:lib": "tsup --silent --config tsup.config.ts",
|