@evandu/super-pi 0.1.274 → 0.1.275

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 (41) hide show
  1. package/agents/super-pi-documents/index.ts +16 -1
  2. package/agents/super-pi-task/core.ts +1 -1
  3. package/bin/render-presentation.ps1 +35 -0
  4. package/desktop/main.cjs +16 -9
  5. package/desktop/notifications.cjs +2 -1
  6. package/desktop/relaunch.cjs +5 -2
  7. package/desktop/restart-handoff.cjs +35 -0
  8. package/dist/client/.super-pi-client-sources.json +26 -19
  9. package/dist/client/assets/CodeMirrorEditor-DJgZdigq.js +2 -0
  10. package/dist/client/assets/{GitDiffEditor-CpoDDQrA.css → GitDiffEditor-DIRyUxnb.css} +1 -1
  11. package/dist/client/assets/GitDiffEditor-lOnvlR42.js +29 -0
  12. package/dist/client/assets/index-BWm699nV.js +350 -0
  13. package/dist/client/assets/index-CnNljc5p.css +1 -0
  14. package/dist/client/index.html +2 -2
  15. package/dist/server/agents.d.ts +1 -1
  16. package/dist/server/agents.js +10 -3
  17. package/dist/server/application/document-service.d.ts +134 -0
  18. package/dist/server/application/document-service.js +9 -0
  19. package/dist/server/http-server.js +32 -3
  20. package/dist/server/presentations/brief.d.ts +49 -0
  21. package/dist/server/presentations/brief.js +132 -0
  22. package/dist/server/presentations/inspect.d.ts +15 -0
  23. package/dist/server/presentations/inspect.js +30 -0
  24. package/dist/server/presentations/native.d.ts +8 -0
  25. package/dist/server/presentations/native.js +33 -0
  26. package/dist/server/presentations/render.d.ts +16 -0
  27. package/dist/server/presentations/render.js +152 -0
  28. package/dist/server/presentations/service.d.ts +176 -0
  29. package/dist/server/presentations/service.js +155 -0
  30. package/dist/server/runtime.js +3 -2
  31. package/dist/shared/message-source-link.d.ts +1 -0
  32. package/dist/shared/message-source-link.js +4 -0
  33. package/dist/shared/workspace-file-preview.d.ts +1 -1
  34. package/dist/shared/workspace-file-preview.js +2 -0
  35. package/package.json +4 -1
  36. package/skills/presentation/SKILL.md +23 -1
  37. package/skills/presentation/references/spec.md +15 -0
  38. package/dist/client/assets/CodeMirrorEditor-DjMbNm7l.js +0 -2
  39. package/dist/client/assets/GitDiffEditor-Cwim9Ua1.js +0 -29
  40. package/dist/client/assets/index-BL9o4WZN.js +0 -350
  41. package/dist/client/assets/index-D1qJmoVY.css +0 -1
