@ghl-ai/aw 0.1.26-beta.1 → 0.1.26-beta.2

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/commands/pull.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // commands/pull.mjs — Pull content from registry
2
2
 
3
- import { mkdirSync, existsSync, readdirSync, copyFileSync } from 'node:fs';
3
+ import { mkdirSync, existsSync, readdirSync, copyFileSync, cpSync } from 'node:fs';
4
4
  import { join } from 'node:path';
5
5
  import { homedir } from 'node:os';
6
6
  import { execSync } from 'node:child_process';
@@ -191,6 +191,16 @@ export async function pullCommand(args) {
191
191
  }
192
192
  }
193
193
 
194
+ // Bulk-copy docs/ directories (not a TYPE_DIR — raw recursive copy)
195
+ for (const rd of registryDirs) {
196
+ const docsDir = join(rd.path, 'docs');
197
+ if (existsSync(docsDir)) {
198
+ const dest = join(workspaceDir, rd.name, 'docs');
199
+ mkdirSync(dest, { recursive: true });
200
+ cpSync(docsDir, dest, { recursive: true });
201
+ }
202
+ }
203
+
194
204
  // MCP registration (second-class — skip if not available)
195
205
  if (cfg.namespace) {
196
206
  registerMcp(cfg.namespace);
@@ -283,6 +293,16 @@ export async function pullAsync(args) {
283
293
  if (existsSync(src)) copyFileSync(src, join(workspaceDir, fname));
284
294
  }
285
295
 
296
+ // Bulk-copy docs/ directories (not a TYPE_DIR — raw recursive copy)
297
+ for (const rd of registryDirs) {
298
+ const docsDir = join(rd.path, 'docs');
299
+ if (existsSync(docsDir)) {
300
+ const dest = join(workspaceDir, rd.name, 'docs');
301
+ mkdirSync(dest, { recursive: true });
302
+ cpSync(docsDir, dest, { recursive: true });
303
+ }
304
+ }
305
+
286
306
  return { pattern, actions, conflictCount };
287
307
  } finally {
288
308
  cleanup(tempDir);
package/link.mjs CHANGED
@@ -1,15 +1,19 @@
1
1
  // link.mjs — Create symlinks from IDE dirs → .aw_registry/
2
2
 
3
- import { existsSync, lstatSync, mkdirSync, readdirSync, unlinkSync } from 'node:fs';
3
+ import { existsSync, lstatSync, mkdirSync, readdirSync, unlinkSync, symlinkSync } from 'node:fs';
4
4
  import { join, relative } from 'node:path';
5
- import { execSync } from 'node:child_process';
6
5
  import { homedir } from 'node:os';
7
6
  import * as fmt from './fmt.mjs';
8
7
 
8
+ function forceSymlink(target, linkPath) {
9
+ try { unlinkSync(linkPath); } catch { /* not there yet */ }
10
+ symlinkSync(target, linkPath);
11
+ }
12
+
9
13
  const IDE_DIRS = ['.claude', '.cursor', '.codex'];
10
14
  // Per-file symlink types
11
15
  const FILE_TYPES = ['agents'];
12
- const ALL_KNOWN_TYPES = new Set([...FILE_TYPES, 'skills', 'commands', 'evals']);
16
+ const ALL_KNOWN_TYPES = new Set([...FILE_TYPES, 'skills', 'commands', 'evals', 'docs']);
13
17
 
14
18
  /**
15
19
  * List namespace directories inside .aw_registry/ (skip dotfiles).
@@ -135,10 +139,7 @@ export function linkWorkspace(cwd) {
135
139
  const linkPath = join(linkDir, flat);
136
140
  const targetPath = join(typeDirPath, file);
137
141
  const relTarget = relative(linkDir, targetPath);
138
- try {
139
- execSync(`ln -sfn "${relTarget}" "${linkPath}"`, { stdio: 'pipe' });
140
- created++;
141
- } catch { /* best effort */ }
142
+ try { forceSymlink(relTarget, linkPath); created++; } catch { /* best effort */ }
142
143
  }
143
144
  }
144
145
  }
@@ -155,10 +156,7 @@ export function linkWorkspace(cwd) {
155
156
  const linkPath = join(linkDir, flat);
156
157
  const targetPath = join(skillsDir, skill);
157
158
  const relTarget = relative(linkDir, targetPath);
158
- try {
159
- execSync(`ln -sfn "${relTarget}" "${linkPath}"`, { stdio: 'pipe' });
160
- created++;
161
- } catch { /* best effort */ }
159
+ try { forceSymlink(relTarget, linkPath); created++; } catch { /* best effort */ }
162
160
  }
