topside-arch 0.0.0-stage → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +217 -2
- package/contrib/aur/.SRCINFO +20 -0
- package/contrib/aur/PKGBUILD +35 -0
- package/contrib/aur/topside-arch.install +28 -0
- package/contrib/icons/hicolor/scalable/apps/topside.svg +28 -0
- package/contrib/systemd/topside.service +10 -0
- package/contrib/themes/sakura.json +31 -0
- package/dist/adapters/claude/attach.js +92 -0
- package/dist/adapters/claude/hook-event.js +173 -0
- package/dist/adapters/claude/one-shot.js +30 -0
- package/dist/adapters/claude/settings.js +78 -0
- package/dist/adapters/claude/usage.js +76 -0
- package/dist/adapters/codex/codex.js +73 -0
- package/dist/adapters/codex/patch.js +39 -0
- package/dist/adapters/codex/usage.js +77 -0
- package/dist/adapters/pi/extension.js +271 -0
- package/dist/adapters/pi/risk-gate.js +256 -0
- package/dist/cli/commands.js +615 -0
- package/dist/cli/hook-log.js +32 -0
- package/dist/cli/main.js +100 -0
- package/dist/daemon/preview.js +70 -0
- package/dist/daemon/processes.js +105 -0
- package/dist/daemon/server.js +437 -0
- package/dist/daemon/session-state.js +179 -0
- package/dist/daemon/store.js +176 -0
- package/dist/dms/setup.js +137 -0
- package/dist/hosts/hosts.js +39 -0
- package/dist/jump/jump.js +199 -0
- package/dist/pill/config.js +92 -0
- package/dist/pill/launch.js +38 -0
- package/dist/sekaipop/setup.js +267 -0
- package/dist/service/unit.js +77 -0
- package/dist/shared/ancestry.js +27 -0
- package/dist/shared/client.js +29 -0
- package/dist/shared/package.js +25 -0
- package/dist/shared/paths.js +69 -0
- package/dist/shared/protocol.js +35 -0
- package/dist/shared/qml-lib.js +33 -0
- package/dist/shared/result.js +6 -0
- package/dist/shared/terminal.js +42 -0
- package/dist/themes/themes.js +84 -0
- package/package.json +49 -4
- package/shell/core/AgentIcon.qml +24 -0
- package/shell/core/AppLogo.qml +48 -0
- package/shell/core/ApprovalRow.qml +197 -0
- package/shell/core/BoardDetail.qml +336 -0
- package/shell/core/BoardList.qml +419 -0
- package/shell/core/BoardNotice.qml +189 -0
- package/shell/core/CardButton.qml +55 -0
- package/shell/core/CardHeader.qml +46 -0
- package/shell/core/ChalkBoard.qml +99 -0
- package/shell/core/CompletionCard.qml +106 -0
- package/shell/core/FlapText.qml +110 -0
- package/shell/core/KeyCap.qml +72 -0
- package/shell/core/Mascot.qml +13 -0
- package/shell/core/MascotBadge.qml +40 -0
- package/shell/core/MascotEffect.qml +40 -0
- package/shell/core/Paper.qml +54 -0
- package/shell/core/PixelGrid.qml +40 -0
- package/shell/core/QuestionRow.qml +161 -0
- package/shell/core/SessionRow.qml +257 -0
- package/shell/core/Stamp.qml +62 -0
- package/shell/core/StatusDots.qml +33 -0
- package/shell/core/Surface.qml +32 -0
- package/shell/core/Tag.qml +22 -0
- package/shell/core/TerminalIcon.qml +34 -0
- package/shell/core/Theme.qml +100 -0
- package/shell/core/TicketDetail.qml +657 -0
- package/shell/core/TicketList.qml +717 -0
- package/shell/core/TicketNotice.qml +198 -0
- package/shell/core/TopsideClient.qml +201 -0
- package/shell/core/UsageLine.qml +106 -0
- package/shell/core/agents.js +79 -0
- package/shell/core/board.js +132 -0
- package/shell/core/hiding.js +68 -0
- package/shell/core/pixels.js +542 -0
- package/shell/core/qmldir +30 -0
- package/shell/core/sounds.js +31 -0
- package/shell/core/themes.js +195 -0
- package/shell/core/ticket.js +170 -0
- package/shell/dms-plugin/TopsideSettings.qml +696 -0
- package/shell/dms-plugin/TopsideWidget.qml +554 -0
- package/shell/dms-plugin/plugin.json +14 -0
- package/shell/pill.qml +279 -0
- package/shell/sekaipop-plugin/Bar.qml +150 -0
- package/shell/sekaipop-plugin/Card.qml +296 -0
- package/shell/sekaipop-plugin/Floating.qml +74 -0
- package/shell/sekaipop-plugin/ListWindow.qml +156 -0
- package/shell/sekaipop-plugin/Popup.qml +70 -0
- package/shell/sekaipop-plugin/Service.qml +418 -0
- package/shell/sekaipop-plugin/ShellLook.qml +43 -0
- package/shell/sekaipop-plugin/StyledCard.qml +194 -0
- package/shell/sekaipop-plugin/place.js +28 -0
- package/shell/sekaipop-plugin/plugin.json +109 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
.pragma library
|
|
2
|
+
|
|
3
|
+
// The departure board style (Settings > Style > Board): what each flap row
|
|
4
|
+
// says. Pure functions over the daemon's snapshot, so `node --test` covers
|
|
5
|
+
// them and the QML only draws (BoardNotice.qml, BoardList.qml).
|
|
6
|
+
|
|
7
|
+
// What a flap can show. Anything else reads as a space.
|
|
8
|
+
var flapChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 .,:;-+!?/%#&'()<>=*_@$";
|
|
9
|
+
|
|
10
|
+
// A text cut or padded to exactly n flaps, in capitals.
|
|
11
|
+
function fit(text, n) {
|
|
12
|
+
var upper = String(text == null ? "" : text).toUpperCase();
|
|
13
|
+
// A character the flaps don't have (an emoji, say) is a blank, and blanks
|
|
14
|
+
// in a row are one, none at the start: "📦 SEKA: x" reads "SEKA: X".
|
|
15
|
+
var out = "";
|
|
16
|
+
for (var i = 0; i < upper.length && out.length < n; i++) {
|
|
17
|
+
var c = upper.charAt(i);
|
|
18
|
+
if (flapChars.indexOf(c) < 0) c = " ";
|
|
19
|
+
if (c === " " && (out === "" || out.charAt(out.length - 1) === " ")) continue;
|
|
20
|
+
out += c;
|
|
21
|
+
}
|
|
22
|
+
while (out.length < n) out += " ";
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// The session's name as the row heads it: its own name, else its folder.
|
|
27
|
+
function sessionName(session) {
|
|
28
|
+
if (!session) return "";
|
|
29
|
+
if (session.name) return session.name;
|
|
30
|
+
var parts = String(session.cwd || "").split("/").filter(function (p) { return p !== ""; });
|
|
31
|
+
return parts.length > 0 ? parts[parts.length - 1] : "";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Agents that only send requests through the risk gate, which blocks on its own.
|
|
35
|
+
function gated(agent) {
|
|
36
|
+
return agent === "pi" || agent === "omp";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// The status word, eight flaps at most, as an airport board would say it.
|
|
40
|
+
// `kind` is "question" or "approval" when a request of the session waits,
|
|
41
|
+
// `reminding` when its reminder is showing.
|
|
42
|
+
function statusWord(session, kind, reminding) {
|
|
43
|
+
if (reminding) return "DELAYED";
|
|
44
|
+
if (kind === "question") return "QUESTION";
|
|
45
|
+
if (kind === "approval") return session && gated(session.agent) ? "SECURITY" : "WAITING";
|
|
46
|
+
if (!session) return "";
|
|
47
|
+
if (session.untracked) return "UNKNOWN";
|
|
48
|
+
if (session.status === "waiting") return "WAITING";
|
|
49
|
+
if (session.status === "working") return "BOARDING";
|
|
50
|
+
if (session.status === "done") return "ARRIVED";
|
|
51
|
+
return "PARKED";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// The status color's name on Theme for a word.
|
|
55
|
+
function statusTone(word) {
|
|
56
|
+
if (word === "DELAYED" || word === "SECURITY" || word === "DENIED" || word === "BLOCKED" || word === "HIDE?") return "reminder";
|
|
57
|
+
if (word === "WAITING" || word === "QUESTION") return "waiting";
|
|
58
|
+
if (word === "ARRIVED" || word === "CLEARED" || word === "ANSWERED" || word === "ALLOWED" || word === "ALWAYS" || word === "AUTO") return "done";
|
|
59
|
+
if (word === "BOARDING") return "working";
|
|
60
|
+
return "idle";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// How long ago, the way the board's first column says it.
|
|
64
|
+
function age(since, now) {
|
|
65
|
+
var minutes = Math.max(0, Math.floor((now - since) / 60000));
|
|
66
|
+
if (minutes < 1) return "<1M";
|
|
67
|
+
if (minutes < 60) return minutes + "M";
|
|
68
|
+
if (minutes < 60 * 24) return Math.floor(minutes / 60) + "H";
|
|
69
|
+
return Math.floor(minutes / (60 * 24)) + "D";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// A path's last part: "src/auth.ts" reads "AUTH.TS" on the board.
|
|
73
|
+
function baseName(path) {
|
|
74
|
+
var parts = String(path || "").split("/").filter(function (p) { return p !== ""; });
|
|
75
|
+
return parts.length > 0 ? parts[parts.length - 1] : "";
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// The board's second line for a request: "EDIT AUTH.TS", "BASH NPM TEST".
|
|
79
|
+
function requestLine(approval) {
|
|
80
|
+
if (!approval) return "";
|
|
81
|
+
var tool = String(approval.toolName || "").replace(/_/g, " ");
|
|
82
|
+
var file = baseName(approval.file);
|
|
83
|
+
if (file !== "") return tool + " " + file;
|
|
84
|
+
var summary = String(approval.summary || "");
|
|
85
|
+
var prefix = approval.toolName + ": ";
|
|
86
|
+
return tool + " " + (summary.indexOf(prefix) === 0 ? summary.slice(prefix.length) : summary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// What the NOW column says about a session: its activity, else its state.
|
|
90
|
+
function nowLine(session) {
|
|
91
|
+
if (!session) return "";
|
|
92
|
+
if (session.untracked) return "NOT TRACKED";
|
|
93
|
+
if (session.status === "working") return session.activity || "WORKING";
|
|
94
|
+
if (session.status === "waiting") return "ASKING";
|
|
95
|
+
if (session.status === "done") return "DONE";
|
|
96
|
+
return "IDLE";
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// What waits, in the order the board shows it: questions, then requests,
|
|
100
|
+
// oldest first, each as { kind, item, sessionId }.
|
|
101
|
+
function pending(approvals, questions) {
|
|
102
|
+
var out = [];
|
|
103
|
+
(questions || []).forEach(function (q) { out.push({ kind: "question", item: q, sessionId: q.sessionId, createdAt: q.createdAt }); });
|
|
104
|
+
(approvals || []).forEach(function (a) { out.push({ kind: "approval", item: a, sessionId: a.sessionId, createdAt: a.createdAt }); });
|
|
105
|
+
return out;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// The request a session waits on, as pending() gives it, or null.
|
|
109
|
+
function pendingFor(sessionId, approvals, questions) {
|
|
110
|
+
var all = pending(approvals, questions);
|
|
111
|
+
for (var i = 0; i < all.length; i++) if (all[i].sessionId === sessionId) return all[i];
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// A question that answers with one click: one question, one choice.
|
|
116
|
+
function instant(question) {
|
|
117
|
+
var asked = (question && question.questions) || [];
|
|
118
|
+
return asked.length === 1 && !asked[0].multiSelect;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Seconds left before the risk gate blocks a request on its own (25 s).
|
|
122
|
+
var gateSeconds = 25;
|
|
123
|
+
function gateLeft(approval, now) {
|
|
124
|
+
return Math.max(0, gateSeconds - Math.floor((now - approval.createdAt) / 1000));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// How tall a list may grow in its window: 85% of the area, less what sits
|
|
128
|
+
// above it. The list always hangs from the top, so its top never depends on
|
|
129
|
+
// its height.
|
|
130
|
+
function listRoom(areaHeight, top) {
|
|
131
|
+
return Math.floor(areaHeight * 0.85) - top;
|
|
132
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.pragma library
|
|
2
|
+
|
|
3
|
+
// Sessions the user hid, as on the Mac (VIA-PARITY §18). The daemon keeps
|
|
4
|
+
// tracking them; the UI leaves them out, so un-hiding brings them back.
|
|
5
|
+
|
|
6
|
+
// A folder hides every session in it or below it.
|
|
7
|
+
function inFolder(cwd, folder) {
|
|
8
|
+
return cwd === folder || cwd.indexOf(folder.replace(/\/$/, "") + "/") === 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// A prompt hides every session whose first prompt contains it, in any case.
|
|
12
|
+
// A session without a prompt yet can't match.
|
|
13
|
+
function likePrompt(session, text) {
|
|
14
|
+
return (session.lastPrompt || "") !== "" && (session.title || "").toLowerCase().indexOf(text.toLowerCase()) >= 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function isHidden(session, folders, prompts) {
|
|
18
|
+
return folders.some(function (f) { return inFolder(session.cwd || "", f); })
|
|
19
|
+
|| prompts.some(function (p) { return likePrompt(session, p); });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// `list` with `entry` first and no copy of it further down: newest first.
|
|
23
|
+
function added(list, entry) {
|
|
24
|
+
return [entry].concat(list.filter(function (e) { return e !== entry; }));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function removed(list, entry) {
|
|
28
|
+
return list.filter(function (e) { return e !== entry; });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// What "Hide prompts like it" stores for a prompt: trimmed, without the "…"
|
|
32
|
+
// a cut title ends in, so the rest still matches the full prompt.
|
|
33
|
+
function promptRule(prompt) {
|
|
34
|
+
var text = String(prompt == null ? "" : prompt).trim();
|
|
35
|
+
if (text.slice(-1) === "\u2026") text = text.slice(0, -1).trim();
|
|
36
|
+
return text;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Hiding asks first (VIA-PARITY §29). A hide the user asked for from a row
|
|
40
|
+
// or a ticket: `rule` is { folder: true, text: <cwd> } or { folder: false,
|
|
41
|
+
// text: <prompt> }. Returns { folder, text, sessionId, caught }, `caught`
|
|
42
|
+
// being every listed session the rule would take off, in list order, found
|
|
43
|
+
// with the same matching the filter uses; null when the rule wouldn't catch
|
|
44
|
+
// `sessionId` itself (it's gone, or has no prompt yet). Ask it again with a
|
|
45
|
+
// newer list to recount.
|
|
46
|
+
function question(rule, sessionId, sessions) {
|
|
47
|
+
var text = rule.folder ? String(rule.text || "") : promptRule(rule.text);
|
|
48
|
+
if (text === "") return null;
|
|
49
|
+
var folders = rule.folder ? [text] : [];
|
|
50
|
+
var prompts = rule.folder ? [] : [text];
|
|
51
|
+
var caught = (sessions || []).filter(function (s) { return isHidden(s, folders, prompts); })
|
|
52
|
+
.map(function (s) { return s.id; });
|
|
53
|
+
if (caught.indexOf(sessionId) < 0) return null;
|
|
54
|
+
return { folder: rule.folder, text: text, sessionId: sessionId, caught: caught };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// "Hide 2 tickets in web-app, and any new one there?" `unit` names what the
|
|
58
|
+
// style lists: session (Classic), row (Board) or ticket (Kitchen).
|
|
59
|
+
function questionText(q, unit) {
|
|
60
|
+
var count = q.caught.length;
|
|
61
|
+
var noun = count === 1 ? unit : unit + "s";
|
|
62
|
+
if (q.folder) {
|
|
63
|
+
var parts = q.text.split("/").filter(function (p) { return p !== ""; });
|
|
64
|
+
return "Hide " + count + " " + noun + " in " + (parts.length > 0 ? parts[parts.length - 1] : q.text) + ", and any new one there?";
|
|
65
|
+
}
|
|
66
|
+
var short = q.text.length > 28 ? q.text.slice(0, 27) + "\u2026" : q.text;
|
|
67
|
+
return "Hide " + count + " " + noun + " that start like \u201c" + short + "\u201d, and any new one?";
|
|
68
|
+
}
|