smridhgupta commited on
Commit
c3db8a2
·
verified ·
1 Parent(s): a55fb64

Update public/index.html

Browse files
Files changed (1) hide show
  1. public/index.html +124 -0
public/index.html CHANGED
@@ -187,6 +187,130 @@ python3 client.py
187
  </div>
188
  </section>
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  <footer>
191
  <p>Axis · Agent — Client delivery by TanDev. Status: <a href="/status">/status</a></p>
192
  </footer>
 
187
  </div>
188
  </section>
189
 
190
+ <!-- TUTORIAL -->
191
+ <section class="grid-1">
192
+ <div class="card">
193
+ <h3>Tutorial: Plan → Review → Execute (client-side)</h3>
194
+
195
+ <p class="muted">
196
+ Axis client asks the server to <b>plan</b>, then lets you <b>review</b> and <b>run locally</b>.
197
+ The server never executes shell commands; the client does (with danger checks).
198
+ </p>
199
+
200
+ <ol style="margin: 0 0 10px 18px;">
201
+ <li><b>Launch the client</b> (sets/reads your API key, pings the server):
202
+ <pre><button class="copy" aria-label="Copy">Copy</button><code>
203
+ python3 client.py --server https://tandevllc-axis.hf.space
204
+ # (or export LLAMA_SERVER and just run `python3 client.py`)
205
+ </code></pre>
206
+ </li>
207
+
208
+ <li><b>Type what you want</b> in natural language (e.g. “create a Flask hello-world app and run it”).
209
+ The client calls <code>/infer</code> and shows a planned JSON with steps.</li>
210
+
211
+ <li><b>Review the plan</b> in a Rich table and pick:
212
+ <ul class="check" style="margin-top:6px">
213
+ <li><b>[a]</b> Execute all — runs steps locally in order</li>
214
+ <li><b>[s]</b> Step-by-step — confirm/edit/skip each step</li>
215
+ <li><b>[e]</b> Edit plan — opens JSON in <code>$EDITOR</code> before running</li>
216
+ <li><b>[d]</b> Toggle dry-run — preview only (no changes)</li>
217
+ <li><b>[c]</b> Cancel</li>
218
+ </ul>
219
+ </li>
220
+
221
+ <li><b>Danger gate</b> for risky shell commands (e.g., <code>rm -rf /</code>, <code>curl | sh</code>, <code>mkfs.*</code>):
222
+ you’ll be asked to type <code>proceed</code> to continue. This is client-side safety.</li>
223
+
224
+ <li><b>See results</b> for every step with pretty panels (stdout/stderr, bytes written, file previews, etc.).
225
+ All transcripts & artifacts are saved under:
226
+ <pre><button class="copy" aria-label="Copy">Copy</button><code>
227
+ ~/.llama3_agent/sessions/<timestamp>/
228
+ </code></pre>
229
+ </li>
230
+ </ol>
231
+
232
+ <p class="muted" style="margin-top:8px">
233
+ <b>Meta commands</b> (type at the client prompt, start with a colon):
234
+ </p>
235
+ <pre><button class="copy" aria-label="Copy">Copy</button><code>
236
+ :server # show current server
237
+ :server https://... # change server
238
+ :apikey set # save/replace API key into ./client/key.json
239
+ :apikey clear # delete saved key (will prompt next run)
240
+ :history # list recent sessions
241
+ :open <path> # open file in a pager
242
+ :clear # clear screen
243
+ :help # help
244
+ </code></pre>
245
+
246
+ <p class="muted" style="margin-top:8px">
247
+ <b>Tips</b>: Works great with Llama-3 8B; TinyLlama on HF is fine for lightweight tasks. You can write long-form content,
248
+ scaffold apps (Flask, etc.), generate files/trees, and manipulate your local filesystem safely.
249
+ </p>
250
+ </div>
251
+
252
+ <div class="card">
253
+ <h3>Step Types Reference (what the plan can do)</h3>
254
+ <p class="muted">Here’s what the client understands and how each step behaves locally.</p>
255
+
256
+ <ul class="check">
257
+ <li><code>shell</code> — run a shell command (OS-aware). Danger-checked before execution.</li>
258
+ <li><code>read_file</code> — print a file’s content with syntax highlighting.</li>
259
+ <li><code>write_file</code> / <code>edit_file</code> / <code>append_file</code> — create/modify files (UTF-8).</li>
260
+ <li><code>rewrite_file</code> — sends current file + instruction to server to rewrite, then saves locally.</li>
261
+ <li><code>mkdirs</code> — create one or more directories (parents OK).</li>
262
+ <li><code>generate_file</code> — ask the model to generate content and save it.</li>
263
+ <li><code>generate_tree</code> — generate multiple files (each via <code>/gen</code>) into a project structure.</li>
264
+ <li><code>generate_large_file</code> — build a big file from multiple generated chunks.</li>
265
+ <li><code>python</code> — run a small Python snippet locally and capture stdout.</li>
266
+ <li><code>respond</code> / <code>respond_llm</code> — show text to you (LLM-assisted for the latter).</li>
267
+ <li><code>fs</code> — filesystem helpers:
268
+ <code>list</code>, <code>read</code>, <code>write</code>, <code>append</code>, <code>mkdir</code>,
269
+ <code>remove</code> (non-recursive), <code>move</code>, <code>copy</code>, <code>exists</code>, <code>glob</code>.
270
+ </li>
271
+ </ul>
272
+
273
+ <p class="muted" style="margin-top:8px"><b>Examples</b></p>
274
+
275
+ <pre><button class="copy" aria-label="Copy">Copy</button><code># Ask: “Make me a Flask hello-world app and run it on port 5001.”
276
+ # Typical planned steps might include:
277
+ {
278
+ "steps": [
279
+ {"type":"mkdirs","paths":["app"]},
280
+ {"type":"write_file","path":"app/app.py","content":"from flask import Flask\napp=Flask(__name__)\n@app.get('/')\ndef hi():\n return 'hi'\n\nif __name__=='__main__':\n app.run(port=5001)"},
281
+ {"type":"shell","cmd":{"unix":"python3 -m pip install flask","windows":"py -m pip install flask"}},
282
+ {"type":"shell","cmd":{"unix":"python3 app/app.py","windows":"py app/app.py"}}
283
+ ]
284
+ }
285
+ </code></pre>
286
+
287
+ <pre><button class="copy" aria-label="Copy">Copy</button><code># Ask: “Draft a 700-word article on RAG for cybersecurity and save to docs/rag.md.”
288
+ {
289
+ "steps": [
290
+ {"type":"mkdirs","paths":["docs"]},
291
+ {"type":"generate_file","format":"markdown","instruction":"700-word article on RAG for cybersecurity, well-structured with headings and bullets","length":"long","path":"docs/rag.md"},
292
+ {"type":"read_file","path":"docs/rag.md"}
293
+ ]
294
+ }
295
+ </code></pre>
296
+
297
+ <pre><button class="copy" aria-label="Copy">Copy</button><code># Ask: “Scan my project folder and list all Python files; show me if README exists.”
298
+ {
299
+ "steps": [
300
+ {"type":"fs","op":"glob","pattern":"**/*.py"},
301
+ {"type":"fs","op":"exists","path":"README.md"}
302
+ ]
303
+ }
304
+ </code></pre>
305
+
306
+ <p class="muted" style="margin-top:8px">
307
+ <b>Notes</b>: <code>remove</code> is non-recursive on purpose; dangerous recursive deletes will trigger the danger gate.
308
+ Shell commands are executed with <code>subprocess.run(..., shell=True)</code> locally, with captured stdout/stderr and return code panels.
309
+ </p>
310
+ </div>
311
+ </section>
312
+
313
+
314
  <footer>
315
  <p>Axis · Agent — Client delivery by TanDev. Status: <a href="/status">/status</a></p>
316
  </footer>