Showing posts with label My Progs. Show all posts
Showing posts with label My Progs. Show all posts

Tuesday, July 28, 2026

Talos v1.0.0

 After using Gemini-cli at work, I thought I'd try some coding agent also for my personal projects. I don't trust running them locally on my computer for privacy reasons, so instead I thought I'd run the agent on a small VPS I rent, 1GB of RAM, 1 CPU core.

I quickly discovered that just installing OpenCode pretty much killed that VPS. Those Gemini-cli based agents full node.js applications, with a myriad different dependencies. I started looking for some lightweight agent but even the most lightweight I could find (pi.dev) still seemed too much for me.

So I made my own. I used a handwritten agent I was using locally in the past for some experimentation and changed it a bit to bootstrap rudimentary coding agent out of it. Then I used itself to continue developing it.

I named it after Talos, it's written in Lua as a single hackable .lua file and it targets Linux. I suggest you add your API key to it by editing the script (it's hardcoded in it), drop the script in your ~/bin directory (or anywhere in your path), copy it also in an empty directory, and then start Talos inside the empty directory and ask it to modify itself. Then use your favorite tool to review the changes it makes, for example I like using Meld to view the differences between the running version and the modified version and to accept them into the running version before restarting it. If you need help, drop a comment here.

To run it you need to install Lua and the following Lua modules which you should be able to find in your repositories: socket ssl cjson ltn12 lfs posix readline

Lfs may be called luafilesystem or something like that in your repos. Posix and readline are optional but strongly recommended. Ltn12 and ssl may be part of luasec. Socket is the usual luasocket.

You will also need to make sure you have the following commands available: sh, timeout, tar, zstd, diff, bwrap, stty

Bwrap is bubblewrap, which is a chunky one and the reason why Talos doesn't work on anything but Linux. It is used for sandboxing so it's likely the most important dependency.

Here is the help page of Talos which should explain also most of its features:

Talos - interactive LLM agent

=============================


Talos is a command-line AI agent. Type a message at the prompt and press Enter to talk to it. Talos can reason, hold a conversation, and act on your working directory by calling tools (reading/writing files, running shell commands, searching, and more). It remembers context across sessions.


GETTING STARTED

  - Just type and press Enter to send a message.

  - Press Enter on an empty line to quit.

  - For multiline input, start with Lua long-bracket syntax like [[, [=[, or [===[. Any number of equal signs is acceptable, as long as the closing marker matches: ]], ]=], or ]===]. The markers are stripped, and everything between them is sent as one message.

  - Start with an optional session name:  talos mysession

    Each named session keeps separate history and memory under .talos/session-<session_name>/. With no name, .talos/ is used.


WHAT TALOS CAN DO

  - Hold a conversation and answer questions.

  - Read, create, delete, search, and manipulate files in the working dir.

  - Run sandboxed shell commands, and unsandboxed shell commands with your approval.

  - Automatically resummarize the conversation if it grows too long, compressing messages into it's persistent memory.


SHELL COMMAND SAFETY

  Normal run_shell commands are sandboxed inside the working directory and have no network. Unsandboxed run_shell commands can access host paths/network and require per-command approval or exact pre-approval:

    y / yes         - run it once and show output to Talos

    n / no          - decline

    a / always      - run and pre-approve this exact command

    p / preview     - run it, show you the output, then ask whether Talos may see the output

    h / help        - explain the options

    :reason         - decline, and send reason to Talos

  Commands are killed if they run longer than 60 seconds.

PATH SAFETY

  All file tools are confined to the working directory. Absolute paths and paths that escape the directory (via ..) are rejected. Only unsandboxed shell commands should be able to escape the working directory, and those need your approval to run.


SLASH COMMANDS


General

  /help                 Show this guide.

  /test                 Run live API self-tests.

  /leaks                Print a sandbox leak report locally; the report is not sent to the model.


Backups

  /backup               Write a compressed tar archive to .talos/backups/. Backups include everything in your working directory, including Talos's state.

                        Talos also creates an automatic backup before conversation turns if the newest backup is over 30 minutes old.

  /backup list          List backups from oldest to newest.

  /backup prune         Delete half the backups while keeping the latest backup, then show total backup size.

  /backup restore N     Restore backup number N, after making a safety backup, then quit.

  /diff [N]             Show a unified diff between the current workspace and backup N, or the latest backup.


Sandbox mounts

  /mount list           List persistent sandbox mounts.

  /mount ro SRC DST     Mount host SRC read-only at sandbox DST.

  /mount rw SRC DST     Mount host SRC read-write at sandbox DST.

  /mount tmpfs DST      Mount temporary writable memory at sandbox DST.

  /mount remove N       Remove sandbox mount number N.


Skills

  /skill list           List configured skill search paths and discovered skills.

  /skill add PATH       Add a skill search path with symlinks blocked. Defaults are .agents/skills/ and ~/.agents/skills/.

  /skill addsl PATH     Add a trusted skill search path with symlinks allowed.

  /skill remove N       Remove configured skill search path number N.


