Merge branch 'main' of git.arirex.me:iris/ai-app

This commit is contained in:
iris committed 2026-09-03 23:32:22 -04:00
commit 9fdab777b4
8 files changed
+1008 -46

No files matched your search

+33
View File
@@ -248,6 +248,39 @@ awk -v mb="$BIG_MB" 'BEGIN {
}
print "{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"usage\":{\"input_tokens\":180000,\"output_tokens\":900}}}"
}' > "$big"
# A tree for the file explorer, at the sandbox home's `~/files`, holding
# the states that are otherwise only reachable by finding a real machine
# in one of them. The default state is the one everybody looks at, so what
# is worth having here is the rest: an empty directory, names a shell would
# mangle, something that is not text, something too big to send, something
# nobody may read, a link that navigates, and one file per language so the
# highlighter is exercised rather than assumed.
FILES=$ROOT/home/files
mkdir -p "$FILES/empty" "$FILES/sub"
printf 'one\ntwo\nthree\n' >"$FILES/hello.txt"
# A real tab, via printf: `\t` inside double quotes is a backslash and a t,
# which is a different (and easier) name than the one worth testing.
tabbed=$(printf 'with\ta tab.txt')
printf 'a tab in the name\n' >"$FILES/$tabbed"
printf "an apostrophe in the name\n" >"$FILES/it's a file.txt"
printf 'fn main() {\n // a comment\n println!("hello, {}", 1_000);\n}\n' >"$FILES/main.rs"
printf 'fun main() {\n // a comment\n println("hello")\n}\n' >"$FILES/Main.kt"
printf 'def main():\n # a comment\n print("hello")\n' >"$FILES/main.py"
printf '#!/bin/sh\n# a comment\necho hello\n' >"$FILES/run.sh"
chmod +x "$FILES/run.sh"
printf '{"a": 1, "b": [true, null]}\n' >"$FILES/data.json"
# Not UTF-8, so it reads as binary rather than as mojibake.
printf '\377\376\000\001binary\n' >"$FILES/picture.bin"
# Over FILE_LIMIT (1 MiB), so the read refuses before anything transfers.
awk 'BEGIN { for (i = 0; i < 40000; i++) print "a line of a log that nobody is going to read" }' >"$FILES/big.log"
# Unreadable on purpose: a directory listing still shows it, and opening it
# fails with the machine's own words rather than with an empty file.
printf 'secret\n' >"$FILES/unreadable.txt"
chmod 000 "$FILES/unreadable.txt"
printf 'in a subdirectory\n' >"$FILES/sub/inside.txt"
ln -sfn sub "$FILES/link-to-sub"
ln -sfn nowhere "$FILES/broken-link"
fi
if [ -n "$regen_config" ]; then