@ductape/mcp 0.1.39 → 0.1.40
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 -32
- package/package.json +1 -1
- package/src/index.ts +44 -32
package/dist/index.js
CHANGED
|
@@ -464,18 +464,18 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
464
464
|
messageBrokers.fetch [product_tag, broker_tag]
|
|
465
465
|
messageBrokers.list [product_tag]
|
|
466
466
|
messageBrokers.delete [product_tag, broker_tag]
|
|
467
|
-
messageBrokers.topics.create
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
←
|
|
472
|
-
|
|
473
|
-
←
|
|
474
|
-
|
|
475
|
-
messageBrokers.topics.
|
|
476
|
-
|
|
477
|
-
messageBrokers.topics.fetch [product_tag, topic_tag]
|
|
478
|
-
messageBrokers.topics.list [product_tag, broker_tag]
|
|
467
|
+
messageBrokers.topics.create ← FORBIDDEN with publishable key. Use ductape_cli instead:
|
|
468
|
+
ductape_cli("events topics create -f topic.json")
|
|
469
|
+
topic.json: { tag, name, broker, description?, sample?, idempotent?, queueUrls?: [{ env_slug, url }] }
|
|
470
|
+
← Always required before consuming. For SQS: must include queueUrls per env.
|
|
471
|
+
← For Pub/Sub, Kafka, RabbitMQ, Redis, NATS: the first produce call auto-registers the topic,
|
|
472
|
+
but you should still create it explicitly so consumers can subscribe before any produce occurs.
|
|
473
|
+
messageBrokers.topics.update ← FORBIDDEN with publishable key. Use ductape_cli:
|
|
474
|
+
ductape_cli("events topics update --tag broker:topic -f patch.json")
|
|
475
|
+
messageBrokers.topics.delete ← FORBIDDEN with publishable key. Use ductape_cli:
|
|
476
|
+
ductape_cli("events topics delete --tag broker:topic")
|
|
477
|
+
messageBrokers.topics.fetch [product_tag, topic_tag] ← safe via ductape_execute
|
|
478
|
+
messageBrokers.topics.list [product_tag, broker_tag] ← safe via ductape_execute
|
|
479
479
|
messageBrokers.produce [{ product, env, event: "broker_tag:topic_tag", message: { key: value }, session?, cache? }]
|
|
480
480
|
messageBrokers.consume [{ product, env, event: "broker_tag:topic_tag", callback: "function_ref" }]
|
|
481
481
|
messageBrokers.dispatch [{ product, env, broker, event, input: { message }, retries?, session?, cache?, schedule?: { cron?, every?, start_at? } }]
|
|
@@ -2422,22 +2422,34 @@ Import (register an EXISTING cloud resource):
|
|
|
2422
2422
|
Producing to a topic also calls ensureTopicRegistered in the background — but DO NOT rely on
|
|
2423
2423
|
auto-registration for consume paths. Always create topics explicitly.
|
|
2424
2424
|
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2425
|
+
IMPORTANT: messageBrokers.topics.create requires an access key (admin operation).
|
|
2426
|
+
Use ductape_cli — NOT ductape_execute — to create topics.
|
|
2427
|
+
|
|
2428
|
+
Write a topic.json file, then:
|
|
2429
|
+
ductape_cli("events topics create -f topic.json")
|
|
2430
|
+
|
|
2431
|
+
topic.json schema:
|
|
2432
|
+
{
|
|
2433
|
+
"tag": "order-created", // topic tag only — NOT "broker:topic"
|
|
2434
|
+
"name": "Order Created",
|
|
2435
|
+
"broker": "order-events", // broker component tag
|
|
2436
|
+
"description": "...", // optional
|
|
2437
|
+
"sample": { "orderId": "string", "total": 0 }, // expected message shape
|
|
2438
|
+
"idempotent": false, // optional — deduplicates by idempotency_key when true
|
|
2439
|
+
// AWS SQS only — per-env queue URL:
|
|
2440
|
+
"queueUrls": [
|
|
2441
|
+
{ "env_slug": "snd", "url": "https://sqs.us-east-1.amazonaws.com/123/queue-snd" },
|
|
2442
|
+
{ "env_slug": "prd", "url": "https://sqs.us-east-1.amazonaws.com/123/queue-prd" }
|
|
2443
|
+
]
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
Other topic operations (all require access key via ductape_cli):
|
|
2447
|
+
ductape_cli("events topics list --tag order-events") → list topics for a broker
|
|
2448
|
+
ductape_cli("events topics get --tag order-events:order-created")
|
|
2449
|
+
ductape_cli("events topics update --tag order-events:order-created -f patch.json")
|
|
2450
|
+
ductape_cli("events topics delete --tag order-events:order-created")
|
|
2438
2451
|
|
|
2439
|
-
|
|
2440
|
-
ductape_execute("messageBrokers.topics.list", [product_tag, "broker-tag"])
|
|
2452
|
+
Read-only fetches (safe with publishable key via ductape_execute):
|
|
2441
2453
|
ductape_execute("messageBrokers.fetch", [product_tag, "broker-tag"]) → includes topics[]
|
|
2442
2454
|
|
|
2443
2455
|
━━━ STEP 3: PRODUCE — WRITTEN IN APPLICATION CODE ━━━
|
|
@@ -2465,13 +2477,13 @@ Import (register an EXISTING cloud resource):
|
|
|
2465
2477
|
});
|
|
2466
2478
|
|
|
2467
2479
|
NESTJS — method decorator:
|
|
2468
|
-
import {
|
|
2480
|
+
import { Events } from '@ductape/nestjs';
|
|
2469
2481
|
@Injectable() export class OrdersService {
|
|
2470
|
-
@
|
|
2482
|
+
@Events.Produce({ event: 'order-events:order-created' })
|
|
2471
2483
|
emitOrderCreated(payload: { orderId: string; total: number }) { return payload; }
|
|
2472
2484
|
|
|
2473
2485
|
// Scheduled dispatch — fire-and-forget with optional schedule:
|
|
2474
|
-
@
|
|
2486
|
+
@Events.Dispatch({ broker: 'order-events', event: 'order-events:order-created',
|
|
2475
2487
|
schedule?: { start_at?, cron?, every?, limit?, tz? } })
|
|
2476
2488
|
scheduleOrderNotification(payload: Record<string, unknown>) { return payload; }
|
|
2477
2489
|
}
|
|
@@ -2546,7 +2558,7 @@ Import (register an EXISTING cloud resource):
|
|
|
2546
2558
|
consumer?: { tag: "order-processor", name: "Order Processor" },
|
|
2547
2559
|
});
|
|
2548
2560
|
|
|
2549
|
-
NESTJS — use SDK in onModuleInit (no @
|
|
2561
|
+
NESTJS — use SDK in onModuleInit (no @Events.Consume decorator exists yet):
|
|
2550
2562
|
@Injectable()
|
|
2551
2563
|
export class OrderConsumerService implements OnModuleInit {
|
|
2552
2564
|
constructor(private readonly ductape: Ductape) {}
|
|
@@ -3523,7 +3535,7 @@ async function main() {
|
|
|
3523
3535
|
' GCP Pub/Sub service identifier is "pubsub". AWS SQS is "sqs". Azure Service Bus is "servicebus".\n' +
|
|
3524
3536
|
' Message brokers are import-only (no provision-persist). Import flow is the same as storage.\n' +
|
|
3525
3537
|
' type field = "messageBrokers" (not "messagebrokers" or "events").\n' +
|
|
3526
|
-
' After importing, create
|
|
3538
|
+
' After importing, create topics first with ductape_cli("events topics create -f topic.json") — SQS requires explicit topic creation with queueUrls. For other providers, topics auto-register on first produce but should still be created explicitly before any consumer subscribes.\n' +
|
|
3527
3539
|
' - Listing workspaces, products, secrets\n' +
|
|
3528
3540
|
' - Linking a project folder: "link --product <tag> --env <slug>"\n' +
|
|
3529
3541
|
' - Syncing sessions/notifications/events: "apply" or "apply sessions" etc.\n' +
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -475,18 +475,18 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
475
475
|
messageBrokers.fetch [product_tag, broker_tag]
|
|
476
476
|
messageBrokers.list [product_tag]
|
|
477
477
|
messageBrokers.delete [product_tag, broker_tag]
|
|
478
|
-
messageBrokers.topics.create
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
←
|
|
483
|
-
|
|
484
|
-
←
|
|
485
|
-
|
|
486
|
-
messageBrokers.topics.
|
|
487
|
-
|
|
488
|
-
messageBrokers.topics.fetch [product_tag, topic_tag]
|
|
489
|
-
messageBrokers.topics.list [product_tag, broker_tag]
|
|
478
|
+
messageBrokers.topics.create ← FORBIDDEN with publishable key. Use ductape_cli instead:
|
|
479
|
+
ductape_cli("events topics create -f topic.json")
|
|
480
|
+
topic.json: { tag, name, broker, description?, sample?, idempotent?, queueUrls?: [{ env_slug, url }] }
|
|
481
|
+
← Always required before consuming. For SQS: must include queueUrls per env.
|
|
482
|
+
← For Pub/Sub, Kafka, RabbitMQ, Redis, NATS: the first produce call auto-registers the topic,
|
|
483
|
+
but you should still create it explicitly so consumers can subscribe before any produce occurs.
|
|
484
|
+
messageBrokers.topics.update ← FORBIDDEN with publishable key. Use ductape_cli:
|
|
485
|
+
ductape_cli("events topics update --tag broker:topic -f patch.json")
|
|
486
|
+
messageBrokers.topics.delete ← FORBIDDEN with publishable key. Use ductape_cli:
|
|
487
|
+
ductape_cli("events topics delete --tag broker:topic")
|
|
488
|
+
messageBrokers.topics.fetch [product_tag, topic_tag] ← safe via ductape_execute
|
|
489
|
+
messageBrokers.topics.list [product_tag, broker_tag] ← safe via ductape_execute
|
|
490
490
|
messageBrokers.produce [{ product, env, event: "broker_tag:topic_tag", message: { key: value }, session?, cache? }]
|
|
491
491
|
messageBrokers.consume [{ product, env, event: "broker_tag:topic_tag", callback: "function_ref" }]
|
|
492
492
|
messageBrokers.dispatch [{ product, env, broker, event, input: { message }, retries?, session?, cache?, schedule?: { cron?, every?, start_at? } }]
|
|
@@ -2495,22 +2495,34 @@ Import (register an EXISTING cloud resource):
|
|
|
2495
2495
|
Producing to a topic also calls ensureTopicRegistered in the background — but DO NOT rely on
|
|
2496
2496
|
auto-registration for consume paths. Always create topics explicitly.
|
|
2497
2497
|
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2498
|
+
IMPORTANT: messageBrokers.topics.create requires an access key (admin operation).
|
|
2499
|
+
Use ductape_cli — NOT ductape_execute — to create topics.
|
|
2500
|
+
|
|
2501
|
+
Write a topic.json file, then:
|
|
2502
|
+
ductape_cli("events topics create -f topic.json")
|
|
2503
|
+
|
|
2504
|
+
topic.json schema:
|
|
2505
|
+
{
|
|
2506
|
+
"tag": "order-created", // topic tag only — NOT "broker:topic"
|
|
2507
|
+
"name": "Order Created",
|
|
2508
|
+
"broker": "order-events", // broker component tag
|
|
2509
|
+
"description": "...", // optional
|
|
2510
|
+
"sample": { "orderId": "string", "total": 0 }, // expected message shape
|
|
2511
|
+
"idempotent": false, // optional — deduplicates by idempotency_key when true
|
|
2512
|
+
// AWS SQS only — per-env queue URL:
|
|
2513
|
+
"queueUrls": [
|
|
2514
|
+
{ "env_slug": "snd", "url": "https://sqs.us-east-1.amazonaws.com/123/queue-snd" },
|
|
2515
|
+
{ "env_slug": "prd", "url": "https://sqs.us-east-1.amazonaws.com/123/queue-prd" }
|
|
2516
|
+
]
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
Other topic operations (all require access key via ductape_cli):
|
|
2520
|
+
ductape_cli("events topics list --tag order-events") → list topics for a broker
|
|
2521
|
+
ductape_cli("events topics get --tag order-events:order-created")
|
|
2522
|
+
ductape_cli("events topics update --tag order-events:order-created -f patch.json")
|
|
2523
|
+
ductape_cli("events topics delete --tag order-events:order-created")
|
|
2511
2524
|
|
|
2512
|
-
|
|
2513
|
-
ductape_execute("messageBrokers.topics.list", [product_tag, "broker-tag"])
|
|
2525
|
+
Read-only fetches (safe with publishable key via ductape_execute):
|
|
2514
2526
|
ductape_execute("messageBrokers.fetch", [product_tag, "broker-tag"]) → includes topics[]
|
|
2515
2527
|
|
|
2516
2528
|
━━━ STEP 3: PRODUCE — WRITTEN IN APPLICATION CODE ━━━
|
|
@@ -2538,13 +2550,13 @@ Import (register an EXISTING cloud resource):
|
|
|
2538
2550
|
});
|
|
2539
2551
|
|
|
2540
2552
|
NESTJS — method decorator:
|
|
2541
|
-
import {
|
|
2553
|
+
import { Events } from '@ductape/nestjs';
|
|
2542
2554
|
@Injectable() export class OrdersService {
|
|
2543
|
-
@
|
|
2555
|
+
@Events.Produce({ event: 'order-events:order-created' })
|
|
2544
2556
|
emitOrderCreated(payload: { orderId: string; total: number }) { return payload; }
|
|
2545
2557
|
|
|
2546
2558
|
// Scheduled dispatch — fire-and-forget with optional schedule:
|
|
2547
|
-
@
|
|
2559
|
+
@Events.Dispatch({ broker: 'order-events', event: 'order-events:order-created',
|
|
2548
2560
|
schedule?: { start_at?, cron?, every?, limit?, tz? } })
|
|
2549
2561
|
scheduleOrderNotification(payload: Record<string, unknown>) { return payload; }
|
|
2550
2562
|
}
|
|
@@ -2619,7 +2631,7 @@ Import (register an EXISTING cloud resource):
|
|
|
2619
2631
|
consumer?: { tag: "order-processor", name: "Order Processor" },
|
|
2620
2632
|
});
|
|
2621
2633
|
|
|
2622
|
-
NESTJS — use SDK in onModuleInit (no @
|
|
2634
|
+
NESTJS — use SDK in onModuleInit (no @Events.Consume decorator exists yet):
|
|
2623
2635
|
@Injectable()
|
|
2624
2636
|
export class OrderConsumerService implements OnModuleInit {
|
|
2625
2637
|
constructor(private readonly ductape: Ductape) {}
|
|
@@ -3659,7 +3671,7 @@ async function main() {
|
|
|
3659
3671
|
' GCP Pub/Sub service identifier is "pubsub". AWS SQS is "sqs". Azure Service Bus is "servicebus".\n' +
|
|
3660
3672
|
' Message brokers are import-only (no provision-persist). Import flow is the same as storage.\n' +
|
|
3661
3673
|
' type field = "messageBrokers" (not "messagebrokers" or "events").\n' +
|
|
3662
|
-
' After importing, create
|
|
3674
|
+
' After importing, create topics first with ductape_cli("events topics create -f topic.json") — SQS requires explicit topic creation with queueUrls. For other providers, topics auto-register on first produce but should still be created explicitly before any consumer subscribes.\n' +
|
|
3663
3675
|
' - Listing workspaces, products, secrets\n' +
|
|
3664
3676
|
' - Linking a project folder: "link --product <tag> --env <slug>"\n' +
|
|
3665
3677
|
' - Syncing sessions/notifications/events: "apply" or "apply sessions" etc.\n' +
|