@dopame/acde-linux-x64 0.0.0-stage → 0.0.10

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 (165) hide show
  1. package/LICENSE +8 -0
  2. package/bin/acde +66 -0
  3. package/bin/acde.cmd +45 -0
  4. package/bin/acdebin-dbg +4 -0
  5. package/bin/app/brand/art.mjs +53 -0
  6. package/bin/app/brand/brand.css +39 -0
  7. package/bin/app/brand/lockup.mjs +17 -0
  8. package/bin/app/brand/mark.mjs +124 -0
  9. package/bin/app/dist/broker.js +1 -0
  10. package/bin/app/dist/web.js +1 -0
  11. package/bin/app/greet/index.html +177 -0
  12. package/bin/app/greet/package.json +16 -0
  13. package/bin/app/package.json +35 -0
  14. package/lib/acde/LICENSE +8 -0
  15. package/lib/acde/dist/chunk-0n69bv5q.js +1 -0
  16. package/lib/acde/dist/chunk-1cw92x19.js +1 -0
  17. package/lib/acde/dist/chunk-458e14zb.js +1 -0
  18. package/lib/acde/dist/chunk-88mxgp54.js +1 -0
  19. package/lib/acde/dist/chunk-8dv09ven.js +1 -0
  20. package/lib/acde/dist/chunk-8fxsj5h6.js +1 -0
  21. package/lib/acde/dist/chunk-8pf3kk8v.js +1 -0
  22. package/lib/acde/dist/chunk-8r65bz1e.js +1 -0
  23. package/lib/acde/dist/chunk-9hpnkmxn.js +1 -0
  24. package/lib/acde/dist/chunk-a7w41xr9.js +1 -0
  25. package/lib/acde/dist/chunk-db7qqt8a.js +1 -0
  26. package/lib/acde/dist/chunk-e3rzr5fj.js +1 -0
  27. package/lib/acde/dist/chunk-ehms6xjp.js +1 -0
  28. package/lib/acde/dist/chunk-ggykhab6.js +1 -0
  29. package/lib/acde/dist/chunk-gt70e8h2.js +1 -0
  30. package/lib/acde/dist/chunk-hcf0xd5c.js +1 -0
  31. package/lib/acde/dist/chunk-hdrvz9sa.js +1 -0
  32. package/lib/acde/dist/chunk-jjq2mn94.js +1 -0
  33. package/lib/acde/dist/chunk-k8f4m94e.js +7 -0
  34. package/lib/acde/dist/chunk-mtgy1bm0.js +1 -0
  35. package/lib/acde/dist/chunk-mtw6p7kv.js +1 -0
  36. package/lib/acde/dist/chunk-nwkq7cpp.js +1 -0
  37. package/lib/acde/dist/chunk-nyr54266.js +1 -0
  38. package/lib/acde/dist/chunk-p0h5kspx.js +1 -0
  39. package/lib/acde/dist/chunk-pdj3h86e.js +1 -0
  40. package/lib/acde/dist/chunk-q9dbzac5.js +1 -0
  41. package/lib/acde/dist/chunk-qrhbrjzk.js +1 -0
  42. package/lib/acde/dist/chunk-s8p0y5ap.js +1 -0
  43. package/lib/acde/dist/chunk-t0xqxe00.js +1 -0
  44. package/lib/acde/dist/chunk-tgn5c2mw.js +1 -0
  45. package/lib/acde/dist/chunk-wmj6zwvn.js +1 -0
  46. package/lib/acde/dist/chunk-wnk81fkc.js +1 -0
  47. package/lib/acde/dist/chunk-x208z38w.js +1 -0
  48. package/lib/acde/dist/chunk-xq76vbg6.js +1 -0
  49. package/lib/acde/dist/chunk-xr9gh5x2.js +1 -0
  50. package/lib/acde/dist/chunk-yytnhz6e.js +1 -0
  51. package/lib/acde/dist/chunk-z0ts25s1.js +1 -0
  52. package/lib/acde/dist/chunk-zdyw1ckt.js +1 -0
  53. package/lib/acde/dist/cli.js +1 -0
  54. package/lib/acde/dist/driver/index.js +1 -0
  55. package/lib/acde/dist/e2e/index.js +1 -0
  56. package/lib/acde/dist/types/configs.d.ts +1 -0
  57. package/lib/acde/dist/types/driver/acde.d.ts +106 -0
  58. package/lib/acde/dist/types/driver/clock.d.ts +32 -0
  59. package/lib/acde/dist/types/driver/expect.d.ts +60 -0
  60. package/lib/acde/dist/types/driver/format.d.ts +16 -0
  61. package/lib/acde/dist/types/driver/index.d.ts +13 -0
  62. package/lib/acde/dist/types/driver/input.d.ts +75 -0
  63. package/lib/acde/dist/types/driver/locator.d.ts +151 -0
  64. package/lib/acde/dist/types/driver/logs.d.ts +26 -0
  65. package/lib/acde/dist/types/driver/png.d.ts +31 -0
  66. package/lib/acde/dist/types/driver/poll.d.ts +4 -0
  67. package/lib/acde/dist/types/driver/screenshot.d.ts +37 -0
  68. package/lib/acde/dist/types/driver/trace.d.ts +26 -0
  69. package/lib/acde/dist/types/driver/types.d.ts +213 -0
  70. package/lib/acde/dist/types/driver/video.d.ts +14 -0
  71. package/lib/acde/dist/types/driver/window.d.ts +77 -0
  72. package/lib/acde/dist/types/e2e/index.d.ts +78 -0
  73. package/lib/acde/dist/types/e2e/settings.d.ts +39 -0
  74. package/lib/acde/dist/types/ipc.d.ts +24 -0
  75. package/lib/acde/dist/types/paths.d.ts +5 -0
  76. package/lib/acde/dist/types/pm.d.ts +20 -0
  77. package/lib/acde/dist/types/runtime.d.ts +49 -0
  78. package/lib/acde/dist/types/sessions.d.ts +80 -0
  79. package/lib/acde/dist/types/sockets.d.ts +4 -0
  80. package/lib/acde/launcher.d.mts +25 -0
  81. package/lib/acde/launcher.mjs +1 -0
  82. package/lib/acde/package.json +31 -0
  83. package/lib/acde/skills/acde/SKILL.md +114 -0
  84. package/lib/acde/skills/acde/references/guide/agents.md +50 -0
  85. package/lib/acde/skills/acde/references/guide/assets.md +40 -0
  86. package/lib/acde/skills/acde/references/guide/backend.md +94 -0
  87. package/lib/acde/skills/acde/references/guide/capabilities.md +157 -0
  88. package/lib/acde/skills/acde/references/guide/config.md +73 -0
  89. package/lib/acde/skills/acde/references/guide/desktop.md +165 -0
  90. package/lib/acde/skills/acde/references/guide/dev.md +66 -0
  91. package/lib/acde/skills/acde/references/guide/doctor.md +144 -0
  92. package/lib/acde/skills/acde/references/guide/files.md +181 -0
  93. package/lib/acde/skills/acde/references/guide/frameworks.md +74 -0
  94. package/lib/acde/skills/acde/references/guide/install.md +34 -0
  95. package/lib/acde/skills/acde/references/guide/mcp.md +64 -0
  96. package/lib/acde/skills/acde/references/guide/open.md +107 -0
  97. package/lib/acde/skills/acde/references/guide/services.md +147 -0
  98. package/lib/acde/skills/acde/references/guide/testing.md +378 -0
  99. package/lib/acde/skills/acde/references/guide/tools.md +291 -0
  100. package/lib/acde/skills/acde/references/guide/window.md +167 -0
  101. package/lib/acde/skills/acde/references/reference/cli.md +221 -0
  102. package/lib/acde/skills/acde/references/reference/config.md +51 -0
  103. package/lib/acde/skills/acde/references/reference/env.md +44 -0
  104. package/lib/acde/skills/acde/references/reference/manifest.md +92 -0
  105. package/lib/acde/skills/acde/references/reference/modules.md +586 -0
  106. package/lib/acde/skills/acde/references/reference/platforms.md +23 -0
  107. package/lib/acde/skills/acde/references/reference/service.md +47 -0
  108. package/lib/acde/skills/acde/references/reference/testing.md +265 -0
  109. package/lib/acde/skills/acde/references/reference/web.md +94 -0
  110. package/lib/acde/skills/acde/references/start/first-app.md +87 -0
  111. package/lib/acde/skills/acde/references/start/install.md +232 -0
  112. package/lib/acde/skills/acde/references/start/project.md +77 -0
  113. package/lib/acde/templates/app/acde.config.jsonc +27 -0
  114. package/lib/acde/templates/app/gitignore +2 -0
  115. package/lib/acde/templates/app/index.html +22 -0
  116. package/lib/acde/templates/app/package.json +5 -0
  117. package/lib/acde/templates/app/src/i18n.js +26 -0
  118. package/lib/acde/templates/app/src/locales/en.js +4 -0
  119. package/lib/acde/templates/app/src/locales/zh.js +4 -0
  120. package/lib/acde/templates/app/src/main.js +5 -0
  121. package/lib/acde/templates/backend/server.ts +7 -0
  122. package/lib/acde/templates/backend/src/main.js +6 -0
  123. package/lib/acde/templates/desktop/acde.config.jsonc +17 -0
  124. package/lib/acde/templates/desktop/gitignore +2 -0
  125. package/lib/acde/templates/desktop/index.html +19 -0
  126. package/lib/acde/templates/desktop/package.json +5 -0
  127. package/lib/acde/templates/desktop/src/desktop.js +16 -0
  128. package/lib/acde/templates/desktop/src/i18n.js +26 -0
  129. package/lib/acde/templates/desktop/src/locales/en.js +4 -0
  130. package/lib/acde/templates/desktop/src/locales/zh.js +4 -0
  131. package/lib/acde/templates/framework/acde.config.jsonc +26 -0
  132. package/lib/acde-api/LICENSE +5 -0
  133. package/lib/acde-api/config.schema.json +563 -0
  134. package/lib/acde-api/package.json +51 -0
  135. package/lib/acde-api/src/app.d.ts +36 -0
  136. package/lib/acde-api/src/frame.d.ts +15 -0
  137. package/lib/acde-api/src/frame.js +1 -0
  138. package/lib/acde-api/src/index.d.ts +11 -0
  139. package/lib/acde-api/src/index.js +1 -0
  140. package/lib/acde-api/src/modules/app-modules.d.ts +81 -0
  141. package/lib/acde-api/src/modules/modules.d.ts +113 -0
  142. package/lib/acde-api/src/modules/shell-modules.d.ts +32 -0
  143. package/lib/acde-api/src/runtime/level.d.ts +1 -0
  144. package/lib/acde-api/src/runtime/level.js +1 -0
  145. package/lib/acde-api/src/runtime/load.d.ts +8 -0
  146. package/lib/acde-api/src/runtime/load.js +1 -0
  147. package/lib/acde-api/src/runtime/places.d.ts +3 -0
  148. package/lib/acde-api/src/runtime/places.js +1 -0
  149. package/lib/acde-api/src/runtime/platforms.d.ts +5 -0
  150. package/lib/acde-api/src/runtime/platforms.js +1 -0
  151. package/lib/acde-api/src/shell.d.ts +14 -0
  152. package/lib/acde-api/src/types/capabilities.d.ts +34 -0
  153. package/lib/acde-api/src/types/config.d.ts +55 -0
  154. package/lib/acde-api/src/types/events.d.ts +151 -0
  155. package/lib/acde-api/src/types/manifest.d.ts +83 -0
  156. package/lib/acde-api/src/types/office.d.ts +118 -0
  157. package/lib/acde-api/src/types/page.d.ts +1090 -0
  158. package/lib/acde-api/src/types/permissions.d.ts +50 -0
  159. package/lib/acde-api/src/types/service.d.ts +35 -0
  160. package/lib/acde-api/src/validate.d.ts +64 -0
  161. package/lib/acde-api/src/validate.js +1 -0
  162. package/lib/acde-api/src/vite.d.ts +3 -0
  163. package/lib/acde-api/src/vite.js +9 -0
  164. package/package.json +11 -4
  165. package/README.md +0 -3
