@astrale-os/cli 1.0.0-beta.27 → 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 (108) hide show
  1. package/README.md +59 -3
  2. package/dist/astrale.js +1765 -1057
  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/__tests__/domain-install-operation.test.ts +23 -0
  15. package/src/commands/__tests__/install-identity-override.test.ts +3 -3
  16. package/src/commands/auth/logout.ts +2 -1
  17. package/src/commands/browser.ts +29 -0
  18. package/src/commands/domain/install.ts +19 -11
  19. package/src/commands/get.ts +1 -1
  20. package/src/commands/identity/register.ts +3 -4
  21. package/src/commands/logs.ts +2 -5
  22. package/src/commands/session/analyze.ts +26 -4
  23. package/src/connection/.spec/architecture.md +9 -1
  24. package/src/connection/__tests__/auth.test.ts +1 -0
  25. package/src/connection/__tests__/credential.test.ts +1 -0
  26. package/src/connection/__tests__/exchange.test.ts +34 -10
  27. package/src/connection/__tests__/session.test.ts +5 -1
  28. package/src/connection/__tests__/target.test.ts +1 -0
  29. package/src/connection/exchange.ts +63 -38
  30. package/src/connection/session.ts +8 -1
  31. package/src/identity/__tests__/fixtures/registry-journey.ts +13 -1
  32. package/src/identity/__tests__/registry.test.ts +4 -0
  33. package/src/identity/registry.ts +2 -0
  34. package/src/lib/__tests__/browser-retention.test.ts +212 -0
  35. package/src/lib/__tests__/config.test.ts +27 -0
  36. package/src/lib/__tests__/skills.test.ts +8 -2
  37. package/src/lib/browser-retention.ts +210 -0
  38. package/src/lib/config.ts +12 -1
  39. package/src/program/__tests__/program.test.ts +1 -1
  40. package/src/state/.spec/api.d.ts +21 -2
  41. package/src/state/.spec/architecture.md +18 -4
  42. package/src/state/.spec/layout.ts +1 -0
  43. package/src/state/__tests__/exchange-credentials.test.ts +88 -42
  44. package/src/state/__tests__/files.test.ts +24 -1
  45. package/src/state/__tests__/fixtures/session-route-process.ts +93 -0
  46. package/src/state/__tests__/paths.test.ts +1 -0
  47. package/src/state/__tests__/session-routes.test.ts +138 -0
  48. package/src/state/exchange-credentials.ts +22 -9
  49. package/src/state/files.ts +41 -0
  50. package/src/state/index.ts +3 -1
  51. package/src/state/paths.ts +3 -0
  52. package/src/state/session-routes.ts +34 -0
  53. package/src/telemetry/__tests__/analyze-log.test.ts +38 -0
  54. package/src/telemetry/__tests__/retention.test.ts +267 -0
  55. package/src/telemetry/__tests__/settings.test.ts +102 -0
  56. package/src/telemetry/__tests__/store-scan.test.ts +128 -0
  57. package/src/telemetry/__tests__/trigger.test.ts +33 -4
  58. package/src/telemetry/analyze.ts +24 -2
  59. package/src/telemetry/recorder.ts +6 -3
  60. package/src/telemetry/retention.ts +176 -0
  61. package/src/telemetry/session.ts +18 -12
  62. package/src/telemetry/settings.ts +64 -11
  63. package/src/telemetry/store.ts +92 -9
  64. package/src/telemetry/trigger.ts +16 -28
  65. package/studio/client/dist/assets/index-BFVFs_8x.js +81 -0
  66. package/studio/client/dist/assets/index-DuB9iUdu.css +2 -0
  67. package/studio/client/dist/assets/schema-studio--a0kX3QU.css +1 -0
  68. package/studio/client/dist/assets/schema-studio-DH6oEWME.js +8 -0
  69. package/studio/client/dist/index.html +3 -3
  70. package/studio/package.json +1 -1
  71. package/studio/server/agent/prompts/anchors.test.ts +17 -4
  72. package/studio/server/agent/prompts/anchors.ts +3 -2
  73. package/studio/server/agent/prompts/system.test.ts +2 -3
  74. package/studio/server/agent/prompts/system.ts +3 -3
  75. package/studio/server/agent/run/preparation.ts +1 -1
  76. package/studio/server/api/context.ts +1 -1
  77. package/studio/server/api/deployment.ts +1 -1
  78. package/studio/server/api/views.ts +2 -2
  79. package/studio/server/api/workspace.ts +1 -1
  80. package/studio/server/cache.test.ts +3 -8
  81. package/studio/server/cache.ts +4 -45
  82. package/studio/server/handoff/copy.ts +1 -1
  83. package/studio/server/introspect/canonical-schema.test.ts +154 -128
  84. package/studio/server/introspect/canonical-schema.ts +183 -302
  85. package/studio/server/introspect/core.ts +14 -21
  86. package/studio/server/introspect/extractor.ts +11 -15
  87. package/studio/server/introspect/overlay-tsmorph.test.ts +1 -5
  88. package/studio/server/introspect/overlay-tsmorph.ts +0 -1
  89. package/studio/server/introspect/overlay.ts +3 -24
  90. package/studio/server/introspect/revision.test.ts +24 -28
  91. package/studio/server/introspect/revision.ts +10 -21
  92. package/studio/server/introspect/runtime.test.ts +14 -14
  93. package/studio/server/introspect/runtime.ts +1 -46
  94. package/studio/server/lifecycle.ts +4 -1
  95. package/studio/server/state/documents.test.ts +69 -0
  96. package/studio/server/state/documents.ts +57 -10
  97. package/studio/shared/contracts/schema.ts +10 -26
  98. package/studio/shared/contracts/surface.test.ts +2 -2
  99. package/studio/shared/contracts/workspace.ts +3 -0
  100. package/studio/shared/schema/identity.ts +0 -1
  101. package/viewer/dist/main.js +28 -28
  102. package/studio/client/dist/assets/index-C0FAnwNw.css +0 -2
  103. package/studio/client/dist/assets/index-CpBed0V1.js +0 -81
  104. package/studio/client/dist/assets/schema-studio-BilUNb6Z.css +0 -1
  105. package/studio/client/dist/assets/schema-studio-DJm9guI8.js +0 -8
  106. package/studio/server/introspect/core-extractor.ts +0 -30
  107. package/studio/server/introspect/overlay.test.ts +0 -44
  108. package/studio/server/introspect/source-overlay/annotations.ts +0 -14