Memory and history

  /summarize            Fold older messages into long-term memory now.

  /summarize all        Fold all messages into long-term memory now.

  /memory               Print the current long-term memory.

  /clear messages       Erase the conversation history.

  /clear memory         Erase the long-term memory.

  /clear cost           Reset the session's cost.

  /clear pre-approved   Erase pre-approved shell commands.

  /clear home           Erase the persistent sandbox home directory.

  /clear all            Erase messages, memory, cost, pre-approved commands, and sandbox home.


Transfer

  /upload PORT DIR      Open a temporary browser upload page on PORT that saves files under DIR; use the page's stop button to end the command.

  /download PORT FILE   Open a temporary browser download page on PORT that serves FILE; use the page's stop button to end the command.


COST

  Each session tracks its API cost, shown after responses and on startup.


You can download Talos from here. 

Sunday, August 10, 2025

Aperito v1.6.2

     Version 1.6.2 of Aperito fixes a duplicate paragraph in the documentation.

 The latest version can be downloaded from here, and the signature from here. Source code is included in the zipfile.

Sunday, June 22, 2025

grIP v1.3.2

   grIP version 1.3.2 fixes a bug: the scan no longer stops if a "host is down" error is encountered.

The latest version can be downloaded from here, and the signature from here.

Tuesday, June 17, 2025

grIP v1.3.1

  grIP version 1.3.1 has even better shuffling of the scan space, with even lower memory usage and escapes "[" and "]" as it should to avoid ambiguity in received data.

The latest version can be downloaded from here, and the signature from here.

Wednesday, November 13, 2024

Aperito v1.6.1

     Version 1.6.1 of Aperito fixes some typos in some error messages and makes Aperito recognize non-existing types of "keep" and properly fail for them, for example it will fail on "keep poop" but will not fail for "keep shallow" or "keep deep".

 The latest version can be downloaded from here, and the signature from here. Source code is included in the zipfile.

Wednesday, April 24, 2024

Voyager Manager v0.1

I've written around seven programs for my HP 12c. I've manually combined them into a big "multiprogram" which starts with a jump table: a bunch of GTO commands, each one jumping to the entry point of one of the actual programs. The reason for that is that the HP 12c has only one contiguous program area. Fortunately, the calculator allows you to manually execute a GTO command before pressing R/S to start the execution. But instead of having to remember the starting address of each program, I just put them on the GTO instructions on the jump table so I just need to manually do GTO 003 and press R/S to start the third program, because address 003 has the GTO to the starting point of the third program. 

But managing this multiprogram is very tedious. When a program is placed in a different starting address in memory, all the GTO targets of that program need to be updated and offset correctly to continue working. So I made a program called Voyager Manager that lets me compile any number of programs into one such multiprogram, taking care of the GTOs and the jump table automatically. It works for my programs but it's still a very early version. It comes with GNU/GPLv3 source code, Lua binaries for Windows included, and a library that includes my programs for the HP 12c to get you started.

You can download Voyager Manager from here.

Tuesday, January 2, 2024

Simple Lua benchmark

Start a Lua interpreter and paste the following in it:

l=os.time() m=0 c=0 while true do n=os.time() if n~=l then l=n m=math.max(m,c) print("Currently: "..c,math.floor(0.5+c*100/m).."% of maximum "..m) c=0 end c=c+1 end

It will show you the current cycles per second and what percentage of the maximum cycles per seconds it is since you started running it.

Wednesday, December 6, 2023

Aperito v1.6.0

     Version 1.6.0 of Aperito renames the compare command to compareboth. It also adds a lot more compare commands that print files fulfilling different combinations of seen and existing in the saved state file you are comparing too: comparefileonly, compareseenonly, comparediffonly. Compare now prints everything, even files that are both seen and in the state file.

 The latest version can be downloaded from here, and the signature from here. Source code is included in the zipfile.

Monday, November 20, 2023

Aperito v1.5.5

     Version 1.5.5 of Aperito allows the load command to read from pipes, opening the way on Linux to read from sets of files at once using the <(cat *.asd) construction. It also fixes a few mistakes in the help page.

 The latest version can be downloaded from here, and the signature from here. Source code is included in the zipfile.

Monday, April 17, 2023

Aperito v1.5.4

     Version 1.5.4 of Aperito fixes some potential multi-threading issues.

 The latest version can be downloaded from here, and the signature from here. Source code is included in the zipfile.

Wednesday, February 22, 2023

Failure track analysis