@@ -0,0 +1,1090 @@
1
+ import type { AppsChangedEvent, DesktopEventMap, ShortcutEvent, TerminalEvent, WindowGrabEvent, WindowGrabLostEvent, WindowsEvents } from './events'
2
+ import type { AcdeOffice } from './office'
3
+ import type { AcdePermissions } from './permissions'
4
+ import type { SharedPlace } from '../runtime/places'
5
+
6
+ export type * from './events'
7
+ export type * from './office'
8
+ export type * from './permissions'
9
+
10
+ export interface FinderRoot {
11
+ id: string
12
+ path?: string
13
+ label: string
14
+ source: 'desktop' | 'downloads' | 'default' | 'granted' | 'private' | 'place'
15
+ place?: SharedPlace
16
+ mode: RootMode
17
+ reason: string | null
18
+ exists: boolean
19
+ }
20
+
21
+ export type RootMode = 'writable' | 'read_only' | 'unavailable'
22
+
23
+ export type EntryKind = 'directory' | 'file' | 'symlink' | 'other'
24
+
25
+ export interface FinderEntry {
26
+ name: string
27
+ kind: EntryKind
28
+ size: number
29
+ modifiedMs: number
30
+ target?: string
31
+ version?: string
32
+ inPlace?: true
33
+ }
34
+
35
+ export interface FinderPreview {
36
+ path: string
37
+ name: string
38
+ size: number
39
+ modifiedMs: number
40
+ kind: 'text' | 'image' | 'binary' | 'too_large'
41
+ content?: string
42
+ truncated?: boolean
43
+ }
44
+
45
+ export interface FileBytes {
46
+ readonly name: string
47
+ readonly contentType: string
48
+ readonly data: Uint8Array
49
+ }
50
+
51
+ export type AcdeFsErrorCode =
52
+ | 'EINVAL'
53
+ | 'EACCES'
54
+ | 'ENOENT'
55
+ | 'EEXIST'
56
+ | 'ECONFLICT'
57
+ | 'ENOTEMPTY'
58
+ | 'EFBIG'
59
+ | 'EILSEQ'
60
+ | 'ENOSPC'
61
+ | 'EIO'
62
+
63
+ export interface AcdeFsError extends Error {
64
+ readonly status: number
65
+ readonly code: AcdeFsErrorCode
66
+ }
67
+
68
+ export interface FinderStat extends FinderEntry {
69
+ path: string
70
+ }
71
+
72
+ export interface FileText {
73
+ readonly text: string
74
+ readonly modifiedMs: number
75
+ readonly size: number
76
+ readonly version: string
77
+ }
78
+
79
+ export interface FileData {
80
+ readonly data: Uint8Array
81
+ readonly modifiedMs: number
82
+ readonly size: number
83
+ readonly version: string
84
+ }
85
+
86
+ export interface FileRange {
87
+ readonly data: Uint8Array
88
+ readonly offset: number
89
+ readonly size: number
90
+ readonly modifiedMs: number
91
+ readonly version: string
92
+ }
93
+
94
+ export interface ReadRangeOptions {
95
+ ifVersion?: string
96
+ }
97
+
98
+ export interface OpenWriteOptions {
99
+ keepExistingData?: boolean
100
+ ifVersion?: string
101
+ create?: 'new' | 'always' | 'never'
102
+ mkdirs?: boolean
103
+ }
104
+
105
+ export interface WriteFileOptions {
106
+ ifModifiedMs?: number
107
+ ifVersion?: string
108
+ create?: 'new' | 'always' | 'never'
109
+ mkdirs?: boolean
110
+ }
111
+
112
+ export interface MkdirOptions {
113
+ recursive?: boolean
114
+ }
115
+
116
+ export interface AcdeFs {
117
+ roots(): Promise<FinderRoot[]>
118
+ list(
119
+ root: string,
120
+ path?: string,
121
+ hidden?: boolean,
122
+ ): Promise<{ root: FinderRoot; path: string; entries: FinderEntry[]; truncated: boolean; skipped?: number }>
123
+ preview(root: string, path: string): Promise<FinderPreview>
124
+ download(root: string, path: string): Promise<FileBytes>
125
+ mkdir(root: string, path: string, options?: MkdirOptions): Promise<FinderEntry>
126
+ stat(root: string, path: string): Promise<FinderStat>
127
+ readText(root: string, path: string): Promise<FileText>
128
+ readBytes(root: string, path: string): Promise<FileData>
129
+ writeFile(root: string, path: string, data: string | Uint8Array, options?: WriteFileOptions): Promise<FinderEntry>
130
+ readRange(root: string, path: string, offset: number, length: number, options?: ReadRangeOptions): Promise<FileRange>
131
+ openWrite(root: string, path: string, options?: OpenWriteOptions): Promise<{ id: string; size: number }>
132
+ writeChunk(id: string, offset: number, data: string | Uint8Array): Promise<void>
133
+ truncateWrite(id: string, size: number): Promise<void>
134
+ commitWrite(id: string): Promise<FinderEntry>
135
+ abortWrite(id: string): Promise<void>
136
+ copy(fromRoot: string, fromPath: string, toRoot: string, toDir: string): Promise<FinderEntry & { path: string }>
137
+ rename(root: string, from: string, to: string): Promise<FinderEntry>
138
+ delete(root: string, path: string): Promise<{ status: 'deleted'; path: string }>
139
+ locate(path: string): Promise<{ root: string; path: string }>
140
+ openPath(root: string, path: string): Promise<{ root: string; path: string; file: string }>
141
+ revoke(rootPath: string): Promise<void>
142
+ }
143
+
144
+ export interface NativeWindow {
145
+ readonly id: number
146
+ readonly appId: string | null
147
+ readonly title: string | null
148
+ readonly web?: boolean
149
+ readonly state: WindowState
150
+ }
151
+
152
+ export interface AcdeWindows extends WindowsEvents {
153
+ list(): NativeWindow[]
154
+ launch(
155
+ argv: string[],
156
+ options?: { cwd?: string; env?: Record<string, string>; slot?: boolean },
157
+ ): number | Promise<number>
158
+ close(id: number): void
159
+ requestState?(id: number, state: WindowState): Promise<void>
160
+ kill?(id: number): Promise<boolean>
161
+ focus?(id: number): Promise<void>
162
+ hide?(id: number): Promise<void>
163
+ show?(id: number): Promise<void>
164
+ invokeMenu?(id: number, menu: string, item: string): Promise<void>
165
+ stats?(): Promise<Readonly<Record<string, number>>>
166
+ /**
167
+ * Plays a short animation on a window. Where the runtime cannot animate, the
168
+ * animation may complete at once; its completion event `windowanimated`
169
+ * (`on('animated')`) still fires.
170
+ */
171
+ animate?(
172
+ id: number,
173
+ options: {
174
+ opacity?: number
175
+ scale?: number
176
+ dx?: number
177
+ dy?: number
178
+ duration?: number
179
+ delay?: number
180
+ easing?: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out'
181
+ },
182
+ ): Promise<void>
183
+ shortcut?(combo: string, scope?: 'session' | 'desktop'): Promise<void>
184
+ unshortcut?(combo: string, scope?: 'session' | 'desktop'): Promise<void>
185
+ }
186
+
187
+ export interface AcdeTerminals {
188
+ open(cols: number, rows: number): Promise<{ id: string }>
189
+ subscribe(id: string, callback: (events: TerminalEvent[]) => void): Promise<void>
190
+ input(id: string, data: string): Promise<{ ok: true }>
191
+ resize(id: string, cols: number, rows: number): Promise<{ cols: number; rows: number }>
192
+ close(id: string): Promise<{ closed: string }>
193
+ }
194
+
195
+ export interface DesktopApp {
196
+ readonly id: string
197
+ readonly label: string
198
+ readonly icon: string
199
+ readonly script: string
200
+ }
201
+
202
+ export interface OpenHandler {
203
+ readonly kind: 'acde' | 'native'
204
+ /** An acde app id; a native program's desktop entry (`x.desktop`), or on Windows its registered name (a path or a packaged app id). */
205
+ readonly id: string
206
+ readonly label: string
207
+ /** An icon name or URL; Windows programs give a `data:image/png` URL, or `''`. */
208
+ readonly icon: string
209
+ /** The app `openPath` uses for this file when none is named (the user's remembered choice, else the first that fits). */
210
+ readonly default: boolean
211
+ /** Windows: this program is the system's own default for the file's extension (read, never changed by acde). */
212
+ readonly system?: boolean
213
+ }
214
+
215
+ export interface AcdeOpenFiles {
216
+ openPath(
217
+ path: string,
218
+ options?: { app?: string; select?: boolean },
219
+ ): Promise<{ kind: 'acde' | 'native'; id: string; window?: number }>
220
+ /**
221
+ * The apps that can open a file. `mime` is `''` when the system knows no type for it (Windows); `association` is the key
222
+ * `setDefault` remembers a choice for this file under: the MIME type, or on Windows the file's extension (`.md`).
223
+ */
224
+ handlers(path: string): Promise<{ mime: string; association: string | null; handlers: OpenHandler[] }>
225
+ /** Remembers `handler` for a MIME type, or on Windows for a file extension (`.md`); the system's own default is untouched. */
226
+ setDefault(mime: string, handler: string): Promise<string>
227
+ }
228
+
229
+ export interface NativeApp {
230
+ readonly id: string
231
+ readonly name: string
232
+ readonly comment: string | null
233
+ readonly icon: string
234
+ readonly keywords: readonly string[]
235
+ readonly wmClass: string | null
236
+ }
237
+
238
+ export interface OpenWindowOptions {
239
+ readonly parent?: number
240
+ readonly modal?: boolean
241
+ }
242
+
243
+ export interface OpenFileRequest {
244
+ readonly kind: 'open-file'
245
+ readonly handle?: FileSystemFileHandle | FileSystemDirectoryHandle
246
+ readonly url?: string
247
+ readonly root?: string
248
+ readonly path?: string
249
+ readonly file?: string | null
250
+ }
251
+
252
+ export interface OpenLinkRequest {
253
+ readonly kind: 'open-link'
254
+ readonly url: string
255
+ }
256
+
257
+ export type SystemRequest = OpenFileRequest | OpenLinkRequest
258
+
259
+ export type AppRequest<K extends string = string, Fields extends object = Record<never, never>> = { readonly kind: K } & {
260
+ readonly [P in keyof Fields]: Fields[P]
261
+ }
262
+
263
+ export type WindowRequest = SystemRequest | AppRequest
264
+
265
+ export interface Opened {
266
+ readonly kind: 'acde' | 'native'
267
+ readonly id: string
268
+ readonly window?: number
269
+ }
270
+
271
+ export interface AcdeOpen {
272
+ (request: SystemRequest): Promise<Opened>
273
+ (app: string, request: SystemRequest): Promise<Opened>
274
+ <R extends AppRequest>(app: string, request: R, options?: OpenWindowOptions): Promise<{ window: number }>
275
+ (app: string, request?: null, options?: OpenWindowOptions): Promise<{ window: number }>
276
+ }
277
+
278
+ export interface AcdeAppList {
279
+ on?(type: 'changed', handler: (event: AppsChangedEvent) => void): () => boolean
280
+ list(): Promise<DesktopApp[]>
281
+ open: AcdeOpen
282
+ }
283
+
284
+ export interface AcdeApps extends AcdeAppList, AcdeOpenFiles {
285
+ refresh(): Promise<DesktopApp[]>
286
+ install(dir: string): Promise<{ id: string; dir: string; apps: DesktopApp[] }>
287
+ natives(): Promise<NativeApp[]>
288
+ runNative(id: string): Promise<number>
289
+ }
290
+
291
+ export interface AcdePackages {
292
+ on(type: 'changed', handler: (event: AppsChangedEvent) => void): () => boolean
293
+ refresh(): Promise<DesktopApp[]>
294
+ install(dir: string): Promise<{ id: string; dir: string; apps: DesktopApp[] }>
295
+ natives(): Promise<NativeApp[]>
296
+ runNative(id: string): Promise<number>
297
+ }
298
+
299
+ export interface LaunchOptions {
300
+ readonly cwd?: string
301
+ readonly env?: Readonly<Record<string, string>>
302
+ }
303
+
304
+ export interface AcdeLaunch extends WindowsEvents {
305
+ start(argv: readonly string[], options?: LaunchOptions): Promise<number>
306
+ embed(argv: readonly string[], options?: LaunchOptions): Promise<number>
307
+ close(window: number): Promise<boolean>
308
+ list(): NativeWindow[]
309
+ }
310
+
311
+ export interface DesktopInfo {
312
+ readonly kind: 'acde' | 'session'
313
+ readonly id: string
314
+ readonly name: string
315
+ readonly description: string | null
316
+ readonly package: string | null
317
+ }
318
+
319
+ export interface AcdeDesktops {
320
+ list(): Promise<{ desktops: DesktopInfo[]; current: string }>
321
+ choose(id: string, remember?: boolean): Promise<void>
322
+ }
323
+
324
+ export interface AcdeSession {
325
+ own(): boolean
326
+ logout(): Promise<void>
327
+ reboot(): Promise<void>
328
+ poweroff(): Promise<void>
329
+ setLanguage(tag: string): Promise<void>
330
+ }
331
+
332
+ export interface InspectNode {
333
+ readonly ref: string
334
+ readonly role: string
335
+ readonly name?: string
336
+ readonly value?: string
337
+ readonly states?: readonly string[]
338
+ readonly level?: number
339
+ readonly rect?: readonly [number, number, number, number]
340
+ readonly more?: number
341
+ readonly children?: readonly InspectNode[]
342
+ }
343
+
344
+ export interface InspectWindow {
345
+ readonly ref: string
346
+ readonly id: number
347
+ readonly kind: 'desktop' | 'web' | 'native'
348
+ readonly app: string | null
349
+ readonly title: string | null
350
+ readonly mode: string
351
+ readonly state?: WindowState
352
+ readonly rect: readonly [number, number, number, number]
353
+ readonly z: number
354
+ readonly focus: boolean
355
+ readonly hidden: boolean
356
+ readonly pid: number | null
357
+ readonly parent?: number | null
358
+ readonly modal?: boolean
359
+ }
360
+
361
+ export interface InspectMatch extends InspectNode {
362
+ readonly tag: string
363
+ readonly visible: boolean
364
+ readonly attributes?: Readonly<Record<string, string | null>>
365
+ }
366
+
367
+ export type InspectAction =
368
+ | 'click'
369
+ | 'double'
370
+ | 'right'
371
+ | 'hover'
372
+ | 'drag'
373
+ | 'type'
374
+ | 'settext'
375
+ | 'select'
376
+ | 'key'
377
+ | 'scroll'
378
+ | 'focus'
379
+ | 'close'
380
+ | 'minimize'
381
+ | 'restore'
382
+ | 'fill'
383
+ | 'fullscreen'
384
+
385
+ export type InspectArg = string | number | readonly string[] | null
386
+
387
+ export interface AcdeInspect {
388
+ snapshot(options?: {
389
+ window?: string
390
+ ref?: string
391
+ all?: boolean
392
+ diff?: boolean
393
+ limit?: number
394
+ find?: string
395
+ tree?: boolean
396
+ offscreen?: boolean
397
+ }): Promise<{ text: string; windows: InspectWindow[]; trees: Record<string, InspectNode[]> }>
398
+ act(ref: string, action: InspectAction, arg?: InspectArg): Promise<{ ok: boolean; text: string }>
399
+ run(
400
+ steps: readonly { ref: string; action: InspectAction; text?: InspectArg }[],
401
+ ): Promise<{ ok: boolean; text: string }>
402
+ open(name: string): Promise<{ ok: boolean; text: string }>
403
+ query(options: {
404
+ selector: string
405
+ window?: string
406
+ ref?: string
407
+ limit?: number
408
+ attributes?: readonly string[]
409
+ }): Promise<{ window: string; count: number; nodes: InspectMatch[] }>
410
+ }
411
+
412
+ export interface AppMenuItem {
413
+ readonly id: string
414
+ readonly label: string
415
+ readonly shortcut?: string
416
+ readonly checked?: boolean
417
+ readonly disabled?: boolean
418
+ onSelect?(): void | Promise<void>
419
+ }
420
+
421
+ export interface AppMenu {
422
+ readonly id: string
423
+ readonly label: string
424
+ readonly items: readonly ({ readonly type: 'separator' } | AppMenuItem)[]
425
+ }
426
+
427
+ export interface WindowHost {
428
+ setTitle(title: string): void
429
+ setMenus(menus: readonly AppMenu[]): void
430
+ }
431
+
432
+ export interface WindowApp {
433
+ mount(element: Element, host: WindowHost): () => void
434
+ }
435
+
436
+ export type WindowEventName =
437
+ | 'activate'
438
+ | 'deactivate'
439
+ | 'beforeclose'
440
+ | 'request'
441
+ | 'suspend'
442
+ | 'resume'
443
+ | 'grab'
444
+ | 'grablost'
445
+ | 'state'
446
+ | 'output'
447
+ | 'hostcontrols'
448
+ | 'minimizable'
449
+
450
+ export type WindowMode = 'free' | 'fixed' | 'pinned'
451
+ export type WindowState = 'normal' | 'minimized' | 'filled' | 'fullscreen'
452
+ export interface WindowStateEvent {
453
+ readonly state: WindowState
454
+ readonly previous: WindowState
455
+ }
456
+ export type WindowEdge = 'top' | 'bottom' | 'left' | 'right'
457
+ export interface WindowRect {
458
+ readonly x: number
459
+ readonly y: number
460
+ readonly width: number
461
+ readonly height: number
462
+ }
463
+
464
+ export interface WindowOutput {
465
+ readonly width: number
466
+ readonly height: number
467
+ readonly scale: number
468
+ readonly workArea: WindowRect
469
+ }
470
+
471
+ export interface AcdeWindowError extends Error {
472
+ readonly code: 'unavailable'
473
+ readonly status: 409
474
+ }
475
+
476
+ export interface AcdeWindow {
477
+ readonly id: number
478
+ readonly state: WindowState
479
+ readonly output: WindowOutput
480
+ readonly hostControls: boolean
481
+ readonly minimizable: boolean
482
+ readonly host: WindowHost
483
+ mount(app: WindowApp): void
484
+ setTitle(title: string): void
485
+ setMenus(menus: readonly AppMenu[]): void
486
+ close(): Promise<boolean>
487
+ minimize(): Promise<void>
488
+ requestAttention(): Promise<void>
489
+ requestState(state: WindowState): void
490
+ requestMode(mode: WindowMode): void
491
+ setGrabHint(rect: WindowRect, edges?: readonly WindowEdge[]): void
492
+ /**
493
+ * Blurs what lies behind a part of the window. Where the platform cannot
494
+ * draw the effect exactly, it may be approximated (see
495
+ * `acde:capabilities` `window.backdrop`).
496
+ */
497
+ setBackdrop(
498
+ rect: WindowRect | null,
499
+ effect?: { radius?: number; blur?: number; saturate?: number; brightness?: number },
500
+ ): void
501
+ requestActivate(): void
502
+ requestGrab(kind: 'pointer' | 'keyboard'): void
503
+ releaseGrab(kind: 'pointer' | 'keyboard'): void
504
+ shortcut(combo: string): Promise<void>
505
+ unshortcut(combo: string): Promise<void>
506
+ on(name: 'beforeclose', handler: () => boolean | void | Promise<boolean | void>): () => boolean
507
+ on<R extends AppRequest = AppRequest>(name: 'request', handler: (request: SystemRequest | R) => void): () => boolean
508
+ on(name: 'suspend' | 'resume', handler: () => void): () => boolean
509
+ on(name: 'activate' | 'deactivate', handler: () => void): () => boolean
510
+ on(name: 'grab', handler: (event: WindowGrabEvent) => void): () => boolean
511
+ on(name: 'grablost', handler: (event: WindowGrabLostEvent) => void): () => boolean
512
+ on(name: 'state', handler: (event: WindowStateEvent) => void): () => boolean
513
+ on(name: 'output', handler: (output: WindowOutput) => void): () => boolean
514
+ on(name: 'hostcontrols', handler: (hostControls: boolean) => void): () => boolean
515
+ on(name: 'minimizable', handler: (minimizable: boolean) => void): () => boolean
516
+ on(name: 'shortcut', handler: (event: ShortcutEvent) => void): () => boolean
517
+ }
518
+
519
+ export interface NetworkDevice {
520
+ readonly iface: string
521
+ readonly type: 'wifi' | 'ethernet'
522
+ readonly state: 'connected' | 'connecting' | 'disconnecting' | 'disconnected' | 'unavailable' | 'unmanaged' | 'failed'
523
+ readonly connection: string | null
524
+ readonly ip4: string | null
525
+ readonly ssid?: string
526
+ readonly strength?: number
527
+ readonly carrier?: boolean
528
+ readonly speed?: number
529
+ }
530
+ export interface NetworkState {
531
+ readonly wifiEnabled: boolean
532
+ readonly connectivity: 'full' | 'limited' | 'portal' | 'none' | 'unknown'
533
+ readonly primary: 'wifi' | 'ethernet' | string | null
534
+ readonly devices: NetworkDevice[]
535
+ }
536
+ export interface WifiNetwork {
537
+ readonly ssid: string
538
+ readonly strength: number
539
+ readonly secure: boolean
540
+ readonly band: '2.4GHz' | '5GHz'
541
+ readonly active: boolean
542
+ readonly saved: boolean
543
+ }
544
+ export interface AcdeNetwork {
545
+ state(): Promise<NetworkState>
546
+ networks(scan?: boolean): Promise<WifiNetwork[]>
547
+ connect(ssid: string, password?: string): Promise<void>
548
+ activate(iface: string): Promise<void>
549
+ disconnect(iface: string): Promise<void>
550
+ setWifiEnabled(on: boolean): Promise<void>
551
+ watch(callback: (state: NetworkState) => void): void
552
+ }
553
+
554
+ export interface PanelReserve {
555
+ readonly edge: WindowEdge
556
+ readonly thickness?: number
557
+ }
558
+
559
+ export interface PinOptions {
560
+ readonly margin?: number
561
+ readonly reserve?: PanelReserve
562
+ }
563
+
564
+ export interface PinnedPanel {
565
+ update(): void
566
+ unpin(): void
567
+ reserve(reserve: PanelReserve | null): void
568
+ }
569
+
570
+ export type DoubleClickAction = 'fill' | 'minimize' | 'none'
571
+
572
+ export interface FrameColors {
573
+ readonly background?: string
574
+ readonly title?: string
575
+ readonly line?: string
576
+ readonly buttons?: string
577
+ }
578
+
579
+ export interface FrameTheme {
580
+ readonly active?: FrameColors
581
+ readonly inactive?: FrameColors
582
+ readonly light?: { readonly active?: FrameColors; readonly inactive?: FrameColors }
583
+ readonly buttonStyle?: 'dots' | 'glyphs'
584
+ readonly buttonSide?: 'left' | 'right'
585
+ readonly titleAlign?: 'center' | 'start'
586
+ }
587
+
588
+ export interface AcdeDesktop {
589
+ apps(): Promise<{ apps: DesktopApp[] }>
590
+ pin?(element: Element, options?: PinOptions): PinnedPanel
591
+ setDoubleClick?(action: DoubleClickAction): void
592
+ setFrameTheme?(theme: FrameTheme | null): void
593
+ on<K extends keyof DesktopEventMap>(type: K, handler: (event: DesktopEventMap[K]) => void): () => boolean
594
+ }
595
+
596
+ export interface ShellModuleTypes {
597
+ readonly windows: AcdeWindows
598
+ readonly packages: AcdePackages
599
+ readonly session: AcdeSession
600
+ readonly desktops: AcdeDesktops
601
+ readonly inspect: AcdeInspect
602
+ readonly desktop: AcdeDesktop
603
+ readonly setDefault: AcdeOpenFiles['setDefault']
604
+ readonly permissions: AcdePermissions
605
+ }
606
+
607
+ export interface ServiceModuleTypes {
608
+ readonly windows: Required<AcdeWindows>
609
+ readonly packages: AcdePackages
610
+ readonly session: AcdeSession
611
+ readonly desktops: AcdeDesktops
612
+ readonly inspect: AcdeInspect
613
+ readonly desktop: Pick<AcdeDesktop, 'apps'>
614
+ readonly setDefault: AcdeOpenFiles['setDefault']
615
+ }
616
+
617
+ export interface SystemInfo {
618
+ readonly hostname: string
619
+ readonly os: string
620
+ readonly kernel: string
621
+ readonly cpu: string
622
+ readonly cores: number
623
+ readonly memory: number
624
+ readonly gpu: readonly string[]
625
+ readonly npu: string | null
626
+ readonly uptimeSeconds: number
627
+ readonly serial: string | null
628
+ }
629
+
630
+ export interface SystemVolume {
631
+ readonly path: string
632
+ readonly label: string
633
+ readonly size: number
634
+ readonly free: number
635
+ }
636
+
637
+ export interface SystemTime {
638
+ readonly timezone: string
639
+ readonly ntp: boolean
640
+ readonly canSetTime: boolean
641
+ }
642
+
643
+ export interface SystemUser {
644
+ readonly name: string
645
+ readonly fullName: string
646
+ readonly avatar: string | null
647
+ }
648
+
649
+ export interface AcdeSystem {
650
+ info(): Promise<SystemInfo>
651
+ storage(): Promise<SystemVolume[]>
652
+ time(): Promise<SystemTime>
653
+ timezones(): Promise<string[]>
654
+ setTimezone(zone: string): Promise<void>
655
+ setNtp(on: boolean): Promise<void>
656
+ setHostname(name: string): Promise<void>
657
+ user(): Promise<SystemUser>
658
+ }
659
+
660
+ export interface BluetoothDevice {
661
+ readonly id: string
662
+ readonly address: string
663
+ readonly name: string
664
+ readonly named: boolean
665
+ readonly kind: 'audio' | 'headset' | 'keyboard' | 'mouse' | 'phone' | 'computer' | 'gamepad' | 'other'
666
+ readonly icon: string
667
+ readonly paired: boolean
668
+ readonly connected: boolean
669
+ readonly trusted: boolean
670
+ readonly blocked: boolean
671
+ readonly battery: number | null
672
+ readonly rssi: number | null
673
+ }
674
+
675
+ export interface BluetoothState {
676
+ readonly available: boolean
677
+ readonly powered: boolean
678
+ readonly discoverable: boolean
679
+ readonly discoverableTimeout: number
680
+ readonly pairable: boolean
681
+ readonly discovering: boolean
682
+ readonly name: string
683
+ readonly address: string
684
+ readonly blocked: 'soft' | 'hard' | null
685
+ readonly onLogin: 'remember' | 'on' | 'off'
686
+ readonly devices: readonly BluetoothDevice[]
687
+ }
688
+
689
+ export interface BluetoothPairing {
690
+ readonly device: string
691
+ readonly name: string
692
+ readonly kind: 'confirm' | 'display' | 'pin' | 'passkey' | 'authorize' | 'service' | 'cancel'
693
+ readonly passkey?: string
694
+ readonly entered?: number
695
+ readonly uuid?: string
696
+ }
697
+
698
+ export interface AcdeBluetooth {
699
+ state(): Promise<BluetoothState>
700
+ setPowered(on: boolean): Promise<void>
701
+ setDiscoverable(on: boolean, timeout?: number): Promise<void>
702
+ setName(name: string): Promise<void>
703
+ scan(on: boolean): Promise<void>
704
+ pair(id: string): Promise<void>
705
+ answer(id: string, accept: boolean, pin?: string): Promise<void>
706
+ connect(id: string): Promise<void>
707
+ disconnect(id: string): Promise<void>
708
+ forget(id: string): Promise<void>
709
+ setTrusted(id: string, on: boolean): Promise<void>
710
+ setBlocked(id: string, on: boolean): Promise<void>
711
+ rename(id: string, name: string): Promise<void>
712
+ setOnLogin(mode: 'remember' | 'on' | 'off'): Promise<void>
713
+ on(type: 'changed', handler: (state: BluetoothState) => void): () => boolean
714
+ on(type: 'pairing', handler: (request: BluetoothPairing) => void): () => boolean
715
+ }
716
+
717
+ export interface AudioPort {
718
+ readonly id: string
719
+ readonly name: string
720
+ readonly available: boolean | null
721
+ }
722
+
723
+ export interface AudioDevice {
724
+ readonly id: string
725
+ readonly name: string
726
+ readonly port: 'speaker' | 'headphones' | 'hdmi' | 'bluetooth' | 'usb' | 'mic' | 'other'
727
+ readonly isDefault: boolean
728
+ readonly volume: number
729
+ readonly muted: boolean
730
+ readonly balance: number | null
731
+ readonly ports: readonly AudioPort[]
732
+ readonly activePort: string | null
733
+ readonly card: string | null
734
+ readonly virtual: boolean
735
+ }
736
+
737
+ export interface AudioStream {
738
+ readonly id: string
739
+ readonly kind: 'playback' | 'capture'
740
+ readonly app: string
741
+ readonly title: string
742
+ readonly icon: string
743
+ readonly volume: number
744
+ readonly muted: boolean
745
+ readonly balance: number | null
746
+ readonly device: string | null
747
+ }
748
+
749
+ export interface AudioCard {
750
+ readonly id: string
751
+ readonly name: string
752
+ readonly icon: string
753
+ readonly bus: string
754
+ readonly profile: string | null
755
+ readonly profiles: readonly { readonly id: string; readonly name: string; readonly available: boolean | null }[]
756
+ }
757
+
758
+ export interface AudioState {
759
+ readonly outputs: readonly AudioDevice[]
760
+ readonly inputs: readonly AudioDevice[]
761
+ readonly streams: readonly AudioStream[]
762
+ readonly cards: readonly AudioCard[]
763
+ readonly maxVolume: number
764
+ }
765
+
766
+ export interface AcdeAudio {
767
+ state(): Promise<AudioState>
768
+ setDefault(id: string): Promise<void>
769
+ setVolume(id: string, volume: number): Promise<void>
770
+ setMuted(id: string, muted: boolean): Promise<void>
771
+ setBalance(id: string, balance: number): Promise<void>
772
+ setPort(id: string, port: string): Promise<void>
773
+ setProfile(card: string, profile: string): Promise<void>
774
+ moveStream(id: string, device: string | null): Promise<void>
775
+ on(type: 'changed', handler: (state: AudioState) => void): () => boolean
776
+ }
777
+
778
+ export interface Drive {
779
+ readonly id: string
780
+ readonly device: string
781
+ readonly label: string
782
+ readonly kind: 'usb' | 'card' | 'disc' | 'phone' | 'disk'
783
+ readonly size: number
784
+ readonly free: number | null
785
+ readonly mounted: boolean
786
+ readonly path: string | null
787
+ readonly ejectable: boolean
788
+ }
789
+
790
+ export interface Printer {
791
+ readonly id: string
792
+ readonly name: string
793
+ readonly state: 'idle' | 'printing' | 'stopped' | 'offline'
794
+ readonly isDefault: boolean
795
+ readonly jobs: number
796
+ readonly model: string
797
+ readonly location: string
798
+ readonly message: string
799
+ readonly reasons: readonly string[]
800
+ readonly accepting: boolean
801
+ readonly shared: boolean
802
+ }
803
+
804
+ export interface PrintJob {
805
+ readonly id: number
806
+ readonly name: string
807
+ readonly user: string
808
+ readonly state: 'pending' | 'held' | 'processing' | 'stopped' | 'canceled' | 'aborted' | 'completed'
809
+ readonly size: number
810
+ readonly created: number
811
+ readonly message: string
812
+ }
813
+
814
+ export interface AutomountDevice {
815
+ readonly id: string
816
+ readonly name: string
817
+ readonly attached: boolean
818
+ readonly login: boolean
819
+ readonly attach: boolean
820
+ readonly everMounted: boolean
821
+ }
822
+
823
+ export interface Automount {
824
+ readonly onLogin: boolean
825
+ readonly onAttach: boolean
826
+ readonly unknown: boolean
827
+ readonly devices: readonly AutomountDevice[]
828
+ }
829
+
830
+ export interface DevicesState {
831
+ readonly drives: readonly Drive[]
832
+ readonly printers: readonly Printer[]
833
+ readonly printing: boolean
834
+ readonly automount: Automount
835
+ }
836
+
837
+ export interface AcdeDevices {
838
+ state(): Promise<DevicesState>
839
+ mount(id: string): Promise<string>
840
+ unmount(id: string): Promise<void>
841
+ eject(id: string): Promise<void>
842
+ setAutomount(patch: Partial<Pick<Automount, 'onLogin' | 'onAttach' | 'unknown'>>): Promise<void>
843
+ setDeviceAutomount(id: string, patch: Partial<Pick<AutomountDevice, 'login' | 'attach'>>): Promise<void>
844
+ forgetDevice(id: string): Promise<void>
845
+ setDefaultPrinter(id: string): Promise<void>
846
+ pausePrinter(id: string): Promise<void>
847
+ resumePrinter(id: string): Promise<void>
848
+ jobs(printer: string): Promise<PrintJob[]>
849
+ cancelJob(printer: string, job: number): Promise<void>
850
+ on(type: 'changed', handler: (state: DevicesState) => void): () => boolean
851
+ on(type: 'added', handler: (drive: Drive) => void): () => boolean
852
+ }
853
+
854
+ export type PowerProfile = 'power-saver' | 'balanced' | 'performance'
855
+
856
+ export type PowerAction = 'none' | 'sleep' | 'hibernate' | 'shutdown' | 'prompt' | 'lock' | 'screen-off'
857
+
858
+ export type PowerIdleAction = 'none' | 'sleep' | 'hibernate' | 'shutdown'
859
+
860
+ export interface ChargeLimit {
861
+ readonly start: number | null
862
+ readonly end: number | null
863
+ readonly writable: boolean
864
+ readonly upower: boolean
865
+ }
866
+
867
+ export interface PowerBattery {
868
+ readonly id: string
869
+ readonly name: string
870
+ readonly percent: number
871
+ readonly state: 'charging' | 'discharging' | 'full' | 'empty' | 'unknown'
872
+ readonly secondsLeft: number | null
873
+ readonly health: number | null
874
+ readonly rate: number | null
875
+ readonly chargeLimit: ChargeLimit | null
876
+ }
877
+
878
+ export interface PowerPolicy {
879
+ readonly dim: number | null
880
+ readonly screenOff: number | null
881
+ readonly idleAction: PowerIdleAction
882
+ readonly idleAfter: number
883
+ readonly lidAction: PowerAction
884
+ readonly lidExternal: boolean
885
+ readonly powerButton: PowerAction
886
+ readonly sleepMode: 'suspend' | 'hybrid' | 'suspend-then-hibernate'
887
+ readonly profile: PowerProfile | null
888
+ readonly brightness: number | null
889
+ }
890
+
891
+ export type PowerGroup = 'ac' | 'battery' | 'lowBattery'
892
+
893
+ export interface PowerSettings {
894
+ readonly ac: PowerPolicy
895
+ readonly battery: PowerPolicy
896
+ readonly lowBattery: PowerPolicy
897
+ readonly lowLevel: number
898
+ readonly criticalLevel: number
899
+ readonly criticalAction: PowerIdleAction
900
+ }
901
+
902
+ export type PowerSettingsPatch = { readonly [G in PowerGroup]?: Partial<PowerPolicy> } & Partial<Pick<PowerSettings, 'lowLevel' | 'criticalLevel' | 'criticalAction'>>
903
+
904
+ export interface PowerState {
905
+ readonly onBattery: boolean
906
+ readonly battery: PowerBattery | null
907
+ readonly batteries: readonly PowerBattery[]
908
+ readonly lid: boolean
909
+ readonly profile: PowerProfile | null
910
+ readonly profiles: readonly PowerProfile[]
911
+ readonly degraded: string | null
912
+ readonly screenOffSeconds: number | null
913
+ readonly sleepSeconds: number | null
914
+ readonly current: PowerGroup
915
+ readonly settings: PowerSettings
916
+ readonly can: { readonly suspend: boolean; readonly hibernate: boolean; readonly hybrid: boolean; readonly suspendThenHibernate: boolean }
917
+ readonly brightness: number | null
918
+ readonly inhibitors: readonly { readonly who: string; readonly why: string; readonly what: readonly ('sleep' | 'idle')[] }[]
919
+ readonly policy: boolean
920
+ }
921
+
922
+ export interface InputLayout {
923
+ readonly layout: string
924
+ readonly variant: string
925
+ }
926
+
927
+ export interface InputKeyboard {
928
+ readonly layouts: readonly InputLayout[]
929
+ readonly model: string
930
+ readonly options: readonly string[]
931
+ readonly repeat: boolean
932
+ readonly repeatDelay: number
933
+ readonly repeatRate: number
934
+ readonly numlock: 'on' | 'off' | 'unchanged'
935
+ readonly active: readonly string[]
936
+ readonly current: number
937
+ }
938
+
939
+ export type InputScroll = 'two-finger' | 'edge' | 'button' | 'none'
940
+ export type InputClick = 'areas' | 'fingers'
941
+
942
+ export interface InputPointer {
943
+ readonly present: boolean
944
+ readonly speed?: number
945
+ readonly acceleration?: 'adaptive' | 'flat'
946
+ readonly leftHanded?: boolean
947
+ readonly naturalScroll?: boolean
948
+ readonly scrollSpeed?: number
949
+ readonly middleEmulation?: boolean
950
+ }
951
+
952
+ export interface InputTouchpad extends InputPointer {
953
+ readonly tapToClick?: boolean
954
+ readonly tapAndDrag?: boolean
955
+ readonly dragLock?: boolean
956
+ readonly tapButtons?: 'lrm' | 'lmr'
957
+ readonly disableWhileTyping?: boolean
958
+ readonly scroll?: InputScroll
959
+ readonly click?: InputClick
960
+ readonly scrollMethods: readonly InputScroll[]
961
+ readonly clickMethods: readonly InputClick[]
962
+ }
963
+
964
+ export interface InputState {
965
+ readonly keyboard: InputKeyboard
966
+ readonly mouse: InputPointer
967
+ readonly touchpad: InputTouchpad
968
+ readonly devices: readonly { readonly name: string; readonly kind: 'mouse' | 'touchpad' }[]
969
+ }
970
+
971
+ type InputNullable<T> = { readonly [K in keyof T]?: T[K] | null }
972
+
973
+ export interface InputPatch {
974
+ readonly keyboard?: InputNullable<Omit<InputKeyboard, 'active' | 'current'>>
975
+ readonly mouse?: InputNullable<Omit<InputPointer, 'present'>>
976
+ readonly touchpad?: InputNullable<Omit<InputTouchpad, 'present' | 'scrollMethods' | 'clickMethods'>>
977
+ }
978
+
979
+ export interface InputCatalog {
980
+ readonly models: readonly { readonly id: string; readonly name: string; readonly vendor: string }[]
981
+ readonly layouts: readonly {
982
+ readonly id: string
983
+ readonly name: string
984
+ readonly short: string
985
+ readonly languages: readonly string[]
986
+ readonly variants: readonly { readonly id: string; readonly name: string }[]
987
+ }[]
988
+ readonly options: readonly {
989
+ readonly id: string
990
+ readonly name: string
991
+ readonly multiple: boolean
992
+ readonly options: readonly { readonly id: string; readonly name: string }[]
993
+ }[]
994
+ }
995
+
996
+ export interface AcdeInput {
997
+ state(): Promise<InputState>
998
+ set(patch: InputPatch): Promise<void>
999
+ catalog(): Promise<InputCatalog>
1000
+ on(type: 'changed', handler: (state: InputState) => void): () => boolean
1001
+ }
1002
+
1003
+ export interface DisplayMode {
1004
+ readonly width: number
1005
+ readonly height: number
1006
+ readonly refresh: number
1007
+ readonly preferred?: boolean
1008
+ }
1009
+
1010
+ export interface DisplayInfo {
1011
+ readonly id: string
1012
+ readonly name: string
1013
+ readonly builtin: boolean
1014
+ readonly primary: boolean
1015
+ readonly enabled: boolean
1016
+ readonly mode: DisplayMode
1017
+ readonly modes: readonly DisplayMode[]
1018
+ readonly scale: number
1019
+ readonly scales: readonly number[]
1020
+ readonly brightness: number | null
1021
+ readonly rotation: 0 | 90 | 180 | 270
1022
+ }
1023
+
1024
+ export interface NightLight {
1025
+ readonly on: boolean
1026
+ readonly warmth: number
1027
+ readonly schedule: 'manual' | 'sunset'
1028
+ }
1029
+
1030
+ export interface DisplayState {
1031
+ readonly displays: readonly DisplayInfo[]
1032
+ readonly nightLight: NightLight | null
1033
+ }
1034
+
1035
+ export interface DisplayPatch {
1036
+ readonly scale?: number
1037
+ }
1038
+
1039
+ export interface AcdeDisplay {
1040
+ state(): Promise<DisplayState>
1041
+ configure(id: string, patch: DisplayPatch): Promise<void>
1042
+ setBrightness(id: string, value: number): Promise<void>
1043
+ setNightLight(patch: Partial<NightLight>): Promise<void>
1044
+ on(type: 'changed', handler: (state: DisplayState) => void): () => boolean
1045
+ }
1046
+
1047
+ export interface AcdePower {
1048
+ state(): Promise<PowerState>
1049
+ setProfile(profile: PowerProfile): Promise<void>
1050
+ configure(patch: PowerSettingsPatch): Promise<void>
1051
+ setScreenOff(seconds: number | null): Promise<void>
1052
+ setSleep(seconds: number | null): Promise<void>
1053
+ suspend(): Promise<void>
1054
+ hibernate(): Promise<void>
1055
+ setBrightness(value: number): Promise<void>
1056
+ setChargeLimit(percent: number | null): Promise<void>
1057
+ on(type: 'changed', handler: (state: PowerState) => void): () => boolean
1058
+ on(type: 'prompt', handler: (event: { readonly type: 'prompt' }) => void): () => boolean
1059
+ on(type: 'critical', handler: (event: { readonly type: 'critical'; readonly action: PowerIdleAction; readonly seconds: number }) => void): () => boolean
1060
+ }
1061
+
1062
+ export interface AcdePage {
1063
+ readonly fs?: AcdeFs
1064
+ readonly office?: AcdeOffice
1065
+ readonly terminal?: AcdeTerminals
1066
+ readonly network?: AcdeNetwork
1067
+ readonly system?: AcdeSystem
1068
+ readonly bluetooth?: AcdeBluetooth
1069
+ readonly audio?: AcdeAudio
1070
+ readonly devices?: AcdeDevices
1071
+ readonly power?: AcdePower
1072
+ readonly input?: AcdeInput
1073
+ readonly display?: AcdeDisplay
1074
+ readonly windows?: AcdeWindows
1075
+ readonly apps?: AcdeApps
1076
+ readonly launch?: AcdeLaunch
1077
+ readonly packages?: AcdePackages
1078
+ readonly desktop?: AcdeDesktop
1079
+ readonly desktops?: AcdeDesktops
1080
+ readonly session?: AcdeSession
1081
+ readonly inspect?: AcdeInspect
1082
+ readonly open?: AcdeOpen
1083
+ readonly openPath?: AcdeOpenFiles['openPath']
1084
+ readonly handlers?: AcdeOpenFiles['handlers']
1085
+ readonly setDefault?: AcdeOpenFiles['setDefault']
1086
+ readonly permissions?: AcdePermissions
1087
+ readonly window?: AcdeWindow
1088
+ readonly capabilities?: import('./capabilities').AcdeCapabilities
1089
+ readonly [service: string]: unknown
1090
+ }