From 4e69b8ef776541de4aa7fe03750952bff3a544ab Mon Sep 17 00:00:00 2001 From: Alois Date: Sat, 4 Jul 2026 20:26:51 +0200 Subject: [PATCH] (feat): small error screen improvement (feat): use correct type maps (fix): remove sudo from nix flake (wip): migrate ttp to mtp --- apps/web/src/index.tsx | 2 +- flake.nix | 1 - package.json | 6 +- packages/mtp/package.json | 1 + packages/mtp/src/context.tsx | 207 +++++++++++++++++------- pnpm-lock.yaml | 127 ++++++++------- pnpm-workspace.yaml | 4 +- type-maps.yaml | 300 +++++++++++++++++++++++++++-------- 8 files changed, 462 insertions(+), 186 deletions(-) diff --git a/apps/web/src/index.tsx b/apps/web/src/index.tsx index 0a35819..02ec8c2 100644 --- a/apps/web/src/index.tsx +++ b/apps/web/src/index.tsx @@ -284,7 +284,7 @@ const rootRoute = createRootRoute({ errorComponent: ({ error }: { error: Error }) => ( ), }); diff --git a/flake.nix b/flake.nix index 1a05922..d6ad8d1 100644 --- a/flake.nix +++ b/flake.nix @@ -228,7 +228,6 @@ dpkg rpm fpm - sudo curl fakeroot rsync diff --git a/package.json b/package.json index dc4edca..3765f87 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", - "@types/node": "^25.6.0", + "@types/node": "^26.1.0", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@typescript-eslint/parser": "^8.59.1", @@ -45,10 +45,6 @@ "vitest": "^4.0.8", "yaml": "^2.8.2" }, - "overrides": { - "@tensamin/ui": "https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz", - "mtp": "https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz" - }, "dependencies": { "@tensamin/ui": "*", "mtp": "*", diff --git a/packages/mtp/package.json b/packages/mtp/package.json index 4d6aa3f..3cf7c86 100644 --- a/packages/mtp/package.json +++ b/packages/mtp/package.json @@ -17,6 +17,7 @@ "@tensamin/shared": "workspace:*", "@tensamin/storage": "workspace:*", "@tensamin/ui": "*", + "lucide-react": "^1.14.0", "mtp": "*", "react": "^19.2.0", "react-dom": "^19.2.0", diff --git a/packages/mtp/src/context.tsx b/packages/mtp/src/context.tsx index ed2e57d..37eb314 100644 --- a/packages/mtp/src/context.tsx +++ b/packages/mtp/src/context.tsx @@ -10,11 +10,14 @@ import { } from "react"; import { isTauri } from "@tauri-apps/api/core"; import { onResume } from "tauri-plugin-app-events-api"; -import { ConnectionState, MTPClient, codec } from "mtp"; +import { MTPClient } from "mtp"; import { type z } from "zod"; +import { ConnectionState } from "./values"; import createAsyncQueue, { createQueuedFunc, } from "@tensamin/shared/asyncQueue"; +import { toast as sonnerToast } from "@tensamin/ui"; +import { Loader2 } from "lucide-react"; import { type Calls, @@ -23,7 +26,7 @@ import { mtp as schemas, type MTP as Schemas, } from "@tensamin/shared/data"; -import { log, toast } from "@tensamin/shared/log"; +import { log } from "@tensamin/shared/log"; import { useStorage } from "@tensamin/storage/context"; import { @@ -33,6 +36,17 @@ import { RETRY_INTERVAL, } from "./values"; +function base64ToUint8Array(b64: string) { + const bin = atob(b64); + const out = new Uint8Array(bin.length); + + for (let i = 0; i < bin.length; i++) { + out[i] = bin.charCodeAt(i); + } + + return out; +} + const PUSH_TYPES = [ "message_live", "message_state", @@ -235,11 +249,13 @@ export function Provider(props: { return subscribe("error_no_iota", () => { setIdentified(false); setIdentifying(false); - toast( - "error", - "We couldn't reach your Iota", - "Check your network connection and try restarting your Iota", - ); + sonnerToast.error("We couldn't reach your Iota", { + description: + "Check your network connection and try restarting your Iota", + icon: null, + duration: Infinity, + closeButton: true, + }); }); }, [connected, subscribe]); @@ -293,39 +309,37 @@ export function Provider(props: { reconnectResetTimer = null; }; - const scheduleReconnectReset = () => { - clearReconnectResetTimer(); - reconnectResetTimer = setTimeout(() => { - attempts = 0; - reconnectResetTimer = null; - }, RECONNECT_RESET * 1_000); - }; + let resolveConnection: (() => void) | null = null; - const scheduleReconnect = (reason?: unknown) => { - if (disposed || reconnectScheduled) return; - - if (attempts >= RECONNECT_TRIES) { - toast( - "error", - "Connection Failed", - "Unable to connect to the Omikron after multiple attempts. Cehck your network connection.", - ); - log(0, "mtp", "red", "Reconnection attempts exhausted", reason); - return; - } - - attempts += 1; - reconnectScheduled = true; - reconnectTimer = setTimeout(() => { - reconnectScheduled = false; - reconnectTimer = null; - void connect(); - }, RETRY_INTERVAL); - }; + if (!props.blockConnection) { + sonnerToast.promise( + new Promise((resolve) => { + resolveConnection = resolve; + }), + { + id: "mtp-connection-toast", + loading: "Connecting to server...", + icon: ( +
+ +
+ ), + duration: Infinity, + }, + ); + } async function connect() { if (disposed || props.blockConnection) return; + const cleanup = () => { + clientRef.current?.disconnect(); + clientRef.current = null; + clearReconnectResetTimer(); + setReadyState(ConnectionState.Disconnected); + setIdentified(false); + setIdentifying(false); + }; try { setIdentified(false); setIdentifying(false); @@ -333,16 +347,60 @@ export function Provider(props: { await MTPClient.init(); log(2, "mtp", "purple", "Fetching Omikron data."); - const omikronData = await fetch( + const data = await fetch( `${mtpUrl}api/get/omikron/${await load("user_id")}`, - ).then(async (res) => - codec.decode(new Uint8Array(await res.arrayBuffer())), ); - console.log(omikronData); + if (data.status === 404) { + sonnerToast.error("We couldn't reach your Iota", { + description: + "Check your network connection and try restarting your Iota", + icon: null, + duration: Infinity, + closeButton: true, + }); + resolveConnection?.(); + cleanup(); + return; + } + + const omikronData = (await data.json()) as { + id: number; + ip_address: string; + port: number; + public_key: string; + status: string; + }; + //codec.decode(new Uint8Array(await res.arrayBuffer())), + + if ( + !omikronData.ip_address || + !omikronData.port || + !omikronData.public_key + ) + throw new Error("Invalid Omikron data"); + + const url = `https://${omikronData.ip_address}:${omikronData.port}`; + + log(2, "mtp", "green", "Connecting to: " + url); const client = await MTPClient.create({ - url: mtpUrl ?? "", + url, + storage: { + getItem: (key) => { + console.log(key); + return key; + }, + removeItem: (key) => { + console.log(key); + }, + setItem: console.log, + }, + credentials: { + clientId: await load("user_id"), + keyring: base64ToUint8Array(await load("private_key")), + }, + hostPublicKey: omikronData.public_key, descriptor: "client", pings: true, logger: (event) => { @@ -352,13 +410,15 @@ export function Provider(props: { ); } - log( - 2, - "mtp", - event.type === "state" ? "cyan" : "blue", - event.type === "state" ? event.data : event.type, - event, - ); + if (event.type !== "Pong") { + log( + 2, + "mtp", + event.type === "state" ? "cyan" : "blue", + event.type === "state" ? event.data : event.type, + event, + ); + } }, }); @@ -391,7 +451,14 @@ export function Provider(props: { ); clearReconnectTimer(); - scheduleReconnectReset(); + + // Schedule reconnect reset + clearReconnectResetTimer(); + reconnectResetTimer = setTimeout(() => { + attempts = 0; + reconnectResetTimer = null; + }, RECONNECT_RESET * 1_000); + setReadyState(client.state); setIdentifying(true); @@ -405,15 +472,10 @@ export function Provider(props: { setFreshCalls(finalResponse.data.calls); setIdentifying(false); setIdentified(true); + resolveConnection?.(); } catch (connectError) { if (disposed) return; - - clientRef.current?.disconnect(); - clientRef.current = null; - clearReconnectResetTimer(); - setReadyState(ConnectionState.Disconnected); - setIdentified(false); - setIdentifying(false); + cleanup(); log( 0, "mtp", @@ -421,7 +483,39 @@ export function Provider(props: { "Connection/authentication attempt failed", getProtocolErrorDetails(connectError) ?? connectError, ); - scheduleReconnect(connectError); + + // Schedule reconnect + if (disposed || reconnectScheduled) return; + if (attempts >= RECONNECT_TRIES) { + log(0, "mtp", "red", "Reconnection attempts exhausted", connectError); + sonnerToast.error("Connection failed", { + id: "mtp-connection-toast", + description: + connectError instanceof Error + ? connectError.message + : String(connectError ?? "Unknown error"), + icon: null, + duration: Infinity, + closeButton: true, + promise: null, + } as unknown as Parameters[1]); + return; + } + + attempts += 1; + + // Show loading toast + sonnerToast.loading( + `Reconnecting to server... (attempt ${attempts} of ${RECONNECT_TRIES})`, + { id: "mtp-connection-toast" }, + ); + + reconnectScheduled = true; + reconnectTimer = setTimeout(() => { + reconnectScheduled = false; + reconnectTimer = null; + void connect(); + }, RETRY_INTERVAL); } } @@ -460,6 +554,7 @@ export function Provider(props: { setReadyState(ConnectionState.Disconnected); setIdentified(false); setIdentifying(false); + sonnerToast.dismiss("mtp-connection-toast"); }; }, [mtpUrl, props.blockConnection, load]); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9bced19..0f9796e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,19 +5,19 @@ settings: excludeLinksFromLockfile: false overrides: - '@tensamin/ui': https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - mtp: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz + '@tensamin/ui': https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + mtp: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz importers: .: dependencies: '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) mtp: - specifier: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz - version: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz + specifier: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz + version: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz sonner: specifier: ^2.0.7 version: 2.0.7(react-dom@19.2.7(react@19.2.7))(react@19.2.7) @@ -26,8 +26,8 @@ importers: specifier: ^10.0.1 version: 10.0.1(eslint@10.6.0(jiti@2.7.0)) '@types/node': - specifier: ^25.6.0 - version: 25.9.4 + specifier: ^26.1.0 + version: 26.1.0 '@types/react': specifier: ^19.2.14 version: 19.2.17 @@ -63,7 +63,7 @@ importers: version: 8.62.1(eslint@10.6.0(jiti@2.7.0))(typescript@6.0.3) vitest: specifier: ^4.0.8 - version: 4.1.9(@types/node@25.9.4)(vite@8.1.3(@types/node@25.9.4)(jiti@2.7.0)(yaml@2.9.0)) + version: 4.1.9(@types/node@26.1.0)(vite@8.1.3(@types/node@26.1.0)(jiti@2.7.0)(yaml@2.9.0)) yaml: specifier: ^2.8.2 version: 2.9.0 @@ -107,8 +107,8 @@ importers: specifier: workspace:* version: link:../../packages/shared '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) react: specifier: ^19.2.0 version: 19.2.7 @@ -205,7 +205,7 @@ importers: version: 2.12.0(react-redux@9.3.0(@types/react@19.2.17)(react@19.2.7))(react@19.2.7) '@tailwindcss/vite': specifier: ^4.2.4 - version: 4.3.2(vite@8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0)) + version: 4.3.2(vite@8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0)) '@tanstack/devtools-event-client': specifier: ^0.3.0 version: 0.3.5 @@ -267,8 +267,8 @@ importers: specifier: workspace:* version: link:../../packages/tauth '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) '@tensamin/user': specifier: workspace:* version: link:../../packages/user @@ -479,7 +479,7 @@ importers: version: 19.2.3(@types/react@19.2.17) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.3(vite@8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0)) + version: 6.0.3(vite@8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0)) esbuild: specifier: ^0.25.11 version: 0.25.12 @@ -497,7 +497,7 @@ importers: version: 8.62.1(eslint@10.6.0(jiti@2.7.0))(typescript@6.0.3) vite: specifier: ^8.0.10 - version: 8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) + version: 8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) packages/call: dependencies: @@ -523,8 +523,8 @@ importers: specifier: workspace:* version: link:../storage '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) '@tensamin/user': specifier: workspace:* version: link:../user @@ -583,8 +583,8 @@ importers: specifier: workspace:* version: link:../storage '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) '@tensamin/user': specifier: workspace:* version: link:../user @@ -655,11 +655,14 @@ importers: specifier: workspace:* version: link:../storage '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + lucide-react: + specifier: ^1.14.0 + version: 1.23.0(react@19.2.7) mtp: - specifier: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz - version: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz + specifier: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz + version: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz react: specifier: ^19.2.0 version: 19.2.7 @@ -701,8 +704,8 @@ importers: specifier: workspace:* version: link:../storage '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) '@tensamin/user': specifier: workspace:* version: link:../user @@ -722,8 +725,8 @@ importers: packages/shared: dependencies: '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) lucide-react: specifier: ^1.14.0 version: 1.23.0(react@19.2.7) @@ -746,8 +749,8 @@ importers: specifier: workspace:* version: link:../shared '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) react: specifier: ^19.2.0 version: 19.2.7 @@ -779,8 +782,8 @@ importers: specifier: workspace:* version: link:../../apps/tauri '@tensamin/ui': - specifier: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz - version: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) + specifier: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz + version: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3) '@tensamin/user': specifier: workspace:* version: link:../user @@ -2041,9 +2044,9 @@ packages: '@tauri-apps/plugin-notification@2.3.3': resolution: {integrity: sha512-Zw+ZH18RJb41G4NrfHgIuofJiymusqN+q8fGUIIV7vyCH+5sSn5coqRv/MWB9qETsUs97vmU045q7OyseCV3Qg==} - '@tensamin/ui@https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz': - resolution: {integrity: sha512-tOvNNwGWnj/LJCXHIUtN+uZG2VoRUGZXuVAoHP18OypgsmlSbx2iQNhkLF1t1qnIboVf5V5mvraVGLXtz4csgQ==, tarball: https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz} - version: 0.0.39 + '@tensamin/ui@https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz': + resolution: {integrity: sha512-xyzw3/XAYKczV1cYQ2QuzhFzFYbU9U2U/gi/TMU/U7MC0vp1xHCVssTcB1kot8yk9YEIEcDBK2X49Ftzj6bJeQ==, tarball: https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz} + version: 0.0.40 peerDependencies: react: ^19.2.7 react-dom: ^19.2.7 @@ -2123,6 +2126,9 @@ packages: '@types/node@25.9.4': resolution: {integrity: sha512-dszCsrKb5U7ZsVZBWiHFklTloVl0mSEnWH/iZXfZUlI4rzCUnsvGmgqfuVRHL54ugE7/wRuxEIXRa2iMZ+BG6g==} + '@types/node@26.1.0': + resolution: {integrity: sha512-O0A1G3xPGy4w7AgQdAQYUlQ+BKk2Oovw8eRpofyp5KdBZULnbe+WqaOVNrm705SHphCiG4XHsACrSmPu1f+Kgw==} + '@types/qrcode@1.5.6': resolution: {integrity: sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==} @@ -3746,8 +3752,8 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - mtp@https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz: - resolution: {integrity: sha512-/MNGev6VRL60hg8I0+TYD0E9QqgbQPT5LCJOzEIuqKzdAMS76LbLpVzq4sA5KCrCkgHVWTUeroafXHVxFCEgUA==, tarball: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz} + mtp@https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz: + resolution: {integrity: sha512-ixykS56llG6Azoxn4ff2v83LlrkCsd/s5wXmEUsxGtM63v8cYvX/HXh1AmWfJeaL0QZiGw1QyyOC0vplXZjwVg==, tarball: https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz} version: 0.1.0 nanoid@3.3.15: @@ -4556,6 +4562,9 @@ packages: undici-types@7.24.6: resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} + undici-types@8.3.0: + resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} + undici@6.27.0: resolution: {integrity: sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==} engines: {node: '>=18.17'} @@ -5946,12 +5955,12 @@ snapshots: '@tailwindcss/oxide-win32-arm64-msvc': 4.3.2 '@tailwindcss/oxide-win32-x64-msvc': 4.3.2 - '@tailwindcss/vite@4.3.2(vite@8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0))': + '@tailwindcss/vite@4.3.2(vite@8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0))': dependencies: '@tailwindcss/node': 4.3.2 '@tailwindcss/oxide': 4.3.2 tailwindcss: 4.3.2 - vite: 8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) + vite: 8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) '@tanstack/devtools-event-client@0.3.5': {} @@ -6071,7 +6080,7 @@ snapshots: dependencies: '@tauri-apps/api': 2.11.1 - '@tensamin/ui@https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3)': + '@tensamin/ui@https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz(@date-fns/tz@1.5.0)(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react-is@19.2.7)(react@19.2.7)(redux@5.0.1)(typescript@6.0.3)': dependencies: '@base-ui/react': 1.6.0(@date-fns/tz@1.5.0)(@types/react@19.2.17)(date-fns@4.4.0)(react-dom@19.2.7(react@19.2.7))(react@19.2.7) '@fontsource-variable/inter': 5.2.8 @@ -6166,7 +6175,7 @@ snapshots: '@types/fs-extra@9.0.13': dependencies: - '@types/node': 25.9.4 + '@types/node': 26.1.0 '@types/http-cache-semantics@4.2.0': {} @@ -6186,9 +6195,13 @@ snapshots: dependencies: undici-types: 7.24.6 + '@types/node@26.1.0': + dependencies: + undici-types: 8.3.0 + '@types/qrcode@1.5.6': dependencies: - '@types/node': 25.9.4 + '@types/node': 26.1.0 '@types/react-dom@19.2.3(@types/react@19.2.17)': dependencies: @@ -6302,10 +6315,10 @@ snapshots: '@typescript-eslint/types': 8.62.1 eslint-visitor-keys: 5.0.1 - '@vitejs/plugin-react@6.0.3(vite@8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0))': + '@vitejs/plugin-react@6.0.3(vite@8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0))': dependencies: '@rolldown/pluginutils': 1.0.1 - vite: 8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) + vite: 8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) '@vitest/expect@4.1.9': dependencies: @@ -6316,13 +6329,13 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.1.0 - '@vitest/mocker@4.1.9(vite@8.1.3(@types/node@25.9.4)(jiti@2.7.0)(yaml@2.9.0))': + '@vitest/mocker@4.1.9(vite@8.1.3(@types/node@26.1.0)(jiti@2.7.0)(yaml@2.9.0))': dependencies: '@vitest/spy': 4.1.9 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) + vite: 8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) '@vitest/pretty-format@4.1.9': dependencies: @@ -7866,7 +7879,7 @@ snapshots: ms@2.1.3: {} - mtp@https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz: {} + mtp@https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz: {} nanoid@3.3.15: {} @@ -7881,11 +7894,11 @@ snapshots: node-abi@4.33.0: dependencies: - semver: 7.7.4 + semver: 7.8.5 node-api-version@0.2.1: dependencies: - semver: 7.7.4 + semver: 7.8.5 node-gyp@12.4.0: dependencies: @@ -7894,7 +7907,7 @@ snapshots: graceful-fs: 4.2.11 nopt: 9.0.0 proc-log: 6.1.0 - semver: 7.7.4 + semver: 7.8.5 tar: 7.5.19 tinyglobby: 0.2.17 undici: 6.27.0 @@ -8702,6 +8715,8 @@ snapshots: undici-types@7.24.6: {} + undici-types@8.3.0: {} + undici@6.27.0: {} undici@7.28.0: {} @@ -8790,7 +8805,7 @@ snapshots: d3-time: 3.1.0 d3-timer: 3.0.1 - vite@8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0): + vite@8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0): dependencies: lightningcss: 1.32.0 picomatch: 4.0.5 @@ -8798,16 +8813,16 @@ snapshots: rolldown: 1.1.4 tinyglobby: 0.2.17 optionalDependencies: - '@types/node': 25.9.4 + '@types/node': 26.1.0 esbuild: 0.25.12 fsevents: 2.3.3 jiti: 2.7.0 yaml: 2.9.0 - vitest@4.1.9(@types/node@25.9.4)(vite@8.1.3(@types/node@25.9.4)(jiti@2.7.0)(yaml@2.9.0)): + vitest@4.1.9(@types/node@26.1.0)(vite@8.1.3(@types/node@26.1.0)(jiti@2.7.0)(yaml@2.9.0)): dependencies: '@vitest/expect': 4.1.9 - '@vitest/mocker': 4.1.9(vite@8.1.3(@types/node@25.9.4)(jiti@2.7.0)(yaml@2.9.0)) + '@vitest/mocker': 4.1.9(vite@8.1.3(@types/node@26.1.0)(jiti@2.7.0)(yaml@2.9.0)) '@vitest/pretty-format': 4.1.9 '@vitest/runner': 4.1.9 '@vitest/snapshot': 4.1.9 @@ -8824,10 +8839,10 @@ snapshots: tinyexec: 1.2.4 tinyglobby: 0.2.17 tinyrainbow: 3.1.0 - vite: 8.1.3(@types/node@25.9.4)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) + vite: 8.1.3(@types/node@26.1.0)(esbuild@0.25.12)(jiti@2.7.0)(yaml@2.9.0) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 25.9.4 + '@types/node': 26.1.0 transitivePeerDependencies: - msw diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3c697b7..e9940f7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -6,5 +6,5 @@ allowBuilds: electron-winstaller: true esbuild: true overrides: - "@tensamin/ui": "https://git.methanium.net/tensamin/ui/releases/download/latest/tensamin-ui.tgz" - mtp: "https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-8dc8b54/mtp-0.1.0.tgz" + "@tensamin/ui": "https://git.methanium.net/tensamin/ui/releases/download/0.0.40/tensamin-ui.tgz" + mtp: "https://git.methanium.net/methanium/mtp/releases/download/0.1.0-dev-2e7c0b4/mtp-0.1.0.tgz" diff --git a/type-maps.yaml b/type-maps.yaml index b542504..501a034 100644 --- a/type-maps.yaml +++ b/type-maps.yaml @@ -1,69 +1,239 @@ -protocol_version: "0.0" +protocol_version: "1.0" + +# Note that markers 0 to 31 are reserved for default use, manually working with them is not recommended + +# Fixed CommunicationType markers are: +# Error: 0 +# ErrorParsing: 1 +# ErrorBadVersion: 2 +# Disconnect: 3 +# Redirect: 4 +# Shutdown: 5 +# BadRequest: 6 +# Unauthorized: 7 +# Forbidden: 8 +# NotFound: 9 +# TooManyRequests: 10 +# InternalServerError: 11 +# BadGateway: 12 +# ServiceUnavailable: 13 +# GatewayTimeout: 14 +# Identification: 15 +# IdentificationResponse: 16 +# Register: 17 +# RegisterResponse: 18 +# Ping: 19 +# Pong: 20 + +# Fixed Data Type markers are: +# Error: 0 +# ErrorParsing: 1 +# ErrorMessage: 2 +# Version: 3 +# Description: 4 +# Timestamp: 5 +# Id: 6 +# ClientNonce: 7 +# ServerNonce: 8 +# PublicKeys: 9 +# Signature: 10 +# Connected: 11 type_maps: - "0.0": + "1.0": CommunicationTypes: - TempCoolType: 32 - GetUserData: 34 - ChangeUserData: 35 - MessageLive: 36 - MessagesGet: 37 - MessageSend: 38 - AddConversation: 39 - MessageState: 40 - LoadTxtRecord: 41 - AuthenticateApp: 42 - CreateApp: 43 - CallToken: 44 - CallData: 45 - CallInvite: 46 - AppPing: 47 - ErrorNoIota: 48 + ErrorProtocol: 33 + ErrorAnonymous: 34 + ErrorInternal: 35 + ErrorInvalidData: 36 + ErrorInvalidUserId: 37 + ErrorInvalidOmikronId: 38 + ErrorNotFound: 39 + ErrorNotAuthenticated: 40 + ErrorNoIota: 41 + ErrorInvalidChallenge: 42 + ErrorInvalidSecret: 43 + ErrorInvalidPrivateKey: 44 + ErrorInvalidPublicKey: 45 + ErrorNoUserId: 46 + ErrorNoCallId: 47 + ErrorInvalidCallId: 48 + Success: 49 + ShortenLink: 50 + SettingsSave: 51 + SettingsLoad: 52 + SettingsList: 53 + GlobalSettingsSave: 54 + GlobalSettingsLoad: 55 + Message: 56 + MessageState: 57 + MessageSend: 58 + MessageLive: 59 + MessageOtherIota: 60 + MessageChunk: 61 + MessagesGet: 62 + PushNotification: 63 + ReadNotification: 64 + GetNotifications: 65 + TauriIdentification: 66 + ChangeConfirm: 67 + ConfirmReceive: 68 + ConfirmRead: 69 + GetChats: 70 + GetStates: 71 + AddCommunity: 72 + RemoveCommunity: 73 + GetCommunities: 74 + RegisterIota: 81 + RegisterIotaSuccess: 82 + AddConversation: 85 + SendChat: 86 + ClientChanged: 87 + ClientConnected: 88 + ClientDisconnected: 89 + ClientClosed: 90 + PublicKey: 91 + PrivateKey: 92 + WebrtcSdp: 93 + WebrtcIce: 94 + StartStream: 95 + EndStream: 96 + WatchStream: 97 + CallToken: 98 + CallInvite: 99 + CallDisconnectUser: 100 + CallTimeoutUser: 101 + CallSetAnonymousJoining: 102 + CallData: 103 + EndCall: 104 + Function: 105 + Update: 106 + CreateUser: 107 + RhoUpdate: 108 + UserConnected: 109 + UserDisconnected: 110 + IotaConnected: 111 + IotaDisconnected: 112 + SyncClientIotaStatus: 113 + GetUserData: 114 + GetIotaData: 115 + IotaUserData: 116 + ChangeUserData: 117 + ChangeIotaData: 118 + GetRegister: 119 + CompleteRegisterUser: 120 + CompleteRegisterIota: 121 + DeleteUser: 122 + DeleteIota: 123 + StartRegister: 124 + CompleteRegister: 125 + GetApp: 126 + CreateApp: 127 + DeleteApp: 128 + SaveAppData: 129 + LoadAppData: 130 + AppIdentification: 131 + AppChallenge: 132 + AppChallengeResponse: 133 + AppIdentificationResponse: 134 + LoadTxtRecord: 135 DataTypes: - About: 32 - AppIdentifier: 33 - AppPublicKey: 34 - Avatar: 35 - CallId: 36 - CallMembers: 37 - CallSecret: 38 - CallToken: 39 - Calls: 40 - Challenge: 41 - ChatPartnerId: 42 - ChatPartnerName: 43 - Communities: 44 - CommunityId: 45 - Contacts: 46 - Content: 47 - Display: 48 - Files: 49 - Height: 50 - IotaId: 51 - LastMessage: 52 - LastMessageAt: 53 - LastPing: 54 - Message: 55 - MessageState: 56 - Messages: 57 - Name: 58 - Offset: 59 - OmikronConnections: 60 - OmikronId: 61 - OnlineStatus: 62 - Path: 63 - PingIota: 64 - PublicKey: 65 - ReceiverId: 66 - SendTime: 67 - SenderId: 68 - SessionId: 69 - Status: 70 - SubEnd: 71 - SubLevel: 72 - Tint: 73 - Type: 74 - UserId: 75 - UserIds: 76 - Username: 77 - AppVersion: 78 + ErrorType: 32 + ErrorProtocol: 33 + AcceptedIds: 34 + Uuid: 35 + RegisterId: 36 + Link: 37 + Settings: 38 + SettingsName: 39 + ChatPartnerId: 40 + ChatPartnerName: 41 + IotaId: 42 + UserId: 43 + UserIds: 44 + IotaIds: 45 + UserState: 46 + UserStates: 47 + UserPings: 48 + CallState: 49 + ScreenShare: 50 + PrivateKeyHash: 51 + Accepted: 52 + AcceptedProfiles: 53 + DeniedProfiles: 54 + Content: 55 + Messages: 56 + Notifications: 57 + SendTime: 58 + GetTime: 59 + GetVariant: 60 + SharedSecretOwn: 61 + SharedSecretOther: 62 + SharedSecretSign: 63 + SharedSecret: 64 + CallId: 65 + CallToken: 66 + CallSecret: 67 + Untill: 68 + Enabled: 69 + StartDate: 70 + EndDate: 71 + ReceiverId: 72 + SenderId: 73 + Signed: 75 + Message: 76 + MessageState: 77 + LastPing: 78 + PingIota: 79 + PingClients: 80 + Matches: 81 + Omikron: 82 + Offset: 83 + Amount: 84 + Position: 85 + Name: 86 + Path: 87 + Codec: 88 + Function: 89 + Payload: 90 + Result: 91 + Interactables: 92 + WantToWatch: 93 + Watcher: 94 + CreatedAt: 95 + Username: 96 + Display: 97 + Avatar: 98 + About: 99 + Status: 100 + PublicKey: 101 + SubLevel: 102 + SubEnd: 103 + CommunityAddress: 104 + CommunityTitle: 106 + Communities: 107 + RhoConnections: 108 + User: 109 + OnlineStatus: 110 + OmikronId: 111 + OmikronConnections: 112 + ResetToken: 113 + NewToken: 114 + CallInvited: 115 + CallMembers: 116 + Calls: 117 + Timeout: 118 + HasAdmin: 119 + LastMessageAt: 120 + Height: 121 + SentBySelf: 122 + SessionId: 123 + Contacts: 124 + LastMessage: 125 + AppIdentifier: 127 + AppPrivateKey: 128 + AppPublicKey: 129 + AppSession: 130 + AppData: 131 + TauriToken: 132 + Challenge: 133