loki-mode 9.42.0 → 9.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/issue-providers.sh +31 -8
- package/autonomy/loki +4 -1
- package/autonomy/run.sh +14 -3
- package/dashboard/__init__.py +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/loki-ts/dist/loki.js +2 -2
- package/mcp/__init__.py +1 -1
- package/mcp/server.py +1 -0
- package/package.json +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: loki-mode
|
|
|
3
3
|
description: Autonomous spec-driven build system with a built-in trust layer. It does not call work done until it is verified (RARV-C closure loop, 8 quality gates, completion council, verified-completion evidence gate). Triggers on "Loki Mode". Takes a spec (PRD, GitHub issue, OpenAPI doc, etc.) to deployed product with minimal human intervention. Provider-agnostic. Requires --dangerously-skip-permissions flag.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Loki Mode v9.
|
|
6
|
+
# Loki Mode v9.45.0
|
|
7
7
|
|
|
8
8
|
**You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
|
|
9
9
|
|
|
@@ -470,4 +470,4 @@ See `CHANGELOG.md` entries [7.5.7], [7.5.8], [7.5.13] for the per-fix list and r
|
|
|
470
470
|
|
|
471
471
|
---
|
|
472
472
|
|
|
473
|
-
**v9.
|
|
473
|
+
**v9.45.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~410 lines core**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
9.
|
|
1
|
+
9.45.0
|
|
@@ -436,7 +436,7 @@ fetch_issue() {
|
|
|
436
436
|
# Output: PRD markdown on stdout
|
|
437
437
|
generate_prd_from_issue() {
|
|
438
438
|
python3 -c "
|
|
439
|
-
import json, sys
|
|
439
|
+
import json, sys, os
|
|
440
440
|
|
|
441
441
|
data = json.loads(sys.stdin.read())
|
|
442
442
|
provider = data.get('provider', 'unknown')
|
|
@@ -449,6 +449,34 @@ url = data.get('url', '')
|
|
|
449
449
|
created_at = data.get('created_at', '')
|
|
450
450
|
repo = data.get('repo', '')
|
|
451
451
|
|
|
452
|
+
# The PRD is the FIRST artifact the issue path produces and the document the
|
|
453
|
+
# agent then works from. Two defects lived here: the version was the literal
|
|
454
|
+
# v6.0.0 (printing on a v9.44.0 install, three majors stale), and acceptance
|
|
455
|
+
# criteria were generic filler that overrode a user who HAD enumerated their
|
|
456
|
+
# requirements. NOTE: inside python3 -c with a DOUBLE-quoted shell string, so
|
|
457
|
+
# single quotes only; no double quotes, no dollar signs, no backticks.
|
|
458
|
+
loki_version = os.environ.get('LOKI_VERSION') or 'unknown'
|
|
459
|
+
|
|
460
|
+
_ex = []
|
|
461
|
+
for _line in (body or '').splitlines():
|
|
462
|
+
_t = _line.strip()
|
|
463
|
+
if _t[:5] in ('- [ ]', '- [x]', '* [ ]', '* [x]'):
|
|
464
|
+
_ex.append(_t.split(']', 1)[1].strip())
|
|
465
|
+
elif len(_t) > 3 and _t[0].isdigit() and _t[1:3] in ('. ', ') '):
|
|
466
|
+
_ex.append(_t[3:].strip())
|
|
467
|
+
_ex = [x for x in _ex if x]
|
|
468
|
+
|
|
469
|
+
if _ex:
|
|
470
|
+
acceptance_criteria = ('Extracted from the issue body:' + chr(10) + chr(10)
|
|
471
|
+
+ chr(10).join('%d. %s' % (i, t) for i, t in enumerate(_ex, 1)))
|
|
472
|
+
else:
|
|
473
|
+
acceptance_criteria = (
|
|
474
|
+
'The issue body lists no explicit checklist, so these are defaults:' + chr(10) + chr(10)
|
|
475
|
+
+ '1. Address all requirements specified in the issue body above' + chr(10)
|
|
476
|
+
+ '2. Ensure backward compatibility (unless explicitly breaking changes are requested)' + chr(10)
|
|
477
|
+
+ '3. Add appropriate tests for new functionality' + chr(10)
|
|
478
|
+
+ '4. Update documentation as needed')
|
|
479
|
+
|
|
452
480
|
labels_str = ', '.join(labels) if labels else ''
|
|
453
481
|
|
|
454
482
|
prd = f'''# PRD: {title}
|
|
@@ -473,12 +501,7 @@ prd += f'''
|
|
|
473
501
|
|
|
474
502
|
## Acceptance Criteria
|
|
475
503
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
1. Address all requirements specified in the issue body above
|
|
479
|
-
2. Ensure backward compatibility (unless explicitly breaking changes are requested)
|
|
480
|
-
3. Add appropriate tests for new functionality
|
|
481
|
-
4. Update documentation as needed
|
|
504
|
+
{acceptance_criteria}
|
|
482
505
|
|
|
483
506
|
---
|
|
484
507
|
|
|
@@ -486,7 +509,7 @@ Based on the issue description, implement the following:
|
|
|
486
509
|
|
|
487
510
|
- Source: {provider.replace('_', ' ').title()} Issue {number}
|
|
488
511
|
- Repository: {repo}
|
|
489
|
-
- Generated by: Loki Mode CLI
|
|
512
|
+
- Generated by: Loki Mode CLI v{loki_version}
|
|
490
513
|
|
|
491
514
|
---
|
|
492
515
|
|
package/autonomy/loki
CHANGED
|
@@ -10454,7 +10454,10 @@ cmd_run() {
|
|
|
10454
10454
|
|
|
10455
10455
|
# Generate PRD
|
|
10456
10456
|
local prd_content
|
|
10457
|
-
|
|
10457
|
+
# Pass the REAL version through. The generator falls back to "unknown"
|
|
10458
|
+
# without it, and it used to hardcode v6.0.0 -- printing a three-majors-stale
|
|
10459
|
+
# version in the first artifact a user sees on the issue path.
|
|
10460
|
+
prd_content=$(echo "$issue_json" | LOKI_VERSION="$(get_version)" generate_prd_from_issue)
|
|
10458
10461
|
|
|
10459
10462
|
# Detached mode: fork to background
|
|
10460
10463
|
if $run_detached; then
|
package/autonomy/run.sh
CHANGED
|
@@ -4724,7 +4724,7 @@ except Exception:
|
|
|
4724
4724
|
if [ -n "$pr_url" ]; then
|
|
4725
4725
|
printf '%-14s %s\n' "Pull request:" "$pr_url"
|
|
4726
4726
|
elif [ "$outcome" = "complete" ]; then
|
|
4727
|
-
printf '%-14s %s\n' "Pull request:" "not opened (
|
|
4727
|
+
printf '%-14s %s\n' "Pull request:" "not opened (no GitHub remote, gh not authed, or on a default branch)"
|
|
4728
4728
|
fi
|
|
4729
4729
|
printf '%-14s %s\n' "Tasks:" "pending=$pending in_progress=$in_progress completed=$completed failed=$failed"
|
|
4730
4730
|
echo ""
|
|
@@ -5224,8 +5224,19 @@ except Exception:
|
|
|
5224
5224
|
# both knobs never gets a double PR.
|
|
5225
5225
|
#===============================================================================
|
|
5226
5226
|
on_run_complete() {
|
|
5227
|
-
#
|
|
5228
|
-
|
|
5227
|
+
# DEFAULT ON as of v9.43.0.
|
|
5228
|
+
#
|
|
5229
|
+
# This shipped OFF, and the product literally printed "Pull request: not
|
|
5230
|
+
# opened (set LOKI_DELEGATE_PR=1 to open one)" -- it knew what the user
|
|
5231
|
+
# wanted and asked them to go read documentation instead of doing it. For
|
|
5232
|
+
# the core use case ("I give it a GitHub issue and it resolves"), the PR IS
|
|
5233
|
+
# the deliverable, so shipping it off meant shipping the product off.
|
|
5234
|
+
#
|
|
5235
|
+
# Safe to default on because every guard below was already built and is
|
|
5236
|
+
# unchanged: requires a GitHub repo AND `gh auth status` AND a non-default
|
|
5237
|
+
# branch; it opens a PR and NEVER merges; every call is best-effort so a
|
|
5238
|
+
# failure cannot block completion. Opt out with LOKI_DELEGATE_PR=0.
|
|
5239
|
+
if [ "${LOKI_DELEGATE_PR:-1}" != "1" ]; then
|
|
5229
5240
|
return 0
|
|
5230
5241
|
fi
|
|
5231
5242
|
# Defer to the existing dedicated PR path to avoid a double PR.
|
package/dashboard/__init__.py
CHANGED
package/docs/INSTALLATION.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The flagship product of [Autonomi](https://www.autonomi.dev/). Loki Mode is a spec-driven autonomous builder with a built-in trust layer that takes any spec to a deployed product and verifies completion with evidence (quality gates plus a completion council), not just a "done" claim. Complete installation instructions for all platforms and use cases.
|
|
4
4
|
|
|
5
|
-
**Version:** v9.
|
|
5
|
+
**Version:** v9.45.0
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
package/loki-ts/dist/loki.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var _t=Object.create;var{getPrototypeOf:vt,defineProperty:jG,getOwnPropertyNames:ht}=Object;var gt=Object.prototype.hasOwnProperty;function mt($){return this[$]}var ut,dt,pt=($,X,Q)=>{var z=$!=null&&typeof $==="object";if(z){var Z=X?ut??=new WeakMap:dt??=new WeakMap,K=Z.get($);if(K)return K}Q=$!=null?_t(vt($)):{};let J=X||!$||!$.__esModule?jG(Q,"default",{value:$,enumerable:!0}):Q;for(let q of ht($))if(!gt.call(J,q))jG(J,q,{get:mt.bind($,q),enumerable:!0});if(z)Z.set($,J);return J};var zq=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var ct=($)=>$;function lt($,X){this[$]=ct.bind(null,X)}var B1=($,X)=>{for(var Q in X)jG($,Q,{get:X[Q],enumerable:!0,configurable:!0,set:lt.bind(X,Q)})};var s=($,X)=>()=>($&&(X=$($=0)),X);var w5=import.meta.require;var UR={};B1(UR,{lokiDir:()=>h0,homeLokiDir:()=>WQ,findRepoRootForVersion:()=>AG,REPO_ROOT:()=>L1});import{resolve as h2,dirname as LG}from"path";import{fileURLToPath as it}from"url";import{existsSync as Zq}from"fs";import{homedir as at}from"os";function ot(){let $=YR;for(let X=0;X<6;X++){if(Zq(h2($,"VERSION"))&&Zq(h2($,"autonomy/run.sh")))return $;let Q=LG($);if(Q===$)break;$=Q}return h2(YR,"..","..","..")}function AG($){let X=$;for(let Q=0;Q<6;Q++){if(Zq(h2(X,"VERSION"))&&Zq(h2(X,"autonomy/run.sh")))return X;let z=LG(X);if(z===X)break;X=z}return h2($,"..","..","..")}function h0(){return process.env.LOKI_DIR??h2(process.cwd(),".loki")}function WQ(){return h2(at(),".loki")}var YR,L1;var k1=s(()=>{YR=LG(it(import.meta.url));L1=ot()});import{readFileSync as st}from"fs";import{resolve as nt,dirname as rt}from"path";import{fileURLToPath as tt}from"url";function j9(){if(n3!==null)return n3;let $="9.
|
|
2
|
+
var _t=Object.create;var{getPrototypeOf:vt,defineProperty:jG,getOwnPropertyNames:ht}=Object;var gt=Object.prototype.hasOwnProperty;function mt($){return this[$]}var ut,dt,pt=($,X,Q)=>{var z=$!=null&&typeof $==="object";if(z){var Z=X?ut??=new WeakMap:dt??=new WeakMap,K=Z.get($);if(K)return K}Q=$!=null?_t(vt($)):{};let J=X||!$||!$.__esModule?jG(Q,"default",{value:$,enumerable:!0}):Q;for(let q of ht($))if(!gt.call(J,q))jG(J,q,{get:mt.bind($,q),enumerable:!0});if(z)Z.set($,J);return J};var zq=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var ct=($)=>$;function lt($,X){this[$]=ct.bind(null,X)}var B1=($,X)=>{for(var Q in X)jG($,Q,{get:X[Q],enumerable:!0,configurable:!0,set:lt.bind(X,Q)})};var s=($,X)=>()=>($&&(X=$($=0)),X);var w5=import.meta.require;var UR={};B1(UR,{lokiDir:()=>h0,homeLokiDir:()=>WQ,findRepoRootForVersion:()=>AG,REPO_ROOT:()=>L1});import{resolve as h2,dirname as LG}from"path";import{fileURLToPath as it}from"url";import{existsSync as Zq}from"fs";import{homedir as at}from"os";function ot(){let $=YR;for(let X=0;X<6;X++){if(Zq(h2($,"VERSION"))&&Zq(h2($,"autonomy/run.sh")))return $;let Q=LG($);if(Q===$)break;$=Q}return h2(YR,"..","..","..")}function AG($){let X=$;for(let Q=0;Q<6;Q++){if(Zq(h2(X,"VERSION"))&&Zq(h2(X,"autonomy/run.sh")))return X;let z=LG(X);if(z===X)break;X=z}return h2($,"..","..","..")}function h0(){return process.env.LOKI_DIR??h2(process.cwd(),".loki")}function WQ(){return h2(at(),".loki")}var YR,L1;var k1=s(()=>{YR=LG(it(import.meta.url));L1=ot()});import{readFileSync as st}from"fs";import{resolve as nt,dirname as rt}from"path";import{fileURLToPath as tt}from"url";function j9(){if(n3!==null)return n3;let $="9.45.0";if(typeof $==="string"&&$.length>0)return n3=$,n3;try{let X=rt(tt(import.meta.url)),Q=AG(X);n3=st(nt(Q,"VERSION"),"utf-8").trim()}catch{n3="unknown"}return n3}var n3=null;var Kq=s(()=>{k1()});var OR={};B1(OR,{runOrThrow:()=>Be,run:()=>$1,readStreamCapped:()=>Jq,commandVersion:()=>Me,commandExists:()=>g5,ShellError:()=>TG,MAX_STDOUT_BYTES:()=>MR});async function Jq($,X=MR){let Q=$.getReader(),z=new TextDecoder,Z="",K=0;try{while(K<X){let{done:J,value:q}=await Q.read();if(J)break;if(!q)continue;if(K+=q.byteLength,K>X){let V=q.byteLength-(K-X);Z+=z.decode(q.subarray(0,V),{stream:!0});break}Z+=z.decode(q,{stream:!0})}Z+=z.decode()}finally{try{await Q.cancel()}catch{}Q.releaseLock()}return Z}async function $1($,X={}){let Q=Bun.spawn({cmd:[...$],stdout:"pipe",stderr:"pipe",env:X.env?{...process.env,...X.env}:process.env,cwd:X.cwd}),z,Z;if(X.timeoutMs&&X.timeoutMs>0)z=setTimeout(()=>{try{Q.kill("SIGTERM")}catch{}Z=setTimeout(()=>{try{Q.kill("SIGKILL")}catch{}},2000)},X.timeoutMs);try{let[K,J,q]=await Promise.all([Jq(Q.stdout),new Response(Q.stderr).text(),Q.exited]);return{stdout:K,stderr:J,exitCode:q}}finally{if(z)clearTimeout(z);if(Z)clearTimeout(Z)}}async function Be($,X={}){let Q=await $1($,X);if(Q.exitCode!==0)throw new TG(`command failed (${Q.exitCode}): ${$.join(" ")}`,Q.exitCode,Q.stdout,Q.stderr);return Q}async function g5($){let X=Ne($),Q=await $1(["sh","-c",`command -v ${X}`],{timeoutMs:5000});if(Q.exitCode===0)return Q.stdout.trim()||null;return null}function Ne($){if(!/^[A-Za-z0-9._/-]+$/.test($))throw Error(`refused to shell-escape suspect token: ${$}`);return $}async function Me($,X="--version"){if(!await g5($))return null;let z=await $1([$,X],{timeoutMs:5000});if(z.exitCode!==0)return null;return((z.stdout||z.stderr).split(/\r?\n/)[0]?.trim()??"")||null}var MR=16777216,TG;var y8=s(()=>{TG=class TG extends Error{message;exitCode;stdout;stderr;constructor($,X,Q,z){super($);this.message=$;this.exitCode=X;this.stdout=Q;this.stderr=z;this.name="ShellError"}}});function g2($){return Oe?"":$}var Oe,p0,$5,q1,D61,A1,f1,m5,r;var t7=s(()=>{Oe=(process.env.NO_COLOR??"").length>0;p0=g2("\x1B[0;31m"),$5=g2("\x1B[0;32m"),q1=g2("\x1B[1;33m"),D61=g2("\x1B[0;34m"),A1=g2("\x1B[0;36m"),f1=g2("\x1B[1m"),m5=g2("\x1B[2m"),r=g2("\x1B[0m")});import{existsSync as we}from"fs";async function Z2(){if(GQ!==void 0)return GQ;let $="/opt/homebrew/bin/python3.12";if(we($))return GQ=$,$;let X=await g5("python3.12");if(X)return GQ=X,X;let Q=await g5("python3");return GQ=Q,Q}async function I4($,X={}){let Q=await Z2();if(!Q)return{stdout:"",stderr:"python3 not found",exitCode:127};return $1([Q,"-c",$],X)}var GQ;var m2=s(()=>{y8()});var vR={};B1(vR,{runStatus:()=>te});import{existsSync as u5,readFileSync as C9,readdirSync as ER,statSync as xR}from"fs";import{resolve as A5,basename as pe}from"path";import{homedir as ce}from"os";function kR($){let X=Math.trunc($);if(X>=1e6)return`${(Math.trunc(X/1e6*10)/10).toFixed(1)}M`;if(X>=1000)return`${(Math.trunc(X/1000*10)/10).toFixed(1)}K`;return String(X)}function SR($,X,Q){if(X===0)return null;let z=Math.trunc($*100/X),Z=Math.trunc($*Vq/X);if(Z>Vq)Z=Vq;let K=Vq-Z,J=$5;if(z>=80)J=p0;else if(z>=50)J=q1;let q="=".repeat(Math.max(0,Z))+" ".repeat(Math.max(0,K)),V=kR($),Y=kR(X);return` ${f1}${Q}${r} ${J}[${q}]${r} ${z}% (${V} / ${Y})`}async function ie(){if(await g5("jq"))return!0;return process.stdout.write(`${p0}Error: jq is required but not installed.${r}
|
|
3
3
|
`),process.stdout.write(`Install with:
|
|
4
4
|
`),process.stdout.write(` brew install jq (macOS)
|
|
5
5
|
`),process.stdout.write(` apt install jq (Debian/Ubuntu)
|
|
@@ -1337,4 +1337,4 @@ Set LOKI_LEGACY_BASH=1 to force the bash CLI for every command.
|
|
|
1337
1337
|
`),2}case"start":{let{runStart:z}=await Promise.resolve().then(() => (yt(),St));return z(Q)}default:return process.stderr.write(`Unknown command: ${X}
|
|
1338
1338
|
`),process.stderr.write(bt),2}}wR();process.on("SIGINT",()=>process.exit(130));process.on("SIGTERM",()=>process.exit(143));var K61=await Z61(Bun.argv.slice(2));process.exit(K61);
|
|
1339
1339
|
|
|
1340
|
-
//# debugId=
|
|
1340
|
+
//# debugId=1DD437C40F72C7156A78843ECF29A101
|
package/mcp/__init__.py
CHANGED
package/mcp/server.py
CHANGED
|
@@ -2574,6 +2574,7 @@ async def loki_graph_query(question: str, budget: int = 1500, path: str = ".") -
|
|
|
2574
2574
|
'network).' % (graph, path or '.')),
|
|
2575
2575
|
}, indent=2)
|
|
2576
2576
|
|
|
2577
|
+
import subprocess
|
|
2577
2578
|
proc = subprocess.run(
|
|
2578
2579
|
['graphify', 'query', question, '--budget', str(budget)],
|
|
2579
2580
|
cwd=path or '.', capture_output=True, text=True, timeout=120)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loki-mode",
|
|
3
3
|
"mcpName": "io.github.asklokesh/loki-mode",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.45.0",
|
|
5
5
|
"description": "Loki Mode by Autonomi. Autonomous spec-to-product system: takes a PRD, GitHub issue, OpenAPI/JSON/YAML, or one-line brief to a deployed app via the RARV-C closure loop with 8 quality gates. Provider-agnostic (Claude Code, OpenAI Codex, Cline, Aider, opencode).",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"agent",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
|
|
3
3
|
"name": "loki-mode",
|
|
4
4
|
"displayName": "Loki Mode",
|
|
5
|
-
"version": "9.
|
|
5
|
+
"version": "9.45.0",
|
|
6
6
|
"description": "Autonomous spec-to-product build system with a built-in trust layer (RARV-C closure loop, 8 quality gates, completion council). Ships Loki's spec-hardening, drift-detection, and deterministic PR verification commands plus the Loki MCP server.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Autonomi",
|