@openagt/dashboard 0.37.0 → 0.39.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 (225) hide show
  1. package/dist/client.d.ts +1 -0
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +1 -0
  4. package/dist/client.js.map +1 -1
  5. package/dist/computer-name.d.ts +3 -0
  6. package/dist/computer-name.d.ts.map +1 -0
  7. package/dist/computer-name.js +6 -0
  8. package/dist/computer-name.js.map +1 -0
  9. package/dist/daemon-runtime.d.ts.map +1 -1
  10. package/dist/daemon-runtime.js +64 -7
  11. package/dist/daemon-runtime.js.map +1 -1
  12. package/dist/daemon.d.ts.map +1 -1
  13. package/dist/daemon.js +6 -1
  14. package/dist/daemon.js.map +1 -1
  15. package/dist/dashboard/compress.d.ts +23 -0
  16. package/dist/dashboard/compress.d.ts.map +1 -0
  17. package/dist/dashboard/compress.js +55 -0
  18. package/dist/dashboard/compress.js.map +1 -0
  19. package/dist/dashboard/copied-logins.d.ts +54 -0
  20. package/dist/dashboard/copied-logins.d.ts.map +1 -0
  21. package/dist/dashboard/copied-logins.js +60 -0
  22. package/dist/dashboard/copied-logins.js.map +1 -0
  23. package/dist/dashboard/copy-logins.d.ts +5 -1
  24. package/dist/dashboard/copy-logins.d.ts.map +1 -1
  25. package/dist/dashboard/copy-logins.js +9 -3
  26. package/dist/dashboard/copy-logins.js.map +1 -1
  27. package/dist/dashboard/git-hosts.d.ts +2 -0
  28. package/dist/dashboard/git-hosts.d.ts.map +1 -1
  29. package/dist/dashboard/git-hosts.js +1 -1
  30. package/dist/dashboard/git-hosts.js.map +1 -1
  31. package/dist/dashboard/logins-sync.d.ts +146 -0
  32. package/dist/dashboard/logins-sync.d.ts.map +1 -0
  33. package/dist/dashboard/logins-sync.js +344 -0
  34. package/dist/dashboard/logins-sync.js.map +1 -0
  35. package/dist/dashboard/machine-runs.d.ts +111 -0
  36. package/dist/dashboard/machine-runs.d.ts.map +1 -0
  37. package/dist/dashboard/machine-runs.js +252 -0
  38. package/dist/dashboard/machine-runs.js.map +1 -0
  39. package/dist/dashboard/module-agents.d.ts +44 -0
  40. package/dist/dashboard/module-agents.d.ts.map +1 -0
  41. package/dist/dashboard/module-agents.js +25 -0
  42. package/dist/dashboard/module-agents.js.map +1 -0
  43. package/dist/dashboard/module-serve.d.ts +10 -1
  44. package/dist/dashboard/module-serve.d.ts.map +1 -1
  45. package/dist/dashboard/module-serve.js +25 -6
  46. package/dist/dashboard/module-serve.js.map +1 -1
  47. package/dist/dashboard/relay-endpoints.d.ts +8 -4
  48. package/dist/dashboard/relay-endpoints.d.ts.map +1 -1
  49. package/dist/dashboard/relay-endpoints.js +41 -9
  50. package/dist/dashboard/relay-endpoints.js.map +1 -1
  51. package/dist/dashboard/remote-run.d.ts +18 -3
  52. package/dist/dashboard/remote-run.d.ts.map +1 -1
  53. package/dist/dashboard/remote-run.js +32 -5
  54. package/dist/dashboard/remote-run.js.map +1 -1
  55. package/dist/dashboard/rpc-serve.d.ts +8 -2
  56. package/dist/dashboard/rpc-serve.d.ts.map +1 -1
  57. package/dist/dashboard/rpc-serve.js +41 -11
  58. package/dist/dashboard/rpc-serve.js.map +1 -1
  59. package/dist/dashboard/runs-watch.d.ts +32 -0
  60. package/dist/dashboard/runs-watch.d.ts.map +1 -0
  61. package/dist/dashboard/runs-watch.js +89 -0
  62. package/dist/dashboard/runs-watch.js.map +1 -0
  63. package/dist/dashboard/server.d.ts +4 -2
  64. package/dist/dashboard/server.d.ts.map +1 -1
  65. package/dist/dashboard/server.js +1 -1
  66. package/dist/dashboard/server.js.map +1 -1
  67. package/dist/dashboard/static.d.ts.map +1 -1
  68. package/dist/dashboard/static.js +8 -6
  69. package/dist/dashboard/static.js.map +1 -1
  70. package/dist/dashboard-bundle/assets/host/module-CUc1n2SP.js +1 -0
  71. package/dist/dashboard-bundle/assets/host/react-B7Fi4tYT.js +1 -0
  72. package/dist/dashboard-bundle/assets/host/react-dom-client-owmMVl4T.js +1 -0
  73. package/dist/dashboard-bundle/assets/host/react-dom-oeGwGKD7.js +1 -0
  74. package/dist/dashboard-bundle/assets/host/react-jsx-runtime-Dxx08tyw.js +1 -0
  75. package/dist/dashboard-bundle/assets/main-Cv9CrCec.css +2 -0
  76. package/dist/dashboard-bundle/assets/main-dejlwmyP.js +149 -0
  77. package/dist/dashboard-bundle/assets/module-DR2oCWs5.js +14 -0
  78. package/dist/dashboard-bundle/index.html +10 -9
  79. package/dist/dashboard-rpc/accounts.d.ts +17 -1
  80. package/dist/dashboard-rpc/accounts.d.ts.map +1 -1
  81. package/dist/dashboard-rpc/accounts.js +46 -8
  82. package/dist/dashboard-rpc/accounts.js.map +1 -1
  83. package/dist/dashboard-rpc/context.js +1 -1
  84. package/dist/dashboard-rpc/context.js.map +1 -1
  85. package/dist/dashboard-rpc/copied-logins.d.ts +49 -0
  86. package/dist/dashboard-rpc/copied-logins.d.ts.map +1 -0
  87. package/dist/dashboard-rpc/copied-logins.js +179 -0
  88. package/dist/dashboard-rpc/copied-logins.js.map +1 -0
  89. package/dist/dashboard-rpc/index.d.ts +6 -3
  90. package/dist/dashboard-rpc/index.d.ts.map +1 -1
  91. package/dist/dashboard-rpc/index.js +10 -4
  92. package/dist/dashboard-rpc/index.js.map +1 -1
  93. package/dist/dashboard-rpc/logins.d.ts +18 -0
  94. package/dist/dashboard-rpc/logins.d.ts.map +1 -1
  95. package/dist/dashboard-rpc/logins.js +51 -7
  96. package/dist/dashboard-rpc/logins.js.map +1 -1
  97. package/dist/dashboard-rpc/machines.d.ts +15 -2
  98. package/dist/dashboard-rpc/machines.d.ts.map +1 -1
  99. package/dist/dashboard-rpc/machines.js +32 -8
  100. package/dist/dashboard-rpc/machines.js.map +1 -1
  101. package/dist/dashboard-rpc/modules.d.ts +9 -9
  102. package/dist/dashboard-rpc/modules.d.ts.map +1 -1
  103. package/dist/dashboard-rpc/modules.js +14 -13
  104. package/dist/dashboard-rpc/modules.js.map +1 -1
  105. package/dist/dashboard-rpc/people.d.ts +16 -0
  106. package/dist/dashboard-rpc/people.d.ts.map +1 -0
  107. package/dist/dashboard-rpc/people.js +32 -0
  108. package/dist/dashboard-rpc/people.js.map +1 -0
  109. package/dist/dashboard-rpc/reads.d.ts +29 -1
  110. package/dist/dashboard-rpc/reads.d.ts.map +1 -1
  111. package/dist/dashboard-rpc/reads.js +111 -8
  112. package/dist/dashboard-rpc/reads.js.map +1 -1
  113. package/dist/dashboard-rpc/relay-dispatch.d.ts +6 -0
  114. package/dist/dashboard-rpc/relay-dispatch.d.ts.map +1 -1
  115. package/dist/dashboard-rpc/relay-dispatch.js +25 -2
  116. package/dist/dashboard-rpc/relay-dispatch.js.map +1 -1
  117. package/dist/dashboard-rpc/runs-changed.d.ts +8 -0
  118. package/dist/dashboard-rpc/runs-changed.d.ts.map +1 -0
  119. package/dist/dashboard-rpc/runs-changed.js +62 -0
  120. package/dist/dashboard-rpc/runs-changed.js.map +1 -0
  121. package/dist/dashboard-rpc/server-logins.d.ts +22 -0
  122. package/dist/dashboard-rpc/server-logins.d.ts.map +1 -0
  123. package/dist/dashboard-rpc/server-logins.js +26 -0
  124. package/dist/dashboard-rpc/server-logins.js.map +1 -0
  125. package/dist/dashboard-rpc/test-context.js +1 -1
  126. package/dist/dashboard-rpc/test-context.js.map +1 -1
  127. package/dist/health.d.ts +20 -0
  128. package/dist/health.d.ts.map +1 -0
  129. package/dist/health.js +98 -0
  130. package/dist/health.js.map +1 -0
  131. package/dist/index.d.ts +1 -0
  132. package/dist/index.d.ts.map +1 -1
  133. package/dist/module-types/dashboard/components/FilterChips.d.ts +12 -0
  134. package/dist/module-types/dashboard/components/Page.d.ts +12 -0
  135. package/dist/module-types/dashboard/components/SidebarToggle.d.ts +4 -0
  136. package/dist/module-types/dashboard/components/StatTile.d.ts +15 -0
  137. package/dist/module-types/dashboard/components/ui/sheet.d.ts +10 -0
  138. package/dist/module-types/dashboard/components/ui/sidebar.d.ts +71 -0
  139. package/dist/module-types/dashboard/lib/use-async.d.ts +24 -6
  140. package/dist/module-types/dashboard/lib/use-mobile.d.ts +4 -0
  141. package/dist/module-types/dashboard/lib/use-modules.d.ts +7 -3
  142. package/dist/module-types/dashboard/module/index.d.ts +42 -15
  143. package/dist/module-types/src/client.d.ts +1 -0
  144. package/dist/module-types/src/computer-name.d.ts +2 -0
  145. package/dist/module-types/src/dashboard/compress.d.ts +22 -0
  146. package/dist/module-types/src/dashboard/copied-logins.d.ts +53 -0
  147. package/dist/module-types/src/dashboard/git-hosts.d.ts +2 -0
  148. package/dist/module-types/src/dashboard/logins-sync.d.ts +145 -0
  149. package/dist/module-types/src/dashboard/machine-runs.d.ts +110 -0
  150. package/dist/module-types/src/dashboard/module-agents.d.ts +43 -0
  151. package/dist/module-types/src/dashboard/module-serve.d.ts +10 -1
  152. package/dist/module-types/src/dashboard/remote-run.d.ts +18 -3
  153. package/dist/module-types/src/dashboard/rpc-serve.d.ts +8 -2
  154. package/dist/module-types/src/dashboard/runs-watch.d.ts +31 -0
  155. package/dist/module-types/src/dashboard-rpc/accounts.d.ts +17 -1
  156. package/dist/module-types/src/dashboard-rpc/copied-logins.d.ts +48 -0
  157. package/dist/module-types/src/dashboard-rpc/index.d.ts +6 -3
  158. package/dist/module-types/src/dashboard-rpc/logins.d.ts +18 -0
  159. package/dist/module-types/src/dashboard-rpc/machines.d.ts +15 -2
  160. package/dist/module-types/src/dashboard-rpc/modules.d.ts +9 -9
  161. package/dist/module-types/src/dashboard-rpc/people.d.ts +15 -0
  162. package/dist/module-types/src/dashboard-rpc/reads.d.ts +29 -1
  163. package/dist/module-types/src/dashboard-rpc/runs-changed.d.ts +7 -0
  164. package/dist/module-types/src/dashboard-rpc/server-logins.d.ts +21 -0
  165. package/dist/module-types/src/health.d.ts +19 -0
  166. package/dist/module-types/src/index.d.ts +1 -0
  167. package/dist/module-types/src/overview-layout.d.ts +37 -0
  168. package/dist/module-types/src/project-hooks.d.ts +11 -1
  169. package/dist/module-types/src/registry.d.ts +14 -0
  170. package/dist/module-types/src/store/agent-store.d.ts +15 -1
  171. package/dist/module-types/src/store/branches.d.ts +2 -2
  172. package/dist/module-types/src/store/git-host.d.ts +8 -2
  173. package/dist/module-types/src/store/provided.d.ts +5 -4
  174. package/dist/module-types/src/store/queue.d.ts +3 -2
  175. package/dist/module-types/src/store/runs.d.ts +6 -3
  176. package/dist/module-types/src/store/tickets.d.ts +3 -2
  177. package/dist/module.css +1 -1
  178. package/dist/overview-layout.d.ts +38 -0
  179. package/dist/overview-layout.d.ts.map +1 -0
  180. package/dist/overview-layout.js +61 -0
  181. package/dist/overview-layout.js.map +1 -0
  182. package/dist/project-hooks.d.ts +11 -1
  183. package/dist/project-hooks.d.ts.map +1 -1
  184. package/dist/project-hooks.js +21 -11
  185. package/dist/project-hooks.js.map +1 -1
  186. package/dist/registry.d.ts +14 -0
  187. package/dist/registry.d.ts.map +1 -1
  188. package/dist/registry.js +31 -2
  189. package/dist/registry.js.map +1 -1
  190. package/dist/store/agent-store.d.ts +15 -1
  191. package/dist/store/agent-store.d.ts.map +1 -1
  192. package/dist/store/agent-store.js.map +1 -1
  193. package/dist/store/branches.d.ts +2 -2
  194. package/dist/store/branches.d.ts.map +1 -1
  195. package/dist/store/branches.js +8 -2
  196. package/dist/store/branches.js.map +1 -1
  197. package/dist/store/git-host.d.ts +8 -2
  198. package/dist/store/git-host.d.ts.map +1 -1
  199. package/dist/store/git-host.js +21 -2
  200. package/dist/store/git-host.js.map +1 -1
  201. package/dist/store/provided.d.ts +5 -4
  202. package/dist/store/provided.d.ts.map +1 -1
  203. package/dist/store/provided.js +10 -9
  204. package/dist/store/provided.js.map +1 -1
  205. package/dist/store/queue.d.ts +3 -2
  206. package/dist/store/queue.d.ts.map +1 -1
  207. package/dist/store/queue.js +9 -2
  208. package/dist/store/queue.js.map +1 -1
  209. package/dist/store/runs.d.ts +6 -3
  210. package/dist/store/runs.d.ts.map +1 -1
  211. package/dist/store/runs.js +10 -3
  212. package/dist/store/runs.js.map +1 -1
  213. package/dist/store/tickets.d.ts +3 -2
  214. package/dist/store/tickets.d.ts.map +1 -1
  215. package/dist/store/tickets.js +9 -2
  216. package/dist/store/tickets.js.map +1 -1
  217. package/package.json +23 -23
  218. package/dist/dashboard-bundle/assets/main-B_YIbzfX.js +0 -148
  219. package/dist/dashboard-bundle/assets/main-COZtHuZ-.css +0 -2
  220. package/dist/dashboard-bundle/assets/module-B_KMN8r0.js +0 -14
  221. package/dist/dashboard-bundle/host/module.js +0 -1
  222. package/dist/dashboard-bundle/host/react-dom-client.js +0 -1
  223. package/dist/dashboard-bundle/host/react-dom.js +0 -1
  224. package/dist/dashboard-bundle/host/react-jsx-runtime.js +0 -1
  225. package/dist/dashboard-bundle/host/react.js +0 -1
