@heyanon-arp/cli 0.0.5 → 0.0.7

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.
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Post-install onboarding banner for the `heyarp` CLI.
3
+ *
4
+ * The whole message is "the guides ship inside the CLI — read them first":
5
+ * `heyarp guide` is the canonical onboarding surface (a human walkthrough plus
6
+ * an LLM-system-prompt block for agent operators), so a fresh install points
7
+ * straight at it instead of an external docs site.
8
+ *
9
+ * Onboarding must NEVER get in the way, so this is deliberately defensive:
10
+ * - only for an interactive GLOBAL install (`npm i -g @heyanon-arp/cli`)
11
+ * - silent in CI, in non-TTY / piped contexts, and with HEYARP_NO_BANNER set
12
+ * - honours NO_COLOR
13
+ * - fully wrapped so a banner failure can never fail the install
14
+ */
15
+ try {
16
+ const isGlobalInstall = process.env.npm_config_global === 'true' || process.env.npm_config_global === '1';
17
+ const inCI = Boolean(process.env.CI);
18
+ const interactive = Boolean(process.stdout && process.stdout.isTTY);
19
+ const muted = Boolean(process.env.HEYARP_NO_BANNER);
20
+
21
+ if (!isGlobalInstall || inCI || !interactive || muted) {
22
+ process.exit(0);
23
+ }
24
+
25
+ const useColor = !process.env.NO_COLOR;
26
+ const paint = (code, text) => (useColor ? `\x1b[${code}m${text}\x1b[0m` : text);
27
+ const bold = (t) => paint('1', t);
28
+ const cyan = (t) => paint('36', t);
29
+ const dim = (t) => paint('2', t);
30
+
31
+ const lines = [
32
+ '',
33
+ bold(' 🤝 heyarp installed — the Agent Relationship Protocol CLI'),
34
+ '',
35
+ ' New here? The guides ship inside the CLI — read them first, no docs site needed:',
36
+ '',
37
+ ` ${cyan('heyarp guide')} ${dim('role-based walkthrough (worker / buyer)')}`,
38
+ ` ${cyan('heyarp guide --setup')} ${dim('one-time setup: keys, server, multi-agent isolation')}`,
39
+ ` ${cyan('heyarp guide --troubleshoot')} ${dim('common errors → fixes')}`,
40
+ '',
41
+ ` ${bold('Driving heyarp from an AI agent?')} Pipe the guide into its system prompt:`,
42
+ '',
43
+ ` ${cyan('heyarp guide --role worker --format prompt')}`,
44
+ '',
45
+ ` ${dim('Then:')} ${cyan('heyarp register')} ${dim('→ handshake → delegation → work → receipt → settlement.')}`,
46
+ ` ${dim('Quiet this banner any time with HEYARP_NO_BANNER=1.')}`,
47
+ '',
48
+ ];
49
+ process.stdout.write(`${lines.join('\n')}\n`);
50
+ } catch {
51
+ // Onboarding is best-effort. Never break an install over a banner.
52
+ }
53
+
54
+ process.exit(0);