@ghl-ai/aw 0.1.21 → 0.1.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/commands/init.mjs +19 -1
- package/constants.mjs +1 -1
- package/git.mjs +1 -0
- package/link.mjs +16 -0
- package/package.json +1 -1
package/commands/init.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Uses git's built-in template hooks for automatic linking on clone/checkout.
|
|
5
5
|
// Uses IDE tasks for auto-pull on workspace open.
|
|
6
6
|
|
|
7
|
-
import { mkdirSync, existsSync, writeFileSync, symlinkSync, chmodSync } from 'node:fs';
|
|
7
|
+
import { mkdirSync, existsSync, writeFileSync, symlinkSync, chmodSync, copyFileSync } from 'node:fs';
|
|
8
8
|
import { execSync } from 'node:child_process';
|
|
9
9
|
import { join, dirname } from 'node:path';
|
|
10
10
|
import { homedir } from 'node:os';
|
|
@@ -111,6 +111,18 @@ function saveManifest(data) {
|
|
|
111
111
|
writeFileSync(MANIFEST_PATH, JSON.stringify(data, null, 2) + '\n');
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
// Place AW-PROTOCOL.md at .aw_registry root so any namespace can reference it
|
|
115
|
+
// as .aw_registry/AW-PROTOCOL.md regardless of team name.
|
|
116
|
+
// Source of truth in repo: registry/AW-PROTOCOL.md (mirrors this root placement).
|
|
117
|
+
// After ghl is pulled, ghl/AW-PROTOCOL.md is the local copy we hoist from.
|
|
118
|
+
function hoistProtocol(registryDir) {
|
|
119
|
+
const src = join(registryDir, 'ghl', 'AW-PROTOCOL.md');
|
|
120
|
+
const dest = join(registryDir, 'AW-PROTOCOL.md');
|
|
121
|
+
if (existsSync(src)) {
|
|
122
|
+
copyFileSync(src, dest);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
114
126
|
export async function initCommand(args) {
|
|
115
127
|
const namespace = args['--namespace'] || null;
|
|
116
128
|
let user = args['--user'] || '';
|
|
@@ -139,6 +151,9 @@ export async function initCommand(args) {
|
|
|
139
151
|
// Pull latest
|
|
140
152
|
pullCommand({ ...args, _positional: [], _workspaceDir: GLOBAL_AW_DIR, '--silent': silent });
|
|
141
153
|
|
|
154
|
+
// Hoist AW-PROTOCOL.md to registry root
|
|
155
|
+
hoistProtocol(GLOBAL_AW_DIR);
|
|
156
|
+
|
|
142
157
|
// Re-link IDE dirs (idempotent)
|
|
143
158
|
linkWorkspace(HOME);
|
|
144
159
|
generateCommands(HOME);
|
|
@@ -190,6 +205,9 @@ export async function initCommand(args) {
|
|
|
190
205
|
// Step 2: Pull registry content
|
|
191
206
|
pullCommand({ ...args, _positional: ['ghl'], _workspaceDir: GLOBAL_AW_DIR });
|
|
192
207
|
|
|
208
|
+
// Hoist AW-PROTOCOL.md to registry root so all namespaces can access it
|
|
209
|
+
hoistProtocol(GLOBAL_AW_DIR);
|
|
210
|
+
|
|
193
211
|
if (namespace) {
|
|
194
212
|
pullCommand({ ...args, _positional: ['[template]'], _renameNamespace: namespace, _workspaceDir: GLOBAL_AW_DIR });
|
|
195
213
|
}
|
package/constants.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// constants.mjs — Single source of truth for registry settings.
|
|
2
2
|
|
|
3
3
|
/** Base branch for PRs and sync checkout */
|
|
4
|
-
export const REGISTRY_BASE_BRANCH = '
|
|
4
|
+
export const REGISTRY_BASE_BRANCH = 'chore/imp-command';
|
|
5
5
|
|
|
6
6
|
/** Default registry repository */
|
|
7
7
|
export const REGISTRY_REPO = 'GoHighLevel/ghl-agentic-workspace';
|
package/git.mjs
CHANGED
package/link.mjs
CHANGED
|
@@ -201,6 +201,22 @@ export function linkWorkspace(cwd) {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
// AW-PROTOCOL.md: symlink into each IDE dir root so commands can always find it
|
|
205
|
+
const protocolSrc = join(awDir, 'AW-PROTOCOL.md');
|
|
206
|
+
if (existsSync(protocolSrc)) {
|
|
207
|
+
for (const ide of IDE_DIRS) {
|
|
208
|
+
const linkPath = join(cwd, ide, 'AW-PROTOCOL.md');
|
|
209
|
+
const relTarget = relative(join(cwd, ide), protocolSrc);
|
|
210
|
+
try {
|
|
211
|
+
if (existsSync(linkPath) || lstatSync(linkPath).isSymbolicLink()) unlinkSync(linkPath);
|
|
212
|
+
} catch { /* not there yet */ }
|
|
213
|
+
try {
|
|
214
|
+
execSync(`ln -sfn "${relTarget}" "${linkPath}"`, { stdio: 'pipe' });
|
|
215
|
+
created++;
|
|
216
|
+
} catch { /* best effort */ }
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
204
220
|
if (created > 0) {
|
|
205
221
|
fmt.logSuccess(`Linked ${created} IDE symlink${created > 1 ? 's' : ''}`);
|
|
206
222
|
}
|