sweetlink 0.1.0 → 0.2.1

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 (232) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +1 -1
  3. package/README.md +22 -11
  4. package/dist/daemon/src/codename.d.ts.map +1 -1
  5. package/dist/daemon/src/codename.js +11 -11
  6. package/dist/daemon/src/codename.js.map +1 -1
  7. package/dist/daemon/src/index.d.ts +1 -1
  8. package/dist/daemon/src/index.js +131 -122
  9. package/dist/daemon/src/index.js.map +1 -1
  10. package/dist/shared/src/env.d.ts.map +1 -1
  11. package/dist/shared/src/env.js +12 -12
  12. package/dist/shared/src/env.js.map +1 -1
  13. package/dist/shared/src/index.d.ts +30 -30
  14. package/dist/shared/src/index.d.ts.map +1 -1
  15. package/dist/shared/src/index.js +17 -17
  16. package/dist/shared/src/index.js.map +1 -1
  17. package/dist/shared/src/node.d.ts +1 -1
  18. package/dist/shared/src/node.d.ts.map +1 -1
  19. package/dist/shared/src/node.js +18 -18
  20. package/dist/shared/src/node.js.map +1 -1
  21. package/dist/src/codex.d.ts +1 -1
  22. package/dist/src/codex.js +19 -19
  23. package/dist/src/codex.js.map +1 -1
  24. package/dist/src/commands/click.d.ts +1 -1
  25. package/dist/src/commands/click.d.ts.map +1 -1
  26. package/dist/src/commands/click.js +32 -24
  27. package/dist/src/commands/click.js.map +1 -1
  28. package/dist/src/commands/run-js.d.ts +1 -1
  29. package/dist/src/commands/run-js.d.ts.map +1 -1
  30. package/dist/src/commands/run-js.js +10 -10
  31. package/dist/src/commands/run-js.js.map +1 -1
  32. package/dist/src/commands/trust-ca.d.ts +1 -1
  33. package/dist/src/commands/trust-ca.js +15 -15
  34. package/dist/src/core/config-file.d.ts +6 -0
  35. package/dist/src/core/config-file.d.ts.map +1 -1
  36. package/dist/src/core/config-file.js +73 -38
  37. package/dist/src/core/config-file.js.map +1 -1
  38. package/dist/src/core/config.d.ts +3 -2
  39. package/dist/src/core/config.d.ts.map +1 -1
  40. package/dist/src/core/config.js +31 -18
  41. package/dist/src/core/config.js.map +1 -1
  42. package/dist/src/core/dev-bootstrap.d.ts +10 -0
  43. package/dist/src/core/dev-bootstrap.d.ts.map +1 -0
  44. package/dist/src/core/dev-bootstrap.js +112 -0
  45. package/dist/src/core/dev-bootstrap.js.map +1 -0
  46. package/dist/src/core/env.d.ts +1 -1
  47. package/dist/src/core/env.d.ts.map +1 -1
  48. package/dist/src/core/env.js +3 -3
  49. package/dist/src/core/env.js.map +1 -1
  50. package/dist/src/devtools-registry.d.ts.map +1 -1
  51. package/dist/src/devtools-registry.js +48 -46
  52. package/dist/src/devtools-registry.js.map +1 -1
  53. package/dist/src/env.d.ts +1 -1
  54. package/dist/src/env.js +1 -1
  55. package/dist/src/http.d.ts.map +1 -1
  56. package/dist/src/http.js +7 -6
  57. package/dist/src/http.js.map +1 -1
  58. package/dist/src/index.d.ts +7 -7
  59. package/dist/src/index.d.ts.map +1 -1
  60. package/dist/src/index.js +450 -363
  61. package/dist/src/index.js.map +1 -1
  62. package/dist/src/runtime/browser/client.d.ts +3 -3
  63. package/dist/src/runtime/browser/client.d.ts.map +1 -1
  64. package/dist/src/runtime/browser/client.js +79 -72
  65. package/dist/src/runtime/browser/client.js.map +1 -1
  66. package/dist/src/runtime/browser/commands/index.d.ts +2 -2
  67. package/dist/src/runtime/browser/commands/index.js +17 -17
  68. package/dist/src/runtime/browser/commands/index.js.map +1 -1
  69. package/dist/src/runtime/browser/dom-to-image-loader.d.ts.map +1 -1
  70. package/dist/src/runtime/browser/dom-to-image-loader.js +7 -7
  71. package/dist/src/runtime/browser/dom-to-image-loader.js.map +1 -1
  72. package/dist/src/runtime/browser/index.d.ts +3 -3
  73. package/dist/src/runtime/browser/index.js +2 -2
  74. package/dist/src/runtime/browser/module-loader.js +2 -2
  75. package/dist/src/runtime/browser/screenshot/hooks.d.ts +25 -53
  76. package/dist/src/runtime/browser/screenshot/hooks.d.ts.map +1 -1
  77. package/dist/src/runtime/browser/screenshot/hooks.js +32 -29
  78. package/dist/src/runtime/browser/screenshot/hooks.js.map +1 -1
  79. package/dist/src/runtime/browser/screenshot/index.d.ts +3 -3
  80. package/dist/src/runtime/browser/screenshot/index.d.ts.map +1 -1
  81. package/dist/src/runtime/browser/screenshot/index.js +17 -15
  82. package/dist/src/runtime/browser/screenshot/index.js.map +1 -1
  83. package/dist/src/runtime/browser/screenshot/renderers/dom-to-image.d.ts +1 -1
  84. package/dist/src/runtime/browser/screenshot/renderers/dom-to-image.js +13 -13
  85. package/dist/src/runtime/browser/screenshot/renderers/dom-to-image.js.map +1 -1
  86. package/dist/src/runtime/browser/screenshot/renderers/html2canvas.d.ts +1 -1
  87. package/dist/src/runtime/browser/screenshot/renderers/html2canvas.d.ts.map +1 -1
  88. package/dist/src/runtime/browser/screenshot/renderers/html2canvas.js +24 -24
  89. package/dist/src/runtime/browser/screenshot/renderers/html2canvas.js.map +1 -1
  90. package/dist/src/runtime/browser/screenshot/targets.d.ts +2 -2
  91. package/dist/src/runtime/browser/screenshot/targets.js +9 -9
  92. package/dist/src/runtime/browser/screenshot/utils.d.ts +1 -1
  93. package/dist/src/runtime/browser/screenshot/utils.d.ts.map +1 -1
  94. package/dist/src/runtime/browser/screenshot/utils.js +73 -71
  95. package/dist/src/runtime/browser/screenshot/utils.js.map +1 -1
  96. package/dist/src/runtime/browser/selector-discovery.d.ts +1 -1
  97. package/dist/src/runtime/browser/selector-discovery.d.ts.map +1 -1
  98. package/dist/src/runtime/browser/selector-discovery.js +24 -22
  99. package/dist/src/runtime/browser/selector-discovery.js.map +1 -1
  100. package/dist/src/runtime/browser/storage/session-storage.d.ts +1 -1
  101. package/dist/src/runtime/browser/storage/session-storage.d.ts.map +1 -1
  102. package/dist/src/runtime/browser/storage/session-storage.js +12 -10
  103. package/dist/src/runtime/browser/storage/session-storage.js.map +1 -1
  104. package/dist/src/runtime/browser/types.d.ts +7 -7
  105. package/dist/src/runtime/browser/types.js +1 -1
  106. package/dist/src/runtime/browser/utils/console.d.ts +1 -1
  107. package/dist/src/runtime/browser/utils/console.js +16 -16
  108. package/dist/src/runtime/browser/utils/console.js.map +1 -1
  109. package/dist/src/runtime/browser/utils/environment.js +2 -2
  110. package/dist/src/runtime/browser/utils/errors.d.ts.map +1 -1
  111. package/dist/src/runtime/browser/utils/errors.js +11 -11
  112. package/dist/src/runtime/browser/utils/number.d.ts.map +1 -1
  113. package/dist/src/runtime/browser/utils/number.js.map +1 -1
  114. package/dist/src/runtime/browser/utils/object.d.ts.map +1 -1
  115. package/dist/src/runtime/browser/utils/object.js +2 -2
  116. package/dist/src/runtime/browser/utils/object.js.map +1 -1
  117. package/dist/src/runtime/browser/utils/sanitize.js +2 -2
  118. package/dist/src/runtime/browser/utils/time.d.ts.map +1 -1
  119. package/dist/src/runtime/browser/utils/time.js +1 -1
  120. package/dist/src/runtime/chrome/cookies.d.ts +4 -4
  121. package/dist/src/runtime/chrome/cookies.d.ts.map +1 -1
  122. package/dist/src/runtime/chrome/cookies.js +31 -31
  123. package/dist/src/runtime/chrome/cookies.js.map +1 -1
  124. package/dist/src/runtime/chrome/deep-link.d.ts +13 -0
  125. package/dist/src/runtime/chrome/deep-link.d.ts.map +1 -0
  126. package/dist/src/runtime/chrome/deep-link.js +292 -0
  127. package/dist/src/runtime/chrome/deep-link.js.map +1 -0
  128. package/dist/src/runtime/chrome/diagnostics.d.ts.map +1 -1
  129. package/dist/src/runtime/chrome/diagnostics.js +13 -11
  130. package/dist/src/runtime/chrome/diagnostics.js.map +1 -1
  131. package/dist/src/runtime/chrome/focus.d.ts.map +1 -1
  132. package/dist/src/runtime/chrome/focus.js +5 -5
  133. package/dist/src/runtime/chrome/focus.js.map +1 -1
  134. package/dist/src/runtime/chrome/launch.d.ts.map +1 -1
  135. package/dist/src/runtime/chrome/launch.js +30 -30
  136. package/dist/src/runtime/chrome/launch.js.map +1 -1
  137. package/dist/src/runtime/chrome/puppeteer.d.ts +2 -2
  138. package/dist/src/runtime/chrome/puppeteer.d.ts.map +1 -1
  139. package/dist/src/runtime/chrome/puppeteer.js +16 -11
  140. package/dist/src/runtime/chrome/puppeteer.js.map +1 -1
  141. package/dist/src/runtime/chrome/reuse.d.ts.map +1 -1
  142. package/dist/src/runtime/chrome/reuse.js +38 -35
  143. package/dist/src/runtime/chrome/reuse.js.map +1 -1
  144. package/dist/src/runtime/chrome/session.d.ts +1 -1
  145. package/dist/src/runtime/chrome/session.d.ts.map +1 -1
  146. package/dist/src/runtime/chrome/session.js +12 -10
  147. package/dist/src/runtime/chrome/session.js.map +1 -1
  148. package/dist/src/runtime/chrome.d.ts +8 -8
  149. package/dist/src/runtime/chrome.js +8 -8
  150. package/dist/src/runtime/cookies.d.ts +1 -16
  151. package/dist/src/runtime/cookies.d.ts.map +1 -1
  152. package/dist/src/runtime/cookies.js +177 -281
  153. package/dist/src/runtime/cookies.js.map +1 -1
  154. package/dist/src/runtime/devstack.d.ts +1 -1
  155. package/dist/src/runtime/devstack.d.ts.map +1 -1
  156. package/dist/src/runtime/devstack.js +31 -28
  157. package/dist/src/runtime/devstack.js.map +1 -1
  158. package/dist/src/runtime/devtools/background.js +22 -22
  159. package/dist/src/runtime/devtools/cdp.d.ts +3 -2
  160. package/dist/src/runtime/devtools/cdp.d.ts.map +1 -1
  161. package/dist/src/runtime/devtools/cdp.js +61 -56
  162. package/dist/src/runtime/devtools/cdp.js.map +1 -1
  163. package/dist/src/runtime/devtools/config.d.ts +44 -1
  164. package/dist/src/runtime/devtools/config.d.ts.map +1 -1
  165. package/dist/src/runtime/devtools/config.js +15 -15
  166. package/dist/src/runtime/devtools/config.js.map +1 -1
  167. package/dist/src/runtime/devtools/constants.d.ts.map +1 -1
  168. package/dist/src/runtime/devtools/constants.js +18 -10
  169. package/dist/src/runtime/devtools/constants.js.map +1 -1
  170. package/dist/src/runtime/devtools/diagnostics.d.ts +6 -3
  171. package/dist/src/runtime/devtools/diagnostics.d.ts.map +1 -1
  172. package/dist/src/runtime/devtools/diagnostics.js +40 -38
  173. package/dist/src/runtime/devtools/diagnostics.js.map +1 -1
  174. package/dist/src/runtime/devtools/oauth.d.ts +1 -1
  175. package/dist/src/runtime/devtools/oauth.d.ts.map +1 -1
  176. package/dist/src/runtime/devtools/oauth.js +35 -28
  177. package/dist/src/runtime/devtools/oauth.js.map +1 -1
  178. package/dist/src/runtime/devtools/types.d.ts +3 -48
  179. package/dist/src/runtime/devtools/types.d.ts.map +1 -1
  180. package/dist/src/runtime/devtools.d.ts +7 -7
  181. package/dist/src/runtime/devtools.js +7 -7
  182. package/dist/src/runtime/next-devtools.d.ts.map +1 -1
  183. package/dist/src/runtime/next-devtools.js +12 -12
  184. package/dist/src/runtime/next-devtools.js.map +1 -1
  185. package/dist/src/runtime/screenshot.d.ts +9 -9
  186. package/dist/src/runtime/screenshot.d.ts.map +1 -1
  187. package/dist/src/runtime/screenshot.js +65 -46
  188. package/dist/src/runtime/screenshot.js.map +1 -1
  189. package/dist/src/runtime/scripts.d.ts +1 -1
  190. package/dist/src/runtime/scripts.d.ts.map +1 -1
  191. package/dist/src/runtime/scripts.js +28 -28
  192. package/dist/src/runtime/scripts.js.map +1 -1
  193. package/dist/src/runtime/session.d.ts +6 -6
  194. package/dist/src/runtime/session.d.ts.map +1 -1
  195. package/dist/src/runtime/session.js +35 -35
  196. package/dist/src/runtime/session.js.map +1 -1
  197. package/dist/src/runtime/smoke.d.ts +3 -3
  198. package/dist/src/runtime/smoke.d.ts.map +1 -1
  199. package/dist/src/runtime/smoke.js +85 -79
  200. package/dist/src/runtime/smoke.js.map +1 -1
  201. package/dist/src/runtime/url.d.ts +2 -2
  202. package/dist/src/runtime/url.d.ts.map +1 -1
  203. package/dist/src/runtime/url.js +20 -20
  204. package/dist/src/runtime/url.js.map +1 -1
  205. package/dist/src/screenshot-hooks.d.ts +1 -1
  206. package/dist/src/screenshot-hooks.d.ts.map +1 -1
  207. package/dist/src/screenshot-hooks.js +12 -12
  208. package/dist/src/screenshot-hooks.js.map +1 -1
  209. package/dist/src/shared/env.d.ts.map +1 -1
  210. package/dist/src/shared/env.js +11 -11
  211. package/dist/src/shared/env.js.map +1 -1
  212. package/dist/src/shared/index.d.ts +30 -30
  213. package/dist/src/shared/index.d.ts.map +1 -1
  214. package/dist/src/shared/index.js +17 -17
  215. package/dist/src/shared/index.js.map +1 -1
  216. package/dist/src/shared/node.d.ts +1 -1
  217. package/dist/src/shared/node.d.ts.map +1 -1
  218. package/dist/src/shared/node.js +18 -18
  219. package/dist/src/shared/node.js.map +1 -1
  220. package/dist/src/token.d.ts +1 -1
  221. package/dist/src/token.d.ts.map +1 -1
  222. package/dist/src/token.js +21 -18
  223. package/dist/src/token.js.map +1 -1
  224. package/dist/src/types.d.ts +7 -1
  225. package/dist/src/types.d.ts.map +1 -1
  226. package/dist/src/util/app-label.js +4 -4
  227. package/dist/src/util/errors.d.ts.map +1 -1
  228. package/dist/src/util/errors.js +12 -10
  229. package/dist/src/util/errors.js.map +1 -1
  230. package/dist/src/util/path.js +2 -2
  231. package/dist/src/util/regex.js +4 -4
  232. package/package.json +48 -40
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1 — 2026-06-11
4
+
5
+ - **Click defaults restored**: `sweetlink click` now scrolls targets into view and dispatches bubbling clicks by default again, with explicit `--no-scroll` and `--no-bubbles` opt-outs. Thanks @devYRPauli.
6
+ - **Cookie collection modernized**: Chrome cookie sync now uses `@steipete/sweet-cookie`, preserves the `~/.oracle` inline fallback, and drops the old native SQLite/keytar dependency path.
7
+ - **Smoke route corrected**: the built-in `main` preset now targets `/timeline` and no longer treats the removed `/timeline/home` route as equivalent.
8
+ - **Node 24 baseline**: package metadata, CI, TypeScript builds, linting, and runtime dependencies now target Node.js 24 or newer.
9
+ - **Runtime maintenance**: updated Commander, Puppeteer Core, Playwright Core, WebSocket, Vite, and supporting dependencies.
10
+
11
+ ## 0.2.0 — 2025-12-26
12
+
13
+ - **Browser runtime tests moved in**: migrated Sweetistics runtime/browser test coverage into SweetLink’s own suite.
14
+ - **JSDOM-backed runtime specs**: added `jsdom` dev dependency to support browser runtime tests.
15
+ - **DevTools cleanup**: removed an unused DevTools CDP import to keep lint noise down.
16
+ - **OAuth deep linking**: `sweetlink open` now auto-kicks OAuth and re-navigates to deep paths when a sign-in flow is required.
17
+ - **Cookie sync stability**: Chrome cookie harvesting runs sequentially to avoid dropped reads; added regression coverage.
18
+ - **Daemon entrypoints**: added the `sweetlinkd` bin plus `sweetlink daemon` subcommand for daemon starts.
19
+ - **Reuse fallback**: when a reused DevTools session fails to reach the deep link, `sweetlink open` now launches a fresh controlled window and retries.
20
+ - **Daemon shared resolution**: `sweetlinkd` now loads shared helpers via bundled paths so local installs and links run cleanly.
21
+ - **Dev bootstrap**: optional `devBootstrap.path` can mint a local admin API key + dev login URL for Sweetistics.
22
+
3
23
  ## 0.1.0 — 2025-11-22 (Initial release)
