@ductape/mcp 0.1.21 → 0.1.23
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 +12 -7
- package/package.json +1 -1
- package/src/index.ts +12 -7
package/dist/index.js
CHANGED
|
@@ -99,11 +99,15 @@ There are THREE categories of operations. Use the right tool for each:
|
|
|
99
99
|
2. RUNTIME OPERATIONS (run, dispatch, execute, start, send, produce, query, insert, update, delete…)
|
|
100
100
|
The "input" field shape is product- and operation-specific — it is NOT derivable from Joi validators.
|
|
101
101
|
It is defined by how the product's action/feature/session/quota/etc. was configured in Ductape.
|
|
102
|
-
→ ALWAYS call ductape_generate_payload first to get the canonical payload template
|
|
102
|
+
→ ALWAYS call ductape_generate_payload first to get the canonical payload template, EXCEPT for
|
|
103
|
+
messaging (produce/consume/dispatch) — see the Events section for why.
|
|
103
104
|
→ The template shows you exactly which input keys are expected and their types/defaults.
|
|
104
105
|
→ Then fill in the values and pass the completed payload to ductape_execute.
|
|
106
|
+
→ Applies to: actions, features, sessions, notifications, databases, storage, graphs, vectors,
|
|
107
|
+
quotas, fallbacks, jobs, and any other operation that executes against a pre-configured schema.
|
|
105
108
|
|
|
106
|
-
Skipping ductape_generate_payload for runtime operations will produce incorrect or empty input payloads.
|
|
109
|
+
Skipping ductape_generate_payload for applicable runtime operations will produce incorrect or empty input payloads.
|
|
110
|
+
Exception: messaging produce/consume/dispatch — the producer defines the schema, so infer from context instead.
|
|
107
111
|
|
|
108
112
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
109
113
|
|
|
@@ -305,9 +309,9 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
305
309
|
sample?: object, idempotent?: boolean, queueUrls?: [{ env_slug: string, url: string }] }]
|
|
306
310
|
messageBrokers.topics.fetch [product_tag, topic_tag]
|
|
307
311
|
messageBrokers.topics.list [product_tag, broker_tag]
|
|
308
|
-
messageBrokers.produce [{ product, env, event: "broker_tag:topic_tag", message: { key: value }, session?, cache? }]
|
|
312
|
+
messageBrokers.produce [{ product, env, event: "broker_tag:topic_tag", message: { key: value }, session?, cache? }]
|
|
309
313
|
messageBrokers.consume [{ product, env, event: "broker_tag:topic_tag", callback: "function_ref" }]
|
|
310
|
-
messageBrokers.dispatch [{ product, env, broker, event, input: { message }, retries?, session?, cache?, schedule?: { cron?, every?, start_at? } }]
|
|
314
|
+
messageBrokers.dispatch [{ product, env, broker, event, input: { message }, retries?, session?, cache?, schedule?: { cron?, every?, start_at? } }]
|
|
311
315
|
messageBrokers.messages.query [{ product, env, brokerTag, topicTag?, producerTag?, consumerTag?, status?, startDate?, endDate?, page?, limit? }]
|
|
312
316
|
messageBrokers.messages.getProducers [{ product, env, brokerTag, topicTag?, page?, limit? }]
|
|
313
317
|
messageBrokers.messages.getConsumers [{ product, env, brokerTag, topicTag?, page?, limit? }]
|
|
@@ -2073,12 +2077,14 @@ Import (register an EXISTING cloud resource):
|
|
|
2073
2077
|
The entire producer/consumer contract is the code you write in your controllers or services:
|
|
2074
2078
|
|
|
2075
2079
|
Produce (publish a message) — write in your service/controller:
|
|
2076
|
-
|
|
2080
|
+
Do NOT call ductape_generate_payload for messaging. Events have no pre-existing backend schema
|
|
2081
|
+
to discover — the producer defines the schema. Instead, infer the message shape from context
|
|
2082
|
+
(event name, existing data models, user input), present it to the user for approval, then implement.
|
|
2077
2083
|
await ductape.events.produce({
|
|
2078
2084
|
product: "my-product",
|
|
2079
2085
|
env: "prd",
|
|
2080
2086
|
event: "broker_tag:topic_tag", // "broker_tag:topic_tag" — always colon-separated
|
|
2081
|
-
message: { key: value },
|
|
2087
|
+
message: { key: value }, // shape inferred from context, approved by user
|
|
2082
2088
|
});
|
|
2083
2089
|
Idempotent publish (deduplicates by key):
|
|
2084
2090
|
await ductape.events.publishIdempotent({ product, env, event, message, idempotencyKey, idempotencyTtl? })
|
|
@@ -2095,7 +2101,6 @@ Import (register an EXISTING cloud resource):
|
|
|
2095
2101
|
Background dispatch with scheduling — write in your service/controller:
|
|
2096
2102
|
await ductape.events.dispatch({ product, env, broker, event, input: { message },
|
|
2097
2103
|
schedule?: { start_at?, cron?, every?, limit?, endDate?, tz? } })
|
|
2098
|
-
→ CALL ductape_generate_payload FIRST (operation_family="messaging", method="dispatch")
|
|
2099
2104
|
|
|
2100
2105
|
For the four standard producer declarations (match-state, match-report, projection-updated,
|
|
2101
2106
|
notification), write these produce calls in the relevant application service methods — there is
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -110,11 +110,15 @@ There are THREE categories of operations. Use the right tool for each:
|
|
|
110
110
|
2. RUNTIME OPERATIONS (run, dispatch, execute, start, send, produce, query, insert, update, delete…)
|
|
111
111
|
The "input" field shape is product- and operation-specific — it is NOT derivable from Joi validators.
|
|
112
112
|
It is defined by how the product's action/feature/session/quota/etc. was configured in Ductape.
|
|
113
|
-
→ ALWAYS call ductape_generate_payload first to get the canonical payload template
|
|
113
|
+
→ ALWAYS call ductape_generate_payload first to get the canonical payload template, EXCEPT for
|
|
114
|
+
messaging (produce/consume/dispatch) — see the Events section for why.
|
|
114
115
|
→ The template shows you exactly which input keys are expected and their types/defaults.
|
|
115
116
|
→ Then fill in the values and pass the completed payload to ductape_execute.
|
|
117
|
+
→ Applies to: actions, features, sessions, notifications, databases, storage, graphs, vectors,
|
|
118
|
+
quotas, fallbacks, jobs, and any other operation that executes against a pre-configured schema.
|
|
116
119
|
|
|
117
|
-
Skipping ductape_generate_payload for runtime operations will produce incorrect or empty input payloads.
|
|
120
|
+
Skipping ductape_generate_payload for applicable runtime operations will produce incorrect or empty input payloads.
|
|
121
|
+
Exception: messaging produce/consume/dispatch — the producer defines the schema, so infer from context instead.
|
|
118
122
|
|
|
119
123
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
120
124
|
|
|
@@ -316,9 +320,9 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
316
320
|
sample?: object, idempotent?: boolean, queueUrls?: [{ env_slug: string, url: string }] }]
|
|
317
321
|
messageBrokers.topics.fetch [product_tag, topic_tag]
|
|
318
322
|
messageBrokers.topics.list [product_tag, broker_tag]
|
|
319
|
-
messageBrokers.produce [{ product, env, event: "broker_tag:topic_tag", message: { key: value }, session?, cache? }]
|
|
323
|
+
messageBrokers.produce [{ product, env, event: "broker_tag:topic_tag", message: { key: value }, session?, cache? }]
|
|
320
324
|
messageBrokers.consume [{ product, env, event: "broker_tag:topic_tag", callback: "function_ref" }]
|
|
321
|
-
messageBrokers.dispatch [{ product, env, broker, event, input: { message }, retries?, session?, cache?, schedule?: { cron?, every?, start_at? } }]
|
|
325
|
+
messageBrokers.dispatch [{ product, env, broker, event, input: { message }, retries?, session?, cache?, schedule?: { cron?, every?, start_at? } }]
|
|
322
326
|
messageBrokers.messages.query [{ product, env, brokerTag, topicTag?, producerTag?, consumerTag?, status?, startDate?, endDate?, page?, limit? }]
|
|
323
327
|
messageBrokers.messages.getProducers [{ product, env, brokerTag, topicTag?, page?, limit? }]
|
|
324
328
|
messageBrokers.messages.getConsumers [{ product, env, brokerTag, topicTag?, page?, limit? }]
|
|
@@ -2142,12 +2146,14 @@ Import (register an EXISTING cloud resource):
|
|
|
2142
2146
|
The entire producer/consumer contract is the code you write in your controllers or services:
|
|
2143
2147
|
|
|
2144
2148
|
Produce (publish a message) — write in your service/controller:
|
|
2145
|
-
|
|
2149
|
+
Do NOT call ductape_generate_payload for messaging. Events have no pre-existing backend schema
|
|
2150
|
+
to discover — the producer defines the schema. Instead, infer the message shape from context
|
|
2151
|
+
(event name, existing data models, user input), present it to the user for approval, then implement.
|
|
2146
2152
|
await ductape.events.produce({
|
|
2147
2153
|
product: "my-product",
|
|
2148
2154
|
env: "prd",
|
|
2149
2155
|
event: "broker_tag:topic_tag", // "broker_tag:topic_tag" — always colon-separated
|
|
2150
|
-
message: { key: value },
|
|
2156
|
+
message: { key: value }, // shape inferred from context, approved by user
|
|
2151
2157
|
});
|
|
2152
2158
|
Idempotent publish (deduplicates by key):
|
|
2153
2159
|
await ductape.events.publishIdempotent({ product, env, event, message, idempotencyKey, idempotencyTtl? })
|
|
@@ -2164,7 +2170,6 @@ Import (register an EXISTING cloud resource):
|
|
|
2164
2170
|
Background dispatch with scheduling — write in your service/controller:
|
|
2165
2171
|
await ductape.events.dispatch({ product, env, broker, event, input: { message },
|
|
2166
2172
|
schedule?: { start_at?, cron?, every?, limit?, endDate?, tz? } })
|
|
2167
|
-
→ CALL ductape_generate_payload FIRST (operation_family="messaging", method="dispatch")
|
|
2168
2173
|
|
|
2169
2174
|
For the four standard producer declarations (match-state, match-report, projection-updated,
|
|
2170
2175
|
notification), write these produce calls in the relevant application service methods — there is
|