0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/integrations/opencode/package.json

66 lines
1.6 KiB

feat(memory, opencode): add @mastra/opencode plugin and standalone observe() API (#12925) Adds `@mastra/opencode` — a plugin that brings Mastra Observational Memory into [OpenCode](https://opencode.ai) sessions. Also enhances the core `observe()` API to support external integrations. The plugin hooks into OpenCode's lifecycle to automatically observe conversations, inject compressed observations into the system prompt, and discard already-observed messages — keeping context lean as conversations grow. ```ts // .opencode/mastra.json { "model": "google/gemini-2.5-flash", "scope": "thread" } ``` ```ts // Standalone observe() with external messages and lifecycle hooks await om.observe({ threadId, messages: externalMessages, hooks: { onObservationStart: () => showToast('Observing...'), onObservationEnd: () => showToast('Done!'), }, }); ``` Core `@mastra/memory` changes: `observe()` now takes object params (breaking), accepts external messages without double-storing, includes threshold checks, and exports `OBSERVATION_CONTEXT_PROMPT` / `OBSERVATION_CONTINUATION_HINT` for reuse by integrations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * OpenCode plugin integration for Observational Memory with session wiring and status reporting * Standalone observe() API that accepts external messages and lifecycle hooks (onObservationStart/onObservationEnd/onReflectionStart/onReflectionEnd) * New public observation helpers and prompts for injecting observations and continuation hints * Progress/status tools and a memory observations command plus an example standalone observe script * **Breaking** * observe() signature changed to an object parameter: update calls to use { threadId, resourceId, messages, hooks } * **Tests** * Added test suite covering the standalone observe() API and hook behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com> Co-authored-by: Mastra Code <noreply@mastra.ai>
2026-02-11 14:20:05 -08:00
feat(memory, opencode): add @mastra/opencode plugin and standalone observe() API (#12925) Adds `@mastra/opencode` — a plugin that brings Mastra Observational Memory into [OpenCode](https://opencode.ai) sessions. Also enhances the core `observe()` API to support external integrations. The plugin hooks into OpenCode's lifecycle to automatically observe conversations, inject compressed observations into the system prompt, and discard already-observed messages — keeping context lean as conversations grow. ```ts // .opencode/mastra.json { "model": "google/gemini-2.5-flash", "scope": "thread" } ``` ```ts // Standalone observe() with external messages and lifecycle hooks await om.observe({ threadId, messages: externalMessages, hooks: { onObservationStart: () => showToast('Observing...'), onObservationEnd: () => showToast('Done!'), }, }); ``` Core `@mastra/memory` changes: `observe()` now takes object params (breaking), accepts external messages without double-storing, includes threshold checks, and exports `OBSERVATION_CONTEXT_PROMPT` / `OBSERVATION_CONTINUATION_HINT` for reuse by integrations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * OpenCode plugin integration for Observational Memory with session wiring and status reporting * Standalone observe() API that accepts external messages and lifecycle hooks (onObservationStart/onObservationEnd/onReflectionStart/onReflectionEnd) * New public observation helpers and prompts for injecting observations and continuation hints * Progress/status tools and a memory observations command plus an example standalone observe script * **Breaking** * observe() signature changed to an object parameter: update calls to use { threadId, resourceId, messages, hooks } * **Tests** * Added test suite covering the standalone observe() API and hook behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com> Co-authored-by: Mastra Code <noreply@mastra.ai>
2026-02-11 14:20:05 -08:00
feat(memory, opencode): add @mastra/opencode plugin and standalone observe() API (#12925) Adds `@mastra/opencode` — a plugin that brings Mastra Observational Memory into [OpenCode](https://opencode.ai) sessions. Also enhances the core `observe()` API to support external integrations. The plugin hooks into OpenCode's lifecycle to automatically observe conversations, inject compressed observations into the system prompt, and discard already-observed messages — keeping context lean as conversations grow. ```ts // .opencode/mastra.json { "model": "google/gemini-2.5-flash", "scope": "thread" } ``` ```ts // Standalone observe() with external messages and lifecycle hooks await om.observe({ threadId, messages: externalMessages, hooks: { onObservationStart: () => showToast('Observing...'), onObservationEnd: () => showToast('Done!'), }, }); ``` Core `@mastra/memory` changes: `observe()` now takes object params (breaking), accepts external messages without double-storing, includes threshold checks, and exports `OBSERVATION_CONTEXT_PROMPT` / `OBSERVATION_CONTINUATION_HINT` for reuse by integrations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * OpenCode plugin integration for Observational Memory with session wiring and status reporting * Standalone observe() API that accepts external messages and lifecycle hooks (onObservationStart/onObservationEnd/onReflectionStart/onReflectionEnd) * New public observation helpers and prompts for injecting observations and continuation hints * Progress/status tools and a memory observations command plus an example standalone observe script * **Breaking** * observe() signature changed to an object parameter: update calls to use { threadId, resourceId, messages, hooks } * **Tests** * Added test suite covering the standalone observe() API and hook behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com> Co-authored-by: Mastra Code <noreply@mastra.ai>
2026-02-11 14:20:05 -08:00
feat(memory, opencode): add @mastra/opencode plugin and standalone observe() API (#12925) Adds `@mastra/opencode` — a plugin that brings Mastra Observational Memory into [OpenCode](https://opencode.ai) sessions. Also enhances the core `observe()` API to support external integrations. The plugin hooks into OpenCode's lifecycle to automatically observe conversations, inject compressed observations into the system prompt, and discard already-observed messages — keeping context lean as conversations grow. ```ts // .opencode/mastra.json { "model": "google/gemini-2.5-flash", "scope": "thread" } ``` ```ts // Standalone observe() with external messages and lifecycle hooks await om.observe({ threadId, messages: externalMessages, hooks: { onObservationStart: () => showToast('Observing...'), onObservationEnd: () => showToast('Done!'), }, }); ``` Core `@mastra/memory` changes: `observe()` now takes object params (breaking), accepts external messages without double-storing, includes threshold checks, and exports `OBSERVATION_CONTEXT_PROMPT` / `OBSERVATION_CONTINUATION_HINT` for reuse by integrations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * OpenCode plugin integration for Observational Memory with session wiring and status reporting * Standalone observe() API that accepts external messages and lifecycle hooks (onObservationStart/onObservationEnd/onReflectionStart/onReflectionEnd) * New public observation helpers and prompts for injecting observations and continuation hints * Progress/status tools and a memory observations command plus an example standalone observe script * **Breaking** * observe() signature changed to an object parameter: update calls to use { threadId, resourceId, messages, hooks } * **Tests** * Added test suite covering the standalone observe() API and hook behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com> Co-authored-by: Mastra Code <noreply@mastra.ai>
2026-02-11 14:20:05 -08:00
feat(memory, opencode): add @mastra/opencode plugin and standalone observe() API (#12925) Adds `@mastra/opencode` — a plugin that brings Mastra Observational Memory into [OpenCode](https://opencode.ai) sessions. Also enhances the core `observe()` API to support external integrations. The plugin hooks into OpenCode's lifecycle to automatically observe conversations, inject compressed observations into the system prompt, and discard already-observed messages — keeping context lean as conversations grow. ```ts // .opencode/mastra.json { "model": "google/gemini-2.5-flash", "scope": "thread" } ``` ```ts // Standalone observe() with external messages and lifecycle hooks await om.observe({ threadId, messages: externalMessages, hooks: { onObservationStart: () => showToast('Observing...'), onObservationEnd: () => showToast('Done!'), }, }); ``` Core `@mastra/memory` changes: `observe()` now takes object params (breaking), accepts external messages without double-storing, includes threshold checks, and exports `OBSERVATION_CONTEXT_PROMPT` / `OBSERVATION_CONTINUATION_HINT` for reuse by integrations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * OpenCode plugin integration for Observational Memory with session wiring and status reporting * Standalone observe() API that accepts external messages and lifecycle hooks (onObservationStart/onObservationEnd/onReflectionStart/onReflectionEnd) * New public observation helpers and prompts for injecting observations and continuation hints * Progress/status tools and a memory observations command plus an example standalone observe script * **Breaking** * observe() signature changed to an object parameter: update calls to use { threadId, resourceId, messages, hooks } * **Tests** * Added test suite covering the standalone observe() API and hook behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com> Co-authored-by: Mastra Code <noreply@mastra.ai>
2026-02-11 14:20:05 -08:00
feat(memory, opencode): add @mastra/opencode plugin and standalone observe() API (#12925) Adds `@mastra/opencode` — a plugin that brings Mastra Observational Memory into [OpenCode](https://opencode.ai) sessions. Also enhances the core `observe()` API to support external integrations. The plugin hooks into OpenCode's lifecycle to automatically observe conversations, inject compressed observations into the system prompt, and discard already-observed messages — keeping context lean as conversations grow. ```ts // .opencode/mastra.json { "model": "google/gemini-2.5-flash", "scope": "thread" } ``` ```ts // Standalone observe() with external messages and lifecycle hooks await om.observe({ threadId, messages: externalMessages, hooks: { onObservationStart: () => showToast('Observing...'), onObservationEnd: () => showToast('Done!'), }, }); ``` Core `@mastra/memory` changes: `observe()` now takes object params (breaking), accepts external messages without double-storing, includes threshold checks, and exports `OBSERVATION_CONTEXT_PROMPT` / `OBSERVATION_CONTINUATION_HINT` for reuse by integrations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * OpenCode plugin integration for Observational Memory with session wiring and status reporting * Standalone observe() API that accepts external messages and lifecycle hooks (onObservationStart/onObservationEnd/onReflectionStart/onReflectionEnd) * New public observation helpers and prompts for injecting observations and continuation hints * Progress/status tools and a memory observations command plus an example standalone observe script * **Breaking** * observe() signature changed to an object parameter: update calls to use { threadId, resourceId, messages, hooks } * **Tests** * Added test suite covering the standalone observe() API and hook behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com> Co-authored-by: Mastra Code <noreply@mastra.ai>
2026-02-11 14:20:05 -08:00
fix: pin @opencode-ai/plugin to prevent pnpm trust downgrade (#19116) Renovate PR #19080 was failing because newer @opencode-ai/plugin versions pull in effect@4.0.0-beta.83, which pnpm 11 rejects under the workspace's trustPolicy: no-downgrade setting. This pins @opencode-ai/plugin to 1.14.48 (which resolves effect@4.0.0-beta.59, already trusted) and tells Renovate to skip plugin updates until upstream ships a version that doesn't trigger the trust downgrade. No new trust exceptions are added — the existing policy stays strict. ```diff - "@opencode-ai/plugin": "^1.2.27" + "@opencode-ai/plugin": "1.14.48" ``` The broader @opencode-ai/* Renovate group is untouched, so @opencode-ai/sdk and other OpenCode packages continue to get minor/patch updates normally. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This change keeps one tool version locked to a safe older release so updates don’t break the project’s security/trust checks. It also tells Renovate to stop trying to update that one package for now, while leaving other package updates alone. ## Summary - Pinned `@opencode-ai/plugin` in `integrations/opencode/package.json` to `1.14.48`. - Added a Renovate `packageRules` entry to disable updates for `@opencode-ai/plugin` until a compatible upstream release is available. - Left the workspace trust policy unchanged and did not add any new trust exceptions. - Regenerated the lockfile only to reflect the specifier change. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Mastra Code (alibaba-token-plan/glm-5.2) <noreply@mastra.ai>
2026-07-08 14:10:37 +02:00
feat(memory, opencode): add @mastra/opencode plugin and standalone observe() API (#12925) Adds `@mastra/opencode` — a plugin that brings Mastra Observational Memory into [OpenCode](https://opencode.ai) sessions. Also enhances the core `observe()` API to support external integrations. The plugin hooks into OpenCode's lifecycle to automatically observe conversations, inject compressed observations into the system prompt, and discard already-observed messages — keeping context lean as conversations grow. ```ts // .opencode/mastra.json { "model": "google/gemini-2.5-flash", "scope": "thread" } ``` ```ts // Standalone observe() with external messages and lifecycle hooks await om.observe({ threadId, messages: externalMessages, hooks: { onObservationStart: () => showToast('Observing...'), onObservationEnd: () => showToast('Done!'), }, }); ``` Core `@mastra/memory` changes: `observe()` now takes object params (breaking), accepts external messages without double-storing, includes threshold checks, and exports `OBSERVATION_CONTEXT_PROMPT` / `OBSERVATION_CONTINUATION_HINT` for reuse by integrations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * OpenCode plugin integration for Observational Memory with session wiring and status reporting * Standalone observe() API that accepts external messages and lifecycle hooks (onObservationStart/onObservationEnd/onReflectionStart/onReflectionEnd) * New public observation helpers and prompts for injecting observations and continuation hints * Progress/status tools and a memory observations command plus an example standalone observe script * **Breaking** * observe() signature changed to an object parameter: update calls to use { threadId, resourceId, messages, hooks } * **Tests** * Added test suite covering the standalone observe() API and hook behavior <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com> Co-authored-by: Mastra Code <noreply@mastra.ai>
2026-02-11 14:20:05 -08:00