vibe-learning-opencode 0.2.2 → 0.2.4

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -209,12 +209,25 @@ var VibeLearningPlugin = (ctx) => {
209
209
  });
210
210
  };
211
211
  return {
212
- // Session created - show learning context immediately
213
- "session.created": async (input, _output) => {
214
- lastSessionID = input.sessionID;
215
- sessionContextShown.add(input.sessionID);
216
- try {
217
- const contextPrompt = `[VibeLearning - Session Start]
212
+ // Generic event handler for session events
213
+ event: async ({ event }) => {
214
+ if (event.type === "session.created") {
215
+ const sessionID = event.properties?.info?.id;
216
+ if (!sessionID)
217
+ return;
218
+ lastSessionID = sessionID;
219
+ sessionContextShown.add(sessionID);
220
+ try {
221
+ client.tui.showToast({
222
+ body: {
223
+ title: "\u{1F4DA} VibeLearning",
224
+ message: "Checking learning status...",
225
+ variant: "info",
226
+ duration: 2e3
227
+ }
228
+ }).catch(() => {
229
+ });
230
+ const contextPrompt = `[VibeLearning - Session Start]
218
231
 
219
232
  Execute NOW and show results to user:
220
233
  1. Call mcp__vibe-learning__get_unknown_unknowns with period="month", limit=5
@@ -226,19 +239,11 @@ Format as brief notification:
226
239
  \u2022 Y due for review
227
240
 
228
241
  If nothing to show, skip silently.`;
229
- injectPrompt(input.sessionID, contextPrompt);
230
- client.tui.showToast({
231
- body: {
232
- title: "\u{1F4DA} VibeLearning",
233
- message: "Checking learning status...",
234
- variant: "info",
235
- duration: 2e3
236
- }
237
- }).catch(() => {
238
- });
239
- } catch (err) {
240
- client.app.log({ level: "error", message: `[VibeLearning] Session start error: ${err}` }).catch(() => {
241
- });
242
+ injectPrompt(sessionID, contextPrompt);
243
+ } catch (err) {
244
+ client.app.log({ level: "error", message: `[VibeLearning] Session start error: ${err}` }).catch(() => {
245
+ });
246
+ }
242
247
  }
243
248
  },
244
249
  "tool.execute.after": async (input, output) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-learning-opencode",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "VibeLearning plugin for OpenCode - spaced repetition learning while coding",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",