iz-tolk-mcp 1.2.0 → 1.3.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 +5 -20
- package/README.ru.md +5 -20
- package/dist/content/changelog.md +37 -0
- package/dist/content/language-guide.md +56 -1
- package/dist/content/stdlib-reference.md +79 -17
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/tools.js +25 -13
- package/dist/tools.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
| 🔨 **4 MCP Tools** | `compile_tolk`, `check_tolk_syntax`, `get_compiler_version`, `generate_deploy_link` |
|
|
38
38
|
| 📄 **6 MCP Resources** | Language guide, stdlib reference, changelog, FunC migration guide, example contracts |
|
|
39
39
|
| 💬 **3 MCP Prompts** | Guided workflows for writing, reviewing, and debugging smart contracts |
|
|
40
|
-
| ⚙️ **Full Compiler Options** | Optimization levels (0-2), stack comments, multi-file compilation |
|
|
41
|
-
| 📦 **Multi-file Support** | Compile projects with multiple `.tolk` source files and `@
|
|
40
|
+
| ⚙️ **Full Compiler Options** | Optimization levels (0-2), stack comments, path mappings, multi-file compilation |
|
|
41
|
+
| 📦 **Multi-file Support** | Compile projects with multiple `.tolk` source files, `@stdlib/*` and `@fiftlib/*` imports |
|
|
42
42
|
| 🔗 **Deployment Links** | Generate `ton://` deeplinks and Tonkeeper URLs for wallet deployment |
|
|
43
43
|
| 🚀 **Zero Configuration** | Runs via `npx` with no external dependencies beyond Node.js |
|
|
44
44
|
|
|
@@ -192,7 +192,7 @@ Returns the version of the Tolk compiler bundled in `@ton/tolk-js` (WASM).
|
|
|
192
192
|
|
|
193
193
|
### 🔨 `compile_tolk`
|
|
194
194
|
|
|
195
|
-
Compiles Tolk smart contract source code. Returns Fift output, BoC (Bag of Cells) in base64, and
|
|
195
|
+
Compiles Tolk smart contract source code. Returns Fift output, BoC (Bag of Cells) in base64, code hash, and compiler version.
|
|
196
196
|
|
|
197
197
|
| Parameter | Type | Required | Description |
|
|
198
198
|
|-----------|------|:--------:|-------------|
|
|
@@ -200,6 +200,7 @@ Compiles Tolk smart contract source code. Returns Fift output, BoC (Bag of Cells
|
|
|
200
200
|
| `sources` | `object` | ✅ | Map of `filename -> source code`. Must include the entrypoint file. |
|
|
201
201
|
| `optimizationLevel` | `number` | — | Optimization level 0-2 (default: 2) |
|
|
202
202
|
| `withStackComments` | `boolean` | — | Include stack layout comments in Fift output |
|
|
203
|
+
| `pathMappings` | `object` | — | Maps `@alias` prefixes to folder paths for import resolution |
|
|
203
204
|
|
|
204
205
|
### ✅ `check_tolk_syntax`
|
|
205
206
|
|
|
@@ -209,6 +210,7 @@ Checks Tolk source code for syntax and type errors without returning full compil
|
|
|
209
210
|
|-----------|------|:--------:|-------------|
|
|
210
211
|
| `entrypointFileName` | `string` | ✅ | The main `.tolk` file to check |
|
|
211
212
|
| `sources` | `object` | ✅ | Map of `filename -> source code` |
|
|
213
|
+
| `pathMappings` | `object` | — | Maps `@alias` prefixes to folder paths for import resolution |
|
|
212
214
|
|
|
213
215
|
### 🔗 `generate_deploy_link`
|
|
214
216
|
|
|
@@ -343,20 +345,3 @@ Pre-commit hooks enforce code quality automatically:
|
|
|
343
345
|
- **Husky** — Git hooks manager
|
|
344
346
|
- **lint-staged** — runs checks only on staged files
|
|
345
347
|
|
|
346
|
-
---
|
|
347
|
-
|
|
348
|
-
## 🤝 Contributing
|
|
349
|
-
|
|
350
|
-
Contributions are welcome! Please:
|
|
351
|
-
|
|
352
|
-
1. Fork the repository
|
|
353
|
-
2. Create a feature branch (`git checkout -b feat/my-feature`)
|
|
354
|
-
3. Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages
|
|
355
|
-
4. Run `npm run lint && npm test` before submitting
|
|
356
|
-
5. Open a Pull Request
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
|
|
360
|
-
## 📄 License
|
|
361
|
-
|
|
362
|
-
[MIT](LICENSE) © iz-tolk-mcp contributors
|
package/README.ru.md
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
| 🔨 **4 MCP-инструмента** | `compile_tolk`, `check_tolk_syntax`, `get_compiler_version`, `generate_deploy_link` |
|
|
38
38
|
| 📄 **6 MCP-ресурсов** | Руководство по языку, справочник stdlib, журнал изменений, миграция с FunC, примеры контрактов |
|
|
39
39
|
| 💬 **3 MCP-промпта** | Управляемые рабочие процессы для написания, ревью и отладки смарт-контрактов |
|
|
40
|
-
| ⚙️ **Все опции компилятора** | Уровни оптимизации (0-2), комментарии стека, многофайловая компиляция |
|
|
41
|
-
| 📦 **Многофайловая поддержка** | Компиляция проектов с несколькими `.tolk`
|
|
40
|
+
| ⚙️ **Все опции компилятора** | Уровни оптимизации (0-2), комментарии стека, маппинг путей, многофайловая компиляция |
|
|
41
|
+
| 📦 **Многофайловая поддержка** | Компиляция проектов с несколькими `.tolk` файлами, импортами `@stdlib/*` и `@fiftlib/*` |
|
|
42
42
|
| 🔗 **Ссылки для деплоя** | Генерация deeplink-ов `ton://` и URL-ов Tonkeeper для деплоя через кошелёк |
|
|
43
43
|
| 🚀 **Без настройки** | Запуск через `npx` без внешних зависимостей, кроме Node.js |
|
|
44
44
|
|
|
@@ -192,7 +192,7 @@ claude mcp add tolk -- npx -y iz-tolk-mcp
|
|
|
192
192
|
|
|
193
193
|
### 🔨 `compile_tolk`
|
|
194
194
|
|
|
195
|
-
Компилирует исходный код смарт-контракта на Tolk. Возвращает Fift-вывод, BoC (Bag of Cells) в base64 и
|
|
195
|
+
Компилирует исходный код смарт-контракта на Tolk. Возвращает Fift-вывод, BoC (Bag of Cells) в base64, хеш кода и версию компилятора.
|
|
196
196
|
|
|
197
197
|
| Параметр | Тип | Обязательный | Описание |
|
|
198
198
|
|----------|-----|:------------:|----------|
|
|
@@ -200,6 +200,7 @@ claude mcp add tolk -- npx -y iz-tolk-mcp
|
|
|
200
200
|
| `sources` | `object` | ✅ | Словарь `имя файла -> исходный код`. Должен включать файл точки входа. |
|
|
201
201
|
| `optimizationLevel` | `number` | — | Уровень оптимизации 0-2 (по умолчанию: 2) |
|
|
202
202
|
| `withStackComments` | `boolean` | — | Включить комментарии расположения стека в Fift-вывод |
|
|
203
|
+
| `pathMappings` | `object` | — | Маппинг `@alias` префиксов на пути к папкам для резолва импортов |
|
|
203
204
|
|
|
204
205
|
### ✅ `check_tolk_syntax`
|
|
205
206
|
|
|
@@ -209,6 +210,7 @@ claude mcp add tolk -- npx -y iz-tolk-mcp
|
|
|
209
210
|
|----------|-----|:------------:|----------|
|
|
210
211
|
| `entrypointFileName` | `string` | ✅ | Главный файл `.tolk` для проверки |
|
|
211
212
|
| `sources` | `object` | ✅ | Словарь `имя файла -> исходный код` |
|
|
213
|
+
| `pathMappings` | `object` | — | Маппинг `@alias` префиксов на пути к папкам для резолва импортов |
|
|
212
214
|
|
|
213
215
|
### 🔗 `generate_deploy_link`
|
|
214
216
|
|
|
@@ -343,20 +345,3 @@ Pre-commit хуки автоматически обеспечивают каче
|
|
|
343
345
|
- **Husky** — менеджер Git-хуков
|
|
344
346
|
- **lint-staged** — запускает проверки только для staged-файлов
|
|
345
347
|
|
|
346
|
-
---
|
|
347
|
-
|
|
348
|
-
## 🤝 Участие в разработке
|
|
349
|
-
|
|
350
|
-
Мы рады вашему участию! Пожалуйста:
|
|
351
|
-
|
|
352
|
-
1. Форкните репозиторий
|
|
353
|
-
2. Создайте feature-ветку (`git checkout -b feat/my-feature`)
|
|
354
|
-
3. Используйте [Conventional Commits](https://www.conventionalcommits.org/) для сообщений коммитов
|
|
355
|
-
4. Запустите `npm run lint && npm test` перед отправкой
|
|
356
|
-
5. Откройте Pull Request
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
|
|
360
|
-
## 📄 Лицензия
|
|
361
|
-
|
|
362
|
-
[MIT](LICENSE) © iz-tolk-mcp contributors
|
|
@@ -132,6 +132,43 @@ Tolk is a fork of FunC, first announced at TON Gateway in 2024, with v0.6 markin
|
|
|
132
132
|
- Enhanced compiler diagnostics
|
|
133
133
|
- Additional standard library methods
|
|
134
134
|
|
|
135
|
+
## v1.3 -- Strings, Arrays, and Reflection
|
|
136
|
+
|
|
137
|
+
### New Types
|
|
138
|
+
|
|
139
|
+
- **`string` built-in type** -- backed by snake-format cells. Compile-time methods: `string.crc32()`, `string.crc16()`, `string.sha256()`, `string.sha256_32()`, `string.hexToSlice()`, `string.toBase256()`, `string.literalSlice()`. Runtime method: `string.beginParse()`
|
|
140
|
+
- **`array<T>` type** replacing raw `tuple` -- typed generic arrays with `push()`, `get()`, `set()`, `first()`, `last()`, `pop()`, `size()`. The old `tuple` is now `type tuple = array<unknown>`
|
|
141
|
+
- **`unknown` type** -- represents one TVM stack slot of unknown type, any type can be cast to/from `unknown`
|
|
142
|
+
- **`lisp_list<T>` type** -- typed lisp-style list with methods: `isEmpty()`, `prependHead()`, `popHead()`, `getHead()`, `getTail()`, `calculateSize()`, `calculateReversed()`, `calculateConcatenation()`, plus serialization support
|
|
143
|
+
|
|
144
|
+
### New Standard Library Modules
|
|
145
|
+
|
|
146
|
+
- **`@stdlib/strings`** -- `string.depth()`, `string.calculateLength()`, `string.hash()`, `string.equalTo()`, `int.toDecimalString()`, `string.prefixWith00()`, `string.prefixWith01()`, and `StringBuilder` struct with `create()`, `append()`, `appendInt()`, `build()` methods
|
|
147
|
+
- **`@stdlib/reflection`** -- compile-time type introspection: `reflect.typeNameOf<T>()`, `reflect.typeNameOfObject()`, `reflect.stackSizeOf<T>()`, `reflect.stackSizeOfObject()`, `reflect.serializationPrefixOf<T>()`, `reflect.estimateSerializationOf<T>()`, `reflect.sourceLocation()`, `reflect.sourceLocationAsString()`
|
|
148
|
+
|
|
149
|
+
### New Features
|
|
150
|
+
|
|
151
|
+
- **`VmExitCode` enum** in `@stdlib/tvm-lowlevel` -- named constants for all standard TVM exit codes (0-63): `NormalTermination`, `StackUnderflow`, `IntegerOverflow`, `OutOfGasError`, etc.
|
|
152
|
+
- **`cell.hashEqual()`** -- compare two cells by hash
|
|
153
|
+
- **`slice.loadString()`** and **`builder.storeString()`** -- read/write string values from/to cells
|
|
154
|
+
- **`pathMappings`** in compiler config -- maps `@alias` prefixes to folder paths for import resolution
|
|
155
|
+
- **`tolkVersion`** in compilation result -- compiler version string included in successful output
|
|
156
|
+
- **`@fiftlib/*` files embedded** -- Fift library files (`Asm.fif`, `Fift.fif`) are now bundled and resolved internally
|
|
157
|
+
|
|
158
|
+
### Breaking Changes
|
|
159
|
+
|
|
160
|
+
- `tuple` is now `array<unknown>` -- use `array<T>` for typed arrays
|
|
161
|
+
- `sizeof<T>()` removed -- use `reflect.stackSizeOfObject<T>()` from `@stdlib/reflection`
|
|
162
|
+
- `T.typeName()` and `T.typeNameOfObject()` removed -- use `reflect.typeNameOf<T>()` from `@stdlib/reflection`
|
|
163
|
+
- `createEmptyTuple()` deprecated -- use `[]` syntax
|
|
164
|
+
- `createEmptyList()` deprecated -- use `[] as lisp_list<T>`
|
|
165
|
+
- `createEmptyMap()` deprecated -- use `[]` with type annotation
|
|
166
|
+
- `stringHexToSlice()` deprecated -- use `"hex".hexToSlice()`
|
|
167
|
+
- `debug.printString()` now requires `string` parameter (was generic)
|
|
168
|
+
- `address()` constructor now takes `string` parameter (was `slice`)
|
|
169
|
+
- Lisp list API rewritten from free functions to method syntax on `lisp_list<T>`
|
|
170
|
+
- `experimentalOptions` compiler config field deprecated
|
|
171
|
+
|
|
135
172
|
---
|
|
136
173
|
|
|
137
174
|
## Standard Library Modules
|
|
@@ -158,7 +158,7 @@ Non-null assertion: `val value = nullableVar!;`
|
|
|
158
158
|
`map<K, V>` -- high-level abstraction over TVM dictionaries.
|
|
159
159
|
|
|
160
160
|
```tolk
|
|
161
|
-
var m: map<int8, int32> =
|
|
161
|
+
var m: map<int8, int32> = [];
|
|
162
162
|
m.set(1, 10);
|
|
163
163
|
m.addIfNotExists(2, -20);
|
|
164
164
|
m.delete(2);
|
|
@@ -201,6 +201,61 @@ enum Mode {
|
|
|
201
201
|
|
|
202
202
|
Enums are distinct types, not integers. Serialized as `(u)intN`. Casting: `Color.Blue as int` (gives 2), `2 as Color` (gives `Color.Blue`).
|
|
203
203
|
|
|
204
|
+
### Strings (v1.3+)
|
|
205
|
+
|
|
206
|
+
The `string` type is backed by snake-format cells. Strings have compile-time and runtime methods:
|
|
207
|
+
|
|
208
|
+
```tolk
|
|
209
|
+
// Compile-time methods on string literals
|
|
210
|
+
val crc = "hello".crc32();
|
|
211
|
+
val hash = "data".sha256();
|
|
212
|
+
val s = "0A0B".hexToSlice();
|
|
213
|
+
|
|
214
|
+
// Runtime methods
|
|
215
|
+
val parsed = myString.beginParse();
|
|
216
|
+
|
|
217
|
+
// String I/O on cells
|
|
218
|
+
b.storeString(myString);
|
|
219
|
+
val str = s.loadString();
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Use `import "@stdlib/strings"` for additional string utilities and `StringBuilder`.
|
|
223
|
+
|
|
224
|
+
### Arrays (v1.3+)
|
|
225
|
+
|
|
226
|
+
`array<T>` is a typed generic array replacing raw `tuple`:
|
|
227
|
+
|
|
228
|
+
```tolk
|
|
229
|
+
var arr: array<int> = [];
|
|
230
|
+
arr.push(1);
|
|
231
|
+
arr.push(2);
|
|
232
|
+
val first = arr.first();
|
|
233
|
+
val last = arr.last();
|
|
234
|
+
val size = arr.size();
|
|
235
|
+
val popped = arr.pop();
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
The old `tuple` type is now `type tuple = array<unknown>`.
|
|
239
|
+
|
|
240
|
+
### Unknown Type (v1.3+)
|
|
241
|
+
|
|
242
|
+
`unknown` represents one TVM stack slot of unknown type. Any type can be cast to/from `unknown`.
|
|
243
|
+
|
|
244
|
+
### Lisp Lists (v1.3+)
|
|
245
|
+
|
|
246
|
+
`lisp_list<T>` provides typed lisp-style linked lists:
|
|
247
|
+
|
|
248
|
+
```tolk
|
|
249
|
+
import "@stdlib/lisp-lists"
|
|
250
|
+
|
|
251
|
+
var list: lisp_list<int> = [] as lisp_list<int>;
|
|
252
|
+
list = list.prependHead(1);
|
|
253
|
+
list = list.prependHead(2);
|
|
254
|
+
val head = list.getHead(); // 2
|
|
255
|
+
val tail = list.getTail();
|
|
256
|
+
val size = list.calculateSize();
|
|
257
|
+
```
|
|
258
|
+
|
|
204
259
|
### Tensors and Tuples
|
|
205
260
|
|
|
206
261
|
Tensors are multiple values on the stack: `(T1, T2, T3)`.
|
|
@@ -18,21 +18,29 @@ These functions evaluate at compile time and embed constant values directly into
|
|
|
18
18
|
|----------|-------------|-------------|
|
|
19
19
|
| `address("EQ...")` | Embeds a contract address | `address` |
|
|
20
20
|
| `ton("0.05")` | Calculates nanoToncoin value | `coins` |
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
21
|
+
| `"str".crc32()` | CRC32 checksum (v1.3+, replaces `stringCrc32`) | `int` |
|
|
22
|
+
| `"str".crc16()` | CRC16 checksum (v1.3+, replaces `stringCrc16`) | `int` |
|
|
23
|
+
| `"str".sha256()` | SHA256 hash (v1.3+, replaces `stringSha256`) | `uint256` |
|
|
24
|
+
| `"str".sha256_32()` | SHA256 truncated to 32 bits (v1.3+, replaces `stringSha256_32`) | `int` |
|
|
25
|
+
| `"str".toBase256()` | Base-256 conversion (v1.3+, replaces `stringToBase256`) | `int` |
|
|
26
|
+
| `"hex".hexToSlice()` | Hex bytes to slice (v1.3+, replaces `stringHexToSlice`) | `slice` |
|
|
27
|
+
| `"str".literalSlice()` | String to slice literal (v1.3+) | `slice` |
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
> **Note:** The old `stringCrc32()`, `stringCrc16()`, `stringSha256()`, `stringSha256_32()`, `stringToBase256()` forms still work but are deprecated in v1.3. `stringHexToSlice()` is deprecated -- use `"hex".hexToSlice()` instead.
|
|
30
|
+
|
|
31
|
+
### Array and Tuple Operations
|
|
32
|
+
|
|
33
|
+
In v1.3+, `array<T>` replaces raw `tuple` for typed collections. The old `tuple` is now `type tuple = array<unknown>`.
|
|
29
34
|
|
|
30
35
|
| Function/Method | Description |
|
|
31
36
|
|-----------------|-------------|
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
37
|
+
| `a.push(value)` | Push value onto array |
|
|
38
|
+
| `a.get(index)` | Get value at index |
|
|
39
|
+
| `a.set(index, value)` | Set value at index |
|
|
40
|
+
| `a.size()` | Get array size |
|
|
41
|
+
| `a.first()` | Get first element |
|
|
42
|
+
| `a.last()` | Get last element |
|
|
43
|
+
| `a.pop()` | Remove and return last element |
|
|
36
44
|
| `toTuple(...)` | Create tuple from values |
|
|
37
45
|
| `fromTuple(t)` | Destructure tuple |
|
|
38
46
|
|
|
@@ -73,6 +81,7 @@ These functions evaluate at compile time and embed constant values directly into
|
|
|
73
81
|
| Function/Method | Description |
|
|
74
82
|
|-----------------|-------------|
|
|
75
83
|
| `cell.hash()` | Hash of a cell (uint256) |
|
|
84
|
+
| `cell.hashEqual(other)` | Compare two cells by hash (v1.3+) |
|
|
76
85
|
| `slice.hash()` | Hash of a slice (uint256) |
|
|
77
86
|
| `isSignatureValid(hash, signature, publicKey)` | Verify Ed25519 signature |
|
|
78
87
|
| `random.uint256()` | Random 256-bit unsigned integer |
|
|
@@ -115,12 +124,14 @@ These functions evaluate at compile time and embed constant values directly into
|
|
|
115
124
|
| `b.storeBool(flag)` | Store boolean |
|
|
116
125
|
| `b.storeCoins(amount)` | Store coins value |
|
|
117
126
|
| `b.storeSlice(s)` | Store slice data |
|
|
127
|
+
| `b.storeString(str)` | Store string value (v1.3+) |
|
|
118
128
|
| `s.loadUint(bits)` | Load unsigned integer |
|
|
119
129
|
| `s.loadInt(bits)` | Load signed integer |
|
|
120
130
|
| `s.loadRef()` | Load cell reference |
|
|
121
131
|
| `s.loadAddress()` | Load address |
|
|
122
132
|
| `s.loadBool()` | Load boolean |
|
|
123
133
|
| `s.loadCoins()` | Load coins value |
|
|
134
|
+
| `s.loadString()` | Load string value (v1.3+) |
|
|
124
135
|
| `s.skipBits(n)` | Skip bits |
|
|
125
136
|
| `s.remainingBitsCount()` | Remaining bits in slice |
|
|
126
137
|
| `s.remainingRefsCount()` | Remaining refs in slice |
|
|
@@ -163,13 +174,22 @@ Handles exotic cell parsing and library references. Used for working with Merkle
|
|
|
163
174
|
import "@stdlib/lisp-lists"
|
|
164
175
|
```
|
|
165
176
|
|
|
166
|
-
|
|
177
|
+
Typed lisp-style linked lists using `lisp_list<T>` (v1.3+):
|
|
167
178
|
|
|
168
|
-
|
|
|
169
|
-
|
|
170
|
-
| `
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
179
|
+
| Method | Description |
|
|
180
|
+
|--------|-------------|
|
|
181
|
+
| `l.isEmpty()` | Check if list is empty |
|
|
182
|
+
| `l.prependHead(value)` | Prepend value to list |
|
|
183
|
+
| `l.popHead()` | Remove and return head |
|
|
184
|
+
| `l.getHead()` | Get head value |
|
|
185
|
+
| `l.getTail()` | Get tail of list |
|
|
186
|
+
| `l.calculateSize()` | Calculate list length |
|
|
187
|
+
| `l.calculateReversed()` | Return reversed copy |
|
|
188
|
+
| `l.calculateConcatenation(other)` | Concatenate two lists |
|
|
189
|
+
| `l.packToBuilder(b)` | Serialize to builder |
|
|
190
|
+
| `lisp_list<T>.unpackFromSlice(s)` | Deserialize from slice |
|
|
191
|
+
|
|
192
|
+
> **Note:** The old free functions `listGetHead()`, `listGetTail()`, `listPrepend()`, `createEmptyList()` are deprecated in v1.3. Use method syntax on `lisp_list<T>` and `[] as lisp_list<T>` instead.
|
|
173
193
|
|
|
174
194
|
### @stdlib/tvm-dicts
|
|
175
195
|
|
|
@@ -189,6 +209,48 @@ Direct TVM register and stack manipulation:
|
|
|
189
209
|
- Access to c3, c4, c5, c7 registers
|
|
190
210
|
- Stack inspection and manipulation
|
|
191
211
|
- Low-level TVM instruction wrappers
|
|
212
|
+
- **`VmExitCode` enum** (v1.3+) -- named constants for all standard TVM exit codes (0-63): `NormalTermination`, `StackUnderflow`, `IntegerOverflow`, `OutOfGasError`, `CellUnderflow`, `CellOverflow`, `DictionaryError`, `TypeCheckError`, etc.
|
|
213
|
+
|
|
214
|
+
### @stdlib/strings (v1.3+)
|
|
215
|
+
|
|
216
|
+
```tolk
|
|
217
|
+
import "@stdlib/strings"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
String utilities and `StringBuilder`:
|
|
221
|
+
|
|
222
|
+
| Function/Method | Description |
|
|
223
|
+
|-----------------|-------------|
|
|
224
|
+
| `str.depth()` | Get cell depth of string |
|
|
225
|
+
| `str.calculateLength()` | Calculate string length |
|
|
226
|
+
| `str.hash()` | Hash of string |
|
|
227
|
+
| `str.equalTo(other)` | Compare two strings |
|
|
228
|
+
| `n.toDecimalString()` | Convert integer to decimal string |
|
|
229
|
+
| `str.prefixWith00()` | Prefix string with 0x00 byte |
|
|
230
|
+
| `str.prefixWith01()` | Prefix string with 0x01 byte |
|
|
231
|
+
| `StringBuilder.create()` | Create new string builder |
|
|
232
|
+
| `sb.append(str)` | Append string |
|
|
233
|
+
| `sb.appendInt(n)` | Append integer as decimal |
|
|
234
|
+
| `sb.build()` | Build final string |
|
|
235
|
+
|
|
236
|
+
### @stdlib/reflection (v1.3+)
|
|
237
|
+
|
|
238
|
+
```tolk
|
|
239
|
+
import "@stdlib/reflection"
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Compile-time type introspection:
|
|
243
|
+
|
|
244
|
+
| Function | Description |
|
|
245
|
+
|----------|-------------|
|
|
246
|
+
| `reflect.typeNameOf<T>()` | Get type name as string |
|
|
247
|
+
| `reflect.typeNameOfObject(obj)` | Get runtime type name |
|
|
248
|
+
| `reflect.stackSizeOf<T>()` | Get TVM stack slots for type |
|
|
249
|
+
| `reflect.stackSizeOfObject(obj)` | Get TVM stack slots for object |
|
|
250
|
+
| `reflect.serializationPrefixOf<T>()` | Get serialization prefix |
|
|
251
|
+
| `reflect.estimateSerializationOf<T>()` | Estimate serialization size |
|
|
252
|
+
| `reflect.sourceLocation()` | Get current source location |
|
|
253
|
+
| `reflect.sourceLocationAsString()` | Get source location as string |
|
|
192
254
|
|
|
193
255
|
---
|
|
194
256
|
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
2
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
6
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
7
|
import { registerPrompts } from "./prompts.js";
|
|
5
8
|
import { registerResources } from "./resources.js";
|
|
6
9
|
import { registerTools } from "./tools.js";
|
|
10
|
+
let version = "0.0.0";
|
|
11
|
+
try {
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
|
|
14
|
+
version = pkg.version;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// package.json not found — use fallback version
|
|
18
|
+
}
|
|
7
19
|
function createServer() {
|
|
8
|
-
const server = new McpServer({ name: "iz-tolk-mcp", version
|
|
20
|
+
const server = new McpServer({ name: "iz-tolk-mcp", version }, { capabilities: { tools: {}, resources: {}, prompts: {} } });
|
|
9
21
|
registerTools(server);
|
|
10
22
|
registerResources(server);
|
|
11
23
|
registerPrompts(server);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;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,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAC5D,CAAC;IAEF,aAAa,CAAC,MAAM,CAAC,CAAC;IACtB,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,MAAM,UAAU,mBAAmB;IACjC,OAAO,YAAY,EAAE,CAAC;AACxB,CAAC;AAED,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAExH,IAAI,WAAW,EAAE,CAAC;IAChB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAC5B,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,EAC1D,CAAC,GAAG,EAAE,EAAE;QACN,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools.js
CHANGED
|
@@ -11,7 +11,7 @@ function validateSources(sources, entrypointFileName) {
|
|
|
11
11
|
if (keys.length > MAX_FILE_COUNT) {
|
|
12
12
|
return `Too many source files (${keys.length}). Maximum is ${MAX_FILE_COUNT}.`;
|
|
13
13
|
}
|
|
14
|
-
if (!sources
|
|
14
|
+
if (!(entrypointFileName in sources)) {
|
|
15
15
|
return `Entrypoint file "${entrypointFileName}" not found in sources. ` + `Available files: ${keys.join(", ")}`;
|
|
16
16
|
}
|
|
17
17
|
let totalSize = 0;
|
|
@@ -54,18 +54,23 @@ export function registerTools(server) {
|
|
|
54
54
|
// ─── Tool 2: compile_tolk ───────────────────────────────────────
|
|
55
55
|
server.tool("compile_tolk", "Compiles Tolk smart contract source code using @ton/tolk-js. " +
|
|
56
56
|
"Provide source files as a map of filename->content. The entrypoint file must be included. " +
|
|
57
|
-
"Standard library imports (@stdlib/*) are resolved automatically. " +
|
|
58
|
-
"
|
|
57
|
+
"Standard library imports (@stdlib/*, @fiftlib/*) are resolved automatically. " +
|
|
58
|
+
"Supports pathMappings for custom @alias import resolution. " +
|
|
59
|
+
"Returns compiled Fift code, BoC (Bag of Cells) in base64, code hash, and compiler version.", {
|
|
59
60
|
entrypointFileName: z.string().describe('The main .tolk file to compile (e.g., "main.tolk")'),
|
|
60
61
|
sources: z
|
|
61
|
-
.
|
|
62
|
+
.record(z.string(), z.string())
|
|
62
63
|
.describe("Object mapping filename -> source code content. Must include the entrypoint file. " +
|
|
63
64
|
'Example: {"main.tolk": "fun main(): int { return 0; }"}'),
|
|
64
|
-
optimizationLevel: z.number().optional().describe("Optimization level 0-2 (default: 2)"),
|
|
65
|
+
optimizationLevel: z.number().int().min(0).max(2).optional().describe("Optimization level 0-2 (default: 2)"),
|
|
65
66
|
withStackComments: z.boolean().optional().describe("Include stack layout comments in Fift output"),
|
|
67
|
+
pathMappings: z
|
|
68
|
+
.record(z.string(), z.string())
|
|
69
|
+
.optional()
|
|
70
|
+
.describe("Maps @alias prefixes to absolute folder paths for import resolution. " +
|
|
71
|
+
'Example: {"@mylib": "/path/to/mylib"}'),
|
|
66
72
|
}, async (args) => {
|
|
67
|
-
const sources = args
|
|
68
|
-
const entrypointFileName = args.entrypointFileName;
|
|
73
|
+
const { sources, entrypointFileName } = args;
|
|
69
74
|
const validationError = validateSources(sources, entrypointFileName);
|
|
70
75
|
if (validationError) {
|
|
71
76
|
return {
|
|
@@ -79,7 +84,7 @@ export function registerTools(server) {
|
|
|
79
84
|
fsReadCallback: makeFsReadCallback(sources),
|
|
80
85
|
optimizationLevel: args.optimizationLevel ?? 2,
|
|
81
86
|
withStackComments: args.withStackComments ?? false,
|
|
82
|
-
|
|
87
|
+
...(args.pathMappings ? { pathMappings: args.pathMappings } : {}),
|
|
83
88
|
});
|
|
84
89
|
if (result.status === "error") {
|
|
85
90
|
return {
|
|
@@ -91,6 +96,7 @@ export function registerTools(server) {
|
|
|
91
96
|
const lines = [
|
|
92
97
|
`## Compilation Successful`,
|
|
93
98
|
"",
|
|
99
|
+
`**Compiler version:** \`${result.tolkVersion}\``,
|
|
94
100
|
`**Code hash:** \`${result.codeHashHex}\``,
|
|
95
101
|
`**BoC size:** ${bocBytes.length} bytes`,
|
|
96
102
|
"",
|
|
@@ -118,15 +124,20 @@ export function registerTools(server) {
|
|
|
118
124
|
});
|
|
119
125
|
// ─── Tool 3: check_tolk_syntax ─────────────────────────────────
|
|
120
126
|
server.tool("check_tolk_syntax", "Checks Tolk source code for syntax and type errors without returning full compilation output. " +
|
|
121
|
-
"Faster feedback loop for iterative development.
|
|
127
|
+
"Faster feedback loop for iterative development. Supports pathMappings for custom @alias import resolution. " +
|
|
128
|
+
"Returns OK + code hash on success, or error details on failure.", {
|
|
122
129
|
entrypointFileName: z.string().describe('The main .tolk file to check (e.g., "main.tolk")'),
|
|
123
130
|
sources: z
|
|
124
|
-
.
|
|
131
|
+
.record(z.string(), z.string())
|
|
125
132
|
.describe("Object mapping filename -> source code content. Must include the entrypoint file. " +
|
|
126
133
|
'Example: {"main.tolk": "fun main(): int { return 0; }"}'),
|
|
134
|
+
pathMappings: z
|
|
135
|
+
.record(z.string(), z.string())
|
|
136
|
+
.optional()
|
|
137
|
+
.describe("Maps @alias prefixes to absolute folder paths for import resolution. " +
|
|
138
|
+
'Example: {"@mylib": "/path/to/mylib"}'),
|
|
127
139
|
}, async (args) => {
|
|
128
|
-
const sources = args
|
|
129
|
-
const entrypointFileName = args.entrypointFileName;
|
|
140
|
+
const { sources, entrypointFileName } = args;
|
|
130
141
|
const validationError = validateSources(sources, entrypointFileName);
|
|
131
142
|
if (validationError) {
|
|
132
143
|
return {
|
|
@@ -140,7 +151,7 @@ export function registerTools(server) {
|
|
|
140
151
|
fsReadCallback: makeFsReadCallback(sources),
|
|
141
152
|
optimizationLevel: 2,
|
|
142
153
|
withStackComments: false,
|
|
143
|
-
|
|
154
|
+
...(args.pathMappings ? { pathMappings: args.pathMappings } : {}),
|
|
144
155
|
});
|
|
145
156
|
if (result.status === "error") {
|
|
146
157
|
return {
|
|
@@ -173,6 +184,7 @@ export function registerTools(server) {
|
|
|
173
184
|
workchain: z.number().optional().describe("Target workchain ID (default: 0, the basechain)"),
|
|
174
185
|
amount: z
|
|
175
186
|
.string()
|
|
187
|
+
.regex(/^\d+$/, "amount must be a non-negative integer string (nanoTON)")
|
|
176
188
|
.optional()
|
|
177
189
|
.describe('Amount in nanoTON to send with deploy message (default: "50000000" = 0.05 TON)'),
|
|
178
190
|
}, async (args) => {
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,OAAO;AACzC,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,SAAS,eAAe,CAAC,OAA+B,EAAE,kBAA0B;IAClF,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAElC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,yDAAyD,CAAC;IAC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AA4B;YAC5B,KAAK;YACL,cAAc;YACd,KAAK;SACN,CAAC;QAEF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACjE,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iz-tolk-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"mcpName": "io.github.izzzzzi/iz-tolk-mcp",
|
|
5
5
|
"description": "MCP server for Tolk smart contract compiler — compile, analyze, and explore TON smart contracts from any MCP-compatible AI assistant",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"iz-tolk-mcp": "dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "tsc &&
|
|
12
|
+
"build": "tsc && node scripts/copy-content.js",
|
|
13
13
|
"start": "node dist/index.js",
|
|
14
14
|
"dev": "tsx src/index.ts",
|
|
15
15
|
"test": "vitest run",
|
|
@@ -46,12 +46,13 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
48
48
|
"@ton/core": "^0.63.1",
|
|
49
|
-
"@ton/tolk-js": "^1.
|
|
49
|
+
"@ton/tolk-js": "^1.3.0",
|
|
50
50
|
"zod": "^4.3.6"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@biomejs/biome": "^2.4.4",
|
|
54
54
|
"@semantic-release/changelog": "^6.0.0",
|
|
55
|
+
"@semantic-release/exec": "^6.0.0",
|
|
55
56
|
"@semantic-release/git": "^10.0.0",
|
|
56
57
|
"@types/node": "^25.3.2",
|
|
57
58
|
"husky": "^9.1.7",
|