4
24
 
5
25
  ### Highlights
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Peter Steinberger
3
+ Copyright (c) 2026 Peter Steinberger
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,8 +1,17 @@
1
- # SweetLink 🍭
1
+ # SweetLink 🍭 - Playwright vibes in your current tab; close the agent loop
2
2
 
3
- SweetLink is the agent-ready way to "connect your agent to your web app. Like Playwright, but it works in your current tab. Close the loop." It drives a real browser session through the SweetLink daemon so you can authenticate, capture screenshots, run smoke tests, and gather DevTools telemetry without wiring up a headless automation stack.
3
+ <p align="center">
4
+ <img src="docs/assets/sweetlink-header.png" alt="SweetLink header banner" width="1100">
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/sweetlink"><img src="https://img.shields.io/npm/v/sweetlink?style=for-the-badge&logo=npm&logoColor=white" alt="npm version"></a>
9
+ <a href="https://github.com/steipete/sweetlink/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/steipete/sweetlink/ci.yml?branch=main&style=for-the-badge&label=tests" alt="CI Status"></a>
10
+ <a href="https://github.com/steipete/sweetlink"><img src="https://img.shields.io/badge/platforms-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=for-the-badge" alt="Platforms"></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="MIT License"></a>
12
+ </p>
4
13
 
