loki-mode 9.40.0 → 9.41.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/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 v9.40.0
6
+ # Loki Mode v9.41.0
7
7
 
8
8
  **You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
9
9
 
@@ -470,4 +470,4 @@ See `CHANGELOG.md` entries [7.5.7], [7.5.8], [7.5.13] for the per-fix list and r
470
470
 
471
471
  ---
472
472
 
473
- **v9.40.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~410 lines core**
473
+ **v9.41.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~410 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 9.40.0
1
+ 9.41.0
package/autonomy/loki CHANGED
@@ -13839,6 +13839,64 @@ else:
13839
13839
  fi
13840
13840
  echo ""
13841
13841
 
13842
+ # PATH SHADOWING. Reported from the field twice, and it defeats upgrading
13843
+ # entirely: `bun install -g loki-mode` reports installing 9.39.0, then
13844
+ # `loki --version` prints 9.22.3, because an OLDER copy sits earlier on
13845
+ # PATH (typically ~/.local/bin -> a Homebrew node prefix, ahead of
13846
+ # ~/.bun/bin). Reinstalling cannot fix it; every reinstall updates the copy
13847
+ # that is NOT winning, so the user loops forever on advice that cannot work.
13848
+ #
13849
+ # This is a blocker, not a warning: the user is running code they did not
13850
+ # install and cannot upgrade by the documented route.
13851
+ #
13852
+ # Resolved by realpath so two PATH entries pointing at the SAME install are
13853
+ # not reported as shadowing each other.
13854
+ # Resolve symlinks with whatever the host has. macOS ships no `realpath`
13855
+ # on older versions, so fall back to readlink and finally to the path
13856
+ # itself -- an unresolved path is still comparable, just less precise.
13857
+ _doctor_resolve() {
13858
+ if command -v realpath >/dev/null 2>&1; then
13859
+ realpath "$1" 2>/dev/null || printf '%s' "$1"
13860
+ elif command -v readlink >/dev/null 2>&1; then
13861
+ readlink -f "$1" 2>/dev/null || printf '%s' "$1"
13862
+ else
13863
+ printf '%s' "$1"
13864
+ fi
13865
+ }
13866
+ _running_real="$(command -v loki 2>/dev/null || true)"
13867
+ if [ -n "$_running_real" ]; then
13868
+ _running_real="$(_doctor_resolve "$_running_real")"
13869
+ _shadow_found=""
13870
+ _shadow_seen=""
13871
+ _oldIFS="$IFS"; IFS=':'
13872
+ for _d in $PATH; do
13873
+ [ -n "$_d" ] || continue
13874
+ [ -x "$_d/loki" ] || continue
13875
+ _r="$(_doctor_resolve "$_d/loki")"
13876
+ case "$_shadow_seen" in *"|$_r|"*) continue ;; esac
13877
+ _shadow_seen="${_shadow_seen}|$_r|"
13878
+ [ "$_r" = "$_running_real" ] && continue
13879
+ # <pkg>/bin/loki -> package.json two levels up
13880
+ _pj="$(dirname "$(dirname "$_r")")/package.json"
13881
+ [ -f "$_pj" ] || continue
13882
+ _v="$(python3 -c "import json,sys;print(json.load(open(sys.argv[1])).get('version',''))" "$_pj" 2>/dev/null || true)"
13883
+ [ -n "$_v" ] || continue
13884
+ _shadow_found="${_shadow_found}\n $_v at $_d/loki"
13885
+ done
13886
+ IFS="$_oldIFS"
13887
+ if [ -n "$_shadow_found" ]; then
13888
+ echo -e " ${RED}FAIL${NC} Multiple loki installs on PATH; you are running $(get_version 2>/dev/null || echo unknown)"
13889
+ echo -e " ${DIM} Running: $_running_real${NC}"
13890
+ printf " ${DIM} Others:%b${NC}\n" "$_shadow_found"
13891
+ echo -e " ${DIM} Reinstalling updates a copy that is not winning on PATH.${NC}"
13892
+ _doctor_block "Multiple loki installs on PATH. Run 'which -a loki', then remove or re-point every entry EARLIER than the one you want. Reinstalling alone will not fix this."
13893
+ fail_count=$((fail_count + 1))
13894
+ else
13895
+ echo -e " ${GREEN}OK${NC} Single loki install on PATH"
13896
+ fi
13897
+ echo ""
13898
+ fi
13899
+
13842
13900
  # Summary
