loki-mode 11.120.0 → 11.121.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/.github/actions/issue-to-pr/action.yml +1 -1
- package/README.md +3 -2
- package/SKILL.md +18 -30
- package/VERSION +1 -1
- package/agents/custom_agents.py +1 -1
- package/api/openapi.yaml +3 -7
- package/api/routes/health.ts +5 -10
- package/api/routes/sessions.ts +12 -3
- package/api/server.js +6 -2
- package/api/services/cli-bridge.ts +1 -1
- package/api/types/api.ts +3 -5
- package/assets/welcome/welcome.html +1 -1
- package/autonomy/completion-council.sh +3 -56
- package/autonomy/context-tracker.py +10 -25
- package/autonomy/council-v2.sh +0 -28
- package/autonomy/grill.sh +3 -25
- package/autonomy/lib/chat.sh +3 -6
- package/autonomy/lib/claude-flags.sh +1 -1
- package/autonomy/lib/contract-scaffold/README.md +2 -2
- package/autonomy/lib/cost-summary.py +2 -2
- package/autonomy/lib/done-recognition.sh +1 -1
- package/autonomy/lib/efficiency_cost.py +1 -1
- package/autonomy/lib/effort_estimator.py +0 -4
- package/autonomy/lib/help-core.sh +6 -4
- package/autonomy/lib/iteration_attribution.py +1 -1
- package/autonomy/lib/mcp-config.sh +7 -34
- package/autonomy/lib/os_sandbox.py +2 -5
- package/autonomy/lib/outcome_ledger.py +1 -1
- package/autonomy/lib/project-graph.sh +1 -1
- package/autonomy/lib/proof-generator.py +1 -2
- package/autonomy/lib/scaffold-hook.sh +3 -7
- package/autonomy/lib/setup-requirements.json +1 -4
- package/autonomy/lib/skill-link-heal.sh +1 -1
- package/autonomy/lib/telemetry-schema.json +3 -3
- package/autonomy/lib/wiki_llm.py +1 -4
- package/autonomy/loki +95 -336
- package/autonomy/migration-agents.sh +1 -1
- package/autonomy/notification-checker.py +2 -2
- package/autonomy/prd-checklist.sh +1 -1
- package/autonomy/provider-offer.sh +7 -11
- package/autonomy/quickstart.sh +3 -11
- package/autonomy/route.sh +6 -6
- package/autonomy/run.sh +79 -348
- package/autonomy/sandbox.sh +8 -39
- package/autonomy/setup-wizard.sh +5 -5
- package/bin/loki +34 -25
- package/completions/_loki +4 -4
- package/completions/loki.bash +2 -4
- package/dashboard/__init__.py +1 -1
- package/dashboard/api_start.py +36 -6
- package/dashboard/api_v2.py +1 -1
- package/dashboard/build_supervisor.py +1 -5
- package/dashboard/server.py +18 -26
- package/docs/ARCHITECTURE.md +13 -14
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/COMPARE-OPENCODE.md +7 -6
- package/docs/COMPONENTS.md +6 -11
- package/docs/DOCKER.md +11 -10
- package/docs/INSTALLATION.md +5 -8
- package/docs/OPEN-CORE-BOUNDARY.md +1 -1
- package/docs/PRIVACY.md +2 -2
- package/docs/QUICKSTART.md +2 -2
- package/docs/TOOLS.md +3 -3
- package/docs/air-gapped.md +3 -3
- package/docs/alternative-installations.md +20 -10
- package/docs/cost-controls.md +0 -3
- package/docs/dev/architecture-reference.md +9 -13
- package/docs/dev/project-structure.md +1 -4
- package/docs/environment-variables.md +8 -10
- package/docs/exit-codes.md +5 -5
- package/docs/network-security.md +3 -6
- package/docs/v10/GUIDE.md +45 -34
- package/integrations/openclaw/README.md +1 -1
- package/integrations/openclaw/SKILL.md +3 -3
- package/learning/emit.sh +1 -1
- package/loki-ts/data/child-env.json +0 -10
- package/loki-ts/data/finding-schema.json +2 -2
- package/loki-ts/dist/cockpit.js +1 -1
- package/loki-ts/dist/loki.js +1348 -1354
- package/magic/core/debate.py +4 -11
- package/magic/core/generator.py +5 -18
- package/mcp/__init__.py +1 -1
- package/mcp/lsp_proxy.py +3 -3
- package/mcp/server.py +1 -1
- package/package.json +2 -3
- package/packages/control-plane/dist/ask-tools-server.js +1 -3
- package/packages/control-plane/dist/server.js +171 -395
- package/packages/control-plane/src/ask/invoke.ts +5 -13
- package/packages/control-plane/src/ask/parse.ts +3 -25
- package/packages/control-plane/src/ask/worker.ts +1 -2
- package/packages/control-plane/src/db/fixture-cleanup.ts +1 -1
- package/packages/control-plane/src/server/routes/ask.ts +3 -2
- package/packages/control-plane/src/server/routes/cost_ledger.ts +0 -1
- package/packages/control-plane/src/server/routes/providers.ts +4 -9
- package/packages/control-plane/src/server/spawn.ts +8 -4
- package/packages/control-plane/ui/dist/assets/{index-C4nb1aRV.js → index-Dy80VLtj.js} +22 -22
- package/packages/control-plane/ui/dist/index.html +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/providers/loader.sh +23 -4
- package/providers/model_catalog.json +2 -104
- package/providers/models.sh +10 -11
- package/providers/opencode.sh +3 -6
- package/references/quality-control.md +1 -1
- package/schemas/loki-yaml.schema.json +1 -1
- package/skills/model-selection.md +27 -56
- package/skills/providers.md +54 -221
- package/skills/quality-gates.md +11 -41
- package/skills/testing.md +1 -1
- package/skills/troubleshooting.md +1 -2
- package/src/integrations/github/action-handler.js +2 -4
- package/src/protocols/tools/start-project.js +1 -1
- package/tools/calibration-audit.py +1 -1
- package/tools/index-codebase.py +1 -2
- package/tools/preflight.sh +2 -2
- package/tools/probe-model-catalog.py +1 -13
- package/tools/regen-state-machine-refs.py +1 -2
- package/tools/token-guard.py +1 -1
- package/web-app/dist/assets/{AdminPage-D1_vz1LQ.js → AdminPage-BfxkhFXl.js} +1 -1
- package/web-app/dist/assets/{Avatar-BefQj_9m.js → Avatar-xV4rK0ps.js} +1 -1
- package/web-app/dist/assets/{Badge-BcAowN-N.js → Badge-Ds_E82Ka.js} +1 -1
- package/web-app/dist/assets/{Button-BeVwFkYh.js → Button-BXAwY0ni.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-Q-sO8Psm.js → CockpitPage-y3R9sk_M.js} +1 -1
- package/web-app/dist/assets/ComparePage-BGbCno4C.js +1 -0
- package/web-app/dist/assets/{ErrorBoundary-DdIh2DlF.js → ErrorBoundary-DGqkzHdy.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-cf2Jhgl3.js → EvidenceReceiptPanel-Bj57TWoJ.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-SfgkosoM.js → GitHubIssuesPanel-CVbtUCRI.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-DsUqn99r.js → GitHubPRsPanel-DuNxI0k8.js} +1 -1
- package/web-app/dist/assets/{HomePage-C6PCzqqg.js → HomePage-DogFuRvt.js} +2 -2
- package/web-app/dist/assets/{LoginPage-Bqci5QVa.js → LoginPage-U-r-YNKC.js} +1 -1
- package/web-app/dist/assets/{MagicPage-NO5PIrOb.js → MagicPage-C5iDqK4d.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-B0oveHbr.js → MetricsPage-COVYOGfr.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-CDh2DiQC.js → NotFoundPage-CZii6Z0s.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-CrJ_t9m_.js → ProjectPage-QwOZzVqj.js} +25 -25
- package/web-app/dist/assets/{ProjectsPage-UPhA-lpV.js → ProjectsPage-BcxVfXVW.js} +1 -1
- package/web-app/dist/assets/SettingsPage-CBY9JiAE.js +10 -0
- package/web-app/dist/assets/{ShowcasePage-sZmG4qo4.js → ShowcasePage-D1YPQOp7.js} +1 -1
- package/web-app/dist/assets/SystemSettingsPage-DcpAC9Lg.js +1 -0
- package/web-app/dist/assets/{TeamsPage-DFuLa1I9.js → TeamsPage-BTiJPkD4.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-C_U8lRMD.js → TemplatesPage-LUa3bH-A.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-DdU-3V0-.js → TerminalOutput-BM8LH-RG.js} +1 -1
- package/web-app/dist/assets/{activity-BwXV9-sA.js → activity-mZHuLoR5.js} +1 -1
- package/web-app/dist/assets/{bell-DF148FeB.js → bell-BR_y_nMB.js} +1 -1
- package/web-app/dist/assets/{bot-BM1t71_O.js → bot-Ct3caGMX.js} +1 -1
- package/web-app/dist/assets/{check-DHJPb450.js → check-DuQpq9PN.js} +1 -1
- package/web-app/dist/assets/{chevron-left-DZIgwXb6.js → chevron-left-CWSfVWba.js} +1 -1
- package/web-app/dist/assets/{circle-alert-31lHNmy0.js → circle-alert-C7TCj9Jm.js} +1 -1
- package/web-app/dist/assets/{clock-D4QAxoCy.js → clock-BFsj3bRT.js} +1 -1
- package/web-app/dist/assets/{cloud-Dd2iypzJ.js → cloud-78sYPXff.js} +1 -1
- package/web-app/dist/assets/{code-xml-CnUOPwx8.js → code-xml-DuwBCDz-.js} +1 -1
- package/web-app/dist/assets/{database-Dhpbplpo.js → database-CwRTYKVV.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-DCt7L7Pk.js → dollar-sign-COXAsjgd.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-D2SPiEH7.js → file-code-corner-A8LPVBBy.js} +1 -1
- package/web-app/dist/assets/{file-plus-cCrpp-pe.js → file-plus-D9IXE7YW.js} +1 -1
- package/web-app/dist/assets/{globe-Cn6TYK_z.js → globe-Ce6xgdLR.js} +1 -1
- package/web-app/dist/assets/{hammer-sMLkpUw2.js → hammer-Dtq836Al.js} +1 -1
- package/web-app/dist/assets/{index-Dgb8Kves.js → index-uce16-nn.js} +16 -16
- package/web-app/dist/assets/{layers-DuPguIVU.js → layers-BOQdqOXk.js} +1 -1
- package/web-app/dist/assets/{loader-circle-BBhsXs18.js → loader-circle-D3y4SHAn.js} +1 -1
- package/web-app/dist/assets/{lock-n-qJvU_o.js → lock-miFONHLo.js} +1 -1
- package/web-app/dist/assets/{package-cDxKfjAD.js → package-ckZFIHTG.js} +1 -1
- package/web-app/dist/assets/{plus-COk5sQxp.js → plus-COJKSbOp.js} +1 -1
- package/web-app/dist/assets/{refresh-cw--VKVhvpo.js → refresh-cw-rPt-Oa4a.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-DvZ6KExW.js → rotate-ccw-Dy50K31A.js} +1 -1
- package/web-app/dist/assets/{scroll-text-HRyHuQUy.js → scroll-text-CbczPkkS.js} +1 -1
- package/web-app/dist/assets/{server-CoZSZtid.js → server-HkfTEf2O.js} +1 -1
- package/web-app/dist/assets/{shield-alert--WkXdHlN.js → shield-alert-DjKF0yba.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-YeW2Lb8g.js → thumbs-up-aObjUDQm.js} +1 -1
- package/web-app/dist/assets/{trash-2-DuhNrOPo.js → trash-2-CQfI6Z-c.js} +1 -1
- package/web-app/dist/assets/{trending-down-55EMrZu6.js → trending-down-CP7J5aPV.js} +1 -1
- package/web-app/dist/assets/{trending-up-BaUDEQ-n.js → trending-up-CTJHoPnm.js} +1 -1
- package/web-app/dist/assets/{upload-BrHq6BXI.js → upload-i1zoXd2k.js} +1 -1
- package/web-app/dist/assets/{usePolling-BEtK-_qo.js → usePolling-CZG-IV1Y.js} +1 -1
- package/web-app/dist/assets/{user-DL5XlCBR.js → user-CJwbwmPE.js} +1 -1
- package/web-app/dist/index.html +1 -1
- package/web-app/server.py +26 -14
- package/autonomy/lib/codex-usage.py +0 -174
- package/providers/aider.sh +0 -191
- package/providers/cline.sh +0 -176
- package/providers/codex.sh +0 -408
- package/web-app/dist/assets/ComparePage-CiJ3FrSl.js +0 -1
- package/web-app/dist/assets/SettingsPage-DKO1LhLq.js +0 -10
- package/web-app/dist/assets/SystemSettingsPage-Drvx9eXK.js +0 -1
package/autonomy/grill.sh
CHANGED
|
@@ -151,12 +151,6 @@ grill_check_provider() {
|
|
|
151
151
|
return $GRILL_EXIT_ERROR
|
|
152
152
|
fi
|
|
153
153
|
;;
|
|
154
|
-
codex)
|
|
155
|
-
if ! command -v codex >/dev/null 2>&1; then
|
|
156
|
-
_grill_err "Codex CLI not found."
|
|
157
|
-
return $GRILL_EXIT_ERROR
|
|
158
|
-
fi
|
|
159
|
-
;;
|
|
160
154
|
*)
|
|
161
155
|
# v8.2.0: capability, not identity. Must stay in lockstep with the
|
|
162
156
|
# matching arm in grill_invoke_provider -- this gate runs FIRST, so
|
|
@@ -164,7 +158,7 @@ grill_check_provider() {
|
|
|
164
158
|
if type provider_invoke_argv >/dev/null 2>&1; then
|
|
165
159
|
return 0
|
|
166
160
|
fi
|
|
167
|
-
_grill_err "grill currently supports the claude
|
|
161
|
+
_grill_err "grill currently supports the claude provider (got: $provider)"
|
|
168
162
|
return $GRILL_EXIT_ERROR
|
|
169
163
|
;;
|
|
170
164
|
esac
|
|
@@ -299,22 +293,6 @@ sys.stdout.write(str(d.get("result", "")) if isinstance(d, dict) else raw)' 2>/d
|
|
|
299
293
|
printf '%s\n' "$out"
|
|
300
294
|
return 0
|
|
301
295
|
;;
|
|
302
|
-
codex)
|
|
303
|
-
if ! command -v codex >/dev/null 2>&1; then
|
|
304
|
-
_grill_err "Codex CLI not found."
|
|
305
|
-
return $GRILL_EXIT_ERROR
|
|
306
|
-
fi
|
|
307
|
-
local out
|
|
308
|
-
local _cx_extra=()
|
|
309
|
-
[ "$role" = "check_author" ] && _cx_extra=(--skip-git-repo-check)
|
|
310
|
-
out="$(printf '%s' "$prompt" | _grill_with_timeout "${LOKI_GRILL_TIMEOUT:-180}" codex exec --sandbox workspace-write ${_cx_extra[@]+"${_cx_extra[@]}"} - 2>/dev/null)"
|
|
311
|
-
if [ -z "$out" ]; then
|
|
312
|
-
_grill_err "provider returned no output"
|
|
313
|
-
return $GRILL_EXIT_ERROR
|
|
314
|
-
fi
|
|
315
|
-
printf '%s\n' "$out"
|
|
316
|
-
return 0
|
|
317
|
-
;;
|
|
318
296
|
*)
|
|
319
297
|
# v8.2.0 TIMEOUT SEAM. Previously any other provider was a hard
|
|
320
298
|
# error. A provider exposing provider_invoke_argv builds a REAL argv
|
|
@@ -342,7 +320,7 @@ sys.stdout.write(str(d.get("result", "")) if isinstance(d, dict) else raw)' 2>/d
|
|
|
342
320
|
printf '%s\n' "$out"
|
|
343
321
|
return 0
|
|
344
322
|
fi
|
|
345
|
-
_grill_err "grill currently supports the claude
|
|
323
|
+
_grill_err "grill currently supports the claude provider (got: $provider)"
|
|
346
324
|
return $GRILL_EXIT_ERROR
|
|
347
325
|
;;
|
|
348
326
|
esac
|
|
@@ -377,7 +355,7 @@ OPTIONS:
|
|
|
377
355
|
-h, --help Show this help.
|
|
378
356
|
|
|
379
357
|
ENVIRONMENT:
|
|
380
|
-
LOKI_PROVIDER Provider to use (claude default;
|
|
358
|
+
LOKI_PROVIDER Provider to use (claude default; opencode via provider_invoke_argv).
|
|
381
359
|
LOKI_GRILL_MODEL Claude model for the interrogation (default: sonnet).
|
|
382
360
|
LOKI_GRILL_TIMEOUT Per-invocation timeout in seconds (default: 180).
|
|
383
361
|
|
package/autonomy/lib/chat.sh
CHANGED
|
@@ -58,7 +58,7 @@ Loki chat commands:
|
|
|
58
58
|
/verify [path] [--max-age 7d] loki verify (a receipt path, group receipt, or age limit)
|
|
59
59
|
/receipt loki receipt
|
|
60
60
|
/model <id> set model for this session
|
|
61
|
-
/provider <name> switch provider (claude,
|
|
61
|
+
/provider <name> switch provider (claude, opencode)
|
|
62
62
|
/cost loki cost
|
|
63
63
|
/merge <args> loki merge (pr <pr>, watch <pr> to repair red CI, run, list)
|
|
64
64
|
/diff git diff --stat plus diff
|
|
@@ -346,10 +346,7 @@ _chat_send() {
|
|
|
346
346
|
source "${_LOKI_SCRIPT_DIR:-.}/../providers/loader.sh" 2>/dev/null || exit 1
|
|
347
347
|
load_provider "$_CHAT_PROVIDER" >/dev/null 2>&1 || { _chat_load_fail "$_CHAT_PROVIDER"; exit 1; }
|
|
348
348
|
case "$_CHAT_PROVIDER" in
|
|
349
|
-
codex) codex exec --sandbox read-only --skip-git-repo-check "$prompt" < /dev/null ;;
|
|
350
349
|
opencode) opencode run --agent plan --model "$PROVIDER_MODEL_DEVELOPMENT" "$prompt" < /dev/null ;;
|
|
351
|
-
aider) aider --message "$prompt" --yes-always --no-auto-commits --dry-run --model "$AIDER_DEFAULT_MODEL" < /dev/null 2>&1 ;;
|
|
352
|
-
cline) cline --plan "$prompt" < /dev/null ;;
|
|
353
350
|
*) provider_invoke "$prompt" ;;
|
|
354
351
|
esac
|
|
355
352
|
) || rc=$?
|
|
@@ -554,8 +551,8 @@ Question: $line" || true
|
|
|
554
551
|
if [ -n "$rest" ]; then _CHAT_MODEL="$rest"; echo "model: $rest"; else echo "model: ${_CHAT_MODEL:-default}"; fi ;;
|
|
555
552
|
/provider)
|
|
556
553
|
case "$rest" in
|
|
557
|
-
claude|
|
|
558
|
-
*) echo "usage: /provider claude|
|
|
554
|
+
claude|opencode) _CHAT_PROVIDER="$rest"; _CHAT_STARTED=0; echo "provider: $rest" ;;
|
|
555
|
+
*) echo "usage: /provider claude|opencode (now: $_CHAT_PROVIDER)" ;;
|
|
559
556
|
esac ;;
|
|
560
557
|
*)
|
|
561
558
|
local _sg; _sg="$(_chat_suggest "$cmd")"
|
|
@@ -527,7 +527,7 @@ loki_ultrareview_enabled() {
|
|
|
527
527
|
# fan out into many background subagents. They are triggered by the `ultracode`
|
|
528
528
|
# keyword in a prompt and fire under `claude -p` (verified empirically: a headless
|
|
529
529
|
# workflow returned "The workflow finished"). They are:
|
|
530
|
-
# - Claude-PROVIDER-ONLY (no
|
|
530
|
+
# - Claude-PROVIDER-ONLY (no opencode equivalent),
|
|
531
531
|
# - require claude CLI >= 2.1.154,
|
|
532
532
|
# - cost meaningfully MORE than a normal run (a trivial workflow observed at
|
|
533
533
|
# ~$0.71 vs ~$0.01 for a plain read; there is NO price API so we never quote
|
|
@@ -33,7 +33,7 @@ knowledge of any specific PRD** (anti-teaching-to-the-test).
|
|
|
33
33
|
This is a capability module, like FV-1 was. It changes zero existing build
|
|
34
34
|
behavior. **Wiring it into the default build lane is the gated next step** (the
|
|
35
35
|
M1->"M1-wire" fork, analogous to FV-1->FV-2): that step touches the parity-locked
|
|
36
|
-
`run.sh
|
|
36
|
+
`run.sh` build_prompt core, reclassifies what every build produces, and
|
|
37
37
|
requires bash+bun parity work + council review + founder sign-off. Do NOT wire it
|
|
38
38
|
in as a solo/rushed action.
|
|
39
39
|
|
|
@@ -79,5 +79,5 @@ UI -- the spine working as designed).
|
|
|
79
79
|
## Next (wiring, see the plan)
|
|
80
80
|
|
|
81
81
|
- Wire M1+M2+M3 into the build lane (GATED: touches parity-locked run.sh/
|
|
82
|
-
|
|
82
|
+
run.sh build_prompt core -> council + founder sign-off).
|
|
83
83
|
- Wire the FV harness into the completion verdict (FV-2, founder-gated).
|
|
@@ -10,7 +10,7 @@ reading 90% from cache costs roughly a tenth of the same run reading fresh --
|
|
|
10
10
|
and nothing on the CLI surfaced it.
|
|
11
11
|
|
|
12
12
|
THE HONESTY RULE THIS INHERITS. Unmeasured is not free. That confusion shipped
|
|
13
|
-
to a user on four separate surfaces (v8.51.0 through v8.54.0:
|
|
13
|
+
to a user on four separate surfaces (v8.51.0 through v8.54.0: a provider
|
|
14
14
|
dispatch recorded no tokens, the receipt said {"usd": 0.0, "available": true},
|
|
15
15
|
the PROMPT said "$0.00" per iteration, and the verifier never checked). Each
|
|
16
16
|
was fixed in isolation. This is a fifth surface reading the same records, so it
|
|
@@ -133,7 +133,7 @@ def summarize(workspace="."):
|
|
|
133
133
|
# UNPRICED IS NOT FREE. record_is_measured() is field-agnostic: a record
|
|
134
134
|
# with real tokens but cost_usd 0 is "measured" on the strength of its
|
|
135
135
|
# tokens, and the cost slot would then render $0.0000 -- the headline
|
|
136
|
-
# rule inverted, on a shape that actually ships.
|
|
136
|
+
# rule inverted, on a shape that actually ships. An unpriced model can record
|
|
137
137
|
# tokens with no priced cost, and the real FireLater records wrote an
|
|
138
138
|
# explicit "cost_usd": 0 rather than omitting the key.
|
|
139
139
|
#
|
|
@@ -220,7 +220,7 @@ except Exception:
|
|
|
220
220
|
# Decide whether model verification can be attempted.
|
|
221
221
|
#
|
|
222
222
|
# v8.2.0: this used to require LOKI_PROVIDER=claude specifically, so a user on
|
|
223
|
-
#
|
|
223
|
+
# opencode silently lost done-recognition. That is a
|
|
224
224
|
# CAPABILITY question, not an identity question -- the real requirement is "can
|
|
225
225
|
# we reach a model AND bound the call with a timeout". Any provider exposing the
|
|
226
226
|
# argv seam (provider_invoke_argv, see providers/claude.sh) satisfies both.
|
|
@@ -180,7 +180,7 @@ def collect_efficiency(loki_dir):
|
|
|
180
180
|
# exactly that.
|
|
181
181
|
#
|
|
182
182
|
# Measured on the real FireLater run: four efficiency records, every token
|
|
183
|
-
# field 0 (
|
|
183
|
+
# field 0 (that provider wrote no usage before v8.51.0), and collect_efficiency
|
|
184
184
|
# returned {'usd': 0.0, ..., 'available': True}.
|
|
185
185
|
#
|
|
186
186
|
# A run that did work necessarily consumed tokens. So "available" now means
|
|
@@ -268,10 +268,6 @@ def _llm_estimate(canon_inputs, timeout=18):
|
|
|
268
268
|
provider = os.environ.get("LOKI_PROVIDER", "claude")
|
|
269
269
|
cmds = {
|
|
270
270
|
"claude": ["claude", "-p", prompt],
|
|
271
|
-
"codex": ["codex", "exec", "--sandbox", "read-only", prompt],
|
|
272
|
-
"cline": ["cline", "-y", prompt],
|
|
273
|
-
"aider": ["aider", "--message", prompt, "--yes-always",
|
|
274
|
-
"--no-auto-commits"],
|
|
275
271
|
}
|
|
276
272
|
base = cmds.get(provider)
|
|
277
273
|
if base is None or not _which(base[0]):
|
|
@@ -89,12 +89,14 @@ T
|
|
|
89
89
|
cat <<'T'
|
|
90
90
|
Providers
|
|
91
91
|
|
|
92
|
-
Claude Code
|
|
92
|
+
Supported providers: claude (Claude Code CLI, or an Anthropic API key through
|
|
93
|
+
the Agent SDK) and opencode (any model, including OpenRouter).
|
|
93
94
|
loki provider list Providers and install status
|
|
94
|
-
loki provider set
|
|
95
|
-
loki start ./prd.md --provider
|
|
95
|
+
loki provider set opencode Switch provider (claude, opencode)
|
|
96
|
+
loki start ./prd.md --provider opencode
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
opencode with OpenRouter: export OPENROUTER_API_KEY=sk-or-..., then
|
|
99
|
+
loki start ./prd.md --provider opencode --model openrouter/<vendor>/<model>
|
|
98
100
|
T
|
|
99
101
|
;;
|
|
100
102
|
agents)
|
|
@@ -216,7 +216,7 @@ def prompt_block(loki_dir):
|
|
|
216
216
|
# give, and it survives into every downstream decision the agent makes.
|
|
217
217
|
#
|
|
218
218
|
# Measured on the real FireLater run: every iteration rendered "$0.00"
|
|
219
|
-
# because
|
|
219
|
+
# because that provider wrote no usage before v8.51.0. The honesty rule was
|
|
220
220
|
# already documented at the top of this file ("reported as null, not as
|
|
221
221
|
# $0.00") and only the summary path honoured it; the per-iteration line
|
|
222
222
|
# did not.
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
# emission fails.
|
|
30
30
|
# loki_mcp_launch_for -- emit the per-provider MCP launch as one compact JSON
|
|
31
31
|
# object {"argv":[..],"env":{..}[,"reason":".."]}
|
|
32
|
-
# for claude|
|
|
32
|
+
# for claude|opencode. Mirror of
|
|
33
33
|
# mcpLaunchFor in loki-ts/src/providers/mcp_config.ts;
|
|
34
34
|
# tests/providers parity test reads both.
|
|
35
35
|
#
|
|
@@ -231,19 +231,19 @@ loki_mcp_config_argv() {
|
|
|
231
231
|
|
|
232
232
|
# ---------- Per-provider MCP launch (CW-10) ----------
|
|
233
233
|
# Usage: loki_mcp_launch_for <provider> [target_dir]
|
|
234
|
-
# claude: the pre-CW-10 --mcp-config paths, unchanged.
|
|
235
|
-
#
|
|
236
|
-
#
|
|
234
|
+
# claude: the pre-CW-10 --mcp-config paths, unchanged. opencode: env
|
|
235
|
+
# OPENCODE_CONFIG_CONTENT. unknown: empty launch plus a reason. Servers for
|
|
236
|
+
# opencode: Loki bundle, project
|
|
237
237
|
# <target_dir>/.mcp.json only when LOKI_MCP_PROJECT=1, ~/.claude/mcp.json overlay;
|
|
238
238
|
# bundle wins a name collision, then project over overlay. `${...}` stays literal.
|
|
239
239
|
loki_mcp_launch_for() {
|
|
240
240
|
local provider="${1:-}" target="${2:-${TARGET_DIR:-.}}"
|
|
241
|
-
local claude_argv="" user_path="" project_path="" lsp_detected=0 lsp_bin
|
|
241
|
+
local claude_argv="" user_path="" project_path="" lsp_detected=0 lsp_bin
|
|
242
242
|
case "$provider" in
|
|
243
243
|
claude)
|
|
244
244
|
claude_argv=$(TARGET_DIR="$target" loki_mcp_config_argv) || return 1
|
|
245
245
|
;;
|
|
246
|
-
|
|
246
|
+
opencode)
|
|
247
247
|
TARGET_DIR="$target" loki_mcp_config_path >/dev/null || return 1
|
|
248
248
|
user_path=$(loki_user_mcp_config_path)
|
|
249
249
|
if [ "${LOKI_MCP_PROJECT:-}" = "1" ]; then
|
|
@@ -256,16 +256,8 @@ loki_mcp_launch_for() {
|
|
|
256
256
|
fi
|
|
257
257
|
done
|
|
258
258
|
;;
|
|
259
|
-
cline)
|
|
260
|
-
if command -v cline >/dev/null 2>&1; then
|
|
261
|
-
line=$(cline --version 2>/dev/null | head -n 1) || line=""
|
|
262
|
-
line="${line#"${line%%[![:space:]]*}"}"
|
|
263
|
-
line="${line%"${line##*[![:space:]]}"}"
|
|
264
|
-
[ -n "$line" ] && cline_ver="$line"
|
|
265
|
-
fi
|
|
266
|
-
;;
|
|
267
259
|
esac
|
|
268
|
-
_MCP_PROVIDER="$provider" _MCP_CLAUDE_ARGV="$claude_argv" _MCP_USER="$user_path" _MCP_PROJECT="$project_path" _MCP_LSP="$lsp_detected"
|
|
260
|
+
_MCP_PROVIDER="$provider" _MCP_CLAUDE_ARGV="$claude_argv" _MCP_USER="$user_path" _MCP_PROJECT="$project_path" _MCP_LSP="$lsp_detected" python3 -c '
|
|
269
261
|
import json, os, re
|
|
270
262
|
prov = os.environ["_MCP_PROVIDER"]
|
|
271
263
|
NAME = re.compile(r"^[A-Za-z0-9_-]+$")
|
|
@@ -322,21 +314,6 @@ def servers():
|
|
|
322
314
|
res = {"argv": [], "env": {}}
|
|
323
315
|
if prov == "claude":
|
|
324
316
|
res["argv"] = ["--mcp-config"] + os.environ["_MCP_CLAUDE_ARGV"].split()
|
|
325
|
-
elif prov == "codex":
|
|
326
|
-
skipped = []
|
|
327
|
-
for n, s in servers().items():
|
|
328
|
-
names = [k for k in s["env"] if NAME.match(k)]
|
|
329
|
-
if any(k in res["env"] and res["env"][k] != s["env"][k] for k in names):
|
|
330
|
-
skipped.append(n)
|
|
331
|
-
continue
|
|
332
|
-
res["argv"] += ["-c", "mcp_servers.%s.command=%s" % (n, dumps(s["command"]))]
|
|
333
|
-
res["argv"] += ["-c", "mcp_servers.%s.args=%s" % (n, dumps(s["args"]))]
|
|
334
|
-
if names:
|
|
335
|
-
for k in names:
|
|
336
|
-
res["env"][k] = s["env"][k]
|
|
337
|
-
res["argv"] += ["-c", "mcp_servers.%s.env_vars=%s" % (n, dumps(names))]
|
|
338
|
-
if skipped:
|
|
339
|
-
res["reason"] = "mcp: skipped %s (env name conflict)" % ",".join(skipped)
|
|
340
317
|
elif prov == "opencode":
|
|
341
318
|
mcp = {}
|
|
342
319
|
for n, s in servers().items():
|
|
@@ -345,10 +322,6 @@ elif prov == "opencode":
|
|
|
345
322
|
e["environment"] = s["env"]
|
|
346
323
|
mcp[n] = e
|
|
347
324
|
res["env"] = {"OPENCODE_CONFIG_CONTENT": dumps({"mcp": mcp})}
|
|
348
|
-
elif prov == "cline":
|
|
349
|
-
res["reason"] = "mcp: unsupported (cline %s)" % os.environ["_MCP_CLINE_VER"]
|
|
350
|
-
elif prov == "aider":
|
|
351
|
-
res["reason"] = "mcp: unsupported (aider has no MCP support)"
|
|
352
325
|
else:
|
|
353
326
|
res["reason"] = "mcp: unsupported (provider %s)" % prov
|
|
354
327
|
print(dumps(res))
|
|
@@ -41,18 +41,15 @@ WALK_MAX_ENTRIES = 200000
|
|
|
41
41
|
|
|
42
42
|
# Provider CLI state the confined process must be able to write. Each entry was
|
|
43
43
|
# checked against a machine with the CLI installed (~/.claude, ~/.claude.json,
|
|
44
|
-
# ~/.
|
|
45
|
-
#
|
|
44
|
+
# ~/.config/opencode, ~/.local/share/opencode, ~/.cache/opencode). A trailing *
|
|
45
|
+
# is a prefix glob inside HOME.
|
|
46
46
|
PROVIDER_WRITE_PATHS: dict[str, tuple[str, ...]] = {
|
|
47
47
|
"claude": ("~/.claude", "~/.claude.json"),
|
|
48
|
-
"codex": ("~/.codex",),
|
|
49
48
|
"opencode": (
|
|
50
49
|
"~/.config/opencode",
|
|
51
50
|
"~/.local/share/opencode",
|
|
52
51
|
"~/.cache/opencode",
|
|
53
52
|
),
|
|
54
|
-
"cline": ("~/.cline",),
|
|
55
|
-
"aider": ("~/.aider*",),
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
INSTALL_HINT = {
|
|
@@ -67,7 +67,7 @@ EMPTY_TREE_SHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
|
|
|
67
67
|
# 9 receipts:
|
|
68
68
|
#
|
|
69
69
|
# 8 of 9 carry base_sha="" and head_sha=1385e71c. That commit touches TWO files
|
|
70
|
-
# (
|
|
70
|
+
# (a provider config and its test) while the receipts
|
|
71
71
|
# attest to EIGHT including autonomy/telemetry.sh. They are not the same change.
|
|
72
72
|
# The 9th carries base_sha=4b825dc6 (empty tree) and 4017 files.
|
|
73
73
|
#
|
|
@@ -561,7 +561,7 @@ _lpg_find_git_root() {
|
|
|
561
561
|
#
|
|
562
562
|
# Resolve the per-directory memory/conventions file for the layered doc walker.
|
|
563
563
|
# Prefers AGENTS.md (the agents.md standard: plain Markdown, nearest-file-wins,
|
|
564
|
-
# read natively by Claude Code/
|
|
564
|
+
# read natively by Claude Code/opencode/etc.) and falls back to CLAUDE.md only when
|
|
565
565
|
# AGENTS.md is absent in that directory. The two are never merged. The reader
|
|
566
566
|
# (_lpg_read_layer / _append_layer) is filename-agnostic, so this is the single
|
|
567
567
|
# point that decides which file each layer site reads.
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
Single implementation called by both routes:
|
|
5
5
|
- bash: autonomy/run.sh generate_proof_of_run() via python3
|
|
6
|
-
- Bun: loki-ts/src/runner/proof.ts via spawn
|
|
7
6
|
|
|
8
7
|
Assembles the frozen proof.json schema v1.0 from .loki/ state, runs the
|
|
9
8
|
redaction chokepoint exactly once, computes an integrity hash, and writes
|
|
@@ -341,7 +340,7 @@ def _test_results_fresh(quality_dir):
|
|
|
341
340
|
test-results.json together with .test-results.iter; they are this
|
|
342
341
|
iteration's evidence only when that marker holds this iteration's number.
|
|
343
342
|
Both loop callers always pass the iteration as ITERATION_COUNT (run.sh
|
|
344
|
-
generate_proof_of_run
|
|
343
|
+
generate_proof_of_run); a set but empty value is not
|
|
345
344
|
fresh.
|
|
346
345
|
ponytail: ITERATION_COUNT absent altogether means a hand run outside any
|
|
347
346
|
loop, with no iteration to compare against, so the pre-82 reading applies
|
|
@@ -14,13 +14,9 @@
|
|
|
14
14
|
# lets the normal build proceed -- it can only ADD a starting skeleton, never
|
|
15
15
|
# remove or overwrite existing code.
|
|
16
16
|
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
# only (not behavior-mirrored in the bun runner). Because it is DEFAULT-OFF, the
|
|
21
|
-
# bun default path is unaffected. When the bun runner (loki-ts autonomous.ts,
|
|
22
|
-
# currently a skeleton port) reaches run_autonomous behavior parity, it should
|
|
23
|
-
# mirror this opt-in gate.
|
|
17
|
+
# This is a bash-only ORCHESTRATION seam in run_autonomous, not part of
|
|
18
|
+
# build_prompt(). It follows the LOKI_SENTRUX_GATE precedent, which is likewise
|
|
19
|
+
# bash-orchestration only. It is DEFAULT-OFF.
|
|
24
20
|
|
|
25
21
|
# Is the target dir greenfield (no meaningful source yet)? Ignores .loki, .git,
|
|
26
22
|
# the PRD, and dotfiles. Echoes "yes"/"no".
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{ "id": "common", "title": "All paths", "summary": "Needed by every Loki command" },
|
|
6
6
|
{ "id": "claude-cli", "title": "Claude Code CLI path (default, loki start)", "summary": "Loki drives the claude binary you installed and logged in" },
|
|
7
7
|
{ "id": "api-key-sdk", "title": "Anthropic API-key path (Agent SDK, no claude CLI)", "summary": "loki \"<goal>\" runs on the bundled Agent SDK over HTTPS with only a key; no claude CLI and no extra setting" },
|
|
8
|
-
{ "id": "other-providers", "title": "
|
|
8
|
+
{ "id": "other-providers", "title": "opencode CLI (any model, including OpenRouter)", "summary": "opencode replaces the claude CLI; with OPENROUTER_API_KEY set it runs openrouter/<vendor>/<model> ids" }
|
|
9
9
|
],
|
|
10
10
|
"requirements": [
|
|
11
11
|
{ "id": "node", "path": "common", "level": "required", "kind": "command", "target": "node", "min": "20.0", "label": "Node.js 20 or newer", "fix": "install Node 20+ from https://nodejs.org" },
|
|
@@ -22,9 +22,6 @@
|
|
|
22
22
|
{ "id": "sdk-binary", "path": "api-key-sdk", "level": "required", "kind": "sdk_binary", "target": "@anthropic-ai/claude-agent-sdk", "label": "Claude Agent SDK platform binary (optional npm dependency)", "fix": "reinstall without --no-optional: npm install -g loki-mode (the SDK is an optionalDependency)" },
|
|
23
23
|
{ "id": "sdk-bun", "path": "api-key-sdk", "level": "required", "kind": "command", "target": "bun", "min": "1.3", "label": "Bun runtime (the SDK loop runs only on the Bun route)", "fix": "reinstall without --no-optional (npm bundles @oven/bun-*) or install from https://bun.sh" },
|
|
24
24
|
|
|
25
|
-
{ "id": "codex", "path": "other-providers", "level": "optional", "kind": "command", "target": "codex", "label": "codex CLI", "fix": "npm install -g @openai/codex" },
|
|
26
|
-
{ "id": "cline", "path": "other-providers", "level": "optional", "kind": "command", "target": "cline", "label": "cline CLI", "fix": "npm install -g cline" },
|
|
27
|
-
{ "id": "aider", "path": "other-providers", "level": "optional", "kind": "command", "target": "aider", "label": "aider CLI", "fix": "pip install aider-chat" },
|
|
28
25
|
{ "id": "opencode", "path": "other-providers", "level": "optional", "kind": "command", "target": "opencode", "label": "opencode CLI", "fix": "npm install -g opencode-ai" }
|
|
29
26
|
],
|
|
30
27
|
"missing_optional": [
|
|
@@ -150,7 +150,7 @@ loki_skill_link_heal() {
|
|
|
150
150
|
fi
|
|
151
151
|
run_v="$(head -n 1 "$root_p/VERSION" 2>/dev/null | tr -d '[:space:]')"
|
|
152
152
|
|
|
153
|
-
for rel in .claude
|
|
153
|
+
for rel in .claude; do
|
|
154
154
|
link="$home/$rel/skills/loki-mode"
|
|
155
155
|
[ -L "$link" ] || continue
|
|
156
156
|
tgt="$(readlink "$link" 2>/dev/null)" || continue
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"command": {"type": "enum", "values": ["--help", "--version", "-h", "-v", "agent", "analyze", "api", "assets", "audit", "bench", "checkpoint", "ci", "cleanup", "cluster", "cockpit", "code", "completion", "completions", "compliance", "compound", "config", "context", "control", "cost", "council", "cp", "crash", "ctx", "dashboard", "demo", "deploy", "docker", "docs", "doctor", "dogfood", "enterprise", "explain", "export", "factory", "failover", "github", "grill", "handoff", "heal", "help", "import", "init", "internal", "issue", "kpis", "logs", "magic", "mcp", "memory", "metrics", "migrate", "modernize", "monitor", "next", "notify", "onboard", "open", "optimize", "otel", "own", "pause", "plan", "preview", "projects", "proof", "provider", "quick", "quickstart", "rc", "receipt", "remote", "report", "reset", "resume", "review", "rollback", "run", "sandbox", "secrets", "secure", "self_update", "self-update", "sentrux", "serve", "setup-skill", "share", "ship", "spec", "start", "state", "stats", "status", "steer", "stop", "syslog", "telemetry", "template", "test", "tour", "trigger", "trust", "trust-metrics", "ultracode", "update", "verify", "version", "voice", "watch", "watchdog", "web", "welcome", "why", "wiki", "worktree", "wow", "wt", "other"]}
|
|
22
22
|
},
|
|
23
23
|
"session_start": {
|
|
24
|
-
"provider": {"type": "enum", "values": ["claude", "
|
|
24
|
+
"provider": {"type": "enum", "values": ["claude", "opencode"]},
|
|
25
25
|
"complexity": {"type": "enum", "values": ["simple", "standard", "complex"]},
|
|
26
26
|
"parallel": {"type": "bool"}
|
|
27
27
|
},
|
|
28
28
|
"session_end": {
|
|
29
|
-
"provider": {"type": "enum", "values": ["claude", "
|
|
29
|
+
"provider": {"type": "enum", "values": ["claude", "opencode"]},
|
|
30
30
|
"duration": {"type": "int", "min": 0, "max": 31536000},
|
|
31
31
|
"iterations": {"type": "int", "min": 0, "max": 100000},
|
|
32
32
|
"result": {"type": "int", "min": 0, "max": 255}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"duration_s": {"type": "int", "min": 0, "max": 31536000},
|
|
69
69
|
"fix_rounds": {"type": "int", "min": 0, "max": 1000},
|
|
70
70
|
"exit_code": {"type": "int", "min": 0, "max": 255},
|
|
71
|
-
"provider": {"type": "enum", "values": ["claude", "
|
|
71
|
+
"provider": {"type": "enum", "values": ["claude", "opencode", "other", "unknown"]},
|
|
72
72
|
"model_tier": {"type": "enum", "values": ["fast", "balanced", "deep", "mixed", "unknown"]},
|
|
73
73
|
"lang_bucket": {"type": "enum", "values": ["python", "javascript", "typescript", "go", "rust", "java", "ruby", "php", "csharp", "c_cpp", "shell", "other"]},
|
|
74
74
|
"repo_size_bucket": {"type": "enum", "values": ["xs", "s", "m", "l", "xl"]},
|
package/autonomy/lib/wiki_llm.py
CHANGED
|
@@ -4,7 +4,7 @@ Keeps every paid-call and grounding-guarantee concern in one place so the
|
|
|
4
4
|
generator and the ask script behave identically.
|
|
5
5
|
|
|
6
6
|
LLM stub contract (CI-safe, zero paid calls in tests):
|
|
7
|
-
LOKI_WIKI_LLM_STUB unset -> call the real provider (claude -p
|
|
7
|
+
LOKI_WIKI_LLM_STUB unset -> call the real provider (claude -p)
|
|
8
8
|
via the same mechanism loki docs uses; if no
|
|
9
9
|
provider is on PATH, return None (callers then
|
|
10
10
|
fall back to extractive/template output).
|
|
@@ -94,9 +94,6 @@ def invoke_llm(prompt, timeout=120, lean=False):
|
|
|
94
94
|
|
|
95
95
|
cmds = {
|
|
96
96
|
"claude": ["claude", "-p", prompt],
|
|
97
|
-
"codex": ["codex", "exec", "--sandbox", "workspace-write", prompt],
|
|
98
|
-
"cline": ["cline", "-y", prompt],
|
|
99
|
-
"aider": ["aider", "--message", prompt, "--yes-always", "--no-auto-commits"],
|
|
100
97
|
}
|
|
101
98
|
base = cmds.get(provider)
|
|
102
99
|
if base is None or not _which(base[0]):
|