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.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +217 -2
  3. package/contrib/aur/.SRCINFO +20 -0
  4. package/contrib/aur/PKGBUILD +35 -0
  5. package/contrib/aur/topside-arch.install +28 -0
  6. package/contrib/icons/hicolor/scalable/apps/topside.svg +28 -0
  7. package/contrib/systemd/topside.service +10 -0
  8. package/contrib/themes/sakura.json +31 -0
  9. package/dist/adapters/claude/attach.js +92 -0
  10. package/dist/adapters/claude/hook-event.js +173 -0
  11. package/dist/adapters/claude/one-shot.js +30 -0
  12. package/dist/adapters/claude/settings.js +78 -0
  13. package/dist/adapters/claude/usage.js +76 -0
  14. package/dist/adapters/codex/codex.js +73 -0
  15. package/dist/adapters/codex/patch.js +39 -0
  16. package/dist/adapters/codex/usage.js +77 -0
  17. package/dist/adapters/pi/extension.js +271 -0
  18. package/dist/adapters/pi/risk-gate.js +256 -0
  19. package/dist/cli/commands.js +615 -0
  20. package/dist/cli/hook-log.js +32 -0
  21. package/dist/cli/main.js +100 -0
  22. package/dist/daemon/preview.js +70 -0
  23. package/dist/daemon/processes.js +105 -0
  24. package/dist/daemon/server.js +437 -0
  25. package/dist/daemon/session-state.js +179 -0
  26. package/dist/daemon/store.js +176 -0
  27. package/dist/dms/setup.js +137 -0
  28. package/dist/hosts/hosts.js +39 -0
  29. package/dist/jump/jump.js +199 -0
  30. package/dist/pill/config.js +92 -0
  31. package/dist/pill/launch.js +38 -0
  32. package/dist/sekaipop/setup.js +267 -0
  33. package/dist/service/unit.js +77 -0
  34. package/dist/shared/ancestry.js +27 -0
  35. package/dist/shared/client.js +29 -0
  36. package/dist/shared/package.js +25 -0
  37. package/dist/shared/paths.js +69 -0
  38. package/dist/shared/protocol.js +35 -0
  39. package/dist/shared/qml-lib.js +33 -0
  40. package/dist/shared/result.js +6 -0
  41. package/dist/shared/terminal.js +42 -0
  42. package/dist/themes/themes.js +84 -0
  43. package/package.json +49 -4
  44. package/shell/core/AgentIcon.qml +24 -0
  45. package/shell/core/AppLogo.qml +48 -0
  46. package/shell/core/ApprovalRow.qml +197 -0
  47. package/shell/core/BoardDetail.qml +336 -0
  48. package/shell/core/BoardList.qml +419 -0
  49. package/shell/core/BoardNotice.qml +189 -0
  50. package/shell/core/CardButton.qml +55 -0
  51. package/shell/core/CardHeader.qml +46 -0
  52. package/shell/core/ChalkBoard.qml +99 -0
  53. package/shell/core/CompletionCard.qml +106 -0
  54. package/shell/core/FlapText.qml +110 -0
  55. package/shell/core/KeyCap.qml +72 -0
  56. package/shell/core/Mascot.qml +13 -0
  57. package/shell/core/MascotBadge.qml +40 -0
  58. package/shell/core/MascotEffect.qml +40 -0
  59. package/shell/core/Paper.qml +54 -0
  60. package/shell/core/PixelGrid.qml +40 -0
  61. package/shell/core/QuestionRow.qml +161 -0
  62. package/shell/core/SessionRow.qml +257 -0
  63. package/shell/core/Stamp.qml +62 -0
  64. package/shell/core/StatusDots.qml +33 -0
  65. package/shell/core/Surface.qml +32 -0
  66. package/shell/core/Tag.qml +22 -0
  67. package/shell/core/TerminalIcon.qml +34 -0
  68. package/shell/core/Theme.qml +100 -0
  69. package/shell/core/TicketDetail.qml +657 -0
  70. package/shell/core/TicketList.qml +717 -0
  71. package/shell/core/TicketNotice.qml +198 -0
  72. package/shell/core/TopsideClient.qml +201 -0
  73. package/shell/core/UsageLine.qml +106 -0
  74. package/shell/core/agents.js +79 -0
  75. package/shell/core/board.js +132 -0
  76. package/shell/core/hiding.js +68 -0
  77. package/shell/core/pixels.js +542 -0
  78. package/shell/core/qmldir +30 -0
  79. package/shell/core/sounds.js +31 -0
  80. package/shell/core/themes.js +195 -0
  81. package/shell/core/ticket.js +170 -0
  82. package/shell/dms-plugin/TopsideSettings.qml +696 -0
  83. package/shell/dms-plugin/TopsideWidget.qml +554 -0
  84. package/shell/dms-plugin/plugin.json +14 -0
  85. package/shell/pill.qml +279 -0
  86. package/shell/sekaipop-plugin/Bar.qml +150 -0
  87. package/shell/sekaipop-plugin/Card.qml +296 -0
  88. package/shell/sekaipop-plugin/Floating.qml +74 -0
  89. package/shell/sekaipop-plugin/ListWindow.qml +156 -0
  90. package/shell/sekaipop-plugin/Popup.qml +70 -0
  91. package/shell/sekaipop-plugin/Service.qml +418 -0
  92. package/shell/sekaipop-plugin/ShellLook.qml +43 -0
  93. package/shell/sekaipop-plugin/StyledCard.qml +194 -0
  94. package/shell/sekaipop-plugin/place.js +28 -0
  95. package/shell/sekaipop-plugin/plugin.json +109 -0
