@ghl-ai/aw 0.1.66 → 0.1.68
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 +9 -14
- package/constants.mjs +34 -2
- package/integrate.mjs +2 -0
- package/package.json +1 -1
package/commands/push.mjs
CHANGED
|
@@ -37,9 +37,9 @@ import {
|
|
|
37
37
|
AW_DOCS_SEED_BRANCH,
|
|
38
38
|
AW_DOCS_PUBLISH_DIR,
|
|
39
39
|
AW_DOCS_PUBLIC_BASE_URL,
|
|
40
|
-
AW_DOCS_TEAMOFONE_ORIGIN,
|
|
41
40
|
AW_DOCS_TEAMOFONE_BASE_URL,
|
|
42
41
|
AW_CO_AUTHOR,
|
|
42
|
+
canonicalAwDocsDevtoolsBaseUrl,
|
|
43
43
|
defaultAwDocsConfig,
|
|
44
44
|
} from '../constants.mjs';
|
|
45
45
|
import { resolveInput } from '../paths.mjs';
|
|
@@ -248,6 +248,12 @@ function writeAwDocsConfigIfChanged(projectRoot, config) {
|
|
|
248
248
|
function ensureAwDocsPublishConfig(projectRoot) {
|
|
249
249
|
const config = readAwDocsConfig(projectRoot);
|
|
250
250
|
const defaultConfig = defaultAwDocsConfig();
|
|
251
|
+
const githubDocs = {
|
|
252
|
+
...defaultConfig.sync.github_docs,
|
|
253
|
+
...(config.sync?.github_docs || {}),
|
|
254
|
+
};
|
|
255
|
+
githubDocs.teamofone_base_url = canonicalAwDocsDevtoolsBaseUrl(githubDocs.teamofone_base_url);
|
|
256
|
+
|
|
251
257
|
const next = {
|
|
252
258
|
...config,
|
|
253
259
|
docs: {
|
|
@@ -257,10 +263,7 @@ function ensureAwDocsPublishConfig(projectRoot) {
|
|
|
257
263
|
sync: {
|
|
258
264
|
...defaultConfig.sync,
|
|
259
265
|
...(config.sync || {}),
|
|
260
|
-
github_docs:
|
|
261
|
-
...defaultConfig.sync.github_docs,
|
|
262
|
-
...(config.sync?.github_docs || {}),
|
|
263
|
-
},
|
|
266
|
+
github_docs: githubDocs,
|
|
264
267
|
},
|
|
265
268
|
paths: {
|
|
266
269
|
...defaultConfig.paths,
|
|
@@ -303,7 +306,7 @@ function resolveAwDocsPublishConfig(projectRoot) {
|
|
|
303
306
|
branch,
|
|
304
307
|
seedBranch: process.env.AW_DOCS_SEED_BRANCH || githubDocs.seed_branch || AW_DOCS_SEED_BRANCH,
|
|
305
308
|
dest,
|
|
306
|
-
teamofoneBaseUrl:
|
|
309
|
+
teamofoneBaseUrl: canonicalAwDocsDevtoolsBaseUrl(teamofoneBaseUrl),
|
|
307
310
|
publicBaseUrl,
|
|
308
311
|
};
|
|
309
312
|
}
|
|
@@ -551,14 +554,6 @@ function appendPathToUrl(baseUrl, path) {
|
|
|
551
554
|
return `${basePath.replace(/\/$/, '')}/${encodedPath}${query}${hash}`;
|
|
552
555
|
}
|
|
553
556
|
|
|
554
|
-
function normalizeTeamOfOneBaseUrl(baseUrl) {
|
|
555
|
-
const value = String(baseUrl || '').trim();
|
|
556
|
-
if (!value) return '';
|
|
557
|
-
if (/^https?:\/\//i.test(value)) return value;
|
|
558
|
-
if (value.startsWith('/')) return `${AW_DOCS_TEAMOFONE_ORIGIN.replace(/\/$/, '')}${value}`;
|
|
559
|
-
return `https://${value.replace(/^\/+/, '')}`;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
557
|
function appendQueryParam(url, key, value) {
|
|
563
558
|
const hashIndex = url.indexOf('#');
|
|
564
559
|
const withoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
|
package/constants.mjs
CHANGED
|
@@ -33,8 +33,40 @@ 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
|
|
37
|
-
export const
|
|
36
|
+
export const AW_DOCS_DEVTOOLS_ORIGIN = 'https://devtools.servers.stg.msgsndr.net';
|
|
37
|
+
export const AW_DOCS_DEVTOOLS_BASE_URL = `${AW_DOCS_DEVTOOLS_ORIGIN}/too/docs/GoHighLevel/ghl-aw-docs`;
|
|
38
|
+
/** @deprecated Use AW_DOCS_DEVTOOLS_ORIGIN. Kept as an alias for older call sites. */
|
|
39
|
+
export const AW_DOCS_TEAMOFONE_ORIGIN = AW_DOCS_DEVTOOLS_ORIGIN;
|
|
40
|
+
/** @deprecated Use AW_DOCS_DEVTOOLS_BASE_URL. Kept as an alias for older config keys. */
|
|
41
|
+
export const AW_DOCS_TEAMOFONE_BASE_URL = AW_DOCS_DEVTOOLS_BASE_URL;
|
|
42
|
+
|
|
43
|
+
function normalizeAwDocsShareBaseUrl(baseUrl) {
|
|
44
|
+
const value = String(baseUrl || '').trim();
|
|
45
|
+
if (!value) return '';
|
|
46
|
+
if (/^https?:\/\//i.test(value)) return value;
|
|
47
|
+
if (value.startsWith('/')) return `${AW_DOCS_DEVTOOLS_ORIGIN.replace(/\/$/, '')}${value}`;
|
|
48
|
+
return `https://${value.replace(/^\/+/, '')}`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function canonicalAwDocsDevtoolsBaseUrl(baseUrl) {
|
|
52
|
+
const canonical = AW_DOCS_DEVTOOLS_BASE_URL.replace(/\/+$/, '');
|
|
53
|
+
const normalized = normalizeAwDocsShareBaseUrl(baseUrl).replace(/\/+$/, '');
|
|
54
|
+
if (!normalized) return canonical;
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const expected = new URL(canonical);
|
|
58
|
+
const actual = new URL(normalized);
|
|
59
|
+
const expectedPath = expected.pathname.replace(/\/+$/, '');
|
|
60
|
+
const actualPath = actual.pathname.replace(/\/+$/, '');
|
|
61
|
+
if (actual.origin === expected.origin && actualPath === expectedPath) {
|
|
62
|
+
return canonical;
|
|
63
|
+
}
|
|
64
|
+
} catch {
|
|
65
|
+
return canonical;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return canonical;
|
|
69
|
+
}
|
|
38
70
|
|
|
39
71
|
export function defaultAwDocsGithubDocsConfig() {
|
|
40
72
|
return {
|
package/integrate.mjs
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import { isDefaultRoutingEnabled } from './startup.mjs';
|
|
16
16
|
import {
|
|
17
17
|
AW_DOCS_DIR,
|
|
18
|
+
canonicalAwDocsDevtoolsBaseUrl,
|
|
18
19
|
defaultAwDocsConfig,
|
|
19
20
|
} from './constants.mjs';
|
|
20
21
|
|
|
@@ -665,6 +666,7 @@ No active runs. Use \`/aw:<team>-<command>\` to start a workflow.
|
|
|
665
666
|
github_docs: {
|
|
666
667
|
...defaultConfig.sync.github_docs,
|
|
667
668
|
...(existing.sync?.github_docs || {}),
|
|
669
|
+
teamofone_base_url: canonicalAwDocsDevtoolsBaseUrl(existing.sync?.github_docs?.teamofone_base_url),
|
|
668
670
|
},
|
|
669
671
|
},
|
|
670
672
|
paths: {
|