@ghl-ai/aw 0.1.76 → 0.1.78

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/mcp.mjs CHANGED
@@ -78,6 +78,7 @@ function renderStatus() {
78
78
  `${chalk.dim('cursor MCP:')} ${formatHealth(status.cursor)}`,
79
79
  `${chalk.dim('codex MCP:')} ${formatHealth(status.codex)}`,
80
80
  `${chalk.dim('aw-ecc Codex MCP source:')} ${formatHealth(status.eccCodex)}`,
81
+ ...(status.desktop !== null ? [`${chalk.dim('desktop MCP:')} ${formatHealth(status.desktop)}`] : []),
81
82
  ].join('\n'), 'MCP');
82
83
 
83
84
  fmt.outro('⟁ MCP status complete');
@@ -101,9 +101,9 @@ function readPackageVersion(pkgPath) {
101
101
 
102
102
  function getAwCliVersionDetails() {
103
103
  if (_awCliVersionDetails) return _awCliVersionDetails;
104
- const envVersion = parseVersionString(process.env.AW_VERSION);
104
+ const envVersion = parseVersionString(process.env.AW_CLI_VERSION);
105
105
  if (envVersion) {
106
- _awCliVersionDetails = { version: envVersion, source: 'env' };
106
+ _awCliVersionDetails = { version: envVersion, source: 'aw_cli_version_env' };
107
107
  return _awCliVersionDetails;
108
108
  }
109
109
  try {
@@ -550,6 +550,8 @@ function buildEvent(hookInput, eventType, payload) {
550
550
  github_email: git.email || input.user_email || null,
551
551
  project_hash: computeProjectHash(cwd),
552
552
  aw_version: awCli.version,
553
+ aw_cli_version: awCli.version,
554
+ aw_cli_version_source: awCli.source,
553
555
  event: eventType,
554
556
  client_ts: new Date().toISOString(),
555
557
  payload: payload || {},
@@ -26,6 +26,8 @@ const CODEX_HOME_PHASE_BLUEPRINTS = {
26
26
  marker: this.scriptMarker,
27
27
  phase: 'SessionStart',
28
28
  targetCandidates: [
29
+ '$HOME/.aw/.aw_registry/aw/skills/using-aw-skills/hooks/session-start.sh',
30
+ '$HOME/.aw_registry/aw/skills/using-aw-skills/hooks/session-start.sh',
29
31
  '$HOME/.aw_registry/platform/core/skills/using-aw-skills/hooks/session-start.sh',
30
32
  '$HOME/.aw/.aw_registry/platform/core/skills/using-aw-skills/hooks/session-start.sh',
31
33
  ],
package/integrations.mjs CHANGED
@@ -337,10 +337,13 @@ function quoteHookCommandArg(value) {
337
337
  }
338
338
 
339
339
  // Try interpreters in order; return the first that meets minPython, or null.
340
- async function detectPython({ major, minor }) {
340
+ export async function detectPython({ major, minor }) {
341
+ // Try versioned candidates first so machines where system python3 is below the
342
+ // minimum (e.g. macOS ships 3.9 but graphify needs 3.10+) still resolve correctly.
343
+ const versionedCandidates = ['python3.14', 'python3.13', 'python3.12', 'python3.11', 'python3.10'];
341
344
  const candidates = IS_WINDOWS
342
345
  ? ['py -3', 'python', 'python3']
343
- : ['python3', 'python'];
346
+ : [...versionedCandidates, 'python3', 'python'];
344
347
 
345
348
  for (const cmd of candidates) {
346
349
  try {
package/mcp.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // mcp.mjs — MCP config generation for Claude Code, Cursor, and Codex (global ~/ configs)
1
+ // mcp.mjs — MCP config generation for Claude Code, Cursor, Codex, and Claude Desktop (global ~/ configs)
2
2
  // Uses native Streamable HTTP — no bridge process needed.
3
3
 
4
4
  import { existsSync, writeFileSync, readFileSync, mkdirSync, renameSync } from 'node:fs';
@@ -82,6 +82,25 @@ function detectPaths() {
82
82
  return { ghlMcpUrl };
83
83
  }
84
84
 
85
+ /**
86
+ * Return the Claude Desktop config path for the current platform, or null on unsupported platforms.
87
+ * Claude Desktop does not exist on Linux; return null there to skip silently.
88
+ *
89
+ * AW_DESKTOP_CONFIG_PATH env override: forces a specific path regardless of platform.
90
+ * Used by tests so CI (Linux) can exercise the Desktop write path without a native app.
91
+ */
92
+ function resolveDesktopConfigPath(homeDir = HOME) {
93
+ if (process.env.AW_DESKTOP_CONFIG_PATH) return process.env.AW_DESKTOP_CONFIG_PATH;
94
+ if (process.platform === 'darwin') {
95
+ return join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
96
+ }
97
+ if (process.platform === 'win32') {
98
+ const appData = process.env.APPDATA || join(homeDir, 'AppData', 'Roaming');
99
+ return join(appData, 'Claude', 'claude_desktop_config.json');
100
+ }
101
+ return null; // Linux: Claude Desktop not available
102
+ }
103
+
85
104
  function resolveCodexBearerTokenEnvVar() {
86
105
  if (process.env[CODEX_MCP_BEARER_TOKEN_ENV]) return CODEX_MCP_BEARER_TOKEN_ENV;
87
106
  if (process.env.GITHUB_TOKEN) return 'GITHUB_TOKEN';
@@ -408,6 +427,35 @@ export async function setupMcp(cwd, namespace, { silent = false } = {}) {
408
427
  const eccCodexTomlPath = join(HOME, '.aw-ecc', '.codex', 'config.toml');
409
428
  mergeTomlMcpServer(eccCodexTomlPath, MCP_SERVER_NAME, ghlAiServerCodex);
410
429
 
430
+ // ── Claude Desktop: platform-specific config ──
431
+ // Claude Desktop does not support hooks, so using-aw-skills cannot auto-fire.
432
+ // We add the MCP server so tools are available; a Project system prompt is
433
+ // required to invoke the router — aw init prints instructions below.
434
+ const desktopConfigPath = resolveDesktopConfigPath();
435
+ if (desktopConfigPath) {
436
+ // Desktop ignores the 'type' field — use url + headers only.
437
+ const ghlAiServerDesktop = { url: mcpUrl, headers };
438
+ const desktopUpdated = mergeJsonMcpServer(desktopConfigPath, MCP_SERVER_NAME, ghlAiServerDesktop);
439
+ if (desktopUpdated) {
440
+ updatedFiles.push(desktopConfigPath);
441
+ }
442
+ if (!silent && (desktopUpdated || existsSync(desktopConfigPath))) {
443
+ fmt.logInfo('');
444
+ fmt.logInfo(fmt.chalk.yellow('Claude Desktop requires a Project system prompt to auto-trigger using-aw-skills.'));
445
+ fmt.logInfo('Claude Desktop has no hook system — MCP tools are available but the router');
446
+ fmt.logInfo('will not fire automatically unless you add these instructions to your Project:');
447
+ fmt.logInfo('');
448
+ fmt.logInfo(fmt.chalk.cyan(' Desktop → Projects → [your project] → Edit instructions → paste:'));
449
+ fmt.logInfo('');
450
+ fmt.logInfo(' Before every response, call the ghl-ai knowledge_ask tool');
451
+ fmt.logInfo(' with skill="using-aw-skills" to load the AW router,');
452
+ fmt.logInfo(' classify the task, and select the correct route.');
453
+ fmt.logInfo('');
454
+ fmt.logInfo(' Restart Claude Desktop to activate the new MCP server.');
455
+ fmt.logInfo('');
456
+ }
457
+ }
458
+
411
459
  // Deduplicate
412
460
  const unique = [...new Set(updatedFiles)];
413
461
 
@@ -426,12 +474,14 @@ export async function setupMcp(cwd, namespace, { silent = false } = {}) {
426
474
  * Called by `aw nuke`. Returns number of files modified.
427
475
  */
428
476
  export function removeMcpConfig() {
477
+ const desktopPath = resolveDesktopConfigPath();
429
478
  const jsonTargets = [
430
479
  join(HOME, '.claude.json'),
431
480
  join(HOME, '.cursor', 'mcp.json'),
432
481
  join(HOME, '.claude', 'settings.json'),
433
482
  join(HOME, '.claude', 'mcp.json'),
434
483
  join(HOME, '.mcp.json'),
484
+ ...(desktopPath ? [desktopPath] : []),
435
485
  ];
436
486
 
437
487
  let removed = 0;
@@ -491,6 +541,7 @@ function tomlMcpHealth(filePath) {
491
541
 
492
542
  export function getMcpStatus(homeDir = HOME, env = process.env) {
493
543
  const prefs = loadMcpPreferences(homeDir);
544
+ const desktopPath = resolveDesktopConfigPath(homeDir);
494
545
  return {
495
546
  ...prefs,
496
547
  effectiveMode: isMcpEnabled(homeDir, env) ? ENABLED_MODE : DISABLED_MODE,
@@ -501,6 +552,7 @@ export function getMcpStatus(homeDir = HOME, env = process.env) {
501
552
  cursor: jsonMcpHealth(join(homeDir, '.cursor', 'mcp.json')),
502
553
  codex: tomlMcpHealth(join(homeDir, '.codex', 'config.toml')),
503
554
  eccCodex: tomlMcpHealth(join(homeDir, '.aw-ecc', '.codex', 'config.toml')),
555
+ desktop: desktopPath ? jsonMcpHealth(desktopPath) : null,
504
556
  };
505
557
  }
506
558
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghl-ai/aw",
3
- "version": "0.1.76",
3
+ "version": "0.1.78",
4
4
  "description": "Agentic Workspace CLI — pull, push & manage agents, skills and commands from the registry",
5
5
  "type": "module",
6
6
  "bin": {