@zhive/cli 0.5.0

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 (189) hide show
  1. package/README.md +118 -0
  2. package/dist/agent/analysis.js +160 -0
  3. package/dist/agent/app.js +122 -0
  4. package/dist/agent/chat-prompt.js +65 -0
  5. package/dist/agent/commands/registry.js +12 -0
  6. package/dist/agent/components/AsciiTicker.js +81 -0
  7. package/dist/agent/components/CommandInput.js +65 -0
  8. package/dist/agent/components/HoneycombBoot.js +291 -0
  9. package/dist/agent/components/Spinner.js +37 -0
  10. package/dist/agent/config.js +75 -0
  11. package/dist/agent/edit-section.js +59 -0
  12. package/dist/agent/fetch-rules.js +21 -0
  13. package/dist/agent/helpers.js +22 -0
  14. package/dist/agent/hooks/useAgent.js +480 -0
  15. package/dist/agent/memory-prompt.js +47 -0
  16. package/dist/agent/model.js +92 -0
  17. package/dist/agent/objects.js +1 -0
  18. package/dist/agent/process-lifecycle.js +18 -0
  19. package/dist/agent/prompt.js +353 -0
  20. package/dist/agent/run-headless.js +189 -0
  21. package/dist/agent/skills/index.js +2 -0
  22. package/dist/agent/skills/skill-parser.js +149 -0
  23. package/dist/agent/skills/types.js +1 -0
  24. package/dist/agent/theme.js +41 -0
  25. package/dist/agent/tools/index.js +76 -0
  26. package/dist/agent/tools/market/client.js +41 -0
  27. package/dist/agent/tools/market/index.js +3 -0
  28. package/dist/agent/tools/market/tools.js +518 -0
  29. package/dist/agent/tools/mindshare/client.js +124 -0
  30. package/dist/agent/tools/mindshare/index.js +3 -0
  31. package/dist/agent/tools/mindshare/tools.js +563 -0
  32. package/dist/agent/tools/read-skill-tool.js +30 -0
  33. package/dist/agent/tools/ta/index.js +1 -0
  34. package/dist/agent/tools/ta/indicators.js +201 -0
  35. package/dist/agent/types.js +1 -0
  36. package/dist/agents.js +110 -0
  37. package/dist/ai-providers.js +66 -0
  38. package/dist/avatar.js +34 -0
  39. package/dist/backtest/default-backtest-data.js +200 -0
  40. package/dist/backtest/fetch.js +41 -0
  41. package/dist/backtest/import.js +106 -0
  42. package/dist/backtest/index.js +10 -0
  43. package/dist/backtest/results.js +113 -0
  44. package/dist/backtest/runner.js +134 -0
  45. package/dist/backtest/storage.js +11 -0
  46. package/dist/backtest/types.js +1 -0
  47. package/dist/commands/create/ai-generate.js +126 -0
  48. package/dist/commands/create/commands/index.js +10 -0
  49. package/dist/commands/create/generate.js +73 -0
  50. package/dist/commands/create/presets/data.js +225 -0
  51. package/dist/commands/create/presets/formatting.js +81 -0
  52. package/dist/commands/create/presets/index.js +3 -0
  53. package/dist/commands/create/presets/options.js +307 -0
  54. package/dist/commands/create/presets/types.js +1 -0
  55. package/dist/commands/create/presets.js +613 -0
  56. package/dist/commands/create/ui/CreateApp.js +172 -0
  57. package/dist/commands/create/ui/steps/ApiKeyStep.js +89 -0
  58. package/dist/commands/create/ui/steps/AvatarStep.js +16 -0
  59. package/dist/commands/create/ui/steps/DoneStep.js +14 -0
  60. package/dist/commands/create/ui/steps/IdentityStep.js +125 -0
  61. package/dist/commands/create/ui/steps/NameStep.js +148 -0
  62. package/dist/commands/create/ui/steps/ScaffoldStep.js +59 -0
  63. package/dist/commands/create/ui/steps/SoulStep.js +21 -0
  64. package/dist/commands/create/ui/steps/StrategyStep.js +20 -0
  65. package/dist/commands/create/ui/steps/StreamingGenerationStep.js +56 -0
  66. package/dist/commands/create/ui/validation.js +34 -0
  67. package/dist/commands/create/validate-api-key.js +27 -0
  68. package/dist/commands/install.js +50 -0
  69. package/dist/commands/list/commands/index.js +7 -0
  70. package/dist/commands/list/ui/ListApp.js +79 -0
  71. package/dist/commands/migrate-templates/commands/index.js +9 -0
  72. package/dist/commands/migrate-templates/migrate.js +87 -0
  73. package/dist/commands/migrate-templates/ui/MigrateApp.js +132 -0
  74. package/dist/commands/run/commands/index.js +17 -0
  75. package/dist/commands/run/run-headless.js +111 -0
  76. package/dist/commands/shared/theme.js +57 -0
  77. package/dist/commands/shared/welcome.js +304 -0
  78. package/dist/commands/start/commands/backtest.js +35 -0
  79. package/dist/commands/start/commands/index.js +62 -0
  80. package/dist/commands/start/commands/prediction.js +73 -0
  81. package/dist/commands/start/commands/skills.js +44 -0
  82. package/dist/commands/start/commands/skills.test.js +140 -0
  83. package/dist/commands/start/hooks/types.js +1 -0
  84. package/dist/commands/start/hooks/useAgent.js +177 -0
  85. package/dist/commands/start/hooks/useChat.js +266 -0
  86. package/dist/commands/start/hooks/usePollActivity.js +45 -0
  87. package/dist/commands/start/hooks/utils.js +152 -0
  88. package/dist/commands/start/services/backtest/default-backtest-data.js +200 -0
  89. package/dist/commands/start/services/backtest/fetch.js +42 -0
  90. package/dist/commands/start/services/backtest/import.js +109 -0
  91. package/dist/commands/start/services/backtest/index.js +10 -0
  92. package/dist/commands/start/services/backtest/results.js +113 -0
  93. package/dist/commands/start/services/backtest/runner.js +103 -0
  94. package/dist/commands/start/services/backtest/storage.js +11 -0
  95. package/dist/commands/start/services/backtest/types.js +1 -0
  96. package/dist/commands/start/services/command-registry.js +13 -0
  97. package/dist/commands/start/ui/AsciiTicker.js +81 -0
  98. package/dist/commands/start/ui/CommandInput.js +65 -0
  99. package/dist/commands/start/ui/HoneycombBoot.js +291 -0
  100. package/dist/commands/start/ui/PollText.js +23 -0
  101. package/dist/commands/start/ui/PredictionsPanel.js +88 -0
  102. package/dist/commands/start/ui/SelectAgentApp.js +93 -0
  103. package/dist/commands/start/ui/Spinner.js +29 -0
  104. package/dist/commands/start/ui/SpinnerContext.js +20 -0
  105. package/dist/commands/start/ui/app.js +36 -0
  106. package/dist/commands/start-all/AgentProcessManager.js +98 -0
  107. package/dist/commands/start-all/commands/index.js +24 -0
  108. package/dist/commands/start-all/ui/Dashboard.js +91 -0
  109. package/dist/components/AsciiTicker.js +81 -0
  110. package/dist/components/CharacterSummaryCard.js +33 -0
  111. package/dist/components/CodeBlock.js +11 -0
  112. package/dist/components/ColoredStats.js +18 -0
  113. package/dist/components/Header.js +10 -0
  114. package/dist/components/HoneycombLoader.js +190 -0
  115. package/dist/components/InputGuard.js +6 -0
  116. package/dist/components/MultiSelectPrompt.js +45 -0
  117. package/dist/components/SelectPrompt.js +20 -0
  118. package/dist/components/Spinner.js +16 -0
  119. package/dist/components/StepIndicator.js +31 -0
  120. package/dist/components/StreamingText.js +50 -0
  121. package/dist/components/TextPrompt.js +28 -0
  122. package/dist/components/stdout-spinner.js +48 -0
  123. package/dist/config.js +28 -0
  124. package/dist/create/CreateApp.js +153 -0
  125. package/dist/create/ai-generate.js +147 -0
  126. package/dist/create/generate.js +73 -0
  127. package/dist/create/steps/ApiKeyStep.js +97 -0
  128. package/dist/create/steps/AvatarStep.js +16 -0
  129. package/dist/create/steps/BioStep.js +14 -0
  130. package/dist/create/steps/DoneStep.js +14 -0
  131. package/dist/create/steps/IdentityStep.js +163 -0
  132. package/dist/create/steps/NameStep.js +71 -0
  133. package/dist/create/steps/ScaffoldStep.js +58 -0
  134. package/dist/create/steps/SoulStep.js +58 -0
  135. package/dist/create/steps/StrategyStep.js +58 -0
  136. package/dist/create/validate-api-key.js +47 -0
  137. package/dist/create/welcome.js +304 -0
  138. package/dist/index.js +60 -0
  139. package/dist/list/ListApp.js +79 -0
  140. package/dist/load-agent-env.js +30 -0
  141. package/dist/migrate-templates/MigrateApp.js +131 -0
  142. package/dist/migrate-templates/migrate.js +86 -0
  143. package/dist/presets.js +613 -0
  144. package/dist/shared/agent/agent-runtime.js +144 -0
  145. package/dist/shared/agent/analysis.js +171 -0
  146. package/dist/shared/agent/helpers.js +1 -0
  147. package/dist/shared/agent/prompts/chat-prompt.js +60 -0
  148. package/dist/shared/agent/prompts/megathread.js +202 -0
  149. package/dist/shared/agent/prompts/memory-prompt.js +47 -0
  150. package/dist/shared/agent/prompts/prompt.js +18 -0
  151. package/dist/shared/agent/skills/index.js +2 -0
  152. package/dist/shared/agent/skills/skill-parser.js +167 -0
  153. package/dist/shared/agent/skills/skill-parser.test.js +190 -0
  154. package/dist/shared/agent/skills/types.js +1 -0
  155. package/dist/shared/agent/tools/edit-section.js +60 -0
  156. package/dist/shared/agent/tools/execute-skill-tool.js +134 -0
  157. package/dist/shared/agent/tools/fetch-rules.js +22 -0
  158. package/dist/shared/agent/tools/formatting.js +48 -0
  159. package/dist/shared/agent/tools/index.js +87 -0
  160. package/dist/shared/agent/tools/market/client.js +41 -0
  161. package/dist/shared/agent/tools/market/index.js +3 -0
  162. package/dist/shared/agent/tools/market/tools.js +497 -0
  163. package/dist/shared/agent/tools/mindshare/client.js +124 -0
  164. package/dist/shared/agent/tools/mindshare/index.js +3 -0
  165. package/dist/shared/agent/tools/mindshare/tools.js +167 -0
  166. package/dist/shared/agent/tools/read-skill-tool.js +30 -0
  167. package/dist/shared/agent/tools/ta/index.js +1 -0
  168. package/dist/shared/agent/tools/ta/indicators.js +201 -0
  169. package/dist/shared/agent/types.js +1 -0
  170. package/dist/shared/agent/utils.js +43 -0
  171. package/dist/shared/config/agent.js +177 -0
  172. package/dist/shared/config/ai-providers.js +156 -0
  173. package/dist/shared/config/config.js +22 -0
  174. package/dist/shared/config/constant.js +8 -0
  175. package/dist/shared/config/env-loader.js +30 -0
  176. package/dist/shared/types.js +1 -0
  177. package/dist/start/AgentProcessManager.js +98 -0
  178. package/dist/start/Dashboard.js +92 -0
  179. package/dist/start/SelectAgentApp.js +81 -0
  180. package/dist/start/StartApp.js +189 -0
  181. package/dist/start/patch-headless.js +101 -0
  182. package/dist/start/patch-managed-mode.js +142 -0
  183. package/dist/start/start-command.js +24 -0
  184. package/dist/theme.js +54 -0
  185. package/package.json +68 -0
  186. package/templates/components/HoneycombBoot.tsx +343 -0
  187. package/templates/fetch-rules.ts +23 -0
  188. package/templates/skills/mindshare/SKILL.md +197 -0
  189. package/templates/skills/ta/SKILL.md +179 -0
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: ta
3
+ description: >
4
+ Technical analysis for crypto trading signals. Use when (1) signal mentions
5
+ price levels, targets, or stop losses, (2) references chart patterns like
6
+ breakout, support, resistance, (3) claims momentum shift or trend reversal,
7
+ (4) makes time-sensitive entry/exit recommendations. Triggers on: "RSI",
8
+ "MACD", "Bollinger", "oversold", "overbought", "support", "resistance",
9
+ "breakout", "momentum".
10
+ compatibility: Requires market_* tools from hive-cli.
11
+ ---
12
+
13
+ # Technical Analysis Knowledge
14
+
15
+ Strategic guidance for applying technical analysis to crypto trading signals.
16
+
17
+ ## Decision Framework: When to Use TA
18
+
19
+ **Use TA when the signal:**
20
+ - Mentions specific price levels, targets, or stop losses
21
+ - References chart patterns (breakout, support, resistance, consolidation)
22
+ - Claims momentum shift or trend reversal
23
+ - Makes time-sensitive entry/exit recommendations
24
+
25
+ **Skip TA when the signal:**
26
+ - Is purely fundamental (team news, partnerships, protocol upgrades)
27
+ - Discusses long-term thesis without actionable price levels
28
+ - Focuses on narrative or sentiment without technical claims
29
+ - Is about assets too illiquid for meaningful TA (sub-$1M daily volume)
30
+
31
+ **One-indicator rule:** For most signals, one well-chosen indicator is enough. Adding more often creates noise without improving conviction.
32
+
33
+ ## Signal Analysis Workflow
34
+
35
+ When you receive a trading signal, follow this sequence:
36
+
37
+ ### Step 1: Establish Context
38
+ Get current price first. This anchors everything else:
39
+ - Is the signal's mentioned price still relevant?
40
+ - Has the market already moved past the entry point?
41
+ - What's the 24h momentum direction?
42
+
43
+ ### Step 2: Match Indicator to Claim
44
+ Select ONE indicator based on what the signal claims:
45
+
46
+ | Signal Claims | Use This |
47
+ |---------------|----------|
48
+ | "Oversold bounce" or "overbought pullback" | RSI |
49
+ | "Breaking out" or "breaking down" | Bollinger Bands |
50
+ | "Momentum shifting" or "trend reversing" | MACD |
51
+ | "Above/below key moving average" | SMA or EMA |
52
+ | "At support/resistance" | Price + recent OHLC |
53
+
54
+ ### Step 3: Validate or Contradict
55
+ Compare indicator reading against the signal's claim:
56
+ - **Confirms:** Indicator supports the thesis → higher conviction
57
+ - **Neutral:** Indicator inconclusive → use other factors
58
+ - **Contradicts:** Indicator opposes the thesis → lower conviction, note in analysis
59
+
60
+ ### Step 4: State Your Finding
61
+ Be direct: "RSI at 28 confirms oversold conditions" or "RSI at 55 does not support oversold claim."
62
+
63
+ ## Indicator Selection Guide
64
+
65
+ ### RSI (Momentum Exhaustion)
66
+ **Best for:** Signals claiming overbought/oversold conditions or momentum exhaustion.
67
+
68
+ Use RSI when:
69
+ - Signal says "oversold bounce incoming" → check if RSI < 30
70
+ - Signal says "overbought, expect pullback" → check if RSI > 70
71
+ - Signal claims momentum is shifting
72
+
73
+ Don't use RSI when:
74
+ - Asset is in a strong trend (RSI can stay overbought/oversold for weeks)
75
+ - Signal is about breakouts (use Bollinger instead)
76
+
77
+ ### MACD (Trend Direction)
78
+ **Best for:** Signals claiming trend changes or momentum shifts.
79
+
80
+ Use MACD when:
81
+ - Signal claims "momentum turning bullish/bearish"
82
+ - Signal mentions "trend reversal"
83
+ - You need to confirm direction, not just magnitude
84
+
85
+ Read the histogram, not just the lines. Shrinking histogram often precedes crossover.
86
+
87
+ ### Bollinger Bands (Volatility & Range)
88
+ **Best for:** Breakout/breakdown signals and volatility plays.
89
+
90
+ Use Bollinger when:
91
+ - Signal claims price is "breaking out" → is price actually outside bands?
92
+ - Signal mentions "consolidation before move" → are bands squeezing?
93
+ - You need to assess if current price is extended
94
+
95
+ Bandwidth squeeze (bands contracting) often precedes large moves in either direction.
96
+
97
+ ### Moving Averages (Trend Context)
98
+ **Best for:** Understanding the broader trend context.
99
+
100
+ Use SMA/EMA when:
101
+ - Signal mentions specific MAs (50-day, 200-day)
102
+ - You need to determine if price is in uptrend or downtrend
103
+ - Signal claims "golden cross" or "death cross"
104
+
105
+ Common periods: 20 (short-term), 50 (medium-term), 200 (long-term trend).
106
+
107
+ ## Interpretation Patterns
108
+
109
+ ### Confirming vs. Contradicting Signals
110
+
111
+ **Strong confirmation pattern:**
112
+ - Signal: "BTC oversold, expecting bounce"
113
+ - RSI: 25 (deeply oversold)
114
+ - Your take: "RSI confirms oversold at 25, supporting bounce thesis"
115
+
116
+ **Clear contradiction pattern:**
117
+ - Signal: "ETH overbought, short opportunity"
118
+ - RSI: 58 (neutral)
119
+ - Your take: "RSI at 58 does not support overbought claim; momentum neutral"
120
+
121
+ **Nuanced interpretation:**
122
+ - Signal: "SOL breaking out of consolidation"
123
+ - Bollinger: Price at upper band, but bands not particularly tight
124
+ - Your take: "Price touching upper band but no prior squeeze; breakout less convincing"
125
+
126
+ ### Reading Multiple Timeframes
127
+
128
+ If signal doesn't specify timeframe, default to daily. But consider:
129
+ - Hourly: Short-term momentum, intraday signals
130
+ - Daily: Standard swing trading, most signals
131
+ - Weekly: Trend context for longer-term positions
132
+
133
+ Timeframe should match the signal's implied holding period.
134
+
135
+ ## Common Pitfalls
136
+
137
+ ### Over-Analyzing
138
+ **Problem:** Using 5 indicators when 1 would suffice.
139
+ **Fix:** Pick the ONE indicator that directly tests the signal's claim.
140
+
141
+ ### Confirmation Bias
142
+ **Problem:** Cherry-picking indicators that agree with the signal.
143
+ **Fix:** Pick indicator BEFORE looking at it, based on what's being claimed.
144
+
145
+ ### Ignoring Context
146
+ **Problem:** "RSI is 32" without knowing what that means for this asset.
147
+ **Fix:** Some assets run hot (RSI rarely below 40), others are volatile. State the reading and what it suggests, not just the number.
148
+
149
+ ### Lagging Indicator Trap
150
+ **Problem:** All these indicators use historical data. By the time MACD crosses, the move may be mostly done.
151
+ **Fix:** Use indicators to validate claims, not predict futures. "The signal claimed X, indicator reading is Y" — not "indicator says price will go up."
152
+
153
+ ### False Precision
154
+ **Problem:** "RSI at 69.7 suggests we're approaching overbought."
155
+ **Fix:** Treat zones, not precise numbers. 65-75 is "approaching overbought," not a decimal reading.
156
+
157
+ ## Available Tools
158
+
159
+ The following market tools are available for technical analysis:
160
+
161
+ - `market_getPrice` - Get price at a specific timestamp
162
+ - `market_getOHLC` - Get historical OHLC candlestick data
163
+ - `market_getSMA` - Calculate Simple Moving Average
164
+ - `market_getEMA` - Calculate Exponential Moving Average
165
+ - `market_getRSI` - Calculate Relative Strength Index
166
+ - `market_getMACD` - Calculate MACD indicator
167
+ - `market_getBollinger` - Calculate Bollinger Bands
168
+
169
+ ## Output Format
170
+
171
+ When presenting TA findings in your analysis:
172
+
173
+ ```
174
+ **Technical Check:** [Indicator] at [reading]
175
+ - [What this reading means in context]
176
+ - [Whether it confirms, contradicts, or is neutral to signal's claim]
177
+ ```
178
+
179
+ Keep it brief. TA is one input to conviction, not the whole analysis.