@datatamer.ai/agentdev 1.0.7 → 1.0.8
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/dist/agentdev.js +7 -10
- package/package.json +1 -1
- package/skills/agentdev-artifact.md +417 -0
package/package.json
CHANGED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
# agentdev artifact — Artifact Management
|
|
2
|
+
|
|
3
|
+
Create and manage artifacts (HTML previews, images, videos, etc.) with semantic search powered by Voyage AI embeddings.
|
|
4
|
+
|
|
5
|
+
## What are Artifacts?
|
|
6
|
+
|
|
7
|
+
Artifacts are interactive files created during the development workflow:
|
|
8
|
+
- **HTML previews** — Interactive mockups, prototypes, dashboards
|
|
9
|
+
- **Images** — Screenshots, diagrams, wireframes
|
|
10
|
+
- **Videos** — Demo recordings, tutorials
|
|
11
|
+
- **JSON/Markdown** — Configuration files, documentation
|
|
12
|
+
|
|
13
|
+
All artifacts are stored with vector embeddings for semantic search and are accessible via secure preview URLs.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Create Artifact
|
|
18
|
+
|
|
19
|
+
Upload a file as an artifact with automatic embedding generation:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Create HTML artifact
|
|
23
|
+
agentdev artifact create \
|
|
24
|
+
--file /path/to/preview.html \
|
|
25
|
+
--title "Homepage Redesign Preview" \
|
|
26
|
+
--desc "Interactive Tailwind CSS prototype" \
|
|
27
|
+
--ticket 123
|
|
28
|
+
|
|
29
|
+
# Create image artifact
|
|
30
|
+
agentdev artifact create \
|
|
31
|
+
--file /tmp/screenshot.png \
|
|
32
|
+
--title "Login Page Screenshot" \
|
|
33
|
+
--ticket 456 \
|
|
34
|
+
--type "image/png"
|
|
35
|
+
|
|
36
|
+
# Create with custom metadata
|
|
37
|
+
agentdev artifact create \
|
|
38
|
+
--file dashboard.html \
|
|
39
|
+
--title "Analytics Dashboard" \
|
|
40
|
+
--metadata '{"framework":"react","responsive":true}'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Output:**
|
|
44
|
+
```
|
|
45
|
+
✅ Artifact created successfully!
|
|
46
|
+
ID: aa891069-14f9-43e8-8ea9-de6438e501c9
|
|
47
|
+
Preview: https://agentdev.datatamer.ai/preview/aa891069-14f9-43e8-8ea9-de6438e501c9
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Important:**
|
|
51
|
+
- Preview URL is automatically posted as a GitHub comment on the associated ticket
|
|
52
|
+
- Embedding is generated asynchronously (takes ~800ms)
|
|
53
|
+
- Max file size: 10MB
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Read Artifact
|
|
58
|
+
|
|
59
|
+
Get artifact details and metadata:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Human-readable output
|
|
63
|
+
agentdev artifact read aa891069-14f9-43e8-8ea9-de6438e501c9
|
|
64
|
+
|
|
65
|
+
# JSON output (for parsing)
|
|
66
|
+
agentdev artifact read aa891069-14f9-43e8-8ea9-de6438e501c9 --json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Output:**
|
|
70
|
+
```
|
|
71
|
+
Artifact Details:
|
|
72
|
+
ID: aa891069-14f9-43e8-8ea9-de6438e501c9
|
|
73
|
+
Title: Homepage Redesign Preview
|
|
74
|
+
Description: Interactive Tailwind CSS prototype
|
|
75
|
+
Type: text/html
|
|
76
|
+
Size: 15360 bytes
|
|
77
|
+
Ticket: 123
|
|
78
|
+
Created: 2026-02-16T10:30:00Z
|
|
79
|
+
Has Embedding: Yes
|
|
80
|
+
Preview: https://agentdev.datatamer.ai/preview/aa891069-...
|
|
81
|
+
Metadata: {"framework":"tailwind","responsive":true}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## List Artifacts
|
|
87
|
+
|
|
88
|
+
List all artifacts or filter by ticket:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# List all artifacts (default limit: 50)
|
|
92
|
+
agentdev artifact list
|
|
93
|
+
|
|
94
|
+
# Filter by ticket
|
|
95
|
+
agentdev artifact list --ticket 123
|
|
96
|
+
|
|
97
|
+
# Limit results
|
|
98
|
+
agentdev artifact list --limit 10
|
|
99
|
+
|
|
100
|
+
# JSON output
|
|
101
|
+
agentdev artifact list --ticket 123 --json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Output:**
|
|
105
|
+
```
|
|
106
|
+
Found 3 artifact(s):
|
|
107
|
+
|
|
108
|
+
1. Homepage Redesign Preview
|
|
109
|
+
ID: aa891069-14...
|
|
110
|
+
Type: text/html
|
|
111
|
+
Size: 15360 bytes
|
|
112
|
+
Created: 2/16/2026, 10:30:00 AM
|
|
113
|
+
|
|
114
|
+
2. Login Page Screenshot
|
|
115
|
+
ID: ef4c103a-1d...
|
|
116
|
+
Type: image/png
|
|
117
|
+
Size: 248576 bytes
|
|
118
|
+
Created: 2/16/2026, 11:15:00 AM
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Search Artifacts (Semantic)
|
|
124
|
+
|
|
125
|
+
Search artifacts by natural language query using vector similarity:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Search by content/description
|
|
129
|
+
agentdev artifact search "landing page designs"
|
|
130
|
+
|
|
131
|
+
# Limit results
|
|
132
|
+
agentdev artifact search "dashboard mockups" --limit 5
|
|
133
|
+
|
|
134
|
+
# Filter by ticket
|
|
135
|
+
agentdev artifact search "homepage" --ticket 123
|
|
136
|
+
|
|
137
|
+
# JSON output
|
|
138
|
+
agentdev artifact search "authentication UI" --json
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Output:**
|
|
142
|
+
```
|
|
143
|
+
Found 2 similar artifact(s):
|
|
144
|
+
|
|
145
|
+
1. Homepage Redesign Preview
|
|
146
|
+
Similarity: 87.3%
|
|
147
|
+
Type: text/html
|
|
148
|
+
ID: aa891069-14...
|
|
149
|
+
Created: 2/16/2026
|
|
150
|
+
|
|
151
|
+
2. Landing Page Wireframe
|
|
152
|
+
Similarity: 75.6%
|
|
153
|
+
Type: image/png
|
|
154
|
+
ID: 962bae25-65...
|
|
155
|
+
Created: 2/15/2026
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**How it works:**
|
|
159
|
+
- Query is converted to a 1024-dimensional embedding via Voyage AI
|
|
160
|
+
- PostgreSQL pgvector performs cosine similarity search
|
|
161
|
+
- Results ranked by similarity percentage
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Update Artifact
|
|
166
|
+
|
|
167
|
+
Update artifact content, title, or metadata:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Update file content
|
|
171
|
+
agentdev artifact update aa891069-14f9-43e8-8ea9-de6438e501c9 \
|
|
172
|
+
--file /path/to/updated.html
|
|
173
|
+
|
|
174
|
+
# Update title and description
|
|
175
|
+
agentdev artifact update aa891069-14f9-43e8-8ea9-de6438e501c9 \
|
|
176
|
+
--title "Homepage v2" \
|
|
177
|
+
--desc "Updated with user feedback"
|
|
178
|
+
|
|
179
|
+
# Update metadata
|
|
180
|
+
agentdev artifact update aa891069-14f9-43e8-8ea9-de6438e501c9 \
|
|
181
|
+
--metadata '{"version":"2.0","responsive":true}'
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Note:** Updating content triggers automatic re-generation of embeddings
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Delete Artifact
|
|
189
|
+
|
|
190
|
+
Permanently delete an artifact:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
agentdev artifact delete aa891069-14f9-43e8-8ea9-de6438e501c9
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Output:**
|
|
197
|
+
```
|
|
198
|
+
✅ Artifact aa891069-14f9-43e8-8ea9-de6438e501c9 deleted successfully
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Important:**
|
|
202
|
+
- Artifacts are automatically deleted when their associated ticket is deleted (CASCADE)
|
|
203
|
+
- Orphaned artifacts (no ticket) are auto-deleted after 30 days
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Preview Artifact
|
|
208
|
+
|
|
209
|
+
Open artifact preview in browser:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
agentdev artifact preview aa891069-14f9-43e8-8ea9-de6438e501c9
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Opens the preview URL in the default browser. Preview URLs are:
|
|
216
|
+
- **Authenticated** — Requires session login
|
|
217
|
+
- **Sandboxed** — HTML rendered in iframe with CSP headers
|
|
218
|
+
- **Secure** — No external script execution
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Workflow Integration
|
|
223
|
+
|
|
224
|
+
### Phase 2.5: OpenSpec Preview (Auto-Ticket Workflow)
|
|
225
|
+
|
|
226
|
+
After generating the OpenSpec in Phase 2, create an artifact for the preview:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Generate HTML preview from OpenSpec
|
|
230
|
+
openspec_html="/tmp/openspec-preview-${TICKET_ID}.html"
|
|
231
|
+
cat > "$openspec_html" <<EOF
|
|
232
|
+
<!DOCTYPE html>
|
|
233
|
+
<html>
|
|
234
|
+
<head>
|
|
235
|
+
<title>${TICKET_TITLE} - OpenSpec Preview</title>
|
|
236
|
+
<style>
|
|
237
|
+
body { font-family: system-ui; max-width: 900px; margin: 40px auto; padding: 20px; }
|
|
238
|
+
.task { background: #f5f5f5; padding: 15px; margin: 10px 0; border-radius: 8px; }
|
|
239
|
+
</style>
|
|
240
|
+
</head>
|
|
241
|
+
<body>
|
|
242
|
+
<h1>${TICKET_TITLE}</h1>
|
|
243
|
+
<div class="task">
|
|
244
|
+
<h3>Task 1: Implement Feature</h3>
|
|
245
|
+
<p>Details...</p>
|
|
246
|
+
</div>
|
|
247
|
+
</body>
|
|
248
|
+
</html>
|
|
249
|
+
EOF
|
|
250
|
+
|
|
251
|
+
# Upload artifact
|
|
252
|
+
ARTIFACT_OUTPUT=$(agentdev artifact create \
|
|
253
|
+
--file "$openspec_html" \
|
|
254
|
+
--title "${TICKET_TITLE} - OpenSpec Preview" \
|
|
255
|
+
--desc "Interactive preview of proposed implementation" \
|
|
256
|
+
--ticket "$TICKET_ID")
|
|
257
|
+
|
|
258
|
+
# Extract artifact ID from output
|
|
259
|
+
ARTIFACT_ID=$(echo "$ARTIFACT_OUTPUT" | grep "ID:" | awk '{print $2}')
|
|
260
|
+
|
|
261
|
+
echo "✅ OpenSpec artifact created: $ARTIFACT_ID"
|
|
262
|
+
# Preview URL automatically posted to GitHub issue
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Supported File Types
|
|
268
|
+
|
|
269
|
+
| Type | MIME Type | Extension | Storage |
|
|
270
|
+
|------|-----------|-----------|---------|
|
|
271
|
+
| HTML | `text/html` | `.html` | TEXT |
|
|
272
|
+
| JSON | `application/json` | `.json` | TEXT |
|
|
273
|
+
| Markdown | `text/markdown` | `.md` | TEXT |
|
|
274
|
+
| Plain Text | `text/plain` | `.txt` | TEXT |
|
|
275
|
+
| PNG Image | `image/png` | `.png` | BYTEA (Base64) |
|
|
276
|
+
| JPEG Image | `image/jpeg` | `.jpg`, `.jpeg` | BYTEA (Base64) |
|
|
277
|
+
| GIF Image | `image/gif` | `.gif` | BYTEA (Base64) |
|
|
278
|
+
| SVG Image | `image/svg+xml` | `.svg` | TEXT |
|
|
279
|
+
| MP4 Video | `video/mp4` | `.mp4` | BYTEA (Base64) |
|
|
280
|
+
| PDF Document | `application/pdf` | `.pdf` | BYTEA (Base64) |
|
|
281
|
+
|
|
282
|
+
**Auto-detection:** MIME type is auto-detected from file extension if `--type` is omitted
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Preview Rendering
|
|
287
|
+
|
|
288
|
+
Different file types are rendered differently in the preview:
|
|
289
|
+
|
|
290
|
+
- **HTML** → Sandboxed iframe with full CSS support
|
|
291
|
+
- **Images** → Full-size display with zoom controls
|
|
292
|
+
- **Videos** → HTML5 video player
|
|
293
|
+
- **JSON** → Syntax-highlighted pretty-print
|
|
294
|
+
- **PDF** → Embedded PDF viewer or download link
|
|
295
|
+
- **Markdown** → Rendered HTML preview
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Security
|
|
300
|
+
|
|
301
|
+
All artifacts follow these security rules:
|
|
302
|
+
|
|
303
|
+
1. **Session Authentication** — Preview URLs require valid session cookie
|
|
304
|
+
2. **Iframe Sandbox** — HTML rendered with `sandbox="allow-scripts allow-same-origin"` (no top navigation)
|
|
305
|
+
3. **CSP Headers** — `Content-Security-Policy: default-src 'self' 'unsafe-inline'`
|
|
306
|
+
4. **No External Resources** — Blocks loading external scripts, images, or fonts
|
|
307
|
+
5. **File Size Limit** — 10MB maximum per artifact
|
|
308
|
+
6. **UUID-based URLs** — Non-guessable preview URLs (e.g., `/preview/aa891069-14f9-43e8-8ea9-de6438e501c9`)
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## API Endpoints (For Reference)
|
|
313
|
+
|
|
314
|
+
The CLI uses these server endpoints:
|
|
315
|
+
|
|
316
|
+
| Endpoint | Method | Description |
|
|
317
|
+
|----------|--------|-------------|
|
|
318
|
+
| `/api/agent/artifact` | POST | Create artifact (requires JWT token) |
|
|
319
|
+
| `/api/artifacts/:id` | GET | Get artifact metadata |
|
|
320
|
+
| `/api/artifacts` | GET | List artifacts (filter by ticket) |
|
|
321
|
+
| `/api/artifacts/:id` | PUT | Update artifact |
|
|
322
|
+
| `/api/artifacts/:id` | DELETE | Delete artifact |
|
|
323
|
+
| `/api/artifacts/search` | POST | Semantic search |
|
|
324
|
+
| `/preview/:id` | GET | Preview artifact (session auth) |
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Examples
|
|
329
|
+
|
|
330
|
+
### Create HTML Dashboard
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
# Save HTML to file
|
|
334
|
+
cat > /tmp/dashboard.html <<'EOF'
|
|
335
|
+
<!DOCTYPE html>
|
|
336
|
+
<html>
|
|
337
|
+
<head>
|
|
338
|
+
<title>Sales Dashboard</title>
|
|
339
|
+
<style>
|
|
340
|
+
body { font-family: Arial; padding: 20px; background: #f0f0f0; }
|
|
341
|
+
.card { background: white; padding: 20px; margin: 10px; border-radius: 8px; }
|
|
342
|
+
.metric { font-size: 48px; color: #2563eb; font-weight: bold; }
|
|
343
|
+
</style>
|
|
344
|
+
</head>
|
|
345
|
+
<body>
|
|
346
|
+
<div class="card">
|
|
347
|
+
<h2>Total Sales</h2>
|
|
348
|
+
<div class="metric">$125,430</div>
|
|
349
|
+
</div>
|
|
350
|
+
</body>
|
|
351
|
+
</html>
|
|
352
|
+
EOF
|
|
353
|
+
|
|
354
|
+
# Create artifact
|
|
355
|
+
agentdev artifact create \
|
|
356
|
+
--file /tmp/dashboard.html \
|
|
357
|
+
--title "Q1 Sales Dashboard" \
|
|
358
|
+
--desc "Real-time sales metrics" \
|
|
359
|
+
--ticket 789 \
|
|
360
|
+
--metadata '{"quarter":"Q1","year":2026}'
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Find Similar Artifacts
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Search for dashboard-related artifacts
|
|
367
|
+
agentdev artifact search "sales dashboard analytics" --limit 10
|
|
368
|
+
|
|
369
|
+
# Filter by specific ticket
|
|
370
|
+
agentdev artifact search "UI mockup" --ticket 123
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Performance
|
|
376
|
+
|
|
377
|
+
| Operation | Time | Notes |
|
|
378
|
+
|-----------|------|-------|
|
|
379
|
+
| Create artifact | ~100ms | Database insert only |
|
|
380
|
+
| Generate embedding | ~800ms | Voyage AI API call (async) |
|
|
381
|
+
| Store embedding | ~50ms | PostgreSQL vector insert |
|
|
382
|
+
| Retrieve artifact | ~30ms | Database query |
|
|
383
|
+
| Semantic search | ~200ms | pgvector cosine similarity |
|
|
384
|
+
| **Total workflow** | **~1.2s** | Create + embed + store + search |
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Notes
|
|
389
|
+
|
|
390
|
+
- **Embeddings are generated asynchronously** — Artifact is created immediately, embedding generated in background
|
|
391
|
+
- **Preview links auto-posted to GitHub** — When ticket_id is provided, preview URL is commented on the issue
|
|
392
|
+
- **Cascade deletion** — Artifacts deleted when parent ticket is deleted
|
|
393
|
+
- **Auto-cleanup** — Orphaned artifacts (no ticket) deleted after 30 days
|
|
394
|
+
- **Voyage AI 3.5 Lite** — Uses 1024-dimensional embeddings optimized for semantic search
|
|
395
|
+
- **pgvector** — PostgreSQL extension for efficient vector similarity search
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
## Troubleshooting
|
|
400
|
+
|
|
401
|
+
**Error: "File too large"**
|
|
402
|
+
- Max file size is 10MB
|
|
403
|
+
- Compress images or split videos before uploading
|
|
404
|
+
|
|
405
|
+
**Error: "VOYAGE_API_KEY not configured"**
|
|
406
|
+
- Contact admin to add API key to server configuration
|
|
407
|
+
- Embeddings cannot be generated without API key
|
|
408
|
+
|
|
409
|
+
**Preview not loading**
|
|
410
|
+
- Ensure you're logged in (session cookie required)
|
|
411
|
+
- Check that artifact ID is correct
|
|
412
|
+
- Verify artifact hasn't been deleted
|
|
413
|
+
|
|
414
|
+
**Search returns no results**
|
|
415
|
+
- Wait ~2 seconds for embedding generation after creation
|
|
416
|
+
- Try broader search terms
|
|
417
|
+
- Check that artifacts have embeddings (`Has Embedding: Yes` in read output)
|