@ghl-ai/aw 0.1.47 → 0.1.48-beta.1
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 +60 -5
- package/constants.mjs +3 -0
- package/ecc.mjs +1 -1
- package/integrations.mjs +23 -6
- package/package.json +1 -1
package/commands/push.mjs
CHANGED
|
@@ -36,6 +36,8 @@ import {
|
|
|
36
36
|
AW_DOCS_SEED_BRANCH,
|
|
37
37
|
AW_DOCS_PUBLISH_DIR,
|
|
38
38
|
AW_DOCS_PUBLIC_BASE_URL,
|
|
39
|
+
AW_DOCS_TEAMOFONE_ORIGIN,
|
|
40
|
+
AW_DOCS_TEAMOFONE_BASE_URL,
|
|
39
41
|
AW_CO_AUTHOR,
|
|
40
42
|
defaultAwDocsGithubDocsConfig,
|
|
41
43
|
} from '../constants.mjs';
|
|
@@ -216,8 +218,14 @@ function resolveAwDocsPublishConfig(projectRoot) {
|
|
|
216
218
|
const branch = AW_DOCS_BASE_BRANCH;
|
|
217
219
|
const repoUrl = process.env.AW_DOCS_REPO_URL || githubDocs.repo_url || repoCloneUrl(repo);
|
|
218
220
|
const dest = safePathSegment(process.env.AW_DOCS_PUBLISH_DIR || githubDocs.dest || AW_DOCS_PUBLISH_DIR, AW_DOCS_PUBLISH_DIR);
|
|
221
|
+
const teamofoneBaseUrl = String(
|
|
222
|
+
process.env.AW_DOCS_TEAMOFONE_BASE_URL
|
|
223
|
+
|| githubDocs.teamofone_base_url
|
|
224
|
+
|| AW_DOCS_TEAMOFONE_BASE_URL,
|
|
225
|
+
).trim();
|
|
219
226
|
const publicBaseUrl = process.env.AW_DOCS_PUBLIC_BASE_URL
|
|
220
|
-
|| githubDocs.
|
|
227
|
+
|| githubDocs.public_base_url
|
|
228
|
+
|| AW_DOCS_PUBLIC_BASE_URL
|
|
221
229
|
|| `https://github.com/${String(repo).replace(/\.git$/, '')}/blob/${branch}`;
|
|
222
230
|
|
|
223
231
|
return {
|
|
@@ -227,6 +235,7 @@ function resolveAwDocsPublishConfig(projectRoot) {
|
|
|
227
235
|
branch,
|
|
228
236
|
seedBranch: process.env.AW_DOCS_SEED_BRANCH || githubDocs.seed_branch || AW_DOCS_SEED_BRANCH,
|
|
229
237
|
dest,
|
|
238
|
+
teamofoneBaseUrl: normalizeTeamOfOneBaseUrl(teamofoneBaseUrl),
|
|
230
239
|
publicBaseUrl,
|
|
231
240
|
};
|
|
232
241
|
}
|
|
@@ -370,19 +379,65 @@ async function remoteBranchExists(repoDir, branchName) {
|
|
|
370
379
|
}
|
|
371
380
|
}
|
|
372
381
|
|
|
382
|
+
function appendPathToUrl(baseUrl, path) {
|
|
383
|
+
const encodedPath = path.split('/').map(encodeURIComponent).join('/');
|
|
384
|
+
const hashIndex = baseUrl.indexOf('#');
|
|
385
|
+
const withoutHash = hashIndex === -1 ? baseUrl : baseUrl.slice(0, hashIndex);
|
|
386
|
+
const hash = hashIndex === -1 ? '' : baseUrl.slice(hashIndex);
|
|
387
|
+
const queryIndex = withoutHash.indexOf('?');
|
|
388
|
+
const basePath = queryIndex === -1 ? withoutHash : withoutHash.slice(0, queryIndex);
|
|
389
|
+
const query = queryIndex === -1 ? '' : withoutHash.slice(queryIndex);
|
|
390
|
+
return `${basePath.replace(/\/$/, '')}/${encodedPath}${query}${hash}`;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function normalizeTeamOfOneBaseUrl(baseUrl) {
|
|
394
|
+
const value = String(baseUrl || '').trim();
|
|
395
|
+
if (!value) return '';
|
|
396
|
+
if (/^https?:\/\//i.test(value)) return value;
|
|
397
|
+
if (value.startsWith('/')) return `${AW_DOCS_TEAMOFONE_ORIGIN.replace(/\/$/, '')}${value}`;
|
|
398
|
+
return `https://${value.replace(/^\/+/, '')}`;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function appendQueryParam(url, key, value) {
|
|
402
|
+
const hashIndex = url.indexOf('#');
|
|
403
|
+
const withoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
404
|
+
const hash = hashIndex === -1 ? '' : url.slice(hashIndex);
|
|
405
|
+
const separator = withoutHash.includes('?') ? '&' : '?';
|
|
406
|
+
return `${withoutHash}${separator}${encodeURIComponent(key)}=${encodeURIComponent(value)}${hash}`;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
function awDocsTeamOfOneUrl(publishedPath, publishConfig) {
|
|
410
|
+
if (!publishConfig.teamofoneBaseUrl) return null;
|
|
411
|
+
return appendQueryParam(
|
|
412
|
+
appendPathToUrl(publishConfig.teamofoneBaseUrl, publishedPath),
|
|
413
|
+
'ref',
|
|
414
|
+
publishConfig.branch,
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function awDocsPublicUrl(publishedPath, publishConfig) {
|
|
419
|
+
return appendPathToUrl(publishConfig.publicBaseUrl, publishedPath);
|
|
420
|
+
}
|
|
421
|
+
|
|
373
422
|
function awDocsRemoteUrl(publishedPath, publishConfig) {
|
|
374
|
-
return
|
|
423
|
+
return awDocsTeamOfOneUrl(publishedPath, publishConfig)
|
|
424
|
+
|| awDocsPublicUrl(publishedPath, publishConfig);
|
|
375
425
|
}
|
|
376
426
|
|
|
377
427
|
function awDocsRepositoryUrl(publishedPath, publishConfig) {
|
|
378
428
|
const repo = String(publishConfig.repo || AW_DOCS_REPO).replace(/\.git$/, '');
|
|
379
|
-
if (!repo.includes('/')) return
|
|
380
|
-
return `https://github.com/${repo}/blob/${publishConfig.branch}
|
|
429
|
+
if (!repo.includes('/')) return awDocsPublicUrl(publishedPath, publishConfig);
|
|
430
|
+
return appendPathToUrl(`https://github.com/${repo}/blob/${publishConfig.branch}`, publishedPath);
|
|
381
431
|
}
|
|
382
432
|
|
|
383
433
|
function printAwDocsLinks(links, limit = 10) {
|
|
434
|
+
fmt.logInfo(chalk.bold('Remote Docs'));
|
|
384
435
|
for (const link of links.slice(0, limit)) {
|
|
385
|
-
fmt.logInfo(chalk.
|
|
436
|
+
fmt.logInfo(` ${chalk.dim(link.relPath)}`);
|
|
437
|
+
fmt.logInfo(` TeamOfOne: ${chalk.cyan(link.remoteUrl)}`);
|
|
438
|
+
if (link.repositoryUrl && link.repositoryUrl !== link.remoteUrl) {
|
|
439
|
+
fmt.logInfo(` GitHub: ${chalk.cyan(link.repositoryUrl)}`);
|
|
440
|
+
}
|
|
386
441
|
}
|
|
387
442
|
if (links.length > limit) {
|
|
388
443
|
fmt.logInfo(chalk.dim(`...and ${links.length - limit} more`));
|
package/constants.mjs
CHANGED
|
@@ -33,12 +33,15 @@ 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';
|
|
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`;
|
|
36
38
|
|
|
37
39
|
export function defaultAwDocsGithubDocsConfig() {
|
|
38
40
|
return {
|
|
39
41
|
enabled: true,
|
|
40
42
|
repo: AW_DOCS_REPO,
|
|
41
43
|
dest: AW_DOCS_PUBLISH_DIR,
|
|
44
|
+
teamofone_base_url: AW_DOCS_TEAMOFONE_BASE_URL,
|
|
42
45
|
};
|
|
43
46
|
}
|
|
44
47
|
|
package/ecc.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { applyStoredStartupPreferences } from "./startup.mjs";
|
|
|
12
12
|
|
|
13
13
|
const AW_ECC_REPO_SSH = "git@github.com:shreyansh-ghl/aw-ecc.git";
|
|
14
14
|
const AW_ECC_REPO_HTTPS = "https://github.com/shreyansh-ghl/aw-ecc.git";
|
|
15
|
-
export const AW_ECC_TAG = "v1.4.
|
|
15
|
+
export const AW_ECC_TAG = "v1.4.55";
|
|
16
16
|
|
|
17
17
|
const MARKETPLACE_NAME = "aw-marketplace";
|
|
18
18
|
const PLUGIN_KEY = `aw@${MARKETPLACE_NAME}`;
|
package/integrations.mjs
CHANGED
|
@@ -45,6 +45,8 @@ export const INTEGRATIONS = {
|
|
|
45
45
|
type: 'universal-installer',
|
|
46
46
|
label: 'LeanCTX',
|
|
47
47
|
description: 'Context OS for AI — compresses file reads + shell output + memory (60-99% fewer input tokens)',
|
|
48
|
+
autoInstall: false, // opt-in only — install via: aw integrations add lean-ctx
|
|
49
|
+
uninstallCmd: 'lean-ctx uninstall', // runs on: aw integrations remove lean-ctx
|
|
48
50
|
scripts: {
|
|
49
51
|
win32: null, // no PS1 — uses npm fallback (lean-ctx-bin)
|
|
50
52
|
posix: 'https://leanctx.com/install.sh',
|
|
@@ -773,12 +775,25 @@ export async function removeIntegration(key, { silent = false } = {}) {
|
|
|
773
775
|
);
|
|
774
776
|
}
|
|
775
777
|
} else if (integration.type === 'universal-installer') {
|
|
776
|
-
if (
|
|
777
|
-
fmt.
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
778
|
+
if (integration.uninstallCmd) {
|
|
779
|
+
if (!silent) fmt.logStep(`Running ${integration.uninstallCmd}...`);
|
|
780
|
+
try {
|
|
781
|
+
execSync(integration.uninstallCmd, { stdio: silent ? 'ignore' : 'inherit' });
|
|
782
|
+
if (!silent) fmt.logSuccess(`${integration.label} uninstalled`);
|
|
783
|
+
} catch {
|
|
784
|
+
if (!silent) fmt.logWarn(
|
|
785
|
+
`${integration.uninstallCmd} failed or not found. Manual cleanup may be needed.`,
|
|
786
|
+
'Uninstall Warning',
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
} else {
|
|
790
|
+
if (!silent) {
|
|
791
|
+
fmt.logWarn(
|
|
792
|
+
`Removed ${integration.label} from the aw manifest.\n` +
|
|
793
|
+
` To fully uninstall: follow the uninstall instructions for ${integration.label} in its documentation.`,
|
|
794
|
+
'Manual Cleanup',
|
|
795
|
+
);
|
|
796
|
+
}
|
|
782
797
|
}
|
|
783
798
|
}
|
|
784
799
|
|
|
@@ -816,6 +831,8 @@ export function suggestForTeam(namespace) {
|
|
|
816
831
|
|
|
817
832
|
return Object.entries(INTEGRATIONS)
|
|
818
833
|
.filter(([, integration]) => {
|
|
834
|
+
// Skip opt-in only integrations (autoInstall: false)
|
|
835
|
+
if (integration.autoInstall === false) return false;
|
|
819
836
|
// Show if: team is in the integration's teams list OR teams list is empty (universal)
|
|
820
837
|
return (
|
|
821
838
|
integration.teams.length === 0 || integration.teams.includes(team)
|