@gurulu/cli 0.1.3 → 0.2.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.
@@ -403,6 +403,9 @@ async function runInstallFlow(args, deps, scriptsDir) {
403
403
  log(deps, 'success', 'Patches applied.');
404
404
  }
405
405
  else {
406
+ if (args.autoInstrument) {
407
+ log(deps, 'info', `Auto-instrument: ${summary.instrumentation?.filesModified || 0} route files, ${summary.instrumentation?.eventsInstrumented || 0} events`);
408
+ }
406
409
  log(deps, 'info', 'Dry-run: skipping apply, npm install, env merge, and ingest test.');
407
410
  }
408
411
  // ---- 5. npm install --------------------------------------------------
@@ -526,6 +529,15 @@ async function runInstallFlow(args, deps, scriptsDir) {
526
529
  `${summary.instrumentation.eventsSkipped} skipped`);
527
530
  }
528
531
  log(deps, 'info', '');
532
+ // ---- Post-install guidance ---------------------------------------------
533
+ if (!summary.dryRun && summary.errors.length === 0) {
534
+ console.log('');
535
+ log(deps, 'info', '✓ Install complete! Next steps:');
536
+ log(deps, 'info', ` Run ${(0, ui_1.cyan)('gurulu doctor')} to verify setup health`);
537
+ log(deps, 'info', ` Run ${(0, ui_1.cyan)('gurulu events tail')} to watch live events`);
538
+ log(deps, 'info', ` Visit ${(0, ui_1.cyan)('https://gurulu.io/dashboard')} to view analytics`);
539
+ console.log('');
540
+ }
529
541
  return summary;
530
542
  }