@@ -0,0 +1,62 @@
1
+ import { ownRunsWatch } from '../dashboard/runs-watch.js';
2
+ import { contextProjects, contextRemote } from './context.js';
3
+ /** How often the projects are listed again while a page listens: a project added since is followed too. */
4
+ const PROJECTS_EVERY_MS = 30_000;
5
+ /** Changes that come together are told once: a run that ends changes its card, then its record. */
6
+ const TOGETHER_MS = 200;
7
+ /** Tell `send` each time the runs of a project on the list change, until the answer is called. */
8
+ export function followRunsChanged(send) {
9
+ const followed = new Map();
10
+ const told = new Map();
11
+ let stopped = false;
12
+ const tell = (projectId) => {
13
+ if (stopped || told.has(projectId))
14
+ return;
15
+ told.set(projectId, setTimeout(() => {
16
+ told.delete(projectId);
17
+ if (!stopped)
18
+ send({ kind: 'runs', projectId });
19
+ }, TOGETHER_MS));
20
+ };
21
+ const follow = async () => {
22
+ const projects = await contextProjects()
23
+ .list()
24
+ .catch(() => undefined);
25
+ if (stopped || projects === undefined)
26
+ return;
27
+ const paths = new Map(projects.map(project => [project.id, project.path]));
28
+ for (const [id, one] of followed) {
29
+ if (paths.get(id) === one.path)
30
+ continue;
31
+ one.stop();
32
+ followed.delete(id);
33
+ }
34
+ for (const project of projects) {
35
+ if (followed.has(project.id))
36
+ continue;
37
+ const own = ownRunsWatch.follow(project.path, () => tell(project.id));
38
+ const machines = contextRemote().followRuns(project.path, () => tell(project.id));
39
+ followed.set(project.id, {
40
+ path: project.path,
41
+ stop: () => {
42
+ own();
43
+ machines();
44
+ },
45
+ });
46
+ }
47
+ };
48
+ void follow();
49
+ const timer = setInterval(() => void follow(), PROJECTS_EVERY_MS);
50
+ timer.unref?.();
51
+ return () => {
52
+ stopped = true;
53
+ clearInterval(timer);
54
+ for (const one of followed.values())
55
+ one.stop();
56
+ followed.clear();
57
+ for (const timeout of told.values())
58
+ clearTimeout(timeout);
59
+ told.clear();
60
+ };
61
+ }
62
+ //# sourceMappingURL=runs-changed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs-changed.js","sourceRoot":"","sources":["../../src/dashboard-rpc/runs-changed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAY7D,2GAA2G;AAC3G,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAChC,mGAAmG;AACnG,MAAM,WAAW,GAAG,GAAG,CAAA;AAEvB,kGAAkG;AAClG,MAAM,UAAU,iBAAiB,CAAC,IAAmC;IACnE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA8C,CAAA;IACtE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAyC,CAAA;IAC7D,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,MAAM,IAAI,GAAG,CAAC,SAAiB,EAAQ,EAAE;QACvC,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,OAAM;QAC1C,IAAI,CAAC,GAAG,CACN,SAAS,EACT,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;YACtB,IAAI,CAAC,OAAO;gBAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC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;oBACT,GAAG,EAAE,CAAA;oBACL,QAAQ,EAAE,CAAA;gBACZ,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CAAA;IACD,KAAK,MAAM,EAAE,CAAA;IACb,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAA;IACjE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAA;IACf,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,IAAI,CAAA;QACd,aAAa,CAAC,KAAK,CAAC,CAAA;QACpB,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE;YAAE,GAAG,CAAC,IAAI,EAAE,CAAA;QAC/C,QAAQ,CAAC,KAAK,EAAE,CAAA;QAChB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE;YAAE,YAAY,CAAC,OAAO,CAAC,CAAA;QAC1D,IAAI,CAAC,KAAK,EAAE,CAAA;IACd,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type ServerLogins } from '../dashboard/logins-sync.js';
2
+ import type { CopiedKind } from '../dashboard/copied-logins.js';
3
+ import type { AccountResult } from './accounts.js';
4
+ export type { ServerLogins, LoginThere } from '../dashboard/logins-sync.js';
5
+ export interface ServerLoginsView {
6
+ /** This computer's own name: what a server says its logins are from. */
7
+ computer: string;
8
+ servers: ServerLogins[];
9
+ }
10
+ /** Each saved server of the person's, and how this computer's logins stand there. */
11
+ export declare function onServerLogins(): Promise<ServerLoginsView>;
12
+ /** A server uses this computer's logins from now on: what can go there goes now. */
13
+ export declare function sendUseLoginsOn(machineId: string): Promise<AccountResult>;
14
+ /** The press: a login of the server's own for each account that waits for one, made in this computer's browser. */
15
+ export declare function sendAllowLogins(machineId: string): Promise<AccountResult>;
16
+ /** A login the server has of this computer's that this computer no longer has: kept there, or taken off. */
17
+ export declare function sendSettleLogin(machineId: string, which: {
18
+ kind: CopiedKind;
19
+ host?: string;
20
+ source: string;
21
+ }, keep: boolean): Promise<AccountResult>;
22
+ //# sourceMappingURL=server-logins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-logins.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/server-logins.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqD,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAClH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAOlD,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE3E,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB;AAED,qFAAqF;AACrF,wBAAsB,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAIhE;AAED,oFAAoF;AACpF,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAI/E;AAED,mHAAmH;AACnH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAE/E;AAED,4GAA4G;AAC5G,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAE1J"}
@@ -0,0 +1,26 @@
1
+ import { computerName } from '../computer-name.js';
2
+ import { useLoginsOn } from '../registry.js';
3
+ import { allowLogins, serverLogins, settleLeft, syncLogins } from '../dashboard/logins-sync.js';
4
+ /** Each saved server of the person's, and how this computer's logins stand there. */
5
+ export async function onServerLogins() {
6
+ // A server uses the logins of the person's computers, and makes none for another.
7
+ if (process.env['OPENAGENT_SERVER'] === '1')
8
+ return { computer: computerName(), servers: [] };
9
+ return { computer: computerName(), servers: await serverLogins() };
10
+ }
11
+ /** A server uses this computer's logins from now on: what can go there goes now. */
12
+ export async function sendUseLoginsOn(machineId) {
13
+ if (!(await useLoginsOn(machineId, true)))
14
+ return { ok: false, error: 'That server is no longer saved.' };
15
+ await syncLogins();
16
+ return { ok: true };
17
+ }
18
+ /** The press: a login of the server's own for each account that waits for one, made in this computer's browser. */
19
+ export async function sendAllowLogins(machineId) {
20
+ return allowLogins(machineId);
21
+ }
22
+ /** A login the server has of this computer's that this computer no longer has: kept there, or taken off. */
23
+ export async function sendSettleLogin(machineId, which, keep) {
24
+ return settleLeft(machineId, which, keep === true);
25
+ }
26
+ //# sourceMappingURL=server-logins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-logins.js","sourceRoot":"","sources":["../../src/dashboard-rpc/server-logins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAqB,MAAM,6BAA6B,CAAA;AAiBlH,qFAAqF;AACrF,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,kFAAkF;IAClF,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,GAAG;QAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;IAC7F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,YAAY,EAAE,EAAE,CAAA;AACpE,CAAC;AAED,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,SAAiB;IACrD,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,iCAAiC,EAAE,CAAA;IACzG,MAAM,UAAU,EAAE,CAAA;IAClB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AACrB,CAAC;AAED,mHAAmH;AACnH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,SAAiB;IACrD,OAAO,WAAW,CAAC,SAAS,CAAC,CAAA;AAC/B,CAAC;AAED,4GAA4G;AAC5G,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,SAAiB,EAAE,KAA0D,EAAE,IAAa;IAChI,OAAO,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC,CAAA;AACpD,CAAC"}
@@ -15,7 +15,7 @@ export function testDashboardContext(over = {}) {
15
15
  startedIn: () => ({ ok: false, error: 'not wired in this test' }),
16
16
  removeProject: () => ({ ok: false, error: 'not wired in this test' }),
17
17
  eventsSource: () => undefined,
18
- remote: { target: () => undefined, list: () => [], working: () => false, rekey: () => { }, sent: () => true, home: async () => undefined, follow: async () => { }, machineNames: async () => () => undefined },
18
+ remote: { target: () => undefined, list: () => [], working: () => false, rekey: () => { }, sent: () => true, home: async () => undefined, follow: async () => { }, machineNames: async () => () => undefined, machineRuns: async () => [], followRuns: () => () => { } },
19
19
  preferences: registryPreferencesStore(),
20
20
  quota: defaultQuotaSource(),
21
21
  models: { read: async () => ({ 'claude-code': { models: [] }, codex: { models: [] } }) },
@@ -1 +1 @@
1
- {"version":3,"file":"test-context.js","sourceRoot":"","sources":["../../src/dashboard-rpc/test-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAI1D;;;;;;GAMG;AACH,MA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I,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE;QAC3H,GAAG,IAAI;KACR,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAI,GAA8B,EAAE;IACvE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,GAAG,oBAAoB,EAAE,CAAA;IAC5F,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;AAC7I,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAI,GAA8B,EAAE;IACrE,mBAAmB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA;AACjD,CAAC"}
@@ -0,0 +1,20 @@
1
+ /** A computer's memory, disk and load, as it says them. */
2
+ export interface Health {
3
+ /** Memory, in bytes: all of it, and how much is in use, the cache a system gives back on demand not counted. */
4
+ memory: {
5
+ total: number;
6
+ used: number;
7
+ };
8
+ /** The disk of its user's home, in bytes: all of it, and how much is in use. */
9
+ disk?: {
10
+ total: number;
11
+ used: number;
12
+ };
13
+ /** How busy its processors are, in percent of all of them: the time they were not idle since the reading before. */
14
+ load?: number;
15
+ }
16
+ /** This computer's health, read at most every {@link KEPT_MS}. */
17
+ export declare function computerHealth(now?: number): Promise<Health>;
18
+ /** What another computer said of its health, kept only as well-formed: whole, finite, used no more than all. */
19
+ export declare function readHealth(said: unknown): Health | undefined;
20
+ //# sourceMappingURL=health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAYA,2DAA2D;AAC3D,MAAM,WAAW,MAAM;IACrB,gHAAgH;IAChH,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACvC,gFAAgF;IAChF,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACtC,oHAAoH;IACpH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAiED,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAYxE;AAED,gHAAgH;AAChH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAW5D"}
package/dist/health.js ADDED
@@ -0,0 +1,98 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { readFile, statfs } from 'node:fs/promises';
3
+ import { cpus, freemem, homedir, platform, totalmem } from 'node:os';
4
+ import { promisify } from 'node:util';
5
+ // How a computer stands: how much of its memory and of its disk is in use, and how busy it is. A
6
+ // computer says its own in the ping another computer of the person's reads (`relay-endpoints.ts`):
7
+ // the Overview's Devices card shows it for this computer and for each server, so a full disk or a
8
+ // server out of memory is seen before an agent fails on it.
9
+ const run = promisify(execFile);
10
+ /**
11
+ * The memory a computer can still give: what Linux calls available, free plus the cache it drops
12
+ * on demand; on a Mac, the free, inactive and purgeable pages; elsewhere, what is free. A plain
13
+ * "free" read as nearly full on both, where most of it is cache.
14
+ */
15
+ async function availableMemory() {
16
+ if (platform() === 'linux') {
17
+ const said = await readFile('/proc/meminfo', 'utf8').catch(() => '');
18
+ const kb = /^MemAvailable:\s+(\d+) kB$/m.exec(said)?.[1];
19
+ if (kb !== undefined)
20
+ return Number(kb) * 1024;
21
+ }
22
+ if (platform() === 'darwin') {
23
+ const { stdout } = await run('vm_stat', [], { timeout: 2000 }).catch(() => ({ stdout: '' }));
24
+ const page = Number(/page size of (\d+) bytes/.exec(stdout)?.[1] ?? 0);
25
+ const pages = (name) => Number(new RegExp(`^${name}:\\s+(\\d+)\\.`, 'm').exec(stdout)?.[1] ?? 0);
26
+ const free = page * (pages('Pages free') + pages('Pages inactive') + pages('Pages purgeable'));
27
+ if (free > 0)
28
+ return free;
29
+ }
30
+ return freemem();
31
+ }
32
+ /** The processors' time so far, busy and in all, in ms: what two readings tell how busy they were between. */
33
+ function cpuTimes() {
34
+ let busy = 0;
35
+ let total = 0;
36
+ for (const cpu of cpus()) {
37
+ const { user, nice, sys, irq, idle } = cpu.times;
38
+ busy += user + nice + sys + irq;
39
+ total += user + nice + sys + irq + idle;
40
+ }
41
+ return { busy, total };
42
+ }
43
+ /** The times of the reading before, and when: how busy the processors were is said over the time since. */
44
+ let lastTimes;
45
+ /** A reading older than this is no measure of now: the processors are watched afresh. */
46
+ const STALE_MS = 60_000;
47
+ /** How long the first reading watches the processors, with none before it to compare with. */
48
+ const FIRST_LOOK_MS = 500;
49
+ /**
50
+ * How busy the processors were, in percent of all of them, since the reading before (with none
51
+ * in the last minute, over half a second). Not the load average: that counts the programs waiting on the disk
52
+ * too, and fades over minutes, so a server idle now read as full long after an install.
53
+ */
54
+ async function cpuBusy() {
55
+ let before = lastTimes && Date.now() - lastTimes.at < STALE_MS ? lastTimes : undefined;
56
+ if (!before) {
57
+ before = cpuTimes();
58
+ await new Promise(resolve => setTimeout(resolve, FIRST_LOOK_MS));
59
+ }
60
+ const now = cpuTimes();
61
+ lastTimes = { ...now, at: Date.now() };
62
+ const total = now.total - before.total;
63
+ return total > 0 ? Math.round(((now.busy - before.busy) / total) * 100) : undefined;
64
+ }
65
+ /** How long a reading is kept: a ping is asked every few seconds, and `vm_stat` is a process each time. */
66
+ const KEPT_MS = 15_000;
67
+ let kept;
68
+ /** This computer's health, read at most every {@link KEPT_MS}. */
69
+ export function computerHealth(now = Date.now()) {
70
+ if (kept && now - kept.at < KEPT_MS)
71
+ return kept.health;
72
+ const health = (async () => {
73
+ const total = totalmem();
74
+ const memory = { total, used: Math.max(0, total - (await availableMemory())) };
75
+ const fs = await statfs(homedir()).catch(() => undefined);
76
+ const disk = fs ? { total: fs.blocks * fs.bsize, used: (fs.blocks - fs.bavail) * fs.bsize } : undefined;
77
+ const load = cpus().length === 0 ? undefined : await cpuBusy();
78
+ return { memory, ...(disk ? { disk } : {}), ...(load !== undefined ? { load } : {}) };
79
+ })();
80
+ kept = { at: now, health };
81
+ return health;
82
+ }
83
+ /** What another computer said of its health, kept only as well-formed: whole, finite, used no more than all. */
84
+ export function readHealth(said) {
85
+ if (typeof said !== 'object' || said === null)
86
+ return undefined;
87
+ const part = (value) => {
88
+ const { total, used } = (value && typeof value === 'object' ? value : {});
89
+ return typeof total === 'number' && typeof used === 'number' && Number.isFinite(total) && Number.isFinite(used) && total > 0 && used >= 0 && used <= total ? { total, used } : undefined;
90
+ };
91
+ const { memory, disk, load } = said;
92
+ const mem = part(memory);
93
+ if (!mem)
94
+ return undefined;
95
+ const space = part(disk);
96
+ return { memory: mem, ...(space ? { disk: space } : {}), ...(typeof load === 'number' && Number.isFinite(load) && load >= 0 && load <= 10_000 ? { load: Math.round(load) } : {}) };
97
+ }
98
+ //# sourceMappingURL=health.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.js","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,iGAAiG;AACjG,mGAAmG;AACnG,k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1B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AACpL,CAAC"}
package/dist/index.d.ts CHANGED
@@ -38,4 +38,5 @@ export type { ProjectQueue } from './dashboard/queue.js';
38
38
  export type { QuotaView } from './dashboard/quota.js';
39
39
  export type { Ticket } from './store/tickets.js';
40
40
  export type { AgentWorktree, CleanupReport, OnboardingSuggestion } from './dashboard/types.js';
41
+ export type { CardPlace, CardWidth, OverviewLayouts } from './overview-layout.js';
41
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC9D,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAChE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC9D,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAA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AY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,YAAY,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC9F,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,12 @@
1
+ export interface FilterChip<T extends string> {
2
+ value: T;
3
+ label: string;
4
+ count: number;
5
+ }
6
+ export declare function FilterChips<T extends string>({ chips, total, picked, onPick, className }: {
7
+ chips: FilterChip<T>[]; /** How many rows "All" shows. */
8
+ total: number;
9
+ picked: T | null;
10
+ onPick: (value: T | null) => void;
11
+ className?: string;
12
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare function Page({ title, count, description, actions, bar, children, }: {
3
+ title: string;
4
+ /** Beside the name, in grey: how many the page shows ("14/14"). Seen on a phone too. */
5
+ count?: ReactNode;
6
+ description?: ReactNode;
7
+ /** The page's own buttons, at the end of its name's row. */
8
+ actions?: ReactNode;
9
+ /** Under the header: a bar of the page's own (the Tickets' filters). */
10
+ bar?: ReactNode;
11
+ children: ReactNode;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** In the sidebar's top row: hides it. */
2
+ export declare function HideSidebarButton(): import("react").JSX.Element | null;
3
+ /** At the start of a page's top row while the sidebar is hidden: shows it again. A page drawn without the shell has no sidebar to show. */
4
+ export declare function ShowSidebarButton(): import("react").JSX.Element | null;
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from 'react';
2
+ /** The ids of the Overview's parts a tile scrolls to. */
3
+ export declare const NEEDS_YOU_ID = "needs-you";
4
+ export declare const WORKING_ID = "working-now";
5
+ /** Scroll the Overview to one of its parts. */
6
+ export declare function scrollToPart(id: string): void;
7
+ export declare function StatTile({ label, value, note, tone, live, href, onClick }: {
8
+ label: string;
9
+ value: number;
10
+ note: ReactNode; /** The number's colour while it is not nothing. */
11
+ tone?: string | undefined; /** Something is going on: a pulsing dot before the name. */
12
+ live?: boolean;
13
+ href?: string;
14
+ onClick?: () => void;
15
+ }): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
2
+ import type { ComponentProps } from 'react';
3
+ declare function Sheet(props: ComponentProps<typeof BaseDialog.Root>): import("react").JSX.Element;
4
+ declare function SheetContent({ className, children, side, ...props }: ComponentProps<typeof BaseDialog.Popup> & {
5
+ side?: 'left' | 'right';
6
+ }): import("react").JSX.Element;
7
+ declare function SheetHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
8
+ declare function SheetTitle({ className, ...props }: ComponentProps<typeof BaseDialog.Title>): import("react").JSX.Element;
9
+ declare function SheetDescription({ className, ...props }: ComponentProps<typeof BaseDialog.Description>): import("react").JSX.Element;
10
+ export { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription };
@@ -0,0 +1,71 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import { type VariantProps } from 'class-variance-authority';
4
+ import { Button } from './button.js';
5
+ import { Input } from './input.js';
6
+ import { Separator } from './separator.js';
7
+ import { TooltipContent } from './tooltip.js';
8
+ type SidebarContextProps = {
9
+ state: 'expanded' | 'collapsed';
10
+ open: boolean;
11
+ setOpen: (open: boolean) => void;
12
+ openMobile: boolean;
13
+ setOpenMobile: (open: boolean) => void;
14
+ isMobile: boolean;
15
+ toggleSidebar: () => void;
16
+ };
17
+ declare function useSidebar(): SidebarContextProps;
18
+ /** The sidebar's state, or null outside a SidebarProvider: for a part drawn in the shell and also alone (a module's page in its own tests). */
19
+ declare function useOptionalSidebar(): SidebarContextProps | null;
20
+ declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<'div'> & {
21
+ defaultOpen?: boolean;
22
+ open?: boolean;
23
+ onOpenChange?: (open: boolean) => void;
24
+ }): React.JSX.Element;
25
+ declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<'div'> & {
26
+ side?: 'left' | 'right';
27
+ variant?: 'sidebar' | 'floating' | 'inset';
28
+ collapsible?: 'offcanvas' | 'icon' | 'none';
29
+ }): React.JSX.Element;
30
+ declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
31
+ declare function SidebarInset({ className, ...props }: React.ComponentProps<'main'>): React.JSX.Element;
32
+ declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
33
+ declare function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
34
+ declare function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
35
+ declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
36
+ declare function SidebarContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
37
+ declare function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
38
+ declare function SidebarGroupLabel({ className, render, ...props }: React.ComponentProps<'div'> & {
39
+ render?: useRender.RenderProp;
40
+ }): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
41
+ declare function SidebarGroupAction({ className, render, ...props }: React.ComponentProps<'button'> & {
42
+ render?: useRender.RenderProp;
43
+ }): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
44
+ declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
45
+ declare function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
46
+ declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
47
+ declare const sidebarMenuButtonVariants: (props?: ({
48
+ variant?: "default" | "outline" | null | undefined;
49
+ size?: "default" | "lg" | "sm" | null | undefined;
50
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
51
+ declare function SidebarMenuButton({ render, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<'button'> & {
52
+ render?: useRender.RenderProp;
53
+ isActive?: boolean;
54
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>;
55
+ } & VariantProps<typeof sidebarMenuButtonVariants>): React.JSX.Element;
56
+ declare function SidebarMenuAction({ className, render, showOnHover, ...props }: React.ComponentProps<'button'> & {
57
+ render?: useRender.RenderProp;
58
+ showOnHover?: boolean;
59
+ }): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
60
+ declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
61
+ declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<'div'> & {
62
+ showIcon?: boolean;
63
+ }): React.JSX.Element;
64
+ declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
65
+ declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
66
+ declare function SidebarMenuSubButton({ render, size, isActive, className, ...props }: React.ComponentProps<'a'> & {
67
+ render?: useRender.RenderProp;
68
+ size?: 'sm' | 'md';
69
+ isActive?: boolean;
70
+ }): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
71
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarSeparator, SidebarTrigger, useSidebar, useOptionalSidebar, };
@@ -9,10 +9,15 @@ import { type DependencyList } from 'react';
9
9
  * answer was. For a page a person goes back and forth between (a run's facts): going back shows
10
10
  * what was read last time at once, and the read is made again all the same, so it is replaced
11
11
  * the moment the fresh answer lands. The key names the target, so no other target's answer is
12
- * ever shown.
12
+ * ever shown. Every read under one key is one read: the Overview's tile and card asking the
13
+ * same question wait for the same answer, and each answer reaches both.
14
+ * - `{ remember: key, stored: true }`: also kept in this browser, for the next time the page is
15
+ * opened: it shows the last answer from its first frame, faded ({@link StaleReads}) until the
16
+ * fresh one lands. For what a person opens the page to glance at (the Overview's cards).
13
17
  */
14
18
  export type Keep = 'previous' | {
15
19
  remember: string;
20
+ stored?: true;
16
21
  };
17
22
  /** Forget the answer remembered under a key, for a target known to have changed since; with no key, every answer (for tests). */
18
23
  export declare function forgetRemembered(key?: string): void;
@@ -22,6 +27,17 @@ export declare function forgetRemembered(key?: string): void;
22
27
  * that already holds an answer.
23
28
  */
24
29
  export declare function readAhead<T>(key: string, load: () => Promise<T>): void;
30
+ /**
31
+ * Where a read is told that what it shows changed, so it reads again at once rather than at its
32
+ * next poll: `read` is called with a number per change, the same for every read told of that one
33
+ * change, until the answer is called. Taken when the deps change, like `load`.
34
+ */
35
+ export type Again = (read: (change: number) => void) => () => void;
36
+ /**
37
+ * Set around a part of the page that fades while what it shows is only an answer stored from an
38
+ * earlier visit (an Overview card): every read inside tells it, by its own id, whether it is.
39
+ */
40
+ export declare const StaleReads: import("react").Context<((reader: object, stale: boolean) => void) | null>;
25
41
  /**
26
42
  * Read once, and again whenever `deps` change.
27
43
  *
@@ -30,16 +46,18 @@ export declare function readAhead<T>(key: string, load: () => Promise<T>): void;
30
46
  */
31
47
  export declare function useLoaded<T>(load: (() => Promise<T>) | null, initial: T, deps: DependencyList, keep?: Keep): T;
32
48
  /**
33
- * Read now, again every `everyMs`, and again whenever `deps` change. Polling stops on
34
- * unmount. `reload` reads immediately, for when a local action means the next tick is
35
- * too late to wait for, and settles once that read has answered.
49
+ * Read now, again `everyMs` after each answer, and again whenever `deps` change. Polling stops on
50
+ * unmount, and while the tab is not shown. `reload` reads immediately, for when a local action
51
+ * means the next tick is too late to wait for, and settles once that read has answered.
36
52
  *
37
53
  * Pass `null` for `load` when there is nothing to read yet. `load` must close over
38
54
  * exactly `deps`. `loaded` is false until the first successful read, and again after
39
- * a dep change — for callers that must tell "not there" from "not read yet".
55
+ * a dep change — for callers that must tell "not there" from "not read yet". `stale` is true
56
+ * while the value is only an answer stored by an earlier visit (`{ remember, stored: true }`).
40
57
  */
41
- export declare function usePolled<T>(load: (() => Promise<T>) | null, initial: T, everyMs: number, deps: DependencyList, keep?: Keep): {
58
+ export declare function usePolled<T>(load: (() => Promise<T>) | null, initial: T, everyMs: number, deps: DependencyList, keep?: Keep, again?: Again): {
42
59
  value: T;
43
60
  reload: () => Promise<void>;
44
61
  loaded: boolean;
62
+ stale: boolean;
45
63
  };
@@ -0,0 +1,4 @@
1
+ /** Whether the screen is a phone's, now. */
2
+ export declare const isMobileScreen: () => boolean;
3
+ /** Whether the screen is a phone's, read at the first paint: the app has no server render to agree with. */
4
+ export declare function useIsMobile(): boolean;
@@ -10,10 +10,12 @@ export interface MountedLinkAction extends LinkAction {
10
10
  package: string;
11
11
  projects: string[];
12
12
  }
13
- /** A card as the shell mounts it (#1818): the card, plus the package it came from and the projects that have it. */
13
+ /** A card as the shell mounts it (#1818): the card, plus the package it came from, the projects that have it, and whether it is the computer's. */
14
14
  export interface MountedCard extends ModuleCard {
15
15
  package: string;
16
16
  projects: string[];
17
+ /** A package of this computer's (its devices): the card is on every Overview, whichever project is picked. */
18
+ computer: boolean;
17
19
  }
18
20
  /** A pane as the shell mounts it: the pane, plus the package it came from and the projects that have it. */
19
21
  export interface MountedPanel extends ModulePanel {
@@ -80,8 +82,10 @@ export declare function byMountOrder(a: {
80
82
  * modules claim going to the first, the cards (#1818), sorted by their order then their package, the link actions, the panes, the run slots, the Settings sections (sorted as the cards are) and the usage bar's stop line (the first module's that declares one),
81
83
  * every one of them, each carrying the package it came from and the projects that have it. `loaded` is false until the module list has
82
84
  * been read and every module in it imported, so the shell can tell "no such page" from "not
83
- * loaded yet". A change of `reloadKey` reads the list again at once; what is mounted stays until
84
- * it answers.
85
+ * loaded yet"; what a module brings is there as soon as that module is imported, so a card is not
86
+ * kept waiting for another package's code. A change of `reloadKey` reads the list again at once;
87
+ * what is mounted stays until it answers. The list is kept for the next visit too, so a page
88
+ * opened again imports the modules at once.
85
89
  */
86
90
  export declare function useModules(reloadKey?: number): MountedModules;
87
91
  /**