loki-mode 6.73.0 → 6.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -0
- package/SKILL.md +8 -4
- package/VERSION +1 -1
- package/dashboard/__init__.py +1 -1
- package/dashboard/server.py +247 -1
- package/docs/DEMOS.md +80 -0
- package/docs/INSTALLATION.md +1 -1
- package/docs/walkthrough/README.md +50 -0
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
- package/web-app/dist/assets/AdminPage-_tI-DDJH.js +32 -0
- package/web-app/dist/assets/Avatar-CzqKTLpE.js +6 -0
- package/web-app/dist/assets/{Badge-B2YpXmSD.js → Badge-D1wzRJkX.js} +1 -1
- package/web-app/dist/assets/{Button-6PFunbl1.js → Button-CYGcdukI.js} +1 -1
- package/web-app/dist/assets/ComparePage-ZQ92Ob4z.js +1 -0
- package/web-app/dist/assets/GitHubIssuesPanel-C0QQO7rE.js +17 -0
- package/web-app/dist/assets/GitHubPRsPanel-D_dcefsN.js +17 -0
- package/web-app/dist/assets/HomePage-hXF60uhR.js +28 -0
- package/web-app/dist/assets/{LoginPage-2aPfdDKK.js → LoginPage-BB5ovU-v.js} +1 -1
- package/web-app/dist/assets/MetricsPage-CDktpwJU.js +6 -0
- package/web-app/dist/assets/NotFoundPage-ChbuKZug.js +1 -0
- package/web-app/dist/assets/ProjectPage-Bg_iB9fR.js +287 -0
- package/web-app/dist/assets/ProjectsPage-CtYbkLUY.js +6 -0
- package/web-app/dist/assets/SettingsPage-Dv9LWh__.js +10 -0
- package/web-app/dist/assets/ShowcasePage-CUcwmKXK.js +1 -0
- package/web-app/dist/assets/SystemSettingsPage-wExXyxQ-.js +6 -0
- package/web-app/dist/assets/TeamsPage-vfNcTTrZ.js +11 -0
- package/web-app/dist/assets/{TemplatesPage-C1qz6lEI.js → TemplatesPage-DykEaiQv.js} +7 -17
- package/web-app/dist/assets/TerminalOutput-elG2cTB3.js +36 -0
- package/web-app/dist/assets/{activity-B1CD-TSg.js → activity-Cc_Lxe6l.js} +1 -1
- package/web-app/dist/assets/bell-CaP8yKuo.js +6 -0
- package/web-app/dist/assets/{bot-Bdc-A4yN.js → bot-Czr4bhA-.js} +1 -1
- package/web-app/dist/assets/{check-Doaz68KQ.js → check-CyZMFrVP.js} +1 -1
- package/web-app/dist/assets/{chevron-left-Cm8ECK4v.js → chevron-left-B7GlH2RP.js} +1 -1
- package/web-app/dist/assets/{circle-alert-BmN-yR7A.js → circle-alert-Cn3wOAee.js} +1 -1
- package/web-app/dist/assets/{clock-CQslsKPy.js → clock-BgDwqVg2.js} +1 -1
- package/web-app/dist/assets/{cloud-DoJyXVzT.js → cloud-7zbPlpRr.js} +1 -1
- package/web-app/dist/assets/{copy-C3zdfDDI.js → copy-C3mlG0DN.js} +1 -1
- package/web-app/dist/assets/{database-DOPfEbC0.js → database-ndWcDAoa.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-ioMWPPqR.js → dollar-sign-DvbonzNh.js} +1 -1
- package/web-app/dist/assets/file-code-corner-CN598VYP.js +6 -0
- package/web-app/dist/assets/file-plus-C73kytfr.js +6 -0
- package/web-app/dist/assets/{folder-open-CpHfutum.js → folder-open-fgrz3ALE.js} +1 -1
- package/web-app/dist/assets/git-commit-horizontal-C5o2smjW.js +6 -0
- package/web-app/dist/assets/{globe-CDrN7PCM.js → globe--RVntJ63.js} +1 -1
- package/web-app/dist/assets/{hammer-DGz2E8op.js → hammer-B8rdFNHw.js} +1 -1
- package/web-app/dist/assets/index-C7230tHo.js +433 -0
- package/web-app/dist/assets/index-CVM4A1Fw.css +1 -0
- package/web-app/dist/assets/{layers-D4__wU3f.js → layers-DBVHQA2R.js} +1 -1
- package/web-app/dist/assets/lightbulb-Drr3GVJK.js +6 -0
- package/web-app/dist/assets/{loader-circle-LaNjK2Ca.js → loader-circle-eykWmnmB.js} +1 -1
- package/web-app/dist/assets/{lock-jithjpv-.js → lock-DPhzdbD8.js} +1 -1
- package/web-app/dist/assets/mail-Jt2RYOPJ.js +6 -0
- package/web-app/dist/assets/{package-B37MPAQL.js → package-DAXMJ7Pm.js} +1 -1
- package/web-app/dist/assets/{plus-DnXmNF4F.js → plus-D41LllNi.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-Bv7cRQU9.js → refresh-cw-Dg7n3s0V.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-DyVycTkQ.js → rotate-ccw-bG8iIrQc.js} +1 -1
- package/web-app/dist/assets/{save-EoKxa6D5.js → save-eazGhHFM.js} +1 -1
- package/web-app/dist/assets/{server-xs5YRQ1G.js → server-BdKIWXiX.js} +1 -1
- package/web-app/dist/assets/{shield-alert-DdvWsEnr.js → shield-alert-i0zGOCu8.js} +1 -1
- package/web-app/dist/assets/{trash-2-DuMPmhre.js → trash-2-CdvB-je7.js} +1 -1
- package/web-app/dist/assets/trending-down-BYkSeH-T.js +11 -0
- package/web-app/dist/assets/trending-up-CwXOwbN7.js +6 -0
- package/web-app/dist/assets/{usePolling-BI5O87hl.js → usePolling-BSLSkfKL.js} +1 -1
- package/web-app/dist/assets/user-CmBX1sm3.js +6 -0
- package/web-app/dist/index.html +2 -2
- package/web-app/server.py +1309 -12
- package/web-app/dist/assets/AdminPage-CTcfgS9M.js +0 -37
- package/web-app/dist/assets/HomePage-CWPTs6Ny.js +0 -23
- package/web-app/dist/assets/NotFoundPage-CM06geaR.js +0 -1
- package/web-app/dist/assets/ProjectPage-zaTHn-rD.js +0 -279
- package/web-app/dist/assets/ProjectsPage-CBbcfwPE.js +0 -6
- package/web-app/dist/assets/SettingsPage-vnLw2AsI.js +0 -10
- package/web-app/dist/assets/SystemSettingsPage-Djua8I-d.js +0 -11
- package/web-app/dist/assets/TeamsPage-JdDix27H.js +0 -11
- package/web-app/dist/assets/TerminalOutput-we0dKa2X.js +0 -31
- package/web-app/dist/assets/chart-column-DUGqXesc.js +0 -6
- package/web-app/dist/assets/index-DSunGxXZ.js +0 -408
- package/web-app/dist/assets/index-DVvFZfV7.css +0 -1
- package/web-app/dist/assets/shield-check-BoCLhMZJ.js +0 -6
- package/web-app/dist/assets/user-znfHSjbe.js +0 -16
package/LICENSE
CHANGED
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: loki-mode
|
|
|
3
3
|
description: Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with minimal human intervention. Requires --dangerously-skip-permissions flag.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Loki Mode v6.
|
|
6
|
+
# Loki Mode v6.74.0
|
|
7
7
|
|
|
8
8
|
**You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ Execute these steps IN ORDER at the start of EVERY turn:
|
|
|
21
21
|
- Load 1-2 modules matching your current phase
|
|
22
22
|
- Register session: Write .loki/session.json with:
|
|
23
23
|
{"pid": null, "startedAt": "<ISO timestamp>", "provider": "<provider>",
|
|
24
|
-
"invokedVia": "skill", "status": "running"}
|
|
24
|
+
"invokedVia": "skill", "status": "running", "updatedAt": "<ISO timestamp>"}
|
|
25
25
|
|
|
26
26
|
2. Read .loki/state/orchestrator.json
|
|
27
27
|
- Extract: currentPhase, tasksCompleted, tasksFailed
|
|
@@ -32,6 +32,10 @@ Execute these steps IN ORDER at the start of EVERY turn:
|
|
|
32
32
|
|
|
33
33
|
4. Check .loki/PAUSE - IF exists: Stop work, wait for removal.
|
|
34
34
|
Check .loki/STOP - IF exists: End session, update session.json status to "stopped".
|
|
35
|
+
|
|
36
|
+
5. EVERY TURN: Update .loki/session.json "updatedAt" field to current ISO timestamp.
|
|
37
|
+
This keeps the dashboard aware the skill session is alive. Sessions without
|
|
38
|
+
an update in 5 minutes are treated as stale/stopped by the dashboard.
|
|
35
39
|
```
|
|
36
40
|
|
|
37
41
|
---
|
|
@@ -137,7 +141,7 @@ GROWTH ──[continuous improvement loop]──> GROWTH
|
|
|
137
141
|
|
|
138
142
|
| File | Read | Write |
|
|
139
143
|
|------|------|-------|
|
|
140
|
-
| `.loki/session.json` | Session start | Session start (register), session end (
|
|
144
|
+
| `.loki/session.json` | Session start | Session start (register), every turn (updatedAt), session end (status) |
|
|
141
145
|
| `.loki/state/orchestrator.json` | Every turn | On phase change |
|
|
142
146
|
| `.loki/queue/pending.json` | Every turn | When claiming/completing tasks |
|
|
143
147
|
| `.loki/queue/current-task.json` | Before each ACT | When claiming task |
|
|
@@ -268,4 +272,4 @@ The following features are documented in skill modules but not yet fully automat
|
|
|
268
272
|
| Quality gates 3-reviewer system | Implemented (v5.35.0) | 5 specialist reviewers in `skills/quality-gates.md`; execution in run.sh |
|
|
269
273
|
| Benchmarks (HumanEval, SWE-bench) | Infrastructure only | Runner scripts and datasets exist in `benchmarks/`; no published results |
|
|
270
274
|
|
|
271
|
-
**v6.
|
|
275
|
+
**v6.74.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.
|
|
1
|
+
6.74.0
|
package/dashboard/__init__.py
CHANGED
package/dashboard/server.py
CHANGED
|
@@ -345,8 +345,12 @@ async def _push_loki_state_loop() -> None:
|
|
|
345
345
|
|
|
346
346
|
Reads dashboard-state.json every 2s when running (30s when idle) and
|
|
347
347
|
broadcasts a state_update message so clients don't rely solely on polling.
|
|
348
|
+
|
|
349
|
+
When dashboard-state.json is absent (skill-invoked sessions), reads state
|
|
350
|
+
from session.json + orchestrator.json + queue files instead.
|
|
348
351
|
"""
|
|
349
352
|
last_mtime: float = 0.0
|
|
353
|
+
_last_skill_hash: str = "" # Track skill-session state changes
|
|
350
354
|
while True:
|
|
351
355
|
try:
|
|
352
356
|
if not manager.active_connections:
|
|
@@ -355,6 +359,9 @@ async def _push_loki_state_loop() -> None:
|
|
|
355
359
|
|
|
356
360
|
loki_dir = _get_loki_dir()
|
|
357
361
|
state_file = loki_dir / "dashboard-state.json"
|
|
362
|
+
_session_file = loki_dir / "session.json"
|
|
363
|
+
|
|
364
|
+
_broadcast_sent = False
|
|
358
365
|
|
|
359
366
|
if state_file.exists():
|
|
360
367
|
try:
|
|
@@ -397,6 +404,15 @@ async def _push_loki_state_loop() -> None:
|
|
|
397
404
|
except (ValueError, OSError, ProcessLookupError):
|
|
398
405
|
pass
|
|
399
406
|
|
|
407
|
+
# Also check session.json for skill sessions
|
|
408
|
+
if not _pid_alive and _session_file.exists():
|
|
409
|
+
try:
|
|
410
|
+
_sd = _safe_json_read(_session_file, {})
|
|
411
|
+
if _sd.get("status") == "running":
|
|
412
|
+
_pid_alive = True
|
|
413
|
+
except (json.JSONDecodeError, KeyError):
|
|
414
|
+
pass
|
|
415
|
+
|
|
400
416
|
status_str = raw.get("mode", "autonomous")
|
|
401
417
|
if not _pid_alive:
|
|
402
418
|
status_str = "stopped"
|
|
@@ -423,9 +439,128 @@ async def _push_loki_state_loop() -> None:
|
|
|
423
439
|
"type": "status_update",
|
|
424
440
|
"data": payload,
|
|
425
441
|
})
|
|
442
|
+
_broadcast_sent = True
|
|
426
443
|
except (json.JSONDecodeError, OSError, KeyError):
|
|
427
444
|
pass
|
|
428
445
|
|
|
446
|
+
# Skill-session fallback: when dashboard-state.json is missing,
|
|
447
|
+
# read state from session.json + orchestrator.json + queue files
|
|
448
|
+
if not _broadcast_sent and _session_file.exists():
|
|
449
|
+
try:
|
|
450
|
+
_sd = _safe_json_read(_session_file, {})
|
|
451
|
+
if _sd.get("status") == "running":
|
|
452
|
+
# Validate freshness (5 min staleness threshold)
|
|
453
|
+
_sk_ts = _sd.get("updatedAt") or _sd.get("startedAt", "")
|
|
454
|
+
_sk_fresh = True
|
|
455
|
+
if _sk_ts:
|
|
456
|
+
try:
|
|
457
|
+
_sk_dt = datetime.fromisoformat(
|
|
458
|
+
_sk_ts.replace("Z", "+00:00")
|
|
459
|
+
)
|
|
460
|
+
if _sk_dt.tzinfo is None:
|
|
461
|
+
_sk_dt = _sk_dt.replace(tzinfo=timezone.utc)
|
|
462
|
+
if (datetime.now(timezone.utc) - _sk_dt).total_seconds() > 300:
|
|
463
|
+
_sk_fresh = False
|
|
464
|
+
except (ValueError, AttributeError):
|
|
465
|
+
pass
|
|
466
|
+
else:
|
|
467
|
+
try:
|
|
468
|
+
if time.time() - _session_file.stat().st_mtime > 300:
|
|
469
|
+
_sk_fresh = False
|
|
470
|
+
except OSError:
|
|
471
|
+
pass
|
|
472
|
+
|
|
473
|
+
if _sk_fresh:
|
|
474
|
+
# Read version from VERSION file
|
|
475
|
+
_sk_version = ""
|
|
476
|
+
_vf = _Path(os.path.dirname(os.path.dirname(__file__))) / "VERSION"
|
|
477
|
+
if _vf.is_file():
|
|
478
|
+
try:
|
|
479
|
+
_sk_version = _vf.read_text().strip()
|
|
480
|
+
except OSError:
|
|
481
|
+
pass
|
|
482
|
+
|
|
483
|
+
# Read orchestrator state
|
|
484
|
+
_sk_phase = ""
|
|
485
|
+
_sk_iteration = 0
|
|
486
|
+
_sk_complexity = "standard"
|
|
487
|
+
_orch_f = loki_dir / "state" / "orchestrator.json"
|
|
488
|
+
if _orch_f.exists():
|
|
489
|
+
try:
|
|
490
|
+
_orch = _safe_json_read(_orch_f, {})
|
|
491
|
+
_sk_phase = _orch.get("currentPhase", "") or ""
|
|
492
|
+
_sk_iteration = _orch.get("iteration", 0)
|
|
493
|
+
_sk_complexity = _orch.get("complexity", "standard") or "standard"
|
|
494
|
+
except (json.JSONDecodeError, KeyError):
|
|
495
|
+
pass
|
|
496
|
+
|
|
497
|
+
# Read pending tasks
|
|
498
|
+
_sk_pending = 0
|
|
499
|
+
_sk_current_task = ""
|
|
500
|
+
_pf = loki_dir / "queue" / "pending.json"
|
|
501
|
+
if _pf.exists():
|
|
502
|
+
try:
|
|
503
|
+
_pd = _safe_json_read(_pf, [])
|
|
504
|
+
_pt = _pd.get("tasks", _pd) if isinstance(_pd, dict) else _pd
|
|
505
|
+
if isinstance(_pt, list):
|
|
506
|
+
_sk_pending = len(_pt)
|
|
507
|
+
except (json.JSONDecodeError, KeyError, AttributeError):
|
|
508
|
+
pass
|
|
509
|
+
|
|
510
|
+
_ipf = loki_dir / "queue" / "in-progress.json"
|
|
511
|
+
if _ipf.exists():
|
|
512
|
+
try:
|
|
513
|
+
_ipd = _safe_json_read(_ipf, [])
|
|
514
|
+
_ipt = _ipd.get("tasks", _ipd) if isinstance(_ipd, dict) else _ipd
|
|
515
|
+
if isinstance(_ipt, list) and _ipt:
|
|
516
|
+
_f = _ipt[0]
|
|
517
|
+
if isinstance(_f, dict):
|
|
518
|
+
_sk_current_task = (
|
|
519
|
+
_f.get("title", "")
|
|
520
|
+
or _f.get("payload", {}).get("action", "")
|
|
521
|
+
or _f.get("id", "")
|
|
522
|
+
)
|
|
523
|
+
except (json.JSONDecodeError, KeyError, AttributeError):
|
|
524
|
+
pass
|
|
525
|
+
|
|
526
|
+
if not _sk_current_task:
|
|
527
|
+
_ctf = loki_dir / "queue" / "current-task.json"
|
|
528
|
+
if _ctf.exists():
|
|
529
|
+
try:
|
|
530
|
+
_ct = _safe_json_read(_ctf, {})
|
|
531
|
+
if isinstance(_ct, dict):
|
|
532
|
+
_sk_current_task = (
|
|
533
|
+
_ct.get("title", "")
|
|
534
|
+
or _ct.get("payload", {}).get("action", "")
|
|
535
|
+
or _ct.get("id", "")
|
|
536
|
+
)
|
|
537
|
+
except (json.JSONDecodeError, KeyError, AttributeError):
|
|
538
|
+
pass
|
|
539
|
+
|
|
540
|
+
# Build a change hash to avoid redundant broadcasts
|
|
541
|
+
_sk_hash = f"{_sk_phase}:{_sk_iteration}:{_sk_pending}:{_sk_current_task}"
|
|
542
|
+
if _sk_hash != _last_skill_hash:
|
|
543
|
+
_last_skill_hash = _sk_hash
|
|
544
|
+
payload = {
|
|
545
|
+
"status": "running",
|
|
546
|
+
"phase": _sk_phase,
|
|
547
|
+
"iteration": _sk_iteration,
|
|
548
|
+
"complexity": _sk_complexity,
|
|
549
|
+
"mode": "autonomous",
|
|
550
|
+
"provider": _sd.get("provider", "claude"),
|
|
551
|
+
"running_agents": 0,
|
|
552
|
+
"pending_tasks": _sk_pending,
|
|
553
|
+
"current_task": _sk_current_task,
|
|
554
|
+
"version": _sk_version,
|
|
555
|
+
}
|
|
556
|
+
await manager.broadcast({
|
|
557
|
+
"type": "status_update",
|
|
558
|
+
"data": payload,
|
|
559
|
+
})
|
|
560
|
+
_broadcast_sent = True
|
|
561
|
+
except (json.JSONDecodeError, OSError, KeyError):
|
|
562
|
+
pass
|
|
563
|
+
|
|
429
564
|
# Poll faster when a session is running
|
|
430
565
|
pid_file = loki_dir / "loki.pid"
|
|
431
566
|
is_running = False
|
|
@@ -437,6 +572,15 @@ async def _push_loki_state_loop() -> None:
|
|
|
437
572
|
except (ValueError, OSError, ProcessLookupError):
|
|
438
573
|
pass
|
|
439
574
|
|
|
575
|
+
# Also consider skill sessions as "running" for poll interval
|
|
576
|
+
if not is_running and _session_file.exists():
|
|
577
|
+
try:
|
|
578
|
+
_sd2 = _safe_json_read(_session_file, {})
|
|
579
|
+
if _sd2.get("status") == "running":
|
|
580
|
+
is_running = True
|
|
581
|
+
except (json.JSONDecodeError, KeyError):
|
|
582
|
+
pass
|
|
583
|
+
|
|
440
584
|
await asyncio.sleep(2.0 if is_running else 30.0)
|
|
441
585
|
except asyncio.CancelledError:
|
|
442
586
|
return
|
|
@@ -598,9 +742,12 @@ async def get_status() -> StatusResponse:
|
|
|
598
742
|
running_agents = 0
|
|
599
743
|
|
|
600
744
|
# Read dashboard state (with retry for concurrent writes)
|
|
745
|
+
_has_dashboard_state = False
|
|
601
746
|
if state_file.exists():
|
|
602
747
|
try:
|
|
603
748
|
state = _safe_json_read(state_file, {})
|
|
749
|
+
if state:
|
|
750
|
+
_has_dashboard_state = True
|
|
604
751
|
phase = state.get("phase", "")
|
|
605
752
|
iteration = state.get("iteration", 0)
|
|
606
753
|
complexity = state.get("complexity", "standard")
|
|
@@ -641,14 +788,113 @@ async def get_status() -> StatusResponse:
|
|
|
641
788
|
pass
|
|
642
789
|
|
|
643
790
|
# Also check session.json for skill-invoked sessions
|
|
791
|
+
_skill_session = False
|
|
644
792
|
if not running and session_file.exists():
|
|
645
793
|
try:
|
|
646
794
|
sd = _safe_json_read(session_file, {})
|
|
647
795
|
if sd.get("status") == "running":
|
|
648
|
-
|
|
796
|
+
# Validate freshness: session.json must have been updated within
|
|
797
|
+
# the last 5 minutes to be considered active (skill agents update
|
|
798
|
+
# it each turn). Fall back to file mtime if no timestamp field.
|
|
799
|
+
_session_fresh = True
|
|
800
|
+
_session_ts = sd.get("updatedAt") or sd.get("startedAt", "")
|
|
801
|
+
if _session_ts:
|
|
802
|
+
try:
|
|
803
|
+
_sdt = datetime.fromisoformat(
|
|
804
|
+
_session_ts.replace("Z", "+00:00")
|
|
805
|
+
)
|
|
806
|
+
if _sdt.tzinfo is None:
|
|
807
|
+
_sdt = _sdt.replace(tzinfo=timezone.utc)
|
|
808
|
+
_age = (datetime.now(timezone.utc) - _sdt).total_seconds()
|
|
809
|
+
if _age > 300:
|
|
810
|
+
_session_fresh = False
|
|
811
|
+
except (ValueError, AttributeError):
|
|
812
|
+
pass
|
|
813
|
+
else:
|
|
814
|
+
# No timestamp -- check file mtime
|
|
815
|
+
try:
|
|
816
|
+
_mtime = session_file.stat().st_mtime
|
|
817
|
+
_age = time.time() - _mtime
|
|
818
|
+
if _age > 300:
|
|
819
|
+
_session_fresh = False
|
|
820
|
+
except OSError:
|
|
821
|
+
pass
|
|
822
|
+
|
|
823
|
+
if _session_fresh:
|
|
824
|
+
running = True
|
|
825
|
+
_skill_session = True
|
|
826
|
+
# Pull provider from session.json if available
|
|
827
|
+
_sp = sd.get("provider", "")
|
|
828
|
+
if _sp:
|
|
829
|
+
provider = _sp
|
|
649
830
|
except (json.JSONDecodeError, KeyError):
|
|
650
831
|
pass
|
|
651
832
|
|
|
833
|
+
# When running as a skill (no dashboard-state.json), read state from
|
|
834
|
+
# the orchestrator and queue files that the skill agent writes directly.
|
|
835
|
+
if _skill_session and not _has_dashboard_state:
|
|
836
|
+
orch_file = loki_dir / "state" / "orchestrator.json"
|
|
837
|
+
if orch_file.exists():
|
|
838
|
+
try:
|
|
839
|
+
orch = _safe_json_read(orch_file, {})
|
|
840
|
+
phase = orch.get("currentPhase", phase) or phase
|
|
841
|
+
iteration = orch.get("iteration", iteration)
|
|
842
|
+
complexity = orch.get("complexity", complexity) or complexity
|
|
843
|
+
_metrics = orch.get("metrics", {})
|
|
844
|
+
if isinstance(_metrics, dict):
|
|
845
|
+
_tc = _metrics.get("tasksCompleted", 0)
|
|
846
|
+
_tf = _metrics.get("tasksFailed", 0)
|
|
847
|
+
if isinstance(_tc, (int, float)):
|
|
848
|
+
pass # available for future use
|
|
849
|
+
except (json.JSONDecodeError, KeyError):
|
|
850
|
+
pass
|
|
851
|
+
|
|
852
|
+
# Read pending task count from queue files
|
|
853
|
+
_q_pending = loki_dir / "queue" / "pending.json"
|
|
854
|
+
if _q_pending.exists():
|
|
855
|
+
try:
|
|
856
|
+
_qd = _safe_json_read(_q_pending, [])
|
|
857
|
+
_tasks = _qd.get("tasks", _qd) if isinstance(_qd, dict) else _qd
|
|
858
|
+
if isinstance(_tasks, list):
|
|
859
|
+
pending_tasks = len(_tasks)
|
|
860
|
+
except (json.JSONDecodeError, KeyError, AttributeError):
|
|
861
|
+
pass
|
|
862
|
+
|
|
863
|
+
# Read current task from in-progress queue
|
|
864
|
+
_q_inprog = loki_dir / "queue" / "in-progress.json"
|
|
865
|
+
if _q_inprog.exists():
|
|
866
|
+
try:
|
|
867
|
+
_ipd = _safe_json_read(_q_inprog, [])
|
|
868
|
+
_ip_tasks = _ipd.get("tasks", _ipd) if isinstance(_ipd, dict) else _ipd
|
|
869
|
+
if isinstance(_ip_tasks, list) and _ip_tasks:
|
|
870
|
+
_first = _ip_tasks[0]
|
|
871
|
+
if isinstance(_first, dict):
|
|
872
|
+
current_task = (
|
|
873
|
+
_first.get("title", "")
|
|
874
|
+
or _first.get("payload", {}).get("action", "")
|
|
875
|
+
or _first.get("id", "")
|
|
876
|
+
)
|
|
877
|
+
except (json.JSONDecodeError, KeyError, AttributeError):
|
|
878
|
+
pass
|
|
879
|
+
|
|
880
|
+
# Read current-task.json (skill agents write this when claiming a task)
|
|
881
|
+
_q_current = loki_dir / "queue" / "current-task.json"
|
|
882
|
+
if not current_task and _q_current.exists():
|
|
883
|
+
try:
|
|
884
|
+
_ct = _safe_json_read(_q_current, {})
|
|
885
|
+
if isinstance(_ct, dict):
|
|
886
|
+
current_task = (
|
|
887
|
+
_ct.get("title", "")
|
|
888
|
+
or _ct.get("payload", {}).get("action", "")
|
|
889
|
+
or _ct.get("id", "")
|
|
890
|
+
)
|
|
891
|
+
except (json.JSONDecodeError, KeyError, AttributeError):
|
|
892
|
+
pass
|
|
893
|
+
|
|
894
|
+
# Skill sessions are autonomous by definition
|
|
895
|
+
if not mode:
|
|
896
|
+
mode = "autonomous"
|
|
897
|
+
|
|
652
898
|
# Determine status string
|
|
653
899
|
if not running:
|
|
654
900
|
status = "stopped"
|
package/docs/DEMOS.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Loki Mode -- Interactive Content Index
|
|
2
|
+
|
|
3
|
+
Complete listing of all interactive HTML experiences in the Loki Mode repository. 18 files total across three categories.
|
|
4
|
+
|
|
5
|
+
## Walkthroughs (11 HTML files)
|
|
6
|
+
|
|
7
|
+
Located in `docs/walkthrough/`.
|
|
8
|
+
|
|
9
|
+
| File | Title | Description | Size |
|
|
10
|
+
|------|-------|-------------|------|
|
|
11
|
+
| `index.html` | Build Your First App | Step-by-step tutorial from PRD to deployment | 43 KB |
|
|
12
|
+
| `architecture.html` | System Architecture | Interactive SVG diagram of the full system | 34 KB |
|
|
13
|
+
| `comparison.html` | Feature Comparison | Loki Mode vs competitor feature matrix | 26 KB |
|
|
14
|
+
| `gallery.html` | Project Gallery | 24 example projects across categories | 37 KB |
|
|
15
|
+
| `video-placeholder.html` | Build Process Animation | CSS-animated build walkthrough | 25 KB |
|
|
16
|
+
| `build-demo.html` | Full Build Video Demo | 12-iteration build replay with timeline | 18 KB |
|
|
17
|
+
| `ide-demo.html` | Purple Lab IDE Demo | Browser-based IDE mockup with editor and build panel | 17 KB |
|
|
18
|
+
| `enterprise-demo.html` | Enterprise Features Demo | Audit logging, RBAC, security, compliance | 13 KB |
|
|
19
|
+
| `provider-race-demo.html` | Multi-Provider Race Demo | Claude vs Codex vs Gemini animated race | 17 KB |
|
|
20
|
+
| `memory-demo.html` | Memory System Demo | Three-layer memory with interactive exploration | 19 KB |
|
|
21
|
+
| `dashboard-demo.html` | Dashboard Monitoring Demo | Real-time dashboard with live build log | 17 KB |
|
|
22
|
+
|
|
23
|
+
**Hub page**: `docs/walkthrough/hub.html` links to all walkthroughs with categories and estimated durations.
|
|
24
|
+
|
|
25
|
+
## Demo Apps (6 HTML files)
|
|
26
|
+
|
|
27
|
+
Located in `examples/`. Each was generated by Loki Mode from a single prompt.
|
|
28
|
+
|
|
29
|
+
| File | Title | Description | Size |
|
|
30
|
+
|------|-------|-------------|------|
|
|
31
|
+
| `demo-saas-dashboard.html` | SaaS Dashboard | KPI cards, sparklines, revenue chart, activity feed | 9 KB |
|
|
32
|
+
| `demo-task-manager.html` | Task Manager | Kanban board with drag-and-drop and localStorage | 9 KB |
|
|
33
|
+
| `demo-chat-app.html` | Chat App | Real-time chat with typing indicators and auto-scroll | 8 KB |
|
|
34
|
+
| `demo-landing-page.html` | Landing Page | Hero, features, pricing, FAQ accordion, newsletter | 15 KB |
|
|
35
|
+
| `demo-portfolio.html` | Portfolio | Animated gradients, skill bars, project cards, contact form | 12 KB |
|
|
36
|
+
| `demo-ecommerce.html` | E-Commerce | Product filters, sorting, star ratings, cart counter | 12 KB |
|
|
37
|
+
|
|
38
|
+
## Product Website (1 HTML file)
|
|
39
|
+
|
|
40
|
+
| File | Title | Description | Size |
|
|
41
|
+
|------|-------|-------------|------|
|
|
42
|
+
| `website/index.html` | Loki Mode Product Website | Full landing page with hero, terminal animation, features, pricing | 38 KB |
|
|
43
|
+
|
|
44
|
+
## Summary
|
|
45
|
+
|
|
46
|
+
| Category | Count | Total Size |
|
|
47
|
+
|----------|-------|------------|
|
|
48
|
+
| Walkthroughs | 11 | 266 KB |
|
|
49
|
+
| Demo Apps | 6 | 65 KB |
|
|
50
|
+
| Product Website | 1 | 38 KB |
|
|
51
|
+
| **Total** | **18** | **369 KB** |
|
|
52
|
+
|
|
53
|
+
## Viewing Locally
|
|
54
|
+
|
|
55
|
+
All files are self-contained HTML. Open directly in any browser:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Open the demo hub (links to everything)
|
|
59
|
+
open docs/walkthrough/hub.html
|
|
60
|
+
|
|
61
|
+
# Open a specific walkthrough
|
|
62
|
+
open docs/walkthrough/architecture.html
|
|
63
|
+
|
|
64
|
+
# Open a demo app
|
|
65
|
+
open examples/demo-saas-dashboard.html
|
|
66
|
+
|
|
67
|
+
# Or serve the entire repo with a local server
|
|
68
|
+
python3 -m http.server 8080
|
|
69
|
+
# Then visit http://localhost:8080/docs/walkthrough/hub.html
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Design
|
|
73
|
+
|
|
74
|
+
All interactive content shares these characteristics:
|
|
75
|
+
|
|
76
|
+
- **Self-contained** -- Single HTML file with embedded CSS and JavaScript
|
|
77
|
+
- **No build step** -- Open in any browser, works offline (except Google Fonts)
|
|
78
|
+
- **Dark theme** -- Consistent dark design with purple accent (#553DE9)
|
|
79
|
+
- **Responsive** -- Adapts to mobile, tablet, and desktop viewports
|
|
80
|
+
- **No external dependencies** -- No npm packages, no CDN libraries, no frameworks
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Loki Mode Walkthroughs
|
|
2
|
+
|
|
3
|
+
Interactive HTML walkthroughs demonstrating Loki Mode's capabilities. Each file is self-contained -- no external dependencies, no build step. Open in any browser.
|
|
4
|
+
|
|
5
|
+
## Walkthrough Files
|
|
6
|
+
|
|
7
|
+
| File | Description | Size |
|
|
8
|
+
|------|-------------|------|
|
|
9
|
+
| `index.html` | **Build Your First App** -- Step-by-step tutorial walking through a complete Loki Mode build from PRD to deployment | 43 KB |
|
|
10
|
+
| `architecture.html` | **System Architecture** -- Interactive SVG diagram showing the full Loki Mode architecture: RARV cycle, providers, memory, quality gates | 34 KB |
|
|
11
|
+
| `comparison.html` | **Feature Comparison** -- Side-by-side comparison of Loki Mode vs alternative AI build tools with interactive feature matrix | 26 KB |
|
|
12
|
+
| `gallery.html` | **Project Gallery** -- Showcase of 24 example projects built with Loki Mode across SaaS, CLI, mobile, and enterprise categories | 37 KB |
|
|
13
|
+
| `video-placeholder.html` | **Build Process Animation** -- CSS-animated walkthrough of the build process with terminal replay and phase transitions | 25 KB |
|
|
14
|
+
| `build-demo.html` | **Full Build Video Demo** -- Replay of a complete SaaS dashboard build showing all 12 iterations with timeline and progress tracking | 18 KB |
|
|
15
|
+
| `ide-demo.html` | **Purple Lab IDE Demo** -- Interactive mockup of the browser-based Purple Lab IDE with file explorer, editor, and Loki Mode status panel | 17 KB |
|
|
16
|
+
| `enterprise-demo.html` | **Enterprise Features Demo** -- Audit logging, RBAC, security architecture, compliance, and governance capabilities for organizations | 13 KB |
|
|
17
|
+
| `provider-race-demo.html` | **Multi-Provider Race Demo** -- Animated race comparing Claude, Codex, and Gemini building the same app simultaneously | 17 KB |
|
|
18
|
+
| `memory-demo.html` | **Memory System Demo** -- Interactive exploration of episodic, semantic, and procedural memory layers with progressive disclosure | 19 KB |
|
|
19
|
+
| `dashboard-demo.html` | **Dashboard Monitoring Demo** -- Real-time monitoring dashboard mockup with build log, agent status, task queue, and KPI tracking | 17 KB |
|
|
20
|
+
|
|
21
|
+
## Hub Page
|
|
22
|
+
|
|
23
|
+
Open `hub.html` for a landing page that links to all walkthroughs with descriptions and categories.
|
|
24
|
+
|
|
25
|
+
## How to View
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Open directly in browser
|
|
29
|
+
open docs/walkthrough/hub.html
|
|
30
|
+
|
|
31
|
+
# Or serve locally
|
|
32
|
+
cd docs/walkthrough && python3 -m http.server 8080
|
|
33
|
+
# Then visit http://localhost:8080/hub.html
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Design Conventions
|
|
37
|
+
|
|
38
|
+
All walkthroughs share a consistent design language:
|
|
39
|
+
|
|
40
|
+
- **Dark theme** with purple accent (#553DE9)
|
|
41
|
+
- **Inter** font for UI text, **JetBrains Mono** for code
|
|
42
|
+
- **Responsive** layouts that work on mobile, tablet, and desktop
|
|
43
|
+
- **Self-contained** HTML with embedded CSS and JavaScript
|
|
44
|
+
- **No external dependencies** beyond Google Fonts (optional, degrades gracefully)
|
|
45
|
+
|
|
46
|
+
## Related Content
|
|
47
|
+
|
|
48
|
+
- **Demo Apps**: See `examples/` for 6 functional app demos built by Loki Mode
|
|
49
|
+
- **Product Website**: See `website/index.html` for the full product landing page
|
|
50
|
+
- **Master Index**: See `docs/DEMOS.md` for a complete listing of all interactive content
|
package/mcp/__init__.py
CHANGED