rsnarsna commited on
Commit
5051049
·
1 Parent(s): 121cfed

feat(specs): extend python fundamentals catalog to 42 constructs across all 11 categories

Browse files
Files changed (3) hide show
  1. database/mongo.py +542 -78
  2. main.py +14 -0
  3. specs/python_fundamentals.json +3283 -0
database/mongo.py CHANGED
@@ -4,6 +4,7 @@ Implements WorkflowRepository and User Profile Store using MongoDB Atlas with gr
4
  """
5
 
6
  import os
 
7
  import uuid
8
  from datetime import datetime, timezone
9
  from typing import Dict, Any, List, Optional
@@ -76,7 +77,7 @@ DEFAULT_CORE_SPECS = [
76
  "label": "Variable",
77
  "sublabel": "Variable (int/str/bool)",
78
  "category": "Variables & Types",
79
- "icon": "Box",
80
  "iconColor": "text-blue-400",
81
  "iconBg": "bg-blue-600",
82
  "borderColor": "border-blue-500/40",
@@ -88,7 +89,7 @@ DEFAULT_CORE_SPECS = [
88
  "label": "Constant",
89
  "sublabel": "Immutable Value",
90
  "category": "Variables & Types",
91
- "icon": "Box",
92
  "iconColor": "text-cyan-400",
93
  "iconBg": "bg-cyan-600",
94
  "borderColor": "border-cyan-500/40",
@@ -101,28 +102,76 @@ DEFAULT_CORE_SPECS = [
101
  "name": "Input & Output",
102
  "items": [
103
  {
104
- "id": "input_prompt",
105
- "label": "Input Prompt",
106
  "sublabel": "input(prompt)",
107
  "category": "Input & Output",
108
- "icon": "Terminal",
 
 
 
 
 
 
 
 
 
 
 
 
109
  "iconColor": "text-emerald-400",
110
  "iconBg": "bg-emerald-600",
111
  "borderColor": "border-emerald-500/40",
112
- "nodeType": "alli.primitive.input",
113
- "defaultData": {"prompt": "Enter value: "},
114
  },
115
  {
116
  "id": "print_output",
117
- "label": "Print / Output",
118
- "sublabel": "print(*args)",
119
  "category": "Input & Output",
120
- "icon": "FileText",
121
  "iconColor": "text-emerald-400",
122
  "iconBg": "bg-emerald-600",
123
  "borderColor": "border-emerald-500/40",
124
  "nodeType": "alli.primitive.print",
125
- "defaultData": {"message": "Execution finished"},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  },
127
  ],
128
  },
@@ -130,28 +179,28 @@ DEFAULT_CORE_SPECS = [
130
  "name": "Control Flow",
131
  "items": [
132
  {
133
- "id": "if_condition",
134
- "label": "If Condition",
135
- "sublabel": "if condition:",
136
  "category": "Control Flow",
137
  "icon": "GitBranch",
138
- "iconColor": "text-indigo-400",
139
- "iconBg": "bg-indigo-600",
140
- "borderColor": "border-indigo-500/40",
141
- "nodeType": "alli.flow.if",
142
- "defaultData": {"condition": "x > 0"},
143
  },
144
  {
145
- "id": "if_else",
146
- "label": "If-Else Branch",
147
- "sublabel": "if ... else:",
148
  "category": "Control Flow",
149
- "icon": "GitFork",
150
- "iconColor": "text-indigo-400",
151
- "iconBg": "bg-indigo-600",
152
- "borderColor": "border-indigo-500/40",
153
- "nodeType": "alli.flow.if_else",
154
- "defaultData": {"condition": "score >= 50", "true_val": "pass", "false_val": "fail"},
155
  },
156
  ],
157
  },
@@ -159,28 +208,40 @@ DEFAULT_CORE_SPECS = [
159
  "name": "Loops & Iteration",
160
  "items": [
161
  {
162
- "id": "for_loop",
163
  "label": "For Loop",
164
- "sublabel": "for item in iterable:",
165
  "category": "Loops & Iteration",
166
  "icon": "Repeat",
167
- "iconColor": "text-purple-400",
168
- "iconBg": "bg-purple-600",
169
- "borderColor": "border-purple-500/40",
170
- "nodeType": "alli.loop.for",
171
- "defaultData": {"iterable": "range(10)", "iterator_var": "i"},
172
  },
173
  {
174
- "id": "while_loop",
175
  "label": "While Loop",
176
  "sublabel": "while condition:",
177
  "category": "Loops & Iteration",
178
- "icon": "RotateCw",
179
- "iconColor": "text-purple-400",
180
- "iconBg": "bg-purple-600",
181
- "borderColor": "border-purple-500/40",
182
- "nodeType": "alli.loop.while",
183
- "defaultData": {"condition": "count < 5"},
 
 
 
 
 
 
 
 
 
 
 
 
184
  },
185
  ],
186
  },
@@ -192,24 +253,113 @@ DEFAULT_CORE_SPECS = [
192
  "label": "Function Def",
193
  "sublabel": "def func(*args):",
194
  "category": "Functions & Scope",
195
- "icon": "Cpu",
196
  "iconColor": "text-yellow-400",
197
  "iconBg": "bg-yellow-600",
198
  "borderColor": "border-yellow-500/40",
199
- "nodeType": "alli.function.def",
200
- "defaultData": {"fn_name": "calculate_total", "args": "items, tax_rate=0.05"},
201
  },
202
  {
203
- "id": "return_val",
204
- "label": "Return Value",
205
- "sublabel": "return result",
206
  "category": "Functions & Scope",
207
- "icon": "CornerDownRight",
208
- "iconColor": "text-yellow-400",
209
- "iconBg": "bg-yellow-600",
210
- "borderColor": "border-yellow-500/40",
211
- "nodeType": "alli.function.return",
212
- "defaultData": {"expression": "result"},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  },
214
  ],
215
  },
@@ -217,56 +367,212 @@ DEFAULT_CORE_SPECS = [
217
  "name": "Data Structures",
218
  "items": [
219
  {
220
- "id": "list_array",
221
- "label": "List / Array",
222
- "sublabel": "list[T]",
223
  "category": "Data Structures",
224
- "icon": "List",
225
- "iconColor": "text-rose-400",
226
- "iconBg": "bg-rose-600",
227
- "borderColor": "border-rose-500/40",
228
- "nodeType": "alli.data.list",
229
- "defaultData": {"items": "[1, 2, 3, 4, 5]"},
230
  },
231
  {
232
- "id": "dict_json",
233
- "label": "Dict / JSON",
234
- "sublabel": "dict[K, V]",
235
  "category": "Data Structures",
236
  "icon": "Braces",
237
  "iconColor": "text-rose-400",
238
  "iconBg": "bg-rose-600",
239
  "borderColor": "border-rose-500/40",
240
- "nodeType": "alli.data.json",
241
- "defaultData": {"schema": '{"status": "ok", "code": 200}'},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  },
243
  ],
244
  },
245
  {
246
- "name": "Error Handling",
247
  "items": [
248
  {
249
- "id": "try_except",
250
- "label": "Try-Except",
251
- "sublabel": "try: ... except:",
252
- "category": "Error Handling",
253
  "icon": "ShieldAlert",
 
 
 
 
 
 
 
 
 
 
 
 
254
  "iconColor": "text-amber-400",
255
  "iconBg": "bg-amber-600",
256
  "borderColor": "border-amber-500/40",
257
- "nodeType": "alli.flow.try_except",
258
- "defaultData": {"try_block": "result = 100 / divisor", "exception_type": "ZeroDivisionError", "fallback": "0"},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  },
260
  ],
261
  },
262
  {
263
- "name": "Services & APIs",
264
  "items": [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  {
266
  "id": "http_request",
267
  "label": "HTTP Request",
268
  "sublabel": "Call REST API Service",
269
- "category": "Services & APIs",
270
  "icon": "Globe",
271
  "iconColor": "text-cyan-400",
272
  "iconBg": "bg-slate-800",
@@ -276,6 +582,124 @@ DEFAULT_CORE_SPECS = [
276
  },
277
  ],
278
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  ]
280
 
281
  DEFAULT_STARTER_TEMPLATES = [
@@ -607,9 +1031,49 @@ class MongoWorkflowRepository(WorkflowRepository):
607
  {"$set": {"key": "python_core_categories", "categories": categories, "updated_at": get_utc_now()}},
608
  upsert=True
609
  )
610
- return True
611
  except Exception as e:
612
  print(f"[ALLI MongoDB] Core specs save error: {e}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
  # ─── TEMPLATES CATALOG (MONGODB ATLAS) ───────────────────────────────────
614
 
615
  def save_template(self, template_data: Dict[str, Any]) -> str:
 
4
  """
5
 
6
  import os
7
+ import json
8
  import uuid
9
  from datetime import datetime, timezone
10
  from typing import Dict, Any, List, Optional
 
77
  "label": "Variable",
78
  "sublabel": "Variable (int/str/bool)",
79
  "category": "Variables & Types",
80
+ "icon": "Variable",
81
  "iconColor": "text-blue-400",
82
  "iconBg": "bg-blue-600",
83
  "borderColor": "border-blue-500/40",
 
89
  "label": "Constant",
90
  "sublabel": "Immutable Value",
91
  "category": "Variables & Types",
92
+ "icon": "Lock",
93
  "iconColor": "text-cyan-400",
94
  "iconBg": "bg-cyan-600",
95
  "borderColor": "border-cyan-500/40",
 
102
  "name": "Input & Output",
103
  "items": [
104
  {
105
+ "id": "user_input",
106
+ "label": "User Input",
107
  "sublabel": "input(prompt)",
108
  "category": "Input & Output",
109
+ "icon": "TextCursorInput",
110
+ "iconColor": "text-indigo-400",
111
+ "iconBg": "bg-indigo-600",
112
+ "borderColor": "border-indigo-500/40",
113
+ "nodeType": "alli.primitive.input",
114
+ "defaultData": {"var_name": "text_prompt", "value": "Explain quantum computing in simple words.", "type_hint": "str"},
115
+ },
116
+ {
117
+ "id": "file_input",
118
+ "label": "File Input / Output",
119
+ "sublabel": "open(file, mode)",
120
+ "category": "Input & Output",
121
+ "icon": "FileText",
122
  "iconColor": "text-emerald-400",
123
  "iconBg": "bg-emerald-600",
124
  "borderColor": "border-emerald-500/40",
125
+ "nodeType": "alli.primitive.file",
126
+ "defaultData": {"filename": "data.csv", "mode": "r"},
127
  },
128
  {
129
  "id": "print_output",
130
+ "label": "Print Output",
131
+ "sublabel": "print(*objects, sep, end, file, flush)",
132
  "category": "Input & Output",
133
+ "icon": "Terminal",
134
  "iconColor": "text-emerald-400",
135
  "iconBg": "bg-emerald-600",
136
  "borderColor": "border-emerald-500/40",
137
  "nodeType": "alli.primitive.print",
138
+ "defaultData": {
139
+ "prefix": "Result:",
140
+ "sep": " ",
141
+ "end": "\\n",
142
+ "file_stream": "stdout",
143
+ "flush": False,
144
+ "format_style": "standard",
145
+ },
146
+ },
147
+ ],
148
+ },
149
+ {
150
+ "name": "Operators & Logic",
151
+ "items": [
152
+ {
153
+ "id": "binary_op",
154
+ "label": "Binary Operation",
155
+ "sublabel": "result = a + b",
156
+ "category": "Operators & Logic",
157
+ "icon": "Binary",
158
+ "iconColor": "text-violet-400",
159
+ "iconBg": "bg-violet-600",
160
+ "borderColor": "border-violet-500/40",
161
+ "nodeType": "alli.primitive.binary_op",
162
+ "defaultData": {"operator": "+", "a": "10", "b": "5"},
163
+ },
164
+ {
165
+ "id": "compare",
166
+ "label": "Comparison",
167
+ "sublabel": "is_valid = (a == b)",
168
+ "category": "Operators & Logic",
169
+ "icon": "Scale",
170
+ "iconColor": "text-amber-400",
171
+ "iconBg": "bg-amber-600",
172
+ "borderColor": "border-amber-500/40",
173
+ "nodeType": "alli.primitive.compare",
174
+ "defaultData": {"operator": "==", "a": "10", "b": "10"},
175
  },
176
  ],
177
  },
 
179
  "name": "Control Flow",
180
  "items": [
181
  {
182
+ "id": "if_else",
183
+ "label": "If-Else",
184
+ "sublabel": "Condition (True/False)",
185
  "category": "Control Flow",
186
  "icon": "GitBranch",
187
+ "iconColor": "text-purple-400",
188
+ "iconBg": "bg-purple-600",
189
+ "borderColor": "border-purple-500/40",
190
+ "nodeType": "alli.flow.condition",
191
+ "defaultData": {"condition": "user_id >= 18"},
192
  },
193
  {
194
+ "id": "match_case",
195
+ "label": "Match-Case",
196
+ "sublabel": "Pattern Match",
197
  "category": "Control Flow",
198
+ "icon": "GitBranch",
199
+ "iconColor": "text-violet-400",
200
+ "iconBg": "bg-violet-600",
201
+ "borderColor": "border-violet-500/40",
202
+ "nodeType": "alli.flow.match",
203
+ "defaultData": {"match_var": "status", "cases": ["200", "404", "_"]},
204
  },
205
  ],
206
  },
 
208
  "name": "Loops & Iteration",
209
  "items": [
210
  {
211
+ "id": "loop_for",
212
  "label": "For Loop",
213
+ "sublabel": "for item in iterable",
214
  "category": "Loops & Iteration",
215
  "icon": "Repeat",
216
+ "iconColor": "text-cyan-400",
217
+ "iconBg": "bg-cyan-600",
218
+ "borderColor": "border-cyan-500/40",
219
+ "nodeType": "alli.flow.for_loop",
220
+ "defaultData": {"loop_var": "item", "iterable": "range(5)"},
221
  },
222
  {
223
+ "id": "loop_while",
224
  "label": "While Loop",
225
  "sublabel": "while condition:",
226
  "category": "Loops & Iteration",
227
+ "icon": "Repeat",
228
+ "iconColor": "text-teal-400",
229
+ "iconBg": "bg-teal-600",
230
+ "borderColor": "border-teal-500/40",
231
+ "nodeType": "alli.flow.while_loop",
232
+ "defaultData": {"condition": "count < 10"},
233
+ },
234
+ {
235
+ "id": "recursion",
236
+ "label": "Recursion",
237
+ "sublabel": "factorial(n)",
238
+ "category": "Loops & Iteration",
239
+ "icon": "ArrowLeftRight",
240
+ "iconColor": "text-violet-400",
241
+ "iconBg": "bg-violet-600",
242
+ "borderColor": "border-violet-500/40",
243
+ "nodeType": "alli.flow.recursion",
244
+ "defaultData": {"function_name": "factorial", "base_case": "n <= 1", "recursive_call": "n * factorial(n - 1)"},
245
  },
246
  ],
247
  },
 
253
  "label": "Function Def",
254
  "sublabel": "def func(*args):",
255
  "category": "Functions & Scope",
256
+ "icon": "Code2",
257
  "iconColor": "text-yellow-400",
258
  "iconBg": "bg-yellow-600",
259
  "borderColor": "border-yellow-500/40",
260
+ "nodeType": "alli.func.def",
261
+ "defaultData": {"func_name": "compute_metric", "params": "x, factor=2.5", "return_type": "float", "docstring": "Computes weighted metrics."},
262
  },
263
  {
264
+ "id": "call_function",
265
+ "label": "Function Call",
266
+ "sublabel": "result = func(*args)",
267
  "category": "Functions & Scope",
268
+ "icon": "PlayCircle",
269
+ "iconColor": "text-amber-400",
270
+ "iconBg": "bg-amber-600",
271
+ "borderColor": "border-amber-500/40",
272
+ "nodeType": "alli.func.call",
273
+ "defaultData": {"func_name": "compute_metric", "args": "50, factor=3.0", "target_var": "calc_result"},
274
+ },
275
+ {
276
+ "id": "lambda_func",
277
+ "label": "Lambda Expr",
278
+ "sublabel": "lambda x: expr",
279
+ "category": "Functions & Scope",
280
+ "icon": "Zap",
281
+ "iconColor": "text-yellow-300",
282
+ "iconBg": "bg-yellow-500",
283
+ "borderColor": "border-yellow-400/40",
284
+ "nodeType": "alli.func.lambda",
285
+ "defaultData": {"var_name": "double_fn", "params": "x", "expression": "x * 2"},
286
+ },
287
+ {
288
+ "id": "generator_yield",
289
+ "label": "Generator Yield",
290
+ "sublabel": "yield item",
291
+ "category": "Functions & Scope",
292
+ "icon": "IterationCw",
293
+ "iconColor": "text-amber-500",
294
+ "iconBg": "bg-amber-700",
295
+ "borderColor": "border-amber-600/40",
296
+ "nodeType": "alli.func.yield",
297
+ "defaultData": {"yield_value": "item", "is_from": False},
298
+ },
299
+ {
300
+ "id": "recursion_guard",
301
+ "label": "Recursion Guard",
302
+ "sublabel": "max_depth protection",
303
+ "category": "Functions & Scope",
304
+ "icon": "ShieldCheck",
305
+ "iconColor": "text-emerald-400",
306
+ "iconBg": "bg-emerald-600",
307
+ "borderColor": "border-emerald-500/40",
308
+ "nodeType": "alli.func.recursion_guard",
309
+ "defaultData": {"max_depth": 50},
310
+ },
311
+ ],
312
+ },
313
+ {
314
+ "name": "OOP & Classes",
315
+ "items": [
316
+ {
317
+ "id": "class_def",
318
+ "label": "Class Definition",
319
+ "sublabel": "class Name(Bases):",
320
+ "category": "OOP & Classes",
321
+ "icon": "Layers",
322
+ "iconColor": "text-indigo-400",
323
+ "iconBg": "bg-indigo-600",
324
+ "borderColor": "border-indigo-500/40",
325
+ "nodeType": "alli.oop.class_def",
326
+ "defaultData": {"class_name": "DataPipeline", "bases": "", "docstring": "Orchestrates end-to-end data processing."},
327
+ },
328
+ {
329
+ "id": "constructor_init",
330
+ "label": "Constructor (__init__)",
331
+ "sublabel": "def __init__(self, ...):",
332
+ "category": "OOP & Classes",
333
+ "icon": "Wrench",
334
+ "iconColor": "text-indigo-300",
335
+ "iconBg": "bg-indigo-700",
336
+ "borderColor": "border-indigo-600/40",
337
+ "nodeType": "alli.oop.constructor",
338
+ "defaultData": {"params": "name, buffer_size=1024", "init_attrs": "self.name = name\nself.buffer_size = buffer_size"},
339
+ },
340
+ {
341
+ "id": "instance_method",
342
+ "label": "Instance Method",
343
+ "sublabel": "def method(self, ...):",
344
+ "category": "OOP & Classes",
345
+ "icon": "Workflow",
346
+ "iconColor": "text-purple-400",
347
+ "iconBg": "bg-purple-600",
348
+ "borderColor": "border-purple-500/40",
349
+ "nodeType": "alli.oop.method",
350
+ "defaultData": {"method_name": "execute", "params": "payload", "is_property": False, "return_expr": "f'{self.name} processed: {payload}'"},
351
+ },
352
+ {
353
+ "id": "instantiate_obj",
354
+ "label": "Instantiate Object",
355
+ "sublabel": "obj = Class(*args)",
356
+ "category": "OOP & Classes",
357
+ "icon": "Box",
358
+ "iconColor": "text-violet-400",
359
+ "iconBg": "bg-violet-600",
360
+ "borderColor": "border-violet-500/40",
361
+ "nodeType": "alli.oop.instantiate",
362
+ "defaultData": {"var_name": "pipeline", "class_name": "DataPipeline", "args": "'Primary', buffer_size=2048"},
363
  },
364
  ],
365
  },
 
