@riligar/agents-kit 1.3.0 → 1.4.0

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 (3) hide show
  1. package/README.md +3 -3
  2. package/bin/cli.js +19 -18
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -31,9 +31,9 @@ bunx @riligar/agents-kit init
31
31
 
32
32
  ### What happens behind the scenes?
33
33
 
34
- 1. Copies the `.agent` directory (containing all rules and skills) to your project root.
35
- 2. Automatically updates your `.gitignore` to prevent committing agent configurations.
36
- 3. Sets up your environment for AI Agent interaction without poluting your `node_modules`.
34
+ 1. Syncs the `.agent` directory (containing all rules and skills) to your project root, adding new resources without overwriting your existing ones.
35
+ 2. Automatically updates your `.gitignore` to ensure `.agent` is ignored.
36
+ 3. Sets up your environment for AI Agent interaction without polluting your `node_modules`.
37
37
 
38
38
  ## Development & Releases
39
39
 
package/bin/cli.js CHANGED
@@ -13,24 +13,25 @@ async function init() {
13
13
  process.exit(1)
14
14
  }
15
15
 
16
- if (fs.existsSync(target)) {
17
- console.log('.agent directory already exists in the destination. Skipping copy.')
18
- } else {
19
- console.log('Copying .agent directory to your project...')
20
- try {
21
- if (fs.cpSync) {
22
- fs.cpSync(source, target, {
23
- recursive: true,
24
- filter: src => !src.includes('.DS_Store'),
25
- })
26
- } else {
27
- execSync(`cp -r "${source}" "${target}"`)
28
- }
29
- console.log('Successfully installed .agent directory!')
30
- } catch (error) {
31
- console.error('Failed to copy .agent directory:', error.message)
32
- process.exit(1)
33
- }
16
+ console.log('Syncing .agent directory to your project...')
17
+
18
+ const merge = (src, dest) => {
19
+ if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true })
20
+ fs.readdirSync(src).forEach(item => {
21
+ if (item === '.DS_Store') return
22
+ const s = path.join(src, item),
23
+ d = path.join(dest, item)
24
+ if (fs.statSync(s).isDirectory()) merge(s, d)
25
+ else if (!fs.existsSync(d)) fs.copyFileSync(s, d)
26
+ })
27
+ }
28
+
29
+ try {
30
+ merge(source, target)
31
+ console.log('Successfully installed/updated .agent directory!')
32
+ } catch (error) {
33
+ console.error('Failed to copy .agent directory:', error.message)
34
+ process.exit(1)
34
35
  }
35
36
 
36
37
  // Manage .gitignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riligar/agents-kit",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },