@ductape/mcp 0.1.12 → 0.1.13
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/dist/index.js +44 -22
- package/package.json +1 -1
- package/src/index.ts +44 -22
package/dist/index.js
CHANGED
|
@@ -68,10 +68,11 @@ There are THREE categories of operations. Use the right tool for each:
|
|
|
68
68
|
⚠ MULTI-ENV REQUIREMENT — applies to ALL product assets (storage, database, cache,
|
|
69
69
|
messageBroker, graph, vector, and any other resource with an envs array):
|
|
70
70
|
The envs array MUST contain one entry for EVERY environment defined on the product.
|
|
71
|
-
import-persist and provision-persist
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
import-persist and provision-persist only generate a draft for ONE env at a time.
|
|
72
|
+
Calling import-persist once will fail with MISSING_ENV_COVERAGE because the single-env
|
|
73
|
+
draft does not cover all product environments. Use import-persist-all or
|
|
74
|
+
provision-persist-all instead — they accept an array of per-env inputs, import/provision
|
|
75
|
+
each env in parallel, merge the drafts, and persist once with full env coverage.
|
|
75
76
|
|
|
76
77
|
BEFORE constructing any resource file or initiating import/provision:
|
|
77
78
|
1. Run: ductape_cli("products environments list <product_tag> --json")
|
|
@@ -79,6 +80,16 @@ There are THREE categories of operations. Use the right tool for each:
|
|
|
79
80
|
3. Collect connection details or confirmation for EACH slug from the user.
|
|
80
81
|
Do not proceed until you have details for every env.
|
|
81
82
|
|
|
83
|
+
Use import-persist-all / provision-persist-all (not the single-env forms) whenever
|
|
84
|
+
you have details for all envs. The file must be a JSON array — one object per env,
|
|
85
|
+
same format as a single import-persist/provision-persist input, all sharing the same
|
|
86
|
+
product and component tag. Example:
|
|
87
|
+
[{"cloud":"gcp-snd","service":"gcs","type":"storage","product":"my-prod",
|
|
88
|
+
"component":"assets","env":"snd","resource":"snd-bucket"},
|
|
89
|
+
{"cloud":"gcp-prd","service":"gcs","type":"storage","product":"my-prod",
|
|
90
|
+
"component":"assets","env":"prd","resource":"prd-bucket"}]
|
|
91
|
+
→ ductape_cli("cloud resources import-persist-all -f all-envs.json --json")
|
|
92
|
+
|
|
82
93
|
Sharing one resource across multiple envs is allowed but must be confirmed per env:
|
|
83
94
|
- Ask the user explicitly: "Should <env> use the same <resource> as <other_env>?"
|
|
84
95
|
- Never assume shared configuration without confirmation.
|
|
@@ -1163,27 +1174,38 @@ async function main() {
|
|
|
1163
1174
|
' resources storage create -f storage.json\n' +
|
|
1164
1175
|
' File shape: { name, tag, envs: [{ slug, type: "aws"|"gcp"|"azure", config: { bucketName, ...creds } }] }\n' +
|
|
1165
1176
|
' For cloud-linked envs set config.cloud to the connection tag and omit raw credentials.\n' +
|
|
1166
|
-
' 2. Import
|
|
1167
|
-
' cloud resources import-persist -f import.json --json\n' +
|
|
1168
|
-
' File
|
|
1169
|
-
'
|
|
1170
|
-
'
|
|
1171
|
-
' "
|
|
1172
|
-
'
|
|
1173
|
-
'
|
|
1174
|
-
'
|
|
1177
|
+
' 2. Import existing cloud buckets via cloud connections (no provisioning):\n' +
|
|
1178
|
+
' cloud resources import-persist-all -f import-all.json --json\n' +
|
|
1179
|
+
' File is a JSON ARRAY — one entry per env, all with the same product and component tag.\n' +
|
|
1180
|
+
' Each entry: cloud (connection tag), service (e.g. "gcs","s3"), type ("storage"),\n' +
|
|
1181
|
+
' product, component (new tag), env, resource (bucket name/identifier).\n' +
|
|
1182
|
+
' Example (two envs): [{"cloud":"gcp-snd","service":"gcs","type":"storage",\n' +
|
|
1183
|
+
' "product":"my-product","component":"assets","env":"snd","resource":"snd-bucket"},\n' +
|
|
1184
|
+
' {"cloud":"gcp-prd","service":"gcs","type":"storage","product":"my-product",\n' +
|
|
1185
|
+
' "component":"assets","env":"prd","resource":"prd-bucket"}].\n' +
|
|
1186
|
+
' All envs are imported in parallel, drafts merged, then the asset is created once.\n' +
|
|
1187
|
+
' Use import-persist (single-env form) only when the product has exactly one environment.\n' +
|
|
1188
|
+
' If import-persist-all fails, the error reports all create/update failures — do not retry blindly.\n' +
|
|
1189
|
+
' 3. Provision brand-new buckets AND register them (see provision-persist-all docs below).\n' +
|
|
1175
1190
|
' - Managing cloud connections and cloud-linked resources\n' +
|
|
1176
1191
|
' - Discovering cloud tiers: "cloud tiers --provider <provider> --type <database|storage> [--db-type <type>] --json"\n' +
|
|
1177
1192
|
' IMPORTANT: `cloud tiers` has no `list` verb. Use only a tier returned for the selected provider/type.\n' +
|
|
1178
|
-
' - Provisioning and persisting
|
|
1179
|
-
'
|
|
1180
|
-
'
|
|
1181
|
-
'
|
|
1182
|
-
'
|
|
1183
|
-
'
|
|
1184
|
-
'
|
|
1185
|
-
'
|
|
1186
|
-
'
|
|
1193
|
+
' - Provisioning and persisting cloud resources:\n' +
|
|
1194
|
+
' For a product with multiple environments always use provision-persist-all (not provision-persist):\n' +
|
|
1195
|
+
' cloud resources provision-persist-all -f file.json --json\n' +
|
|
1196
|
+
' File is a JSON ARRAY — one entry per env, all with the same product and component tag.\n' +
|
|
1197
|
+
' Each entry requires: cloud (connection tag), service (provider service), type (Ductape component type),\n' +
|
|
1198
|
+
' product (product tag), component (new component tag), env (existing environment slug).\n' +
|
|
1199
|
+
' Provider parameters such as region, location, bucketName, dbName, tier, and waitForReady\n' +
|
|
1200
|
+
' may be supplied per entry in the file.\n' +
|
|
1201
|
+
' Example (two envs): [{"cloud":"gcp-snd","service":"gcs","type":"storage",\n' +
|
|
1202
|
+
' "product":"product-tag","component":"assets","env":"snd","location":"us-central1"},\n' +
|
|
1203
|
+
' {"cloud":"gcp-prd","service":"gcs","type":"storage","product":"product-tag",\n' +
|
|
1204
|
+
' "component":"assets","env":"prd","location":"us-central1"}].\n' +
|
|
1205
|
+
' Use provision-persist (single-env) only when the product has exactly one environment.\n' +
|
|
1206
|
+
' Use provision alone when you only need the provider resource without registering an asset.\n' +
|
|
1207
|
+
' Tier discovery does not by itself prove that a connection supports provisioning that service:\n' +
|
|
1208
|
+
' if provisioning reports an unsupported provider/service pair, stop and report it.\n' +
|
|
1187
1209
|
' Never infer an environment, provider service, region, tier, or cost. List/verify each before provisioning.\n' +
|
|
1188
1210
|
' - Known provisioning limitations: MongoDB Atlas (M0 free tier) and Neo4j Aura cannot be provisioned via\n' +
|
|
1189
1211
|
' Ductape — they are import-only. Only AWS, GCP, and Azure managed services support provision-persist.\n' +
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -79,10 +79,11 @@ There are THREE categories of operations. Use the right tool for each:
|
|
|
79
79
|
⚠ MULTI-ENV REQUIREMENT — applies to ALL product assets (storage, database, cache,
|
|
80
80
|
messageBroker, graph, vector, and any other resource with an envs array):
|
|
81
81
|
The envs array MUST contain one entry for EVERY environment defined on the product.
|
|
82
|
-
import-persist and provision-persist
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
import-persist and provision-persist only generate a draft for ONE env at a time.
|
|
83
|
+
Calling import-persist once will fail with MISSING_ENV_COVERAGE because the single-env
|
|
84
|
+
draft does not cover all product environments. Use import-persist-all or
|
|
85
|
+
provision-persist-all instead — they accept an array of per-env inputs, import/provision
|
|
86
|
+
each env in parallel, merge the drafts, and persist once with full env coverage.
|
|
86
87
|
|
|
87
88
|
BEFORE constructing any resource file or initiating import/provision:
|
|
88
89
|
1. Run: ductape_cli("products environments list <product_tag> --json")
|
|
@@ -90,6 +91,16 @@ There are THREE categories of operations. Use the right tool for each:
|
|
|
90
91
|
3. Collect connection details or confirmation for EACH slug from the user.
|
|
91
92
|
Do not proceed until you have details for every env.
|
|
92
93
|
|
|
94
|
+
Use import-persist-all / provision-persist-all (not the single-env forms) whenever
|
|
95
|
+
you have details for all envs. The file must be a JSON array — one object per env,
|
|
96
|
+
same format as a single import-persist/provision-persist input, all sharing the same
|
|
97
|
+
product and component tag. Example:
|
|
98
|
+
[{"cloud":"gcp-snd","service":"gcs","type":"storage","product":"my-prod",
|
|
99
|
+
"component":"assets","env":"snd","resource":"snd-bucket"},
|
|
100
|
+
{"cloud":"gcp-prd","service":"gcs","type":"storage","product":"my-prod",
|
|
101
|
+
"component":"assets","env":"prd","resource":"prd-bucket"}]
|
|
102
|
+
→ ductape_cli("cloud resources import-persist-all -f all-envs.json --json")
|
|
103
|
+
|
|
93
104
|
Sharing one resource across multiple envs is allowed but must be confirmed per env:
|
|
94
105
|
- Ask the user explicitly: "Should <env> use the same <resource> as <other_env>?"
|
|
95
106
|
- Never assume shared configuration without confirmation.
|
|
@@ -1257,27 +1268,38 @@ async function main() {
|
|
|
1257
1268
|
' resources storage create -f storage.json\n' +
|
|
1258
1269
|
' File shape: { name, tag, envs: [{ slug, type: "aws"|"gcp"|"azure", config: { bucketName, ...creds } }] }\n' +
|
|
1259
1270
|
' For cloud-linked envs set config.cloud to the connection tag and omit raw credentials.\n' +
|
|
1260
|
-
' 2. Import
|
|
1261
|
-
' cloud resources import-persist -f import.json --json\n' +
|
|
1262
|
-
' File
|
|
1263
|
-
'
|
|
1264
|
-
'
|
|
1265
|
-
' "
|
|
1266
|
-
'
|
|
1267
|
-
'
|
|
1268
|
-
'
|
|
1271
|
+
' 2. Import existing cloud buckets via cloud connections (no provisioning):\n' +
|
|
1272
|
+
' cloud resources import-persist-all -f import-all.json --json\n' +
|
|
1273
|
+
' File is a JSON ARRAY — one entry per env, all with the same product and component tag.\n' +
|
|
1274
|
+
' Each entry: cloud (connection tag), service (e.g. "gcs","s3"), type ("storage"),\n' +
|
|
1275
|
+
' product, component (new tag), env, resource (bucket name/identifier).\n' +
|
|
1276
|
+
' Example (two envs): [{"cloud":"gcp-snd","service":"gcs","type":"storage",\n' +
|
|
1277
|
+
' "product":"my-product","component":"assets","env":"snd","resource":"snd-bucket"},\n' +
|
|
1278
|
+
' {"cloud":"gcp-prd","service":"gcs","type":"storage","product":"my-product",\n' +
|
|
1279
|
+
' "component":"assets","env":"prd","resource":"prd-bucket"}].\n' +
|
|
1280
|
+
' All envs are imported in parallel, drafts merged, then the asset is created once.\n' +
|
|
1281
|
+
' Use import-persist (single-env form) only when the product has exactly one environment.\n' +
|
|
1282
|
+
' If import-persist-all fails, the error reports all create/update failures — do not retry blindly.\n' +
|
|
1283
|
+
' 3. Provision brand-new buckets AND register them (see provision-persist-all docs below).\n' +
|
|
1269
1284
|
' - Managing cloud connections and cloud-linked resources\n' +
|
|
1270
1285
|
' - Discovering cloud tiers: "cloud tiers --provider <provider> --type <database|storage> [--db-type <type>] --json"\n' +
|
|
1271
1286
|
' IMPORTANT: `cloud tiers` has no `list` verb. Use only a tier returned for the selected provider/type.\n' +
|
|
1272
|
-
' - Provisioning and persisting
|
|
1273
|
-
'
|
|
1274
|
-
'
|
|
1275
|
-
'
|
|
1276
|
-
'
|
|
1277
|
-
'
|
|
1278
|
-
'
|
|
1279
|
-
'
|
|
1280
|
-
'
|
|
1287
|
+
' - Provisioning and persisting cloud resources:\n' +
|
|
1288
|
+
' For a product with multiple environments always use provision-persist-all (not provision-persist):\n' +
|
|
1289
|
+
' cloud resources provision-persist-all -f file.json --json\n' +
|
|
1290
|
+
' File is a JSON ARRAY — one entry per env, all with the same product and component tag.\n' +
|
|
1291
|
+
' Each entry requires: cloud (connection tag), service (provider service), type (Ductape component type),\n' +
|
|
1292
|
+
' product (product tag), component (new component tag), env (existing environment slug).\n' +
|
|
1293
|
+
' Provider parameters such as region, location, bucketName, dbName, tier, and waitForReady\n' +
|
|
1294
|
+
' may be supplied per entry in the file.\n' +
|
|
1295
|
+
' Example (two envs): [{"cloud":"gcp-snd","service":"gcs","type":"storage",\n' +
|
|
1296
|
+
' "product":"product-tag","component":"assets","env":"snd","location":"us-central1"},\n' +
|
|
1297
|
+
' {"cloud":"gcp-prd","service":"gcs","type":"storage","product":"product-tag",\n' +
|
|
1298
|
+
' "component":"assets","env":"prd","location":"us-central1"}].\n' +
|
|
1299
|
+
' Use provision-persist (single-env) only when the product has exactly one environment.\n' +
|
|
1300
|
+
' Use provision alone when you only need the provider resource without registering an asset.\n' +
|
|
1301
|
+
' Tier discovery does not by itself prove that a connection supports provisioning that service:\n' +
|
|
1302
|
+
' if provisioning reports an unsupported provider/service pair, stop and report it.\n' +
|
|
1281
1303
|
' Never infer an environment, provider service, region, tier, or cost. List/verify each before provisioning.\n' +
|
|
1282
1304
|
' - Known provisioning limitations: MongoDB Atlas (M0 free tier) and Neo4j Aura cannot be provisioned via\n' +
|
|
1283
1305
|
' Ductape — they are import-only. Only AWS, GCP, and Azure managed services support provision-persist.\n' +
|