publish: the public projection begins here
This is a projection, not a development branch. The tree above was constructed from the internal source named below under a manifest that decides which paths may leave, then scanned as a whole tree rather than as a series of patches, and only then published. Public history starts here because the history before it was not admissible, and neither was the tree. What used to stand in this repository included a rescue copy of another machine, a directory of phone handoffs, deployment wired to one house, and a submodule pointing at a forge no stranger can reach. None of that was ever the product. It stays in the private forge, which is allowed to hold the whole working organism, and this is what was deliberately sent out instead. Three mechanisms produced this tree, in decreasing order of trust. A top-level path the manifest does not name never arrives at all, which is the one that catches directories nobody has thought of yet. Named internal files inside admitted roots are dropped. A short, reviewed table replaces deployment defaults that a public build must not carry -- an endpoint aimed at one LAN, a VPN profile belonging to one phone, packaging built from one checkout path. Everything after this commit is an ordinary publication with the same three trailers, so a force push stops being routine and starts meaning that something deliberate happened. The trailers bind the projection to its source without pretending the public SHA is the private one: same lineage, different tree, and the record says so. Source-Sha: 8f27b1e76a8fef560a336aba18e6990713ff1047 Policy-Sha: 6b261d2f3e6e1fb19874846ba4bb1dfe15565d25b8618c1c1afba0419c101d27 Tree-Digest: 18ec3563c5e5ef9a414993a9f6734b251ff9ed3cd56eebdd6cac01e45c6e3067
This commit is contained in:
commit
8f42fc953d
1476 changed files with 238455 additions and 0 deletions
238
surfaces/quickshell/services/Lens.qml
Normal file
238
surfaces/quickshell/services/Lens.qml
Normal file
|
|
@ -0,0 +1,238 @@
|
|||
// The garden on the limb — the vault's micro-view service.
|
||||
//
|
||||
// One more process owned the Face way: this holds a `souveraine-lens`
|
||||
// process with `--ipc` at a socket only the shell ever touches. The lens
|
||||
// process has no connection to the server, and this service has no
|
||||
// connection to the vault — the micro-state the widget renders arrives
|
||||
// over the same line protocol the lens already speaks, one JSON object
|
||||
// per line on stdout. The seam stays: nobody reads the vault but the lens
|
||||
// and the user.
|
||||
//
|
||||
// `joined` is the whole state, as with the face. While it is false the
|
||||
// garden window is not on glass and no webview holds memory; the widget
|
||||
// shows a cold card until the user opens it.
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs
|
||||
import qs.modules.common
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property bool joined: false
|
||||
property string socketPath: Quickshell.env("XDG_RUNTIME_DIR") + "/souveraine/lens.sock"
|
||||
property string vaultDir: Quickshell.env("HOME") + "/vault"
|
||||
readonly property string vaultRel: vaultDir.replace(Quickshell.env("HOME"), "~")
|
||||
|
||||
// The micro-state, exactly as the lens reports it.
|
||||
property var notes: []
|
||||
property int noteCount: 0
|
||||
property int dirty: 0
|
||||
property int ahead: 0
|
||||
property int behind: 0
|
||||
property string head: ""
|
||||
property string branch: ""
|
||||
property bool hasRemote: true
|
||||
property string lastError: ""
|
||||
|
||||
// cold until the first state answers; then one of clean / ahead /
|
||||
// behind / diverged / dirty — computed, so there is one place the
|
||||
// widget reads.
|
||||
property string syncState: "cold"
|
||||
readonly property string stateText: {
|
||||
if (!root.joined) return "offline";
|
||||
switch (root.syncState) {
|
||||
case "clean": return root.noteCount + " notes · clean";
|
||||
case "ahead": return root.noteCount + " notes · push " + root.ahead;
|
||||
case "behind": return root.noteCount + " notes · pull " + root.behind;
|
||||
case "diverged": return root.noteCount + " notes · push " + root.ahead + " pull " + root.behind;
|
||||
case "dirty": return root.noteCount + " notes · " + root.dirty + " uncommitted";
|
||||
default: return root.noteCount + " notes";
|
||||
}
|
||||
}
|
||||
|
||||
onJoinedChanged: {
|
||||
if (root.joined)
|
||||
root.requestState();
|
||||
}
|
||||
|
||||
function join() {
|
||||
if (root.joined)
|
||||
return;
|
||||
host.running = true;
|
||||
root.joined = true;
|
||||
}
|
||||
|
||||
function leave() {
|
||||
if (!root.joined)
|
||||
return;
|
||||
root._send({ op: "quit" });
|
||||
host.running = false;
|
||||
root.joined = false;
|
||||
root.syncState = "cold";
|
||||
root.notes = [];
|
||||
root.noteCount = 0;
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
if (root.joined)
|
||||
root.leave();
|
||||
else
|
||||
root.join();
|
||||
}
|
||||
|
||||
function requestState() {
|
||||
root._send({ op: "state" });
|
||||
}
|
||||
|
||||
function openNote(rel) {
|
||||
root._send({ op: "open", rel: rel });
|
||||
}
|
||||
|
||||
function createNote(title) {
|
||||
root._send({ op: "create", title: title });
|
||||
}
|
||||
|
||||
// The page owns its sync flow; the shell only pulls the trigger.
|
||||
function syncNow() {
|
||||
root._eval("window.__lens.sync()");
|
||||
}
|
||||
|
||||
function _eval(script) {
|
||||
root._send({ op: "eval", script: script });
|
||||
}
|
||||
|
||||
function _send(msg) {
|
||||
if (sock.connected)
|
||||
sock.write(JSON.stringify(msg) + "\n");
|
||||
}
|
||||
|
||||
Process {
|
||||
id: host
|
||||
command: ["souveraine-lens",
|
||||
"--vault", root.vaultDir,
|
||||
"--ipc", root.socketPath,
|
||||
"--app-id", "org.souveraine.lens",
|
||||
"--title", "Garden"]
|
||||
stdout: SplitParser {
|
||||
splitMarker: "\n"
|
||||
onRead: line => {
|
||||
let msg;
|
||||
try {
|
||||
msg = JSON.parse(line);
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
if (msg.event === "note_created") {
|
||||
const rel = msg.rel ?? "";
|
||||
const title = rel.replace(/\.md$/, "").split("/").pop();
|
||||
Quickshell.execDetached(["notify-send", "-a", "Garden", "Note planted", title]);
|
||||
}
|
||||
else if (msg.event === "synced") {
|
||||
Quickshell.execDetached(["notify-send", "-a", "Garden", "Garden synced"]);
|
||||
}
|
||||
|
||||
if (msg.event === "state" && msg.state) {
|
||||
const st = msg.state.status ?? {};
|
||||
root.notes = msg.state.notes ?? [];
|
||||
root.noteCount = st.note_count ?? root.notes.length;
|
||||
root.dirty = st.dirty ?? 0;
|
||||
root.ahead = st.ahead ?? 0;
|
||||
root.behind = st.behind ?? 0;
|
||||
root.head = st.head ?? "";
|
||||
root.branch = st.branch ?? "";
|
||||
root.hasRemote = !!st.remote;
|
||||
root.syncState = root.dirty > 0
|
||||
? "dirty"
|
||||
: root.ahead > 0 && root.behind > 0
|
||||
? "diverged"
|
||||
: root.ahead > 0 ? "ahead"
|
||||
: root.behind > 0 ? "behind" : "clean";
|
||||
}
|
||||
else if (msg.event === "synced")
|
||||
refreshTimer.restart();
|
||||
else if (msg.event === "note_opened" || msg.event === "note_created" || msg.event === "note_saved")
|
||||
refreshTimer.restart();
|
||||
else if (msg.event === "console")
|
||||
console.log("[lens]", msg.level ?? "", msg.text ?? "");
|
||||
else
|
||||
console.log("[lens]", line);
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
root.joined = false;
|
||||
root.syncState = "cold";
|
||||
}
|
||||
}
|
||||
|
||||
// One refresh after a burst of events, not one per line.
|
||||
Timer {
|
||||
id: refreshTimer
|
||||
interval: 300
|
||||
repeat: false
|
||||
onTriggered: root.requestState()
|
||||
}
|
||||
|
||||
// The garden's heartbeat while it is joined; cheap — one scan.
|
||||
Timer {
|
||||
id: pollTimer
|
||||
running: root.joined
|
||||
interval: 60000
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: root.requestState()
|
||||
}
|
||||
|
||||
Socket {
|
||||
id: sock
|
||||
path: root.socketPath
|
||||
connected: root.joined
|
||||
|
||||
onConnectionStateChanged: {
|
||||
if (sock.connected)
|
||||
root.requestState();
|
||||
}
|
||||
}
|
||||
|
||||
// Reachable by name: the agent summons the garden the same way it
|
||||
// summons the face, without guessing.
|
||||
IpcHandler {
|
||||
target: "lens"
|
||||
|
||||
function open(rel: string): void {
|
||||
if (!root.joined)
|
||||
root.join();
|
||||
root.openNote(rel);
|
||||
}
|
||||
|
||||
function create(title: string): void {
|
||||
if (!root.joined)
|
||||
root.join();
|
||||
root.createNote(title);
|
||||
}
|
||||
|
||||
function sync(): void {
|
||||
root.syncNow();
|
||||
}
|
||||
|
||||
function join(): void {
|
||||
root.join();
|
||||
}
|
||||
|
||||
function leave(): void {
|
||||
root.leave();
|
||||
}
|
||||
|
||||
function status(): string {
|
||||
return JSON.stringify({
|
||||
joined: root.joined,
|
||||
syncState: root.syncState,
|
||||
noteCount: root.noteCount,
|
||||
head: root.head
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue