@sureshotlabs/hunch-agent-tools 0.1.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.
- package/README.md +260 -0
- package/build/hunch-agent.js +17724 -0
- package/build/hunch-mcp.js +33699 -0
- package/package.json +41 -0
- package/skills/hunch-trading/SKILL.md +67 -0
- package/skills/hunch-trading/agents/openai.yaml +7 -0
- package/skills/hunch-trading/bin/hunch-agent.js +17724 -0
- package/skills/hunch-trading/references/tools.md +125 -0
- package/skills/hunch-trading/scripts/hunch +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# Hunch Agent Tools
|
|
2
|
+
|
|
3
|
+
Public read-only MCP server, CLI, and Codex plugin for Hunch prediction-market
|
|
4
|
+
research.
|
|
5
|
+
|
|
6
|
+
This repository is intentionally separate from `hunch-monorepo`. The shipped
|
|
7
|
+
package does not log in, read private account state, create intents, execute
|
|
8
|
+
actions, sign wallet payloads, trade, bridge, redeem, fund, convert, transfer,
|
|
9
|
+
or withdraw. It only calls public Hunch read APIs.
|
|
10
|
+
|
|
11
|
+
## Packages
|
|
12
|
+
|
|
13
|
+
- `packages/hunch-agent-client`: internal TypeScript client and response
|
|
14
|
+
shaping helpers.
|
|
15
|
+
- `apps/mcp-hunch`: MCP stdio server and `hunch-agent` CLI binary.
|
|
16
|
+
- `skills/hunch-trading`: Codex skill wrapper and references.
|
|
17
|
+
- `.codex-plugin/plugin.json` and `.mcp.json`: Codex plugin distribution.
|
|
18
|
+
- `plugin-dist/`: generated, ignored bundled runtime files for local plugin
|
|
19
|
+
testing.
|
|
20
|
+
|
|
21
|
+
## Public Scope
|
|
22
|
+
|
|
23
|
+
Available read surfaces:
|
|
24
|
+
|
|
25
|
+
- Feed search and browsing.
|
|
26
|
+
- Market and event details.
|
|
27
|
+
- Discovery map data and ranked discovery top lists.
|
|
28
|
+
- Cross-venue arbitrage clusters.
|
|
29
|
+
- Exact market alternatives across matched venues.
|
|
30
|
+
- Similar markets and events.
|
|
31
|
+
- Public holders and recent public trade tape.
|
|
32
|
+
- Market/event signals.
|
|
33
|
+
- Market and event price history.
|
|
34
|
+
- Public tracking overview, wallet intelligence, wallet activity, wallet
|
|
35
|
+
positions, wallet time series, and wallet signals.
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm install
|
|
41
|
+
pnpm check
|
|
42
|
+
pnpm build
|
|
43
|
+
pnpm -F @sureshotlabs/hunch-agent-tools run dev:mcp
|
|
44
|
+
pnpm -F @sureshotlabs/hunch-agent-tools run dev:cli -- discovery-browse --venues polymarket,kalshi --limit 10 --json
|
|
45
|
+
pnpm -F @sureshotlabs/hunch-agent-tools run dev:cli -- discovery-search "election" --standard --json
|
|
46
|
+
skills/hunch-trading/scripts/hunch discovery-search "election" --json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Set `HUNCH_API_BASE_URL` to point at a local or production Hunch API. It
|
|
50
|
+
defaults to `https://api.hunch.trade`. Set `HUNCH_APP_BASE_URL` to control app
|
|
51
|
+
links in compact/standard responses. It defaults to
|
|
52
|
+
`https://app.hunch.trade`.
|
|
53
|
+
|
|
54
|
+
CLI and MCP tools support `responseMode` values:
|
|
55
|
+
|
|
56
|
+
- `compact` (default): small agent-friendly payloads.
|
|
57
|
+
- `standard`: includes descriptions, metadata, and larger previews.
|
|
58
|
+
- `full`: raw backend JSON for debugging or one-off inspection.
|
|
59
|
+
|
|
60
|
+
The CLI aliases these as `--compact`, `--standard`, `--full`, or
|
|
61
|
+
`--response-mode <mode>`.
|
|
62
|
+
|
|
63
|
+
## MCP Tools
|
|
64
|
+
|
|
65
|
+
- `hunch_search_discovery`
|
|
66
|
+
- `hunch_browse_discovery`
|
|
67
|
+
- `hunch_get_discovery_top_lists`
|
|
68
|
+
- `hunch_get_discovery_map`
|
|
69
|
+
- `hunch_get_market_detail`
|
|
70
|
+
- `hunch_get_event_detail`
|
|
71
|
+
- `hunch_get_arbitrage_clusters`
|
|
72
|
+
- `hunch_get_market_alternatives`
|
|
73
|
+
- `hunch_get_similar_markets`
|
|
74
|
+
- `hunch_get_similar_events`
|
|
75
|
+
- `hunch_get_market_holders`
|
|
76
|
+
- `hunch_get_market_price_history`
|
|
77
|
+
- `hunch_get_event_price_history`
|
|
78
|
+
- `hunch_get_tracking_overview`
|
|
79
|
+
- `hunch_get_wallet_intel`
|
|
80
|
+
- `hunch_get_wallet_activity`
|
|
81
|
+
- `hunch_get_wallet_positions`
|
|
82
|
+
- `hunch_get_wallet_series`
|
|
83
|
+
- `hunch_get_wallet_signals`
|
|
84
|
+
- `hunch_get_signals`
|
|
85
|
+
- `hunch_get_trades`
|
|
86
|
+
|
|
87
|
+
The tools expose backend filters instead of adding local post-processing.
|
|
88
|
+
Compact and standard responses include Hunch app links such as event, market,
|
|
89
|
+
tracking wallet, tracking overview, and arbitrage URLs so agents do not need to
|
|
90
|
+
present raw IDs as the primary user-facing output.
|
|
91
|
+
|
|
92
|
+
For event-page context, combine event detail, signals, similar events, price
|
|
93
|
+
history, trades, and market holders. Holders are market-scoped, so use the
|
|
94
|
+
selected market ID from event detail. Use market alternatives when the user
|
|
95
|
+
wants exact cross-venue versions of the same selected outcome; use similar
|
|
96
|
+
markets/events when they want broader semantic neighbors.
|
|
97
|
+
|
|
98
|
+
Price history uses `range` for the time window and `bucketMinutes` for candle
|
|
99
|
+
size; `interval` remains a legacy alias for `range`.
|
|
100
|
+
|
|
101
|
+
## Packaging
|
|
102
|
+
|
|
103
|
+
Run local release packaging after a successful build:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pnpm release:local
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Artifacts are written under ignored `artifacts/`:
|
|
110
|
+
|
|
111
|
+
- `artifacts/npm/sureshotlabs-hunch-agent-tools-*.tgz` for the self-contained
|
|
112
|
+
npm MCP/CLI package.
|
|
113
|
+
- `artifacts/plugin/hunch-agent-tools-plugin.tar.gz` for plugin installs.
|
|
114
|
+
- `artifacts/skill/hunch-trading-skill.tar.gz` for standalone skill installs.
|
|
115
|
+
|
|
116
|
+
Use `--dry-run` with `pack:npm`, `pack:plugin`, or `pack:skill` to verify the
|
|
117
|
+
file list without creating tarballs.
|
|
118
|
+
|
|
119
|
+
## Install Surfaces
|
|
120
|
+
|
|
121
|
+
End users have four supported ways to use the package:
|
|
122
|
+
|
|
123
|
+
- **MCP server via npm:** best default for Codex, Claude Code, and other MCP
|
|
124
|
+
clients. This exposes Hunch research tools to the agent.
|
|
125
|
+
- **CLI via npm:** best for shell usage, smoke tests, and scripts.
|
|
126
|
+
- **Codex plugin:** best for Codex users who want the MCP server plus bundled
|
|
127
|
+
Skill installed together through a plugin marketplace entry.
|
|
128
|
+
- **Standalone Skill:** best when an agent only needs reusable instructions and
|
|
129
|
+
the lightweight `scripts/hunch` CLI wrapper.
|
|
130
|
+
|
|
131
|
+
All install surfaces are public and read-only. They do not log in, read private
|
|
132
|
+
accounts, create intents, execute, trade, bridge, redeem, transfer, withdraw,
|
|
133
|
+
convert, fund, or sign.
|
|
134
|
+
|
|
135
|
+
### MCP npm package
|
|
136
|
+
|
|
137
|
+
The npm artifact is an `npx`-runnable MCP server package. It bundles the MCP
|
|
138
|
+
server and Hunch client into one executable, so it does not require installing
|
|
139
|
+
workspace packages separately.
|
|
140
|
+
|
|
141
|
+
The same npm tarball also includes `skills/hunch-trading/` as a portable
|
|
142
|
+
read-only Skill folder. The package root remains the npm/MCP package root;
|
|
143
|
+
the Skill root is the subfolder containing `SKILL.md`. This keeps
|
|
144
|
+
`npx -y @sureshotlabs/hunch-agent-tools@latest` launching the MCP server while
|
|
145
|
+
also making the bundled Skill copyable into a Codex/agent skills directory when
|
|
146
|
+
that install surface is preferred. The Skill wrapper uses its bundled
|
|
147
|
+
`skills/hunch-trading/bin/hunch-agent.js` CLI, so it does not require workspace
|
|
148
|
+
packages after extraction.
|
|
149
|
+
|
|
150
|
+
After publishing `@sureshotlabs/hunch-agent-tools`, Codex can install it
|
|
151
|
+
directly:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
codex mcp remove hunch
|
|
155
|
+
codex mcp add hunch -- npx -y @sureshotlabs/hunch-agent-tools@latest
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Claude Code uses the same package:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
claude mcp remove hunch
|
|
162
|
+
claude mcp add --transport stdio hunch -- npx -y @sureshotlabs/hunch-agent-tools@latest
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### CLI npm usage
|
|
166
|
+
|
|
167
|
+
Use the CLI without installing globally:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npm exec --yes --package @sureshotlabs/hunch-agent-tools@latest -- hunch-agent discovery-search "election" --json
|
|
171
|
+
npm exec --yes --package @sureshotlabs/hunch-agent-tools@latest -- hunch-agent market-detail polymarket:123 --standard --json
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Or install it globally:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm install -g @sureshotlabs/hunch-agent-tools
|
|
178
|
+
hunch-agent discovery-browse --venues polymarket,kalshi --limit 10 --json
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The MCP server binary is `hunch-agent-tools` or `hunch-mcp`. The CLI binary is
|
|
182
|
+
`hunch-agent`.
|
|
183
|
+
|
|
184
|
+
For local tarball validation before publishing:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
pnpm release:local
|
|
188
|
+
npx -y ./artifacts/npm/sureshotlabs-hunch-agent-tools-0.1.1.tgz
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Publish with npm provenance from an authenticated environment:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm publish ./artifacts/npm/sureshotlabs-hunch-agent-tools-0.1.1.tgz --provenance
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Codex Plugin
|
|
198
|
+
|
|
199
|
+
The repository root is the plugin source. The packaged artifact is a Codex
|
|
200
|
+
local marketplace root matching Codex's installed marketplace layout:
|
|
201
|
+
|
|
202
|
+
- `.agents/plugins/marketplace.json`
|
|
203
|
+
- `plugins/hunch-agent-tools/.codex-plugin/plugin.json`
|
|
204
|
+
- `plugins/hunch-agent-tools/.mcp.json`
|
|
205
|
+
- `plugins/hunch-agent-tools/skills/hunch-trading`
|
|
206
|
+
|
|
207
|
+
Run `pnpm build` before local testing. The build generates ignored runtime
|
|
208
|
+
bundles under `plugin-dist/` and `skills/hunch-trading/bin/`.
|
|
209
|
+
|
|
210
|
+
The bundled MCP config does not rely on Codex launching from the plugin root.
|
|
211
|
+
It locates `plugin-dist/hunch-mcp.js` from Codex's installed plugin cache or
|
|
212
|
+
from the extracted local marketplace under `~/.codex/plugins`.
|
|
213
|
+
|
|
214
|
+
For a local plugin install test, package and extract the self-contained local
|
|
215
|
+
marketplace:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
pnpm release:local
|
|
219
|
+
mkdir -p ~/.codex/plugins
|
|
220
|
+
tar -xzf artifacts/plugin/hunch-agent-tools-plugin.tar.gz -C ~/.codex/plugins
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Then register the extracted local marketplace in `~/.codex/config.toml`:
|
|
224
|
+
|
|
225
|
+
```toml
|
|
226
|
+
[marketplaces.hunch-agent-tools]
|
|
227
|
+
source_type = "local"
|
|
228
|
+
source = "/Users/xorbot/.codex/plugins/hunch-agent-tools"
|
|
229
|
+
|
|
230
|
+
[plugins."hunch-agent-tools@hunch-agent-tools"]
|
|
231
|
+
enabled = true
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Restart Codex after changing plugin configuration. If Codex has already cached
|
|
235
|
+
an older local copy, remove `~/.codex/plugins/cache/hunch-agent-tools` before
|
|
236
|
+
restarting so Codex reinstalls from the local marketplace source.
|
|
237
|
+
|
|
238
|
+
### Standalone Skill
|
|
239
|
+
|
|
240
|
+
The npm tarball and `artifacts/skill/hunch-trading-skill.tar.gz` both contain a
|
|
241
|
+
portable Skill folder:
|
|
242
|
+
|
|
243
|
+
```text
|
|
244
|
+
hunch-trading/
|
|
245
|
+
SKILL.md
|
|
246
|
+
scripts/hunch
|
|
247
|
+
bin/hunch-agent.js
|
|
248
|
+
references/tools.md
|
|
249
|
+
agents/openai.yaml
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
For local Codex skill usage, copy or extract that folder into the user's skills
|
|
253
|
+
directory. The wrapper can be called directly:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
hunch-trading/scripts/hunch discovery-search "up or down" --json
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
The Skill is intentionally a subfolder, not the npm package root, so npm keeps
|
|
260
|
+
normal package semantics while agents can still load `hunch-trading/SKILL.md`.
|