loki-mode 11.137.1 → 11.137.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.
Files changed (67) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/dashboard/__init__.py +1 -1
  4. package/docs/CLI-REFERENCE.md +1 -1
  5. package/docs/INSTALLATION.md +1 -1
  6. package/loki-ts/dist/loki.js +4 -4
  7. package/mcp/__init__.py +1 -1
  8. package/package.json +2 -2
  9. package/packages/control-plane/dist/server.js +1 -1
  10. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  11. package/web-app/dist/assets/{AdminPage-DlD6DW_j.js → AdminPage-CU65Sb0t.js} +1 -1
  12. package/web-app/dist/assets/{Avatar-BITb-cd5.js → Avatar-HIyC7HMX.js} +1 -1
  13. package/web-app/dist/assets/{Badge-BdgAHas3.js → Badge-DOsx9bo0.js} +1 -1
  14. package/web-app/dist/assets/{Button-C1KpekBR.js → Button-BxUQtv5n.js} +1 -1
  15. package/web-app/dist/assets/{CockpitPage-DU_tAv1b.js → CockpitPage-C6CD7s5Q.js} +1 -1
  16. package/web-app/dist/assets/{ComparePage-CBo8qdEK.js → ComparePage-BQurKCEE.js} +1 -1
  17. package/web-app/dist/assets/{ErrorBoundary-uMIRI1zD.js → ErrorBoundary-Dz51Pml4.js} +1 -1
  18. package/web-app/dist/assets/{EvidenceReceiptPanel-WI1M3Tji.js → EvidenceReceiptPanel-CykvpKxV.js} +1 -1
  19. package/web-app/dist/assets/{GitHubIssuesPanel-BvfJAdPF.js → GitHubIssuesPanel-BUp6USsa.js} +1 -1
  20. package/web-app/dist/assets/{GitHubPRsPanel-XJiXEhvR.js → GitHubPRsPanel-S3kC0B2l.js} +1 -1
  21. package/web-app/dist/assets/{HomePage-Doz_KIQt.js → HomePage-BPk7_DJW.js} +2 -2
  22. package/web-app/dist/assets/{LoginPage-trJpBTMs.js → LoginPage-CjNa_LHu.js} +1 -1
  23. package/web-app/dist/assets/{MagicPage-CzUerd6-.js → MagicPage-wJ3IO9cF.js} +1 -1
  24. package/web-app/dist/assets/{MetricsPage-D1ya9gYH.js → MetricsPage-BVC19ezj.js} +1 -1
  25. package/web-app/dist/assets/{NotFoundPage-DIs1m4Q3.js → NotFoundPage-CS6tT0Af.js} +1 -1
  26. package/web-app/dist/assets/{ProjectPage-BmlKkd3v.js → ProjectPage-Cqek-G3r.js} +3 -3
  27. package/web-app/dist/assets/{ProjectsPage-C23EtR5R.js → ProjectsPage-CinlECdF.js} +1 -1
  28. package/web-app/dist/assets/{SettingsPage-D8XUlT3p.js → SettingsPage-DBJ2Do4v.js} +1 -1
  29. package/web-app/dist/assets/{ShowcasePage-CG0yi6mK.js → ShowcasePage-Dcki-Bc5.js} +1 -1
  30. package/web-app/dist/assets/{SystemSettingsPage-CIDzI-Ie.js → SystemSettingsPage--NhvwmaN.js} +1 -1
  31. package/web-app/dist/assets/{TeamsPage-CVpQINTd.js → TeamsPage-CLQR7PsE.js} +1 -1
  32. package/web-app/dist/assets/{TemplatesPage-Vz9HREA-.js → TemplatesPage-B8AG6WCj.js} +1 -1
  33. package/web-app/dist/assets/{TerminalOutput-TdLKSbR7.js → TerminalOutput-HC2ojXj_.js} +1 -1
  34. package/web-app/dist/assets/{activity-CBSvCxPd.js → activity-Cnkose4Q.js} +1 -1
  35. package/web-app/dist/assets/{bell-LvF8jqSy.js → bell-CBDZhL7O.js} +1 -1
  36. package/web-app/dist/assets/{bot-Nq7CP0wm.js → bot-DDCNEM-J.js} +1 -1
  37. package/web-app/dist/assets/{check-CBJXqIsV.js → check-D1qIrOQs.js} +1 -1
  38. package/web-app/dist/assets/{chevron-left-CovdvyC6.js → chevron-left-dP2eCudr.js} +1 -1
  39. package/web-app/dist/assets/{circle-alert-C5U8JfmL.js → circle-alert-BhqMU4XU.js} +1 -1
  40. package/web-app/dist/assets/{clock-BmJaE6OB.js → clock-B3sGx0CC.js} +1 -1
  41. package/web-app/dist/assets/{cloud-C29z_Xbl.js → cloud-CFswD3X1.js} +1 -1
  42. package/web-app/dist/assets/{code-xml-UFdv7-KW.js → code-xml-BmbV3qOZ.js} +1 -1
  43. package/web-app/dist/assets/{database-B2kx_2RX.js → database-BkIkNTBq.js} +1 -1
  44. package/web-app/dist/assets/{dollar-sign-CvutGHYe.js → dollar-sign-C6A25I3T.js} +1 -1
  45. package/web-app/dist/assets/{file-code-corner-Dgk6tDOW.js → file-code-corner-DibSfM-s.js} +1 -1
  46. package/web-app/dist/assets/{file-plus-B_aLYwqI.js → file-plus-CoBzP3Nf.js} +1 -1
  47. package/web-app/dist/assets/{globe-Cl8ma4WC.js → globe-DdI8jmBf.js} +1 -1
  48. package/web-app/dist/assets/{hammer-g6IDM0Mp.js → hammer-DK3tnNkU.js} +1 -1
  49. package/web-app/dist/assets/{index-BsqpWddM.js → index-Bof3-_68.js} +3 -3
  50. package/web-app/dist/assets/{layers-CPs9L1Zy.js → layers-D9qUaFUb.js} +1 -1
  51. package/web-app/dist/assets/{loader-circle-CMndtL-U.js → loader-circle-DqmrMD2y.js} +1 -1
  52. package/web-app/dist/assets/{lock-BMisdUz_.js → lock-DAIMLqQl.js} +1 -1
  53. package/web-app/dist/assets/{package-CO3fayvy.js → package-ZmQnH6BC.js} +1 -1
  54. package/web-app/dist/assets/{plus-DmEQY3hE.js → plus-8OGlItzn.js} +1 -1
  55. package/web-app/dist/assets/{refresh-cw-VIstG20G.js → refresh-cw-CfZ0NrKz.js} +1 -1
  56. package/web-app/dist/assets/{rotate-ccw-B2B8qXF1.js → rotate-ccw-BvxEood6.js} +1 -1
  57. package/web-app/dist/assets/{scroll-text-CGtfemeE.js → scroll-text-BNwohxjk.js} +1 -1
  58. package/web-app/dist/assets/{server-B2orlO1M.js → server-BqtYPaUL.js} +1 -1
  59. package/web-app/dist/assets/{shield-alert-CtSYP1Py.js → shield-alert-H3Z6GpeL.js} +1 -1
  60. package/web-app/dist/assets/{thumbs-up-DNtqLkNY.js → thumbs-up-4nZcaHTV.js} +1 -1
  61. package/web-app/dist/assets/{trash-2-BaCldFY1.js → trash-2-DLRI8X63.js} +1 -1
  62. package/web-app/dist/assets/{trending-down-DrGr5-dm.js → trending-down-VKVQVXQU.js} +1 -1
  63. package/web-app/dist/assets/{trending-up-D29cRQYb.js → trending-up-BwyGhAc3.js} +1 -1
  64. package/web-app/dist/assets/{upload-BQbpBtnJ.js → upload-CZky_3--.js} +1 -1
  65. package/web-app/dist/assets/{usePolling-g5L-2DFp.js → usePolling-DBMddMG9.js} +1 -1
  66. package/web-app/dist/assets/{user-CwsB4l3d.js → user-B54w7sMr.js} +1 -1
  67. package/web-app/dist/index.html +1 -1
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: loki-mode
3
3
  description: Runs an autonomous software factory that knows what it is supposed to deliver and proves it did, with a signed receipt. Use when the user says Loki Mode or asks to build, fix or verify software autonomously.
4
4
  ---
5
5
 
6
- # Loki Mode v11.137.1
6
+ # Loki Mode v11.137.2
7
7
 
8
8
  **Current entry points (Loki 10 engine):** `loki "<task>"`, `loki owner/repo#N` and `loki quick "<task>"` run the Loki 10 engine and end with a signed receipt (`loki verify`). `loki backlog owner/repo --all` runs many issues in parallel. Guide: `docs/v10/GUIDE.md`. The skill instructions below, and `loki start`, describe the previous bash loop. PRD-file starts (`loki start ./prd.md`) and the opencode provider still run on it until FC38-SWEEP ports them; the legacy-engine command and the LOKI_ENGINE switch remain removed. Prefer `loki owner/repo#N` for issues.
9
9
 
@@ -461,4 +461,4 @@ Implemented, planned and deprecated items, with the version each landed in: `CHA
461
461
 
462
462
  ---
463
463
 
464
- **v11.137.1 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
464
+ **v11.137.2 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.137.1
1
+ 11.137.2
@@ -7,6 +7,6 @@ Modules:
7
7
  control: Session control helpers (status, atomic writes, origin check)
8
8
  """
9
9
 
10
- __version__ = "11.137.1"
10
+ __version__ = "11.137.2"
11
11
 
12
12
  __all__ = ["__version__"]
@@ -1,6 +1,6 @@
1
1
  # CLI reference
2
2
 
3
- Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.137.1. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.137.2. Do not edit by hand.
4
4
  Hidden and legacy-only commands are omitted; see `docs/CLI-INVENTORY.md` for the full inventory.
5
5
 
6
6
  | Command | Description |
@@ -2,7 +2,7 @@
2
2
 
3
3
  Loki Mode, by [Autonomi](https://www.autonomi.dev/), turns a spec or an issue into a verified pull request with a receipt you can check. This page covers installing it, a first run, and the options around it.
4
4
 
5
- **Version:** v11.137.1
5
+ **Version:** v11.137.2
6
6
 
7
7
  **Engine note:** `loki start` is the primary command. `loki start`, `loki "<task>"`, `loki owner/repo#N` and `loki quick` all run the Loki 10 engine, whatever the flag order or input form (PRD file, issue ref, task or one-word brief). The previous loop runs only on `--engine legacy`, `LOKI_ENGINE=legacy`, or for one call when a flag Loki 10 cannot honor is present. See the [user guide](v10/GUIDE.md) and the [5-minute quickstart](QUICKSTART.md).
