blockmine 1.25.0 → 1.27.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/CHANGELOG.md +46 -3
- package/backend/cli.js +1 -1
- package/backend/package.json +2 -2
- package/backend/prisma/migrations/20260328173000_add_plugin_source_ref/migration.sql +2 -0
- package/backend/prisma/migrations/migration_lock.toml +2 -2
- package/backend/prisma/schema.prisma +2 -0
- package/backend/src/api/routes/apiKeys.js +8 -0
- package/backend/src/api/routes/bots.js +258 -9
- package/backend/src/api/routes/eventGraphs.js +151 -1
- package/backend/src/api/routes/health.js +38 -0
- package/backend/src/api/routes/nodeRegistry.js +63 -0
- package/backend/src/api/routes/plugins.js +254 -29
- package/backend/src/container.js +11 -8
- package/backend/src/core/BotCommandLoader.js +161 -0
- package/backend/src/core/BotConnection.js +125 -0
- package/backend/src/core/BotEventHandlers.js +234 -0
- package/backend/src/core/BotIPCHandler.js +445 -0
- package/backend/src/core/BotManager.js +15 -7
- package/backend/src/core/BotProcess.js +75 -142
- package/backend/src/core/EventGraphManager.js +7 -3
- package/backend/src/core/GraphDebugHandler.js +229 -0
- package/backend/src/core/GraphDebugIPC.js +117 -0
- package/backend/src/core/GraphExecutionEngine.js +545 -978
- package/backend/src/core/GraphTraversal.js +80 -0
- package/backend/src/core/GraphValidation.js +73 -0
- package/backend/src/core/NodeDefinition.js +138 -0
- package/backend/src/core/NodeRegistry.js +153 -141
- package/backend/src/core/PluginManager.js +272 -31
- package/backend/src/core/RewindSignal.js +9 -0
- package/backend/src/core/config/ConfigValidator.js +72 -0
- package/backend/src/core/config/FeatureFlags.js +52 -0
- package/backend/src/core/config/__tests__/ConfigValidator.test.js +232 -0
- package/backend/src/core/domain/entities/Bot.js +39 -0
- package/backend/src/core/domain/entities/Command.js +41 -0
- package/backend/src/core/domain/entities/EventGraph.js +39 -0
- package/backend/src/core/domain/entities/Plugin.js +45 -0
- package/backend/src/core/domain/entities/User.js +40 -0
- package/backend/src/core/domain/services/DependencyResolver.js +168 -0
- package/backend/src/core/domain/services/GraphValidator.js +117 -0
- package/backend/src/core/domain/services/PermissionChecker.js +34 -0
- package/backend/src/core/domain/services/__tests__/DependencyResolver.test.js +126 -0
- package/backend/src/core/domain/valueObjects/BotConfig.js +27 -0
- package/backend/src/core/domain/valueObjects/DependencyGraph.js +86 -0
- package/backend/src/core/domain/valueObjects/PluginManifest.js +36 -0
- package/backend/src/core/errors/BaseError.js +29 -0
- package/backend/src/core/errors/ErrorHandler.js +81 -0
- package/backend/src/core/errors/__tests__/ErrorHandler.test.js +188 -0
- package/backend/src/core/errors/index.js +68 -0
- package/backend/src/core/infrastructure/BatchingUtility.js +66 -0
- package/backend/src/core/infrastructure/CircuitBreaker.js +103 -0
- package/backend/src/core/infrastructure/ConnectionPool.js +81 -0
- package/backend/src/core/infrastructure/RateLimiter.js +64 -0
- package/backend/src/core/infrastructure/__tests__/BatchingUtility.test.js +86 -0
- package/backend/src/core/infrastructure/__tests__/CircuitBreaker.test.js +156 -0
- package/backend/src/core/infrastructure/__tests__/ConnectionPool.test.js +146 -0
- package/backend/src/core/infrastructure/__tests__/RateLimiter.test.js +171 -0
- package/backend/src/core/ipc/botApiFactory.js +72 -0
- package/backend/src/core/ipc/ipcMessageTypes.js +115 -0
- package/backend/src/core/logging/AuditLogger.js +61 -0
- package/backend/src/core/logging/StructuredLogger.js +80 -0
- package/backend/src/core/logging/__tests__/StructuredLogger.test.js +213 -0
- package/backend/src/core/logging/index.js +7 -0
- package/backend/src/core/metrics/MetricsCollector.js +104 -0
- package/backend/src/core/metrics/__tests__/MetricsCollector.test.js +131 -0
- package/backend/src/core/node-registries/actionsNodes.js +191 -0
- package/backend/src/core/node-registries/arraysNodes.js +152 -0
- package/backend/src/core/node-registries/botNodes.js +48 -0
- package/backend/src/core/node-registries/containerNodes.js +141 -0
- package/backend/src/core/node-registries/dataNodes.js +284 -0
- package/backend/src/core/node-registries/debugNodes.js +23 -0
- package/backend/src/core/node-registries/eventsNodes.js +223 -0
- package/backend/src/core/node-registries/flowNodes.js +151 -0
- package/backend/src/core/node-registries/furnaceNodes.js +123 -0
- package/backend/src/core/node-registries/index.js +108 -0
- package/backend/src/core/node-registries/inventory.js +102 -106
- package/backend/src/core/node-registries/logicNodes.js +54 -0
- package/backend/src/core/node-registries/mathNodes.js +38 -0
- package/backend/src/core/node-registries/navigationNodes.js +109 -0
- package/backend/src/core/node-registries/objectsNodes.js +90 -0
- package/backend/src/core/node-registries/stringsNodes.js +165 -0
- package/backend/src/core/node-registries/timeNodes.js +105 -0
- package/backend/src/core/node-registries/typeNodes.js +22 -0
- package/backend/src/core/node-registries/usersNodes.js +126 -0
- package/backend/src/core/nodes/arrays/shuffle.js +14 -0
- package/backend/src/core/nodes/bot/get_name.js +8 -0
- package/backend/src/core/nodes/bot/stop_bot.js +5 -0
- package/backend/src/core/nodes/container/open.js +101 -111
- package/backend/src/core/nodes/data/store_read.js +26 -0
- package/backend/src/core/nodes/data/store_write.js +23 -0
- package/backend/src/core/nodes/event/call_event.js +31 -0
- package/backend/src/core/nodes/event/custom_event.js +8 -0
- package/backend/src/core/nodes/flow/timer.js +35 -0
- package/backend/src/core/nodes/inventory/drop.js +73 -65
- package/backend/src/core/nodes/inventory/equip.js +54 -45
- package/backend/src/core/nodes/inventory/select_slot.js +48 -46
- package/backend/src/core/nodes/navigation/follow.js +54 -51
- package/backend/src/core/nodes/navigation/go_to.js +41 -53
- package/backend/src/core/nodes/navigation/go_to_entity.js +65 -69
- package/backend/src/core/nodes/navigation/go_to_player.js +65 -70
- package/backend/src/core/nodes/navigation/stop.js +17 -26
- package/backend/src/core/nodes/users/add_to_group.js +24 -0
- package/backend/src/core/nodes/users/check_permission.js +26 -0
- package/backend/src/core/nodes/users/remove_from_group.js +24 -0
- package/backend/src/core/services/BotIPCMessageRouter.js +337 -0
- package/backend/src/core/services/BotLifecycleService.js +41 -632
- package/backend/src/core/services/CacheManager.js +83 -23
- package/backend/src/core/services/CrashRestartManager.js +42 -0
- package/backend/src/core/services/DebugSessionManager.js +114 -12
- package/backend/src/core/services/EventGraphService.js +69 -0
- package/backend/src/core/services/MinecraftBotManager.js +9 -1
- package/backend/src/core/services/PluginManagementService.js +84 -0
- package/backend/src/core/services/TestModeContext.js +65 -0
- package/backend/src/core/services/__tests__/CacheManager.test.js +168 -0
- package/backend/src/core/services.js +1 -11
- package/backend/src/core/validation/InputValidator.js +167 -0
- package/backend/src/core/validation/__tests__/InputValidator.test.js +296 -0
- package/backend/src/real-time/botApi/index.js +1 -1
- package/backend/src/real-time/socketHandler.js +26 -0
- package/backend/src/server.js +10 -5
- package/frontend/dist/assets/{browser-ponyfill-DN7pwmHT.js → browser-ponyfill-D8y0Ty7C.js} +1 -1
- package/frontend/dist/assets/index-CFJLS0dk.css +32 -0
- package/frontend/dist/assets/{index-LSy71uwm.js → index-D91UGNMG.js} +1880 -1881
- package/frontend/dist/index.html +2 -2
- package/frontend/dist/locales/en/bots.json +4 -1
- package/frontend/dist/locales/en/common.json +7 -1
- package/frontend/dist/locales/en/login.json +2 -0
- package/frontend/dist/locales/en/management.json +79 -1
- package/frontend/dist/locales/en/nodes.json +59 -4
- package/frontend/dist/locales/en/plugin-detail.json +24 -4
- package/frontend/dist/locales/en/plugins.json +226 -7
- package/frontend/dist/locales/en/setup.json +2 -0
- package/frontend/dist/locales/en/sidebar.json +171 -3
- package/frontend/dist/locales/en/visual-editor.json +230 -31
- package/frontend/dist/locales/ru/bots.json +4 -1
- package/frontend/dist/locales/ru/login.json +2 -0
- package/frontend/dist/locales/ru/management.json +79 -1
- package/frontend/dist/locales/ru/minecraft-viewer.json +3 -0
- package/frontend/dist/locales/ru/nodes.json +105 -51
- package/frontend/dist/locales/ru/plugins.json +103 -4
- package/frontend/dist/locales/ru/setup.json +2 -0
- package/frontend/dist/locales/ru/sidebar.json +171 -3
- package/frontend/dist/locales/ru/visual-editor.json +232 -33
- package/frontend/package.json +2 -0
- package/nul +12 -0
- package/package.json +3 -3
- package/backend/package-lock.json +0 -6801
- package/backend/src/core/node-registries/actions.js +0 -202
- package/backend/src/core/node-registries/arrays.js +0 -155
- package/backend/src/core/node-registries/bot.js +0 -23
- package/backend/src/core/node-registries/container.js +0 -162
- package/backend/src/core/node-registries/data.js +0 -290
- package/backend/src/core/node-registries/debug.js +0 -26
- package/backend/src/core/node-registries/events.js +0 -201
- package/backend/src/core/node-registries/flow.js +0 -139
- package/backend/src/core/node-registries/furnace.js +0 -143
- package/backend/src/core/node-registries/logic.js +0 -62
- package/backend/src/core/node-registries/math.js +0 -42
- package/backend/src/core/node-registries/navigation.js +0 -111
- package/backend/src/core/node-registries/objects.js +0 -98
- package/backend/src/core/node-registries/strings.js +0 -187
- package/backend/src/core/node-registries/time.js +0 -113
- package/backend/src/core/node-registries/type.js +0 -25
- package/backend/src/core/node-registries/users.js +0 -79
- package/frontend/dist/assets/index-SfhKxI4-.css +0 -32
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
const { GRAPH_TYPES } = require('../constants/graphTypes');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Регистрация нод категории "Печка"
|
|
5
|
-
*/
|
|
6
|
-
function registerNodes(registry) {
|
|
7
|
-
console.log('[Furnace Registry] Registering furnace nodes...');
|
|
8
|
-
|
|
9
|
-
// ACTION NODES (с exec пинами) - используют executor
|
|
10
|
-
|
|
11
|
-
registry.registerNodeType({
|
|
12
|
-
type: 'furnace:open',
|
|
13
|
-
label: '🔥 Печка: открыть',
|
|
14
|
-
category: 'Печка',
|
|
15
|
-
description: 'Открывает печку (обычную, плавильную, коптильню) по координатам.',
|
|
16
|
-
graphType: GRAPH_TYPES.ALL,
|
|
17
|
-
executor: require('../nodes/furnace/open').execute,
|
|
18
|
-
evaluator: require('../nodes/furnace/open').evaluate,
|
|
19
|
-
pins: {
|
|
20
|
-
inputs: [
|
|
21
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
22
|
-
{ id: 'x', name: 'X', type: 'Number', required: false },
|
|
23
|
-
{ id: 'y', name: 'Y', type: 'Number', required: false },
|
|
24
|
-
{ id: 'z', name: 'Z', type: 'Number', required: false }
|
|
25
|
-
],
|
|
26
|
-
outputs: [
|
|
27
|
-
{ id: 'exec', name: 'Открыта', type: 'Exec' },
|
|
28
|
-
{ id: 'exec_failed', name: 'Ошибка', type: 'Exec' },
|
|
29
|
-
{ id: 'furnace', name: 'Печка', type: 'Object' },
|
|
30
|
-
{ id: 'success', name: 'Успех?', type: 'Boolean' }
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
registry.registerNodeType({
|
|
36
|
-
type: 'furnace:close',
|
|
37
|
-
label: '🔥 Печка: закрыть',
|
|
38
|
-
category: 'Печка',
|
|
39
|
-
description: 'Закрывает открытую печку.',
|
|
40
|
-
graphType: GRAPH_TYPES.ALL,
|
|
41
|
-
executor: require('../nodes/furnace/close').execute,
|
|
42
|
-
pins: {
|
|
43
|
-
inputs: [
|
|
44
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' }
|
|
45
|
-
],
|
|
46
|
-
outputs: [
|
|
47
|
-
{ id: 'exec', name: 'Далее', type: 'Exec' }
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
registry.registerNodeType({
|
|
53
|
-
type: 'furnace:put_input',
|
|
54
|
-
label: '🔥 Печка: положить для плавки',
|
|
55
|
-
category: 'Печка',
|
|
56
|
-
description: 'Кладёт предмет в слот плавки печки.',
|
|
57
|
-
graphType: GRAPH_TYPES.ALL,
|
|
58
|
-
executor: require('../nodes/furnace/put_input').execute,
|
|
59
|
-
evaluator: require('../nodes/furnace/put_input').evaluate,
|
|
60
|
-
pins: {
|
|
61
|
-
inputs: [
|
|
62
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
63
|
-
{ id: 'itemName', name: 'Предмет', type: 'String', required: true },
|
|
64
|
-
{ id: 'count', name: 'Кол-во', type: 'Number', required: false }
|
|
65
|
-
],
|
|
66
|
-
outputs: [
|
|
67
|
-
{ id: 'exec', name: 'Положено', type: 'Exec' },
|
|
68
|
-
{ id: 'exec_failed', name: 'Ошибка', type: 'Exec' },
|
|
69
|
-
{ id: 'success', name: 'Успех?', type: 'Boolean' }
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
registry.registerNodeType({
|
|
75
|
-
type: 'furnace:put_fuel',
|
|
76
|
-
label: '🔥 Печка: положить топливо',
|
|
77
|
-
category: 'Печка',
|
|
78
|
-
description: 'Кладёт топливо в слот топлива печки.',
|
|
79
|
-
graphType: GRAPH_TYPES.ALL,
|
|
80
|
-
executor: require('../nodes/furnace/put_fuel').execute,
|
|
81
|
-
evaluator: require('../nodes/furnace/put_fuel').evaluate,
|
|
82
|
-
pins: {
|
|
83
|
-
inputs: [
|
|
84
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
85
|
-
{ id: 'itemName', name: 'Топливо', type: 'String', required: true },
|
|
86
|
-
{ id: 'count', name: 'Кол-во', type: 'Number', required: false }
|
|
87
|
-
],
|
|
88
|
-
outputs: [
|
|
89
|
-
{ id: 'exec', name: 'Положено', type: 'Exec' },
|
|
90
|
-
{ id: 'exec_failed', name: 'Ошибка', type: 'Exec' },
|
|
91
|
-
{ id: 'success', name: 'Успех?', type: 'Boolean' }
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
registry.registerNodeType({
|
|
97
|
-
type: 'furnace:take_output',
|
|
98
|
-
label: '🔥 Печка: забрать результат',
|
|
99
|
-
category: 'Печка',
|
|
100
|
-
description: 'Забирает готовый предмет из слота результата печки.',
|
|
101
|
-
graphType: GRAPH_TYPES.ALL,
|
|
102
|
-
executor: require('../nodes/furnace/take_output').execute,
|
|
103
|
-
evaluator: require('../nodes/furnace/take_output').evaluate,
|
|
104
|
-
pins: {
|
|
105
|
-
inputs: [
|
|
106
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' }
|
|
107
|
-
],
|
|
108
|
-
outputs: [
|
|
109
|
-
{ id: 'exec', name: 'Забрано', type: 'Exec' },
|
|
110
|
-
{ id: 'exec_failed', name: 'Пусто/Ошибка', type: 'Exec' },
|
|
111
|
-
{ id: 'item', name: 'Предмет', type: 'Object' },
|
|
112
|
-
{ id: 'count', name: 'Кол-во', type: 'Number' },
|
|
113
|
-
{ id: 'success', name: 'Успех?', type: 'Boolean' }
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
// DATA NODE (без exec пинов) - использует только evaluator
|
|
119
|
-
|
|
120
|
-
registry.registerNodeType({
|
|
121
|
-
type: 'furnace:get_status',
|
|
122
|
-
label: '🔥 Печка: статус',
|
|
123
|
-
category: 'Печка',
|
|
124
|
-
description: 'Получает текущий статус печки (топливо, прогресс, предметы).',
|
|
125
|
-
graphType: GRAPH_TYPES.ALL,
|
|
126
|
-
evaluator: require('../nodes/furnace/get_status').evaluate,
|
|
127
|
-
pins: {
|
|
128
|
-
inputs: [],
|
|
129
|
-
outputs: [
|
|
130
|
-
{ id: 'inputItem', name: 'Плавится', type: 'Object' },
|
|
131
|
-
{ id: 'fuelItem', name: 'Топливо', type: 'Object' },
|
|
132
|
-
{ id: 'outputItem', name: 'Результат', type: 'Object' },
|
|
133
|
-
{ id: 'fuel', name: 'Топливо %', type: 'Number' },
|
|
134
|
-
{ id: 'progress', name: 'Прогресс %', type: 'Number' },
|
|
135
|
-
{ id: 'isBurning', name: 'Горит?', type: 'Boolean' }
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
console.log('[Furnace Registry] Furnace nodes registered successfully');
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
module.exports = { registerNodes };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const { GRAPH_TYPES } = require('../constants/graphTypes');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Регистрация нод категории "Логика"
|
|
5
|
-
*/
|
|
6
|
-
function registerNodes(registry) {
|
|
7
|
-
registry.registerNodeType({
|
|
8
|
-
type: 'logic:operation',
|
|
9
|
-
label: '💡 Логика',
|
|
10
|
-
category: 'Логика',
|
|
11
|
-
description: 'Выполняет логическую операцию. Для НЕ (NOT) используется только вход А.',
|
|
12
|
-
graphType: GRAPH_TYPES.ALL,
|
|
13
|
-
dynamicPins: true,
|
|
14
|
-
evaluator: require('../nodes/logic/operation').evaluate,
|
|
15
|
-
pins: {
|
|
16
|
-
inputs: [
|
|
17
|
-
{ id: 'a', name: 'A', type: 'Boolean', required: true },
|
|
18
|
-
{ id: 'b', name: 'B', type: 'Boolean', required: true }
|
|
19
|
-
],
|
|
20
|
-
outputs: [
|
|
21
|
-
{ id: 'result', name: 'Результат', type: 'Boolean' }
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
registry.registerNodeType({
|
|
27
|
-
type: 'logic:compare',
|
|
28
|
-
label: '⎗ Сравнение',
|
|
29
|
-
category: 'Логика',
|
|
30
|
-
description: 'Сравнивает два значения.',
|
|
31
|
-
graphType: GRAPH_TYPES.ALL,
|
|
32
|
-
evaluator: require('../nodes/logic/compare').evaluate,
|
|
33
|
-
pins: {
|
|
34
|
-
inputs: [
|
|
35
|
-
{ id: 'a', name: 'A', type: 'Wildcard' },
|
|
36
|
-
{ id: 'b', name: 'B', type: 'Wildcard' }
|
|
37
|
-
],
|
|
38
|
-
outputs: [
|
|
39
|
-
{ id: 'result', name: 'Результат', type: 'Boolean' }
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
registry.registerNodeType({
|
|
45
|
-
type: 'logic:not',
|
|
46
|
-
label: '! НЕ',
|
|
47
|
-
category: 'Логика',
|
|
48
|
-
description: 'Инвертирует boolean значение (NOT).',
|
|
49
|
-
graphType: GRAPH_TYPES.ALL,
|
|
50
|
-
evaluator: require('../nodes/logic/not').evaluate,
|
|
51
|
-
pins: {
|
|
52
|
-
inputs: [
|
|
53
|
-
{ id: 'value', name: 'Значение', type: 'Boolean', required: false }
|
|
54
|
-
],
|
|
55
|
-
outputs: [
|
|
56
|
-
{ id: 'result', name: 'Результат', type: 'Boolean' }
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
module.exports = { registerNodes };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const { GRAPH_TYPES } = require('../constants/graphTypes');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Регистрация нод категории "Математика"
|
|
5
|
-
*/
|
|
6
|
-
function registerNodes(registry) {
|
|
7
|
-
registry.registerNodeType({
|
|
8
|
-
type: 'math:operation',
|
|
9
|
-
label: '🔢 Математика',
|
|
10
|
-
category: 'Математика',
|
|
11
|
-
description: 'Выполняет математическую операцию над двумя числами.',
|
|
12
|
-
graphType: GRAPH_TYPES.ALL,
|
|
13
|
-
evaluator: require('../nodes/math/operation').evaluate,
|
|
14
|
-
pins: {
|
|
15
|
-
inputs: [
|
|
16
|
-
{ id: 'a', name: 'A', type: 'Number', required: true },
|
|
17
|
-
{ id: 'b', name: 'B', type: 'Number', required: true }
|
|
18
|
-
],
|
|
19
|
-
outputs: [
|
|
20
|
-
{ id: 'result', name: 'Результат', type: 'Number' }
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
registry.registerNodeType({
|
|
26
|
-
type: 'math:random_number',
|
|
27
|
-
label: '🎲 Случайное число',
|
|
28
|
-
category: 'Математика',
|
|
29
|
-
graphType: GRAPH_TYPES.ALL,
|
|
30
|
-
description: 'Генерирует случайное число в заданном диапазоне.',
|
|
31
|
-
evaluator: require('../nodes/math/random_number').evaluate,
|
|
32
|
-
pins: {
|
|
33
|
-
inputs: [
|
|
34
|
-
{ id: 'min', name: 'Мин', type: 'Number' },
|
|
35
|
-
{ id: 'max', name: 'Макс', type: 'Number' }
|
|
36
|
-
],
|
|
37
|
-
outputs: [{ id: 'result', name: 'Результат', type: 'Number' }]
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
module.exports = { registerNodes };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
const { GRAPH_TYPES } = require('../constants/graphTypes');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Регистрация нод категории "Навигация"
|
|
5
|
-
*/
|
|
6
|
-
function registerNodes(registry) {
|
|
7
|
-
registry.registerNodeType({
|
|
8
|
-
type: 'navigation:go_to',
|
|
9
|
-
label: '🚶 Идти к',
|
|
10
|
-
category: 'Навигация',
|
|
11
|
-
description: 'Перемещает бота к указанным координатам используя pathfinding.',
|
|
12
|
-
graphType: GRAPH_TYPES.ALL,
|
|
13
|
-
evaluator: require('../nodes/navigation/go_to').evaluate,
|
|
14
|
-
pins: {
|
|
15
|
-
inputs: [
|
|
16
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
17
|
-
{ id: 'x', name: 'X', type: 'Number', required: false },
|
|
18
|
-
{ id: 'y', name: 'Y', type: 'Number', required: false },
|
|
19
|
-
{ id: 'z', name: 'Z', type: 'Number', required: false },
|
|
20
|
-
{ id: 'range', name: 'Радиус', type: 'Number', required: false }
|
|
21
|
-
],
|
|
22
|
-
outputs: [
|
|
23
|
-
{ id: 'exec', name: 'Дошёл', type: 'Exec' },
|
|
24
|
-
{ id: 'exec_failed', name: 'Не удалось', type: 'Exec' },
|
|
25
|
-
{ id: 'success', name: 'Успех?', type: 'Boolean' }
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
registry.registerNodeType({
|
|
31
|
-
type: 'navigation:go_to_player',
|
|
32
|
-
label: '🏃 Идти к игроку',
|
|
33
|
-
category: 'Навигация',
|
|
34
|
-
description: 'Перемещает бота к указанному игроку.',
|
|
35
|
-
graphType: GRAPH_TYPES.ALL,
|
|
36
|
-
evaluator: require('../nodes/navigation/go_to_player').evaluate,
|
|
37
|
-
pins: {
|
|
38
|
-
inputs: [
|
|
39
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
40
|
-
{ id: 'playerName', name: 'Имя игрока', type: 'String', required: true },
|
|
41
|
-
{ id: 'range', name: 'Радиус', type: 'Number', required: false }
|
|
42
|
-
],
|
|
43
|
-
outputs: [
|
|
44
|
-
{ id: 'exec', name: 'Дошёл', type: 'Exec' },
|
|
45
|
-
{ id: 'exec_failed', name: 'Не удалось', type: 'Exec' },
|
|
46
|
-
{ id: 'success', name: 'Успех?', type: 'Boolean' },
|
|
47
|
-
{ id: 'playerPosition', name: 'Позиция игрока', type: 'Object' }
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
registry.registerNodeType({
|
|
53
|
-
type: 'navigation:go_to_entity',
|
|
54
|
-
label: '🎯 Идти к сущности',
|
|
55
|
-
category: 'Навигация',
|
|
56
|
-
description: 'Перемещает бота к указанной сущности.',
|
|
57
|
-
graphType: GRAPH_TYPES.ALL,
|
|
58
|
-
evaluator: require('../nodes/navigation/go_to_entity').evaluate,
|
|
59
|
-
pins: {
|
|
60
|
-
inputs: [
|
|
61
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
62
|
-
{ id: 'entity', name: 'Сущность', type: 'Object', required: true },
|
|
63
|
-
{ id: 'range', name: 'Радиус', type: 'Number', required: false }
|
|
64
|
-
],
|
|
65
|
-
outputs: [
|
|
66
|
-
{ id: 'exec', name: 'Дошёл', type: 'Exec' },
|
|
67
|
-
{ id: 'exec_failed', name: 'Не удалось', type: 'Exec' },
|
|
68
|
-
{ id: 'success', name: 'Успех?', type: 'Boolean' }
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
registry.registerNodeType({
|
|
74
|
-
type: 'navigation:follow',
|
|
75
|
-
label: '👥 Следовать',
|
|
76
|
-
category: 'Навигация',
|
|
77
|
-
description: 'Начинает следовать за игроком.',
|
|
78
|
-
graphType: GRAPH_TYPES.ALL,
|
|
79
|
-
evaluator: require('../nodes/navigation/follow').evaluate,
|
|
80
|
-
pins: {
|
|
81
|
-
inputs: [
|
|
82
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' },
|
|
83
|
-
{ id: 'target', name: 'Цель', type: 'String', required: true },
|
|
84
|
-
{ id: 'range', name: 'Дистанция', type: 'Number', required: false }
|
|
85
|
-
],
|
|
86
|
-
outputs: [
|
|
87
|
-
{ id: 'exec', name: 'Начал следовать', type: 'Exec' },
|
|
88
|
-
{ id: 'following', name: 'Следует?', type: 'Boolean' }
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
registry.registerNodeType({
|
|
94
|
-
type: 'navigation:stop',
|
|
95
|
-
label: '🛑 Остановиться',
|
|
96
|
-
category: 'Навигация',
|
|
97
|
-
description: 'Останавливает текущее движение бота.',
|
|
98
|
-
graphType: GRAPH_TYPES.ALL,
|
|
99
|
-
evaluator: require('../nodes/navigation/stop').evaluate,
|
|
100
|
-
pins: {
|
|
101
|
-
inputs: [
|
|
102
|
-
{ id: 'exec', name: 'Выполнить', type: 'Exec' }
|
|
103
|
-
],
|
|
104
|
-
outputs: [
|
|
105
|
-
{ id: 'exec', name: 'Выполнено', type: 'Exec' }
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
module.exports = { registerNodes };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
const { GRAPH_TYPES } = require('../constants/graphTypes');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Регистрация нод категории "Объекты"
|
|
5
|
-
*/
|
|
6
|
-
function registerNodes(registry) {
|
|
7
|
-
registry.registerNodeType({
|
|
8
|
-
type: 'object:create',
|
|
9
|
-
label: '🏗️ Создать объект',
|
|
10
|
-
category: 'Объект',
|
|
11
|
-
description: 'Создает объект из пар ключ-значение.',
|
|
12
|
-
graphType: GRAPH_TYPES.ALL,
|
|
13
|
-
dynamicPins: true,
|
|
14
|
-
evaluator: require('../nodes/objects/create').evaluate,
|
|
15
|
-
pins: {
|
|
16
|
-
inputs: [],
|
|
17
|
-
outputs: [
|
|
18
|
-
{ id: 'object', name: 'Объект', type: 'Object' }
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
registry.registerNodeType({
|
|
24
|
-
type: 'object:get',
|
|
25
|
-
label: '📤 Получить значение',
|
|
26
|
-
category: 'Объект',
|
|
27
|
-
description: 'Получает значение по ключу из объекта.',
|
|
28
|
-
graphType: GRAPH_TYPES.ALL,
|
|
29
|
-
evaluator: require('../nodes/objects/get').evaluate,
|
|
30
|
-
pins: {
|
|
31
|
-
inputs: [
|
|
32
|
-
{ id: 'object', name: 'Объект', type: 'Object', required: true },
|
|
33
|
-
{ id: 'key', name: 'Ключ', type: 'String', required: true }
|
|
34
|
-
],
|
|
35
|
-
outputs: [
|
|
36
|
-
{ id: 'value', name: 'Значение', type: 'Any' }
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
registry.registerNodeType({
|
|
42
|
-
type: 'object:set',
|
|
43
|
-
label: '➕ Добавить/Изменить ключ',
|
|
44
|
-
category: 'Объект',
|
|
45
|
-
description: 'Добавляет или изменяет значение по ключу в объекте.',
|
|
46
|
-
graphType: GRAPH_TYPES.ALL,
|
|
47
|
-
evaluator: require('../nodes/objects/set').evaluate,
|
|
48
|
-
pins: {
|
|
49
|
-
inputs: [
|
|
50
|
-
{ id: 'object', name: 'Объект', type: 'Object', required: true },
|
|
51
|
-
{ id: 'key', name: 'Ключ', type: 'String', required: true },
|
|
52
|
-
{ id: 'value', name: 'Значение', type: 'Any', required: true }
|
|
53
|
-
],
|
|
54
|
-
outputs: [
|
|
55
|
-
{ id: 'new_object', name: 'Новый объект', type: 'Object' }
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
registry.registerNodeType({
|
|
61
|
-
type: 'object:delete',
|
|
62
|
-
label: '➖ Удалить ключ',
|
|
63
|
-
category: 'Объект',
|
|
64
|
-
description: 'Удаляет ключ из объекта.',
|
|
65
|
-
graphType: GRAPH_TYPES.ALL,
|
|
66
|
-
evaluator: require('../nodes/objects/delete').evaluate,
|
|
67
|
-
pins: {
|
|
68
|
-
inputs: [
|
|
69
|
-
{ id: 'object', name: 'Объект', type: 'Object', required: true },
|
|
70
|
-
{ id: 'key', name: 'Ключ', type: 'String', required: true }
|
|
71
|
-
],
|
|
72
|
-
outputs: [
|
|
73
|
-
{ id: 'new_object', name: 'Новый объект', type: 'Object' }
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
registry.registerNodeType({
|
|
79
|
-
type: 'object:has_key',
|
|
80
|
-
label: '🔍 Проверить ключ',
|
|
81
|
-
category: 'Объект',
|
|
82
|
-
description: 'Проверяет наличие ключа в объекте и возвращает значение.',
|
|
83
|
-
graphType: GRAPH_TYPES.ALL,
|
|
84
|
-
evaluator: require('../nodes/objects/has_key').evaluate,
|
|
85
|
-
pins: {
|
|
86
|
-
inputs: [
|
|
87
|
-
{ id: 'object', name: 'Объект', type: 'Object', required: true },
|
|
88
|
-
{ id: 'key', name: 'Ключ', type: 'String', required: true }
|
|
89
|
-
],
|
|
90
|
-
outputs: [
|
|
91
|
-
{ id: 'result', name: 'Найден', type: 'Boolean' },
|
|
92
|
-
{ id: 'value', name: 'Значение', type: 'Any' }
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
module.exports = { registerNodes };
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
const { GRAPH_TYPES } = require('../constants/graphTypes');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Регистрация нод категории "Строки"
|
|
5
|
-
*/
|
|
6
|
-
function registerNodes(registry) {
|
|
7
|
-
registry.registerNodeType({
|
|
8
|
-
type: 'string:contains',
|
|
9
|
-
label: '🔍 Строка содержит',
|
|
10
|
-
category: 'Строки',
|
|
11
|
-
description: 'Проверяет, содержит ли одна строка другую.',
|
|
12
|
-
graphType: GRAPH_TYPES.ALL,
|
|
13
|
-
evaluator: require('../nodes/strings/contains').evaluate,
|
|
14
|
-
pins: {
|
|
15
|
-
inputs: [
|
|
16
|
-
{ id: 'haystack', name: 'Строка', type: 'String', required: true },
|
|
17
|
-
{ id: 'needle', name: 'Подстрока', type: 'String', required: true },
|
|
18
|
-
{ id: 'case_sensitive', name: 'Учет регистра', type: 'Boolean', required: false }
|
|
19
|
-
],
|
|
20
|
-
outputs: [
|
|
21
|
-
{ id: 'result', name: 'Содержит?', type: 'Boolean' }
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
registry.registerNodeType({
|
|
27
|
-
type: 'string:matches',
|
|
28
|
-
label: '🔎 RegEx совпадает',
|
|
29
|
-
category: 'Строки',
|
|
30
|
-
description: 'Проверяет совпадение с регулярным выражением.',
|
|
31
|
-
graphType: GRAPH_TYPES.ALL,
|
|
32
|
-
evaluator: require('../nodes/strings/matches').evaluate,
|
|
33
|
-
pins: {
|
|
34
|
-
inputs: [
|
|
35
|
-
{ id: 'string', name: 'Строка', type: 'String', required: true },
|
|
36
|
-
{ id: 'regex', name: 'RegEx', type: 'String', required: true }
|
|
37
|
-
],
|
|
38
|
-
outputs: [
|
|
39
|
-
{ id: 'result', name: 'Совпадает?', type: 'Boolean' }
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
registry.registerNodeType({
|
|
45
|
-
type: 'string:equals',
|
|
46
|
-
label: '🔤 Строка равна',
|
|
47
|
-
category: 'Строки',
|
|
48
|
-
description: 'Проверяет равенство двух строк.',
|
|
49
|
-
graphType: GRAPH_TYPES.ALL,
|
|
50
|
-
evaluator: require('../nodes/strings/equals').evaluate,
|
|
51
|
-
pins: {
|
|
52
|
-
inputs: [
|
|
53
|
-
{ id: 'a', name: 'A', type: 'String', required: true },
|
|
54
|
-
{ id: 'b', name: 'B', type: 'String', required: true },
|
|
55
|
-
{ id: 'case_sensitive', name: 'Учет регистра', type: 'Boolean', required: false }
|
|
56
|
-
],
|
|
57
|
-
outputs: [
|
|
58
|
-
{ id: 'result', name: 'Равны?', type: 'Boolean' }
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
registry.registerNodeType({
|
|
64
|
-
type: 'string:starts_with',
|
|
65
|
-
label: '▶️ Начинается с',
|
|
66
|
-
category: 'Строки',
|
|
67
|
-
description: 'Проверяет, начинается ли строка с подстроки.',
|
|
68
|
-
graphType: GRAPH_TYPES.ALL,
|
|
69
|
-
evaluator: require('../nodes/strings/starts_with').evaluate,
|
|
70
|
-
pins: {
|
|
71
|
-
inputs: [
|
|
72
|
-
{ id: 'string', name: 'Строка', type: 'String', required: true },
|
|
73
|
-
{ id: 'prefix', name: 'Префикс', type: 'String', required: true },
|
|
74
|
-
{ id: 'case_sensitive', name: 'Учет регистра', type: 'Boolean', required: false }
|
|
75
|
-
],
|
|
76
|
-
outputs: [
|
|
77
|
-
{ id: 'result', name: 'Начинается?', type: 'Boolean' }
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
registry.registerNodeType({
|
|
83
|
-
type: 'string:ends_with',
|
|
84
|
-
label: '◀️ Заканчивается на',
|
|
85
|
-
category: 'Строки',
|
|
86
|
-
description: 'Проверяет, заканчивается ли строка подстрокой.',
|
|
87
|
-
graphType: GRAPH_TYPES.ALL,
|
|
88
|
-
evaluator: require('../nodes/strings/ends_with').evaluate,
|
|
89
|
-
pins: {
|
|
90
|
-
inputs: [
|
|
91
|
-
{ id: 'string', name: 'Строка', type: 'String', required: true },
|
|
92
|
-
{ id: 'suffix', name: 'Суффикс', type: 'String', required: true },
|
|
93
|
-
{ id: 'case_sensitive', name: 'Учет регистра', type: 'Boolean', required: false }
|
|
94
|
-
],
|
|
95
|
-
outputs: [
|
|
96
|
-
{ id: 'result', name: 'Заканчивается?', type: 'Boolean' }
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
registry.registerNodeType({
|
|
102
|
-
type: 'string:length',
|
|
103
|
-
label: '📏 Длина строки',
|
|
104
|
-
category: 'Строки',
|
|
105
|
-
description: 'Возвращает количество символов.',
|
|
106
|
-
graphType: GRAPH_TYPES.ALL,
|
|
107
|
-
evaluator: require('../nodes/strings/length').evaluate,
|
|
108
|
-
pins: {
|
|
109
|
-
inputs: [
|
|
110
|
-
{ id: 'string', name: 'Строка', type: 'String', required: true }
|
|
111
|
-
],
|
|
112
|
-
outputs: [
|
|
113
|
-
{ id: 'length', name: 'Длина', type: 'Number' }
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
registry.registerNodeType({
|
|
119
|
-
type: 'string:split',
|
|
120
|
-
label: '✂️ Разделить строку',
|
|
121
|
-
category: 'Строки',
|
|
122
|
-
description: 'Разделяет строку на массив по разделителю.',
|
|
123
|
-
graphType: GRAPH_TYPES.ALL,
|
|
124
|
-
evaluator: require('../nodes/strings/split').evaluate,
|
|
125
|
-
pins: {
|
|
126
|
-
inputs: [
|
|
127
|
-
{ id: 'string', name: 'Строка', type: 'String', required: true },
|
|
128
|
-
{ id: 'separator', name: 'Разделитель', type: 'String', required: true }
|
|
129
|
-
],
|
|
130
|
-
outputs: [
|
|
131
|
-
{ id: 'array', name: 'Массив', type: 'Array' }
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
registry.registerNodeType({
|
|
137
|
-
type: 'string:concat',
|
|
138
|
-
label: 'Строка: Объединить',
|
|
139
|
-
category: 'Строки',
|
|
140
|
-
description: 'Объединяет две или более строки в одну.',
|
|
141
|
-
graphType: GRAPH_TYPES.ALL,
|
|
142
|
-
dynamicPins: true,
|
|
143
|
-
evaluator: require('../nodes/strings/concat').evaluate,
|
|
144
|
-
pins: {
|
|
145
|
-
inputs: [],
|
|
146
|
-
outputs: [
|
|
147
|
-
{ id: 'result', name: 'Результат', type: 'String' }
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
registry.registerNodeType({
|
|
153
|
-
type: 'string:to_upper',
|
|
154
|
-
label: '⬆️ В верхний регистр',
|
|
155
|
-
category: 'Строки',
|
|
156
|
-
description: 'Преобразует строку в верхний регистр (UPPERCASE).',
|
|
157
|
-
graphType: GRAPH_TYPES.ALL,
|
|
158
|
-
evaluator: require('../nodes/strings/to_upper').evaluate,
|
|
159
|
-
pins: {
|
|
160
|
-
inputs: [
|
|
161
|
-
{ id: 'text', name: 'Текст', type: 'String', required: false }
|
|
162
|
-
],
|
|
163
|
-
outputs: [
|
|
164
|
-
{ id: 'result', name: 'Result', type: 'String' }
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
registry.registerNodeType({
|
|
170
|
-
type: 'string:to_lower',
|
|
171
|
-
label: '⬇️ В нижний регистр',
|
|
172
|
-
category: 'Строки',
|
|
173
|
-
description: 'Преобразует строку в нижний регистр (lowercase).',
|
|
174
|
-
graphType: GRAPH_TYPES.ALL,
|
|
175
|
-
evaluator: require('../nodes/strings/to_lower').evaluate,
|
|
176
|
-
pins: {
|
|
177
|
-
inputs: [
|
|
178
|
-
{ id: 'text', name: 'Текст', type: 'String', required: false }
|
|
179
|
-
],
|
|
180
|
-
outputs: [
|
|
181
|
-
{ id: 'result', name: 'Result', type: 'String' }
|
|
182
|
-
]
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
module.exports = { registerNodes };
|