loki-mode 7.128.0 → 7.128.2
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/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/lib/cockpit-render.sh +28 -2
- package/autonomy/loki +12 -1
- package/autonomy/run.sh +18 -12
- package/dashboard/__init__.py +1 -1
- package/dashboard/registry.py +44 -3
- package/docs/INSTALLATION.md +2 -2
- package/loki-ts/dist/cockpit.js +9 -9
- package/loki-ts/dist/loki.js +2 -2
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: loki-mode
|
|
|
3
3
|
description: Autonomous spec-driven build system with a built-in trust layer. It does not call work done until it is verified (RARV-C closure loop, 8 quality gates, completion council, verified-completion evidence gate). Triggers on "Loki Mode". Takes a spec (PRD, GitHub issue, OpenAPI doc, etc.) to deployed product with minimal human intervention. Provider-agnostic. Requires --dangerously-skip-permissions flag.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Loki Mode v7.128.
|
|
6
|
+
# Loki Mode v7.128.2
|
|
7
7
|
|
|
8
8
|
**You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
|
|
9
9
|
|
|
@@ -408,4 +408,4 @@ See `CHANGELOG.md` entries [7.5.7], [7.5.8], [7.5.13] for the per-fix list and r
|
|
|
408
408
|
|
|
409
409
|
---
|
|
410
410
|
|
|
411
|
-
**v7.128.
|
|
411
|
+
**v7.128.2 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.128.
|
|
1
|
+
7.128.2
|
|
@@ -131,20 +131,46 @@ fleet = []
|
|
|
131
131
|
runs = []
|
|
132
132
|
try:
|
|
133
133
|
from dashboard import registry
|
|
134
|
+
# Self-heal: mark dead-pid "running" zombies as stopped before reading the
|
|
135
|
+
# fleet, so the cockpit does not show 100+ frozen "BUILDING" entries from
|
|
136
|
+
# reaped/crashed sessions. Best-effort; a failure here never blocks the render.
|
|
137
|
+
try:
|
|
138
|
+
registry.reconcile_stale_runs()
|
|
139
|
+
except Exception:
|
|
140
|
+
pass
|
|
134
141
|
runs = registry.get_fleet_runs(include_inactive=True)
|
|
135
142
|
except Exception:
|
|
136
143
|
runs = []
|
|
137
144
|
|
|
138
145
|
for r in runs:
|
|
146
|
+
_running = bool(r.get("running"))
|
|
147
|
+
_status = (r.get("status") or "").lower()
|
|
148
|
+
# A not-running entry must not display an in-flight phase (BUILDING/etc): the
|
|
149
|
+
# reconciled registry status is authoritative for dead runs, so a stopped or
|
|
150
|
+
# stale run shows its status, not a frozen phase left in a stale state file.
|
|
151
|
+
if _running:
|
|
152
|
+
_phase = r.get("phase", "") or ""
|
|
153
|
+
elif _status in ("stale", "stopped", "completed", "failed"):
|
|
154
|
+
_phase = _status
|
|
155
|
+
else:
|
|
156
|
+
_phase = r.get("phase", "") or _status
|
|
139
157
|
fleet.append({
|
|
140
158
|
"name": r.get("name") or os.path.basename(r.get("path", "") or "project"),
|
|
141
159
|
"path": r.get("path", "") or "",
|
|
142
|
-
"phase":
|
|
160
|
+
"phase": _phase,
|
|
143
161
|
"iteration": r.get("iteration", 0) or 0,
|
|
144
162
|
"status": r.get("status", "") or "",
|
|
145
|
-
"running":
|
|
163
|
+
"running": _running,
|
|
146
164
|
})
|
|
147
165
|
|
|
166
|
+
# Live-first ordering: running builds, then everything else by most-recent.
|
|
167
|
+
# Keeps the useful runs at the top when the fleet has many stopped/stale entries.
|
|
168
|
+
def _fleet_sort_key(e):
|
|
169
|
+
st = (e.get("status") or "").lower()
|
|
170
|
+
rank = 0 if e.get("running") else (1 if st not in ("stale", "stopped") else 2)
|
|
171
|
+
return (rank, -(e.get("iteration") or 0))
|
|
172
|
+
fleet.sort(key=_fleet_sort_key)
|
|
173
|
+
|
|
148
174
|
# Focused run: --repo wins; else first running fleet run; else cwd.
|
|
149
175
|
focus_path = focus or cwd
|
|
150
176
|
focus_entry = None
|
package/autonomy/loki
CHANGED
|
@@ -2529,6 +2529,11 @@ cmd_start() {
|
|
|
2529
2529
|
local _tier_label="${LOKI_COMPLEXITY:-auto}"
|
|
2530
2530
|
local _decision
|
|
2531
2531
|
_decision="$(_loki_start_handoff "$_spec_label" "$_tier_label" "$effective_provider")"
|
|
2532
|
+
# The new handoff already rendered the Autonomi brand banner, so tell
|
|
2533
|
+
# run.sh to skip its legacy ASCII "LOKI MODE" banner (avoids a duplicate,
|
|
2534
|
+
# redundant second banner). The legacy banner still shows on the
|
|
2535
|
+
# non-handoff path (CI / --bg / --yes / non-interactive), unchanged.
|
|
2536
|
+
[ "$_decision" != "cancel" ] && export LOKI_BRAND_SHOWN=1
|
|
2532
2537
|
case "$_decision" in
|
|
2533
2538
|
cancel)
|
|
2534
2539
|
exit 0
|
|
@@ -8816,7 +8821,13 @@ if council:
|
|
|
8816
8821
|
fleet = s.get('fleet') or []
|
|
8817
8822
|
if fleet:
|
|
8818
8823
|
cap = 8 # cap so a huge registry (e.g. 171 runs) never floods the summary
|
|
8819
|
-
|
|
8824
|
+
active = sum(1 for r in fleet if r.get("running"))
|
|
8825
|
+
# Header shows active vs total so a long tail of finished/stale runs reads
|
|
8826
|
+
# honestly (e.g. "0 active / 136 total") instead of an alarming bare count.
|
|
8827
|
+
if active:
|
|
8828
|
+
print(f" Fleet ({active} active / {len(fleet)} total):")
|
|
8829
|
+
else:
|
|
8830
|
+
print(f" Fleet ({len(fleet)} total, none active):")
|
|
8820
8831
|
for r in fleet[:cap]:
|
|
8821
8832
|
mark = "*" if r.get("running") else " "
|
|
8822
8833
|
print(f" {mark} {r.get('name','?'):<28} iter {r.get('iteration',0)} {r.get('phase') or r.get('status') or ''}")
|
package/autonomy/run.sh
CHANGED
|
@@ -19385,18 +19385,24 @@ main() {
|
|
|
19385
19385
|
loki_show_disclosure_once
|
|
19386
19386
|
fi
|
|
19387
19387
|
|
|
19388
|
-
|
|
19389
|
-
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
|
|
19398
|
-
|
|
19399
|
-
|
|
19388
|
+
# Legacy ASCII "LOKI MODE" banner. Skipped when the new `loki start` handoff
|
|
19389
|
+
# already rendered the Autonomi brand banner (LOKI_BRAND_SHOWN=1) so the user
|
|
19390
|
+
# does not see two banners back to back. Still shown on the non-handoff path
|
|
19391
|
+
# (CI / --bg / --yes / non-interactive / direct run.sh), unchanged.
|
|
19392
|
+
if [ "${LOKI_BRAND_SHOWN:-}" != "1" ]; then
|
|
19393
|
+
echo ""
|
|
19394
|
+
echo -e "${BOLD}${BLUE}"
|
|
19395
|
+
echo " ██╗ ██████╗ ██╗ ██╗██╗ ███╗ ███╗ ██████╗ ██████╗ ███████╗"
|
|
19396
|
+
echo " ██║ ██╔═══██╗██║ ██╔╝██║ ████╗ ████║██╔═══██╗██╔══██╗██╔════╝"
|
|
19397
|
+
echo " ██║ ██║ ██║█████╔╝ ██║ ██╔████╔██║██║ ██║██║ ██║█████╗ "
|
|
19398
|
+
echo " ██║ ██║ ██║██╔═██╗ ██║ ██║╚██╔╝██║██║ ██║██║ ██║██╔══╝ "
|
|
19399
|
+
echo " ███████╗╚██████╔╝██║ ██╗██║ ██║ ╚═╝ ██║╚██████╔╝██████╔╝███████╗"
|
|
19400
|
+
echo " ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝"
|
|
19401
|
+
echo -e "${NC}"
|
|
19402
|
+
echo -e " ${CYAN}Autonomous Spec-to-Product System${NC}"
|
|
19403
|
+
echo -e " ${CYAN}Version: $(cat "$PROJECT_DIR/VERSION" 2>/dev/null || echo "4.x.x")${NC}"
|
|
19404
|
+
echo ""
|
|
19405
|
+
fi
|
|
19400
19406
|
|
|
19401
19407
|
# Parse arguments
|
|
19402
19408
|
PRD_PATH=""
|
package/dashboard/__init__.py
CHANGED
package/dashboard/registry.py
CHANGED
|
@@ -396,6 +396,41 @@ def prune_missing_projects(running_ids: Optional[set] = None) -> list[dict]:
|
|
|
396
396
|
return pruned
|
|
397
397
|
|
|
398
398
|
|
|
399
|
+
def reconcile_stale_runs() -> int:
|
|
400
|
+
"""Self-heal the registry: mark dead-pid in-flight entries as stopped.
|
|
401
|
+
|
|
402
|
+
`loki start` records status="running" for a build, and an exit trap marks it
|
|
403
|
+
stopped on clean shutdown. But a reaped session, a crash, or a SIGKILL skips
|
|
404
|
+
that trap, leaving the entry frozen at "running"/"building" forever with a
|
|
405
|
+
dead pid. Over time these zombies accumulate (a fleet of 130+ "BUILDING"
|
|
406
|
+
entries with no live process), polluting the cockpit and dashboard.
|
|
407
|
+
|
|
408
|
+
This reconciles reality: for every entry whose recorded pid is NOT alive but
|
|
409
|
+
whose status is still in-flight (running/building/active/in_progress), set
|
|
410
|
+
status="stopped". Non-destructive (the entry is kept, just corrected) and
|
|
411
|
+
never touches a live-pid entry or an already-terminal status. Best-effort and
|
|
412
|
+
concurrency-safe (runs under the registry lock with the atomic save).
|
|
413
|
+
|
|
414
|
+
Returns:
|
|
415
|
+
The number of entries reconciled (0 when the registry is already clean).
|
|
416
|
+
"""
|
|
417
|
+
IN_FLIGHT = {"running", "building", "active", "in_progress"}
|
|
418
|
+
reconciled = 0
|
|
419
|
+
with _registry_lock():
|
|
420
|
+
registry = _load_registry()
|
|
421
|
+
projects = registry.get("projects", {})
|
|
422
|
+
changed = False
|
|
423
|
+
for project in projects.values():
|
|
424
|
+
status = str(project.get("status") or "").lower()
|
|
425
|
+
if status in IN_FLIGHT and not _pid_alive(project.get("pid")):
|
|
426
|
+
project["status"] = "stopped"
|
|
427
|
+
reconciled += 1
|
|
428
|
+
changed = True
|
|
429
|
+
if changed:
|
|
430
|
+
_save_registry(registry)
|
|
431
|
+
return reconciled
|
|
432
|
+
|
|
433
|
+
|
|
399
434
|
def check_project_health(identifier: str) -> dict:
|
|
400
435
|
"""
|
|
401
436
|
Check the health status of a project.
|
|
@@ -754,11 +789,17 @@ def get_fleet_runs(include_inactive: bool = True) -> list[dict]:
|
|
|
754
789
|
running = _pid_alive(pid)
|
|
755
790
|
snap = _read_project_run_snapshot(path)
|
|
756
791
|
|
|
757
|
-
# A live pid is authoritative for "running"
|
|
758
|
-
# registry
|
|
759
|
-
#
|
|
792
|
+
# A live pid is authoritative for "running". When the pid is DEAD but the
|
|
793
|
+
# registry still says the run is in-flight (running/building/active), the
|
|
794
|
+
# run was reaped or crashed without its exit trap marking it stopped -- it
|
|
795
|
+
# is a stale zombie, NOT still building. Report it honestly as "stale" so
|
|
796
|
+
# the fleet does not show 100+ frozen "BUILDING" entries. A dead pid with
|
|
797
|
+
# a terminal registry status (stopped/completed/failed) keeps that status.
|
|
798
|
+
reg_status = (p.get("status") or "unknown").lower()
|
|
760
799
|
if running:
|
|
761
800
|
status = "running"
|
|
801
|
+
elif reg_status in ("running", "building", "active", "in_progress"):
|
|
802
|
+
status = "stale"
|
|
762
803
|
else:
|
|
763
804
|
status = p.get("status") or "unknown"
|
|
764
805
|
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The flagship product of [Autonomi](https://www.autonomi.dev/). Loki Mode is a spec-driven autonomous builder with a built-in trust layer that takes any spec to a deployed product and verifies completion with evidence (quality gates plus a completion council), not just a "done" claim. Complete installation instructions for all platforms and use cases.
|
|
4
4
|
|
|
5
|
-
**Version:** v7.128.
|
|
5
|
+
**Version:** v7.128.2
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -396,7 +396,7 @@ provider works inside the container. Provide auth with your Anthropic API key:
|
|
|
396
396
|
# Run Loki Mode in Docker (Claude provider, API-key auth)
|
|
397
397
|
docker run --rm -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
|
|
398
398
|
-v $(pwd):/workspace -w /workspace \
|
|
399
|
-
asklokesh/loki-mode:7.128.
|
|
399
|
+
asklokesh/loki-mode:7.128.2 start ./my-spec.md
|
|
400
400
|
```
|
|
401
401
|
|
|
402
402
|
##### docker compose + .env (no host install)
|
package/loki-ts/dist/cockpit.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var EJ=Object.defineProperty;var TJ=(J)=>J;function WJ(J,Q){this[J]=TJ.bind(null,Q)}var FJ=(J,Q)=>{for(var X in Q)EJ(J,X,{get:Q[X],enumerable:!0,configurable:!0,set:WJ.bind(Q,X)})};var BJ=(J,Q)=>()=>(J&&(Q=J(J=0)),Q);var F=import.meta.require;var qJ={};FJ(qJ,{initWasm:()=>mJ,Resvg:()=>dJ});function Y(J){if(_===T.length)T.push(T.length+1);let Q=_;return _=T[Q],T[Q]=J,Q}function A(J){return T[J]}function OJ(J){if(J<132)return;T[J]=_,_=J}function W(J){let Q=A(J);return OJ(J),Q}function b(){if(j===null||j.byteLength===0)j=new Uint8Array(D.memory.buffer);return j}function g(J,Q,X){if(X===void 0){let K=y.encode(J),P=Q(K.length,1)>>>0;return b().subarray(P,P+K.length).set(K),h=K.length,P}let Z=J.length,$=Q(Z,1)>>>0,G=b(),q=0;for(;q<Z;q++){let K=J.charCodeAt(q);if(K>127)break;G[$+q]=K}if(q!==Z){if(q!==0)J=J.slice(q);$=X($,Z,Z=q+J.length*3,1)>>>0;let K=b().subarray($+q,$+Z),P=jJ(J,K);q+=P.written,$=X($,Z,q,1)>>>0}return h=q,$}function i(J){return J===void 0||J===null}function N(){if(x===null||x.byteLength===0)x=new Int32Array(D.memory.buffer);return x}function w(J,Q){return J=J>>>0,DJ.decode(b().subarray(J,J+Q))}function xJ(J,Q){if(!(J instanceof Q))throw Error(`expected instance of ${Q.name}`);return J.ptr}function _J(J,Q){try{return J.apply(this,Q)}catch(X){D.__wbindgen_exn_store(Y(X))}}async function vJ(J,Q){if(typeof Response==="function"&&J instanceof Response){if(typeof WebAssembly.instantiateStreaming==="function")try{return await WebAssembly.instantiateStreaming(J,Q)}catch(Z){if(J.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",Z);else throw Z}let X=await J.arrayBuffer();return await WebAssembly.instantiate(X,Q)}else{let X=await WebAssembly.instantiate(J,Q);if(X instanceof WebAssembly.Instance)return{instance:X,module:J};else return X}}function bJ(){let J={};return J.wbg={},J.wbg.__wbg_new_28c511d9baebfa89=function(Q,X){let Z=Error(w(Q,X));return Y(Z)},J.wbg.__wbindgen_memory=function(){let Q=D.memory;return Y(Q)},J.wbg.__wbg_buffer_12d079cc21e14bdb=function(Q){let X=A(Q).buffer;return Y(X)},J.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb=function(Q,X,Z){let $=new Uint8Array(A(Q),X>>>0,Z>>>0);return Y($)},J.wbg.__wbindgen_object_drop_ref=function(Q){W(Q)},J.wbg.__wbg_new_63b92bc8671ed464=function(Q){let X=new Uint8Array(A(Q));return Y(X)},J.wbg.__wbg_values_839f3396d5aac002=function(Q){let X=A(Q).values();return Y(X)},J.wbg.__wbg_next_196c84450b364254=function(){return _J(function(Q){let X=A(Q).next();return Y(X)},arguments)},J.wbg.__wbg_done_298b57d23c0fc80c=function(Q){return A(Q).done},J.wbg.__wbg_value_d93c65011f51a456=function(Q){let X=A(Q).value;return Y(X)},J.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6=function(Q){let X;try{X=A(Q)instanceof Uint8Array}catch($){X=!1}return X},J.wbg.__wbindgen_string_get=function(Q,X){let Z=A(X),$=typeof Z==="string"?Z:void 0;var G=i($)?0:g($,D.__wbindgen_malloc,D.__wbindgen_realloc),q=h;N()[Q/4+1]=q,N()[Q/4+0]=G},J.wbg.__wbg_new_16b304a2cfa7ff4a=function(){return Y([])},J.wbg.__wbindgen_string_new=function(Q,X){let Z=w(Q,X);return Y(Z)},J.wbg.__wbg_push_a5b05aedc7234f9f=function(Q,X){return A(Q).push(A(X))},J.wbg.__wbg_length_c20a40f15020d68a=function(Q){return A(Q).length},J.wbg.__wbg_set_a47bac70306a19a7=function(Q,X,Z){A(Q).set(A(X),Z>>>0)},J.wbg.__wbindgen_throw=function(Q,X){throw Error(w(Q,X))},J}function yJ(J,Q){}function wJ(J,Q){return D=J.exports,KJ.__wbindgen_wasm_module=Q,x=null,j=null,D}async function KJ(J){if(D!==void 0)return D;if(typeof J>"u")J=new URL("index_bg.wasm",void 0);let Q=bJ();if(typeof J==="string"||typeof Request==="function"&&J instanceof Request||typeof URL==="function"&&J instanceof URL)J=fetch(J);yJ(Q);let{instance:X,module:Z}=await vJ(await J,Q);return wJ(X,Z)}function pJ(J){return Object.prototype.hasOwnProperty.call(J,"fontBuffers")}var D,T,_,h=0,j=null,y,jJ,x=null,DJ,$J,p=class J{static __wrap(Q){Q=Q>>>0;let X=Object.create(J.prototype);return X.__wbg_ptr=Q,$J.register(X,X.__wbg_ptr,X),X}__destroy_into_raw(){let Q=this.__wbg_ptr;return this.__wbg_ptr=0,$J.unregister(this),Q}free(){let Q=this.__destroy_into_raw();D.__wbg_bbox_free(Q)}get x(){return D.__wbg_get_bbox_x(this.__wbg_ptr)}set x(Q){D.__wbg_set_bbox_x(this.__wbg_ptr,Q)}get y(){return D.__wbg_get_bbox_y(this.__wbg_ptr)}set y(Q){D.__wbg_set_bbox_y(this.__wbg_ptr,Q)}get width(){return D.__wbg_get_bbox_width(this.__wbg_ptr)}set width(Q){D.__wbg_set_bbox_width(this.__wbg_ptr,Q)}get height(){return D.__wbg_get_bbox_height(this.__wbg_ptr)}set height(Q){D.__wbg_set_bbox_height(this.__wbg_ptr,Q)}},GJ,hJ=class J{static __wrap(Q){Q=Q>>>0;let X=Object.create(J.prototype);return X.__wbg_ptr=Q,GJ.register(X,X.__wbg_ptr,X),X}__destroy_into_raw(){let Q=this.__wbg_ptr;return this.__wbg_ptr=0,GJ.unregister(this),Q}free(){let Q=this.__destroy_into_raw();D.__wbg_renderedimage_free(Q)}get width(){return D.renderedimage_width(this.__wbg_ptr)>>>0}get height(){return D.renderedimage_height(this.__wbg_ptr)>>>0}asPng(){try{let $=D.__wbindgen_add_to_stack_pointer(-16);D.renderedimage_asPng($,this.__wbg_ptr);var Q=N()[$/4+0],X=N()[$/4+1],Z=N()[$/4+2];if(Z)throw W(X);return W(Q)}finally{D.__wbindgen_add_to_stack_pointer(16)}}get pixels(){let Q=D.renderedimage_pixels(this.__wbg_ptr);return W(Q)}},fJ,uJ=class{__destroy_into_raw(){let J=this.__wbg_ptr;return this.__wbg_ptr=0,fJ.unregister(this),J}free(){let J=this.__destroy_into_raw();D.__wbg_resvg_free(J)}constructor(J,Q,X){try{let P=D.__wbindgen_add_to_stack_pointer(-16);var Z=i(Q)?0:g(Q,D.__wbindgen_malloc,D.__wbindgen_realloc),$=h;D.resvg_new(P,Y(J),Z,$,i(X)?0:Y(X));var G=N()[P/4+0],q=N()[P/4+1],K=N()[P/4+2];if(K)throw W(q);return this.__wbg_ptr=G>>>0,this}finally{D.__wbindgen_add_to_stack_pointer(16)}}get width(){return D.resvg_width(this.__wbg_ptr)}get height(){return D.resvg_height(this.__wbg_ptr)}render(){try{let Z=D.__wbindgen_add_to_stack_pointer(-16);D.resvg_render(Z,this.__wbg_ptr);var J=N()[Z/4+0],Q=N()[Z/4+1],X=N()[Z/4+2];if(X)throw W(Q);return hJ.__wrap(J)}finally{D.__wbindgen_add_to_stack_pointer(16)}}toString(){let J,Q;try{let $=D.__wbindgen_add_to_stack_pointer(-16);D.resvg_toString($,this.__wbg_ptr);var X=N()[$/4+0],Z=N()[$/4+1];return J=X,Q=Z,w(X,Z)}finally{D.__wbindgen_add_to_stack_pointer(16),D.__wbindgen_free(J,Q,1)}}innerBBox(){let J=D.resvg_innerBBox(this.__wbg_ptr);return J===0?void 0:p.__wrap(J)}getBBox(){let J=D.resvg_getBBox(this.__wbg_ptr);return J===0?void 0:p.__wrap(J)}cropByBBox(J){xJ(J,p),D.resvg_cropByBBox(this.__wbg_ptr,J.__wbg_ptr)}imagesToResolve(){try{let Z=D.__wbindgen_add_to_stack_pointer(-16);D.resvg_imagesToResolve(Z,this.__wbg_ptr);var J=N()[Z/4+0],Q=N()[Z/4+1],X=N()[Z/4+2];if(X)throw W(Q);return W(J)}finally{D.__wbindgen_add_to_stack_pointer(16)}}resolveImage(J,Q){try{let $=D.__wbindgen_add_to_stack_pointer(-16),G=g(J,D.__wbindgen_malloc,D.__wbindgen_realloc),q=h;D.resvg_resolveImage($,this.__wbg_ptr,G,q,Y(Q));var X=N()[$/4+0],Z=N()[$/4+1];if(Z)throw W(X)}finally{D.__wbindgen_add_to_stack_pointer(16)}}},lJ,c=!1,mJ=async(J)=>{if(c)throw Error("Already initialized. The `initWasm()` function can be used only once.");await lJ(await J),c=!0},dJ;var VJ=BJ(()=>{T=Array(128).fill(void 0);T.push(void 0,null,!0,!1);_=T.length;y=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},jJ=typeof y.encodeInto==="function"?function(J,Q){return y.encodeInto(J,Q)}:function(J,Q){let X=y.encode(J);return Q.set(X),{read:J.length,written:X.length}};DJ=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};if(typeof TextDecoder<"u")DJ.decode();$J=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((J)=>D.__wbg_bbox_free(J>>>0)),GJ=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((J)=>D.__wbg_renderedimage_free(J>>>0)),fJ=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((J)=>D.__wbg_resvg_free(J>>>0));lJ=KJ,dJ=class extends uJ{constructor(J,Q){if(!c)throw Error("Wasm has not been initialized. Call `initWasm()` function.");let X=Q?.font;if(!!X&&pJ(X)){let Z={...Q,font:{...X,fontBuffers:void 0}};super(J,JSON.stringify(Z),X.fontBuffers)}else super(J,JSON.stringify(Q))}}});function U(J){return String(J??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function HJ(J,Q,X){let Z=X/512;return`<g transform="translate(${J},${Q}) scale(${Z})">
|
|
3
3
|
<rect x="0" y="0" width="512" height="512" rx="118" fill="#553de9"/>
|
|
4
4
|
<path d="M152 405 L242 120" stroke="#FFFEFB" stroke-width="28" stroke-linecap="round" fill="none"/>
|
|
5
5
|
<path d="M360 405 L270 120" stroke="#FFFEFB" stroke-width="28" stroke-linecap="round" fill="none"/>
|
|
6
6
|
<path d="M242 120 Q256 86 270 120" stroke="#FFFEFB" stroke-width="28" stroke-linecap="round" fill="none"/>
|
|
7
7
|
<circle cx="256" cy="295" r="20" fill="#1FC5A8"/>
|
|
8
|
-
</g>`}function
|
|
9
|
-
<text x="${J}" y="${Q+24}" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="20" font-weight="600" fill="${
|
|
8
|
+
</g>`}function SJ(J){switch(J){case"verified":return"#1f8a52";case"failed":return"#b23a3a";case"working":case"pending":return"#9a6a12";default:return"#6b6675"}}function RJ(J){switch(J){case"pass":return"#1f8a52";case"fail":return"#b23a3a";case"pending":return"#9a6a12";default:return"#6b6675"}}function IJ(J){switch(J){case"approve":return"#1f8a52";case"reject":return"#b23a3a";case"concern":return"#9a6a12";default:return"#6b6675"}}function v(J,Q,X,Z,$="#201515"){return`<text x="${J}" y="${Q}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="12" fill="#6b6675" letter-spacing="0.5">${U(X.toUpperCase())}</text>
|
|
9
|
+
<text x="${J}" y="${Q+24}" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="20" font-weight="600" fill="${$}">${U(Z)}</text>`}var kJ=["Reason","Act","Reflect","Verify"];function MJ(J){let Q=(J||"").toLowerCase();if(/verif|complet|done|ship|deploy/.test(Q))return 3;if(/reflect|review|council|critique|assess/.test(Q))return 2;if(/reason|plan|design|architect|spec|analy/.test(Q))return 0;return 1}function ZJ(J){let Z={run:J?.run||"cockpit",iteration:typeof J?.iteration==="number"?J.iteration:0,phase:J?.phase||"idle",tier:J?.tier||"",provider:J?.provider||"",verdict:J?.verdict||"unknown",budgetUsd:typeof J?.budgetUsd==="number"?J.budgetUsd:0,budgetLimitUsd:J?.budgetLimitUsd,freshness:J?.freshness,gates:Array.isArray(J?.gates)?J.gates:[],council:Array.isArray(J?.council)?J.council:[],fleet:Array.isArray(J?.fleet)?J.fleet:[]},$=Z.budgetLimitUsd&&Z.budgetLimitUsd>0?`$${Z.budgetUsd.toFixed(2)} / $${Z.budgetLimitUsd.toFixed(2)}`:`$${Z.budgetUsd.toFixed(2)}`,G="";G+=HJ(32,32,44),G+=`<text x="92" y="54" font-family="'Fraunces','Georgia',serif" font-size="24" font-weight="600" fill="#201515">Autonomi</text>`,G+=`<text x="92" y="74" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="13" fill="#6b6675">Loki Cockpit</text>`;let q=Z.freshness?`updated ${Z.freshness}`:"live";G+=`<text x="868" y="54" text-anchor="end" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="12" fill="#6b6675">${U(q)}</text>`,G+=`<text x="868" y="74" text-anchor="end" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="13" fill="${SJ(Z.verdict)}" font-weight="600">${U(Z.verdict.toUpperCase())}</text>`;let K=96,P=168;G+=`<rect x="32" y="${K}" width="836" height="${P}" rx="16" fill="#ffffff" stroke="#e2e0e8"/>`,G+=`<text x="56" y="${K+34}" font-family="'Fraunces','Georgia',serif" font-size="20" font-weight="600" fill="#201515">${U(Z.run)}</text>`,G+=`<text x="56" y="${K+54}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="13" fill="#6b6675">phase ${U(Z.phase)}</text>`;let z=K+96,E=(V)=>56+V*168;G+=v(E(0),z,"iteration",String(Z.iteration)),G+=v(E(1),z,"tier",Z.tier),G+=v(E(2),z,"provider",Z.provider),G+=v(E(3),z,"budget",$);let n=K+P+40;G+=`<text x="32" y="${n}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="13" font-weight="600" fill="#6b6675" letter-spacing="0.5">RARV LOOP</text>`;let s=MJ(Z.phase),R=n+14,o=200;kJ.forEach((V,C)=>{let L=32+C*(o+12),O=C<s,H=C===s;G+=`<rect x="${L}" y="${R}" width="${o}" height="40" rx="10" fill="${H?"#553de9":"#ffffff"}" fill-opacity="${H?"0.10":"1"}" stroke="${H?"#553de9":O?"#1f8a52":"#6b6675"}" stroke-width="${H?2:1}"/>`;let XJ=O?"check":H?"dot":"wait";if(XJ==="check")G+=`<path d="M${L+16} ${R+20} l6 6 l10 -12" stroke="#1f8a52" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`;else if(XJ==="dot")G+=`<circle cx="${L+22}" cy="${R+20}" r="5" fill="#553de9"/>`;else G+=`<circle cx="${L+22}" cy="${R+20}" r="5" fill="none" stroke="#6b6675" stroke-width="1.5"/>`;G+=`<text x="${L+40}" y="${R+25}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="14" font-weight="${H?600:500}" fill="${H?"#553de9":O?"#201515":"#6b6675"}">${V}</text>`});let a=R+40+40;G+=`<text x="32" y="${a}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="13" font-weight="600" fill="#6b6675" letter-spacing="0.5">QUALITY GATES</text>`;let r=Z.gates.length?Z.gates:[{name:"no gates yet",status:"pending"}],I=30,k=a+12;G+=`<rect x="32" y="${k}" width="836" height="${r.slice(0,8).length*I+8}" rx="12" fill="#ffffff" stroke="#e2e0e8"/>`,k+=8;for(let V of r.slice(0,8)){let C=RJ(V.status),L=k+I/2;if(G+=`<circle cx="50" cy="${L}" r="4" fill="${C}"/>`,G+=`<text x="66" y="${L+4}" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="12" fill="#201515">${U(V.name)}</text>`,V.runner)G+=`<text x="242" y="${L+4}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="11" fill="#6b6675">${U(V.runner)}</text>`;if(V.evidence){let O=V.evidence.length>52?`${V.evidence.slice(0,49)}...`:V.evidence;G+=`<text x="332" y="${L+4}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="11" fill="#6b6675">${U(O)}</text>`}G+=`<text x="852" y="${L+4}" text-anchor="end" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="11" font-weight="700" fill="${C}">${U(V.status.toUpperCase())}</text>`,k+=I}let t=k+40;G+=`<text x="32" y="${t}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="13" font-weight="600" fill="#6b6675" letter-spacing="0.5">COMPLETION COUNCIL</text>`;let e=Z.council.length?Z.council:[{reviewer:"pending",vote:"pending"}],M=t+12;G+=`<rect x="32" y="${M}" width="836" height="${e.slice(0,6).length*I+8}" rx="12" fill="#ffffff" stroke="#e2e0e8"/>`,M+=8;for(let V of e.slice(0,6)){let C=IJ(V.vote),L=M+I/2;if(G+=`<circle cx="50" cy="${L}" r="4" fill="${C}"/>`,G+=`<text x="66" y="${L+4}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="12.5" font-weight="500" fill="#201515">${U(V.reviewer)}</text>`,V.tier)G+=`<text x="292" y="${L+4}" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="11" fill="#6b6675">${U(V.tier)}</text>`;G+=`<text x="852" y="${L+4}" text-anchor="end" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="11" font-weight="700" fill="${C}">${U(V.vote.toUpperCase())}</text>`,M+=I}let JJ=M+46,QJ=Z.fleet.filter((V)=>V.running).length,zJ=QJ>0?`FLEET (${QJ} active / ${Z.fleet.length})`:`FLEET (${Z.fleet.length}, none active)`;G+=`<text x="32" y="${JJ}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="13" font-weight="600" fill="#6b6675" letter-spacing="0.5">${zJ}</text>`;let B=JJ+20,m=Z.fleet.slice(0,4);for(let V of m){let C=V.running?"#1f8a52":"#6b6675";G+=`<circle cx="38" cy="${B-4}" r="5" fill="${C}"/>`,G+=`<text x="52" y="${B}" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="13" fill="#201515">${U(V.name)}</text>`;let L=`iter ${V.iteration??0} ${U(V.phase||V.status||"")}`;G+=`<text x="868" y="${B}" text-anchor="end" font-family="'JetBrains Mono','SF Mono',ui-monospace,monospace" font-size="12" fill="#6b6675">${L}</text>`,B+=26}if(Z.fleet.length>m.length)G+=`<text x="52" y="${B}" font-family="'Inter','Helvetica Neue',Arial,sans-serif" font-size="12" fill="#6b6675">+ ${Z.fleet.length-m.length} more</text>`,B+=26;let d=Math.round(B+32);return`<svg xmlns="http://www.w3.org/2000/svg" width="900" height="${d}" viewBox="0 0 900 ${d}">
|
|
10
10
|
<rect x="0" y="0" width="900" height="${d}" fill="#f1f2f6"/>
|
|
11
|
-
${
|
|
12
|
-
</svg>`}var f,u;function
|
|
11
|
+
${G}
|
|
12
|
+
</svg>`}var f,u;function PJ(){if(f!==void 0)return f;try{let J=globalThis.require??F;J.resolve("@resvg/resvg-js"),f=J("@resvg/resvg-js")}catch{f=null}return f}async function LJ(){if(u!==void 0)return u;try{let J=await Promise.resolve().then(() => (VJ(),qJ)),Q=globalThis.require??F,{readFileSync:X,existsSync:Z}=await import("fs"),{resolve:$,dirname:G}=await import("path"),{fileURLToPath:q}=await import("url"),K=null;try{let P=G(q(import.meta.url));for(let z of["../data/resvg.wasm","../../data/resvg.wasm"]){let E=$(P,z);if(Z(E)){K=X(E);break}}}catch{}if(!K){let P=Q.resolve("@resvg/resvg-wasm/index_bg.wasm");K=X(P)}await J.initWasm(K),u={Resvg:J.Resvg}}catch{u=null}return u}async function NJ(){if(PJ()?.Resvg)return!0;return(await LJ())?.Resvg!=null}var S;async function gJ(){if(S!==void 0)return S;try{let{readFileSync:J,existsSync:Q}=await import("fs"),X=["/System/Library/Fonts/Supplemental/Arial.ttf","/System/Library/Fonts/Helvetica.ttc","/Library/Fonts/Arial.ttf","/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf","/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf","/usr/share/fonts/dejavu/DejaVuSans.ttf","/usr/share/fonts/TTF/DejaVuSans.ttf","C:\\Windows\\Fonts\\arial.ttf","C:\\Windows\\Fonts\\segoeui.ttf"];for(let Z of X)if(Q(Z))return S=new Uint8Array(J(Z)),S;S=null}catch{S=null}return S}async function UJ(J,Q=900){let X=PJ();if(X?.Resvg)try{let $=new X.Resvg(J,{fitTo:{mode:"width",value:Q}});return{png:Uint8Array.from($.render().asPng()),available:!0}}catch{}let Z=await LJ();if(Z?.Resvg)try{let $=await gJ(),G={fitTo:{mode:"width",value:Q}};if($)G.font={fontBuffers:[$],defaultFontFamily:"Arial",loadSystemFonts:!1};else G.font={loadSystemFonts:!0};let q=new Z.Resvg(J,G);return{png:Uint8Array.from(q.render().asPng()),available:!0}}catch($){return{png:null,available:!1,reason:`raster failed: ${$.message}`}}return{png:null,available:!1,reason:"rasterizer unavailable (no resvg native or wasm)"}}function AJ(J){return Buffer.from(J).toString("base64")}function iJ(J,Q){let X=AJ(J),Z=Q&&Q>0?`${Q}`:"auto";return`\x1B]1337;File=${`inline=1;size=${J.length};width=${Z};height=auto;preserveAspectRatio=1`}:${X}\x07`}function cJ(J,Q=4096,X){let Z=AJ(J);if(Z.length===0)return"\x1B_Ga=T,f=100,m=0;\x1B\\";let $=[];for(let K=0;K<Z.length;K+=Q)$.push(Z.slice(K,K+Q));let G=X&&X>0?`,c=${X}`:"",q="";for(let K=0;K<$.length;K++){let z=K===$.length-1?0:1,E=K===0?`a=T,f=100${G},m=${z}`:`m=${z}`;q+=`\x1B_G${E};${$[K]}\x1B\\`}return q}function YJ(J,Q,X){return J==="kitty"?cJ(Q,4096,X):iJ(Q,X)}var nJ=new Set(["iterm.app","wezterm","ghostty"]);function l(J=process.env){let Q=(J.LOKI_COCKPIT_PROTOCOL||"").trim().toLowerCase();if(Q==="iterm2"||Q==="kitty"||Q==="none")return Q;let X=(J.KITTY_WINDOW_ID||"").trim(),Z=(J.TERM||"").trim().toLowerCase();if(X.length>0||Z==="xterm-kitty")return"kitty";let $=(J.TERM_PROGRAM||"").trim().toLowerCase();if(nJ.has($))return"iterm2";return"none"}async function CJ(J,Q={}){let X=ZJ(J);if(Q.forceText)return{kind:"fallback",protocol:"none",reason:"--no-image (text/browser fallback)",svg:X};let Z;if(Q.protocol&&Q.protocol!=="auto")Z=Q.protocol;else Z=l(Q.env);if(Z==="none")return{kind:"fallback",protocol:Z,reason:"no inline-image terminal detected",svg:X};let $=await UJ(X);if(!$.available||!$.png)return{kind:"fallback",protocol:Z,reason:$.reason||"rasterization unavailable",svg:X};let G=YJ(Z,$.png,Q.cols);return{kind:"image",protocol:Z,data:G,svg:X}}async function sJ(){let J=[];for await(let Q of process.stdin)J.push(Q);return Buffer.concat(J).toString("utf-8")}function oJ(J){let Q="auto",X=!1,Z;for(let $=0;$<J.length;$++){let G=J[$];if(G==="--protocol"){let q=(J[++$]||"auto").toLowerCase();Q=q==="iterm2"||q==="kitty"||q==="none"?q:"auto"}else if(G==="--no-image")X=!0;else if(G==="--svg-out")Z=J[++$]}return{protocol:Q,noImage:X,svgOut:Z}}async function aJ(){let J=l(),Q=await NJ(),X=J!=="none"&&Q?"image":"text+dashboard";return process.stdout.write(`protocol=${J}
|
|
13
13
|
`),process.stdout.write(`resvg=${Q?"yes":"no"}
|
|
14
14
|
`),process.stdout.write(`path=${X}
|
|
15
|
-
`),0}async function
|
|
16
|
-
`),3}let
|
|
17
|
-
`),3}if(import.meta.main)
|
|
15
|
+
`),0}async function rJ(J=process.argv.slice(2)){if(J.includes("--probe"))return await aJ();let{protocol:Q,noImage:X,svgOut:Z}=oJ(J),$;try{let P=await sJ();$=JSON.parse(P)}catch(P){return process.stderr.write(`FALLBACK could not parse cockpit state: ${P.message}
|
|
16
|
+
`),3}let G=process.stdout.columns||Number(process.env.COLUMNS)||0,q=G>4?G-2:void 0,K=await CJ($,{protocol:Q,forceText:X,cols:q});if(Z)try{let{writeFileSync:P}=await import("fs");P(Z,K.svg)}catch{}if(K.kind==="image"&&K.data)return process.stdout.write(K.data),0;return process.stderr.write(`FALLBACK ${K.reason||"image unavailable"}
|
|
17
|
+
`),3}if(import.meta.main)rJ().then((J)=>process.exit(J));export{rJ as main};
|
|
18
18
|
|
|
19
|
-
//# debugId=
|
|
19
|
+
//# debugId=7F0CBB32F48339CA64756E2164756E21
|
package/loki-ts/dist/loki.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var q8=Object.defineProperty;var J8=($)=>$;function V8($,Q){this[$]=J8.bind(null,Q)}var b=($,Q)=>{for(var Z in Q)q8($,Z,{get:Q[Z],enumerable:!0,configurable:!0,set:V8.bind(Q,Z)})};var P=($,Q)=>()=>($&&(Q=$($=0)),Q);var J$=import.meta.require;var m1={};b(m1,{lokiDir:()=>j,homeLokiDir:()=>T$,findRepoRootForVersion:()=>$1,REPO_ROOT:()=>h});import{resolve as t,dirname as e$}from"path";import{fileURLToPath as W8}from"url";import{existsSync as N$}from"fs";import{homedir as H8}from"os";function G8(){let $=v1;for(let Q=0;Q<6;Q++){if(N$(t($,"VERSION"))&&N$(t($,"autonomy/run.sh")))return $;let Z=e$($);if(Z===$)break;$=Z}return t(v1,"..","..","..")}function $1($){let Q=$;for(let Z=0;Z<6;Z++){if(N$(t(Q,"VERSION"))&&N$(t(Q,"autonomy/run.sh")))return Q;let z=e$(Q);if(z===Q)break;Q=z}return t($,"..","..","..")}function j(){return process.env.LOKI_DIR??t(process.cwd(),".loki")}function T$(){return t(H8(),".loki")}var v1,h;var C=P(()=>{v1=e$(W8(import.meta.url));h=G8()});import{readFileSync as U8}from"fs";import{resolve as Y8,dirname as B8}from"path";import{fileURLToPath as M8}from"url";function S$(){if(Q$!==null)return Q$;let $="7.128.
|
|
2
|
+
var q8=Object.defineProperty;var J8=($)=>$;function V8($,Q){this[$]=J8.bind(null,Q)}var b=($,Q)=>{for(var Z in Q)q8($,Z,{get:Q[Z],enumerable:!0,configurable:!0,set:V8.bind(Q,Z)})};var P=($,Q)=>()=>($&&(Q=$($=0)),Q);var J$=import.meta.require;var m1={};b(m1,{lokiDir:()=>j,homeLokiDir:()=>T$,findRepoRootForVersion:()=>$1,REPO_ROOT:()=>h});import{resolve as t,dirname as e$}from"path";import{fileURLToPath as W8}from"url";import{existsSync as N$}from"fs";import{homedir as H8}from"os";function G8(){let $=v1;for(let Q=0;Q<6;Q++){if(N$(t($,"VERSION"))&&N$(t($,"autonomy/run.sh")))return $;let Z=e$($);if(Z===$)break;$=Z}return t(v1,"..","..","..")}function $1($){let Q=$;for(let Z=0;Z<6;Z++){if(N$(t(Q,"VERSION"))&&N$(t(Q,"autonomy/run.sh")))return Q;let z=e$(Q);if(z===Q)break;Q=z}return t($,"..","..","..")}function j(){return process.env.LOKI_DIR??t(process.cwd(),".loki")}function T$(){return t(H8(),".loki")}var v1,h;var C=P(()=>{v1=e$(W8(import.meta.url));h=G8()});import{readFileSync as U8}from"fs";import{resolve as Y8,dirname as B8}from"path";import{fileURLToPath as M8}from"url";function S$(){if(Q$!==null)return Q$;let $="7.128.2";if(typeof $==="string"&&$.length>0)return Q$=$,Q$;try{let Q=B8(M8(import.meta.url)),Z=$1(Q);Q$=U8(Y8(Z,"VERSION"),"utf-8").trim()}catch{Q$="unknown"}return Q$}var Q$=null;var Q1=P(()=>{C()});var p1={};b(p1,{runOrThrow:()=>S8,run:()=>R,readStreamCapped:()=>c1,commandVersion:()=>C8,commandExists:()=>u,ShellError:()=>Z1,MAX_STDOUT_BYTES:()=>u1});async function c1($,Q=u1){let Z=$.getReader(),z=new TextDecoder,X="",q=0;try{while(q<Q){let{done:K,value:W}=await Z.read();if(K)break;if(!W)continue;if(q+=W.byteLength,q>Q){let V=W.byteLength-(q-Q);X+=z.decode(W.subarray(0,V),{stream:!0});break}X+=z.decode(W,{stream:!0})}X+=z.decode()}finally{try{await Z.cancel()}catch{}Z.releaseLock()}return X}async function R($,Q={}){let Z=Bun.spawn({cmd:[...$],stdout:"pipe",stderr:"pipe",env:Q.env?{...process.env,...Q.env}:process.env,cwd:Q.cwd}),z,X;if(Q.timeoutMs&&Q.timeoutMs>0)z=setTimeout(()=>{try{Z.kill("SIGTERM")}catch{}X=setTimeout(()=>{try{Z.kill("SIGKILL")}catch{}},2000)},Q.timeoutMs);try{let[q,K,W]=await Promise.all([c1(Z.stdout),new Response(Z.stderr).text(),Z.exited]);return{stdout:q,stderr:K,exitCode:W}}finally{if(z)clearTimeout(z);if(X)clearTimeout(X)}}async function S8($,Q={}){let Z=await R($,Q);if(Z.exitCode!==0)throw new Z1(`command failed (${Z.exitCode}): ${$.join(" ")}`,Z.exitCode,Z.stdout,Z.stderr);return Z}async function u($){let Q=D8($),Z=await R(["sh","-c",`command -v ${Q}`],{timeoutMs:5000});if(Z.exitCode===0)return Z.stdout.trim()||null;return null}function D8($){if(!/^[A-Za-z0-9._/-]+$/.test($))throw Error(`refused to shell-escape suspect token: ${$}`);return $}async function C8($,Q="--version"){if(!await u($))return null;let z=await R([$,Q],{timeoutMs:5000});if(z.exitCode!==0)return null;return((z.stdout||z.stderr).split(/\r?\n/)[0]?.trim()??"")||null}var u1=16777216,Z1;var o=P(()=>{Z1=class Z1 extends Error{message;exitCode;stdout;stderr;constructor($,Q,Z,z){super($);this.message=$;this.exitCode=Q;this.stdout=Z;this.stderr=z;this.name="ShellError"}}});function r($){return b8?"":$}var b8,M,S,_,tZ,L,k,y,J;var p=P(()=>{b8=(process.env.NO_COLOR??"").length>0;M=r("\x1B[0;31m"),S=r("\x1B[0;32m"),_=r("\x1B[1;33m"),tZ=r("\x1B[0;34m"),L=r("\x1B[0;36m"),k=r("\x1B[1m"),y=r("\x1B[2m"),J=r("\x1B[0m")});import{existsSync as l8}from"fs";async function Z$(){if(A$!==void 0)return A$;let $="/opt/homebrew/bin/python3.12";if(l8($))return A$=$,$;let Q=await u("python3.12");if(Q)return A$=Q,Q;let Z=await u("python3");return A$=Z,Z}async function z$($,Q={}){let Z=await Z$();if(!Z)return{stdout:"",stderr:"python3 not found",exitCode:127};return R([Z,"-c",$],Q)}var A$;var V$=P(()=>{o()});var V0={};b(V0,{runStatus:()=>U3});import{existsSync as v,readFileSync as H$,readdirSync as $0,statSync as Q0}from"fs";import{resolve as D,basename as z3}from"path";import{homedir as X3}from"os";function Z0($){let Q=Math.trunc($);if(Q>=1e6)return`${(Math.trunc(Q/1e6*10)/10).toFixed(1)}M`;if(Q>=1000)return`${(Math.trunc(Q/1000*10)/10).toFixed(1)}K`;return String(Q)}function z0($,Q,Z){if(Q===0)return null;let z=Math.trunc($*100/Q),X=Math.trunc($*C$/Q);if(X>C$)X=C$;let q=C$-X,K=S;if(z>=80)K=M;else if(z>=50)K=_;let W="=".repeat(Math.max(0,X))+" ".repeat(Math.max(0,q)),V=Z0($),H=Z0(Q);return` ${k}${Z}${J} ${K}[${W}]${J} ${z}% (${V} / ${H})`}async function q3(){if(await u("jq"))return!0;return process.stdout.write(`${M}Error: jq is required but not installed.${J}
|
|
3
3
|
`),process.stdout.write(`Install with:
|
|
4
4
|
`),process.stdout.write(` brew install jq (macOS)
|
|
5
5
|
`),process.stdout.write(` apt install jq (Debian/Ubuntu)
|
|
@@ -814,4 +814,4 @@ Set LOKI_LEGACY_BASH=1 to force the bash CLI for every command.
|
|
|
814
814
|
`),2}default:return process.stderr.write(`Unknown command: ${Q}
|
|
815
815
|
`),process.stderr.write(K8),2}}e1();process.on("SIGINT",()=>process.exit(130));process.on("SIGTERM",()=>process.exit(143));var SZ=await NZ(Bun.argv.slice(2));process.exit(SZ);
|
|
816
816
|
|
|
817
|
-
//# debugId=
|
|
817
|
+
//# debugId=3642C2645E1F762E64756E2164756E21
|
package/mcp/__init__.py
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loki-mode",
|
|
3
3
|
"mcpName": "io.github.asklokesh/loki-mode",
|
|
4
|
-
"version": "7.128.
|
|
4
|
+
"version": "7.128.2",
|
|
5
5
|
"description": "Loki Mode by Autonomi. Autonomous spec-to-product system: takes a PRD, GitHub issue, OpenAPI/JSON/YAML, or one-line brief to a deployed app via the RARV-C closure loop with 8 quality gates. Provider-agnostic (Claude Code, OpenAI Codex, Cline, Aider).",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"agent",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
|
|
3
3
|
"name": "loki-mode",
|
|
4
4
|
"displayName": "Loki Mode",
|
|
5
|
-
"version": "7.128.
|
|
5
|
+
"version": "7.128.2",
|
|
6
6
|
"description": "Autonomous spec-to-product build system with a built-in trust layer (RARV-C closure loop, 8 quality gates, completion council). Ships Loki's spec-hardening, drift-detection, and deterministic PR verification commands plus the Loki MCP server.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Autonomi",
|