konpeki 0.1.1 → 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.
Files changed (53) hide show
  1. package/AGENTS.md +1 -1
  2. package/CONTRIBUTING.md +36 -0
  3. package/README.md +57 -21
  4. package/SECURITY.md +22 -0
  5. package/SETUP.md +112 -51
  6. package/composition/README.md +42 -52
  7. package/composition/compile.ts +2 -2
  8. package/composition/document.ts +2 -111
  9. package/composition/schema.json +12 -3
  10. package/composition/schema.ts +4 -2
  11. package/composition/types.ts +4 -21
  12. package/composition/validate.ts +3 -461
  13. package/composition/visualizations.ts +0 -16
  14. package/design/themes/README.md +25 -7
  15. package/design/themes/index.ts +15 -4
  16. package/docs/development.md +75 -11
  17. package/docs/workflow.md +60 -11
  18. package/index.html +17 -1
  19. package/package.json +10 -2
  20. package/plugin.json +22 -0
  21. package/public/og.png +0 -0
  22. package/runtime/konpeki.mjs +223 -473
  23. package/skills/konpeki/SKILL.md +186 -0
  24. package/skills/konpeki/assets/blank.json +23 -0
  25. package/skills/konpeki/scripts/ensure-runtime.mjs +69 -0
  26. package/skills/konpeki/scripts/prepare-document.mjs +40 -0
  27. package/slides/introducing-konpeki/PROMPT.md +21 -0
  28. package/slides/introducing-konpeki/README.md +52 -30
  29. package/slides/introducing-konpeki/SOURCE.md +16 -10
  30. package/slides/introducing-konpeki/author.ts +44 -42
  31. package/slides/introducing-konpeki/composition.json +1748 -1743
  32. package/src/app/App.tsx +179 -37
  33. package/src/components/BuildOrb.tsx +40 -0
  34. package/src/components/Canvas.tsx +18 -1
  35. package/src/components/InspectorPanel.tsx +130 -43
  36. package/src/components/LeftPanel.tsx +16 -3
  37. package/src/components/RevisionNotes.tsx +56 -0
  38. package/src/components/WorkspaceChrome.tsx +98 -11
  39. package/src/lib/examples/react-page-migration.json +1 -1
  40. package/src/lib/export-png.ts +4 -1
  41. package/src/lib/file-session.ts +14 -1
  42. package/src/lib/review.ts +26 -0
  43. package/src/lib/storage.ts +38 -10
  44. package/src/lib/use-file-session.ts +49 -13
  45. package/src/main.tsx +3 -0
  46. package/src/styles/base.css +16 -0
  47. package/src/styles/canvas.css +43 -12
  48. package/src/styles/chrome.css +174 -52
  49. package/src/styles/feedback.css +39 -4
  50. package/src/styles/left-panel.css +48 -7
  51. package/src/styles/right-panel.css +90 -47
  52. package/src/styles/shell.css +99 -53
  53. package/.agents/skills/authoring-visuals/SKILL.md +0 -82
@@ -29,13 +29,71 @@ pnpm dev
29
29
  For a production preview, run `pnpm build` then `pnpm preview`. The build produces
30
30
  a static site in `dist` for a root or subdirectory. Use
31
31
  `?example=introducing-konpeki` or `?example=custom-visual` to open a bundled editable
