dero-mcp-server 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,11 @@
7
7
  * content via the shared extractTelaDocContent. Large files are chunked with
8
8
  * offset pagination (mirrors dero_docs_get_page).
9
9
  *
10
+ * TELA-CLI gzips files (a `.gz` filename), storing them base64-encoded. This
11
+ * tool transparently base64-decodes + gunzips such content (Node's built-in
12
+ * zlib, no new dependency) and returns the real plaintext file — so an agent
13
+ * never has to shell out to decompress.
14
+ *
10
15
  * Read-only; one RPC call. We surface the content verbatim and report the
11
16
  * author signature's presence — we do NOT claim to have verified it (the
12
17
  * server performs no signature check), only that the contract carries one.
@@ -27,6 +32,7 @@ export declare function telaGetDocContent(rpc: DeroDaemonRpc, args: TelaGetDocCo
27
32
  scid: string;
28
33
  topoheight: number | null;
29
34
  filename: string | null;
35
+ stored_filename: string | null;
30
36
  doc_type: string | null;
31
37
  sub_dir: string | null;
32
38
  content_embedded: boolean;
@@ -36,6 +42,7 @@ export declare function telaGetDocContent(rpc: DeroDaemonRpc, args: TelaGetDocCo
36
42
  content_truncated: boolean;
37
43
  next_offset: number | null;
38
44
  compressed: boolean;
45
+ decompressed: boolean;
39
46
  signature: {
40
47
  present: boolean;
41
48
  file_check_c_present: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"tela-get-doc-content.d.ts","sourceRoot":"","sources":["../../src/composites/tela-get-doc-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAmB,KAAK,aAAa,EAAwB,MAAM,cAAc,CAAA;AAQxF,eAAO,MAAM,4BAA4B;;;;CAY/B,CAAA;AAEV,KAAK,sBAAsB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpF,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;GA2DvF"}
1
+ {"version":3,"file":"tela-get-doc-content.d.ts","sourceRoot":"","sources":["../../src/composites/tela-get-doc-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAmB,KAAK,aAAa,EAAwB,MAAM,cAAc,CAAA;AAyBxF,eAAO,MAAM,4BAA4B;;;;CAY/B,CAAA;AAEV,KAAK,sBAAsB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpF,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;GAuFvF"}
@@ -7,16 +7,41 @@
7
7
  * content via the shared extractTelaDocContent. Large files are chunked with
8
8
  * offset pagination (mirrors dero_docs_get_page).
9
9
  *
10
+ * TELA-CLI gzips files (a `.gz` filename), storing them base64-encoded. This
11
+ * tool transparently base64-decodes + gunzips such content (Node's built-in
12
+ * zlib, no new dependency) and returns the real plaintext file — so an agent
13
+ * never has to shell out to decompress.
14
+ *
10
15
  * Read-only; one RPC call. We surface the content verbatim and report the
11
16
  * author signature's presence — we do NOT claim to have verified it (the
12
17
  * server performs no signature check), only that the contract carries one.
13
18
  */
14
19
  import { z } from 'zod';
20
+ import zlib from 'node:zlib';
21
+ import { Buffer } from 'node:buffer';
15
22
  import { attachCitations } from './_shared.js';
16
23
  import { classifyTela, parseTelaDoc, extractTelaDocContent } from '../tela-parse.js';
17
24
  const SCID_HEX_REGEX = /^[0-9a-fA-F]{64}$/;
18
25
  // Per-call content cap, matching dero_docs_get_page's PAGE_CONTENT_CHUNK.
19
26
  const DOC_CONTENT_CHUNK = 60000;
27
+ /**
28
+ * TELA-CLI stores gzipped DOC files as base64-encoded gzip. Decode + gunzip
29
+ * back to the plaintext file. Defensive: returns null (caller keeps the raw
30
+ * content) if the bytes are not actually base64'd gzip, so a mislabeled or
31
+ * truncated file never throws.
32
+ */
33
+ function decompressGzipBase64(content) {
34
+ try {
35
+ const buf = Buffer.from(content.trim(), 'base64');
36
+ // gzip magic bytes 0x1f 0x8b — bail early if absent (not really gzip).
37
+ if (buf.length < 2 || buf[0] !== 0x1f || buf[1] !== 0x8b)
38
+ return null;
39
+ return zlib.gunzipSync(buf).toString('utf8');
40
+ }
41
+ catch {
42
+ return null;
43
+ }
44
+ }
20
45
  export const telaGetDocContentInputSchema = {
21
46
  scid: z
22
47
  .string()
@@ -50,17 +75,44 @@ export async function telaGetDocContent(rpc, args) {
50
75
  const doc = parseTelaDoc(stringkeys, code);
51
76
  const extracted = extractTelaDocContent(code);
52
77
  const responseTopoheight = typeof args.topoheight === 'number' && Number.isFinite(args.topoheight) ? args.topoheight : null;
53
- const full = extracted.content ?? '';
78
+ // A `.gz` filename means TELA-CLI stored the file as base64'd gzip.
79
+ // Transparently decompress to the plaintext file so the agent reads real
80
+ // HTML/JS/CSS, not a compressed blob. If decompression fails (not actually
81
+ // gzip), fall back to the raw content and flag it.
82
+ const rawExtracted = extracted.content ?? '';
83
+ const looksGzipped = !!doc.filename && /\.gz$/i.test(doc.filename);
84
+ let decompressed = false;
85
+ let decompressFailed = false;
86
+ let full = rawExtracted;
87
+ let displayFilename = doc.filename;
88
+ if (looksGzipped && extracted.embedded && rawExtracted) {
89
+ const out = decompressGzipBase64(rawExtracted);
90
+ if (out !== null) {
91
+ full = out;
92
+ decompressed = true;
93
+ // Surface the real filename (strip the .gz the user never sees).
94
+ displayFilename = doc.filename.replace(/\.gz$/i, '');
95
+ }
96
+ else {
97
+ decompressFailed = true;
98
+ }
99
+ }
54
100
  const total = full.length;
55
101
  const offset = Math.max(0, Math.min(args.offset ?? 0, total));
56
102
  const end = Math.min(offset + DOC_CONTENT_CHUNK, total);
57
103
  const truncated = end < total;
58
- // .gz filename ⇒ gzip-compressed content we cannot decompress in-process.
59
- const compressed = !!doc.filename && /\.gz$/i.test(doc.filename);
104
+ const note = extracted.note
105
+ ? extracted.note
106
+ : decompressed
107
+ ? `File was gzip-compressed on-chain (stored as ${doc.filename}); transparently decompressed to plaintext here.`
108
+ : decompressFailed
109
+ ? `Filename is ${doc.filename} but the content did not decode as base64 gzip; returning raw bytes.`
110
+ : undefined;
60
111
  const payload = {
61
112
  scid: args.scid,
62
113
  topoheight: responseTopoheight,
63
- filename: doc.filename,
114
+ filename: displayFilename,
115
+ stored_filename: doc.filename,
64
116
  doc_type: doc.doc_type,
65
117
  sub_dir: doc.sub_dir,
66
118
  content_embedded: extracted.embedded,
@@ -69,12 +121,13 @@ export async function telaGetDocContent(rpc, args) {
69
121
  content_length: total,
70
122
  content_truncated: truncated,
71
123
  next_offset: truncated ? end : null,
72
- compressed,
124
+ compressed: looksGzipped,
125
+ decompressed,
73
126
  signature: doc.signature,
74
127
  signature_note: 'The contract carries an author signature (fileCheckC/S). This tool reports its presence but does NOT cryptographically verify it.',
75
- note: extracted.note ?? (compressed ? 'Content is gzip-compressed (.gz); shown bytes are compressed, not the plaintext file.' : undefined),
128
+ note,
76
129
  narrative: extracted.embedded
77
- ? `Fetched ${total} bytes of "${doc.filename ?? 'file'}" (${doc.doc_type ?? 'unknown type'}) from TELA-DOC-1 ${args.scid}.${truncated ? ` Returning bytes ${offset}–${end}; paginate with next_offset.` : ''}${compressed ? ' Content is gzip-compressed.' : ''}`
130
+ ? `Fetched ${total} bytes of "${displayFilename ?? 'file'}" (${doc.doc_type ?? 'unknown type'}) from TELA-DOC-1 ${args.scid}.${decompressed ? ' Gzip content was decompressed to plaintext.' : ''}${truncated ? ` Returning bytes ${offset}–${end}; paginate with next_offset.` : ''}`
78
131
  : `TELA-DOC-1 ${args.scid} ("${doc.filename ?? 'file'}") has no inline file content (${extracted.note ?? 'DocShard, STATIC, or external'}).`,
79
132
  };
80
133
  return attachCitations(payload, 'tela_get_doc_content');
@@ -1 +1 @@
1
- {"version":3,"file":"tela-get-doc-content.js","sourceRoot":"","sources":["../../src/composites/tela-get-doc-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAA4C,MAAM,cAAc,CAAA;AACxF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAEpF,MAAM,cAAc,GAAG,mBAAmB,CAAA;AAE1C,0EAA0E;AAC1E,MAAM,iBAAiB,GAAG,KAAK,CAAA;AAE/B,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,KAAK,CAAC,cAAc,EAAE,6CAA6C,CAAC;SACpE,QAAQ,CAAC,6DAA6D,CAAC;IAC1E,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,sFAAsF,CAAC;IACnG,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;CACjG,CAAA;AAIV,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAkB,EAAE,IAA4B;IACtF,MAAM,MAAM,GAA4B,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;IACxF,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS;QAAE,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;IAEtE,MAAM,GAAG,GAAG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iBAAiB,EAAE,SAAS;QAC5B,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;QACnC,UAAU,EAAE,YAAY;QACxB,YAAY;QACZ,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,cAAc,EACZ,mIAAmI;QACrI,IAAI;QACJ,SAAS,EAAE,SAAS,CAAC,QAAQ;YAC3B,CAAC,CAAC,WAAW,KAAK,cAAc,eAAe,IAAI,MAAM,MAAM,GAAG,CAAC,QAAQ,IAAI,cAAc,qBAAqB,IAAI,CAAC,IAAI,IAAI,YAAY,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,oBAAoB,MAAM,IAAI,GAAG,8BAA8B,CAAC,CAAC,CAAC,EAAE,EAAE;YACtR,CAAC,CAAC,cAAc,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,QAAQ,IAAI,MAAM,kCAAkC,SAAS,CAAC,IAAI,IAAI,+BAA+B,IAAI;KAC/I,CAAA;IAED,OAAO,eAAe,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAA;AACzD,CAAC"}
@@ -40,7 +40,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
40
40
  import { createDeroMcpServer } from './server.js';
41
41
  import { resolveDaemonBase, describeDaemonResolution } from './daemon-base.js';
42
42
  import { docsIndexMeta } from './docs.js';
43
- const PACKAGE_VERSION = '0.4.5';
43
+ const PACKAGE_VERSION = '0.4.7';
44
44
  function readEnv() {
45
45
  const port = Number.parseInt(process.env.DERO_MCP_HTTP_PORT ?? '8787', 10);
46
46
  const host = process.env.DERO_MCP_HTTP_HOST ?? '127.0.0.1';
package/dist/server.js CHANGED
@@ -240,7 +240,7 @@ export function createDeroMcpServer(daemonBaseUrl) {
240
240
  const rpc = async (method, params) => deroJsonRpc(endpoint, method, params);
241
241
  const server = new McpServer({
242
242
  name: 'dero-daemon-mcp',
243
- version: '0.4.5',
243
+ version: '0.4.7',
244
244
  });
245
245
  server.registerTool('dero_daemon_ping', readOnly({
246
246
  description: TOOL_DESCRIPTIONS.dero_daemon_ping,
@@ -613,7 +613,7 @@ export function createDeroMcpServer(daemonBaseUrl) {
613
613
  mimeType: 'application/json',
614
614
  text: JSON.stringify({
615
615
  name: 'dero-daemon-mcp',
616
- version: '0.4.5',
616
+ version: '0.4.7',
617
617
  mode: 'read-only',
618
618
  endpoint: endpoint,
619
619
  docs_products: DERO_DOC_PRODUCTS,
@@ -48,6 +48,14 @@ export type TelaIndexParsed = {
48
48
  }[];
49
49
  current_commit_hash: string | null;
50
50
  owner: string | null;
51
+ tela_version: string | null;
52
+ likes: number | null;
53
+ dislikes: number | null;
54
+ /** Per-wallet ratings summary (voters + raw values), or null if none. */
55
+ ratings: {
56
+ voters: number;
57
+ values: number[];
58
+ } | null;
51
59
  /** GetSC does not expose ringsize, so updateability cannot be derived. */
52
60
  updateable: 'unknown';
53
61
  updateable_note: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tela-parse.d.ts","sourceRoot":"","sources":["../src/tela-parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAA;AAE7D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAA;IACd,qFAAqF;IACrF,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,mFAAmF;IACnF,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,OAAO,CAAA;IACtB,gFAAgF;IAChF,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE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OAAO,CAAC;QAAC,oBAAoB,EAAE,OAAO,CAAA;KAAE,CAAA;IAC7F,gBAAgB,EAAE,OAAO,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,IAAI,CAAA;IACf,WAAW,EAAE,MAAM,EAAE,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAuDD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC/C,IAAI,EAAE,MAAM,GACX,kBAAkB,CAoCpB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC/C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAC9C,eAAe,CAqGjB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC/C,IAAI,EAAE,MAAM,GACX,aAAa,CAkCf;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CA2BlE"}
@@ -22,10 +22,51 @@ const DOC_KEY = /^DOC(\d+)$/;
22
22
  const UPDATEABLE_NOTE = 'Updateability depends on the install ringsize (ringsize 2 = owner-updateable, ' +
23
23
  '> 2 = permanently immutable), which DERO.GetSC does not expose. Cannot be ' +
24
24
  'determined from chain state here; check the install transaction ringsize.';
25
- /** Null-tolerant string read from a stringkeys map. Returns null for missing/non-string. */
25
+ /**
26
+ * DERO.GetSC returns stored STRING-key values hex-encoded. A TELA app's
27
+ * var_header_name "Crypto hammer" comes back as "43727970746f2068616d6d6572",
28
+ * and a DOC SCID comes back as the 128-char hex encoding of its 64-char hex
29
+ * string. This decodes such values back to text.
30
+ *
31
+ * Defensive: only decodes when the value is even-length hex that decodes to
32
+ * printable UTF-8 (no control chars / replacement chars); otherwise returns the
33
+ * value unchanged. So already-plain values, short counters, and binary blobs
34
+ * pass through untouched and we never throw or corrupt a value.
35
+ */
36
+ function decodeScValue(value) {
37
+ if (typeof value !== 'string')
38
+ return value == null ? null : String(value);
39
+ const v = value;
40
+ if (v.length === 0)
41
+ return '';
42
+ if (v.length % 2 !== 0 || !/^[0-9a-fA-F]+$/.test(v))
43
+ return v;
44
+ try {
45
+ const decoded = Buffer.from(v, 'hex').toString('utf8');
46
+ // Reject if decoding produced control chars or U+FFFD (not real text).
47
+ if (/[\u0000-\u0008\u000e-\u001f\ufffd]/.test(decoded))
48
+ return v;
49
+ return decoded;
50
+ }
51
+ catch {
52
+ return v;
53
+ }
54
+ }
55
+ /** Null-tolerant, hex-decoded string read from a stringkeys map. */
26
56
  function readStr(stringkeys, key) {
27
- const v = stringkeys?.[key];
28
- return typeof v === 'string' ? v : null;
57
+ if (!stringkeys || !(key in stringkeys))
58
+ return null;
59
+ return decodeScValue(stringkeys[key]);
60
+ }
61
+ /** Null-tolerant non-negative integer read (number, numeric string, or decoded). */
62
+ function readUint(stringkeys, key) {
63
+ if (!stringkeys || !(key in stringkeys))
64
+ return null;
65
+ const raw = stringkeys[key];
66
+ if (typeof raw === 'number' && Number.isFinite(raw))
67
+ return raw;
68
+ const s = decodeScValue(raw);
69
+ return s !== null && /^\d+$/.test(s) ? Number(s) : null;
29
70
  }
30
71
  function keySet(map) {
31
72
  return new Set(map ? Object.keys(map) : []);
@@ -91,10 +132,11 @@ export function classifyTela(stringkeys, code) {
91
132
  export function parseTelaIndex(stringkeys, uint64keys) {
92
133
  const notes = [];
93
134
  const sk = stringkeys ?? {};
94
- const name = readStr(sk, 'var_header_name');
135
+ // Real contracts store the name under var_header_name OR var_nameHdr.
136
+ const name = readStr(sk, 'var_header_name') ?? readStr(sk, 'var_nameHdr');
95
137
  const durl = readStr(sk, 'dURL');
96
138
  if (!name)
97
- notes.push('Missing var_header_name (INDEX app name).');
139
+ notes.push('Missing app name (var_header_name / var_nameHdr).');
98
140
  if (!durl)
99
141
  notes.push('Missing dURL (app identifier).');
100
142
  const modsRaw = readStr(sk, 'mods') ?? '';
@@ -103,14 +145,15 @@ export function parseTelaIndex(stringkeys, uint64keys) {
103
145
  .map((m) => m.trim())
104
146
  .filter(Boolean);
105
147
  // Enumerate ALL DOCn keys directly from the raw map, ordered by index.
148
+ // Values are hex-encoded SCIDs (128 hex chars decoding to a 64-char hex
149
+ // SCID), so decode first, then validate.
106
150
  const docs = [];
107
151
  for (const key of Object.keys(sk)) {
108
152
  const m = DOC_KEY.exec(key);
109
153
  if (!m)
110
154
  continue;
111
155
  const position = Number(m[1]);
112
- const value = sk[key];
113
- const scid = typeof value === 'string' ? value : String(value ?? '');
156
+ const scid = decodeScValue(sk[key]) ?? '';
114
157
  const malformed = !SCID_HEX.test(scid);
115
158
  docs.push({ position, key, scid, is_entrypoint: position === 1, malformed });
116
159
  }
@@ -133,16 +176,44 @@ export function parseTelaIndex(stringkeys, uint64keys) {
133
176
  else if (typeof commitS === 'string' && /^\d+$/.test(commitS))
134
177
  commit = Number(commitS);
135
178
  }
136
- // version_history: numbered keys "0","1","2"... → commit TXIDs, numeric order.
179
+ // version_history: numbered keys "0","1","2"... → commit TXIDs, numeric
180
+ // order. Real contracts store these in uint64keys (observed on feed.tela),
181
+ // though the spec template shows stringkeys — scan BOTH so neither is missed.
182
+ const uk = uint64keys ?? {};
137
183
  const version_history = [];
184
+ const seenCommits = new Set();
185
+ for (const map of [sk, uk]) {
186
+ for (const key of Object.keys(map)) {
187
+ if (!/^\d+$/.test(key))
188
+ continue;
189
+ const n = Number(key);
190
+ if (seenCommits.has(n))
191
+ continue;
192
+ const txid = decodeScValue(map[key]);
193
+ if (txid) {
194
+ version_history.push({ commit: n, txid });
195
+ seenCommits.add(n);
196
+ }
197
+ }
198
+ }
199
+ version_history.sort((a, b) => a.commit - b.commit);
200
+ // ratings: per-wallet keys map a voter address → "<rating>_<block>" (a TELA
201
+ // convention). Summarize so an agent doesn't have to reverse-engineer it.
202
+ const ratings = { voters: 0, values: [] };
138
203
  for (const key of Object.keys(sk)) {
139
- if (!/^\d+$/.test(key))
204
+ if (!/^(dero1|deto1)[0-9a-z]+$/i.test(key))
140
205
  continue;
141
- const txid = readStr(sk, key);
142
- if (txid)
143
- version_history.push({ commit: Number(key), txid });
206
+ const val = readStr(sk, key) ?? '';
207
+ const m = /^(\d+)_/.exec(val);
208
+ if (m) {
209
+ ratings.voters += 1;
210
+ ratings.values.push(Number(m[1]));
211
+ }
144
212
  }
145
- version_history.sort((a, b) => a.commit - b.commit);
213
+ // Optional metadata seen on real INDEX contracts (not in the base spec).
214
+ const tela_version = readStr(sk, 'telaVersion');
215
+ const likes = readUint(sk, 'likes');
216
+ const dislikes = readUint(sk, 'dislikes');
146
217
  return {
147
218
  name,
148
219
  description: readStr(sk, 'var_header_description'),
@@ -155,6 +226,10 @@ export function parseTelaIndex(stringkeys, uint64keys) {
155
226
  version_history,
156
227
  current_commit_hash: readStr(sk, 'hash'),
157
228
  owner: readStr(sk, 'owner'),
229
+ tela_version,
230
+ likes,
231
+ dislikes,
232
+ ratings: ratings.voters > 0 ? ratings : null,
158
233
  updateable: 'unknown',
159
234
  updateable_note: UPDATEABLE_NOTE,
160
235
  parse_notes: notes,
@@ -1 +1 @@
1
- {"version":3,"file":"tela-parse.js","sourceRoot":"","sources":["../src/tela-parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA2DH,MAAM,QAAQ,GAAG,mBAAmB,CAAA;AACpC,MAAM,OAAO,GAAG,YAAY,CAAA;AAE5B,MAAM,eAAe,GACnB,gFAAgF;IAChF,4EAA4E;IAC5E,2EAA2E,CAAA;AAE7E,4F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AAM,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACnC,IAAI,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,iDAAiD,EAAE,CAAA;IACpG,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;IAC1C,+EAA+E;IAC/E,mEAAmE;IACnE,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjC,CAAC,CAAC,iFAAiF;QACnF,CAAC,CAAC,SAAS,CAAA;IACb,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;AAC7E,CAAC"}
@@ -44,7 +44,7 @@ export declare const TOOL_DESCRIPTIONS: {
44
44
  readonly recommend_docs_path: "Composite: take a natural-language intent, fan out parallel scoped searches across the bundled docs for all four DERO products (derod, tela, hologram, deropay), boost any product_hint matches by 1.5×, and return a ranked recommendation list with per-result rationale plus ready-to-cite related_docs.\n\nWhen to call: at the START of any \"where do I read about X?\" or \"which docs cover Y?\" investigation, BEFORE calling dero_docs_search directly. PREFER this over guessing the right product: this composite already runs all four products in parallel, dedupes overlap, surfaces the top heading per result as rationale, and gives you the top-2 citations pre-built. Pass product_hint when the user has already said e.g. \"TELA\" or \"DeroPay\" so that product's matches float to the top.\n\nInput Requirements:\n- `intent` is REQUIRED. Free-text description of what the user is trying to do (min 8 chars). Drop verbs and use product nouns like \"deploy a TELA app\" or \"verify a DeroPay webhook signature\" for best results.\n- `product_hint` is OPTIONAL. One of `derod | tela | hologram | deropay`. Multiplies hint-product scores by 1.5×.\n- `limit_per_product` is OPTIONAL (default 2, max 5). Cap per-product hits before merging.\n\nOutput: `{ intent, product_hint, limit_per_product, recommended: [{ product, slug, title, canonical_url, score, boosted_score, rationale }], by_product: { derod | tela | hologram | deropay: { count, top_slug, top_score } }, related_docs: DeroCitation[] }`. `related_docs` is the top-2 picks pre-built as citations the agent can drop straight into a response. On zero matches across every product the composite returns a structured `_meta.error` with code `NO_DOCS_MATCH` and a hint to rephrase or drop the product_hint.";
45
45
  readonly explain_smart_contract: "Composite: fetch a DERO smart contract (code + variables + balances) and return its function surface, a classification of the contract pattern (tela_index | tela_doc | token | registry | minimal | generic), a plain-language narrative, and curated DVM docs citations re-ordered so the most relevant page is first. TELA contracts (apps/files) are detected first and cite the TELA spec; for a deep TELA parse use tela_inspect.\n\nWhen to call: when the user wants to UNDERSTAND a smart contract — its functions, state shape, or which DVM concept to read about. PREFER this over chaining dero_get_sc with a docs lookup yourself: this composite already parses the DVM-BASIC source for function declarations, sorts stringkeys/uint64keys deterministically, and picks the right docs page from a heuristic so the agent does not have to learn DVM-BASIC syntax to summarize a contract.\n\nInput Requirements:\n- `scid` is REQUIRED. Must be 64 hex chars (the smart contract id). Use `0000…0001` for the on-chain name registry as a known-good example.\n- `topoheight` is OPTIONAL. Provide to inspect the contract at a specific topo height; omit for latest tip.\n\nOutput: `{ scid, topoheight, kind, surface: { functions[], stringkeys[], uint64keys[], balances }, narrative, raw_code_length, has_code, related_docs }`. `kind` is one of `tela_index | tela_doc | token | registry | minimal | generic`. `surface.functions` items are `{ name, args, returns }`. `has_code` is false when the SCID is unknown or has no on-chain code; `functions` is then `[]` and the narrative explains the gap. `raw_code_length` is always present so the agent knows when to fall back to `dero_get_sc` for the full source.";
46
46
  readonly tela_inspect: "Composite: fetch a TELA contract by SCID (DERO.GetSC code + variables) and parse it as either a TELA-INDEX-1 app manifest or a TELA-DOC-1 file contract, auto-detecting which standard it is from the stored keys. TELA is DERO's on-chain web-app platform: an INDEX is the app manifest (like package.json) and DOCs are the individual files (HTML/CSS/JS) stored on chain.\n\nWhen to call: as the FIRST step whenever a user references a TELA SCID, a `.tela` dURL app, or asks \"what is this TELA contract/app\", \"what files does this TELA app have\", or \"is this a TELA INDEX or DOC\". PREFER this over dero_get_sc + manual parsing or explain_smart_contract: explain_smart_contract treats TELA contracts as generic DVM and its surface CAPS stored keys at 50, which silently drops DOCn entries on large manifests — tela_inspect reads the raw stringkeys directly so it enumerates ALL DOC references, and it decodes the TELA header/mods/commit schema the generic tool does not understand.\n\nInput Requirements:\n- `scid` is REQUIRED. Must be 64 hex chars (the TELA contract id).\n- `topoheight` is OPTIONAL. Provide to inspect at a specific topo height; omit for the latest committed state.\n\nOutput: a discriminated union on `kind`. `tela_index` → `{ scid, topoheight, kind, index: { name, description, icon, durl, mods[], docs:[{position, key, scid, is_entrypoint, malformed}], doc_count, commit, version_history[], current_commit_hash, owner, updateable:'unknown', updateable_note, parse_notes[] }, narrative, related_docs }`. `tela_doc` → `{ ..., doc: { filename, doc_type, sub_dir, durl, signature, content_embedded, code_size_bytes, immutable }, narrative, related_docs }`. `not_tela` → `{ ..., kind:'not_tela', reason, observed:{ stringkey_sample[], stringkeys_total, has_code, markers[] }, narrative }` — returned (NOT an error) when the SCID is unknown or lacks TELA markers. Updateability cannot be derived from chain state (ringsize is not in GetSC) so it is honestly reported as 'unknown'.";
47
- readonly tela_get_doc_content: "Composite: fetch the actual file content stored in a TELA-DOC-1 contract. A DOC's file (HTML/CSS/JS/...) lives inside a DVM-BASIC comment block in the contract code — NOT in a stored variable — so this tool fetches DERO.GetSC, confirms the SCID is a DOC, and extracts the file bytes. Large files paginate via offset.\n\nWhen to call: when a user wants to READ or inspect the actual code/markup a TELA app file holds (e.g. \"show me the HTML of this TELA DOC\", \"what does this app's app.js contain\"). Get DOC SCIDs from tela_inspect on an INDEX first. PREFER this over dero_get_sc: that returns the raw DVM contract wrapper; this extracts just the embedded file content and reports docType, size, and signature presence.\n\nInput Requirements:\n- `scid` is REQUIRED. Must be 64 hex chars and reference a TELA-DOC-1 contract (an INDEX or non-TELA SCID returns INVALID_INPUT with guidance).\n- `offset` is OPTIONAL. Byte offset into the extracted content; pass `next_offset` to read the next chunk of a large file.\n- `topoheight` is OPTIONAL. Omit for the latest committed state.\n\nOutput: `{ scid, topoheight, filename, doc_type, sub_dir, content_embedded, content, content_offset, content_length, content_truncated, next_offset, compressed, signature, signature_note, note, narrative, related_docs }`. `content` is the extracted file bytes (a 60000-char chunk; paginate via `next_offset`), or null when content is not embedded (DocShard/STATIC/external). `compressed` is true for `.gz` filenames (bytes are gzip, not plaintext). The contract's author signature presence is reported but NOT cryptographically verified.";
47
+ readonly tela_get_doc_content: "Composite: fetch the actual file content stored in a TELA-DOC-1 contract. A DOC's file (HTML/CSS/JS/...) lives inside a DVM-BASIC comment block in the contract code — NOT in a stored variable — so this tool fetches DERO.GetSC, confirms the SCID is a DOC, and extracts the file bytes. Gzip-compressed files (a `.gz` filename, the TELA-CLI default) are transparently base64-decoded + decompressed to plaintext. Large files paginate via offset.\n\nWhen to call: when a user wants to READ or inspect the actual code/markup a TELA app file holds (e.g. \"show me the HTML of this TELA DOC\", \"what does this app's app.js contain\"). Get DOC SCIDs from tela_inspect on an INDEX first. PREFER this over dero_get_sc: that returns the raw DVM contract wrapper; this extracts just the embedded file content and reports docType, size, and signature presence.\n\nInput Requirements:\n- `scid` is REQUIRED. Must be 64 hex chars and reference a TELA-DOC-1 contract (an INDEX or non-TELA SCID returns INVALID_INPUT with guidance).\n- `offset` is OPTIONAL. Byte offset into the extracted content; pass `next_offset` to read the next chunk of a large file.\n- `topoheight` is OPTIONAL. Omit for the latest committed state.\n\nOutput: `{ scid, topoheight, filename, doc_type, sub_dir, content_embedded, content, content_offset, content_length, content_truncated, next_offset, compressed, decompressed, stored_filename, signature, signature_note, note, narrative, related_docs }`. `content` is the plaintext file (a 60000-char chunk; paginate via `next_offset`), or null when content is not embedded (DocShard/STATIC/external). `compressed` is true for `.gz` files; `decompressed` is true when this tool gunzipped them (`filename` then strips `.gz`; `stored_filename` keeps the on-chain name). The contract's author signature presence is reported but NOT cryptographically verified.";
48
48
  readonly diagnose_chain_health: "Composite: run a four-step chain (DERO.Ping → DERO.GetInfo → DERO.GetHeight → DERO.GetTxPool) and return a single narrative health report with chain metadata, mempool snapshot, machine-readable signals, and curated docs citations.\n\nWhen to call: as the first step in any chain-state investigation when the user asks \"is the node healthy\", \"is it synced\", or \"what is the current state of the chain\". PREFER this over chaining the four primitives yourself — the composite handles partial-failure modes and lag-depth classification consistently, and the response already cites the right docs page.\n\nInput Requirements:\n- `include_tx_pool` is OPTIONAL (default true). Set false to skip the mempool snapshot when you only need chain-tip status.\n\nOutput: `{ status, narrative, signals[], chain, mempool, related_docs, _diagnostics }`. `status` is one of `healthy | lagging | partial | unreachable`. `chain` is null when DERO.GetInfo was unreachable; `mempool` is null when skipped or the call failed. On total daemon unreachability the tool returns a structured `_meta.error` with code `RPC_UNREACHABLE`.";
49
49
  readonly audit_chain_artifact_claim: "Composite: audit a chain artifact (block topoheight, block hash, TX hash, and/or proof string) end-to-end. Returns a verdict (`cited_in_false_claim` | `clean`), the actual on-chain facts (block reward, TX acceptance status), an optional proof-string decode, a relayable narrative, and curated rebuttal docs citations.\n\nWhen to call: when the user asks \"what's going on with DERO block X?\" / \"is this transaction the inflation-claim TX?\" / \"does this proof string come from a known false claim?\" PREFER this over chaining `dero_get_block_header_by_topo_height` + `dero_get_transaction` + `dero_decode_proof_string` yourself: the composite already runs them in parallel, joins them against the flagged false-claim registry, and emits a single `verdict` field plus a narrative so the agent does not need to compose the rebuttal arc from scratch each time.\n\nInput Requirements (CRITICAL):\n- At least ONE of `topoheight`, `block_hash`, `tx_hash`, or `proof_string` MUST be provided. The composite throws `INVALID_INPUT` otherwise.\n- `topoheight` is OPTIONAL. Non-negative integer.\n- `block_hash` is OPTIONAL. 64 hex characters.\n- `tx_hash` is OPTIONAL. 64 hex characters.\n- `proof_string` is OPTIONAL. Full `deroproof…` / DERO bech32 string with HRP.\n- `include_forge_demo` is OPTIONAL (default false). When true AND `tx_hash` is provided, also forges a fresh demo proof for the same TX (via `dero_forge_demo_proof`) and embeds it under `forge_demo`. The demo amount auto-selects: a flagged artifact's pinned amount (e.g. -2.2M for the 2022 claim) > the cited `proof_string` V > -1 DERO. PREFER setting this true when the agent is fielding a \"Verified ✓ means the chain minted coins, right?\" question — the embedded forge IS the refutation.\n\nOutput: `{ verdict, inputs, matched_artifacts[], context_note, chain_facts, proof_decode, forge_demo, narrative, related_docs, _diagnostics }`. `verdict` is `cited_in_false_claim` when any input matches the flagged-artifact registry, else `clean`. `chain_facts` is null when no chain-querying input was provided or all daemon calls failed; `proof_decode` is null when no `proof_string` was provided. `forge_demo` is null unless `include_forge_demo: true` was passed; on success it carries `{ skipped: false, forged_proof_string, target_amount, ring_slot, ring_size, ring_receiver_address, math, self_check, explorer_display_amount, demo_amount_source }` (the slim form — full citations stay at the top level).\n\nPREFER citing the returned `related_docs` verbatim in the agent response — they are the canonical rebuttal pages and have been validated against the bundled docs index by CI. Quote the `context_note` when verdict is `cited_in_false_claim` so the user understands why the artifact matters.";
50
50
  readonly dero_decode_proof_string: "Decode any DERO bech32 string (`dero…`, `deto…`, `deroi…`, `detoi…`, or `deroproof…`) into its constituent parts: HRP, network, compressed public key, and any embedded RPC arguments (CBOR-encoded). For `deroproof…` strings the \"public key\" is a derived blinder point used in the proof's commitment math, NOT a wallet pubkey — the tool surfaces `is_proof: true` so the agent does not mislabel it.\n\nWhen to call: when the user pastes a `deroproof…` / integrated-address string and wants to know what value or fields it encodes. PREFER this over chaining bech32 decoders + CBOR libraries yourself: the tool implements the exact same wire format as DEROHE `rpc.NewAddress` and surfaces the `RPC_VALUE_TRANSFER` uint64 both as raw and as a signed/wraparound interpretation. The decoder is verified against the publicly-cited 2022 inflation-claim proof string (embedded uint64 = 18446743853709551435 = signed -2,200,000.00181 DERO).\n\nInput Requirements (CRITICAL):\n- `proof_string` is REQUIRED. The full bech32 string including HRP and separator (e.g. `deroproof1qyy…`). Whitespace is trimmed but the case must be consistent (all lower OR all upper per BIP-0173).\n\nOutput: `{ decoded: { hrp, mainnet, is_proof, public_key_hex, arguments[] }, value_interpretation?: { uint64, signed_int64, is_negative_wraparound, signed_atoms, dero }, context_note?, related_docs? }`. `arguments` is an array of `{ name, type, type_label, semantic_name?, value }`. `value_interpretation` is present only when an `RPC_VALUE_TRANSFER` (V) + `uint64` (U) argument is found. `context_note` + extra `related_docs` are silently attached when the input matches a flagged adversarially-cited artifact. Returns a structured `_meta.error` with code `INVALID_BECH32` on parse failure.\n\nPREFER citing `integrity/payload-vs-transaction-proofs` and `integrity/negative-transfer-protection` in any agent response that frames a `deroproof…` decode result — readers should understand that \"this string decodes to value V\" is a display-layer fact, not a consensus statement.";
@@ -243,7 +243,7 @@ Input Requirements:
243
243
  - \`topoheight\` is OPTIONAL. Provide to inspect at a specific topo height; omit for the latest committed state.
244
244
 
245
245
  Output: a discriminated union on \`kind\`. \`tela_index\` → \`{ scid, topoheight, kind, index: { name, description, icon, durl, mods[], docs:[{position, key, scid, is_entrypoint, malformed}], doc_count, commit, version_history[], current_commit_hash, owner, updateable:'unknown', updateable_note, parse_notes[] }, narrative, related_docs }\`. \`tela_doc\` → \`{ ..., doc: { filename, doc_type, sub_dir, durl, signature, content_embedded, code_size_bytes, immutable }, narrative, related_docs }\`. \`not_tela\` → \`{ ..., kind:'not_tela', reason, observed:{ stringkey_sample[], stringkeys_total, has_code, markers[] }, narrative }\` — returned (NOT an error) when the SCID is unknown or lacks TELA markers. Updateability cannot be derived from chain state (ringsize is not in GetSC) so it is honestly reported as 'unknown'.`,
246
- tela_get_doc_content: `Composite: fetch the actual file content stored in a TELA-DOC-1 contract. A DOC's file (HTML/CSS/JS/...) lives inside a DVM-BASIC comment block in the contract code — NOT in a stored variable — so this tool fetches DERO.GetSC, confirms the SCID is a DOC, and extracts the file bytes. Large files paginate via offset.
246
+ tela_get_doc_content: `Composite: fetch the actual file content stored in a TELA-DOC-1 contract. A DOC's file (HTML/CSS/JS/...) lives inside a DVM-BASIC comment block in the contract code — NOT in a stored variable — so this tool fetches DERO.GetSC, confirms the SCID is a DOC, and extracts the file bytes. Gzip-compressed files (a \`.gz\` filename, the TELA-CLI default) are transparently base64-decoded + decompressed to plaintext. Large files paginate via offset.
247
247
 
248
248
  When to call: when a user wants to READ or inspect the actual code/markup a TELA app file holds (e.g. "show me the HTML of this TELA DOC", "what does this app's app.js contain"). Get DOC SCIDs from tela_inspect on an INDEX first. PREFER this over dero_get_sc: that returns the raw DVM contract wrapper; this extracts just the embedded file content and reports docType, size, and signature presence.
249
249
 
@@ -252,7 +252,7 @@ Input Requirements:
252
252
  - \`offset\` is OPTIONAL. Byte offset into the extracted content; pass \`next_offset\` to read the next chunk of a large file.
253
253
  - \`topoheight\` is OPTIONAL. Omit for the latest committed state.
254
254
 
255
- Output: \`{ scid, topoheight, filename, doc_type, sub_dir, content_embedded, content, content_offset, content_length, content_truncated, next_offset, compressed, signature, signature_note, note, narrative, related_docs }\`. \`content\` is the extracted file bytes (a 60000-char chunk; paginate via \`next_offset\`), or null when content is not embedded (DocShard/STATIC/external). \`compressed\` is true for \`.gz\` filenames (bytes are gzip, not plaintext). The contract's author signature presence is reported but NOT cryptographically verified.`,
255
+ Output: \`{ scid, topoheight, filename, doc_type, sub_dir, content_embedded, content, content_offset, content_length, content_truncated, next_offset, compressed, decompressed, stored_filename, signature, signature_note, note, narrative, related_docs }\`. \`content\` is the plaintext file (a 60000-char chunk; paginate via \`next_offset\`), or null when content is not embedded (DocShard/STATIC/external). \`compressed\` is true for \`.gz\` files; \`decompressed\` is true when this tool gunzipped them (\`filename\` then strips \`.gz\`; \`stored_filename\` keeps the on-chain name). The contract's author signature presence is reported but NOT cryptographically verified.`,
256
256
  diagnose_chain_health: `Composite: run a four-step chain (DERO.Ping → DERO.GetInfo → DERO.GetHeight → DERO.GetTxPool) and return a single narrative health report with chain metadata, mempool snapshot, machine-readable signals, and curated docs citations.
257
257
 
258
258
  When to call: as the first step in any chain-state investigation when the user asks "is the node healthy", "is it synced", or "what is the current state of the chain". PREFER this over chaining the four primitives yourself — the composite handles partial-failure modes and lag-depth classification consistently, and the response already cites the right docs page.
@@ -1 +1 @@
1
- {"version":3,"file":"tool-descriptions.js","sourceRoot":"","sources":["../src/tool-descriptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,gBAAgB,EAAE;;;;;;sJAMkI;IAEpJ,gBAAgB,EAAE;;;;;;;sDAOkC;IAEpD,aAAa,EAAE;;;;;;uKAMsJ;IAErK,eAAe,EAAE;;;;;;kDAM+B;IAEhD,oBAAoB,EAAE;;;;;;uBAMD;IAErB,0BAA0B,EAAE;;;;;;wFAM0D;IAEtF,cAAc,EAAE;;;;;;;;;2FASyE;IAEzF,oCAAoC,EAAE;;;;;;;4EAOoC;IAE1E,6BAA6B,EAAE;;;;;;;qCAOI;IAEnC,gBAAgB,EAAE;;;;;;4CAMwB;IAE1C,uBAAuB,EAAE;;;;;;;mCAOQ;IAEjC,oBAAoB,EAAE;;;;;;;;uHAQ+F;IAErH,0BAA0B,EAAE;;;;;;;;;;;qEAWuC;IAEnE,WAAW,EAAE;;;;;;;;;;4EAU6D;IAE1E,qBAAqB,EAAE;;;;;;;;;;gDAUuB;IAE9C,oBAAoB,EAAE;;;;;;;;4GAQoF;IAE1G,uBAAuB,EAAE;;;;;;;;;gJASqH;IAE9I,gBAAgB,EAAE;;;;;;;;;;8GAU0F;IAE5G,kBAAkB,EAAE;;;;;;;;;kRAS4P;IAEhR,cAAc,EAAE;;;;;;;;8GAQ4F;IAE5G,8BAA8B,EAAE;;;;;;;;;01BASwzB;IAEx1B,oBAAoB,EAAE;;;;;;;;;oiBAS4gB;IAEliB,mBAAmB,EAAE;;;;;;;;;ghBASyf;IAE9gB,sBAAsB,EAAE;;;;;;;;0iBAQghB;IAExiB,YAAY,EAAE;;;;;;;;uzBAQuyB;IAErzB,oBAAoB,EAAE;;;;;;;;;oiBAS4gB;IAEli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S4gB;IAEliB,mBAAmB,EAAE;;;;;;;;;ghBASyf;IAE9gB,sBAAsB,EAAE;;;;;;;;0iBAQghB;IAExiB,YAAY,EAAE;;;;;;;;uzBAQuyB;IAErzB,oBAAoB,EAAE;;;;;;;;;iqBASyoB;IAE/pB,qBAAqB,EAAE;;;;;;;oXAO2V;IAElX,0BAA0B,EAAE;;;;;;;;;;;;;;uSAcyQ;IAErS,wBAAwB,EAAE;;;;;;;;;gSASoQ;IAE9R,qBAAqB,EAAE;;;;;;;;;;;;;mYAa0W;CACzX,CAAA;AAIV,MAAM,CAAC,MAAM,eAAe,GAA4B,MAAM,CAAC,IAAI,CACjE,iBAAiB,CACA,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dero-mcp-server",
3
3
  "mcpName": "io.github.DHEBP/dero-mcp-server",
4
- "version": "0.4.5",
4
+ "version": "0.4.7",
5
5
  "description": "Model Context Protocol (MCP) server exposing DERO Stargate daemon JSON-RPC and bundled documentation to Claude and other MCP clients",
6
6
  "type": "module",
7
7
  "license": "MIT",