@ibgib/web-gib 0.0.21 → 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 CHANGED
@@ -27,12 +27,32 @@ In lieu of a heavy framework CLI, the `@ibgib/web-gib` package comes bundled wit
27
27
 
28
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
29
 
30
- To initialize or update your agent skills, run the bundled executable in your terminal:
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`:
31
32
 
32
33
  ```bash
33
34
  npx web-gib-init-agents
34
35
  ```
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
+
36
56
  ## UI Architecture: Custom @ibgib component framework
37
57
 
38
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.21",
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",
@@ -1,11 +1,15 @@
1
1
  #!/usr/bin/env node
2
- const fs = require('fs');
3
- const path = require('path');
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
- // Assuming this file is placed at <package_root>/tools/init-agents.js
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
  });