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,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cox-language-support",
|
|
3
|
+
"displayName": "COX Language Support",
|
|
4
|
+
"description": "Syntax highlighting, snippets, and packaging support for COX files.",
|
|
5
|
+
"version": "1.1.0",
|
|
6
|
+
"publisher": "charbelmalo",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"preview": true,
|
|
9
|
+
"markdown": "github",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/charbelmalo/cox-protocol-package.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/charbelmalo/cox-protocol-package#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/charbelmalo/cox-protocol-package/issues"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"vscode": "^1.90.0"
|
|
20
|
+
},
|
|
21
|
+
"categories": [
|
|
22
|
+
"Programming Languages",
|
|
23
|
+
"Snippets"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"cox",
|
|
27
|
+
"yaml",
|
|
28
|
+
"design-spec",
|
|
29
|
+
"ui-spec",
|
|
30
|
+
"component-spec",
|
|
31
|
+
"agent-readable"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"package": "vsce package --out ../../build/vscode/cox-language-support-1.1.0.vsix"
|
|
35
|
+
},
|
|
36
|
+
"contributes": {
|
|
37
|
+
"languages": [
|
|
38
|
+
{
|
|
39
|
+
"id": "cox",
|
|
40
|
+
"aliases": [
|
|
41
|
+
"COX",
|
|
42
|
+
"cox"
|
|
43
|
+
],
|
|
44
|
+
"extensions": [
|
|
45
|
+
".cox"
|
|
46
|
+
],
|
|
47
|
+
"configuration": "./language-configuration.json"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"grammars": [
|
|
51
|
+
{
|
|
52
|
+
"language": "cox",
|
|
53
|
+
"scopeName": "source.cox",
|
|
54
|
+
"path": "./syntaxes/cox.tmLanguage.json"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"snippets": [
|
|
58
|
+
{
|
|
59
|
+
"language": "cox",
|
|
60
|
+
"path": "./snippets/cox-common.json"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"language": "cox",
|
|
64
|
+
"path": "./snippets/cox-manifest.json"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"language": "cox",
|
|
68
|
+
"path": "./snippets/cox-page.json"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"language": "cox",
|
|
72
|
+
"path": "./snippets/cox-component.json"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"language": "cox",
|
|
76
|
+
"path": "./snippets/cox-protocol.json"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"language": "cox",
|
|
80
|
+
"path": "./snippets/cox-crop-metadata.json"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"configurationDefaults": {
|
|
84
|
+
"[cox]": {
|
|
85
|
+
"editor.insertSpaces": true,
|
|
86
|
+
"editor.tabSize": 2
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COX Header": {
|
|
3
|
+
"prefix": "cox-header",
|
|
4
|
+
"body": [
|
|
5
|
+
"CoxVersion: \"1.0\"",
|
|
6
|
+
"FileType: \"${1|manifest,page_spec,component_spec,protocol_doc,crop_metadata|}\"",
|
|
7
|
+
"Slug: \"${2:my_slug}\"",
|
|
8
|
+
"Schema: \"${3|cox.manifest.v1,cox.page.v1,cox.component.v1,cox.protocol.v1,cox.crop_metadata.v1|}\""
|
|
9
|
+
],
|
|
10
|
+
"description": "Insert the common COX v1.0 document header"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COX Component Spec": {
|
|
3
|
+
"prefix": "cox-component",
|
|
4
|
+
"body": [
|
|
5
|
+
"CoxVersion: \"1.0\"",
|
|
6
|
+
"FileType: \"component_spec\"",
|
|
7
|
+
"ComponentName: \"${1:projects_grid_cards}\"",
|
|
8
|
+
"Slug: \"${1:projects_grid_cards}\"",
|
|
9
|
+
"Schema: \"cox.component.v1\"",
|
|
10
|
+
"Role: \"${2:Describe the component role}\"",
|
|
11
|
+
"EvidenceSummary:",
|
|
12
|
+
" Visible: []",
|
|
13
|
+
" UserSpecified: []",
|
|
14
|
+
" Inferred: []",
|
|
15
|
+
" Intended: []",
|
|
16
|
+
" Recommended: []",
|
|
17
|
+
"NamingDecision:",
|
|
18
|
+
" ChosenName: \"${1:projects_grid_cards}\"",
|
|
19
|
+
" Reason: \"${3:Reason for the component name}\"",
|
|
20
|
+
" RejectedAlternatives: []",
|
|
21
|
+
" AmbiguityRisk: \"Low\"",
|
|
22
|
+
" EvidenceLevel: \"UserSpecified\"",
|
|
23
|
+
"VisibleStructure:",
|
|
24
|
+
" Regions: []",
|
|
25
|
+
"VisualStyle:",
|
|
26
|
+
" Tokens: []",
|
|
27
|
+
"Interactions:",
|
|
28
|
+
" Visible: []",
|
|
29
|
+
" Inferred: []",
|
|
30
|
+
" Intended: []",
|
|
31
|
+
" Recommended: []",
|
|
32
|
+
"Responsive:",
|
|
33
|
+
" Desktop: \"\"",
|
|
34
|
+
" Tablet: \"\"",
|
|
35
|
+
" Mobile: \"\"",
|
|
36
|
+
"ImplementationHints: []",
|
|
37
|
+
"ChildSubcomponents: []"
|
|
38
|
+
],
|
|
39
|
+
"description": "Insert a COX component specification skeleton"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COX Crop Metadata": {
|
|
3
|
+
"prefix": "cox-crop",
|
|
4
|
+
"body": [
|
|
5
|
+
"CoxVersion: \"1.0\"",
|
|
6
|
+
"FileType: \"crop_metadata\"",
|
|
7
|
+
"Slug: \"${1:component_crop_metadata}\"",
|
|
8
|
+
"Schema: \"cox.crop_metadata.v1\"",
|
|
9
|
+
"SourceScreenshot: \"${2:dashboard_screenshot.png}\"",
|
|
10
|
+
"OutputScreenshot: \"${3:component_screenshot.png}\"",
|
|
11
|
+
"BoundaryConfidence: \"${4|High,Medium,Low|}\"",
|
|
12
|
+
"EstimatedBoundingBox:",
|
|
13
|
+
" Unit: \"${5|px,percent|}\"",
|
|
14
|
+
" X: \"\"",
|
|
15
|
+
" Y: \"\"",
|
|
16
|
+
" Width: \"\"",
|
|
17
|
+
" Height: \"\"",
|
|
18
|
+
"IncludedPaddingReason: \"${6:Preserve visible shadow and edge spacing}\"",
|
|
19
|
+
"ExcludedRegions: []"
|
|
20
|
+
],
|
|
21
|
+
"description": "Insert a COX crop metadata skeleton"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COX Manifest": {
|
|
3
|
+
"prefix": "cox-manifest",
|
|
4
|
+
"body": [
|
|
5
|
+
"CoxVersion: \"1.0\"",
|
|
6
|
+
"FileType: \"manifest\"",
|
|
7
|
+
"Slug: \"${1:project_slug}\"",
|
|
8
|
+
"Schema: \"cox.manifest.v1\"",
|
|
9
|
+
"ProjectName: \"${2:ProjectName}\"",
|
|
10
|
+
"PackageName: \"${3:project.zip}\"",
|
|
11
|
+
"ProtocolExtension: \".cox\"",
|
|
12
|
+
"MimeType: \"application/vnd.cox+yaml\"",
|
|
13
|
+
"Encoding: \"UTF-8\"",
|
|
14
|
+
"SyntaxBase: \"YAML-compatible structured text\"",
|
|
15
|
+
"EntryPoint: \"manifest.cox\"",
|
|
16
|
+
"ReferenceDocs:",
|
|
17
|
+
" - \"README.md\"",
|
|
18
|
+
"ProtocolDocs:",
|
|
19
|
+
" - \"${4:protocols/example_protocol.cox}\"",
|
|
20
|
+
"Schemas:",
|
|
21
|
+
" - \"schemas/cox.manifest.v1.schema.json\"",
|
|
22
|
+
"ToolingFiles:",
|
|
23
|
+
" - \"tools/cox_cli.py\"",
|
|
24
|
+
"Pages:",
|
|
25
|
+
" - PageName: \"${5:Dashboard}\"",
|
|
26
|
+
" Slug: \"${6:dashboard}\"",
|
|
27
|
+
" Folder: \"${7:LocalAppManager/Dashboard}\"",
|
|
28
|
+
" PageInstruction: \"${8:LocalAppManager/Dashboard/dashboard.cox}\"",
|
|
29
|
+
" PageScreenshotPlaceholder: \"${9:LocalAppManager/Dashboard/dashboard_screenshot.placeholder.txt}\"",
|
|
30
|
+
" Components: []",
|
|
31
|
+
"BuildTargets:",
|
|
32
|
+
" - \"json\"",
|
|
33
|
+
" - \"react\"",
|
|
34
|
+
"VerificationRules:",
|
|
35
|
+
" - \"${10:Validation must parse YAML, apply JSON Schema, and check referenced paths.}\""
|
|
36
|
+
],
|
|
37
|
+
"description": "Insert a COX manifest skeleton"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COX Page Spec": {
|
|
3
|
+
"prefix": "cox-page",
|
|
4
|
+
"body": [
|
|
5
|
+
"CoxVersion: \"1.0\"",
|
|
6
|
+
"FileType: \"page_spec\"",
|
|
7
|
+
"PageName: \"${1:Dashboard}\"",
|
|
8
|
+
"Slug: \"${2:dashboard}\"",
|
|
9
|
+
"Schema: \"cox.page.v1\"",
|
|
10
|
+
"ProjectName: \"${3:LocalAppManager}\"",
|
|
11
|
+
"PageType: \"${4:dashboard_overview}\"",
|
|
12
|
+
"EvidenceSummary:",
|
|
13
|
+
" Visible: []",
|
|
14
|
+
" UserSpecified: []",
|
|
15
|
+
" Inferred: []",
|
|
16
|
+
" Intended: []",
|
|
17
|
+
" Recommended: []",
|
|
18
|
+
"VisibleStructure:",
|
|
19
|
+
" Regions: []",
|
|
20
|
+
"NamingDecision:",
|
|
21
|
+
" ChosenName: \"${1:Dashboard}\"",
|
|
22
|
+
" Reason: \"${5:Reason for the page name}\"",
|
|
23
|
+
" RejectedAlternatives: []",
|
|
24
|
+
" AmbiguityRisk: \"Low\"",
|
|
25
|
+
" EvidenceLevel: \"UserSpecified\"",
|
|
26
|
+
"Layout:",
|
|
27
|
+
" Desktop: \"\"",
|
|
28
|
+
" Tablet: \"\"",
|
|
29
|
+
" Mobile: \"\"",
|
|
30
|
+
"Children:",
|
|
31
|
+
" Components: []",
|
|
32
|
+
"Interactions:",
|
|
33
|
+
" Visible: []",
|
|
34
|
+
" Inferred: []",
|
|
35
|
+
" Intended: []",
|
|
36
|
+
" Recommended: []",
|
|
37
|
+
"RecursiveDecompositionDecision:",
|
|
38
|
+
" Complexity: \"ModeratePage\"",
|
|
39
|
+
" Reason: \"\"",
|
|
40
|
+
" Action: \"\""
|
|
41
|
+
],
|
|
42
|
+
"description": "Insert a COX page specification skeleton"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"COX Protocol Doc": {
|
|
3
|
+
"prefix": "cox-protocol",
|
|
4
|
+
"body": [
|
|
5
|
+
"CoxVersion: \"1.0\"",
|
|
6
|
+
"FileType: \"protocol_doc\"",
|
|
7
|
+
"Slug: \"${1:protocol_slug}\"",
|
|
8
|
+
"Schema: \"cox.protocol.v1\"",
|
|
9
|
+
"ProtocolName: \"${2:Protocol Name}\"",
|
|
10
|
+
"Purpose: \"${3:Describe the protocol purpose}\"",
|
|
11
|
+
"${4:SectionName}:",
|
|
12
|
+
" ${5:Key}: \"${6:Value}\""
|
|
13
|
+
],
|
|
14
|
+
"description": "Insert a COX protocol document skeleton"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
3
|
+
"name": "COX",
|
|
4
|
+
"scopeName": "source.cox",
|
|
5
|
+
"patterns": [
|
|
6
|
+
{
|
|
7
|
+
"match": "^(CoxVersion|FileType|Slug|Schema|PageName|ProjectName|ComponentName|ProtocolName|MimeType|Encoding|SyntaxBase|EntryPoint)(?=:\\s)",
|
|
8
|
+
"name": "keyword.control.cox"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"match": "^(EvidenceSummary|VisibleStructure|Interactions|NamingDecision|Layout|Children|Responsive|VisualStyle|ImplementationHints|BuildTargets|VerificationRules|ReferenceDocs|ProtocolDocs|Schemas|ToolingFiles)(?=:\\s)",
|
|
12
|
+
"name": "entity.name.section.cox"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"match": "\b(manifest|page_spec|component_spec|protocol_doc|crop_metadata)\b",
|
|
16
|
+
"name": "storage.type.cox"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"match": "\bcox\\.(manifest|page|component|protocol|crop_metadata)\\.v1\b",
|
|
20
|
+
"name": "support.type.schema.cox"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"match": "\b(Visible|UserSpecified|Inferred|Intended|Recommended|High|Medium|Low)\b",
|
|
24
|
+
"name": "constant.language.cox"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"include": "source.yaml"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Imported Package Audit: cox_protocol_package_compiled.zip
|
|
2
|
+
|
|
3
|
+
## Classification
|
|
4
|
+
|
|
5
|
+
`cox_protocol_package_compiled.zip` is a legacy compiled/source snapshot of this same COX protocol package. Its contents overlap with the current repository: sample `LocalAppManager` COX files, root protocol `.cox` files, templates, `README.md`, `manifest.cox`, `verification_report.txt`, and `zip_content_listing.txt`.
|
|
6
|
+
|
|
7
|
+
## Intake Decision
|
|
8
|
+
|
|
9
|
+
The archive was inspected and staged before any merge. No unsafe absolute paths or `..` traversal entries were found.
|
|
10
|
+
|
|
11
|
+
The archive was not extracted into the live source tree because its `.cox` protocol files use the older pre-COX-v1 header shape and would conflict with the current `protocols/` layout, schema validation, compiler targets, NPM metadata, and deterministic package emitter.
|
|
12
|
+
|
|
13
|
+
Current live files are newer and supersede the snapshot. The correct action is to keep this audit note as provenance and continue using the upgraded package source.
|
|
14
|
+
|
|
15
|
+
## Archive Contents Summary
|
|
16
|
+
|
|
17
|
+
- `LocalAppManager/Dashboard/**`: sample page and component specs with screenshot placeholders.
|
|
18
|
+
- Root protocol docs: legacy versions of the protocol `.cox` files now stored under `protocols/`.
|
|
19
|
+
- `templates/`: page, component, and crop metadata templates.
|
|
20
|
+
- Root docs: `README.md`, `verification_report.txt`, and `zip_content_listing.txt`.
|
|
21
|
+
- `manifest.cox`: legacy package manifest shape.
|
|
22
|
+
|
|
23
|
+
## Cross-Examination Result
|
|
24
|
+
|
|
25
|
+
- Current package target is implemented in `tools/package_target.py`; the archive only documents a package expectation.
|
|
26
|
+
- Current manifest supports `GuideDocs`, `SkillBundles`, and `BuildTargets` values `json`, `react`, and `package`.
|
|
27
|
+
- Current protocol docs include COX v1.0 headers and schema ids; the archive's legacy protocol docs do not.
|
|
28
|
+
- Current build emits normalized protocol outputs under `build/normalized/protocols/`; the archive predates that grouping.
|
|
29
|
+
|
|
30
|
+
## Status
|
|
31
|
+
|
|
32
|
+
Accepted as an audited legacy source snapshot. No live source overwrite was performed.
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
# Publishing And Installing COX With NPM
|
|
2
|
+
|
|
3
|
+
This package ships an NPM command named `cox-protocol`. The command delegates to the Python COX CLI bundled in the package, so target machines need both Node.js and Python.
|
|
4
|
+
|
|
5
|
+
If the target machine has multiple Python installations, set `COX_PYTHON` to the interpreter that has the COX dependencies installed.
|
|
6
|
+
|
|
7
|
+
> Note: This NPM package installs the `cox-protocol` command wrapper and the COX package files. The target machine must also have Python 3.10+ and the required Python packages:
|
|
8
|
+
>
|
|
9
|
+
> ```bash
|
|
10
|
+
> python3 -m pip install PyYAML jsonschema typer rich
|
|
11
|
+
> ```
|
|
12
|
+
>
|
|
13
|
+
> Optional when you need to force a specific interpreter:
|
|
14
|
+
>
|
|
15
|
+
> ```bash
|
|
16
|
+
> export COX_PYTHON=/path/to/python
|
|
17
|
+
> ```
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
- Node.js 18 or newer
|
|
22
|
+
- Python 3.10 or newer
|
|
23
|
+
- `pip` available for the Python interpreter you want COX to use
|
|
24
|
+
- An npm account with two-factor authentication or an appropriate granular publishing token
|
|
25
|
+
|
|
26
|
+
## Check `package.json`
|
|
27
|
+
|
|
28
|
+
Run all publishing commands from the repository root folder that contains `package.json`.
|
|
29
|
+
|
|
30
|
+
The publish metadata should include:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"name": "cox-protocol-package",
|
|
35
|
+
"version": "1.0.0",
|
|
36
|
+
"description": "NPM wrapper and distribution package for the COX protocol CLI.",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"bin": {
|
|
39
|
+
"cox-protocol": "./bin/cox-protocol.js"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"bin",
|
|
43
|
+
"COX_FILE_FORMAT_SPECIFICATION_v1.0.md",
|
|
44
|
+
"LICENSE",
|
|
45
|
+
"README.md",
|
|
46
|
+
"guides",
|
|
47
|
+
"manifest.cox",
|
|
48
|
+
"protocols",
|
|
49
|
+
"pyproject.toml",
|
|
50
|
+
"requirements.txt",
|
|
51
|
+
"schemas",
|
|
52
|
+
"skills",
|
|
53
|
+
"templates",
|
|
54
|
+
"tools"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The `bin` field makes `cox-protocol` available after a global install. The wrapper file must be executable and start with a Node shebang:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
chmod +x bin/cox-protocol.js
|
|
63
|
+
head -n 1 bin/cox-protocol.js
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Expected first line:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
#!/usr/bin/env node
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Check Package Name Availability
|
|
73
|
+
|
|
74
|
+
Unscoped npm package names are public and globally unique. Check the current package name:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm view cox-protocol-package
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If npm returns package info, the name is already taken. If it returns a 404, the name can be used.
|
|
81
|
+
|
|
82
|
+
As of the last local check for this package, both `cox-protocol-package` and `cox-protocol` returned no package version from `npm view`, so either name appeared available. Recheck immediately before publishing because npm names can be claimed at any time.
|
|
83
|
+
|
|
84
|
+
A shorter public name may be better if it is available:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm view cox-protocol
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
If `cox-protocol` is available and you want that name, update `package.json` before publishing:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"name": "cox-protocol"
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then users install:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm install -g cox-protocol
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Log In To NPM
|
|
105
|
+
|
|
106
|
+
Create an npm account, then log in:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm login
|
|
110
|
+
npm whoami
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If your account has 2FA enabled, expect an OTP prompt during login or publish. For CI, use a granular npm token with publish permissions.
|
|
114
|
+
|
|
115
|
+
## Preview The Published Contents
|
|
116
|
+
|
|
117
|
+
Run a dry run first:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npm pack --dry-run
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Then create and inspect the actual tarball:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm pack
|
|
127
|
+
tar -tzf cox-protocol-package-1.0.0.tgz
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Confirm the tarball includes:
|
|
131
|
+
|
|
132
|
+
- `package.json`
|
|
133
|
+
- `README.md`
|
|
134
|
+
- `bin/cox-protocol.js`
|
|
135
|
+
- `tools/` Python CLI files
|
|
136
|
+
- `schemas/`, `protocols/`, `templates/`, `guides/`, and `skills/`
|
|
137
|
+
|
|
138
|
+
Confirm it does not include:
|
|
139
|
+
|
|
140
|
+
- secrets or `.env` files
|
|
141
|
+
- `.venv/`
|
|
142
|
+
- `.git/`
|
|
143
|
+
- `node_modules/`
|
|
144
|
+
- `__pycache__/` or `*.pyc`
|
|
145
|
+
- generated tarballs or raw intake ZIPs
|
|
146
|
+
- unrelated build or test artifacts
|
|
147
|
+
|
|
148
|
+
## Test The Tarball Locally
|
|
149
|
+
|
|
150
|
+
From another temporary folder:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npm install -g /path/to/cox-protocol-package-1.0.0.tgz
|
|
154
|
+
python3 -m pip install PyYAML jsonschema typer rich
|
|
155
|
+
cox-protocol --help
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Then test a real COX project:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
cd /path/to/cox/project
|
|
162
|
+
cox-protocol validate .
|
|
163
|
+
cox-protocol compile . --target json --target react --target package --out build
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Publish To NPM
|
|
167
|
+
|
|
168
|
+
For an unscoped public package such as `cox-protocol-package`:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npm publish
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
NPM publishes unscoped packages to the public registry by default. Publishing fails if the same package name and version already exists. Once a version is published, that exact version cannot be reused, even if it is later unpublished.
|
|
175
|
+
|
|
176
|
+
For a scoped package, such as `@charbel/cox-protocol`, the first public publish must include `--access public`:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
npm publish --access public
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Scoped packages are not public by default on initial publish.
|
|
183
|
+
|
|
184
|
+
## Verify Public Installation
|
|
185
|
+
|
|
186
|
+
After publishing:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
npm view cox-protocol-package
|
|
190
|
+
npm install -g cox-protocol-package
|
|
191
|
+
cox-protocol --help
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Then verify a real project:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
python3 -m pip install PyYAML jsonschema typer rich
|
|
198
|
+
cd /path/to/cox/project
|
|
199
|
+
cox-protocol validate .
|
|
200
|
+
cox-protocol compile . --target json --target react --target package --out build
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Install From NPM After Publication
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npm install -g cox-protocol-package
|
|
207
|
+
python3 -m pip install PyYAML jsonschema typer rich
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Then validate a COX project:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
cd /path/to/cox/project
|
|
214
|
+
cox-protocol validate .
|
|
215
|
+
cox-protocol compile . --target json --target react --target package --out build
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Install From A Local NPM Tarball
|
|
219
|
+
|
|
220
|
+
On the development machine, create the tarball:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npm pack
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Copy `cox-protocol-package-1.0.0.tgz` to the other device, then install it there:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
npm install -g ./cox-protocol-package-1.0.0.tgz
|
|
230
|
+
python3 -m pip install PyYAML jsonschema typer rich
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Run the same smoke test from any COX project folder:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
cox-protocol validate .
|
|
237
|
+
cox-protocol compile . --target json --target react --target package --out build
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Use A Specific Python Interpreter
|
|
241
|
+
|
|
242
|
+
If the device has multiple Python installations, set `COX_PYTHON`:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
COX_PYTHON=/path/to/python3 cox-protocol validate .
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
For a virtual environment:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
python3 -m venv .venv
|
|
252
|
+
. .venv/bin/activate
|
|
253
|
+
python -m pip install PyYAML jsonschema typer rich
|
|
254
|
+
COX_PYTHON="$PWD/.venv/bin/python" cox-protocol validate .
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Publish Updates Later
|
|
258
|
+
|
|
259
|
+
Every new publish needs a new version:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
npm version patch
|
|
263
|
+
npm publish
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
For larger changes:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
npm version minor
|
|
270
|
+
npm publish
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
or:
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npm version major
|
|
277
|
+
npm publish
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Minimum Manual Publish Sequence
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
npm login
|
|
284
|
+
npm whoami
|
|
285
|
+
npm pack --dry-run
|
|
286
|
+
npm pack
|
|
287
|
+
npm install -g ./cox-protocol-package-1.0.0.tgz
|
|
288
|
+
python3 -m pip install PyYAML jsonschema typer rich
|
|
289
|
+
cox-protocol --help
|
|
290
|
+
npm publish
|
|
291
|
+
npm view cox-protocol-package
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Current Limitation
|
|
295
|
+
|
|
296
|
+
The NPM package is a distribution wrapper, not a TypeScript-native compiler. Python dependencies must be installed separately until the compiler is ported to Node.js or the NPM package gains an installer that manages the Python environment.
|