@cortexkit/opencode-magic-context 0.7.0 → 0.7.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK3C,MAAM,WAAW,mBAAmB;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,MAAM,GACjB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAkBrD;AAED,6GAA6G;AAC7G,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,IAAiB,GAAG,OAAO,CAYpF;AAED,6GAA6G;AAC7G,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,EAAE,CA0C/D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAwB9E"}
1
+ {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK3C,MAAM,WAAW,mBAAmB;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,MAAM,GACjB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAkBrD;AAaD,6GAA6G;AAC7G,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,IAAiB,GAAG,OAAO,CAYpF;AAED,6GAA6G;AAC7G,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,EAAE,CAkD/D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAwB9E"}
package/dist/index.js CHANGED
@@ -25220,6 +25220,10 @@ function parseScheduleWindow(schedule) {
25220
25220
  const endMinutes = endHour * 60 + endMin;
25221
25221
  return { startMinutes, endMinutes };
25222
25222
  }
25223
+ function isDreamFromCurrentWindow(lastDreamAtMs, now) {
25224
+ const twelveHoursMs = 12 * 60 * 60 * 1000;
25225
+ return now.getTime() - lastDreamAtMs < twelveHoursMs;
25226
+ }
25223
25227
  function isInScheduleWindow(schedule, now = new Date) {
25224
25228
  const window = parseScheduleWindow(schedule);
25225
25229
  if (!window)
@@ -25237,10 +25241,14 @@ function findProjectsNeedingDream(db) {
25237
25241
  WHERE type = 'smart' AND status = 'pending' AND project_path IS NOT NULL
25238
25242
  ORDER BY project_path`).all();
25239
25243
  const projects = [];
25244
+ const now = new Date;
25240
25245
  for (const row of projectRows) {
25241
25246
  const lastDreamAtStr = getDreamState(db, `last_dream_at:${row.project_path}`);
25242
25247
  const fallbackStr = !lastDreamAtStr ? getDreamState(db, "last_dream_at") : null;
25243
25248
  const lastDreamAt = Number(lastDreamAtStr ?? fallbackStr ?? "0") || 0;
25249
+ if (lastDreamAt > 0 && isDreamFromCurrentWindow(lastDreamAt, now)) {
25250
+ continue;
25251
+ }
25244
25252
  const updatedMemories = db.query(`SELECT COUNT(*) as cnt FROM memories
25245
25253
  WHERE project_path = ? AND status = 'active' AND updated_at > ?`).get(row.project_path, lastDreamAt);
25246
25254
  const pendingSmartNotes = db.query(`SELECT COUNT(*) as cnt FROM notes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-magic-context",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",