@ghl-ai/aw 0.1.48-beta.2 → 0.1.49-beta.0

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/push.mjs CHANGED
@@ -518,6 +518,91 @@ function writeAwDocsLinkSummary(projectRoot, links, publishConfig) {
518
518
  }
519
519
  }
520
520
 
521
+ function normalizeAwDocsRelPath(value) {
522
+ if (!value) return null;
523
+ let relPath = String(value).replace(/\\/g, '/').replace(/^\.\//, '');
524
+ if (relPath.startsWith(`${AW_DOCS_DIR}/`)) relPath = relPath.slice(AW_DOCS_DIR.length + 1);
525
+ return relPath.replace(/^\/+/, '');
526
+ }
527
+
528
+ function featureSlugForAwDocsRelPath(relPath) {
529
+ const normalized = normalizeAwDocsRelPath(relPath);
530
+ if (!normalized) return null;
531
+ const parts = normalized.split('/');
532
+ if (parts[0] !== 'features' || !parts[1]) return null;
533
+ return parts[1];
534
+ }
535
+
536
+ function setIfChanged(target, key, value) {
537
+ if (target[key] === value) return false;
538
+ target[key] = value;
539
+ return true;
540
+ }
541
+
542
+ function inferredMarkdownSourcePath(projectRoot, htmlRelPath) {
543
+ const sourceRelPath = htmlRelPath.replace(/\.html$/i, '.md');
544
+ if (sourceRelPath === htmlRelPath) return null;
545
+ if (!existsSync(join(projectRoot, AW_DOCS_DIR, sourceRelPath))) return null;
546
+ return `${AW_DOCS_DIR}/${sourceRelPath}`;
547
+ }
548
+
549
+ function hydrateAwDocsFeatureStateLinks(projectRoot, links, publishConfig) {
550
+ const htmlLinksByFeature = new Map();
551
+ for (const link of links) {
552
+ if (!/\.html$/i.test(link.relPath)) continue;
553
+ const featureSlug = featureSlugForAwDocsRelPath(link.relPath);
554
+ if (!featureSlug) continue;
555
+ const featureLinks = htmlLinksByFeature.get(featureSlug) || [];
556
+ featureLinks.push(link);
557
+ htmlLinksByFeature.set(featureSlug, featureLinks);
558
+ }
559
+
560
+ for (const [featureSlug, featureLinks] of htmlLinksByFeature) {
561
+ const statePath = join(projectRoot, AW_DOCS_DIR, 'features', featureSlug, 'state.json');
562
+ if (!existsSync(statePath)) continue;
563
+
564
+ let state;
565
+ try {
566
+ state = JSON.parse(readFileSync(statePath, 'utf8'));
567
+ } catch (e) {
568
+ throw new Error(`Invalid ${AW_DOCS_DIR}/features/${featureSlug}/state.json: ${e.message}`);
569
+ }
570
+
571
+ const artifacts = Array.isArray(state.html_companion_artifacts)
572
+ ? state.html_companion_artifacts
573
+ : [];
574
+ let changed = !Array.isArray(state.html_companion_artifacts);
575
+
576
+ for (const link of featureLinks) {
577
+ const htmlPath = `${AW_DOCS_DIR}/${link.relPath}`;
578
+ const existing = artifacts.find(artifact => normalizeAwDocsRelPath(artifact?.html_path) === link.relPath);
579
+ const artifact = existing || {};
580
+ if (!existing) {
581
+ const sourcePath = inferredMarkdownSourcePath(projectRoot, link.relPath);
582
+ if (sourcePath) artifact.source_path = sourcePath;
583
+ artifacts.push(artifact);
584
+ changed = true;
585
+ }
586
+
587
+ changed = setIfChanged(artifact, 'html_path', htmlPath) || changed;
588
+ changed = setIfChanged(artifact, 'publish_status', 'published') || changed;
589
+ changed = setIfChanged(artifact, 'remote_repo', publishConfig.repo) || changed;
590
+ changed = setIfChanged(artifact, 'remote_branch', publishConfig.branch) || changed;
591
+ changed = setIfChanged(artifact, 'remote_path', link.publishedPath) || changed;
592
+ changed = setIfChanged(artifact, 'platform_docs_path', link.publishedPath) || changed;
593
+ changed = setIfChanged(artifact, 'remote_url', link.remoteUrl) || changed;
594
+ changed = setIfChanged(artifact, 'teamofone_url', link.remoteUrl) || changed;
595
+ changed = setIfChanged(artifact, 'github_url', link.repositoryUrl) || changed;
596
+ changed = setIfChanged(artifact, 'repository_url', link.repositoryUrl) || changed;
597
+ }
598
+
599
+ if (!changed) continue;
600
+ state.html_companion_artifacts = artifacts;
601
+ state.updated_at = new Date().toISOString();
602
+ writeFileSync(statePath, JSON.stringify(state, null, 2) + '\n');
603
+ }
604
+ }
605
+
521
606
  async function commitAndPushAwDocsRepo(docsRepoDir, { message, branch }) {
522
607
  await execFile('git', ['add', '-A'], { cwd: docsRepoDir, encoding: 'utf8' });
523
608
  await execFile('git', ['commit', '-m', message], {
@@ -612,6 +697,8 @@ async function publishProjectAwDocs(cwd, home, dryRun, scope = null) {
612
697
  return { hasDocs: true, publishedPaths, links };
613
698
  }
614
699
 
700
+ hydrateAwDocsFeatureStateLinks(projectRoot, links, publishConfig);
701
+
615
702
  const s = fmt.spinner();
616
703
  s.start(`Publishing ${files.length} AW doc${files.length > 1 ? 's' : ''} to ${publishConfig.repo}...`);
617
704
  try {
package/constants.mjs CHANGED
@@ -33,7 +33,7 @@ export const AW_DOCS_BASE_BRANCH = 'master-sync';
33
33
  export const AW_DOCS_SEED_BRANCH = process.env.AW_DOCS_SEED_BRANCH || 'scaffold';
34
34
  export const AW_DOCS_PUBLISH_DIR = 'aw_docs';
35
35
  export const AW_DOCS_PUBLIC_BASE_URL = process.env.AW_DOCS_PUBLIC_BASE_URL || `https://github.com/${AW_DOCS_REPO}/blob/${AW_DOCS_BASE_BRANCH}`;
36
- export const AW_DOCS_TEAMOFONE_ORIGIN = process.env.AW_DOCS_TEAMOFONE_ORIGIN || 'https://teamofone.msgsndr.net';
36
+ export const AW_DOCS_TEAMOFONE_ORIGIN = process.env.AW_DOCS_TEAMOFONE_ORIGIN || 'https://teamofone.servers.stg.msgsndr.net';
37
37
  export const AW_DOCS_TEAMOFONE_BASE_URL = process.env.AW_DOCS_TEAMOFONE_BASE_URL || `${AW_DOCS_TEAMOFONE_ORIGIN}/too/docs/GoHighLevel/ghl-aw-docs`;
38
38
 
39
39
  export function defaultAwDocsGithubDocsConfig() {
package/integrate.mjs CHANGED
@@ -649,6 +649,9 @@ No active runs. Use \`/aw:<team>-<command>\` to start a workflow.
649
649
  // config.json — registry paths, sync settings
650
650
  const configPath = join(awDocsDir, 'config.json');
651
651
  const defaultConfig = {
652
+ docs: {
653
+ outputMode: 'dual',
654
+ },
652
655
  sync: {
653
656
  eager: true,
654
657
  batch_threshold: 10,
@@ -668,6 +671,10 @@ No active runs. Use \`/aw:<team>-<command>\` to start a workflow.
668
671
  const existing = JSON.parse(readFileSync(configPath, 'utf8'));
669
672
  nextConfig = {
670
673
  ...existing,
674
+ docs: {
675
+ ...defaultConfig.docs,
676
+ ...(existing.docs || {}),
677
+ },
671
678
  sync: {
672
679
  ...defaultConfig.sync,
673
680
  ...(existing.sync || {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.48-beta.2",
3
+ "version": "0.1.49-beta.0",
4
4
  "description": "Agentic Workspace CLI — pull, push & manage agents, skills and commands from the registry",
5
5
  "type": "module",
6
6
  "bin": {