367
  "name": "Data Structures",
368
  "items": [
369
  {
370
+ "id": "list_struct",
371
+ "label": "List / Sequence",
372
+ "sublabel": "list[T] (Ordered & Dynamic)",
373
  "category": "Data Structures",
374
+ "icon": "ListOrdered",
375
+ "iconColor": "text-emerald-400",
376
+ "iconBg": "bg-emerald-600",
377
+ "borderColor": "border-emerald-500/40",
378
+ "nodeType": "alli.ds.list",
379
+ "defaultData": {"var_name": "items_list", "operation": "create", "initial_items": "[10, 20, 30, 40]"},
380
  },
381
  {
382
+ "id": "dict_struct",
383
+ "label": "Dictionary / Map",
384
+ "sublabel": "dict[K, V] (Hash Map)",
385
  "category": "Data Structures",
386
  "icon": "Braces",
387
  "iconColor": "text-rose-400",
388
  "iconBg": "bg-rose-600",
389
  "borderColor": "border-rose-500/40",
390
+ "nodeType": "alli.ds.dict",
391
+ "defaultData": {"var_name": "config_map", "operation": "create", "initial_dict": '{"status": "active", "code": 200}'},
392
+ },
393
+ {
394
+ "id": "tuple_struct",
395
+ "label": "Tuple / Record",
396
+ "sublabel": "(a, b) (Immutable & Unpack)",
397
+ "category": "Data Structures",
398
+ "icon": "Layers",
399
+ "iconColor": "text-indigo-400",
400
+ "iconBg": "bg-indigo-600",
401
+ "borderColor": "border-indigo-500/40",
402
+ "nodeType": "alli.ds.tuple",
403
+ "defaultData": {"var_name": "point_record", "val_a": "100", "val_b": "200"},
404
+ },
405
+ {
406
+ "id": "set_struct",
407
+ "label": "Set / Unique",
408
+ "sublabel": "set{T} (Unique & Algebra)",
409
+ "category": "Data Structures",
410
+ "icon": "Boxes",
411
+ "iconColor": "text-teal-400",
412
+ "iconBg": "bg-teal-600",
413
+ "borderColor": "border-teal-500/40",
414
+ "nodeType": "alli.ds.set",
415
+ "defaultData": {"var_name": "unique_tags", "operation": "create", "initial_set": '{"alpha", "beta", "gamma"}'},
416
+ },
417
+ {
418
+ "id": "comp_struct",
419
+ "label": "Comprehension",
420
+ "sublabel": "[x * 2 for x in seq]",
421
+ "category": "Data Structures",
422
+ "icon": "Sparkles",
423
+ "iconColor": "text-violet-400",
424
+ "iconBg": "bg-violet-600",
425
+ "borderColor": "border-violet-500/40",
426
+ "nodeType": "alli.ds.comprehension",
427
+ "defaultData": {"var_name": "transformed_list", "expr": "x * 2", "iterator": "x", "condition": "x > 0"},
428
+ },
429
+ {
430
+ "id": "stack_queue_struct",
431
+ "label": "Stack & Queue",
432
+ "sublabel": "LIFO / FIFO Buffer",
433
+ "category": "Data Structures",
434
+ "icon": "Layers",
435
+ "iconColor": "text-cyan-400",
436
+ "iconBg": "bg-cyan-600",
437
+ "borderColor": "border-cyan-500/40",
438
+ "nodeType": "alli.ds.stack_queue",
439
+ "defaultData": {"var_name": "data_buffer", "mode": "stack"},
440
+ },
441
+ {
442
+ "id": "sort_search_struct",
443
+ "label": "Sort & Reduction",
444
+ "sublabel": "sorted(seq) / len / min / max",
445
+ "category": "Data Structures",
446
+ "icon": "ArrowUpDown",
447
+ "iconColor": "text-amber-400",
448
+ "iconBg": "bg-amber-600",
449
+ "borderColor": "border-amber-500/40",
450
+ "nodeType": "alli.ds.sort_search",
451
+ "defaultData": {"var_name": "sorted_result", "algo": "sorted", "reverse": False},
452
  },
453
  ],
454
  },
455
  {
456
+ "name": "Exception Handling",
457
  "items": [
458
  {
459
+ "id": "try_block",
460
+ "label": "Try Block",
461
+ "sublabel": "try: (Protected)",
462
+ "category": "Exception Handling",
463
  "icon": "ShieldAlert",
464
+ "iconColor": "text-rose-400",
465
+ "iconBg": "bg-rose-600",
466
+ "borderColor": "border-rose-500/40",
467
+ "nodeType": "alli.exc.try",
468
+ "defaultData": {"description": "Protected operations"},
469
+ },
470
+ {
471
+ "id": "except_handler",
472
+ "label": "Except Handler",
473
+ "sublabel": "except Exception as err:",
474
+ "category": "Exception Handling",
475
+ "icon": "AlertTriangle",
476
  "iconColor": "text-amber-400",
477
  "iconBg": "bg-amber-600",
478
  "borderColor": "border-amber-500/40",
479
+ "nodeType": "alli.exc.except",
480
+ "defaultData": {"exception_class": "Exception", "as_var": "err", "fallback_value": "None"},
481
+ },
482
+ {
483
+ "id": "finally_block",
484
+ "label": "Finally Block",
485
+ "sublabel": "finally: (Cleanup)",
486
+ "category": "Exception Handling",
487
+ "icon": "CheckCircle2",
488
+ "iconColor": "text-slate-400",
489
+ "iconBg": "bg-slate-700",
490
+ "borderColor": "border-slate-600/40",
491
+ "nodeType": "alli.exc.finally",
492
+ "defaultData": {"cleanup_comment": "Guaranteed cleanup"},
493
+ },
494
+ {
495
+ "id": "raise_exc",
496
+ "label": "Raise Exception",
497
+ "sublabel": "raise ValueError(msg)",
498
+ "category": "Exception Handling",
499
+ "icon": "Flame",
500
+ "iconColor": "text-red-400",
501
+ "iconBg": "bg-red-600",
502
+ "borderColor": "border-red-500/40",
503
+ "nodeType": "alli.exc.raise",
504
+ "defaultData": {"exception_class": "ValueError", "message": "Invalid parameter configuration supplied"},
505
+ },
506
+ {
507
+ "id": "assert_stmt",
508
+ "label": "Assertion",
509
+ "sublabel": "assert condition, msg",
510
+ "category": "Exception Handling",
511
+ "icon": "AlertOctagon",
512
+ "iconColor": "text-rose-400",
513
+ "iconBg": "bg-rose-700",
514
+ "borderColor": "border-rose-600/40",
515
+ "nodeType": "alli.exc.assert",
516
+ "defaultData": {"condition": "len(items) > 0", "message": "Items collection must not be empty"},
517
  },
518
  ],
519
  },
520
  {
521
+ "name": "System & Libraries",
522
  "items": [
523
+ {
524
+ "id": "sys_import",
525
+ "label": "Import Module",
526
+ "sublabel": "import math as alias",
527
+ "category": "System & Libraries",
528
+ "icon": "Package",
529
+ "iconColor": "text-cyan-400",
530
+ "iconBg": "bg-cyan-700",
531
+ "borderColor": "border-cyan-600/40",
532
+ "nodeType": "alli.sys.import",
533
+ "defaultData": {"module_name": "math", "alias": "math", "imported_items": ""},
534
+ },
535
+ {
536
+ "id": "file_ops",
537
+ "label": "File Operations",
538
+ "sublabel": "with open(path, mode):",
539
+ "category": "System & Libraries",
540
+ "icon": "FileText",
541
+ "iconColor": "text-emerald-400",
542
+ "iconBg": "bg-emerald-600",
543
+ "borderColor": "border-emerald-500/40",
544
+ "nodeType": "alli.sys.file",
545
+ "defaultData": {"var_name": "file_data", "path": "data.txt", "mode": "r", "operation": "read", "encoding": "utf-8"},
546
+ },
547
+ {
548
+ "id": "env_vars",
549
+ "label": "Environment Variable",
550
+ "sublabel": "os.getenv(key, default)",
551
+ "category": "System & Libraries",
552
+ "icon": "KeyRound",
553
+ "iconColor": "text-slate-300",
554
+ "iconBg": "bg-slate-800",
555
+ "borderColor": "border-slate-700/40",
556
+ "nodeType": "alli.sys.env",
557
+ "defaultData": {"var_name": "api_key", "key": "OPENAI_API_KEY", "default_val": "default_key_mock", "is_secret": True},
558
+ },
559
+ {
560
+ "id": "logging_svc",
561
+ "label": "Logging Service",
562
+ "sublabel": "logging.info(msg)",
563
+ "category": "System & Libraries",
564
+ "icon": "Activity",
565
+ "iconColor": "text-blue-400",
566
+ "iconBg": "bg-blue-600",
567
+ "borderColor": "border-blue-500/40",
568
+ "nodeType": "alli.sys.logging",
569
+ "defaultData": {"level": "INFO", "message": "Processing pipeline step initiated"},
570
+ },
571
  {
572
  "id": "http_request",
573
  "label": "HTTP Request",
574
  "sublabel": "Call REST API Service",
575
+ "category": "System & Libraries",
576
  "icon": "Globe",
577
  "iconColor": "text-cyan-400",
578
  "iconBg": "bg-slate-800",
 
582
  },
583
  ],
584
  },
585
+ {
586
+ "name": "Advanced Execution",
587
+ "items": [
588
+ {
589
+ "id": "async_def",
590
+ "label": "Async Function",
591
+ "sublabel": "async def coroutine():",
592
+ "category": "Advanced Execution",
593
+ "icon": "Radio",
594
+ "iconColor": "text-cyan-400",
595
+ "iconBg": "bg-cyan-600",
596
+ "borderColor": "border-cyan-500/40",
597
+ "nodeType": "alli.async.def",
598
+ "defaultData": {"func_name": "fetch_async_resource", "params": "endpoint", "docstring": "Asynchronously fetches remote resource."},
599
+ },
600
+ {
601
+ "id": "async_await",
602
+ "label": "Await Expression",
603
+ "sublabel": "res = await coro",
604
+ "category": "Advanced Execution",
605
+ "icon": "Timer",
606
+ "iconColor": "text-cyan-300",
607
+ "iconBg": "bg-cyan-700",
608
+ "borderColor": "border-cyan-600/40",
609
+ "nodeType": "alli.async.await",
610
+ "defaultData": {"coroutine_expr": "fetch_async_resource('/api/v1/data')", "target_var": "async_result"},
611
+ },
612
+ {
613
+ "id": "async_task",
614
+ "label": "Async Task",
615
+ "sublabel": "asyncio.create_task()",
616
+ "category": "Advanced Execution",
617
+ "icon": "Sparkles",
618
+ "iconColor": "text-indigo-400",
619
+ "iconBg": "bg-indigo-600",
620
+ "borderColor": "border-indigo-500/40",
621
+ "nodeType": "alli.async.task",
622
+ "defaultData": {"task_var": "bg_task", "task_name": "worker_pipeline", "coroutine_expr": "fetch_async_resource('/stream')"},
623
+ },
624
+ {
625
+ "id": "async_context",
626
+ "label": "Async Context",
627
+ "sublabel": "async with / async for",
628
+ "category": "Advanced Execution",
629
+ "icon": "Workflow",
630
+ "iconColor": "text-teal-400",
631
+ "iconBg": "bg-teal-600",
632
+ "borderColor": "border-teal-500/40",
633
+ "nodeType": "alli.async.context",
634
+ "defaultData": {"statement_type": "async with", "expr": "httpx.AsyncClient()", "var_name": "client"},
635
+ },
636
+ ],
637
+ },
638
+ {
639
+ "name": "Standard Modules & Libraries",
640
+ "items": [
641
+ {
642
+ "id": "module_math",
643
+ "label": "Math Library",
644
+ "sublabel": "math.sqrt, pow, pi, ceil",
645
+ "category": "Standard Modules & Libraries",
646
+ "icon": "Calculator",
647
+ "iconColor": "text-emerald-400",
648
+ "iconBg": "bg-emerald-600",
649
+ "borderColor": "border-emerald-500/40",
650
+ "nodeType": "alli.primitive.math",
651
+ "defaultData": {"func": "sqrt", "x": "16", "y": "2"},
652
+ },
653
+ {
654
+ "id": "module_datetime",
655
+ "label": "Datetime Library",
656
+ "sublabel": "datetime.now, strftime",
657
+ "category": "Standard Modules & Libraries",
658
+ "icon": "Calendar",
659
+ "iconColor": "text-cyan-400",
660
+ "iconBg": "bg-cyan-600",
661
+ "borderColor": "border-cyan-500/40",
662
+ "nodeType": "alli.primitive.datetime",
663
+ "defaultData": {"operation": "strftime", "format_pattern": "%Y-%m-%d %H:%M:%S"},
664
+ },
665
+ {
666
+ "id": "module_random",
667
+ "label": "Random Generator",
668
+ "sublabel": "random.randint, choice",
669
+ "category": "Standard Modules & Libraries",
670
+ "icon": "Dices",
671
+ "iconColor": "text-purple-400",
672
+ "iconBg": "bg-purple-600",
673
+ "borderColor": "border-purple-500/40",
674
+ "nodeType": "alli.primitive.random",
675
+ "defaultData": {"func": "randint", "min_val": "1", "max_val": "100"},
676
+ },
677
+ {
678
+ "id": "module_json",
679
+ "label": "JSON Serialization",
680
+ "sublabel": "json.dumps, loads",
681
+ "category": "Standard Modules & Libraries",
682
+ "icon": "FileJson",
683
+ "iconColor": "text-rose-400",
684
+ "iconBg": "bg-rose-600",
685
+ "borderColor": "border-rose-500/40",
686
+ "nodeType": "alli.primitive.json",
687
+ "defaultData": {"func": "dumps", "indent": 2},
688
+ },
689
+ {
690
+ "id": "module_time",
691
+ "label": "Time & Clock",
692
+ "sublabel": "time.ctime, time, sleep",
693
+ "category": "Standard Modules & Libraries",
694
+ "icon": "Clock",
695
+ "iconColor": "text-amber-400",
696
+ "iconBg": "bg-amber-600",
697
+ "borderColor": "border-amber-500/40",
698
+ "nodeType": "alli.primitive.time",
699
+ "defaultData": {"func": "ctime"},
700
+ },
701
+ ],
702
+ },
703
  ]
704
 
705
  DEFAULT_STARTER_TEMPLATES = [
 
1031
  {"$set": {"key": "python_core_categories", "categories": categories, "updated_at": get_utc_now()}},
1032
  upsert=True
1033
  )
 
1034
  except Exception as e:
1035
  print(f"[ALLI MongoDB] Core specs save error: {e}")
1036
+ return False
1037
+
1038
+ # ─── PYTHON FUNDAMENTALS CATALOG (MONGODB ATLAS) ─────────────────────────
1039
+
1040
+ def get_python_fundamentals(self) -> Dict[str, Any]:
1041
+ """Fetches dynamic Python fundamentals schema from MongoDB Atlas collection 'python_fundamentals' or fallback specs file."""
1042
+ if self.is_connected and self.client is not None:
1043
+ try:
1044
+ col = self.client[self.db_name]["python_fundamentals"]
1045
+ doc = col.find_one({"key": "python_fundamentals_schema"}, {"_id": 0})
1046
+ if doc and "constructs" in doc:
1047
+ return doc
1048
+ except Exception as e:
1049
+ print(f"[ALLI MongoDB] Python fundamentals fetch error: {e}")
1050
+
1051
+ # Fallback to backend specs file
1052
+ spec_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "specs", "python_fundamentals.json")
1053
+ if os.path.exists(spec_path):
1054
+ try:
1055
+ with open(spec_path, "r", encoding="utf-8") as f:
1056
+ return json.load(f)
1057
+ except Exception as e:
1058
+ print(f"[ALLI Specs] Could not read python_fundamentals.json: {e}")
1059
+
1060
+ return {"version": "1.0.0", "constructs": []}
1061
+
1062
+ def save_python_fundamentals(self, data: Dict[str, Any]) -> bool:
1063
+ """Persists Python fundamentals schema into MongoDB Atlas collection 'python_fundamentals'."""
1064
+ if self.is_connected and self.client is not None:
1065
+ try:
1066
+ col = self.client[self.db_name]["python_fundamentals"]
1067
+ col.update_one(
1068
+ {"key": "python_fundamentals_schema"},
1069
+ {"$set": {**data, "key": "python_fundamentals_schema", "updated_at": get_utc_now()}},
1070
+ upsert=True
1071
+ )
1072
+ return True
1073
+ except Exception as e:
1074
+ print(f"[ALLI MongoDB] Python fundamentals save error: {e}")
1075
+ return False
1076
+
1077
  # ─── TEMPLATES CATALOG (MONGODB ATLAS) ───────────────────────────────────
