koboyo 0.1.0 → 0.3.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/README.md +6 -1
- package/assets/editor/assets/IconCornerDownRight-BerbioFY.js +1 -0
- package/assets/editor/assets/IconLink-ze4g4Lrj.js +1 -0
- package/assets/editor/assets/build-pips-q_Fq10ov.js +1 -0
- package/assets/editor/assets/code-panel-BfsykjSz.js +43 -0
- package/assets/editor/assets/flow-layer-B7mlx0G4.js +1 -0
- package/assets/editor/assets/flow-panel-DoK6VIJ4.js +1 -0
- package/assets/editor/assets/flow-start-BKN48uke.js +1 -0
- package/assets/editor/assets/{index-DGJESAlV.css → index-e23lIFZB.css} +1 -1
- package/assets/editor/assets/{index-By5YsjJ8.js → index-mhi0Z6gG.js} +8 -8
- package/assets/editor/assets/slides-panel-hozTMSMk.js +26 -0
- package/assets/editor/assets/tool-catalog-CHq6TJ2q.js +1 -0
- package/assets/editor/assets/{tool-drawer-GdbF-XpT.js → tool-drawer-DEEqsKSN.js} +1 -1
- package/assets/editor/assets/tree-BbSzMkPL.js +1 -0
- package/assets/editor/assets/use-drag-reorder-CTTvTwza.js +1 -0
- package/assets/editor/assets/use-key-held-38H1v73f.js +1 -0
- package/assets/editor/index.html +7 -7
- package/dist/koboyo.js +287 -229
- package/package.json +5 -5
- package/skills/koboyo/SKILL.md +33 -1
- package/skills/koboyo/references/architecture.md +4 -4
- package/skills/koboyo/references/bpmn.md +1 -1
- package/skills/koboyo/references/chart.md +1 -1
- package/skills/koboyo/references/cycle.md +1 -1
- package/skills/koboyo/references/erd.md +1 -1
- package/skills/koboyo/references/flowchart.md +1 -1
- package/skills/koboyo/references/funnel.md +1 -1
- package/skills/koboyo/references/gantt.md +1 -1
- package/skills/koboyo/references/gitgraph.md +1 -1
- package/skills/koboyo/references/journey.md +1 -1
- package/skills/koboyo/references/matrix.md +1 -1
- package/skills/koboyo/references/mindmap.md +2 -2
- package/skills/koboyo/references/orgchart.md +1 -1
- package/skills/koboyo/references/pyramid.md +1 -1
- package/skills/koboyo/references/sankey.md +1 -1
- package/skills/koboyo/references/sequence.md +1 -1
- package/skills/koboyo/references/statemachine.md +1 -1
- package/skills/koboyo/references/timeline.md +1 -1
- package/skills/koboyo/references/venn.md +1 -1
- package/skills/koboyo/references/wireframe.md +1 -1
- package/assets/editor/assets/IconArrowBackUp-Brd2WpCh.js +0 -1
- package/assets/editor/assets/IconNote-C0uYQWp-.js +0 -1
- package/assets/editor/assets/build-pips-CIaHaEPB.js +0 -1
- package/assets/editor/assets/code-panel-CVIEtmj2.js +0 -43
- package/assets/editor/assets/flow-layer-CGYUYmni.js +0 -1
- package/assets/editor/assets/flow-panel-BNLlwdYm.js +0 -1
- package/assets/editor/assets/flow-start-ccYJ2KB9.js +0 -1
- package/assets/editor/assets/slides-panel-DV-zQJhV.js +0 -26
- package/assets/editor/assets/tool-catalog-DOYGpvRD.js +0 -1
- package/assets/editor/assets/tree-BSe8fgqT.js +0 -1
- package/assets/editor/assets/use-drag-reorder-C3h4ZMoZ.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koboyo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Render Koboyo diagram code to SVG and PNG on your own machine. No account needed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"koboyo",
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"zod": "^4.4.3",
|
|
52
52
|
"@koboyo/agent-tools": "0.0.0",
|
|
53
53
|
"@koboyo/compiler": "0.0.0",
|
|
54
|
-
"@koboyo/headless": "0.0.0",
|
|
55
|
-
"@koboyo/model": "0.0.0",
|
|
56
|
-
"@koboyo/local-editor": "0.0.0",
|
|
57
54
|
"@koboyo/language": "0.0.0",
|
|
58
|
-
"@koboyo/
|
|
55
|
+
"@koboyo/model": "0.0.0",
|
|
56
|
+
"@koboyo/headless": "0.0.0",
|
|
57
|
+
"@koboyo/renderer": "0.0.0",
|
|
58
|
+
"@koboyo/local-editor": "0.0.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "node --import tsx scripts/build.mjs",
|
package/skills/koboyo/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: koboyo
|
|
|
3
3
|
description: "Draw diagrams as code and render them to SVG, PNG or HTML on this machine with the koboyo CLI: architecture and dependency maps, flowcharts, sequence diagrams, ERDs and class diagrams, state machines, mind maps, gantt charts, timelines and more. Use when the user asks to draw, diagram, visualize, map or explain a system, a codebase, a request flow, a data model or a process, or wants a picture for docs or a README; and to let the user edit a diagram by hand in a local editor and read their edits back."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
<!-- Generated by koboyo 0.
|
|
6
|
+
<!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
|
|
7
7
|
|
|
8
8
|
# Koboyo diagrams
|
|
9
9
|
|
|
@@ -48,6 +48,9 @@ without drawing. Add `--json` to any command for one JSON result on stdout.
|
|
|
48
48
|
- A PNG: `-o docs/checkout.png` (`--width` sets its width in pixels).
|
|
49
49
|
- Existing Mermaid: `koboyo render flow.mmd` draws it directly, and
|
|
50
50
|
`koboyo convert flow.mmd` writes flow.kbd to keep working in Koboyo code.
|
|
51
|
+
- Keeping committed pictures current: `koboyo render docs/*.kbd --check` writes nothing
|
|
52
|
+
and exits 1 when an SVG no longer matches its code. Use it in CI, with the same options
|
|
53
|
+
as the render.
|
|
51
54
|
|
|
52
55
|
## Visualize a codebase
|
|
53
56
|
|
|
@@ -100,6 +103,12 @@ To bring the code in line with their edits, apply `changes` to the `.kbd`. Rewri
|
|
|
100
103
|
`.kbd` while the editor is open redraws the board, unless it has hand edits; then the
|
|
101
104
|
editor asks the person which to keep. Never write the `.kby` yourself.
|
|
102
105
|
|
|
106
|
+
When the person would rather sketch than describe, hand them a blank board: open a
|
|
107
|
+
`.kby` that does not exist yet (`koboyo open docs/sketch.kby --wait --json`, or
|
|
108
|
+
`open_editor({ path: "docs/sketch.kby" })`) and it is created empty. A `.kbd` is never
|
|
109
|
+
created empty; write its code first. What they draw comes back the same way, in `changes`
|
|
110
|
+
and the PNG, and stays in the `.kby`.
|
|
111
|
+
|
|
103
112
|
The person can pin comments on the drawing for you ("make this Postgres"). Treat each as a
|
|
104
113
|
request: do it in the `.kbd`, then answer it so they see it was handled, in the editor if
|
|
105
114
|
it is still open:
|
|
@@ -120,6 +129,27 @@ call it again with the same sessionId;
|
|
|
120
129
|
`read_drawing({ path })` reads the board as it is now, without waiting. Both list the open
|
|
121
130
|
comments; `reply_to_comment({ path, commentId, text, resolve })` answers one.
|
|
122
131
|
|
|
132
|
+
The server also draws on boards directly, with the hosted server's board tools taking a
|
|
133
|
+
`path` to a `.kby`: `create_diagram`, `read_canvas`, `draw_shapes`, `update_shapes`,
|
|
134
|
+
`connect_shapes`, `add_flow` and the rest. While the board is open in the editor, the
|
|
135
|
+
person watches each change land.
|
|
136
|
+
|
|
137
|
+
To get the person's feedback on something visual you built — a page, a screen, a chart:
|
|
138
|
+
|
|
139
|
+
1. Take a screenshot with your browser tool and save it in the project.
|
|
140
|
+
2. `add_image({ path: "review.kby", image: "shots/login.png" })` puts it on a board.
|
|
141
|
+
3. Optionally `annotate_image` the spots you want an opinion on, at pixel positions you
|
|
142
|
+
MEASURED (the element's bounding box times the device pixel ratio, or OCR boxes). Never
|
|
143
|
+
guess a position from looking at the picture.
|
|
144
|
+
4. `open_editor({ path: "review.kby", message: "Does the form read clearly?" })`, then
|
|
145
|
+
`wait_for_edits`.
|
|
146
|
+
5. Each comment pinned on the screenshot comes back with `image` { file, x, y }, and each
|
|
147
|
+
box, arrow or scribble they drew over it is in `imageMarks` with its `box` — all in the
|
|
148
|
+
screenshot's own pixels, so you can find the exact element they mean.
|
|
149
|
+
|
|
150
|
+
Drew two or three variants as frames? `offer_choices({ sessionId, question, options })`
|
|
151
|
+
asks the person to pick one; `wait_for_edits` returns it as `chosen`.
|
|
152
|
+
|
|
123
153
|
## MCP tools
|
|
124
154
|
|
|
125
155
|
If a `koboyo` MCP server is connected (`koboyo setup` adds it), its tools do the same work
|
|
@@ -139,6 +169,8 @@ koboyo save docs/architecture.kbd # upload it as a board and print its link
|
|
|
139
169
|
|
|
140
170
|
Saving the same file again updates the same board. `koboyo whoami` shows who is signed
|
|
141
171
|
in and `koboyo logout` signs out. The editor's **Save to cloud** button does the same.
|
|
172
|
+
Where no browser can open (an SSH session), `koboyo login` prints a code instead: tell
|
|
173
|
+
the user to enter it at the address it prints, on any device, and wait for it to finish.
|
|
142
174
|
Saving needs Koboyo Pro; without it the command says how to start a trial. Do not bring
|
|
143
175
|
it up unless the user asks to share.
|
|
144
176
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by koboyo 0.
|
|
1
|
+
<!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
|
|
2
2
|
|
|
3
3
|
# Architecture diagrams
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ _Icons, colours, and layout are the compiler's job; you write the structure._
|
|
|
14
14
|
```koboyo
|
|
15
15
|
title: Image upload service
|
|
16
16
|
|
|
17
|
-
Client [
|
|
17
|
+
Client [monitor]
|
|
18
18
|
API [aws/api-gateway]
|
|
19
19
|
Resize [aws/lambda, green]
|
|
20
20
|
Bucket [aws/simple-storage-service, orange]
|
|
@@ -138,7 +138,7 @@ Oracle, Twitter, RSS -> Ingest -> Warehouse
|
|
|
138
138
|
Nodes may declare their attributes the first time they appear inside an edge:
|
|
139
139
|
|
|
140
140
|
```koboyo
|
|
141
|
-
Backend [server, blue] -> Client [
|
|
141
|
+
Backend [server, blue] -> Client [monitor]
|
|
142
142
|
Backend --> Cache [cylinder, red]: warm
|
|
143
143
|
```
|
|
144
144
|
|
|
@@ -167,7 +167,7 @@ title: Three-tier web app
|
|
|
167
167
|
direction: right
|
|
168
168
|
|
|
169
169
|
group Edge [gray] {
|
|
170
|
-
Browser [
|
|
170
|
+
Browser [app-window]
|
|
171
171
|
CDN [cloud, blue]
|
|
172
172
|
}
|
|
173
173
|
group Application [violet] {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by koboyo 0.
|
|
1
|
+
<!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
|
|
2
2
|
|
|
3
3
|
# Mind maps
|
|
4
4
|
|
|
@@ -91,7 +91,7 @@ central: Machine learning
|
|
|
91
91
|
- Reinforcement [orange, icon: target]
|
|
92
92
|
- Policy
|
|
93
93
|
- Reward
|
|
94
|
-
- Tooling [violet, icon:
|
|
94
|
+
- Tooling [violet, icon: toolbox]
|
|
95
95
|
- Python
|
|
96
96
|
- Notebooks
|
|
97
97
|
```
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{_ as n}from"./selection-overlay-primitives-hWJ1xjF7.js";import{t as r}from"./editable-target-BTLnvKNi.js";import{t as i}from"./createReactComponent-9UsI5fmM.js";var a=e(t(),1),o=`button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="tab"], [role="option"], [role="checkbox"], [role="switch"], [role="radio"]`;function s(e){return e instanceof Element&&e.closest(o)!==null}function c(e,t={}){let{preventDefault:i=!1}=t,[o,c]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{function t(t){t.code===e&&(r(t.target)||s(t.target)||(i&&t.preventDefault(),c(!0)))}function a(t){t.code!==e&&t.key!==`Meta`||c(!1)}window.addEventListener(`keydown`,t),window.addEventListener(`keyup`,a);let o=n(()=>c(!1));return()=>{window.removeEventListener(`keydown`,t),window.removeEventListener(`keyup`,a),o()}},[e,i]),o}var l=i(`outline`,`arrow-back-up`,`ArrowBackUp`,[[`path`,{d:`M9 14l-4 -4l4 -4`,key:`svg-0`}],[`path`,{d:`M5 10h11a4 4 0 1 1 0 8h-1`,key:`svg-1`}]]);export{s as n,c as r,l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`note`,`Note`,[[`path`,{d:`M13 20l7 -7`,key:`svg-0`}],[`path`,{d:`M13 20v-6a1 1 0 0 1 1 -1h6v-7a2 2 0 0 0 -2 -2h-12a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7`,key:`svg-1`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{a as r,o as i}from"./editor-B0tARd79.js";import{Zt as a,cn as o,i as s}from"./slides-D9bnXqtf.js";import{t as c}from"./createReactComponent-9UsI5fmM.js";import{_ as l,f as u,h as d,m as f,n as p,o as m,r as h,v as g}from"./plan-jQm1jDpt.js";import{n as _,r as v}from"./edit-BJ_kibk8.js";var y=c(`outline`,`corner-down-right`,`CornerDownRight`,[[`path`,{d:`M6 6v6a3 3 0 0 0 3 3h10l-4 -4m0 8l4 -4`,key:`svg-0`}]]),b=e(t(),1),x=n(),S=21,C=3;function w(e){let{zoom:t}=e,n=i(e=>e.animateSlideId),c=i(e=>e.shapes),w=i(e=>e.hoveredId),{store:T,history:E,measurement:D}=r(),O=(0,b.useMemo)(()=>{if(n)return s(c).find(e=>e.id===n)},[n,c]),k=(0,b.useMemo)(()=>{if(!O)return[];let e=l(c,O),t=u(c,O),n=h(t),r=t.flatMap((t,r)=>p([t],e).map(e=>({unit:{shapes:e.items.map(e=>e.shape),groupId:e.groupId},rowId:m(e),step:n[r],follows:e.withPrevious}))),i=f(c,O,e).map(e=>({unit:e,rowId:null,step:null,follows:!1})),a=[...r,...i],o=new Map;return a.map(e=>{let t=e.unit.groupId??e.unit.shapes[0].id,n=o.get(t)??0;return o.set(t,n+1),{...e,lane:n}})},[c,O]);if(!O||k.length===0)return null;function A(e,t){let r=T.getState().shapes,i=s(r).find(e=>e.id===n);if(!i)return;let a=l(r,i),o=u(r,i),c=t?v(p(o,a),t):_(o,[e],d(e.shapes[0]));c.length!==0&&(E.beginTransaction(),T.getState().replaceMany(c),E.endTransaction())}function j(e){return{onPointerEnter:()=>T.getState().setHoveredId(e),onPointerLeave:()=>T.getState().setHoveredId(null)}}return(0,x.jsx)(`div`,{"data-testid":`build-pips`,className:`pointer-events-none absolute left-0 top-0`,children:k.map(({unit:e,rowId:n,step:r,follows:i,lane:s})=>{let c=a(e.shapes,D)??o(e.shapes[0],D),l=r!==null,u=e.shapes.some(e=>e.id===w);return(0,x.jsx)(`div`,{className:`absolute`,style:{left:c.x-(C+s*S)/t,top:c.y-C/t},children:(0,x.jsx)(`button`,{type:`button`,"data-testid":l?`build-pip`:`build-pip-add`,"data-follows":l&&i?`true`:void 0,title:l?i?`Plays with click ${r}. Press to remove.`:`Click ${r}. Press to remove.`:`Click to animate this`,style:{transform:`scale(${1/t})`,transformOrigin:`100% 100%`},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),A(e,n)},...j(e.shapes[0].id),className:`pointer-events-auto absolute bottom-0 right-0 flex items-center justify-center rounded-md text-[11px] leading-none tabular-nums ring-1 transition-[opacity,background-color,color] ${l?`h-[18px] min-w-[18px] bg-[var(--chrome-accent)] px-1 text-white ring-[var(--chrome-accent)]`:`h-[15px] w-[15px] bg-[var(--chrome-popup)] text-[var(--chrome-fg-500)] ring-[var(--chrome-ring)] hover:text-[var(--chrome-fg-900)] ${u?`opacity-100`:`opacity-45 hover:opacity-100`}`}`,children:l?i?(0,x.jsx)(y,{size:11,stroke:2.25}):r:`+`})},n??g(e))})})}export{w as BuildPips};
|