@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,81 @@
1
+ {
2
+ "type": "object",
3
+ "required": [
4
+ "schemaVersion",
5
+ "stageId",
6
+ "attemptId",
7
+ "actionId",
8
+ "launchEnvelopeSha256",
9
+ "grantedScopes",
10
+ "operationKey",
11
+ "targetStore",
12
+ "apiVersion",
13
+ "requestFingerprint",
14
+ "naturalResourceKey",
15
+ "providerIdempotencySupported",
16
+ "resourceType",
17
+ "executorInput"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": { "const": "1.0.0" },
21
+ "runDir": { "type": "string", "minLength": 1 },
22
+ "stageId": { "type": "string", "minLength": 1 },
23
+ "attemptId": { "type": "string", "minLength": 1 },
24
+ "launchEnvelopePath": { "type": "string", "minLength": 1 },
25
+ "envelope": { "type": "object" },
26
+ "actionId": { "type": "string", "minLength": 1 },
27
+ "launchEnvelopeSha256": { "type": "string", "minLength": 1 },
28
+ "grantedScopes": {
29
+ "type": "array",
30
+ "items": { "type": "string", "minLength": 1 }
31
+ },
32
+ "approvalGrantPath": {
33
+ "anyOf": [
34
+ { "type": "string", "minLength": 1 },
35
+ { "const": null }
36
+ ]
37
+ },
38
+ "operationKey": { "type": "string", "minLength": 1 },
39
+ "targetStore": { "type": "string", "minLength": 1 },
40
+ "apiVersion": { "type": "string", "minLength": 1 },
41
+ "requestFingerprint": { "type": "string", "minLength": 1 },
42
+ "naturalResourceKey": { "type": "string", "minLength": 1 },
43
+ "providerIdempotencySupported": { "type": "boolean" },
44
+ "resourceType": { "type": "string", "minLength": 1 },
45
+ "executorInput": {
46
+ "oneOf": [
47
+ {
48
+ "type": "object",
49
+ "required": ["kind", "operationName", "query"],
50
+ "properties": {
51
+ "kind": { "const": "admin-graphql" },
52
+ "operationName": { "type": "string", "minLength": 1 },
53
+ "query": { "type": "string", "minLength": 1 },
54
+ "variables": { "type": "object" }
55
+ },
56
+ "additionalProperties": false
57
+ },
58
+ {
59
+ "type": "object",
60
+ "required": ["kind", "themeWorkspace"],
61
+ "properties": {
62
+ "kind": { "const": "theme-push-unpublished" },
63
+ "themeWorkspace": { "type": "string", "minLength": 1 },
64
+ "themeId": { "type": "string", "minLength": 1 },
65
+ "themeName": { "type": "string", "minLength": 1 },
66
+ "nodelete": { "type": "boolean" }
67
+ },
68
+ "additionalProperties": false
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ "anyOf": [
74
+ { "required": ["launchEnvelopePath"] },
75
+ { "required": ["envelope"] }
76
+ ],
77
+ "not": {
78
+ "required": ["actionRegistry"]
79
+ },
80
+ "additionalProperties": false
81
+ }
@@ -0,0 +1,187 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/shopify-preflight-report.schema.json",
4
+ "title": "Storewright Shopify Preflight Report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "runId", "preflight"],
8
+ "properties": {
9
+ "schemaVersion": { "type": "string", "const": "1.0.0" },
10
+ "runId": { "type": "string", "minLength": 1 },
11
+ "preflight": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["store", "shopifyCli", "storeAccess", "adminGraphqlAccess", "requiredManualApprovals", "publicationStrategy", "commands"],
15
+ "properties": {
16
+ "store": { "type": "string", "minLength": 1 },
17
+ "shopifyCli": {
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "required": ["result", "version"],
21
+ "properties": {
22
+ "result": { "type": "string", "enum": ["ok", "error"] },
23
+ "version": { "type": "string" },
24
+ "details": { "type": "string" }
25
+ }
26
+ },
27
+ "storeAccess": {
28
+ "type": "object",
29
+ "additionalProperties": false,
30
+ "required": ["result", "details"],
31
+ "properties": {
32
+ "result": { "type": "string", "enum": ["ok", "error"] },
33
+ "details": { "type": "string" }
34
+ }
35
+ },
36
+ "adminGraphqlAccess": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["result", "details"],
40
+ "properties": {
41
+ "result": { "type": "string", "enum": ["ok", "error"] },
42
+ "details": { "type": "string" }
43
+ }
44
+ },
45
+ "requiredManualApprovals": {
46
+ "type": "array",
47
+ "items": { "type": "string", "minLength": 1 }
48
+ },
49
+ "scopeMatrix": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["operation", "scopes", "source"],
55
+ "properties": {
56
+ "operation": { "type": "string", "minLength": 1 },
57
+ "scopes": {
58
+ "type": "array",
59
+ "items": { "type": "string", "minLength": 1 }
60
+ },
61
+ "source": { "type": "string", "minLength": 1 },
62
+ "reason": { "type": "string" }
63
+ }
64
+ }
65
+ },
66
+ "requiredScopes": {
67
+ "type": "array",
68
+ "items": { "type": "string", "minLength": 1 }
69
+ },
70
+ "publicationStrategy": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": ["productStatus", "publicationChannel", "publicationLookup", "requiredScopes"],
74
+ "anyOf": [
75
+ {
76
+ "type": "object",
77
+ "required": ["publicationId", "publicationName", "missingOrZeroPriceStrategy", "verificationFields"],
78
+ "properties": {
79
+ "publicationLookup": {
80
+ "type": "object",
81
+ "required": ["matchedPublication"],
82
+ "properties": {
83
+ "result": { "type": "string", "const": "ok" }
84
+ }
85
+ }
86
+ }
87
+ },
88
+ {
89
+ "type": "object",
90
+ "properties": {
91
+ "publicationLookup": {
92
+ "type": "object",
93
+ "required": ["blockerId"],
94
+ "properties": {
95
+ "result": { "type": "string", "enum": ["missing", "ambiguous", "error"] }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ ],
101
+ "properties": {
102
+ "productStatus": { "type": "string", "const": "ACTIVE" },
103
+ "publicationChannel": { "type": "string", "const": "Online Store" },
104
+ "publicationId": { "type": "string", "pattern": "^gid://shopify/Publication/" },
105
+ "publicationName": { "type": "string", "const": "Online Store" },
106
+ "publicationLookup": {
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "required": ["result", "command", "rawOutputPath", "selectionReason"],
110
+ "properties": {
111
+ "result": { "type": "string", "enum": ["ok", "missing", "ambiguous", "error"] },
112
+ "command": { "type": "string", "minLength": 1 },
113
+ "rawOutputPath": { "type": "string", "minLength": 1 },
114
+ "candidateCount": { "type": "number" },
115
+ "matchedPublication": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": ["id", "name"],
119
+ "properties": {
120
+ "id": { "type": "string", "pattern": "^gid://shopify/Publication/" },
121
+ "name": { "type": "string", "const": "Online Store" }
122
+ }
123
+ },
124
+ "blockerId": { "type": "string", "minLength": 1 },
125
+ "errorSummary": { "type": "string" },
126
+ "selectionReason": { "type": "string", "minLength": 1 }
127
+ }
128
+ },
129
+ "missingOrZeroPriceStrategy": {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": ["match", "productStatus", "publicationChannel", "requiredScopes", "verificationFields"],
133
+ "properties": {
134
+ "match": { "type": "string", "const": "missing-or-zero-price" },
135
+ "productStatus": { "type": "string", "const": "DRAFT" },
136
+ "publicationChannel": { "type": "string", "const": "Online Store" },
137
+ "requiredScopes": {
138
+ "type": "array",
139
+ "items": { "type": "string", "minLength": 1 },
140
+ "minItems": 2,
141
+ "allOf": [
142
+ { "contains": { "const": "read_publications" } },
143
+ { "contains": { "const": "write_publications" } }
144
+ ]
145
+ },
146
+ "verificationFields": {
147
+ "type": "array",
148
+ "items": {
149
+ "type": "string",
150
+ "enum": ["resourcePublications", "publishedOnPublication"]
151
+ },
152
+ "minItems": 1
153
+ }
154
+ }
155
+ },
156
+ "requiredScopes": {
157
+ "type": "array",
158
+ "items": { "type": "string", "minLength": 1 },
159
+ "minItems": 2,
160
+ "allOf": [
161
+ { "contains": { "const": "read_publications" } },
162
+ { "contains": { "const": "write_publications" } }
163
+ ]
164
+ },
165
+ "verificationFields": {
166
+ "type": "array",
167
+ "items": {
168
+ "type": "string",
169
+ "enum": ["resourcePublications", "publishedOnPublication", "onlineStoreUrl"]
170
+ },
171
+ "minItems": 1
172
+ }
173
+ }
174
+ },
175
+ "commands": {
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "required": ["themeList", "adminGraphqlRead"],
179
+ "properties": {
180
+ "themeList": { "type": "string", "minLength": 1 },
181
+ "adminGraphqlRead": { "type": "string", "minLength": 1 }
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/store-blueprint.schema.json",
4
+ "title": "Storewright Store Blueprint",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "runId", "authoring", "storeBlueprint"],
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": "agent-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
+ "storeBlueprint": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["sitemap", "collections", "navigation", "homepage", "contentPages", "seo"],
29
+ "properties": {
30
+ "sitemap": { "type": "array", "items": { "type": "string" } },
31
+ "collections": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["handle", "title", "productIds"],
37
+ "properties": {
38
+ "handle": { "type": "string", "minLength": 1 },
39
+ "title": { "type": "string", "minLength": 1 },
40
+ "description": { "type": "string" },
41
+ "productIds": { "type": "array", "items": { "type": "string" } }
42
+ }
43
+ }
44
+ },
45
+ "navigation": { "type": "array", "items": { "type": "string" } },
46
+ "homepage": { "type": "array", "items": { "type": "string" } },
47
+ "contentPages": {
48
+ "type": "array",
49
+ "minItems": 1,
50
+ "items": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": ["handle", "sourceContent", "placement", "required"],
54
+ "properties": {
55
+ "handle": { "type": "string", "minLength": 1 },
56
+ "sourceContent": {
57
+ "type": "string",
58
+ "enum": ["storeContent.brandStory", "storeContent.pageBodies"]
59
+ },
60
+ "placement": {
61
+ "type": "string",
62
+ "enum": ["standalone-page", "homepage-section", "footer-navigation"]
63
+ },
64
+ "required": { "type": "boolean" },
65
+ "fallbackReason": { "type": "string" }
66
+ }
67
+ }
68
+ },
69
+ "mediaRequirements": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": [
75
+ "slotId",
76
+ "usage",
77
+ "assetKind",
78
+ "placement",
79
+ "aspectRatio",
80
+ "altText",
81
+ "sourceRationale"
82
+ ],
83
+ "properties": {
84
+ "slotId": { "type": "string", "minLength": 1 },
85
+ "usage": { "type": "string", "minLength": 1 },
86
+ "assetKind": {
87
+ "type": "string",
88
+ "enum": ["product-derived", "generated", "supplied", "shopify-existing"]
89
+ },
90
+ "placement": { "type": "string", "minLength": 1 },
91
+ "aspectRatio": { "type": "string", "minLength": 1 },
92
+ "altText": { "type": "string", "minLength": 1 },
93
+ "sourceRationale": { "type": "string", "minLength": 1 }
94
+ }
95
+ }
96
+ },
97
+ "pages": { "type": "array", "items": { "type": "string" } },
98
+ "seo": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": ["title", "description"],
102
+ "properties": {
103
+ "title": { "type": "string", "minLength": 1 },
104
+ "description": { "type": "string", "minLength": 1 }
105
+ }
106
+ },
107
+ "brandVoice": { "type": "string" },
108
+ "visualTokens": { "type": "object" }
109
+ }
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,102 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/store-content-generation-output.schema.json",
4
+ "title": "Storewright Store Content Generation Output",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "runId", "authoring", "storeContent"],
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": "agent-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
+ "storeContent": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["homepageCopy", "collectionDescriptions", "pageBodies", "brandStory"],
29
+ "properties": {
30
+ "homepageCopy": {
31
+ "type": "array",
32
+ "items": { "type": "string", "minLength": 1 }
33
+ },
34
+ "collectionDescriptions": {
35
+ "type": "array",
36
+ "items": { "type": "object" }
37
+ },
38
+ "pageBodies": {
39
+ "type": "array",
40
+ "items": { "type": "object" }
41
+ },
42
+ "brandStory": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": [
46
+ "pageHandle",
47
+ "storyMode",
48
+ "title",
49
+ "seo",
50
+ "sections",
51
+ "factClaims",
52
+ "agentInferences",
53
+ "claimsNeedingReview"
54
+ ],
55
+ "properties": {
56
+ "pageHandle": { "type": "string", "const": "our-story" },
57
+ "storyMode": {
58
+ "type": "string",
59
+ "enum": ["founder-story", "curation-story", "point-of-view"]
60
+ },
61
+ "title": { "type": "string", "minLength": 1 },
62
+ "seo": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "required": ["title", "description"],
66
+ "properties": {
67
+ "title": { "type": "string", "minLength": 1 },
68
+ "description": { "type": "string", "minLength": 1 }
69
+ }
70
+ },
71
+ "sections": {
72
+ "type": "array",
73
+ "minItems": 4,
74
+ "items": {
75
+ "type": "object",
76
+ "additionalProperties": false,
77
+ "required": ["heading", "body", "role"],
78
+ "properties": {
79
+ "heading": { "type": "string", "minLength": 1 },
80
+ "body": { "type": "string", "minLength": 1 },
81
+ "role": { "type": "string", "minLength": 1 }
82
+ }
83
+ }
84
+ },
85
+ "factClaims": {
86
+ "type": "array",
87
+ "items": { "type": "string", "minLength": 1 }
88
+ },
89
+ "agentInferences": {
90
+ "type": "array",
91
+ "items": { "type": "string", "minLength": 1 }
92
+ },
93
+ "claimsNeedingReview": {
94
+ "type": "array",
95
+ "items": { "type": "string", "minLength": 1 }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }