@roughapp/feature 0.4.1 → 0.4.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roughapp/feature",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -19,8 +19,7 @@
19
19
  "index.js",
20
20
  "index.d.ts",
21
21
  "style.css",
22
- "README.md",
23
- "CHANGELOG.md"
22
+ "README.md"
24
23
  ],
25
24
  "sideEffects": [
26
25
  "./index.js",
package/CHANGELOG.md DELETED
@@ -1,255 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `@roughapp/feature`.
4
-
5
- The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
- This package is pre-1.0, so a minor version bump can contain breaking changes.
7
-
8
- ## 0.4.1 - 2026-08-26
9
-
10
- Documentation-only release. The README now has expanded setup, security,
11
- lifecycle, theming and API guidance, and the changelog includes the release
12
- notes that were missing from 0.4.0. There are no runtime, type or API changes.
13
-
14
- ## 0.4.0 - 2026-08-26
15
-
16
- The Feature Builder is now conversational: Rough can clarify what to build,
17
- inspect the tools available on the surface and start a build when it has enough
18
- context. The recommended client and surface APIs are unchanged, so host apps do
19
- not need an integration migration.
20
-
21
- ### Added
22
-
23
- - **Feature Builder chat.** Conversations are saved per feature and remain
24
- available when the builder is reopened. Follow-up messages can refine the
25
- feature before Rough starts another build.
26
- - **Markdown responses.** Assistant messages render headings, lists, links,
27
- tables, blockquotes and code blocks.
28
- - **Build cancellation.** Pending and in-progress builds have a Stop control.
29
- Canceled builds remain in the conversation and build log with the time they
30
- ran before stopping.
31
-
32
- ### Changed
33
-
34
- - **Build and publish updates arrive over an authenticated WebSocket when
35
- available**, with Replicache polling retained as a fallback. Updates produced
36
- by workers or another server process now reach an open Feature client without
37
- waiting for the previous five-second polling interval.
38
- - Opening the create flow no longer creates an empty feature immediately. Rough
39
- creates it only after the first message is sent.
40
- - Advanced consumers of the incidental `SpriteBuild` export must handle the new
41
- `CANCELED` status. Build records also include
42
- `cancelRequestedAt: number | null`; update exhaustive status switches and
43
- test fixtures accordingly.
44
-
45
- ## 0.3.0 - 2026-08-10
46
-
47
- **This release has breaking API changes.** Rough now uses an explicit client for
48
- each project instead of global initialization. Apps can safely show features
49
- from multiple Rough projects at the same time, and each client has a clear,
50
- awaitable lifecycle.
51
-
52
- ### Added
53
-
54
- - **`createRoughClient({ projectId, baseUrl?, fetchUserToken })`** creates and
55
- starts a client for one project. Keep the client for as long as your app needs
56
- that project, then call `await client.destroy()`.
57
- - **`whenRoughClientReady({ client })`** lets you wait for startup or handle a
58
- startup error.
59
- - **`openRoughCreate({ target })`** lets you attach the create modal inside the
60
- element that scopes your Rough theme. It defaults to `document.body`.
61
-
62
- ### Changed
63
-
64
- - **All stateful functions and components now take a client.** Pass `client` and
65
- `surface` to `getRoughFeatures()`, `openRoughCreate()`, `<rough-surface>`,
66
- `<rough-feature>`, `<rough-edit-button>` and the modal elements.
67
- - **Cleanup methods are asynchronous and safe to call more than once.** Await
68
- `client.destroy()`, `subscription.unsubscribe()` and `modal.close()` when you
69
- need to know that cleanup has finished.
70
- - **Create one client and share it for each signed-in person and project.** A
71
- second client for the same `baseUrl`, `projectId` and person fails with
72
- `RoughReplicacheIdentityConflictError`. Clients for different projects or
73
- different signed-in people can run together.
74
- - **`openRoughCreate()` no longer requires a mounted Rough component.** You can
75
- open it directly with a client and surface.
76
-
77
- ### Removed
78
-
79
- - **`initRough()` has been removed.** There is no default or global client.
80
- - **`defineSurface()` has been replaced by `defineRoughSurface()`.** Rename
81
- `toolList` to `tools` when updating your surface definitions.
82
- - **`registerSurfaceEntry` has been removed.** You no longer need to register a
83
- surface before using it.
84
-
85
- ### Migrating
86
-
87
- ```ts
88
- // Before
89
- initRough({ projectId, fetchUserToken })
90
- const surface = defineSurface({ key, name, description, toolList })
91
- const unsubscribe = getRoughFeatures(surface, onFeatures)
92
- openRoughCreate(surface, { projectId })
93
-
94
- // After
95
- const client = createRoughClient({ projectId, fetchUserToken })
96
- const surface = defineRoughSurface({ key, name, description, tools })
97
- const subscription = getRoughFeatures({ client, surface, onFeatures })
98
- const modal = await openRoughCreate({ client, surface })
99
-
100
- await modal.close()
101
- await subscription.unsubscribe()
102
- await client.destroy()
103
- ```
104
-
105
- ## 0.2.1 - 2026-08-05
106
-
107
- Add `CHANGELOG.md` to the published package.
108
-
109
- ## 0.2.0 - 2026-08-05
110
-
111
- **Upgrade from 0.1.0 as soon as you can.** Every read and write 0.1.0 performs
112
- goes through gateway REST routes that are being deleted. When that lands, a
113
- 0.1.0 install can no longer list, create, build or publish features. 0.2.0 does
114
- not call any of those routes.
115
-
116
- Upgrading needs no configuration change. `initRough` takes the same
117
- `projectId`, `fetchUserToken` and optional `baseUrl` it always did, and no
118
- export was added or removed. The work is in the type and theme changes below.
119
-
120
- ### Changed
121
-
122
- - **Breaking: sprite, surface and ping traffic now syncs through Replicache
123
- instead of the REST API.** 0.1.0 called ten routes under
124
- `/api/v1/project/{projectId}/` to list sprites, fetch a sprite, list and
125
- create builds, read a build and its logs, publish, register a surface and
126
- ping. 0.2.0 calls none of them. It syncs over
127
- `/api/v1/internal/replicache/pull` and `/api/v1/internal/replicache/push`,
128
- and the session token exchange at `/api/v1/project/{projectId}/session-token`
129
- is the only other request it makes. The ten legacy routes have now been
130
- removed, which is what makes this upgrade time sensitive.
131
-
132
- One consequence worth planning for: the SDK now keeps a sync loop open and
133
- polls for changes every 5 seconds for as long as the page is mounted, where
134
- 0.1.0 issued one request per call and then went quiet.
135
-
136
- - **Breaking: `Sprite` and `SpriteBuild` reference related records by ID
137
- instead of nesting them.**
138
-
139
- ```ts
140
- // 0.1.0
141
- type Sprite = {
142
- id: string
143
- name: string
144
- ownedByPersonId: string
145
- publishedSpriteBuild: SpriteBuild | null // full nested record
146
- }
147
- type SpriteBuild = {
148
- createdByPerson: { id: string; name: string }
149
- // ...
150
- }
151
-
152
- // 0.2.0
153
- type Sprite = {
154
- id: SpriteId
155
- name: string
156
- ownedByPersonId: PersonId
157
- publishedSpriteBuildId: SpriteBuildId | null // ID only
158
- }
159
- type SpriteBuild = {
160
- createdByPersonId: PersonId
161
- // ...
162
- }
163
- ```
164
-
165
- Anything reading `sprite.publishedSpriteBuild.artifactUrl`,
166
- `.status` or `.prompt` off a `getRoughFeatures` result must be reworked, and
167
- `SpriteBuild` no longer carries the build author's display name. There is no
168
- replacement for that name in the public API.
169
-
170
- - **Breaking: ID fields are branded string types.** `SpriteId`,
171
- `SpriteBuildId`, `SurfaceId` and `PersonId` are now `string & { __brand: … }`
172
- rather than `string`, on `RoughFeature`'s `featureId` and `buildId`,
173
- `RoughCreateModal`'s and `SpriteBuildMenu`'s `surfaceId`, `SpriteFrame`'s
174
- `spriteBuildId`, and `registerSurfaceEntry`'s `surfaceId`.
175
-
176
- Reading is unaffected, because a branded string is still assignable to
177
- `string`. Passing one in is not: an ID you hold as a plain `string`, from
178
- your own database or a URL parameter, is rejected. The brand types are not
179
- themselves exported, so reach them through the types that are:
180
-
181
- ```ts
182
- type SpriteId = Sprite['id']
183
- type SpriteBuildId = NonNullable<Sprite['publishedSpriteBuildId']>
184
- type SurfaceId = RoughCreateModalElement['surfaceId']
185
- ```
186
-
187
- IDs that flow straight out of `getRoughFeatures` into a component still
188
- typecheck with no cast.
189
-
190
- - **Breaking: the stylesheet ships a different set of design tokens.** The
191
- Solarized palette was replaced with a ShadCN-style token set, so any host
192
- theming Rough through CSS custom properties needs to remap. These eight are
193
- gone, with their nearest replacement:
194
-
195
- | Removed in 0.2.0 | Closest 0.2.0 token |
196
- | ------------------------- | ---------------------------------------------- |
197
- | `--rough-text` | `--rough-foreground` |
198
- | `--rough-text-secondary` | `--rough-muted-foreground` |
199
- | `--rough-surface` | `--rough-card` |
200
- | `--rough-surface-border` | `--rough-border` |
201
- | `--rough-background-muted` | `--rough-muted` |
202
- | `--rough-danger` | `--rough-destructive` |
203
- | `--rough-shadow` | `--rough-shadow-xs`, `-md`, `-lg` |
204
- | `--rough-accent-secondary` | no equivalent; `--rough-brand` is the saturated brand colour |
205
-
206
- Watch `--rough-accent` in particular. The name survived but the meaning did
207
- not: it was the primary action colour (Solarized blue) and is now the subtle
208
- hover background that ShadCN uses the name for. A host that set it to their
209
- brand colour to tint buttons will find it tinting hover states instead.
210
- `--rough-primary` is the token that now drives primary actions.
211
- `--rough-background` and `--rough-border` also kept their names with new
212
- values. Twenty-eight tokens were added, including a `--rough-radius` scale
213
- and `--rough-success` variants.
214
-
215
- - **`getRoughFeatures` is a live subscription rather than a one-shot fetch.**
216
- In 0.1.0 the callback fired once and only fired again when something called
217
- `triggerRefresh`. It now re-fires on every relevant change that syncs in, so
218
- a feature published in another tab or by another user appears without the
219
- host doing anything.
220
-
221
- - **A feature becomes visible on a published build rather than on a built
222
- artifact.** 0.1.0 listed a sprite only if its published build had an
223
- `artifactUrl`; 0.2.0 lists it as soon as a build is marked published. A
224
- published build with no artifact, which should not normally occur, now
225
- reaches the host and renders an empty frame instead of being filtered out.
226
-
227
- - The bundle is roughly three times larger, because the Replicache client is
228
- compiled into it: `index.js` goes from 105 kB to 320 kB raw, 27 kB to 77 kB
229
- gzipped. The stylesheet grows from 324 B to 5.2 kB with the larger token set.
230
-
231
- - The declared `svelte` dependency range moves from `^5.56.4` to `^5.56.8`.
232
- Every other runtime dependency is unchanged, `capnweb` included, so the
233
- version compatibility required between the two ends of the iframe bridge has
234
- not moved.
235
-
236
- ### Removed
237
-
238
- - **`onpublish` is gone from `RoughCreateModal`, `RoughEditButton` and
239
- `RoughEditModal`.** Because `getRoughFeatures` is now a live subscription, a
240
- publish already reaches the host through that callback, which is what the
241
- prop existed to signal. Move any publish handling into the
242
- `getRoughFeatures` callback. Note that the prop was optional, so depending on
243
- your setup this may fail quietly rather than at compile time.
244
-
245
- - **`triggerRefresh` is gone from the `SurfaceEntry` passed to
246
- `registerSurfaceEntry`.** It was the manual refresh hook for the old
247
- fetch-once model and has nothing to do now. Delete it from the object you
248
- pass in; leaving it there is an excess property and will be rejected.
249
-
250
- ### Added
251
-
252
- - A light and dark mode toggle in the Feature Builder. The stylesheet now
253
- carries a `.rough-dark` class holding the dark values for every token.
254
- - The Feature Builder's build log now reports token usage and estimated cost
255
- per agent step, formatted in cents below one dollar.