Files
luxe/crates/luxe-remote/app-tests/notifications.test.mjs
Evan Whittaker d2129a886f Luxe 0.1.3: your sessions on your phone, joinable sessions, and nested AGENTS.md
- luxe remote puts the sessions on your computer in reach of your own phone or tablet over
  Tailscale: write, steer, answer prompts, send photos, browse files, diffs and GitHub, with a
  paired device and your own Tailscale login.
- luxe join lets another program on the same machine join a running session over the RPC protocol.
- An AGENTS.md in a subfolder reaches the model the first time it works there.
- Long sessions stay fast: no stall before each model call, lighter memory, cheaper drawing.
- A session is open in one Luxe at a time, web_search shares results across its phrasings, and a
  grep glob starting with ! excludes.

The CHANGELOG has the full list.
2026-10-20 02:40:13 -05:00

24 lines
1.3 KiB
JavaScript

import { test } from "node:test";
import assert from "node:assert/strict";
import { keyBytes, support } from "../app/notifications.js";
// The break this catches: the switch offered where subscribing can only fail, or a Safari tab on
// iOS told notifications are impossible when the Home Screen is the way to them.
test("what the switch offers follows what the browser can do", () => {
assert.equal(support({ worker: true, push: true, standalone: false }), "ready");
assert.equal(support({ worker: true, push: true, standalone: true }), "ready");
assert.equal(support({ worker: true, push: false, standalone: false }), "home-screen");
assert.equal(support({ worker: false, push: true, standalone: false }), "home-screen");
assert.equal(support({ worker: true, push: false, standalone: true }), "unsupported");
});
// The break this catches: the key passed as base64url text or decoded as plain base64, which
// PushManager refuses, so turning notifications on fails on every device.
test("the bridge's key reaches the browser as bytes", () => {
assert.deepEqual([...keyBytes("AQID_-8")], [1, 2, 3, 255, 239]);
const key = "BCVxsr7N_eNgVRqvHtD0zTZsEc6-VV-JvLexhqUzORcxaOzi6-AYWXvTBHm4bjyPjs7Vd8pZGH6SRpkNtoIAiw4";
const bytes = keyBytes(key);
assert.equal(bytes.length, 65);
assert.equal(bytes[0], 4, "an uncompressed point");
});