tinywebui 0.1.0

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 (96) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +586 -0
  3. package/bin/tinywebui.js +105 -0
  4. package/package.json +49 -0
  5. package/public/app.js +81 -0
  6. package/public/chat/attachments.js +304 -0
  7. package/public/chat/chat.js +282 -0
  8. package/public/chat/composer.js +289 -0
  9. package/public/chat/library.js +76 -0
  10. package/public/chat/outline.js +39 -0
  11. package/public/chat/queue.js +124 -0
  12. package/public/chat/sidebar.js +485 -0
  13. package/public/chat/stream.js +162 -0
  14. package/public/chat/tasks.js +36 -0
  15. package/public/chat/transcript.js +691 -0
  16. package/public/core/access.js +42 -0
  17. package/public/core/api.js +27 -0
  18. package/public/core/dom.js +13 -0
  19. package/public/core/id.js +7 -0
  20. package/public/core/md.js +131 -0
  21. package/public/core/state.js +31 -0
  22. package/public/favicon.svg +9 -0
  23. package/public/index.html +261 -0
  24. package/public/panels/admin.js +199 -0
  25. package/public/panels/automations.js +464 -0
  26. package/public/panels/panels.js +52 -0
  27. package/public/panels/settings.js +365 -0
  28. package/public/panels/usage.js +474 -0
  29. package/public/shared/attachment_note.js +23 -0
  30. package/public/shared/events.js +27 -0
  31. package/public/shared/features.js +21 -0
  32. package/public/shared/origins.js +8 -0
  33. package/public/shared/usage.js +59 -0
  34. package/public/styles.css +1455 -0
  35. package/public/themes/README.md +178 -0
  36. package/public/themes/cyber-grid/cyber-grid.css +59 -0
  37. package/public/themes/drivers/scene-kit.js +422 -0
  38. package/public/themes/fall-fairy/fall-fairy.css +221 -0
  39. package/public/themes/fall-fairy/fall-fairy.js +859 -0
  40. package/public/themes/manifest.json +6 -0
  41. package/public/themes/theme-loader.js +123 -0
  42. package/src/access/auth.js +228 -0
  43. package/src/access/auth_gate.js +67 -0
  44. package/src/access/policy.js +180 -0
  45. package/src/audit.js +7 -0
  46. package/src/automations/automation.js +136 -0
  47. package/src/automations/scheduler.js +147 -0
  48. package/src/chat/compact.js +242 -0
  49. package/src/chat/llm.js +448 -0
  50. package/src/chat/runs.js +180 -0
  51. package/src/chat/tool_executor.js +239 -0
  52. package/src/cli.js +478 -0
  53. package/src/config/approval.js +54 -0
  54. package/src/config/config.js +479 -0
  55. package/src/config/models.js +112 -0
  56. package/src/files/documents.js +91 -0
  57. package/src/files/images.js +62 -0
  58. package/src/harness/agent.js +115 -0
  59. package/src/harness/attribution.js +75 -0
  60. package/src/harness/checkpoint.js +96 -0
  61. package/src/harness/history.js +40 -0
  62. package/src/harness/prompt.js +93 -0
  63. package/src/harness/provider.js +430 -0
  64. package/src/http.js +95 -0
  65. package/src/log.js +24 -0
  66. package/src/mcp.js +405 -0
  67. package/src/retrieval/embedding.js +298 -0
  68. package/src/retrieval/retrieval.js +250 -0
  69. package/src/routes/admin.js +112 -0
  70. package/src/routes/auth.js +97 -0
  71. package/src/routes/automations.js +92 -0
  72. package/src/routes/chats.js +232 -0
  73. package/src/routes/documents.js +133 -0
  74. package/src/routes/library.js +51 -0
  75. package/src/routes/mcp.js +59 -0
  76. package/src/routes/settings.js +101 -0
  77. package/src/server.js +397 -0
  78. package/src/set-password.js +32 -0
  79. package/src/store/automations.js +119 -0
  80. package/src/store/chats.js +254 -0
  81. package/src/store/documents.js +256 -0
  82. package/src/store/embeddings.js +67 -0
  83. package/src/store/index.js +90 -0
  84. package/src/store/messages.js +93 -0
  85. package/src/store/schema.js +480 -0
  86. package/src/store/scope.js +43 -0
  87. package/src/store/search.js +56 -0
  88. package/src/store/turns.js +78 -0
  89. package/src/store/usage.js +327 -0
  90. package/src/store/users.js +102 -0
  91. package/src/store/wire.js +55 -0
  92. package/src/tools/ask_tool.js +93 -0
  93. package/src/tools/chat_search_tool.js +63 -0
  94. package/src/tools/context_tool.js +183 -0
  95. package/src/tools/document_tool.js +102 -0
  96. package/src/tools/task_tool.js +63 -0
