@ibgib/web-gib 0.0.25 → 0.0.26

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.
@@ -10,5 +10,5 @@
10
10
  /**
11
11
  * this is the version of this package, auto-updated in the build process
12
12
  */
13
- export declare const AUTO_GENERATED_VERSION = "0.0.25";
13
+ export declare const AUTO_GENERATED_VERSION = "0.0.26";
14
14
  //# sourceMappingURL=AUTO-GENERATED-version.d.mts.map
@@ -10,5 +10,5 @@
10
10
  /**
11
11
  * this is the version of this package, auto-updated in the build process
12
12
  */
13
- export const AUTO_GENERATED_VERSION = '0.0.25';
13
+ export const AUTO_GENERATED_VERSION = '0.0.26';
14
14
  //# sourceMappingURL=AUTO-GENERATED-version.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibgib/web-gib",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Framework for creating agentic ibGib web apps. Contains plumbing for ibgib components, agentic framework (currently only Gemini implemented), web-based IndexedDB storage substrate, and more.",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -11,4 +11,4 @@
11
11
  /**
12
12
  * this is the version of this package, auto-updated in the build process
13
13
  */
14
- export const AUTO_GENERATED_VERSION = '0.0.25';
14
+ export const AUTO_GENERATED_VERSION = '0.0.26';
@@ -25,29 +25,56 @@ console.log(`${logPref} Copying ibgib agent skills...`);
25
25
  console.log(`${logPref} From: ${sourceAgentsDir}`);
26
26
  console.log(`${logPref} To: ${targetAgentsDir}`);
27
27
 
28
- let shouldCopy = true;
28
+ const sourceSkillsDir = path.join(sourceAgentsDir, 'skills');
29
+ const targetSkillsDir = path.join(targetAgentsDir, 'skills');
29
30
 
30
- if (fs.existsSync(targetAgentsDir)) {
31
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
32
- const answer = await rl.question(`${logPref} Target directory ${targetAgentsDir} already exists. Overwrite contents? (y/N) `);
33
- rl.close();
34
-
35
- if (answer.toLowerCase() !== 'y') {
36
- shouldCopy = false;
37
- console.log(`${logPref} Aborted copying agent skills.`);
38
- }
31
+ if (!fs.existsSync(sourceSkillsDir)) {
32
+ console.error(`${logPref} Error: Source skills directory not found at ${sourceSkillsDir}`);
33
+ process.exit(1);
34
+ }
35
+
36
+ // Ensure the target skills directory exists
37
+ if (!fs.existsSync(targetSkillsDir)) {
38
+ fs.mkdirSync(targetSkillsDir, { recursive: true });
39
39
  }
40
40
 
41
- if (shouldCopy) {
42
- try {
43
- fs.cpSync(sourceAgentsDir, targetAgentsDir, {
44
- recursive: true,
45
- force: true, // Auto-overwrite if user accepted
46
- errorOnExist: false
47
- });
48
- console.log(`${logPref} Success! Agent skills have been initialized.`);
49
- } catch (error) {
50
- console.error(`${logPref} ❌ Failed to copy agent skills:`, error);
51
- process.exit(1);
41
+ const skillDirs = fs.readdirSync(sourceSkillsDir, { withFileTypes: true });
42
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
43
+
44
+ try {
45
+ for (const dirent of skillDirs) {
46
+ if (!dirent.isDirectory()) continue;
47
+
48
+ const skillName = dirent.name;
49
+ // Proceed only with explicitly targeted ibgib prefixed skills
50
+ if (!skillName.startsWith('ibgib-')) continue;
51
+
52
+ const srcSkillPath = path.join(sourceSkillsDir, skillName);
53
+ const targetSkillPath = path.join(targetSkillsDir, skillName);
54
+
55
+ let shouldCopy = true;
56
+
57
+ if (fs.existsSync(targetSkillPath)) {
58
+ const answer = await rl.question(`${logPref} Skill folder '${skillName}' already exists. Overwrite? (y/N) `);
59
+ if (answer.toLowerCase() !== 'y') {
60
+ shouldCopy = false;
61
+ console.log(`${logPref} Skipped overwriting ${skillName}.`);
62
+ }
63
+ }
64
+
65
+ if (shouldCopy) {
66
+ fs.cpSync(srcSkillPath, targetSkillPath, {
67
+ recursive: true,
68
+ force: true,
69
+ errorOnExist: false
70
+ });
71
+ console.log(`${logPref} ✅ Copied skill: ${skillName}`);
72
+ }
52
73
  }
74
+ console.log(`${logPref} Finished initializing agent skills.`);
75
+ } catch (error) {
76
+ console.error(`${logPref} ❌ Failed to copy agent skills:`, error);
77
+ process.exit(1);
78
+ } finally {
79
+ rl.close();
53
80
  }