@super-pocock-ai/suite 2.0.12 → 2.0.13
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/index.js +56 -0
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -37,6 +37,62 @@ export const SuperPocockSuite = async ({ project, client, $, directory, worktree
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// Helper: remove directory recursively
|
|
41
|
+
const removeDir = (dir) => {
|
|
42
|
+
if (existsSync(dir)) {
|
|
43
|
+
for (const item of readdirSync(dir)) {
|
|
44
|
+
const itemPath = join(dir, item)
|
|
45
|
+
if (statSync(itemPath).isDirectory()) {
|
|
46
|
+
removeDir(itemPath)
|
|
47
|
+
} else {
|
|
48
|
+
require('fs').unlinkSync(itemPath)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
require('fs').rmdirSync(dir)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Check cache version and clear if outdated
|
|
56
|
+
const checkCacheVersion = async () => {
|
|
57
|
+
const cacheSuitePackageJson = join(cacheDir, 'suite', 'package.json')
|
|
58
|
+
if (existsSync(cacheSuitePackageJson)) {
|
|
59
|
+
const cached = JSON.parse(readFileSync(cacheSuitePackageJson, 'utf-8'))
|
|
60
|
+
if (cached.version !== SUITE_VERSION) {
|
|
61
|
+
await client.app.log({
|
|
62
|
+
body: {
|
|
63
|
+
service: 'super-pocock-suite',
|
|
64
|
+
level: 'info',
|
|
65
|
+
message: `Cache outdated (v${cached.version}), clearing...`
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
// Clear outdated cache
|
|
70
|
+
const cachePackagesDir = join(process.env.HOME, '.cache', 'opencode', 'packages', '@super-pocock-ai')
|
|
71
|
+
if (existsSync(cachePackagesDir)) {
|
|
72
|
+
removeDir(cachePackagesDir)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Clear config dependencies to force reinstall
|
|
76
|
+
const configPackagesDir = join(configDir, '@super-pocock-ai')
|
|
77
|
+
if (existsSync(configPackagesDir)) {
|
|
78
|
+
removeDir(configPackagesDir)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Trigger reinstall by running npm update
|
|
82
|
+
try {
|
|
83
|
+
execSync('npm update @super-pocock-ai/suite', {
|
|
84
|
+
cwd: join(process.env.HOME, '.config', 'opencode'),
|
|
85
|
+
stdio: 'pipe'
|
|
86
|
+
})
|
|
87
|
+
} catch (e) {
|
|
88
|
+
// Ignore errors, will be handled by checkAndUpdate
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
await checkCacheVersion()
|
|
95
|
+
|
|
40
96
|
// Ensure dependencies are copied from cache to config
|
|
41
97
|
const ensureDependencies = async () => {
|
|
42
98
|
const packages = ['suite', 'compose-agents', 'compose-workflow', 'memory-agents', 'memory-core']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@super-pocock-ai/suite",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
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.
|
|
17
|
-
"@super-pocock-ai/memory-agents": "2.0.
|
|
18
|
-
"@super-pocock-ai/compose-workflow": "2.0.
|
|
19
|
-
"@super-pocock-ai/compose-agents": "2.0.
|
|
16
|
+
"@super-pocock-ai/memory-core": "2.0.13",
|
|
17
|
+
"@super-pocock-ai/memory-agents": "2.0.13",
|
|
18
|
+
"@super-pocock-ai/compose-workflow": "2.0.13",
|
|
19
|
+
"@super-pocock-ai/compose-agents": "2.0.13"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"opencode",
|