1078
 
1079
  def save_template(self, template_data: Dict[str, Any]) -> str:
main.py CHANGED
@@ -206,6 +206,20 @@ def save_core_specs(payload: CoreSpecsPayload):
206
  return {"success": success, "count": len(payload.categories)}
207
 
208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  @app.get("/packages")
210
  def list_packages():
211
  """Returns extracted library blueprints from MongoDB Atlas + standard library packages."""
 
206
  return {"success": success, "count": len(payload.categories)}
207
 
208
 
209
+ # 1c. Python Fundamentals Catalog (Dynamic Backend Schema)
210
+ @app.get("/python-fundamentals")
211
+ def get_python_fundamentals():
212
+ """Returns the complete specification of Python language fundamentals, syntax, and arguments."""
213
+ return workflow_repo.get_python_fundamentals()
214
+
215
+
216
+ @app.post("/python-fundamentals")
217
+ def save_python_fundamentals(payload: Dict[str, Any]):
218
+ """Persists updated Python fundamentals schema into MongoDB Atlas."""
219
+ success = workflow_repo.save_python_fundamentals(payload)
220
+ return {"success": success}
221
+
222
+
223
  @app.get("/packages")
224
  def list_packages():
225
  """Returns extracted library blueprints from MongoDB Atlas + standard library packages."""
