@ibgib/web-gib 0.0.19 → 0.0.20
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/package.json +4 -1
- package/tools/init-agents.js +37 -0
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibgib/web-gib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
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",
|
|
7
7
|
"url": "https://paypal.me/ibGib"
|
|
8
8
|
},
|
|
9
9
|
"main": "dist/index.mjs",
|
|
10
|
+
"bin": {
|
|
11
|
+
"web-gib-init-agents": "./tools/init-agents.js"
|
|
12
|
+
},
|
|
10
13
|
"scripts": {
|
|
11
14
|
"clean": "node node_modules/@ibgib/helper-gib/tools/clean.js ./dist",
|
|
12
15
|
"build": "npm run clean && tsc -b tsconfig.json --force",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const logPref = '[web-gib init-agents]';
|
|
6
|
+
|
|
7
|
+
// Assuming this file is placed at <package_root>/tools/init-agents.js
|
|
8
|
+
// so the package root is exactly one directory up.
|
|
9
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
10
|
+
const sourceAgentsDir = path.join(packageRoot, '.agents');
|
|
11
|
+
|
|
12
|
+
// The consumer's repository root (where they run npx web-gib-init-agents)
|
|
13
|
+
const targetAgentsDir = path.join(process.cwd(), '.agents');
|
|
14
|
+
|
|
15
|
+
if (!fs.existsSync(sourceAgentsDir)) {
|
|
16
|
+
console.error(`${logPref} Error: Could not locate source agent skills at ${sourceAgentsDir}`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
console.log(`${logPref} Copying ibgib agent skills...`);
|
|
21
|
+
console.log(`${logPref} From: ${sourceAgentsDir}`);
|
|
22
|
+
console.log(`${logPref} To: ${targetAgentsDir}`);
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
// cpSync is available in Node 16.7+
|
|
26
|
+
fs.cpSync(sourceAgentsDir, targetAgentsDir, {
|
|
27
|
+
recursive: true,
|
|
28
|
+
// Setting force to false ensures we DO NOT overwrite existing templates
|
|
29
|
+
// if the consumer has customized them for their own project!
|
|
30
|
+
force: false,
|
|
31
|
+
errorOnExist: false
|
|
32
|
+
});
|
|
33
|
+
console.log(`${logPref} ✅ Success! Agent skills have been initialized.`);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error(`${logPref} ❌ Failed to copy agent skills:`, error);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|