@jay-framework/aiditor 0.16.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/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @jay-framework/aiditor
2
+
3
+ A visual AI-driven code editor plugin for Jay Framework. Annotate live page previews with visual markers, attach short instructions, and let an AI agent edit your source files directly.
4
+
5
+ ## How it works
6
+
7
+ 1. **Preview** — The AIditor loads your project's pages in an iframe
8
+ 2. **Annotate** — Place visual markers (points, areas, arrows) on elements you want changed
9
+ 3. **Instruct** — Type a short instruction per marker (e.g. "make this blue", "add a close button")
10
+ 4. **Run** — The AIditor captures annotated screenshots, sends them to a Claude agent, and streams the agent's file edits back in real-time
11
+
12
+ The agent receives a triple screenshot (annotated, markers-only, clean) for maximum context, and can also process video recordings of interactions.
13
+
14
+ ## Installation
15
+
16
+ Add the plugin to your Jay project:
17
+
18
+ ```bash
19
+ yarn add @jay-framework/aiditor
20
+ ```
21
+
22
+ The plugin auto-registers with the Jay dev server — no additional configuration needed. The `/aiditor` route becomes available when you run `yarn dev`.
23
+
24
+ ## Requirements
25
+
26
+ The AI agent runs server-side via the Claude Agent SDK. Set your API key as an environment variable:
27
+
28
+ ```bash
29
+ export ANTHROPIC_API_KEY=sk-ant-...
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ 1. Start your dev server (`yarn dev`)
35
+ 2. Navigate to `/aiditor`
36
+ 3. Select a page route from the dropdown
37
+ 4. Choose an annotation tool (point, area, or arrow)
38
+ 5. Click on the preview to place a marker
39
+ 6. Type your instruction in the popover (Cmd+Enter to run, Escape to cancel)
40
+ 7. Watch the agent's output in the bottom panel
41
+
42
+ ## Features
43
+
44
+ - **Point, area, and arrow annotations** with per-marker instructions
45
+ - **Video recording mode** — record interactions and pin annotations at specific moments
46
+ - **File attachments** — attach reference images or assets to annotations
47
+ - **Page freeze support** — annotate saved page snapshots
48
+ - **Dynamic route params** — automatically discovers and lists route parameter combinations
49
+ - **Streaming output** — real-time agent output with clickable file paths
50
+ - **Keyboard shortcuts** — Cmd+Enter to run, Escape to cancel annotations
51
+
52
+ ## Plugin structure
53
+
54
+ The plugin provides:
55
+
56
+ - **Route** `/aiditor` — the editor UI
57
+ - **Actions** — server-side actions for bootstrapping, route discovery, param loading, task submission, and file reading
58
+ - **Contract** `aiditor-shell` — an optional editor chrome banner component
@@ -0,0 +1,9 @@
1
+ name: getAiditorBootstrap
2
+ description: One-shot bootstrap returning project directory and dev server base URL
3
+
4
+ inputSchema:
5
+ origin: string
6
+
7
+ outputSchema:
8
+ projectDir: string
9
+ httpBaseUrl: string
@@ -0,0 +1,8 @@
1
+ export interface GetAiditorBootstrapInput {
2
+ origin: string;
3
+ }
4
+
5
+ export interface GetAiditorBootstrapOutput {
6
+ projectDir: string;
7
+ httpBaseUrl: string;
8
+ }
@@ -0,0 +1,9 @@
1
+ name: getPageParamsAction
2
+ description: Stream dynamic route parameter combinations from dev server
3
+ streaming: true
4
+
5
+ inputSchema:
6
+ route: string
7
+
8
+ outputSchema:
9
+ - record(string)
@@ -0,0 +1,5 @@
1
+ export interface GetPageParamsActionInput {
2
+ route: string;
3
+ }
4
+
5
+ export type GetPageParamsActionOutput = Array<Record<string, string>>;
@@ -0,0 +1,12 @@
1
+ name: getProjectInfoAction
2
+ description: List all page routes in the project via dev server
3
+
4
+ inputSchema:
5
+ jayDevUrl: string
6
+
7
+ outputSchema:
8
+ routes:
9
+ - path: string
10
+ jayHtmlPath: string
11
+ compPath: string
12
+ httpBaseUrl: string
@@ -0,0 +1,12 @@
1
+ export interface GetProjectInfoActionInput {
2
+ jayDevUrl: string;
3
+ }
4
+
5
+ export interface GetProjectInfoActionOutput {
6
+ routes: Array<{
7
+ path: string;
8
+ jayHtmlPath: string;
9
+ compPath: string;
10
+ }>;
11
+ httpBaseUrl: string;
12
+ }
@@ -0,0 +1,12 @@
1
+ name: listFreezesAction
2
+ description: List frozen page states for a given route
3
+
4
+ inputSchema:
5
+ route: string
6
+
7
+ outputSchema:
8
+ freezes:
9
+ - id: string
10
+ name?: string
11
+ route: string
12
+ createdAt: string
@@ -0,0 +1,12 @@
1
+ export interface ListFreezesActionInput {
2
+ route: string;
3
+ }
4
+
5
+ export interface ListFreezesActionOutput {
6
+ freezes: Array<{
7
+ id: string;
8
+ name?: string;
9
+ route: string;
10
+ createdAt: string;
11
+ }>;
12
+ }
@@ -0,0 +1,11 @@
1
+ name: readFileAction
2
+ description: Read a file from the project filesystem (text or image as base64)
3
+
4
+ inputSchema:
5
+ filePath: string
6
+
7
+ outputSchema:
8
+ type: string
9
+ data: string
10
+ filePath: string
11
+ mime?: string
@@ -0,0 +1,10 @@
1
+ export interface ReadFileActionInput {
2
+ filePath: string;
3
+ }
4
+
5
+ export interface ReadFileActionOutput {
6
+ type: string;
7
+ data: string;
8
+ filePath: string;
9
+ mime?: string;
10
+ }
@@ -0,0 +1,24 @@
1
+ name: submitTaskAction
2
+ description: Submit a visual annotation task to the AI agent (Agent SDK) with file uploads
3
+ streaming: true
4
+
5
+ inputSchema:
6
+ notes: string
7
+ pageRoute?: string
8
+ renderedUrl?: string
9
+ visualTask?: string
10
+ videoFramesOnly?: string
11
+ screenshot_full?: file
12
+ screenshot_markers_only?: file
13
+ screenshot_clean?: file
14
+ video?: file
15
+ extraFiles?: record(file)
16
+
17
+ outputSchema:
18
+ type: string
19
+ message?: string
20
+ text?: string
21
+ name?: string
22
+ result?: string
23
+ cost?: number
24
+ duration?: number
@@ -0,0 +1,24 @@
1
+ import { JayFile } from '@jay-framework/fullstack-component';
2
+
3
+ export interface SubmitTaskActionInput {
4
+ notes: string;
5
+ pageRoute?: string;
6
+ renderedUrl?: string;
7
+ visualTask?: string;
8
+ videoFramesOnly?: string;
9
+ screenshot_full?: JayFile;
10
+ screenshot_markers_only?: JayFile;
11
+ screenshot_clean?: JayFile;
12
+ video?: JayFile;
13
+ extraFiles?: Record<string, JayFile>;
14
+ }
15
+
16
+ export interface SubmitTaskActionOutput {
17
+ type: string;
18
+ message?: string;
19
+ text?: string;
20
+ name?: string;
21
+ result?: string;
22
+ cost?: number;
23
+ duration?: number;
24
+ }
@@ -0,0 +1,8 @@
1
+ name: AiditorShell
2
+ description: POC shell for AIditor — banner text until full sidebar + iframe UI lands
3
+ tags:
4
+ - tag: headline
5
+ type: data
6
+ dataType: string
7
+ phase: fast
8
+ description: Visible title for the AIditor POC shell
@@ -0,0 +1,18 @@
1
+ import {JayContract} from "@jay-framework/runtime";
2
+
3
+
4
+ export interface AiditorShellViewState {
5
+ headline: string
6
+ }
7
+
8
+ export type AiditorShellSlowViewState = {};
9
+
10
+ export type AiditorShellFastViewState = Pick<AiditorShellViewState, 'headline'>;
11
+
12
+ export type AiditorShellInteractiveViewState = {};
13
+
14
+ export interface AiditorShellRefs {}
15
+
16
+ export interface AiditorShellRepeatedRefs {}
17
+
18
+ export type AiditorShellContract = JayContract<AiditorShellViewState, AiditorShellRefs, AiditorShellSlowViewState, AiditorShellFastViewState, AiditorShellInteractiveViewState>