specs/python_fundamentals.json ADDED
@@ -0,0 +1,3283 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "1.0.0",
3
+ "name": "Python Fundamentals Specification",
4
+ "description": "Centralized schema and argument metadata for core Python language constructs in ALLI Studio",
5
+ "constructs": [
6
+ {
7
+ "id": "alli.primitive.print",
8
+ "name": "Print Statement",
9
+ "category": "Input & Output",
10
+ "syntax": "print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)",
11
+ "description": "Prints objects to the text stream file, separated by sep and followed by end. sep, end, file, and flush, if present, must be given as keyword arguments.",
12
+ "doc_url": "https://docs.python.org/3/library/functions.html#print",
13
+ "icon": "Terminal",
14
+ "icon_bg": "bg-cyan-600",
15
+ "border_color": "border-cyan-500/40",
16
+ "inputs": [
17
+ {
18
+ "id": "value",
19
+ "name": "Value (*objects)",
20
+ "type": "Any",
21
+ "color": "blue",
22
+ "description": "Object or variable value to print to stdout / stderr"
23
+ }
24
+ ],
25
+ "outputs": [
26
+ {
27
+ "id": "out",
28
+ "name": "Pass-Through",
29
+ "type": "Any",
30
+ "color": "emerald",
31
+ "description": "Passes the input value through for subsequent node operations in DAG"
32
+ }
33
+ ],
34
+ "default_config": {
35
+ "prefix": "Result:",
36
+ "sep": " ",
37
+ "end": "\\n",
38
+ "file_stream": "stdout",
39
+ "flush": false,
40
+ "format_style": "standard"
41
+ },
42
+ "arguments": [
43
+ {
44
+ "name": "prefix",
45
+ "type": "string",
46
+ "label": "Prefix / Message Label",
47
+ "description": "Optional leading label or title message to output before values",
48
+ "default": "Result:",
49
+ "presets": [
50
+ "",
51
+ "Result:",
52
+ "Output:",
53
+ "[DEBUG]",
54
+ "[INFO]",
55
+ "User:"
56
+ ]
57
+ },
58
+ {
59
+ "name": "sep",
60
+ "type": "string",
61
+ "label": "Separator (sep=' ')",
62
+ "description": "String inserted between values when printing multiple objects (default space)",
63
+ "default": " ",
64
+ "presets": [
65
+ " ",
66
+ ", ",
67
+ " - ",
68
+ " | ",
69
+ "\t",
70
+ "\n",
71
+ ""
72
+ ]
73
+ },
74
+ {
75
+ "name": "end",
76
+ "type": "string",
77
+ "label": "End String (end='\\n')",
78
+ "description": "String appended after the last value (default newline)",
79
+ "default": "\\n",
80
+ "presets": [
81
+ "\\n",
82
+ "",
83
+ " ",
84
+ "\t",
85
+ "\\n\\n"
86
+ ]
87
+ },
88
+ {
89
+ "name": "file_stream",
90
+ "type": "select",
91
+ "label": "Output Stream (file=)",
92
+ "description": "Stream destination: sys.stdout (default console) or sys.stderr (error logging)",
93
+ "default": "stdout",
94
+ "options": [
95
+ {
96
+ "value": "stdout",
97
+ "label": "sys.stdout (Console)"
98
+ },
99
+ {
100
+ "value": "stderr",
101
+ "label": "sys.stderr (Error / Diagnostic)"
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ "name": "flush",
107
+ "type": "boolean",
108
+ "label": "Buffer Flush (flush=)",
109
+ "description": "Whether to forcibly flush the stream buffer immediately (real-time stream)",
110
+ "default": false,
111
+ "options": [
112
+ {
113
+ "value": false,
114
+ "label": "False (Buffered)"
115
+ },
116
+ {
117
+ "value": true,
118
+ "label": "True (Instant Flush)"
119
+ }
120
+ ]
121
+ },
122
+ {
123
+ "name": "format_style",
124
+ "type": "select",
125
+ "label": "Formatting Style",
126
+ "description": "Rendering style: standard print(*args), f-string template, or pprint pretty printing",
127
+ "default": "standard",
128
+ "options": [
129
+ {
130
+ "value": "standard",
131
+ "label": "Standard print(*args)"
132
+ },
133
+ {
134
+ "value": "fstring",
135
+ "label": "f-String print(f\"...\")"
136
+ },
137
+ {
138
+ "value": "pprint",
139
+ "label": "pprint (Pretty-Print)"
140
+ }
141
+ ]
142
+ }
143
+ ],
144
+ "parent_category": "Input & Output",
145
+ "subcategory": "Streams & Consoles",
146
+ "group_id": "io",
147
+ "tags": [
148
+ "print",
149
+ "output",
150
+ "stream"
151
+ ]
152
+ },
153
+ {
154
+ "id": "alli.primitive.variable",
155
+ "name": "Variable",
156
+ "category": "Variables & Types",
157
+ "syntax": "<identifier>: <type_hint> = <value>",
158
+ "description": "Declares and assigns a named Python variable with static type hint.",
159
+ "doc_url": "https://docs.python.org/3/reference/simple_stmts.html#assignment-statements",
160
+ "icon": "Variable",
161
+ "icon_bg": "bg-blue-600",
162
+ "border_color": "border-blue-500/40",
163
+ "inputs": [],
164
+ "outputs": [
165
+ {
166
+ "id": "value",
167
+ "name": "Value",
168
+ "type": "Any",
169
+ "color": "emerald",
170
+ "description": "The assigned variable reference"
171
+ }
172
+ ],
173
+ "default_config": {
174
+ "var_name": "hi",
175
+ "value": "hello",
176
+ "type_hint": "str"
177
+ },
178
+ "arguments": [
179
+ {
180
+ "name": "var_name",
181
+ "type": "string",
182
+ "label": "Variable Identifier",
183
+ "description": "Valid Python variable name (PEP 8 snake_case)",
184
+ "default": "hi"
185
+ },
186
+ {
187
+ "name": "type_hint",
188
+ "type": "select",
189
+ "label": "Data Type Hint",
190
+ "description": "Python static type annotation",
191
+ "default": "str",
192
+ "options": [
193
+ {
194
+ "value": "str",
195
+ "label": "str (String)"
196
+ },
197
+ {
198
+ "value": "int",
199
+ "label": "int (Integer)"
200
+ },
201
+ {
202
+ "value": "float",
203
+ "label": "float (Float)"
204
+ },
205
+ {
206
+ "value": "bool",
207
+ "label": "bool (Boolean)"
208
+ },
209
+ {
210
+ "value": "list",
211
+ "label": "list (List)"
212
+ },
213
+ {
214
+ "value": "dict",
215
+ "label": "dict (Dictionary)"
216
+ },
217
+ {
218
+ "value": "Any",
219
+ "label": "Any (Dynamic)"
220
+ }
221
+ ]
222
+ },
223
+ {
224
+ "name": "value",
225
+ "type": "string",
226
+ "label": "Assigned Value",
227
+ "description": "Initial literal value assigned to the variable",
228
+ "default": "hello"
229
+ }
230
+ ],
231
+ "parent_category": "Variables & Data",
232
+ "subcategory": "Primitives & Scalars",
233
+ "group_id": "variables_data",
234
+ "tags": [
235
+ "variable",
236
+ "constant",
237
+ "data",
238
+ "primitives"
239
+ ]
240
+ },
241
+ {
242
+ "id": "alli.primitive.binary_op",
243
+ "name": "Binary Operation",
244
+ "category": "Arithmetic & Math",
245
+ "syntax": "result = a <operator> b",
246
+ "description": "Applies an arithmetic or binary operator between operands A and B.",
247
+ "doc_url": "https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations",
248
+ "icon": "Binary",
249
+ "icon_bg": "bg-emerald-600",
250
+ "border_color": "border-emerald-500/40",
251
+ "inputs": [
252
+ {
253
+ "id": "a",
254
+ "name": "A",
255
+ "type": "float | int",
256
+ "color": "blue"
257
+ },
258
+ {
259
+ "id": "b",
260
+ "name": "B",
261
+ "type": "float | int",
262
+ "color": "cyan"
263
+ }
264
+ ],
265
+ "outputs": [
266
+ {
267
+ "id": "result",
268
+ "name": "Result",
269
+ "type": "float | int",
270
+ "color": "emerald"
271
+ }
272
+ ],
273
+ "default_config": {
274
+ "operator": "+"
275
+ },
276
+ "arguments": [
277
+ {
278
+ "name": "operator",
279
+ "type": "select",
280
+ "label": "Operator",
281
+ "description": "Arithmetic operation to apply",
282
+ "default": "+",
283
+ "presets": [
284
+ "+",
285
+ "-",
286
+ "*",
287
+ "/",
288
+ "//",
289
+ "%",
290
+ "**"
291
+ ]
292
+ }
293
+ ],
294
+ "parent_category": "Operators & Logic",
295
+ "subcategory": "Arithmetic & Comparison",
296
+ "group_id": "operators_logic",
297
+ "tags": [
298
+ "math",
299
+ "logic",
300
+ "binary",
301
+ "compare"
302
+ ]
303
+ },
304
+ {
305
+ "id": "alli.primitive.compare",
306
+ "name": "Comparison",
307
+ "category": "Control Flow",
308
+ "syntax": "is_valid = (a <operator> b)",
309
+ "description": "Evaluates boolean relationship between values A and B.",
310
+ "doc_url": "https://docs.python.org/3/reference/expressions.html#comparisons",
311
+ "icon": "Scale",
312
+ "icon_bg": "bg-purple-600",
313
+ "border_color": "border-purple-500/40",
314
+ "inputs": [
315
+ {
316
+ "id": "a",
317
+ "name": "Left Operand",
318
+ "type": "Any",
319
+ "color": "blue"
320
+ },
321
+ {
322
+ "id": "b",
323
+ "name": "Right Operand",
324
+ "type": "Any",
325
+ "color": "cyan"
326
+ }
327
+ ],
328
+ "outputs": [
329
+ {
330
+ "id": "result",
331
+ "name": "Boolean",
332
+ "type": "bool",
333
+ "color": "emerald"
334
+ }
335
+ ],
336
+ "default_config": {
337
+ "operator": "=="
338
+ },
339
+ "arguments": [
340
+ {
341
+ "name": "operator",
342
+ "type": "select",
343
+ "label": "Comparison Operator",
344
+ "description": "Relational comparison condition",
345
+ "default": "==",
346
+ "presets": [
347
+ "==",
348
+ "!=",
349
+ ">",
350
+ "<",
351
+ ">=",
352
+ "<="
353
+ ]
354
+ }
355
+ ],
356
+ "parent_category": "Operators & Logic",
357
+ "subcategory": "Arithmetic & Comparison",
358
+ "group_id": "operators_logic",
359
+ "tags": [
360
+ "math",
361
+ "logic",
362
+ "binary",
363
+ "compare"
364
+ ]
365
+ },
366
+ {
367
+ "id": "alli.primitive.if_condition",
368
+ "name": "If / Else Condition",
369
+ "category": "Control Flow",
370
+ "syntax": "if <condition>:\\n true_branch()\\nelse:\\n false_branch()",
371
+ "description": "Branches execution flow based on a boolean expression evaluation.",
372
+ "doc_url": "https://docs.python.org/3/reference/compound_stmts.html#the-if-statement",
373
+ "icon": "GitBranch",
374
+ "icon_bg": "bg-purple-600",
375
+ "border_color": "border-purple-500/40",
376
+ "inputs": [
377
+ {
378
+ "id": "condition",
379
+ "name": "Condition",
380
+ "type": "bool",
381
+ "color": "purple"
382
+ },
383
+ {
384
+ "id": "then_val",
385
+ "name": "If True",
386
+ "type": "Any",
387
+ "color": "emerald"
388
+ },
389
+ {
390
+ "id": "else_val",
391
+ "name": "If False",
392
+ "type": "Any",
393
+ "color": "rose"
394
+ }
395
+ ],
396
+ "outputs": [
397
+ {
398
+ "id": "result",
399
+ "name": "Result",
400
+ "type": "Any",
401
+ "color": "emerald"
402
+ },
403
+ {
404
+ "id": "true",
405
+ "name": "True Branch",
406
+ "type": "bool",
407
+ "color": "emerald"
408
+ },
409
+ {
410
+ "id": "false",
411
+ "name": "False Branch",
412
+ "type": "bool",
413
+ "color": "rose"
414
+ }
415
+ ],
416
+ "default_config": {
417
+ "condition": "True"
418
+ },
419
+ "arguments": [
420
+ {
421
+ "name": "condition",
422
+ "type": "expression",
423
+ "label": "Condition Expression",
424
+ "description": "Python expression evaluated as a boolean predicate",
425
+ "default": "True",
426
+ "presets": [
427
+ "True",
428
+ "False",
429
+ "x > 0",
430
+ "a == b",
431
+ "val >= 18"
432
+ ]
433
+ }
434
+ ],
435
+ "parent_category": "Control Flow",
436
+ "subcategory": "Conditionals",
437
+ "group_id": "control_flow",
438
+ "tags": [
439
+ "condition",
440
+ "branch",
441
+ "if",
442
+ "else"
443
+ ]
444
+ },
445
+ {
446
+ "id": "alli.primitive.constant",
447
+ "name": "Constant",
448
+ "category": "Variables & Types",
449
+ "syntax": "<IDENTIFIER>: Final[<type_hint>] = <value>",
450
+ "description": "Declares an immutable constant value according to PEP 591 typing conventions.",
451
+ "doc_url": "https://peps.python.org/pep-0591/",
452
+ "icon": "Lock",
453
+ "icon_bg": "bg-cyan-600",
454
+ "border_color": "border-cyan-500/40",
455
+ "inputs": [],
456
+ "outputs": [
457
+ {
458
+ "id": "value",
459
+ "name": "Constant Value",
460
+ "type": "Any",
461
+ "color": "cyan",
462
+ "description": "Immutable constant output"
463
+ }
464
+ ],
465
+ "default_config": {
466
+ "var_name": "PI",
467
+ "value": "3.14159",
468
+ "type_hint": "float"
469
+ },
470
+ "arguments": [
471
+ {
472
+ "name": "var_name",
473
+ "type": "string",
474
+ "label": "Constant Name",
475
+ "description": "UPPER_SNAKE_CASE constant identifier",
476
+ "default": "PI",
477
+ "presets": [
478
+ "PI",
479
+ "MAX_RETRIES",
480
+ "TIMEOUT",
481
+ "BASE_URL",
482
+ "DEBUG"
483
+ ]
484
+ },
485
+ {
486
+ "name": "type_hint",
487
+ "type": "select",
488
+ "label": "Constant Type",
489
+ "description": "Data type hint",
490
+ "default": "float",
491
+ "options": [
492
+ {
493
+ "value": "float",
494
+ "label": "float (Float)"
495
+ },
496
+ {
497
+ "value": "int",
498
+ "label": "int (Integer)"
499
+ },
500
+ {
501
+ "value": "str",
502
+ "label": "str (String)"
503
+ },
504
+ {
505
+ "value": "bool",
506
+ "label": "bool (Boolean)"
507
+ }
508
+ ]
509
+ },
510
+ {
511
+ "name": "value",
512
+ "type": "string",
513
+ "label": "Immutable Value",
514
+ "description": "Static constant value",
515
+ "default": "3.14159"
516
+ }
517
+ ],
518
+ "parent_category": "Variables & Data",
519
+ "subcategory": "Primitives & Scalars",
520
+ "group_id": "variables_data",
521
+ "tags": [
522
+ "variable",
523
+ "constant",
524
+ "data",
525
+ "primitives"
526
+ ]
527
+ },
528
+ {
529
+ "id": "alli.primitive.input",
530
+ "name": "Input Prompt",
531
+ "category": "Input & Output",
532
+ "syntax": "user_val = input('<prompt>')",
533
+ "description": "Reads a string line from standard console input with custom prompt message.",
534
+ "doc_url": "https://docs.python.org/3/library/functions.html#input",
535
+ "icon": "TextCursorInput",
536
+ "icon_bg": "bg-emerald-600",
537
+ "border_color": "border-emerald-500/40",
538
+ "inputs": [],
539
+ "outputs": [
540
+ {
541
+ "id": "value",
542
+ "name": "User Input String",
543
+ "type": "str",
544
+ "color": "emerald",
545
+ "description": "Captured user input line"
546
+ }
547
+ ],
548
+ "default_config": {
549
+ "prompt": "Enter value: ",
550
+ "cast_type": "str"
551
+ },
552
+ "arguments": [
553
+ {
554
+ "name": "prompt",
555
+ "type": "string",
556
+ "label": "Prompt Message",
557
+ "description": "Message string displayed to user on stdin",
558
+ "default": "Enter value: ",
559
+ "presets": [
560
+ "Enter value: ",
561
+ "Enter your name: ",
562
+ "Input number: ",
563
+ "Select option: "
564
+ ]
565
+ },
566
+ {
567
+ "name": "cast_type",
568
+ "type": "select",
569
+ "label": "Type Casting",
570
+ "description": "Automatically cast input to desired type",
571
+ "default": "str",
572
+ "options": [
573
+ {
574
+ "value": "str",
575
+ "label": "str (Raw String)"
576
+ },
577
+ {
578
+ "value": "int",
579
+ "label": "int (Integer: int(...))"
580
+ },
581
+ {
582
+ "value": "float",
583
+ "label": "float (Float: float(...))"
584
+ }
585
+ ]
586
+ }
587
+ ],
588
+ "parent_category": "Variables & Data",
589
+ "subcategory": "Primitives & Scalars",
590
+ "group_id": "variables_data",
591
+ "tags": [
592
+ "variable",
593
+ "constant",
594
+ "data",
595
+ "primitives"
596
+ ]
597
+ },
598
+ {
599
+ "id": "alli.primitive.loop",
600
+ "name": "For Loop / Iterator",
601
+ "category": "Control Flow",
602
+ "syntax": "for <item> in range(<count>):\\n body()",
603
+ "description": "Repeats execution sequence across an iterable sequence or range.",
604
+ "doc_url": "https://docs.python.org/3/reference/compound_stmts.html#the-for-statement",
605
+ "icon": "Repeat",
606
+ "icon_bg": "bg-amber-600",
607
+ "border_color": "border-amber-500/40",
608
+ "inputs": [
609
+ {
610
+ "id": "iterable",
611
+ "name": "Iterable / Range",
612
+ "type": "iterable",
613
+ "color": "blue"
614
+ }
615
+ ],
616
+ "outputs": [
617
+ {
618
+ "id": "item",
619
+ "name": "Current Item",
620
+ "type": "Any",
621
+ "color": "amber"
622
+ },
623
+ {
624
+ "id": "done",
625
+ "name": "Loop Complete",
626
+ "type": "bool",
627
+ "color": "emerald"
628
+ }
629
+ ],
630
+ "default_config": {
631
+ "iterator_var": "item",
632
+ "range_count": 5
633
+ },
634
+ "arguments": [
635
+ {
636
+ "name": "iterator_var",
637
+ "type": "string",
638
+ "label": "Iterator Variable",
639
+ "description": "Loop variable bound to each iteration item",
640
+ "default": "item",
641
+ "presets": [
642
+ "item",
643
+ "i",
644
+ "idx",
645
+ "element",
646
+ "num"
647
+ ]
648
+ },
649
+ {
650
+ "name": "range_count",
651
+ "type": "string",
652
+ "label": "Range Count or Sequence",
653
+ "description": "Iteration count range(N) or iterable variable expression",
654
+ "default": "5",
655
+ "presets": [
656
+ "5",
657
+ "10",
658
+ "100",
659
+ "items",
660
+ "data"
661
+ ]
662
+ }
663
+ ],
664
+ "parent_category": "Loops & Iteration",
665
+ "subcategory": "Iterators",
666
+ "group_id": "loops",
667
+ "tags": [
668
+ "loop",
669
+ "for",
670
+ "iteration"
671
+ ]
672
+ },
673
+ {
674
+ "id": "alli.primitive.math",
675
+ "name": "Math Functions (math)",
676
+ "category": "Standard Library",
677
+ "syntax": "import math\nresult = math.sqrt(x)",
678
+ "description": "Access standard mathematical functions including sqrt, pow, floor, ceil, pi, factorial, sin, cos, and gcd.",
679
+ "doc_url": "https://docs.python.org/3/library/math.html",
680
+ "icon": "Calculator",
681
+ "icon_bg": "bg-emerald-600",
682
+ "border_color": "border-emerald-500/40",
683
+ "inputs": [
684
+ {
685
+ "id": "x",
686
+ "name": "Operand X",
687
+ "type": "float",
688
+ "color": "blue",
689
+ "description": "Primary numeric operand"
690
+ },
691
+ {
692
+ "id": "y",
693
+ "name": "Operand Y",
694
+ "type": "float",
695
+ "color": "blue",
696
+ "description": "Secondary operand (for pow, gcd)"
697
+ }
698
+ ],
699
+ "outputs": [
700
+ {
701
+ "id": "result",
702
+ "name": "Math Result",
703
+ "type": "float",
704
+ "color": "emerald",
705
+ "description": "Calculated mathematical result"
706
+ }
707
+ ],
708
+ "default_config": {
709
+ "func": "sqrt",
710
+ "x": "16",
711
+ "y": "2"
712
+ },
713
+ "arguments": [
714
+ {
715
+ "name": "func",
716
+ "type": "select",
717
+ "label": "Math Operation",
718
+ "description": "Mathematical function to compute",
719
+ "default": "sqrt",
720
+ "options": [
721
+ {
722
+ "value": "sqrt",
723
+ "label": "math.sqrt(x) - Square Root"
724
+ },
725
+ {
726
+ "value": "pow",
727
+ "label": "math.pow(x, y) - Power (x^y)"
728
+ },
729
+ {
730
+ "value": "floor",
731
+ "label": "math.floor(x) - Floor Integer"
732
+ },
733
+ {
734
+ "value": "ceil",
735
+ "label": "math.ceil(x) - Ceiling Integer"
736
+ },
737
+ {
738
+ "value": "pi",
739
+ "label": "math.pi - Constant Pi"
740
+ },
741
+ {
742
+ "value": "factorial",
743
+ "label": "math.factorial(x) - Factorial"
744
+ },
745
+ {
746
+ "value": "sin",
747
+ "label": "math.sin(x) - Sine (radians)"
748
+ },
749
+ {
750
+ "value": "cos",
751
+ "label": "math.cos(x) - Cosine (radians)"
752
+ },
753
+ {
754
+ "value": "gcd",
755
+ "label": "math.gcd(x, y) - Greatest Common Divisor"
756
+ }
757
+ ]
758
+ },
759
+ {
760
+ "name": "x",
761
+ "type": "string",
762
+ "label": "Operand X",
763
+ "description": "Primary numeric value or input variable",
764
+ "default": "16",
765
+ "presets": [
766
+ "16",
767
+ "25",
768
+ "100",
769
+ "3.14159",
770
+ "0"
771
+ ]
772
+ },
773
+ {
774
+ "name": "y",
775
+ "type": "string",
776
+ "label": "Operand Y (for pow/gcd)",
777
+ "description": "Secondary numeric operand for 2-parameter functions",
778
+ "default": "2",
779
+ "presets": [
780
+ "2",
781
+ "3",
782
+ "10",
783
+ "4"
784
+ ]
785
+ }
786
+ ],
787
+ "parent_category": "Standard Library",
788
+ "subcategory": "Utilities",
789
+ "group_id": "stdlib",
790
+ "tags": [
791
+ "module",
792
+ "stdlib"
793
+ ]
794
+ },
795
+ {
796
+ "id": "alli.primitive.datetime",
797
+ "name": "Date & Time (datetime)",
798
+ "category": "Standard Library",
799
+ "syntax": "from datetime import datetime\nnow_str = datetime.now().strftime(format)",
800
+ "description": "Date and time manipulation functions: datetime.now(), date.today(), strftime, and timestamp.",
801
+ "doc_url": "https://docs.python.org/3/library/datetime.html",
802
+ "icon": "Calendar",
803
+ "icon_bg": "bg-cyan-600",
804
+ "border_color": "border-cyan-500/40",
805
+ "inputs": [
806
+ {
807
+ "id": "format",
808
+ "name": "Format Pattern",
809
+ "type": "str",
810
+ "color": "blue",
811
+ "description": "strftime pattern string"
812
+ }
813
+ ],
814
+ "outputs": [
815
+ {
816
+ "id": "result",
817
+ "name": "Date/Time Value",
818
+ "type": "str",
819
+ "color": "cyan",
820
+ "description": "Formatted date/time string or timestamp"
821
+ }
822
+ ],
823
+ "default_config": {
824
+ "operation": "strftime",
825
+ "format_pattern": "%Y-%m-%d %H:%M:%S"
826
+ },
827
+ "arguments": [
828
+ {
829
+ "name": "operation",
830
+ "type": "select",
831
+ "label": "Datetime Operation",
832
+ "description": "Datetime function or format",
833
+ "default": "strftime",
834
+ "options": [
835
+ {
836
+ "value": "strftime",
837
+ "label": "datetime.now().strftime(pattern) - Formatted String"
838
+ },
839
+ {
840
+ "value": "now",
841
+ "label": "datetime.now() - Current Datetime"
842
+ },
843
+ {
844
+ "value": "today",
845
+ "label": "date.today() - Current Calendar Date"
846
+ },
847
+ {
848
+ "value": "timestamp",
849
+ "label": "datetime.now().timestamp() - Epoch Float"
850
+ },
851
+ {
852
+ "value": "isoformat",
853
+ "label": "datetime.now().isoformat() - ISO 8601 String"
854
+ }
855
+ ]
856
+ },
857
+ {
858
+ "name": "format_pattern",
859
+ "type": "string",
860
+ "label": "Format Pattern",
861
+ "description": "strftime date/time pattern string",
862
+ "default": "%Y-%m-%d %H:%M:%S",
863
+ "presets": [
864
+ "%Y-%m-%d %H:%M:%S",
865
+ "%Y-%m-%d",
866
+ "%H:%M:%S",
867
+ "%A, %B %d, %Y"
868
+ ]
869
+ }
870
+ ],
871
+ "parent_category": "Standard Library",
872
+ "subcategory": "Utilities",
873
+ "group_id": "stdlib",
874
+ "tags": [
875
+ "module",
876
+ "stdlib"
877
+ ]
878
+ },
879
+ {
880
+ "id": "alli.primitive.random",
881
+ "name": "Random Generator (random)",
882
+ "category": "Standard Library",
883
+ "syntax": "import random\nval = random.randint(min, max)",
884
+ "description": "Generates pseudo-random numbers and items: randint(a, b), random(), uniform(a, b), choice(seq).",
885
+ "doc_url": "https://docs.python.org/3/library/random.html",
886
+ "icon": "Dices",
887
+ "icon_bg": "bg-purple-600",
888
+ "border_color": "border-purple-500/40",
889
+ "inputs": [
890
+ {
891
+ "id": "min_val",
892
+ "name": "Min Bound",
893
+ "type": "int",
894
+ "color": "blue",
895
+ "description": "Minimum integer value"
896
+ },
897
+ {
898
+ "id": "max_val",
899
+ "name": "Max Bound",
900
+ "type": "int",
901
+ "color": "blue",
902
+ "description": "Maximum integer value"
903
+ }
904
+ ],
905
+ "outputs": [
906
+ {
907
+ "id": "result",
908
+ "name": "Random Result",
909
+ "type": "int",
910
+ "color": "purple",
911
+ "description": "Generated random value"
912
+ }
913
+ ],
914
+ "default_config": {
915
+ "func": "randint",
916
+ "min_val": "1",
917
+ "max_val": "100"
918
+ },
919
+ "arguments": [
920
+ {
921
+ "name": "func",
922
+ "type": "select",
923
+ "label": "Random Function",
924
+ "description": "Random distribution method",
925
+ "default": "randint",
926
+ "options": [
927
+ {
928
+ "value": "randint",
929
+ "label": "random.randint(a, b) - Random Integer [a, b]"
930
+ },
931
+ {
932
+ "value": "random",
933
+ "label": "random.random() - Random Float [0.0, 1.0)"
934
+ },
935
+ {
936
+ "value": "uniform",
937
+ "label": "random.uniform(a, b) - Random Float in [a, b]"
938
+ },
939
+ {
940
+ "value": "choice",
941
+ "label": "random.choice(seq) - Random Item from List"
942
+ }
943
+ ]
944
+ },
945
+ {
946
+ "name": "min_val",
947
+ "type": "string",
948
+ "label": "Min Bound (a)",
949
+ "description": "Lower bound integer or sequence",
950
+ "default": "1",
951
+ "presets": [
952
+ "1",
953
+ "0",
954
+ "10",
955
+ "100"
956
+ ]
957
+ },
958
+ {
959
+ "name": "max_val",
960
+ "type": "string",
961
+ "label": "Max Bound (b)",
962
+ "description": "Upper bound integer",
963
+ "default": "100",
964
+ "presets": [
965
+ "10",
966
+ "50",
967
+ "100",
968
+ "1000"
969
+ ]
970
+ }
971
+ ],
972
+ "parent_category": "Standard Library",
973
+ "subcategory": "Utilities",
974
+ "group_id": "stdlib",
975
+ "tags": [
976
+ "module",
977
+ "stdlib"
978
+ ]
979
+ },
980
+ {
981
+ "id": "alli.primitive.json",
982
+ "name": "JSON Serialization (json)",
983
+ "category": "Standard Library",
984
+ "syntax": "import json\noutput = json.dumps(data, indent=2)",
985
+ "description": "JSON encoder and decoder: json.dumps(obj) and json.loads(string).",
986
+ "doc_url": "https://docs.python.org/3/library/json.html",
987
+ "icon": "FileJson",
988
+ "icon_bg": "bg-rose-600",
989
+ "border_color": "border-rose-500/40",
990
+ "inputs": [
991
+ {
992
+ "id": "data",
993
+ "name": "Input Data",
994
+ "type": "Any",
995
+ "color": "blue",
996
+ "description": "Python object or JSON string"
997
+ }
998
+ ],
999
+ "outputs": [
1000
+ {
1001
+ "id": "result",
1002
+ "name": "JSON Result",
1003
+ "type": "str",
1004
+ "color": "rose",
1005
+ "description": "Serialized JSON string or parsed dict"
1006
+ }
1007
+ ],
1008
+ "default_config": {
1009
+ "func": "dumps",
1010
+ "indent": 2
1011
+ },
1012
+ "arguments": [
1013
+ {
1014
+ "name": "func",
1015
+ "type": "select",
1016
+ "label": "JSON Operation",
1017
+ "description": "Serialize to string or parse from string",
1018
+ "default": "dumps",
1019
+ "options": [
1020
+ {
1021
+ "value": "dumps",
1022
+ "label": "json.dumps(obj) - Serialize Object to JSON"
1023
+ },
1024
+ {
1025
+ "value": "loads",
1026
+ "label": "json.loads(str) - Parse JSON String to Object"
1027
+ }
1028
+ ]
1029
+ },
1030
+ {
1031
+ "name": "indent",
1032
+ "type": "select",
1033
+ "label": "Indentation (indent=)",
1034
+ "description": "Indentation spacing for pretty-printing JSON",
1035
+ "default": 2,
1036
+ "options": [
1037
+ {
1038
+ "value": 0,
1039
+ "label": "Compact (indent=0)"
1040
+ },
1041
+ {
1042
+ "value": 2,
1043
+ "label": "2 Spaces (Standard)"
1044
+ },
1045
+ {
1046
+ "value": 4,
1047
+ "label": "4 Spaces (Readable)"
1048
+ }
1049
+ ]
1050
+ }
1051
+ ],
1052
+ "parent_category": "Standard Library",
1053
+ "subcategory": "Utilities",
1054
+ "group_id": "stdlib",
1055
+ "tags": [
1056
+ "module",
1057
+ "stdlib"
1058
+ ]
1059
+ },
1060
+ {
1061
+ "id": "alli.primitive.time",
1062
+ "name": "Time & Clocks (time)",
1063
+ "category": "Standard Library",
1064
+ "syntax": "import time\ncurrent = time.ctime()",
1065
+ "description": "Provides time-related functions: time.time(), time.ctime(), and time.sleep().",
1066
+ "doc_url": "https://docs.python.org/3/library/time.html",
1067
+ "icon": "Clock",
1068
+ "icon_bg": "bg-amber-600",
1069
+ "border_color": "border-amber-500/40",
1070
+ "inputs": [],
1071
+ "outputs": [
1072
+ {
1073
+ "id": "result",
1074
+ "name": "Time Output",
1075
+ "type": "str",
1076
+ "color": "amber",
1077
+ "description": "Epoch float or formatted time string"
1078
+ }
1079
+ ],
1080
+ "default_config": {
1081
+ "func": "ctime"
1082
+ },
1083
+ "arguments": [
1084
+ {
1085
+ "name": "func",
1086
+ "type": "select",
1087
+ "label": "Time Function",
1088
+ "description": "Clock or sleep function",
1089
+ "default": "ctime",
1090
+ "options": [
1091
+ {
1092
+ "value": "ctime",
1093
+ "label": "time.ctime() - Human Readable Time"
1094
+ },
1095
+ {
1096
+ "value": "time",
1097
+ "label": "time.time() - Seconds Since Epoch"
1098
+ },
1099
+ {
1100
+ "value": "sleep",
1101
+ "label": "time.sleep(1) - Pause Execution 1s"
1102
+ }
1103
+ ]
1104
+ }
1105
+ ],
1106
+ "parent_category": "Standard Library",
1107
+ "subcategory": "Utilities",
1108
+ "group_id": "stdlib",
1109
+ "tags": [
1110
+ "module",
1111
+ "stdlib"
1112
+ ]
1113
+ },
1114
+ {
1115
+ "id": "alli.ds.list",
1116
+ "name": "List / Sequence",
1117
+ "category": "Data Structures",
1118
+ "parent_category": "Variables & Data",
1119
+ "subcategory": "Collections & Sequences",
1120
+ "group_id": "data_structures",
1121
+ "tags": [
1122
+ "list",
1123
+ "array",
1124
+ "sequence",
1125
+ "collections",
1126
+ "data_structures"
1127
+ ],
1128
+ "syntax": "my_list = [items]\nmy_list.append(x)\nitem = my_list[idx]",
1129
+ "description": "Ordered mutable sequence. Supports creation, indexing, slicing, appending, and popping.",
1130
+ "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#more-on-lists",
1131
+ "icon": "ListOrdered",
1132
+ "icon_bg": "bg-emerald-600",
1133
+ "border_color": "border-emerald-500/40",
1134
+ "inputs": [
1135
+ {
1136
+ "id": "items",
1137
+ "name": "Elements (*items)",
1138
+ "type": "Any",
1139
+ "color": "emerald",
1140
+ "description": "Element(s) to pack into list or append"
1141
+ },
1142
+ {
1143
+ "id": "index",
1144
+ "name": "Index / Slice",
1145
+ "type": "int",
1146
+ "color": "blue",
1147
+ "description": "Optional index or slice bound for extraction"
1148
+ }
1149
+ ],
1150
+ "outputs": [
1151
+ {
1152
+ "id": "out",
1153
+ "name": "List [T]",
1154
+ "type": "list",
1155
+ "color": "emerald",
1156
+ "description": "Resulting Python list"
1157
+ },
1158
+ {
1159
+ "id": "item",
1160
+ "name": "Extracted Item",
1161
+ "type": "Any",
1162
+ "color": "cyan",
1163
+ "description": "Extracted element if indexing"
1164
+ }
1165
+ ],
1166
+ "default_config": {
1167
+ "var_name": "items_list",
1168
+ "operation": "create",
1169
+ "initial_items": "[10, 20, 30, 40]"
1170
+ },
1171
+ "arguments": [
1172
+ {
1173
+ "name": "operation",
1174
+ "type": "select",
1175
+ "label": "List Operation",
1176
+ "description": "Choose creation, append, slice, or pop",
1177
+ "default": "create",
1178
+ "options": [
1179
+ {
1180
+ "value": "create",
1181
+ "label": "Create [elements]"
1182
+ },
1183
+ {
1184
+ "value": "append",
1185
+ "label": ".append(item)"
1186
+ },
1187
+ {
1188
+ "value": "slice",
1189
+ "label": "Slice [start:stop]"
1190
+ },
1191
+ {
1192
+ "value": "pop",
1193
+ "label": ".pop(index)"
1194
+ }
1195
+ ]
1196
+ },
1197
+ {
1198
+ "name": "var_name",
1199
+ "type": "string",
1200
+ "label": "List Variable Name",
1201
+ "description": "Variable name for the list",
1202
+ "default": "items_list"
1203
+ },
1204
+ {
1205
+ "name": "initial_items",
1206
+ "type": "string",
1207
+ "label": "Initial Elements / Literal",
1208
+ "description": "Literal list representation",
1209
+ "default": "[10, 20, 30, 40]"
1210
+ }
1211
+ ]
1212
+ },
1213
+ {
1214
+ "id": "alli.ds.dict",
1215
+ "name": "Dictionary / Map",
1216
+ "category": "Data Structures",
1217
+ "parent_category": "Variables & Data",
1218
+ "subcategory": "Key-Value Mappings",
1219
+ "group_id": "data_structures",
1220
+ "tags": [
1221
+ "dict",
1222
+ "map",
1223
+ "json",
1224
+ "hashmap",
1225
+ "collections",
1226
+ "data_structures"
1227
+ ],
1228
+ "syntax": "user = {'id': 101, 'name': 'Alice'}\nval = user.get('key', default)",
1229
+ "description": "Key-value hash table mapping. Supports safe lookups, key assignment, and view extraction.",
1230
+ "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#dictionaries",
1231
+ "icon": "Braces",
1232
+ "icon_bg": "bg-rose-600",
1233
+ "border_color": "border-rose-500/40",
1234
+ "inputs": [
1235
+ {
1236
+ "id": "key",
1237
+ "name": "Key",
1238
+ "type": "str",
1239
+ "color": "rose",
1240
+ "description": "Key identifier to insert or look up"
1241
+ },
1242
+ {
1243
+ "id": "value",
1244
+ "name": "Value",
1245
+ "type": "Any",
1246
+ "color": "blue",
1247
+ "description": "Value to assign to key"
1248
+ },
1249
+ {
1250
+ "id": "default",
1251
+ "name": "Default Fallback",
1252
+ "type": "Any",
1253
+ "color": "amber",
1254
+ "description": "Fallback value for safe .get() lookup"
1255
+ }
1256
+ ],
1257
+ "outputs": [
1258
+ {
1259
+ "id": "out",
1260
+ "name": "Dict [K, V]",
1261
+ "type": "dict",
1262
+ "color": "rose",
1263
+ "description": "The dictionary object"
1264
+ },
1265
+ {
1266
+ "id": "val_out",
1267
+ "name": "Retrieved Value",
1268
+ "type": "Any",
1269
+ "color": "cyan",
1270
+ "description": "Value returned from key query"
1271
+ },
1272
+ {
1273
+ "id": "keys",
1274
+ "name": "Keys List",
1275
+ "type": "list",
1276
+ "color": "purple",
1277
+ "description": "list(dict.keys())"
1278
+ }
1279
+ ],
1280
+ "default_config": {
1281
+ "var_name": "config_map",
1282
+ "operation": "create",
1283
+ "query_key": "status",
1284
+ "initial_dict": "{\"status\": \"active\", \"code\": 200, \"region\": \"us-east\"}"
1285
+ },
1286
+ "arguments": [
1287
+ {
1288
+ "name": "operation",
1289
+ "type": "select",
1290
+ "label": "Dictionary Action",
1291
+ "description": "Choose creation, get query, or set key",
1292
+ "default": "create",
1293
+ "options": [
1294
+ {
1295
+ "value": "create",
1296
+ "label": "Create {key: value}"
1297
+ },
1298
+ {
1299
+ "value": "get",
1300
+ "label": "Safe .get(key, default)"
1301
+ },
1302
+ {
1303
+ "value": "set",
1304
+ "label": "Set dict[key] = value"
1305
+ },
1306
+ {
1307
+ "value": "keys",
1308
+ "label": "Get Keys list(d.keys())"
1309
+ }
1310
+ ]
1311
+ },
1312
+ {
1313
+ "name": "var_name",
1314
+ "type": "string",
1315
+ "label": "Dict Variable Name",
1316
+ "description": "Identifier name",
1317
+ "default": "config_map"
1318
+ },
1319
+ {
1320
+ "name": "query_key",
1321
+ "type": "string",
1322
+ "label": "Target Key",
1323
+ "description": "Key name for queries or updates",
1324
+ "default": "status"
1325
+ }
1326
+ ]
1327
+ },
1328
+ {
1329
+ "id": "alli.ds.tuple",
1330
+ "name": "Tuple / Record",
1331
+ "category": "Data Structures",
1332
+ "parent_category": "Variables & Data",
1333
+ "subcategory": "Collections & Sequences",
1334
+ "group_id": "data_structures",
1335
+ "tags": [
1336
+ "tuple",
1337
+ "record",
1338
+ "immutable",
1339
+ "unpack",
1340
+ "data_structures"
1341
+ ],
1342
+ "syntax": "coords = (10, 20)\nx, y = coords",
1343
+ "description": "Immutable ordered sequence. Supports creation and multi-variable parallel unpacking.",
1344
+ "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences",
1345
+ "icon": "Layers",
1346
+ "icon_bg": "bg-indigo-600",
1347
+ "border_color": "border-indigo-500/40",
1348
+ "inputs": [
1349
+ {
1350
+ "id": "a",
1351
+ "name": "Item A",
1352
+ "type": "Any",
1353
+ "color": "blue",
1354
+ "description": "First element"
1355
+ },
1356
+ {
1357
+ "id": "b",
1358
+ "name": "Item B",
1359
+ "type": "Any",
1360
+ "color": "purple",
1361
+ "description": "Second element"
1362
+ }
1363
+ ],
1364
+ "outputs": [
1365
+ {
1366
+ "id": "out",
1367
+ "name": "Tuple",
1368
+ "type": "tuple",
1369
+ "color": "indigo",
1370
+ "description": "The packed tuple record"
1371
+ },
1372
+ {
1373
+ "id": "unpacked_a",
1374
+ "name": "Unpacked A",
1375
+ "type": "Any",
1376
+ "color": "blue",
1377
+ "description": "Unpacked first element"
1378
+ },
1379
+ {
1380
+ "id": "unpacked_b",
1381
+ "name": "Unpacked B",
1382
+ "type": "Any",
1383
+ "color": "purple",
1384
+ "description": "Unpacked second element"
1385
+ }
1386
+ ],
1387
+ "default_config": {
1388
+ "var_name": "point_record",
1389
+ "val_a": "100",
1390
+ "val_b": "200"
1391
+ },
1392
+ "arguments": [
1393
+ {
1394
+ "name": "var_name",
1395
+ "type": "string",
1396
+ "label": "Tuple Variable Name",
1397
+ "description": "Name for the tuple",
1398
+ "default": "point_record"
1399
+ }
1400
+ ]
1401
+ },
1402
+ {
1403
+ "id": "alli.ds.set",
1404
+ "name": "Set / Unique",
1405
+ "category": "Data Structures",
1406
+ "parent_category": "Variables & Data",
1407
+ "subcategory": "Sets & Uniques",
1408
+ "group_id": "data_structures",
1409
+ "tags": [
1410
+ "set",
1411
+ "unique",
1412
+ "union",
1413
+ "intersection",
1414
+ "data_structures"
1415
+ ],
1416
+ "syntax": "tags = {'python', 'ai'}\ntags.add('cloud')\ns1 | s2",
1417
+ "description": "Unordered collection of unique items. Supports deduplication and mathematical set algebra.",
1418
+ "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#sets",
1419
+ "icon": "Boxes",
1420
+ "icon_bg": "bg-teal-600",
1421
+ "border_color": "border-teal-500/40",
1422
+ "inputs": [
1423
+ {
1424
+ "id": "item",
1425
+ "name": "Element",
1426
+ "type": "Any",
1427
+ "color": "teal",
1428
+ "description": "Item to add or test membership"
1429
+ },
1430
+ {
1431
+ "id": "other_set",
1432
+ "name": "Second Set",
1433
+ "type": "set",
1434
+ "color": "teal",
1435
+ "description": "Set for union or intersection"
1436
+ }
1437
+ ],
1438
+ "outputs": [
1439
+ {
1440
+ "id": "out",
1441
+ "name": "Set [T]",
1442
+ "type": "set",
1443
+ "color": "teal",
1444
+ "description": "Resulting set"
1445
+ },
1446
+ {
1447
+ "id": "is_member",
1448
+ "name": "In Set (bool)",
1449
+ "type": "bool",
1450
+ "color": "cyan",
1451
+ "description": "True if element exists in set"
1452
+ }
1453
+ ],
1454
+ "default_config": {
1455
+ "var_name": "unique_tags",
1456
+ "operation": "create",
1457
+ "initial_set": "{\"alpha\", \"beta\", \"gamma\"}"
1458
+ },
1459
+ "arguments": [
1460
+ {
1461
+ "name": "operation",
1462
+ "type": "select",
1463
+ "label": "Set Operation",
1464
+ "description": "Action to perform",
1465
+ "default": "create",
1466
+ "options": [
1467
+ {
1468
+ "value": "create",
1469
+ "label": "Create {unique items}"
1470
+ },
1471
+ {
1472
+ "value": "add",
1473
+ "label": "Add element: .add(x)"
1474
+ },
1475
+ {
1476
+ "value": "union",
1477
+ "label": "Union: s1 | s2"
1478
+ },
1479
+ {
1480
+ "value": "intersection",
1481
+ "label": "Intersection: s1 & s2"
1482
+ }
1483
+ ]
1484
+ },
1485
+ {
1486
+ "name": "var_name",
1487
+ "type": "string",
1488
+ "label": "Set Variable Name",
1489
+ "description": "Variable name",
1490
+ "default": "unique_tags"
1491
+ }
1492
+ ]
1493
+ },
1494
+ {
1495
+ "id": "alli.ds.comprehension",
1496
+ "name": "Comprehension",
1497
+ "category": "Data Structures",
1498
+ "parent_category": "Variables & Data",
1499
+ "subcategory": "Comprehensions",
1500
+ "group_id": "data_structures",
1501
+ "tags": [
1502
+ "comprehension",
1503
+ "vectorize",
1504
+ "map",
1505
+ "filter",
1506
+ "data_structures"
1507
+ ],
1508
+ "syntax": "doubles = [x * 2 for x in numbers if x > 0]",
1509
+ "description": "High-performance Pythonic sequence transformation and filtering.",
1510
+ "doc_url": "https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions",
1511
+ "icon": "Sparkles",
1512
+ "icon_bg": "bg-violet-600",
1513
+ "border_color": "border-violet-500/40",
1514
+ "inputs": [
1515
+ {
1516
+ "id": "iterable",
1517
+ "name": "Source Iterable",
1518
+ "type": "Iterable",
1519
+ "color": "emerald",
1520
+ "description": "Input collection to iterate across"
1521
+ }
1522
+ ],
1523
+ "outputs": [
1524
+ {
1525
+ "id": "out",
1526
+ "name": "Transformed List",
1527
+ "type": "list",
1528
+ "color": "violet",
1529
+ "description": "Generated list after comprehension"
1530
+ }
1531
+ ],
1532
+ "default_config": {
1533
+ "var_name": "transformed_list",
1534
+ "expr": "x * 2",
1535
+ "iterator": "x",
1536
+ "condition": "x > 0"
1537
+ },
1538
+ "arguments": [
1539
+ {
1540
+ "name": "var_name",
1541
+ "type": "string",
1542
+ "label": "Result Variable",
1543
+ "description": "Target variable name",
1544
+ "default": "transformed_list"
1545
+ },
1546
+ {
1547
+ "name": "expr",
1548
+ "type": "string",
1549
+ "label": "Transform Expression",
1550
+ "description": "Expression applied to each item",
1551
+ "default": "x * 2"
1552
+ },
1553
+ {
1554
+ "name": "iterator",
1555
+ "type": "string",
1556
+ "label": "Loop Item Name",
1557
+ "description": "Iteration variable",
1558
+ "default": "x"
1559
+ },
1560
+ {
1561
+ "name": "condition",
1562
+ "type": "string",
1563
+ "label": "Filter Condition (if)",
1564
+ "description": "Optional condition to keep item",
1565
+ "default": "x > 0"
1566
+ }
1567
+ ]
1568
+ },
1569
+ {
1570
+ "id": "alli.ds.stack_queue",
1571
+ "name": "Stack / Queue",
1572
+ "category": "Data Structures",
1573
+ "parent_category": "Variables & Data",
1574
+ "subcategory": "Abstract Structures",
1575
+ "group_id": "data_structures",
1576
+ "tags": [
1577
+ "stack",
1578
+ "queue",
1579
+ "deque",
1580
+ "lifo",
1581
+ "fifo",
1582
+ "data_structures"
1583
+ ],
1584
+ "syntax": "stack.append(x); val = stack.pop()\nfrom collections import deque\nq = deque(); q.append(x); val = q.popleft()",
1585
+ "description": "Abstract linear data structures: Stack (LIFO) and Queue (FIFO).",
1586
+ "doc_url": "https://docs.python.org/3/library/collections.html#collections.deque",
1587
+ "icon": "Stack",
1588
+ "icon_bg": "bg-cyan-600",
1589
+ "border_color": "border-cyan-500/40",
1590
+ "inputs": [
1591
+ {
1592
+ "id": "item",
1593
+ "name": "Item (Push/Enqueue)",
1594
+ "type": "Any",
1595
+ "color": "cyan",
1596
+ "description": "Element to push or enqueue"
1597
+ }
1598
+ ],
1599
+ "outputs": [
1600
+ {
1601
+ "id": "out",
1602
+ "name": "Collection",
1603
+ "type": "Any",
1604
+ "color": "cyan",
1605
+ "description": "Stack list or deque instance"
1606
+ },
1607
+ {
1608
+ "id": "popped",
1609
+ "name": "Popped Item",
1610
+ "type": "Any",
1611
+ "color": "emerald",
1612
+ "description": "Element extracted from front or top"
1613
+ }
1614
+ ],
1615
+ "default_config": {
1616
+ "mode": "stack",
1617
+ "var_name": "data_buffer"
1618
+ },
1619
+ "arguments": [
1620
+ {
1621
+ "name": "mode",
1622
+ "type": "select",
1623
+ "label": "Structure Type",
1624
+ "description": "Stack (LIFO) or Queue (FIFO)",
1625
+ "default": "stack",
1626
+ "options": [
1627
+ {
1628
+ "value": "stack",
1629
+ "label": "Stack (LIFO - append/pop)"
1630
+ },
1631
+ {
1632
+ "value": "queue",
1633
+ "label": "Queue (FIFO - append/popleft)"
1634
+ }
1635
+ ]
1636
+ },
1637
+ {
1638
+ "name": "var_name",
1639
+ "type": "string",
1640
+ "label": "Buffer Variable",
1641
+ "description": "Name for buffer",
1642
+ "default": "data_buffer"
1643
+ }
1644
+ ]
1645
+ },
1646
+ {
1647
+ "id": "alli.ds.sort_search",
1648
+ "name": "Sort & Reduction",
1649
+ "category": "Data Structures",
1650
+ "parent_category": "Variables & Data",
1651
+ "subcategory": "Algorithms & Reductions",
1652
+ "group_id": "data_structures",
1653
+ "tags": [
1654
+ "sort",
1655
+ "search",
1656
+ "len",
1657
+ "min",
1658
+ "max",
1659
+ "sum",
1660
+ "data_structures"
1661
+ ],
1662
+ "syntax": "sorted_items = sorted(data, reverse=False)\ncount = len(data)",
1663
+ "description": "Standard sorting and aggregation reductions across any collection.",
1664
+ "doc_url": "https://docs.python.org/3/library/functions.html#sorted",
1665
+ "icon": "ArrowUpDown",
1666
+ "icon_bg": "bg-amber-600",
1667
+ "border_color": "border-amber-500/40",
1668
+ "inputs": [
1669
+ {
1670
+ "id": "collection",
1671
+ "name": "Collection",
1672
+ "type": "Iterable",
1673
+ "color": "amber",
1674
+ "description": "Collection to sort or reduce"
1675
+ }
1676
+ ],
1677
+ "outputs": [
1678
+ {
1679
+ "id": "out",
1680
+ "name": "Result",
1681
+ "type": "Any",
1682
+ "color": "amber",
1683
+ "description": "Sorted list or aggregated scalar"
1684
+ },
1685
+ {
1686
+ "id": "length",
1687
+ "name": "Length (len)",
1688
+ "type": "int",
1689
+ "color": "blue",
1690
+ "description": "Number of elements in collection"
1691
+ }
1692
+ ],
1693
+ "default_config": {
1694
+ "algo": "sorted",
1695
+ "reverse": false,
1696
+ "var_name": "sorted_result"
1697
+ },
1698
+ "arguments": [
1699
+ {
1700
+ "name": "algo",
1701
+ "type": "select",
1702
+ "label": "Algorithm / Reduction",
1703
+ "description": "Choose sorting or aggregation function",
1704
+ "default": "sorted",
1705
+ "options": [
1706
+ {
1707
+ "value": "sorted",
1708
+ "label": "sorted(collection)"
1709
+ },
1710
+ {
1711
+ "value": "min",
1712
+ "label": "min(collection)"
1713
+ },
1714
+ {
1715
+ "value": "max",
1716
+ "label": "max(collection)"
1717
+ },
1718
+ {
1719
+ "value": "sum",
1720
+ "label": "sum(collection)"
1721
+ },
1722
+ {
1723
+ "value": "len",
1724
+ "label": "len(collection)"
1725
+ }
1726
+ ]
1727
+ },
1728
+ {
1729
+ "name": "reverse",
1730
+ "type": "boolean",
1731
+ "label": "Reverse Order",
1732
+ "description": "Sort descending if True",
1733
+ "default": false
1734
+ }
1735
+ ]
1736
+ },
1737
+ {
1738
+ "id": "alli.func.def",
1739
+ "name": "Function Definition",
1740
+ "category": "Functions & Scope",
1741
+ "parent_category": "Functions & Scope",
1742
+ "subcategory": "Definitions",
1743
+ "group_id": "functions",
1744
+ "tags": [
1745
+ "def",
1746
+ "function",
1747
+ "parameters",
1748
+ "return",
1749
+ "scope"
1750
+ ],
1751
+ "syntax": "def {name}({params}) -> {return_type}:\n \"\"\"{docstring}\"\"\"\n return {result}",
1752
+ "description": "Defines a reusable, parameterized Python function with type hints and docstring.",
1753
+ "doc_url": "https://docs.python.org/3/tutorial/controlflow.html#defining-functions",
1754
+ "icon": "Code2",
1755
+ "icon_bg": "bg-yellow-600",
1756
+ "border_color": "border-yellow-500/40",
1757
+ "inputs": [
1758
+ {
1759
+ "id": "arg1",
1760
+ "name": "Argument 1",
1761
+ "type": "Any",
1762
+ "color": "blue",
1763
+ "description": "First positional parameter"
1764
+ },
1765
+ {
1766
+ "id": "arg2",
1767
+ "name": "Argument 2",
1768
+ "type": "Any",
1769
+ "color": "blue",
1770
+ "description": "Second parameter (optional)"
1771
+ }
1772
+ ],
1773
+ "outputs": [
1774
+ {
1775
+ "id": "out",
1776
+ "name": "Function Result",
1777
+ "type": "Any",
1778
+ "color": "emerald",
1779
+ "description": "Evaluated return value"
1780
+ },
1781
+ {
1782
+ "id": "func_ref",
1783
+ "name": "Callable Reference",
1784
+ "type": "Callable",
1785
+ "color": "amber",
1786
+ "description": "First-class reference to the defined function"
1787
+ }
1788
+ ],
1789
+ "default_config": {
1790
+ "func_name": "compute_metric",
1791
+ "params": "x, factor=2.5",
1792
+ "return_type": "float",
1793
+ "docstring": "Computes weighted metrics."
1794
+ },
1795
+ "arguments": [
1796
+ {
1797
+ "name": "func_name",
1798
+ "type": "string",
1799
+ "label": "Function Name",
1800
+ "description": "Identifier for def statement (valid snake_case)",
1801
+ "default": "compute_metric"
1802
+ },
1803
+ {
1804
+ "name": "params",
1805
+ "type": "string",
1806
+ "label": "Parameters Signature",
1807
+ "description": "Comma-separated parameters (e.g. x, factor=2.5)",
1808
+ "default": "x, factor=2.5"
1809
+ },
1810
+ {
1811
+ "name": "return_type",
1812
+ "type": "string",
1813
+ "label": "Return Type Hint",
1814
+ "description": "PEP 484 type hint (float, int, str, Any, etc.)",
1815
+ "default": "float"
1816
+ },
1817
+ {
1818
+ "name": "docstring",
1819
+ "type": "string",
1820
+ "label": "Docstring",
1821
+ "description": "Function documentation string",
1822
+ "default": "Computes weighted metrics."
1823
+ }
1824
+ ]
1825
+ },
1826
+ {
1827
+ "id": "alli.func.call",
1828
+ "name": "Function Call",
1829
+ "category": "Functions & Scope",
1830
+ "parent_category": "Functions & Scope",
1831
+ "subcategory": "Execution",
1832
+ "group_id": "functions",
1833
+ "tags": [
1834
+ "call",
1835
+ "invoke",
1836
+ "execute",
1837
+ "args"
1838
+ ],
1839
+ "syntax": "{target_var} = {func_name}({args})",
1840
+ "description": "Invokes a callable function or lambda passing positional and keyword arguments.",
1841
+ "doc_url": "https://docs.python.org/3/tutorial/controlflow.html#calling-functions",
1842
+ "icon": "PlayCircle",
1843
+ "icon_bg": "bg-amber-600",
1844
+ "border_color": "border-amber-500/40",
1845
+ "inputs": [
1846
+ {
1847
+ "id": "func_in",
1848
+ "name": "Function Ref",
1849
+ "type": "Callable",
1850
+ "color": "amber",
1851
+ "description": "Optional function reference handle"
1852
+ },
1853
+ {
1854
+ "id": "arg",
1855
+ "name": "Argument Value",
1856
+ "type": "Any",
1857
+ "color": "blue",
1858
+ "description": "Value to pass as argument"
1859
+ }
1860
+ ],
1861
+ "outputs": [
1862
+ {
1863
+ "id": "out",
1864
+ "name": "Return Value",
1865
+ "type": "Any",
1866
+ "color": "emerald",
1867
+ "description": "Result returned by the called function"
1868
+ }
1869
+ ],
1870
+ "default_config": {
1871
+ "func_name": "compute_metric",
1872
+ "args": "50, factor=3.0",
1873
+ "target_var": "calc_result"
1874
+ },
1875
+ "arguments": [
1876
+ {
1877
+ "name": "func_name",
1878
+ "type": "string",
1879
+ "label": "Function Name to Call",
1880
+ "description": "Name of target function",
1881
+ "default": "compute_metric"
1882
+ },
1883
+ {
1884
+ "name": "args",
1885
+ "type": "string",
1886
+ "label": "Arguments (*args, **kwargs)",
1887
+ "description": "Comma-separated arguments",
1888
+ "default": "50, factor=3.0"
1889
+ },
1890
+ {
1891
+ "name": "target_var",
1892
+ "type": "string",
1893
+ "label": "Assign Result To",
1894
+ "description": "Variable identifier storing return value",
1895
+ "default": "calc_result"
1896
+ }
1897
+ ]
1898
+ },
1899
+ {
1900
+ "id": "alli.func.lambda",
1901
+ "name": "Lambda Expression",
1902
+ "category": "Functions & Scope",
1903
+ "parent_category": "Functions & Scope",
1904
+ "subcategory": "Anonymous",
1905
+ "group_id": "functions",
1906
+ "tags": [
1907
+ "lambda",
1908
+ "anonymous",
1909
+ "expression"
1910
+ ],
1911
+ "syntax": "{var_name} = lambda {params}: {expression}",
1912
+ "description": "Creates an inline anonymous function expression.",
1913
+ "doc_url": "https://docs.python.org/3/tutorial/controlflow.html#lambda-expressions",
1914
+ "icon": "Zap",
1915
+ "icon_bg": "bg-yellow-500",
1916
+ "border_color": "border-yellow-400/40",
1917
+ "inputs": [
1918
+ {
1919
+ "id": "in",
1920
+ "name": "Input Feed",
1921
+ "type": "Any",
1922
+ "color": "blue",
1923
+ "description": "Optional argument feed"
1924
+ }
1925
+ ],
1926
+ "outputs": [
1927
+ {
1928
+ "id": "func_ref",
1929
+ "name": "Lambda Callable",
1930
+ "type": "Callable",
1931
+ "color": "amber",
1932
+ "description": "The compiled lambda function"
1933
+ }
1934
+ ],
1935
+ "default_config": {
1936
+ "var_name": "double_fn",
1937
+ "params": "x",
1938
+ "expression": "x * 2"
1939
+ },
1940
+ "arguments": [
1941
+ {
1942
+ "name": "var_name",
1943
+ "type": "string",
1944
+ "label": "Lambda Variable",
1945
+ "description": "Variable identifier",
1946
+ "default": "double_fn"
1947
+ },
1948
+ {
1949
+ "name": "params",
1950
+ "type": "string",
1951
+ "label": "Parameters",
1952
+ "description": "Input parameters",
1953
+ "default": "x"
1954
+ },
1955
+ {
1956
+ "name": "expression",
1957
+ "type": "string",
1958
+ "label": "Return Expression",
1959
+ "description": "Single-line Python expression",
1960
+ "default": "x * 2"
1961
+ }
1962
+ ]
1963
+ },
1964
+ {
1965
+ "id": "alli.func.yield",
1966
+ "name": "Generator Yield",
1967
+ "category": "Functions & Scope",
1968
+ "parent_category": "Functions & Scope",
1969
+ "subcategory": "Generators",
1970
+ "group_id": "functions",
1971
+ "tags": [
1972
+ "yield",
1973
+ "generator",
1974
+ "stream",
1975
+ "iteration"
1976
+ ],
1977
+ "syntax": "yield {value}",
1978
+ "description": "Yields an incremental value, transforming the enclosing function into a generator.",
1979
+ "doc_url": "https://docs.python.org/3/reference/expressions.html#yield-expressions",
1980
+ "icon": "IterationCw",
1981
+ "icon_bg": "bg-amber-700",
1982
+ "border_color": "border-amber-600/40",
1983
+ "inputs": [
1984
+ {
1985
+ "id": "value",
1986
+ "name": "Yield Value",
1987
+ "type": "Any",
1988
+ "color": "blue",
1989
+ "description": "Value to produce"
1990
+ }
1991
+ ],
1992
+ "outputs": [
1993
+ {
1994
+ "id": "out",
1995
+ "name": "Generator Stream",
1996
+ "type": "Iterator",
1997
+ "color": "emerald",
1998
+ "description": "Stream output handle"
1999
+ }
2000
+ ],
2001
+ "default_config": {
2002
+ "yield_value": "item",
2003
+ "is_from": false
2004
+ },
2005
+ "arguments": [
2006
+ {
2007
+ "name": "yield_value",
2008
+ "type": "string",
2009
+ "label": "Yield Expression",
2010
+ "description": "Value or expression to yield",
2011
+ "default": "item"
2012
+ },
2013
+ {
2014
+ "name": "is_from",
2015
+ "type": "boolean",
2016
+ "label": "yield from (Sub-generator)",
2017
+ "description": "Delegates to a sub-iterable if True",
2018
+ "default": false
2019
+ }
2020
+ ]
2021
+ },
2022
+ {
2023
+ "id": "alli.func.recursion_guard",
2024
+ "name": "Recursion Guard",
2025
+ "category": "Functions & Scope",
2026
+ "parent_category": "Functions & Scope",
2027
+ "subcategory": "Safety",
2028
+ "group_id": "functions",
2029
+ "tags": [
2030
+ "recursion",
2031
+ "guard",
2032
+ "depth",
2033
+ "limit"
2034
+ ],
2035
+ "syntax": "if _recursion_depth > {max_depth}: raise RecursionError('Guard depth exceeded')",
2036
+ "description": "Protects recursive workflows from unbounded stack overflow exceptions.",
2037
+ "doc_url": "https://docs.python.org/3/library/sys.html#sys.setrecursionlimit",
2038
+ "icon": "ShieldCheck",
2039
+ "icon_bg": "bg-emerald-600",
2040
+ "border_color": "border-emerald-500/40",
2041
+ "inputs": [
2042
+ {
2043
+ "id": "depth_in",
2044
+ "name": "Current Depth",
2045
+ "type": "int",
2046
+ "color": "blue",
2047
+ "description": "Current recursive depth integer"
2048
+ }
2049
+ ],
2050
+ "outputs": [
2051
+ {
2052
+ "id": "depth_out",
2053
+ "name": "Safe Depth (+1)",
2054
+ "type": "int",
2055
+ "color": "emerald",
2056
+ "description": "Incremented depth verified within bounds"
2057
+ }
2058
+ ],
2059
+ "default_config": {
2060
+ "max_depth": 50
2061
+ },
2062
+ "arguments": [
2063
+ {
2064
+ "name": "max_depth",
2065
+ "type": "number",
2066
+ "label": "Max Recursion Depth",
2067
+ "description": "Maximum allowed recursive step before aborting",
2068
+ "default": 50
2069
+ }
2070
+ ]
2071
+ },
2072
+ {
2073
+ "id": "alli.oop.class_def",
2074
+ "name": "Class Definition",
2075
+ "category": "OOP & Classes",
2076
+ "parent_category": "OOP & Classes",
2077
+ "subcategory": "Definitions",
2078
+ "group_id": "oop",
2079
+ "tags": [
2080
+ "class",
2081
+ "oop",
2082
+ "inheritance",
2083
+ "object"
2084
+ ],
2085
+ "syntax": "class {class_name}({bases}):\n \"\"\"{docstring}\"\"\"\n pass",
2086
+ "description": "Declares an object-oriented class with optional inheritance and docstring.",
2087
+ "doc_url": "https://docs.python.org/3/tutorial/classes.html",
2088
+ "icon": "Layers",
2089
+ "icon_bg": "bg-indigo-600",
2090
+ "border_color": "border-indigo-500/40",
2091
+ "inputs": [],
2092
+ "outputs": [
2093
+ {
2094
+ "id": "class_ref",
2095
+ "name": "Class Type",
2096
+ "type": "Type",
2097
+ "color": "indigo",
2098
+ "description": "Reference to the defined class"
2099
+ }
2100
+ ],
2101
+ "default_config": {
2102
+ "class_name": "DataPipeline",
2103
+ "bases": "",
2104
+ "docstring": "Orchestrates end-to-end data processing."
2105
+ },
2106
+ "arguments": [
2107
+ {
2108
+ "name": "class_name",
2109
+ "type": "string",
2110
+ "label": "Class Name (PascalCase)",
2111
+ "description": "Class identifier",
2112
+ "default": "DataPipeline"
2113
+ },
2114
+ {
2115
+ "name": "bases",
2116
+ "type": "string",
2117
+ "label": "Base Classes (Inheritance)",
2118
+ "description": "Comma-separated base classes (e.g. object, BaseModel)",
2119
+ "default": ""
2120
+ },
2121
+ {
2122
+ "name": "docstring",
2123
+ "type": "string",
2124
+ "label": "Class Docstring",
2125
+ "description": "Class level documentation",
2126
+ "default": "Orchestrates end-to-end data processing."
2127
+ }
2128
+ ]
2129
+ },
2130
+ {
2131
+ "id": "alli.oop.constructor",
2132
+ "name": "Constructor (__init__)",
2133
+ "category": "OOP & Classes",
2134
+ "parent_category": "OOP & Classes",
2135
+ "subcategory": "Methods",
2136
+ "group_id": "oop",
2137
+ "tags": [
2138
+ "__init__",
2139
+ "constructor",
2140
+ "self",
2141
+ "instance"
2142
+ ],
2143
+ "syntax": "def __init__(self, {params}):\n {init_body}",
2144
+ "description": "Initializes object instance attributes on creation.",
2145
+ "doc_url": "https://docs.python.org/3/reference/datamodel.html#object.__init__",
2146
+ "icon": "Wrench",
2147
+ "icon_bg": "bg-indigo-700",
2148
+ "border_color": "border-indigo-600/40",
2149
+ "inputs": [
2150
+ {
2151
+ "id": "init_arg1",
2152
+ "name": "Initial Value",
2153
+ "type": "Any",
2154
+ "color": "blue",
2155
+ "description": "Argument passed to constructor"
2156
+ }
2157
+ ],
2158
+ "outputs": [
2159
+ {
2160
+ "id": "self_out",
2161
+ "name": "self",
2162
+ "type": "Object",
2163
+ "color": "indigo",
2164
+ "description": "Initialized instance reference"
2165
+ }
2166
+ ],
2167
+ "default_config": {
2168
+ "params": "name, buffer_size=1024",
2169
+ "init_attrs": "self.name = name\nself.buffer_size = buffer_size"
2170
+ },
2171
+ "arguments": [
2172
+ {
2173
+ "name": "params",
2174
+ "type": "string",
2175
+ "label": "Parameters Signature",
2176
+ "description": "Parameters following self (e.g. name, buffer_size=1024)",
2177
+ "default": "name, buffer_size=1024"
2178
+ },
2179
+ {
2180
+ "name": "init_attrs",
2181
+ "type": "string",
2182
+ "label": "Attribute Assignments",
2183
+ "description": "self.attr = value lines",
2184
+ "default": "self.name = name\nself.buffer_size = buffer_size"
2185
+ }
2186
+ ]
2187
+ },
2188
+ {
2189
+ "id": "alli.oop.method",
2190
+ "name": "Instance Method / Property",
2191
+ "category": "OOP & Classes",
2192
+ "parent_category": "OOP & Classes",
2193
+ "subcategory": "Methods",
2194
+ "group_id": "oop",
2195
+ "tags": [
2196
+ "method",
2197
+ "property",
2198
+ "self",
2199
+ "oop"
2200
+ ],
2201
+ "syntax": "def {method_name}(self, {params}) -> {return_type}:\n return {return_expr}",
2202
+ "description": "Defines an instance method or @property getter bound to self.",
2203
+ "doc_url": "https://docs.python.org/3/tutorial/classes.html#method-objects",
2204
+ "icon": "Workflow",
2205
+ "icon_bg": "bg-purple-600",
2206
+ "border_color": "border-purple-500/40",
2207
+ "inputs": [
2208
+ {
2209
+ "id": "self",
2210
+ "name": "self",
2211
+ "type": "Object",
2212
+ "color": "indigo",
2213
+ "description": "Instance self binding"
2214
+ }
2215
+ ],
2216
+ "outputs": [
2217
+ {
2218
+ "id": "out",
2219
+ "name": "Method Return",
2220
+ "type": "Any",
2221
+ "color": "emerald",
2222
+ "description": "Result returned by the method"
2223
+ }
2224
+ ],
2225
+ "default_config": {
2226
+ "method_name": "execute",
2227
+ "params": "payload",
2228
+ "is_property": false,
2229
+ "return_expr": "f'{self.name} processed: {payload}'"
2230
+ },
2231
+ "arguments": [
2232
+ {
2233
+ "name": "method_name",
2234
+ "type": "string",
2235
+ "label": "Method Name",
2236
+ "description": "Identifier for the method",
2237
+ "default": "execute"
2238
+ },
2239
+ {
2240
+ "name": "params",
2241
+ "type": "string",
2242
+ "label": "Parameters (after self)",
2243
+ "description": "Positional and keyword parameters",
2244
+ "default": "payload"
2245
+ },
2246
+ {
2247
+ "name": "is_property",
2248
+ "type": "boolean",
2249
+ "label": "Decorate with @property",
2250
+ "description": "Creates a managed getter property",
2251
+ "default": false
2252
+ },
2253
+ {
2254
+ "name": "return_expr",
2255
+ "type": "string",
2256
+ "label": "Return Expression",
2257
+ "description": "Expression returned by method",
2258
+ "default": "f'{self.name} processed: {payload}'"
2259
+ }
2260
+ ]
2261
+ },
2262
+ {
2263
+ "id": "alli.oop.instantiate",
2264
+ "name": "Instantiate Object",
2265
+ "category": "OOP & Classes",
2266
+ "parent_category": "OOP & Classes",
2267
+ "subcategory": "Instances",
2268
+ "group_id": "oop",
2269
+ "tags": [
2270
+ "new",
2271
+ "instance",
2272
+ "object",
2273
+ "create"
2274
+ ],
2275
+ "syntax": "{var_name} = {class_name}({args})",
2276
+ "description": "Creates a new class instance object and binds it to a variable.",
2277
+ "doc_url": "https://docs.python.org/3/tutorial/classes.html#class-instantiation",
2278
+ "icon": "Box",
2279
+ "icon_bg": "bg-violet-600",
2280
+ "border_color": "border-violet-500/40",
2281
+ "inputs": [
2282
+ {
2283
+ "id": "arg",
2284
+ "name": "Constructor Arg",
2285
+ "type": "Any",
2286
+ "color": "blue",
2287
+ "description": "Argument passed to __init__"
2288
+ }
2289
+ ],
2290
+ "outputs": [
2291
+ {
2292
+ "id": "instance",
2293
+ "name": "Instance Object",
2294
+ "type": "Object",
2295
+ "color": "indigo",
2296
+ "description": "Instantiated class object"
2297
+ }
2298
+ ],
2299
+ "default_config": {
2300
+ "var_name": "pipeline",
2301
+ "class_name": "DataPipeline",
2302
+ "args": "'Primary', buffer_size=2048"
2303
+ },
2304
+ "arguments": [
2305
+ {
2306
+ "name": "var_name",
2307
+ "type": "string",
2308
+ "label": "Instance Variable",
2309
+ "description": "Variable identifier storing object",
2310
+ "default": "pipeline"
2311
+ },
2312
+ {
2313
+ "name": "class_name",
2314
+ "type": "string",
2315
+ "label": "Target Class Name",
2316
+ "description": "Class identifier to instantiate",
2317
+ "default": "DataPipeline"
2318
+ },
2319
+ {
2320
+ "name": "args",
2321
+ "type": "string",
2322
+ "label": "Constructor Arguments",
2323
+ "description": "Arguments passed to __init__",
2324
+ "default": "'Primary', buffer_size=2048"
2325
+ }
2326
+ ]
2327
+ },
2328
+ {
2329
+ "id": "alli.exc.try",
2330
+ "name": "Try Block",
2331
+ "category": "Exception Handling",
2332
+ "parent_category": "Exception Handling",
2333
+ "subcategory": "Protected Blocks",
2334
+ "group_id": "exceptions",
2335
+ "tags": [
2336
+ "try",
2337
+ "exception",
2338
+ "guard",
2339
+ "error"
2340
+ ],
2341
+ "syntax": "try:\n {try_body}",
2342
+ "description": "Encapsulates statements protected from fatal runtime exceptions.",
2343
+ "doc_url": "https://docs.python.org/3/tutorial/errors.html#handling-exceptions",
2344
+ "icon": "ShieldAlert",
2345
+ "icon_bg": "bg-rose-600",
2346
+ "border_color": "border-rose-500/40",
2347
+ "inputs": [
2348
+ {
2349
+ "id": "in",
2350
+ "name": "Flow Trigger",
2351
+ "type": "Any",
2352
+ "color": "blue",
2353
+ "description": "Incoming execution trigger"
2354
+ }
2355
+ ],
2356
+ "outputs": [
2357
+ {
2358
+ "id": "protected",
2359
+ "name": "Protected Body",
2360
+ "type": "Block",
2361
+ "color": "emerald",
2362
+ "description": "Body executed inside try block"
2363
+ }
2364
+ ],
2365
+ "default_config": {
2366
+ "description": "Protected operations"
2367
+ },
2368
+ "arguments": [
2369
+ {
2370
+ "name": "description",
2371
+ "type": "string",
2372
+ "label": "Block Description",
2373
+ "description": "Comment documenting the guarded logic",
2374
+ "default": "Protected operations"
2375
+ }
2376
+ ]
2377
+ },
2378
+ {
2379
+ "id": "alli.exc.except",
2380
+ "name": "Except Handler",
2381
+ "category": "Exception Handling",
2382
+ "parent_category": "Exception Handling",
2383
+ "subcategory": "Handlers",
2384
+ "group_id": "exceptions",
2385
+ "tags": [
2386
+ "except",
2387
+ "catch",
2388
+ "handler",
2389
+ "error"
2390
+ ],
2391
+ "syntax": "except {exception_class} as {as_var}:\n {handler_body}",
2392
+ "description": "Catches specific exceptions and executes recovery or fallback logic.",
2393
+ "doc_url": "https://docs.python.org/3/tutorial/errors.html#handling-exceptions",
2394
+ "icon": "AlertTriangle",
2395
+ "icon_bg": "bg-amber-600",
2396
+ "border_color": "border-amber-500/40",
2397
+ "inputs": [
2398
+ {
2399
+ "id": "try_in",
2400
+ "name": "From Try Block",
2401
+ "type": "Block",
2402
+ "color": "rose",
2403
+ "description": "Connection from preceding Try node"
2404
+ }
2405
+ ],
2406
+ "outputs": [
2407
+ {
2408
+ "id": "error_obj",
2409
+ "name": "Caught Error",
2410
+ "type": "Exception",
2411
+ "color": "rose",
2412
+ "description": "The caught exception instance"
2413
+ },
2414
+ {
2415
+ "id": "fallback",
2416
+ "name": "Recovery Output",
2417
+ "type": "Any",
2418
+ "color": "amber",
2419
+ "description": "Fallback value produced"
2420
+ }
2421
+ ],
2422
+ "default_config": {
2423
+ "exception_class": "Exception",
2424
+ "as_var": "err",
2425
+ "fallback_value": "None"
2426
+ },
2427
+ "arguments": [
2428
+ {
2429
+ "name": "exception_class",
2430
+ "type": "select",
2431
+ "label": "Target Exception Class",
2432
+ "description": "Exception type to catch",
2433
+ "default": "Exception",
2434
+ "options": [
2435
+ {
2436
+ "value": "Exception",
2437
+ "label": "Exception (General Catch)"
2438
+ },
2439
+ {
2440
+ "value": "ValueError",
2441
+ "label": "ValueError"
2442
+ },
2443
+ {
2444
+ "value": "TypeError",
2445
+ "label": "TypeError"
2446
+ },
2447
+ {
2448
+ "value": "KeyError",
2449
+ "label": "KeyError"
2450
+ },
2451
+ {
2452
+ "value": "IndexError",
2453
+ "label": "IndexError"
2454
+ },
2455
+ {
2456
+ "value": "ZeroDivisionError",
2457
+ "label": "ZeroDivisionError"
2458
+ },
2459
+ {
2460
+ "value": "FileNotFoundError",
2461
+ "label": "FileNotFoundError"
2462
+ },
2463
+ {
2464
+ "value": "TimeoutError",
2465
+ "label": "TimeoutError"
2466
+ }
2467
+ ]
2468
+ },
2469
+ {
2470
+ "name": "as_var",
2471
+ "type": "string",
2472
+ "label": "Error Variable Name",
2473
+ "description": "Variable bound to exception instance",
2474
+ "default": "err"
2475
+ },
2476
+ {
2477
+ "name": "fallback_value",
2478
+ "type": "string",
2479
+ "label": "Fallback Result",
2480
+ "description": "Default return if exception is caught",
2481
+ "default": "None"
2482
+ }
2483
+ ]
2484
+ },
2485
+ {
2486
+ "id": "alli.exc.finally",
2487
+ "name": "Finally Block",
2488
+ "category": "Exception Handling",
2489
+ "parent_category": "Exception Handling",
2490
+ "subcategory": "Cleanup",
2491
+ "group_id": "exceptions",
2492
+ "tags": [
2493
+ "finally",
2494
+ "cleanup",
2495
+ "resource"
2496
+ ],
2497
+ "syntax": "finally:\n {cleanup_body}",
2498
+ "description": "Executes cleanup statements guaranteed to run regardless of exceptions.",
2499
+ "doc_url": "https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions",
2500
+ "icon": "CheckCircle2",
2501
+ "icon_bg": "bg-slate-700",
2502
+ "border_color": "border-slate-600/40",
2503
+ "inputs": [
2504
+ {
2505
+ "id": "in",
2506
+ "name": "Block In",
2507
+ "type": "Block",
2508
+ "color": "blue",
2509
+ "description": "Incoming block stream"
2510
+ }
2511
+ ],
2512
+ "outputs": [
2513
+ {
2514
+ "id": "out",
2515
+ "name": "Completed",
2516
+ "type": "Any",
2517
+ "color": "emerald",
2518
+ "description": "Continuation trigger"
2519
+ }
2520
+ ],
2521
+ "default_config": {
2522
+ "cleanup_comment": "Guaranteed cleanup"
2523
+ },
2524
+ "arguments": [
2525
+ {
2526
+ "name": "cleanup_comment",
2527
+ "type": "string",
2528
+ "label": "Cleanup Description",
2529
+ "description": "Description of cleanup actions performed",
2530
+ "default": "Guaranteed cleanup"
2531
+ }
2532
+ ]
2533
+ },
2534
+ {
2535
+ "id": "alli.exc.raise",
2536
+ "name": "Raise Exception",
2537
+ "category": "Exception Handling",
2538
+ "parent_category": "Exception Handling",
2539
+ "subcategory": "Signaling",
2540
+ "group_id": "exceptions",
2541
+ "tags": [
2542
+ "raise",
2543
+ "throw",
2544
+ "error",
2545
+ "bail"
2546
+ ],
2547
+ "syntax": "raise {exception_class}({message})",
2548
+ "description": "Explicitly raises a runtime exception with a custom message.",
2549
+ "doc_url": "https://docs.python.org/3/tutorial/errors.html#raising-exceptions",
2550
+ "icon": "Flame",
2551
+ "icon_bg": "bg-red-600",
2552
+ "border_color": "border-red-500/40",
2553
+ "inputs": [
2554
+ {
2555
+ "id": "trigger",
2556
+ "name": "Trigger (bool)",
2557
+ "type": "bool",
2558
+ "color": "rose",
2559
+ "description": "Optional condition triggering raise"
2560
+ }
2561
+ ],
2562
+ "outputs": [],
2563
+ "default_config": {
2564
+ "exception_class": "ValueError",
2565
+ "message": "Invalid parameter configuration supplied"
2566
+ },
2567
+ "arguments": [
2568
+ {
2569
+ "name": "exception_class",
2570
+ "type": "string",
2571
+ "label": "Exception Type",
2572
+ "description": "Exception class to raise",
2573
+ "default": "ValueError"
2574
+ },
2575
+ {
2576
+ "name": "message",
2577
+ "type": "string",
2578
+ "label": "Error Message",
2579
+ "description": "Human-readable diagnostic message",
2580
+ "default": "Invalid parameter configuration supplied"
2581
+ }
2582
+ ]
2583
+ },
2584
+ {
2585
+ "id": "alli.exc.assert",
2586
+ "name": "Assertion",
2587
+ "category": "Exception Handling",
2588
+ "parent_category": "Exception Handling",
2589
+ "subcategory": "Contracts",
2590
+ "group_id": "exceptions",
2591
+ "tags": [
2592
+ "assert",
2593
+ "invariant",
2594
+ "contract",
2595
+ "test"
2596
+ ],
2597
+ "syntax": "assert {condition}, {message}",
2598
+ "description": "Tests an invariant condition; raises AssertionError if False.",
2599
+ "doc_url": "https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement",
2600
+ "icon": "AlertOctagon",
2601
+ "icon_bg": "bg-rose-700",
2602
+ "border_color": "border-rose-600/40",
2603
+ "inputs": [
2604
+ {
2605
+ "id": "condition",
2606
+ "name": "Condition (bool)",
2607
+ "type": "bool",
2608
+ "color": "blue",
2609
+ "description": "Boolean test expression"
2610
+ }
2611
+ ],
2612
+ "outputs": [
2613
+ {
2614
+ "id": "out",
2615
+ "name": "Passed Value",
2616
+ "type": "Any",
2617
+ "color": "emerald",
2618
+ "description": "Pass-through if assertion holds"
2619
+ }
2620
+ ],
2621
+ "default_config": {
2622
+ "condition": "len(items) > 0",
2623
+ "message": "Items collection must not be empty"
2624
+ },
2625
+ "arguments": [
2626
+ {
2627
+ "name": "condition",
2628
+ "type": "string",
2629
+ "label": "Assertion Condition",
2630
+ "description": "Expression that must evaluate to True",
2631
+ "default": "len(items) > 0"
2632
+ },
2633
+ {
2634
+ "name": "message",
2635
+ "type": "string",
2636
+ "label": "Failure Message",
2637
+ "description": "AssertionError description",
2638
+ "default": "Items collection must not be empty"
2639
+ }
2640
+ ]
2641
+ },
2642
+ {
2643
+ "id": "alli.sys.import",
2644
+ "name": "Import Statement",
2645
+ "category": "System & Libraries",
2646
+ "parent_category": "System & Libraries",
2647
+ "subcategory": "Modules",
2648
+ "group_id": "system",
2649
+ "tags": [
2650
+ "import",
2651
+ "module",
2652
+ "library",
2653
+ "package"
2654
+ ],
2655
+ "syntax": "import {module_name} as {alias}",
2656
+ "description": "Imports standard library modules or third-party packages.",
2657
+ "doc_url": "https://docs.python.org/3/reference/simple_stmts.html#the-import-statement",
2658
+ "icon": "Package",
2659
+ "icon_bg": "bg-cyan-700",
2660
+ "border_color": "border-cyan-600/40",
2661
+ "inputs": [],
2662
+ "outputs": [
2663
+ {
2664
+ "id": "module",
2665
+ "name": "Module Ref",
2666
+ "type": "Module",
2667
+ "color": "cyan",
2668
+ "description": "Loaded module reference"
2669
+ }
2670
+ ],
2671
+ "default_config": {
2672
+ "module_name": "math",
2673
+ "alias": "math",
2674
+ "imported_items": ""
2675
+ },
2676
+ "arguments": [
2677
+ {
2678
+ "name": "module_name",
2679
+ "type": "string",
2680
+ "label": "Module Name",
2681
+ "description": "Module identifier to import",
2682
+ "default": "math"
2683
+ },
2684
+ {
2685
+ "name": "alias",
2686
+ "type": "string",
2687
+ "label": "Import Alias (as)",
2688
+ "description": "Optional alias identifier",
2689
+ "default": "math"
2690
+ },
2691
+ {
2692
+ "name": "imported_items",
2693
+ "type": "string",
2694
+ "label": "from module import items",
2695
+ "description": "Optional comma-separated items for from import",
2696
+ "default": ""
2697
+ }
2698
+ ]
2699
+ },
2700
+ {
2701
+ "id": "alli.sys.file",
2702
+ "name": "File Operations",
2703
+ "category": "System & Libraries",
2704
+ "parent_category": "System & Libraries",
2705
+ "subcategory": "I/O",
2706
+ "group_id": "system",
2707
+ "tags": [
2708
+ "file",
2709
+ "open",
2710
+ "read",
2711
+ "write",
2712
+ "io"
2713
+ ],
2714
+ "syntax": "with open('{path}', '{mode}', encoding='{encoding}') as f:\n {var_name} = f.{operation}()",
2715
+ "description": "Performs safe context-managed file reading and writing.",
2716
+ "doc_url": "https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files",
2717
+ "icon": "FileText",
2718
+ "icon_bg": "bg-emerald-600",
2719
+ "border_color": "border-emerald-500/40",
2720
+ "inputs": [
2721
+ {
2722
+ "id": "content",
2723
+ "name": "Write Content",
2724
+ "type": "str",
2725
+ "color": "blue",
2726
+ "description": "Text to write when in write mode"
2727
+ }
2728
+ ],
2729
+ "outputs": [
2730
+ {
2731
+ "id": "out",
2732
+ "name": "File Content",
2733
+ "type": "str",
2734
+ "color": "emerald",
2735
+ "description": "Read content or status"
2736
+ }
2737
+ ],
2738
+ "default_config": {
2739
+ "var_name": "file_data",
2740
+ "path": "data.txt",
2741
+ "mode": "r",
2742
+ "operation": "read",
2743
+ "encoding": "utf-8"
2744
+ },
2745
+ "arguments": [
2746
+ {
2747
+ "name": "path",
2748
+ "type": "string",
2749
+ "label": "File Path",
2750
+ "description": "Path to target file",
2751
+ "default": "data.txt"
2752
+ },
2753
+ {
2754
+ "name": "mode",
2755
+ "type": "select",
2756
+ "label": "Open Mode",
2757
+ "description": "File open mode",
2758
+ "default": "r",
2759
+ "options": [
2760
+ {
2761
+ "value": "r",
2762
+ "label": "Read Text ('r')"
2763
+ },
2764
+ {
2765
+ "value": "w",
2766
+ "label": "Write Text ('w')"
2767
+ },
2768
+ {
2769
+ "value": "a",
2770
+ "label": "Append Text ('a')"
2771
+ },
2772
+ {
2773
+ "value": "rb",
2774
+ "label": "Read Binary ('rb')"
2775
+ },
2776
+ {
2777
+ "value": "wb",
2778
+ "label": "Write Binary ('wb')"
2779
+ }
2780
+ ]
2781
+ },
2782
+ {
2783
+ "name": "operation",
2784
+ "type": "select",
2785
+ "label": "Method",
2786
+ "description": "File method to call",
2787
+ "default": "read",
2788
+ "options": [
2789
+ {
2790
+ "value": "read",
2791
+ "label": "f.read() (Entire content)"
2792
+ },
2793
+ {
2794
+ "value": "readlines",
2795
+ "label": "f.readlines() (Lines list)"
2796
+ },
2797
+ {
2798
+ "value": "write",
2799
+ "label": "f.write(content)"
2800
+ }
2801
+ ]
2802
+ },
2803
+ {
2804
+ "name": "encoding",
2805
+ "type": "string",
2806
+ "label": "Encoding",
2807
+ "description": "Text encoding character set",
2808
+ "default": "utf-8"
2809
+ }
2810
+ ]
2811
+ },
2812
+ {
2813
+ "id": "alli.sys.env",
2814
+ "name": "Environment Variable",
2815
+ "category": "System & Libraries",
2816
+ "parent_category": "System & Libraries",
2817
+ "subcategory": "OS",
2818
+ "group_id": "system",
2819
+ "tags": [
2820
+ "env",
2821
+ "os",
2822
+ "getenv",
2823
+ "secret"
2824
+ ],
2825
+ "syntax": "{var_name} = os.getenv('{key}', {default_val})",
2826
+ "description": "Retrieves configuration or secret tokens from system environment variables.",
2827
+ "doc_url": "https://docs.python.org/3/library/os.html#os.getenv",
2828
+ "icon": "KeyRound",
2829
+ "icon_bg": "bg-slate-800",
2830
+ "border_color": "border-slate-700/40",
2831
+ "inputs": [],
2832
+ "outputs": [
2833
+ {
2834
+ "id": "out",
2835
+ "name": "Env Value",
2836
+ "type": "str",
2837
+ "color": "cyan",
2838
+ "description": "Retrieved environment string"
2839
+ }
2840
+ ],
2841
+ "default_config": {
2842
+ "var_name": "api_key",
2843
+ "key": "OPENAI_API_KEY",
2844
+ "default_val": "default_key_mock",
2845
+ "is_secret": true
2846
+ },
2847
+ "arguments": [
2848
+ {
2849
+ "name": "var_name",
2850
+ "type": "string",
2851
+ "label": "Variable Name",
2852
+ "description": "Target variable identifier",
2853
+ "default": "api_key"
2854
+ },
2855
+ {
2856
+ "name": "key",
2857
+ "type": "string",
2858
+ "label": "Env Key Name",
2859
+ "description": "Environment variable key",
2860
+ "default": "OPENAI_API_KEY"
2861
+ },
2862
+ {
2863
+ "name": "default_val",
2864
+ "type": "string",
2865
+ "label": "Default Fallback",
2866
+ "description": "Fallback value if key is not set",
2867
+ "default": "default_key_mock"
2868
+ },
2869
+ {
2870
+ "name": "is_secret",
2871
+ "type": "boolean",
2872
+ "label": "Mask as Secret in UI",
2873
+ "description": "Hides value in canvas inspect previews",
2874
+ "default": true
2875
+ }
2876
+ ]
2877
+ },
2878
+ {
2879
+ "id": "alli.sys.logging",
2880
+ "name": "Logging Service",
2881
+ "category": "System & Libraries",
2882
+ "parent_category": "System & Libraries",
2883
+ "subcategory": "Observability",
2884
+ "group_id": "system",
2885
+ "tags": [
2886
+ "log",
2887
+ "logging",
2888
+ "info",
2889
+ "warn",
2890
+ "error"
2891
+ ],
2892
+ "syntax": "logging.{level.lower()}('{message}')",
2893
+ "description": "Emits structured diagnostic logs through Python's standard logging facility.",
2894
+ "doc_url": "https://docs.python.org/3/library/logging.html",
2895
+ "icon": "Activity",
2896
+ "icon_bg": "bg-blue-600",
2897
+ "border_color": "border-blue-500/40",
2898
+ "inputs": [
2899
+ {
2900
+ "id": "msg_in",
2901
+ "name": "Log Message / Data",
2902
+ "type": "Any",
2903
+ "color": "blue",
2904
+ "description": "Dynamic value to format into log"
2905
+ }
2906
+ ],
2907
+ "outputs": [
2908
+ {
2909
+ "id": "out",
2910
+ "name": "Pass-Through",
2911
+ "type": "Any",
2912
+ "color": "emerald",
2913
+ "description": "Passes incoming data downstream"
2914
+ }
2915
+ ],
2916
+ "default_config": {
2917
+ "level": "INFO",
2918
+ "message": "Processing pipeline step initiated"
2919
+ },
2920
+ "arguments": [
2921
+ {
2922
+ "name": "level",
2923
+ "type": "select",
2924
+ "label": "Log Level",
2925
+ "description": "Severity level",
2926
+ "default": "INFO",
2927
+ "options": [
2928
+ {
2929
+ "value": "DEBUG",
2930
+ "label": "DEBUG"
2931
+ },
2932
+ {
2933
+ "value": "INFO",
2934
+ "label": "INFO"
2935
+ },
2936
+ {
2937
+ "value": "WARNING",
2938
+ "label": "WARNING"
2939
+ },
2940
+ {
2941
+ "value": "ERROR",
2942
+ "label": "ERROR"
2943
+ },
2944
+ {
2945
+ "value": "CRITICAL",
2946
+ "label": "CRITICAL"
2947
+ }
2948
+ ]
2949
+ },
2950
+ {
2951
+ "name": "message",
2952
+ "type": "string",
2953
+ "label": "Log Message Pattern",
2954
+ "description": "Text message format",
2955
+ "default": "Processing pipeline step initiated"
2956
+ }
2957
+ ]
2958
+ },
2959
+ {
2960
+ "id": "alli.async.def",
2961
+ "name": "Async Function (async def)",
2962
+ "category": "Advanced Execution",
2963
+ "parent_category": "Advanced Execution",
2964
+ "subcategory": "Coroutines",
2965
+ "group_id": "async",
2966
+ "tags": [
2967
+ "async",
2968
+ "await",
2969
+ "coroutine",
2970
+ "asyncio"
2971
+ ],
2972
+ "syntax": "async def {func_name}({params}):\n \"\"\"{docstring}\"\"\"\n {body}",
2973
+ "description": "Defines an asynchronous coroutine function compatible with asyncio event loops.",
2974
+ "doc_url": "https://docs.python.org/3/library/asyncio-task.html#coroutines",
2975
+ "icon": "Radio",
2976
+ "icon_bg": "bg-cyan-600",
2977
+ "border_color": "border-cyan-500/40",
2978
+ "inputs": [
2979
+ {
2980
+ "id": "arg",
2981
+ "name": "Parameter",
2982
+ "type": "Any",
2983
+ "color": "blue",
2984
+ "description": "Argument passed to coroutine"
2985
+ }
2986
+ ],
2987
+ "outputs": [
2988
+ {
2989
+ "id": "coro",
2990
+ "name": "Coroutine Ref",
2991
+ "type": "Coroutine",
2992
+ "color": "cyan",
2993
+ "description": "Awaitable coroutine object"
2994
+ }
2995
+ ],
2996
+ "default_config": {
2997
+ "func_name": "fetch_async_resource",
2998
+ "params": "endpoint",
2999
+ "docstring": "Asynchronously fetches remote resource."
3000
+ },
3001
+ "arguments": [
3002
+ {
3003
+ "name": "func_name",
3004
+ "type": "string",
3005
+ "label": "Async Function Name",
3006
+ "description": "Identifier for async def statement",
3007
+ "default": "fetch_async_resource"
3008
+ },
3009
+ {
3010
+ "name": "params",
3011
+ "type": "string",
3012
+ "label": "Parameters",
3013
+ "description": "Comma-separated coroutine parameters",
3014
+ "default": "endpoint"
3015
+ },
3016
+ {
3017
+ "name": "docstring",
3018
+ "type": "string",
3019
+ "label": "Docstring",
3020
+ "description": "Coroutine documentation",
3021
+ "default": "Asynchronously fetches remote resource."
3022
+ }
3023
+ ]
3024
+ },
3025
+ {
3026
+ "id": "alli.async.await",
3027
+ "name": "Await Expression",
3028
+ "category": "Advanced Execution",
3029
+ "parent_category": "Advanced Execution",
3030
+ "subcategory": "Coroutines",
3031
+ "group_id": "async",
3032
+ "tags": [
3033
+ "await",
3034
+ "coroutine",
3035
+ "asyncio",
3036
+ "result"
3037
+ ],
3038
+ "syntax": "{target_var} = await {coroutine_expr}",
3039
+ "description": "Suspends coroutine execution until the awaitable promise resolves.",
3040
+ "doc_url": "https://docs.python.org/3/reference/expressions.html#await",
3041
+ "icon": "Timer",
3042
+ "icon_bg": "bg-cyan-700",
3043
+ "border_color": "border-cyan-600/40",
3044
+ "inputs": [
3045
+ {
3046
+ "id": "coro_in",
3047
+ "name": "Awaitable Input",
3048
+ "type": "Coroutine",
3049
+ "color": "cyan",
3050
+ "description": "Coroutine or Task to await"
3051
+ }
3052
+ ],
3053
+ "outputs": [
3054
+ {
3055
+ "id": "out",
3056
+ "name": "Resolved Value",
3057
+ "type": "Any",
3058
+ "color": "emerald",
3059
+ "description": "Resolved asynchronous result"
3060
+ }
3061
+ ],
3062
+ "default_config": {
3063
+ "coroutine_expr": "fetch_async_resource('/api/v1/data')",
3064
+ "target_var": "async_result"
3065
+ },
3066
+ "arguments": [
3067
+ {
3068
+ "name": "coroutine_expr",
3069
+ "type": "string",
3070
+ "label": "Awaitable Expression",
3071
+ "description": "Expression returning a coroutine, Task, or Future",
3072
+ "default": "fetch_async_resource('/api/v1/data')"
3073
+ },
3074
+ {
3075
+ "name": "target_var",
3076
+ "type": "string",
3077
+ "label": "Target Variable",
3078
+ "description": "Variable identifier storing resolved result",
3079
+ "default": "async_result"
3080
+ }
3081
+ ]
3082
+ },
3083
+ {
3084
+ "id": "alli.async.task",
3085
+ "name": "Async Task Creation",
3086
+ "category": "Advanced Execution",
3087
+ "parent_category": "Advanced Execution",
3088
+ "subcategory": "Concurrency",
3089
+ "group_id": "async",
3090
+ "tags": [
3091
+ "task",
3092
+ "create_task",
3093
+ "asyncio",
3094
+ "background"
3095
+ ],
3096
+ "syntax": "{task_var} = asyncio.create_task({coroutine_expr}, name='{task_name}')",
3097
+ "description": "Schedules a coroutine to run concurrently on the asyncio event loop.",
3098
+ "doc_url": "https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task",
3099
+ "icon": "Sparkles",
3100
+ "icon_bg": "bg-indigo-600",
3101
+ "border_color": "border-indigo-500/40",
3102
+ "inputs": [
3103
+ {
3104
+ "id": "coro",
3105
+ "name": "Coroutine Feed",
3106
+ "type": "Coroutine",
3107
+ "color": "cyan",
3108
+ "description": "Coroutine to wrap into task"
3109
+ }
3110
+ ],
3111
+ "outputs": [
3112
+ {
3113
+ "id": "task",
3114
+ "name": "Task Handle",
3115
+ "type": "Task",
3116
+ "color": "indigo",
3117
+ "description": "Running asyncio Task object"
3118
+ }
3119
+ ],
3120
+ "default_config": {
3121
+ "task_var": "bg_task",
3122
+ "task_name": "worker_pipeline",
3123
+ "coroutine_expr": "fetch_async_resource('/stream')"
3124
+ },
3125
+ "arguments": [
3126
+ {
3127
+ "name": "task_var",
3128
+ "type": "string",
3129
+ "label": "Task Variable",
3130
+ "description": "Variable identifier for Task handle",
3131
+ "default": "bg_task"
3132
+ },
3133
+ {
3134
+ "name": "task_name",
3135
+ "type": "string",
3136
+ "label": "Task Name",
3137
+ "description": "Human-readable task label",
3138
+ "default": "worker_pipeline"
3139
+ },
3140
+ {
3141
+ "name": "coroutine_expr",
3142
+ "type": "string",
3143
+ "label": "Coroutine Call",
3144
+ "description": "Coroutine to spawn as task",
3145
+ "default": "fetch_async_resource('/stream')"
3146
+ }
3147
+ ]
3148
+ },
3149
+ {
3150
+ "id": "alli.async.context",
3151
+ "name": "Async Context (async with / for)",
3152
+ "category": "Advanced Execution",
3153
+ "parent_category": "Advanced Execution",
3154
+ "subcategory": "Context",
3155
+ "group_id": "async",
3156
+ "tags": [
3157
+ "async with",
3158
+ "async for",
3159
+ "context",
3160
+ "iterator"
3161
+ ],
3162
+ "syntax": "{statement_type} {expr} as {var_name}:\n {body}",
3163
+ "description": "Asynchronous context management or asynchronous iterator streaming.",
3164
+ "doc_url": "https://docs.python.org/3/reference/compound_stmts.html#async-with",
3165
+ "icon": "Workflow",
3166
+ "icon_bg": "bg-teal-600",
3167
+ "border_color": "border-teal-500/40",
3168
+ "inputs": [
3169
+ {
3170
+ "id": "ctx_in",
3171
+ "name": "Async Target",
3172
+ "type": "Any",
3173
+ "color": "cyan",
3174
+ "description": "Async context manager or iterator"
3175
+ }
3176
+ ],
3177
+ "outputs": [
3178
+ {
3179
+ "id": "item",
3180
+ "name": "Bound Item",
3181
+ "type": "Any",
3182
+ "color": "emerald",
3183
+ "description": "Target variable bound inside async block"
3184
+ }
3185
+ ],
3186
+ "default_config": {
3187
+ "statement_type": "async with",
3188
+ "expr": "httpx.AsyncClient()",
3189
+ "var_name": "client"
3190
+ },
3191
+ "arguments": [
3192
+ {
3193
+ "name": "statement_type",
3194
+ "type": "select",
3195
+ "label": "Syntax Construct",
3196
+ "description": "Choose async with or async for",
3197
+ "default": "async with",
3198
+ "options": [
3199
+ {
3200
+ "value": "async with",
3201
+ "label": "async with expr as target:"
3202
+ },
3203
+ {
3204
+ "value": "async for",
3205
+ "label": "async for item in iterable:"
3206
+ }
3207
+ ]
3208
+ },
3209
+ {
3210
+ "name": "expr",
3211
+ "type": "string",
3212
+ "label": "Async Expression",
3213
+ "description": "Context manager or async iterable expression",
3214
+ "default": "httpx.AsyncClient()"
3215
+ },
3216
+ {
3217
+ "name": "var_name",
3218
+ "type": "string",
3219
+ "label": "Bound Variable (as)",
3220
+ "description": "Target identifier",
3221
+ "default": "client"
3222
+ }
3223
+ ]
3224
+ }
3225
+ ],
3226
+ "categories": [
3227
+ {
3228
+ "id": "advanced_execution",
3229
+ "name": "Advanced Execution",
3230
+ "description": "Standard Advanced Execution visual language constructs."
3231
+ },
3232
+ {
3233
+ "id": "arithmetic_and_math",
3234
+ "name": "Arithmetic & Math",
3235
+ "description": "Standard Arithmetic & Math visual language constructs."
3236
+ },
3237
+ {
3238
+ "id": "control_flow",
3239
+ "name": "Control Flow",
3240
+ "description": "Standard Control Flow visual language constructs."
3241
+ },
3242
+ {
3243
+ "id": "data_structures",
3244
+ "name": "Data Structures",
3245
+ "description": "Standard Data Structures visual language constructs."
3246
+ },
3247
+ {
3248
+ "id": "exception_handling",
3249
+ "name": "Exception Handling",
3250
+ "description": "Standard Exception Handling visual language constructs."
3251
+ },
3252
+ {
3253
+ "id": "functions_and_scope",
3254
+ "name": "Functions & Scope",
3255
+ "description": "Standard Functions & Scope visual language constructs."
3256
+ },
3257
+ {
3258
+ "id": "input_and_output",
3259
+ "name": "Input & Output",
3260
+ "description": "Standard Input & Output visual language constructs."
3261
+ },
3262
+ {
3263
+ "id": "oop_and_classes",
3264
+ "name": "OOP & Classes",
3265
+ "description": "Standard OOP & Classes visual language constructs."
3266
+ },
3267
+ {
3268
+ "id": "standard_library",
3269
+ "name": "Standard Library",
3270
+ "description": "Standard Standard Library visual language constructs."
3271
+ },
3272
+ {
3273
+ "id": "system_and_libraries",
3274
+ "name": "System & Libraries",
3275
+ "description": "Standard System & Libraries visual language constructs."
3276
+ },
3277
+ {
3278
+ "id": "variables_and_types",
3279
+ "name": "Variables & Types",
3280
+ "description": "Standard Variables & Types visual language constructs."
3281
+ }
3282
+ ]
3283
+ }