Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

846 B
Raw Blame
import assert from 'node:assert/strict'
import { test } from 'node:test'
import { checkVersions, isBelow, parseVersion } from './compat.ts'

test('versions parse like the host and the iPhone app', () => {
  assert.deepEqual(parseVersion('v2.6'), [2, 6, 0])
  assert.deepEqual(parseVersion('2.6.3-beta+1'), [2, 6, 3])
  assert.equal(parseVersion('2.x'), null)
  assert.equal(isBelow('2.6.3', '2.7.0'), true)
  assert.equal(isBelow('2.10.0', '2.9.9'), false)
  assert.equal(isBelow('garbage', '9.9.9'), false)
})

test('the side that must update', () => {
  assert.deepEqual(checkVersions('2.6.0', '2.7.0', '2.7.0'), { kind: 'updateApp', minimum: '2.7.0' })
  assert.deepEqual(checkVersions('2.26.0', '2.25.9', null), { kind: 'updateHost', version: '2.25.9', minimum: '2.26.0' })
  assert.equal(checkVersions('2.26.0', '2.26.0', '2.3.0'), null)
})