163
161
  }
164
162
  }
@@ -178,10 +176,7 @@ export function linkWorkspace(cwd) {
178
176
  const linkPath = join(linkDir, flat);
179
177
  const targetPath = join(subDir, evalName);
180
178
  const relTarget = relative(linkDir, targetPath);
181
- try {
182
- execSync(`ln -sfn "${relTarget}" "${linkPath}"`, { stdio: 'pipe' });
183
- created++;
184
- } catch { /* best effort */ }
179
+ try { forceSymlink(relTarget, linkPath); created++; } catch { /* best effort */ }
185
180
  }
186
181
  }
187
182
  }
@@ -199,10 +194,7 @@ export function linkWorkspace(cwd) {
199
194
  const linkPath = join(agentsSkillsDir, flat);
200
195
  const targetPath = join(skillsDir, skill);
201
196
  const relTarget = relative(agentsSkillsDir, targetPath);
202
- try {
203
- execSync(`ln -sfn "${relTarget}" "${linkPath}"`, { stdio: 'pipe' });
204
- created++;
205
- } catch { /* best effort */ }
197
+ try { forceSymlink(relTarget, linkPath); created++; } catch { /* best effort */ }
206
198
  }
207
199
  }
208
200
  }
@@ -220,10 +212,7 @@ export function linkWorkspace(cwd) {
220
212
  const linkPath = join(linkDir, cmdFileName);
221
213
  const targetPath = join(commandsDir, file);
222
214
  const relTarget = relative(linkDir, targetPath);
223
- try {
224
- execSync(`ln -sfn "${relTarget}" "${linkPath}"`, { stdio: 'pipe' });
225
- created++;
226
- } catch { /* best effort */ }
215
+ try { forceSymlink(relTarget, linkPath); created++; } catch { /* best effort */ }
227
216
  }
228
217
  }
229
218
  }
@@ -235,13 +224,19 @@ export function linkWorkspace(cwd) {
235
224
  for (const ide of IDE_DIRS) {
236
225
  const linkPath = join(cwd, ide, 'AW-PROTOCOL.md');
237
226
  const relTarget = relative(join(cwd, ide), protocolSrc);
238
- try {
239
- if (existsSync(linkPath) || lstatSync(linkPath).isSymbolicLink()) unlinkSync(linkPath);
240
- } catch { /* not there yet */ }
241
- try {
242
- execSync(`ln -sfn "${relTarget}" "${linkPath}"`, { stdio: 'pipe' });
243
- created++;
244
- } catch { /* best effort */ }
227
+ try { forceSymlink(relTarget, linkPath); created++; } catch { /* best effort */ }
228
+ }
229
+ }
230
+
231
+ // Docs: single directory symlink per IDE → .aw_registry/platform/docs
232
+ const platformDocsDir = join(awDir, 'platform', 'docs');
233
+ if (existsSync(platformDocsDir)) {
234
+ for (const ide of IDE_DIRS) {
235
+ const linkDir = join(cwd, ide);
236
+ mkdirSync(linkDir, { recursive: true });
237
+ const linkPath = join(linkDir, 'docs');
238
+ const relTarget = relative(linkDir, platformDocsDir);
239
+ try { forceSymlink(relTarget, linkPath); created++; } catch { /* best effort */ }
245
240
  }
246
241
  }
247
242
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.26-beta.1",
3
+ "version": "0.1.26-beta.2",
4
4
  "description": "Agentic Workspace CLI — pull, push & manage agents, skills and commands from the registry",
5
5
  "type": "module",
6
6
  "bin": {
package/registry.mjs CHANGED
@@ -5,6 +5,7 @@ import { join, relative } from 'node:path';
5
5
  import { createHash } from 'node:crypto';
6
6
 
7
7
  const TYPE_DIRS = new Set(['agents', 'skills', 'commands', 'evals']);
8
+ const SKIP_DIRS = new Set(['docs']);
8
9
 
9
10
  export function sha256(content) {
10
11
  return createHash('sha256').update(content).digest('hex');
@@ -97,7 +98,7 @@ export function walkRegistryTree(baseDir, baseName) {
97
98
  });
98
99
  }
99
100
  }
100
- } else if (entry.isDirectory()) {
101
+ } else if (entry.isDirectory() && !SKIP_DIRS.has(entry.name)) {
101
102
  recurse(fullPath, [...pathSegments, entry.name]);
102
103
  }
103
104
  }