531
543
  function repoHashOf(repoRoot, remoteUrl = null) {
@@ -633,10 +645,41 @@ async function runAuthenticatedInstallFlow(args, authDeps, installDeps, scriptsD
633
645
  intent = await authDeps.intent.analyze(signals);
634
646
  intentRecord.analyzed = true;
635
647
  intentRecord.vertical = intent.vertical;
648
+ if (intent.analyzerMode === 'heuristic') {
649
+ installDeps.log?.warn('⚠ LLM unavailable — using rule-based intent discovery. Results may be less precise.');
650
+ }
636
651
  }
637
652
  catch (err) {
638
653
  installDeps.log?.warn(`Intent analyzer failed: ${err.message}`);
654
+ installDeps.log?.warn('⚠ Falling back to built-in generic event set.');
639
655
  intentRecord.error = `analyze_failed:${err.message}`;
656
+ // Client-side fallback: produce a minimal generic intent so
657
+ // auto-instrument and pre-seed still work even when the API is down.
658
+ intent = {
659
+ vertical: 'generic',
660
+ confidence: 'low',
661
+ reasoning: 'API unavailable — using built-in generic fallback.',
662
+ analyzerMode: 'heuristic',
663
+ alternativeVerticals: [],
664
+ events: [
665
+ { name: '$page_view', category: 'engagement', source: 'inferred:pattern', properties: [], confidence: 1.0, reasoning: 'Baseline page impression.' },
666
+ { name: '$session_start', category: 'engagement', source: 'inferred:pattern', properties: [], confidence: 1.0, reasoning: 'Session boundary.' },
667
+ { name: '$signup', category: 'acquisition', source: 'inferred:pattern', properties: [{ name: 'method', type: 'string' }], confidence: 0.9, reasoning: 'New account signal.' },
668
+ { name: '$login', category: 'engagement', source: 'inferred:pattern', properties: [{ name: 'method', type: 'string' }], confidence: 0.9, reasoning: 'Returning user signal.' },
669
+ { name: '$logout', category: 'engagement', source: 'inferred:pattern', properties: [], confidence: 0.9, reasoning: 'Session end.' },
670
+ { name: '$first_action', category: 'activation', source: 'inferred:pattern', properties: [], confidence: 0.8, reasoning: 'First meaningful interaction.' },
671
+ { name: 'click', category: 'engagement', source: 'inferred:pattern', properties: [{ name: 'selector', type: 'string' }], confidence: 1.0, reasoning: 'User clicks.' },
672
+ { name: 'scroll_depth', category: 'engagement', source: 'inferred:pattern', properties: [{ name: 'depth', type: 'number' }], confidence: 1.0, reasoning: 'Scroll engagement.' },
673
+ { name: 'form_submit', category: 'engagement', source: 'inferred:pattern', properties: [{ name: 'form_id', type: 'string' }], confidence: 0.9, reasoning: 'Form completion.' },
674
+ { name: 'engaged_session', category: 'engagement', source: 'inferred:pattern', properties: [], confidence: 1.0, reasoning: 'Quality session marker.' },
675
+ { name: '$search', category: 'engagement', source: 'inferred:pattern', properties: [{ name: 'query', type: 'string' }], confidence: 0.7, reasoning: 'Search intent.' },
676
+ { name: '$error', category: 'engagement', source: 'inferred:pattern', properties: [{ name: 'message', type: 'string' }], confidence: 0.8, reasoning: 'Client error tracking.' },
677
+ ],
678
+ funnels: [
679
+ { name: 'Signup Flow', category: 'acquisition', steps: ['$page_view', '$signup', '$login'], reasoning: 'Page view to signup to first login.' },
680
+ { name: 'Engagement', category: 'engagement', steps: ['$page_view', 'scroll_depth', 'engaged_session'], reasoning: 'Page view to scroll to engaged session.' },
681
+ ],
682
+ };
640
683
  }
641
684
  if (intent) {
642
685
  const io = authDeps.intent.io || {
package/dist/index.js CHANGED
@@ -208,20 +208,25 @@ const db_1 = require("./commands/db");
208
208
  .option('skip-env', { type: 'boolean', describe: 'Skip .env file merge' })
209
209
  .option('yes', { type: 'boolean', alias: 'y', describe: 'Non-interactive (assume yes)' })
210
210
  .option('ingest-url', { type: 'string', describe: 'Override ingest base URL' })
211
- .option('verify', { type: 'boolean', describe: 'Live smoke test after install' })
211
+ .option('verify', { type: 'boolean', default: true, describe: 'Live smoke test after install' })
212
212
  .option('skip-intent', { type: 'boolean', describe: 'Skip install-time intent discovery' })
213
213
  .option('intent-dry-run', { type: 'boolean', describe: 'Show intent proposal without pre-seeding' })
214
214
  .option('vertical', { type: 'string', describe: 'Vertical hint for intent analyzer' })
215
215
  // BEGIN: Agent B (Phase 18.7) — auto-instrument opt-in flag
216
216
  .option('auto-instrument', {
217
217
  type: 'boolean',
218
- description: 'Also auto-instrument route handlers with gurulu.track() calls (opt-in)',
219
- default: false,
218
+ description: 'Also auto-instrument route handlers with gurulu.track() calls',
219
+ default: true,
220
220
  })
221
221
  .option('auto-properties', {
222
222
  type: 'boolean',
223
+ default: true,
224
+ description: 'Ask Minimax to propose properties for each auto-instrumented handler (Phase 20 W1 A2)',
225
+ })
226
+ .option('skip-verify', {
227
+ type: 'boolean',
223
228
  default: false,
224
- description: 'Opt-in: ask Minimax to propose properties for each auto-instrumented handler (Phase 20 W1 A2)',
229
+ description: 'Skip live smoke verification after install',
225
230
  }),
226
231
  // END: Agent B (Phase 18.7)
227
232
  (args) => {
@@ -239,7 +244,7 @@ const db_1 = require("./commands/db");
239
244
  skipEnv: args['skip-env'],
240
245
  yes: args.yes,
241
246
  ingestUrl: args['ingest-url'],
242
- verify: args.verify,
247
+ verify: args['skip-verify'] ? false : args.verify,
243
248
  profile: args.profile,
244
249
  skipIntent: args['skip-intent'],
245
250
  intentDryRun: args['intent-dry-run'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gurulu/cli",
3
- "version": "0.1.3",
3
+ "version": "0.2.1",
4
4
  "description": "Gurulu.io CLI — setup analytics in seconds",
5
5
  "bin": {
6
6
  "gurulu": "bin/gurulu.js"