@super-pocock-ai/suite 2.0.2 → 2.0.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.
- package/index.js +37 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync } from 'fs'
|
|
1
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync, statSync } from 'fs'
|
|
2
2
|
import { join, dirname } from 'path'
|
|
3
3
|
import { fileURLToPath } from 'url'
|
|
4
4
|
|
|
5
|
-
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
6
|
-
|
|
7
5
|
export const SuperPocockSuite = async ({ project, client, $, directory, worktree }) => {
|
|
8
6
|
const agentsDir = join(process.env.HOME, '.config', 'opencode', 'agents')
|
|
7
|
+
const skillsDir = join(process.env.HOME, '.config', 'opencode', 'skills')
|
|
9
8
|
|
|
10
9
|
if (!existsSync(agentsDir)) {
|
|
11
10
|
mkdirSync(agentsDir, { recursive: true })
|
|
12
11
|
}
|
|
12
|
+
if (!existsSync(skillsDir)) {
|
|
13
|
+
mkdirSync(skillsDir, { recursive: true })
|
|
14
|
+
}
|
|
13
15
|
|
|
14
|
-
const
|
|
16
|
+
const configDir = join(process.env.HOME, '.config', 'opencode', 'node_modules')
|
|
15
17
|
|
|
18
|
+
// Install compose agents
|
|
19
|
+
const composeAgentsDir = join(configDir, '@super-pocock-ai', 'compose-agents', 'agents')
|
|
16
20
|
if (existsSync(composeAgentsDir)) {
|
|
17
21
|
const files = readdirSync(composeAgentsDir)
|
|
18
22
|
for (const file of files) {
|
|
@@ -33,6 +37,35 @@ export const SuperPocockSuite = async ({ project, client, $, directory, worktree
|
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
|
|
40
|
+
// Install compose skills
|
|
41
|
+
const composeSkillsDir = join(configDir, '@super-pocock-ai', 'compose-workflow', 'skills', 'compose')
|
|
42
|
+
if (existsSync(composeSkillsDir)) {
|
|
43
|
+
const skillNames = readdirSync(composeSkillsDir)
|
|
44
|
+
for (const skillName of skillNames) {
|
|
45
|
+
const skillDir = join(composeSkillsDir, skillName)
|
|
46
|
+
if (statSync(skillDir).isDirectory()) {
|
|
47
|
+
const skillFile = join(skillDir, 'SKILL.md')
|
|
48
|
+
if (existsSync(skillFile)) {
|
|
49
|
+
const destDir = join(skillsDir, `compose-${skillName}`)
|
|
50
|
+
if (!existsSync(destDir)) {
|
|
51
|
+
mkdirSync(destDir, { recursive: true })
|
|
52
|
+
}
|
|
53
|
+
const destFile = join(destDir, 'SKILL.md')
|
|
54
|
+
if (!existsSync(destFile)) {
|
|
55
|
+
writeFileSync(destFile, readFileSync(skillFile, 'utf-8'))
|
|
56
|
+
await client.app.log({
|
|
57
|
+
body: {
|
|
58
|
+
service: 'super-pocock-suite',
|
|
59
|
+
level: 'info',
|
|
60
|
+
message: `Installed skill: compose-${skillName}`
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
36
69
|
return {
|
|
37
70
|
"session.created": async ({ event }) => {
|
|
38
71
|
await client.app.log({
|