instruckt 0.4.29 → 0.4.31
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 +57 -4
- package/dist/instruckt.cjs.js +27 -7
- package/dist/instruckt.cjs.js.map +1 -1
- package/dist/instruckt.esm.js +27 -7
- package/dist/instruckt.esm.js.map +1 -1
- package/dist/instruckt.iife.js +39 -20
- package/dist/instruckt.iife.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ npm install instruckt
|
|
|
22
22
|
| [Next.js](#nextjs) | Client component |
|
|
23
23
|
| [Laravel](#laravel) | Composer package |
|
|
24
24
|
| [Astro](#astro) | Community integration |
|
|
25
|
+
| [Tauri](#tauri) | Rust plugin + MCP server |
|
|
25
26
|
|
|
26
27
|
---
|
|
27
28
|
|
|
@@ -169,6 +170,48 @@ See **[instruckt-astro](https://github.com/sgasser/instruckt-astro)** for a comm
|
|
|
169
170
|
|
|
170
171
|
---
|
|
171
172
|
|
|
173
|
+
### Tauri
|
|
174
|
+
|
|
175
|
+
Use the **[tauri-plugin-instruckt](https://github.com/Naoray/instruckt-rust)** crate — a Tauri v2 plugin that provides a Rust backend with JSON file storage, MCP tools, and IPC commands. Dev-only by default.
|
|
176
|
+
|
|
177
|
+
Add the plugin to your Tauri app:
|
|
178
|
+
|
|
179
|
+
```toml
|
|
180
|
+
# src-tauri/Cargo.toml
|
|
181
|
+
[dependencies]
|
|
182
|
+
tauri-plugin-instruckt = "0.1"
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
```rust
|
|
186
|
+
// src-tauri/src/lib.rs
|
|
187
|
+
fn main() {
|
|
188
|
+
tauri::Builder::default()
|
|
189
|
+
.plugin(tauri_plugin_instruckt::init())
|
|
190
|
+
.run(tauri::generate_context!())
|
|
191
|
+
.expect("error while running tauri application");
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Then add the Vite plugin to your frontend with `server: false` (Tauri owns the backend):
|
|
196
|
+
|
|
197
|
+
```js
|
|
198
|
+
// vite.config.ts
|
|
199
|
+
import instruckt from 'instruckt/vite'
|
|
200
|
+
|
|
201
|
+
export default defineConfig({
|
|
202
|
+
plugins: [
|
|
203
|
+
instruckt({
|
|
204
|
+
server: false,
|
|
205
|
+
mcp: true,
|
|
206
|
+
}),
|
|
207
|
+
],
|
|
208
|
+
})
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
The plugin intercepts fetch requests to the instruckt API and routes them through Tauri IPC. Annotations and screenshots are stored in the OS app data directory. Includes a standalone MCP server binary (`instruckt-mcp`) that AI agents can connect to via stdio.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
172
215
|
## Vite Plugin Options
|
|
173
216
|
|
|
174
217
|
```js
|
|
@@ -219,16 +262,22 @@ instruckt({
|
|
|
219
262
|
### Example Output
|
|
220
263
|
|
|
221
264
|
```markdown
|
|
222
|
-
# UI Feedback: /
|
|
265
|
+
# UI Feedback: /dashboard
|
|
223
266
|
|
|
224
267
|
## 1. Change the submit button color to green
|
|
225
|
-
- Element: `button.btn-primary` in `
|
|
268
|
+
- Element: `button.btn-primary` in `LoginForm`
|
|
269
|
+
- Source: `src/components/LoginForm.tsx:42:5`
|
|
270
|
+
- Component stack:
|
|
271
|
+
- LoginForm `src/components/LoginForm.tsx:42:5`
|
|
272
|
+
- AuthPage `src/pages/AuthPage.tsx:18:3`
|
|
273
|
+
- App `src/App.tsx:8:7`
|
|
226
274
|
- Classes: `btn btn-primary`
|
|
227
275
|
- Text: "Submit Login"
|
|
228
276
|
- Screenshot: `.instruckt/screenshots/01JWXYZ.png`
|
|
229
277
|
|
|
230
278
|
## 2. Make the login card have rounded corners
|
|
231
|
-
- Element: `div.bg-white` in `
|
|
279
|
+
- Element: `div.bg-white` in `LoginCard`
|
|
280
|
+
- Source: `src/components/LoginCard.tsx:15:3`
|
|
232
281
|
- Classes: `bg-white dark:bg-white/10 border`
|
|
233
282
|
```
|
|
234
283
|
|
|
@@ -286,7 +335,7 @@ Default shortcuts (customizable via `keys` config):
|
|
|
286
335
|
|
|
287
336
|
## Features
|
|
288
337
|
|
|
289
|
-
- **Framework detection** — automatically identifies Livewire, Vue, Svelte, and React components
|
|
338
|
+
- **Framework detection** — automatically identifies Livewire, Vue, Svelte, and React components with full component stacks and precise source locations (file:line:column) via [element-source](https://github.com/aidenybai/element-source)
|
|
290
339
|
- **Screenshots** — capture element or region screenshots; uses DOM-to-image on standard apps, automatically falls back to Screen Capture API on shadow DOM frameworks (Flux UI, etc.)
|
|
291
340
|
- **Shadow DOM isolation** — all UI renders in shadow roots so it never conflicts with your styles
|
|
292
341
|
- **Copy as markdown** — annotations auto-copy as structured markdown optimized for AI agents
|
|
@@ -320,6 +369,10 @@ The Vite plugin includes a dev API server that saves annotations and screenshots
|
|
|
320
369
|
|
|
321
370
|
**[instruckt-laravel](https://github.com/joshcirre/instruckt-laravel)** — Laravel package with JSON file storage, MCP tools, Blade component, and API routes. Includes `artisan instruckt:install` which auto-configures the Vite plugin, MCP, and agent skills.
|
|
322
371
|
|
|
372
|
+
### Tauri
|
|
373
|
+
|
|
374
|
+
**[tauri-plugin-instruckt](https://github.com/Naoray/instruckt-rust)** — Tauri v2 plugin with Rust backend, JSON file storage in OS app data directory, IPC commands, and a standalone MCP server binary for AI agent integration.
|
|
375
|
+
|
|
323
376
|
### Custom Backend
|
|
324
377
|
|
|
325
378
|
instruckt expects these endpoints:
|
package/dist/instruckt.cjs.js
CHANGED
|
@@ -173,6 +173,22 @@ var TOOLBAR_CSS = (
|
|
|
173
173
|
}
|
|
174
174
|
.toolbar:active { cursor: grabbing; }
|
|
175
175
|
|
|
176
|
+
.drag-handle {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
width: 100%;
|
|
181
|
+
height: 10px;
|
|
182
|
+
cursor: grab;
|
|
183
|
+
opacity: 0.35;
|
|
184
|
+
transition: opacity 0.15s ease;
|
|
185
|
+
flex-shrink: 0;
|
|
186
|
+
margin-bottom: 2px;
|
|
187
|
+
}
|
|
188
|
+
.drag-handle:hover { opacity: 0.7; }
|
|
189
|
+
.drag-handle:active { cursor: grabbing; opacity: 0.9; }
|
|
190
|
+
.drag-handle svg { pointer-events: none; }
|
|
191
|
+
|
|
176
192
|
.btn {
|
|
177
193
|
display: flex;
|
|
178
194
|
align-items: center;
|
|
@@ -579,6 +595,14 @@ var Toolbar = class {
|
|
|
579
595
|
this.shadow.appendChild(style);
|
|
580
596
|
this.toolbarEl = document.createElement("div");
|
|
581
597
|
this.toolbarEl.className = "toolbar";
|
|
598
|
+
const dragHandle = document.createElement("div");
|
|
599
|
+
dragHandle.className = "drag-handle";
|
|
600
|
+
dragHandle.setAttribute("aria-label", "Drag to reposition toolbar");
|
|
601
|
+
dragHandle.innerHTML = `<svg width="16" height="6" viewBox="0 0 16 6" fill="currentColor">
|
|
602
|
+
<circle cx="4" cy="1.5" r="1.2"/><circle cx="8" cy="1.5" r="1.2"/><circle cx="12" cy="1.5" r="1.2"/>
|
|
603
|
+
<circle cx="4" cy="4.5" r="1.2"/><circle cx="8" cy="4.5" r="1.2"/><circle cx="12" cy="4.5" r="1.2"/>
|
|
604
|
+
</svg>`;
|
|
605
|
+
this.toolbarEl.appendChild(dragHandle);
|
|
582
606
|
const k = this.keys;
|
|
583
607
|
this.annotateBtn = this.makeBtn(ICONS.annotate, `Annotate elements (${((_a2 = k.annotate) != null ? _a2 : "A").toUpperCase()})`, () => {
|
|
584
608
|
const next = !this.annotateActive;
|
|
@@ -4000,7 +4024,8 @@ No open annotations.`;
|
|
|
4000
4024
|
if (a.screenshot) {
|
|
4001
4025
|
if (!a.screenshot.startsWith("data:")) {
|
|
4002
4026
|
const screenshotPath = (_f = this.config.screenshotPath) != null ? _f : "storage/app/_instruckt/";
|
|
4003
|
-
|
|
4027
|
+
const screenshotInstruction = this.config.mcp ? ` \u2014 call \`instruckt.get_screenshot\` with ID \`${a.id}\` to view` : "";
|
|
4028
|
+
lines.push(`- Screenshot: \`${screenshotPath}${a.screenshot}\`${screenshotInstruction}`);
|
|
4004
4029
|
} else {
|
|
4005
4030
|
lines.push(`- Screenshot: `);
|
|
4006
4031
|
}
|
|
@@ -4009,14 +4034,9 @@ No open annotations.`;
|
|
|
4009
4034
|
});
|
|
4010
4035
|
}
|
|
4011
4036
|
if (this.config.mcp) {
|
|
4012
|
-
const hasScreenshots = pending.some((a) => a.screenshot && !a.screenshot.startsWith("data:"));
|
|
4013
4037
|
lines.push("---");
|
|
4014
4038
|
lines.push("");
|
|
4015
|
-
|
|
4016
|
-
lines.push("Use the `instruckt.get_screenshot` MCP tool to view screenshots. After making changes, use `instruckt.resolve` to mark each annotation as resolved.");
|
|
4017
|
-
} else {
|
|
4018
|
-
lines.push("After making changes, use the `instruckt.resolve` MCP tool to mark each annotation as resolved.");
|
|
4019
|
-
}
|
|
4039
|
+
lines.push("After making changes, use the `instruckt.resolve` MCP tool to mark each annotation as resolved.");
|
|
4020
4040
|
}
|
|
4021
4041
|
return lines.join("\n").trim();
|
|
4022
4042
|
}
|