5
- > **Note:** This README is the canonical copy. When updating docs for the public `steipete/sweetlink` repository, edit here first and then sync the changes.
14
+ SweetLink is the agent-ready way to "connect your agent to your web app. Like Playwright, but it works in your current tab. Close the loop." It drives a real browser session through the SweetLink daemon so you can authenticate, capture screenshots, run smoke tests, and gather DevTools telemetry without wiring up a headless automation stack.
6
15
 
7
16
  ## Features
8
17
 
@@ -14,10 +23,10 @@ SweetLink is the agent-ready way to "connect your agent to your web app. Like Pl
14
23
 
15
24
  ## Prerequisites
16
25
 
17
- - Node.js 22+
26
+ - Node.js 24+
18
27
  - `pnpm` (managed via Corepack)
19
28
  - TLS requirements: `brew install mkcert nss`
20
- - SweetLink daemon (`apps/sweetlink/daemon`) running locally or via `pnpm sweetlink:daemon`
29
+ - SweetLink daemon running locally (`pnpm exec sweetlink daemon` or `pnpm exec sweetlinkd`)
21
30
  - Trust the local certificate once: `pnpm sweetlink trust-ca`
22
31
 
23
32
  ## Installation
@@ -37,6 +46,7 @@ pnpm sweetlink --help
37
46
 
