instruckt 0.4.30 → 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 +47 -0
- 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
|
|
@@ -326,6 +369,10 @@ The Vite plugin includes a dev API server that saves annotations and screenshots
|
|
|
326
369
|
|
|
327
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.
|
|
328
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
|
+
|
|
329
376
|
### Custom Backend
|
|
330
377
|
|
|
331
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
|
}
|