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,96 @@
|
|
|
1
|
+
CoxVersion: "1.0"
|
|
2
|
+
FileType: "protocol_doc"
|
|
3
|
+
Slug: "recursive_decomposition_protocol"
|
|
4
|
+
Schema: "cox.protocol.v1"
|
|
5
|
+
ProtocolName: "Recursive Decomposition Protocol"
|
|
6
|
+
Purpose: "Decide when to keep a screenshot as one .cox file and when to split into component/subcomponent folders."
|
|
7
|
+
|
|
8
|
+
Principle:
|
|
9
|
+
Statement: "Decompose only until each file is clear, named deterministically, and implementation-ready. Do not split for its own sake."
|
|
10
|
+
|
|
11
|
+
ComplexityLevels:
|
|
12
|
+
SimplePage:
|
|
13
|
+
Criteria:
|
|
14
|
+
- "One dominant purpose"
|
|
15
|
+
- "One primary form, panel, or content region"
|
|
16
|
+
- "Few interactive states"
|
|
17
|
+
- "No major nested component ambiguity"
|
|
18
|
+
Action: "Create only {page_slug}.cox plus {page_slug}_screenshot."
|
|
19
|
+
Example: "Minimal sign-in page"
|
|
20
|
+
ModeratePage:
|
|
21
|
+
Criteria:
|
|
22
|
+
- "Two to five distinguishable components"
|
|
23
|
+
- "Components have clear names and boundaries"
|
|
24
|
+
- "Interactions are localized"
|
|
25
|
+
Action: "Create {page_slug}.cox plus component folders."
|
|
26
|
+
ComplexPage:
|
|
27
|
+
Criteria:
|
|
28
|
+
- "More than five components"
|
|
29
|
+
- "Dense dashboard, analytics, sidebar, grid, toolbar, charts, modals, or nested states"
|
|
30
|
+
- "Some components require creative implementation reasoning"
|
|
31
|
+
Action: "Create {page_slug}.cox, component folders, and subcomponent folders only where needed."
|
|
32
|
+
|
|
33
|
+
DecompositionDecisionTree:
|
|
34
|
+
- Question: "Can the page be explained accurately in one {page_slug}.cox without becoming long or ambiguous?"
|
|
35
|
+
Yes: "Do not split."
|
|
36
|
+
No: "Identify primary components."
|
|
37
|
+
- Question: "Are component boundaries visually distinguishable?"
|
|
38
|
+
Yes: "Create component folders."
|
|
39
|
+
No: "Use {page_slug}.cox with internal regions and mark boundaries as Inferred."
|
|
40
|
+
- Question: "Would a component name need vague or overly specific wording to be unique?"
|
|
41
|
+
Yes: "Split or rename using purpose/domain; validate sibling names."
|
|
42
|
+
No: "Keep component as-is."
|
|
43
|
+
- Question: "Does the component contain multi-layered visual logic, expandable interactions, nested states, or creative animation?"
|
|
44
|
+
Yes: "Create ComplexSubcomponentName folders."
|
|
45
|
+
No: "Keep inside component .cox."
|
|
46
|
+
|
|
47
|
+
PageCoxResponsibility:
|
|
48
|
+
Includes:
|
|
49
|
+
- "Page purpose"
|
|
50
|
+
- "Global layout grid"
|
|
51
|
+
- "Component map"
|
|
52
|
+
- "Responsive variants"
|
|
53
|
+
- "Page-level interactions"
|
|
54
|
+
- "Links to child component .cox files"
|
|
55
|
+
Excludes:
|
|
56
|
+
- "Deep per-component implementation details when child folder exists"
|
|
57
|
+
|
|
58
|
+
ComponentCoxResponsibility:
|
|
59
|
+
Includes:
|
|
60
|
+
- "Component purpose"
|
|
61
|
+
- "Visible structure"
|
|
62
|
+
- "Styling tokens"
|
|
63
|
+
- "States and interactions"
|
|
64
|
+
- "Data bindings"
|
|
65
|
+
- "Implementation hints"
|
|
66
|
+
- "Links to subcomponent .cox files if present"
|
|
67
|
+
|
|
68
|
+
ComplexSubcomponentCoxResponsibility:
|
|
69
|
+
IncludeOnlyWhen:
|
|
70
|
+
- "Subcomponent needs special creative reasoning"
|
|
71
|
+
- "Subcomponent has independent motion, states, interactions, data, or security/testing notes"
|
|
72
|
+
- "Component .cox would otherwise become ambiguous or too long"
|
|
73
|
+
|
|
74
|
+
OverEngineeringGuardrails:
|
|
75
|
+
- "Do not create subcomponents for every button, icon, or text label."
|
|
76
|
+
- "Do not split a simple sign-in page unless user explicitly asks."
|
|
77
|
+
- "Do not split merely because visual elements exist; split because explanation or implementation benefits."
|
|
78
|
+
- "Prefer one clear component over many fragile micro-components."
|
|
79
|
+
|
|
80
|
+
RecursiveFlow:
|
|
81
|
+
ConstructHierarchyFirst:
|
|
82
|
+
- "Project"
|
|
83
|
+
- "Pages"
|
|
84
|
+
- "Responsive page variants"
|
|
85
|
+
- "Components"
|
|
86
|
+
- "Complex subcomponents"
|
|
87
|
+
ThenWriteFiles:
|
|
88
|
+
- "Root docs"
|
|
89
|
+
- "{page_slug}.cox files"
|
|
90
|
+
- "Component .cox files"
|
|
91
|
+
- "Subcomponent .cox files"
|
|
92
|
+
ThenValidate:
|
|
93
|
+
- "Names"
|
|
94
|
+
- "Evidence levels"
|
|
95
|
+
- "File existence"
|
|
96
|
+
- "Zip contents"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
CoxVersion: "1.0"
|
|
2
|
+
FileType: "protocol_doc"
|
|
3
|
+
Slug: "screenshot_partitioning_protocol"
|
|
4
|
+
Schema: "cox.protocol.v1"
|
|
5
|
+
ProtocolName: "Screenshot Partitioning Protocol"
|
|
6
|
+
Purpose: "Define how agents estimate section containers, borders, and crops from screenshots."
|
|
7
|
+
|
|
8
|
+
Inputs:
|
|
9
|
+
AcceptedFormats: ["png", "jpg", "jpeg", "webp"]
|
|
10
|
+
MinimumScreenshots: 1
|
|
11
|
+
|
|
12
|
+
PartitioningRules:
|
|
13
|
+
- "Always preserve the original full-page screenshot at page level."
|
|
14
|
+
- "Create component screenshots only when the component boundary is sufficiently clear."
|
|
15
|
+
- "Use visual section containers, borders, spacing, background changes, alignment, and hierarchy to estimate crop boundaries."
|
|
16
|
+
- "Include slight padding around crops so shadows, glows, popovers, badges, and floating controls are not clipped."
|
|
17
|
+
- "If a border is unclear, keep the broader region and mark boundary confidence as Medium or Low."
|
|
18
|
+
- "Do not crop out contextual labels required to understand the component."
|
|
19
|
+
- "Do not invent hidden offscreen UI."
|
|
20
|
+
|
|
21
|
+
BoundaryConfidence:
|
|
22
|
+
High:
|
|
23
|
+
Meaning: "Clear visual border, container, or region separation."
|
|
24
|
+
Action: "Crop component screenshot."
|
|
25
|
+
Medium:
|
|
26
|
+
Meaning: "Region is distinguishable by spacing/alignment, but edge is inferred."
|
|
27
|
+
Action: "Crop with padding and mark EstimatedBoundary."
|
|
28
|
+
Low:
|
|
29
|
+
Meaning: "Boundary is ambiguous or overlapping."
|
|
30
|
+
Action: "Avoid crop or use parent screenshot reference."
|
|
31
|
+
|
|
32
|
+
CropMetadataRequired:
|
|
33
|
+
Fields:
|
|
34
|
+
- "SourceScreenshot"
|
|
35
|
+
- "OutputScreenshot"
|
|
36
|
+
- "BoundaryConfidence"
|
|
37
|
+
- "EstimatedBoundingBox"
|
|
38
|
+
- "IncludedPaddingReason"
|
|
39
|
+
- "ExcludedRegions"
|
|
40
|
+
|
|
41
|
+
EstimatedBoundingBoxFormat:
|
|
42
|
+
Units: "pixels when known, percentage when exact pixel coordinates are not available"
|
|
43
|
+
Examples:
|
|
44
|
+
Pixel: "x:0 y:0 width:280 height:900"
|
|
45
|
+
Percent: "x:0% y:0% width:22% height:100%"
|
|
46
|
+
|
|
47
|
+
ResponsiveVariantHandling:
|
|
48
|
+
PageLevel:
|
|
49
|
+
Rule: "Desktop, tablet, and mobile variants stay in same Page folder when they represent the same page."
|
|
50
|
+
ComponentLevel:
|
|
51
|
+
Rule: "Component variant screenshots stay in the same component folder when they represent the same component."
|
|
52
|
+
Naming:
|
|
53
|
+
- "dashboard_screenshot_desktop.png"
|
|
54
|
+
- "dashboard_screenshot_tablet.png"
|
|
55
|
+
- "dashboard_screenshot_mobile.png"
|
|
56
|
+
- "{component_slug}_screenshot_desktop.png"
|
|
57
|
+
- "{component_slug}_screenshot_mobile.png"
|
|
58
|
+
|
|
59
|
+
AgenticToolInstruction:
|
|
60
|
+
RequiredBehavior:
|
|
61
|
+
- "Use vision models to identify regions before cropping."
|
|
62
|
+
- "Use image tools to crop only after a region plan is written."
|
|
63
|
+
- "Verify generated crop files exist on disk."
|
|
64
|
+
- "Record all crops in manifest.cox."
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
CoxVersion: "1.0"
|
|
2
|
+
FileType: "protocol_doc"
|
|
3
|
+
Slug: "sub_agents_orchestration"
|
|
4
|
+
Schema: "cox.protocol.v1"
|
|
5
|
+
ProtocolName: "Sub-Agents Orchestration"
|
|
6
|
+
Purpose: "Divide COX package generation into expert sub-agent responsibilities."
|
|
7
|
+
|
|
8
|
+
CoordinatorAgent:
|
|
9
|
+
Mission: "Own the full package contract, sequence sub-agents, and ensure final ZIP integrity."
|
|
10
|
+
Inputs: ["UserRequirements", "Screenshots", "ExistingArtifacts"]
|
|
11
|
+
Outputs: ["FinalZip", "manifest.cox", "VerificationReport"]
|
|
12
|
+
MustNot:
|
|
13
|
+
- "Claim files exist before checking disk."
|
|
14
|
+
|
|
15
|
+
RequirementsAnalystAgent:
|
|
16
|
+
Mission: "Extract project purpose, pages, platform constraints, style requirements, and explicit user naming preferences."
|
|
17
|
+
Outputs:
|
|
18
|
+
- "requirements_summary.cox"
|
|
19
|
+
- "ProjectName proposal"
|
|
20
|
+
- "PageName proposals"
|
|
21
|
+
|
|
22
|
+
VisionInspectorAgent:
|
|
23
|
+
Mission: "Inspect screenshots and identify page type, layout, visual hierarchy, components, responsive variants, and evidence levels."
|
|
24
|
+
Outputs:
|
|
25
|
+
- "visual_inventory.cox"
|
|
26
|
+
- "page_component_candidates"
|
|
27
|
+
- "boundary_confidence estimates"
|
|
28
|
+
|
|
29
|
+
NamingArchitectAgent:
|
|
30
|
+
Mission: "Apply deterministic naming convention, reject ambiguous names, and produce final Project/Page/Component/Subcomponent names."
|
|
31
|
+
Outputs:
|
|
32
|
+
- "naming_decisions.cox"
|
|
33
|
+
- "RejectedAlternatives"
|
|
34
|
+
- "AmbiguityValidationPass"
|
|
35
|
+
|
|
36
|
+
ScreenshotPartitionAgent:
|
|
37
|
+
Mission: "Create page-level and component-level screenshots using estimated containers and safe padding."
|
|
38
|
+
Outputs:
|
|
39
|
+
- "cropped component screenshots"
|
|
40
|
+
- "crop_metadata.cox"
|
|
41
|
+
Constraint: "Only crop when boundary confidence is High or Medium."
|
|
42
|
+
|
|
43
|
+
CoxSpecWriterAgent:
|
|
44
|
+
Mission: "Write {page_slug}.cox, component .cox, and complex subcomponent .cox files."
|
|
45
|
+
Outputs:
|
|
46
|
+
- "{page_slug}.cox"
|
|
47
|
+
- "{component_slug}.cox"
|
|
48
|
+
- "{subcomponent_slug}.cox"
|
|
49
|
+
|
|
50
|
+
LogicAndImplementationAgent:
|
|
51
|
+
Mission: "Write product logic, data flow, API routes, safe runtime controls, and coding-agent implementation plan."
|
|
52
|
+
Outputs:
|
|
53
|
+
- "protocols/website_logic_and_functionality.cox"
|
|
54
|
+
- "protocols/coding_agent_starting_point.cox"
|
|
55
|
+
|
|
56
|
+
DesignSystemAgent:
|
|
57
|
+
Mission: "Extract reusable visual tokens and component relationships."
|
|
58
|
+
Outputs:
|
|
59
|
+
- "protocols/design_tokens.cox"
|
|
60
|
+
- "protocols/component_binding_graph.cox"
|
|
61
|
+
|
|
62
|
+
ValidationAgent:
|
|
63
|
+
Mission: "Verify naming, evidence levels, file existence, UTF-8 text, screenshot/spec pairs, and zip contents."
|
|
64
|
+
Outputs:
|
|
65
|
+
- "manifest.cox"
|
|
66
|
+
- "protocols/visual_acceptance_checklist.cox"
|
|
67
|
+
- "zip_content_listing.txt"
|
|
68
|
+
|
|
69
|
+
ExecutionOrder:
|
|
70
|
+
- "CoordinatorAgent"
|
|
71
|
+
- "RequirementsAnalystAgent"
|
|
72
|
+
- "VisionInspectorAgent"
|
|
73
|
+
- "NamingArchitectAgent"
|
|
74
|
+
- "ScreenshotPartitionAgent"
|
|
75
|
+
- "DesignSystemAgent"
|
|
76
|
+
- "CoxSpecWriterAgent"
|
|
77
|
+
- "LogicAndImplementationAgent"
|
|
78
|
+
- "ValidationAgent"
|
|
79
|
+
- "CoordinatorAgent final zip assembly"
|
|
80
|
+
|
|
81
|
+
EscalationRules:
|
|
82
|
+
- "If naming ambiguity persists, split component or choose purpose-based name."
|
|
83
|
+
- "If boundary confidence is Low, do not crop; reference parent screenshot."
|
|
84
|
+
- "If a feature is not visible, mark as Inferred, Intended, or Recommended."
|
|
85
|
+
- "If a file is missing, do not include it in manifest as completed."
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
CoxVersion: "1.0"
|
|
2
|
+
FileType: "protocol_doc"
|
|
3
|
+
Slug: "visual_acceptance_checklist"
|
|
4
|
+
Schema: "cox.protocol.v1"
|
|
5
|
+
ProtocolName: "Visual Acceptance Checklist"
|
|
6
|
+
Purpose: "Give implementation agents concrete pass/fail checks for reconstructed UI."
|
|
7
|
+
|
|
8
|
+
GlobalChecks:
|
|
9
|
+
- "All page and component names match protocols/deterministic_naming_convention.cox."
|
|
10
|
+
- "Each page folder contains {page_slug}.cox and at least one {page_slug}_screenshot file."
|
|
11
|
+
- "Each component folder contains component_slug.cox and component_slug_screenshot if a crop was generated."
|
|
12
|
+
- "Evidence levels are present for visible, inferred, intended, and recommended behavior."
|
|
13
|
+
|
|
14
|
+
VisualChecks:
|
|
15
|
+
- "Glass surfaces use translucent cards, subtle border, and soft shadow."
|
|
16
|
+
- "Typography uses compact bold headings, readable body text, and muted metadata."
|
|
17
|
+
- "Card grids preserve spacing, radius, preview area, metadata density, and status badges."
|
|
18
|
+
- "Sidebar/header/analytics regions remain visually distinguishable."
|
|
19
|
+
- "Responsive layout degrades predictably from desktop to tablet to mobile."
|
|
20
|
+
|
|
21
|
+
InteractionChecks:
|
|
22
|
+
- "Hover states are subtle and native-feeling."
|
|
23
|
+
- "Active/selected states use primary accent without overwhelming layout."
|
|
24
|
+
- "Loading, empty, error, and unhealthy states are implemented where specified."
|
|
25
|
+
- "Runtime actions are guarded by safe confirmations where required."
|
|
26
|
+
|
|
27
|
+
NamingChecks:
|
|
28
|
+
- "No timestamp-named screenshots remain in final folders unless intentionally preserved as source references."
|
|
29
|
+
- "No sibling names are near-duplicates like left_sidebar and left_navigation."
|
|
30
|
+
- "Names are neither vague nor over-specific."
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
CoxVersion: "1.0"
|
|
2
|
+
FileType: "protocol_doc"
|
|
3
|
+
Slug: "website_logic_and_functionality"
|
|
4
|
+
Schema: "cox.protocol.v1"
|
|
5
|
+
ProtocolName: "Website Logic And Functionality"
|
|
6
|
+
Purpose: "Capture the product logic, state transitions, data model, and safety notes behind the COX sample application."
|
|
7
|
+
|
|
8
|
+
ProductPurpose:
|
|
9
|
+
Evidence: UserSpecified
|
|
10
|
+
Summary: "LocalAppManager helps users browse, monitor, launch, and inspect local projects/apps from a visual dashboard."
|
|
11
|
+
|
|
12
|
+
CoreEntities:
|
|
13
|
+
Project:
|
|
14
|
+
Evidence: Inferred
|
|
15
|
+
Fields: ["id", "name", "path", "status", "port", "tags", "favorite", "lastOpened", "previewImage", "runtimeCommand"]
|
|
16
|
+
RuntimeStatus:
|
|
17
|
+
Evidence: UserSpecified
|
|
18
|
+
States: ["running", "stopped", "paused", "unhealthy", "indexing", "missing", "archived"]
|
|
19
|
+
AIProviderUsage:
|
|
20
|
+
Evidence: UserSpecified
|
|
21
|
+
MaxProviders: 10
|
|
22
|
+
Fields: ["provider", "requests", "tokens", "cost", "percentage"]
|
|
23
|
+
|
|
24
|
+
FrontendResponsibilities:
|
|
25
|
+
Evidence: Inferred
|
|
26
|
+
Items:
|
|
27
|
+
- "Render project grid/list and page shell."
|
|
28
|
+
- "Filter, sort, tag, and favorite projects."
|
|
29
|
+
- "Display runtime status, health, previews, analytics, and empty/error states."
|
|
30
|
+
- "Send safe runtime commands through backend abstractions."
|
|
31
|
+
|
|
32
|
+
BackendResponsibilities:
|
|
33
|
+
Evidence: Inferred
|
|
34
|
+
Items:
|
|
35
|
+
- "Scan configured local folders for projects."
|
|
36
|
+
- "Manage safe start/stop/restart operations."
|
|
37
|
+
- "Track ports, process health, and availability."
|
|
38
|
+
- "Generate/cache/refresh screenshots and previews."
|
|
39
|
+
- "Persist project metadata and user preferences."
|
|
40
|
+
|
|
41
|
+
StateTransitions:
|
|
42
|
+
Evidence: UserSpecified
|
|
43
|
+
Allowed:
|
|
44
|
+
stopped: ["running", "missing", "archived", "indexing"]
|
|
45
|
+
running: ["paused", "stopped", "unhealthy", "archived"]
|
|
46
|
+
paused: ["running", "stopped"]
|
|
47
|
+
unhealthy: ["running", "stopped", "missing"]
|
|
48
|
+
indexing: ["running", "stopped", "missing"]
|
|
49
|
+
missing: ["indexing", "archived"]
|
|
50
|
+
archived: ["indexing"]
|
|
51
|
+
|
|
52
|
+
ScreenshotsAndPreviews:
|
|
53
|
+
Evidence: UserSpecified
|
|
54
|
+
Behavior:
|
|
55
|
+
Generate: "Capture project preview when project is reachable."
|
|
56
|
+
Cache: "Store preview image with project metadata."
|
|
57
|
+
Refresh: "Refresh manually or after detected project activity."
|
|
58
|
+
Failure: "Use empty preview state if capture fails."
|
|
59
|
+
|
|
60
|
+
FilteringSortingTagsFavorites:
|
|
61
|
+
Evidence: UserSpecified
|
|
62
|
+
Behavior:
|
|
63
|
+
Filters: ["status", "tag", "favorite", "runtime", "recent"]
|
|
64
|
+
Sorting: ["last opened", "name", "status", "activity", "port"]
|
|
65
|
+
Tags: "User-defined labels for grouping projects."
|
|
66
|
+
Favorites: "Pinned/high-priority projects displayed first or filterable."
|
|
67
|
+
|
|
68
|
+
PersistenceModel:
|
|
69
|
+
Evidence: Inferred
|
|
70
|
+
RecommendedStorage:
|
|
71
|
+
LocalConfig: "project paths, preferences, ignored folders"
|
|
72
|
+
LocalDatabase: "project metadata, runtime history, preview paths, AI usage summaries"
|
|
73
|
+
CacheFolder: "generated screenshots and thumbnails"
|
|
74
|
+
|
|
75
|
+
SecurityAndPrivacyNotes:
|
|
76
|
+
Evidence: Recommended
|
|
77
|
+
Notes:
|
|
78
|
+
- "Avoid destructive file operations without explicit user confirmation."
|
|
79
|
+
- "Never expose secrets found in project folders."
|
|
80
|
+
- "Sandbox runtime commands where possible."
|
|
81
|
+
- "Show clear confirmation before deleting, moving, or overwriting files."
|
|
82
|
+
- "Treat local paths and usage metrics as private user data."
|
package/pyproject.toml
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "cox-protocol-package"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Validator and compiler for COX design-spec documents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { file = "LICENSE" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Charbel Malo" },
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"agent-protocol",
|
|
17
|
+
"cox",
|
|
18
|
+
"design-spec",
|
|
19
|
+
"schema",
|
|
20
|
+
"ui-reconstruction",
|
|
21
|
+
"yaml",
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 4 - Beta",
|
|
25
|
+
"Environment :: Console",
|
|
26
|
+
"Intended Audience :: Developers",
|
|
27
|
+
"License :: OSI Approved :: MIT License",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"Programming Language :: Python :: 3.10",
|
|
30
|
+
"Programming Language :: Python :: 3.11",
|
|
31
|
+
"Programming Language :: Python :: 3.12",
|
|
32
|
+
"Topic :: Software Development :: Build Tools",
|
|
33
|
+
"Topic :: Text Processing :: Markup",
|
|
34
|
+
]
|
|
35
|
+
dependencies = [
|
|
36
|
+
"PyYAML>=6.0",
|
|
37
|
+
"jsonschema>=4.23",
|
|
38
|
+
"typer>=0.12",
|
|
39
|
+
"rich>=13.7",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
cox = "tools.cox_cli:app"
|
|
44
|
+
|
|
45
|
+
[project.urls]
|
|
46
|
+
Homepage = "https://github.com/charbelmalo/cox-protocol-package#readme"
|
|
47
|
+
Repository = "https://github.com/charbelmalo/cox-protocol-package"
|
|
48
|
+
Issues = "https://github.com/charbelmalo/cox-protocol-package/issues"
|
|
49
|
+
|
|
50
|
+
[tool.setuptools]
|
|
51
|
+
packages = ["tools"]
|
package/requirements.txt
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "cox.component.v1",
|
|
4
|
+
"title": "COX Component Spec",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"CoxVersion",
|
|
8
|
+
"FileType",
|
|
9
|
+
"ComponentName",
|
|
10
|
+
"Slug",
|
|
11
|
+
"Schema",
|
|
12
|
+
"Role",
|
|
13
|
+
"EvidenceSummary",
|
|
14
|
+
"VisibleStructure",
|
|
15
|
+
"Interactions",
|
|
16
|
+
"NamingDecision"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"CoxVersion": {
|
|
20
|
+
"const": "1.0"
|
|
21
|
+
},
|
|
22
|
+
"FileType": {
|
|
23
|
+
"const": "component_spec"
|
|
24
|
+
},
|
|
25
|
+
"ComponentName": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"minLength": 1
|
|
28
|
+
},
|
|
29
|
+
"Slug": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$"
|
|
32
|
+
},
|
|
33
|
+
"Schema": {
|
|
34
|
+
"const": "cox.component.v1"
|
|
35
|
+
},
|
|
36
|
+
"Role": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"EvidenceSummary": {
|
|
40
|
+
"$ref": "#/$defs/evidenceSummary"
|
|
41
|
+
},
|
|
42
|
+
"VisibleStructure": {
|
|
43
|
+
"type": "object"
|
|
44
|
+
},
|
|
45
|
+
"Interactions": {
|
|
46
|
+
"$ref": "#/$defs/interactionSummary"
|
|
47
|
+
},
|
|
48
|
+
"NamingDecision": {
|
|
49
|
+
"$ref": "#/$defs/namingDecision"
|
|
50
|
+
},
|
|
51
|
+
"VisualStyle": {
|
|
52
|
+
"type": "object"
|
|
53
|
+
},
|
|
54
|
+
"Responsive": {
|
|
55
|
+
"type": "object"
|
|
56
|
+
},
|
|
57
|
+
"ImplementationHints": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"ChildSubcomponents": {
|
|
64
|
+
"type": "array"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"$defs": {
|
|
68
|
+
"evidenceSummary": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"properties": {
|
|
71
|
+
"Visible": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"items": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"UserSpecified": {
|
|
78
|
+
"type": "array",
|
|
79
|
+
"items": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"Inferred": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"Intended": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"items": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"Recommended": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"additionalProperties": true
|
|
103
|
+
},
|
|
104
|
+
"interactionSummary": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"Visible": {
|
|
108
|
+
"type": "array",
|
|
109
|
+
"items": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"Inferred": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"items": {
|
|
116
|
+
"type": "string"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"Intended": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": {
|
|
122
|
+
"type": "string"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"Recommended": {
|
|
126
|
+
"type": "array",
|
|
127
|
+
"items": {
|
|
128
|
+
"type": "string"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"additionalProperties": true
|
|
133
|
+
},
|
|
134
|
+
"namingDecision": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"required": [
|
|
137
|
+
"ChosenName",
|
|
138
|
+
"Reason",
|
|
139
|
+
"RejectedAlternatives",
|
|
140
|
+
"AmbiguityRisk",
|
|
141
|
+
"EvidenceLevel"
|
|
142
|
+
],
|
|
143
|
+
"properties": {
|
|
144
|
+
"ChosenName": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"Reason": {
|
|
148
|
+
"type": "string"
|
|
149
|
+
},
|
|
150
|
+
"RejectedAlternatives": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"items": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"AmbiguityRisk": {
|
|
157
|
+
"type": "string"
|
|
158
|
+
},
|
|
159
|
+
"EvidenceLevel": {
|
|
160
|
+
"type": "string"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"additionalProperties": true
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"additionalProperties": true
|
|
167
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "cox.crop_metadata.v1",
|
|
4
|
+
"title": "COX Crop Metadata",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"CoxVersion",
|
|
8
|
+
"FileType",
|
|
9
|
+
"Slug",
|
|
10
|
+
"Schema",
|
|
11
|
+
"SourceScreenshot",
|
|
12
|
+
"OutputScreenshot",
|
|
13
|
+
"BoundaryConfidence",
|
|
14
|
+
"EstimatedBoundingBox"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"CoxVersion": {
|
|
18
|
+
"const": "1.0"
|
|
19
|
+
},
|
|
20
|
+
"FileType": {
|
|
21
|
+
"const": "crop_metadata"
|
|
22
|
+
},
|
|
23
|
+
"Slug": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"pattern": "^[a-z0-9]+(_[a-z0-9]+)*$"
|
|
26
|
+
},
|
|
27
|
+
"Schema": {
|
|
28
|
+
"const": "cox.crop_metadata.v1"
|
|
29
|
+
},
|
|
30
|
+
"SourceScreenshot": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"OutputScreenshot": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"BoundaryConfidence": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": [
|
|
39
|
+
"High",
|
|
40
|
+
"Medium",
|
|
41
|
+
"Low"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"EstimatedBoundingBox": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"required": [
|
|
47
|
+
"Unit",
|
|
48
|
+
"X",
|
|
49
|
+
"Y",
|
|
50
|
+
"Width",
|
|
51
|
+
"Height"
|
|
52
|
+
],
|
|
53
|
+
"properties": {
|
|
54
|
+
"Unit": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"X": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"Y": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"Width": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
},
|
|
66
|
+
"Height": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"additionalProperties": true
|
|
71
|
+
},
|
|
72
|
+
"IncludedPaddingReason": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"ExcludedRegions": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": {
|
|
78
|
+
"type": "string"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"additionalProperties": true
|
|
83
|
+
}
|