13843
13901
  echo -e "${BOLD}Summary:${NC} ${GREEN}$pass_count passed${NC}, ${RED}$fail_count failed${NC}, ${YELLOW}$warn_count warnings${NC}"
13844
13902
  echo ""
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "9.40.0"
10
+ __version__ = "9.41.0"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -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:** v9.40.0
5
+ **Version:** v9.41.0
6
6
 
7
7
  ---
8
8
 
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var _t=Object.create;var{getPrototypeOf:vt,defineProperty:jG,getOwnPropertyNames:ht}=Object;var gt=Object.prototype.hasOwnProperty;function mt($){return this[$]}var ut,dt,pt=($,X,Q)=>{var z=$!=null&&typeof $==="object";if(z){var Z=X?ut??=new WeakMap:dt??=new WeakMap,K=Z.get($);if(K)return K}Q=$!=null?_t(vt($)):{};let J=X||!$||!$.__esModule?jG(Q,"default",{value:$,enumerable:!0}):Q;for(let q of ht($))if(!gt.call(J,q))jG(J,q,{get:mt.bind($,q),enumerable:!0});if(z)Z.set($,J);return J};var zq=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var ct=($)=>$;function lt($,X){this[$]=ct.bind(null,X)}var B1=($,X)=>{for(var Q in X)jG($,Q,{get:X[Q],enumerable:!0,configurable:!0,set:lt.bind(X,Q)})};var s=($,X)=>()=>($&&(X=$($=0)),X);var w5=import.meta.require;var UR={};B1(UR,{lokiDir:()=>h0,homeLokiDir:()=>WQ,findRepoRootForVersion:()=>AG,REPO_ROOT:()=>L1});import{resolve as h2,dirname as LG}from"path";import{fileURLToPath as it}from"url";import{existsSync as Zq}from"fs";import{homedir as at}from"os";function ot(){let $=YR;for(let X=0;X<6;X++){if(Zq(h2($,"VERSION"))&&Zq(h2($,"autonomy/run.sh")))return $;let Q=LG($);if(Q===$)break;$=Q}return h2(YR,"..","..","..")}function AG($){let X=$;for(let Q=0;Q<6;Q++){if(Zq(h2(X,"VERSION"))&&Zq(h2(X,"autonomy/run.sh")))return X;let z=LG(X);if(z===X)break;X=z}return h2($,"..","..","..")}function h0(){return process.env.LOKI_DIR??h2(process.cwd(),".loki")}function WQ(){return h2(at(),".loki")}var YR,L1;var k1=s(()=>{YR=LG(it(import.meta.url));L1=ot()});import{readFileSync as st}from"fs";import{resolve as nt,dirname as rt}from"path";import{fileURLToPath as tt}from"url";function j9(){if(n3!==null)return n3;let $="9.40.0";if(typeof $==="string"&&$.length>0)return n3=$,n3;try{let X=rt(tt(import.meta.url)),Q=AG(X);n3=st(nt(Q,"VERSION"),"utf-8").trim()}catch{n3="unknown"}return n3}var n3=null;var Kq=s(()=>{k1()});var OR={};B1(OR,{runOrThrow:()=>Be,run:()=>$1,readStreamCapped:()=>Jq,commandVersion:()=>Me,commandExists:()=>g5,ShellError:()=>TG,MAX_STDOUT_BYTES:()=>MR});async function Jq($,X=MR){let Q=$.getReader(),z=new TextDecoder,Z="",K=0;try{while(K<X){let{done:J,value:q}=await Q.read();if(J)break;if(!q)continue;if(K+=q.byteLength,K>X){let V=q.byteLength-(K-X);Z+=z.decode(q.subarray(0,V),{stream:!0});break}Z+=z.decode(q,{stream:!0})}Z+=z.decode()}finally{try{await Q.cancel()}catch{}Q.releaseLock()}return Z}async function $1($,X={}){let Q=Bun.spawn({cmd:[...$],stdout:"pipe",stderr:"pipe",env:X.env?{...process.env,...X.env}:process.env,cwd:X.cwd}),z,Z;if(X.timeoutMs&&X.timeoutMs>0)z=setTimeout(()=>{try{Q.kill("SIGTERM")}catch{}Z=setTimeout(()=>{try{Q.kill("SIGKILL")}catch{}},2000)},X.timeoutMs);try{let[K,J,q]=await Promise.all([Jq(Q.stdout),new Response(Q.stderr).text(),Q.exited]);return{stdout:K,stderr:J,exitCode:q}}finally{if(z)clearTimeout(z);if(Z)clearTimeout(Z)}}async function Be($,X={}){let Q=await $1($,X);if(Q.exitCode!==0)throw new TG(`command failed (${Q.exitCode}): ${$.join(" ")}`,Q.exitCode,Q.stdout,Q.stderr);return Q}async function g5($){let X=Ne($),Q=await $1(["sh","-c",`command -v ${X}`],{timeoutMs:5000});if(Q.exitCode===0)return Q.stdout.trim()||null;return null}function Ne($){if(!/^[A-Za-z0-9._/-]+$/.test($))throw Error(`refused to shell-escape suspect token: ${$}`);return $}async function Me($,X="--version"){if(!await g5($))return null;let z=await $1([$,X],{timeoutMs:5000});if(z.exitCode!==0)return null;return((z.stdout||z.stderr).split(/\r?\n/)[0]?.trim()??"")||null}var MR=16777216,TG;var y8=s(()=>{TG=class TG extends Error{message;exitCode;stdout;stderr;constructor($,X,Q,z){super($);this.message=$;this.exitCode=X;this.stdout=Q;this.stderr=z;this.name="ShellError"}}});function g2($){return Oe?"":$}var Oe,p0,$5,q1,D61,A1,f1,m5,r;var t7=s(()=>{Oe=(process.env.NO_COLOR??"").length>0;p0=g2("\x1B[0;31m"),$5=g2("\x1B[0;32m"),q1=g2("\x1B[1;33m"),D61=g2("\x1B[0;34m"),A1=g2("\x1B[0;36m"),f1=g2("\x1B[1m"),m5=g2("\x1B[2m"),r=g2("\x1B[0m")});import{existsSync as we}from"fs";async function Z2(){if(GQ!==void 0)return GQ;let $="/opt/homebrew/bin/python3.12";if(we($))return GQ=$,$;let X=await g5("python3.12");if(X)return GQ=X,X;let Q=await g5("python3");return GQ=Q,Q}async function I4($,X={}){let Q=await Z2();if(!Q)return{stdout:"",stderr:"python3 not found",exitCode:127};return $1([Q,"-c",$],X)}var GQ;var m2=s(()=>{y8()});var vR={};B1(vR,{runStatus:()=>te});import{existsSync as u5,readFileSync as C9,readdirSync as ER,statSync as xR}from"fs";import{resolve as A5,basename as pe}from"path";import{homedir as ce}from"os";function kR($){let X=Math.trunc($);if(X>=1e6)return`${(Math.trunc(X/1e6*10)/10).toFixed(1)}M`;if(X>=1000)return`${(Math.trunc(X/1000*10)/10).toFixed(1)}K`;return String(X)}function SR($,X,Q){if(X===0)return null;let z=Math.trunc($*100/X),Z=Math.trunc($*Vq/X);if(Z>Vq)Z=Vq;let K=Vq-Z,J=$5;if(z>=80)J=p0;else if(z>=50)J=q1;let q="=".repeat(Math.max(0,Z))+" ".repeat(Math.max(0,K)),V=kR($),Y=kR(X);return` ${f1}${Q}${r} ${J}[${q}]${r} ${z}% (${V} / ${Y})`}async function ie(){if(await g5("jq"))return!0;return process.stdout.write(`${p0}Error: jq is required but not installed.${r}
2
+ var _t=Object.create;var{getPrototypeOf:vt,defineProperty:jG,getOwnPropertyNames:ht}=Object;var gt=Object.prototype.hasOwnProperty;function mt($){return this[$]}var ut,dt,pt=($,X,Q)=>{var z=$!=null&&typeof $==="object";if(z){var Z=X?ut??=new WeakMap:dt??=new WeakMap,K=Z.get($);if(K)return K}Q=$!=null?_t(vt($)):{};let J=X||!$||!$.__esModule?jG(Q,"default",{value:$,enumerable:!0}):Q;for(let q of ht($))if(!gt.call(J,q))jG(J,q,{get:mt.bind($,q),enumerable:!0});if(z)Z.set($,J);return J};var zq=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var ct=($)=>$;function lt($,X){this[$]=ct.bind(null,X)}var B1=($,X)=>{for(var Q in X)jG($,Q,{get:X[Q],enumerable:!0,configurable:!0,set:lt.bind(X,Q)})};var s=($,X)=>()=>($&&(X=$($=0)),X);var w5=import.meta.require;var UR={};B1(UR,{lokiDir:()=>h0,homeLokiDir:()=>WQ,findRepoRootForVersion:()=>AG,REPO_ROOT:()=>L1});import{resolve as h2,dirname as LG}from"path";import{fileURLToPath as it}from"url";import{existsSync as Zq}from"fs";import{homedir as at}from"os";function ot(){let $=YR;for(let X=0;X<6;X++){if(Zq(h2($,"VERSION"))&&Zq(h2($,"autonomy/run.sh")))return $;let Q=LG($);if(Q===$)break;$=Q}return h2(YR,"..","..","..")}function AG($){let X=$;for(let Q=0;Q<6;Q++){if(Zq(h2(X,"VERSION"))&&Zq(h2(X,"autonomy/run.sh")))return X;let z=LG(X);if(z===X)break;X=z}return h2($,"..","..","..")}function h0(){return process.env.LOKI_DIR??h2(process.cwd(),".loki")}function WQ(){return h2(at(),".loki")}var YR,L1;var k1=s(()=>{YR=LG(it(import.meta.url));L1=ot()});import{readFileSync as st}from"fs";import{resolve as nt,dirname as rt}from"path";import{fileURLToPath as tt}from"url";function j9(){if(n3!==null)return n3;let $="9.41.0";if(typeof $==="string"&&$.length>0)return n3=$,n3;try{let X=rt(tt(import.meta.url)),Q=AG(X);n3=st(nt(Q,"VERSION"),"utf-8").trim()}catch{n3="unknown"}return n3}var n3=null;var Kq=s(()=>{k1()});var OR={};B1(OR,{runOrThrow:()=>Be,run:()=>$1,readStreamCapped:()=>Jq,commandVersion:()=>Me,commandExists:()=>g5,ShellError:()=>TG,MAX_STDOUT_BYTES:()=>MR});async function Jq($,X=MR){let Q=$.getReader(),z=new TextDecoder,Z="",K=0;try{while(K<X){let{done:J,value:q}=await Q.read();if(J)break;if(!q)continue;if(K+=q.byteLength,K>X){let V=q.byteLength-(K-X);Z+=z.decode(q.subarray(0,V),{stream:!0});break}Z+=z.decode(q,{stream:!0})}Z+=z.decode()}finally{try{await Q.cancel()}catch{}Q.releaseLock()}return Z}async function $1($,X={}){let Q=Bun.spawn({cmd:[...$],stdout:"pipe",stderr:"pipe",env:X.env?{...process.env,...X.env}:process.env,cwd:X.cwd}),z,Z;if(X.timeoutMs&&X.timeoutMs>0)z=setTimeout(()=>{try{Q.kill("SIGTERM")}catch{}Z=setTimeout(()=>{try{Q.kill("SIGKILL")}catch{}},2000)},X.timeoutMs);try{let[K,J,q]=await Promise.all([Jq(Q.stdout),new Response(Q.stderr).text(),Q.exited]);return{stdout:K,stderr:J,exitCode:q}}finally{if(z)clearTimeout(z);if(Z)clearTimeout(Z)}}async function Be($,X={}){let Q=await $1($,X);if(Q.exitCode!==0)throw new TG(`command failed (${Q.exitCode}): ${$.join(" ")}`,Q.exitCode,Q.stdout,Q.stderr);return Q}async function g5($){let X=Ne($),Q=await $1(["sh","-c",`command -v ${X}`],{timeoutMs:5000});if(Q.exitCode===0)return Q.stdout.trim()||null;return null}function Ne($){if(!/^[A-Za-z0-9._/-]+$/.test($))throw Error(`refused to shell-escape suspect token: ${$}`);return $}async function Me($,X="--version"){if(!await g5($))return null;let z=await $1([$,X],{timeoutMs:5000});if(z.exitCode!==0)return null;return((z.stdout||z.stderr).split(/\r?\n/)[0]?.trim()??"")||null}var MR=16777216,TG;var y8=s(()=>{TG=class TG extends Error{message;exitCode;stdout;stderr;constructor($,X,Q,z){super($);this.message=$;this.exitCode=X;this.stdout=Q;this.stderr=z;this.name="ShellError"}}});function g2($){return Oe?"":$}var Oe,p0,$5,q1,D61,A1,f1,m5,r;var t7=s(()=>{Oe=(process.env.NO_COLOR??"").length>0;p0=g2("\x1B[0;31m"),$5=g2("\x1B[0;32m"),q1=g2("\x1B[1;33m"),D61=g2("\x1B[0;34m"),A1=g2("\x1B[0;36m"),f1=g2("\x1B[1m"),m5=g2("\x1B[2m"),r=g2("\x1B[0m")});import{existsSync as we}from"fs";async function Z2(){if(GQ!==void 0)return GQ;let $="/opt/homebrew/bin/python3.12";if(we($))return GQ=$,$;let X=await g5("python3.12");if(X)return GQ=X,X;let Q=await g5("python3");return GQ=Q,Q}async function I4($,X={}){let Q=await Z2();if(!Q)return{stdout:"",stderr:"python3 not found",exitCode:127};return $1([Q,"-c",$],X)}var GQ;var m2=s(()=>{y8()});var vR={};B1(vR,{runStatus:()=>te});import{existsSync as u5,readFileSync as C9,readdirSync as ER,statSync as xR}from"fs";import{resolve as A5,basename as pe}from"path";import{homedir as ce}from"os";function kR($){let X=Math.trunc($);if(X>=1e6)return`${(Math.trunc(X/1e6*10)/10).toFixed(1)}M`;if(X>=1000)return`${(Math.trunc(X/1000*10)/10).toFixed(1)}K`;return String(X)}function SR($,X,Q){if(X===0)return null;let z=Math.trunc($*100/X),Z=Math.trunc($*Vq/X);if(Z>Vq)Z=Vq;let K=Vq-Z,J=$5;if(z>=80)J=p0;else if(z>=50)J=q1;let q="=".repeat(Math.max(0,Z))+" ".repeat(Math.max(0,K)),V=kR($),Y=kR(X);return` ${f1}${Q}${r} ${J}[${q}]${r} ${z}% (${V} / ${Y})`}async function ie(){if(await g5("jq"))return!0;return process.stdout.write(`${p0}Error: jq is required but not installed.${r}
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)
@@ -1241,10 +1241,10 @@ If you believe the lock is stale, remove '${X}' manually.`;throw $.log(`[runner]
1241
1241
  [--regen-prd] [--skip-memory]
1242
1242
  <spec> = a PRD path, or a one-line brief. (Issue refs / --github / --parallel /
1243
1243
  --sandbox, opencode, and other shell-adapter paths run on the bash route automatically.)
1244
- `;var yt=s(()=>{Pt=new Set(["--max-iterations","--max-retries","--budget-limit","--budget","--provider","--session-model","--completion-promise","--base-wait","--max-wait","--prd","--brief","--aider-model","--aider-flags","--cline-model"]),Et=new Map([["--allow-haiku",["LOKI_ALLOW_HAIKU","true"]],["--simple",["LOKI_COMPLEXITY","simple"]],["--complex",["LOKI_COMPLEXITY","complex"]],["--regen-prd",["LOKI_PRD_REGEN","1"]],["--regenerate-prd",["LOKI_PRD_REGEN","1"]],["--regen",["LOKI_PRD_REGEN","1"]],["--fresh-prd",["LOKI_PRD_REGEN","1"]],["--skip-memory",["LOKI_SKIP_MEMORY","true"]]]),xt=new Set(["--yes","-y","--no-plan","--no-mirofish","--no-dashboard"]),t31=new Set(["claude","codex","cline","aider"]),e31=new Set(["planning","development","fast"]),$61={small:"fast",medium:"development",high:"planning"}});Kq();k1();import{mkdirSync as et,readFileSync as WR,realpathSync as $e,statSync as Xe,writeFileSync as Qe}from"fs";import{dirname as CG,join as HR,resolve as ze}from"path";var Ze="https://registry.npmjs.org/loki-mode/latest",Ke=86400000,Je=1500;function qe(){return ze(WQ(),"cache","update-check.json")}function L9($){let X=/^(\d+)\.(\d+)\.(\d+)$/.exec($.trim());if(!X)return null;return[Number(X[1]),Number(X[2]),Number(X[3])]}function GR($,X){let Q=L9($),z=L9(X);if(!Q||!z)return!1;let[Z,K,J]=Q,[q,V,Y]=z;if(Z!==q)return Z>q;if(K!==V)return K>V;return J>Y}function Ve(){if(process.env.LOKI_NO_UPDATE_CHECK==="1")return!0;if(process.env.CI)return!0;if(!process.stdout.isTTY)return!0;return!1}function Ye($){try{let X=WR($,"utf-8"),Q=JSON.parse(X);if(typeof Q.checkedAt==="number"&&typeof Q.latest==="string"&&L9(Q.latest)!==null)return{checkedAt:Q.checkedAt,latest:Q.latest}}catch{}return null}function Ue($,X){try{et(CG($),{recursive:!0}),Qe($,JSON.stringify(X),"utf-8")}catch{}}async function He(){try{let $=await fetch(Ze,{signal:AbortSignal.timeout(Je),headers:{accept:"application/json"}});if(!$.ok)return null;let X=await $.json();if(typeof X.version==="string"&&L9(X.version)!==null)return X.version}catch{}return null}async function We($=Date.now(),X=He,Q=qe()){let z=Ye(Q);if(z&&$-z.checkedAt<Ke)return z.latest;let Z=await X();if(Z===null)return null;return Ue(Q,{checkedAt:$,latest:Z}),Z}function Ge($,X=process.env){if(L9($)===null)return null;let z=X.PATH;if(!z)return null;let Z=new Set;for(let K of z.split(":")){if(!K)continue;let J=HR(K,"loki"),q;try{Xe(J),q=$e(J)}catch{continue}if(Z.has(q))continue;Z.add(q);try{let V=HR(CG(CG(q)),"package.json"),Y=JSON.parse(WR(V,"utf8")).version;if(typeof Y!=="string")continue;if(GR(Y,$))return{path:J,version:Y}}catch{continue}}return null}async function BR($,X={}){try{if(Ve())return;if(L9($)===null)return;let Q=await We(X.now,X.fetcher,X.cacheFile);if(Q===null)return;if(!GR(Q,$))return;let z=X.write??((K)=>process.stderr.write(K)),Z=Ge($,X.env??process.env);if(Z!==null){z(`Loki Mode ${Z.version} is installed but not the one running (you are running ${$}).
1245
- Another loki earlier on PATH is winning. Newer copy: ${Z.path}
1244
+ `;var yt=s(()=>{Pt=new Set(["--max-iterations","--max-retries","--budget-limit","--budget","--provider","--session-model","--completion-promise","--base-wait","--max-wait","--prd","--brief","--aider-model","--aider-flags","--cline-model"]),Et=new Map([["--allow-haiku",["LOKI_ALLOW_HAIKU","true"]],["--simple",["LOKI_COMPLEXITY","simple"]],["--complex",["LOKI_COMPLEXITY","complex"]],["--regen-prd",["LOKI_PRD_REGEN","1"]],["--regenerate-prd",["LOKI_PRD_REGEN","1"]],["--regen",["LOKI_PRD_REGEN","1"]],["--fresh-prd",["LOKI_PRD_REGEN","1"]],["--skip-memory",["LOKI_SKIP_MEMORY","true"]]]),xt=new Set(["--yes","-y","--no-plan","--no-mirofish","--no-dashboard"]),t31=new Set(["claude","codex","cline","aider"]),e31=new Set(["planning","development","fast"]),$61={small:"fast",medium:"development",high:"planning"}});Kq();k1();import{mkdirSync as et,readFileSync as WR,realpathSync as $e,statSync as Xe,writeFileSync as Qe}from"fs";import{dirname as CG,join as HR,resolve as ze}from"path";var Ze="https://registry.npmjs.org/loki-mode/latest",Ke=86400000,Je=1500;function qe(){return ze(WQ(),"cache","update-check.json")}function L9($){let X=/^(\d+)\.(\d+)\.(\d+)$/.exec($.trim());if(!X)return null;return[Number(X[1]),Number(X[2]),Number(X[3])]}function GR($,X){let Q=L9($),z=L9(X);if(!Q||!z)return!1;let[Z,K,J]=Q,[q,V,Y]=z;if(Z!==q)return Z>q;if(K!==V)return K>V;return J>Y}function Ve(){if(process.env.LOKI_NO_UPDATE_CHECK==="1")return!0;if(process.env.CI)return!0;if(!process.stdout.isTTY)return!0;return!1}function Ye($){try{let X=WR($,"utf-8"),Q=JSON.parse(X);if(typeof Q.checkedAt==="number"&&typeof Q.latest==="string"&&L9(Q.latest)!==null)return{checkedAt:Q.checkedAt,latest:Q.latest}}catch{}return null}function Ue($,X){try{et(CG($),{recursive:!0}),Qe($,JSON.stringify(X),"utf-8")}catch{}}async function He(){try{let $=await fetch(Ze,{signal:AbortSignal.timeout(Je),headers:{accept:"application/json"}});if(!$.ok)return null;let X=await $.json();if(typeof X.version==="string"&&L9(X.version)!==null)return X.version}catch{}return null}async function We($=Date.now(),X=He,Q=qe()){let z=Ye(Q);if(z&&$-z.checkedAt<Ke)return z.latest;let Z=await X();if(Z===null)return null;return Ue(Q,{checkedAt:$,latest:Z}),Z}function Ge($,X=process.env){if(L9($)===null)return null;let z=X.PATH;if(!z)return null;let Z=new Set;for(let K of z.split(":")){if(!K)continue;let J=HR(K,"loki"),q;try{Xe(J),q=$e(J)}catch{continue}if(Z.has(q))continue;Z.add(q);try{let V=HR(CG(CG(q)),"package.json"),Y=JSON.parse(WR(V,"utf8")).version;if(typeof Y!=="string")continue;if(GR(Y,$))return{path:J,version:Y}}catch{continue}}return null}async function BR($,X={}){try{if(Ve())return;if(L9($)===null)return;let Q=X.write??((K)=>process.stderr.write(K)),z=Ge($,X.env??process.env);if(z!==null){Q(`Loki Mode ${z.version} is installed but not the one running (you are running ${$}).
1245
+ Another loki earlier on PATH is winning. Newer copy: ${z.path}
1246
1246
  Run \`which -a loki\` to see the order, then remove or re-point the earlier entry.
1247
- `);return}z(`A newer Loki Mode is available: ${Q} (you have ${$}). Update: bun install -g loki-mode (or npm i -g loki-mode)
1247
+ `);return}let Z=await We(X.now,X.fetcher,X.cacheFile);if(Z===null)return;if(!GR(Z,$))return;Q(`A newer Loki Mode is available: ${Z} (you have ${$}). Update: bun install -g loki-mode (or npm i -g loki-mode)
1248
1248
  `)}catch{}}async function NR(){let $=j9();return process.stdout.write(`Loki Mode v${$}
1249
1249
  `),await BR($),0}y8();t7();k1();import{readFileSync as je,existsSync as Le}from"fs";import{resolve as Ae}from"path";var Ce=["claude","cline","codex","aider","opencode"];function jR(){let $=Ae(h0(),"state","provider");if(!Le($))return"";try{return je($,"utf-8").trim()}catch{return""}}function Te($,X){return $||X||process.env.LOKI_PROVIDER||"claude"}function De($){let X=jR(),Q=Te($,X);switch(process.stdout.write(`${f1}Current Provider${r}
1250
1250
  `),process.stdout.write(`
@@ -1337,4 +1337,4 @@ Set LOKI_LEGACY_BASH=1 to force the bash CLI for every command.
1337
1337
  `),2}case"start":{let{runStart:z}=await Promise.resolve().then(() => (yt(),St));return z(Q)}default:return process.stderr.write(`Unknown command: ${X}
1338
1338
  `),process.stderr.write(bt),2}}wR();process.on("SIGINT",()=>process.exit(130));process.on("SIGTERM",()=>process.exit(143));var K61=await Z61(Bun.argv.slice(2));process.exit(K61);
1339
1339
 
1340
- //# debugId=B7667F8F4AB07553B9BC693C48EB2AFC
1340
+ //# debugId=2D91561BF1C8026CBF5C04C1871B78CF
package/mcp/__init__.py CHANGED
@@ -75,4 +75,4 @@ try:
75
75
  except ImportError:
76
76
  __all__ = ['mcp']
77
77
 
78
- __version__ = '9.40.0'
78
+ __version__ = '9.41.0'
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": "9.40.0",
4
+ "version": "9.41.0",
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, opencode).",
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": "9.40.0",
5
+ "version": "9.41.0",
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",