instruckt 0.1.0 → 0.4.0

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 ADDED
@@ -0,0 +1,111 @@
1
+ # instruckt
2
+
3
+ Visual feedback tool for AI coding agents. Click on any element in your app, leave an annotation, and your AI agent picks it up via MCP — no screenshots, no copy-pasting.
4
+
5
+ Framework-agnostic JS core with adapters for Livewire, Vue, Svelte, and React.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install instruckt
11
+ ```
12
+
13
+ Or load via CDN:
14
+
15
+ ```html
16
+ <script src="https://cdn.jsdelivr.net/npm/instruckt@0.1.0/dist/instruckt.iife.js"></script>
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```js
22
+ import { Instruckt } from 'instruckt'
23
+
24
+ const instruckt = new Instruckt({
25
+ endpoint: '/instruckt',
26
+ })
27
+ ```
28
+
29
+ Or with the IIFE build:
30
+
31
+ ```html
32
+ <script src="/path/to/instruckt.iife.js"></script>
33
+ <script>
34
+ Instruckt.init({ endpoint: '/instruckt' })
35
+ </script>
36
+ ```
37
+
38
+ ## How It Works
39
+
40
+ 1. A floating toolbar appears in your app
41
+ 2. Press **A** or click the annotate button to enter annotation mode
42
+ 3. Hover over any element — instruckt highlights it and detects its framework component
43
+ 4. Click to annotate — choose an intent (fix, change, question, approve) and severity
44
+ 5. Your AI agent reads annotations via MCP tools and can reply, acknowledge, or resolve them
45
+ 6. Real-time sync via SSE keeps both sides in sync
46
+
47
+ ## Configuration
48
+
49
+ ```js
50
+ new Instruckt({
51
+ // Required — URL to your instruckt API (provided by the Laravel package or your own backend)
52
+ endpoint: '/instruckt',
53
+
54
+ // Framework adapters to activate (default: all)
55
+ adapters: ['livewire', 'vue', 'svelte', 'react'],
56
+
57
+ // Theme: 'light' | 'dark' | 'auto' (default: 'auto')
58
+ theme: 'auto',
59
+
60
+ // Toolbar position (default: 'bottom-right')
61
+ position: 'bottom-right',
62
+
63
+ // Callbacks
64
+ onAnnotationAdd: (annotation) => {},
65
+ onAnnotationResolve: (annotation) => {},
66
+ onSessionCreate: (session) => {},
67
+ })
68
+ ```
69
+
70
+ ## Keyboard Shortcuts
71
+
72
+ | Key | Action |
73
+ |-----|--------|
74
+ | `A` | Toggle annotation mode |
75
+ | `F` | Freeze animations |
76
+ | `Esc` | Exit annotation mode |
77
+
78
+ ## Features
79
+
80
+ - **Framework detection** — automatically identifies Livewire, Vue, Svelte, and React components, including component names and state
81
+ - **Shadow DOM isolation** — all UI renders in shadow roots so it never conflicts with your styles
82
+ - **Annotation threads** — back-and-forth conversation between you and your AI agent on each annotation
83
+ - **Copy as markdown** — export all open annotations to clipboard for pasting into any context
84
+ - **MutationObserver** — markers reposition automatically when the DOM changes (Livewire re-renders, SPA navigation)
85
+ - **SSE real-time sync** — agent replies and status changes appear instantly
86
+
87
+ ## Public API
88
+
89
+ ```js
90
+ // Get all annotations
91
+ instruckt.getAnnotations()
92
+
93
+ // Get current session
94
+ instruckt.getSession()
95
+
96
+ // Export open annotations as markdown
97
+ instruckt.exportMarkdown()
98
+
99
+ // Clean up
100
+ instruckt.destroy()
101
+ ```
102
+
103
+ ## Backend
104
+
105
+ instruckt needs a backend to persist annotations and expose MCP tools. The official Laravel package provides this out of the box:
106
+
107
+ - **[instruckt-laravel](https://github.com/joshcirre/instruckt-laravel)** — Laravel package with MCP server, migrations, Blade component, and API routes
108
+
109
+ ## License
110
+
111
+ MIT