@@ -0,0 +1,696 @@
1
+ import QtQuick
2
+ import Quickshell.Io
3
+ import qs.Common
4
+ import qs.DCommon.Widgets
5
+ import qs.Modules.Plugins
6
+ import qs.Modules.Settings.Widgets
7
+ import qs.Services
8
+ import "core" as Topside
9
+ import "core/themes.js" as Themes
10
+ import "core/sounds.js" as Sounds
11
+ import "core/hiding.js" as Hiding
12
+
13
+ // DMS Settings → Plugins → Topside. The ⚙ in the popout opens this page.
14
+ // It follows Topside's settings on the Mac, as one page of five sections:
15
+ // General, Notifications, Integrations, Appearance and About.
16
+ // Values DMS stores reach TopsideWidget.qml as pluginData. The Integrations
17
+ // switches and "Open at login" run the Topside CLI instead
18
+ // (`topside integrations`, `hooks`, `usage`, `login`), which backs a file up
19
+ // before writing it and says where.
20
+ //
21
+ // The rows are DMS's own (SettingsRow and friends, from qs.Modules.Settings
22
+ // .Widgets) so they look and hover like the native pages. Those types aren't
23
+ // plugin API, so a DMS update can break this page. DMS puts a plugin's
24
+ // settings inside one padded tile; the page steps out of that padding and
25
+ // paints over the tile, so its sections sit where the native ones do.
26
+ PluginSettings {
27
+ id: settings
28
+ pluginId: "topside"
29
+
30
+ Item {
31
+ id: page
32
+
33
+ property bool autoOpen: true
34
+ property string appearance: "dark"
35
+ property string theme: "topsideBlack"
36
+ property int fontSize: 11
37
+ property int maxDots: 5
38
+ property bool reminders: true
39
+ property int reminderMinutes: 2
40
+ property bool sounds: false
41
+ property string attentionSound: Sounds.defaults.attention
42
+ property string completionSound: Sounds.defaults.completion
43
+ property var hiddenFolders: []
44
+ property var hiddenPrompts: []
45
+
46
+ // Every theme the picker steps through, [{ id, title }]: the built-in
47
+ // ones, then your usable theme files, from `topside theme list --json`.
48
+ property var themeList: Themes.names.map(id => ({ id: id, title: Themes.titles[id] }))
49
+ function stepTheme(steps) {
50
+ save("theme", Themes.stepped(theme, steps, themeList.map(t => t.id)));
51
+ }
52
+ function themeTitle(id) {
53
+ const found = themeList.find(t => t.id === id);
54
+ return found ? found.title : Themes.titles[id] ?? id;
55
+ }
56
+
57
+ // From `topside integrations`; null until it answers.
58
+ property var info: null
59
+ // How to run Topside, from the cli.json `topside setup` writes.
60
+ property var cli: ["topside"]
61
+ // The last command's answer, shown under the row that ran it.
62
+ property string busy: ""
63
+ property var notes: ({})
64
+
65
+ // PluginSettings calls this on its children whenever the data changes.
66
+ function loadValue() {
67
+ autoOpen = settings.loadValue("autoOpen", true);
68
+ const mode = settings.loadValue("appearance", "dark");
69
+ appearance = ["light", "dark", "system"].indexOf(mode) >= 0 ? mode : "dark";
70
+ // A theme file's id stays as it is; Theme reads the file.
71
+ theme = settings.loadValue("theme", "topsideBlack") || "topsideBlack";
72
+ fontSize = Math.max(10, Math.min(14, settings.loadValue("fontSize", 11)));
73
+ maxDots = Math.max(1, Math.min(7, settings.loadValue("maxDots", 5)));
74
+ reminders = settings.loadValue("reminders", true);
75
+ reminderMinutes = Math.max(1, Math.min(10, settings.loadValue("reminderMinutes", 2)));
76
+ sounds = settings.loadValue("sounds", false);
77
+ attentionSound = Sounds.known(settings.loadValue("attentionSound", ""), "attention");
78
+ completionSound = Sounds.known(settings.loadValue("completionSound", ""), "completion");
79
+ const folders = settings.loadValue("hiddenFolders", []);
80
+ hiddenFolders = Array.isArray(folders) ? folders : [];
81
+ const prompts = settings.loadValue("hiddenPrompts", []);
82
+ hiddenPrompts = Array.isArray(prompts) ? prompts : [];
83
+ }
84
+
85
+ // Plays a sound so the user hears what they picked.
86
+ function preview(name) {
87
+ previewer.command = ["canberra-gtk-play", "-i", name];
88
+ previewer.running = true;
89
+ }
90
+
91
+ function save(key, value) {
92
+ settings.saveValue(key, value);
93
+ loadValue();
94
+ }
95
+
96
+ function refresh() {
97
+ reader.running = true;
98
+ themeReader.running = true;
99
+ }
100
+
101
+ // Runs `topside <args>` for the row `key`, then reads the state again.
102
+ function run(key, args) {
103
+ if (busy !== "") return;
104
+ busy = key;
105
+ runner.output = "";
106
+ runner.command = cli.concat(args);
107
+ runner.running = true;
108
+ }
109
+
110
+ function note(key, text) {
111
+ const next = Object.assign({}, notes);
112
+ next[key] = text;
113
+ notes = next;
114
+ }
115
+
116
+ readonly property real padH: SettingsMetrics.rowPaddingH
117
+ readonly property real padV: SettingsMetrics.rowPaddingV
118
+ readonly property bool otherCopy: info !== null && (info.hooks === "other" || info.usage === "other" || info.codexHooks === "other" || info.piExtension === "other" || info.ompExtension === "other")
119
+
120
+ width: parent.width
121
+ implicitHeight: sections.implicitHeight - 2 * padV
122
+ height: implicitHeight
123
+ Component.onCompleted: {
124
+ loadValue();
125
+ hideHostTitle();
126
+ }
127
+
128
+ // DMS heads every plugin's settings with a "Settings" title, the same
129
+ // size as this page's section titles. The page has its own sections, so
130
+ // it clears that title on the card that hosts it (settingKey
131
+ // "pluginSettings"). Not plugin API: if DMS changes, the title just stays.
132
+ function hideHostTitle() {
133
+ for (let item = page.parent; item; item = item.parent) {
134
+ if (item.settingKey === "pluginSettings" && item.title !== undefined) {
135
+ item.title = "";
136
+ return;
137
+ }
138
+ }
139
+ }
140
+
141
+ FileView {
142
+ path: Qt.resolvedUrl("cli.json").toString().replace(/^file:\/\//, "")
143
+ printErrors: false
144
+ onLoaded: {
145
+ try {
146
+ const value = JSON.parse(text());
147
+ if (Array.isArray(value) && value.length > 0) page.cli = value;
148
+ } catch (e) {
149
+ // Keep "topside" on PATH.
150
+ }
151
+ page.refresh();
152
+ }
153
+ onLoadFailed: page.refresh()
154
+ }
155
+
156
+ Process {
157
+ id: reader
158
+ command: page.cli.concat(["integrations"])
159
+ stdout: StdioCollector {
160
+ onStreamFinished: {
161
+ try {
162
+ page.info = JSON.parse(text);
163
+ } catch (e) {
164
+ page.info = null;
165
+ }
166
+ }
167
+ }
168
+ }
169
+
170
+ Process {
171
+ id: themeReader
172
+ command: page.cli.concat(["theme", "list", "--json"])
173
+ stdout: StdioCollector {
174
+ onStreamFinished: {
175
+ try {
176
+ const usable = JSON.parse(text).filter(t => t.usable);
177
+ if (usable.length > 0) page.themeList = usable.map(t => ({ id: t.id, title: t.title }));
178
+ } catch (e) {
179
+ // An older topside without `theme`: keep the built-in list.
180
+ }
181
+ }
182
+ }
183
+ }
184
+
185
+ Process {
186
+ id: previewer
187
+ }
188
+
189
+ Process {
190
+ id: runner
191
+ property string output: ""
192
+ stdout: SplitParser {
193
+ onRead: line => runner.output += (runner.output ? "\n" : "") + line
194
+ }
195
+ stderr: SplitParser {
196
+ onRead: line => runner.output += (runner.output ? "\n" : "") + line
197
+ }
198
+ onExited: {
199
+ page.note(page.busy, runner.output);
200
+ page.busy = "";
201
+ page.refresh();
202
+ }
203
+ }
204
+
205
+ // Covers the tile DMS draws around plugin settings.
206
+ Rectangle {
207
+ x: -page.padH
208
+ y: -page.padV
209
+ width: page.width + 2 * page.padH
210
+ height: sections.implicitHeight
211
+ color: SettingsMetrics.paneColor
212
+ }
213
+
214
+ Column {
215
+ id: sections
216
+ x: -page.padH
217
+ y: -page.padV
218
+ width: page.width + 2 * page.padH
219
+ spacing: 0
220
+
221
+ SettingsSectionLabel {
222
+ width: parent.width
223
+ text: "General"
224
+ }
225
+
226
+ SettingsGroup {
227
+ width: parent.width
228
+
229
+ SettingsToggleRow {
230
+ iconName: "power_settings_new"
231
+ text: "Open at login"
232
+ description: page.notes.login || "Starts the Topside service when you log in"
233
+ enabled: page.info !== null && page.busy === ""
234
+ checked: page.info !== null && page.info.login
235
+ onToggled: value => page.run("login", ["login", value ? "on" : "off"])
236
+ }
237
+
238
+ SettingsRow {
239
+ iconName: "more_horiz"
240
+ title: "Sessions shown"
241
+ subtitle: "Dots on the bar and rows in the list; the rest wait behind “+ N more”"
242
+
243
+ Stepper {
244
+ value: page.maxDots
245
+ minimum: 1
246
+ maximum: 7
247
+ onChosen: value => page.save("maxDots", value)
248
+ }
249
+ }
250
+
251
+ // Where the widget sits is DMS's own setting; this row opens that page.
252
+ SettingsNavRow {
253
+ iconName: "widgets"
254
+ title: "Arrange on the bar"
255
+ hint: "DMS Settings → Bar widgets"
256
+ onClicked: PopoutService.openSettingsWithTab("dankbar_widgets")
257
+ }
258
+ }
259
+
260
+ SettingsSectionLabel {
261
+ width: parent.width
262
+ text: "Notifications"
263
+ }
264
+
265
+ SettingsGroup {
266
+ width: parent.width
267
+
268
+ SettingsToggleRow {
269
+ iconName: "open_in_new"
270
+ text: "Open cards by themselves"
271
+ description: page.autoOpen
272
+ ? "Requests, questions and finished turns open the popout on the monitor you're on"
273
+ : "The bar shows the waiting count and you open the popout yourself"
274
+ checked: page.autoOpen
275
+ onToggled: value => page.save("autoOpen", value)
276
+ }
277
+
278
+ SettingsToggleRow {
279
+ iconName: "notifications_active"
280
+ text: "Remind me about unanswered requests"
281
+ description: "Once per request: the bar's mascot blinks red, and the card opens again"
282
+ checked: page.reminders
283
+ onToggled: value => page.save("reminders", value)
284
+ }
285
+
286
+ SettingsRow {
287
+ visible: page.reminders
288
+ iconName: "timer"
289
+ title: "Remind after"
290
+ subtitle: page.reminderMinutes === 1 ? "1 minute without an answer" : page.reminderMinutes + " minutes without an answer"
291
+
292
+ Stepper {
293
+ value: page.reminderMinutes
294
+ minimum: 1
295
+ maximum: 10
296
+ onChosen: value => page.save("reminderMinutes", value)
297
+ }
298
+ }
299
+
300
+ SettingsToggleRow {
301
+ iconName: "volume_up"
302
+ text: "Sounds"
303
+ description: "When a session needs you and when one finishes, unless its terminal has the focus"
304
+ checked: page.sounds
305
+ onToggled: value => page.save("sounds", value)
306
+ }
307
+
308
+ Repeater {
309
+ model: [
310
+ { key: "attentionSound", title: "Request or question", icon: "help" },
311
+ { key: "completionSound", title: "Finished turn", icon: "task_alt" },
312
+ ]
313
+ delegate: SettingsRow {
314
+ id: soundRow
315
+ required property var modelData
316
+ readonly property string current: page[modelData.key]
317
+ visible: page.sounds
318
+ iconName: modelData.icon
319
+ title: modelData.title
320
+
321
+ Row {
322
+ spacing: Theme.spacingXS
323
+ anchors.verticalCenter: parent.verticalCenter
324
+ DActionButton {
325
+ iconName: "chevron_left"
326
+ anchors.verticalCenter: parent.verticalCenter
327
+ onClicked: soundRow.pick(-1)
328
+ }
329
+ StyledText {
330
+ text: Sounds.title(soundRow.current)
331
+ width: 170
332
+ elide: Text.ElideRight
333
+ horizontalAlignment: Text.AlignHCenter
334
+ anchors.verticalCenter: parent.verticalCenter
335
+ font.pixelSize: Theme.fontSizeMedium
336
+ font.weight: Theme.fontWeightMedium
337
+ color: Theme.surfaceText
338
+ }
339
+ DActionButton {
340
+ iconName: "chevron_right"
341
+ anchors.verticalCenter: parent.verticalCenter
342
+ onClicked: soundRow.pick(1)
343
+ }
344
+ }
345
+
346
+ function pick(steps) {
347
+ const next = Sounds.stepped(soundRow.current, steps);
348
+ page.save(soundRow.modelData.key, next);
349
+ page.preview(next);
350
+ }
351
+ }
352
+ }
353
+ }
354
+
355
+ // Hidden sessions, by folder and by prompt, newest first. Up to five
356
+ // of each show; the heading counts them when there are more. Entries
357
+ // only come from a row's hide buttons, so there's no text field.
358
+ SettingsSectionLabel {
359
+ width: parent.width
360
+ text: "Hidden sessions"
361
+ }
362
+
363
+ SettingsGroup {
364
+ width: parent.width
365
+
366
+ SettingsRow {
367
+ visible: page.hiddenFolders.length + page.hiddenPrompts.length === 0
368
+ iconName: "visibility_off"
369
+ title: "Nothing hidden"
370
+ subtitle: "In the popout, point at a session and click ⊘ to hide its folder, or ≈ to hide sessions with a prompt like it"
371
+ }
372
+
373
+ Repeater {
374
+ model: [
375
+ { key: "hiddenFolders", icon: "folder_off", label: "Folder", list: page.hiddenFolders },
376
+ { key: "hiddenPrompts", icon: "speaker_notes_off", label: "Prompt", list: page.hiddenPrompts },
377
+ ].reduce((rows, group) => rows.concat(group.list.slice(0, 5).map((entry, i) => ({
378
+ key: group.key,
379
+ icon: group.icon,
380
+ entry: entry,
381
+ label: i === 0 && group.list.length > 5 ? group.label + " (" + group.list.length + ")" : group.label,
382
+ }))), [])
383
+ delegate: SettingsRow {
384
+ id: hiddenRow
385
+ required property var modelData
386
+ iconName: modelData.icon
387
+ title: modelData.key === "hiddenPrompts" ? "“" + modelData.entry + "”" : modelData.entry
388
+ subtitle: modelData.label
389
+
390
+ DActionButton {
391
+ iconName: "close"
392
+ tooltipText: "Show these sessions again"
393
+ anchors.verticalCenter: parent.verticalCenter
394
+ onClicked: page.save(hiddenRow.modelData.key, Hiding.removed(page[hiddenRow.modelData.key], hiddenRow.modelData.entry))
395
+ }
396
+ }
397
+ }
398
+ }
399
+
400
+ SettingsSectionLabel {
401
+ width: parent.width
402
+ text: "Integrations"
403
+ }
404
+
405
+ SettingsGroup {
406
+ width: parent.width
407
+
408
+ SettingsNoteRow {
409
+ visible: page.info !== null && page.info.settingsError !== ""
410
+ text: page.info ? page.info.settingsError + ". Topside leaves it alone." : ""
411
+ }
412
+
413
+ SettingsToggleRow {
414
+ iconName: "webhook"
415
+ text: "Claude Code hooks"
416
+ description: page.notes.hooks || "Sessions, requests and questions from Claude Code reach the island"
417
+ enabled: page.info !== null && page.busy === ""
418
+ checked: page.info !== null && page.info.hooks !== "none"
419
+ onToggled: value => page.run("hooks", ["hooks", value ? "install" : "uninstall"])
420
+ }
421
+
422
+ // Codex runs a hook only after the user trusts it in /hooks, and a
423
+ // changed command loses that trust; the CLI keeps a flag until a
424
+ // Codex hook runs (docs/notes/codex-hooks.md).
425
+ SettingsToggleRow {
426
+ visible: page.info !== null && page.info.codex === true
427
+ iconName: "terminal"
428
+ text: "Codex hooks"
429
+ description: page.info !== null && page.info.codexUntrusted && page.info.codexHooks !== "none"
430
+ ? "Run /hooks in Codex once and trust Topside's hooks. Until then Codex sends nothing."
431
+ : page.notes.codexHooks || "Sessions and requests from Codex reach the island. Allow and Deny only."
432
+ enabled: page.info !== null && page.busy === ""
433
+ checked: page.info !== null && page.info.codexHooks !== "none"
434
+ onToggled: value => page.run("codexHooks", ["hooks", value ? "install" : "uninstall", "codex"])
435
+ }
436
+
437
+ SettingsToggleRow {
438
+ iconName: "monitoring"
439
+ text: "Plan usage in the header"
440
+ description: page.notes.usage || "Wraps Claude Code's status line, which keeps showing what it showed"
441
+ enabled: page.info !== null && page.busy === ""
442
+ checked: page.info !== null && page.info.usage !== "none"
443
+ onToggled: value => page.run("usage", ["usage", value ? "install" : "uninstall"])
444
+ }
445
+
446
+ // pi and omp have no hooks; Topside writes an extension file into
447
+ // their extensions folder. omp only loads it when it starts.
448
+ SettingsToggleRow {
449
+ visible: page.info !== null && page.info.pi === true
450
+ iconName: "extension"
451
+ text: "pi extension"
452
+ description: page.notes.pi || "Sessions and their cost from pi. Open sessions pick it up with /reload."
453
+ enabled: page.info !== null && page.busy === ""
454
+ checked: page.info !== null && page.info.piExtension !== "none"
455
+ onToggled: value => page.run("pi", ["hooks", value ? "install" : "uninstall", "pi"])
456
+ }
457
+
458
+ SettingsToggleRow {
459
+ visible: page.info !== null && page.info.omp === true
460
+ iconName: "extension"
461
+ text: "omp extension"
462
+ description: page.notes.omp || "Sessions and their cost from omp. Open sessions pick it up when omp restarts."
463
+ enabled: page.info !== null && page.busy === ""
464
+ checked: page.info !== null && page.info.ompExtension !== "none"
465
+ onToggled: value => page.run("omp", ["hooks", value ? "install" : "uninstall", "omp"])
466
+ }
467
+
468
+ // pi and omp run tools without asking. With this on, their extension
469
+ // waits for an answer here before rm -rf, sudo, git push --force,
470
+ // git reset --hard or curl | sh; no answer in 25 s blocks it.
471
+ SettingsToggleRow {
472
+ visible: page.info !== null && (page.info.pi === true || page.info.omp === true)
473
+ iconName: "gpp_maybe"
474
+ text: "Ask before risky commands"
475
+ description: page.notes.gate || "pi and omp wait for Allow or Deny here before rm -rf, sudo, force pushes and piped installs"
476
+ enabled: page.info !== null && page.busy === ""
477
+ checked: page.info !== null && page.info.gate === true
478
+ onToggled: value => page.run("gate", ["gate", value ? "on" : "off"])
479
+ }
480
+
481
+ // An npm install and an AUR install put Topside in different places;
482
+ // Claude Code may still run the other one, or an old via.
483
+ SettingsRow {
484
+ visible: page.otherCopy
485
+ iconName: "warning"
486
+ title: "An agent reports to another copy of Topside."
487
+ subtitle: page.notes.adopt || "Its hooks or status line point somewhere else, or to the old via"
488
+
489
+ DButton {
490
+ text: "Use this copy"
491
+ enabled: page.busy === ""
492
+ anchors.verticalCenter: parent.verticalCenter
493
+ onClicked: page.run("adopt", ["integrations", "adopt"])
494
+ }
495
+ }
496
+ }
497
+
498
+ SettingsSectionLabel {
499
+ width: parent.width
500
+ text: "Appearance"
501
+ }
502
+
503
+ SettingsGroup {
504
+ width: parent.width
505
+
506
+ SettingsButtonGroupRow {
507
+ iconName: "contrast"
508
+ text: "Mode"
509
+ description: page.appearance === "system" ? "Follows DMS's light or dark mode" : "Light or dark side of the theme"
510
+ model: ["Light", "Dark", "System"]
511
+ values: ["light", "dark", "system"]
512
+ value: page.appearance
513
+ onValueSelected: value => page.save("appearance", value)
514
+ }
515
+
516
+ SettingsRow {
517
+ iconName: "palette"
518
+ title: "Theme"
519
+ subtitle: "Each has a dark and a light side; yours go in ~/.config/topside/themes"
520
+
521
+ Row {
522
+ spacing: Theme.spacingXS
523
+ anchors.verticalCenter: parent.verticalCenter
524
+ DActionButton {
525
+ iconName: "chevron_left"
526
+ anchors.verticalCenter: parent.verticalCenter
527
+ onClicked: page.stepTheme(-1)
528
+ }
529
+ StyledText {
530
+ text: page.themeTitle(page.theme)
531
+ elide: Text.ElideRight
532
+ width: 110
533
+ horizontalAlignment: Text.AlignHCenter
534
+ anchors.verticalCenter: parent.verticalCenter
535
+ font.pixelSize: Theme.fontSizeMedium
536
+ font.weight: Theme.fontWeightMedium
537
+ color: Theme.surfaceText
538
+ }
539
+ DActionButton {
540
+ iconName: "chevron_right"
541
+ anchors.verticalCenter: parent.verticalCenter
542
+ onClicked: page.stepTheme(1)
543
+ }
544
+ }
545
+
546
+ // Three sample rows, one per status color, drawn in the theme in use.
547
+ body: Rectangle {
548
+ id: previewCard
549
+ width: parent.width
550
+ height: preview.implicitHeight + 24
551
+ radius: Theme.cornerRadius
552
+ color: Topside.Theme.bg
553
+ border.color: Topside.Theme.stroke
554
+ border.width: 1
555
+
556
+ readonly property real twoMinutesAgo: Date.now() - 120000
557
+
558
+ Column {
559
+ id: preview
560
+ x: 14
561
+ y: 12
562
+ width: parent.width - 28
563
+ spacing: 8
564
+ Repeater {
565
+ model: [
566
+ { id: "p1", agent: "claude", status: "working", title: "add dark mode", cwd: "~/webapp", lastPrompt: "add dark mode", activity: "Editing config.ts" },
567
+ { id: "p2", agent: "codex", status: "waiting", title: "fix the flaky test", cwd: "~/checkout-api", lastPrompt: "fix the flaky test", activity: "Running npm test" },
568
+ { id: "p3", agent: "claude", status: "done", title: "write API docs", cwd: "~/docs-site", lastPrompt: "write API docs", activity: "" },
569
+ ]
570
+ delegate: Topside.SessionRow {
571
+ required property var modelData
572
+ width: preview.width
573
+ session: Object.assign({ terminal: null, startedAt: previewCard.twoMinutesAgo, updatedAt: Date.now() }, modelData)
574
+ }
575
+ }
576
+ }
577
+ }
578
+ }
579
+
580
+ SettingsRow {
581
+ iconName: "format_size"
582
+ title: "Text size"
583
+ subtitle: "Prompt and status lines; the rest follows"
584
+
585
+ Stepper {
586
+ value: page.fontSize
587
+ minimum: 10
588
+ maximum: 14
589
+ onChosen: value => page.save("fontSize", value)
590
+ }
591
+ }
592
+ }
593
+
594
+ SettingsSectionLabel {
595
+ width: parent.width
596
+ text: "About"
597
+ }
598
+
599
+ // Shows things, changes nothing. The values can be selected and copied.
600
+ SettingsGroup {
601
+ width: parent.width
602
+
603
+ Item {
604
+ width: parent.width
605
+ implicitHeight: logo.height + slogan.implicitHeight + 40
606
+
607
+ Topside.AppLogo {
608
+ id: logo
609
+ cell: 3
610
+ color: Theme.surfaceText
611
+ y: 16
612
+ anchors.horizontalCenter: parent.horizontalCenter
613
+ }
614
+ StyledText {
615
+ id: slogan
616
+ text: "Every agent, one island."
617
+ y: logo.y + logo.height + 10
618
+ anchors.horizontalCenter: parent.horizontalCenter
619
+ font.pixelSize: Theme.fontSizeMedium
620
+ color: Theme.surfaceVariantText
621
+ }
622
+ }
623
+
624
+ Repeater {
625
+ model: page.info === null ? [] : [
626
+ { label: "Version", value: page.info.version },
627
+ { label: "Made by", value: page.info.author ?? "" },
628
+ { label: "Running from", value: page.info.runningFrom },
629
+ { label: "Data folder", value: page.info.dataFolder },
630
+ ].filter(row => row.value)
631
+ delegate: SettingsRow {
632
+ id: aboutRow
633
+ required property var modelData
634
+ title: modelData.label
635
+
636
+ TextEdit {
637
+ text: aboutRow.modelData.value
638
+ readOnly: true
639
+ selectByMouse: true
640
+ width: Math.min(implicitWidth, 320)
641
+ clip: true
642
+ anchors.verticalCenter: parent.verticalCenter
643
+ horizontalAlignment: Text.AlignRight
644
+ font.pixelSize: Theme.fontSizeMedium
645
+ color: Theme.surfaceVariantText
646
+ selectionColor: Theme.primary
647
+ }
648
+ }
649
+ }
650
+
651
+ StyledText {
652
+ width: parent.width
653
+ topPadding: 10
654
+ bottomPadding: 12
655
+ text: "Built with Quickshell for DankMaterialShell and Hyprland.\nAgent logos belong to their owners."
656
+ horizontalAlignment: Text.AlignHCenter
657
+ font.pixelSize: Theme.fontSizeSmall
658
+ color: Theme.surfaceVariantText
659
+ }
660
+ }
661
+ }
662
+ }
663
+
664
+ // − value +. DMS's DNumberStepper stacks vertically; settings rows want a line.
665
+ component Stepper: Row {
666
+ id: stepper
667
+ property int value
668
+ property int minimum
669
+ property int maximum
670
+ signal chosen(int value)
671
+
672
+ spacing: Theme.spacingXS
673
+
674
+ DActionButton {
675
+ iconName: "remove"
676
+ enabled: stepper.value > stepper.minimum
677
+ anchors.verticalCenter: parent.verticalCenter
678
+ onClicked: stepper.chosen(stepper.value - 1)
679
+ }
680
+ StyledText {
681
+ text: stepper.value
682
+ width: 24
683
+ horizontalAlignment: Text.AlignHCenter
684
+ anchors.verticalCenter: parent.verticalCenter
685
+ font.pixelSize: Theme.fontSizeLarge
686
+ font.weight: Theme.fontWeightMedium
687
+ color: Theme.surfaceText
688
+ }
689
+ DActionButton {
690
+ iconName: "add"
691
+ enabled: stepper.value < stepper.maximum
692
+ anchors.verticalCenter: parent.verticalCenter
693
+ onClicked: stepper.chosen(stepper.value + 1)
694
+ }
695
+ }
696
+ }