@@ -0,0 +1,221 @@
1
+ /* ============================================================================
2
+ Fall Fairy — a skin, not a fork.
3
+
4
+ Every rule here is scoped under [data-theme="fall-fairy"], and the core app
5
+ is untouched: no class, id, or attribute in this file is one that app.js
6
+ does not already produce for its own reasons.
7
+
8
+ The moving scenery lives in fall-fairy.js and paints on two canvases this
9
+ file positions: one behind the page, one in front of it. This half's job is
10
+ the part a canvas must not do — keep the transcript readable while a forest
11
+ is going on behind it.
12
+ ========================================================================== */
13
+
14
+ /* ------------------------------------------------------------------ type */
15
+
16
+ /* The one thing in this file that reaches outside the machine: four families
17
+ from Google Fonts. Every one of them has a full local fallback stack below,
18
+ so a TinyWebUI running on a box with no internet gets the same layout in
19
+ system faces rather than a blank page — nothing here is load-bearing. If you
20
+ would rather not call out at all, drop this @import and the stacks take
21
+ over; if you would rather it never call out, the four .woff2 files are small
22
+ enough to sit next to this file.
23
+
24
+ Grandstander headings and the title — bouncy, storybook, a bit game-like
25
+ Quicksand everything you read — rounded and very legible at 17px
26
+ Space Mono the machine's own voice — timestamps, tools, code, status
27
+ Caveat her line in the clearing — handwritten, used exactly once */
28
+ @import url("https://fonts.googleapis.com/css2?family=Grandstander:wght@500;600;700&family=Quicksand:wght@400;500;600;700&family=Space+Mono:wght@400;700&family=Caveat:wght@500;600&display=swap");
29
+
30
+ /* ---------------------------------------------------------------- palette */
31
+
32
+ :root[data-theme="fall-fairy"] {
33
+ --bg: #fdf5e9; --panel: #f6e8d4; --line: #dcbd91; --fg: #40271a;
34
+ --muted: #77563a; --faint: #997750; --accent: #b5482e; --tool: #4f7a3f; --err: #9c3b3b;
35
+
36
+ /* Scene-only tokens. fall-fairy.js reads these off the root element, so the
37
+ canvas and the chrome are never two different autumns — and dark mode
38
+ below re-tints the whole forest by changing nothing but these lines. */
39
+ --ff-sky-hi: #f7dcac;
40
+ --ff-sky-lo: #e79a5c;
41
+ --ff-hill-far: #c08a63;
42
+ --ff-hill-mid: #a4663f;
43
+ --ff-hill-near: #7d452a;
44
+ --ff-tree: #5c3220;
45
+ --ff-canopy-a: #c85a24;
46
+ --ff-canopy-b: #d98b2b;
47
+ --ff-canopy-c: #9c6b2a;
48
+ --ff-leaf-a: #c0562c;
49
+ --ff-leaf-b: #dc9a33;
50
+ --ff-leaf-c: #8d7a2f;
51
+ --ff-glow: #ffdf9e;
52
+ --ff-wing: #fff6de;
53
+ --ff-star: #fff3d2;
54
+ --ff-stars: 0; /* stars are a night thing; see the dark block */
55
+
56
+ --ff-scrim: 84%; /* how solid the reading surfaces sit over the scene */
57
+
58
+ /* --mono is the app's own variable: overriding it here re-voices every
59
+ timestamp, tool name, code block and status line in one line, with no
60
+ rule in this file having to name any of them. */
61
+ --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
62
+ --ff-display: "Grandstander", "Iowan Old Style", Georgia, "Segoe UI", sans-serif;
63
+ --ff-body: "Quicksand", "Segoe UI Variable", ui-rounded, "Segoe UI", sans-serif;
64
+ --ff-hand: "Caveat", "Segoe Script", "Bradley Hand", cursive;
65
+ }
66
+
67
+ @media (prefers-color-scheme: dark) {
68
+ :root[data-theme="fall-fairy"] {
69
+ --bg: #1d1628; --panel: #281e35; --line: #4b3860; --fg: #f4e6d2;
70
+ --muted: #c7a8dc; --faint: #a184be; --accent: #f0a24a; --tool: #7fd9a8; --err: #f28b7d;
71
+
72
+ --ff-sky-hi: #211730; --ff-sky-lo: #4a2a3f;
73
+ --ff-hill-far: #33233f; --ff-hill-mid: #261a31; --ff-hill-near: #1b1224;
74
+ --ff-tree: #120c1a;
75
+ --ff-canopy-a: #40243a; --ff-canopy-b: #522e37; --ff-canopy-c: #33203a;
76
+ --ff-leaf-a: #8a3f2a; --ff-leaf-b: #9a6a2c; --ff-leaf-c: #5c4a2a;
77
+ --ff-glow: #ffd98a; --ff-wing: #dff3ff; --ff-star: #fff3d2;
78
+ --ff-stars: 1;
79
+ --ff-scrim: 88%;
80
+ }
81
+ }
82
+
83
+ /* --------------------------------------------------- the reading surfaces */
84
+
85
+ /* body's own opaque background is the one thing standing between the page and
86
+ the scene behind it, so it goes — and every surface that carries text gets a
87
+ scrim of its own instead. Prose contrast is unchanged from the plain theme:
88
+ the forest is only ever allowed behind a wash, never behind a paragraph. */
89
+ [data-theme="fall-fairy"] body { background: transparent; }
90
+
91
+ [data-theme="fall-fairy"] #log,
92
+ [data-theme="fall-fairy"] header,
93
+ [data-theme="fall-fairy"] footer {
94
+ background: color-mix(in srgb, var(--bg) var(--ff-scrim), transparent);
95
+ backdrop-filter: blur(7px);
96
+ }
97
+ [data-theme="fall-fairy"] aside,
98
+ [data-theme="fall-fairy"] #settings,
99
+ [data-theme="fall-fairy"] .sec-bar {
100
+ background: color-mix(in srgb, var(--panel) 95%, transparent);
101
+ backdrop-filter: blur(12px);
102
+ }
103
+ /* These sit on --panel, which is translucent now; a mono block over a tree is
104
+ exactly the case the scrim above is not strong enough for. */
105
+ [data-theme="fall-fairy"] .md pre,
106
+ [data-theme="fall-fairy"] .step pre,
107
+ [data-theme="fall-fairy"] .tool .doc,
108
+ [data-theme="fall-fairy"] .tool-group,
109
+ [data-theme="fall-fairy"] .md th {
110
+ background: color-mix(in srgb, var(--panel) 97%, transparent);
111
+ }
112
+
113
+ /* scene-kit places its own canvases inline — position, hit-testing and depth
114
+ are part of the runtime's contract, not something each skin restates. */
115
+
116
+ /* ------------------------------------------------------------ typography */
117
+
118
+ /* One rule re-voices the whole app: styles.css sets body's font in a shorthand
119
+ and everything else inherits it, either literally or through `font: inherit`
120
+ on the controls. Buttons, inputs, the composer, the sidebar and the settings
121
+ panel all follow from here without being named. */
122
+ [data-theme="fall-fairy"] body {
123
+ font-family: var(--ff-body);
124
+ font-weight: 500;
125
+ letter-spacing: .005em;
126
+ }
127
+ /* Quicksand's lowercase runs small for its em, and the transcript is the one
128
+ place that has to stay comfortable for a long read. */
129
+ [data-theme="fall-fairy"] #log { font-size: calc(var(--fs-body) * 1.04); }
130
+
131
+ [data-theme="fall-fairy"] header h1,
132
+ [data-theme="fall-fairy"] .sec-h,
133
+ [data-theme="fall-fairy"] .md h1,
134
+ [data-theme="fall-fairy"] .md h2,
135
+ [data-theme="fall-fairy"] .md h3,
136
+ [data-theme="fall-fairy"] .md h4,
137
+ [data-theme="fall-fairy"] aside .head button,
138
+ [data-theme="fall-fairy"] button.primary {
139
+ font-family: var(--ff-display);
140
+ font-weight: 600;
141
+ letter-spacing: .01em;
142
+ }
143
+ /* .sec-h is uppercase mono in the base sheet; Grandstander is neither, so the
144
+ tracking that made the mono caps readable now just pulls it apart. */
145
+ [data-theme="fall-fairy"] .sec-h { letter-spacing: .04em; text-transform: lowercase; }
146
+ [data-theme="fall-fairy"] header h1 { font-size: 1.1rem; }
147
+ [data-theme="fall-fairy"] header h1::after { content: " \1F342"; font-size: .8em; }
148
+
149
+ /* The mono voice stays mono — Space Mono arrives through --mono above, which
150
+ the base sheet already points at for every one of these. It runs wide, so
151
+ the label-sized uses get their tracking wound back in. */
152
+ [data-theme="fall-fairy"] .who,
153
+ [data-theme="fall-fairy"] .hit-role,
154
+ [data-theme="fall-fairy"] details.work > summary,
155
+ [data-theme="fall-fairy"] details.think > summary,
156
+ [data-theme="fall-fairy"] button.linkish,
157
+ [data-theme="fall-fairy"] #status {
158
+ letter-spacing: .01em;
159
+ }
160
+ /* Space Mono's default weight is light for small caps on a scrim. */
161
+ [data-theme="fall-fairy"] .usage,
162
+ [data-theme="fall-fairy"] .step .ms,
163
+ [data-theme="fall-fairy"] #status { font-weight: 700; }
164
+
165
+ /* The question keeps its accent rail, lit like a lantern. */
166
+ [data-theme="fall-fairy"] .msg.user .body {
167
+ box-shadow: -3px 0 10px -3px color-mix(in srgb, var(--accent) 60%, transparent);
168
+ }
169
+ /* The answer landing is the payoff of the whole chase, so it gets the single
170
+ flourish in the transcript: the fairy who found it signs the line. */
171
+ [data-theme="fall-fairy"] .msg.assistant.final .who::after {
172
+ content: " \2726";
173
+ color: var(--ff-glow);
174
+ text-shadow: 0 0 6px var(--ff-glow);
175
+ }
176
+
177
+ /* A step still running: the trailing ellipsis becomes her spark. */
178
+ [data-theme="fall-fairy"] .work.live .act::after {
179
+ content: " \2726";
180
+ color: var(--ff-glow);
181
+ text-shadow: 0 0 6px var(--ff-glow);
182
+ animation: ff-twinkle 2s ease-in-out infinite;
183
+ }
184
+ @keyframes ff-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
185
+
186
+ /* A turn still running in a chat you are not looking at: one of them is still
187
+ out there with a lantern. */
188
+ [data-theme="fall-fairy"] .chat-item .dot {
189
+ background: var(--ff-glow);
190
+ box-shadow: 0 0 6px var(--ff-glow);
191
+ }
192
+
193
+ /* ---------------------------------------------------------- the clearing */
194
+
195
+ /* A brand-new chat is the one moment the app leaves an empty stage, and it
196
+ says so in markup all by itself: #wrap with no children. The canvas reads
197
+ the same state and seats a fairy on her pumpkin down there; this is the
198
+ room made for her, and the line she is waiting on. */
199
+ [data-theme="fall-fairy"] #wrap:empty {
200
+ min-height: min(30rem, 62vh);
201
+ align-items: center; justify-content: flex-end;
202
+ padding-bottom: min(15rem, 34vh);
203
+ }
204
+ [data-theme="fall-fairy"] #wrap:empty::after {
205
+ content: "ask, and we'll go find it";
206
+ font-family: var(--ff-hand);
207
+ font-size: 1.85rem; font-weight: 600;
208
+ color: var(--muted);
209
+ text-align: center;
210
+ text-shadow: 0 0 12px color-mix(in srgb, var(--bg) 80%, transparent);
211
+ animation: ff-breathe 9s ease-in-out infinite;
212
+ }
213
+ @keyframes ff-breathe {
214
+ 0%, 100% { opacity: .75; }
215
+ 50% { opacity: 1; }
216
+ }
217
+
218
+ @media (prefers-reduced-motion: reduce) {
219
+ [data-theme="fall-fairy"] .work.live .act::after,
220
+ [data-theme="fall-fairy"] #wrap:empty::after { animation: none; }
221
+ }