@loupekit/sdk 0.10.15-next.60 → 0.10.16-next.61
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/README.md +42 -0
- package/dist/index.global.js +616 -11
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +616 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -176,6 +176,48 @@ the proposal. Approving resolves the thread and is logged in the Activity feed.
|
|
|
176
176
|
The rule that shape enforces: **only a human resolves a thread.** An agent moves work to In Review;
|
|
177
177
|
a person closes it from there.
|
|
178
178
|
|
|
179
|
+
### Generating and iterating on a change
|
|
180
|
+
|
|
181
|
+
Pass a `generate` function and a thread's detail gains a Generate pane — preview,
|
|
182
|
+
opacity comparison, undo, iteration history and a refine input. The panel owns all of
|
|
183
|
+
that; producing the markup is yours, so any model works:
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
init({
|
|
187
|
+
projectKey: "pk_live_…",
|
|
188
|
+
user: { id: "u_1", name: "Ada" },
|
|
189
|
+
generate: async ({ comment, prompt, kind, previous, localAi }) => {
|
|
190
|
+
// previous carries the iteration being refined; localAi is whatever the user
|
|
191
|
+
// configured in the panel (see below).
|
|
192
|
+
const { html, css, notes } = await myModel({ comment, prompt, kind, previous, localAi });
|
|
193
|
+
return { html, css, notes };
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The preview renders in a **sandboxed** iframe, so generated markup can never reach your
|
|
199
|
+
page. A local-AI endpoint and model (any OpenAI-compatible server — Ollama, llama.cpp…)
|
|
200
|
+
are configurable in the project manager, with a real connection check. Without a
|
|
201
|
+
`generate` function the pane offers *Request access to generate* and hands it to
|
|
202
|
+
`init({ onRequestAccess })`.
|
|
203
|
+
|
|
204
|
+
### Agent navigation needs consent
|
|
205
|
+
|
|
206
|
+
An agent that can move the browser is useful and dangerous in equal measure, so
|
|
207
|
+
navigation is a request a human answers:
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
import { requestNavigation } from "@loupekit/sdk";
|
|
211
|
+
|
|
212
|
+
requestNavigation("https://preview.acme.test/pr/412", {
|
|
213
|
+
reason: "The fix is live on the preview URL.",
|
|
214
|
+
requester: "Claude Code",
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
The panel shows who wants to go where and why. **Nothing navigates without an explicit
|
|
219
|
+
grant** — only `http(s)` is even offerable, and every decision is kept as an audit trail.
|
|
220
|
+
|
|
179
221
|
### Offline mode (no backend)
|
|
180
222
|
|
|
181
223
|
Omit `apiBase` and comments persist to `localStorage` — great for demos and local dev:
|