@jay-framework/aiditor 0.17.3 → 0.18.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.
Files changed (48) hide show
  1. package/README.md +1 -5
  2. package/dist/actions/check-add-page-route.jay-action +12 -0
  3. package/dist/actions/check-add-page-route.jay-action.d.ts +10 -0
  4. package/dist/actions/check-page-add-page-brief.jay-action +9 -0
  5. package/dist/actions/check-page-add-page-brief.jay-action.d.ts +8 -0
  6. package/dist/actions/check-plugin-update.jay-action +14 -0
  7. package/dist/actions/check-plugin-update.jay-action.d.ts +13 -0
  8. package/dist/actions/ensure-project-plugin.jay-action +9 -0
  9. package/dist/actions/ensure-project-plugin.jay-action.d.ts +8 -0
  10. package/dist/actions/generate-add-page-brief-from-image.jay-action +20 -0
  11. package/dist/actions/generate-add-page-brief-from-image.jay-action.d.ts +20 -0
  12. package/dist/actions/get-plugin-setup-status.jay-action +9 -0
  13. package/dist/actions/get-plugin-setup-status.jay-action.d.ts +6 -0
  14. package/dist/actions/list-jay-plugins.jay-action +8 -0
  15. package/dist/actions/list-jay-plugins.jay-action.d.ts +5 -0
  16. package/dist/actions/list-plugin-contracts.jay-action +11 -0
  17. package/dist/actions/list-plugin-contracts.jay-action.d.ts +9 -0
  18. package/dist/actions/open-add-page-from-brief.jay-action +20 -0
  19. package/dist/actions/open-add-page-from-brief.jay-action.d.ts +18 -0
  20. package/dist/actions/reclassify-add-page-asset.jay-action +12 -0
  21. package/dist/actions/reclassify-add-page-asset.jay-action.d.ts +10 -0
  22. package/dist/actions/rerun-plugin-setup.jay-action +12 -0
  23. package/dist/actions/rerun-plugin-setup.jay-action.d.ts +10 -0
  24. package/dist/actions/save-add-page-draft.jay-action +10 -0
  25. package/dist/actions/save-add-page-draft.jay-action.d.ts +9 -0
  26. package/dist/actions/start-add-page-request.jay-action +12 -0
  27. package/dist/actions/start-add-page-request.jay-action.d.ts +10 -0
  28. package/dist/actions/submit-add-page.jay-action +21 -0
  29. package/dist/actions/submit-add-page.jay-action.d.ts +17 -0
  30. package/dist/actions/submit-task.jay-action +1 -0
  31. package/dist/actions/submit-task.jay-action.d.ts +1 -0
  32. package/dist/actions/sync-add-page-plugin-manifest.jay-action +11 -0
  33. package/dist/actions/sync-add-page-plugin-manifest.jay-action.d.ts +9 -0
  34. package/dist/actions/upload-add-page-asset.jay-action +13 -0
  35. package/dist/actions/upload-add-page-asset.jay-action.d.ts +13 -0
  36. package/dist/actions/write-plugin-source.jay-action +13 -0
  37. package/dist/actions/write-plugin-source.jay-action.d.ts +12 -0
  38. package/dist/add-page-agent/SKILL.md +79 -0
  39. package/dist/add-page-agent/system.md +47 -0
  40. package/dist/index.client.js +2696 -278
  41. package/dist/index.d.ts +797 -6
  42. package/dist/index.js +2682 -14
  43. package/dist/pages/aiditor/page.jay-html +603 -2
  44. package/dist/prompts/add-page-figma-brief-prompt.md +163 -0
  45. package/dist/prompts/add-page-figma-design-definitions-prompt.md +256 -0
  46. package/dist/prompts/add-page-figma-design-from-image-prompt.md +144 -0
  47. package/package.json +24 -7
  48. package/plugin.yaml +34 -0
package/README.md CHANGED
@@ -23,11 +23,7 @@ The plugin auto-registers with the Jay dev server — no additional configuratio
23
23
 
24
24
  ## Requirements
25
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
- ```
26
+ The AI agent runs server-side via the Claude Agent SDK (`query()`). Authentication matches Claude Code set `ANTHROPIC_API_KEY` or run `claude login`.
31
27
 
32
28
  ## Usage
33
29
 
@@ -0,0 +1,12 @@
1
+ name: checkAddPageRouteAction
2
+ description: Validate and normalize an Add Page route; check if it already exists
3
+
4
+ inputSchema:
5
+ pageRoute: string
6
+
7
+ outputSchema:
8
+ normalizedRoute: string
9
+ routeKind: static | dynamic
10
+ routeExists: boolean
11
+ valid: boolean
12
+ error?: string
@@ -0,0 +1,10 @@
1
+ export interface CheckAddPageRouteActionInput {
2
+ pageRoute: string;
3
+ }
4
+
5
+ export interface CheckAddPageRouteActionOutput {
6
+ normalizedRoute: string;
7
+ routeExists: boolean;
8
+ valid: boolean;
9
+ error?: string;
10
+ }
@@ -0,0 +1,9 @@
1
+ name: checkPageAddPageBriefAction
2
+ description: Check whether a Jay page has saved Add Page brief files next to its jay-html
3
+
4
+ inputSchema:
5
+ jayHtmlPath: string
6
+ pageRoute?: string
7
+
8
+ outputSchema:
9
+ hasBrief: boolean
@@ -0,0 +1,8 @@
1
+ export interface CheckPageAddPageBriefActionInput {
2
+ jayHtmlPath: string;
3
+ pageRoute?: string;
4
+ }
5
+
6
+ export interface CheckPageAddPageBriefActionOutput {
7
+ hasBrief: boolean;
8
+ }
@@ -0,0 +1,14 @@
1
+ name: checkPluginUpdateAction
2
+ description: Compare installed plugin version with latest on npm
3
+
4
+ inputSchema:
5
+ pluginName: string
6
+
7
+ outputSchema:
8
+ pluginName: string
9
+ packageName: string
10
+ installedVersion?: string
11
+ latestVersion?: string
12
+ updateAvailable: boolean
13
+ isLocalSource: boolean
14
+ message?: string
@@ -0,0 +1,13 @@
1
+ export interface CheckPluginUpdateActionInput {
2
+ pluginName: string;
3
+ }
4
+
5
+ export interface CheckPluginUpdateActionOutput {
6
+ pluginName: string;
7
+ packageName: string;
8
+ installedVersion?: string;
9
+ latestVersion?: string;
10
+ updateAvailable: boolean;
11
+ isLocalSource: boolean;
12
+ message?: string;
13
+ }
@@ -0,0 +1,9 @@
1
+ name: ensureProjectPluginAction
2
+ description: Install plugin package, run setup and agent-kit (stream)
3
+
4
+ inputSchema:
5
+ pluginName: string
6
+ installSpec?: string
7
+
8
+ outputSchema:
9
+ type: string
@@ -0,0 +1,8 @@
1
+ export interface EnsureProjectPluginActionInput {
2
+ pluginName: string;
3
+ installSpec?: string;
4
+ }
5
+
6
+ export interface EnsureProjectPluginActionOutput {
7
+ type: string;
8
+ }
@@ -0,0 +1,20 @@
1
+ name: generateAddPageBriefFromImageAction
2
+ description: Generate Add Page Content or Design markdown from screenshot(s) via vision AI
3
+
4
+ inputSchema:
5
+ target: content | design
6
+ requestId?: string
7
+ pageRoute?: string
8
+ contextNotes?: string
9
+ extraFiles?: record(file)
10
+
11
+ outputSchema:
12
+ ok: boolean
13
+ markdown?: string
14
+ suggestedRoute?: string
15
+ suggestedRouteKind?: static | dynamic
16
+ referenceAttachments?:
17
+ - id: string
18
+ path: string
19
+ filename: string
20
+ error?: string
@@ -0,0 +1,20 @@
1
+ import { JayFile } from '@jay-framework/fullstack-component';
2
+
3
+ export interface GenerateAddPageBriefFromImageActionInput {
4
+ requestId?: string;
5
+ pageRoute?: string;
6
+ contextNotes?: string;
7
+ extraFiles?: Record<string, JayFile>;
8
+ }
9
+
10
+ export interface GenerateAddPageBriefFromImageActionOutput {
11
+ ok: boolean;
12
+ markdown?: string;
13
+ suggestedRoute?: string;
14
+ referenceAttachments?: Array<{
15
+ id: string;
16
+ path: string;
17
+ filename: string;
18
+ }>;
19
+ error?: string;
20
+ }
@@ -0,0 +1,9 @@
1
+ name: getPluginSetupStatusAction
2
+ description: Query plugin setup status from cache or refresh
3
+
4
+ inputSchema:
5
+ pluginName?: string
6
+ refresh?: boolean
7
+
8
+ outputSchema:
9
+ plugins: array
@@ -0,0 +1,6 @@
1
+ export interface GetPluginSetupStatusActionInput {
2
+ pluginName?: string;
3
+ refresh?: boolean;
4
+ }
5
+
6
+ export type GetPluginSetupStatusActionOutput = Record<string, unknown>;
@@ -0,0 +1,8 @@
1
+ name: listJayPluginsAction
2
+ description: List Jay plugin catalog with install and setup status
3
+
4
+ inputSchema:
5
+ refreshSetupStatus?: boolean
6
+
7
+ outputSchema:
8
+ plugins: array
@@ -0,0 +1,5 @@
1
+ export interface ListJayPluginsActionInput {
2
+ refreshSetupStatus?: boolean;
3
+ }
4
+
5
+ export type ListJayPluginsActionOutput = Record<string, unknown>;
@@ -0,0 +1,11 @@
1
+ name: listPluginContractsAction
2
+ description: List contracts for an installed plugin
3
+
4
+ inputSchema:
5
+ pluginName: string
6
+
7
+ outputSchema:
8
+ pluginName: string
9
+ installed: boolean
10
+ contracts: array
11
+ setupRequiredMessage?: string
@@ -0,0 +1,9 @@
1
+ export interface ListPluginContractsActionInput {
2
+ pluginName: string;
3
+ }
4
+
5
+ export interface ListPluginContractsActionOutput {
6
+ pluginName: string;
7
+ installed: boolean;
8
+ setupRequiredMessage?: string;
9
+ }
@@ -0,0 +1,20 @@
1
+ name: openAddPageFromBriefAction
2
+ description: Load a page's saved Add Page brief into a new page request with a unique copy route
3
+
4
+ inputSchema:
5
+ jayHtmlPath: string
6
+ sourcePageRoute: string
7
+
8
+ outputSchema:
9
+ ok: boolean
10
+ error?: string
11
+ requestId?: string
12
+ pageRoute?: string
13
+ routeKind?: static | dynamic
14
+ contentMd?: string
15
+ designMd?: string
16
+ attachments?:
17
+ - id: string
18
+ path: string
19
+ role: reference | asset
20
+ filename: string
@@ -0,0 +1,18 @@
1
+ export interface OpenAddPageFromBriefActionInput {
2
+ jayHtmlPath: string;
3
+ sourcePageRoute: string;
4
+ }
5
+
6
+ export interface OpenAddPageFromBriefActionOutput {
7
+ ok: boolean;
8
+ error?: string;
9
+ requestId?: string;
10
+ pageRoute?: string;
11
+ contentMd?: string;
12
+ designMd?: string;
13
+ attachments?: Array<{
14
+ id: string;
15
+ path: string;
16
+ filename: string;
17
+ }>;
18
+ }
@@ -0,0 +1,12 @@
1
+ name: reclassifyAddPageAssetAction
2
+ description: Move an attachment between references/ and assets/ for an Add Page request
3
+
4
+ inputSchema:
5
+ requestId: string
6
+ attachmentId: string
7
+ newRole: reference | asset
8
+
9
+ outputSchema:
10
+ ok: boolean
11
+ path: string
12
+ markdownRef?: string
@@ -0,0 +1,10 @@
1
+ export interface ReclassifyAddPageAssetActionInput {
2
+ requestId: string;
3
+ attachmentId: string;
4
+ }
5
+
6
+ export interface ReclassifyAddPageAssetActionOutput {
7
+ ok: boolean;
8
+ path: string;
9
+ markdownRef?: string;
10
+ }
@@ -0,0 +1,12 @@
1
+ name: rerunPluginSetupAction
2
+ description: Re-run jay-stack setup for a plugin
3
+
4
+ inputSchema:
5
+ pluginName: string
6
+ force?: boolean
7
+
8
+ outputSchema:
9
+ pluginName: string
10
+ setupStatus: string
11
+ configCreated?: array
12
+ message?: string
@@ -0,0 +1,10 @@
1
+ export interface RerunPluginSetupActionInput {
2
+ pluginName: string;
3
+ force?: boolean;
4
+ }
5
+
6
+ export interface RerunPluginSetupActionOutput {
7
+ pluginName: string;
8
+ setupStatus: string;
9
+ message?: string;
10
+ }
@@ -0,0 +1,10 @@
1
+ name: saveAddPageDraftAction
2
+ description: Persist Add Page composer markdown to the request folder
3
+
4
+ inputSchema:
5
+ requestId: string
6
+ contentMd: string
7
+ designMd: string
8
+
9
+ outputSchema:
10
+ ok: boolean
@@ -0,0 +1,9 @@
1
+ export interface SaveAddPageDraftActionInput {
2
+ requestId: string;
3
+ contentMd: string;
4
+ designMd: string;
5
+ }
6
+
7
+ export interface SaveAddPageDraftActionOutput {
8
+ ok: boolean;
9
+ }
@@ -0,0 +1,12 @@
1
+ name: startAddPageRequestAction
2
+ description: Mint an Add Page request folder under .aiditor/page-requests/
3
+
4
+ inputSchema:
5
+ pageRoute: string
6
+ routeKind?: static | dynamic
7
+
8
+ outputSchema:
9
+ requestId: string
10
+ requestDir: string
11
+ routeExists: boolean
12
+ routeExistsMessage?: string
@@ -0,0 +1,10 @@
1
+ export interface StartAddPageRequestActionInput {
2
+ pageRoute: string;
3
+ }
4
+
5
+ export interface StartAddPageRequestActionOutput {
6
+ requestId: string;
7
+ requestDir: string;
8
+ routeExists: boolean;
9
+ routeExistsMessage?: string;
10
+ }
@@ -0,0 +1,21 @@
1
+ name: submitAddPageAction
2
+ description: Run the Add Page implementation agent and validate the result (streaming)
3
+
4
+ streaming: true
5
+
6
+ inputSchema:
7
+ requestId: string
8
+ contentMd: string
9
+ designMd: string
10
+ pageRoute: string
11
+ routeKind?: static | dynamic
12
+ isRetry?: boolean
13
+
14
+ outputSchema:
15
+ type: string
16
+ message?: string
17
+ text?: string
18
+ name?: string
19
+ result?: string
20
+ filePath?: string
21
+ validateErrors?: string[]
@@ -0,0 +1,17 @@
1
+ export interface SubmitAddPageActionInput {
2
+ requestId: string;
3
+ contentMd: string;
4
+ designMd: string;
5
+ pageRoute: string;
6
+ isRetry?: boolean;
7
+ }
8
+
9
+ export interface SubmitAddPageActionOutput {
10
+ type: string;
11
+ message?: string;
12
+ text?: string;
13
+ name?: string;
14
+ result?: string;
15
+ filePath?: string;
16
+ validateErrors?: Array<string>;
17
+ }
@@ -4,6 +4,7 @@ streaming: true
4
4
 
5
5
  inputSchema:
6
6
  notes: string
7
+ messageKind?: string
7
8
  pageRoute?: string
8
9
  renderedUrl?: string
9
10
  visualTask?: string
@@ -2,6 +2,7 @@ import { JayFile } from '@jay-framework/fullstack-component';
2
2
 
3
3
  export interface SubmitTaskActionInput {
4
4
  notes: string;
5
+ messageKind?: string;
5
6
  pageRoute?: string;
6
7
  renderedUrl?: string;
7
8
  visualTask?: string;
@@ -0,0 +1,11 @@
1
+ name: syncAddPagePluginManifestAction
2
+ description: Sync selected plugins to content.md managed section and request.json
3
+
4
+ inputSchema:
5
+ requestId: string
6
+ selectedPlugins: array
7
+
8
+ outputSchema:
9
+ ok: boolean
10
+ contentMd: string
11
+ error?: string
@@ -0,0 +1,9 @@
1
+ export interface SyncAddPagePluginManifestActionInput {
2
+ requestId: string;
3
+ }
4
+
5
+ export interface SyncAddPagePluginManifestActionOutput {
6
+ ok: boolean;
7
+ contentMd: string;
8
+ error?: string;
9
+ }
@@ -0,0 +1,13 @@
1
+ name: uploadAddPageAssetAction
2
+ description: Upload a reference or asset file for an Add Page request
3
+
4
+ inputSchema:
5
+ requestId: string
6
+ role: reference | asset
7
+ file: file
8
+
9
+ outputSchema:
10
+ id: string
11
+ path: string
12
+ markdownRef: string
13
+ markdownSnippet?: string
@@ -0,0 +1,13 @@
1
+ import { JayFile } from '@jay-framework/fullstack-component';
2
+
3
+ export interface UploadAddPageAssetActionInput {
4
+ requestId: string;
5
+ file: JayFile;
6
+ }
7
+
8
+ export interface UploadAddPageAssetActionOutput {
9
+ id: string;
10
+ path: string;
11
+ markdownRef: string;
12
+ markdownSnippet?: string;
13
+ }
@@ -0,0 +1,13 @@
1
+ name: writePluginSourceAction
2
+ description: Add or update a local plugin source in .aiditor/plugin-sources.yaml
3
+
4
+ inputSchema:
5
+ pluginName: string
6
+ packageName: string
7
+ installSpec: string
8
+ label?: string
9
+ kind?: string
10
+ description?: string
11
+
12
+ outputSchema:
13
+ ok: boolean
@@ -0,0 +1,12 @@
1
+ export interface WritePluginSourceActionInput {
2
+ pluginName: string;
3
+ packageName: string;
4
+ installSpec: string;
5
+ label?: string;
6
+ kind?: string;
7
+ description?: string;
8
+ }
9
+
10
+ export interface WritePluginSourceActionOutput {
11
+ ok: boolean;
12
+ }
@@ -0,0 +1,79 @@
1
+ # Add Page — implementation steps
2
+
3
+ Follow these steps in order when creating a Jay Stack page from an Add Page brief.
4
+
5
+ ## 1. Read the brief
6
+
7
+ 1. Read `content.md` — behavior, plugins, contracts, copy, interactions.
8
+ 2. Read `design.md` — layout, typography, colors, spacing, responsive behavior.
9
+ 3. List files in `references/` and `assets/` under the request folder.
10
+
11
+ ## 2. Map route → page path
12
+
13
+ Jay uses directory-based routing under `src/pages/`:
14
+
15
+ | Route | Page directory |
16
+ | ------------------------ | ----------------------------------------------- |
17
+ | `/` | `src/pages/page.jay-html` |
18
+ | `/about` | `src/pages/about/page.jay-html` |
19
+ | `/products/[slug]` | `src/pages/products/[slug]/page.jay-html` |
20
+ | `/products/[[category]]` | `src/pages/products/[[category]]/page.jay-html` |
21
+
22
+ Dynamic segment names must match contract `params` (e.g. `slug`, `category`, `prefix`).
23
+
24
+ For static routes that use a dynamic contract, add:
25
+
26
+ ```html
27
+ <script type="application/jay-params">
28
+ slug: my-product-slug
29
+ </script>
30
+ ```
31
+
32
+ ## 3. Discover contracts
33
+
34
+ 1. Read `agent-kit/plugins-index.yaml` for installed plugins and contract paths.
35
+ 2. Read each selected contract's `.jay-contract` file — note `params`, tag types, phases, and refs.
36
+ 3. Consult `agent-kit/designer/routing.md`, `jay-html-syntax.md`, and `contracts-and-plugins.md` as needed.
37
+
38
+ ## 4. Scaffold the page
39
+
40
+ Create `page.jay-html` (and `page.ts` / `page.jay-contract` only if the brief requires custom page logic).
41
+
42
+ Minimum headless import:
43
+
44
+ ```html
45
+ <script
46
+ type="application/jay-headless"
47
+ plugin="@jay-framework/wix-stores"
48
+ contract="product-page"
49
+ key="product"
50
+ ></script>
51
+ ```
52
+
53
+ Use the plugin manifest from the user message for exact `plugin`, `contract`, and `key` values.
54
+
55
+ ## 5. Bind data and interactions
56
+
57
+ - Data: `{contractKey.fieldName}` in text and attributes.
58
+ - Conditionals: `<div if="condition">` — use `===` not `==`.
59
+ - Loops: `<div forEach="items" trackBy="id">`.
60
+ - Interactions: `ref="contractKey.refName"` on the target element.
61
+
62
+ Read contract tags before binding — do not invent field names.
63
+
64
+ ## 6. Apply design
65
+
66
+ - Match `design.md` for layout, colors, typography, and breakpoints.
67
+ - Reuse patterns from existing pages (header, footer, nav) when requested.
68
+ - Use `references/*` for spacing and composition inspiration only.
69
+
70
+ ## 7. Copy assets
71
+
72
+ When `content.md` or `design.md` cites an asset file:
73
+
74
+ 1. Copy from the request folder's `assets/` into the project (`public/` or an appropriate path).
75
+ 2. Reference the copied path in the page (e.g. `src="/images/hero.png"`).
76
+
77
+ ## 8. Finish
78
+
79
+ Summarize files created, how they satisfy the brief, and any blockers. Do not run `jay-stack validate` — the server validates after the agent completes.
@@ -0,0 +1,47 @@
1
+ You are a Jay Stack page author working inside an existing Jay project.
2
+
3
+ Your job is to create **one** page at the route given in the user message. Match the user's intent from their brief files as closely as possible.
4
+
5
+ ## Scope
6
+
7
+ - Create or fix page files for **this route only** — do not refactor unrelated pages.
8
+ - Read `content.md` and `design.md` in the request folder before writing code.
9
+ - Follow `agent-kit/designer/INSTRUCTIONS.md` and `agent-kit/developer/INSTRUCTIONS.md` in the project.
10
+ - Reuse existing site patterns (header, footer, typography, spacing) from other pages when the brief asks for consistency.
11
+
12
+ ## Headless components
13
+
14
+ When the user message includes a plugin manifest table:
15
+
16
+ - Add `<script type="application/jay-headless" plugin="..." contract="..." key="...">` for each entry.
17
+ - Bind UI using contract ViewState fields and refs per agent-kit designer guides.
18
+ - Read the materialized `.jay-contract` files listed in `agent-kit/plugins-index.yaml` before binding.
19
+
20
+ If Wix or other plugin config is incomplete, still implement layout and headless imports. Live store data may be unavailable until config files are filled.
21
+
22
+ ## Attachments
23
+
24
+ - `references/*` — inspiration only; do not copy verbatim unless the brief says so.
25
+ - `assets/*` — copy cited assets from the request folder into appropriate project paths (`public/`, etc.) when implementing.
26
+
27
+ ## Dynamic routes
28
+
29
+ - Map route segments to directory names under `src/pages/` per Jay routing conventions.
30
+ - For static override routes (no dynamic segment), declare params with `<script type="application/jay-params">` (YAML body).
31
+ - Use `jay-params` when a headless contract requires params that are not in the URL path.
32
+
33
+ ## Validation
34
+
35
+ Do **not** run `jay-stack validate` yourself — the server runs validation after you finish.
36
+
37
+ ## Retry mode
38
+
39
+ If the user message says retry mode, read existing page files at the route and **fix** issues rather than recreating from scratch.
40
+
41
+ ## Output
42
+
43
+ When done, summarize:
44
+
45
+ 1. Files created or modified
46
+ 2. How the implementation covers the brief
47
+ 3. Any assumptions or blockers (missing config, ambiguous design, etc.)