waterplane 0.1.16 → 0.1.18

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 (235) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/NOTICES.md +18 -7
  3. package/README.md +43 -0
  4. package/SECURITY.md +196 -12
  5. package/node_modules/@waterplane/shared/dist/desktopfiles.d.ts +24 -2
  6. package/node_modules/@waterplane/shared/dist/desktopfiles.js +73 -3
  7. package/node_modules/@waterplane/shared/dist/desktopfiles.js.map +1 -1
  8. package/node_modules/@waterplane/shared/dist/hosts.d.ts +31 -0
  9. package/node_modules/@waterplane/shared/dist/hosts.js +46 -1
  10. package/node_modules/@waterplane/shared/dist/hosts.js.map +1 -1
  11. package/node_modules/@waterplane/shared/dist/hosturl.d.ts +55 -0
  12. package/node_modules/@waterplane/shared/dist/hosturl.js +85 -0
  13. package/node_modules/@waterplane/shared/dist/hosturl.js.map +1 -1
  14. package/node_modules/@waterplane/shared/dist/index.d.ts +4 -0
  15. package/node_modules/@waterplane/shared/dist/index.js +4 -0
  16. package/node_modules/@waterplane/shared/dist/index.js.map +1 -1
  17. package/node_modules/@waterplane/shared/dist/installrow.d.ts +6 -1
  18. package/node_modules/@waterplane/shared/dist/installrow.js +20 -1
  19. package/node_modules/@waterplane/shared/dist/installrow.js.map +1 -1
  20. package/node_modules/@waterplane/shared/dist/lanroute.d.ts +5 -0
  21. package/node_modules/@waterplane/shared/dist/lanroute.js.map +1 -1
  22. package/node_modules/@waterplane/shared/dist/pairing.d.ts +96 -2
  23. package/node_modules/@waterplane/shared/dist/pairing.js +71 -3
  24. package/node_modules/@waterplane/shared/dist/pairing.js.map +1 -1
  25. package/node_modules/@waterplane/shared/dist/pake.d.ts +131 -0
  26. package/node_modules/@waterplane/shared/dist/pake.js +272 -0
  27. package/node_modules/@waterplane/shared/dist/pake.js.map +1 -0
  28. package/node_modules/@waterplane/shared/dist/peer.d.ts +63 -0
  29. package/node_modules/@waterplane/shared/dist/peer.js +41 -0
  30. package/node_modules/@waterplane/shared/dist/peer.js.map +1 -1
  31. package/node_modules/@waterplane/shared/dist/plugin/api.d.ts +15 -0
  32. package/node_modules/@waterplane/shared/dist/plugin/version.d.ts +5 -1
  33. package/node_modules/@waterplane/shared/dist/plugin/version.js +5 -1
  34. package/node_modules/@waterplane/shared/dist/plugin/version.js.map +1 -1
  35. package/node_modules/@waterplane/shared/dist/sessioncost/costwords.d.ts +7 -2
  36. package/node_modules/@waterplane/shared/dist/sessioncost/costwords.js +6 -3
  37. package/node_modules/@waterplane/shared/dist/sessioncost/costwords.js.map +1 -1
  38. package/node_modules/@waterplane/shared/dist/waiting.d.ts +64 -0
  39. package/node_modules/@waterplane/shared/dist/waiting.js +86 -0
  40. package/node_modules/@waterplane/shared/dist/waiting.js.map +1 -0
  41. package/node_modules/@waterplane/shared/dist/wire/messages/hostcore.d.ts +3 -0
  42. package/node_modules/@waterplane/shared/dist/wire/notify.d.ts +2 -0
  43. package/node_modules/@waterplane/shared/dist/wire/notify.js +2 -0
  44. package/node_modules/@waterplane/shared/dist/wire/notify.js.map +1 -1
  45. package/node_modules/@waterplane/shared/dist/wire/repo.d.ts +25 -1
  46. package/node_modules/@waterplane/shared/dist/wire/repo.js.map +1 -1
  47. package/node_modules/@waterplane/shared/dist/wire/sysstat.d.ts +7 -0
  48. package/node_modules/@waterplane/shared/dist/wire/telemetry.d.ts +3 -0
  49. package/node_modules/@waterplane/shared/package.json +3 -0
  50. package/npm-shrinkwrap.json +30 -2
  51. package/package.json +2 -1
  52. package/packages/extensions/desktop/helper/Capture.swift +245 -0
  53. package/packages/extensions/desktop/helper/H264.swift +226 -0
  54. package/packages/extensions/desktop/helper/Info.plist +20 -0
  55. package/packages/extensions/desktop/helper/Input.swift +195 -0
  56. package/packages/extensions/desktop/helper/Jpeg.swift +81 -0
  57. package/packages/extensions/desktop/helper/PROTOCOL.md +366 -0
  58. package/packages/extensions/desktop/helper/Params.swift +133 -0
  59. package/packages/extensions/desktop/helper/Probe.swift +119 -0
  60. package/packages/extensions/desktop/helper/Protocol.swift +224 -0
  61. package/packages/extensions/desktop/helper/Request.swift +51 -0
  62. package/packages/extensions/desktop/helper/Responsibility.swift +133 -0
  63. package/packages/extensions/desktop/helper/Server.swift +334 -0
  64. package/packages/extensions/desktop/helper/Synthetic.swift +281 -0
  65. package/packages/extensions/desktop/helper/build.sh +53 -0
  66. package/packages/extensions/desktop/helper/main.swift +79 -0
  67. package/packages/extensions/desktop/helper/selftest-driver +626 -0
  68. package/packages/extensions/desktop/helper/selftest.sh +16 -0
  69. package/packages/extensions/desktop/helper-win/Capture.cs +299 -0
  70. package/packages/extensions/desktop/helper-win/H264.cs +340 -0
  71. package/packages/extensions/desktop/helper-win/Input.cs +257 -0
  72. package/packages/extensions/desktop/helper-win/Jpeg.cs +75 -0
  73. package/packages/extensions/desktop/helper-win/Main.cs +118 -0
  74. package/packages/extensions/desktop/helper-win/Native.cs +276 -0
  75. package/packages/extensions/desktop/helper-win/Params.cs +138 -0
  76. package/packages/extensions/desktop/helper-win/Protocol.cs +206 -0
  77. package/packages/extensions/desktop/helper-win/Server.cs +304 -0
  78. package/packages/extensions/desktop/helper-win/Synthetic.cs +88 -0
  79. package/packages/extensions/desktop/helper-win/build.sh +57 -0
  80. package/packages/extensions/desktop/helper-win/selftest.sh +36 -0
  81. package/packages/extensions/desktop/waterplane-plugin.json +24 -0
  82. package/packages/host/dist/alwayson.js +1 -1
  83. package/packages/host/dist/alwayson.js.map +1 -1
  84. package/packages/host/dist/attentionstore.d.ts +4 -0
  85. package/packages/host/dist/attentionstore.js +17 -0
  86. package/packages/host/dist/attentionstore.js.map +1 -1
  87. package/packages/host/dist/auth.d.ts +28 -0
  88. package/packages/host/dist/auth.js +65 -2
  89. package/packages/host/dist/auth.js.map +1 -1
  90. package/packages/host/dist/cli/pair.d.ts +4 -0
  91. package/packages/host/dist/cli/pair.js +18 -5
  92. package/packages/host/dist/cli/pair.js.map +1 -1
  93. package/packages/host/dist/der.d.ts +19 -0
  94. package/packages/host/dist/der.js +51 -0
  95. package/packages/host/dist/der.js.map +1 -0
  96. package/packages/host/dist/doctor.d.ts +2 -0
  97. package/packages/host/dist/doctor.js +10 -2
  98. package/packages/host/dist/doctor.js.map +1 -1
  99. package/packages/host/dist/extensions/desktop/host/auto.d.mts +71 -0
  100. package/packages/host/dist/extensions/desktop/host/auto.mjs +114 -0
  101. package/packages/host/dist/extensions/desktop/host/auto.mjs.map +1 -0
  102. package/packages/host/dist/extensions/desktop/host/desktop.d.mts +51 -0
  103. package/packages/host/dist/extensions/desktop/host/desktop.mjs +113 -0
  104. package/packages/host/dist/extensions/desktop/host/desktop.mjs.map +1 -0
  105. package/packages/host/dist/extensions/desktop/host/helperbin.d.mts +71 -0
  106. package/packages/host/dist/extensions/desktop/host/helperbin.mjs +160 -0
  107. package/packages/host/dist/extensions/desktop/host/helperbin.mjs.map +1 -0
  108. package/packages/host/dist/extensions/desktop/host/index.d.mts +4 -0
  109. package/packages/host/dist/extensions/desktop/host/index.mjs +88 -0
  110. package/packages/host/dist/extensions/desktop/host/index.mjs.map +1 -0
  111. package/packages/host/dist/extensions/desktop/host/knobs.d.mts +52 -0
  112. package/packages/host/dist/extensions/desktop/host/knobs.mjs +81 -0
  113. package/packages/host/dist/extensions/desktop/host/knobs.mjs.map +1 -0
  114. package/packages/host/dist/extensions/desktop/host/probe.d.mts +57 -0
  115. package/packages/host/dist/extensions/desktop/host/probe.mjs +119 -0
  116. package/packages/host/dist/extensions/desktop/host/probe.mjs.map +1 -0
  117. package/packages/host/dist/extensions/desktop/host/records.d.mts +40 -0
  118. package/packages/host/dist/extensions/desktop/host/records.mjs +101 -0
  119. package/packages/host/dist/extensions/desktop/host/records.mjs.map +1 -0
  120. package/packages/host/dist/extensions/desktop/host/session.d.mts +86 -0
  121. package/packages/host/dist/extensions/desktop/host/session.mjs +318 -0
  122. package/packages/host/dist/extensions/desktop/host/session.mjs.map +1 -0
  123. package/packages/host/dist/extensions/desktop/host/setup.d.mts +28 -0
  124. package/packages/host/dist/extensions/desktop/host/setup.mjs +217 -0
  125. package/packages/host/dist/extensions/desktop/host/setup.mjs.map +1 -0
  126. package/packages/host/dist/extensions/desktop/host/status.d.mts +27 -0
  127. package/packages/host/dist/extensions/desktop/host/status.mjs +62 -0
  128. package/packages/host/dist/extensions/desktop/host/status.mjs.map +1 -0
  129. package/packages/host/dist/extensions/desktop/shared/wire.d.mts +206 -0
  130. package/packages/host/dist/extensions/desktop/shared/wire.mjs +174 -0
  131. package/packages/host/dist/extensions/desktop/shared/wire.mjs.map +1 -0
  132. package/packages/host/dist/git.d.ts +23 -6
  133. package/packages/host/dist/git.js +54 -26
  134. package/packages/host/dist/git.js.map +1 -1
  135. package/packages/host/dist/gitfetchfail.d.ts +24 -0
  136. package/packages/host/dist/gitfetchfail.js +62 -0
  137. package/packages/host/dist/gitfetchfail.js.map +1 -0
  138. package/packages/host/dist/gitlog.d.ts +4 -0
  139. package/packages/host/dist/gitlog.js +8 -3
  140. package/packages/host/dist/gitlog.js.map +1 -1
  141. package/packages/host/dist/gitnotify.d.ts +7 -1
  142. package/packages/host/dist/gitnotify.js +61 -1
  143. package/packages/host/dist/gitnotify.js.map +1 -1
  144. package/packages/host/dist/host.js +5 -1
  145. package/packages/host/dist/host.js.map +1 -1
  146. package/packages/host/dist/hoststore.js +4 -4
  147. package/packages/host/dist/hoststore.js.map +1 -1
  148. package/packages/host/dist/lantls.d.ts +145 -0
  149. package/packages/host/dist/lantls.js +337 -0
  150. package/packages/host/dist/lantls.js.map +1 -0
  151. package/packages/host/dist/main.js +7 -2
  152. package/packages/host/dist/main.js.map +1 -1
  153. package/packages/host/dist/net.d.ts +7 -0
  154. package/packages/host/dist/net.js +9 -0
  155. package/packages/host/dist/net.js.map +1 -1
  156. package/packages/host/dist/origin.d.ts +4 -0
  157. package/packages/host/dist/origin.js +6 -0
  158. package/packages/host/dist/origin.js.map +1 -1
  159. package/packages/host/dist/pair.d.ts +54 -5
  160. package/packages/host/dist/pair.js +139 -34
  161. package/packages/host/dist/pair.js.map +1 -1
  162. package/packages/host/dist/pairpake.d.ts +58 -0
  163. package/packages/host/dist/pairpake.js +208 -0
  164. package/packages/host/dist/pairpake.js.map +1 -0
  165. package/packages/host/dist/passive.d.ts +2 -0
  166. package/packages/host/dist/passive.js +4 -0
  167. package/packages/host/dist/passive.js.map +1 -1
  168. package/packages/host/dist/peers/client.d.ts +3 -1
  169. package/packages/host/dist/peers/client.js +4 -0
  170. package/packages/host/dist/peers/client.js.map +1 -1
  171. package/packages/host/dist/peers/routes.d.ts +6 -1
  172. package/packages/host/dist/peers/routes.js +39 -0
  173. package/packages/host/dist/peers/routes.js.map +1 -1
  174. package/packages/host/dist/plugins/pluginapi.js +13 -0
  175. package/packages/host/dist/plugins/pluginapi.js.map +1 -1
  176. package/packages/host/dist/plugins/pluginregistry.d.ts +6 -0
  177. package/packages/host/dist/plugins/pluginregistry.js.map +1 -1
  178. package/packages/host/dist/prepushcheck.d.ts +34 -0
  179. package/packages/host/dist/prepushcheck.js +157 -0
  180. package/packages/host/dist/prepushcheck.js.map +1 -0
  181. package/packages/host/dist/prs.js +2 -1
  182. package/packages/host/dist/prs.js.map +1 -1
  183. package/packages/host/dist/routes/apigitcheck.d.ts +2 -0
  184. package/packages/host/dist/routes/apigitcheck.js +29 -0
  185. package/packages/host/dist/routes/apigitcheck.js.map +1 -0
  186. package/packages/host/dist/routes/apihost.js +2 -0
  187. package/packages/host/dist/routes/apihost.js.map +1 -1
  188. package/packages/host/dist/routes/apiio.js +2 -1
  189. package/packages/host/dist/routes/apiio.js.map +1 -1
  190. package/packages/host/dist/routes/apirepofiles.js +2 -1
  191. package/packages/host/dist/routes/apirepofiles.js.map +1 -1
  192. package/packages/host/dist/routes/apisystem.js +21 -3
  193. package/packages/host/dist/routes/apisystem.js.map +1 -1
  194. package/packages/host/dist/server/http.js +31 -5
  195. package/packages/host/dist/server/http.js.map +1 -1
  196. package/packages/host/dist/server/plugins.d.ts +13 -0
  197. package/packages/host/dist/server/plugins.js +26 -0
  198. package/packages/host/dist/server/plugins.js.map +1 -1
  199. package/packages/host/dist/server/wsops.js +3 -1
  200. package/packages/host/dist/server/wsops.js.map +1 -1
  201. package/packages/host/dist/sysstat.js +10 -1
  202. package/packages/host/dist/sysstat.js.map +1 -1
  203. package/packages/host/dist/updatekey.d.ts +22 -0
  204. package/packages/host/dist/updatekey.js +140 -0
  205. package/packages/host/dist/updatekey.js.map +1 -0
  206. package/packages/host/dist/webbundle.d.ts +15 -6
  207. package/packages/host/dist/webbundle.js +44 -7
  208. package/packages/host/dist/webbundle.js.map +1 -1
  209. package/packages/host/dist/wincpu.d.ts +13 -0
  210. package/packages/host/dist/wincpu.js +101 -0
  211. package/packages/host/dist/wincpu.js.map +1 -0
  212. package/packages/host/package.json +2 -1
  213. package/packages/web/dist/assets/demo-BLBaz4G_.js +26 -0
  214. package/packages/web/dist/assets/icons-D8RlmSLR.js +1 -0
  215. package/packages/web/dist/assets/index-BrvcQFBj.js +170 -0
  216. package/packages/web/dist/assets/index-Dx3VHnr3.css +1 -0
  217. package/packages/web/dist/assets/noble-DV-r0OkE.js +1 -0
  218. package/packages/web/dist/assets/{react-CoSyT_xY.js → react-CjmvHigY.js} +2 -2
  219. package/packages/web/dist/assets/rolldown-runtime-4tVxZq34.js +1 -0
  220. package/packages/web/dist/assets/shared-BsWIJLE-.js +51 -0
  221. package/packages/web/dist/assets/sheets-C7CXUU6R.js +250 -0
  222. package/packages/web/dist/assets/xterm-BHsKrDzh.js +16 -0
  223. package/packages/web/dist/build-id.txt +1 -1
  224. package/packages/web/dist/buildstamp.json +1 -1
  225. package/packages/web/dist/index.html +9 -9
  226. package/packages/web/dist/sw.js +2 -2
  227. package/release.json +7 -3
  228. package/packages/web/dist/assets/demo-DkCtg-SJ.js +0 -26
  229. package/packages/web/dist/assets/icons-B48F-4nA.js +0 -1
  230. package/packages/web/dist/assets/index-CpdyS6Xe.css +0 -1
  231. package/packages/web/dist/assets/index-EYc28CfH.js +0 -170
  232. package/packages/web/dist/assets/rolldown-runtime-BpQH8Ho1.js +0 -1
  233. package/packages/web/dist/assets/shared-DjRRLGfw.js +0 -50
  234. package/packages/web/dist/assets/sheets-ByWNPa9p.js +0 -248
  235. package/packages/web/dist/assets/xterm-C8zLTNGk.js +0 -16
