@dwlf/mcp-server 0.67.0 → 0.69.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 +3 -0
- package/dist/block/client.d.ts +24 -0
- package/dist/block/client.d.ts.map +1 -0
- package/dist/block/client.js +49 -0
- package/dist/block/client.js.map +1 -0
- package/dist/block/tools.d.ts +4 -0
- package/dist/block/tools.d.ts.map +1 -0
- package/dist/block/tools.js +184 -0
- package/dist/block/tools.js.map +1 -0
- package/dist/blockDescriptions.d.ts.map +1 -1
- package/dist/blockDescriptions.js +35 -13
- package/dist/blockDescriptions.js.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/profiles.d.ts +15 -0
- package/dist/profiles.d.ts.map +1 -1
- package/dist/profiles.js +34 -0
- package/dist/profiles.js.map +1 -1
- package/dist/register.d.ts +12 -0
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +22 -0
- package/dist/register.js.map +1 -1
- package/dist/tools/academy.js +2 -2
- package/dist/tools/academy.js.map +1 -1
- package/dist/tools/conditions.js +2 -2
- package/dist/tools/conditions.js.map +1 -1
- package/dist/tools/custom-events.js +5 -5
- package/dist/tools/custom-events.js.map +1 -1
- package/dist/tools/cycle-windows.js +8 -8
- package/dist/tools/cycle-windows.js.map +1 -1
- package/dist/tools/divergences.js +6 -6
- package/dist/tools/divergences.js.map +1 -1
- package/dist/tools/explain-event.js +3 -3
- package/dist/tools/explain-event.js.map +1 -1
- package/dist/tools/indicators.js +1 -1
- package/dist/tools/indicators.js.map +1 -1
- package/dist/tools/market-data.d.ts.map +1 -1
- package/dist/tools/market-data.js +29 -23
- package/dist/tools/market-data.js.map +1 -1
- package/dist/tools/onchain-catalogue.js +1 -1
- package/dist/tools/onchain-catalogue.js.map +1 -1
- package/dist/tools/ranges.js +2 -2
- package/dist/tools/ranges.js.map +1 -1
- package/dist/tools/semantic.js +4 -4
- package/dist/tools/semantic.js.map +1 -1
- package/dist/tools/stages.js +5 -5
- package/dist/tools/stages.js.map +1 -1
- package/dist/tools/strategies.js +1 -1
- package/dist/tools/strategies.js.map +1 -1
- package/dist/tools/subscriptions.js +3 -3
- package/dist/tools/subscriptions.js.map +1 -1
- package/dist/tools/theses.d.ts +4 -0
- package/dist/tools/theses.d.ts.map +1 -0
- package/dist/tools/theses.js +342 -0
- package/dist/tools/theses.js.map +1 -0
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -145,6 +145,9 @@ Activate symbols for event detection and strategy signal generation. Manage whic
|
|
|
145
145
|
### Custom Events
|
|
146
146
|
Create custom indicator-based triggers (e.g. "DSS exits oversold with bullish cross").
|
|
147
147
|
|
|
148
|
+
### Theses (thesis alerts)
|
|
149
|
+
Save, per symbol, the market events you are waiting for and why (ordered steps, invalidation, your own context). DWLF checks them nightly after the close and reports what happened: a Telegram digest, and a fire feed agents read with a cursor. `dwlf_list_theses` with `includeProgress` also says how close each active thesis is to its next condition (last close and % to a level, a forming pivot's % developed, a weekly window's date) and gives `closest`, the one "closest to trigger" choice to sort by.
|
|
150
|
+
|
|
148
151
|
### AI Summaries
|
|
149
152
|
Full account dashboard, single-symbol briefs, and strategy performance overviews — pre-aggregated for AI consumption.
|
|
150
153
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Block API client (DWLF-876, docs/design/block-repoint.md D3), for `--profile block` on the `block-api` backend.
|
|
3
|
+
* Charter invariant 3 (scoped 19-Nov): the second and last authenticated client, the sole `Authorization` assignment
|
|
4
|
+
* for its one host. With no key it reads the public routes (`/public/v1/*`, the Free view); with a key (a personal
|
|
5
|
+
* `dwlfk_` key once keys ship) it reads `/v1/*` with `Bearer`. One client per caller: `options` overrides the
|
|
6
|
+
* environment, so a hosted host can build one per request (D7). The key is never logged.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BlockApiError extends Error {
|
|
9
|
+
readonly status: number | null;
|
|
10
|
+
readonly body: unknown;
|
|
11
|
+
constructor(status: number | null, body: unknown, message: string);
|
|
12
|
+
}
|
|
13
|
+
export declare class BlockApiClient {
|
|
14
|
+
private http;
|
|
15
|
+
readonly signedIn: boolean;
|
|
16
|
+
constructor(options?: {
|
|
17
|
+
apiKey?: string;
|
|
18
|
+
baseURL?: string;
|
|
19
|
+
timeoutMs?: number;
|
|
20
|
+
});
|
|
21
|
+
/** GET a route below the view's prefix (`/conditions`, `/events`, …). Undefined params are dropped. */
|
|
22
|
+
get<T = unknown>(path: string, params?: Record<string, string | undefined>): Promise<T>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/block/client.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,KAAK;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO;gBAA7C,MAAM,EAAE,MAAM,GAAG,IAAI,EAAW,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;CAIpF;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,IAAI,CAAgB;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;gBAEf,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO;IAYnF,uGAAuG;IACjG,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAalG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* The Block API client (DWLF-876, docs/design/block-repoint.md D3), for `--profile block` on the `block-api` backend.
|
|
4
|
+
* Charter invariant 3 (scoped 19-Nov): the second and last authenticated client, the sole `Authorization` assignment
|
|
5
|
+
* for its one host. With no key it reads the public routes (`/public/v1/*`, the Free view); with a key (a personal
|
|
6
|
+
* `dwlfk_` key once keys ship) it reads `/v1/*` with `Bearer`. One client per caller: `options` overrides the
|
|
7
|
+
* environment, so a hosted host can build one per request (D7). The key is never logged.
|
|
8
|
+
*/
|
|
9
|
+
export class BlockApiError extends Error {
|
|
10
|
+
status;
|
|
11
|
+
body;
|
|
12
|
+
constructor(status, body, message) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.status = status;
|
|
15
|
+
this.body = body;
|
|
16
|
+
this.name = 'BlockApiError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class BlockApiClient {
|
|
20
|
+
http;
|
|
21
|
+
signedIn;
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
const base = (options.baseURL || process.env.BLOCK_API_URL || 'https://api.block.dwlf.co.uk').replace(/\/+$/, '');
|
|
24
|
+
const raw = 'apiKey' in options ? options.apiKey : process.env.DWLF_BLOCK_KEY;
|
|
25
|
+
const apiKey = raw?.trim() ? raw.trim() : undefined;
|
|
26
|
+
this.signedIn = Boolean(apiKey);
|
|
27
|
+
this.http = axios.create({
|
|
28
|
+
baseURL: `${base}${apiKey ? '/v1' : '/public/v1'}`,
|
|
29
|
+
headers: { Accept: 'application/json', ...(apiKey ? { Authorization: `Bearer ${apiKey}` } : {}) },
|
|
30
|
+
timeout: options.timeoutMs ?? 30000,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** GET a route below the view's prefix (`/conditions`, `/events`, …). Undefined params are dropped. */
|
|
34
|
+
async get(path, params = {}) {
|
|
35
|
+
const query = Object.fromEntries(Object.entries(params).filter(([, v]) => v !== undefined && v !== ''));
|
|
36
|
+
try {
|
|
37
|
+
return (await this.http.get(path, { params: query })).data;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (axios.isAxiosError(error) && error.response) {
|
|
41
|
+
const body = error.response.data;
|
|
42
|
+
// The Block API's own error body is the agent's answer (its code, message, requiredPlan, pricingUrl): kept whole.
|
|
43
|
+
throw new BlockApiError(error.response.status, body, `Block API ${error.response.status}: ${typeof body === 'string' ? body.slice(0, 500) : JSON.stringify(body)}`);
|
|
44
|
+
}
|
|
45
|
+
throw new BlockApiError(null, null, `Block API unreachable: ${error instanceof Error ? error.message : String(error)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/block/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACjB;IAAgC;IAArD,YAAqB,MAAqB,EAAW,IAAa,EAAE,OAAe;QACjF,KAAK,CAAC,OAAO,CAAC,CAAC;QADI,WAAM,GAAN,MAAM,CAAe;QAAW,SAAI,GAAJ,IAAI,CAAS;QAEhE,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,OAAO,cAAc;IACjB,IAAI,CAAgB;IACnB,QAAQ,CAAU;IAE3B,YAAY,UAAqE,EAAE;QACjF,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,8BAA8B,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAClH,MAAM,GAAG,GAAG,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;QAC9E,MAAM,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,GAA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AAC,QAAQ,CAAC,MAAM,KAAK,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACtK,CAAC;YACD,MAAM,IAAI,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1H,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/block/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AA0B5D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CA8CrF"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlockApiError } from './client.js';
|
|
3
|
+
/**
|
|
4
|
+
* The launch-set tools on the Block API (DWLF-876, docs/design/block-repoint.md D2–D4). Registered by
|
|
5
|
+
* `registerBlockApiTools`, only on the `block-api` backend of `--profile block` (charter invariant 6, scoped 19-Nov),
|
|
6
|
+
* under the same names as their SPT versions. Each gives the Block API's body verbatim (invariant 2: the envelope is
|
|
7
|
+
* the answer, never unwrapped). Their release-gate snapshots live in eval/snapshots/ (block-eval.md §0).
|
|
8
|
+
*/
|
|
9
|
+
// How an agent reads every answer here. Worded within the shared banned-terms list (check 7).
|
|
10
|
+
const ENVELOPE = 'The answer is the Block envelope: lead with its `summary`; each item has its own `summary`, `why` (the reasons, ' +
|
|
11
|
+
'in plain words), `chartUrl` (the chart to show your human) and `knowableAt` (when it became known: date a fact by ' +
|
|
12
|
+
'that, never by the time of your request). `definitions` explains each term used. An item with `locked: true` is ' +
|
|
13
|
+
'of a family this view does not read: say what it is and when, and that `requiredPlan` reads it (`pricingUrl`); ' +
|
|
14
|
+
'never guess its value. A refusal comes back as an error, `Block API <status>: <body>`, whose body says why ' +
|
|
15
|
+
'(`error`, `message`, and for a plan refusal `requiredPlan` and `pricingUrl`). It describes the market or the chain as of its date. It is not a forecast and not a ' +
|
|
16
|
+
'recommendation: never turn it into buy, sell or hold recommendations.';
|
|
17
|
+
const DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
18
|
+
const reply = (body) => ({ content: [{ type: 'text', text: JSON.stringify(body, null, 2) }] });
|
|
19
|
+
const failure = (error) => ({
|
|
20
|
+
content: [{ type: 'text', text: error instanceof BlockApiError ? error.message : `Block API call failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
21
|
+
isError: true,
|
|
22
|
+
});
|
|
23
|
+
export function registerBlockApiTools(server, client) {
|
|
24
|
+
server.tool('dwlf_get_conditions', 'Where Bitcoin is now against its own history, from DWLF Block: the cost-basis ladder (realised prices: what ' +
|
|
25
|
+
'holders paid), the on-chain bands, and the cycle readings, each as one item. For BITCOIN, call this first. ' +
|
|
26
|
+
ENVELOPE, {}, async () => {
|
|
27
|
+
try {
|
|
28
|
+
return reply(await client.get('/conditions'));
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return failure(error);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
server.tool('dwlf_get_events', 'Events on Bitcoin from DWLF Block (DWLF\'s own data, BTCOC/USD, daily): on-chain events (`onchain.*`), cycle ' +
|
|
35
|
+
'pivots and indicator events, one item per event. Without a key the view covers the last 30 days. Narrow it ' +
|
|
36
|
+
'with `types` (exact event type ids, e.g. `onchain.sth_sopr.lose`; dwlf_describe_onchain_events finds them) and `from` / `to`; with a key, ' +
|
|
37
|
+
'always pass `from`, since a longer history comes back in one answer. ' + ENVELOPE, {
|
|
38
|
+
types: z.array(z.string()).max(20).optional()
|
|
39
|
+
.describe('Only these event types: exact ids, at most 20 (e.g. ["onchain.sth_sopr.lose"]).'),
|
|
40
|
+
from: z.string().regex(DAY).optional().describe('The first day to include, YYYY-MM-DD.'),
|
|
41
|
+
to: z.string().regex(DAY).optional().describe('The last day to include, YYYY-MM-DD.'),
|
|
42
|
+
}, async ({ types, from, to }) => {
|
|
43
|
+
try {
|
|
44
|
+
return reply(await client.get('/events', { types: types?.length ? types.join(',') : undefined, from, to }));
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return failure(error);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
server.tool('dwlf_get_series', 'One daily Bitcoin series from DWLF Block (DWLF\'s own data), by id: for example `price-close`, `realized-price`, ' +
|
|
51
|
+
'`sth-realized-price` or `mvrv` (dwlf_describe_onchain_events lists every series). ' +
|
|
52
|
+
'Without a key the view covers the last 365 days. The item\'s `from` is its first point; `historyFrom` is set ' +
|
|
53
|
+
'only when the series\' own history, not the view or your `from`, is what limits it (no earlier day exists), ' +
|
|
54
|
+
'and is null otherwise. ' + ENVELOPE, {
|
|
55
|
+
id: z.string().min(1).describe('The series id, e.g. "mvrv".'),
|
|
56
|
+
from: z.string().regex(DAY).optional().describe('The first day to include, YYYY-MM-DD.'),
|
|
57
|
+
}, async ({ id, from }) => {
|
|
58
|
+
try {
|
|
59
|
+
return reply(await client.get(`/series/${encodeURIComponent(id)}`, { from }));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
return failure(error);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
registerCatalogueTools(server, client);
|
|
66
|
+
}
|
|
67
|
+
const isObject = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
68
|
+
/**
|
|
69
|
+
* The catalogue narrowed to `keep` (D4: the scoped selection exception). Every top-level field stays as served except
|
|
70
|
+
* `items` (whole items, in upstream order) and `definitions` (the selected items' own entries, whole). Nothing is
|
|
71
|
+
* rewritten; the release gate's selection check holds it to that (eval/envelope.mjs `selectionFailures`).
|
|
72
|
+
*/
|
|
73
|
+
const narrowCatalogue = (catalogue, keep) => {
|
|
74
|
+
const items = (Array.isArray(catalogue.items) ? catalogue.items : []).filter((i) => isObject(i) && keep(i));
|
|
75
|
+
const ids = new Set(items.map((i) => String(i.id)));
|
|
76
|
+
const definitions = isObject(catalogue.definitions)
|
|
77
|
+
? Object.fromEntries(Object.entries(catalogue.definitions).filter(([k]) => ids.has(k))) : catalogue.definitions;
|
|
78
|
+
return { ...catalogue, items, definitions };
|
|
79
|
+
};
|
|
80
|
+
const words = (text) => text.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
|
|
81
|
+
const CATALOGUE_TTL_MS = 15 * 60 * 1000;
|
|
82
|
+
const MAX_ITEMS = 40;
|
|
83
|
+
function registerCatalogueTools(server, client) {
|
|
84
|
+
// The catalogue is 355 KB and changes slowly: kept 15 minutes per client, as the SPT catalogues are. A failed read is
|
|
85
|
+
// never kept, so the next call tries again.
|
|
86
|
+
let cached = null;
|
|
87
|
+
const catalogueOf = async () => {
|
|
88
|
+
if (cached && Date.now() - cached.at < CATALOGUE_TTL_MS) {
|
|
89
|
+
return cached.body;
|
|
90
|
+
}
|
|
91
|
+
const body = await client.get('/catalogue');
|
|
92
|
+
cached = { at: Date.now(), body };
|
|
93
|
+
return body;
|
|
94
|
+
};
|
|
95
|
+
server.tool('dwlf_describe_onchain_events', 'What DWLF Block serves, from its catalogue: every event type (on-chain `onchain.*`, cycles, indicators, levels, ' +
|
|
96
|
+
'COT) and every daily series, with its family, the plan that reads it, how often it has fired and when it last ' +
|
|
97
|
+
'did (names and counts, never values). No arguments gives each family with its counts; `family`, `search` (words ' +
|
|
98
|
+
'in the id, name or definition) or `eventType` (one exact id) gives those items whole, with their definitions. ' +
|
|
99
|
+
'At most 40 items come back; `matched` says how many matched (narrow with `family`, `eventType` or more words). ' +
|
|
100
|
+
'The catalogue-wide `summary` covers every item; an item\'s own `summary` gives its plan status, and its meaning is ' +
|
|
101
|
+
'under its id in `definitions`. For ' +
|
|
102
|
+
'one event type\'s recent occurrences use dwlf_explain_event; for a series\' values, dwlf_get_series. ' + ENVELOPE, {
|
|
103
|
+
family: z.string().optional().describe('One family, e.g. "cost-basis", "mining", "cycles", "indicators".'),
|
|
104
|
+
search: z.string().optional().describe('Words to find in an id, name or definition, e.g. "hash ribbon".'),
|
|
105
|
+
eventType: z.string().optional().describe('One exact id, e.g. "onchain.sth_sopr.lose".'),
|
|
106
|
+
}, async ({ family, search, eventType }) => {
|
|
107
|
+
try {
|
|
108
|
+
const catalogue = await catalogueOf();
|
|
109
|
+
if (!family && !search && !eventType) {
|
|
110
|
+
const families = {};
|
|
111
|
+
for (const item of Array.isArray(catalogue.items) ? catalogue.items : []) {
|
|
112
|
+
if (!isObject(item)) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const f = (families[String(item.family)] ??= { eventTypes: 0, series: 0, locked: 0 });
|
|
116
|
+
if (item.kind === 'series') {
|
|
117
|
+
f.series += 1;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
f.eventTypes += 1;
|
|
121
|
+
}
|
|
122
|
+
if (item.locked === true) {
|
|
123
|
+
f.locked += 1;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return reply({ ...narrowCatalogue(catalogue, () => false), families });
|
|
127
|
+
}
|
|
128
|
+
// Search reads what describes the item (its id, name and own definition), never its `summary`, which on the
|
|
129
|
+
// Free view is plan wording ("needs the Free plan", "locked") shared by hundreds of items.
|
|
130
|
+
const wanted = search ? words(search) : [];
|
|
131
|
+
const definitions = isObject(catalogue.definitions) ? catalogue.definitions : {};
|
|
132
|
+
const narrowed = narrowCatalogue(catalogue, (item) => (!family || item.family === family)
|
|
133
|
+
&& (!eventType || item.id === eventType)
|
|
134
|
+
&& (!wanted.length || wanted.every((w) => words(`${item.id} ${item.name ?? ''} ${definitions[String(item.id)] ?? ''}`).includes(w))));
|
|
135
|
+
if (!narrowed.items.length) {
|
|
136
|
+
const known = [...new Set((Array.isArray(catalogue.items) ? catalogue.items : []).filter(isObject).map((i) => String(i.family)))].sort();
|
|
137
|
+
return { content: [{ type: 'text', text: `Nothing in the Block catalogue matches${family ? ` family "${family}"` : ''}${search ? ` "${search}"` : ''}${eventType ? ` id "${eventType}"` : ''}. Families: ${known.join(', ')}. Call with no arguments for each family's counts.` }], isError: true };
|
|
138
|
+
}
|
|
139
|
+
const matched = narrowed.items.length;
|
|
140
|
+
if (matched <= MAX_ITEMS) {
|
|
141
|
+
return reply({ ...narrowed, matched });
|
|
142
|
+
}
|
|
143
|
+
// Too many to hand an agent whole: the first MAX_ITEMS in catalogue order, and the count, so nothing is hidden.
|
|
144
|
+
const shown = new Set(narrowed.items.slice(0, MAX_ITEMS).map((i) => String(i.id)));
|
|
145
|
+
return reply({ ...narrowCatalogue(catalogue, (item) => shown.has(String(item.id))), matched, shown: MAX_ITEMS });
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
return failure(error);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
server.tool('dwlf_explain_event', 'One event type from DWLF Block\'s catalogue, by exact id: its definition, family, the plan that reads it, how ' +
|
|
152
|
+
'often it has fired and when it last did, plus `occurrences`: its events over the view (without a key, the last ' +
|
|
153
|
+
'30 days; narrow with `from` / `to`; with a key, always pass `from`, since a longer history comes back in one ' +
|
|
154
|
+
'answer), as the Block API gave them. If the occurrences could not be read, ' +
|
|
155
|
+
'`occurrencesUnavailable` says why instead: never read that as "it has not fired". Use ' +
|
|
156
|
+
'dwlf_describe_onchain_events to find an id. ' + ENVELOPE, {
|
|
157
|
+
eventType: z.string().min(1).describe('One exact event type id, e.g. "onchain.sth_sopr.lose".'),
|
|
158
|
+
from: z.string().regex(DAY).optional().describe('The first day of occurrences to include, YYYY-MM-DD.'),
|
|
159
|
+
to: z.string().regex(DAY).optional().describe('The last day of occurrences to include, YYYY-MM-DD.'),
|
|
160
|
+
}, async ({ eventType, from, to }) => {
|
|
161
|
+
try {
|
|
162
|
+
const catalogue = await catalogueOf();
|
|
163
|
+
const narrowed = narrowCatalogue(catalogue, (item) => item.id === eventType);
|
|
164
|
+
const [item] = narrowed.items;
|
|
165
|
+
if (!item) {
|
|
166
|
+
return { content: [{ type: 'text', text: `No event type "${eventType}" in the Block catalogue. Find one with dwlf_describe_onchain_events.` }], isError: true };
|
|
167
|
+
}
|
|
168
|
+
if (item.kind === 'series') {
|
|
169
|
+
return { content: [{ type: 'text', text: `"${eventType}" is a series, not an event type: read it with dwlf_get_series.` }], isError: true };
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
return reply({ ...narrowed, occurrences: await client.get('/events', { types: eventType, from, to }) });
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
// The definition still answers; the occurrences read failing is said, never read as "it has not fired".
|
|
176
|
+
return reply({ ...narrowed, occurrencesUnavailable: error instanceof BlockApiError ? error.message : String(error) });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
return failure(error);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/block/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAkB,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;GAKG;AAEH,8FAA8F;AAC9F,MAAM,QAAQ,GACZ,kHAAkH;IAClH,oHAAoH;IACpH,kHAAkH;IAClH,iHAAiH;IACjH,6GAA6G;IAC7G,oKAAoK;IACpK,uEAAuE,CAAC;AAE1E,MAAM,GAAG,GAAG,qBAAqB,CAAC;AAClC,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AE,CAAC;gBACf,wGAAwG;gBACxG,OAAO,KAAK,CAAC,EAAE,GAAG,QAAQ,EAAE,sBAAsB,EAAE,KAAK,YAAY,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACxH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;QAAC,CAAC;IAC5C,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockDescriptions.d.ts","sourceRoot":"","sources":["../src/blockDescriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AAC1C,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"blockDescriptions.d.ts","sourceRoot":"","sources":["../src/blockDescriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AAC1C,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;AAY1E;;;GAGG;AAGH,eAAO,MAAM,YAAY,QAC2F,CAAC;AACrH,eAAO,MAAM,WAAW,mBAC0E,CAAC;AAyBnG,kGAAkG;AAClG,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CA6E7F,CAAC;AAWH,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,KAAK,KAAK,CAAC,CA0B3E,CAAC;AAOH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,CAehF,CAAC"}
|
|
@@ -9,18 +9,32 @@ const swap = (from, to) => (shared) => {
|
|
|
9
9
|
}
|
|
10
10
|
return shared.replace(from, to);
|
|
11
11
|
};
|
|
12
|
+
/** Several one-phrase changes, applied in order (each throws like `swap` when its phrase is gone). */
|
|
13
|
+
const swaps = (...pairs) => (shared) => pairs.reduce((text, [from, to]) => swap(from, to)(text), shared);
|
|
12
14
|
/**
|
|
13
15
|
* What a Block agent must not do with a market reading (WP7, the 12-Nov input point 6). Appended to the read tools whose
|
|
14
16
|
* shared description does not already say it in its own words; the profile test checks every one of them carries it.
|
|
15
17
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
// Worded in the shared list's own allowed phrases (block-site ops/wording-banned.json `allowPhrases`), so the wording
|
|
19
|
+
// gate (test/wording.test.mjs) passes it without an exemption.
|
|
20
|
+
export const READING_NOTE = 'What this tool gives describes the market or the chain as of its date. It is not a forecast and not a ' +
|
|
21
|
+
'recommendation, and nothing here is scored as a predictor: never turn it into buy, sell or hold recommendations.';
|
|
18
22
|
export const NOTED_TOOLS = Object.freeze(['dwlf_get_events', 'dwlf_get_price_picture', 'dwlf_get_indicators', 'dwlf_get_regime',
|
|
19
23
|
'dwlf_get_support_resistance', 'dwlf_get_trendlines', 'dwlf_get_market_data', 'dwlf_get_quote']);
|
|
20
24
|
// A noted tool whose shared wording also needs a phrase changed: the phrase change, then the note.
|
|
21
25
|
const NOTED_PHRASES = {
|
|
22
26
|
dwlf_get_quote: swap(' Ideal for marking a trade/skip to current price or pricing an arbitrary symbol.', ' Use it to price any tracked symbol.'),
|
|
23
|
-
dwlf_get_indicators:
|
|
27
|
+
dwlf_get_indicators: swaps(['For momentum, band and cross signals use', 'For momentum, band and cross events use'], ['`rsi.exit.*` / `rsi.midline.*` for RSI(14)', '`rsi.*` for RSI(14) moves back inside 70 / 30 and closes across 50']),
|
|
28
|
+
// Block reads an event id inside a sentence as words (dwlf-block-api's charter), so its wording names id families
|
|
29
|
+
// and leaves each id to dwlf_explain_event; retail keeps the engine's ids in the shared text.
|
|
30
|
+
dwlf_get_events: swaps(['RSI(14): `rsi.exit.overbought` / `rsi.exit.oversold` (back inside 70 / 30), `rsi.midline.bullish` / `rsi.midline.bearish` (a close across 50). ',
|
|
31
|
+
'RSI(14) (`rsi.*`): a move back inside 70 / 30, and a close across 50. '], ['Divergence: `rsi.divergence.*` and `dss.divergence.*`, each `{regular,hidden}.{bullish,bearish}` (e.g. `rsi.divergence.regular.bullish`), ' +
|
|
32
|
+
'compare price with RSI(14) or DSS at consecutive confirmed daily cycle lows (bullish) or highs (bearish). ',
|
|
33
|
+
'Divergence (`rsi.divergence.*` and `dss.divergence.*`, regular or hidden, at lows or at highs; dwlf_explain_event names each id) ' +
|
|
34
|
+
'compares price with RSI(14) or DSS at two consecutive confirmed daily cycle lows, or at two highs. '], ['ADX / DMI (daily, Wilder 14): `adx.trend.started.bullish` / `.bearish` (ADX rises to 25; side from the DIs), `adx.trend.faded` ' +
|
|
35
|
+
'(ADX falls below 20: ranging again), `adx.di.cross.bullish` / `.bearish` (DIs cross while ADX >= 20); ',
|
|
36
|
+
'ADX / DMI (daily, Wilder 14; `adx.*`): a trend start, one id per side (ADX rises to 25; side from the DIs), `adx.trend.faded` ' +
|
|
37
|
+
'(ADX falls below 20: ranging again), and a DI cross, one id per side (DIs cross while ADX >= 20); ']),
|
|
24
38
|
};
|
|
25
39
|
const noted = (name) => (shared) => `${(NOTED_PHRASES[name] ?? String)(shared)} ${READING_NOTE}`;
|
|
26
40
|
/** A string replaces the shared description; a function rewrites it (for a one-phrase change). */
|
|
@@ -29,10 +43,13 @@ export const BLOCK_DESCRIPTIONS = Object.freeze({
|
|
|
29
43
|
'Most used: toggle `enabled` to pause/resume without losing the subscription\'s history. Editable fields: enabled, ' +
|
|
30
44
|
'symbols, timeframes, channels, quietHours, dedupeWindowMinutes, and customEventId (custom_event subscriptions ' +
|
|
31
45
|
'only). `eventTypeId` is NOT patchable: switching what an alert listens for means delete + recreate.',
|
|
32
|
-
dwlf_get_ranges: swap('
|
|
46
|
+
dwlf_get_ranges: swap('"at the BOTTOM of a range" (near_floor — significant alongside a daily cycle low), "at the TOP of the range — ' +
|
|
47
|
+
'think twice about entering here",', '"near the floor of a range" (near_floor, read alongside a confirmed daily cycle low), "near the ' +
|
|
48
|
+
'ceiling of the range",'),
|
|
49
|
+
dwlf_get_divergences: swaps(['Bullish = measured at lows, bearish = at highs.', 'The `direction` parameter says where it was measured: one value for lows, the other for highs.'], ['`direction` (bullish | bearish)', '`direction` (one of its two values: the first measured at lows, the second at highs)']),
|
|
33
50
|
...Object.fromEntries(NOTED_TOOLS.map((name) => [name, noted(name)])),
|
|
34
51
|
dwlf_get_custom_event_notifications: (shared) => `${shared} A fire records that a condition the user defined held on that ` +
|
|
35
|
-
'date: it is the output of their own rule, not a DWLF
|
|
52
|
+
'date: it is the output of their own rule, not a DWLF call.',
|
|
36
53
|
dwlf_create_subscription: 'Create an alert subscription: get told when an event fires. Two shapes, distinguished by `eventTypeId`:\n' +
|
|
37
54
|
' - any event id (e.g. `onchain.mvrv.cross_above_1`, `cycle.low.confirmed`, `swing_low_break`): fires when that event is recorded;\n' +
|
|
38
55
|
' - `custom_event`: requires `customEventId`; fires when that custom event fires.\n\n' +
|
|
@@ -51,12 +68,12 @@ export const BLOCK_DESCRIPTIONS = Object.freeze({
|
|
|
51
68
|
'list ({ id } or { prefix }, with a reason). `catalogueError` means the catalogue could not be read and only the ' +
|
|
52
69
|
'static nodes are listed.',
|
|
53
70
|
dwlf_create_custom_event: '⚠️ Create a new custom event (a condition you define, recorded each time it holds). WORKFLOW: 1) create (saving ' +
|
|
54
|
-
'compiles it; a graph that
|
|
55
|
-
'event
|
|
71
|
+
'compiles it; a graph that does not compile is refused with 400) → 2) call dwlf_activate_event_symbols next (without ' +
|
|
72
|
+
'it the event never fires) → 3) dwlf_evaluate_custom_event to fill its history. Until symbols are activated the event ' +
|
|
56
73
|
'exists but the evaluation engine does not see it, so it records nothing. Activate symbols straight after creating it.',
|
|
57
74
|
dwlf_evaluate_custom_event: '⚠️ Trigger an on-demand evaluation run for a custom event: the step BETWEEN activating symbols and reading its fires. ' +
|
|
58
|
-
'Without it the event only evaluates on the daily run, and its history is not filled until then.
|
|
59
|
-
'{ requestId, status: "pending" }; poll dwlf_get_evaluation_status(requestId) until status is "completed", then read ' +
|
|
75
|
+
'Without it the event only evaluates on the daily run, and its history is not filled until then. It answers ' +
|
|
76
|
+
'with { requestId, status: "pending" }; poll dwlf_get_evaluation_status(requestId) until status is "completed", then read ' +
|
|
60
77
|
'the fires via dwlf_get_events(type: "custom_event"). Consumes one EVALUATION quota. By default only the most recent ' +
|
|
61
78
|
'~400 candles (~14 months of daily data) are evaluated, so older history has NO fires: to fill a longer history pass ' +
|
|
62
79
|
'`lookbackDays` covering it (e.g. 2200 for ~5-6 years).',
|
|
@@ -68,7 +85,7 @@ export const BLOCK_DESCRIPTIONS = Object.freeze({
|
|
|
68
85
|
'custom event), NOT the symbols inside the job: an evaluation across 37 symbols shows `totalItems: 1, ' +
|
|
69
86
|
'processedItems: 1` when done. When the request named symbols this tool adds `symbolsRequested: <count>` beside the ' +
|
|
70
87
|
'summary. When status is "completed", read the fires via dwlf_get_events(type: "custom_event").',
|
|
71
|
-
dwlf_register_agent: 'Programmatically register a new DWLF account: no browser or Google sign-in required.
|
|
88
|
+
dwlf_register_agent: 'Programmatically register a new DWLF account: no browser or Google sign-in required. It issues an API key ' +
|
|
72
89
|
'immediately. Email verification unlocks the compute features (custom event evaluations). Useful for onboarding ' +
|
|
73
90
|
'flows where an agent registers itself.',
|
|
74
91
|
dwlf_get_cycle_setups: 'The cycle screener: across the symbols DWLF tracks, which have their WEEKLY cycle timing window open, and whether a ' +
|
|
@@ -82,9 +99,9 @@ export const BLOCK_DESCRIPTIONS = Object.freeze({
|
|
|
82
99
|
'`unverified` while the detection gate stands failed), `rulerAgreesWithState`, `generation` and `projectionHash`; ' +
|
|
83
100
|
'null when no window is stored for the series. ⚠️ A symbol whose weekly window is not yet open is ABSENT from every ' +
|
|
84
101
|
'list: for its window dates call `dwlf_get_cycle_windows`. DEPTH (`depth: true`): each row also carries `depth`, ' +
|
|
85
|
-
'its weekly window\'s price band from past cycles\' moves (the same object `dwlf_get_cycle_windows`
|
|
102
|
+
'its weekly window\'s price band from past cycles\' moves (the same object `dwlf_get_cycle_windows` gives), and ' +
|
|
86
103
|
'`depth.reading.position` places the last weekly close: `in-zone` (inside the p25–p75 of past moves), `shallow` / ' +
|
|
87
|
-
'`deep` / `beyond`, or `not-reached`. It is context
|
|
104
|
+
'`deep` / `beyond`, or `not-reached`. It is context (no targets), and it does not change the stage or the order. ' +
|
|
88
105
|
'A missing band says why in `depthUnavailable`. Everything here is a dated state of the cycle engine, not a call.',
|
|
89
106
|
});
|
|
90
107
|
const BLOCK_EVENT_TYPE_ID = 'What fires the alert: an event id (e.g. `onchain.mvrv.cross_above_1`, `cycle.low.confirmed`), or ' +
|
|
@@ -111,13 +128,18 @@ export const BLOCK_SCHEMAS = Object.freeze({
|
|
|
111
128
|
...shared,
|
|
112
129
|
side: z.enum(['low', 'high']).optional().describe('Omit for both sides. `low` = the next cycle-low window; `high` = the next cycle-high window.'),
|
|
113
130
|
}),
|
|
131
|
+
// The values stay the engine's (identifiers); the words around them are Block's.
|
|
132
|
+
dwlf_get_divergences: (shared) => ({
|
|
133
|
+
...shared,
|
|
134
|
+
direction: z.enum(['bullish', 'bearish']).optional().describe('Where it was measured: the first value at lows, the second at highs.'),
|
|
135
|
+
}),
|
|
114
136
|
dwlf_get_evaluation_status: (shared) => ({
|
|
115
137
|
...shared,
|
|
116
138
|
requestId: z.string().describe('Evaluation request ID returned by dwlf_evaluate_custom_event'),
|
|
117
139
|
}),
|
|
118
140
|
dwlf_describe_strategy_nodes: (shared) => ({
|
|
119
141
|
...shared,
|
|
120
|
-
nodeType: z.string().optional().describe('
|
|
142
|
+
nodeType: z.string().optional().describe('Give only this one node (a condition or a logic gate, by its node type id).'),
|
|
121
143
|
category: z.enum(['condition', 'logic']).optional().describe('`condition` (indicator and event conditions) or `logic` (the and/or/not/then gates that combine them).'),
|
|
122
144
|
}),
|
|
123
145
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockDescriptions.js","sourceRoot":"","sources":["../src/blockDescriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,EAAE,CAAC,CAAC,MAAc,EAAU,EAAE;IACpE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,4DAA4D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC;IACpI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC;AACF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"blockDescriptions.js","sourceRoot":"","sources":["../src/blockDescriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,EAAE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CAAC,EAAE,KAAK,EAAE,4BAA4B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;4BACjI,IAAI,EAAE,0GAA0G,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QACtI,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACnH,CAAC;CACF,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { profiledServer, resolveProfile, PROFILE_INSTRUCTIONS } from './profiles.js';
|
|
5
|
+
import { registerForProfile } from './register.js';
|
|
6
|
+
import { resolveProfile, resolveBlockBackend, PROFILE_INSTRUCTIONS, BLOCK_API_INSTRUCTIONS } from './profiles.js';
|
|
8
7
|
// package.json sits one level above dist/ in both a clone and the published tarball.
|
|
9
8
|
const { version } = createRequire(import.meta.url)('../package.json');
|
|
10
9
|
// Tool profile (DWLF-621): `full` by default; `block` for block.dwlf users. Unknown → exit with the reason.
|
|
11
10
|
let profile;
|
|
11
|
+
let backend;
|
|
12
12
|
try {
|
|
13
13
|
profile = resolveProfile(process.argv.slice(2), process.env);
|
|
14
|
+
backend = resolveBlockBackend(process.argv.slice(2), process.env, profile);
|
|
14
15
|
}
|
|
15
16
|
catch (error) {
|
|
16
17
|
console.error(error instanceof Error ? error.message : String(error));
|
|
17
18
|
process.exit(1);
|
|
18
19
|
}
|
|
19
|
-
const instructions = PROFILE_INSTRUCTIONS[profile];
|
|
20
|
+
const instructions = backend === 'block-api' ? BLOCK_API_INSTRUCTIONS : PROFILE_INSTRUCTIONS[profile];
|
|
20
21
|
const server = new McpServer({ name: 'dwlf', version }, instructions ? { instructions } : undefined);
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
// On the block-api backend (DWLF-876) SPT and DWLF_API_KEY are not used at all.
|
|
23
|
+
if (backend === 'block-api' && process.env.DWLF_API_KEY) {
|
|
24
|
+
console.error('Note: DWLF_API_KEY is not used on the block-api backend (set DWLF_BLOCK_KEY for a Block API key).');
|
|
25
|
+
}
|
|
26
|
+
registerForProfile(server, profile, backend);
|
|
23
27
|
// Start server with stdio transport
|
|
24
28
|
const transport = new StdioServerTransport();
|
|
25
29
|
await server.connect(transport);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAuC,MAAM,eAAe,CAAC;AAEvJ,qFAAqF;AACrF,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC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AS,CAAC,CAAC"}
|
package/dist/profiles.d.ts
CHANGED
|
@@ -15,6 +15,21 @@ export type ProfileName = 'full' | 'block';
|
|
|
15
15
|
export declare const BLOCK_TOOLS: ReadonlySet<string>;
|
|
16
16
|
/** Server instructions sent at `initialize`, per profile (null = none, as before). */
|
|
17
17
|
export declare const PROFILE_INSTRUCTIONS: Record<ProfileName, string | null>;
|
|
18
|
+
/**
|
|
19
|
+
* The Block profile's backend (DWLF-876, docs/design/block-repoint.md D1): `spt` (today's default, SPT /v2) or
|
|
20
|
+
* `block-api` (the Block API, the launch set only). Dark until the cut release flips the default. Not a published
|
|
21
|
+
* contract like a profile name: `spt` stays one minor release after the cut as the rollback, then goes.
|
|
22
|
+
*/
|
|
23
|
+
export type BlockBackend = 'spt' | 'block-api';
|
|
24
|
+
/** The tools `--profile block` offers on the `block-api` backend (the launch set as it lands; D2). */
|
|
25
|
+
export declare const BLOCK_API_TOOLS: ReadonlySet<string>;
|
|
26
|
+
/** Server instructions for `--profile block` on the `block-api` backend. Worded within the shared banned-terms list. */
|
|
27
|
+
export declare const BLOCK_API_INSTRUCTIONS: string;
|
|
28
|
+
/**
|
|
29
|
+
* The backend named by `--block-backend X` / `--block-backend=X`, else `DWLF_BLOCK_BACKEND`, else `spt`. Throws on an
|
|
30
|
+
* unknown value, and on a non-default backend for any profile but `block` (it would otherwise be silently ignored).
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveBlockBackend(argv: readonly string[], env: Record<string, string | undefined>, profile: ProfileName): BlockBackend;
|
|
18
33
|
/** The profile named by `--profile X` / `--profile=X`, else `DWLF_TOOL_PROFILE`, else `full`. Throws on an unknown name. */
|
|
19
34
|
export declare function resolveProfile(argv: readonly string[], env: Record<string, string | undefined>): ProfileName;
|
|
20
35
|
/**
|
package/dist/profiles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AAAA,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AM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,YAAY,CAaxI;AAED,4HAA4H;AAC5H,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,WAAW,CAgB5G;AAwBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,SAAS,CAgBtH"}
|
package/dist/profiles.js
CHANGED
|
@@ -71,6 +71,40 @@ export const PROFILE_INSTRUCTIONS = {
|
|
|
71
71
|
'naming `[PLAN_REQUIRED; family=…; requiredPlan=…; pricingUrl=…]`. Tell your human what is locked and which plan ' +
|
|
72
72
|
'unlocks it (`pricingUrl`); never guess a locked value.',
|
|
73
73
|
};
|
|
74
|
+
/** The tools `--profile block` offers on the `block-api` backend (the launch set as it lands; D2). */
|
|
75
|
+
export const BLOCK_API_TOOLS = new Set(['dwlf_get_conditions', 'dwlf_get_events', 'dwlf_get_series',
|
|
76
|
+
'dwlf_describe_onchain_events', 'dwlf_explain_event']);
|
|
77
|
+
/** Server instructions for `--profile block` on the `block-api` backend. Worded within the shared banned-terms list. */
|
|
78
|
+
export const BLOCK_API_INSTRUCTIONS = 'DWLF Block: Bitcoin conditions, not calls. Start with dwlf_get_conditions for where Bitcoin is now, then ' +
|
|
79
|
+
'dwlf_get_events for what happened and when, and dwlf_get_series for one measure over time. Find an event type or ' +
|
|
80
|
+
'series with dwlf_describe_onchain_events, and read one event type with dwlf_explain_event. Every answer is the ' +
|
|
81
|
+
'Block envelope: lead with its `summary`, give each item\'s `why` and `chartUrl`, and date each fact by its ' +
|
|
82
|
+
'`knowableAt`. An item with `locked: true` is of a family this view does not read: tell your human what it is, ' +
|
|
83
|
+
'when it happened and which plan reads it (`requiredPlan`, `pricingUrl`); never guess a locked value. Describe ' +
|
|
84
|
+
'states and conditions; never turn them into buy, sell or hold recommendations. Nothing here is scored as a predictor.';
|
|
85
|
+
/**
|
|
86
|
+
* The backend named by `--block-backend X` / `--block-backend=X`, else `DWLF_BLOCK_BACKEND`, else `spt`. Throws on an
|
|
87
|
+
* unknown value, and on a non-default backend for any profile but `block` (it would otherwise be silently ignored).
|
|
88
|
+
*/
|
|
89
|
+
export function resolveBlockBackend(argv, env, profile) {
|
|
90
|
+
let named;
|
|
91
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
92
|
+
if (argv[i] === '--block-backend') {
|
|
93
|
+
if (argv[i + 1] === undefined || argv[i + 1].startsWith('--'))
|
|
94
|
+
throw new Error('--block-backend needs a value (spt or block-api).');
|
|
95
|
+
named = argv[i + 1];
|
|
96
|
+
}
|
|
97
|
+
else if (argv[i].startsWith('--block-backend='))
|
|
98
|
+
named = argv[i].slice('--block-backend='.length);
|
|
99
|
+
}
|
|
100
|
+
const fromEnv = env.DWLF_BLOCK_BACKEND?.trim() ? env.DWLF_BLOCK_BACKEND : undefined;
|
|
101
|
+
const raw = (named ?? fromEnv ?? 'spt').trim().toLowerCase();
|
|
102
|
+
if (raw !== 'spt' && raw !== 'block-api')
|
|
103
|
+
throw new Error(`Unknown Block backend "${raw}". Use one of: spt, block-api.`);
|
|
104
|
+
if (raw === 'block-api' && profile !== 'block')
|
|
105
|
+
throw new Error('The block-api backend applies to --profile block only.');
|
|
106
|
+
return raw;
|
|
107
|
+
}
|
|
74
108
|
/** The profile named by `--profile X` / `--profile=X`, else `DWLF_TOOL_PROFILE`, else `full`. Throws on an unknown name. */
|
|
75
109
|
export function resolveProfile(argv, env) {
|
|
76
110
|
let named;
|
package/dist/profiles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AACA,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