@feimacode/open-design-agent-kit 0.3.0-beta.3 → 0.4.0-beta.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.
- package/assets/claude-skills/{deck-guizang-editorial → od-deck-deck-guizang-editorial}/SKILL.md +1 -1
- package/assets/claude-skills/{deck-open-slide-canvas → od-deck-deck-open-slide-canvas}/SKILL.md +1 -1
- package/assets/claude-skills/{deck-swiss-international → od-deck-deck-swiss-international}/SKILL.md +1 -1
- package/assets/claude-skills/{guizang-ppt → od-deck-guizang-ppt}/SKILL.md +1 -1
- package/assets/claude-skills/{ppt-keynote → od-deck-ppt-keynote}/SKILL.md +1 -1
- package/assets/claude-skills/{article-magazine → od-prototype-article-magazine}/SKILL.md +1 -1
- package/assets/claude-skills/{card-twitter → od-prototype-card-twitter}/SKILL.md +1 -1
- package/assets/claude-skills/{card-xiaohongshu → od-prototype-card-xiaohongshu}/SKILL.md +1 -1
- package/assets/claude-skills/{data-report → od-prototype-data-report}/SKILL.md +1 -1
- package/assets/claude-skills/{doc-kami-parchment → od-prototype-doc-kami-parchment}/SKILL.md +1 -1
- package/assets/claude-skills/{mockup-device-3d → od-prototype-mockup-device-3d}/SKILL.md +1 -1
- package/assets/claude-skills/{poster-hero → od-prototype-poster-hero}/SKILL.md +1 -1
- package/assets/claude-skills/{resume-modern → od-prototype-resume-modern}/SKILL.md +1 -1
- package/assets/claude-skills/{social-carousel → od-prototype-social-carousel}/SKILL.md +1 -1
- package/assets/claude-skills/{social-reddit-card → od-prototype-social-reddit-card}/SKILL.md +1 -1
- package/assets/claude-skills/{social-spotify-card → od-prototype-social-spotify-card}/SKILL.md +1 -1
- package/assets/claude-skills/{social-x-post-card → od-prototype-social-x-post-card}/SKILL.md +1 -1
- package/assets/claude-skills/{social-youtube-thumbnail → od-prototype-social-youtube-thumbnail}/SKILL.md +1 -1
- package/assets/claude-skills/{frame-data-chart-nyt → od-video-frame-data-chart-nyt}/SKILL.md +1 -1
- package/assets/claude-skills/{frame-flowchart-sticky → od-video-frame-flowchart-sticky}/SKILL.md +1 -1
- package/assets/claude-skills/{frame-glitch-title → od-video-frame-glitch-title}/SKILL.md +1 -1
- package/assets/claude-skills/{frame-light-leak-cinema → od-video-frame-light-leak-cinema}/SKILL.md +1 -1
- package/assets/claude-skills/{frame-liquid-bg-hero → od-video-frame-liquid-bg-hero}/SKILL.md +1 -1
- package/assets/claude-skills/{frame-logo-outro → od-video-frame-logo-outro}/SKILL.md +1 -1
- package/assets/claude-skills/{frame-macos-notification → od-video-frame-macos-notification}/SKILL.md +1 -1
- package/assets/claude-skills/{vfx-text-cursor → od-video-vfx-text-cursor}/SKILL.md +1 -1
- package/assets/claude-skills/{video-hyperframes → od-video-video-hyperframes}/SKILL.md +1 -1
- package/assets/claude-skills/open-design/SKILL.md +48 -10
- package/assets/claude-skills/open-design-campaign/SKILL.md +19 -0
- package/assets/claude-skills/open-design-critique/SKILL.md +95 -0
- package/assets/claude-skills/open-design-deck-from-source/SKILL.md +19 -0
- package/assets/claude-skills/open-design-design-system-from-url/SKILL.md +81 -0
- package/assets/claude-skills/open-design-docs/SKILL.md +19 -0
- package/assets/claude-skills/open-design-explore/SKILL.md +23 -0
- package/assets/claude-skills/open-design-integrations/SKILL.md +19 -0
- package/assets/claude-skills/open-design-new/SKILL.md +37 -5
- package/assets/claude-skills/open-design-poster/SKILL.md +20 -1
- package/assets/claude-skills/open-design-preview/SKILL.md +22 -0
- package/assets/claude-skills/open-design-publish/SKILL.md +19 -0
- package/assets/claude-skills/open-design-recurring/SKILL.md +19 -0
- package/assets/claude-skills/open-design-social-post/SKILL.md +20 -1
- package/assets/codex-skills/article-magazine/SKILL.md +1 -1
- package/assets/codex-skills/card-twitter/SKILL.md +1 -1
- package/assets/codex-skills/card-xiaohongshu/SKILL.md +1 -1
- package/assets/codex-skills/data-report/SKILL.md +1 -1
- package/assets/codex-skills/deck-guizang-editorial/SKILL.md +1 -1
- package/assets/codex-skills/deck-open-slide-canvas/SKILL.md +1 -1
- package/assets/codex-skills/deck-swiss-international/SKILL.md +1 -1
- package/assets/codex-skills/doc-kami-parchment/SKILL.md +1 -1
- package/assets/codex-skills/frame-data-chart-nyt/SKILL.md +1 -1
- package/assets/codex-skills/frame-flowchart-sticky/SKILL.md +1 -1
- package/assets/codex-skills/frame-glitch-title/SKILL.md +1 -1
- package/assets/codex-skills/frame-light-leak-cinema/SKILL.md +1 -1
- package/assets/codex-skills/frame-liquid-bg-hero/SKILL.md +1 -1
- package/assets/codex-skills/frame-logo-outro/SKILL.md +1 -1
- package/assets/codex-skills/frame-macos-notification/SKILL.md +1 -1
- package/assets/codex-skills/guizang-ppt/SKILL.md +1 -1
- package/assets/codex-skills/mockup-device-3d/SKILL.md +1 -1
- package/assets/codex-skills/open-design/SKILL.md +48 -10
- package/assets/codex-skills/open-design-campaign/SKILL.md +19 -0
- package/assets/codex-skills/open-design-critique/SKILL.md +94 -0
- package/assets/codex-skills/open-design-deck-from-source/SKILL.md +19 -0
- package/assets/codex-skills/open-design-design-system-from-url/SKILL.md +76 -0
- package/assets/codex-skills/open-design-docs/SKILL.md +19 -0
- package/assets/codex-skills/open-design-explore/SKILL.md +19 -0
- package/assets/codex-skills/open-design-integrations/SKILL.md +19 -0
- package/assets/codex-skills/open-design-new/SKILL.md +31 -5
- package/assets/codex-skills/open-design-poster/SKILL.md +20 -1
- package/assets/codex-skills/open-design-preview/SKILL.md +19 -0
- package/assets/codex-skills/open-design-publish/SKILL.md +19 -0
- package/assets/codex-skills/open-design-recurring/SKILL.md +19 -0
- package/assets/codex-skills/open-design-social-post/SKILL.md +20 -1
- package/assets/codex-skills/poster-hero/SKILL.md +1 -1
- package/assets/codex-skills/ppt-keynote/SKILL.md +1 -1
- package/assets/codex-skills/resume-modern/SKILL.md +1 -1
- package/assets/codex-skills/social-carousel/SKILL.md +1 -1
- package/assets/codex-skills/social-reddit-card/SKILL.md +1 -1
- package/assets/codex-skills/social-spotify-card/SKILL.md +1 -1
- package/assets/codex-skills/social-x-post-card/SKILL.md +1 -1
- package/assets/codex-skills/social-youtube-thumbnail/SKILL.md +1 -1
- package/assets/codex-skills/vfx-text-cursor/SKILL.md +1 -1
- package/assets/codex-skills/video-hyperframes/SKILL.md +1 -1
- package/out/index.js +4243 -1699
- package/out/preview/mcp-app.js +110 -87
- package/out/preview/shell.js +24 -24
- package/package.json +2 -2
package/out/preview/shell.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{function $(t,o){let r=t.getBoundingClientRect();return{left:r.left+o.left,top:r.top+o.top,width:o.width,height:o.height}}function
|
|
1
|
+
"use strict";(()=>{function re(t){let o=t.findings.length;if(o===0)return`Second look: ${t.verdict}`;let r=t.verdict==="ship"?o===1?"note":"notes":o===1?"fix":"fixes";return`Second look: ${t.verdict}, ${o} ${r}`}function A(t,o){let r=t.getBoundingClientRect();return{left:r.left+o.left,top:r.top+o.top,width:o.width,height:o.height}}function j(t,o){let r=document.createElement("div");return r.className=o,r.style.left=`${t.left}px`,r.style.top=`${t.top}px`,r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r}function se(t,o){let r=t.getBoundingClientRect(),i=p=>{let m=document.createElement("div");return m.className="od-guide-line od-guide-h",m.style.left=`${r.left}px`,m.style.top=`${p}px`,m.style.width=`${r.width}px`,m},y=p=>{let m=document.createElement("div");return m.className="od-guide-line od-guide-v",m.style.top=`${r.top}px`,m.style.left=`${p}px`,m.style.height=`${r.height}px`,m};return[i(o.top),i(o.top+o.height),y(o.left),y(o.left+o.width)]}function a(t){return t.replace(/[&<>"']/g,o=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[o])}function be(){return`c-${Math.random().toString(36).slice(2,10)}`}function we(t,o,r,i=new Date().toISOString()){return{id:be(),...t.sourceElementId?{elementId:t.sourceElementId}:{},selector:t.selector,htmlHint:t.htmlHint,note:o,status:"open",createdAt:i,updatedAt:i,text:t.textExcerpt||void 0,rect:{x:Math.round(t.docRect.left),y:Math.round(t.docRect.top),width:Math.round(t.docRect.width),height:Math.round(t.docRect.height)},viewport:t.viewport,host:r}}function de(t){let{panel:o,iframe:r}=t,i=[],y=(d,c=[])=>{t.persist(d,c),t.onListChanged()},p=d=>{o.hidden=!1,o.innerHTML=`
|
|
2
2
|
<div class="od-panel-header">
|
|
3
3
|
<span class="od-panel-header-title">Add comment</span>
|
|
4
4
|
<button id="od-comment-close" class="od-panel-close" aria-label="Close">\xD7</button>
|
|
@@ -11,37 +11,37 @@
|
|
|
11
11
|
<button id="od-comment-cancel" class="od-btn">Cancel</button>
|
|
12
12
|
<button id="od-comment-save" class="od-btn od-btn-primary">Add</button>
|
|
13
13
|
</div>
|
|
14
|
-
`;let
|
|
14
|
+
`;let c=document.getElementById("od-comment-text");c.focus();let u=()=>{let h=c.value.trim();if(!h)return;let g=we(d,h,t.host);i.push(g),y([g]),t.closePanel(),t.onAdded?.(g,d)};document.getElementById("od-comment-close").addEventListener("click",t.closePanel),document.getElementById("od-comment-cancel").addEventListener("click",t.closePanel),document.getElementById("od-comment-save").addEventListener("click",u),c.addEventListener("keydown",h=>{h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&u(),h.key==="Escape"&&t.closePanel()})},m=d=>{o.hidden=!1;let c=d.status==="sent"?"Sent to the agent":"Open";o.innerHTML=`
|
|
15
15
|
<div class="od-panel-header">
|
|
16
|
-
<span class="od-panel-header-title">Comment \xB7 ${
|
|
16
|
+
<span class="od-panel-header-title">Comment \xB7 ${a(c)}</span>
|
|
17
17
|
<button id="od-pin-close" class="od-panel-close" aria-label="Close">\xD7</button>
|
|
18
18
|
</div>
|
|
19
19
|
<div class="od-panel-body">
|
|
20
|
-
<p class="od-comment-note">${
|
|
21
|
-
<code class="od-comment-target">${
|
|
20
|
+
<p class="od-comment-note">${a(d.note)}</p>
|
|
21
|
+
<code class="od-comment-target">${a(d.selector)}</code>
|
|
22
22
|
</div>
|
|
23
23
|
<div class="od-panel-footer">
|
|
24
24
|
<button id="od-pin-delete" class="od-btn od-btn-danger">Delete</button>
|
|
25
25
|
<span class="od-spacer"></span>
|
|
26
26
|
<button id="od-pin-resolve" class="od-btn">Resolve</button>
|
|
27
|
-
</div>`,document.getElementById("od-pin-close").addEventListener("click",t.closePanel),document.getElementById("od-pin-delete").addEventListener("click",()=>{
|
|
27
|
+
</div>`,document.getElementById("od-pin-close").addEventListener("click",t.closePanel),document.getElementById("od-pin-delete").addEventListener("click",()=>{i=i.filter(u=>u.id!==d.id),y([],[d.id]),t.closePanel()}),document.getElementById("od-pin-resolve").addEventListener("click",()=>{$.patch(d.id,{status:"resolved"}),t.closePanel()})},$={setComments(d){i=Array.isArray(d)?[...d]:[],t.onListChanged()},all:()=>i,open:()=>i.filter(d=>d.status==="open"),openInput:p,forBridge:()=>i.map(d=>({id:d.id,elementId:d.elementId,selector:d.selector,status:d.status,text:d.text,htmlHint:d.htmlHint})),pins(d){let c=[];for(let u of i){if(u.status==="resolved")continue;let h=d.find(b=>b.commentId===u.id)?.rect,g=h?A(r,h):null,f=document.createElement("div");f.className=`od-pin ${g?"anchored":"lost"}${u.status==="sent"?" sent":""}`,f.title=u.note,f.style.left=g?`${g.left+g.width/2}px`:"8px",f.style.top=g?`${g.top}px`:"8px",t.pinDetails&&(f.style.pointerEvents="auto",f.addEventListener("click",b=>{b.stopPropagation(),m(u)})),c.push(f)}return c},markOpenSent(){let d=new Date().toISOString(),c=[];return i=i.map(u=>{if(u.status!=="open")return u;let h={...u,status:"sent",updatedAt:d};return c.push(h),h}),c.length&&y(c),c},patch(d,c){let u=new Date().toISOString(),h;i=i.map(g=>g.id===d?h={...g,...c,updatedAt:u}:g),h&&y([h])},upsertLocal(d){let c=i.findIndex(u=>u.id===d.id);c===-1?i.push(d):i[c]=d,t.onListChanged()}};return $}var Ee={eye:'<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',comment:'<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>',pencil:'<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/>',chevronLeft:'<path d="m15 18-6-6 6-6"/>',chevronRight:'<path d="m9 18 6-6-6-6"/>',chevronDown:'<path d="m6 9 6 6 6-6"/>',refresh:'<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>',expand:'<path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/>',code:'<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',share:'<path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline points="16 6 12 2 8 6"/><line x1="12" x2="12" y1="2" y2="15"/>',export:'<path d="M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6"/><path d="m21 3-9 9"/><path d="M15 3h6v6"/>',layers:'<path d="m12 2 10 5-10 5L2 7Z"/><path d="m2 17 10 5 10-5"/><path d="m2 12 10 5 10-5"/>',image:'<rect width="18" height="18" x="3" y="3" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21"/>',users:'<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',link:'<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>',check:'<path d="M20 6 9 17l-5-5"/>',arrowLeft:'<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',palette:'<circle cx="13.5" cy="6.5" r=".5" fill="currentColor"/><circle cx="17.5" cy="10.5" r=".5" fill="currentColor"/><circle cx="8.5" cy="7.5" r=".5" fill="currentColor"/><circle cx="6.5" cy="12.5" r=".5" fill="currentColor"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/>',sliders:'<line x1="4" x2="4" y1="21" y2="14"/><line x1="4" x2="4" y1="10" y2="3"/><line x1="12" x2="12" y1="21" y2="12"/><line x1="12" x2="12" y1="8" y2="3"/><line x1="20" x2="20" y1="21" y2="16"/><line x1="20" x2="20" y1="12" y2="3"/><line x1="2" x2="6" y1="14" y2="14"/><line x1="10" x2="14" y1="8" y2="8"/><line x1="18" x2="22" y1="16" y2="16"/>',send:'<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>',mail:'<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',clipboard:'<rect width="8" height="4" x="8" y="2" rx="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>'};function L(t,o=16){return`<svg class="od-icon" width="${o}" height="${o}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${Ee[t]}</svg>`}var Q="bridge";function ae(t){return typeof t=="object"&&t!==null&&t.od===Q&&typeof t.type=="string"}var V=document.getElementById("root"),G=JSON.parse(V.dataset.odConfig??"{}"),le=window.matchMedia("(prefers-color-scheme: dark)"),pe=()=>{document.body.classList.toggle("od-dark",le.matches)};pe();le.addEventListener("change",pe);async function S(t,o){let r=await fetch(t,{method:o?.method??"GET",headers:o?.body!==void 0?{"Content-Type":"application/json"}:void 0,body:o?.body!==void 0?JSON.stringify(o.body):void 0}),i=await r.json().catch(()=>({}));if(!r.ok)throw new Error(i.error??`HTTP ${r.status}`);return i}var R=document.createElement("div");R.className="od-toast";R.hidden=!0;R.setAttribute("role","status");document.body.appendChild(R);var ce=0;function D(t){R.textContent=t,R.hidden=!1,clearTimeout(ce),ce=window.setTimeout(()=>{R.hidden=!0},4e3)}async function me(t){V.innerHTML=`<div class="od-picker"><div class="od-picker-inner">
|
|
28
28
|
<h1>Open Design preview</h1>
|
|
29
|
-
<p>${t?
|
|
29
|
+
<p>${t?a(t):"Pick a design to preview and comment on."}</p>
|
|
30
30
|
<ul class="od-picker-list" id="od-picker-list"><li><p>Loading\u2026</p></li></ul>
|
|
31
|
-
</div></div>`;let o=document.getElementById("od-picker-list");try{let{artifacts:r}=await
|
|
31
|
+
</div></div>`;let o=document.getElementById("od-picker-list");try{let{artifacts:r}=await S("api/artifacts");o.innerHTML=r.length?r.map(i=>`<li><a href="?entry=${encodeURIComponent(i.entryPath)}">${a(i.title)}<small>${a(i.entryPath)}</small></a></li>`).join(""):"<li><p>No designs are registered in this workspace yet. Ask your agent to make one.</p></li>"}catch(r){o.innerHTML=`<li><p>${a(r instanceof Error?r.message:String(r))}</p></li>`}}async function xe(t){let o;try{o=await S(`api/state?entry=${encodeURIComponent(t)}`)}catch(e){await me(e instanceof Error?e.message:String(e));return}document.title=`${o.title} \xB7 Open Design`;let r=`entry=${encodeURIComponent(t)}`;V.innerHTML=`
|
|
32
32
|
<div class="od-shell" style="display:flex;flex-direction:column;height:100%">
|
|
33
33
|
<div class="od-toolbar" role="toolbar" aria-label="Preview">
|
|
34
34
|
<div class="od-segmented" role="radiogroup" aria-label="Mode">
|
|
35
|
-
<button data-mode="view" class="od-seg-btn active" role="radio" aria-checked="true" title="View">${
|
|
36
|
-
<button data-mode="comment" class="od-seg-btn" role="radio" aria-checked="false" tabindex="-1" title="Comment on elements">${
|
|
35
|
+
<button data-mode="view" class="od-seg-btn active" role="radio" aria-checked="true" title="View">${L("eye")}<span class="od-label">View</span></button>
|
|
36
|
+
<button data-mode="comment" class="od-seg-btn" role="radio" aria-checked="false" tabindex="-1" title="Comment on elements">${L("comment")}<span class="od-label">Comment</span></button>
|
|
37
37
|
</div>
|
|
38
|
-
<a class="od-icon-btn" href="./" title="All designs" aria-label="All designs">${
|
|
39
|
-
<span class="od-title">${
|
|
40
|
-
<span class="od-path">${
|
|
38
|
+
<a class="od-icon-btn" href="./" title="All designs" aria-label="All designs">${L("chevronLeft")}</a>
|
|
39
|
+
<span class="od-title">${a(o.title)}</span>
|
|
40
|
+
<span class="od-path">${a(t)}</span>
|
|
41
41
|
<span class="od-toolbar-spacer"></span>
|
|
42
42
|
<span id="od-live" class="od-live off" title="Reloads when the design changes"><span>Live</span></span>
|
|
43
|
-
<button id="od-checks-toggle" class="od-btn" title="Check screenshots: before and after" aria-pressed="false">${
|
|
44
|
-
<button id="od-send-comments" class="od-btn od-btn-primary" title="Copy an instruction for your agent to apply the open comments" hidden>${
|
|
43
|
+
<button id="od-checks-toggle" class="od-btn" title="Check screenshots: before and after" aria-pressed="false">${L("check")}<span class="od-label">Checks</span><span id="od-checks-dot" class="od-dot" hidden></span></button>
|
|
44
|
+
<button id="od-send-comments" class="od-btn od-btn-primary" title="Copy an instruction for your agent to apply the open comments" hidden>${L("send")}<span class="od-label">Send to agent</span><span id="od-send-count" class="od-count"></span></button>
|
|
45
45
|
</div>
|
|
46
46
|
<div class="od-stage">
|
|
47
47
|
<div id="od-errors" class="od-errors" role="status" hidden>
|
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
</div>
|
|
54
54
|
<div id="od-panel" class="od-panel" hidden></div>
|
|
55
55
|
<div id="od-checks" class="od-panel od-checks" hidden></div>
|
|
56
|
-
</div>`;let
|
|
56
|
+
</div>`;let i=document.getElementById("od-preview"),y=document.getElementById("od-pins"),p=document.getElementById("od-panel"),m=document.getElementById("od-checks"),$=document.getElementById("od-checks-toggle"),d=document.getElementById("od-checks-dot"),c=document.getElementById("od-send-comments"),u=document.getElementById("od-send-count"),h=document.getElementById("od-live"),g="view",f=null,b=null,k=null,H=[],P=!1,_=!1,O=!1,J={x:0,y:0},q,x=e=>{i.contentWindow?.postMessage({od:Q,...e},G.designOrigin)},ue=()=>{p.hidden=!0,b=null,k=null,x({type:"clear-selection"}),E()},X=()=>{let e=w.open().length;c.hidden=g!=="comment"&&e===0,c.disabled=e===0,u.textContent=e?String(e):""},w=de({panel:p,iframe:i,host:"browser",pinDetails:!0,persist:(e,n)=>{S(`api/comments?${r}`,{method:"POST",body:{changed:e,deletedIds:n}}).catch(l=>D(`Couldn't save the comment: ${l instanceof Error?l.message:String(l)}`))},closePanel:ue,onListChanged:()=>{X(),x({type:"set-comments",comments:w.forBridge()}),E()},onAdded:(e,n)=>void he(e,n)});function E(){if(y.innerHTML="",!(g==="view"||O)){if(f&&y.appendChild(j(A(i,f),"od-hover-box")),b&&k){let e=A(i,k);se(i,e).forEach(n=>y.appendChild(n)),y.appendChild(j(e,"od-select-box"))}w.pins(H).forEach(e=>y.appendChild(e))}}let z=()=>new Promise(e=>requestAnimationFrame(()=>e()));async function he(e,n){if(o.cropSupport==="none")return;O=!0,E(),await z(),await z();let l=i.getBoundingClientRect(),v=A(i,n.rect);try{let s=await S(`api/crop?${r}`,{method:"POST",body:{commentId:e.id,element:{x:v.left,y:v.top,width:v.width,height:v.height},stage:{x:l.left,y:l.top,width:l.width,height:l.height},docRect:{x:n.docRect.left,y:n.docRect.top,width:n.docRect.width,height:n.docRect.height},viewport:n.viewport}});s.comment?w.upsertLocal(s.comment):s.reason&&D(s.reason)}catch(s){D(`The comment was saved without a screenshot: ${s instanceof Error?s.message:String(s)}`)}finally{O=!1,E()}}function ge(){p.hidden=!1,p.innerHTML=`
|
|
57
57
|
<div class="od-panel-header">
|
|
58
58
|
<span class="od-panel-header-title">Comment unavailable</span>
|
|
59
59
|
<button id="od-bridge-close" class="od-panel-close" aria-label="Close">\xD7</button>
|
|
60
60
|
</div>
|
|
61
|
-
<div class="od-panel-body"><p>This design's page didn't start the preview helper that Comment relies on, usually because one of its own scripts failed first. Check the error banner, or ask your agent to fix the page.</p></div>`,document.getElementById("od-bridge-close").addEventListener("click",()=>{p.hidden=!0})}let
|
|
61
|
+
<div class="od-panel-body"><p>This design's page didn't start the preview helper that Comment relies on, usually because one of its own scripts failed first. Check the error banner, or ask your agent to fix the page.</p></div>`,document.getElementById("od-bridge-close").addEventListener("click",()=>{p.hidden=!0})}let M=Array.from(document.querySelectorAll(".od-seg-btn[data-mode]"));function W(e){if(e!=="view"&&_&&!P){ge();return}g=e,M.forEach(n=>{let l=n.dataset.mode===e;n.classList.toggle("active",l),n.setAttribute("aria-checked",String(l)),n.tabIndex=l?0:-1}),p.hidden=!0,b=null,k=null,f=null,H=[],X(),x({type:"set-mode",mode:e}),x({type:"set-comments",comments:w.forBridge()}),E()}M.forEach((e,n)=>{e.addEventListener("click",()=>W(e.dataset.mode)),e.addEventListener("keydown",l=>{let v=l.key==="ArrowRight"?1:l.key==="ArrowLeft"?-1:0;if(!v)return;l.preventDefault();let s=M[(n+v+M.length)%M.length];W(s.dataset.mode),s.focus()})});let Y=document.getElementById("od-errors"),fe=document.getElementById("od-errors-list"),C=[],Z=()=>{Y.hidden=C.length===0,fe.innerHTML=C.slice(0,3).map(e=>`<code>${a(e)}</code>`).join("")+(C.length>3?`<span>and ${C.length-3} more</span>`:"")};document.getElementById("od-errors-close").addEventListener("click",()=>{Y.hidden=!0}),window.addEventListener("message",e=>{if(e.source!==i.contentWindow||e.origin!==G.designOrigin)return;if(typeof e.data?.odPreviewError=="string"){let l=e.data.odPreviewError;!C.includes(l)&&C.length<20&&(C.push(l),Z());return}if(!ae(e.data))return;let n=e.data;switch(n.type){case"ready":P=!0,x({type:"set-mode",mode:g}),x({type:"set-comments",comments:w.forBridge()}),q&&(x({type:"scroll-to",...q}),q=void 0);break;case"select":if(g==="view")break;b=n.element,k=n.element.rect,f=null,E(),w.openInput(b);break;case"rects":f=n.hover,k=b?n.selection:null,H=Array.isArray(n.pins)?n.pins:[],E();break;case"scroll":Number.isFinite(n.x)&&Number.isFinite(n.y)&&(J={x:n.x,y:n.y});break;case"open-local-link":ye(String(n.href??""));break}});async function ye(e){let n=new URL(e,o.designUrl),l=`/${new URL(o.designUrl).pathname.split("/")[1]}/`,v=decodeURIComponent(n.pathname.slice(l.length));try{await S(`api/state?entry=${encodeURIComponent(v)}`),location.search=`?entry=${encodeURIComponent(v)}`}catch{i.src=n.href}}let K=0;function ee(e){P=!1,_=!1,C=[],Z(),f=null,b=null,k=null,H=[],!p.hidden&&p.querySelector("#od-comment-text")||(p.hidden=!0),q=e?J:void 0,K++,i.src=`${o.designUrl}?v=${K}`,E()}i.addEventListener("load",()=>{_=!0,x({type:"hello"}),E()}),window.addEventListener("resize",E),c.addEventListener("click",async()=>{let e=w.open();if(e.length===0)return;let n=`Apply my ${e.length===1?"comment":`${e.length} comments`} on the Open Design artifact "${t}": call get_open_design_artifact for it, address each open comment, then pass their ids as resolvedCommentIds when you re-register it.`;w.markOpenSent();try{await navigator.clipboard.writeText(n),D("Copied. Paste it into your agent.")}catch{p.hidden=!1,p.innerHTML=`
|
|
62
62
|
<div class="od-panel-header"><span class="od-panel-header-title">Paste this into your agent</span><button id="od-copy-close" class="od-panel-close" aria-label="Close">\xD7</button></div>
|
|
63
|
-
<div class="od-panel-body"><textarea class="od-textarea od-copy-text" readonly>${
|
|
64
|
-
<p class="od-check-summary">After: ${
|
|
65
|
-
${e.images.map(
|
|
66
|
-
<figure>${
|
|
67
|
-
<figure><img src="${
|
|
68
|
-
${e.findings.length?`<div class="od-panel-section-title">Findings</div><ul class="od-shape-findings">${e.findings.map(
|
|
63
|
+
<div class="od-panel-body"><textarea class="od-textarea od-copy-text" readonly>${a(n)}</textarea></div>`,p.querySelector("textarea").select(),document.getElementById("od-copy-close").addEventListener("click",()=>{p.hidden=!0})}});let I=[],T,U;async function N(){try{({runs:I,critique:T}=await S(`api/checks?${r}`))}catch{I=[],T=void 0}m.hidden||F()}let te=(e,n)=>`api/check-image?${r}&run=${encodeURIComponent(e.id)}&file=${encodeURIComponent(n)}`,ne=e=>`${new Date(e.createdAt).toLocaleString()} \xB7 ${e.errors} error${e.errors===1?"":"s"}, ${e.warnings} warning${e.warnings===1?"":"s"}`;function F(){let e=I.find(s=>s.id===U)??I[0],n=e?I[I.indexOf(e)+1]:void 0,l=e?`<div class="od-check-runs">${I.map(s=>`<button class="od-btn od-check-run${s===e?" active":""}" data-run="${a(s.id)}">${a(new Date(s.createdAt).toLocaleTimeString())}</button>`).join("")}</div>
|
|
64
|
+
<p class="od-check-summary">After: ${a(ne(e))}${n?`<br>Before: ${a(ne(n))}`:"<br>No earlier check to compare with."}</p>
|
|
65
|
+
${e.images.map(s=>{let ie=n?.images.find(ve=>ve.label===s.label);return`<div class="od-check-label">${a(s.label)}</div><div class="od-check-pair">
|
|
66
|
+
<figure>${ie?`<img src="${te(n,ie.file)}" alt="Before: ${a(s.label)}" loading="lazy">`:'<div class="od-check-empty">No earlier image</div>'}<figcaption>Before</figcaption></figure>
|
|
67
|
+
<figure><img src="${te(e,s.file)}" alt="After: ${a(s.label)}" loading="lazy"><figcaption>After</figcaption></figure></div>`}).join("")}
|
|
68
|
+
${e.findings.length?`<div class="od-panel-section-title">Findings</div><ul class="od-shape-findings">${e.findings.map(s=>`<li class="od-shape-finding od-sev-${a(s.severity)}"><b>${a(s.severity)}</b> [${a(s.check)}] ${a(s.message)}</li>`).join("")}</ul>`:""}`:'<p class="od-check-empty">No checks yet. Your agent runs one after making or changing a design.</p>',v=T?`<div class="od-panel-section-title">${a(re(T))}</div>${T.findings.length?`<ul class="od-shape-findings">${T.findings.map(s=>`<li class="od-shape-finding">${s.where?`<b>${a(s.where)}</b> `:""}${s.problem?`${a(s.problem)}. `:""}${a(s.fix)}</li>`).join("")}</ul>`:""}`:"";m.innerHTML=`
|
|
69
69
|
<div class="od-panel-header"><span class="od-panel-header-title">Checks</span><button id="od-checks-close" class="od-panel-close" aria-label="Close">\xD7</button></div>
|
|
70
|
-
<div class="od-panel-body">${
|
|
70
|
+
<div class="od-panel-body">${v}${l}</div>`,document.getElementById("od-checks-close").addEventListener("click",()=>oe(!1)),m.querySelectorAll("[data-run]").forEach(s=>s.addEventListener("click",()=>{U=s.dataset.run,F()}))}function oe(e=m.hidden){m.hidden=!e,$.classList.toggle("active",e),$.setAttribute("aria-pressed",String(e)),e&&(d.hidden=!0,p.hidden=!0,F())}$.addEventListener("click",()=>oe());let B=new EventSource(`events?${r}`);B.addEventListener("open",()=>h.classList.remove("off")),B.addEventListener("error",()=>h.classList.add("off")),B.addEventListener("source-updated",()=>ee(!0)),B.addEventListener("manifest-updated",()=>void N()),B.addEventListener("comments-updated",e=>{let n=JSON.parse(e.data);w.setComments(n.comments??[])}),B.addEventListener("checks-updated",e=>{U=JSON.parse(e.data).runId,m.hidden&&(d.hidden=!1),N()}),w.setComments(o.comments),ee(!1),N()}G.entryPath?xe(G.entryPath):me();})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feimacode/open-design-agent-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-beta.1",
|
|
4
4
|
"description": "npx @feimacode/open-design-agent-kit init — sets up Open Design's Claude Code and/or Codex integration directly in your own project, no marketplace or manual copying required. Also `export` (artifact → upload-ready PNG/JPEG) and `render-video` (HyperFrames → MP4) for scripted social-post pipelines.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@inquirer/prompts": "^7.8.0",
|
|
46
46
|
"commander": "^14.0.0",
|
|
47
47
|
"smol-toml": "^1.8.0",
|
|
48
|
-
"@feimacode/open-design-agent-kit-content": "^0.
|
|
48
|
+
"@feimacode/open-design-agent-kit-content": "^0.4.0-beta.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@feimacode/open-design-agent-kit-core": "*"
|