@@ -0,0 +1,79 @@
1
+ // wp-desktop: capture, encode and inject for the live desktop view.
2
+ // The contract with the host is PROTOCOL.md; keep the two in step.
3
+
4
+ import Foundation
5
+
6
+ signal(SIGPIPE, SIG_IGN)
7
+
8
+ let argv = Array(CommandLine.arguments.dropFirst())
9
+ let cmd = argv.first ?? "help"
10
+ let flags = Set(argv.dropFirst())
11
+
12
+ func flagValue(_ name: String) -> String? {
13
+ guard let i = argv.firstIndex(of: name), i + 1 < argv.count else { return nil }
14
+ return argv[i + 1]
15
+ }
16
+
17
+ if flags.contains("--no-capture") { captureForbidden = true }
18
+
19
+ func disclaim() {
20
+ if flags.contains("--no-disclaim") { return }
21
+ disclaimResponsibilityIfNeeded(
22
+ force: flags.contains("--force-disclaim"), forceChild: flags.contains("--force-disclaim-child"))
23
+ }
24
+
25
+ let usage = """
26
+ usage: wp-desktop <command> [flags]
27
+ serve run the stream: JSON commands on stdin, binary records on stdout (PROTOCOL.md)
28
+ probe one JSON line: permissions, displays, OS, helper version
29
+ windows one JSON line: on-screen windows (id, owner, bounds; titles only where granted)
30
+ whoami one JSON line: pid and the responsible pid TCC judges
31
+ request [screen|accessibility] ASK macOS for the grant (shows its dialog on the desktop's
32
+ screen), then one JSON line. The only command that can raise a dialog;
33
+ --dry-request reads the state and asks nothing
34
+ version the helper version
35
+ flags (serve):
36
+ --source synthetic test pattern instead of the screen; no capture API is touched
37
+ --dry-input log the CGEvents input would post instead of posting them
38
+ --no-capture behave as if Screen Recording were not granted
39
+ --no-disclaim keep the parent as the responsible process (see Responsibility.swift)
40
+ --force-disclaim[-child] take the re-exec (or child) path even when not needed (selftest)
41
+
42
+ """
43
+
44
+ switch cmd {
45
+ case "serve":
46
+ disclaim()
47
+ let synthetic = flagValue("--source") == "synthetic"
48
+ let server = Server(dryInput: flags.contains("--dry-input"), forceSynthetic: synthetic)
49
+ // The App Nap / idle-sleep activity is the Server's, held only while a source runs.
50
+ server.run()
51
+ dispatchMain()
52
+ case "probe":
53
+ disclaim()
54
+ print(jsonLine(probeObject().filter { $0.key != "t" }))
55
+ case "windows":
56
+ print(jsonLine(["windows": windowList()]))
57
+ case "whoami":
58
+ disclaim()
59
+ let r = responsibility()
60
+ print(jsonLine([
61
+ "pid": Int(r.pid), "ppid": Int(getppid()), "responsiblePid": Int(r.responsible),
62
+ "responsibleSelf": r.pid == r.responsible,
63
+ "disclaimed": ProcessInfo.processInfo.environment["WP_DESKTOP_DISCLAIMED"] ?? "",
64
+ "path": executablePath() ?? "",
65
+ ]))
66
+ case "request":
67
+ disclaim()
68
+ let what = argv.count > 1 && !argv[1].hasPrefix("-") ? argv[1] : nil
69
+ guard let obj = requestObject(what, dry: flags.contains("--dry-request")) else {
70
+ FileHandle.standardError.write(Data("wp-desktop: request takes screen or accessibility\n".utf8))
71
+ exit(2)
72
+ }
73
+ print(jsonLine(obj))
74
+ case "version", "--version":
75
+ print(helperVersion)
76
+ default:
77
+ FileHandle.standardError.write(Data(usage.utf8))
78
+ exit(cmd == "help" || cmd == "--help" ? 0 : 2)
79
+ }