@litfamily/litgravity 0.1.9 → 0.1.10

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/lib/doctor.mjs CHANGED
@@ -9,7 +9,8 @@ import { HOST_TOOLS, hostToolOk } from './host-tools.mjs';
9
9
  import { isOurs, replacedStatusLine, stripBom } from './statusline.mjs';
10
10
  import { readAgentFileMode, ruleFileState } from './agent-file.mjs';
11
11
  import { checkUpdate } from './update-check.mjs';
12
- import { SKILL_ROUTES, MOVED_SKILLS, movedInstallLine } from '../plugin/hooks/lib/routes.mjs';
12
+ import { SKILL_ROUTES, MOVED_SKILLS, EXTENSIONS_CLI, extensionLines } from '../plugin/hooks/lib/routes.mjs';
13
+ import { checkFindings, extensionPaths } from './extension-manager.mjs';
13
14
  import { oldRuntimeDir } from '../plugin/hooks/lib/extensions.mjs';
14
15
 
15
16
  // Hooks, rules and the first agy release that fires SessionStart. Probed on 1.4.3.
@@ -148,7 +149,14 @@ export async function doctor({ env = process.env, flags = {}, cwd = process.cwd(
148
149
 
149
150
  const moved = Object.entries(MOVED_SKILLS);
150
151
  if (moved.length) {
151
- add('INFO', 'moved skills', `${moved.length} are pointer stubs here; the skills are LitFamily extensions in wjgoarxiv-skills: ${moved.map(([id, family]) => `${id} (${family})`).join(', ')}`, movedInstallLine('<id>'));
152
+ add('INFO', 'moved skills', `${moved.length} are pointer stubs here; the skills are LitFamily extensions in wjgoarxiv-skills: ${moved.map(([id, family]) => `${id} (${family})`).join(', ')}`, [`${EXTENSIONS_CLI} install <id> (a dry run; add --yes)`, 'or by hand, the same four steps:', ...extensionLines('<id>')].join('\n'));
153
+ const ep = extensionPaths(env, cwd);
154
+ const findings = checkFindings(ep);
155
+ const actions = findings.filter((f) => f.level === 'action');
156
+ const installed = Object.keys(MOVED_SKILLS).filter((id) => ['user', 'project'].some((s) => existsSync(join(ep.roots[s], id, '.litfamily-extension.json'))));
157
+ add(actions.length ? 'WARN' : 'PASS', 'extensions', actions.length
158
+ ? `${actions.length} thing${actions.length === 1 ? '' : 's'} to look at: ${actions.map((f) => f.text).join('; ')}`
159
+ : `${installed.length} of ${moved.length} installed with a receipt; no duplicate or unreceipted copy`, `${EXTENSIONS_CLI} check`);
152
160
  }
153
161
  const runtime = oldRuntimeDir(p.data);
154
162
  if (existsSync(runtime)) {
@@ -192,7 +200,7 @@ export async function doctor({ env = process.env, flags = {}, cwd = process.cwd(
192
200
  print(`LitGravity ${version} doctor`);
193
201
  for (const c of checks) {
194
202
  print(`${c.status} ${c.name} — ${c.detail}`);
195
- if (c.fix && c.status !== 'PASS') print(` fix: ${c.fix}`);
203
+ if (c.fix && c.status !== 'PASS') print(` fix: ${c.fix.replaceAll('\n', '\n ')}`);
196
204
  }
197
205
  print('');
198
206
  print(summary.fail ? `LitGravity: ${summary.fail} problem${summary.fail === 1 ? '' : 's'} found, ${summary.warn} warning${summary.warn === 1 ? '' : 's'}.` : `LitGravity: ready${summary.warn ? `, ${summary.warn} warning${summary.warn === 1 ? '' : 's'}` : ''}.`);