32
- example. Example links do not autosave; open a composition in a file-backed
33
- session to preserve edits.
32
+ example. Each example has an isolated browser-local working copy that survives
33
+ reload. The Browser menu supports JSON import/download, starting blank and
34
+ resetting the example. These actions never replace another example or the normal
35
+ local draft. Invalid stored data remains untouched until an explicit reset.
36
+
37
+ Deploy only the static `dist` output for the public playground, not a file-session
38
+ server. Imported documents stay in that browser; there is no account, cloud sync,
39
+ AI generation or Build/notes handoff in standalone mode. Downloaded JSON can be
40
+ opened in a file-backed session with a coding agent. Browser storage is not a
41
+ backup. Hosting shares bundled examples, not private drafts or an AI service.
42
+ No deployment is automatic. In a remote environment, expose a review server
43
+ through its authenticated preview mechanism, not a loopback address.
44
+
45
+ The source CLI's `preview` chooses the next available port if its default is
46
+ occupied. An explicit `--port <number>` fails rather than silently changing the
47
+ requested port; `--port 0` asks the OS for a free port. `--json` prints one readiness
48
+ record with `type`, `compositionPath` and the exact session-bearing `url` after
49
+ listening. Treat that URL as a capability, not public logging data. This is a
50
+ startup signal, not proof that the browser loaded the right composition.
51
+
52
+ ### GitHub Pages
53
+
54
+ The public playground is hosted at
55
+ [vcfgdev.github.io/konpeki](https://vcfgdev.github.io/konpeki/?example=introducing-konpeki).
56
+ The example query opens the introduction; the root URL opens the ordinary local
57
+ draft. Each visitor's edits stay in their own browser, not in the deployed site.
58
+
59
+ `.github/workflows/pages.yml` deploys only when explicitly dispatched on `main`:
34
60
 
35
- Hosting shares bundled examples, not private drafts, arbitrary documents or an
36
- AI service. No deployment is automatic. In a remote environment, expose the
37
- server through its authenticated preview mechanism; a local address is not a
38
- shareable URL.
61
+ ```sh
62
+ gh workflow run pages.yml --repo vcfgdev/konpeki --ref main
63
+ ```
64
+
65
+ The workflow uses the pinned mise/pnpm toolchain, runs typecheck and tests, builds
66
+ with the Pages base path, and uploads only `dist`. The deployment job publishes
67
+ that artifact to the `github-pages` environment. Repository **Settings → Pages →
68
+ Source** must be **GitHub Actions**. Ordinary pushes run CI but do not redeploy;
69
+ package releases remain separate. Inspect the public example after deployment,
70
+ including reload, fonts, editing, JSON download and Present.
71
+
72
+ Existing example working copies survive deployments. Download any edits before
73
+ choosing **Browser → Reset example** to load a newly published example.
74
+
75
+ ## Skill and plugin packaging
76
+
77
+ `skills/konpeki/` is the canonical portable skill. The repo's
78
+ `.agents/skills/konpeki` symlink enables local discovery without a second
79
+ copy. The root Agent Plugins `plugin.json` and repo marketplace expose the same
80
+ skill to compatible Codex clients; no MCP, hook or hosted AI is involved. Review
81
+ native-client installation separately from the npm smoke test.
82
+
83
+ The skill dispatches `init` (open only) and `generate` (create/revise, including
84
+ implicit setup). These are agent modes, not CLI subcommands. Its portable
85
+ `scripts/prepare-document.mjs` validates through the resolved CLI and exclusively
86
+ creates a blank file, or validates an existing file without rewriting it. The
87
+ bundled `assets/blank.json` matches `initialDraft(true)` in
88
+ `composition/document.ts`; onboarding tests enforce that contract. Keep scripts
89
+ and assets when copying the skill. No TypeScript import from `node_modules` is
90
+ needed, so a copied skill also supports the existing published runtime.
91
+
92
+ Its `scripts/ensure-runtime.mjs` pins the release runtime. It performs
93
+ no installation without `--install`, and never updates project dependencies.
94
+ When preparing a new release, deliberately update its pin and the plugin version
95
+ together with the package version after testing the target runtime. The current
96
+ pin is 0.3.0; local CLI/playground changes do not republish that npm version.
39
97
 
40
98
  ## Implementation reference
41
99
 
@@ -78,7 +136,8 @@ trusted local React source; never use it on untrusted JSX. It rejects unsupporte
78
136
  SVG elements rather than silently flattening them. Review converted typography
79
137
  and geometry in the browser; conversion is not a fidelity guarantee.
80
138
  The bundled `?example=react-page-migration` preview uses the same format.
81
- Example previews do not autosave; use a file-backed session to save edits.
139
+ Its working copy autosaves in that browser. Download JSON or use a file-backed
140
+ session to retain edits outside browser storage.
82
141
 
83
142
  ## Package contents
84
143
 
@@ -103,7 +162,7 @@ rebuilding during publication. Packing locally does not publish anything.
103
162
 
104
163
  ## Tag releases
105
164
 
106
- `.github/workflows/publish.yml` stages releases on bare version tags such as `0.1.1`
165
+ `.github/workflows/publish.yml` stages releases on bare version tags such as `0.2.1`
107
166
  (no `v` prefix). The tag must equal `package.json`'s version.
108
167
  The workflow installs the mise toolchain and frozen dependencies, runs typecheck,
109
168
  tests, build and package checks, then installs a tarball in an isolated directory
@@ -130,11 +189,12 @@ After updating the package version, completing release checks and pushing the
130
189
  release commit, explicitly create and push its matching tag:
131
190
 
132
191
  ```sh
133
- git tag 0.1.1
134
- git push origin 0.1.1
192
+ VERSION=0.2.1
193
+ git tag "$VERSION"
194
+ git push origin "$VERSION"
135
195
  ```
136
196
 
137
- Replace `0.1.1` with the new version. `0.1.0` is already published and cannot be
197
+ Replace `0.2.1` with the version in `package.json`. Published versions cannot be
138
198
  republished. Pushing a matching tag submits the tested package to npm's staging
139
199
  area. After the workflow succeeds, review the release in npmjs.com's **Staged
140
200
  Packages** tab and click **Approve**, completing 2FA to publish it. Alternatively,
@@ -170,6 +230,10 @@ disposable file session. It checks pending requests, agent refresh, failure
170
230
  recovery and reduced motion, and captures the affected states. Add an output
171
231
  directory and `--record` to also record the animation.
172
232
 
233
+ `node scripts/check-notes.mjs` checks page/vector note scopes, draft isolation,
234
+ reload persistence, CLI claim/finish, clarification and cancellation in a disposable
235
+ file-backed browser session. It accepts a screenshot directory as its first argument.
236
+
173
237
  These checks exercise all five component kinds, empty slides, JSON round trips,
174
238
  vector editing/history and fitted line dragging. They capture editor and
175
239
  presentation states at two sizes; inspect the images because assertions alone
package/docs/workflow.md CHANGED
@@ -1,9 +1,16 @@
1
1
  # Canvas workflow
2
2
 
3
- Start with the [quickstart](../README.md#start-in-your-coding-agent) and give your
4
- coding agent a brief in its prompt field. Keep the skill with the project:
5
- copying `SKILL.md` alone does not install Konpeki. Skill discovery varies by
6
- agent; there is no universal `/konpeki` command.
3
+ Start with [Use with your agent](../README.md#use-with-your-agent) and give your
4
+ coding agent a brief in its prompt field. Install the complete skill directory;
5
+ its bootstrap script finds or installs the runtime separately. Skill discovery
6
+ varies by agent: Codex CLI/IDE uses `$konpeki`, while the standalone Claude Code
7
+ skill uses `/konpeki`. Other clients may use skill selection or natural language.
8
+ `init` opens a blank or existing file-backed editor without generating; `generate`
9
+ creates or revises a visual, opens its preview and inspects it, with setup implicit.
10
+ A creation brief without a mode selects generate. Follow-up reviews continue the
11
+ same document without repeating a command. These are skill modes, not terminal
12
+ subcommands. **Build it** is an optional revision handoff, not a required first-run
13
+ step; opening the editor does not start a review listener.
7
14
 
8
15
  ## Documents and exports
9
16
 
@@ -49,13 +56,55 @@ An agent waiting for a person's revision request runs:
49
56
  npm exec --no -- konpeki wait slides/my-visual/composition.json
50
57
  ```
51
58
 
52
- In the file-backed canvas, **Build it** saves the composition and submits the
53
- exact revision, active page and optional selected component. `wait` prints that
54
- machine-readable request and exits. It does not launch or wake an agent itself.
55
- The listening agent must reread the named composition, preserve unrelated human
56
- edits, validate, render and inspect its revision before returning. Browser-local
57
- drafts and hosted examples do not expose **Build it** because no local agent owns
58
- their files.
59
+ In the file-backed canvas, select a component or an inner vector element and
60
+ write a **Revision note** in the left panel's **Notes** tab. With nothing selected, the note targets
61
+ the page. **Add note** saves feedback without starting a build; add notes to several
62
+ targets, then choose **Build it** to submit them together. Numbered canvas pins
63
+ return to their note and selection. Pins and notes never appear in presentations
64
+ or PNG exports. Direct text, geometry and attribute edits still save normally.
65
+
66
+ **Build it** saves the composition and submits its exact revision, selected page,
67
+ component and optional vector-element ID, plus all unresolved notes. Without notes,
68
+ it requests a build from the saved composition and selected scope as before.
69
+ `wait` atomically claims one submitted request, marks it working, prints the
70
+ machine-readable v2 request and exits. It does not launch or wake an agent.
71
+ Until claimed, the canvas asks you to contact your coding agent and offers
72
+ **Copy prompt** for the handoff. “Agent working” means claimed, not a live
73
+ agent heartbeat. Only one request per document can be active. Connection errors
74
+ keep an active request locked until completion or cancellation.
75
+
76
+ The agent must reread the named composition and preserve newer human edits.
77
+ Follow each note's target IDs, not just the active page; never silently retarget
78
+ a deleted element. After validating, rendering and inspecting all requested
79
+ changes, explicitly finish using the ID returned by `wait`:
80
+
81
+ ```sh
82
+ npm exec --no -- konpeki finish slides/my-visual/composition.json <request-id> --message "Updated and checked"
83
+ ```
84
+
85
+ Only this acknowledgement resolves the submitted notes and unlocks editing.
86
+ File changes alone do not complete the request; explicit no-op completion is
87
+ valid when the requested result is already present. If blocked, finish with
88
+ `--status needs-clarification --message "What needs clarification?"` or
89
+ `--status failed --message "What failed"`. Notes stay unresolved for a retry.
90
+ Do not mark a partly applied batch done. **Cancel request** unlocks the editor
91
+ and keeps notes, but cannot stop an agent process; stop that agent before retrying.
92
+
93
+ Feedback is stored next to the document as `composition.json.review.json`, separate
94
+ from artwork and exports. Retain that file with the composition when moving work.
95
+ Browser reloads and preview restarts preserve notes and request status. To inspect
96
+ or recover an already claimed request after an interruption, run:
97
+
98
+ ```sh
99
+ npm exec --no -- konpeki request slides/my-visual/composition.json
100
+ ```
101
+
102
+ Coordinate with the previous worker before resuming; `wait` does not claim an
103
+ already working request a second time. Do not edit the sidecar manually while a
104
+ preview or agent is updating it. Existing v1 temporary requests are not migrated;
105
+ finish them before upgrading, then resubmit if needed. Browser-local drafts and
106
+ hosted examples do not expose revision notes or **Build it** because no local
107
+ agent owns their files.
59
108
 
60
109
  Browser screenshots do not establish PDF/PPTX editability, font embedding or
61
110
  cross-application fidelity. Inspect every requested export separately.
package/index.html CHANGED
@@ -4,10 +4,26 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <meta name="theme-color" content="#ffffff" />
7
+ <link rel="icon" type="image/png" sizes="128x128" href="/src/assets/konpeki-mark.png" />
7
8
  <meta
8
9
  name="description"
9
- content="An editable canvas for agent-made visuals. Create a single explanation or a whole presentation, then revise it together."
10
+ content="Try Konpeki's editable canvas. Edit an example, create a page, export PNG or download editable JSON. No account needed; changes stay in your browser."
10
11
  />
12
+ <meta property="og:type" content="website" />
13
+ <meta property="og:site_name" content="Konpeki" />
14
+ <meta property="og:title" content="Konpeki — Browser playground" />
15
+ <meta property="og:description" content="Try Konpeki's editable canvas. Edit an example, create a page, export PNG or download editable JSON. No account needed; changes stay in your browser." />
16
+ <meta property="og:url" content="https://vcfgdev.github.io/konpeki/?example=introducing-konpeki" />
17
+ <meta property="og:image" content="https://vcfgdev.github.io/konpeki/og.png" />
18
+ <meta property="og:image:type" content="image/png" />
19
+ <meta property="og:image:width" content="1280" />
20
+ <meta property="og:image:height" content="640" />
21
+ <meta property="og:image:alt" content="Konpeki — Create clear visuals with your coding agent. Blue brush mark and editable canvas illustrations." />
22
+ <meta name="twitter:card" content="summary_large_image" />
23
+ <meta name="twitter:title" content="Konpeki — Browser playground" />
24
+ <meta name="twitter:description" content="Try Konpeki's editable canvas. Edit an example, create a page, export PNG or download editable JSON. No account needed; changes stay in your browser." />
25
+ <meta name="twitter:image" content="https://vcfgdev.github.io/konpeki/og.png" />
26
+ <meta name="twitter:image:alt" content="Konpeki — Create clear visuals with your coding agent. Blue brush mark and editable canvas illustrations." />
11
27
  <title>Konpeki</title>
12
28
  </head>
13
29
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "konpeki",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "A shared editable canvas for agent-made visuals",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,13 +20,19 @@
20
20
  "files": [
21
21
  "AGENTS.md",
22
22
  "AUTHORING.md",
23
+ "CONTRIBUTING.md",
24
+ "SECURITY.md",
23
25
  "SETUP.md",
24
26
  "docs/workflow.md",
25
27
  "docs/development.md",
26
- ".agents/skills/authoring-visuals/SKILL.md",
28
+ "plugin.json",
29
+ "skills/konpeki/SKILL.md",
30
+ "skills/konpeki/scripts/*.mjs",
31
+ "skills/konpeki/assets/blank.json",
27
32
  "runtime/konpeki.mjs",
28
33
  "index.html",
29
34
  "vite.config.ts",
35
+ "public/og.png",
30
36
  "src/main.tsx",
31
37
  "src/app/*.tsx",
32
38
  "src/components/*.tsx",
@@ -72,12 +78,14 @@
72
78
  "@nivo/sankey": "0.99.0",
73
79
  "@xmldom/xmldom": "0.9.12",
74
80
  "ajv": "^8.20.0",
81
+ "proper-lockfile": "4.1.2",
75
82
  "react": "19.2.8",
76
83
  "react-dom": "19.2.8",
77
84
  "vite": "^8.3.0"
78
85
  },
79
86
  "devDependencies": {
80
87
  "@types/node": "^24.0.0",
88
+ "@types/proper-lockfile": "4.1.4",
81
89
  "@types/react": "^19.2.18",
82
90
  "@types/react-dom": "^19.2.5",
83
91
  "typescript": "^5.9.3"
package/plugin.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
+ "name": "konpeki",
4
+ "version": "0.3.0",
5
+ "description": "Create editable visuals with your coding agent.",
6
+ "repository": "https://github.com/vcfgdev/konpeki",
7
+ "license": "Apache-2.0",
8
+ "extensions": {
9
+ "com.openai": {
10
+ "interface": {
11
+ "displayName": "Konpeki",
12
+ "shortDescription": "Create editable visuals with your coding agent",
13
+ "category": "Productivity",
14
+ "defaultPrompt": [
15
+ "Use Konpeki to turn these launch notes into a product announcement.",
16
+ "Use Konpeki to create a cover for this article.",
17
+ "Use Konpeki to turn this data into a chart for a presentation."
18
+ ]
19
+ }
20
+ }
21
+ }
22
+ }
package/public/og.png ADDED
Binary file