Store the cli version for display and handle auto update

This commit is contained in:
Owen
2026-09-14 11:26:07 -04:00
parent 018ee17304
commit b6c048c805
11 changed files with 93 additions and 46 deletions
@@ -37,6 +37,8 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
publicKey,
pingResults,
newtVersion,
agent,
agentVersion,
backwardsCompatible,
chainId
} = message.data;
@@ -174,17 +176,12 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
await db
.update(newts)
.set({
version: newtVersion as string
})
.where(eq(newts.newtId, newt.newtId));
}
if (newtVersion && newtVersion !== newt.version) {
// update the newt version in the database
await db
.update(newts)
.set({
version: newtVersion as string
version: newtVersion as string,
agent: agent,
agentVersion:
!agentVersion && agent == "newt"
? newtVersion
: agentVersion
})
.where(eq(newts.newtId, newt.newtId));
}