8
8
 
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var hJ8=Object.create;var{getPrototypeOf:fJ8,defineProperty:lU,getOwnPropertyNames:yJ0,getOwnPropertyDescriptor:gJ8}=Object,SJ0=Object.prototype.hasOwnProperty;function bJ0($){return this[$]}var mJ8,uJ8,dJ8=($,Z,J)=>{var X=$!=null&&typeof $==="object";if(X){var Q=Z?mJ8??=new WeakMap:uJ8??=new WeakMap,Y=Q.get($);if(Y)return Y}J=$!=null?hJ8(fJ8($)):{};let z=Z||!$||!$.__esModule?lU(J,"default",{value:$,enumerable:!0}):J;for(let W of yJ0($))if(!SJ0.call(z,W))lU(z,W,{get:bJ0.bind($,W),enumerable:!0});if(X)Q.set($,z);return z},Vg=($)=>{var Z=(kJ0??=new WeakMap).get($),J;if(Z)return Z;if(Z=lU({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var X of yJ0($))if(!SJ0.call(Z,X))lU(Z,X,{get:bJ0.bind($,X),enumerable:!(J=gJ8($,X))||J.enumerable})}return kJ0.set($,Z),Z},kJ0,vA=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var cJ8=($)=>$;function pJ8($,Z){this[$]=cJ8.bind(null,Z)}var w0=($,Z)=>{for(var J in Z)lU($,J,{get:Z[J],enumerable:!0,configurable:!0,set:pJ8.bind(Z,J)})};var x=($,Z)=>()=>($&&(Z=$($=0)),Z);var V9=import.meta.require;var Gg={};w0(Gg,{lokiDirFor:()=>_V,lokiDir:()=>H8,homeLokiDir:()=>n3,findRepoRootForVersion:()=>iU,REPO_ROOT:()=>_0});import{resolve as aJ,dirname as Kg}from"path";import{fileURLToPath as lJ8}from"url";import{existsSync as hA}from"fs";import{homedir as iJ8}from"os";function aJ8(){let $=vJ0;for(let Z=0;Z<6;Z++){if(hA(aJ($,"VERSION"))&&hA(aJ($,"autonomy/run.sh")))return $;let J=Kg($);if(J===$)break;$=J}return aJ(vJ0,"..","..","..")}function iU($){let Z=$;for(let J=0;J<6;J++){if(hA(aJ(Z,"VERSION"))&&hA(aJ(Z,"autonomy/run.sh")))return Z;let X=Kg(Z);if(X===Z)break;Z=X}return aJ($,"..","..","..")}function _V($){return process.env.LOKI_DIR??aJ($,".loki")}function H8(){return _V(process.cwd())}function n3(){return aJ(iJ8(),".loki")}var vJ0,_0;var q8=x(()=>{vJ0=Kg(lJ8(import.meta.url));_0=aJ8()});import{readFileSync as oJ8}from"fs";import{resolve as nJ8,dirname as sJ8}from"path";import{fileURLToPath as rJ8}from"url";function Z6(){if(HY!==null)return HY;let $="11.137.1";if(typeof $==="string"&&$.length>0)return HY=$,HY;try{let Z=sJ8(rJ8(import.meta.url)),J=iU(Z);HY=oJ8(nJ8(J,"VERSION"),"utf-8").trim()}catch{HY="unknown"}return HY}var HY=null;var s3=x(()=>{q8()});import{mkdirSync as qg,readFileSync as fA,realpathSync as tJ8,statSync as eJ8,writeFileSync as Ug}from"fs";import{dirname as xV,join as Hg,resolve as hJ0}from"path";function QX8(){return hJ0(n3(),"cache","update-check.json")}function oJ($){let Z=/^(\d+)\.(\d+)\.(\d+)$/.exec($.trim());if(!Z)return null;return[Number(Z[1]),Number(Z[2]),Number(Z[3])]}function aU($,Z){let J=oJ($),X=oJ(Z);if(!J||!X)return!1;let[Q,Y,z]=J,[W,V,K]=X;if(Q!==W)return Q>W;if(Y!==V)return Y>V;return z>K}function fJ0(){let $=(process.env.LOKI_NO_UPDATE_CHECK??"").trim().toLowerCase();if($==="1"||$==="true"||$==="yes")return!0;if(process.env.LOKI_AIRGAP==="true")return!0;if(process.env.CI)return!0;if(!process.stdout.isTTY)return!0;return!1}function gJ0($){try{let Z=fA($,"utf-8"),J=JSON.parse(Z);if(typeof J.checkedAt==="number"&&typeof J.latest==="string"&&oJ(J.latest)!==null)return{checkedAt:J.checkedAt,latest:J.latest}}catch{}return null}function YX8($){try{let Z=JSON.parse(fA($,"utf-8")).failedAt;if(typeof Z==="number")return Z}catch{}return null}function zX8($,Z){let J=gJ0($);try{qg(xV($),{recursive:!0}),Ug($,JSON.stringify({...J??{},failedAt:Z}),"utf-8")}catch{}}function WX8($,Z){try{qg(xV($),{recursive:!0}),Ug($,JSON.stringify(Z),"utf-8")}catch{}}async function VX8(){try{let $=await fetch($X8,{signal:AbortSignal.timeout(JX8),headers:{accept:"application/json"}});if(!$.ok)return null;let Z=await $.json();if(typeof Z.version==="string"&&oJ(Z.version)!==null)return Z.version}catch{}return null}async function KX8($=Date.now(),Z=VX8,J=QX8()){let X=gJ0(J);if(X&&$-X.checkedAt<ZX8)return X.latest;let Q=YX8(J);if(Q!==null&&$-Q>=0&&$-Q<XX8)return null;let Y=await Z();if(Y===null)return zX8(J,$),null;return WX8(J,{checkedAt:$,latest:Y}),Y}function GX8($,Z=process.env){if(oJ($)===null)return null;let X=Z.PATH;if(!X)return null;let Q=new Set;for(let Y of X.split(":")){if(!Y)continue;let z=Hg(Y,"loki"),W;try{eJ8(z),W=tJ8(z)}catch{continue}if(Q.has(W))continue;Q.add(W);try{let V=Hg(xV(xV(W)),"package.json"),K=JSON.parse(fA(V,"utf8")).version;if(typeof K!=="string")continue;if(aU(K,$))return{path:z,version:K}}catch{continue}}return null}function HX8(){return hJ0(n3(),"cache","last-seen-version.json")}function qX8($,Z={}){try{if(fJ0())return!1;if(oJ($)===null)return!1;let J=Z.seenFile??HX8(),X=null;try{let Y=JSON.parse(fA(J,"utf-8")).version;if(typeof Y==="string"&&oJ(Y)!==null)X=Y}catch{}if(X!==null&&!aU($,X))return!1;try{qg(xV(J),{recursive:!0}),Ug(J,JSON.stringify({version:$}),"utf-8")}catch{return!1}if(X===null)return!1;return(Z.write??((Y)=>process.stderr.write(Y)))(`Loki Mode upgraded ${X} -> ${$}. What is new: https://github.com/asklokesh/loki-mode/releases/tag/v${$}
2
+ var hJ8=Object.create;var{getPrototypeOf:fJ8,defineProperty:lU,getOwnPropertyNames:yJ0,getOwnPropertyDescriptor:gJ8}=Object,SJ0=Object.prototype.hasOwnProperty;function bJ0($){return this[$]}var mJ8,uJ8,dJ8=($,Z,J)=>{var X=$!=null&&typeof $==="object";if(X){var Q=Z?mJ8??=new WeakMap:uJ8??=new WeakMap,Y=Q.get($);if(Y)return Y}J=$!=null?hJ8(fJ8($)):{};let z=Z||!$||!$.__esModule?lU(J,"default",{value:$,enumerable:!0}):J;for(let W of yJ0($))if(!SJ0.call(z,W))lU(z,W,{get:bJ0.bind($,W),enumerable:!0});if(X)Q.set($,z);return z},Vg=($)=>{var Z=(kJ0??=new WeakMap).get($),J;if(Z)return Z;if(Z=lU({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var X of yJ0($))if(!SJ0.call(Z,X))lU(Z,X,{get:bJ0.bind($,X),enumerable:!(J=gJ8($,X))||J.enumerable})}return kJ0.set($,Z),Z},kJ0,vA=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var cJ8=($)=>$;function pJ8($,Z){this[$]=cJ8.bind(null,Z)}var w0=($,Z)=>{for(var J in Z)lU($,J,{get:Z[J],enumerable:!0,configurable:!0,set:pJ8.bind(Z,J)})};var x=($,Z)=>()=>($&&(Z=$($=0)),Z);var V9=import.meta.require;var Gg={};w0(Gg,{lokiDirFor:()=>_V,lokiDir:()=>H8,homeLokiDir:()=>n3,findRepoRootForVersion:()=>iU,REPO_ROOT:()=>_0});import{resolve as aJ,dirname as Kg}from"path";import{fileURLToPath as lJ8}from"url";import{existsSync as hA}from"fs";import{homedir as iJ8}from"os";function aJ8(){let $=vJ0;for(let Z=0;Z<6;Z++){if(hA(aJ($,"VERSION"))&&hA(aJ($,"autonomy/run.sh")))return $;let J=Kg($);if(J===$)break;$=J}return aJ(vJ0,"..","..","..")}function iU($){let Z=$;for(let J=0;J<6;J++){if(hA(aJ(Z,"VERSION"))&&hA(aJ(Z,"autonomy/run.sh")))return Z;let X=Kg(Z);if(X===Z)break;Z=X}return aJ($,"..","..","..")}function _V($){return process.env.LOKI_DIR??aJ($,".loki")}function H8(){return _V(process.cwd())}function n3(){return aJ(iJ8(),".loki")}var vJ0,_0;var q8=x(()=>{vJ0=Kg(lJ8(import.meta.url));_0=aJ8()});import{readFileSync as oJ8}from"fs";import{resolve as nJ8,dirname as sJ8}from"path";import{fileURLToPath as rJ8}from"url";function Z6(){if(HY!==null)return HY;let $="11.137.2";if(typeof $==="string"&&$.length>0)return HY=$,HY;try{let Z=sJ8(rJ8(import.meta.url)),J=iU(Z);HY=oJ8(nJ8(J,"VERSION"),"utf-8").trim()}catch{HY="unknown"}return HY}var HY=null;var s3=x(()=>{q8()});import{mkdirSync as qg,readFileSync as fA,realpathSync as tJ8,statSync as eJ8,writeFileSync as Ug}from"fs";import{dirname as xV,join as Hg,resolve as hJ0}from"path";function QX8(){return hJ0(n3(),"cache","update-check.json")}function oJ($){let Z=/^(\d+)\.(\d+)\.(\d+)$/.exec($.trim());if(!Z)return null;return[Number(Z[1]),Number(Z[2]),Number(Z[3])]}function aU($,Z){let J=oJ($),X=oJ(Z);if(!J||!X)return!1;let[Q,Y,z]=J,[W,V,K]=X;if(Q!==W)return Q>W;if(Y!==V)return Y>V;return z>K}function fJ0(){let $=(process.env.LOKI_NO_UPDATE_CHECK??"").trim().toLowerCase();if($==="1"||$==="true"||$==="yes")return!0;if(process.env.LOKI_AIRGAP==="true")return!0;if(process.env.CI)return!0;if(!process.stdout.isTTY)return!0;return!1}function gJ0($){try{let Z=fA($,"utf-8"),J=JSON.parse(Z);if(typeof J.checkedAt==="number"&&typeof J.latest==="string"&&oJ(J.latest)!==null)return{checkedAt:J.checkedAt,latest:J.latest}}catch{}return null}function YX8($){try{let Z=JSON.parse(fA($,"utf-8")).failedAt;if(typeof Z==="number")return Z}catch{}return null}function zX8($,Z){let J=gJ0($);try{qg(xV($),{recursive:!0}),Ug($,JSON.stringify({...J??{},failedAt:Z}),"utf-8")}catch{}}function WX8($,Z){try{qg(xV($),{recursive:!0}),Ug($,JSON.stringify(Z),"utf-8")}catch{}}async function VX8(){try{let $=await fetch($X8,{signal:AbortSignal.timeout(JX8),headers:{accept:"application/json"}});if(!$.ok)return null;let Z=await $.json();if(typeof Z.version==="string"&&oJ(Z.version)!==null)return Z.version}catch{}return null}async function KX8($=Date.now(),Z=VX8,J=QX8()){let X=gJ0(J);if(X&&$-X.checkedAt<ZX8)return X.latest;let Q=YX8(J);if(Q!==null&&$-Q>=0&&$-Q<XX8)return null;let Y=await Z();if(Y===null)return zX8(J,$),null;return WX8(J,{checkedAt:$,latest:Y}),Y}function GX8($,Z=process.env){if(oJ($)===null)return null;let X=Z.PATH;if(!X)return null;let Q=new Set;for(let Y of X.split(":")){if(!Y)continue;let z=Hg(Y,"loki"),W;try{eJ8(z),W=tJ8(z)}catch{continue}if(Q.has(W))continue;Q.add(W);try{let V=Hg(xV(xV(W)),"package.json"),K=JSON.parse(fA(V,"utf8")).version;if(typeof K!=="string")continue;if(aU(K,$))return{path:z,version:K}}catch{continue}}return null}function HX8(){return hJ0(n3(),"cache","last-seen-version.json")}function qX8($,Z={}){try{if(fJ0())return!1;if(oJ($)===null)return!1;let J=Z.seenFile??HX8(),X=null;try{let Y=JSON.parse(fA(J,"utf-8")).version;if(typeof Y==="string"&&oJ(Y)!==null)X=Y}catch{}if(X!==null&&!aU($,X))return!1;try{qg(xV(J),{recursive:!0}),Ug(J,JSON.stringify({version:$}),"utf-8")}catch{return!1}if(X===null)return!1;return(Z.write??((Y)=>process.stderr.write(Y)))(`Loki Mode upgraded ${X} -> ${$}. What is new: https://github.com/asklokesh/loki-mode/releases/tag/v${$}
3
3
  `),!0}catch{return!1}}function UX8($){let Z=$.replace(/\\/g,"/");if(Z.includes("/Cellar/"))return"brew upgrade loki-mode";if(/\/pnpm\//.test(Z)||Z.includes("/.pnpm/"))return"pnpm add -g loki-mode (or npm i -g loki-mode)";if(Z.includes("/yarn/global/")||Z.includes("/.yarn/"))return"yarn global add loki-mode (or npm i -g loki-mode)";if(Z.includes("/.bun/"))return"bun install -g loki-mode (or npm i -g loki-mode)";if(Z.includes("/lib/node_modules/"))return"npm i -g loki-mode (or bun install -g loki-mode)";if(Z.includes("/homebrew/"))return"brew upgrade loki-mode";return"bun install -g loki-mode (or npm i -g loki-mode)"}async function mJ0($,Z={}){try{if(fJ0())return;if(oJ($)===null)return;let J=Z.write??((Y)=>process.stderr.write(Y));qX8($,{write:J,...Z.cacheFile?{seenFile:Hg(xV(Z.cacheFile),"last-seen-version.json")}:{}});let X=GX8($,Z.env??process.env);if(X!==null){J(`Loki Mode ${X.version} is installed but not the one running (you are running ${$}).
4
4
  Another loki earlier on PATH is winning. Newer copy: ${X.path}
5
5
  Run \`which -a loki\` to see the order, then remove or re-point the earlier entry.
@@ -195,7 +195,7 @@ ${K.get(k.path).slice(k.start-1,k.end).join(`
195
195
  `)}`)].join(`
196
196
  `);return{text:r,files:s,spans:Y0.map(({path:k,start:m,end:i,symbol:S,via:g})=>({path:k,start:m,end:i,symbol:S,via:g})),tokens:az8(r),budget_tokens:Q}}function TW8($,Z,J){let X=$?.brief_files;if(!Array.isArray(X))return null;let Q=new Set(X.filter((H)=>typeof H==="string")),Y=[];for(let H=0;H+1<Z.length;H+=2)if(/^[MDT]$/.test(Z[H].trim().split(" ").pop()??"")&&!B8(Z[H+1])&&!Z[H+1].startsWith(".loki/"))Y.push(Z[H+1]);let z=Y.filter((H)=>Q.has(H)).length,W=null,V=Array.isArray($?.iteration_ids)?$.iteration_ids[0]:void 0;if(typeof V==="string"&&/^[\w.-]+$/.test(V))try{let H=JSON.parse(Nm(Fm(J,".loki","metrics",`result-cost-${V}.json`),"utf8"));if(typeof H.reads_before_first_edit==="number")W=H.reads_before_first_edit}catch{}let K=(H)=>Math.round(H*1000)/1000,G=$?.context_pack;return{brief_files:Q.size,changed_files:Y.length,covered_files:z,context_recall:Y.length?K(z/Y.length):null,context_precision:Q.size?K(z/Q.size):null,reads_before_first_edit:W,...typeof G?.tokens==="number"?{pack_tokens:G.tokens}:{}}}function tQ0($,Z=20){let J=[];try{for(let z of pz8($)){let W=Fm($,z,"receipt.json");try{let V=JSON.parse(Nm(W,"utf8"));J.push({mtime:iz8(W).mtimeMs,recall:V.context?.context_recall})}catch{}}}catch{}J=J.sort((z,W)=>z.mtime-W.mtime).slice(-Z);let X=J.map((z)=>z.recall).filter((z)=>typeof z==="number").sort((z,W)=>z-W),Q=X.length>>1;return{median:!X.length?null:X.length%2?X[Q]:Math.round((X[Q-1]+X[Q])/2*1000)/1000,n:X.length,runs_considered:J.length}}var IT,az8=($)=>Math.ceil(Buffer.byteLength($)/3),Bm,oz8,nz8,sz8,rz8,tz8,ez8,$W8,ZW8,JW8,XW8,QW8,YW8,zW8,WW8,VW8,KW8,Mm=256000,MW8=6000,NW8=3200,lQ0=8,iQ0=120,FW8=200,LW8=!0,jW8=3,CW8=6,PW8=3,rQ0=($,Z,J)=>{let X=TW8($,Z,J);return X?{context:X}:{}};var $2=x(()=>{Wm();y0();U7();IT=/\.(java|kt|kts|cs|go|rs)$/;Bm=new Set(["if","for","while","switch","catch","return","function","new","await","typeof","super","this","else","do","try","throw","using","lock","foreach","when","match","loop","fixed","checked","unchecked","yield","sizeof","nameof","default","case"]),oz8=/^\s*(?:export\s+)?(?:default\s+)?(?:declare\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/,nz8=/^\s*(?:export\s+)?(?:default\s+)?(?:declare\s+)?(?:abstract\s+)?class\s+([A-Za-z_$][\w$]*)/,sz8=/^\s*(?:export\s+)?(?:declare\s+)?(?:const\s+)?(?:interface|enum|type|namespace)\s+([A-Za-z_$][\w$]*)/,rz8=/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)/,tz8=/^\s+(?:(?:public|private|protected|static|async|readonly|override|abstract|get|set)\s+)*\*?#?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/,ez8=/^\s*(?:@\w+(?:\([^)]*\))?\s+)*(?:(?:public|private|protected|internal|static|final|abstract|sealed|partial|data|open|inner|enum|annotation|value|readonly|ref|unsafe|new|file)\s+)*(?:class|interface|enum|record|struct|object)\s+([A-Za-z_]\w*)/,$W8=/^\s*(?:@\w+(?:\([^)]*\))?\s+)*(?:(?:public|private|protected|internal|static|final|abstract|override|virtual|async|synchronized|native|sealed|partial|readonly|extern|unsafe|new|default|strictfp)\s+)*(?:<[^>]+>\s+)?([\w<>[\],.?]+(?:\s*<[^>]*>)?)\s+([A-Za-z_]\w*)\s*(?:<[^>]*>)?\s*\(/,ZW8=/^\s*(?:(?:public|private|protected|internal|static)\s+)+([A-Za-z_]\w*)\s*\(/,JW8=/^\s*(?:@\w+(?:\([^)]*\))?\s+)*(?:(?:public|private|protected|internal|override|open|abstract|suspend|inline|operator|infix|tailrec|external|final)\s+)*fun\s+(?:<[^>]+>\s*)?(?:[\w.<>?]+\.)?([A-Za-z_]\w*)\s*\(/,XW8=/^func\s+(?:\(\s*(?:\w+\s+)?\*?\s*([A-Za-z_]\w*)(?:\[[^\]]*\])?\s*\)\s*)?([A-Za-z_]\w*)/,QW8=/^type\s+([A-Za-z_]\w*)\b/,YW8=/^(?:var|const)\s+([A-Za-z_]\w*)/,zW8=/^\s*(?:pub(?:\([^)]*\))?\s+)?(?:default\s+)?(?:const\s+)?(?:async\s+)?(?:unsafe\s+)?(?:extern\s+(?:"[^"]*"\s+)?)?fn\s+([A-Za-z_]\w*)/,WW8=/^\s*(?:pub(?:\([^)]*\))?\s+)?(?:struct|enum|trait|union|mod)\s+([A-Za-z_]\w*)/,VW8=/^\s*(?:unsafe\s+)?impl(?:\s*<[^>]*>)?\s+(?:[\w:<>, ]+?\s+for\s+)?([A-Za-z_]\w*)/,KW8=/^\s*(?:pub(?:\([^)]*\))?\s+)?(?:const|static)\s+([A-Za-z_]\w*)/});import{closeSync as IW8,openSync as RW8,readSync as EW8}from"fs";import{join as eQ0}from"path";function TY($,Z=ZY0()){let J;try{J=t($,["ls-files"],{stdio:["ignore","pipe","pipe"]})}catch{return{files:[],truncated:!1}}let X=J.split(`
197
197
  `).filter((Q)=>Q.length>0);if(X.length>Z){let Q=DQ0($,X),Y=(z)=>Q.has(z)||/(^|\/)(vendor|node_modules|dist|build|third_party)\//.test(z);X=[...X.filter((z)=>!Y(z)),...X.filter(Y)]}return{files:X.slice(0,Z),truncated:X.length>Z}}function _W8($,Z){let J,X=-1;try{let W=Buffer.allocUnsafe($Y0);X=RW8($,"r"),J=W.toString("utf8",0,EW8(X,W,0,$Y0,0))}catch{return[]}finally{if(X>=0)try{IW8(X)}catch{}}let Q=[],Y="",z="";for(let W of J.matchAll(Z)){if(Q.length>=JY0)break;if(Z!==XY0){if(W[1])Q.push(W[1]);continue}if(W[1]||W[2]){Y=W[2]??"",z="",Q.push(W[1]??W[2]);continue}if(Y&&(z||=W[3])===W[3])Q.push(`${Y}.${W[4]}`)}return Q}function $X($,Z=ZY0()){let{files:J,truncated:X}=TY($,Z),Q=[];for(let Y of J){if(!wW8.test(Y))continue;let z=IT.test(Y)?oQ0(eQ0($,Y),JY0):_W8(eQ0($,Y),Y.endsWith(".py")?XY0:DW8);if(z.length>0)Q.push({path:Y,symbols:z})}return{files:J,entries:Q,truncated:X}}var ZY0=()=>{let $=process.env.LOKI_E10_REPOMAP_MAX_FILES,Z=Number($);if(Number.isInteger(Z)&&Z>0)return Z;if($)process.stderr.write(`loki: ignoring invalid LOKI_E10_REPOMAP_MAX_FILES=${JSON.stringify($)}; using default 2000
198
- `);return 2000},$Y0=256000,JY0=300,wW8,DW8,XY0;var tJ=x(()=>{y0();GB();$2();wW8=/\.(ts|tsx|js|jsx|mjs|cjs|py|java|kt|kts|cs|go|rs)$/,DW8=/^export\s+(?:default\s+)?(?:async\s+)?(?:function|class|const|let|interface|type|enum)\s+([A-Za-z0-9_$]+)/gm,XY0=/^(?:(?:async\s+)?def\s+(\w+)|class\s+(\w+))|^([ \t]+)(?:async\s+)?def\s+(\w+)/gm});import{createHash as QY0}from"crypto";import{readdirSync as xW8,readFileSync as kW8}from"fs";import{relative as yW8,resolve as YY0}from"path";function SW8($){let Z=QY0("sha256"),J=(X)=>{for(let Q of xW8(X,{withFileTypes:!0}).sort((Y,z)=>Y.name<z.name?-1:1)){let Y=YY0(X,Q.name);if(Q.isDirectory()){if(Q.name!=="node_modules")J(Y)}else if(Q.isFile()&&Q.name.endsWith(".ts"))Z.update(`${yW8($,Y)}\x00`).update(kW8(Y)).update("\x00")}};return J($),Z.digest("hex")}function vW8($=YY0(import.meta.dir,".."),Z="f6e91ff5e2fed3180071ee6389ea8971e9f04c68eb798e363dea20153a0a5644"){if(typeof Z==="string"&&/^[0-9a-f]{64}$/.test(Z))return Z;try{return SW8($)}catch{return QY0("sha256").update(`unbound:${process.pid}:${Date.now()}:${Math.random()}`).digest("hex")}}function wY(){return bW8??=vW8()}var bW8=null;var zY0=()=>{};import{createHash as GY0}from"crypto";import{chmodSync as WY0,existsSync as hW8,mkdirSync as fW8,readdirSync as gW8,readFileSync as mW8,renameSync as uW8,statSync as dW8,unlinkSync as HY0,writeFileSync as cW8}from"fs";import{basename as pW8,resolve as n2}from"path";function B7($,Z){let J=$&&$.trim()!==""?$:n2(Z);return GY0("sha256").update(J).digest("hex")}function Lm(){return n2(n3(),"cache","v10")}function r7($,Z=Lm()){return n2(Z,$)}function dV($,Z=(J)=>!0){if(!hW8($))return null;try{let J=JSON.parse(mW8($,"utf8"));return Z(J)?J:null}catch{return null}}function lW8($){return typeof $==="object"&&$!==null&&Array.isArray($.files)&&Array.isArray($.entries)}function iW8($){return typeof $==="object"&&$!==null&&Array.isArray($.runners)&&Array.isArray($.tests)}function ET($,Z,J){fW8(Z,{recursive:!0,mode:448}),WY0(Z,448);let X=`${$}.${process.pid}.${aW8++}.tmp`;try{cW8(X,JSON.stringify(J),{mode:384}),WY0(X,384),uW8(X,$)}catch(Q){try{HY0(X)}catch{}throw Q}}function VY0($,Z,J,X=Z==="slice-"?500:5){let Q=(Y)=>{try{return dW8(n2($,Y)).mtimeMs}catch{return 0}};try{gW8($).filter((Y)=>Y.startsWith(Z)&&Y.endsWith(".json")&&Y!==pW8(J)).sort((Y,z)=>Q(z)-Q(Y)||(Y<z?1:-1)).slice(X-1).forEach((Y)=>{try{HY0(n2($,Y))}catch{}})}catch{}}function sW8($,Z,J){if($)return KY0.hits++,$;KY0.misses++;let X=Z();try{J(X)}catch{}return X}var aW8=0,oW8,Om=($,Z,J,X)=>{ET($,Z,X),VY0(Z,J,$);let Q=oW8[J];if(Q)VY0(Z,Q,$,1)},wT=($,Z,J=wY())=>`${$}-${J.slice(0,16)}-${Z}.json`,NB=($,Z,J=wY())=>dV(n2($,wT("repomap",Z,J)),lW8),nW8=($,Z,J,X=wY())=>Om(n2($,wT("repomap",Z,X)),$,"repomap-",J),qY0=($,Z,J=wY())=>dV(n2($,wT("testmap",Z,J)),iW8),UY0=($,Z,J,X=wY())=>Om(n2($,wT("testmap",Z,X)),$,"testmap-",J),KY0,BY0=($,Z,J,X=wY())=>sW8(NB($,Z,X),J,(Q)=>nW8($,Z,Q,X)),MY0=($,Z)=>GY0("sha256").update(`${$.length}:${$}\x00${Z}`).digest("hex"),rW8=($)=>{let Z=$;return typeof Z==="object"&&Z!==null&&typeof Z.gid==="string"&&typeof Z.id==="string"&&typeof Z.head==="string"&&Number.isInteger(Z.n)},NY0=($,Z)=>dV(n2($,`slice-${Z}.json`),rW8),FY0=($,Z,J)=>Om(n2($,`slice-${Z}.json`),$,"slice-",J);var s2=x(()=>{q8();zY0();oW8={"repomap-":"repomap2-"},KY0={hits:0,misses:0}});function LY0($){return Array.from(new Set(($.toLowerCase().match(/[a-z0-9_]+/g)??[]).filter((Z)=>Z.length>2)))}function DY($,Z,J=jm,X){return _Q0($,Z,J,X).map((Q)=>Q.path)}var jm=8,OY0=($)=>`${$.path} ${$.symbols.join(" ")}`.toLowerCase();var DT=x(()=>{Wm()});function eW8($,Z,J=jm){let X=Z.entries;if(X.length===0)return[];let Q=X.map((W)=>new Set(tW8(OY0(W)))),Y=LY0($).filter((W)=>{let V=Q.reduce((K,G)=>K+(G.has(W)?1:0),0);return V>0&&V*2<=Q.length});if(Y.length===0)return[];return Q.map((W,V)=>({path:X[V].path,score:Y.reduce((K,G)=>K+(W.has(G)?1:0),0),idx:V})).filter((W)=>W.score>0).sort((W,V)=>V.score-W.score||W.idx-V.idx).slice(0,J).map((W)=>W.path)}function jY0($,Z,J=process.env){if(J.LOKI_SPEED==="0"||!Z)return[];try{return eW8($,Z)}catch{return[]}}var tW8=($)=>$.toLowerCase().match(/[a-z0-9_]+/g)??[];var CY0=x(()=>{DT()});function PY0($){let Z=$.slice($.lastIndexOf("/")+1);return $V8.test(Z)}function Pm($){let Z=[],J=[];for(let Q of $.split(/\r?\n/)){let Y=Cm.exec(Q);if(Y){Z.push(Y[1].trim());continue}let z=TY0.exec(Q);if(z)J.push(z[1].trim())}if(Z.length)return Z;if(J.length)return J;let X=$.trim();return X?[X]:[]}function GV8($=process.env){try{let Z=JSON.parse($[_T]??"[]");return Array.isArray(Z)?Z.filter((J)=>typeof J==="string"):[]}catch{return[]}}function cV($,Z=GV8()){let J="none",X=0,Q=0;for(let K of $.split(/\r?\n/)){if(Cm.exec(K)){if((/^\s*/.exec(K)?.[0].length??0)>=2)continue;let U=/^\s*(?:\d+[.)]|[-*+])\s+\[[ xX]\]/.test(K);if(J==="accept"||U&&J!=="solution")Q++;else if(J==="solution"||J==="none")X++;continue}let H=TY0.exec(K)?.[1];if(H!==void 0){J=AY0(H)??"other";continue}let q=/[:*_]\s*$/.test(K)||/^\s*(?:\*\*|__)/.test(K)?QV8.exec(K)?.[1]:void 0;if(q!==void 0)J=AY0(q)??(XV8.test(q)?"other":J)}let Y=YV8.test($)&&zV8.test($),z=[X>=WV8,Q>=VV8,Y].filter(Boolean).length,W=Z.map((K)=>K.trim().toLowerCase()).find((K)=>KV8.test(K)),V=`structure: ${X} solution part(s), ${Q} acceptance criteria, ${Y?"backend and frontend":"one side of the stack"}`;return{parts:X,criteria:Q,stack:Y,large:Boolean(W)||z>=2,reason:W?`label ${W}`:V}}function IY0($){let Z=$.split(/\r?\n/),J=[],X=null;for(let z of Z){let W=HV8.exec(z);if(W){if(X)J.push({n:X.n,title:X.title,body:X.body.join(`
198
+ `);return 2000},$Y0=256000,JY0=300,wW8,DW8,XY0;var tJ=x(()=>{y0();GB();$2();wW8=/\.(ts|tsx|js|jsx|mjs|cjs|py|java|kt|kts|cs|go|rs)$/,DW8=/^export\s+(?:default\s+)?(?:async\s+)?(?:function|class|const|let|interface|type|enum)\s+([A-Za-z0-9_$]+)/gm,XY0=/^(?:(?:async\s+)?def\s+(\w+)|class\s+(\w+))|^([ \t]+)(?:async\s+)?def\s+(\w+)/gm});import{createHash as QY0}from"crypto";import{readdirSync as xW8,readFileSync as kW8}from"fs";import{relative as yW8,resolve as YY0}from"path";function SW8($){let Z=QY0("sha256"),J=(X)=>{for(let Q of xW8(X,{withFileTypes:!0}).sort((Y,z)=>Y.name<z.name?-1:1)){let Y=YY0(X,Q.name);if(Q.isDirectory()){if(Q.name!=="node_modules")J(Y)}else if(Q.isFile()&&Q.name.endsWith(".ts"))Z.update(`${yW8($,Y)}\x00`).update(kW8(Y)).update("\x00")}};return J($),Z.digest("hex")}function vW8($=YY0(import.meta.dir,".."),Z="005d494d6f472a56460a726a958f107f0546af1e558434530bdcfd8115929c50"){if(typeof Z==="string"&&/^[0-9a-f]{64}$/.test(Z))return Z;try{return SW8($)}catch{return QY0("sha256").update(`unbound:${process.pid}:${Date.now()}:${Math.random()}`).digest("hex")}}function wY(){return bW8??=vW8()}var bW8=null;var zY0=()=>{};import{createHash as GY0}from"crypto";import{chmodSync as WY0,existsSync as hW8,mkdirSync as fW8,readdirSync as gW8,readFileSync as mW8,renameSync as uW8,statSync as dW8,unlinkSync as HY0,writeFileSync as cW8}from"fs";import{basename as pW8,resolve as n2}from"path";function B7($,Z){let J=$&&$.trim()!==""?$:n2(Z);return GY0("sha256").update(J).digest("hex")}function Lm(){return n2(n3(),"cache","v10")}function r7($,Z=Lm()){return n2(Z,$)}function dV($,Z=(J)=>!0){if(!hW8($))return null;try{let J=JSON.parse(mW8($,"utf8"));return Z(J)?J:null}catch{return null}}function lW8($){return typeof $==="object"&&$!==null&&Array.isArray($.files)&&Array.isArray($.entries)}function iW8($){return typeof $==="object"&&$!==null&&Array.isArray($.runners)&&Array.isArray($.tests)}function ET($,Z,J){fW8(Z,{recursive:!0,mode:448}),WY0(Z,448);let X=`${$}.${process.pid}.${aW8++}.tmp`;try{cW8(X,JSON.stringify(J),{mode:384}),WY0(X,384),uW8(X,$)}catch(Q){try{HY0(X)}catch{}throw Q}}function VY0($,Z,J,X=Z==="slice-"?500:5){let Q=(Y)=>{try{return dW8(n2($,Y)).mtimeMs}catch{return 0}};try{gW8($).filter((Y)=>Y.startsWith(Z)&&Y.endsWith(".json")&&Y!==pW8(J)).sort((Y,z)=>Q(z)-Q(Y)||(Y<z?1:-1)).slice(X-1).forEach((Y)=>{try{HY0(n2($,Y))}catch{}})}catch{}}function sW8($,Z,J){if($)return KY0.hits++,$;KY0.misses++;let X=Z();try{J(X)}catch{}return X}var aW8=0,oW8,Om=($,Z,J,X)=>{ET($,Z,X),VY0(Z,J,$);let Q=oW8[J];if(Q)VY0(Z,Q,$,1)},wT=($,Z,J=wY())=>`${$}-${J.slice(0,16)}-${Z}.json`,NB=($,Z,J=wY())=>dV(n2($,wT("repomap",Z,J)),lW8),nW8=($,Z,J,X=wY())=>Om(n2($,wT("repomap",Z,X)),$,"repomap-",J),qY0=($,Z,J=wY())=>dV(n2($,wT("testmap",Z,J)),iW8),UY0=($,Z,J,X=wY())=>Om(n2($,wT("testmap",Z,X)),$,"testmap-",J),KY0,BY0=($,Z,J,X=wY())=>sW8(NB($,Z,X),J,(Q)=>nW8($,Z,Q,X)),MY0=($,Z)=>GY0("sha256").update(`${$.length}:${$}\x00${Z}`).digest("hex"),rW8=($)=>{let Z=$;return typeof Z==="object"&&Z!==null&&typeof Z.gid==="string"&&typeof Z.id==="string"&&typeof Z.head==="string"&&Number.isInteger(Z.n)},NY0=($,Z)=>dV(n2($,`slice-${Z}.json`),rW8),FY0=($,Z,J)=>Om(n2($,`slice-${Z}.json`),$,"slice-",J);var s2=x(()=>{q8();zY0();oW8={"repomap-":"repomap2-"},KY0={hits:0,misses:0}});function LY0($){return Array.from(new Set(($.toLowerCase().match(/[a-z0-9_]+/g)??[]).filter((Z)=>Z.length>2)))}function DY($,Z,J=jm,X){return _Q0($,Z,J,X).map((Q)=>Q.path)}var jm=8,OY0=($)=>`${$.path} ${$.symbols.join(" ")}`.toLowerCase();var DT=x(()=>{Wm()});function eW8($,Z,J=jm){let X=Z.entries;if(X.length===0)return[];let Q=X.map((W)=>new Set(tW8(OY0(W)))),Y=LY0($).filter((W)=>{let V=Q.reduce((K,G)=>K+(G.has(W)?1:0),0);return V>0&&V*2<=Q.length});if(Y.length===0)return[];return Q.map((W,V)=>({path:X[V].path,score:Y.reduce((K,G)=>K+(W.has(G)?1:0),0),idx:V})).filter((W)=>W.score>0).sort((W,V)=>V.score-W.score||W.idx-V.idx).slice(0,J).map((W)=>W.path)}function jY0($,Z,J=process.env){if(J.LOKI_SPEED==="0"||!Z)return[];try{return eW8($,Z)}catch{return[]}}var tW8=($)=>$.toLowerCase().match(/[a-z0-9_]+/g)??[];var CY0=x(()=>{DT()});function PY0($){let Z=$.slice($.lastIndexOf("/")+1);return $V8.test(Z)}function Pm($){let Z=[],J=[];for(let Q of $.split(/\r?\n/)){let Y=Cm.exec(Q);if(Y){Z.push(Y[1].trim());continue}let z=TY0.exec(Q);if(z)J.push(z[1].trim())}if(Z.length)return Z;if(J.length)return J;let X=$.trim();return X?[X]:[]}function GV8($=process.env){try{let Z=JSON.parse($[_T]??"[]");return Array.isArray(Z)?Z.filter((J)=>typeof J==="string"):[]}catch{return[]}}function cV($,Z=GV8()){let J="none",X=0,Q=0;for(let K of $.split(/\r?\n/)){if(Cm.exec(K)){if((/^\s*/.exec(K)?.[0].length??0)>=2)continue;let U=/^\s*(?:\d+[.)]|[-*+])\s+\[[ xX]\]/.test(K);if(J==="accept"||U&&J!=="solution")Q++;else if(J==="solution"||J==="none")X++;continue}let H=TY0.exec(K)?.[1];if(H!==void 0){J=AY0(H)??"other";continue}let q=/[:*_]\s*$/.test(K)||/^\s*(?:\*\*|__)/.test(K)?QV8.exec(K)?.[1]:void 0;if(q!==void 0)J=AY0(q)??(XV8.test(q)?"other":J)}let Y=YV8.test($)&&zV8.test($),z=[X>=WV8,Q>=VV8,Y].filter(Boolean).length,W=Z.map((K)=>K.trim().toLowerCase()).find((K)=>KV8.test(K)),V=`structure: ${X} solution part(s), ${Q} acceptance criteria, ${Y?"backend and frontend":"one side of the stack"}`;return{parts:X,criteria:Q,stack:Y,large:Boolean(W)||z>=2,reason:W?`label ${W}`:V}}function IY0($){let Z=$.split(/\r?\n/),J=[],X=null;for(let z of Z){let W=HV8.exec(z);if(W){if(X)J.push({n:X.n,title:X.title,body:X.body.join(`
199
199
  `).trim()});X={n:Number(W[1]),title:(W[2]??"").trim(),body:[]}}else if(X)X.body.push(z)}if(X)J.push({n:X.n,title:X.title,body:X.body.join(`
200
200
  `).trim()});if(J.length>=2)return J.map((z)=>({...z,body:z.body||z.title||`Milestone ${z.n}`}));let Q=[],Y=!1;for(let z of Z){if(!Y){Y=qV8.test(z);continue}let W=Cm.exec(z);if(W){let V=W[1].trim();Q.push({n:Q.length+1,title:V,body:V});continue}if(z.trim()===""||/^\s+\S/.test(z))continue;break}return Q.length>=2?Q:[]}function UV8($,Z){let J=[...Z].sort((Q,Y)=>Y.length-Q.length||(Q<Y?-1:1)).find((Q)=>$===Q||$.startsWith(`${Q}/`));if(J)return J;let X=$.indexOf("/");return X<0?".":$.slice(0,X)}function BV8($,Z){let J=[];for(let X of $.split(/[\s`'"(),;:]+/)){let Q=X.replace(/^\.\//,"").replace(/\.+$/,"");if(Q&&Z.has(Q))J.push(Q)}return J}function Am($,Z,J){let X=Pm($),Q=new Set(Z.files),Y=J.maxFilesPerItem??8,z=J.workspaces??[],W=X.map((L)=>{let O=FB([...BV8(L,Q),...J.select(L,Z,Y).filter((j)=>Q.has(j))]);return{text:L,files:O.filter((j)=>!PY0(j)),shared:O.filter(PY0)}}),V=W.map((L,O)=>O),K=(L)=>{while(V[L]!==L)V[L]=V[V[L]],L=V[L];return L},G=new Map;W.forEach((L,O)=>{for(let j of L.files){let C=G.get(j);if(C===void 0)G.set(j,O);else{let T=K(O),A=K(C);if(T!==A)V[Math.max(T,A)]=Math.min(T,A)}}});let H=W.findIndex((L)=>L.files.length>0);W.forEach((L,O)=>{if(L.files.length>0)return;let j=K(O),C=K(H<0?0:H);if(j!==C)V[Math.max(j,C)]=Math.min(j,C)});let q=new Map;W.forEach((L,O)=>{let j=K(O);q.set(j,[...q.get(j)??[],O])});let B=[...q.keys()].sort((L,O)=>L-O).map((L,O)=>{let j=q.get(L),C=FB(j.flatMap((A)=>W[A].files)),T=FB(j.flatMap((A)=>W[A].shared));return{id:`u${O+1}`,items:j.map((A)=>W[A].text),writeSet:C,modules:FB([...C,...T].map((A)=>UV8(A,z))),serialized:T}}),M=[],F=FB(B.flatMap((L)=>L.serialized));for(let L of F){let O=B.filter((j)=>j.serialized.includes(L));for(let j=1;j<O.length;j++)M.push({from:O[j-1].id,to:O[j].id,via:L})}let N=(L)=>`${L.from}\x00${L.to}\x00${L.via}`;return M.sort((L,O)=>N(L)<N(O)?-1:N(L)>N(O)?1:0),{units:B,sharedFiles:F,edges:M}}var $V8,Cm,TY0,ZV8,JV8,XV8,QV8,AY0=($)=>JV8.test($)?"accept":ZV8.test($)?"solution":void 0,YV8,zV8,WV8=4,VV8=4,KV8,_T="LOKI_E10_ISSUE_LABELS",HV8,qV8,FB=($)=>[...new Set($)].sort();var pV=x(()=>{$V8=/^(package\.json|package-lock\.json|bun\.lockb?|yarn\.lock|pnpm-lock\.yaml|Cargo\.toml|Cargo\.lock|go\.mod|go\.sum|poetry\.lock|Pipfile\.lock|requirements\.txt|pyproject\.toml|CHANGELOG(\.md)?|index\.(ts|tsx|js|jsx|mjs)|__init__\.py|mod\.rs)$/i,Cm=/^\s*(?:\d+[.)]|[-*+])\s+(?:\[[ xX]\]\s+)?(\S.*)$/,TY0=/^\s{0,3}#{1,6}\s+(\S.*?)\s*#*\s*$/;ZV8=/\b(solution|proposal|proposed|implementation|deliverables?|scope|requirements?|tasks?|features?|changes|goals?|plan|todo|work items?)\b/i,JV8=/\b(acceptance|criteria|definition of done|done when)\b/i,XV8=/\b(problem|background|context|motivation|reproduce|steps|expected|actual|observed|environment|notes?|logs?|errors?|trace|screenshots?|current)\b/i,QV8=/^\s{0,3}(?:\*\*|__)?([A-Za-z][\w /&-]{0,60}?)(?:\*\*|__)?\s*:?\s*(?:\*\*|__)?\s*$/,YV8=/\b(backend|back-end|server|api|endpoints?|routes?|database|sql|postgres(?:ql)?|mysql|sqlite|migrations?|fastify|express|django|flask|rails|graphql)\b/i,zV8=/\b(frontend|front-end|ui|react|vue|svelte|angular|components?|pages?|css|tailwind|dashboard|autocomplete)\b/i,KV8=/^(?:epic|umbrella|tracking|meta)$/i;HV8=/^\s{0,3}#{1,6}\s+Milestone\s+(\d+)\s*(?:[:.-]\s*(.*?))?\s*#*\s*$/i,qV8=/^milestones:\s*$/i});import{readFileSync as xT}from"fs";import{resolve as kT}from"path";function t7($){try{let Z=process.env.LOKI_MODEL_CATALOG||kT(_0,"providers/model_catalog.json");return JSON.parse(xT(Z,"utf8")).providers?.claude?.cli_aliases?.[$]??$}catch{return $}}function Tm($){return MV8.has($)}function Im($){try{let Z=process.env.LOKI_MODEL_CATALOG||kT(_0,"providers/model_catalog.json"),J=JSON.parse(xT(Z,"utf8")).providers?.claude?.models;if(!Array.isArray(J))return null;let X=[];for(let W of J)if(W.tier!=="legacy"&&!X.includes(W.tier))X.push(W.tier);let Q=t7($),Y=J.find((W)=>W.id===Q||W.alias===$),z=Y?X.indexOf(Y.tier):-1;return z>=0?z:null}catch{return null}}function RY0($){try{let Z=process.env.LOKI_MODEL_CATALOG||kT(_0,"providers/model_catalog.json"),J=JSON.parse(xT(Z,"utf8")).providers?.claude?.models;if(!Array.isArray(J))return null;let X=t7($),Q=J.find((Y)=>Y.id===X||Y.alias===$)?.effort?.levels;return Array.isArray(Q)?Q:null}catch{return null}}function yT($){try{let Z=process.env.LOKI_MODEL_CATALOG||kT(_0,"providers/model_catalog.json"),J=JSON.parse(xT(Z,"utf8")).providers?.claude?.models;if(!Array.isArray(J))return null;let X=t7($);return J.find((Q)=>Q.id===X||Q.alias===$)?.thinking??null}catch{return null}}function ST($,Z){let J=yT($)?.max_effort?.[Z];return typeof J==="string"?J:null}function bT($,Z){let J=yT($)?.substitute?.[Z];return typeof J==="string"?J:null}function LB($,Z){let J=yT($);if(!J||!Array.isArray(J.types))return!0;return J.types.includes(Z)||typeof J.substitute?.[Z]==="string"}function EY0($){let Z=yT($)?.types;return Array.isArray(Z)&&Z.includes("adaptive")}function vT($){let Z=($??"").trim().toLowerCase();if(!Z)return;let J=Em[Z]??Z;if(!Rm.has(J))throw Error(`unknown LOKI_SESSION_MODEL '${($??"").trim()}' (small|medium|high, planning|development|fast, or opus|sonnet|haiku|fable)`);return J}function wm($,Z=process.env){if(Z.LOKI_LEGACY_TIER_SWITCHING==="true")return;let J=(Z.LOKI_SESSION_MODEL??"").trim().toLowerCase();if($==="planning"&&(J==="high"||J==="planning"))return Z.LOKI_CLAUDE_MODEL_PLANNING||Z.LOKI_MODEL_PLANNING?void 0:"opus";if($!=="fast"||J!=="small"&&J!=="fast"||Z.LOKI_CLAUDE_MODEL_FAST||Z.LOKI_MODEL_FAST)return;return Z.LOKI_ALLOW_HAIKU===void 0||Z.LOKI_ALLOW_HAIKU==="true"?"haiku":void 0}var X6="claude (provider default)",MV8,Rm,Em;var M7=x(()=>{q8();MV8=new Set(["haiku","sonnet","opus","fable"]);Rm=new Set(["planning","development","fast","opus","sonnet","haiku","fable"]),Em={small:"fast",medium:"development",high:"planning"}});function wY0($=process.env){let Z=($.LOKI_ROUTER??"").trim().toLowerCase();if(Z==="0"||Z==="false"||Z==="off")return"opt-out";if(Z==="1"||Z==="true"||Z==="on")return"on";if(Z==="auto")return"auto";return"off"}function Z2($=process.env){let Z=($.LOKI_ROUTER_EXECUTOR??"").trim();if(Z)return{model:Z,reason:"LOKI_ROUTER=auto, executor from LOKI_ROUTER_EXECUTOR"};return $.LOKI_ALLOW_HAIKU==="false"?{model:"sonnet",reason:"LOKI_ROUTER=auto with LOKI_ALLOW_HAIKU=false: Sonnet executes implement and fix"}:{model:"haiku",reason:"LOKI_ROUTER=auto: Haiku executes implement and fix"}}function Dm($=process.env){let Z=($.LOKI_ADVISOR??"").trim().toLowerCase();return Z==="1"||Z==="true"||Z==="on"}var G9=($=process.env)=>{let Z=wY0($);return Z==="on"||Z==="auto"},_6=($=process.env)=>wY0($)==="auto",OB=($=process.env)=>G9($)||Dm($);var yY0={};w0(yY0,{wallReviewRequired:()=>CV8,unitRedo:()=>bm,resolveExecutor:()=>km,parseUnits:()=>Sm,parseRoute:()=>LV8,nextState:()=>ym,envOverride:()=>e7,defaultRoute:()=>xY0,WALL_UNIT_ID:()=>kY0,MAX_UNIT_FIELD:()=>xm,MAX_UNITS:()=>_m});function xY0($,Z="no route returned"){return{executor:"sonnet",source:"default",risk:"medium",reason:Z}}function LV8($,Z){let J=(z)=>({route:xY0(Z),notProven:`NOT PROVEN (owner model): routing decision ${z}`}),X=$;if(typeof X==="string")try{X=JSON.parse(X)}catch{return J("is not valid JSON")}if(typeof X!=="object"||X===null)return J("is missing");let Q=X,Y=typeof Q.route==="object"&&Q.route!==null?Q.route:Q;if(typeof Y.executor!=="string"||!_Y0.includes(Y.executor))return J("has an invalid executor");if(typeof Y.risk!=="string"||!NV8.includes(Y.risk))return J("has an invalid risk");if(typeof Y.reason!=="string"||Y.reason.trim()===""||Y.reason.length>200)return J("has an invalid reason");if(typeof Y.source!=="string"||!FV8.includes(Y.source))return J("has an invalid source");return{route:{executor:Y.executor,reason:Y.reason,risk:Y.risk,source:Y.source},notProven:null}}function e7($){for(let Z of["LOKI_MODEL_OVERRIDE","LOKI_CLAUDE_MODEL_DEVELOPMENT","LOKI_MODEL_DEVELOPMENT","LOKI_SESSION_MODEL"]){let J=($[Z]??"").trim();if(J)return J}return null}function km($){let Z=$.env??{},J=e7(Z);if(J)return{model:J,source:"override",reason:"explicit model override"};let X={model:$.route.executor,source:$.route.source,reason:$.route.reason},Q=(Z.LOKI_ROUTER_EXECUTOR??"").trim();if(Q)X={model:Q,source:"advisor",reason:"LOKI_ROUTER_EXECUTOR route input"};let Y=(G,H,q)=>{if(hT(G)>hT(X.model))X={model:G,source:H,reason:q}},z=/^(1|true)$/i.test((Z.LOKI_COST_FIRST??"").trim()),W=$.advisorAvailable&&hT(X.model)===0&&X.source!=="default"&&$.historyFloor!=="sonnet",V=z&&X.source==="advisor"&&$.shapeDefault!=="haiku"&&$.route.risk==="low",K=W&&($.shapeDefault==="haiku"||V);if(hT(X.model)===0&&!K)Y("sonnet","no-evidence","no evidence the shape earned haiku: executor sonnet");else if(K&&V)X={...X,reason:`${X.reason}; cost-first kept the lower-cost model`};if($.shapeDefault==="sonnet")Y("sonnet","shape-default","shipped shape default");else if($.shapeDefault==="prior-default")Y($.priorDefaultModel,"shape-default","shipped shape default: prior-default");if($.historyFloor==="sonnet")Y("sonnet","history","Haiku lost 2 of the last 3 runs on this shape");if(!$.advisorAvailable)Y("sonnet","no-advisor-floor","advisor unavailable: executor fixed at sonnet");return X}function ym($,Z){let J=(X="none")=>({state:$,action:X});if(Z.kind==="error")return J();if($.model==="haiku"){if(Z.kind==="code_fail_repeat"||Z.kind==="escalate_marker")return{state:{model:"sonnet",swapped:!0},action:"swap-sonnet"};return{state:{model:"sonnet",swapped:!0},action:"swap-sonnet-retry"}}if($.model==="sonnet"){if(Z.kind==="spec_conflict")return J("blocked");if(Z.kind==="code_fail_repeat"||Z.kind==="stall")return{state:{model:"opus",swapped:$.swapped},action:"fix-on-opus"};return J()}return Z.kind==="code_fail_repeat"||Z.kind==="stall"?J("stalled"):J()}function Sm($,Z){let J=$;if(typeof J==="string")try{J=JSON.parse(J)}catch{return{units:[],notProven:["NOT PROVEN (owner model): per-unit routes are not valid JSON; default sonnet"]}}let X=typeof J==="object"&&J!==null?J.units:void 0;if(!Array.isArray(X))return{units:[],notProven:["NOT PROVEN (owner model): no per-unit routes returned; default sonnet"]};if(X.length===0)return{units:[],notProven:["NOT PROVEN (owner model): empty per-unit routes; default sonnet"]};if(X.length>_m)return{units:[],notProven:[`NOT PROVEN (owner model): ${X.length} per-unit routes exceed the cap of ${_m}; default sonnet`]};let Q=(V)=>{let K=typeof V==="object"&&V!==null?V.id:void 0;return typeof K==="string"&&K.length<=xm&&OV8.test(K)&&!jV8.includes(K)?K:null},Y=new Map;for(let V of X){let K=Q(V);if(K!==null)Y.set(K,(Y.get(K)??0)+1)}let z=[],W=[];return X.forEach((V,K)=>{let G=typeof V==="object"&&V!==null?V:{},H=Q(V),q=H??`#${K}`,U=typeof G.kind==="string"&&G.kind.length<=xm,B=H!==null&&(Y.get(H)??0)>1;if(!(H!==null&&!B&&U&&typeof G.executor==="string"&&_Y0.includes(G.executor)&&typeof G.reason==="string"&&G.reason.trim()!==""&&G.reason.length<=200)){z.push({id:q,kind:U?G.kind:"",executor:"sonnet",reason:B?"duplicate unit id":"invalid unit route"}),W.push(`NOT PROVEN (owner model): unit ${q} route ${B?"has a duplicate id":"invalid"}; sonnet`);return}let F=G.executor==="haiku"&&!Z;z.push({id:q,kind:G.kind,executor:F?"sonnet":G.executor,reason:F?"advisor unavailable: raised to sonnet":G.reason})}),{units:z,notProven:W}}function bm($,Z){return $==="haiku"&&Z==="code"?"redo-sonnet":"none"}var _Y0,NV8,FV8,DY0,hT=($)=>{let Z=DY0.findIndex((J)=>$.toLowerCase().includes(J));return Z<0?DY0.length:Z},kY0="wall",_m=200,xm=64,OV8,jV8,CV8=($)=>$.some((Z)=>Z.id===kY0&&Z.executor==="haiku");var OZ=x(()=>{_Y0=["haiku","sonnet"],NV8=["low","medium","high"],FV8=["advisor","opus-plan"];DY0=["haiku","sonnet","opus"];OV8=/^[A-Za-z0-9_.-]+$/,jV8=["__proto__","constructor","prototype"]});var SY0,PV8=($)=>["0","off","false"].includes(($??"").toLowerCase()),_Y=($=process.env)=>!PV8($.LOKI_E10_WALL_CONCURRENT),bY0=($=process.env)=>{let Z=$.LOKI_E10_WALL_MAX_TOKENS,J=Z??"",X=Number(J);if(/^[0-9]+$/.test(J)&&Number.isSafeInteger(X)&&X>0)return X;if(Z!==void 0&&Z.trim()&&!SY0.has(Z))SY0.add(Z),process.stderr.write(`loki: LOKI_E10_WALL_MAX_TOKENS="${Z}" is not a positive decimal integer within the safe range; using 16000
201
201
  `);return 16000},fT=($=process.env)=>$.LOKI_E10_WALL_MAX_TOKENS===void 0&&$.CLAUDE_CODE_MAX_OUTPUT_TOKENS?void 0:bY0($);var jB=x(()=>{SY0=new Set});function AV8($,Z,J){let X=`${$}=${Z}`;if(vY0.has(X))return;vY0.add(X),process.stderr.write(`loki: ignoring invalid ${$}="${Z}" (need a number > 0); using ${J}${J===0?" (off)":"s"}
@@ -1451,7 +1451,7 @@ ${Z.content.trim()}
1451
1451
  REPLY`:`Harness:
1452
1452
  ${Z.content}`).join(`
1453
1453
 
1454
- `)}function Ap0($,Z,J=180000,X=process.env){if(X.LOKI_E10_INVOKER==="cli")return async({system:Q,messages:Y,signal:z})=>{try{let W=await WI(N8,Z,"implement-patch",$)([X.LOKI_CLAUDE_CLI||"claude","-p",t90(Y),"--output-format","json","--tools","","--model",$,"--system-prompt",Q,"--strict-mcp-config","--setting-sources","project"],{timeoutMs:J,group:!0,signal:z}),V=JSON.parse(W.stdout);return{text:W.exitCode===0&&!V.is_error&&typeof V.result==="string"?V.result:null,usd:typeof V.total_cost_usd==="number"?V.total_cost_usd:null}}catch{return{text:null,usd:null}}};return async({system:Q,messages:Y})=>{let z=await DW({model:$,system:Q,prompt:t90(Y),maxTokens:km5,thinking:"off",timeoutMs:J,ledger:{lokiDir:Z,phase:"implement-patch"}});return{text:z.outcome.kind==="ok"?z.outcome.value:null,usd:z.usd}}}var Lp0=($=process.env)=>!["0","off","false","no"].includes(($.LOKI_E10_PATCH??"").trim().toLowerCase()),Om5="You are Loki, an autonomous coding agent. You have no tools. Follow the task prompt exactly.",jm5,Np0=30,Cm5=3,Pm5=6000,Am5,Im5,xm5=1500,J60=($)=>$.filter((Z)=>B8(Z)),km5=8000;var X60=x(()=>{X1();yZ();tH();U7();lH();j9();SY();jm5=["You are the Loki 10 implement stage in patch mode. You have no tools: the harness applies your edits, runs the check named below and shows you any failure.","Rules: never edit or delete an existing assertion; add a regression test in the test file the dossier names, following its conventions; write no documentation; never edit lockfiles, test-runner or compiler configs, or the read-only Wall tests (such edits are refused and nothing is applied).","Reply with at most 5 lines naming the root cause and the change, then every edit block in exactly this form:",`FILE: <repo-relative path>
1454
+ `)}function Ap0($,Z,J=180000,X=process.env){if(X.LOKI_E10_INVOKER==="cli")return async({system:Q,messages:Y,signal:z})=>{try{let W=await WI(N8,Z,"implement-patch",$)([X.LOKI_CLAUDE_CLI||"claude","-p",t90(Y),"--output-format","json","--tools","","--model",$,"--system-prompt",Q,"--strict-mcp-config","--setting-sources","project"],{timeoutMs:J,group:!0,signal:z}),V=JSON.parse(W.stdout);return{text:W.exitCode===0&&!V.is_error&&typeof V.result==="string"?V.result:null,usd:typeof V.total_cost_usd==="number"?V.total_cost_usd:null}}catch{return{text:null,usd:null}}};return async({system:Q,messages:Y})=>{let z=await DW({model:$,system:Q,prompt:t90(Y),maxTokens:km5,thinking:"off",timeoutMs:J,ledger:{lokiDir:Z,phase:"implement-patch"}});return{text:z.outcome.kind==="ok"?z.outcome.value:null,usd:z.usd}}}var Lp0=($=process.env)=>["1","on","true","yes"].includes(($.LOKI_E10_PATCH??"").trim().toLowerCase()),Om5="You are Loki, an autonomous coding agent. You have no tools. Follow the task prompt exactly.",jm5,Np0=30,Cm5=3,Pm5=6000,Am5,Im5,xm5=1500,J60=($)=>$.filter((Z)=>B8(Z)),km5=8000;var X60=x(()=>{X1();yZ();tH();U7();lH();j9();SY();jm5=["You are the Loki 10 implement stage in patch mode. You have no tools: the harness applies your edits, runs the check named below and shows you any failure.","Rules: never edit or delete an existing assertion; add a regression test in the test file the dossier names, following its conventions; write no documentation; never edit lockfiles, test-runner or compiler configs, or the read-only Wall tests (such edits are refused and nothing is applied).","Reply with at most 5 lines naming the root cause and the change, then every edit block in exactly this form:",`FILE: <repo-relative path>
1455
1455
  <<<<<<< SEARCH
1456
1456
  <lines copied exactly from the dossier, enough to match one place>
1457
1457
  =======
@@ -4199,4 +4199,4 @@ Unknown commands exit 2 with a suggestion; run 'loki help' for the full list.
4199
4199
  `);{let{suggestCommand:X}=await Promise.resolve().then(() => (o7(),hg)),Q=Z===void 0?void 0:X(Z);if(Q)process.stderr.write(`Did you mean 'loki ${Q}'?
4200
4200
  `)}return process.stderr.write(bJ8),2}}C68();var vJ8=()=>globalThis[Symbol.for("loki.ownsStopSignals")]===!0;process.on("SIGINT",()=>{if(!vJ8())process.exit(130)});process.on("SIGTERM",()=>{if(!vJ8())process.exit(143)});var t39=await r39(Bun.argv.slice(2));process.exit(t39);
4201
4201
 
4202
- //# debugId=7D9EDC4FCD890748FEFE905C5DFAB165
4202
+ //# debugId=BD380FE2FE8917E22775824333ECCCB2
package/mcp/__init__.py CHANGED
@@ -75,4 +75,4 @@ try:
75
75
  except ImportError:
76
76
  __all__ = ['mcp']
77
77
 
78
- __version__ = '11.137.1'
78
+ __version__ = '11.137.2'
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": "11.137.1",
4
+ "version": "11.137.2",
5
5
  "description": "An autonomous software factory that knows what it is supposed to deliver, and proves it did.",
6
6
  "keywords": [
7
7
  "agent",
@@ -161,5 +161,5 @@
161
161
  "dependencies": {
162
162
  "@resvg/resvg-wasm": "^2.6.2"
163
163
  },
164
- "gitHead": "26e00ae9ed7e5568a5aca40c59d71ba65adb88db"
164
+ "gitHead": "665dc42ab83e49294b301b1bf9209b6a569a4955"
165
165
  }
@@ -99386,7 +99386,7 @@ function patchCallFor(model, lokiDir2, timeoutMs = 180000, env2 = process.env) {
99386
99386
  return { text: r.outcome.kind === "ok" ? r.outcome.value : null, usd: r.usd };
99387
99387
  };
99388
99388
  }
99389
- var patchEnabled = (env2 = process.env) => !["0", "off", "false", "no"].includes((env2.LOKI_E10_PATCH ?? "").trim().toLowerCase()), PATCH_SYSTEM = "You are Loki, an autonomous coding agent. You have no tools. Follow the task prompt exactly.", PATCH_RULES, CONVENTION_HEAD_LINES = 30, CONVENTION_MAX_FILES = 3, CONVENTION_MAX_CHARS = 6000, TEST_NAME2, LOCKFILES, DIGEST_MAX_CHARS = 1500, appliedTests = (applied) => applied.filter((f) => isTestFile(f)), PATCH_MAX_TOKENS = 8000;
99389
+ var patchEnabled = (env2 = process.env) => ["1", "on", "true", "yes"].includes((env2.LOKI_E10_PATCH ?? "").trim().toLowerCase()), PATCH_SYSTEM = "You are Loki, an autonomous coding agent. You have no tools. Follow the task prompt exactly.", PATCH_RULES, CONVENTION_HEAD_LINES = 30, CONVENTION_MAX_FILES = 3, CONVENTION_MAX_CHARS = 6000, TEST_NAME2, LOCKFILES, DIGEST_MAX_CHARS = 1500, appliedTests = (applied) => applied.filter((f) => isTestFile(f)), PATCH_MAX_TOKENS = 8000;
99390
99390
  var init_patch_protocol = __esm(() => {
99391
99391
  init_lock_ecosystems();
99392
99392
  init_commit_filter();
@@ -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": "11.137.1",
5
+ "version": "11.137.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",
@@ -1,4 +1,4 @@
1
- import{c as L,r as x,j as e,w as re,Z as ne,m as le,h as ie,p as P,F as ye,U as I,X as ce,L as de,x as oe,M as Ae,T as Z,S as we,l as xe,k as me,y as Ce,E as Fe,a0 as Se,a as U,a2 as he}from"./index-BsqpWddM.js";import{B as C}from"./Button-C1KpekBR.js";import{T as $e}from"./trending-up-D29cRQYb.js";import{C as z}from"./clock-BmJaE6OB.js";import{A as Be,U as ue,M as De}from"./Avatar-BITb-cd5.js";import{A as J}from"./activity-CBSvCxPd.js";import{R as pe}from"./refresh-cw-VIstG20G.js";import{G as ze}from"./globe-Cl8ma4WC.js";import{C as Le}from"./chevron-left-CovdvyC6.js";import{C as je}from"./check-CBJXqIsV.js";import{D as Y}from"./dollar-sign-CvutGHYe.js";import{U as Te}from"./user-CwsB4l3d.js";import{D as Me}from"./database-B2kx_2RX.js";import{L as Ue}from"./lock-BMisdUz_.js";import{S as Re}from"./scroll-text-CGtfemeE.js";import{S as Ie}from"./shield-alert-CtSYP1Py.js";/**
1
+ import{c as L,r as x,j as e,w as re,Z as ne,m as le,h as ie,p as P,F as ye,U as I,X as ce,L as de,x as oe,M as Ae,T as Z,S as we,l as xe,k as me,y as Ce,E as Fe,a0 as Se,a as U,a2 as he}from"./index-Bof3-_68.js";import{B as C}from"./Button-BxUQtv5n.js";import{T as $e}from"./trending-up-BwyGhAc3.js";import{C as z}from"./clock-B3sGx0CC.js";import{A as Be,U as ue,M as De}from"./Avatar-HIyC7HMX.js";import{A as J}from"./activity-Cnkose4Q.js";import{R as pe}from"./refresh-cw-CfZ0NrKz.js";import{G as ze}from"./globe-DdI8jmBf.js";import{C as Le}from"./chevron-left-dP2eCudr.js";import{C as je}from"./check-D1qIrOQs.js";import{D as Y}from"./dollar-sign-C6A25I3T.js";import{U as Te}from"./user-B54w7sMr.js";import{D as Me}from"./database-BkIkNTBq.js";import{L as Ue}from"./lock-DAIMLqQl.js";import{S as Re}from"./scroll-text-BNwohxjk.js";import{S as Ie}from"./shield-alert-H3Z6GpeL.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as l,j as s}from"./index-BsqpWddM.js";/**
1
+ import{c as l,j as s}from"./index-Bof3-_68.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e}from"./index-BsqpWddM.js";import{C as r}from"./clock-BmJaE6OB.js";import{C as a}from"./circle-alert-C5U8JfmL.js";import{C as l}from"./check-CBJXqIsV.js";const i={completed:"bg-[#1FC5A8]/10 text-[#1FC5A8]",running:"bg-[#553DE9]/10 text-[#553DE9]",failed:"bg-[#C45B5B]/10 text-[#C45B5B]",started:"bg-[#D4A03C]/10 text-[#D4A03C]",empty:"bg-[#F8F4F0] text-[#6B6960]",version:"bg-[#553DE9]/10 text-[#553DE9]"};function o({status:t}){switch(t){case"completed":return e.jsx(l,{size:12});case"running":return e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping motion-reduce:animate-none absolute inline-flex h-full w-full rounded-full bg-current opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]});case"failed":return e.jsx(a,{size:12});case"started":return e.jsx(r,{size:12});default:return null}}function f({status:t,children:n,className:s=""}){return e.jsxs("span",{className:["inline-flex items-center gap-1 rounded-btn px-2.5 py-0.5 text-xs font-semibold",i[t],s].filter(Boolean).join(" "),children:[e.jsx(o,{status:t}),n]})}export{f as B};
1
+ import{j as e}from"./index-Bof3-_68.js";import{C as r}from"./clock-B3sGx0CC.js";import{C as a}from"./circle-alert-BhqMU4XU.js";import{C as l}from"./check-D1qIrOQs.js";const i={completed:"bg-[#1FC5A8]/10 text-[#1FC5A8]",running:"bg-[#553DE9]/10 text-[#553DE9]",failed:"bg-[#C45B5B]/10 text-[#C45B5B]",started:"bg-[#D4A03C]/10 text-[#D4A03C]",empty:"bg-[#F8F4F0] text-[#6B6960]",version:"bg-[#553DE9]/10 text-[#553DE9]"};function o({status:t}){switch(t){case"completed":return e.jsx(l,{size:12});case"running":return e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping motion-reduce:animate-none absolute inline-flex h-full w-full rounded-full bg-current opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]});case"failed":return e.jsx(a,{size:12});case"started":return e.jsx(r,{size:12});default:return null}}function f({status:t,children:n,className:s=""}){return e.jsxs("span",{className:["inline-flex items-center gap-1 rounded-btn px-2.5 py-0.5 text-xs font-semibold",i[t],s].filter(Boolean).join(" "),children:[e.jsx(o,{status:t}),n]})}export{f as B};
@@ -1 +1 @@
1
- import{r as p,j as t}from"./index-BsqpWddM.js";const m={primary:"bg-[#553DE9] text-white hover:bg-[#4432c4] shadow-button rounded-btn",secondary:"border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] bg-transparent rounded-btn",ghost:"text-[#36342E] hover:bg-[#F8F4F0] rounded-btn",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border border-[#C45B5B]/20 hover:bg-[#C45B5B]/20 rounded-btn"},b={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u={sm:14,md:16,lg:18};function h({size:e}){return t.jsxs("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}const B=p.forwardRef(({variant:e="primary",size:o="md",icon:n,iconRight:i,loading:r=!1,disabled:a,className:c="",children:l,...x},d)=>{const s=u[o];return t.jsxs("button",{ref:d,disabled:a||r,className:["inline-flex items-center justify-center gap-2 font-medium transition-colors",m[e],b[o],(a||r)&&"opacity-60 cursor-not-allowed",c].filter(Boolean).join(" "),...x,children:[r?t.jsx(h,{size:s}):n?t.jsx(n,{size:s}):null,l,i&&!r&&t.jsx(i,{size:s})]})});B.displayName="Button";export{B};
1
+ import{r as p,j as t}from"./index-Bof3-_68.js";const m={primary:"bg-[#553DE9] text-white hover:bg-[#4432c4] shadow-button rounded-btn",secondary:"border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] bg-transparent rounded-btn",ghost:"text-[#36342E] hover:bg-[#F8F4F0] rounded-btn",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border border-[#C45B5B]/20 hover:bg-[#C45B5B]/20 rounded-btn"},b={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u={sm:14,md:16,lg:18};function h({size:e}){return t.jsxs("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}const B=p.forwardRef(({variant:e="primary",size:o="md",icon:n,iconRight:i,loading:r=!1,disabled:a,className:c="",children:l,...x},d)=>{const s=u[o];return t.jsxs("button",{ref:d,disabled:a||r,className:["inline-flex items-center justify-center gap-2 font-medium transition-colors",m[e],b[o],(a||r)&&"opacity-60 cursor-not-allowed",c].filter(Boolean).join(" "),...x,children:[r?t.jsx(h,{size:s}):n?t.jsx(n,{size:s}):null,l,i&&!r&&t.jsx(i,{size:s})]})});B.displayName="Button";export{B};
@@ -1,4 +1,4 @@
1
- import{c as $,r as l,j as e,G as we,Q as Se,F as Ce,h as Re,T as U,Z as Ee,a as S,V as Me,S as $e,Y as Te,X as Pe,P as ie,i as Ae,g as ze,C as Ie,l as Le,N as I,J as _e,K as De,O as Fe,u as Oe}from"./index-BsqpWddM.js";import{P as K,S as He,E as Be}from"./ErrorBoundary-uMIRI1zD.js";import{C as qe,F as Ge,M as Ue,H as Ke,a as We,G as Ve,T as Qe}from"./thumbs-up-DNtqLkNY.js";import{C as oe}from"./check-CBJXqIsV.js";import{C as Ye}from"./clock-BmJaE6OB.js";import{D as Xe}from"./dollar-sign-CvutGHYe.js";import{U as Ze}from"./upload-BQbpBtnJ.js";import{L as V}from"./loader-circle-CMndtL-U.js";/**
1
+ import{c as $,r as l,j as e,G as we,Q as Se,F as Ce,h as Re,T as U,Z as Ee,a as S,V as Me,S as $e,Y as Te,X as Pe,P as ie,i as Ae,g as ze,C as Ie,l as Le,N as I,J as _e,K as De,O as Fe,u as Oe}from"./index-Bof3-_68.js";import{P as K,S as He,E as Be}from"./ErrorBoundary-Dz51Pml4.js";import{C as qe,F as Ge,M as Ue,H as Ke,a as We,G as Ve,T as Qe}from"./thumbs-up-4nZcaHTV.js";import{C as oe}from"./check-D1qIrOQs.js";import{C as Ye}from"./clock-B3sGx0CC.js";import{D as Xe}from"./dollar-sign-C6A25I3T.js";import{U as Ze}from"./upload-CZky_3--.js";import{L as V}from"./loader-circle-DqmrMD2y.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as o,j as e}from"./index-BsqpWddM.js";function f({value:l,prefix:t="",suffix:s=""}){const[u,n]=o.useState(0),c=o.useRef(0);return o.useEffect(()=>{const a=c.current,h=l-a;if(h===0)return;const i=600,d=performance.now();function r(b){const v=b-d,m=Math.min(v/i,1),N=1-Math.pow(1-m,3),p=Math.round(a+h*N);n(p),c.current=p,m<1&&requestAnimationFrame(r)}requestAnimationFrame(r)},[l]),e.jsxs("span",{className:"tabular-nums",children:[t,u.toLocaleString(),s]})}function g(){const[l,t]=o.useState(5),[s,u]=o.useState(30),[n,c]=o.useState(75),a=.4,i=Math.round(l*s*a*4.33),d=Math.round(i*n);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-6 shadow-sm",children:[e.jsx("h3",{className:"text-lg font-bold text-[#36342E] mb-1",children:"ROI Calculator"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6",children:"Estimate how much your team could save with autonomous development."}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Team size"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[l," developers"]})]}),e.jsx("input",{type:"range",min:1,max:50,value:l,onChange:r=>t(Number(r.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"50"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Hours coding per week"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[s,"h"]})]}),e.jsx("input",{type:"range",min:5,max:60,value:s,onChange:r=>u(Number(r.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"5h"}),e.jsx("span",{children:"60h"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Average hourly rate"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:["$",n,"/hr"]})]}),e.jsx("input",{type:"range",min:25,max:250,step:5,value:n,onChange:r=>c(Number(r.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"$25"}),e.jsx("span",{children:"$250"})]})]})]}),e.jsxs("div",{className:"mt-6 pt-6 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#553DE9]",children:e.jsx(f,{value:i,suffix:"h"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Est. hours saved / month"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#1FC5A8]",children:e.jsx(f,{value:d,prefix:"$"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Est. cost saved / month"})]})]}),e.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-[#553DE9]/5 border border-[#553DE9]/10",children:[e.jsxs("p",{className:"text-sm text-[#36342E] text-center",children:["If Loki Mode saved ",Math.round(a*100),"% of coding time, your team could save"," ",e.jsxs("span",{className:"font-bold text-[#553DE9]",children:[i.toLocaleString()," hours"]})," ","and"," ",e.jsxs("span",{className:"font-bold text-[#1FC5A8]",children:["$",d.toLocaleString()]})," ","per month."]}),e.jsxs("p",{className:"mt-2 text-xs text-[#6B6960] text-center",children:["The ",Math.round(a*100),"% is an assumption, not a measurement. Model and API spend is not included."]})]})]})]})}const j=[{feature:"Claude (Opus/Sonnet/Haiku)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!0},{feature:"Any model via opencode (OpenRouter, local)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Provider auto-failover (Claude Code, opencode)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"8 automated quality gates",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Blind 3-reviewer code review",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Anti-sycophancy checks",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Automated test generation",category:"Quality",lokiMode:!0,boltNew:!1,replit:"Partial",lovable:!1},{feature:"Docker container generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"CI/CD pipeline generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"One-click cloud deploy",category:"Deployment",lokiMode:"Planned",boltNew:!0,replit:!0,lovable:!0},{feature:"Self-hosted (your keys)",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Free tier available",category:"Cost",lokiMode:"Source-available (BUSL-1.1)",boltNew:!0,replit:!0,lovable:!0},{feature:"No vendor lock-in",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"SSO / OIDC authentication",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"RBAC access control",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Audit logging",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Air-gapped deployment",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1}];function y(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function w(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#C45B5B]/40",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function x({value:l}){return typeof l=="string"?e.jsx("span",{className:"text-xs text-[#6B6960] font-medium",children:l}):l?e.jsx(y,{}):e.jsx(w,{})}const k=[{title:"Full Autonomy",description:"Describe what you want. Loki Mode handles planning, coding, testing, and verification automatically.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#553DE9]",children:e.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Production Quality",description:"8 quality gates, blind code review, and anti-sycophancy checks ensure code that actually works.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Your Infrastructure",description:"Self-hosted, source-available (BUSL-1.1), no data leaves your network. Use your own API keys across 5 providers.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#2F71E3]",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("circle",{cx:"6",cy:"6",r:"1",fill:"currentColor"}),e.jsx("circle",{cx:"6",cy:"18",r:"1",fill:"currentColor"})]})},{title:"Built for Teams",description:"Enterprise auth, RBAC, audit logs, and parallel workflows for teams of any size.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#E93D82]",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"9",cy:"7",r:"4",stroke:"currentColor",strokeWidth:"2"}),e.jsx("path",{d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}];function C(){const l=[...new Set(j.map(t=>t.category))];return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Compare"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:"See how Loki Mode stacks up against other AI development platforms."})]}),e.jsx("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#ECEAE3]",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-[#6B6960] w-[240px]",children:"Feature"}),e.jsx("th",{className:"text-center px-4 py-3 font-bold text-[#553DE9] bg-[#553DE9]/5 w-[130px]",children:"Loki Mode"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"bolt.new"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Replit"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Lovable"})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs(e.Fragment,{children:[e.jsx("tr",{className:"bg-[#FAF9F6]",children:e.jsx("td",{colSpan:5,className:"px-4 py-2 text-xs font-bold text-[#939084] uppercase tracking-wider",children:t})},`cat-${t}`),j.filter(s=>s.category===t).map(s=>e.jsxs("tr",{className:"border-b border-[#ECEAE3] last:border-b-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-[#36342E]",children:s.feature}),e.jsx("td",{className:"px-4 py-2.5 text-center bg-[#553DE9]/5",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.lokiMode})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.boltNew})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.replit})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.lovable})})})]},s.feature))]}))})]})})}),e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"text-xl font-bold text-[#36342E] mb-6",children:"Why developers choose Loki Mode"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:k.map(t=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-5 shadow-sm hover:shadow-md transition-shadow",children:[e.jsx("div",{className:"mb-3",children:t.icon}),e.jsx("h3",{className:"text-base font-bold text-[#36342E] mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:t.description})]},t.title))})]}),e.jsx("div",{className:"mt-12 max-w-xl mx-auto",children:e.jsx(g,{})})]})})}export{C as default};
1
+ import{r as o,j as e}from"./index-Bof3-_68.js";function f({value:l,prefix:t="",suffix:s=""}){const[u,n]=o.useState(0),c=o.useRef(0);return o.useEffect(()=>{const a=c.current,h=l-a;if(h===0)return;const i=600,d=performance.now();function r(b){const v=b-d,m=Math.min(v/i,1),N=1-Math.pow(1-m,3),p=Math.round(a+h*N);n(p),c.current=p,m<1&&requestAnimationFrame(r)}requestAnimationFrame(r)},[l]),e.jsxs("span",{className:"tabular-nums",children:[t,u.toLocaleString(),s]})}function g(){const[l,t]=o.useState(5),[s,u]=o.useState(30),[n,c]=o.useState(75),a=.4,i=Math.round(l*s*a*4.33),d=Math.round(i*n);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-6 shadow-sm",children:[e.jsx("h3",{className:"text-lg font-bold text-[#36342E] mb-1",children:"ROI Calculator"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6",children:"Estimate how much your team could save with autonomous development."}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Team size"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[l," developers"]})]}),e.jsx("input",{type:"range",min:1,max:50,value:l,onChange:r=>t(Number(r.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"50"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Hours coding per week"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[s,"h"]})]}),e.jsx("input",{type:"range",min:5,max:60,value:s,onChange:r=>u(Number(r.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"5h"}),e.jsx("span",{children:"60h"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Average hourly rate"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:["$",n,"/hr"]})]}),e.jsx("input",{type:"range",min:25,max:250,step:5,value:n,onChange:r=>c(Number(r.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"$25"}),e.jsx("span",{children:"$250"})]})]})]}),e.jsxs("div",{className:"mt-6 pt-6 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#553DE9]",children:e.jsx(f,{value:i,suffix:"h"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Est. hours saved / month"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#1FC5A8]",children:e.jsx(f,{value:d,prefix:"$"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Est. cost saved / month"})]})]}),e.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-[#553DE9]/5 border border-[#553DE9]/10",children:[e.jsxs("p",{className:"text-sm text-[#36342E] text-center",children:["If Loki Mode saved ",Math.round(a*100),"% of coding time, your team could save"," ",e.jsxs("span",{className:"font-bold text-[#553DE9]",children:[i.toLocaleString()," hours"]})," ","and"," ",e.jsxs("span",{className:"font-bold text-[#1FC5A8]",children:["$",d.toLocaleString()]})," ","per month."]}),e.jsxs("p",{className:"mt-2 text-xs text-[#6B6960] text-center",children:["The ",Math.round(a*100),"% is an assumption, not a measurement. Model and API spend is not included."]})]})]})]})}const j=[{feature:"Claude (Opus/Sonnet/Haiku)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!0},{feature:"Any model via opencode (OpenRouter, local)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Provider auto-failover (Claude Code, opencode)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"8 automated quality gates",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Blind 3-reviewer code review",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Anti-sycophancy checks",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Automated test generation",category:"Quality",lokiMode:!0,boltNew:!1,replit:"Partial",lovable:!1},{feature:"Docker container generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"CI/CD pipeline generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"One-click cloud deploy",category:"Deployment",lokiMode:"Planned",boltNew:!0,replit:!0,lovable:!0},{feature:"Self-hosted (your keys)",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Free tier available",category:"Cost",lokiMode:"Source-available (BUSL-1.1)",boltNew:!0,replit:!0,lovable:!0},{feature:"No vendor lock-in",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"SSO / OIDC authentication",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"RBAC access control",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Audit logging",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Air-gapped deployment",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1}];function y(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function w(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#C45B5B]/40",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function x({value:l}){return typeof l=="string"?e.jsx("span",{className:"text-xs text-[#6B6960] font-medium",children:l}):l?e.jsx(y,{}):e.jsx(w,{})}const k=[{title:"Full Autonomy",description:"Describe what you want. Loki Mode handles planning, coding, testing, and verification automatically.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#553DE9]",children:e.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Production Quality",description:"8 quality gates, blind code review, and anti-sycophancy checks ensure code that actually works.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Your Infrastructure",description:"Self-hosted, source-available (BUSL-1.1), no data leaves your network. Use your own API keys across 5 providers.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#2F71E3]",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("circle",{cx:"6",cy:"6",r:"1",fill:"currentColor"}),e.jsx("circle",{cx:"6",cy:"18",r:"1",fill:"currentColor"})]})},{title:"Built for Teams",description:"Enterprise auth, RBAC, audit logs, and parallel workflows for teams of any size.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#E93D82]",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"9",cy:"7",r:"4",stroke:"currentColor",strokeWidth:"2"}),e.jsx("path",{d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}];function C(){const l=[...new Set(j.map(t=>t.category))];return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Compare"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:"See how Loki Mode stacks up against other AI development platforms."})]}),e.jsx("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#ECEAE3]",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-[#6B6960] w-[240px]",children:"Feature"}),e.jsx("th",{className:"text-center px-4 py-3 font-bold text-[#553DE9] bg-[#553DE9]/5 w-[130px]",children:"Loki Mode"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"bolt.new"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Replit"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Lovable"})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs(e.Fragment,{children:[e.jsx("tr",{className:"bg-[#FAF9F6]",children:e.jsx("td",{colSpan:5,className:"px-4 py-2 text-xs font-bold text-[#939084] uppercase tracking-wider",children:t})},`cat-${t}`),j.filter(s=>s.category===t).map(s=>e.jsxs("tr",{className:"border-b border-[#ECEAE3] last:border-b-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-[#36342E]",children:s.feature}),e.jsx("td",{className:"px-4 py-2.5 text-center bg-[#553DE9]/5",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.lokiMode})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.boltNew})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.replit})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(x,{value:s.lovable})})})]},s.feature))]}))})]})})}),e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"text-xl font-bold text-[#36342E] mb-6",children:"Why developers choose Loki Mode"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:k.map(t=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-5 shadow-sm hover:shadow-md transition-shadow",children:[e.jsx("div",{className:"mb-3",children:t.icon}),e.jsx("h3",{className:"text-base font-bold text-[#36342E] mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:t.description})]},t.title))})]}),e.jsx("div",{className:"mt-12 max-w-xl mx-auto",children:e.jsx(g,{})})]})})}export{C as default};
@@ -1,4 +1,4 @@
1
- import{c as o,r as a,j as e,T as n,h as i,p as c}from"./index-BsqpWddM.js";/**
1
+ import{c as o,r as a,j as e,T as n,h as i,p as c}from"./index-Bof3-_68.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as l,a as x,j as e}from"./index-BsqpWddM.js";const N={verified:{badge:"bg-success/10 text-success border-success/20",dot:"bg-success",label:"Verified",proven:"The server recomputed the integrity hash and it matches, and the gpg signature verified against its keyring.",notProven:"That the code is correct, or that the recorded diff still matches your repo. A receipt records which checks ran, not that the result is right."},unsigned:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Unsigned",proven:"The server recomputed the integrity hash and it matches these receipt bytes.",notProven:"Who produced it. An unsigned receipt is forgeable: whoever controls the builder can rewrite the facts and recompute the hash."},unchecked:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Not checked",proven:"The server recomputed the integrity hash and it matches.",notProven:"Provenance. A signature is present but was not evaluated here, which is not the same as a bad signature."},tampered:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Tampered",proven:"Nothing. The server recomputed the integrity hash and it does not match the contents.",notProven:"Anything at all. This receipt was edited after it was written. Do not trust this build."},failed:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Failed verification",proven:"Nothing. A verification check ran on the server and said no.",notProven:"Anything the receipt claims. Read the reason below."},not_verified:{badge:"border-muted/20 text-muted",dot:"bg-muted/40",label:"Not verified here",proven:"Nothing. No verification result was computed for this receipt here.",notProven:"Integrity or provenance. Run the command below to check it yourself."}};function w(t){const n=t==null?void 0:t.integrity_check,r=t==null?void 0:t.verification;return n?n.status==="tampered"?"tampered":n.status==="failed"?"failed":n.status!=="verified"?"not_verified":n.gpg_ok===!0?"verified":r!=null&&r.attestation||r!=null&&r.gpg_signature?"unchecked":"unsigned":"not_verified"}const v=[{key:"verified",label:"Verified",bar:"bg-success",text:"text-success"},{key:"with_gaps",label:"With gaps",bar:"bg-warning",text:"text-warning"},{key:"not_verified",label:"Not verified",bar:"bg-danger",text:"text-danger"},{key:"unknown",label:"Unknown",bar:"bg-muted/40",text:"text-muted"}];function y({summary:t}){const n=t.total_receipts;return n?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex h-1.5 rounded-full overflow-hidden bg-muted/10",children:v.map(({key:r,bar:s})=>{const i=t[r];return i?e.jsx("div",{className:s,style:{width:`${i/n*100}%`},title:`${i} ${r}`},r):null})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs",children:v.map(({key:r,label:s,text:i})=>{const c=t[r];return c?e.jsxs("span",{className:i,children:[e.jsx("span",{className:"font-semibold",children:c})," ",s.toLowerCase()]},r):null})}),e.jsxs("p",{className:"text-muted text-xs",children:["Recorded verdicts across ",n," receipt",n===1?"":"s",", not re-verified here."]})]}):null}function u({label:t,value:n}){return e.jsxs("div",{className:"flex items-baseline gap-2 text-xs",children:[e.jsx("span",{className:"text-muted w-28 flex-shrink-0",children:t}),e.jsx("span",{className:"font-mono truncate",title:n,children:n})]})}function k({proof:t}){var m,p,g,f,b;const[n,r]=l.useState(!1),[s,i]=l.useState(null),[c,d]=l.useState(null);l.useEffect(()=>{if(!n||s||c)return;let o=!1;return x.getProof(t.run_id).then(h=>{o||i(h)}).catch(h=>{o||d((h==null?void 0:h.message)||"could not load this receipt")}),()=>{o=!0}},[n,t.run_id,s,c]);const a=N[w(s)],j=t.generated_at?new Date(t.generated_at).toLocaleString():"unknown";return e.jsxs("div",{className:`border rounded-card overflow-hidden ${s?a.badge:"border-muted/20"}`,children:[e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-3 py-2.5 text-left",onClick:()=>r(!n),"aria-expanded":n,children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s?a.dot:"bg-muted/40"}`}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:t.headline?`Recorded: ${t.headline}`:t.run_id}),t.final_verdict&&e.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider flex-shrink-0 text-muted",children:["council ",t.final_verdict]}),e.jsx("span",{className:"text-muted text-xs flex-shrink-0",children:n?"−":"+"})]}),n&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-current/10 pt-3",children:[c&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load this receipt: ",c]}),!c&&!s&&e.jsx("p",{className:"text-xs text-muted",children:"Loading receipt…"}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(u,{label:"Run",value:s.run_id}),e.jsx(u,{label:"Generated",value:j}),e.jsx(u,{label:"Loki version",value:s.loki_version||"unknown"}),e.jsx(u,{label:"Cost",value:typeof((m=s.cost)==null?void 0:m.usd)=="number"?`${s.cost.cost_partial===!0?"at least ":""}$${s.cost.usd.toFixed(2)}`:"unknown"}),e.jsx(u,{label:"Files changed",value:typeof((p=s.files_changed)==null?void 0:p.count)=="number"?String(s.files_changed.count):"unknown"}),((g=s.verification)==null?void 0:g.hash)&&e.jsx(u,{label:"Recorded hash",value:s.verification.hash})]}),e.jsxs("div",{className:`rounded-card border px-3 py-2 ${a.badge}`,children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider mb-1",children:a.label}),e.jsxs("p",{className:"text-xs mb-1",children:[e.jsx("span",{className:"font-semibold",children:"Proven: "}),a.proven]}),e.jsxs("p",{className:"text-xs opacity-80",children:[e.jsx("span",{className:"font-semibold",children:"Not proven: "}),a.notProven]}),(((f=s.integrity_check)==null?void 0:f.reasons)||[]).slice(0,2).map(o=>e.jsx("p",{className:"text-xs opacity-80 mt-1",children:o},o))]}),e.jsxs("p",{className:"text-xs text-muted",children:["Verify it yourself (also re-derives the diff against your repo):"," ",e.jsxs("code",{className:"font-mono",children:["loki proof verify ",s.run_id,(b=s.verification)!=null&&b.attestation?" --jwks <url|file>":""]})]}),t.pr_url&&e.jsx("a",{href:t.pr_url,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-primary underline",children:"View the pull request"})]})]})]})}function P(){const[t,n]=l.useState(null),[r,s]=l.useState(null),[i,c]=l.useState(null);return l.useEffect(()=>{let d=!1;return x.listProofs().then(a=>{d||n(a.proofs||[])}).catch(a=>{d||c((a==null?void 0:a.message)||"could not load receipts")}),x.proofsSummary().then(a=>{d||s(a)}).catch(()=>{}),()=>{d=!0}},[]),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Evidence Receipts"}),e.jsx("p",{className:"text-muted text-xs mt-1",children:"What each build actually checked, recorded so you can verify it yourself."})]}),i&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load receipts: ",i]}),!i&&t===null&&e.jsx("p",{className:"text-xs text-muted",children:"Loading…"}),r&&e.jsx(y,{summary:r}),t!==null&&t.length===0&&e.jsxs("p",{className:"text-xs text-muted",children:["No receipts yet. One is written at the end of each run (set ",e.jsx("code",{className:"font-mono",children:"LOKI_PROOF=0"})," to opt out)."]}),e.jsx("div",{className:"space-y-2",children:t==null?void 0:t.map(d=>e.jsx(k,{proof:d},d.run_id))})]})}export{P as E};
1
+ import{r as l,a as x,j as e}from"./index-Bof3-_68.js";const N={verified:{badge:"bg-success/10 text-success border-success/20",dot:"bg-success",label:"Verified",proven:"The server recomputed the integrity hash and it matches, and the gpg signature verified against its keyring.",notProven:"That the code is correct, or that the recorded diff still matches your repo. A receipt records which checks ran, not that the result is right."},unsigned:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Unsigned",proven:"The server recomputed the integrity hash and it matches these receipt bytes.",notProven:"Who produced it. An unsigned receipt is forgeable: whoever controls the builder can rewrite the facts and recompute the hash."},unchecked:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Not checked",proven:"The server recomputed the integrity hash and it matches.",notProven:"Provenance. A signature is present but was not evaluated here, which is not the same as a bad signature."},tampered:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Tampered",proven:"Nothing. The server recomputed the integrity hash and it does not match the contents.",notProven:"Anything at all. This receipt was edited after it was written. Do not trust this build."},failed:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Failed verification",proven:"Nothing. A verification check ran on the server and said no.",notProven:"Anything the receipt claims. Read the reason below."},not_verified:{badge:"border-muted/20 text-muted",dot:"bg-muted/40",label:"Not verified here",proven:"Nothing. No verification result was computed for this receipt here.",notProven:"Integrity or provenance. Run the command below to check it yourself."}};function w(t){const n=t==null?void 0:t.integrity_check,r=t==null?void 0:t.verification;return n?n.status==="tampered"?"tampered":n.status==="failed"?"failed":n.status!=="verified"?"not_verified":n.gpg_ok===!0?"verified":r!=null&&r.attestation||r!=null&&r.gpg_signature?"unchecked":"unsigned":"not_verified"}const v=[{key:"verified",label:"Verified",bar:"bg-success",text:"text-success"},{key:"with_gaps",label:"With gaps",bar:"bg-warning",text:"text-warning"},{key:"not_verified",label:"Not verified",bar:"bg-danger",text:"text-danger"},{key:"unknown",label:"Unknown",bar:"bg-muted/40",text:"text-muted"}];function y({summary:t}){const n=t.total_receipts;return n?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex h-1.5 rounded-full overflow-hidden bg-muted/10",children:v.map(({key:r,bar:s})=>{const i=t[r];return i?e.jsx("div",{className:s,style:{width:`${i/n*100}%`},title:`${i} ${r}`},r):null})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs",children:v.map(({key:r,label:s,text:i})=>{const c=t[r];return c?e.jsxs("span",{className:i,children:[e.jsx("span",{className:"font-semibold",children:c})," ",s.toLowerCase()]},r):null})}),e.jsxs("p",{className:"text-muted text-xs",children:["Recorded verdicts across ",n," receipt",n===1?"":"s",", not re-verified here."]})]}):null}function u({label:t,value:n}){return e.jsxs("div",{className:"flex items-baseline gap-2 text-xs",children:[e.jsx("span",{className:"text-muted w-28 flex-shrink-0",children:t}),e.jsx("span",{className:"font-mono truncate",title:n,children:n})]})}function k({proof:t}){var m,p,g,f,b;const[n,r]=l.useState(!1),[s,i]=l.useState(null),[c,d]=l.useState(null);l.useEffect(()=>{if(!n||s||c)return;let o=!1;return x.getProof(t.run_id).then(h=>{o||i(h)}).catch(h=>{o||d((h==null?void 0:h.message)||"could not load this receipt")}),()=>{o=!0}},[n,t.run_id,s,c]);const a=N[w(s)],j=t.generated_at?new Date(t.generated_at).toLocaleString():"unknown";return e.jsxs("div",{className:`border rounded-card overflow-hidden ${s?a.badge:"border-muted/20"}`,children:[e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-3 py-2.5 text-left",onClick:()=>r(!n),"aria-expanded":n,children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s?a.dot:"bg-muted/40"}`}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:t.headline?`Recorded: ${t.headline}`:t.run_id}),t.final_verdict&&e.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider flex-shrink-0 text-muted",children:["council ",t.final_verdict]}),e.jsx("span",{className:"text-muted text-xs flex-shrink-0",children:n?"−":"+"})]}),n&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-current/10 pt-3",children:[c&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load this receipt: ",c]}),!c&&!s&&e.jsx("p",{className:"text-xs text-muted",children:"Loading receipt…"}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(u,{label:"Run",value:s.run_id}),e.jsx(u,{label:"Generated",value:j}),e.jsx(u,{label:"Loki version",value:s.loki_version||"unknown"}),e.jsx(u,{label:"Cost",value:typeof((m=s.cost)==null?void 0:m.usd)=="number"?`${s.cost.cost_partial===!0?"at least ":""}$${s.cost.usd.toFixed(2)}`:"unknown"}),e.jsx(u,{label:"Files changed",value:typeof((p=s.files_changed)==null?void 0:p.count)=="number"?String(s.files_changed.count):"unknown"}),((g=s.verification)==null?void 0:g.hash)&&e.jsx(u,{label:"Recorded hash",value:s.verification.hash})]}),e.jsxs("div",{className:`rounded-card border px-3 py-2 ${a.badge}`,children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider mb-1",children:a.label}),e.jsxs("p",{className:"text-xs mb-1",children:[e.jsx("span",{className:"font-semibold",children:"Proven: "}),a.proven]}),e.jsxs("p",{className:"text-xs opacity-80",children:[e.jsx("span",{className:"font-semibold",children:"Not proven: "}),a.notProven]}),(((f=s.integrity_check)==null?void 0:f.reasons)||[]).slice(0,2).map(o=>e.jsx("p",{className:"text-xs opacity-80 mt-1",children:o},o))]}),e.jsxs("p",{className:"text-xs text-muted",children:["Verify it yourself (also re-derives the diff against your repo):"," ",e.jsxs("code",{className:"font-mono",children:["loki proof verify ",s.run_id,(b=s.verification)!=null&&b.attestation?" --jwks <url|file>":""]})]}),t.pr_url&&e.jsx("a",{href:t.pr_url,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-primary underline",children:"View the pull request"})]})]})]})}function P(){const[t,n]=l.useState(null),[r,s]=l.useState(null),[i,c]=l.useState(null);return l.useEffect(()=>{let d=!1;return x.listProofs().then(a=>{d||n(a.proofs||[])}).catch(a=>{d||c((a==null?void 0:a.message)||"could not load receipts")}),x.proofsSummary().then(a=>{d||s(a)}).catch(()=>{}),()=>{d=!0}},[]),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Evidence Receipts"}),e.jsx("p",{className:"text-muted text-xs mt-1",children:"What each build actually checked, recorded so you can verify it yourself."})]}),i&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load receipts: ",i]}),!i&&t===null&&e.jsx("p",{className:"text-xs text-muted",children:"Loading…"}),r&&e.jsx(y,{summary:r}),t!==null&&t.length===0&&e.jsxs("p",{className:"text-xs text-muted",children:["No receipts yet. One is written at the end of each run (set ",e.jsx("code",{className:"font-mono",children:"LOKI_PROOF=0"})," to opt out)."]}),e.jsx("div",{className:"space-y-2",children:t==null?void 0:t.map(d=>e.jsx(k,{proof:d},d.run_id))})]})}export{P as E};
@@ -1,4 +1,4 @@
1
- import{c as _,r as o,a as k,j as e,m as B,J as v,N as h,a5 as H,M as L,l as q}from"./index-BsqpWddM.js";import{B as N}from"./Button-C1KpekBR.js";import{C as y}from"./thumbs-up-DNtqLkNY.js";import{R as S}from"./refresh-cw-VIstG20G.js";import{C as z}from"./circle-alert-C5U8JfmL.js";import{U as D}from"./user-CwsB4l3d.js";import{L as G}from"./loader-circle-CMndtL-U.js";import{R as T}from"./rotate-ccw-B2B8qXF1.js";/**
1
+ import{c as _,r as o,a as k,j as e,m as B,J as v,N as h,a5 as H,M as L,l as q}from"./index-Bof3-_68.js";import{B as N}from"./Button-BxUQtv5n.js";import{C as y}from"./thumbs-up-4nZcaHTV.js";import{R as S}from"./refresh-cw-CfZ0NrKz.js";import{C as z}from"./circle-alert-BhqMU4XU.js";import{U as D}from"./user-B54w7sMr.js";import{L as G}from"./loader-circle-DqmrMD2y.js";import{R as T}from"./rotate-ccw-BvxEood6.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as I,r as c,a as b,j as e,G as me,A as ue,S as Z,k as ee,m as pe,h as he,p as fe,X as te,M as be}from"./index-BsqpWddM.js";import{B as y}from"./Button-C1KpekBR.js";import{C as ge}from"./chevron-left-CovdvyC6.js";import{G as P}from"./thumbs-up-DNtqLkNY.js";import{R as $}from"./refresh-cw-VIstG20G.js";import{C as Ne}from"./circle-alert-C5U8JfmL.js";import{L as Q,S as je}from"./ProjectPage-BmlKkd3v.js";import{S as se}from"./shield-alert-CtSYP1Py.js";import{F as ye}from"./file-code-corner-Dgk6tDOW.js";import{C as V}from"./clock-BmJaE6OB.js";import{C as re}from"./check-CBJXqIsV.js";import"./ErrorBoundary-uMIRI1zD.js";import"./TerminalOutput-TdLKSbR7.js";import"./lock-BMisdUz_.js";import"./package-CO3fayvy.js";import"./file-plus-B_aLYwqI.js";import"./activity-CBSvCxPd.js";import"./scroll-text-CGtfemeE.js";import"./bot-Nq7CP0wm.js";import"./loader-circle-CMndtL-U.js";import"./hammer-g6IDM0Mp.js";import"./dollar-sign-CvutGHYe.js";import"./globe-Cl8ma4WC.js";import"./trash-2-BaCldFY1.js";import"./upload-BQbpBtnJ.js";import"./plus-DmEQY3hE.js";import"./rotate-ccw-B2B8qXF1.js";import"./code-xml-UFdv7-KW.js";import"./trending-up-D29cRQYb.js";import"./layers-CPs9L1Zy.js";import"./trending-down-DrGr5-dm.js";import"./server-B2orlO1M.js";/**
1
+ import{c as I,r as c,a as b,j as e,G as me,A as ue,S as Z,k as ee,m as pe,h as he,p as fe,X as te,M as be}from"./index-Bof3-_68.js";import{B as y}from"./Button-BxUQtv5n.js";import{C as ge}from"./chevron-left-dP2eCudr.js";import{G as P}from"./thumbs-up-4nZcaHTV.js";import{R as $}from"./refresh-cw-CfZ0NrKz.js";import{C as Ne}from"./circle-alert-BhqMU4XU.js";import{L as Q,S as je}from"./ProjectPage-Cqek-G3r.js";import{S as se}from"./shield-alert-H3Z6GpeL.js";import{F as ye}from"./file-code-corner-DibSfM-s.js";import{C as V}from"./clock-B3sGx0CC.js";import{C as re}from"./check-D1qIrOQs.js";import"./ErrorBoundary-Dz51Pml4.js";import"./TerminalOutput-HC2ojXj_.js";import"./lock-DAIMLqQl.js";import"./package-ZmQnH6BC.js";import"./file-plus-CoBzP3Nf.js";import"./activity-Cnkose4Q.js";import"./scroll-text-BNwohxjk.js";import"./bot-DDCNEM-J.js";import"./loader-circle-DqmrMD2y.js";import"./hammer-DK3tnNkU.js";import"./dollar-sign-C6A25I3T.js";import"./globe-DdI8jmBf.js";import"./trash-2-DLRI8X63.js";import"./upload-CZky_3--.js";import"./plus-8OGlItzn.js";import"./rotate-ccw-BvxEood6.js";import"./code-xml-BmbV3qOZ.js";import"./trending-up-BwyGhAc3.js";import"./layers-D9qUaFUb.js";import"./trending-down-VKVQVXQU.js";import"./server-BqtYPaUL.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.