codesign-mcp-next 0.3.2 → 0.3.4
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/CHANGELOG.md +149 -121
- package/LICENSE +21 -21
- package/README.md +460 -458
- package/dist/codesign/errors.js +1 -0
- package/dist/codesign/verify.js +495 -0
- package/dist/mcp/result.js +19 -0
- package/dist/prompts/design-to-code.js +20 -18
- package/dist/resources/workflow.js +17 -16
- package/dist/server.js +2 -0
- package/dist/tools/slices.js +56 -3
- package/dist/tools/verify-rendering.js +175 -0
- package/package.json +58 -58
- package/userscripts/codesign-ai-selection.user.js +445 -445
package/CHANGELOG.md
CHANGED
|
@@ -1,121 +1,149 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.3.
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- Added
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- Clarified that
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.3.4 - 2026-11-26
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added `verify_rendering`, a read-only tool that re-fetches the official spec, rebuilds `platformSpec`, and statically checks generated code for size, slice scale, color, typography, radius, and hierarchy. Slice usages are located via `data-slice-id="<layerObjectId>"` attributes or `/* slice:<layerObjectId> */` comments. It reports per-file/line issues and a `reviewRequired` list for areas that cannot be statically resolved, and returns `ok: false` when a hard check fails.
|
|
8
|
+
- Added `designSize` to `download_slice` results when `targetPlatform` is supplied: the converted layout width/height a slice must be displayed at, so 2x assets are shown at design size rather than pixel size.
|
|
9
|
+
- Added `CODE_FILE_INVALID` for missing, oversized, or out-of-workspace code files passed to `verify_rendering`.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Updated the design-to-code prompt, workflow resource, and skill to mark slice anchors and run `verify_rendering` before finishing.
|
|
14
|
+
|
|
15
|
+
## 0.3.3 - 2026-11-26
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Added in-process TTL caching and in-flight request deduplication for sharing details, metadata, and slice manifests.
|
|
20
|
+
- Added metadata and slice-download integrity checks, including hierarchy validation, artifact magic-byte checks, and SHA-256 reporting.
|
|
21
|
+
- Added per-host request throttling and exponential-backoff retries for CoDesign API, metadata, and CDN downloads.
|
|
22
|
+
- Added full artboard hierarchy in `spec.hierarchy` with parent-relative geometry, plus concise text summaries of structured tool results.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Renamed the npm package to `codesign-mcp-next`; the GitHub repository remains `DOIT008/codesign-mcp`.
|
|
27
|
+
- Serialized browser launches and reused a shared headless page to avoid profile contention.
|
|
28
|
+
- Updated the design-to-code skill workflow to consume `platformSpec` and `spec.hierarchy` instead of hardcoded conversions.
|
|
29
|
+
- Hardened the GitHub Actions publishing workflow for npm Trusted Publishing.
|
|
30
|
+
|
|
31
|
+
## 0.3.2 - 2026-08-31
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- Accepted password-protected sharing-detail responses that expose `screens` at the top level instead of nesting them under `designs`, preventing valid HTTP 200 responses from being reported as `SHARING_NOT_FOUND`. ([#5](https://github.com/DOIT008/codesign-mcp/issues/5))
|
|
36
|
+
- Preserved the existing nested `designs` response shape and sharing-detail diagnostics.
|
|
37
|
+
|
|
38
|
+
### Tests
|
|
39
|
+
|
|
40
|
+
- Added regression coverage for both sharing-detail response shapes and malformed-response diagnostics.
|
|
41
|
+
|
|
42
|
+
## 0.3.1 - 2026-08-29
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Encoded slice `object_id` values as reversible, cross-platform filename components so Windows downloads no longer fail for Figma-style IDs containing reserved characters such as `:`. ([#3](https://github.com/DOIT008/codesign-mcp/issues/3))
|
|
47
|
+
- Preserved existing UUID-style slice filenames while avoiding collisions with identifiers that already contain percent-encoded text.
|
|
48
|
+
|
|
49
|
+
### Tests
|
|
50
|
+
|
|
51
|
+
- Added regression coverage for UUID-style IDs, Windows-incompatible Figma-style IDs, and filename-encoding collisions.
|
|
52
|
+
- Verified real PNG downloads for both a UUID-style slice and the Issue #3 Figma-style slice on Windows.
|
|
53
|
+
|
|
54
|
+
## 0.3.0 - 2026-07-29
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
- Added a repository-hosted Tampermonkey userscript that copies the active CoDesign screen and layer selection as a structured Agent prompt without including the sharing password.
|
|
59
|
+
- Added `selectionScope` support to `get_artboard_spec`: `layer` preserves the existing single-node response, `subtree` returns strict descendants, and `region` returns all non-ancestor nodes contained by the selected bounds.
|
|
60
|
+
- Added selected-region hierarchy, bounds, relative coordinates, and platform-filtered selection metadata.
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
|
|
64
|
+
- Clarified that semantic document flow is the default design-to-code strategy while an explicit user request for absolute or canvas-style positioning takes precedence.
|
|
65
|
+
- Positioned the userscript action before CoDesign's native inspector action so the existing control keeps its expected placement.
|
|
66
|
+
|
|
67
|
+
### Tests
|
|
68
|
+
|
|
69
|
+
- Added coverage for single-layer, subtree, spatial region, relative coordinate, and missing-layer selection behavior.
|
|
70
|
+
- Added userscript syntax validation to the test command.
|
|
71
|
+
- Verified region selection against a real CoDesign sharing screen, including spatial sibling layers and relative coordinates.
|
|
72
|
+
|
|
73
|
+
## 0.2.0 - 2026-07-02
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
|
|
77
|
+
- Added `targetPlatform` support to `get_artboard_spec` for natural-language platform names such as `web`, `Android`, `安卓`, `iOS`, `微信小程序`, and `mini program`.
|
|
78
|
+
- Added platform presentation metadata under `spec.platformSpec`, including normalized platform id, units, converted rects, unit-adjusted CSS, and conversion details.
|
|
79
|
+
- Added CoDesign-style custom platform settings with `targetUnit`, `customScale`, `customWidth`, and `remBasePx`, including rem conversion for target-width workflows.
|
|
80
|
+
- Updated the design-to-code prompt and workflow resource so agents pass platform, unit, custom width, custom scale, and rem base settings when users provide them in natural language.
|
|
81
|
+
|
|
82
|
+
### Tests
|
|
83
|
+
|
|
84
|
+
- Added platform alias, unit conversion, custom width, rem base, and invalid platform coverage.
|
|
85
|
+
- Verified the real CoDesign sharing link flow with the fuzzy request "设计稿目标宽度 1440px,单位用 rem".
|
|
86
|
+
|
|
87
|
+
## 0.1.10 - 2026-06-09
|
|
88
|
+
|
|
89
|
+
### Fixed
|
|
90
|
+
|
|
91
|
+
- Updated the CoDesign design-to-code prompt and workflow guidance to require semantic page structure and normal document flow before coding.
|
|
92
|
+
- Clarified that Flexbox/Grid should be preferred for page layout, with absolute or fixed positioning reserved for local overlays or intentionally overlapping elements.
|
|
93
|
+
|
|
94
|
+
## 0.1.9 - 2026-05-26
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
|
|
98
|
+
- Delayed creation of the default `.codesign-mcp` runtime directory until a tool actually needs local state or artifacts.
|
|
99
|
+
- Kept default startup logging from creating the runtime directory while still honoring an explicit `CODESIGN_LOG_FILE`.
|
|
100
|
+
|
|
101
|
+
### Tests
|
|
102
|
+
|
|
103
|
+
- Added startup coverage to ensure server initialization does not create the default runtime directory.
|
|
104
|
+
|
|
105
|
+
## 0.1.8 - 2026-05-22
|
|
106
|
+
|
|
107
|
+
### Security
|
|
108
|
+
|
|
109
|
+
- Removed runtime dependencies on the MCP SDK, Pino, and Zod to reduce third-party supply-chain exposure.
|
|
110
|
+
- Replaced in-page dynamic fetch calls with Playwright API request calls guarded by CoDesign same-origin checks.
|
|
111
|
+
- Added remote asset allowlisting and CoDesign COS-to-CDN normalization for meta, screen, and slice downloads.
|
|
112
|
+
- Hardened `codesign_logout` so it only clears the configured profile directory, not arbitrary children of a broad data directory.
|
|
113
|
+
- Expanded `debug_collect_network` redaction for sharing IDs, account/team IDs, sensitive headers, query values, CDN path tokens, and response bodies.
|
|
114
|
+
|
|
115
|
+
### Changed
|
|
116
|
+
|
|
117
|
+
- Added a small local MCP stdio implementation and JSON schema validator for the server's current tool, prompt, and resource surface.
|
|
118
|
+
- Replaced Pino with a local JSON-lines file logger.
|
|
119
|
+
- Disabled source map output and excluded generated source maps from published package contents.
|
|
120
|
+
|
|
121
|
+
### Fixed
|
|
122
|
+
|
|
123
|
+
- `prompts/get` now reports invalid prompt arguments as JSON-RPC invalid params instead of internal server errors.
|
|
124
|
+
- Diagnostic response summaries now preserve useful request shape while hiding sensitive values.
|
|
125
|
+
|
|
126
|
+
### Tests
|
|
127
|
+
|
|
128
|
+
- Added coverage for profile deletion safety, diagnostic redaction, same-origin request blocking, and MCP prompt argument validation.
|
|
129
|
+
|
|
130
|
+
## 0.1.7 - 2026-05-21
|
|
131
|
+
|
|
132
|
+
### Added
|
|
133
|
+
|
|
134
|
+
- Added the `implement_codesign_page` MCP prompt for the documented CoDesign design-to-code workflow.
|
|
135
|
+
- Added the `codesign://workflow/design-to-code` read-only MCP resource for workflow guidance.
|
|
136
|
+
- Extended the stdio smoke test to verify tools, prompts, and resources.
|
|
137
|
+
- Added README badges for LobeHub, npm, Node.js, TypeScript, MCP SDK, and license metadata.
|
|
138
|
+
|
|
139
|
+
## 0.1.6 - 2026-05-19
|
|
140
|
+
|
|
141
|
+
### Changed
|
|
142
|
+
|
|
143
|
+
- Invalid scalar environment variables now fail at startup instead of silently using defaults. For example, `CODESIGN_KEEP_BROWSER=maybe` and `CODESIGN_LOG_LEVEL=verbose` will stop the server with a clear configuration error. This is intentional so configuration mistakes are exposed before runtime.
|
|
144
|
+
- Same-origin CoDesign API fetch failures now surface as `SHARING_FETCH_FAILED` instead of being misreported as missing shares.
|
|
145
|
+
- Artifact downloads now reject paths that escape the configured artifacts directory.
|
|
146
|
+
|
|
147
|
+
### Tests
|
|
148
|
+
|
|
149
|
+
- Added coverage for strict environment parsing, same-origin request failures, and artifact path validation.
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 ccpopy
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ccpopy
|
|
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.
|