@storewright/cli 0.14.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.
Files changed (67) hide show
  1. package/README.md +19 -0
  2. package/VERSION +1 -0
  3. package/bin/storewright.mjs +62 -0
  4. package/contracts/action-registry.json +175 -0
  5. package/contracts/capability-registry.json +63 -0
  6. package/contracts/workflow-manifest.json +207 -0
  7. package/lib/cli/storewright-cli.mjs +259 -0
  8. package/lib/internal/launch-envelope.mjs +223 -0
  9. package/lib/internal/multi-agent-contracts.mjs +137 -0
  10. package/lib/internal/operation-ledger.mjs +190 -0
  11. package/lib/internal/pricing/default-preview-pricing.mjs +181 -0
  12. package/lib/internal/run-state-helpers.mjs +313 -0
  13. package/lib/internal/shopify-operation-adapter.mjs +456 -0
  14. package/package.json +38 -0
  15. package/schemas/action-registry.schema.json +11 -0
  16. package/schemas/agent-report.schema.json +14 -0
  17. package/schemas/approval-grant.schema.json +16 -0
  18. package/schemas/base-theme-report.schema.json +25 -0
  19. package/schemas/brand-identity.schema.json +142 -0
  20. package/schemas/capability-registry.schema.json +11 -0
  21. package/schemas/competitor-audit.schema.json +38 -0
  22. package/schemas/design-direction.schema.json +64 -0
  23. package/schemas/external-operation.schema.json +34 -0
  24. package/schemas/intake-blocked-report.schema.json +76 -0
  25. package/schemas/launch-envelope.schema.json +25 -0
  26. package/schemas/launch-readiness.schema.json +73 -0
  27. package/schemas/media-file-inspection-report.schema.json +223 -0
  28. package/schemas/media-manifest.schema.json +84 -0
  29. package/schemas/merchandising-brief.schema.json +27 -0
  30. package/schemas/normalized-product-catalog.schema.json +42 -0
  31. package/schemas/product-content-generation-input.schema.json +40 -0
  32. package/schemas/product-content-generation-output.schema.json +43 -0
  33. package/schemas/raw-product-candidates.schema.json +32 -0
  34. package/schemas/shopify-access-preflight-report.schema.json +213 -0
  35. package/schemas/shopify-content-sync-report.schema.json +190 -0
  36. package/schemas/shopify-media-map.schema.json +87 -0
  37. package/schemas/shopify-media-upload-report.schema.json +96 -0
  38. package/schemas/shopify-operation-request.schema.json +81 -0
  39. package/schemas/shopify-preflight-report.schema.json +187 -0
  40. package/schemas/store-blueprint.schema.json +112 -0
  41. package/schemas/store-content-generation-output.schema.json +102 -0
  42. package/schemas/store-intake.schema.json +205 -0
  43. package/schemas/store-ops-plan.schema.json +82 -0
  44. package/schemas/storefront-preview-review.schema.json +227 -0
  45. package/schemas/supplier-access-report.schema.json +36 -0
  46. package/schemas/supplier-extraction-report.schema.json +185 -0
  47. package/schemas/theme-build-report.schema.json +43 -0
  48. package/schemas/theme-code-change-summary.schema.json +65 -0
  49. package/schemas/theme-plan.schema.json +26 -0
  50. package/schemas/theme-push-report.schema.json +151 -0
  51. package/schemas/theme-workspace-validation-report.schema.json +61 -0
  52. package/schemas/workflow-manifest.schema.json +29 -0
  53. package/scripts/audit-run-state.mjs +472 -0
  54. package/scripts/execute-shopify-operation.mjs +190 -0
  55. package/scripts/generate-image-assets-openai.mjs +342 -0
  56. package/scripts/generate-media-assets.mjs +121 -0
  57. package/scripts/init-run-state.mjs +69 -0
  58. package/scripts/inspect-media-files.mjs +334 -0
  59. package/scripts/prepare-launch-envelope.mjs +47 -0
  60. package/scripts/shopify-access-preflight.mjs +432 -0
  61. package/scripts/upload-shopify-media.mjs +831 -0
  62. package/scripts/validate-agent-report.mjs +46 -0
  63. package/scripts/validate-artifact.mjs +196 -0
  64. package/scripts/validate-launch-envelope.mjs +50 -0
  65. package/scripts/validate-registries.mjs +50 -0
  66. package/scripts/validate-workflow-manifest.mjs +38 -0
  67. package/scripts/version.mjs +192 -0
