slidev-addon-agent 0.0.1

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 (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +54 -0
  3. package/agent/constants.ts +119 -0
  4. package/agent/deck-context.ts +67 -0
  5. package/agent/index.ts +201 -0
  6. package/agent/middleware.ts +163 -0
  7. package/agent/skills/slidev/README.md +61 -0
  8. package/agent/skills/slidev/SKILL.md +189 -0
  9. package/agent/skills/slidev/references/animation-click-marker.md +37 -0
  10. package/agent/skills/slidev/references/animation-drawing.md +68 -0
  11. package/agent/skills/slidev/references/animation-rough-marker.md +53 -0
  12. package/agent/skills/slidev/references/api-slide-hooks.md +37 -0
  13. package/agent/skills/slidev/references/build-og-image.md +36 -0
  14. package/agent/skills/slidev/references/build-pdf.md +40 -0
  15. package/agent/skills/slidev/references/build-remote-assets.md +34 -0
  16. package/agent/skills/slidev/references/build-seo-meta.md +43 -0
  17. package/agent/skills/slidev/references/code-groups.md +64 -0
  18. package/agent/skills/slidev/references/code-import-snippet.md +55 -0
  19. package/agent/skills/slidev/references/code-line-highlighting.md +50 -0
  20. package/agent/skills/slidev/references/code-line-numbers.md +46 -0
  21. package/agent/skills/slidev/references/code-magic-move.md +57 -0
  22. package/agent/skills/slidev/references/code-max-height.md +37 -0
  23. package/agent/skills/slidev/references/code-twoslash.md +42 -0
  24. package/agent/skills/slidev/references/core-animations.md +196 -0
  25. package/agent/skills/slidev/references/core-cli.md +140 -0
  26. package/agent/skills/slidev/references/core-components.md +197 -0
  27. package/agent/skills/slidev/references/core-exporting.md +148 -0
  28. package/agent/skills/slidev/references/core-frontmatter.md +195 -0
  29. package/agent/skills/slidev/references/core-global-context.md +155 -0
  30. package/agent/skills/slidev/references/core-headmatter.md +188 -0
  31. package/agent/skills/slidev/references/core-hosting.md +152 -0
  32. package/agent/skills/slidev/references/core-layouts.md +286 -0
  33. package/agent/skills/slidev/references/core-syntax.md +155 -0
  34. package/agent/skills/slidev/references/diagram-latex.md +55 -0
  35. package/agent/skills/slidev/references/diagram-mermaid.md +44 -0
  36. package/agent/skills/slidev/references/diagram-plantuml.md +45 -0
  37. package/agent/skills/slidev/references/editor-monaco-run.md +44 -0
  38. package/agent/skills/slidev/references/editor-monaco-write.md +24 -0
  39. package/agent/skills/slidev/references/editor-monaco.md +50 -0
  40. package/agent/skills/slidev/references/editor-prettier.md +40 -0
  41. package/agent/skills/slidev/references/editor-side.md +23 -0
  42. package/agent/skills/slidev/references/editor-vscode.md +55 -0
  43. package/agent/skills/slidev/references/layout-canvas-size.md +25 -0
  44. package/agent/skills/slidev/references/layout-draggable.md +57 -0
  45. package/agent/skills/slidev/references/layout-global-layers.md +50 -0
  46. package/agent/skills/slidev/references/layout-slots.md +75 -0
  47. package/agent/skills/slidev/references/layout-transform.md +33 -0
  48. package/agent/skills/slidev/references/layout-zoom.md +39 -0
  49. package/agent/skills/slidev/references/presenter-notes-ruby.md +35 -0
  50. package/agent/skills/slidev/references/presenter-recording.md +30 -0
  51. package/agent/skills/slidev/references/presenter-remote.md +40 -0
  52. package/agent/skills/slidev/references/presenter-timer.md +34 -0
  53. package/agent/skills/slidev/references/style-direction.md +34 -0
  54. package/agent/skills/slidev/references/style-icons.md +46 -0
  55. package/agent/skills/slidev/references/style-scoped.md +50 -0
  56. package/agent/skills/slidev/references/syntax-block-frontmatter.md +39 -0
  57. package/agent/skills/slidev/references/syntax-frontmatter-merging.md +49 -0
  58. package/agent/skills/slidev/references/syntax-importing-slides.md +60 -0
  59. package/agent/skills/slidev/references/syntax-mdc.md +51 -0
  60. package/agent/skills/slidev/references/tool-eject-theme.md +27 -0
  61. package/agent/tools/export-tool.ts +216 -0
  62. package/agent/tools/review-tool.ts +136 -0
  63. package/app/index.ts +124 -0
  64. package/components/MessageItem.vue +231 -0
  65. package/components/SlidevAgentNavButton.vue +48 -0
  66. package/components/SlidevAgentSidebar.vue +766 -0
  67. package/components/SubagentCard.vue +184 -0
  68. package/components/TypingDots.vue +62 -0
  69. package/dist/agent/constants.js +117 -0
  70. package/dist/agent/deck-context.js +47 -0
  71. package/dist/agent/index.js +167 -0
  72. package/dist/agent/middleware.js +134 -0
  73. package/dist/agent/slide-preview-tool.js +257 -0
  74. package/dist/agent/tools/export-tool.js +167 -0
  75. package/dist/agent/tools/review-tool.js +111 -0
  76. package/dist/app/index.js +101 -0
  77. package/dist/bin/slidev-agent.js +155 -0
  78. package/dist/lib/bridge.js +151 -0
  79. package/dist/lib/env.js +17 -0
  80. package/dist/lib/headless-tools.js +10 -0
  81. package/dist/lib/langgraph-init.js +59 -0
  82. package/dist/lib/review-tool.js +98 -0
  83. package/lib/bridge.ts +212 -0
  84. package/lib/config.ts +79 -0
  85. package/lib/env.ts +38 -0
  86. package/lib/headless-tool-impl.ts +26 -0
  87. package/lib/headless-tools.ts +11 -0
  88. package/lib/langgraph-init.ts +79 -0
  89. package/lib/messages.ts +169 -0
  90. package/lib/render-chat-markdown.ts +19 -0
  91. package/lib/sidebar.ts +573 -0
  92. package/lib/state.ts +44 -0
  93. package/package.json +65 -0
  94. package/public/deepagents.svg +12 -0
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: syntax
3
+ description: Core Markdown syntax for Slidev presentations
4
+ ---
5
+
6
+ # Slidev Markdown Syntax
7
+
8
+ Core Markdown syntax for Slidev presentations.
9
+
10
+ ## Slide Separator
11
+
12
+ Use `---` with blank lines before and after:
13
+
14
+ ```md
15
+ # Slide 1
16
+
17
+ Content
18
+
19
+ ---
20
+
21
+ # Slide 2
22
+
23
+ More content
24
+ ```
25
+
26
+ ## Headmatter (Deck Config)
27
+
28
+ First frontmatter block configures the entire deck:
29
+
30
+ ```md
31
+ ---
32
+ theme: default
33
+ title: My Presentation
34
+ lineNumbers: true
35
+ ---
36
+
37
+ # First Slide
38
+ ```
39
+
40
+ ## Per-Slide Frontmatter
41
+
42
+ Each slide can have its own frontmatter:
43
+
44
+ ```md
45
+ ---
46
+ layout: center
47
+ background: /image.jpg
48
+ class: text-white
49
+ ---
50
+
51
+ # Centered Slide
52
+ ```
53
+
54
+ ## Presenter Notes
55
+
56
+ HTML comments at end of slide become presenter notes:
57
+
58
+ ```md
59
+ # My Slide
60
+
61
+ Content here
62
+
63
+ <!--
64
+ These are presenter notes.
65
+ - Remember to mention X
66
+ - Demo the feature
67
+ -->
68
+ ```
69
+
70
+ ## Code Blocks
71
+
72
+ Standard Markdown with Shiki highlighting:
73
+
74
+ ````md
75
+ ```ts
76
+ const hello = 'world'
77
+ ```
78
+ ````
79
+
80
+ With features:
81
+ ````md
82
+ ```ts {2,3} // Line highlighting
83
+ ```ts {1|2-3|all} // Click-based highlighting
84
+ ```ts {monaco} // Monaco editor
85
+ ```ts {monaco-run} // Runnable code
86
+ ```ts twoslash // TypeScript types
87
+ ```
88
+ ````
89
+
90
+ ## LaTeX Math
91
+
92
+ Inline: `$E = mc^2$`
93
+
94
+ Block:
95
+ ```md
96
+ $$
97
+ \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
98
+ $$
99
+ ```
100
+
101
+ ## Diagrams
102
+
103
+ Mermaid:
104
+ ````md
105
+ ```mermaid
106
+ graph LR
107
+ A --> B --> C
108
+ ```
109
+ ````
110
+
111
+ PlantUML:
112
+ ````md
113
+ ```plantuml
114
+ @startuml
115
+ Alice -> Bob : Hello
116
+ @enduml
117
+ ```
118
+ ````
119
+
120
+ ## Comark Syntax
121
+
122
+ Enable with `comark: true`:
123
+
124
+ ```md
125
+ [styled text]{style="color:red"}
126
+ ![](/image.png){width=500px}
127
+ ::component{prop="value"}
128
+ ```
129
+
130
+ ## Scoped CSS
131
+
132
+ Styles apply only to current slide:
133
+
134
+ ```md
135
+ # Red Title
136
+
137
+ <style>
138
+ h1 { color: red; }
139
+ </style>
140
+ ```
141
+
142
+ ## Import Slides
143
+
144
+ ```md
145
+ ---
146
+ src: ./pages/intro.md
147
+ ---
148
+ ```
149
+
150
+ Import specific slides:
151
+ ```md
152
+ ---
153
+ src: ./other.md#2,5-7
154
+ ---
155
+ ```
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: latex
3
+ description: Render mathematical equations using KaTeX
4
+ ---
5
+
6
+ # LaTeX
7
+
8
+ Render mathematical equations. Powered by KaTeX.
9
+
10
+ ## Inline Math
11
+
12
+ ```md
13
+ $\sqrt{3x-1}+(1+x)^2$
14
+ ```
15
+
16
+ ## Block Math
17
+
18
+ ```md
19
+ $$
20
+ \begin{aligned}
21
+ \nabla \cdot \vec{E} &= \frac{\rho}{\varepsilon_0} \\
22
+ \nabla \cdot \vec{B} &= 0
23
+ \end{aligned}
24
+ $$
25
+ ```
26
+
27
+ ## Line Highlighting
28
+
29
+ ```md
30
+ $$ {1|3|all}
31
+ \begin{aligned}
32
+ \nabla \cdot \vec{E} &= \frac{\rho}{\varepsilon_0} \\
33
+ \nabla \cdot \vec{B} &= 0 \\
34
+ \nabla \times \vec{E} &= -\frac{\partial\vec{B}}{\partial t}
35
+ \end{aligned}
36
+ $$
37
+ ```
38
+
39
+ ## Chemical Equations
40
+
41
+ Enable mhchem extension in `vite.config.ts`:
42
+
43
+ ```ts
44
+ import 'katex/contrib/mhchem'
45
+
46
+ export default {}
47
+ ```
48
+
49
+ Then use:
50
+
51
+ ```md
52
+ $$
53
+ \ce{B(OH)3 + H2O <--> B(OH)4^- + H+}
54
+ $$
55
+ ```
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: mermaid
3
+ description: Create diagrams from text descriptions
4
+ ---
5
+
6
+ # Mermaid Diagrams
7
+
8
+ Create diagrams from text descriptions.
9
+
10
+ ## Basic Usage
11
+
12
+ ````md
13
+ ```mermaid
14
+ sequenceDiagram
15
+ Alice->John: Hello John, how are you?
16
+ Note over Alice,John: A typical interaction
17
+ ```
18
+ ````
19
+
20
+ ## With Options
21
+
22
+ ````md
23
+ ```mermaid {theme: 'neutral', scale: 0.8}
24
+ graph TD
25
+ B[Text] --> C{Decision}
26
+ C -->|One| D[Result 1]
27
+ C -->|Two| E[Result 2]
28
+ ```
29
+ ````
30
+
31
+ ## Diagram Types
32
+
33
+ - `graph` / `flowchart` - Flow diagrams
34
+ - `sequenceDiagram` - Sequence diagrams
35
+ - `classDiagram` - Class diagrams
36
+ - `stateDiagram` - State diagrams
37
+ - `erDiagram` - Entity relationship
38
+ - `gantt` - Gantt charts
39
+ - `pie` - Pie charts
40
+
41
+ ## Resources
42
+
43
+ - Mermaid docs: https://mermaid.js.org/
44
+ - Live editor: https://mermaid.live/
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: plantuml
3
+ description: Create UML diagrams from text descriptions
4
+ ---
5
+
6
+ # PlantUML Diagrams
7
+
8
+ Create UML diagrams from text descriptions.
9
+
10
+ ## Basic Usage
11
+
12
+ ````md
13
+ ```plantuml
14
+ @startuml
15
+ Alice -> Bob : Hello!
16
+ @enduml
17
+ ```
18
+ ````
19
+
20
+ ## Server Configuration
21
+
22
+ Default: Uses https://www.plantuml.com/plantuml
23
+
24
+ Custom server in headmatter:
25
+
26
+ ```md
27
+ ---
28
+ plantUmlServer: https://your-server.com/plantuml
29
+ ---
30
+ ```
31
+
32
+ ## Diagram Types
33
+
34
+ - Sequence diagrams
35
+ - Class diagrams
36
+ - Activity diagrams
37
+ - Component diagrams
38
+ - State diagrams
39
+ - Object diagrams
40
+ - Use case diagrams
41
+
42
+ ## Resources
43
+
44
+ - PlantUML docs: https://plantuml.com/
45
+ - Live editor: https://plantuml.com/plantuml
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: monaco-run
3
+ description: Run code directly in the editor and see results
4
+ ---
5
+
6
+ # Monaco Runner
7
+
8
+ Run code directly in the editor and see results.
9
+
10
+ ## Basic Usage
11
+
12
+ ````md
13
+ ```ts {monaco-run}
14
+ function distance(x: number, y: number) {
15
+ return Math.sqrt(x ** 2 + y ** 2)
16
+ }
17
+ console.log(distance(3, 4))
18
+ ```
19
+ ````
20
+
21
+ Shows a "Run" button and displays output below the code.
22
+
23
+ ## Disable Auto-run
24
+
25
+ ````md
26
+ ```ts {monaco-run} {autorun:false}
27
+ console.log('Click the play button to run me')
28
+ ```
29
+ ````
30
+
31
+ ## Show Output on Click
32
+
33
+ ````md
34
+ ```ts {monaco-run} {showOutputAt:'+1'}
35
+ console.log('Shown after 1 click')
36
+ ```
37
+ ````
38
+
39
+ ## Supported Languages
40
+
41
+ - JavaScript
42
+ - TypeScript
43
+
44
+ For other languages, configure custom code runners in `/custom/config-code-runners`.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: monaco-write
3
+ description: Edit code and save changes back to the file
4
+ ---
5
+
6
+ # Writable Monaco Editor
7
+
8
+ Edit code and save changes back to the file.
9
+
10
+ ## Usage
11
+
12
+ ```md
13
+ <<< ./some-file.ts {monaco-write}
14
+ ```
15
+
16
+ ## Behavior
17
+
18
+ - Links Monaco editor to actual file on filesystem
19
+ - Changes are saved directly to the file
20
+ - Useful for live coding demonstrations
21
+
22
+ ## Warning
23
+
24
+ Back up files before using - changes are saved directly.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: monaco
3
+ description: Turn code blocks into fully-featured editors
4
+ ---
5
+
6
+ # Monaco Editor
7
+
8
+ Turn code blocks into fully-featured editors.
9
+
10
+ ## Basic Usage
11
+
12
+ ````md
13
+ ```ts {monaco}
14
+ console.log('HelloWorld')
15
+ ```
16
+ ````
17
+
18
+ ## Diff Editor
19
+
20
+ Compare two code versions:
21
+
22
+ ````md
23
+ ```ts {monaco-diff}
24
+ console.log('Original text')
25
+ ~~~
26
+ console.log('Modified text')
27
+ ```
28
+ ````
29
+
30
+ ## Editor Height
31
+
32
+ Auto-grow as you type:
33
+
34
+ ````md
35
+ ```ts {monaco} {height:'auto'}
36
+ console.log('Hello, World!')
37
+ ```
38
+ ````
39
+
40
+ Fixed height:
41
+
42
+ ````md
43
+ ```ts {monaco} {height:'300px'}
44
+ // code here
45
+ ```
46
+ ````
47
+
48
+ ## Configuration
49
+
50
+ See `/custom/config-monaco` for Monaco editor customization options.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: prettier-plugin
3
+ description: Format Slidev markdown files correctly
4
+ ---
5
+
6
+ # Prettier Plugin
7
+
8
+ Format Slidev markdown files correctly.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ pnpm i -D prettier prettier-plugin-slidev
14
+ ```
15
+
16
+ ## Configuration
17
+
18
+ Create/modify `.prettierrc`:
19
+
20
+ ```json
21
+ {
22
+ "overrides": [
23
+ {
24
+ "files": ["slides.md", "pages/*.md"],
25
+ "options": {
26
+ "parser": "slidev",
27
+ "plugins": ["prettier-plugin-slidev"]
28
+ }
29
+ }
30
+ ]
31
+ }
32
+ ```
33
+
34
+ ## Why Needed
35
+
36
+ Slidev's syntax (frontmatter, code blocks) may conflict with default Markdown formatting. This plugin understands Slidev-specific syntax.
37
+
38
+ ## Note
39
+
40
+ Must specify files via `overrides` since Slidev and regular Markdown share `.md` extension.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: side-editor
3
+ description: Edit slides source alongside the presentation
4
+ ---
5
+
6
+ # Integrated Editor
7
+
8
+ Edit slides source alongside the presentation.
9
+
10
+ ## Open Editor
11
+
12
+ Click the edit icon in the navigation panel.
13
+
14
+ ## Features
15
+
16
+ - Live reload on changes
17
+ - Auto-save to file
18
+ - Side-by-side editing
19
+ - Syntax highlighting
20
+
21
+ ## Use Case
22
+
23
+ Make quick edits during presentation preparation without switching applications.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: vscode-extension
3
+ description: Manage slides visually in VS Code
4
+ ---
5
+
6
+ # VS Code Extension
7
+
8
+ Manage slides visually in VS Code.
9
+
10
+ ## Installation
11
+
12
+ Install from VS Code Marketplace: `antfu.slidev`
13
+
14
+ ## Features
15
+
16
+ - Preview slides in side panel
17
+ - Slides tree view
18
+ - Drag and drop to reorder slides
19
+ - Folding for slide blocks
20
+ - Multiple project support
21
+ - One-click dev server start
22
+
23
+ ## Usage
24
+
25
+ 1. Click `Slidev` icon in activity bar
26
+ 2. Projects tree shows all Slidev projects in workspace
27
+ 3. Slides tree shows slides in active project
28
+ 4. Preview panel shows live preview
29
+
30
+ ## Commands
31
+
32
+ Type `Slidev` in command palette to see available commands.
33
+
34
+ ## Configuration
35
+
36
+ Include specific files as Slidev entries:
37
+
38
+ ```json
39
+ {
40
+ "slidev.include": ["**/presentation.md"]
41
+ }
42
+ ```
43
+
44
+ Custom dev command:
45
+
46
+ ```json
47
+ {
48
+ "slidev.dev-command": "pnpm slidev ${args}"
49
+ }
50
+ ```
51
+
52
+ ## Placeholders
53
+
54
+ - `${args}` - All CLI arguments
55
+ - `${port}` - Port number
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: canvas-size
3
+ description: Configure slide canvas dimensions and aspect ratio
4
+ ---
5
+
6
+ # Slide Canvas Size
7
+
8
+ Set the canvas dimensions for all slides.
9
+
10
+ ## Configuration
11
+
12
+ ```md
13
+ ---
14
+ aspectRatio: 16/9
15
+ canvasWidth: 980
16
+ ---
17
+ ```
18
+
19
+ - `aspectRatio`: Ratio of width to height (default: `16/9`)
20
+ - `canvasWidth`: Canvas width in pixels (default: `980`)
21
+
22
+ ## Related Features
23
+
24
+ - Scale individual slides: use `zoom` frontmatter option
25
+ - Scale elements: use `<Transform>` component
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: draggable-elements
3
+ description: Move, resize, and rotate elements by dragging during presentation
4
+ ---
5
+
6
+ # Draggable Elements
7
+
8
+ Move, resize, and rotate elements by dragging during presentation.
9
+
10
+ ## Directive Usage
11
+
12
+ ### With Frontmatter Position
13
+
14
+ ```md
15
+ ---
16
+ dragPos:
17
+ square: Left,Top,Width,Height,Rotate
18
+ ---
19
+
20
+ <img v-drag="'square'" src="https://sli.dev/logo.png">
21
+ ```
22
+
23
+ ### Inline Position
24
+
25
+ ```md
26
+ <img v-drag="[Left,Top,Width,Height,Rotate]" src="https://sli.dev/logo.png">
27
+ ```
28
+
29
+ ## Component Usage
30
+
31
+ ```md
32
+ ---
33
+ dragPos:
34
+ foo: Left,Top,Width,Height,Rotate
35
+ ---
36
+
37
+ <v-drag pos="foo" text-3xl>
38
+ Draggable content
39
+ </v-drag>
40
+ ```
41
+
42
+ ## Draggable Arrow
43
+
44
+ ```md
45
+ <v-drag-arrow />
46
+ ```
47
+
48
+ ## Controls
49
+
50
+ - Double-click: Start dragging
51
+ - Arrow keys: Move element
52
+ - Shift + drag: Preserve aspect ratio
53
+ - Click outside: Stop dragging
54
+
55
+ ## Auto Height
56
+
57
+ Set Height to `NaN` or `_` for auto height based on content.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: global-layers
3
+ description: Create components that persist across slides like footers and backgrounds
4
+ ---
5
+
6
+ # Global Layers
7
+
8
+ Create components that persist across slides.
9
+
10
+ ## Layer Files
11
+
12
+ Create in project root:
13
+ - `global-top.vue` - Above all slides (single instance)
14
+ - `global-bottom.vue` - Below all slides (single instance)
15
+ - `slide-top.vue` - Above each slide (per-slide instance)
16
+ - `slide-bottom.vue` - Below each slide (per-slide instance)
17
+ - `custom-nav-controls.vue` - Custom navigation controls
18
+
19
+ ## Z-Order (top to bottom)
20
+
21
+ 1. NavControls / custom-nav-controls.vue
22
+ 2. global-top.vue
23
+ 3. slide-top.vue
24
+ 4. Slide Content
25
+ 5. slide-bottom.vue
26
+ 6. global-bottom.vue
27
+
28
+ ## Example: Footer
29
+
30
+ ```html
31
+ <!-- global-bottom.vue -->
32
+ <template>
33
+ <footer class="absolute bottom-0 left-0 right-0 p-2">Your Name</footer>
34
+ </template>
35
+ ```
36
+
37
+ ## Conditional Rendering
38
+
39
+ ```html
40
+ <!-- Hide on cover layout -->
41
+ <template>
42
+ <footer v-if="$nav.currentLayout !== 'cover'" class="absolute bottom-0 p-2">
43
+ {{ $nav.currentPage }} / {{ $nav.total }}
44
+ </footer>
45
+ </template>
46
+ ```
47
+
48
+ ## Export Note
49
+
50
+ Use `--per-slide` export option when global layers depend on navigation state.