decaframe 0.1.0
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/LICENSE +32 -0
- package/README.md +55 -0
- package/dist/archetype.js +1 -0
- package/dist/blocks.css +2822 -0
- package/dist/blocks.js +6 -0
- package/dist/brand.js +1 -0
- package/dist/chart.js +3 -0
- package/dist/chartView.js +1 -0
- package/dist/cli.js +22 -0
- package/dist/colour.js +1 -0
- package/dist/commands.js +1 -0
- package/dist/design.js +1 -0
- package/dist/diagram.js +99 -0
- package/dist/diagramRender.js +1 -0
- package/dist/diagramTheme.js +1 -0
- package/dist/diagramView.js +1 -0
- package/dist/diagramZoom.js +2 -0
- package/dist/export/assets.js +1 -0
- package/dist/export/html.js +6 -0
- package/dist/export/spec.js +1 -0
- package/dist/export/viewer.js +1112 -0
- package/dist/extensions.js +1 -0
- package/dist/figure.js +1 -0
- package/dist/filename.js +1 -0
- package/dist/fit.js +6 -0
- package/dist/fitLoop.js +1 -0
- package/dist/furniture.js +1 -0
- package/dist/icons.js +1 -0
- package/dist/id.js +1 -0
- package/dist/index.js +1 -0
- package/dist/item.js +1 -0
- package/dist/layout.js +1 -0
- package/dist/lint.js +1 -0
- package/dist/markdown.js +32 -0
- package/dist/mcp/browser.js +81 -0
- package/dist/mcp/channel.js +7 -0
- package/dist/mcp/export.js +1 -0
- package/dist/mcp/exportCli.js +11 -0
- package/dist/mcp/fit.js +1 -0
- package/dist/mcp/open.js +1 -0
- package/dist/mcp/openCli.js +1 -0
- package/dist/mcp/read.js +1 -0
- package/dist/mcp/server.js +31 -0
- package/dist/mcp/session.js +2 -0
- package/dist/mcp/stdio.js +2 -0
- package/dist/media.js +1 -0
- package/dist/notes.js +1 -0
- package/dist/page.js +1 -0
- package/dist/placeholder.js +1 -0
- package/dist/present/constants.js +1 -0
- package/dist/prose.js +1 -0
- package/dist/registry.js +1 -0
- package/dist/sizePreview.js +1 -0
- package/dist/slotMarkdown.js +3 -0
- package/dist/table.js +2 -0
- package/dist/template/catalogue.json +1 -0
- package/dist/template/index.js +1 -0
- package/dist/template/look.js +1 -0
- package/dist/text.js +8 -0
- package/dist/theme/atelier.json +1 -0
- package/dist/theme/aurora.json +1 -0
- package/dist/theme/boardroom.json +1 -0
- package/dist/theme/decaframe.json +1 -0
- package/dist/theme/editorial.json +1 -0
- package/dist/theme/emit.js +19 -0
- package/dist/theme/fonts.js +1 -0
- package/dist/theme/foundry.json +1 -0
- package/dist/theme/index.js +1 -0
- package/dist/theme/meadow.json +1 -0
- package/dist/theme/signal.json +1 -0
- package/dist/theme/tokens.json +1 -0
- package/dist/videoPlay.js +1 -0
- package/editor/assets/App-BvOGZ4cc.js +56 -0
- package/editor/assets/PresenterView-Barr5wsl.js +1 -0
- package/editor/assets/Shell-Dvc8Yvly.js +413 -0
- package/editor/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/editor/assets/abnfDiagram-N423BO3Z-DMNuYXhv.js +1 -0
- package/editor/assets/arc-DOR9Dhm9.js +1 -0
- package/editor/assets/architectureDiagram-T3A2C74G-CpcCHDGw.js +36 -0
- package/editor/assets/blockDiagram-VBNYF7ZC-CbCqcHim.js +132 -0
- package/editor/assets/c4Diagram-5PPSVZJV-DouVYESX.js +10 -0
- package/editor/assets/channel-Dt7MgGxB.js +1 -0
- package/editor/assets/chunk-2GRJ4B5K-DCJz-Q3N.js +1 -0
- package/editor/assets/chunk-2Q5K7J3B-D5q9RvV7.js +1 -0
- package/editor/assets/chunk-5RXB4S5H-DnaXL-Vg.js +231 -0
- package/editor/assets/chunk-5VM5RSS4-Dsc890tp.js +15 -0
- package/editor/assets/chunk-6Q2QTUOP-B5F620Er.js +88 -0
- package/editor/assets/chunk-GF5L2VYU-D6F2cocl.js +206 -0
- package/editor/assets/chunk-JWPE2WC7-bRknM2iE.js +1 -0
- package/editor/assets/chunk-KBJHAD2P-DOPClpqF.js +1 -0
- package/editor/assets/chunk-RYQCIY6F-CvMFFqLU.js +1 -0
- package/editor/assets/chunk-XXDRQBXY-1qxA3khf.js +1 -0
- package/editor/assets/classDiagram-JCYQIIEL-DCQKoo1F.js +1 -0
- package/editor/assets/classDiagram-v2-OCEON4UE-DCQKoo1F.js +1 -0
- package/editor/assets/cose-bilkent-JH36ORCC-ClwDXN93.js +1 -0
- package/editor/assets/cynefin-VYW2F7L2-D_3oIqit.js +178 -0
- package/editor/assets/cynefinDiagram-MW4NZA55-5VKykgH3.js +62 -0
- package/editor/assets/cytoscape.esm-BjAbmLdb.js +331 -0
- package/editor/assets/dagre-VZM6K2ZE-DcheWwdS.js +4 -0
- package/editor/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/editor/assets/diagram-7IWD3JNH-BKU8hufg.js +30 -0
- package/editor/assets/diagram-B4RE2ZJO-C6NwNXMM.js +3 -0
- package/editor/assets/diagram-LBJQPF4R-D5l8kaaB.js +24 -0
- package/editor/assets/diagram-Q27KOJAE-B839mp_E.js +24 -0
- package/editor/assets/diagram-UB23O5K3-BEJ8nrHN.js +41 -0
- package/editor/assets/ebnfDiagram-BXEA7PRR-Clexv7zP.js +1 -0
- package/editor/assets/erDiagram-JOGREHBK-CQiS9gcI.js +85 -0
- package/editor/assets/flowDiagram-UKHOOZJN-CKnVd1JX.js +156 -0
- package/editor/assets/ganttDiagram-PKOTCBZU-B2_YsT7P.js +292 -0
- package/editor/assets/gitGraphDiagram-DS77QQ5N-woKMsCpe.js +106 -0
- package/editor/assets/graph-C9eacEi8.js +1 -0
- package/editor/assets/index-CBRsrwap.css +1 -0
- package/editor/assets/index-CnMC8Z9d.js +9167 -0
- package/editor/assets/index-CzJ1nSGZ.js +61 -0
- package/editor/assets/infoDiagram-6WML65LV-DQBHUzYs.js +2 -0
- package/editor/assets/init-Gi6I4Gst.js +1 -0
- package/editor/assets/ishikawaDiagram-WSZJBQD7-B0ECJjey.js +70 -0
- package/editor/assets/journeyDiagram-NVQOT4AX-C6IoE7ds.js +139 -0
- package/editor/assets/kanban-definition-27J2QSJJ-BsRx6-QA.js +89 -0
- package/editor/assets/katex-C5jXJg4s.js +257 -0
- package/editor/assets/layout-DEXfKzaS.js +1 -0
- package/editor/assets/linear-CZdkbpsZ.js +1 -0
- package/editor/assets/map-Czzmt4hB.js +1 -0
- package/editor/assets/mermaid.core-BD7SxJD7.js +314 -0
- package/editor/assets/mindmap-definition-FAOFIHXS-zQTmawZC.js +96 -0
- package/editor/assets/ordinal-Cboi1Yqb.js +1 -0
- package/editor/assets/pegDiagram-VL7TDLO6-DwfoSDjb.js +1 -0
- package/editor/assets/pieDiagram-7S7Q4E2Y-CFju-NFP.js +39 -0
- package/editor/assets/quadrantDiagram-CIZ2JOQS-BD6kYPyE.js +7 -0
- package/editor/assets/railroadDiagram-AXF67PYL-RqQwm-lL.js +1 -0
- package/editor/assets/requirementDiagram-LRYGKXZP-piqHrBVs.js +84 -0
- package/editor/assets/sankeyDiagram-W5VNT64P-CiALLT6P.js +40 -0
- package/editor/assets/sequenceDiagram-SI44F4Z6-CjpaYPxa.js +162 -0
- package/editor/assets/sizeCapture-X5ZJPWSS-DG9i3uEZ.js +1 -0
- package/editor/assets/stateDiagram-OKZ733FA-BgfrUiLR.js +1 -0
- package/editor/assets/stateDiagram-v2-UEYNNEHI-OBUiw3fk.js +1 -0
- package/editor/assets/swimlanes-SLNWSIFB-edAhP15G.js +2 -0
- package/editor/assets/swimlanesDiagram-ULZ7WXOC-BvcKTcG0.js +8 -0
- package/editor/assets/timeline-definition-Z64GVDOM-CLCag48V.js +120 -0
- package/editor/assets/vennDiagram-T6HMQDX7-CNuGpJHG.js +34 -0
- package/editor/assets/wardleyDiagram-T6FBY63Y-D-NVpbtn.js +78 -0
- package/editor/assets/xychartDiagram-ELKLHX3M-CmO8305Y.js +7 -0
- package/editor/favicon.ico +0 -0
- package/editor/index.html +15 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
decaframe Licence
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 decaframe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This is proprietary software. It is licensed, not sold.
|
|
6
|
+
|
|
7
|
+
1. Grant. Subject to these terms, you may install and use the decaframe package as
|
|
8
|
+
distributed through the npm registry, including the command it provides and the editor
|
|
9
|
+
and browser it ships with, to create, edit and export documents for your own purposes,
|
|
10
|
+
including commercial ones.
|
|
11
|
+
|
|
12
|
+
2. Restrictions. You may not copy, modify, adapt, translate, reverse engineer, decompile,
|
|
13
|
+
disassemble or create derivative works of the software or any part of it; redistribute,
|
|
14
|
+
sublicense, rent, lease or lend it; or use it to build a competing product or service. The
|
|
15
|
+
software carries no source code, and no licence to any is granted.
|
|
16
|
+
|
|
17
|
+
3. Your documents are yours. Nothing here claims any right in the content you author or
|
|
18
|
+
export with the software.
|
|
19
|
+
|
|
20
|
+
4. Third-party components. The software includes open-source components under their own
|
|
21
|
+
licences, whose notices travel with it, and a Chromium-based browser licensed under the
|
|
22
|
+
terms distributed beside it. Those terms govern those components.
|
|
23
|
+
|
|
24
|
+
5. No warranty. The software is provided "as is", without warranty of any kind, express or
|
|
25
|
+
implied, including merchantability, fitness for a particular purpose and non-infringement.
|
|
26
|
+
To the fullest extent permitted by law, decaframe is not liable for any damages arising
|
|
27
|
+
from its use.
|
|
28
|
+
|
|
29
|
+
6. Termination. This licence ends automatically if you breach it. On termination you must
|
|
30
|
+
stop using the software and delete every copy.
|
|
31
|
+
|
|
32
|
+
For any other use, contact decaframe.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# decaframe
|
|
2
|
+
|
|
3
|
+
Agents author. Humans edit. The frame lints.
|
|
4
|
+
|
|
5
|
+
`decaframe` is an MCP server that lets a coding agent write presentations, reports and one-pagers
|
|
6
|
+
as visual documents, a WYSIWYG editor a person opens on the same file, and an export to one HTML
|
|
7
|
+
file that opens anywhere.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g decaframe
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Node 22 or later. The headless browser the export renders with is downloaded once, in the background, the
|
|
16
|
+
first time `deca` runs, about 100 MB from Playwright's own servers. Until it lands, an export says so.
|
|
17
|
+
|
|
18
|
+
## Connect an agent
|
|
19
|
+
|
|
20
|
+
Add the server to your client. For Claude Code, Cursor, Windsurf and most others the entry is:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{ "mcpServers": { "decaframe": { "command": "npx", "args": ["-y", "decaframe", "mcp"] } } }
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then ask for a deck. The document is written to `document.json` in the folder the agent works in;
|
|
27
|
+
set `DECAFRAME_DOC` to put it elsewhere.
|
|
28
|
+
|
|
29
|
+
The skill that teaches an agent to design with the tools installs into every agent on the machine:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx skills add decaframe/decaframe
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Open a document yourself
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
deca open document.json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Serves the editor on a free port and opens it in a window. An agent and the editor may hold the
|
|
42
|
+
same file at once: what either saves, the other sees.
|
|
43
|
+
|
|
44
|
+
## Export
|
|
45
|
+
|
|
46
|
+
Ask the agent for `export_html`, or from the editor's menu. The file expects the internet for its
|
|
47
|
+
fonts, pictures and video, and degrades gracefully without it.
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
https://github.com/decaframe/decaframe
|
|
52
|
+
|
|
53
|
+
## Licence
|
|
54
|
+
|
|
55
|
+
Commercial. See LICENSE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{carryDesign as w}from"./design.js";import{mintId as T}from"./id.js";import{PROSE_FIELDS as _}from"./prose.js";import{TABLE_FIELDS as b}from"./table.js";import{SERIES_FIELDS as B}from"./chart.js";import{DIAGRAM_FIELDS as N}from"./diagram.js";import{slotContent as z,slotText as A}from"./text.js";const u={item:[["meta","itemMeta"],["title","itemTitle"],["body","itemBody"]],stat:[["label","statLabel"],["value","statValue"],["note","statNote"]],mediaItem:[["caption","mediaCaption"],["title","mediaTitle"],["body","mediaBody"]]},h={item:["icon","emphasis"],stat:[],mediaItem:["src","alt","focusX","focusY","zoom"]},R={item:[],stat:["value"],mediaItem:["src"]},C=t=>t==="items"||t==="stats"||t==="media",M={items:"item",stats:"stat",media:"mediaItem"},L=t=>M[t]??"item",O={items:"items",stats:"stats",media:"media",prose:"content",table:"table",chart:"chart",diagram:"diagram"},J=t=>O[t]??"items",P=t=>{if(t==="prose")return _;if(t==="table")return b;if(t==="chart")return B;if(t==="diagram")return N;if(!C(t))return[];const e=L(t);return["id",...(u[e]??u.item).map(([o])=>o),...h[e]??[]]},Z=(t,e)=>(u[t]??u.item).find(([,o])=>o===e)?.[0],Y=t=>C(t)?R[L(t)]??[]:[],W=t=>C(t)?(u[L(t)]??u.item).map(([e])=>e):[],v=t=>typeof t!="string"||t.trim()==="",$=(t,e)=>{const o=e,r=W(t);return!r.length||Y(t).some(f=>!v(o[f]))?!1:r.every(f=>v(o[f]))};function tt(t){const e=t.firstChild?.type.name??"item",o=u[e]??u.item,r=h[e]??[],f=[];return t.forEach(i=>{const m={id:i.attrs.id};i.forEach(s=>{const l=o.find(([,p])=>p===s.type.name);l&&(m[l[0]]=A(s))});for(const s of r)i.attrs[s]!=null&&(m[s]=i.attrs[s]);f.push(m)}),f}const K=(t,e,o)=>t.nodes[e].create(null,z(t,o,e));function y(t,e,o,r){const f=u[e]??u.item,i=o,m=f.filter(([p])=>typeof i[p]=="string").map(([p,x])=>K(t,x,i[p])),s=h[e]??[],l={id:i.id??T(e),...w(r?.attrs,s)};for(const p of s)l[p]=i[p]??null;return t.nodes[e].createChecked(l,m)}function et(t,e,o){try{for(const r of o)y(t,e,r);return!0}catch{return!1}}function nt(t,e,o){return o.map(r=>y(t,e,r))}function q(t,e,o,r,f,i){const m=u[i]??u.item,s=f;for(const[d,g]of m){const n=typeof s[d]=="string",a=r.content.content.some(c=>c.type.name===g);if(n!==a)return!1}const l=h[i]??[];if(l.some(d=>(s[d]??null)!==(r.attrs[d]??null)&&s[d]!==void 0)){const d={...r.attrs};for(const g of l)s[g]!==void 0&&(d[g]=s[g]??null);t.setNodeMarkup(t.mapping.slice(e).map(o),void 0,d)}const x=[];let I=o+1;r.forEach(d=>{x.push([d,I]),I+=d.nodeSize});for(let d=x.length-1;d>=0;d--){const[g,n]=x[d],a=m.find(([,D])=>D===g.type.name);if(!a)continue;const c=s[a[0]];if(typeof c!="string"||c===A(g))continue;const E=t.mapping.slice(e),F=E.map(n+1),S=E.map(n+g.nodeSize-1);t.replaceWith(F,S,z(t.doc.type.schema,c,g.type.name))}return!0}function ot(t,e,o){const r=t.doc.nodeAt(e);if(!r)return;const f=t.steps.length,i=r.firstChild?.type.name??"item",m=t.doc.type.schema,s=new Map;let l=e+1;r.forEach((n,a,c)=>{n.attrs.id&&s.set(n.attrs.id,{node:n,pos:l,index:c}),l+=n.nodeSize});const p=o.map(n=>n.id?s.get(n.id)?.index:void 0).filter(n=>n!==void 0),x=p.every((n,a)=>a===0||n>p[a-1]),I=p.length===0;if(!x||I){const n=o.map(a=>{const c=a.id?s.get(a.id):void 0;return c?G(c.node,a,i)?c.node:y(m,i,a,c.node):y(m,i,a)});t.replaceWith(e+1,e+r.content.size+1,n);return}const d=new Set(o.map(n=>n.id).filter(Boolean)),g=[...s.values()].filter(n=>!d.has(n.node.attrs.id));for(const n of g.sort((a,c)=>c.pos-a.pos))t.delete(n.pos,n.pos+n.node.nodeSize);for(let n=0;n<o.length;n++){const a=o[n],c=a.id?s.get(a.id):void 0;if(c){if(!q(t,f,c.pos,c.node,a,i)){const S=t.mapping.slice(f).map(c.pos),D=t.mapping.slice(f).map(c.pos+c.node.nodeSize);t.replaceWith(S,D,y(m,i,a,c.node))}continue}const E=o.slice(n+1).map(S=>S.id?s.get(S.id):void 0).find(Boolean),F=E?t.mapping.slice(f).map(E.pos):t.mapping.slice(f).map(e+r.content.size+1);t.insert(F,y(m,i,a))}}function G(t,e,o){const r=u[o]??u.item,f=e;for(const[i,m]of r){const s=t.content.content.find(p=>p.type.name===m),l=f[i];if(l===void 0){if(s)return!1;continue}if(!s||A(s)!==l)return!1}for(const i of h[o]??[])if(f[i]!==void 0&&(f[i]??null)!==(t.attrs[i]??null))return!1;return!0}export{ot as applyEntries,y as childFor,L as childTypeFor,nt as childrenFor,et as entriesBuildable,tt as entriesOf,$ as entryDrawsNothing,Z as fieldForSlotNode,P as fieldsFor,C as isEntryArchetype,J as payloadKeyFor,Y as requiredFor,W as textSlotsFor};
|