package/README.md CHANGED
@@ -87,12 +87,12 @@ Install the browser driver once:
87
87
 
88
88
  ```bash
89
89
  npm install -g agent-browser && agent-browser install
90
- npx skills add astrale-os/cli # installs both the astrale-cli (ops) and astrale-domain (authoring) skills
90
+ npx skills add astrale-os/cli # installs every Astrale skill published by this repository
91
91
  npx skills add vercel-labs/agent-browser
92
92
  ```
93
93
 
94
- To install just one: `npx skills add astrale-os/cli@astrale-cli` or
95
- `npx skills add astrale-os/cli@astrale-domain`.
94
+ To install just one, select `astrale-cli`, `astrale-domain`, `astrale-frontend-design`, or
95
+ `astrale-services`, for example: `npx skills add astrale-os/cli@astrale-frontend-design`.
96
96
 
97
97
  ## Updating
98
98
 
@@ -148,6 +148,62 @@ CLI state lives under `~/.astrale/`:
148
148
  - `identities.json`
149
149
  - keypairs
150
150
  - cached IdP sessions
151
+ - `sessions/` — locally recorded work sessions (see below)
152
+
153
+ ### Session retention
154
+
155
+ Each invocation appends one line to a local session record under
156
+ `~/.astrale/sessions/`; `astrale session list` shows them. The store is swept
157
+ automatically against two bounds — sessions idle past `maxAgeDays` are dropped,
158
+ then the store is trimmed to `maxBytes`, oldest first. Both are optional:
159
+
160
+ ```jsonc
161
+ // ~/.astrale/config.json
162
+ {
163
+ "telemetry": {
164
+ "enabled": true, // false disables recording (the sweep still runs)
165
+ "maxAgeDays": 30, // default
166
+ "maxBytes": 52428800 // default: 50 MB
167
+ }
168
+ }
169
+ ```
170
+
171
+ `ASTRALE_TELEMETRY_MAX_AGE_DAYS` and `ASTRALE_TELEMETRY_MAX_BYTES` override the
172
+ config for one invocation. Values that are not positive numbers are ignored in
173
+ favour of the default, so a typo cannot leave the store unbounded.
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`.
151
207
 
152
208
  ## Development
153
209