cox-protocol-package 1.0.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/COX_FILE_FORMAT_SPECIFICATION_v1.0.md +236 -0
- package/LICENSE +21 -0
- package/README.md +192 -0
- package/bin/cox-protocol.js +57 -0
- package/editor-support/vscode/.vscodeignore +9 -0
- package/editor-support/vscode/CHANGELOG.md +12 -0
- package/editor-support/vscode/LICENSE +21 -0
- package/editor-support/vscode/README.md +32 -0
- package/editor-support/vscode/language-configuration.json +47 -0
- package/editor-support/vscode/package.json +90 -0
- package/editor-support/vscode/snippets/cox-common.json +12 -0
- package/editor-support/vscode/snippets/cox-component.json +41 -0
- package/editor-support/vscode/snippets/cox-crop-metadata.json +23 -0
- package/editor-support/vscode/snippets/cox-manifest.json +39 -0
- package/editor-support/vscode/snippets/cox-page.json +44 -0
- package/editor-support/vscode/snippets/cox-protocol.json +16 -0
- package/editor-support/vscode/syntaxes/cox.tmLanguage.json +30 -0
- package/guides/imported-packages/cox_protocol_package_compiled.md +32 -0
- package/guides/npm-installation.md +296 -0
- package/manifest.cox +106 -0
- package/package.json +53 -0
- package/protocols/coding_agent_starting_point.cox +67 -0
- package/protocols/component_binding_graph.cox +52 -0
- package/protocols/design_tokens.cox +42 -0
- package/protocols/deterministic_naming_convention.cox +159 -0
- package/protocols/evidence_and_uncertainty_protocol.cox +42 -0
- package/protocols/llm_agent_zip_recreation_instructions.cox +87 -0
- package/protocols/recursive_decomposition_protocol.cox +96 -0
- package/protocols/screenshot_partitioning_protocol.cox +64 -0
- package/protocols/sub_agents_orchestration.cox +85 -0
- package/protocols/visual_acceptance_checklist.cox +30 -0
- package/protocols/website_logic_and_functionality.cox +82 -0
- package/pyproject.toml +51 -0
- package/requirements.txt +4 -0
- package/schemas/cox.component.v1.schema.json +167 -0
- package/schemas/cox.crop_metadata.v1.schema.json +83 -0
- package/schemas/cox.manifest.v1.schema.json +172 -0
- package/schemas/cox.page.v1.schema.json +229 -0
- package/schemas/cox.protocol.v1.schema.json +38 -0
- package/skills/design-spec-writer/SKILL.md +182 -0
- package/skills/package-docs-writer/SKILL.md +270 -0
- package/skills/screenshot-semantic-namer/SKILL.md +96 -0
- package/skills/visual-token-extractor/SKILL.md +102 -0
- package/skills/zip-design-orchestrator/SKILL.md +113 -0
- package/skills/zip-packager/SKILL.md +127 -0
- package/templates/ComponentName.cox.template +33 -0
- package/templates/Page.cox.template +36 -0
- package/templates/crop_metadata.cox.template +15 -0
- package/tools/__init__.py +3 -0
- package/tools/cox_cli.py +127 -0
- package/tools/cox_lib.py +557 -0
- package/tools/package_target.py +214 -0
- package/tools/react_target.py +278 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# COX File Format Specification v1.0
|
|
2
|
+
|
|
3
|
+
## 1. Status
|
|
4
|
+
|
|
5
|
+
- Format name: `COX`
|
|
6
|
+
- Version: `1.0`
|
|
7
|
+
- File extension: `.cox`
|
|
8
|
+
- MIME type: `application/vnd.cox+yaml`
|
|
9
|
+
- Encoding: `UTF-8`
|
|
10
|
+
- Syntax base: `YAML-compatible structured text`
|
|
11
|
+
- Entry point: `manifest.cox`
|
|
12
|
+
|
|
13
|
+
## 2. Purpose
|
|
14
|
+
|
|
15
|
+
COX is a structured file format for UI reconstruction, evidence tracking, component binding, implementation guidance, and agent-readable design specifications. A COX project is manifest-driven and intended to be both human-readable and machine-validatable.
|
|
16
|
+
|
|
17
|
+
## 3. Common Header
|
|
18
|
+
|
|
19
|
+
Every `.cox` document must begin with the following versioned metadata header:
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
CoxVersion: "1.0"
|
|
23
|
+
FileType: "component_spec"
|
|
24
|
+
Slug: "projects_grid_cards"
|
|
25
|
+
Schema: "cox.component.v1"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Required header fields for all COX documents:
|
|
29
|
+
|
|
30
|
+
- `CoxVersion`
|
|
31
|
+
- `FileType`
|
|
32
|
+
- `Slug`
|
|
33
|
+
- `Schema`
|
|
34
|
+
|
|
35
|
+
## 4. Supported File Types
|
|
36
|
+
|
|
37
|
+
### `manifest`
|
|
38
|
+
|
|
39
|
+
Project entrypoint that defines the package contract, referenced pages, guide documents, protocol documents, skill bundles, schemas, tooling, and build targets.
|
|
40
|
+
|
|
41
|
+
Required top-level fields:
|
|
42
|
+
|
|
43
|
+
- `CoxVersion`
|
|
44
|
+
- `FileType`
|
|
45
|
+
- `Slug`
|
|
46
|
+
- `Schema`
|
|
47
|
+
- `ProjectName`
|
|
48
|
+
- `ProtocolExtension`
|
|
49
|
+
- `MimeType`
|
|
50
|
+
- `EntryPoint`
|
|
51
|
+
- `Pages`
|
|
52
|
+
|
|
53
|
+
Optional manifest file collections:
|
|
54
|
+
|
|
55
|
+
- `ReferenceDocs`: human-facing root documentation files
|
|
56
|
+
- `GuideDocs`: guide or tutorial files imported into `guides/`
|
|
57
|
+
- `ProtocolDocs`: `.cox` methodology and system protocol documents
|
|
58
|
+
- `SkillBundles`: LLM-agent skill bundle files or directories imported into `skills/`
|
|
59
|
+
- `Schemas`: JSON Schema files used by the validator
|
|
60
|
+
- `ToolingFiles`: compiler, editor, package, and distribution tooling files
|
|
61
|
+
|
|
62
|
+
Supported build targets:
|
|
63
|
+
|
|
64
|
+
- `json`
|
|
65
|
+
- `react`
|
|
66
|
+
- `package`
|
|
67
|
+
|
|
68
|
+
### `page_spec`
|
|
69
|
+
|
|
70
|
+
Defines page-level evidence, visible regions, child component bindings, layout behavior, and page interactions.
|
|
71
|
+
|
|
72
|
+
Required top-level fields:
|
|
73
|
+
|
|
74
|
+
- `CoxVersion`
|
|
75
|
+
- `FileType`
|
|
76
|
+
- `PageName`
|
|
77
|
+
- `Slug`
|
|
78
|
+
- `Schema`
|
|
79
|
+
- `ProjectName`
|
|
80
|
+
- `EvidenceSummary`
|
|
81
|
+
- `VisibleStructure`
|
|
82
|
+
- `Interactions`
|
|
83
|
+
|
|
84
|
+
### `component_spec`
|
|
85
|
+
|
|
86
|
+
Defines a reusable UI component, its evidence basis, visible structure, visual style, and interactions.
|
|
87
|
+
|
|
88
|
+
Required top-level fields:
|
|
89
|
+
|
|
90
|
+
- `CoxVersion`
|
|
91
|
+
- `FileType`
|
|
92
|
+
- `ComponentName`
|
|
93
|
+
- `Slug`
|
|
94
|
+
- `Schema`
|
|
95
|
+
- `EvidenceSummary`
|
|
96
|
+
- `VisibleStructure`
|
|
97
|
+
- `Interactions`
|
|
98
|
+
|
|
99
|
+
### `protocol_doc`
|
|
100
|
+
|
|
101
|
+
Defines COX process rules, naming conventions, orchestration rules, logic notes, design tokens, or validation checklists.
|
|
102
|
+
|
|
103
|
+
Required top-level fields:
|
|
104
|
+
|
|
105
|
+
- `CoxVersion`
|
|
106
|
+
- `FileType`
|
|
107
|
+
- `Slug`
|
|
108
|
+
- `Schema`
|
|
109
|
+
- `ProtocolName`
|
|
110
|
+
- `Purpose`
|
|
111
|
+
|
|
112
|
+
### `crop_metadata`
|
|
113
|
+
|
|
114
|
+
Defines crop planning metadata for derived screenshots.
|
|
115
|
+
|
|
116
|
+
Required top-level fields:
|
|
117
|
+
|
|
118
|
+
- `CoxVersion`
|
|
119
|
+
- `FileType`
|
|
120
|
+
- `Slug`
|
|
121
|
+
- `Schema`
|
|
122
|
+
- `SourceScreenshot`
|
|
123
|
+
- `OutputScreenshot`
|
|
124
|
+
- `BoundaryConfidence`
|
|
125
|
+
- `EstimatedBoundingBox`
|
|
126
|
+
|
|
127
|
+
## 5. Slug Rules
|
|
128
|
+
|
|
129
|
+
`Slug` values use lowercase snake case.
|
|
130
|
+
|
|
131
|
+
Allowed pattern:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
^[a-z0-9]+(_[a-z0-9]+)*$
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Examples:
|
|
138
|
+
|
|
139
|
+
- `dashboard`
|
|
140
|
+
- `projects_grid_cards`
|
|
141
|
+
- `deterministic_naming_convention`
|
|
142
|
+
|
|
143
|
+
## 6. Evidence Model
|
|
144
|
+
|
|
145
|
+
When evidence is relevant, COX documents should separate claims into explicit evidence levels:
|
|
146
|
+
|
|
147
|
+
- `Visible`
|
|
148
|
+
- `UserSpecified`
|
|
149
|
+
- `Inferred`
|
|
150
|
+
- `Intended`
|
|
151
|
+
- `Recommended`
|
|
152
|
+
|
|
153
|
+
The format does not permit inferred behavior to be represented as certain without explicit visible or user-provided evidence.
|
|
154
|
+
|
|
155
|
+
## 7. Validation Model
|
|
156
|
+
|
|
157
|
+
COX documents are parsed as YAML and validated against JSON Schema Draft 2020-12.
|
|
158
|
+
|
|
159
|
+
Canonical schema ids:
|
|
160
|
+
|
|
161
|
+
- `cox.manifest.v1`
|
|
162
|
+
- `cox.page.v1`
|
|
163
|
+
- `cox.component.v1`
|
|
164
|
+
- `cox.protocol.v1`
|
|
165
|
+
- `cox.crop_metadata.v1`
|
|
166
|
+
|
|
167
|
+
Validation must include:
|
|
168
|
+
|
|
169
|
+
- UTF-8 decoding
|
|
170
|
+
- YAML parsing
|
|
171
|
+
- Schema validation
|
|
172
|
+
- Manifest reference existence checks
|
|
173
|
+
- Page/component path checks
|
|
174
|
+
- Unreferenced `.cox` file detection as a warning
|
|
175
|
+
|
|
176
|
+
## 8. Compilation Model
|
|
177
|
+
|
|
178
|
+
The first professional compilation target for COX v1.0 is normalized JSON. The current compiler also supports React stubs and deterministic package ZIP output.
|
|
179
|
+
|
|
180
|
+
Expected pipeline:
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
.cox files
|
|
184
|
+
-> parse YAML
|
|
185
|
+
-> validate against schema
|
|
186
|
+
-> check references and paths
|
|
187
|
+
-> emit normalized JSON
|
|
188
|
+
-> generate verification report
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Recommended commands:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
cox validate ./cox_protocol_package
|
|
195
|
+
cox compile ./cox_protocol_package --out ./build
|
|
196
|
+
cox compile ./cox_protocol_package --target react --out ./build
|
|
197
|
+
cox compile ./cox_protocol_package --target json --target react --target package --out ./build
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Expected build outputs:
|
|
201
|
+
|
|
202
|
+
```text
|
|
203
|
+
build/
|
|
204
|
+
manifest.compiled.json
|
|
205
|
+
normalized/
|
|
206
|
+
package/
|
|
207
|
+
cox_protocol_package_corrected.zip
|
|
208
|
+
cox_protocol_package_corrected.manifest.json
|
|
209
|
+
reports/
|
|
210
|
+
verification_report.txt
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Optional React stub output:
|
|
214
|
+
|
|
215
|
+
```text
|
|
216
|
+
build/
|
|
217
|
+
react/
|
|
218
|
+
components/
|
|
219
|
+
pages/
|
|
220
|
+
index.ts
|
|
221
|
+
manifest.react.json
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The `react` target consumes the same normalized COX document model used by the JSON target and emits framework-neutral TSX stubs. COX v1.0 does not require the compiler to infer concrete CSS values or executable interaction logic from prose-only layout and evidence sections.
|
|
225
|
+
|
|
226
|
+
The `package` target emits a deterministic ZIP archive from manifest-referenced source files and any generated outputs produced earlier in the same compilation pass. Package archives must use project-relative paths under a single archive root, sorted file ordering, fixed ZIP timestamps, and SHA-256 records for every packaged file. Local caches, virtual environments, raw intake ZIPs, and package output directories must not be included.
|
|
227
|
+
|
|
228
|
+
Guide and skill bundle intake is intentionally explicit. The compiler supports `GuideDocs` and `SkillBundles`, but ZIP attachments must be inspected and curated before their paths are added to the manifest.
|
|
229
|
+
|
|
230
|
+
## 9. Editor Support
|
|
231
|
+
|
|
232
|
+
COX editor support should register `.cox` as its own language id and may initially inherit YAML-compatible tokenization. Header keys such as `CoxVersion`, `FileType`, `Slug`, and `Schema` should be highlighted distinctly.
|
|
233
|
+
|
|
234
|
+
## 10. Compatibility
|
|
235
|
+
|
|
236
|
+
COX v1.0 is compatible with YAML tooling that preserves mappings, lists, strings, and nested objects. COX-specific validity is determined by COX schemas rather than YAML parsing alone.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Charbel Malo
|
|
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.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# COX Protocol Package
|
|
2
|
+
|
|
3
|
+
COX is a versioned, YAML-compatible file format for UI reconstruction, evidence tracking, component binding, implementation guidance, and agent-readable design specifications.
|
|
4
|
+
|
|
5
|
+
This repository now treats `.cox` as a real format surface rather than renamed text files. COX v1.0 includes:
|
|
6
|
+
|
|
7
|
+
- a formal file format specification
|
|
8
|
+
- versioned headers on `.cox` documents
|
|
9
|
+
- JSON Schemas for validation
|
|
10
|
+
- a manifest-driven validator/compiler CLI
|
|
11
|
+
- normalized JSON build output
|
|
12
|
+
- deterministic package ZIP output
|
|
13
|
+
- minimal VS Code language support
|
|
14
|
+
|
|
15
|
+
## COX v1.0
|
|
16
|
+
|
|
17
|
+
- Extension: `.cox`
|
|
18
|
+
- MIME type: `application/vnd.cox+yaml`
|
|
19
|
+
- Encoding: `UTF-8`
|
|
20
|
+
- Syntax base: `YAML-compatible structured text`
|
|
21
|
+
- Entry point: `manifest.cox`
|
|
22
|
+
|
|
23
|
+
Every `.cox` document starts with a common header:
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
CoxVersion: "1.0"
|
|
27
|
+
FileType: "component_spec"
|
|
28
|
+
Slug: "projects_grid_cards"
|
|
29
|
+
Schema: "cox.component.v1"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Repository Contents
|
|
33
|
+
|
|
34
|
+
- `COX_FILE_FORMAT_SPECIFICATION_v1.0.md`: formal format rules for COX v1.0
|
|
35
|
+
- `manifest.cox`: manifest entrypoint for validation and compilation
|
|
36
|
+
- `protocols/`: shared protocol documents referenced by the manifest
|
|
37
|
+
- `guides/`: package guides, including imported archive audit notes and NPM installation instructions
|
|
38
|
+
- `skills/`: LLM-agent skill bundles imported from `llm_agent_zip_skills_bundle.zip`
|
|
39
|
+
- `schemas/`: JSON Schemas for manifest, page, component, protocol, and crop metadata documents
|
|
40
|
+
- `tools/`: Python validator/compiler package and CLI
|
|
41
|
+
- `bin/`: NPM wrapper that delegates to the Python COX CLI
|
|
42
|
+
- `editor-support/vscode/`: minimal VS Code language registration for `.cox`
|
|
43
|
+
- `LocalAppManager/`: example manifest-driven project content
|
|
44
|
+
- `templates/`: versioned starter templates for page, component, and crop metadata files
|
|
45
|
+
|
|
46
|
+
## Commands
|
|
47
|
+
|
|
48
|
+
Install the toolchain:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python -m pip install -e .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Validate a COX project:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
cox validate .
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Compile a COX project to normalized JSON:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
cox compile . --out build
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Compile React stubs from the same normalized COX document model:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
cox compile . --target react --out build
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Compile multiple targets in one pass:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
cox compile . --target json --target react --target package --out build
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The `package` target emits a deterministic ZIP archive and package manifest under `build/package/`. The archive uses sorted paths, fixed ZIP timestamps, project-relative names, SHA-256 file records, and excludes transient local artifacts such as `.venv`, `.mypy_cache`, `node_modules`, `*.egg-info`, raw intake ZIPs, and `build/package` itself.
|
|
79
|
+
|
|
80
|
+
## Build Output
|
|
81
|
+
|
|
82
|
+
Compilation emits:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
build/
|
|
86
|
+
manifest.compiled.json
|
|
87
|
+
normalized/
|
|
88
|
+
reports/
|
|
89
|
+
verification_report.txt
|
|
90
|
+
package/
|
|
91
|
+
cox_protocol_package_corrected.zip
|
|
92
|
+
cox_protocol_package_corrected.manifest.json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
When the `react` target is requested, compilation also emits:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
build/
|
|
99
|
+
react/
|
|
100
|
+
components/
|
|
101
|
+
pages/
|
|
102
|
+
index.ts
|
|
103
|
+
manifest.react.json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The React target is intentionally stub-oriented. It uses COX structure, roles, token references, layout notes, and implementation hints to generate TSX placeholders, but it does not invent concrete CSS values, event handlers, or runtime data contracts from prose-only fields.
|
|
107
|
+
|
|
108
|
+
## Guide and Skill Bundle Intake
|
|
109
|
+
|
|
110
|
+
The manifest has first-class `GuideDocs` and `SkillBundles` sections.
|
|
111
|
+
|
|
112
|
+
Current imported content:
|
|
113
|
+
|
|
114
|
+
- `cox_protocol_package_compiled.zip` was audited as a legacy snapshot of this same package. It was not extracted over the live source because the current repository has the newer COX v1.0 manifest, schema, compiler, package target, and `protocols/` layout. See `guides/imported-packages/cox_protocol_package_compiled.md`.
|
|
115
|
+
- `llm_agent_zip_skills_bundle.zip` was expanded into six skill directories under `skills/`.
|
|
116
|
+
- NPM installation instructions for another device live in `guides/npm-installation.md`.
|
|
117
|
+
|
|
118
|
+
Use this intake flow for future ZIP files:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
unzip -l cox_protocol_package_compiled.zip
|
|
122
|
+
unzip -l llm_agent_zip_skills_bundle.zip
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Inspect the listings before extraction. Reject or rename entries with absolute paths, `..` path segments, root-level collisions such as `README.md` or `manifest.cox`, generated caches, or unrelated build artifacts. Curated guide content should land in `guides/`; curated skill bundle content should land in `skills/`. After that, add concrete paths to `GuideDocs` and `SkillBundles`, then rerun validation and compilation.
|
|
126
|
+
|
|
127
|
+
## Protocol Readiness Score
|
|
128
|
+
|
|
129
|
+
| Attribute | Meter | Score | Notes |
|
|
130
|
+
| --- | --- | ---: | --- |
|
|
131
|
+
| Determinism | `[########--]` | 8/10 | Versioned headers, schema-backed manifests, stable package ordering, fixed ZIP timestamps, and SHA-256 records are now in place. Remaining work is an optional generated artifact policy for release bundles. |
|
|
132
|
+
| Validation rigor | `[########--]` | 8/10 | YAML parsing, JSON Schema, manifest path checks, target enums, referenced guides, referenced skill bundle directories, and unreferenced `.cox` warnings are active. |
|
|
133
|
+
| Evidence traceability | `[########--]` | 8/10 | Evidence and uncertainty protocols are explicit, and the package manifest records exact file hashes. Runtime visual evidence still depends on real screenshots replacing placeholders. |
|
|
134
|
+
| Distribution readiness | `[#######---]` | 7/10 | Local Python CLI, NPM wrapper metadata, deterministic package output, VSIX packaging, guide docs, and skill bundle content are present. Public publishing still needs final repository URLs and account tokens. |
|
|
135
|
+
| Interoperability | `[#######---]` | 7/10 | COX works as YAML-compatible structured text with JSON, React stub, VS Code, NPM, and ZIP surfaces. A TypeScript-native compiler and concrete design-token CSS layer remain future improvements. |
|
|
136
|
+
|
|
137
|
+
COX complements Vercel v0 and Stitch-style AI design tools rather than replacing them. Those tools optimize prompt-to-app generation, visual iteration, repo sync, and deployment. COX optimizes deterministic file contracts, evidence tracking, schema validation, reproducible package output, and agent-to-agent handoff.
|
|
138
|
+
|
|
139
|
+
## Publication and Local Testing
|
|
140
|
+
|
|
141
|
+
Install and test the Python CLI locally:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
python -m pip install -e .
|
|
145
|
+
cox validate .
|
|
146
|
+
cox compile . --target json --target react --target package --out build
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Check the NPM package contents before publishing:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npm pack --dry-run
|
|
153
|
+
npm pack
|
|
154
|
+
npm install -g ./cox-protocol-package-1.0.0.tgz
|
|
155
|
+
cox-protocol validate .
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The NPM wrapper delegates to the Python CLI, so the Python dependencies in `requirements.txt` must be installed in the environment used by `cox-protocol`. Set `COX_PYTHON=/path/to/python` if the desired interpreter is not `python3`.
|
|
159
|
+
|
|
160
|
+
For a device-by-device installation walkthrough, see `guides/npm-installation.md`.
|
|
161
|
+
|
|
162
|
+
Package the VS Code extension locally:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
cd editor-support/vscode
|
|
166
|
+
npm run package
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Public publishing still requires verified NPM, PyPI, and VS Code Marketplace credentials. Before publishing, confirm the repository URLs in `package.json`, `pyproject.toml`, and `editor-support/vscode/package.json` point to the final public repository.
|
|
170
|
+
|
|
171
|
+
## Example Layout
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
LocalAppManager/
|
|
175
|
+
Dashboard/
|
|
176
|
+
dashboard.cox
|
|
177
|
+
dashboard_screenshot.placeholder.txt
|
|
178
|
+
left_navigation_sidebar/
|
|
179
|
+
left_navigation_sidebar.cox
|
|
180
|
+
left_navigation_sidebar_screenshot.placeholder.txt
|
|
181
|
+
top_header_stats_bar/
|
|
182
|
+
top_header_stats_bar.cox
|
|
183
|
+
top_header_stats_bar_screenshot.placeholder.txt
|
|
184
|
+
projects_grid_cards/
|
|
185
|
+
projects_grid_cards.cox
|
|
186
|
+
projects_grid_cards_screenshot.placeholder.txt
|
|
187
|
+
analytics_sidebar_panels/
|
|
188
|
+
analytics_sidebar_panels.cox
|
|
189
|
+
analytics_sidebar_panels_screenshot.placeholder.txt
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
The formal COX rules live in `COX_FILE_FORMAT_SPECIFICATION_v1.0.md`, and the executable contract lives in the schema files under `schemas/`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const scriptPath = fileURLToPath(import.meta.url);
|
|
7
|
+
const packageRoot = path.resolve(path.dirname(scriptPath), "..");
|
|
8
|
+
const python = process.env.COX_PYTHON || "python3";
|
|
9
|
+
const pythonPath = [packageRoot, process.env.PYTHONPATH]
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.join(path.delimiter);
|
|
12
|
+
const pythonEnv = {
|
|
13
|
+
...process.env,
|
|
14
|
+
PYTHONPATH: pythonPath,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const dependencyCheck = spawnSync(
|
|
18
|
+
python,
|
|
19
|
+
["-c", "import typer, yaml, jsonschema, rich"],
|
|
20
|
+
{
|
|
21
|
+
cwd: process.cwd(),
|
|
22
|
+
env: pythonEnv,
|
|
23
|
+
stdio: "pipe",
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
if (dependencyCheck.status !== 0) {
|
|
28
|
+
console.error(
|
|
29
|
+
`Python dependencies for COX are missing in ${python}.`,
|
|
30
|
+
);
|
|
31
|
+
console.error(
|
|
32
|
+
"Install them with `python3 -m pip install PyYAML jsonschema typer rich` or point COX_PYTHON at an environment that already has them.",
|
|
33
|
+
);
|
|
34
|
+
process.exit(dependencyCheck.status ?? 1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const result = spawnSync(
|
|
38
|
+
python,
|
|
39
|
+
["-m", "tools.cox_cli", ...process.argv.slice(2)],
|
|
40
|
+
{
|
|
41
|
+
cwd: process.cwd(),
|
|
42
|
+
env: pythonEnv,
|
|
43
|
+
stdio: "inherit",
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
if (result.error) {
|
|
48
|
+
console.error(
|
|
49
|
+
`Unable to run COX Python CLI with ${python}: ${result.error.message}`,
|
|
50
|
+
);
|
|
51
|
+
console.error(
|
|
52
|
+
"Install Python dependencies with `python -m pip install PyYAML jsonschema typer rich` or set COX_PYTHON.",
|
|
53
|
+
);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
process.exit(result.status ?? 1);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
- Added installable extension metadata for COX Language Support
|
|
6
|
+
- Added COX authoring snippets for all primary document types
|
|
7
|
+
- Improved COX keyword highlighting while preserving YAML-derived tokenization
|
|
8
|
+
- Documented local VSIX packaging workflow
|
|
9
|
+
|
|
10
|
+
## 1.0.0
|
|
11
|
+
|
|
12
|
+
- Initial language registration, configuration, and basic grammar scaffold
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Charbel Malo
|
|
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.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# COX Language Support
|
|
2
|
+
|
|
3
|
+
COX Language Support adds syntax highlighting, editor configuration, and authoring snippets for `.cox` files.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Dedicated `cox` language registration for `.cox`
|
|
8
|
+
- YAML-derived tokenization via `source.yaml` grammar inclusion
|
|
9
|
+
- COX header highlighting for versioned metadata fields
|
|
10
|
+
- Authoring snippets for manifest, page, component, protocol, and crop metadata documents
|
|
11
|
+
- Installable VSIX packaging surface for local use or Marketplace preparation
|
|
12
|
+
|
|
13
|
+
## Included Snippets
|
|
14
|
+
|
|
15
|
+
- `cox-header`: common COX header
|
|
16
|
+
- `cox-manifest`: manifest skeleton
|
|
17
|
+
- `cox-page`: page spec skeleton
|
|
18
|
+
- `cox-component`: component spec skeleton
|
|
19
|
+
- `cox-protocol`: protocol doc skeleton
|
|
20
|
+
- `cox-crop`: crop metadata skeleton
|
|
21
|
+
|
|
22
|
+
## Packaging
|
|
23
|
+
|
|
24
|
+
Create a local VSIX package from this folder:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
vsce package --out ../../build/vscode/cox-language-support-1.1.0.vsix
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Notes
|
|
31
|
+
|
|
32
|
+
COX inherits YAML-like syntax highlighting through TextMate grammar inclusion, but native VS Code contribution points do not provide full JSON Schema validation for custom YAML-compatible languages. Schema validation remains available through the repository CLI and bundled schema files in the main COX project.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comments": {
|
|
3
|
+
"lineComment": "#"
|
|
4
|
+
},
|
|
5
|
+
"brackets": [
|
|
6
|
+
[
|
|
7
|
+
"{",
|
|
8
|
+
"}"
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
"[",
|
|
12
|
+
"]"
|
|
13
|
+
]
|
|
14
|
+
],
|
|
15
|
+
"autoClosingPairs": [
|
|
16
|
+
{
|
|
17
|
+
"open": "{",
|
|
18
|
+
"close": "}"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"open": "[",
|
|
22
|
+
"close": "]"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"open": "\"",
|
|
26
|
+
"close": "\""
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"surroundingPairs": [
|
|
30
|
+
[
|
|
31
|
+
"{",
|
|
32
|
+
"}"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"[",
|
|
36
|
+
"]"
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"\"",
|
|
40
|
+
"\""
|
|
41
|
+
]
|
|
42
|
+
],
|
|
43
|
+
"indentationRules": {
|
|
44
|
+
"increaseIndentPattern": "^.*:\\s*$",
|
|
45
|
+
"decreaseIndentPattern": "^\\s*[\\]}].*$"
|
|
46
|
+
}
|
|
47
|
+
}
|