openhermes 1.5.1 → 1.5.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/autorecall.mjs CHANGED
@@ -80,16 +80,16 @@ async function loadMemoryAndWriteCache(projectKey, directory) {
80
80
  const SENTINEL = path.join(getDataRoot(), ".migrated-from-v1")
81
81
  if (!fs.existsSync(SENTINEL)) {
82
82
  const oldMemory = path.join(OLD_BASE, "memory")
83
+ const oldCache = path.join(oldMemory, "recall")
83
84
  if (fs.existsSync(oldMemory)) {
84
85
  fs.cpSync(oldMemory, getMemoryRoot(), { recursive: true })
86
+ if (fs.existsSync(oldCache)) {
87
+ fs.mkdirSync(getRecallRoot(), { recursive: true })
88
+ const files = fs.readdirSync(oldCache).filter(f => f.endsWith(".json"))
89
+ for (const f of files) fs.cpSync(path.join(oldCache, f), path.join(getRecallRoot(), f))
90
+ }
85
91
  fs.rmSync(oldMemory, { recursive: true, force: true })
86
92
  }
87
- const oldCache = path.join(OLD_BASE, "memory", "recall")
88
- if (fs.existsSync(oldCache)) {
89
- fs.mkdirSync(getRecallRoot(), { recursive: true })
90
- const files = fs.readdirSync(oldCache).filter(f => f.endsWith(".json"))
91
- for (const f of files) fs.cpSync(path.join(oldCache, f), path.join(getRecallRoot(), f))
92
- }
93
93
  const oldRuntime = path.join(OLD_BASE, "runtime")
94
94
  if (fs.existsSync(oldRuntime)) {
95
95
  fs.cpSync(oldRuntime, getRuntimeRoot(), { recursive: true })
@@ -99,6 +99,7 @@ async function loadMemoryAndWriteCache(projectKey, directory) {
99
99
  if (fs.existsSync(oldArchive)) {
100
100
  fs.rmSync(oldArchive, { recursive: true, force: true })
101
101
  }
102
+ fs.mkdirSync(path.dirname(SENTINEL), { recursive: true })
102
103
  fs.writeFileSync(SENTINEL, new Date().toISOString(), "utf8")
103
104
  }
104
105
 
package/curator.mjs CHANGED
@@ -393,33 +393,44 @@ async function handlePermissionReplied(directory, project, event) {
393
393
  }
394
394
  }
395
395
 
396
- export const CuratorPlugin = async ({ project, directory }) => {
397
- return {
398
- event: async ({ event }) => {
399
- const OLD_BASE = path.join(os.homedir(), ".config", "opencode", "openhermes")
400
- const SENTINEL = path.join(getDataRoot(), ".migrated-from-v1")
401
- if (!fs.existsSync(SENTINEL)) {
402
- const oldMemory = path.join(OLD_BASE, "memory")
403
- if (fs.existsSync(oldMemory)) {
404
- fs.cpSync(oldMemory, getMemoryRoot(), { recursive: true })
405
- fs.rmSync(oldMemory, { recursive: true, force: true })
406
- }
407
- const oldRuntime = path.join(OLD_BASE, "runtime")
408
- if (fs.existsSync(oldRuntime)) {
409
- fs.cpSync(oldRuntime, getRuntimeRoot(), { recursive: true })
396
+ export const CuratorPlugin = async ({ project, directory }) => {
397
+ return {
398
+ event: async ({ event }) => {
399
+ const OLD_BASE = path.join(os.homedir(), ".config", "opencode", "openhermes")
400
+ const SENTINEL = path.join(getDataRoot(), ".migrated-from-v1")
401
+ if (!fs.existsSync(SENTINEL)) {
402
+ const oldMemory = path.join(OLD_BASE, "memory")
403
+ const oldCache = path.join(oldMemory, "recall")
404
+ if (fs.existsSync(oldMemory)) {
405
+ fs.cpSync(oldMemory, getMemoryRoot(), { recursive: true })
406
+ if (fs.existsSync(oldCache)) {
407
+ fs.mkdirSync(getRecallRoot(), { recursive: true })
408
+ const files = fs.readdirSync(oldCache).filter(f => f.endsWith(".json"))
409
+ for (const f of files) fs.cpSync(path.join(oldCache, f), path.join(getRecallRoot(), f))
410
+ }
411
+ fs.rmSync(oldMemory, { recursive: true, force: true })
412
+ }
413
+ const oldRuntime = path.join(OLD_BASE, "runtime")
414
+ if (fs.existsSync(oldRuntime)) {
415
+ fs.cpSync(oldRuntime, getRuntimeRoot(), { recursive: true })
410
416
  fs.rmSync(oldRuntime, { recursive: true, force: true })
411
417
  }
412
418
  const oldArchive = path.join(OLD_BASE, "archive")
413
- if (fs.existsSync(oldArchive)) {
414
- fs.rmSync(oldArchive, { recursive: true, force: true })
415
- }
416
- fs.writeFileSync(SENTINEL, new Date().toISOString(), "utf8")
417
- }
418
- if (event.type === "session.idle") {
419
- await handleSessionIdle(directory, project)
420
- } else if (event.type === "session.compacted") {
421
- await handleSessionCompacted(directory, project)
422
- } else if (event.type === "session.error") {
419
+ if (fs.existsSync(oldArchive)) {
420
+ fs.rmSync(oldArchive, { recursive: true, force: true })
421
+ }
422
+ fs.mkdirSync(path.dirname(SENTINEL), { recursive: true })
423
+ fs.writeFileSync(SENTINEL, new Date().toISOString(), "utf8")
424
+ }
425
+ if (event.type === "session.created") {
426
+ lastCheckpoint.ts = 0
427
+ writtenThisSession.length = 0
428
+ }
429
+ if (event.type === "session.idle") {
430
+ await handleSessionIdle(directory, project)
431
+ } else if (event.type === "session.compacted") {
432
+ await handleSessionCompacted(directory, project)
433
+ } else if (event.type === "session.error") {
423
434
  await handleSessionError(directory, project, event)
424
435
  } else if (event.type === "permission.replied") {
425
436
  await handlePermissionReplied(directory, project, event)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openhermes",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "OpenHermes plugin suite for OpenCode — autonomous checkpointing, native memory tools, subagent routing, slash commands, and skill-candidate detection.",
5
5
  "type": "module",
6
6
  "license": "MIT",