@ibgib/web-gib 0.0.20 → 0.0.22
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/README.md +32 -0
- package/package.json +1 -1
- package/tools/init-agents.js +8 -6
package/README.md
CHANGED
|
@@ -21,6 +21,38 @@ All ibgib code is TypeScript + ES Modules.
|
|
|
21
21
|
* .web.mts - web (not node)
|
|
22
22
|
* .app.mts - blank-gib app (not the web extension)
|
|
23
23
|
|
|
24
|
+
## AI Agent Skills (Scaffolding)
|
|
25
|
+
|
|
26
|
+
In lieu of a heavy framework CLI, the `@ibgib/web-gib` package comes bundled with built-in agent instructions and templates structure to help your IDE's AI agents natively scaffold new ibgib applications, components, and shells.
|
|
27
|
+
|
|
28
|
+
Because AI coding assistants typically do not read files inside `node_modules`, you must initialize these skills by copying them directly into your project's root folder. You can do this manually, or we have provided a simple script to do the copying for you.
|
|
29
|
+
|
|
30
|
+
**Option 1 (For standard projects)**
|
|
31
|
+
If `@ibgib/web-gib` is installed at your project root, you can run the executable directly via `npx`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx web-gib-init-agents
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Option 2 (For Monorepos & Workspaces)**
|
|
38
|
+
If `@ibgib/web-gib` is a dependency on a sub-app (e.g. `apps/my-app`) instead of the workspace root, `npx` at the root will fail to locate the binary. To initialize the `.agents` folder at your monorepo root, you have two choices:
|
|
39
|
+
|
|
40
|
+
*Choice A:* Add it as a passthrough script in your monorepo's root `package.json` (Recommended):
|
|
41
|
+
```json
|
|
42
|
+
"scripts": {
|
|
43
|
+
"init-agents": "web-gib-init-agents"
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
Then execute it from the root:
|
|
47
|
+
```bash
|
|
48
|
+
npm run init-agents
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
*Choice B:* Force `npx` to resolve the package locally:
|
|
52
|
+
```bash
|
|
53
|
+
npx -p @ibgib/web-gib web-gib-init-agents
|
|
54
|
+
```
|
|
55
|
+
|
|
24
56
|
## UI Architecture: Custom @ibgib component framework
|
|
25
57
|
|
|
26
58
|
**tl;dr**: _Web Component-based components react to ibgib's unique Merkle DAG DLT time-centric data model._
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibgib/web-gib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
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",
|
package/tools/init-agents.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
// ESM doesn't natively have __dirname, so we reconstruct it.
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
4
9
|
|
|
5
10
|
const logPref = '[web-gib init-agents]';
|
|
6
11
|
|
|
7
|
-
//
|
|
8
|
-
// so the package root is exactly one directory up.
|
|
12
|
+
// Target the .agents folder at the package root
|
|
9
13
|
const packageRoot = path.resolve(__dirname, '..');
|
|
10
14
|
const sourceAgentsDir = path.join(packageRoot, '.agents');
|
|
11
15
|
|
|
@@ -22,11 +26,9 @@ console.log(`${logPref} From: ${sourceAgentsDir}`);
|
|
|
22
26
|
console.log(`${logPref} To: ${targetAgentsDir}`);
|
|
23
27
|
|
|
24
28
|
try {
|
|
25
|
-
// cpSync is available in Node 16.7+
|
|
26
29
|
fs.cpSync(sourceAgentsDir, targetAgentsDir, {
|
|
27
30
|
recursive: true,
|
|
28
31
|
// Setting force to false ensures we DO NOT overwrite existing templates
|
|
29
|
-
// if the consumer has customized them for their own project!
|
|
30
32
|
force: false,
|
|
31
33
|
errorOnExist: false
|
|
32
34
|
});
|