@super-pocock-ai/suite 2.0.3 → 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.
Files changed (2) hide show
  1. package/index.js +36 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,17 +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
5
  export const SuperPocockSuite = async ({ project, client, $, directory, worktree }) => {
6
6
  const agentsDir = join(process.env.HOME, '.config', 'opencode', 'agents')
7
+ const skillsDir = join(process.env.HOME, '.config', 'opencode', 'skills')
7
8
 
8
9
  if (!existsSync(agentsDir)) {
9
10
  mkdirSync(agentsDir, { recursive: true })
10
11
  }
12
+ if (!existsSync(skillsDir)) {
13
+ mkdirSync(skillsDir, { recursive: true })
14
+ }
11
15
 
12
16
  const configDir = join(process.env.HOME, '.config', 'opencode', 'node_modules')
13
- const composeAgentsDir = join(configDir, '@super-pocock-ai', 'compose-agents', 'agents')
14
17
 
18
+ // Install compose agents
19
+ const composeAgentsDir = join(configDir, '@super-pocock-ai', 'compose-agents', 'agents')
15
20
  if (existsSync(composeAgentsDir)) {
16
21
  const files = readdirSync(composeAgentsDir)
17
22
  for (const file of files) {
@@ -32,6 +37,35 @@ export const SuperPocockSuite = async ({ project, client, $, directory, worktree
32
37
  }
33
38
  }
34
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
+
35
69
  return {
36
70
  "session.created": async ({ event }) => {
37
71
  await client.app.log({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-pocock-ai/suite",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Superpocock 完整套件,包含记忆系统和工作流",
5
5
  "type": "module",
6
6
  "main": "index.js",