38
47
  Common workflows:
39
48
 
49
+ - `pnpm exec sweetlink daemon` – start the SweetLink daemon (alias: `pnpm exec sweetlinkd`).
40
50
  - `pnpm sweetlink open --controlled --path /dashboard` – launch/reuse the controlled Chrome window.
41
51
  - `pnpm sweetlink open --url http://localhost:4100/dashboard` – target a non-default host/port for one-off runs.
42
52
  - `pnpm sweetlink sessions` – view active sessions (codename, heartbeat, socket state, buffered console errors).
@@ -70,7 +80,7 @@ SweetLink defaults to `https://localhost:4455` for daemon traffic. Run `pnpm swe
70
80
  SweetLink consists of two cooperating pieces:
71
81
 
72
82
  - **CLI** – a Node.js client that parses your commands (`open`, `smoke`, `sessions`, etc.), reads `sweetlink.json`, and establishes a control session with your browser.
73
- - **Daemon** – a long-lived service (`pnpm sweetlink:daemon`) that launches or attaches to a DevTools-enabled Chrome instance, forwards console/network telemetry, and executes remote evaluations on behalf of the CLI.
83
+ - **Daemon** – a long-lived service (`pnpm exec sweetlink daemon` or `pnpm exec sweetlinkd`) that launches or attaches to a DevTools-enabled Chrome instance, forwards console/network telemetry, and executes remote evaluations on behalf of the CLI.
74
84
 
75
85
  The typical flow looks like this:
76
86
 
@@ -130,6 +140,7 @@ Place the config file in your project root (or any parent directory). With the f
130
140
  - `prodUrl` – Base URL for `--env prod` runs (smoke tests, screenshots). Falls back to the same origin as `appUrl` when omitted or when `SWEETLINK_PROD_URL` is unset.
131
141
  - `daemonUrl` – Location of the SweetLink daemon. Defaults to `https://localhost:4455`; override when you run the daemon remotely.
132
142
  - `adminKey` – Admin API key used when the CLI requests short-lived session tokens. Provide it via config/`--admin-key`, `SWEETLINK_LOCAL_ADMIN_API_KEY` (preferred for dev), `SWEETLINK_ADMIN_API_KEY` (prod), or the legacy `SWEETISTICS_*` variables for backwards compatibility.
143
+ - `devBootstrap` – Optional dev bootstrap settings that let the CLI fetch a local admin key + dev login URL on demand (endpoint + login path).
133
144
  - `port` – Injected into `appUrl` when no explicit host is provided. Handy for per-service configs (`4100`, `5173`, etc.).
134
145
  - `healthChecks.paths` – Additional paths the CLI and watchdog probe before assuming the app is healthy. Include JSON APIs or custom `/healthz` endpoints to catch silent failures.
135
146
  - `cookieMappings` – List of `{ hosts, origins }` entries that teach SweetLink which Chrome profiles to harvest cookies from. Map every hostname your app serves (including wildcards) to the origins you need (auth providers, REST APIs, CDNs). SweetLink combines these with the primary origin for the target URL; no extra domains are assumed automatically.
@@ -139,11 +150,11 @@ Place the config file in your project root (or any parent directory). With the f
139
150
  - `oauthScript` – Absolute or relative path to an OAuth automation script (ESM module). When set, SweetLink loads the module at runtime and calls its `authorize(context)` export to approve third-party consent dialogs.
140
151
 
141
152
  SweetLink reads the config once at start-up. When you edit `sweetlink.json` rerun the CLI command to pick up the new defaults. Multiple projects on the same machine can keep their own config files; SweetLink stops at the first file it finds while walking up the directory tree, so place project-specific configs as close to the repo root as possible.
142
- See `apps/sweetlink/docs/config.md` for a full configuration reference (including environment overrides).
153
+ See `docs/config.md` for a full configuration reference (including environment overrides).
143
154
 
144
155
  ### OAuth automation scripts
145
156
 
146
- Out of the box SweetLink no longer ships opinionated OAuth heuristics. Instead you can point `oauthScript` at a small ESM module that exports an `authorize(context)` function. The helper receives a `SweetLinkOauthAuthorizeContext` with DevTools and Puppeteer helpers, so you can fully control how SweetLink approves third-party consent prompts. A ready-to-use implementation for Twitter/X lives at `apps/sweetlink/examples/oauth/twitter-oauth-automation.ts`; copy it into your project (or tweak it) and set `oauthScript` to that path to re-enable the previous behaviour. If the script is omitted, SweetLink will log that auto-authorization is disabled and leave the prompt untouched.
157
+ Out of the box SweetLink no longer ships opinionated OAuth heuristics. Instead you can point `oauthScript` at a small ESM module that exports an `authorize(context)` function. The helper receives a `SweetLinkOauthAuthorizeContext` with DevTools and Puppeteer helpers, so you can fully control how SweetLink approves third-party consent prompts. A ready-to-use implementation for Twitter/X lives at `examples/oauth/twitter-oauth-automation.ts`; copy it into your project (or tweak it) and set `oauthScript` to that path to re-enable the previous behaviour. If the script is omitted, SweetLink will log that auto-authorization is disabled and leave the prompt untouched.
147
158
 