@@ -0,0 +1,15 @@
1
+ # Positioned specification (only when a brief cannot express the requested layout)
2
+
3
+ Prefer the compact semantic brief for normal decks. Do not inspect Super Pi source or build a generator to discover this contract. The same `presentation_create` brief/briefPath accepts the following JSON instead:
4
+
5
+ ```json
6
+ {"version":1,"metadata":{"title":"评审","author":"团队","language":"zh-CN"},"canvas":{"width":13.333,"height":7.5},"slides":[{"id":"page-1","title":"试点收益","notes":"模拟数据。","background":"F8FAFD","elements":[
7
+ {"id":"title-1","type":"text","x":0.7,"y":0.5,"width":12,"height":0.9,"text":"试点收益需要质量护栏","fontSize":28,"bold":true,"color":"233047"},
8
+ {"id":"chart-1","type":"chart","x":0.8,"y":1.6,"width":8,"height":4.8,"chart":"column","categories":["基线","试点"],"series":[{"name":"中位周期(小时)","values":[18,14.5]}],"showLegend":true,"showValues":true},
9
+ {"id":"caption-1","type":"text","x":9.3,"y":2,"width":3,"height":3,"text":"这是观察结果,不能推断因果。","fontSize":22,"color":"233047"}
10
+ ]}]}
11
+ ```
12
+
13
+ All dimensions are inches; fontSize is points. All frames must fit the canvas. IDs are unique across the deck, start with a letter, and contain only ASCII letters/digits/dot/underscore/hyphen. Colors are six-digit RGB, with optional leading #. Text fields: fontFamily, fontSize, color, bold, italic, align (left/center/right/justify), verticalAlign (top/middle/bottom). Shape fields: shape (rectangle/roundRectangle/ellipse/triangle/chevron), fill, stroke, strokeWidth. Line fields: stroke, strokeWidth. Table fields: rectangular rows (string/number/boolean/null) and headerRows. Chart fields as above, plus chart types bar/column/line/area/pie/doughnut. Null data values, scatter and images are not supported by the writer; do not silently replace them. Layout PNG approximates these shapes; native-office previews are actual PowerPoint output.
14
+
15
+ Semantic brief data bindings: strings can contain `{{budget.monthly}}`; objects/arrays can be shared as `{"$ref":"teamChart"}`. A chart/table reference resolves from the brief's data object before validation. Updating that data through presentation_edit updates every reference. References cannot execute code or access files. Patch slide fields by ID; positioned slides can replace their elements array as a unit. Preserve IDs of unchanged elements. Object-level insert/remove patches and arbitrary imported deck editing remain future work.
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-D978o95T.js","assets/rolldown-runtime-XKyaHtl9.js","assets/dist-B3-a6uF0.js","assets/dist-CX_Hm4GS.js","assets/dist-Cus6_oaF.js","assets/dist-J6XWqRpB.js","assets/dist-scBkrwv-.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{c as t,d as n,l as r,n as i,s as a,t as o,u as s}from"./index-BL9o4WZN.js";var c=e(n(),1),l=s(),u=262144,d=131072;function f(e){return e.split(`.`).pop()?.toLowerCase()??``}function p(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function m(e,t){return e.HighlightStyle.define([{tag:t.tags.keyword,color:p(`--cm-keyword`)},{tag:t.tags.string,color:p(`--cm-string`)},{tag:t.tags.number,color:p(`--cm-number`)},{tag:t.tags.comment,color:p(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:p(`--cm-function`)},{tag:t.tags.typeName,color:p(`--cm-type`)},{tag:t.tags.className,color:p(`--cm-type`)},{tag:t.tags.propertyName,color:p(`--cm-property`)},{tag:t.tags.operator,color:p(`--cm-operator`)},{tag:t.tags.variableName,color:p(`--cm-variable`)}])}function h({path:e,value:n,onChange:s,jumpToLine:p,onSave:h,workspaceId:g,blame:_,onPosition:v,readOnly:y=!1,languageOverride:b}){let x=(0,c.useRef)(null),S=(0,c.useRef)(null),C=(0,c.useRef)(void 0),w=(0,c.useRef)(null),T=(0,c.useRef)(null),E=(0,c.useRef)(null),D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(s),j=(0,c.useRef)(h);A.current=s,j.current=h;let[M,N]=(0,c.useState)(!1),[P,F]=(0,c.useState)(!1),[I,L]=(0,c.useState)(`0,0`),[R,z]=(0,c.useState)(0);(0,c.useEffect)(()=>{let a=!1,o,s,c,l,d;return(async()=>{try{let p=b??f(e),h=t(p),[_,v,M,P,I,R,B,V]=await Promise.all([r(()=>import(`./dist-D978o95T.js`).then(e=>e.S),__vite__mapDeps([0,1])),r(()=>import(`./dist-B3-a6uF0.js`).then(e=>e.s),__vite__mapDeps([2,1,0])),r(()=>import(`./dist-CX_Hm4GS.js`),__vite__mapDeps([3,0,1,2,4,5])),r(()=>import(`./dist-scBkrwv-.js`),__vite__mapDeps([6,0,1,2])),r(()=>import(`./dist-J6XWqRpB.js`).then(e=>e.d),__vite__mapDeps([5,1,0,2,4])),r(()=>import(`./dist-Cus6_oaF.js`).then(e=>e.n),__vite__mapDeps([4,1])),h?h().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${p}:`,e),null)):Promise.resolve(null),i().catch(e=>(console.warn(`[CodeMirror] Failed to build the blame extension:`,e),null))]);if(a||!x.current)return;l=I,d=R,T.current=_.Annotation.define(),E.current=_.Transaction.addToHistory;let H=n.length<=u&&B!==null;s=new _.Compartment;let U=[v.lineNumbers(),v.highlightActiveLine(),v.drawSelection(),M.history(),v.keymap.of([M.indentWithTab,...M.defaultKeymap,...M.historyKeymap,...P.searchKeymap,{key:`Mod-s`,run:()=>(j.current(),!0)}]),v.EditorView.updateListener.of(e=>{e.docChanged&&!(T.current&&e.transactions.some(e=>e.annotation(T.current)===!0))&&A.current(e.state.doc.toString()),e.selectionSet&&L(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),v.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(y&&U.push(_.EditorState.readOnly.of(!0),v.EditorView.editable.of(!1)),V&&!y&&(c=new _.Compartment,U.splice(1,0,c.of([])),U.push(V.base)),B)try{U.push(B)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${p}:`,e),H=!1}if(H&&s&&l&&d)try{U.push(s.of(l.syntaxHighlighting(m(l,d))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${p}:`,e),H=!1}let W=C.current,G=W?.scope===JSON.stringify([g,e])&&W.state.doc.toString()===n,K=G?W.state.update({effects:_.StateEffect.reconfigure.of(U)}).state:_.EditorState.create({doc:n,extensions:U});if(o=new v.EditorView({state:K,parent:x.current}),G&&(o.scrollDOM.scrollTop=W.top,o.scrollDOM.scrollLeft=W.left),a){o.destroy();return}S.current=o,N(H),F(!0),D.current=V,O.current=c??null,k.current=null,z(e=>e+1);let q=new MutationObserver(()=>{let e=S.current;if(e&&H&&s&&l&&d)try{e.dispatch({effects:s.reconfigure(l.syntaxHighlighting(m(l,d)))})}catch{}});w.current=q,q.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),a||F(!0)}})(),()=>{a=!0,w.current?.disconnect(),w.current=null,o&&(C.current={scope:JSON.stringify([g,e]),state:o.state,top:o.scrollDOM.scrollTop,left:o.scrollDOM.scrollLeft}),o?.destroy(),S.current=null,F(!1),x.current&&(x.current.textContent=``)}},[e,y,b]),(0,c.useEffect)(()=>{let e=S.current;if(!e)return;let t=e.state.doc.toString();t!==n&&e.dispatch({changes:{from:0,to:t.length,insert:n},annotations:T.current?T.current.of(!0):void 0})},[n]),(0,c.useEffect)(()=>{let e=S.current;if(!e||!p)return;let t=e.state.doc.line(Math.min(Math.max(1,p.line),e.state.doc.lines)),n=Math.min(t.to,t.from+(p.column??1)-1);e.dispatch({selection:{anchor:t.to,head:n},scrollIntoView:!0}),e.focus()},[p,P]);let B=!!(_&&_.state===`ready`&&_.response&&_.path===e&&_.workspaceId===g);(0,c.useEffect)(()=>{let t=S.current,n=D.current,r=O.current;if(!t||!n||!r)return;let i=_&&_.state===`ready`&&_.response&&_.path===e&&_.workspaceId===g?_.response:null,a=i?o(i):null;k.current!==a&&(k.current=a,t.dispatch({effects:[n.setBlame.of(a),r.reconfigure(a?n.gutter:[])]}))},[_?.state,_?.response,_?.path,_?.workspaceId,e,g,R]);let V=S.current?.state.doc.toString()??n,H=V.length<=d?V:V.slice(0,d),U=b??f(e),W=a(U),G=S.current?.state,K=G?.selection.main.head,q=K===void 0?void 0:G?.doc.lineAt(K),J=q?.number,Y=K!==void 0&&q?K-q.from+1:void 0;return(0,c.useEffect)(()=>{P&&J!==void 0&&Y!==void 0&&v?.({line:J,column:Y,language:M&&W||`纯文本`,highlight:M?U:`plain`})},[P,J,Y,M,W,U,v]),(0,c.useEffect)(()=>()=>v?.(),[v]),(0,l.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":H,"data-file-content-truncated":V.length>d?`1`:`0`,"data-file-selection":I,"data-file-editor-ready":P?`1`:`0`,"data-file-blame-gutter":B?`1`:void 0,onMouseDown:()=>S.current?.focus(),children:[(0,l.jsx)(`div`,{className:`file-cm`,ref:x,"aria-label":`${y?`查看`:`编辑`} ${e}`}),(!P||!v)&&(0,l.jsxs)(`div`,{className:`file-editor-status`,children:[!P&&(0,l.jsx)(`span`,{"data-file-editor-loading":`1`,children:`正在加载编辑器…`}),P&&K!==void 0&&q&&(0,l.jsxs)(`span`,{children:[`第 `,q.number,` 行,第 `,K-q.from+1,` 列`]}),P&&!M&&(0,l.jsx)(`span`,{"data-file-highlight-status":`plain`,children:`纯文本`}),P&&M&&W&&(0,l.jsx)(`span`,{"data-file-highlight-status":U,children:W})]})]})}export{h as CodeMirrorEditor,m as themeHighlightStyle};