servicemap 0.1.18 → 0.1.19

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.
Files changed (2) hide show
  1. package/bin/servicemap.mjs +17 -9
  2. package/package.json +1 -1
@@ -298,6 +298,7 @@ const additionalAgentWindowSize = 8;
298
298
  const dim = (value) => `\x1b[2m${value}\x1b[22m`;
299
299
  const green = (value) => `\x1b[32m${value}\x1b[39m`;
300
300
  const cyan = (value) => `\x1b[36m${value}\x1b[39m`;
301
+ let stableSourceStatus = '';
301
302
 
302
303
  function timelineStep(text) {
303
304
  console.log(`${green('◇')} ${text}`);
@@ -318,6 +319,9 @@ function renderSurvey(selected, cursor) {
318
319
  timelineStep(cyan('servicemap'));
319
320
  timelineStep(`Source: ${repositoryUrl}`);
320
321
  timelineStep(`Stable source: ${stableSourceRoot()}`);
322
+ if (stableSourceStatus) {
323
+ timelineStep(stableSourceStatus);
324
+ }
321
325
  timelineActive('Which agents do you want to install Servicemap to?');
322
326
  timelineLine('Universal (.agents/skills) — always included');
323
327
  for (const agent of universalAgents.slice(0, visibleUniversalLimit)) {
@@ -477,15 +481,18 @@ async function prepareStableSource(options) {
477
481
  try {
478
482
  if (existsSync(join(sourceRoot, '.git'))) {
479
483
  await withSpinner('Updating repository…', () => runSilent('git', ['pull', '--ff-only'], { cwd: sourceRoot }));
484
+ stableSourceStatus = 'Repository updated';
480
485
  timelineStep('Repository updated');
481
486
  } else {
482
487
  await rm(sourceRoot, { recursive: true, force: true });
483
488
  await withSpinner('Cloning repository…', () => runSilent('git', ['clone', '--depth', '1', repositoryUrl, sourceRoot]));
489
+ stableSourceStatus = 'Repository cloned';
484
490
  timelineStep('Repository cloned');
485
491
  }
486
492
  } catch (_error) {
487
493
  await rm(sourceRoot, { recursive: true, force: true });
488
494
  await cp(packageRoot, sourceRoot, { recursive: true });
495
+ stableSourceStatus = 'Repository unavailable; copied packaged source';
489
496
  timelineStep('Repository unavailable; copied packaged source');
490
497
  }
491
498
 
@@ -515,21 +522,12 @@ async function installIntoRoot(root, source, method, options) {
515
522
 
516
523
  async function installSkill(options) {
517
524
  let source = resolve(packageRoot, 'servicemap');
518
- const selectedTargets = options.survey && !options.yes
519
- ? [{ id: 'universal', label: 'Universal', root: universalRoot }, ...await runTargetSurvey()]
520
- : targetsForOptions(options);
521
- const roots = skillRootsForTargets(options, selectedTargets);
522
525
  const method = options.installMethod ?? 'symlink';
523
526
 
524
527
  if (!existsSync(source)) {
525
528
  throw new Error(`Bundled skill folder not found: ${source}`);
526
529
  }
527
530
 
528
- if (roots.length === 0) {
529
- console.log('No targets selected. Nothing was installed.');
530
- return;
531
- }
532
-
533
531
  if (!['copy', 'symlink'].includes(method)) {
534
532
  throw new Error(`Unknown install method "${method}". Use copy or symlink.`);
535
533
  }
@@ -541,6 +539,16 @@ async function installSkill(options) {
541
539
  }
542
540
  }
543
541
 
542
+ const selectedTargets = options.survey && !options.yes
543
+ ? [{ id: 'universal', label: 'Universal', root: universalRoot }, ...await runTargetSurvey()]
544
+ : targetsForOptions(options);
545
+ const roots = skillRootsForTargets(options, selectedTargets);
546
+
547
+ if (roots.length === 0) {
548
+ console.log('No targets selected. Nothing was installed.');
549
+ return;
550
+ }
551
+
544
552
  for (const root of roots) {
545
553
  await installIntoRoot(root, source, method, options);
546
554
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "servicemap",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "Generate an internal service map page or desktop app for a software project.",
5
5
  "type": "module",
6
6
  "bin": {