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.
- package/AGENTS.md +1 -1
- package/CONTRIBUTING.md +36 -0
- package/README.md +57 -21
- package/SECURITY.md +22 -0
- package/SETUP.md +112 -51
- package/composition/README.md +42 -52
- package/composition/compile.ts +2 -2
- package/composition/document.ts +2 -111
- package/composition/schema.json +12 -3
- package/composition/schema.ts +4 -2
- package/composition/types.ts +4 -21
- package/composition/validate.ts +3 -461
- package/composition/visualizations.ts +0 -16
- package/design/themes/README.md +25 -7
- package/design/themes/index.ts +15 -4
- package/docs/development.md +75 -11
- package/docs/workflow.md +60 -11
- package/index.html +17 -1
- package/package.json +10 -2
- package/plugin.json +22 -0
- package/public/og.png +0 -0
- package/runtime/konpeki.mjs +223 -473
- package/skills/konpeki/SKILL.md +186 -0
- package/skills/konpeki/assets/blank.json +23 -0
- package/skills/konpeki/scripts/ensure-runtime.mjs +69 -0
- package/skills/konpeki/scripts/prepare-document.mjs +40 -0
- package/slides/introducing-konpeki/PROMPT.md +21 -0
- package/slides/introducing-konpeki/README.md +52 -30
- package/slides/introducing-konpeki/SOURCE.md +16 -10
- package/slides/introducing-konpeki/author.ts +44 -42
- package/slides/introducing-konpeki/composition.json +1748 -1743
- package/src/app/App.tsx +179 -37
- package/src/components/BuildOrb.tsx +40 -0
- package/src/components/Canvas.tsx +18 -1
- package/src/components/InspectorPanel.tsx +130 -43
- package/src/components/LeftPanel.tsx +16 -3
- package/src/components/RevisionNotes.tsx +56 -0
- package/src/components/WorkspaceChrome.tsx +98 -11
- package/src/lib/examples/react-page-migration.json +1 -1
- package/src/lib/export-png.ts +4 -1
- package/src/lib/file-session.ts +14 -1
- package/src/lib/review.ts +26 -0
- package/src/lib/storage.ts +38 -10
- package/src/lib/use-file-session.ts +49 -13
- package/src/main.tsx +3 -0
- package/src/styles/base.css +16 -0
- package/src/styles/canvas.css +43 -12
- package/src/styles/chrome.css +174 -52
- package/src/styles/feedback.css +39 -4
- package/src/styles/left-panel.css +48 -7
- package/src/styles/right-panel.css +90 -47
- package/src/styles/shell.css +99 -53
- package/.agents/skills/authoring-visuals/SKILL.md +0 -82
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ presents that same document.
|
|
|
7
7
|
## Choose the relevant guide
|
|
8
8
|
|
|
9
9
|
- First-time setup: [SETUP.md](SETUP.md).
|
|
10
|
-
-
|
|
10
|
+
- Opening the editor, creating or revising visuals: [Konpeki skill](skills/konpeki/SKILL.md)
|
|
11
11
|
and [AUTHORING.md](AUTHORING.md), which owns design and factual-fidelity rules.
|
|
12
12
|
- Changing the application: [development guidance](docs/development.md) and
|
|
13
13
|
the [composition contract](composition/README.md).
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Contributing to Konpeki
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve Konpeki. Bug reports, focused fixes and additions that
|
|
4
|
+
strengthen the shared human-agent canvas are welcome.
|
|
5
|
+
|
|
6
|
+
## Before opening a change
|
|
7
|
+
|
|
8
|
+
- Search existing issues before filing a new one.
|
|
9
|
+
- Use an issue to discuss large features or changes to the composition contract
|
|
10
|
+
before investing in an implementation.
|
|
11
|
+
- Do not include private compositions, credentials or proprietary source material
|
|
12
|
+
in issues, fixtures or screenshots.
|
|
13
|
+
- Report security concerns through the process in [SECURITY.md](SECURITY.md), not
|
|
14
|
+
through a public issue.
|
|
15
|
+
|
|
16
|
+
## Development
|
|
17
|
+
|
|
18
|
+
Follow [docs/development.md](docs/development.md) to install the pinned Node.js and
|
|
19
|
+
pnpm toolchain. Keep changes scoped and preserve existing composition compatibility
|
|
20
|
+
unless a contract change has been agreed in advance.
|
|
21
|
+
|
|
22
|
+
Before opening a pull request, run:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
mise exec -- pnpm check
|
|
26
|
+
mise exec -- pnpm test
|
|
27
|
+
mise exec -- pnpm build
|
|
28
|
+
mise exec -- pnpm check:package
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
UI changes also require visual inspection using the relevant browser checks in
|
|
32
|
+
[docs/development.md](docs/development.md#verification). Include the affected
|
|
33
|
+
states and verification performed in the pull request description.
|
|
34
|
+
|
|
35
|
+
By submitting a contribution, you agree that it is licensed under the repository's
|
|
36
|
+
[Apache-2.0 license](LICENSE).
|
package/README.md
CHANGED
|
@@ -1,53 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
|
|
3
|
+
**Create clear visuals with your coding agent.** Konpeki is an opinionated design
|
|
4
|
+
framework for covers, social graphics, visual explanations and presentations.
|
|
5
5
|
|
|
6
6
|
Give your coding agent notes, source material and a brief. Konpeki provides the
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
canvas, design guidance, typography and semantic components for the intended
|
|
8
|
+
format and dimensions.
|
|
9
9
|
|
|
10
10
|
People and agents edit the same composition. Export a page as PNG, download its
|
|
11
11
|
editable JSON, or use **Present** for a chrome-free presentation.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Use with your agent
|
|
14
14
|
|
|
15
15
|
Requires **Node.js 24+**, npm, a coding agent that can edit files and run commands,
|
|
16
16
|
and a browser.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
Install the [Konpeki skill](skills/konpeki/) with your agent's
|
|
19
|
+
skill installer. Install the whole directory, including `scripts/` and `assets/`, not just
|
|
20
|
+
`SKILL.md`. For example, ask a Codex skill installer:
|
|
20
21
|
|
|
21
22
|
```text
|
|
22
|
-
|
|
23
|
-
and set up Konpeki in this workspace.
|
|
24
|
-
Turn these notes into a three-slide explanation for engineers. Make the request
|
|
25
|
-
flow and failure handling easy to follow. Preserve facts and caveats. Save editable composition
|
|
26
|
-
JSON, open the preview, then render, inspect and fix the result.
|
|
27
|
-
|
|
28
|
-
[Paste notes or provide source files.]
|
|
23
|
+
Install the konpeki skill from vcfgdev/konpeki, at skills/konpeki.
|
|
29
24
|
```
|
|
30
25
|
|
|
26
|
+
Then choose a mode, or just give it a brief:
|
|
27
|
+
|
|
28
|
+
| Workflow | Codex CLI / IDE | Claude Code standalone skill |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| Open a blank or existing editor; no generation | `$konpeki init` | `/konpeki init` |
|
|
31
|
+
| Create, inspect and revise a visual | `$konpeki generate …` | `/konpeki generate …` |
|
|
32
|
+
|
|
33
|
+
`init` accepts a composition JSON path and preserves existing work. `generate`
|
|
34
|
+
uses the materials already in your conversation and prepares the runtime if
|
|
35
|
+
needed; there is no required init step. Plugin installations may namespace the
|
|
36
|
+
skill. Other hosts can select the skill or use natural language:
|
|
37
|
+
|
|
38
|
+
> Use Konpeki to turn these launch notes into a product announcement.
|
|
39
|
+
|
|
40
|
+
Or ask for an article cover, a social graphic, a chart, a diagram or a presentation.
|
|
41
|
+
Natural-language creation requests select `generate` automatically.
|
|
42
|
+
The skill reuses a compatible runtime or, with permission, installs the pinned
|
|
43
|
+
npm release in a user cache. It creates editable JSON in your workspace, opens
|
|
44
|
+
the preview and visually checks the result. You do not need to clone Konpeki,
|
|
45
|
+
edit a package manifest, or repeat your prompt in a blank canvas.
|
|
46
|
+
|
|
47
|
+
First-run installation, browser permissions and remote preview forwarding depend
|
|
48
|
+
on your agent host. If skills are unavailable, give the agent the public
|
|
49
|
+
[SETUP.md](https://raw.githubusercontent.com/vcfgdev/konpeki/main/SETUP.md) URL and
|
|
50
|
+
your brief together. The setup guide also covers the optional Codex plugin package.
|
|
51
|
+
|
|
31
52
|
Ask for revisions in the same conversation. Add “Stop after the outline for
|
|
32
53
|
approval” when you want a checkpoint. Supply a visual direction or leave it open;
|
|
33
54
|
[authoring modes](AUTHORING.md#authoring-mode) provide defaults without requiring
|
|
34
55
|
you to choose fonts, colors or layouts first.
|
|
35
56
|
|
|
36
|
-
|
|
37
|
-
|
|
57
|
+
Canvas review notes use **Build it** and an active agent listener, or the
|
|
58
|
+
button's copyable handoff to resume the agent. Opening the editor alone does not
|
|
59
|
+
connect or wake an agent. The skill modes are not terminal CLI subcommands.
|
|
60
|
+
|
|
61
|
+
## Try the editor in your browser
|
|
62
|
+
|
|
63
|
+
[Open the editable Konpeki example](https://vcfgdev.github.io/konpeki/?example=introducing-konpeki).
|
|
64
|
+
|
|
65
|
+
The browser-only playground lets you edit an example or start blank, keep a local
|
|
66
|
+
working copy, import/download editable JSON, export PNG and present. It requires
|
|
67
|
+
no account or AI service. Browser-local data is not cloud backup; download JSON
|
|
68
|
+
to keep or move your work. Continue with your coding agent using that file.
|
|
69
|
+
|
|
70
|
+
The [GitHub Pages playground](docs/development.md#github-pages) does not connect
|
|
71
|
+
to an agent or expose **Build it**. The agent-led workflow above is the route
|
|
72
|
+
from a prompt to a finished visual.
|
|
38
73
|
|
|
39
|
-
##
|
|
74
|
+
## Manual npm start
|
|
40
75
|
|
|
41
76
|
For a manual start, install [Konpeki from npm](https://www.npmjs.com/package/konpeki)
|
|
42
77
|
in your workspace (run `npm init -y` first in a new, empty directory):
|
|
43
78
|
|
|
44
79
|
```sh
|
|
45
|
-
npm install --save-dev konpeki@
|
|
46
|
-
|
|
80
|
+
npm install --save-dev konpeki@latest
|
|
81
|
+
curl -fL https://raw.githubusercontent.com/vcfgdev/konpeki/main/slides/introducing-konpeki/composition.json -o introduction.json
|
|
47
82
|
npm exec --no -- konpeki preview introduction.json
|
|
48
83
|
```
|
|
49
84
|
|
|
50
|
-
Open the exact URL printed by `preview`. Browser edits save to your
|
|
85
|
+
Open the exact URL printed by `preview`. Browser edits save to your downloaded file;
|
|
51
86
|
valid agent edits appear on the same canvas. In a remote environment, use its
|
|
52
87
|
authenticated preview mechanism rather than sharing a local address.
|
|
53
88
|
|
|
@@ -60,6 +95,7 @@ authenticated preview mechanism rather than sharing a local address.
|
|
|
60
95
|
- [Canvas workflow](docs/workflow.md): page sizes, export and agent handoff.
|
|
61
96
|
- [Development](docs/development.md): architecture, demo hosting, packaging and checks.
|
|
62
97
|
- [Composition contract](composition/README.md) and [design resources](design/README.md).
|
|
98
|
+
- [Contributing](CONTRIBUTING.md) and [security policy](SECURITY.md).
|
|
63
99
|
|
|
64
100
|
Konpeki requires no account or hosted AI service. Your coding agent's pricing
|
|
65
101
|
and data handling still apply. Supply facts and approved assets; examples and
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
Konpeki is early-stage software. Security fixes are made against the latest npm
|
|
6
|
+
release and the `main` branch; older releases are not maintained separately.
|
|
7
|
+
|
|
8
|
+
## Reporting a vulnerability
|
|
9
|
+
|
|
10
|
+
Do not disclose a suspected vulnerability in a public issue. Use GitHub's
|
|
11
|
+
**Security → Report a vulnerability** flow to send the maintainers a private
|
|
12
|
+
report. Include the affected version, reproduction steps, impact and any suggested
|
|
13
|
+
mitigation. Please avoid accessing data that is not yours while investigating.
|
|
14
|
+
|
|
15
|
+
The maintainers will acknowledge the report, assess its impact and coordinate a
|
|
16
|
+
fix and disclosure. If private vulnerability reporting is unavailable, open an
|
|
17
|
+
issue containing no sensitive details and ask the maintainers for a private
|
|
18
|
+
reporting channel.
|
|
19
|
+
|
|
20
|
+
Konpeki's file-backed preview uses a session URL as a local authorization secret.
|
|
21
|
+
Do not publish that URL or its token, and expose remote previews only through an
|
|
22
|
+
authenticated tunnel or workspace portal.
|
package/SETUP.md
CHANGED
|
@@ -1,79 +1,133 @@
|
|
|
1
1
|
# Set up Konpeki for your coding agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install the `konpeki` skill once, then give your agent a creation brief:
|
|
4
4
|
|
|
5
5
|
```text
|
|
6
|
-
|
|
7
|
-
Use it to explain [source] to [audience], with the takeaway [idea].
|
|
8
|
-
Create [one visual / a short presentation]. Open the editable preview,
|
|
9
|
-
then render, inspect and fix the result.
|
|
6
|
+
Use Konpeki to turn these launch notes into a product announcement.
|
|
10
7
|
```
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
and
|
|
15
|
-
agent
|
|
9
|
+
Opening and inspecting the editable preview is part of the skill, not an extra
|
|
10
|
+
instruction the person has to remember. Covers, social graphics, charts,
|
|
11
|
+
diagrams and presentations use the same workflow. Keep the brief and revisions
|
|
12
|
+
in agent chat; the browser edits, reviews, presents and exports the document.
|
|
13
|
+
Konpeki supplies no hosted AI service or additional model subscription.
|
|
16
14
|
|
|
17
|
-
## 1.
|
|
15
|
+
## 1. Install the skill or plugin
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
Use the host's skill installer to install the complete
|
|
18
|
+
[`skills/konpeki`](skills/konpeki/) directory from
|
|
19
|
+
`vcfgdev/konpeki`. Keep its `scripts/` and `assets/` directories. In Codex, ask the skill installer:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Install the konpeki skill from vcfgdev/konpeki, at skills/konpeki.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Other agents may use another installer or skill location. Follow their documented
|
|
26
|
+
mechanism; there is no universal slash command. If a host does not discover skills,
|
|
27
|
+
read the installed `SKILL.md` directly. Do not overwrite existing agent guidance.
|
|
28
|
+
|
|
29
|
+
If you previously installed `authoring-visuals`, replace that installed skill
|
|
30
|
+
with `konpeki` rather than keeping both copies. The runtime package is unchanged.
|
|
31
|
+
|
|
32
|
+
### Choose init or generate
|
|
33
|
+
|
|
34
|
+
| Mode | Codex CLI / IDE | Claude Code standalone skill |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| Open the editor without generating | `$konpeki init [composition.json]` | `/konpeki init [composition.json]` |
|
|
37
|
+
| Create or revise from your materials | `$konpeki generate [brief]` | `/konpeki generate [brief]` |
|
|
38
|
+
|
|
39
|
+
`generate` automatically prepares the runtime when needed. It uses materials
|
|
40
|
+
already supplied in chat, referenced files and the current canvas; it does not
|
|
41
|
+
require `init` first or a repeated brief. Natural-language “Use Konpeki to…”
|
|
42
|
+
creation requests also select generate. Follow-up feedback continues the same
|
|
43
|
+
document without another command. Other GUIs may use skill selection, and plugin
|
|
44
|
+
installations may namespace the skill. These modes are not terminal subcommands.
|
|
45
|
+
|
|
46
|
+
For `init`, choose the supplied path or the document already active in the
|
|
47
|
+
conversation; otherwise use `slides/untitled/composition.json`. After resolving
|
|
48
|
+
the runtime below, run:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
node "<installed-skill>/scripts/prepare-document.mjs" "<cli>" "<composition.json>"
|
|
52
|
+
node "<cli>" preview "<composition.json>"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The helper validates existing files without rewriting them. For a missing file,
|
|
56
|
+
it validates and writes the bundled blank document without overwriting a file
|
|
57
|
+
created concurrently. Invalid data is preserved, not replaced with a sample.
|
|
58
|
+
Reuse an already running preview for the same file. Open and verify its exact
|
|
59
|
+
session URL as described below, then stop: init does not generate or start a
|
|
60
|
+
review listener. The starter works with the pinned published runtime; it does
|
|
61
|
+
not import TypeScript from `node_modules` or require an unreleased `init` CLI.
|
|
62
|
+
|
|
63
|
+
### Optional Codex plugin packaging
|
|
64
|
+
|
|
65
|
+
The root `plugin.json` packages that same skill, without MCP servers, hooks or
|
|
66
|
+
credentials. `.agents/plugins/marketplace.json` exposes it as a repo marketplace.
|
|
67
|
+
On a compatible Codex client, add the repository marketplace with:
|
|
26
68
|
|
|
27
69
|
```sh
|
|
28
|
-
|
|
70
|
+
codex plugin marketplace add vcfgdev/konpeki
|
|
29
71
|
```
|
|
30
72
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
73
|
+
Then install Konpeki from that source in the desktop plugin directory and test it
|
|
74
|
+
in a new conversation. Install either the standalone skill or the plugin, not
|
|
75
|
+
both. This is repository distribution, not a listing in OpenAI's public directory.
|
|
76
|
+
It becomes available from the remote repository after these files are published.
|
|
77
|
+
Native Codex GUI installation needs a separate client smoke test; package checks
|
|
78
|
+
alone do not establish host compatibility.
|
|
37
79
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
80
|
+
## 2. Let the skill prepare the runtime
|
|
81
|
+
|
|
82
|
+
Check Node.js 24+, npm, command/file access and the host's browser capabilities.
|
|
83
|
+
Follow host approval and toolchain rules if prerequisites are missing.
|
|
84
|
+
|
|
85
|
+
From the user's document workspace, run:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
node "<installed-skill>/scripts/ensure-runtime.mjs"
|
|
89
|
+
```
|
|
42
90
|
|
|
43
|
-
|
|
91
|
+
The script reuses a compatible workspace installation, surrounding Konpeki
|
|
92
|
+
checkout, or cached runtime. If none exists, obtain any required host approval
|
|
93
|
+
and rerun with `--install`. It installs the pinned `konpeki@0.3.0` release in a
|
|
94
|
+
user cache, without adding project dependencies or changing project guidance.
|
|
95
|
+
Missing/incompatible runtimes are never reported ready. The script prints JSON
|
|
96
|
+
with `root`, `cli` and `version`; installation diagnostics go to stderr.
|
|
44
97
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
98
|
+
Use the returned absolute `root` for resources and `cli` for commands. Do not rely
|
|
99
|
+
on repo-relative paths from a copied skill. Keep documents outside the runtime.
|
|
100
|
+
For manual project-local npm installation, see [Manual npm start](README.md#manual-npm-start).
|
|
101
|
+
Repository contributors instead use the [mise setup](docs/development.md); users
|
|
102
|
+
of the published package do not need mise.
|
|
49
103
|
|
|
50
|
-
|
|
51
|
-
a faithful result. Do not ask the person to re-enter their intent in the canvas.
|
|
52
|
-
Create a new document without overwriting an example or existing work. By default,
|
|
53
|
-
save it as `slides/<name>/composition.json` with its brief and source notes beside
|
|
54
|
-
it. If the user specifies another destination, pass that file's absolute path to
|
|
55
|
-
the CLI.
|
|
104
|
+
## 3. Generate, validate and open the visual
|
|
56
105
|
|
|
57
|
-
|
|
106
|
+
Follow the installed skill and the runtime's `AUTHORING.md`, composition contract
|
|
107
|
+
and design resources. Use the brief already supplied; ask only for information
|
|
108
|
+
needed for faithful work. Do not ask the person to repeat their prompt in the
|
|
109
|
+
canvas. Continue the current document when revising or following init. Save new
|
|
110
|
+
work to an unused `slides/<name>/composition.json`, with brief/source notes,
|
|
111
|
+
unless the person chooses another destination. Preserve existing documents.
|
|
58
112
|
|
|
59
|
-
For an installation check, validate the bundled
|
|
113
|
+
For an installation check, validate the bundled example:
|
|
60
114
|
|
|
61
115
|
```sh
|
|
62
|
-
|
|
116
|
+
node "<cli>" validate "<root>/slides/introducing-konpeki/composition.json"
|
|
63
117
|
```
|
|
64
118
|
|
|
65
119
|
After authoring the user's document:
|
|
66
120
|
|
|
67
121
|
```sh
|
|
68
|
-
|
|
69
|
-
|
|
122
|
+
node "<cli>" validate "slides/<name>/composition.json"
|
|
123
|
+
node "<cli>" preview "slides/<name>/composition.json"
|
|
70
124
|
```
|
|
71
125
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
126
|
+
Reuse an existing preview for that file when available. Keep the process running
|
|
127
|
+
using the host's supported service mechanism. Open the exact printed session URL
|
|
128
|
+
in the in-app browser when supported, otherwise the regular browser. Preserve its
|
|
129
|
+
query string and never publish its capability token. In remote workspaces, use
|
|
130
|
+
authenticated preview/port forwarding, not a remote loopback address.
|
|
77
131
|
|
|
78
132
|
Verify that the browser loads the intended document, then render, inspect and
|
|
79
133
|
repair the result as directed by the skill. The file-backed canvas saves browser
|
|
@@ -82,5 +136,12 @@ validation succeeds and the intended composition opens—not merely when a serve
|
|
|
82
136
|
process starts. If browser inspection is unavailable, report that limitation.
|
|
83
137
|
|
|
84
138
|
Return the document path, usable preview link and verification outcome. Continue
|
|
85
|
-
revisions in agent chat.
|
|
86
|
-
|
|
139
|
+
revisions in agent chat. For submitted canvas reviews, generate checks `request`,
|
|
140
|
+
claims a `submitted` request with `wait`, applies the notes against the latest
|
|
141
|
+
document, and acknowledges it with `finish` only after validation and inspection.
|
|
142
|
+
Coordinate ownership before resuming an already `working` request.
|
|
143
|
+
|
|
144
|
+
An ongoing listener runs only when explicitly requested and supported by the host.
|
|
145
|
+
Otherwise, use **Copy prompt** after **Build it**, or resume generate in agent chat.
|
|
146
|
+
The [canvas workflow](docs/workflow.md) describes this handoff; the button cannot
|
|
147
|
+
wake an idle agent, and an open preview is not a live agent connection.
|
package/composition/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Composition contract
|
|
2
2
|
|
|
3
|
-
`konpeki-composition/
|
|
3
|
+
`konpeki-composition/v1` describes one or more bounded visual pages
|
|
4
4
|
shared by a person and coding agent. It is a visual intent contract, while the
|
|
5
5
|
Konpeki canvas is its editor and presentation preview. Component rectangles are
|
|
6
6
|
preferences; factual fidelity and readable
|
|
@@ -9,67 +9,44 @@ default is `none`; rules/dividers are separate appearance parameters. Editor
|
|
|
9
9
|
guides never enter the contract. The contract is tool-agnostic: no Konpeki
|
|
10
10
|
package, repository checkout, or separate authoring kit is required.
|
|
11
11
|
|
|
12
|
-
Schema identifiers are immutable compatibility boundaries.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
authoring-kit targets are removed; v3 callouts and comparisons become configured
|
|
17
|
-
Text blocks without changing component IDs, geometry, slots, relationships or
|
|
18
|
-
orders. V5 Evidence becomes Visual; Process and System map become a typed
|
|
19
|
-
Diagram; and the Page-number component becomes a slide setting. V7 makes the
|
|
20
|
-
Headline optional while retaining its singleton and reading-order constraints
|
|
21
|
-
when present. V8 adds standalone Image, Icon and Shape primitives, Pie visuals,
|
|
22
|
-
Text-block logical order and empty slides; v7 Image visuals migrate to Image
|
|
23
|
-
components. V9 adds a first-class Table primitive with content-derived dimensions,
|
|
24
|
-
header placement, grid treatment, density and color scheme. V10 adds optional
|
|
25
|
-
slide-coordinate preferred rectangles to explicit diagram nodes so circular,
|
|
26
|
-
branched and asymmetric topology can preserve authored geometry. V11 merges
|
|
27
|
-
Headline and Footnote into Text-block roles, renames Visual to Chart, moves Icon
|
|
28
|
-
and Shape into Diagram nodes, and renames Diagram `template` to `layout`. Schema
|
|
29
|
-
v12 replaces Diagram's coarse process/system and layout pair with 32 semantic
|
|
30
|
-
grammars adapted from the MIT-licensed Diagram Design taxonomy. The previous six
|
|
31
|
-
layouts become derived implementation engines; all v11 combinations migrate
|
|
32
|
-
deterministically. Diagram owns structural grammars while Chart owns the six
|
|
33
|
-
scale-based historical grammars (bar, line, radar, treemap, scatter and Sankey).
|
|
34
|
-
Pie and Annotated detail are additional Konpeki Chart grammars. V13 lets any of
|
|
35
|
-
the same five semantic components own an optional self-contained SVG interior.
|
|
36
|
-
V14 adds a structured vector interior: lines, shapes, paths and text have stable
|
|
37
|
-
IDs, editable attributes and parent relationships. Legacy SVG remains an opaque
|
|
38
|
-
compatibility fallback. The composition is authoritative for both outer geometry
|
|
39
|
-
and editable vector internals. V15 adds explicit theme bindings to vector styles;
|
|
40
|
-
v14 documents migrate with their literal styles unchanged. Current exports are
|
|
41
|
-
always v18. Consumers must reject unknown future versions rather than interpreting them as v18. The JSON
|
|
42
|
-
Schema `$id` and deterministic compiler version are versioned with this contract.
|
|
12
|
+
Schema identifiers are immutable compatibility boundaries. This is the first
|
|
13
|
+
public contract, so current exports use v1 and unknown versions are rejected.
|
|
14
|
+
The JSON Schema `$id` and deterministic compiler version are versioned with this
|
|
15
|
+
contract.
|
|
43
16
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
17
|
+
The contract has five semantic component kinds: Text block, Diagram, Chart,
|
|
18
|
+
Image and Table. Any component can own optional self-contained SVG or structured
|
|
19
|
+
vector artwork. Structured lines, shapes, paths and text have stable IDs,
|
|
20
|
+
editable attributes and parent relationships. Opaque SVG remains a supported
|
|
21
|
+
fallback. The composition is authoritative for both outer geometry and editable
|
|
22
|
+
vector internals.
|
|
23
|
+
|
|
24
|
+
Diagram and Chart `appearance.selection` controls form choice: `auto` delegates
|
|
25
|
+
selection to the agent; `explicit` makes the diagram type or chart template
|
|
26
|
+
binding. Omission means explicit, never permission to switch. New canvas diagrams
|
|
27
|
+
and charts use auto. The agent must ask before changing an explicit form or
|
|
28
|
+
component kind, and may not silently reset it to auto. This is a handoff
|
|
29
|
+
requirement, not a runtime permission barrier against arbitrary external file edits.
|
|
30
|
+
The form picker remains available for finished vectors and opaque SVG as well as
|
|
53
31
|
drafts. Changing the requirement preserves existing artwork; it does not redraw it.
|
|
54
32
|
Sankey topology cannot be discarded by selecting another template, even in Auto.
|
|
55
33
|
|
|
56
|
-
|
|
34
|
+
Each page's `canvas.width` and `canvas.height` are integers from 256 to 4096.
|
|
57
35
|
`innerPadding` is nonnegative and must leave a content area. Component rectangles
|
|
58
36
|
must fit their owning page. `intendedViewingSize` accepts `presentation`, `social`,
|
|
59
|
-
`article` or `custom`.
|
|
37
|
+
`article` or `custom`.
|
|
60
38
|
The JSON key `slides` remains the ordered page collection for compatibility; it
|
|
61
39
|
does not restrict the document to presentations. Resizing does not transform content.
|
|
62
40
|
|
|
63
|
-
|
|
41
|
+
Ordinary Text blocks have plain `content` and optional `textStyle`: size
|
|
64
42
|
(8–240 slide pixels), weight (400/500/600), lineHeight (1–3), color
|
|
65
43
|
(ink/muted/accent), and font (heading/body). Newlines are preserved and lines wrap
|
|
66
44
|
inside the component. Missing content is empty; new manually added blocks start
|
|
67
45
|
with editable “Text”. `intent` is separate agent guidance and never supplies live
|
|
68
|
-
displayed copy.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
placeholder lines. Use separate Text blocks when independently positioned copy is needed.
|
|
46
|
+
displayed copy. Custom visuals, when present, still own rendering. Ordinary text
|
|
47
|
+
should not use custom visuals. Layout and purpose metadata remains agent guidance
|
|
48
|
+
rather than displayed copy. Use separate Text blocks when independently positioned
|
|
49
|
+
copy is needed.
|
|
73
50
|
|
|
74
51
|
### Theme-linked vector styles
|
|
75
52
|
|
|
@@ -77,9 +54,22 @@ placeholder lines. Use separate Text blocks when independently positioned copy i
|
|
|
77
54
|
`theme:background`, `theme:surface`, `theme:divider`, `theme:accent`,
|
|
78
55
|
`theme:on-accent`, and `theme:wash`. `font-family` accepts `theme:heading-font`
|
|
79
56
|
and `theme:body-font`. These resolve from the deck theme in every canvas view.
|
|
80
|
-
Use on-accent for text over an accent fill.
|
|
81
|
-
|
|
82
|
-
|
|
57
|
+
Use on-accent for text over an accent fill. `theme.typography` independently selects
|
|
58
|
+
`plex-sans` (IBM Plex Sans throughout), `noto-sans` (Noto Sans throughout),
|
|
59
|
+
`plex-serif` (IBM Plex Serif headings / IBM Plex Sans body), or `hanken-grotesk`
|
|
60
|
+
(Hanken Grotesk throughout). `theme.id` still selects the color palette and
|
|
61
|
+
`theme.mode` selects Paper or Night. For example:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{ "id": "green", "mode": "paper", "typography": "noto-sans" }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Omitting typography preserves the legacy pairing: Precision uses Noto Sans;
|
|
68
|
+
Editorial uses Plex Serif headings and Plex Sans body; other palettes use Plex
|
|
69
|
+
Sans. When revising colors, retain the current typography explicitly so changing
|
|
70
|
+
the palette does not change fonts. The editor does this automatically. Older
|
|
71
|
+
runtimes that do not support `theme.typography` reject documents containing it;
|
|
72
|
+
use a compatible runtime rather than removing the field and changing appearance.
|
|
83
73
|
|
|
84
74
|
Literal values are fixed overrides. SVG conversion preserves literals; it never
|
|
85
75
|
guesses roles from colors. Legacy raw SVG stays inert, fixed artwork. In the
|
package/composition/compile.ts
CHANGED
|
@@ -117,7 +117,7 @@ function compileSlidePlan(slide: CompositionSlide, index: number) {
|
|
|
117
117
|
const custom = component.customVisual
|
|
118
118
|
? component.customVisual.format === "vector"
|
|
119
119
|
? ` Custom visual — ${component.customVisual.elements.length} editable vector elements in a ${component.customVisual.viewBox.width}×${component.customVisual.viewBox.height} local viewport, ${component.customVisual.fit ?? "contain"} fit; preserve element IDs and edit individual geometry or styling while this component ID and preferred rectangle own slide placement.`
|
|
120
|
-
: ` Custom visual —
|
|
120
|
+
: ` Custom visual — opaque self-contained SVG, ${component.customVisual.viewBox.width}×${component.customVisual.viewBox.height} local viewport, ${component.customVisual.fit ?? "contain"} fit; convert its source to editable vector elements when revising while this component ID and preferred rectangle own slide placement.`
|
|
121
121
|
: "";
|
|
122
122
|
return `- ${componentLabel(component)}, ${placement(component, slide)}: ${component.intent?.trim() || "Use its content-slot instructions."} Appearance — ${appearance(component)}.${grammar}${custom} Required slots — ${slotLabels}.`;
|
|
123
123
|
});
|
|
@@ -213,7 +213,7 @@ Legacy Text-block purpose, treatment, layout and logical-order fields are guidan
|
|
|
213
213
|
Text-block role controls typography and semantic placement: title, subtitle, body, caption or footnote. Use title for the main takeaway and footnote for sources, scope and caveats.
|
|
214
214
|
Ordinary Text blocks store visible copy in content (plain text with newlines) and typography in textStyle (size in slide pixels, weight 400/500/600, lineHeight, ink/muted/accent color and heading/body font). Intent is separate agent guidance, never displayed copy. Revise content for manual and agent-authored text alike; do not replace ordinary text with customVisual. Custom vectors remain for genuinely custom artwork.
|
|
215
215
|
When a Text block records a logical order other than none, express that relationship in its text and shape arrangement: parallel, progressive, cyclical, general-to-specific or hierarchical.
|
|
216
|
-
Resolve authoring mode to ${document.authoringMode ?? "default"} and theme to ${document.theme?.id ?? "plex"} / ${document.theme?.mode ?? "paper"}. Theme and authoring mode are independent.
|
|
216
|
+
Resolve authoring mode to ${document.authoringMode ?? "default"} and theme to ${document.theme?.id ?? "plex"} / ${document.theme?.mode ?? "paper"}. Theme and authoring mode are independent.${document.theme?.typography ? ` Use typography ${document.theme.typography} independently of the color palette. plex-sans uses IBM Plex Sans throughout; noto-sans uses Noto Sans throughout; plex-serif uses IBM Plex Serif headings with IBM Plex Sans body; hanken-grotesk uses Hanken Grotesk throughout. Preserve this choice when changing colors.` : ""}
|
|
217
217
|
For editable vector interiors, bind fill/stroke/color to theme:ink, theme:muted, theme:background, theme:surface, theme:divider, theme:accent, theme:on-accent or theme:wash. Bind font-family to theme:heading-font or theme:body-font. Literal values remain fixed overrides; never infer theme roles from imported colors. Check text bounds after font changes; do not silently shrink or rearrange content.
|
|
218
218
|
Preserve the supplied slide order and slide names. Do not hide overflow, shrink required content, merge slides, or silently add slides. Report an overfull brief and ask for a scope decision. When rendering is requested, inspect and repair every slide at presentation and review sizes. Deliver the updated composition JSON, any requested editable render source, verified output and limitations.
|
|
219
219
|
|