148
159
  You can also specify the script through runtime inputs:
149
160
 
@@ -193,11 +204,11 @@ export const sweetLinkClient = createSweetLinkClient({
193
204
 
194
205
  The runtime mirrors everything we ship in production: websocket lifecycle, console buffering, screenshot hooks/renderers, selector discovery, and auto-reconnect with stored-session resume. Tests can import `sweetLinkBrowserTestHelpers` to reuse `createHookRunner`, `stripDataUrlPrefix`, and `commandSelectorSummary` without reaching into private modules.
195
206
 
196
- 👉 See [`apps/sweetlink/browser.md`](./browser.md) for a step-by-step integration guide (handshake endpoint, custom storage adapters, DOM events) plus a reference implementation you can copy into other apps.
207
+ 👉 See [`browser.md`](./browser.md) for a step-by-step integration guide (handshake endpoint, custom storage adapters, DOM events) plus a reference implementation you can copy into other apps.
197
208
 
198
209
  ## Example App
199
210
 
200
- Looking for a minimal integration? Launch the demo web app under `apps/sweetlink/examples/basic-web`:
211
+ Looking for a minimal integration? Launch the demo web app under `examples/basic-web`:
201
212
 
202
213
  ```bash
203
214
  cd examples/basic-web
@@ -228,7 +239,7 @@ pnpm test
228
239
 
229
240
  ## License
230
241
 
231
- SweetLink (CLI, daemon, and shared packages) is licensed under the MIT License. See `apps/sweetlink/LICENSE` for the full text.
242
+ SweetLink (CLI, daemon, and shared packages) is licensed under the MIT License. See `LICENSE` for the full text.
232
243
 
233
244
  ## TLS Onboarding
234
245
 
@@ -1 +1 @@
1
- {"version":3,"file":"codename.d.ts","sourceRoot":"","sources":["../../../daemon/src/codename.ts"],"names":[],"mappings":"AAGA,UAAU,eAAe;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;IACpC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,MAAM,CAAC;CAC1C;AA0BD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CA0BzG"}
1
+ {"version":3,"file":"codename.d.ts","sourceRoot":"","sources":["../../../daemon/src/codename.ts"],"names":[],"mappings":"AAGA,UAAU,eAAe;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;IACpC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,MAAM,CAAC;CAC1C;AA0BD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC1B,OAAO,GAAE,eAAoB,GAC5B,MAAM,CA0BR"}
@@ -1,22 +1,22 @@
1
- import { randomInt } from 'node:crypto';
2
- import { generateSlug } from 'random-word-slugs';
1
+ import { randomInt } from "node:crypto";
2
+ import { generateSlug } from "random-word-slugs";
3
3
  const MAX_ATTEMPTS = 12;
4
4
  const ensureNonEmptyString = (value, label) => {
5
- if (typeof value !== 'string' || value.trim().length === 0) {
5
+ if (typeof value !== "string" || value.trim().length === 0) {
6
6
  throw new TypeError(`${label} must return a non-empty string`);
7
7
  }
8
8
  return value;
9
9
  };
10
10
  const defaultSlugFactory = () => {
11
11
  const slug = generateSlug(2, {
12
- partsOfSpeech: ['adjective', 'noun'],
13
- format: 'kebab',
12
+ partsOfSpeech: ["adjective", "noun"],
13
+ format: "kebab",
14
14
  });
15
- return ensureNonEmptyString(slug, 'slugFactory');
15
+ return ensureNonEmptyString(slug, "slugFactory");
16
16
  };
17
17
  const defaultSaltFactory = () => randomInt(36 ** 2)
18
18
  .toString(36)
19
- .padStart(2, '0');
19
+ .padStart(2, "0");
20
20
  const defaultTimestampFactory = () => Date.now();
21
21
  export function generateSessionCodename(existing, options = {}) {
22
22
  const used = new Set(existing);
@@ -24,18 +24,18 @@ export function generateSessionCodename(existing, options = {}) {
24
24
  const saltFactory = options.saltFactory ?? defaultSaltFactory;
25
25
  const timestampFactory = options.timestampFactory ?? defaultTimestampFactory;
26
26
  for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt += 1) {
27
- const candidate = ensureNonEmptyString(slugFactory(), 'slugFactory');
27
+ const candidate = ensureNonEmptyString(slugFactory(), "slugFactory");
28
28
  if (!used.has(candidate)) {
29
29
  return candidate;
30
30
  }
31
31
  }
32
- const withSalt = `${ensureNonEmptyString(slugFactory(), 'slugFactory')}-${ensureNonEmptyString(saltFactory(), 'saltFactory')}`;
32
+ const withSalt = `${ensureNonEmptyString(slugFactory(), "slugFactory")}-${ensureNonEmptyString(saltFactory(), "saltFactory")}`;
33
33
  if (!used.has(withSalt)) {
34
34
  return withSalt;
35
35
  }
36
36
  const timestamp = timestampFactory();
37
- if (typeof timestamp !== 'number' || Number.isNaN(timestamp)) {
38
- throw new TypeError('timestampFactory must return a numeric timestamp');
37
+ if (typeof timestamp !== "number" || Number.isNaN(timestamp)) {
38
+ throw new TypeError("timestampFactory must return a numeric timestamp");
39
39
  }
40
40
  return `${withSalt}-${Math.abs(timestamp).toString(36).slice(-2)}`;
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"codename.js","sourceRoot":"","sources":["../../../daemon/src/codename.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQjD,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,oBAAoB,GAAG,CAAC,KAAc,EAAE,KAAa,EAAU,EAAE;IACrE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,iCAAiC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,GAAW,EAAE;IACtC,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,EAAE;QAC3B,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC;QACpC,MAAM,EAAE,OAAO;KAChB,CAAC,CAAC;IACH,OAAO,oBAAoB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAC9B,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;KACf,QAAQ,CAAC,EAAE,CAAC;KACZ,QAAQ,CAAC,CA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