-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.doql.less
More file actions
265 lines (225 loc) · 8.44 KB
/
Copy pathapp.doql.less
File metadata and controls
265 lines (225 loc) · 8.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
// LESS format — define @variables here as needed
app {
name: env2llm;
version: 0.1.11;
description: "Generate environment maps (services, artifacts, env vars) for LLM decision-making";
license: Apache-2.0;
}
dependencies {
runtime: "pydantic>=2.0, pyyaml>=6.0";
llm: litellm>=1.0;
mqtt: paho-mqtt>=2.0;
nlp2uri: nlp2uri[envmap]>=0.4.7;
dev: "pytest>=8.0, goal>=2.1.0, costs>=0.1.20, pfix>=0.1.60";
}
interface[type="mcp"] {
framework: stdio;
}
interface[type="mcp"] page[name="env2llm-mcp"] {
entry: env2llm.integrators.mcp_server:main;
}
interface[type="cli"] {
framework: argparse;
}
interface[type="cli"] page[name="env2llm"] {
entry: env2llm.cli:main;
}
interface[type="cli"] page[name="env2llm-mqtt"] {
entry: env2llm.integrators.mqtt_bridge:main;
}
integration[name="mqtt"] {
type: mqtt;
}
integration[name="nlp"] {
type: api;
}
workflow[name="install"] {
trigger: manual;
step-1: run cmd=$(PIP) install -r requirements.txt;
}
workflow[name="install-dev"] {
trigger: manual;
step-1: run cmd=$(PIP) install pytest pytest-asyncio httpx anyio;
}
workflow[name="install-ai"] {
trigger: manual;
step-1: run cmd=$(PIP) install litellm;
}
workflow[name="setup"] {
trigger: manual;
step-1: run cmd=echo "$(GREEN)✓ Setup complete$(RESET)";
}
workflow[name="env"] {
trigger: manual;
step-1: run cmd=if [ ! -f .env ]; then \;
step-2: run cmd=cp .env.example .env; \;
step-3: run cmd=echo "$(GREEN)✓ Created .env from .env.example$(RESET)"; \;
step-4: run cmd=else \;
step-5: run cmd=echo "$(YELLOW)⚠ .env already exists$(RESET)"; \;
step-6: run cmd=fi;
}
workflow[name="run"] {
trigger: manual;
step-1: depend target=web;
}
workflow[name="web"] {
trigger: manual;
step-1: run cmd=echo "$(CYAN)Starting web server on http://$(HOST):$(PORT)$(RESET)";
step-2: run cmd=$(PYTHON) -m web.app;
}
workflow[name="shell"] {
trigger: manual;
step-1: run cmd=echo "$(CYAN)Starting interactive shell$(RESET)";
step-2: run cmd=$(PYTHON) -m cli.main;
}
workflow[name="plan"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m cli.main plan examples/01-user-api/generated/iterun.yaml -o examples/01-user-api/generated/;
}
workflow[name="execute"] {
trigger: manual;
step-1: run cmd=ITERUN_EXECUTE=1 ./examples/01-user-api/run.sh;
}
workflow[name="examples"] {
trigger: manual;
step-1: run cmd=./examples/run-all.sh;
}
workflow[name="run-intent"] {
trigger: manual;
step-1: run cmd=if [ -z "$(FILE)" ]; then \;
step-2: run cmd=echo "$(RED)ERROR: FILE not specified$(RESET)"; \;
step-3: run cmd=echo "Usage: make run-intent FILE=path/to/iterun.yaml"; \;
step-4: run cmd=exit 1; \;
step-5: run cmd=fi;
step-6: run cmd=$(PYTHON) -m cli.main execute $(FILE);
}
workflow[name="test"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pytest tests/ -v;
}
workflow[name="test-shell"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pytest tests/e2e/test_shell.py -v;
}
workflow[name="test-web"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pytest tests/e2e/test_web.py -v;
}
workflow[name="test-ai"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pytest tests/e2e/test_ai_gateway.py -v;
}
workflow[name="test-cov"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pytest tests/ -v --cov=. --cov-report=html --cov-report=term;
}
workflow[name="ollama-start"] {
trigger: manual;
step-1: run cmd=echo "$(CYAN)Starting Ollama server...$(RESET)";
step-2: run cmd=ollama serve &;
step-3: run cmd=sleep 2;
step-4: run cmd=echo "$(GREEN)✓ Ollama server started$(RESET)";
}
workflow[name="ollama-pull"] {
trigger: manual;
step-1: run cmd=echo "$(CYAN)Pulling model: $(DEFAULT_MODEL)$(RESET)";
step-2: run cmd=ollama pull $(DEFAULT_MODEL);
step-3: run cmd=echo "$(GREEN)✓ Model $(DEFAULT_MODEL) ready$(RESET)";
}
workflow[name="ollama-models"] {
trigger: manual;
step-1: run cmd=echo "";
step-2: run cmd=echo "$(CYAN)Recommended Ollama models (≤12B):$(RESET)";
step-3: run cmd=echo " $(GREEN)llama3.2$(RESET) - 3B - Default, fast";
step-4: run cmd=echo " llama3.2:1b - 1B - Ultra lightweight";
step-5: run cmd=echo " llama3.1:8b - 8B - Balanced";
step-6: run cmd=echo " mistral - 7B - Fast inference";
step-7: run cmd=echo " mistral-nemo - 12B - Best quality";
step-8: run cmd=echo " gemma2 - 9B - Google Gemma 2";
step-9: run cmd=echo " phi3 - 3.8B - Microsoft Phi-3";
step-10: run cmd=echo " qwen2.5 - 7B - Alibaba Qwen";
step-11: run cmd=echo " codellama - 7B - Code generation";
step-12: run cmd=echo "";
step-13: run cmd=echo "$(YELLOW)Install:$(RESET) ollama pull <model>";
step-14: run cmd=echo "";
}
workflow[name="ollama-status"] {
trigger: manual;
step-1: run cmd=echo "$(CYAN)Checking Ollama status...$(RESET)";
step-2: run cmd=curl -s http://localhost:11434/api/tags > /dev/null 2>&1 && \;
step-3: run cmd=echo "$(GREEN)✓ Ollama is running$(RESET)" || \;
step-4: run cmd=echo "$(RED)✗ Ollama is not running$(RESET)";
}
workflow[name="lint"] {
trigger: manual;
step-1: run cmd=which ruff > /dev/null 2>&1 && ruff check . || echo "$(YELLOW)ruff not installed$(RESET)";
}
workflow[name="format"] {
trigger: manual;
step-1: run cmd=which ruff > /dev/null 2>&1 && ruff format . || echo "$(YELLOW)ruff not installed$(RESET)";
}
workflow[name="clean"] {
trigger: manual;
step-1: run cmd=echo "$(CYAN)Cleaning...$(RESET)";
step-2: run cmd=rm -rf __pycache__ */__pycache__ */*/__pycache__;
step-3: run cmd=rm -rf .pytest_cache */.pytest_cache;
step-4: run cmd=rm -rf *.egg-info .eggs;
step-5: run cmd=rm -rf htmlcov .coverage;
step-6: run cmd=rm -rf /tmp/intent-*;
step-7: run cmd=echo "$(GREEN)✓ Cleaned$(RESET)";
}
workflow[name="docker-clean"] {
trigger: manual;
step-1: run cmd=echo "$(CYAN)Cleaning Docker resources...$(RESET)";
step-2: run cmd=-docker ps -a --filter "name=$(CONTAINER_PREFIX)-" -q | xargs -r docker rm -f;
step-3: run cmd=-docker images --filter "reference=$(CONTAINER_PREFIX)-*" -q | xargs -r docker rmi -f;
step-4: run cmd=echo "$(GREEN)✓ Docker cleaned$(RESET)";
}
workflow[name="docker-ps"] {
trigger: manual;
step-1: run cmd=docker ps --filter "name=$(CONTAINER_PREFIX)-";
}
workflow[name="docker-stop"] {
trigger: manual;
step-1: run cmd=docker ps --filter "name=$(CONTAINER_PREFIX)-" -q | xargs -r docker stop;
step-2: run cmd=echo "$(GREEN)✓ Containers stopped$(RESET)";
}
workflow[name="dev"] {
trigger: manual;
step-1: run cmd=uvicorn web.app:app --reload --host $(HOST) --port $(PORT);
}
workflow[name="new-intent"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m cli.main new;
}
workflow[name="show-config"] {
trigger: manual;
step-1: run cmd=echo "";
step-2: run cmd=echo "$(CYAN)Current Configuration:$(RESET)";
step-3: run cmd=echo " HOST=$(HOST)";
step-4: run cmd=echo " PORT=$(PORT)";
step-5: run cmd=echo " DEFAULT_MODEL=$(DEFAULT_MODEL)";
step-6: run cmd=echo " CONTAINER_PORT=$(CONTAINER_PORT)";
step-7: run cmd=echo " CONTAINER_PREFIX=$(CONTAINER_PREFIX)";
step-8: run cmd=echo " OLLAMA_BASE_URL=$(OLLAMA_BASE_URL)";
step-9: run cmd=echo " SKIP_ITERUN_CONFIRMATION=$(SKIP_ITERUN_CONFIRMATION)";
step-10: run cmd=echo "";
}
tests {
import: testql-scenarios/**/*.testql.toon.yaml;
}
env_vars {
keys: OPENROUTER_API_KEY, LLM_MODEL, PFIX_AUTO_APPLY, PFIX_AUTO_INSTALL_DEPS, PFIX_AUTO_RESTART, PFIX_MAX_RETRIES, PFIX_DRY_RUN, PFIX_ENABLED, PFIX_GIT_COMMIT, PFIX_GIT_PREFIX, PFIX_CREATE_BACKUPS, NLP2DSL_AUTO_EXECUTE, LLM_TEMPERATURE, LLM_MAX_TOKENS, LLM_API_BASE, NLP2DSL_SYSTEM_MAP_LLM, NLP2DSL_DOQL_CONTEXT, NLP2DSL_EXAMPLE_DIR, NLP2DSL_RUN_ID, ENV2LLM_MQTT_ENABLED, ENV2LLM_MQTT_HOST, ENV2LLM_MQTT_PORT, ENV2LLM_MQTT_TOPIC_PREFIX, ENV2LLM_MQTT_USERNAME, ENV2LLM_MQTT_PASSWORD, ENV2LLM_MQTT_CLIENT_ID, XDG_CURRENT_DESKTOP, DESKTOP_SESSION, XDG_SESSION_TYPE, WAYLAND_DISPLAY, DISPLAY, ENV2LLM_MCP_PROBE, ENV2LLM_TESTQL_PROBE, ENV2LLM_DESKTOP_PROBE, NLP2DSL_EXAMPLES_MOUNT;
}
deploy {
target: makefile;
}
environment[name="local"] {
runtime: python;
env_file: .env;
template_file: .env.example;
python_version: >=3.10;
vars: LLM_MODEL, OPENROUTER_API_KEY, PFIX_AUTO_APPLY, PFIX_AUTO_INSTALL_DEPS, PFIX_AUTO_RESTART, PFIX_CREATE_BACKUPS, PFIX_DRY_RUN, PFIX_ENABLED, PFIX_GIT_COMMIT, PFIX_GIT_PREFIX, PFIX_MAX_RETRIES;
runtime_llm: OPENROUTER_API_KEY;
runtime_pfix: PFIX_AUTO_APPLY, PFIX_AUTO_INSTALL_DEPS, PFIX_AUTO_RESTART, PFIX_CREATE_BACKUPS, PFIX_DRY_RUN, PFIX_ENABLED, PFIX_GIT_COMMIT, PFIX_GIT_PREFIX, PFIX_MAX_RETRIES;
}