@super-pocock-ai/suite 2.0.9 → 2.0.12

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/index.js +52 -1
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -3,7 +3,8 @@ import { join, dirname } from 'path'
3
3
  import { fileURLToPath } from 'url'
4
4
  import { execSync } from 'child_process'
5
5
 
6
- const SUITE_VERSION = '2.0.7'
6
+ const __dirname = dirname(fileURLToPath(import.meta.url))
7
+ const SUITE_VERSION = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf-8')).version
7
8
 
8
9
  export const SuperPocockSuite = async ({ project, client, $, directory, worktree }) => {
9
10
  const agentsDir = join(process.env.HOME, '.config', 'opencode', 'agents')
@@ -17,6 +18,53 @@ export const SuperPocockSuite = async ({ project, client, $, directory, worktree
17
18
  }
18
19
 
19
20
  const configDir = join(process.env.HOME, '.config', 'opencode', 'node_modules')
21
+ const cacheDir = join(process.env.HOME, '.cache', 'opencode', 'packages', '@super-pocock-ai', 'suite', 'node_modules', '@super-pocock-ai')
22
+
23
+ // Helper: copy directory recursively
24
+ const copyDir = (src, dest) => {
25
+ if (!existsSync(src)) return
26
+ mkdirSync(dest, { recursive: true })
27
+ for (const item of readdirSync(src)) {
28
+ const srcPath = join(src, item)
29
+ const destPath = join(dest, item)
30
+ if (statSync(srcPath).isDirectory()) {
31
+ copyDir(srcPath, destPath)
32
+ } else {
33
+ if (!existsSync(destPath) || readFileSync(srcPath, 'utf-8') !== readFileSync(destPath, 'utf-8')) {
34
+ writeFileSync(destPath, readFileSync(srcPath))
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ // Ensure dependencies are copied from cache to config
41
+ const ensureDependencies = async () => {
42
+ const packages = ['suite', 'compose-agents', 'compose-workflow', 'memory-agents', 'memory-core']
43
+ const targetDir = join(configDir, '@super-pocock-ai')
44
+
45
+ if (!existsSync(targetDir)) {
46
+ mkdirSync(targetDir, { recursive: true })
47
+ }
48
+
49
+ for (const pkg of packages) {
50
+ const destPkg = join(targetDir, pkg)
51
+ if (!existsSync(join(destPkg, 'package.json'))) {
52
+ const srcPkg = join(cacheDir, pkg)
53
+ if (existsSync(srcPkg)) {
54
+ copyDir(srcPkg, destPkg)
55
+ await client.app.log({
56
+ body: {
57
+ service: 'super-pocock-suite',
58
+ level: 'info',
59
+ message: `Restored dependency: ${pkg}`
60
+ }
61
+ })
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ await ensureDependencies()
20
68
 
21
69
  // Check and update packages if needed
22
70
  const checkAndUpdate = async () => {
@@ -47,6 +95,9 @@ export const SuperPocockSuite = async ({ project, client, $, directory, worktree
47
95
  message: 'Suite updated successfully'
48
96
  }
49
97
  })
98
+
99
+ // Re-ensure dependencies after update
100
+ await ensureDependencies()
50
101
  } catch (e) {
51
102
  await client.app.log({
52
103
  body: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-pocock-ai/suite",
3
- "version": "2.0.9",
3
+ "version": "2.0.12",
4
4
  "description": "Superpocock 完整套件,包含记忆系统和工作流",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -13,10 +13,10 @@
13
13
  "postinstall": "node postinstall.js"
14
14
  },
15
15
  "dependencies": {
16
- "@super-pocock-ai/memory-core": "2.0.9",
17
- "@super-pocock-ai/memory-agents": "2.0.9",
18
- "@super-pocock-ai/compose-workflow": "2.0.9",
19
- "@super-pocock-ai/compose-agents": "2.0.9"
16
+ "@super-pocock-ai/memory-core": "2.0.12",
17
+ "@super-pocock-ai/memory-agents": "2.0.12",
18
+ "@super-pocock-ai/compose-workflow": "2.0.12",
19
+ "@super-pocock-ai/compose-agents": "2.0.12"
20
20
  },
21
21
  "keywords": [
22
22
  "opencode",