mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
p2 (Pi Mobile on Chord v2) moves from pi-private into pi as one commit. Root scripts that loop all workspaces use --if-present; npm test, ./test.sh and the release script cover packages/* only (p2: cd apps/p2 && npm test); sync-versions also updates apps' workspace pins.
23 lines
829 B
TypeScript
23 lines
829 B
TypeScript
import { arr, num, obj, type Static, str, union } from "@earendil-works/pi-schema";
|
|
import { literal, param, remote, serverHost } from "@p2/app/v1";
|
|
|
|
export const LogLineSchema = obj({
|
|
id: num(),
|
|
time: num(),
|
|
level: union([literal("stdout"), literal("stderr"), literal("event"), literal("error")]),
|
|
text: str(),
|
|
});
|
|
export type LogLine = Static<typeof LogLineSchema>;
|
|
export const LogSourcesSchema = arr(obj({ id: str(), lines: num(), updatedAt: num() }));
|
|
|
|
export { LogNotices, NoticesSchema } from "@p2/app/v1";
|
|
|
|
/** Owner-only diagnostics. Changing source acquires a new view, not a new worker. */
|
|
export const Logs = remote("p2.logs", {
|
|
version: 1,
|
|
params: { source: param.str({ max: 128 }) },
|
|
hostAddress: serverHost,
|
|
variants: {
|
|
owner: { state: { sources: LogSourcesSchema, lines: arr(LogLineSchema) } },
|
|
},
|
|
});
|