@astrale-os/cli 1.0.0-beta.28 → 1.0.0-beta.29

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 (50) hide show
  1. package/README.md +33 -0
  2. package/dist/astrale.js +1629 -1088
  3. package/dist/public/connect-core.js +86 -17
  4. package/dist/public/keys/index.js +69 -2
  5. package/dist/public/paths/index.js +67 -0
  6. package/dist/types/connection/session.d.ts +2 -2
  7. package/dist/types/lib/config.d.ts +6 -0
  8. package/dist/types/state/exchange-credentials.d.ts +6 -2
  9. package/dist/types/state/files.d.ts +2 -0
  10. package/dist/types/state/index.d.ts +3 -2
  11. package/dist/types/state/paths.d.ts +2 -0
  12. package/dist/types/state/session-routes.d.ts +10 -0
  13. package/package.json +2 -2
  14. package/src/commands/auth/logout.ts +2 -1
  15. package/src/commands/browser.ts +29 -0
  16. package/src/connection/.spec/architecture.md +9 -1
  17. package/src/connection/__tests__/auth.test.ts +1 -0
  18. package/src/connection/__tests__/credential.test.ts +1 -0
  19. package/src/connection/__tests__/exchange.test.ts +34 -10
  20. package/src/connection/__tests__/session.test.ts +5 -1
  21. package/src/connection/__tests__/target.test.ts +1 -0
  22. package/src/connection/exchange.ts +63 -38
  23. package/src/connection/session.ts +8 -1
  24. package/src/identity/__tests__/fixtures/registry-journey.ts +13 -1
  25. package/src/identity/__tests__/registry.test.ts +4 -0
  26. package/src/identity/registry.ts +2 -0
  27. package/src/lib/__tests__/browser-retention.test.ts +212 -0
  28. package/src/lib/__tests__/config.test.ts +27 -0
  29. package/src/lib/browser-retention.ts +210 -0
  30. package/src/lib/config.ts +12 -1
  31. package/src/state/.spec/api.d.ts +21 -2
  32. package/src/state/.spec/architecture.md +18 -4
  33. package/src/state/.spec/layout.ts +1 -0
  34. package/src/state/__tests__/exchange-credentials.test.ts +88 -42
  35. package/src/state/__tests__/files.test.ts +24 -1
  36. package/src/state/__tests__/fixtures/session-route-process.ts +93 -0
  37. package/src/state/__tests__/paths.test.ts +1 -0
  38. package/src/state/__tests__/session-routes.test.ts +138 -0
  39. package/src/state/exchange-credentials.ts +22 -9
  40. package/src/state/files.ts +41 -0
  41. package/src/state/index.ts +3 -1
  42. package/src/state/paths.ts +3 -0
  43. package/src/state/session-routes.ts +34 -0
  44. package/src/telemetry/__tests__/analyze-log.test.ts +38 -0
  45. package/src/telemetry/__tests__/retention.test.ts +88 -1
  46. package/src/telemetry/analyze.ts +24 -2
  47. package/src/telemetry/retention.ts +53 -6
  48. package/src/telemetry/store.ts +5 -0
  49. package/studio/package.json +1 -1
  50. package/viewer/dist/main.js +28 -28
package/README.md CHANGED
@@ -172,6 +172,39 @@ then the store is trimmed to `maxBytes`, oldest first. Both are optional:
172
172
  config for one invocation. Values that are not positive numbers are ignored in
173
173
  favour of the default, so a typo cannot leave the store unbounded.
174
174
 
175
+ Once a session has been analyzed it is reduced to its durable artifacts —
176
+ `meta.json`, `events.jsonl`, `report.md`, the marker and a clamped
177
+ `analyzer.log`. The analyzer runs an agent with write access to the session
178
+ directory, so anything else it leaves there is scratch and is removed. The
179
+ prompt is kept only when the analysis failed, which is the one case where what
180
+ the analyzer was asked still matters.
181
+
182
+ ### Browser-profile retention
183
+
184
+ `astrale browser` keeps one persistent Chromium profile per host under
185
+ `~/.astrale/browser/`, so the sign-in cookie survives between runs. That cookie
186
+ is a few kilobytes; the cache Chromium piles up around it is not, and Chromium
187
+ does not bound it (`--disk-cache-size` is ignored for a profile's HTTP cache).
188
+
189
+ Every `astrale browser` therefore sweeps the profiles first: one untouched for
190
+ longer than `maxProfileAgeDays` is removed outright — its cookie has expired
191
+ anyway — and one whose cache exceeds `maxCacheBytes` has its cache directories
192
+ emptied. Cookies, Local Storage, Preferences and Local State are never touched,
193
+ so you stay signed in. A profile held by a running browser is skipped.
194
+
195
+ ```jsonc
196
+ // ~/.astrale/config.json
197
+ {
198
+ "browser": {
199
+ "maxCacheBytes": 52428800, // default: 50 MB, per profile, cache only
200
+ "maxProfileAgeDays": 30 // default
201
+ }
202
+ }
203
+ ```
204
+
205
+ Overridable per invocation with `ASTRALE_BROWSER_MAX_CACHE_BYTES` and
206
+ `ASTRALE_BROWSER_MAX_PROFILE_AGE_DAYS`.
207
+
175
208
  ## Development
176
209
 
177
210
  Contributors use Node.js 26.7.0 by default; Node.js 24 is also supported. pnpm is