@@ -0,0 +1,223 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/media-file-inspection-report.schema.json",
4
+ "title": "Storewright Media File Inspection Report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "runId",
10
+ "authoring",
11
+ "mediaFileInspection"
12
+ ],
13
+ "properties": {
14
+ "schemaVersion": {
15
+ "type": "string",
16
+ "const": "1.0.0"
17
+ },
18
+ "runId": {
19
+ "type": "string",
20
+ "minLength": 1
21
+ },
22
+ "authoring": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "mode",
27
+ "createdBy",
28
+ "sourceInputArtifacts"
29
+ ],
30
+ "properties": {
31
+ "mode": {
32
+ "type": "string",
33
+ "const": "worker-authored"
34
+ },
35
+ "createdBy": {
36
+ "type": "string",
37
+ "minLength": 1
38
+ },
39
+ "sourceInputArtifacts": {
40
+ "type": "array",
41
+ "minItems": 1,
42
+ "items": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "mediaFileInspection": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": [
53
+ "dimensionThreshold",
54
+ "summary",
55
+ "duplicateHashGroups",
56
+ "assets"
57
+ ],
58
+ "properties": {
59
+ "dimensionThreshold": {
60
+ "type": "number",
61
+ "minimum": 1
62
+ },
63
+ "summary": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": [
67
+ "assetCount",
68
+ "missingFileCount",
69
+ "duplicateHashGroupCount",
70
+ "findingCount"
71
+ ],
72
+ "properties": {
73
+ "assetCount": {
74
+ "type": "number",
75
+ "minimum": 0
76
+ },
77
+ "missingFileCount": {
78
+ "type": "number",
79
+ "minimum": 0
80
+ },
81
+ "duplicateHashGroupCount": {
82
+ "type": "number",
83
+ "minimum": 0
84
+ },
85
+ "findingCount": {
86
+ "type": "number",
87
+ "minimum": 0
88
+ }
89
+ }
90
+ },
91
+ "duplicateHashGroups": {
92
+ "type": "array",
93
+ "items": {
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": [
97
+ "groupId",
98
+ "sha256",
99
+ "assetRefs",
100
+ "candidateIds"
101
+ ],
102
+ "properties": {
103
+ "groupId": {
104
+ "type": "string",
105
+ "minLength": 1
106
+ },
107
+ "sha256": {
108
+ "type": "string",
109
+ "minLength": 64
110
+ },
111
+ "assetRefs": {
112
+ "type": "array",
113
+ "minItems": 2,
114
+ "items": {
115
+ "type": "string",
116
+ "minLength": 1
117
+ }
118
+ },
119
+ "candidateIds": {
120
+ "type": "array",
121
+ "minItems": 2,
122
+ "items": {
123
+ "type": "string",
124
+ "minLength": 1
125
+ }
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "assets": {
131
+ "type": "array",
132
+ "items": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": [
136
+ "assetRef",
137
+ "localPath",
138
+ "fileExists",
139
+ "findingCodes",
140
+ "findings"
141
+ ],
142
+ "properties": {
143
+ "assetRef": {
144
+ "type": "string",
145
+ "minLength": 1
146
+ },
147
+ "candidateId": {
148
+ "type": "string",
149
+ "minLength": 1
150
+ },
151
+ "sourceArtifact": {
152
+ "type": "string",
153
+ "minLength": 1
154
+ },
155
+ "sourceUrl": {
156
+ "type": "string",
157
+ "minLength": 1
158
+ },
159
+ "localPath": {
160
+ "type": "string",
161
+ "minLength": 1
162
+ },
163
+ "fileExists": {
164
+ "type": "boolean"
165
+ },
166
+ "bytes": {
167
+ "type": "number",
168
+ "minimum": 0
169
+ },
170
+ "sha256": {
171
+ "type": "string",
172
+ "minLength": 64
173
+ },
174
+ "detectedMimeType": {
175
+ "type": "string",
176
+ "minLength": 1
177
+ },
178
+ "width": {
179
+ "type": "number",
180
+ "minimum": 0
181
+ },
182
+ "height": {
183
+ "type": "number",
184
+ "minimum": 0
185
+ },
186
+ "duplicateHashGroupId": {
187
+ "type": "string",
188
+ "minLength": 1
189
+ },
190
+ "findingCodes": {
191
+ "type": "array",
192
+ "items": {
193
+ "type": "string",
194
+ "minLength": 1
195
+ }
196
+ },
197
+ "findings": {
198
+ "type": "array",
199
+ "items": {
200
+ "type": "object",
201
+ "additionalProperties": false,
202
+ "required": [
203
+ "code",
204
+ "evidence"
205
+ ],
206
+ "properties": {
207
+ "code": {
208
+ "type": "string",
209
+ "minLength": 1
210
+ },
211
+ "evidence": {
212
+ "type": "string"
213
+ }
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/media-manifest.schema.json",
4
+ "title": "Storewright Media Manifest",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "runId", "authoring", "media"],
8
+ "properties": {
9
+ "schemaVersion": { "type": "string", "const": "1.0.0" },
10
+ "runId": { "type": "string", "minLength": 1 },
11
+ "authoring": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["mode", "createdBy", "sourceInputArtifacts"],
15
+ "properties": {
16
+ "mode": { "type": "string", "const": "worker-authored" },
17
+ "createdBy": { "type": "string", "minLength": 1 },
18
+ "sourceInputArtifacts": {
19
+ "type": "array",
20
+ "minItems": 1,
21
+ "items": { "type": "string", "minLength": 1 }
22
+ }
23
+ }
24
+ },
25
+ "media": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["assets"],
29
+ "properties": {
30
+ "assets": {
31
+ "type": "array",
32
+ "items": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "anyOf": [
36
+ {
37
+ "type": "object",
38
+ "required": ["status"],
39
+ "properties": {
40
+ "status": {
41
+ "enum": ["source-downloaded", "generation-required", "upload-blocked", "uploaded"]
42
+ }
43
+ }
44
+ },
45
+ {
46
+ "type": "object",
47
+ "required": ["status", "seoFilename"],
48
+ "properties": {
49
+ "status": { "const": "ready-for-upload" }
50
+ }
51
+ }
52
+ ],
53
+ "required": ["assetId", "origin", "localPath", "mimeType", "status", "altText", "sourceArtifact"],
54
+ "properties": {
55
+ "assetId": { "type": "string", "minLength": 1 },
56
+ "slotId": { "type": "string", "minLength": 1 },
57
+ "candidateId": { "type": "string", "minLength": 1 },
58
+ "origin": {
59
+ "type": "string",
60
+ "enum": ["supplier", "product-derived", "generated", "supplied", "shopify-existing"]
61
+ },
62
+ "localPath": { "type": "string", "minLength": 1 },
63
+ "mimeType": { "type": "string", "minLength": 1 },
64
+ "status": {
65
+ "type": "string",
66
+ "enum": ["source-downloaded", "generation-required", "ready-for-upload", "upload-blocked", "uploaded"]
67
+ },
68
+ "seoFilename": {
69
+ "type": "string",
70
+ "minLength": 5,
71
+ "maxLength": 180,
72
+ "pattern": "^(?!image-[0-9]+\\.)[a-z0-9]+(?:-[a-z0-9]+)*\\.[a-z0-9]+$"
73
+ },
74
+ "altText": { "type": "string", "minLength": 1, "maxLength": 512 },
75
+ "sourceArtifact": { "type": "string", "minLength": 1 },
76
+ "provenance": { "type": "object" },
77
+ "warnings": { "type": "array", "items": { "type": "string" } }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/merchandising-brief.schema.json",
4
+ "title": "Merchandising Brief",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "runId", "merchandisingBrief"],
7
+ "properties": {
8
+ "schemaVersion": { "type": "string" },
9
+ "runId": { "type": "string" },
10
+ "merchandisingBrief": {
11
+ "type": "object",
12
+ "required": ["primaryCollections", "navItems", "heroFocus"],
13
+ "properties": {
14
+ "targetAudience": {},
15
+ "categoryStrategy": {},
16
+ "primaryCollections": { "type": "array" },
17
+ "secondaryCollections": { "type": "array" },
18
+ "heroFocus": {},
19
+ "navItems": { "type": "array" },
20
+ "featuredCollectionIdeas": { "type": "array" },
21
+ "productCountRange": {},
22
+ "pricePositioning": {},
23
+ "contentAngles": { "type": "array" }
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/normalized-product-catalog.schema.json",
4
+ "title": "Normalized Product Catalog",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "runId", "authoring", "normalizedProductCatalog"],
7
+ "properties": {
8
+ "schemaVersion": { "type": "string" },
9
+ "runId": { "type": "string" },
10
+ "authoring": {
11
+ "type": "object",
12
+ "required": ["mode", "createdBy", "sourceInputArtifacts"],
13
+ "properties": {
14
+ "mode": { "type": "string", "const": "worker-authored" },
15
+ "createdBy": { "type": "string", "minLength": 1 },
16
+ "sourceInputArtifacts": {
17
+ "type": "array",
18
+ "minItems": 1,
19
+ "items": { "type": "string", "minLength": 1 }
20
+ }
21
+ }
22
+ },
23
+ "normalizedProductCatalog": {
24
+ "type": "object",
25
+ "required": ["products"],
26
+ "properties": {
27
+ "products": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "required": ["title", "fieldStatus", "writeEligibility"],
32
+ "properties": {
33
+ "title": { "type": "string" },
34
+ "fieldStatus": { "type": "object" },
35
+ "writeEligibility": { "type": "object" }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/product-content-generation-input.schema.json",
4
+ "title": "Product Content Generation Input",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "runId", "productContentGeneration"],
7
+ "properties": {
8
+ "schemaVersion": { "type": "string" },
9
+ "runId": { "type": "string" },
10
+ "productContentGeneration": {
11
+ "type": "object",
12
+ "required": ["status", "items"],
13
+ "properties": {
14
+ "status": { "type": "string" },
15
+ "instructions": {
16
+ "type": "array",
17
+ "items": { "type": "string" }
18
+ },
19
+ "items": {
20
+ "type": "array",
21
+ "items": {
22
+ "type": "object",
23
+ "required": ["candidateId", "brandName", "category", "raw", "requiredOutput"],
24
+ "properties": {
25
+ "candidateId": { "type": "string" },
26
+ "source": { "type": "string" },
27
+ "brandName": { "type": "string" },
28
+ "category": { "type": "string" },
29
+ "market": { "type": "string" },
30
+ "currency": { "type": "string" },
31
+ "collectionHint": { "type": "string" },
32
+ "raw": { "type": "object" },
33
+ "requiredOutput": { "type": "object" }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/product-content-generation-output.schema.json",
4
+ "title": "Product Content Generation Output",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "runId", "productContentGeneration"],
7
+ "properties": {
8
+ "schemaVersion": { "type": "string" },
9
+ "runId": { "type": "string" },
10
+ "productContentGeneration": {
11
+ "type": "object",
12
+ "required": ["status", "items"],
13
+ "properties": {
14
+ "status": { "type": "string" },
15
+ "items": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "required": ["candidateId", "title", "description"],
20
+ "properties": {
21
+ "candidateId": { "type": "string" },
22
+ "title": { "type": "string" },
23
+ "description": { "type": "string" },
24
+ "productType": { "type": "string" },
25
+ "collectionHint": { "type": "string" },
26
+ "tags": {
27
+ "type": "array",
28
+ "items": { "type": "string" }
29
+ },
30
+ "seo": {
31
+ "type": "object",
32
+ "properties": {
33
+ "title": { "type": "string" },
34
+ "description": { "type": "string" }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/raw-product-candidates.schema.json",
4
+ "title": "Raw Product Candidates",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "runId", "rawProductCandidates"],
7
+ "properties": {
8
+ "schemaVersion": { "type": "string" },
9
+ "runId": { "type": "string" },
10
+ "rawProductCandidates": {
11
+ "type": "object",
12
+ "required": ["status", "items"],
13
+ "properties": {
14
+ "status": { "type": "string" },
15
+ "items": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "required": ["type"],
20
+ "properties": {
21
+ "type": { "enum": ["supplier-url", "local-product", "manual-brief"] },
22
+ "supplierUrl": { "type": "string" },
23
+ "title": { "type": "string" },
24
+ "collectionHint": { "type": "string" },
25
+ "localImages": { "type": "array" }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }