@trace.market/types 0.1.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/.github/workflows/build-mcp.yml +36 -0
- package/.github/workflows/publish.yml +72 -0
- package/IMPLEMENTATION.md +199 -0
- package/QUICKSTART.md +238 -0
- package/README.md +144 -0
- package/mcp-config.example.json +13 -0
- package/mcp-server/.env.example +9 -0
- package/mcp-server/README.md +151 -0
- package/mcp-server/generate-token.js +61 -0
- package/mcp-server/package-lock.json +1206 -0
- package/mcp-server/package.json +26 -0
- package/mcp-server/src/index.ts +516 -0
- package/package.json +31 -0
- package/src/ENov +261 -0
- package/src/index.d.ts +187 -0
- package/tsconfig.json +18 -0
package/src/ENov
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
Crear archivo /client/src/data/equipmentData.js:
|
|
2
|
+
|
|
3
|
+
export const PYROLYSIS_EQUIPMENT = {
|
|
4
|
+
reactor_main: {
|
|
5
|
+
id: "LJP1000-00",
|
|
6
|
+
name: "Reactor Principal Pirólisis",
|
|
7
|
+
capacity: "500kg",
|
|
8
|
+
material: "acero_carbono",
|
|
9
|
+
max_temperature: 500,
|
|
10
|
+
working_pressure: 0.02,
|
|
11
|
+
emergency_pressure: 0.04,
|
|
12
|
+
rotation: true,
|
|
13
|
+
life_expectancy_years: "5-6",
|
|
14
|
+
critical_components: ["graphite_packing", "feeding_door", "slag_door"],
|
|
15
|
+
status: "off",
|
|
16
|
+
current_temp: 25,
|
|
17
|
+
current_pressure: 0.0
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
burner_main: {
|
|
21
|
+
id: "Q1-200K",
|
|
22
|
+
name: "Quemador Principal",
|
|
23
|
+
capacity: "200000_kcal",
|
|
24
|
+
fuel: "heavy_oil",
|
|
25
|
+
control: "manual_boilers",
|
|
26
|
+
status: "off",
|
|
27
|
+
flame_level: 0
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
burner_tail_gas: {
|
|
31
|
+
id: "Q2-TG",
|
|
32
|
+
name: "Quemador Tail Gas",
|
|
33
|
+
fuel: "syngas_recirculado",
|
|
34
|
+
control: "manual_valve",
|
|
35
|
+
purpose: "energy_recovery",
|
|
36
|
+
status: "off"
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
condensers: {
|
|
40
|
+
primary: {
|
|
41
|
+
ids: ["C1", "C2"],
|
|
42
|
+
stage: "1#_2#",
|
|
43
|
+
function: "primary_condensation",
|
|
44
|
+
status: "standby",
|
|
45
|
+
water_flow: "normal"
|
|
46
|
+
},
|
|
47
|
+
secondary: {
|
|
48
|
+
ids: ["C3", "C4"],
|
|
49
|
+
stage: "3#_4#",
|
|
50
|
+
function: "secondary_condensation",
|
|
51
|
+
status: "standby",
|
|
52
|
+
water_flow: "normal"
|
|
53
|
+
},
|
|
54
|
+
final: {
|
|
55
|
+
ids: ["C5", "C6"],
|
|
56
|
+
stage: "5#_6#",
|
|
57
|
+
function: "final_condensation",
|
|
58
|
+
status: "standby",
|
|
59
|
+
water_flow: "normal"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
tanks: {
|
|
64
|
+
buffer_chamber: {
|
|
65
|
+
id: "HC-4-00",
|
|
66
|
+
function: "buffer_gases",
|
|
67
|
+
level: 0,
|
|
68
|
+
status: "normal"
|
|
69
|
+
},
|
|
70
|
+
oil_tank: {
|
|
71
|
+
id: "YC-6-00",
|
|
72
|
+
function: "crude_oil_storage",
|
|
73
|
+
capacity: "1000L",
|
|
74
|
+
current_level: 0
|
|
75
|
+
},
|
|
76
|
+
water_seal: {
|
|
77
|
+
function: "safety_seal",
|
|
78
|
+
ph_level: 7.0,
|
|
79
|
+
ph_range: [6.5, 8.5],
|
|
80
|
+
water_level: "normal",
|
|
81
|
+
status: "ok"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
pumps_motors: {
|
|
86
|
+
cooling_pump: {
|
|
87
|
+
activation_temp: 50,
|
|
88
|
+
auto_trigger: true,
|
|
89
|
+
status: "off",
|
|
90
|
+
flow_rate: 0
|
|
91
|
+
},
|
|
92
|
+
gear_oil_pump: {
|
|
93
|
+
id: "KCB-55",
|
|
94
|
+
function: "oil_transfer",
|
|
95
|
+
status: "off",
|
|
96
|
+
flow_rate: 0
|
|
97
|
+
},
|
|
98
|
+
reactor_motor: {
|
|
99
|
+
function: "reactor_rotation",
|
|
100
|
+
reverse_capability: true,
|
|
101
|
+
status: "off",
|
|
102
|
+
rpm: 0
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
sensors: {
|
|
107
|
+
temperature: {
|
|
108
|
+
quantity: 1,
|
|
109
|
+
location: "buffer_chamber",
|
|
110
|
+
current_reading: 25,
|
|
111
|
+
status: "normal",
|
|
112
|
+
last_calibration: "2024-01-01"
|
|
113
|
+
},
|
|
114
|
+
pressure: {
|
|
115
|
+
quantity: 1,
|
|
116
|
+
location: "reactor_main",
|
|
117
|
+
current_reading: 0.0,
|
|
118
|
+
normal_reading: 0.0,
|
|
119
|
+
status: "normal",
|
|
120
|
+
last_calibration: "2024-01-01"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
safety_systems: {
|
|
125
|
+
pressure_gauge: {
|
|
126
|
+
monitoring: "visual_continuous",
|
|
127
|
+
current_reading: 0.0,
|
|
128
|
+
status: "normal"
|
|
129
|
+
},
|
|
130
|
+
safety_valve: {
|
|
131
|
+
activation: "automatic_overpressure",
|
|
132
|
+
set_pressure: 0.04,
|
|
133
|
+
status: "armed"
|
|
134
|
+
},
|
|
135
|
+
tail_gas_valve: {
|
|
136
|
+
requirement: "always_one_open",
|
|
137
|
+
current_state: "open",
|
|
138
|
+
status: "normal"
|
|
139
|
+
},
|
|
140
|
+
filter_screen: {
|
|
141
|
+
location: "oil_gas_outlet",
|
|
142
|
+
last_cleaned: "2024-01-01",
|
|
143
|
+
status: "clean"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
2. EQUIPOS DESTILACIÓN ESPECÍFICOS:
|
|
149
|
+
|
|
150
|
+
export const DISTILLATION_EQUIPMENT = {
|
|
151
|
+
distillation_reactor: {
|
|
152
|
+
id: "JL-500-00-MAIN",
|
|
153
|
+
name: "Reactor Destilación Principal",
|
|
154
|
+
capacity: "500kg",
|
|
155
|
+
max_fill_percent: 75,
|
|
156
|
+
current_fill_percent: 0,
|
|
157
|
+
current_temp: 25,
|
|
158
|
+
residue_temp_when_complete: 360,
|
|
159
|
+
status: "off"
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
refining_pots: {
|
|
163
|
+
pot_1: {
|
|
164
|
+
id: "JL6-800-01",
|
|
165
|
+
code: "Q235A",
|
|
166
|
+
function: "primary_refining",
|
|
167
|
+
status: "standby"
|
|
168
|
+
},
|
|
169
|
+
pot_2: {
|
|
170
|
+
id: "JL6-800-02",
|
|
171
|
+
code: "Q04",
|
|
172
|
+
function: "secondary_refining",
|
|
173
|
+
status: "standby"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
treatment_system: {
|
|
178
|
+
acid_tank: {
|
|
179
|
+
process: "acid_treatment",
|
|
180
|
+
stir_time_min: 30,
|
|
181
|
+
settle_time_hours: 3,
|
|
182
|
+
pump: "pump_1",
|
|
183
|
+
sequence: 1,
|
|
184
|
+
current_volume: 0,
|
|
185
|
+
last_process: null,
|
|
186
|
+
status: "empty"
|
|
187
|
+
},
|
|
188
|
+
alkaline_tank: {
|
|
189
|
+
process: "alkaline_treatment",
|
|
190
|
+
stir_time_min: 30,
|
|
191
|
+
settle_time_hours: 3,
|
|
192
|
+
pump: "pump_2",
|
|
193
|
+
sequence: 2,
|
|
194
|
+
current_volume: 0,
|
|
195
|
+
last_process: null,
|
|
196
|
+
status: "empty"
|
|
197
|
+
},
|
|
198
|
+
final_tank: {
|
|
199
|
+
product: "final_diesel",
|
|
200
|
+
pump: "pump_3",
|
|
201
|
+
sequence: 3,
|
|
202
|
+
current_volume: 0,
|
|
203
|
+
quality_grade: null,
|
|
204
|
+
status: "empty"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
pumps: {
|
|
209
|
+
pump_1: {
|
|
210
|
+
function: "oil_tank_to_acid_tank",
|
|
211
|
+
sequence: 1,
|
|
212
|
+
status: "off",
|
|
213
|
+
flow_rate: 0
|
|
214
|
+
},
|
|
215
|
+
pump_2: {
|
|
216
|
+
function: "acid_tank_to_alkaline_tank",
|
|
217
|
+
sequence: 2,
|
|
218
|
+
status: "off",
|
|
219
|
+
flow_rate: 0
|
|
220
|
+
},
|
|
221
|
+
pump_3: {
|
|
222
|
+
function: "alkaline_tank_to_final_tank",
|
|
223
|
+
sequence: 3,
|
|
224
|
+
status: "off",
|
|
225
|
+
flow_rate: 0
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
cooling_system: {
|
|
230
|
+
water_pool: {
|
|
231
|
+
function: "closed_circuit_cooling",
|
|
232
|
+
temperature: 25,
|
|
233
|
+
flow_rate: "normal",
|
|
234
|
+
status: "circulating"
|
|
235
|
+
},
|
|
236
|
+
water_sealing_tank: {
|
|
237
|
+
level_control: "overflow_valve",
|
|
238
|
+
current_level: "normal",
|
|
239
|
+
overflow_status: "closed"
|
|
240
|
+
},
|
|
241
|
+
horizontal_condenser: {
|
|
242
|
+
id: "WL-4-00",
|
|
243
|
+
efficiency: "normal",
|
|
244
|
+
status: "standby"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
temperature_control: {
|
|
249
|
+
burner_system: {
|
|
250
|
+
control: "manual_flame_adjustment",
|
|
251
|
+
current_flame_level: 0,
|
|
252
|
+
fuel_type: "heavy_oil",
|
|
253
|
+
status: "off"
|
|
254
|
+
},
|
|
255
|
+
blower: {
|
|
256
|
+
activation: "post_process_cooling",
|
|
257
|
+
status: "off",
|
|
258
|
+
speed: 0
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
};
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { GeoJSON } from "geojson";
|
|
2
|
+
|
|
3
|
+
export type TokenIdOr<T> = string | T | FetchError;
|
|
4
|
+
|
|
5
|
+
export interface FetchError {
|
|
6
|
+
errorMessage: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Pokedex {
|
|
10
|
+
description: string;
|
|
11
|
+
contract: string;
|
|
12
|
+
token: string;
|
|
13
|
+
feedchainVersion: string;
|
|
14
|
+
instance: ProductInstance;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type Location = GeoJSON.Point;
|
|
18
|
+
|
|
19
|
+
export interface Facility {
|
|
20
|
+
label?: string;
|
|
21
|
+
location: Location;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type Process =
|
|
25
|
+
| PrintingProcess
|
|
26
|
+
| MillingProcess
|
|
27
|
+
| FreezeDryingProcess
|
|
28
|
+
| BlendingProcess
|
|
29
|
+
| SaleProcess
|
|
30
|
+
| HarvestProcess;
|
|
31
|
+
|
|
32
|
+
export interface GenericProcess {
|
|
33
|
+
timestamp: number;
|
|
34
|
+
duration?: number;
|
|
35
|
+
facility: Facility;
|
|
36
|
+
temperatureRange: TemperatureRange;
|
|
37
|
+
inputInstances: (TransportedInputInstance | LocalInputInstance)[];
|
|
38
|
+
impacts?: Impact[];
|
|
39
|
+
price?: Price;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PrintingProcess extends GenericProcess {
|
|
43
|
+
type: "printing";
|
|
44
|
+
machineInstance: MachineInstance;
|
|
45
|
+
knowHow: KnowHow;
|
|
46
|
+
shape: string /* URL */;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface MillingProcess extends GenericProcess {
|
|
50
|
+
type: "milling";
|
|
51
|
+
knowHow: KnowHow;
|
|
52
|
+
machineInstance: MachineInstance;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface FreezeDryingProcess extends GenericProcess {
|
|
56
|
+
type: "freezedrying";
|
|
57
|
+
knowHow: KnowHow;
|
|
58
|
+
machineInstance: MachineInstance;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface BlendingProcess extends GenericProcess {
|
|
62
|
+
type: "blending";
|
|
63
|
+
machineInstance: MachineInstance;
|
|
64
|
+
knowHow: KnowHow;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface SaleProcess extends GenericProcess {
|
|
68
|
+
type: "sale";
|
|
69
|
+
price: Price;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface HarvestProcess extends GenericProcess {
|
|
73
|
+
type: "harvest";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface Price {
|
|
77
|
+
amount: number;
|
|
78
|
+
currency: string;
|
|
79
|
+
type: "budget" | "is" | "%" | "payin30days" | "payin60days";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface GenericInputInstance {
|
|
83
|
+
instance: TokenIdOr<ProductInstance>;
|
|
84
|
+
quantity: number; // g|ml
|
|
85
|
+
}
|
|
86
|
+
export interface LocalInputInstance extends GenericInputInstance {
|
|
87
|
+
type: "local";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface TransportedInputInstance extends GenericInputInstance {
|
|
91
|
+
type: "transported";
|
|
92
|
+
transport: Transport;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type InputInstance = LocalInputInstance | TransportedInputInstance;
|
|
96
|
+
|
|
97
|
+
export interface Transport {
|
|
98
|
+
method: TransportMethod;
|
|
99
|
+
fuelType: "hydrogen" | "electric" | "diesel" | "petrol" | "kerosene";
|
|
100
|
+
weight: number;
|
|
101
|
+
deparetureTime: number;
|
|
102
|
+
duration: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export type TransportMethod = "air" | "sea" | "land";
|
|
106
|
+
|
|
107
|
+
export interface ProductInstanceBase {
|
|
108
|
+
type: string;
|
|
109
|
+
ownerId?: string;
|
|
110
|
+
expiryDate?: number;
|
|
111
|
+
bio: boolean;
|
|
112
|
+
quantity: number;
|
|
113
|
+
price?: Price;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface FoodInstance extends ProductInstanceBase {
|
|
117
|
+
category: "food";
|
|
118
|
+
iDs?: ID[];
|
|
119
|
+
nutrients?: FallbackFoodNutrient[];
|
|
120
|
+
format?: string;
|
|
121
|
+
grade?: string;
|
|
122
|
+
size?: string;
|
|
123
|
+
process?: Process;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface CartridgeInstance extends ProductInstanceBase {
|
|
127
|
+
category: "cartridge";
|
|
128
|
+
grade: string;
|
|
129
|
+
size: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type ProductInstance = FoodInstance | CartridgeInstance;
|
|
133
|
+
|
|
134
|
+
export interface FallbackFoodNutrient {
|
|
135
|
+
amount: number;
|
|
136
|
+
iD: ID;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface MachineInstance {
|
|
140
|
+
category: string;
|
|
141
|
+
ownerId: string;
|
|
142
|
+
quantity: number;
|
|
143
|
+
size: string;
|
|
144
|
+
hr: Hr;
|
|
145
|
+
providerSDomain: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface Hr {
|
|
149
|
+
tasks: string;
|
|
150
|
+
assignee: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface TemperatureRange {
|
|
154
|
+
min: number;
|
|
155
|
+
max: number;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface KnowHow {
|
|
159
|
+
owner: string;
|
|
160
|
+
hash: string;
|
|
161
|
+
inputs: string;
|
|
162
|
+
outputs: string;
|
|
163
|
+
licenseFee: Price;
|
|
164
|
+
note?: string | object;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface GenericImpact {
|
|
168
|
+
ownerId: string;
|
|
169
|
+
format: string;
|
|
170
|
+
/* x (g|l) */
|
|
171
|
+
quantity: number;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export type Impact = CarbonImpact | WaterImpact;
|
|
175
|
+
|
|
176
|
+
export interface CarbonImpact extends GenericImpact {
|
|
177
|
+
category: "carbon";
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface WaterImpact extends GenericImpact {
|
|
181
|
+
category: "water";
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface ID {
|
|
185
|
+
registry: string;
|
|
186
|
+
id: string;
|
|
187
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "Node16",
|
|
5
|
+
"moduleResolution": "Node16",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"rootDir": "./",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"declarationMap": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*"],
|
|
17
|
+
"exclude": ["node_modules", "dist"]
|
|
18
|
+
}
|