The Delve expansion for Ironsworn describes an optional mechanic that rewards players for their rolls that result in a miss. Every time they miss, they add 1 tick (or 3 ticks if the roll was a progress roll, but I'll completely ignore these for this analysis) to a failure track. Every 4 ticks constitute a full mark and the failure track can have up to 10 marks. Once the track has 6 marks (in other words after 24 miss-rolls) the player can choose to "learn from their mistakes". This move is resolved by a roll and resets the fail track to zero ticks again. The resolution is a simple progress roll against the fail track where a strong hit awards 3 XP, a weak hit awards 2XP and a fail rewards 1XP. Additionally a strong hit will let the player discard an asset for more XP (which I will ignore for this analysis) and a weak hit will narratively force the player to learn the wrong lesson from their failures which is in my opinion a hefty penalty if role-played correctly.

I did a small analysis of the 5 different points when a player can trigger the "learn from your mistakes" move:

Learn from your mistakes when you have this many marksMiss-rolls to gain 1XPMiss-rolls to have to learn the wrong lesson
61296
712.73175
813.33355.6
913.85900
1014.294000

Triggering the "learn from your mistakes" move as frequently as possible gives more XP overall but the difference is minor: less than 20% extra XP compared to waiting for a full failure trackbefore you trigger. At the same time frequent triggers will result in a 4066% increase in how often you'll be learning the wrong lesson compared to waiting for a full failure track before triggering!

If someone wants to verify the code that produced the above table, I wrote it on a casio fx-3650P II just for fun so I can't exactly upload the code but here's a rough dump:

For 6->M To 10:
0->X:
0->Y:
1->A:
Lbl 1:
1->B:
Lbl 2:
(M>A)+(M>B)+1+X->X:
(M<=A)+(M<=B)=2=>Y+1->Y:
B+1->B:
B<=10=>Goto 2:
A+1->A:
A<=10=>Goto 1:
M[output triangle symbol]
M*400/X[output triangle symbol]
M*400*Y[output triangle symbol]
Next

Wednesday, January 25, 2023

Aperito v1.5.3

    Version 1.5.3 of Aperito doesn't show the message about applying permissions to directories when there are none to apply. It also stops affecting the modification times of directories in the source tree (those would change as files were moved out of them). A bug that could stop read-only files from being moved has been fixed as well as a potential crash when "keep shallow" was used and a few bugs regarding the preservation of mofication times in directories on the target tree were squashed. Finally the copy commands will no longer overwrite files in the target directory, not even if you use the nonstop command because that's not what nonstop is supposed to be doing. Finally Aperito now has an end2end test suit (mind you, I have not yet tested the test framework on anything but Linux) which I'll keep expanding to see if I've missed any cases. Upgrading is highly recommended.

 The latest version can be downloaded from here, and the signature from here. Source code is included in the zipfile.

Wednesday, January 18, 2023

Aperito v1.5.2

   Version 1.5.2 of Aperito fixes a problem I encountered when it had to copy or move files into a write protected directory. Directory permissions are now applied at the end of the process, after all files have been copied or moved.

 The latest version can be downloaded from here, and the signature from here. Source code included in the zipfile.

Thursday, January 5, 2023

Aperito v1.5.1

  Version 1.5.1 of Aperito has some more examples in its help and is open source for the first time under GNU GPLv3. The source code and my build script is in the zipfile.

 The latest version can be downloaded from here, and the signature from here.

Wednesday, December 21, 2022

Aperito v1.5

 Version 1.5 of Aperito adds the "onlybefore" and "onlyafter" commands which take either a Unix timestamp or a relative interval like 1d (1 day), 5h (5 hours) or 32m (32 minutes) and scan the files that were modified before or after that timestamp. They can be, of course, combined to scan specific time ranges. I needed this to use scancopynew to backup new files from my user directory without re-hashing all my files every time.


 The latest version can be downloaded from here, and the signature from here.

Wednesday, November 23, 2022

Ironsworn roll probabilities

Each plot is for a different momentum value, horizontal is your total "adds" (including the stat) for your roll.



















Here is the spreadsheet that these came from. And here is the code that generated the count tables for each spreadsheet page (change the momentum variable before you run it).

Thursday, August 4, 2022

Aperito v1.4

I had avoided adding an "include" command (to complement he "exclude" command) because I thought that we could include specific files by using negative lookaheads in the regex. Turns out Go doesn't support those so version 1.4 adds an "include" command to scan only files that match a regex.


 The latest version can be downloaded from here, and the signature from here.

Sunday, July 31, 2022

Aperito v1.3.4

I fixed a few inaccurate progress messages, added an example for the "scancopynew" command and made dry-run affect the "save" command too.


 The latest version can be downloaded from here, and the signature from here.

Tuesday, July 12, 2022

Aperito v1.3.3

I fixed an old bug that would cause Aperito to try to change the permissions of one directory above the "*-Aperito-dupicates" directory when deduplicating a file inside that directory.


 The latest version can be downloaded from here, and the signature from here.

Thursday, June 16, 2022

grIP v1.2

 grIP version 1.2 has much improved shuffling of the scan space.

The latest version can be downloaded from here, and the signature from here.

Popular Posts