From 6e4a65579c3ade76feea0890072099f0d0caf416 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 28 Aug 2023 21:05:25 -0400 Subject: Prototype Mynion This implements a prototype Mynion, my chatbot which will eventually help me write code here. In fact he's already helping me, and works pretty well over xmpp. The prompt is currently not checked in because I'm experimenting with it a lot, and it should probably be a runtime parameter anyways. In the course of writing this I added some helper libraries to get me going, configured black (didn't even know that was possible), and added 'outlines' and its dependencies even though I didn't end up using it. I'll keep outlines around for now, but I'm not sure how useful it really is because afaict its just pre-defining some stop conditions. But it took a while to get it working so I'll just keep it in for now. --- Biz/Ide/repl | 6 +++++- Biz/Ide/tidy | 2 ++ Biz/Ide/tips | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 Biz/Ide/tidy (limited to 'Biz/Ide') diff --git a/Biz/Ide/repl b/Biz/Ide/repl index 1d94e47..1401218 100755 --- a/Biz/Ide/repl +++ b/Biz/Ide/repl @@ -30,6 +30,7 @@ fi sysdeps=$(jq --raw-output '.[].sysdeps | join(" ")' <<< $json) exts=$(jq --raw-output '.[].namespace.ext' <<< $json | sort | uniq) packageSet=$(jq --raw-output '.[].packageSet' <<< $json) + module=$(jq --raw-output '.[].mainModule' <<< $json) BILD="(import ${BIZ_ROOT:?}/Biz/Bild.nix {})" for lib in ${sysdeps[@]}; do flags+=(--packages "$BILD.pkgs.${lib}") @@ -64,8 +65,11 @@ fi ;; Py) langdeps="$langdeps mypy" + flags+=(--packages ruff) flags+=(--packages "$BILD.bild.python.pythonWith (p: with p; [$langdeps])") - command=${CMD:-"python -i $targets"} + PYTHONPATH=$BIZ_ROOT:$PYTHONPATH + pycommand="python -i $BIZ_ROOT/Biz/Repl.py $module ${targets[@]}" + command=${CMD:-"$pycommand"} ;; *) echo "unsupported targets: ${targets[@]}" diff --git a/Biz/Ide/tidy b/Biz/Ide/tidy new file mode 100755 index 0000000..edea828 --- /dev/null +++ b/Biz/Ide/tidy @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +rm -f $BIZ_ROOT/_/bin/* diff --git a/Biz/Ide/tips b/Biz/Ide/tips index 1b998e6..21808eb 100755 --- a/Biz/Ide/tips +++ b/Biz/Ide/tips @@ -9,4 +9,5 @@ echo " tips show this message" echo " lint auto-lint all changed files" echo " push send a namespace to the cloud" echo " ship lint, bild, and push one (or all) namespace(s)" +echo " tidy cleanup common working files" echo "" -- cgit v1.2.3