glyphsmith 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 +21 -0
- package/README.ja.md +180 -0
- package/README.md +180 -0
- package/dist/index.js +4651 -0
- package/dist/index.js.map +7 -0
- package/package.json +33 -0
- package/skills/glyphsmith/SKILL.md +63 -0
- package/skills/glyphsmith-ast/SKILL.md +112 -0
- package/skills/glyphsmith-mcp/SKILL.md +294 -0
- package/skills/glyphsmith-patch/SKILL.md +239 -0
- package/web/_app/immutable/assets/0.6FezuCNY.css +2 -0
- package/web/_app/immutable/chunks/BAVS28_6.js +3 -0
- package/web/_app/immutable/chunks/BHNkEUd5.js +1 -0
- package/web/_app/immutable/chunks/kNaey6uv.js +1 -0
- package/web/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/web/_app/immutable/entry/app.ueWjp9Q5.js +2 -0
- package/web/_app/immutable/entry/start.3V6PXC0_.js +1 -0
- package/web/_app/immutable/nodes/0.CgyV9l8M.js +1 -0
- package/web/_app/immutable/nodes/1.CVIOxv4y.js +1 -0
- package/web/_app/immutable/nodes/2.DAdKRbM5.js +72 -0
- package/web/_app/version.json +1 -0
- package/web/icons/App-Icon.svg +1 -0
- package/web/icons/Arc.svg +1 -0
- package/web/icons/Basis.svg +1 -0
- package/web/icons/Catmull.svg +1 -0
- package/web/icons/Cubic-Bezier.svg +1 -0
- package/web/icons/Edit.svg +1 -0
- package/web/icons/Ellipse.svg +1 -0
- package/web/icons/Line.svg +1 -0
- package/web/icons/Rect.svg +1 -0
- package/web/icons/Redo.svg +1 -0
- package/web/icons/Select.svg +1 -0
- package/web/icons/Text.svg +1 -0
- package/web/icons/Triangle.svg +1 -0
- package/web/icons/Undo.svg +1 -0
- package/web/index.html +37 -0
- package/web/robots.txt +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KobayashiRui
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/images/app-icon.svg" alt="GlyphSmith" width="72" height="72" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">GlyphSmith</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Geometry AST と patch-based editing で動く、agent-native な SVG エディタ。
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="README.md">English</a> | 日本語
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
GlyphSmith は、手作業での編集と AI エージェントによる編集の両方を前提にした SVG エディタです。
|
|
16
|
+
エージェントに SVG 文字列全体を書き換えさせるのではなく、SVG を Geometry AST に import し、
|
|
17
|
+
対象を絞った patch operation を適用し、境界部分でだけ SVG として export します。
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
```txt
|
|
22
|
+
SVG
|
|
23
|
+
↓ Import
|
|
24
|
+
Geometry AST
|
|
25
|
+
↓ Patch Operations
|
|
26
|
+
Geometry AST
|
|
27
|
+
↓ Export
|
|
28
|
+
SVG
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Status
|
|
32
|
+
|
|
33
|
+
GlyphSmith は開発初期段階です。現在のリリースは CLI-first で、ローカルの editor session、project file、SVG export、MCP ベースの agent workflow にフォーカスしています。
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
依存関係をインストールします。
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pnpm install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
新規プロジェクトを開始します。
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
npx glyphsmith my-logo
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
これは `./my-logo.gs.json` を開きます。ファイルが存在しない場合、GlyphSmith が自動で作成します。
|
|
50
|
+
|
|
51
|
+
このリポジトリから実行する場合:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
pnpm run build:cli
|
|
55
|
+
node apps/cli/dist/index.js my-logo
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
デフォルトの開発用プロジェクトを起動します。
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
pnpm run dev
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
開発時のデフォルト:
|
|
65
|
+
|
|
66
|
+
```txt
|
|
67
|
+
Project: examples/playground.gs.json
|
|
68
|
+
UI: http://localhost:6201
|
|
69
|
+
Host: ws://localhost:6202/ws
|
|
70
|
+
MCP: http://localhost:6202/mcp
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
公式 GlyphSmith icon project を起動します。
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
pnpm run dev:icons
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Export Icons
|
|
80
|
+
|
|
81
|
+
icon project を web app の static directory に export します。
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
pnpm run export:icons
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
生成された SVG ファイルはここに出力されます。
|
|
88
|
+
|
|
89
|
+
```txt
|
|
90
|
+
apps/web/static/icons
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
同じコマンドを再実行すると、生成済みの icon output は上書きされます。
|
|
94
|
+
|
|
95
|
+
## Package
|
|
96
|
+
|
|
97
|
+
公開用の CLI package を build します。
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
pnpm run build:cli
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
確認用の npm tarball を作成します。
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
pnpm run pack:cli
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
package は `artifacts/npm` に出力され、bundle 済み CLI、build 済み web UI、GlyphSmith skills を含みます。
|
|
110
|
+
|
|
111
|
+
## Agent Workflow
|
|
112
|
+
|
|
113
|
+
GlyphSmith では Geometry AST が source of truth です。AI エージェントは SVG ファイル全体を再生成するのではなく、patch operation または MCP tool を通じて project を変更します。
|
|
114
|
+
|
|
115
|
+
デフォルトのローカル MCP endpoint:
|
|
116
|
+
|
|
117
|
+
```txt
|
|
118
|
+
http://127.0.0.1:6202/mcp
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
ローカル MCP endpoint を登録します。
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
glyphsmith mcp install codex --url http://127.0.0.1:6202/mcp
|
|
125
|
+
glyphsmith mcp install claude --url http://127.0.0.1:6202/mcp
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
GlyphSmith skill をインストールします。
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
glyphsmith skills install codex
|
|
132
|
+
glyphsmith skills install claude
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Project Files
|
|
136
|
+
|
|
137
|
+
GlyphSmith の project file は `.gs.json` 拡張子を使い、複数ページを含められます。1ページは1つの SVG-equivalent な Geometry AST document に対応します。
|
|
138
|
+
|
|
139
|
+
Examples:
|
|
140
|
+
|
|
141
|
+
```txt
|
|
142
|
+
examples/playground.gs.json
|
|
143
|
+
examples/glyphsmith.gs.json
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
CLI の path resolution は決定的です。
|
|
147
|
+
|
|
148
|
+
```txt
|
|
149
|
+
glyphsmith -> ./glyphsmith.gs.json
|
|
150
|
+
glyphsmith logo -> ./logo.gs.json
|
|
151
|
+
glyphsmith logo.gs.json -> ./logo.gs.json
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
解決された project file が存在しない場合、CLI はそのファイルを作成して処理を続行します。
|
|
155
|
+
|
|
156
|
+
## Repository Layout
|
|
157
|
+
|
|
158
|
+
```txt
|
|
159
|
+
apps/
|
|
160
|
+
├ cli/ Local host, CLI entrypoint, MCP coordination
|
|
161
|
+
└ web/ SvelteKit editor UI
|
|
162
|
+
|
|
163
|
+
packages/
|
|
164
|
+
├ ast/ Geometry AST definitions
|
|
165
|
+
├ editor/ Reusable editor interaction logic
|
|
166
|
+
├ kernel/ Geometry operations
|
|
167
|
+
├ mcp/ MCP server implementation
|
|
168
|
+
└ svg/ SVG import/export
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## README Assets
|
|
172
|
+
|
|
173
|
+
README 用の画像は `docs/images` に置きます。アプリ実行時の asset は `apps/web/static` に置きます。
|
|
174
|
+
|
|
175
|
+
現在の README assets:
|
|
176
|
+
|
|
177
|
+
```txt
|
|
178
|
+
docs/images/app-icon.svg
|
|
179
|
+
docs/images/editor.png
|
|
180
|
+
```
|
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/images/app-icon.svg" alt="GlyphSmith" width="72" height="72" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">GlyphSmith</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Agent-native SVG editor powered by Geometry AST and patch-based editing.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
English | <a href="README.ja.md">日本語</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
GlyphSmith is an SVG editor designed for both manual editing and AI-assisted editing.
|
|
16
|
+
Instead of asking agents to rewrite whole SVG strings, GlyphSmith imports SVG into a Geometry AST,
|
|
17
|
+
applies targeted patch operations, and exports SVG only at the boundary.
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
```txt
|
|
22
|
+
SVG
|
|
23
|
+
↓ Import
|
|
24
|
+
Geometry AST
|
|
25
|
+
↓ Patch Operations
|
|
26
|
+
Geometry AST
|
|
27
|
+
↓ Export
|
|
28
|
+
SVG
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Status
|
|
32
|
+
|
|
33
|
+
GlyphSmith is in early development. The current release is CLI-first and focuses on local editor sessions, project files, SVG export, and MCP-based agent workflows.
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
Install dependencies:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pnpm install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Start a new project:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
npx glyphsmith my-logo
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This opens `./my-logo.gs.json`. If the file does not exist, GlyphSmith creates it automatically.
|
|
50
|
+
|
|
51
|
+
When running from this repository:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
pnpm run build:cli
|
|
55
|
+
node apps/cli/dist/index.js my-logo
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Run the default development project:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
pnpm run dev
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Development defaults:
|
|
65
|
+
|
|
66
|
+
```txt
|
|
67
|
+
Project: examples/playground.gs.json
|
|
68
|
+
UI: http://localhost:6201
|
|
69
|
+
Host: ws://localhost:6202/ws
|
|
70
|
+
MCP: http://localhost:6202/mcp
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Run the official GlyphSmith icon project:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
pnpm run dev:icons
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Export Icons
|
|
80
|
+
|
|
81
|
+
Export the icon project into the web app static directory:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
pnpm run export:icons
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The generated SVG files are written to:
|
|
88
|
+
|
|
89
|
+
```txt
|
|
90
|
+
apps/web/static/icons
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Running the command again overwrites the generated icon output.
|
|
94
|
+
|
|
95
|
+
## Package
|
|
96
|
+
|
|
97
|
+
Build the publishable CLI package:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
pnpm run build:cli
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Create a local npm tarball for inspection:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
pnpm run pack:cli
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The package is written to `artifacts/npm` and contains the bundled CLI, built web UI, and GlyphSmith skills.
|
|
110
|
+
|
|
111
|
+
## Agent Workflow
|
|
112
|
+
|
|
113
|
+
GlyphSmith keeps the Geometry AST as the source of truth. AI agents should modify projects through patch operations or MCP tools instead of regenerating SVG files.
|
|
114
|
+
|
|
115
|
+
Default local MCP endpoint:
|
|
116
|
+
|
|
117
|
+
```txt
|
|
118
|
+
http://127.0.0.1:6202/mcp
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Register the local MCP endpoint:
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
glyphsmith mcp install codex --url http://127.0.0.1:6202/mcp
|
|
125
|
+
glyphsmith mcp install claude --url http://127.0.0.1:6202/mcp
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Install GlyphSmith skills:
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
glyphsmith skills install codex
|
|
132
|
+
glyphsmith skills install claude
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Project Files
|
|
136
|
+
|
|
137
|
+
GlyphSmith project files use the `.gs.json` extension and can contain multiple pages. One page maps to one SVG-equivalent Geometry AST document.
|
|
138
|
+
|
|
139
|
+
Examples:
|
|
140
|
+
|
|
141
|
+
```txt
|
|
142
|
+
examples/playground.gs.json
|
|
143
|
+
examples/glyphsmith.gs.json
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
CLI path resolution is deterministic:
|
|
147
|
+
|
|
148
|
+
```txt
|
|
149
|
+
glyphsmith -> ./glyphsmith.gs.json
|
|
150
|
+
glyphsmith logo -> ./logo.gs.json
|
|
151
|
+
glyphsmith logo.gs.json -> ./logo.gs.json
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
If the resolved project file does not exist, the CLI creates it and continues.
|
|
155
|
+
|
|
156
|
+
## Repository Layout
|
|
157
|
+
|
|
158
|
+
```txt
|
|
159
|
+
apps/
|
|
160
|
+
├ cli/ Local host, CLI entrypoint, MCP coordination
|
|
161
|
+
└ web/ SvelteKit editor UI
|
|
162
|
+
|
|
163
|
+
packages/
|
|
164
|
+
├ ast/ Geometry AST definitions
|
|
165
|
+
├ editor/ Reusable editor interaction logic
|
|
166
|
+
├ kernel/ Geometry operations
|
|
167
|
+
├ mcp/ MCP server implementation
|
|
168
|
+
└ svg/ SVG import/export
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## README Assets
|
|
172
|
+
|
|
173
|
+
README images live in `docs/images`. App runtime assets live in `apps/web/static`.
|
|
174
|
+
|
|
175
|
+
Current README assets:
|
|
176
|
+
|
|
177
|
+
```txt
|
|
178
|
+
docs/images/app-icon.svg
|
|
179
|
+
docs/images/editor.png
|
|
180
|
+
```
|