crypto-quant-signal-mcp 1.28.2 → 1.29.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.
- package/README.md +17 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +196 -61
- package/dist/index.js.map +1 -1
- package/dist/lib/adapters/hyperliquid.d.ts +5 -0
- package/dist/lib/adapters/hyperliquid.d.ts.map +1 -1
- package/dist/lib/adapters/hyperliquid.js +58 -1
- package/dist/lib/adapters/hyperliquid.js.map +1 -1
- package/dist/lib/adapters/weex.d.ts +83 -12
- package/dist/lib/adapters/weex.d.ts.map +1 -1
- package/dist/lib/adapters/weex.js +102 -18
- package/dist/lib/adapters/weex.js.map +1 -1
- package/dist/lib/ai-crawler-allowlist.d.ts +97 -0
- package/dist/lib/ai-crawler-allowlist.d.ts.map +1 -0
- package/dist/lib/ai-crawler-allowlist.js +77 -0
- package/dist/lib/ai-crawler-allowlist.js.map +1 -0
- package/dist/lib/analytics.d.ts +2 -0
- package/dist/lib/analytics.d.ts.map +1 -1
- package/dist/lib/analytics.js +5 -1
- package/dist/lib/analytics.js.map +1 -1
- package/dist/lib/attribution-sources.d.ts +1 -1
- package/dist/lib/attribution-sources.d.ts.map +1 -1
- package/dist/lib/attribution-sources.js +8 -0
- package/dist/lib/attribution-sources.js.map +1 -1
- package/dist/lib/band-outcome-lane.d.ts +60 -0
- package/dist/lib/band-outcome-lane.d.ts.map +1 -0
- package/dist/lib/band-outcome-lane.js +220 -0
- package/dist/lib/band-outcome-lane.js.map +1 -0
- package/dist/lib/band-signal-capture.d.ts +111 -0
- package/dist/lib/band-signal-capture.d.ts.map +1 -0
- package/dist/lib/band-signal-capture.js +111 -0
- package/dist/lib/band-signal-capture.js.map +1 -0
- package/dist/lib/capabilities.d.ts +28 -9
- package/dist/lib/capabilities.d.ts.map +1 -1
- package/dist/lib/capabilities.js +13 -1
- package/dist/lib/capabilities.js.map +1 -1
- package/dist/lib/channel-registry.js +1 -1
- package/dist/lib/channel-registry.js.map +1 -1
- package/dist/lib/ddl-barrier.d.ts +47 -0
- package/dist/lib/ddl-barrier.d.ts.map +1 -0
- package/dist/lib/ddl-barrier.js +59 -0
- package/dist/lib/ddl-barrier.js.map +1 -0
- package/dist/lib/exchange-universe.d.ts.map +1 -1
- package/dist/lib/exchange-universe.js +39 -2
- package/dist/lib/exchange-universe.js.map +1 -1
- package/dist/lib/feature-registry.d.ts.map +1 -1
- package/dist/lib/feature-registry.js +37 -0
- package/dist/lib/feature-registry.js.map +1 -1
- package/dist/lib/hold-decision-capture.d.ts +9 -0
- package/dist/lib/hold-decision-capture.d.ts.map +1 -1
- package/dist/lib/hold-decision-capture.js.map +1 -1
- package/dist/lib/integrations-data/mcp-clients.d.ts +2 -2
- package/dist/lib/integrations-data/mcp-clients.d.ts.map +1 -1
- package/dist/lib/integrations-data/mcp-clients.js +36 -4
- package/dist/lib/integrations-data/mcp-clients.js.map +1 -1
- package/dist/lib/knowledge-index.d.ts +6 -0
- package/dist/lib/knowledge-index.d.ts.map +1 -1
- package/dist/lib/knowledge-index.js +8 -0
- package/dist/lib/knowledge-index.js.map +1 -1
- package/dist/lib/license.d.ts +44 -0
- package/dist/lib/license.d.ts.map +1 -1
- package/dist/lib/license.js +41 -0
- package/dist/lib/license.js.map +1 -1
- package/dist/lib/payment-method-attribution.d.ts +23 -0
- package/dist/lib/payment-method-attribution.d.ts.map +1 -1
- package/dist/lib/payment-method-attribution.js +44 -5
- package/dist/lib/payment-method-attribution.js.map +1 -1
- package/dist/lib/payment-method-backfill.d.ts.map +1 -1
- package/dist/lib/payment-method-backfill.js +2 -2
- package/dist/lib/payment-method-backfill.js.map +1 -1
- package/dist/lib/performance-db.d.ts +280 -28
- package/dist/lib/performance-db.d.ts.map +1 -1
- package/dist/lib/performance-db.js +701 -48
- package/dist/lib/performance-db.js.map +1 -1
- package/dist/lib/plans-public-api.d.ts +104 -0
- package/dist/lib/plans-public-api.d.ts.map +1 -0
- package/dist/lib/plans-public-api.js +64 -0
- package/dist/lib/plans-public-api.js.map +1 -0
- package/dist/lib/probe-failure-class.d.ts +19 -0
- package/dist/lib/probe-failure-class.d.ts.map +1 -1
- package/dist/lib/probe-failure-class.js +45 -3
- package/dist/lib/probe-failure-class.js.map +1 -1
- package/dist/lib/public-performance-formatter.d.ts +170 -0
- package/dist/lib/public-performance-formatter.d.ts.map +1 -0
- package/dist/lib/public-performance-formatter.js +198 -0
- package/dist/lib/public-performance-formatter.js.map +1 -0
- package/dist/lib/published-population.d.ts +94 -0
- package/dist/lib/published-population.d.ts.map +1 -0
- package/dist/lib/published-population.js +103 -0
- package/dist/lib/published-population.js.map +1 -0
- package/dist/lib/referral-pages.js +3 -3
- package/dist/lib/regime-request-verdict.d.ts +56 -0
- package/dist/lib/regime-request-verdict.d.ts.map +1 -0
- package/dist/lib/regime-request-verdict.js +72 -0
- package/dist/lib/regime-request-verdict.js.map +1 -0
- package/dist/lib/scorer-input-capture.d.ts +56 -0
- package/dist/lib/scorer-input-capture.d.ts.map +1 -0
- package/dist/lib/scorer-input-capture.js +61 -0
- package/dist/lib/scorer-input-capture.js.map +1 -0
- package/dist/lib/scorer-input-codes.d.ts +195 -0
- package/dist/lib/scorer-input-codes.d.ts.map +1 -0
- package/dist/lib/scorer-input-codes.js +167 -0
- package/dist/lib/scorer-input-codes.js.map +1 -0
- package/dist/lib/search-engine.d.ts +30 -0
- package/dist/lib/search-engine.d.ts.map +1 -1
- package/dist/lib/search-engine.js +70 -2
- package/dist/lib/search-engine.js.map +1 -1
- package/dist/lib/site-nav.js +1 -1
- package/dist/lib/site-nav.js.map +1 -1
- package/dist/lib/stripe-payment-failures-store.d.ts +27 -0
- package/dist/lib/stripe-payment-failures-store.d.ts.map +1 -1
- package/dist/lib/stripe-payment-failures-store.js +57 -5
- package/dist/lib/stripe-payment-failures-store.js.map +1 -1
- package/dist/lib/tool-param-schema.d.ts +1 -1
- package/dist/lib/tool-param-schema.d.ts.map +1 -1
- package/dist/lib/upstream-weight-budget.d.ts +22 -0
- package/dist/lib/upstream-weight-budget.d.ts.map +1 -1
- package/dist/lib/upstream-weight-budget.js +29 -0
- package/dist/lib/upstream-weight-budget.js.map +1 -1
- package/dist/lib/venue-brand-colors.d.ts +1 -1
- package/dist/lib/venue-brand-colors.d.ts.map +1 -1
- package/dist/lib/venue-brand-colors.js +9 -1
- package/dist/lib/venue-brand-colors.js.map +1 -1
- package/dist/lib/venue-budget-registry.d.ts +20 -6
- package/dist/lib/venue-budget-registry.d.ts.map +1 -1
- package/dist/lib/venue-budget-registry.js +108 -32
- package/dist/lib/venue-budget-registry.js.map +1 -1
- package/dist/lib/venue-store.d.ts +36 -0
- package/dist/lib/venue-store.d.ts.map +1 -1
- package/dist/lib/venue-store.js +71 -0
- package/dist/lib/venue-store.js.map +1 -1
- package/dist/lib/verdict-factors.d.ts +19 -1
- package/dist/lib/verdict-factors.d.ts.map +1 -1
- package/dist/lib/verdict-factors.js +55 -5
- package/dist/lib/verdict-factors.js.map +1 -1
- package/dist/lib/x402-idempotency-store.d.ts.map +1 -1
- package/dist/lib/x402-idempotency-store.js +67 -0
- package/dist/lib/x402-idempotency-store.js.map +1 -1
- package/dist/resources/signal-performance.d.ts +24 -0
- package/dist/resources/signal-performance.d.ts.map +1 -1
- package/dist/resources/signal-performance.js +27 -0
- package/dist/resources/signal-performance.js.map +1 -1
- package/dist/scripts/backfill-directional-labels.d.ts +9 -0
- package/dist/scripts/backfill-directional-labels.d.ts.map +1 -1
- package/dist/scripts/backfill-directional-labels.js +30 -1
- package/dist/scripts/backfill-directional-labels.js.map +1 -1
- package/dist/scripts/backfill-hold-decision-labels.d.ts +65 -10
- package/dist/scripts/backfill-hold-decision-labels.d.ts.map +1 -1
- package/dist/scripts/backfill-hold-decision-labels.js +168 -2
- package/dist/scripts/backfill-hold-decision-labels.js.map +1 -1
- package/dist/scripts/dwr-baseline-report.d.ts +14 -2
- package/dist/scripts/dwr-baseline-report.d.ts.map +1 -1
- package/dist/scripts/dwr-baseline-report.js +30 -2
- package/dist/scripts/dwr-baseline-report.js.map +1 -1
- package/dist/scripts/dwr-baseline-snapshot.d.ts +11 -1
- package/dist/scripts/dwr-baseline-snapshot.d.ts.map +1 -1
- package/dist/scripts/dwr-baseline-snapshot.js +32 -0
- package/dist/scripts/dwr-baseline-snapshot.js.map +1 -1
- package/dist/scripts/dwr-cluster-edge.d.ts +71 -0
- package/dist/scripts/dwr-cluster-edge.d.ts.map +1 -0
- package/dist/scripts/dwr-cluster-edge.js +145 -0
- package/dist/scripts/dwr-cluster-edge.js.map +1 -0
- package/dist/scripts/monitor-pfe.d.ts +49 -0
- package/dist/scripts/monitor-pfe.d.ts.map +1 -1
- package/dist/scripts/monitor-pfe.js +34 -0
- package/dist/scripts/monitor-pfe.js.map +1 -1
- package/dist/scripts/monitor-probe-alerts.d.ts +61 -0
- package/dist/scripts/monitor-probe-alerts.d.ts.map +1 -0
- package/dist/scripts/monitor-probe-alerts.js +77 -0
- package/dist/scripts/monitor-probe-alerts.js.map +1 -0
- package/dist/scripts/monitor.js +119 -38
- package/dist/scripts/monitor.js.map +1 -1
- package/dist/scripts/oi-snapshot-sampler.d.ts.map +1 -1
- package/dist/scripts/oi-snapshot-sampler.js +10 -4
- package/dist/scripts/oi-snapshot-sampler.js.map +1 -1
- package/dist/scripts/promote-venue.d.ts +6 -0
- package/dist/scripts/promote-venue.d.ts.map +1 -1
- package/dist/scripts/promote-venue.js +42 -0
- package/dist/scripts/promote-venue.js.map +1 -1
- package/dist/scripts/seed-signals.d.ts.map +1 -1
- package/dist/scripts/seed-signals.js +60 -6
- package/dist/scripts/seed-signals.js.map +1 -1
- package/dist/scripts/venue-readiness-report.d.ts +26 -0
- package/dist/scripts/venue-readiness-report.d.ts.map +1 -1
- package/dist/scripts/venue-readiness-report.js +59 -0
- package/dist/scripts/venue-readiness-report.js.map +1 -1
- package/dist/scripts/verdict-mix-r1-point.js +1 -2
- package/dist/scripts/verdict-mix-r1-point.js.map +1 -1
- package/dist/scripts/verdict-mix-replay.d.ts.map +1 -1
- package/dist/scripts/verdict-mix-replay.js +2 -3
- package/dist/scripts/verdict-mix-replay.js.map +1 -1
- package/dist/scripts/verdict-mix-report.js +1 -2
- package/dist/scripts/verdict-mix-report.js.map +1 -1
- package/dist/tool-descriptions.d.ts +4 -2
- package/dist/tool-descriptions.d.ts.map +1 -1
- package/dist/tool-descriptions.js +31 -3
- package/dist/tool-descriptions.js.map +1 -1
- package/dist/tools/get-market-regime.d.ts.map +1 -1
- package/dist/tools/get-market-regime.js +22 -1
- package/dist/tools/get-market-regime.js.map +1 -1
- package/dist/tools/get-track-record.d.ts +37 -0
- package/dist/tools/get-track-record.d.ts.map +1 -0
- package/dist/tools/get-track-record.js +104 -0
- package/dist/tools/get-track-record.js.map +1 -0
- package/dist/tools/get-trade-call.d.ts +54 -2
- package/dist/tools/get-trade-call.d.ts.map +1 -1
- package/dist/tools/get-trade-call.js +209 -23
- package/dist/tools/get-trade-call.js.map +1 -1
- package/dist/tools/scan-funding-arb.d.ts.map +1 -1
- package/dist/tools/scan-funding-arb.js +11 -2
- package/dist/tools/scan-funding-arb.js.map +1 -1
- package/dist/tools/scan-trade-calls.d.ts +2 -2
- package/dist/tools/scan-trade-calls.d.ts.map +1 -1
- package/dist/tools/scan-trade-calls.js +7 -1
- package/dist/tools/scan-trade-calls.js.map +1 -1
- package/package.json +12 -2
- package/server.json +2 -2
- package/dist/lib/r4-relax-flag.d.ts +0 -47
- package/dist/lib/r4-relax-flag.d.ts.map +0 -1
- package/dist/lib/r4-relax-flag.js +0 -58
- package/dist/lib/r4-relax-flag.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
<span data-tr-field="pfe_wr">91.
|
|
14
|
+
<span data-tr-field="pfe_wr">91.6%</span> PFE win rate across <span data-tr-field="total_calls">584,546</span>+ verified calls. Merkle-verified on Base L2. Don't trust — verify. <!-- SNAPSHOT-LINE -->
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
@@ -93,7 +93,7 @@ Under the hood, a self-tuning model fuses momentum, trend structure, derivatives
|
|
|
93
93
|
{ "coin": "SOL", "timeframe": "15m", "confidence": 73 }
|
|
94
94
|
],
|
|
95
95
|
"_algovault": {
|
|
96
|
-
"version": "1.
|
|
96
|
+
"version": "1.29.0",
|
|
97
97
|
"tool": "get_trade_call",
|
|
98
98
|
"compatible_with": ["crypto-quant-risk-mcp", "crypto-quant-backtest-mcp"]
|
|
99
99
|
}
|
|
@@ -111,7 +111,7 @@ The `_algovault` block makes outputs composable: downstream risk and backtest to
|
|
|
111
111
|
scripts/snapshot-landing-data.mjs at npm-publish + Hetzner-deploy. Do NOT hand-edit the
|
|
112
112
|
numbers; edit "What's new" by hand. Wired by OPS-NPM-README-SINGLE-SOT-W1 (2026-05-31). -->
|
|
113
113
|
<p align="center">
|
|
114
|
-
<strong><span data-tr-field="pfe_wr">91.
|
|
114
|
+
<strong><span data-tr-field="pfe_wr">91.6%</span> PFE Win Rate</strong> · <strong><span data-tr-field="total_calls">584,546</span> trade calls</strong> · <strong><span data-tr-field="merkle_batches">147</span> on-chain batches</strong> <!-- SNAPSHOT-LINE -->
|
|
115
115
|
</p>
|
|
116
116
|
|
|
117
117
|
<p align="center">
|
|
@@ -188,6 +188,7 @@ The MCP tools live at `https://api.algovault.com/mcp`. Every asset works across
|
|
|
188
188
|
- **`scan_funding_arb`** — cross-venue funding-rate spreads across 7 venues (Hyperliquid, Binance, Bybit, Gate, KuCoin, Aster, OKX), ranked. The only MCP server doing multi-exchange derivatives arbitrage.
|
|
189
189
|
- **`get_market_regime`** — classifies TRENDING_UP / TRENDING_DOWN / RANGING / VOLATILE for strategy selection.
|
|
190
190
|
- **`search_knowledge`** + **`chat_knowledge`** — free BM25 search and grounded Q&A over the full knowledge bundle.
|
|
191
|
+
- **`get_track_record`** — the published track record as a tool call, for clients that bridge tools but not resources. `include` opens the per-asset, per-venue and recent-call sections.
|
|
191
192
|
|
|
192
193
|
Performance is exposed as a read-only MCP resource: `performance://signal-performance` (aggregated PFE win rate, never raw outcomes). Full parameter reference at [algovault.com/docs](https://algovault.com/docs.html).
|
|
193
194
|
|
|
@@ -236,7 +237,7 @@ Two meters per paid tier, monthly and daily, enforced independently: a call is r
|
|
|
236
237
|
| Feature | Free | Starter ($9.99/mo · $39.90/6mo) | Pro ($49/mo · $129/6mo) | Enterprise (contact us) | x402 (per call) |
|
|
237
238
|
|---------|------|-------------------|-------------|---------------------|-----------------|
|
|
238
239
|
| Exchanges | All 15 | All 15 | All 15 | All 15 | All 15 | <!-- SNAPSHOT-LINE-TABLE -->
|
|
239
|
-
| Assets | All
|
|
240
|
+
| Assets | All 740+ | All 740+ | All 740+ | All 740+ | All 740+ | <!-- SNAPSHOT-LINE-TABLE -->
|
|
240
241
|
| Asset classes | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi | Crypto + TradFi |
|
|
241
242
|
| Timeframes | All 11 | All 11 | All 11 | All 11 | All 11 |
|
|
242
243
|
| Funding arb results | Top 5 | Unlimited | Unlimited | Unlimited | Unlimited |
|
|
@@ -254,17 +255,21 @@ Pro 6-month is currently $129 — limited-time pricing; subscribe now and renewa
|
|
|
254
255
|
|
|
255
256
|
---
|
|
256
257
|
|
|
257
|
-
## What's new in v1.
|
|
258
|
+
## What's new in v1.29.0
|
|
258
259
|
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
260
|
+
- **📊 The track record is a tool now, not only a resource.** `get_track_record` returns the same verified aggregate as `performance://signal-performance`, so a harness that bridges tools but not resources can read it. Compact by default; `include` opens the per-asset, per-venue and recent-call sections.
|
|
261
|
+
- **✋ HOLD means HOLD.** When a book is not currently trading, the call returns HOLD instead of a direction, and the reasoning says so and says when it resumes. Previously a still book read as a flat market.
|
|
262
|
+
- **📡 A degraded read looks degraded.** `get_market_regime` no longer reports neutral cross-venue funding when the upstream request was refused — a refused read is now distinguishable from a genuine neutral one.
|
|
263
|
+
- **🔓 Allowances are machine-readable.** `GET /api/plans/public` returns the current free and paid call limits, unauthenticated, so you can stop hard-coding them.
|
|
264
|
+
- **🧩 [DeepSeek Harness](https://algovault.com/integrations/deepseek-harness) has a guide.** Plus `/.well-known/security.txt` and `/.well-known/api-catalog`, both of which used to 404.
|
|
263
265
|
|
|
264
|
-
|
|
265
|
-
- **v1.28.2** — **Pair with [Binance Agent OS](https://algovault.com/integrations/binance-agent-os).** One MCP client, two servers: AlgoVault returns the verdict, Binance Agent OS executes it. OAuth at connect time — no API keys on your machine, no request signing, and trading confined to an isolated sub-account you fund yourself. There is no withdrawal scope.
|
|
266
|
+
**Upgrading from v1.28.x** — one breaking change: `BITMART` is no longer a valid `exchange` value and now returns `-32602`. Check any hard-coded `exchange` value against the published enum. `get_track_record` is new; nothing was renamed or removed from the tool list.
|
|
266
267
|
|
|
267
|
-
|
|
268
|
+
### v1.28.x highlights (recap)
|
|
269
|
+
|
|
270
|
+
- **🔐 Authentication tells you what happened.** Every response carries `_algovault.auth`. A well-formed but unrecognised key is refused instead of being quietly served free-tier data, and "malformed", "unknown" and "we couldn't verify" are three distinct outcomes.
|
|
271
|
+
- **📘 Two parameters that were always there, now documented.** `assetClass` on the trade-call tools and `minLiquidityUsd` on `scan_trade_calls`, both projected from the live schema so the docs cannot drift from the server.
|
|
272
|
+
- **🤝 Pair with [Binance Agent OS](https://algovault.com/integrations/binance-agent-os).** One MCP client, two servers: AlgoVault returns the verdict, Binance Agent OS executes it. OAuth at connect time — no API keys on your machine, and trading confined to a sub-account you fund yourself.
|
|
268
273
|
|
|
269
274
|
### v1.27.x highlights (recap)
|
|
270
275
|
|
|
@@ -273,10 +278,6 @@ Pro 6-month is currently $129 — limited-time pricing; subscribe now and renewa
|
|
|
273
278
|
- **💳 6-month prepay replaces annual.** Starter is **$39.90** (~$6.65/mo, 33% off monthly) and Pro is **$129** (~$21.50/mo, 56% off monthly). Pick it at [signup](https://api.algovault.com/signup) with `?interval=6month`. Enterprise remains contact-us.
|
|
274
279
|
- **⏱️ Daily limits say when they reset.** Hit a daily cap and the refusal tells you the hours remaining, not a monthly figure.
|
|
275
280
|
|
|
276
|
-
### v1.26.0 highlights (recap)
|
|
277
|
-
|
|
278
|
-
- **💳 Annual plans — prepay a year, save up to 49%.** Starter was **$79/yr** (~$6.58/mo) and Pro was **$299/yr** (~$24.92/mo). **Superseded: annual was retired on 2026-08-09 and replaced by 6-month prepay (see v1.27.0); `?interval=year` now redirects to the 6-month checkout, so existing links still work.**
|
|
279
|
-
|
|
280
281
|
> **Refresh your MCP client to pick up this release.** MCP clients cache `tools/list` at session start — Claude.ai/Desktop: toggle the connector off+on; Cursor/Cline: restart the MCP server connection.
|
|
281
282
|
|
|
282
283
|
---
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAuC,MAAM,yCAAyC,CAAC;AAIzG,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,SAAS,EAAuC,MAAM,yCAAyC,CAAC;AAIzG,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,YAAY,CAAC;AA+U1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,MAAM,EAAE,MAAM,GACb,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,OAAO,SAAS,EAAE,OAAO,EAC9B,GAAG,EAAE,OAAO,SAAS,EAAE,QAAQ,EAC/B,UAAU,EAAE,MAAM,SAAS,GAC1B,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,SAAS,EAAE,OAAO,EAC9B,GAAG,EAAE,OAAO,SAAS,EAAE,QAAQ,EAC/B,OAAO,EAAE,WAAW,GACnB,OAAO,CAQT;AA+8JD,wBAAgB,mBAAmB,cAElC"}
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,10 @@ const scan_funding_arb_js_1 = require("./tools/scan-funding-arb.js");
|
|
|
63
63
|
const get_market_regime_js_1 = require("./tools/get-market-regime.js");
|
|
64
64
|
const scan_trade_calls_js_1 = require("./tools/scan-trade-calls.js");
|
|
65
65
|
const signal_performance_js_1 = require("./resources/signal-performance.js");
|
|
66
|
+
// DEV-TRACK-RECORD-TOOL-PARITY-W1 CH2: the ONE public allow-list projection of the track
|
|
67
|
+
// record. Consumed here by BOTH `performance://signal-performance` and
|
|
68
|
+
// `GET /api/performance-public`, and by `src/tools/get-track-record.ts`. Single derivation.
|
|
69
|
+
const public_performance_formatter_js_1 = require("./lib/public-performance-formatter.js");
|
|
66
70
|
const cross_asset_grid_js_1 = require("./lib/cross-asset-grid.js");
|
|
67
71
|
const footer_content_js_1 = require("./lib/footer-content.js");
|
|
68
72
|
const admin_auth_js_1 = require("./lib/admin-auth.js");
|
|
@@ -84,14 +88,18 @@ const non_public_venue_counter_js_1 = require("./lib/non-public-venue-counter.js
|
|
|
84
88
|
const venue_brand_colors_js_1 = require("./lib/venue-brand-colors.js");
|
|
85
89
|
const funding_venues_js_1 = require("./lib/funding-venues.js");
|
|
86
90
|
const license_js_1 = require("./lib/license.js");
|
|
91
|
+
const regime_request_verdict_js_1 = require("./lib/regime-request-verdict.js");
|
|
87
92
|
const x402_js_1 = require("./lib/x402.js");
|
|
88
93
|
const x402_http_routes_js_1 = require("./lib/x402-http-routes.js");
|
|
89
94
|
const okx_a2mcp_js_1 = require("./lib/okx-a2mcp.js");
|
|
90
95
|
const seller_worker_js_1 = require("./channels/acp/seller-worker.js");
|
|
91
96
|
const tool_annotations_js_1 = require("./tool-annotations.js");
|
|
92
97
|
const equity_tool_formatters_js_1 = require("./lib/equities/equity-tool-formatters.js");
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
// DEV-TRACK-RECORD-TOOL-PARITY-W1 CH2: `getEquityPerformance` / `getEquityPool` were
|
|
99
|
+
// imported here for the `equities` key on `performance://signal-performance`. That key is
|
|
100
|
+
// dropped (public-copy HOLD + absent from the endpoint's published allow-list), and the
|
|
101
|
+
// imports go with it. The equity engine itself is untouched — `equity-performance.ts` keeps
|
|
102
|
+
// its other consumers, so this removes a public projection, not a capability.
|
|
95
103
|
const analytics_js_1 = require("./lib/analytics.js");
|
|
96
104
|
const client_ip_js_1 = require("./lib/client-ip.js");
|
|
97
105
|
const stripe_events_store_js_1 = require("./lib/stripe-events-store.js");
|
|
@@ -130,8 +138,11 @@ const bot_auth_js_1 = require("./lib/bot-auth.js");
|
|
|
130
138
|
// PRICING-BOT-DELIVERY-METERING-W1 CH3: /api/entitlement/* route registrar.
|
|
131
139
|
const entitlement_api_js_1 = require("./lib/entitlement-api.js");
|
|
132
140
|
const ops_build_api_js_1 = require("./lib/ops-build-api.js");
|
|
141
|
+
// GROWTH-TG-QUOTA-PARITY-W1 CH1: GET /api/plans/public — the plan-ladder read surface.
|
|
142
|
+
const plans_public_api_js_1 = require("./lib/plans-public-api.js");
|
|
133
143
|
const welcome_page_js_1 = require("./lib/welcome-page.js");
|
|
134
144
|
const tool_descriptions_js_1 = require("./tool-descriptions.js");
|
|
145
|
+
const get_track_record_js_1 = require("./tools/get-track-record.js");
|
|
135
146
|
const feature_registry_js_1 = require("./lib/feature-registry.js");
|
|
136
147
|
// EQUITY-TOOLS-DARK-RETIRE-W1: the live tools/list set is env-gated (get_equity_call /
|
|
137
148
|
// get_equity_regime dark behind EQUITY_TOOLS_ENABLED, default OFF). allToolNames() stays
|
|
@@ -595,6 +606,15 @@ function createServer() {
|
|
|
595
606
|
responseTimeMs: Date.now() - startMs,
|
|
596
607
|
ipHash: (0, license_js_1.getRequestIpHash)(),
|
|
597
608
|
isBotInternal: license.tier === 'internal',
|
|
609
|
+
// OPS-HL-INTERACTIVE-STARVATION-W1. Until this wave, `verdict` and `regime` were NULL on
|
|
610
|
+
// every one of this tool's rows, so it had no measurable failure rate and its ten-day
|
|
611
|
+
// outage was invisible by construction.
|
|
612
|
+
//
|
|
613
|
+
// THIS IS THE READER the `license.ts` regimeFundingDegraded seam is required to have;
|
|
614
|
+
// `tests/unit/regime-request-observability.test.ts` fails if it stops happening.
|
|
615
|
+
verdict: (0, regime_request_verdict_js_1.regimeSuccessVerdict)((0, license_js_1.getRequestRegimeFundingDegraded)()),
|
|
616
|
+
regime: result.regime ?? null,
|
|
617
|
+
exchange,
|
|
598
618
|
});
|
|
599
619
|
const sessionIdForCohort = (0, license_js_1.getRequestSessionId)() ?? null;
|
|
600
620
|
if (sessionIdForCohort !== null) {
|
|
@@ -609,6 +629,31 @@ function createServer() {
|
|
|
609
629
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
610
630
|
}
|
|
611
631
|
catch (err) {
|
|
632
|
+
// OPS-HL-INTERACTIVE-STARVATION-W1 — THE ERROR ARM, which did not exist.
|
|
633
|
+
//
|
|
634
|
+
// `logRequest` sat inside the `try` AFTER the awaited call, and this `catch` returned
|
|
635
|
+
// without logging. A refused call therefore wrote NO `request_log` row at all, so the
|
|
636
|
+
// 36,836 rows for this tool were successes ONLY and any failure rate computed from that
|
|
637
|
+
// table was 0.0% BY CONSTRUCTION — a confident wrong number rather than a missing one.
|
|
638
|
+
// Populating `verdict` without adding this block would have reported exactly that 0.0%.
|
|
639
|
+
//
|
|
640
|
+
// `license` is re-read rather than hoisted: `getRequestLicense()` returns a default when no
|
|
641
|
+
// request context exists, so it cannot throw, and a second throw on the error path would
|
|
642
|
+
// lose the row and restore the blind spot. `logRequest` is best-effort internally already.
|
|
643
|
+
const errLicenseTier = (0, license_js_1.getRequestLicense)().tier;
|
|
644
|
+
(0, analytics_js_1.logRequest)({
|
|
645
|
+
sessionId: (0, license_js_1.getRequestSessionId)(),
|
|
646
|
+
toolName: 'get_market_regime',
|
|
647
|
+
asset: coin,
|
|
648
|
+
timeframe,
|
|
649
|
+
licenseTier: errLicenseTier,
|
|
650
|
+
responseTimeMs: Date.now() - startMs,
|
|
651
|
+
ipHash: (0, license_js_1.getRequestIpHash)(),
|
|
652
|
+
isBotInternal: errLicenseTier === 'internal',
|
|
653
|
+
verdict: (0, regime_request_verdict_js_1.regimeErrorVerdict)(err),
|
|
654
|
+
regime: null,
|
|
655
|
+
exchange,
|
|
656
|
+
});
|
|
612
657
|
return toolErrorContent(err);
|
|
613
658
|
}
|
|
614
659
|
});
|
|
@@ -829,6 +874,35 @@ function createServer() {
|
|
|
829
874
|
return toolErrorContent(err);
|
|
830
875
|
}
|
|
831
876
|
});
|
|
877
|
+
// ── Tool 6: get_track_record (DEV-TRACK-RECORD-TOOL-PARITY-W1 CH2) ──
|
|
878
|
+
// The track record on the tools channel, for the harnesses that bridge tools and nothing
|
|
879
|
+
// else. Thin shell by design: every decision lives in the exported `runGetTrackRecord`,
|
|
880
|
+
// which projects the ONE producer through the ONE public formatter. It refuses in-band
|
|
881
|
+
// (structured payload + isError) rather than throwing, so a venue-registry blip degrades
|
|
882
|
+
// one optional section instead of the call.
|
|
883
|
+
register('get_track_record', tool_descriptions_js_1.GET_TRACK_RECORD_DESCRIPTION, {
|
|
884
|
+
include: zod_1.z.array(zod_1.z.enum(get_track_record_js_1.TRACK_RECORD_SECTIONS)).optional().describe(tool_descriptions_js_1.PARAM_DESC_TRACK_RECORD_INCLUDE),
|
|
885
|
+
}, { title: 'Track Record', ...tool_annotations_js_1.PUBLIC_READONLY_TOOL_ANNOTATIONS }, async ({ include }) => {
|
|
886
|
+
const startMs = Date.now();
|
|
887
|
+
try {
|
|
888
|
+
const license = (0, license_js_1.getRequestLicense)();
|
|
889
|
+
const { payload, isError } = await (0, upstream_weight_budget_js_1.runAsCaller)('get_track_record', () => (0, get_track_record_js_1.runGetTrackRecord)({ include }));
|
|
890
|
+
(0, analytics_js_1.logRequest)({
|
|
891
|
+
sessionId: (0, license_js_1.getRequestSessionId)(),
|
|
892
|
+
toolName: 'get_track_record',
|
|
893
|
+
licenseTier: license.tier,
|
|
894
|
+
responseTimeMs: Date.now() - startMs,
|
|
895
|
+
ipHash: (0, license_js_1.getRequestIpHash)(),
|
|
896
|
+
isBotInternal: license.tier === 'internal',
|
|
897
|
+
});
|
|
898
|
+
return isError
|
|
899
|
+
? { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }], isError: true }
|
|
900
|
+
: { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
|
|
901
|
+
}
|
|
902
|
+
catch (err) {
|
|
903
|
+
return toolErrorContent(err);
|
|
904
|
+
}
|
|
905
|
+
});
|
|
832
906
|
// FEATURE-REGISTRY-SOT-W1 CH2: registry-driven registration — register exactly the
|
|
833
907
|
// names FEATURE_REGISTRY declares (canonical + aliases), pulling each tool's verbatim
|
|
834
908
|
// handler/schema/annotations/description from toolDefs. Bidirectional parity guard:
|
|
@@ -862,21 +936,32 @@ function createServer() {
|
|
|
862
936
|
// NOTE: Outcome-based WR (from Phase E, outcome_return_pct) is INTERNAL to
|
|
863
937
|
// AlgoVault's quant engine — never exposed via MCP or any public surface.
|
|
864
938
|
server.resource('signal-performance', 'performance://signal-performance', { description: 'Signal track record — PFE win rates by timeframe, asset, tier, and signal type. Measures whether price moved in the signal direction during the evaluation window.' }, async () => {
|
|
939
|
+
// DEV-TRACK-RECORD-TOOL-PARITY-W1 CH2 — THE LEAK CLOSED. This handler used to
|
|
940
|
+
// serve `{ ...stats, equities }` RAW, so the resource published strictly more than
|
|
941
|
+
// `/api/performance-public` did. Measured 2026-08-28: 17 venues against the
|
|
942
|
+
// endpoint's 14 — BITMART (`retired`), EDGEX (`retired`), WEEX (`shadow`) — plus
|
|
943
|
+
// the 1m shadow timeframe, on an unauthenticated public surface. BITMART is the
|
|
944
|
+
// sharp end: the estate had already WITHDRAWN that venue while this resource kept
|
|
945
|
+
// itemising its per-asset track record. The fail-closed venue filter SV-02 shipped
|
|
946
|
+
// (OPS-AUDIT-REMEDIATION-MED-W1) only ever reached the HTTP lane; this is the same
|
|
947
|
+
// guard arriving at the lane it was always owed.
|
|
948
|
+
//
|
|
949
|
+
// `equities` is DROPPED, not filtered: it is absent from
|
|
950
|
+
// audits/api-performance-public-shape-snapshot-2026-07-15.json's allowed_keys and
|
|
951
|
+
// equities are under the standing public-copy HOLD that keeps both equity tools
|
|
952
|
+
// `publicListing: false`. Consumer audit for this removal: the ONLY reader of
|
|
953
|
+
// `.equities` in the tree was this line, and every other consumer of
|
|
954
|
+
// `getSignalPerformance()` reads the PRODUCER directly rather than this payload
|
|
955
|
+
// (`/performance` admin-only, `/api/performance-shadow` auth-gated,
|
|
956
|
+
// capabilities.getAssetCount → byAsset key count, chat-track-record → scalars,
|
|
957
|
+
// seed-signals → byAsset coin names). So nothing rendered the removed rows: this
|
|
958
|
+
// retracts an unlawful disclosure, it does not reduce public-facing data.
|
|
865
959
|
const stats = await (0, signal_performance_js_1.getSignalPerformance)();
|
|
866
|
-
|
|
867
|
-
// byte-unchanged. Fail-open — equity DB issues must never break the crypto
|
|
868
|
-
// resource (graceful pre-data shape on error).
|
|
869
|
-
let equities;
|
|
870
|
-
try {
|
|
871
|
-
equities = await (0, equity_performance_js_1.getEquityPerformance)((0, equity_store_js_1.getEquityPool)());
|
|
872
|
-
}
|
|
873
|
-
catch {
|
|
874
|
-
equities = { state: 'pre_data', overall: { totalCalls: 0, totalEvaluated: 0, pfeWinRate: null } };
|
|
875
|
-
}
|
|
960
|
+
const allow = await (0, public_performance_formatter_js_1.resolvePublicPerformanceAllowList)();
|
|
876
961
|
return {
|
|
877
962
|
contents: [{
|
|
878
963
|
uri: 'performance://signal-performance',
|
|
879
|
-
text: JSON.stringify(
|
|
964
|
+
text: JSON.stringify((0, public_performance_formatter_js_1.formatPublicPerformance)(stats, allow), null, 2),
|
|
880
965
|
mimeType: 'application/json',
|
|
881
966
|
}],
|
|
882
967
|
};
|
|
@@ -1171,7 +1256,37 @@ async function startHttp() {
|
|
|
1171
1256
|
next();
|
|
1172
1257
|
});
|
|
1173
1258
|
// Rate limiting
|
|
1174
|
-
|
|
1259
|
+
//
|
|
1260
|
+
// OPS-BOT-DISPATCH-LATENCY-W1 CH4 — the INTERNAL caller is exempt from the per-IP bucket.
|
|
1261
|
+
//
|
|
1262
|
+
// This was NOT safe to do before this wave and the reason is worth keeping. The bot used to
|
|
1263
|
+
// reach the MCP over the PUBLIC url, so its requests arrived through Cloudflare, and the
|
|
1264
|
+
// Caddyfile rewrites X-Forwarded-For to CF-Connecting-IP — which Cloudflare delivers already
|
|
1265
|
+
// MASKED to a /24 (v4) or /48 (v6). `req.ip` was therefore a shared Hetzner PREFIX
|
|
1266
|
+
// (2a01:4f9:c013::), so an IP-keyed exemption would have exempted an entire /48 rather than
|
|
1267
|
+
// one host. CH1b repointed the bot to http://127.0.0.1:3000/mcp; the loopback bucket is this
|
|
1268
|
+
// host alone, and the exemption below is keyed on a SECRET HEADER rather than on the address
|
|
1269
|
+
// regardless, so neither half rests on the network shape.
|
|
1270
|
+
//
|
|
1271
|
+
// WHY IT IS NEEDED. The bot's dispatch collapses onto one tick by design (jitter is being
|
|
1272
|
+
// removed so every row fires at bar close), and the whole watchlist is ~104 rows ≈ 115 tool
|
|
1273
|
+
// calls plus handshakes in a single minute — over the 120 cap, with the overflow arriving as
|
|
1274
|
+
// a SILENTLY DROPPED ALERT rather than a retry. Measured peak before the collapse: 31
|
|
1275
|
+
// tool-calls/min, and 0 × HTTP 429 in 14 days, so this is headroom for a change we are
|
|
1276
|
+
// making, not a fix for an incident.
|
|
1277
|
+
//
|
|
1278
|
+
// `checkInternalBypass` is the predicate the MCP request path already uses (five live routes)
|
|
1279
|
+
// and it fails CLOSED on every misconfiguration: bypass disabled, key absent, key under 16
|
|
1280
|
+
// chars, header missing, header mismatched — every one returns null and the caller stays
|
|
1281
|
+
// limited. It is a shared secret, not an address, so it cannot be spoofed by position on the
|
|
1282
|
+
// network. Same shape as the per-key burst guard below; two limiters, one idiom.
|
|
1283
|
+
app.use('/mcp', rateLimit({
|
|
1284
|
+
windowMs: 60_000,
|
|
1285
|
+
max: 120,
|
|
1286
|
+
standardHeaders: true,
|
|
1287
|
+
legacyHeaders: false,
|
|
1288
|
+
skip: (req) => (0, license_js_1.isInternalRateLimitExempt)(req.headers),
|
|
1289
|
+
}));
|
|
1175
1290
|
// ── Ops-only per-KEY burst guard (PRICING-FLAT-CALL-BILLING-AND-6MONTH-W1 CH4) ──
|
|
1176
1291
|
//
|
|
1177
1292
|
// NOT MARKETED and deliberately carries no TIER_CLAIM: this protects the upstream venues, it
|
|
@@ -1303,9 +1418,13 @@ async function startHttp() {
|
|
|
1303
1418
|
// (Plain HTTP/curl stays inline-only per Q-PLAIN-HTTP=NO; not in allow-list).
|
|
1304
1419
|
// LANDING-MCP-CLIENT-REGISTRY-W1 (2026-08-05): +3 MCP-client pages. The other
|
|
1305
1420
|
// 3 registry rows (plain-http, zai-api, deepseek) are hasDedicatedPage:false —
|
|
1306
|
-
// a transport, a server-side API and a model
|
|
1421
|
+
// a transport, a server-side API and a bring-your-own-model path.
|
|
1422
|
+
// LANDING-DSH-CLIENT-SURFACE-W1 (2026-08-28): +deepseek-harness. This supersedes
|
|
1423
|
+
// the reading that `deepseek` "is a model, none of which have a page": DeepSeek
|
|
1424
|
+
// now ships its own agent runtime with a first-party MCP client, and that is a
|
|
1425
|
+
// SEPARATE product from the byo-model row, which keeps no page of its own.
|
|
1307
1426
|
const INTEGRATION_MCP_CLIENTS = ['claude-desktop', 'claude-code', 'cursor', 'cline', 'smithery',
|
|
1308
|
-
'codex', 'kimi', 'glm-zcode'];
|
|
1427
|
+
'codex', 'kimi', 'glm-zcode', 'deepseek-harness'];
|
|
1309
1428
|
const ALL_INTEGRATION_SLUGS = [...INTEGRATION_EXCHANGES, ...INTEGRATION_FRAMEWORKS, ...INTEGRATION_MCP_CLIENTS];
|
|
1310
1429
|
const INTEGRATION_HTML = new Map();
|
|
1311
1430
|
{
|
|
@@ -2348,7 +2467,30 @@ async function startHttp() {
|
|
|
2348
2467
|
}
|
|
2349
2468
|
try {
|
|
2350
2469
|
const bands = await (0, performance_db_js_1.getConfidenceBands)();
|
|
2351
|
-
|
|
2470
|
+
// ── OPS-SIGNAL-PERSISTENCE-BAND-CAPTURE-W1 R4 — the successor's gate, made readable ──
|
|
2471
|
+
//
|
|
2472
|
+
// `OPS-TRACK-RECORD-BAND-DECISION-W{NEXT}` opens on a STATED ROW COUNT of resolved band
|
|
2473
|
+
// rows, never a date, so the count has to be checkable without an SSH psql session every
|
|
2474
|
+
// time someone asks whether the corpus is ready.
|
|
2475
|
+
//
|
|
2476
|
+
// ADMIN-GATED, AND THAT IS LOAD-BEARING. This route sits behind `isAdminAuthorized`; its
|
|
2477
|
+
// sibling `/api/confidence-bands-public` is unauthenticated and must NEVER carry these
|
|
2478
|
+
// fields — band rows are excluded from every published number by construction, and a
|
|
2479
|
+
// count of them appearing on a public surface would be the first step to including them.
|
|
2480
|
+
// `tests/unit/band-population-invariance.test.ts` asserts the absence by field NAME on
|
|
2481
|
+
// every unauthenticated response.
|
|
2482
|
+
//
|
|
2483
|
+
// Named `band_*` rather than a bare `total` deliberately: this value will get
|
|
2484
|
+
// copy-pasted into a status entry or a dashboard one day, and a name that travels with
|
|
2485
|
+
// its meaning is the difference between a reader knowing it is a COUNTERFACTUAL corpus
|
|
2486
|
+
// and assuming it is part of the track record.
|
|
2487
|
+
const bandCounts = await (0, performance_db_js_1.getBandSignalCounts)();
|
|
2488
|
+
res.json({
|
|
2489
|
+
bands,
|
|
2490
|
+
band_signals_captured: bandCounts.captured,
|
|
2491
|
+
band_signals_resolved: bandCounts.resolved,
|
|
2492
|
+
generatedAt: new Date().toISOString(),
|
|
2493
|
+
});
|
|
2352
2494
|
}
|
|
2353
2495
|
catch (err) {
|
|
2354
2496
|
res.status(500).json({ error: 'Failed to fetch confidence bands' });
|
|
@@ -2657,50 +2799,33 @@ async function startHttp() {
|
|
|
2657
2799
|
const totalCalls = stats.totalCalls || 0;
|
|
2658
2800
|
const denom = totalHolds + totalCalls;
|
|
2659
2801
|
const hold_rate = denom > 0 ? Math.round((totalHolds / denom) * 1000) / 10 : 0;
|
|
2660
|
-
//
|
|
2661
|
-
//
|
|
2662
|
-
//
|
|
2663
|
-
//
|
|
2664
|
-
//
|
|
2665
|
-
//
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
const filteredByTimeframe = stats.byTimeframe
|
|
2672
|
-
? Object.fromEntries(Object.entries(stats.byTimeframe).filter(([tf]) => !SHADOW_TIMEFRAMES.includes(tf) || shadowReveal.has(tf)))
|
|
2673
|
-
: stats.byTimeframe;
|
|
2674
|
-
// EXCHANGE-SHADOW-PROMOTE-W1 / C4: filter `byExchange` to only
|
|
2675
|
-
// `venues.status='promoted'` rows. Existing 5 venues all promoted
|
|
2676
|
-
// post-C1 backfill → no behavior change at deploy. Shadow venues get
|
|
2677
|
-
// their own (auth-gated) /api/performance-shadow endpoint.
|
|
2802
|
+
// DEV-TRACK-RECORD-TOOL-PARITY-W1 CH2: the shadow-timeframe strip
|
|
2803
|
+
// (SHADOW-SEED-W1) and the fail-CLOSED promoted-venue filter
|
|
2804
|
+
// (EXCHANGE-SHADOW-PROMOTE-W1 / C4, hardened by SV-02 of
|
|
2805
|
+
// OPS-AUDIT-REMEDIATION-MED-W1) used to live INLINE here — which is
|
|
2806
|
+
// exactly why `performance://signal-performance` never had them and
|
|
2807
|
+
// published BITMART (retired), EDGEX (retired) and WEEX (shadow) plus
|
|
2808
|
+
// the 1m timeframe on a public surface. Both filters now live in ONE
|
|
2809
|
+
// exported allow-list formatter that every public channel calls; this
|
|
2810
|
+
// handler is its first consumer, the resource its second, the
|
|
2811
|
+
// `get_track_record` tool its third. Do not reintroduce a local copy —
|
|
2812
|
+
// a second derivation of this filter is the defect being retired.
|
|
2678
2813
|
//
|
|
2679
|
-
//
|
|
2680
|
-
//
|
|
2681
|
-
//
|
|
2682
|
-
// so
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
// on any lookup error set EMPTY. The happy path (5 promoted) is
|
|
2686
|
-
// byte-identical. Never let a missing filter dependency widen the
|
|
2687
|
-
// public response.
|
|
2688
|
-
let filteredByExchange = {};
|
|
2814
|
+
// Behaviour here is UNCHANGED: same allow-list, same fail-CLOSED
|
|
2815
|
+
// direction (empty/unreadable venues → NO per-venue rows, never all),
|
|
2816
|
+
// and the formatter emits keys in `PerformanceStats` declaration order
|
|
2817
|
+
// so the happy-path body is byte-identical to the pre-extraction one.
|
|
2818
|
+
const allow = await (0, public_performance_formatter_js_1.resolvePublicPerformanceAllowList)();
|
|
2819
|
+
const publicStats = (0, public_performance_formatter_js_1.formatPublicPerformance)(stats, allow);
|
|
2689
2820
|
let shadow_venue_count = 0;
|
|
2690
2821
|
try {
|
|
2691
|
-
|
|
2692
|
-
const shadow = await (0, venue_store_js_1.listVenues)('shadow');
|
|
2693
|
-
shadow_venue_count = shadow.length;
|
|
2694
|
-
const promotedIds = new Set(promoted.map(v => v.exchange_id));
|
|
2695
|
-
filteredByExchange = Object.fromEntries(Object.entries(stats.byExchange).filter(([ex]) => promotedIds.has(ex)));
|
|
2822
|
+
shadow_venue_count = (await (0, venue_store_js_1.listVenues)('shadow')).length;
|
|
2696
2823
|
}
|
|
2697
|
-
catch
|
|
2698
|
-
|
|
2699
|
-
filteredByExchange = {};
|
|
2824
|
+
catch {
|
|
2825
|
+
shadow_venue_count = 0;
|
|
2700
2826
|
}
|
|
2701
|
-
const filteredStats = { ...stats, byTimeframe: filteredByTimeframe, byExchange: filteredByExchange };
|
|
2702
2827
|
res.json({
|
|
2703
|
-
...
|
|
2828
|
+
...publicStats,
|
|
2704
2829
|
...holdStats,
|
|
2705
2830
|
hold_rate,
|
|
2706
2831
|
asset_count,
|
|
@@ -3332,7 +3457,7 @@ async function startHttp() {
|
|
|
3332
3457
|
return res.send(`<!doctype html><meta charset="utf-8"><title>You're in — AlgoVault</title>` +
|
|
3333
3458
|
`<body style="font-family:system-ui;background:#0d1117;color:#c9d1d9;max-width:560px;margin:60px auto;padding:0 20px">` +
|
|
3334
3459
|
`<h1 style="color:#56d364">You're in via ${id}${stubNote}</h1>` +
|
|
3335
|
-
`<p>Your free API key (
|
|
3460
|
+
`<p>Your free API key (200 calls/mo, 100/day, no card):</p>` +
|
|
3336
3461
|
`<pre style="background:#161b22;border:1px solid #30363d;border-radius:8px;padding:12px;user-select:all">${key}</pre>` +
|
|
3337
3462
|
`<p>Referral link: <a style="color:#58a6ff" href="${referralLink}">${referralLink}</a></p>` +
|
|
3338
3463
|
`<p style="color:#8b949e;font-size:13px">Use it as <code>Authorization: Bearer <key></code>. <a style="color:#58a6ff" href="/account">Manage your account →</a></p></body>`);
|
|
@@ -3513,6 +3638,12 @@ async function startHttp() {
|
|
|
3513
3638
|
// container was built from. Registered here beside the other internal-key routes; the handler
|
|
3514
3639
|
// lives in lib/ because index.ts boots the server at import.
|
|
3515
3640
|
(0, ops_build_api_js_1.registerOpsBuildRoute)(app);
|
|
3641
|
+
// GROWTH-TG-QUOTA-PARITY-W1 CH1: GET /api/plans/public — the plan ladder, projected from
|
|
3642
|
+
// `lib/plans.ts` at request time. UNAUTHENTICATED by design, unlike its neighbours above: the
|
|
3643
|
+
// consumer this exists for is a FREE, unlinked Telegram chat, which holds no api_key and no
|
|
3644
|
+
// internal key, and cannot read the ladder it is metered against through any authenticated
|
|
3645
|
+
// route. Public data only (allow-list formatter in lib/plans-public-api.ts); no DB touch.
|
|
3646
|
+
(0, plans_public_api_js_1.registerPlansPublicRoutes)(app);
|
|
3516
3647
|
// MCP endpoint
|
|
3517
3648
|
app.all('/mcp', express.json(), async (req, res) => {
|
|
3518
3649
|
// OPS-X402-MCP-PRICE-BINDING-W1: for a priced `tools/call` POST, bind the x402
|
|
@@ -4630,7 +4761,7 @@ ${(0, site_nav_js_1.renderSiteNav)()}
|
|
|
4630
4761
|
<span class="recent-calls-feed-tick"><span class="live-pulse"></span>tick</span>
|
|
4631
4762
|
</div>
|
|
4632
4763
|
<div id="tr-recent-calls-rows">
|
|
4633
|
-
<!-- DESIGN-W11-FF3 (2026-05-14): Call + Confidence columns REMOVED per Mr.1 Data Integrity directive ("should not be disclosure at here"). Public track record
|
|
4764
|
+
<!-- DESIGN-W11-FF3 (2026-05-14): Call + Confidence columns REMOVED per Mr.1 Data Integrity directive ("should not be disclosure at here"). Public track record shows 6 cols: ID, Time, Tier, Asset, Timeframe, Exchange. HISTORY, corrected: this note used to warn that the underlying API was still emitting the direction and confidence fields, and that a follow-up wave should sanitize the response shape. (The old wording is deliberately paraphrased, not quoted — the verification gate for this change bans that literal, and a comment quoting the banned string keeps the gate red for the wrong reason.) That follow-up SHIPPED — PERFORMANCE-PUBLIC-SANITIZE-W1 (2026-05-15) moved enforcement to the data layer via the explicit field allow-list in formatPublicRecentSignal() (src/lib/performance-db.ts), so the fields cannot be emitted regardless of what the input row carries. Measured live 2026-08-29 on BOTH channels (/api/performance-public and performance://signal-performance): row keys are exactly coin, created_at, exchange, id, tier, timeframe. The warning was retired by OPS-RECENT-SIGNALS-VENUE-FILTER-W1 because a comment advertising a Data-Integrity hole that no longer exists sends the next reader chasing a ghost and devalues every neighbouring note. -->
|
|
4634
4765
|
<table class="recent-table"><thead><tr><th>ID</th><th>Time</th><th>Tier</th><th>Asset</th><th class="num">Timeframe</th><th>Exchange</th></tr></thead>
|
|
4635
4766
|
<tbody id="tr-recent-calls-tbody"><tr><td colspan="6" class="empty">Loading recent calls…</td></tr></tbody></table>
|
|
4636
4767
|
</div>
|
|
@@ -4800,9 +4931,9 @@ var LB_SMALL_N = 30; // muted "small sample" tag bar (single source w/
|
|
|
4800
4931
|
// OPS-VENUE-GO-LIVE-15-W1 (2026-07-23): 12→15. WhiteBIT lime #A3E635 / BitMart red #F6465D /
|
|
4801
4932
|
// XT pink #EC4899 — chosen pairwise-distinct from the 12 (unused red/lime/magenta hues; Design.md
|
|
4802
4933
|
// "no two venues share a colour"), brand hues being too crowded (blue/teal) to stay distinct.
|
|
4803
|
-
var LB_EX_LABEL = { HL: 'Hyperliquid', BINANCE: 'Binance', BYBIT: 'Bybit', OKX: 'OKX', BITGET: 'Bitget', ASTER: 'Aster', BINGX: 'BingX', GATE: 'Gate.io', HTX: 'HTX', KUCOIN: 'KuCoin', MEXC: 'MEXC', PHEMEX: 'Phemex', WHITEBIT: 'WhiteBIT',
|
|
4804
|
-
var LB_EX_COLOR = { HL: '#4ade80', BINANCE: '#F0B90B', BYBIT: '#F7A600', OKX: '#ffffff', BITGET: '#00C8BC', ASTER: '#A855F7', BINGX: '#0058FB', GATE: '#17E6A1', HTX: '#0091D4', KUCOIN: '#23AF91', MEXC: '#1972E2', PHEMEX: '#818CF8', WHITEBIT: '#A3E635',
|
|
4805
|
-
var LB_EX_ORDER = ['HL', 'BINANCE', 'BYBIT', 'OKX', 'BITGET', 'ASTER', 'BINGX', 'GATE', 'HTX', 'KUCOIN', 'MEXC', 'PHEMEX', 'WHITEBIT', '
|
|
4934
|
+
var LB_EX_LABEL = { HL: 'Hyperliquid', BINANCE: 'Binance', BYBIT: 'Bybit', OKX: 'OKX', BITGET: 'Bitget', ASTER: 'Aster', BINGX: 'BingX', GATE: 'Gate.io', HTX: 'HTX', KUCOIN: 'KuCoin', MEXC: 'MEXC', PHEMEX: 'Phemex', WHITEBIT: 'WhiteBIT', XT: 'XT', WEEX: 'WEEX' };
|
|
4935
|
+
var LB_EX_COLOR = { HL: '#4ade80', BINANCE: '#F0B90B', BYBIT: '#F7A600', OKX: '#ffffff', BITGET: '#00C8BC', ASTER: '#A855F7', BINGX: '#0058FB', GATE: '#17E6A1', HTX: '#0091D4', KUCOIN: '#23AF91', MEXC: '#1972E2', PHEMEX: '#818CF8', WHITEBIT: '#A3E635', XT: '#EC4899', WEEX: '#FF6B3D' };
|
|
4936
|
+
var LB_EX_ORDER = ['HL', 'BINANCE', 'BYBIT', 'OKX', 'BITGET', 'ASTER', 'BINGX', 'GATE', 'HTX', 'KUCOIN', 'MEXC', 'PHEMEX', 'WHITEBIT', 'XT', 'WEEX'];
|
|
4806
4937
|
// TRACK-RECORD-EXCHANGE-BRAND-COLORS-W1: server-side VENUE_BRAND_COLORS SoT
|
|
4807
4938
|
// (src/lib/venue-brand-colors.ts) injected once so the ANALYZING chip row's
|
|
4808
4939
|
// client re-render and its server-rendered chips share ONE derivation. This is
|
|
@@ -5010,7 +5141,11 @@ async function load() {
|
|
|
5010
5141
|
return '<div class="tab'+(isActive?' active':'')+'" data-ex="'+ex.id+'" style="font-size:13px" onclick="setExchangeFilter(\\''+ex.id+'\\')">'+ex.label+'</div>';
|
|
5011
5142
|
}).join('');
|
|
5012
5143
|
|
|
5013
|
-
// OPS-VENUE-GO-LIVE Phase B (R3b-TR): Analyzing chip row — same LB_EX_ORDER SoT
|
|
5144
|
+
// OPS-VENUE-GO-LIVE Phase B (R3b-TR): Analyzing chip row — same LB_EX_ORDER SoT.
|
|
5145
|
+
// OPS-BITMART-ENUM-RECONCILE-W1: LB_EX_* do NOT "auto-grow with EXCHANGES" — they are HAND-
|
|
5146
|
+
// MAINTAINED literals inside this client script, invisible to tsc. What keeps them honest is
|
|
5147
|
+
// tests/unit/capabilities.test.ts, which pins LB_EX_ORDER and LB_EX_COLOR EXACTLY to
|
|
5148
|
+
// PROMOTED_VENUE_IDS. Edit them in the same commit as EXCHANGES or that test goes RED.
|
|
5014
5149
|
// TRACK-RECORD-EXCHANGE-BRAND-COLORS-W1: colour projects from VENUE_BRAND_COLORS
|
|
5015
5150
|
// (the injected brand SoT), NOT LB_EX_COLOR — so the chip strip shows each venue's
|
|
5016
5151
|
// official brand colour while the leaderboard bars keep their chart-distinct palette.
|