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,55 @@
1
+ ---
2
+ name: import-snippet
3
+ description: Import code from external files into slides with optional region selection
4
+ ---
5
+
6
+ # Import Code Snippets
7
+
8
+ Import code from external files into slides.
9
+
10
+ ## Basic Syntax
11
+
12
+ ```md
13
+ <<< @/snippets/snippet.js
14
+ ```
15
+
16
+ `@` = package root directory. Recommended: place snippets in `@/snippets/`.
17
+
18
+ ## Import Region
19
+
20
+ Use VS Code region syntax:
21
+
22
+ ```md
23
+ <<< @/snippets/snippet.js#region-name
24
+ ```
25
+
26
+ ## Specify Language
27
+
28
+ ```md
29
+ <<< @/snippets/snippet.js ts
30
+ ```
31
+
32
+ ## With Features
33
+
34
+ Combine with line highlighting, Monaco editor:
35
+
36
+ ```md
37
+ <<< @/snippets/snippet.js {2,3|5}{lines:true}
38
+ <<< @/snippets/snippet.js ts {monaco}{height:200px}
39
+ ```
40
+
41
+ ## Placeholder
42
+
43
+ Use `{*}` for line highlighting placeholder:
44
+
45
+ ```md
46
+ <<< @/snippets/snippet.js {*}{lines:true}
47
+ ```
48
+
49
+ ## Monaco Write
50
+
51
+ Link editor to file for live editing:
52
+
53
+ ```md
54
+ <<< ./some-file.ts {monaco-write}
55
+ ```
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: line-highlighting
3
+ description: Highlight specific lines in code blocks with static or click-based dynamic highlighting
4
+ ---
5
+
6
+ # Line Highlighting
7
+
8
+ Highlight specific lines in code blocks.
9
+
10
+ ## Static Highlighting
11
+
12
+ ````md
13
+ ```ts {2,3}
14
+ function add(
15
+ a: Ref<number> | number,
16
+ b: Ref<number> | number
17
+ ) {
18
+ return computed(() => unref(a) + unref(b))
19
+ }
20
+ ```
21
+ ````
22
+
23
+ ## Dynamic (Click-based)
24
+
25
+ Use `|` to separate stages:
26
+
27
+ ````md
28
+ ```ts {2-3|5|all}
29
+ function add(
30
+ a: Ref<number> | number,
31
+ b: Ref<number> | number
32
+ ) {
33
+ return computed(() => unref(a) + unref(b))
34
+ }
35
+ ```
36
+ ````
37
+
38
+ Click progression: lines 2-3 → line 5 → all lines
39
+
40
+ ## Special Values
41
+
42
+ - `hide` - Hide the code block
43
+ - `none` - Show code without highlighting
44
+ - `all` - Highlight all lines
45
+
46
+ ````md
47
+ ```ts {hide|none|all}
48
+ // Hidden → No highlight → All highlighted
49
+ ```
50
+ ````
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: line-numbers
3
+ description: Enable line numbering for code blocks globally or per-block
4
+ ---
5
+
6
+ # Code Block Line Numbers
7
+
8
+ Enable line numbering for code blocks.
9
+
10
+ ## Global Setting
11
+
12
+ Enable for all code blocks in headmatter:
13
+
14
+ ```md
15
+ ---
16
+ lineNumbers: true
17
+ ---
18
+ ```
19
+
20
+ ## Per-Block Setting
21
+
22
+ ````md
23
+ ```ts {6,7}{lines:true,startLine:5}
24
+ function add(
25
+ a: Ref<number> | number,
26
+ b: Ref<number> | number
27
+ ) {
28
+ return computed(() => unref(a) + unref(b))
29
+ }
30
+ ```
31
+ ````
32
+
33
+ ## Options
34
+
35
+ - `lines: true/false` - Enable/disable line numbers
36
+ - `startLine: number` - Starting line number (default: 1)
37
+
38
+ ## With Line Highlighting
39
+
40
+ Use `{*}` as placeholder when combining with other features:
41
+
42
+ ````md
43
+ ```ts {*}{lines:true,startLine:5}
44
+ // code here
45
+ ```
46
+ ````
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: magic-move
3
+ description: Animate code changes with smooth transitions between code blocks
4
+ ---
5
+
6
+ # Shiki Magic Move
7
+
8
+ Animate code changes with smooth transitions (like Keynote's Magic Move).
9
+
10
+ ## Basic Usage
11
+
12
+ `````md
13
+ ````md magic-move
14
+ ```js
15
+ console.log(`Step ${1}`)
16
+ ```
17
+ ```js
18
+ console.log(`Step ${1 + 1}`)
19
+ ```
20
+ ```ts
21
+ console.log(`Step ${3}` as string)
22
+ ```
23
+ ````
24
+ `````
25
+
26
+ Note: Use 4 backticks for the wrapper.
27
+
28
+ ## With Line Highlighting
29
+
30
+ `````md
31
+ ````md magic-move {at:4, lines: true}
32
+ ```js {*|1|2-5}
33
+ let count = 1
34
+ function add() {
35
+ count++
36
+ }
37
+ ```
38
+
39
+ Non-code blocks in between are ignored.
40
+
41
+ ```js {*}{lines: false}
42
+ let count = 1
43
+ const add = () => count += 1
44
+ ```
45
+ ````
46
+ `````
47
+
48
+ ## How It Works
49
+
50
+ - Wraps multiple code blocks as one
51
+ - Each block is a "step"
52
+ - Morphs between steps on click
53
+ - Syntax highlighting preserved during animation
54
+
55
+ ## Resources
56
+
57
+ - Playground: https://shiki-magic-move.netlify.app/
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: max-height
3
+ description: Set a fixed height for code blocks with scrolling for long code
4
+ ---
5
+
6
+ # Code Block Max Height
7
+
8
+ Set a fixed height for code blocks with scrolling.
9
+
10
+ ## Usage
11
+
12
+ ````md
13
+ ```ts {2|3|7|12}{maxHeight:'100px'}
14
+ function add(
15
+ a: Ref<number> | number,
16
+ b: Ref<number> | number
17
+ ) {
18
+ return computed(() => unref(a) + unref(b))
19
+ }
20
+ /// ...as many lines as you want
21
+ const c = add(1, 2)
22
+ ```
23
+ ````
24
+
25
+ ## With Line Highlighting Placeholder
26
+
27
+ Use `{*}` when you only need maxHeight:
28
+
29
+ ````md
30
+ ```ts {*}{maxHeight:'100px'}
31
+ // long code here
32
+ ```
33
+ ````
34
+
35
+ ## Use Case
36
+
37
+ When code is too long to fit on one slide but you want to show it all with scrolling.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: twoslash
3
+ description: Show TypeScript type information inline or on hover in code blocks
4
+ ---
5
+
6
+ # TwoSlash Integration
7
+
8
+ Show TypeScript type information inline or on hover.
9
+
10
+ ## Usage
11
+
12
+ ````md
13
+ ```ts twoslash
14
+ import { ref } from 'vue'
15
+
16
+ const count = ref(0)
17
+ // ^?
18
+ ```
19
+ ````
20
+
21
+ ## Features
22
+
23
+ - Type information on hover
24
+ - Inline type annotations with `^?`
25
+ - Errors and warnings display
26
+ - Full TypeScript compiler integration
27
+
28
+ ## Annotations
29
+
30
+ ```ts twoslash
31
+ const count = ref(0)
32
+ // ^?
33
+ // Shows: const count: Ref<number>
34
+ ```
35
+
36
+ ## Use Case
37
+
38
+ Perfect for TypeScript/JavaScript teaching materials where showing types helps understanding.
39
+
40
+ ## Resources
41
+
42
+ - TwoSlash docs: https://twoslash.netlify.app/
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: animations
3
+ description: Click animations, motion effects, and slide transitions
4
+ ---
5
+
6
+ # Animations
7
+
8
+ Click animations, motion effects, and slide transitions.
9
+
10
+ ## Click Animations
11
+
12
+ ### v-click Directive
13
+
14
+ ```md
15
+ <div v-click>Appears on click</div>
16
+ <div v-click>Appears on next click</div>
17
+ ```
18
+
19
+ ### v-clicks Component
20
+
21
+ Animate list items:
22
+
23
+ ```md
24
+ <v-clicks>
25
+
26
+ - Item 1
27
+ - Item 2
28
+ - Item 3
29
+
30
+ </v-clicks>
31
+ ```
32
+
33
+ With depth for nested lists:
34
+
35
+ ```md
36
+ <v-clicks depth="2">
37
+
38
+ - Parent 1
39
+ - Child 1
40
+ - Child 2
41
+ - Parent 2
42
+
43
+ </v-clicks>
44
+ ```
45
+
46
+ ### Click Positioning
47
+
48
+ Relative positioning:
49
+ ```md
50
+ <div v-click>1st (default)</div>
51
+ <div v-click="+1">2nd</div>
52
+ <div v-click="-1">Same as previous</div>
53
+ ```
54
+
55
+ Absolute positioning:
56
+ ```md
57
+ <div v-click="3">Appears on click 3</div>
58
+ <div v-click="[2,5]">Visible clicks 2-5</div>
59
+ ```
60
+
61
+ ### v-after
62
+
63
+ Show with previous element:
64
+
65
+ ```md
66
+ <div v-click>Main element</div>
67
+ <div v-after>Appears with main element</div>
68
+ ```
69
+
70
+ ### v-switch
71
+
72
+ Conditional rendering by click:
73
+
74
+ ```md
75
+ <v-switch>
76
+ <template #1>First state</template>
77
+ <template #2>Second state</template>
78
+ <template #3>Third state</template>
79
+ </v-switch>
80
+ ```
81
+
82
+ ## Custom Click Count
83
+
84
+ ```md
85
+ ---
86
+ clicks: 10
87
+ ---
88
+ ```
89
+
90
+ Or starting from specific count:
91
+
92
+ ```md
93
+ ---
94
+ clicksStart: 5
95
+ ---
96
+ ```
97
+
98
+ ## Motion Animations
99
+
100
+ Using @vueuse/motion:
101
+
102
+ ```md
103
+ <div
104
+ v-motion
105
+ :initial="{ x: -100, opacity: 0 }"
106
+ :enter="{ x: 0, opacity: 1 }"
107
+ >
108
+ Animated content
109
+ </div>
110
+ ```
111
+
112
+ Click-based motion:
113
+
114
+ ```md
115
+ <div
116
+ v-motion
117
+ :initial="{ scale: 1 }"
118
+ :click-1="{ scale: 1.5 }"
119
+ :click-2="{ scale: 1 }"
120
+ >
121
+ Scales on clicks
122
+ </div>
123
+ ```
124
+
125
+ ## Slide Transitions
126
+
127
+ In headmatter (all slides):
128
+
129
+ ```md
130
+ ---
131
+ transition: slide-left
132
+ ---
133
+ ```
134
+
135
+ Per-slide:
136
+
137
+ ```md
138
+ ---
139
+ transition: fade
140
+ ---
141
+ ```
142
+
143
+ ### Built-in Transitions
144
+
145
+ - `fade` / `fade-out`
146
+ - `slide-left` / `slide-right`
147
+ - `slide-up` / `slide-down`
148
+ - `view-transition` (View Transitions API)
149
+
150
+ ### Directional Transitions
151
+
152
+ Different transitions for forward/backward:
153
+
154
+ ```md
155
+ ---
156
+ transition: slide-left | slide-right
157
+ ---
158
+ ```
159
+
160
+ ### Custom Transitions
161
+
162
+ Define CSS classes:
163
+
164
+ ```css
165
+ .my-transition-enter-active,
166
+ .my-transition-leave-active {
167
+ transition: all 0.5s ease;
168
+ }
169
+ .my-transition-enter-from,
170
+ .my-transition-leave-to {
171
+ opacity: 0;
172
+ transform: translateX(100px);
173
+ }
174
+ ```
175
+
176
+ Use: `transition: my-transition`
177
+
178
+ ## CSS Classes
179
+
180
+ Animation targets get these classes:
181
+ - `.slidev-vclick-target` - Animated element
182
+ - `.slidev-vclick-hidden` - Hidden state
183
+ - `.slidev-vclick-current` - Current click target
184
+ - `.slidev-vclick-prior` - Previously shown
185
+
186
+ ## Default Animation CSS
187
+
188
+ ```css
189
+ .slidev-vclick-target {
190
+ transition: opacity 100ms ease;
191
+ }
192
+ .slidev-vclick-hidden {
193
+ opacity: 0;
194
+ pointer-events: none;
195
+ }
196
+ ```
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: cli
3
+ description: Slidev command-line interface reference
4
+ ---
5
+
6
+ # CLI Commands
7
+
8
+ Slidev command-line interface reference.
9
+
10
+ ## Dev Server
11
+
12
+ ```bash
13
+ slidev [entry]
14
+ slidev slides.md
15
+ ```
16
+
17
+ Options:
18
+ | Option | Default | Description |
19
+ |--------|---------|-------------|
20
+ | `--port` | 3030 | Server port |
21
+ | `--open` | false | Open browser |
22
+ | `--remote [password]` | - | Enable remote access |
23
+ | `--bind` | 0.0.0.0 | Bind address |
24
+ | `--base` | / | Base URL path |
25
+ | `--log` | warn | Log level |
26
+ | `--force` | false | Force optimizer re-bundle |
27
+ | `--theme` | - | Override theme |
28
+
29
+ Examples:
30
+ ```bash
31
+ slidev --port 8080 --open
32
+ slidev --remote mypassword
33
+ slidev --base /talks/my-talk/
34
+ ```
35
+
36
+ ## Build
37
+
38
+ ```bash
39
+ slidev build [entry]
40
+ ```
41
+
42
+ Options:
43
+ | Option | Default | Description |
44
+ |--------|---------|-------------|
45
+ | `--out` | dist | Output directory |
46
+ | `--base` | / | Base URL for deployment |
47
+ | `--download` | false | Include PDF download |
48
+ | `--theme` | - | Override theme |
49
+ | `--without-notes` | false | Exclude presenter notes |
50
+
51
+ Examples:
52
+ ```bash
53
+ slidev build --base /my-repo/
54
+ slidev build --download --out public
55
+ slidev build slides1.md slides2.md # Multiple builds
56
+ ```
57
+
58
+ ## Export
59
+
60
+ ```bash
61
+ slidev export [entry]
62
+ ```
63
+
64
+ Options:
65
+ | Option | Default | Description |
66
+ |--------|---------|-------------|
67
+ | `--output` | - | Output filename |
68
+ | `--format` | pdf | pdf / png / pptx / md |
69
+ | `--timeout` | 30000 | Timeout per slide (ms) |
70
+ | `--range` | - | Slide range (e.g., 1,4-7) |
71
+ | `--dark` | false | Export dark mode |
72
+ | `--with-clicks` | false | Include click steps |
73
+ | `--with-toc` | false | PDF table of contents |
74
+ | `--wait` | 0 | Wait ms before export |
75
+ | `--wait-until` | networkidle | Wait condition |
76
+ | `--omit-background` | false | Transparent background |
77
+ | `--executable-path` | - | Browser path |
78
+
79
+ Examples:
80
+ ```bash
81
+ slidev export
82
+ slidev export --format pptx
83
+ slidev export --format png --range 1-5
84
+ slidev export --with-clicks --dark
85
+ slidev export --timeout 60000 --wait 2000
86
+ ```
87
+
88
+ ## Format
89
+
90
+ ```bash
91
+ slidev format [entry]
92
+ ```
93
+
94
+ Formats the slides markdown file.
95
+
96
+ ## Theme Eject
97
+
98
+ ```bash
99
+ slidev theme eject [entry]
100
+ ```
101
+
102
+ Options:
103
+ | Option | Default | Description |
104
+ |--------|---------|-------------|
105
+ | `--dir` | theme | Output directory |
106
+ | `--theme` | - | Theme to eject |
107
+
108
+ Extracts theme to local directory for customization.
109
+
110
+ ## npm Script Usage
111
+
112
+ In package.json:
113
+ ```json
114
+ {
115
+ "scripts": {
116
+ "dev": "slidev",
117
+ "build": "slidev build",
118
+ "export": "slidev export"
119
+ }
120
+ }
121
+ ```
122
+
123
+ With arguments (note `--`):
124
+ ```bash
125
+ npm run dev -- --port 8080 --open
126
+ npm run export -- --format pptx
127
+ ```
128
+
129
+ ## Boolean Options
130
+
131
+ ```bash
132
+ slidev --open # Same as --open true
133
+ slidev --no-open # Same as --open false
134
+ ```
135
+
136
+ ## Install CLI Globally
137
+
138
+ ```bash
139
+ npm i -g @slidev/cli
140
+ ```