@nickduy/agent-studio 0.0.0-stage → 0.1.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 (29) hide show
  1. package/README.md +27 -2
  2. package/bin/agent-studio.js +9 -0
  3. package/lib/cli.mjs +2 -0
  4. package/package.json +22 -4
  5. package/template/playwright-cli.config.json +5 -0
  6. package/template/playwright.config.ts +28 -0
  7. package/template/skills/playwright-cli/SKILL.md +493 -0
  8. package/template/skills/playwright-cli/references/element-attributes.md +23 -0
  9. package/template/skills/playwright-cli/references/playwright-tests.md +39 -0
  10. package/template/skills/playwright-cli/references/pr-attachments.md +60 -0
  11. package/template/skills/playwright-cli/references/request-mocking.md +87 -0
  12. package/template/skills/playwright-cli/references/running-code.md +247 -0
  13. package/template/skills/playwright-cli/references/session-management.md +227 -0
  14. package/template/skills/playwright-cli/references/storage-state.md +278 -0
  15. package/template/skills/playwright-cli/references/test-generation.md +433 -0
  16. package/template/skills/playwright-cli/references/tracing.md +146 -0
  17. package/template/skills/playwright-cli/references/video-recording.md +216 -0
  18. package/template/tsconfig.json +13 -0
  19. package/web/assets/index-CeK0TK15.css +1 -0
  20. package/web/assets/index-QDu4V47t.js +419 -0
  21. package/web/icons/apple-touch-icon.png +0 -0
  22. package/web/icons/icon-192.png +0 -0
  23. package/web/icons/icon-512.png +0 -0
  24. package/web/icons/icon-maskable-512.png +0 -0
  25. package/web/icons/icon-maskable.svg +7 -0
  26. package/web/icons/icon.svg +7 -0
  27. package/web/index.html +22 -0
  28. package/web/manifest.webmanifest +22 -0
  29. package/web/sw.js +85 -0
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
2
+ <rect width="512" height="512" fill="#7c4dff"/>
3
+ <g transform="translate(112 112) scale(12)" fill="none" stroke="#fff" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
4
+ <path d="M12 3 5 6v6c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6z"/>
5
+ <path d="m9 12 2 2 4-4"/>
6
+ </g>
7
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
2
+ <rect width="512" height="512" rx="112" fill="#7c4dff"/>
3
+ <g transform="translate(64 64) scale(16)" fill="none" stroke="#fff" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
4
+ <path d="M12 3 5 6v6c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6z"/>
5
+ <path d="m9 12 2 2 4-4"/>
6
+ </g>
7
+ </svg>
package/web/index.html ADDED
@@ -0,0 +1,22 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Agent Studio</title>
7
+ <meta name="description" content="QA agents: turn test-case specs into verified Playwright tests." />
8
+ <meta name="theme-color" content="#1a1135" />
9
+ <link rel="manifest" href="/manifest.webmanifest" />
10
+ <link rel="icon" href="/icons/icon.svg" type="image/svg+xml" />
11
+ <link rel="icon" href="/icons/icon-192.png" type="image/png" sizes="192x192" />
12
+ <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
13
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
14
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
15
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
16
+ <script type="module" crossorigin src="/assets/index-QDu4V47t.js"></script>
17
+ <link rel="stylesheet" crossorigin href="/assets/index-CeK0TK15.css">
18
+ </head>
19
+ <body>
20
+ <div id="root"></div>
21
+ </body>
22
+ </html>
@@ -0,0 +1,22 @@
1
+ {
2
+ "id": "/",
3
+ "name": "Agent Studio",
4
+ "short_name": "Agent Studio",
5
+ "description": "QA agents: turn test-case specs into verified Playwright tests.",
6
+ "start_url": "/",
7
+ "scope": "/",
8
+ "display": "standalone",
9
+ "background_color": "#1a1135",
10
+ "theme_color": "#1a1135",
11
+ "icons": [
12
+ { "src": "/icons/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" },
13
+ { "src": "/icons/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" },
14
+ { "src": "/icons/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" },
15
+ { "src": "/icons/icon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "any" }
16
+ ],
17
+ "shortcuts": [
18
+ { "name": "Claude chat", "url": "/chat", "icons": [{ "src": "/icons/icon-192.png", "sizes": "192x192" }] },
19
+ { "name": "Recent runs", "url": "/runs", "icons": [{ "src": "/icons/icon-192.png", "sizes": "192x192" }] },
20
+ { "name": "Specification", "url": "/specs", "icons": [{ "src": "/icons/icon-192.png", "sizes": "192x192" }] }
21
+ ]
22
+ }
package/web/sw.js ADDED
@@ -0,0 +1,85 @@
1
+ /*
2
+ * Agent Studio service worker: makes the installed app (PWA) open even when the API is not running,
3
+ * so the UI can say "server not running" instead of a browser error page.
4
+ *
5
+ * Rules:
6
+ * - /api/* is never touched: JSON, SSE streams (EventSource) and Playwright reports always go to the network.
7
+ * - Page navigations: network first, cached index.html as fallback (the SPA serves every route from it).
8
+ * - /assets/* (hashed Vite files) and icons: cache first, they never change under the same name.
9
+ * - Google Fonts: stale-while-revalidate.
10
+ */
11
+ const VERSION = 'v1';
12
+ const SHELL = `agent-studio-shell-${VERSION}`;
13
+ const ASSETS = `agent-studio-assets-${VERSION}`;
14
+ const FONTS = `agent-studio-fonts-${VERSION}`;
15
+
16
+ self.addEventListener('install', (event) => {
17
+ event.waitUntil(
18
+ caches
19
+ .open(SHELL)
20
+ .then((c) => c.addAll(['/', '/manifest.webmanifest', '/icons/icon-192.png']))
21
+ .then(() => self.skipWaiting()),
22
+ );
23
+ });
24
+
25
+ self.addEventListener('activate', (event) => {
26
+ const keep = new Set([SHELL, ASSETS, FONTS]);
27
+ event.waitUntil(
28
+ caches
29
+ .keys()
30
+ .then((keys) => Promise.all(keys.filter((k) => k.startsWith('agent-studio-') && !keep.has(k)).map((k) => caches.delete(k))))
31
+ .then(() => self.clients.claim()),
32
+ );
33
+ });
34
+
35
+ self.addEventListener('fetch', (event) => {
36
+ const req = event.request;
37
+ if (req.method !== 'GET') return;
38
+ const url = new URL(req.url);
39
+
40
+ if (url.origin === self.location.origin) {
41
+ if (url.pathname.startsWith('/api/') || url.pathname === '/api') return; // network only, incl. SSE
42
+ if (req.mode === 'navigate') return event.respondWith(navigate(req));
43
+ if (url.pathname.startsWith('/assets/') || url.pathname.startsWith('/icons/')) return event.respondWith(cacheFirst(req, ASSETS));
44
+ return;
45
+ }
46
+ if (url.hostname === 'fonts.googleapis.com' || url.hostname === 'fonts.gstatic.com') {
47
+ event.respondWith(staleWhileRevalidate(req, FONTS));
48
+ }
49
+ });
50
+
51
+ async function navigate(req) {
52
+ try {
53
+ const res = await fetch(req);
54
+ // Keep the latest app shell for offline starts (every route returns the same index.html)
55
+ if (res.ok && res.headers.get('content-type')?.includes('text/html')) {
56
+ const copy = res.clone();
57
+ void caches.open(SHELL).then((c) => c.put('/', copy));
58
+ }
59
+ return res;
60
+ } catch {
61
+ const cached = await caches.match('/', { cacheName: SHELL });
62
+ return cached ?? Response.error();
63
+ }
64
+ }
65
+
66
+ async function cacheFirst(req, cacheName) {
67
+ const cache = await caches.open(cacheName);
68
+ const hit = await cache.match(req);
69
+ if (hit) return hit;
70
+ const res = await fetch(req);
71
+ if (res.ok) void cache.put(req, res.clone());
72
+ return res;
73
+ }
74
+
75
+ async function staleWhileRevalidate(req, cacheName) {
76
+ const cache = await caches.open(cacheName);
77
+ const hit = await cache.match(req);
78
+ const update = fetch(req)
79
+ .then((res) => {
80
+ if (res.ok || res.type === 'opaque') void cache.put(req, res.clone());
81
+ return res;
82
+ })
83
+ .catch(() => hit ?? Response.error());
84
+ return hit ?? update;
85
+ }