@ductape/mcp 0.3.0 → 0.3.1

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 (2) hide show
  1. package/dist/index.js +47 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3709,7 +3709,7 @@ QUOTAS — weighted/provider-capacity routing pools (NOT request rate limiting):
3709
3709
  input: { to: { type: "string", required: true }, message: { type: "string" } },
3710
3710
  options: [
3711
3711
  { provider: "twilio", app: "twilio-app", type: "action", event: "send-sms",
3712
- quota: 1000, uses: 0, retries: 2,
3712
+ quota: 1000, uses: 0, retries: 2, health: "twilio-health",
3713
3713
  input: { "body:to": "$Input{to}", "body:message": "$Input{message}" },
3714
3714
  output: {} },
3715
3715
  { provider: "nexmo", app: "nexmo-app", type: "action", event: "send-sms",
@@ -3731,13 +3731,54 @@ FALLBACKS — automatic provider switching on failure:
3731
3731
  fallback.run [{ product, env, tag, input }] ← CALL ductape_generate_payload FIRST
3732
3732
  fallback.dispatch [{ product, env, tag, input, schedule? }]
3733
3733
 
3734
+ HEALTH-GATED PROVIDERS — REQUIRED BEHAVIOR:
3735
+ Provider options may declare health: "<healthcheck-tag>". healthcheck is a deprecated input alias;
3736
+ generate health in new JSON and code. Before creating a quota/fallback, list the product's existing
3737
+ healthchecks and reuse one whose probe targets the same app/resource and operation. Create a new
3738
+ healthcheck only when no equivalent check exists. Verify the referenced tag exists in the same
3739
+ product and covers every environment used by the quota/fallback.
3740
+
3741
+ This is an active prerequisite, not optional advice. When creating or updating a quota/fallback:
3742
+ 1. List existing healthchecks and connected product providers.
3743
+ 2. Match each provider to an existing check by probe type + provider asset/app + safe probe event.
3744
+ 3. For every unmatched provider, inspect its live action/resource schema, choose a repeat-safe probe,
3745
+ write ductape/healthchecks/<tag>.json, and run: ductape resources health create --tag <product>
3746
+ -f ductape/healthchecks/<tag>.json --json.
3747
+ 4. Fetch and explicitly run each newly-created check in every target environment. Do not create the
3748
+ quota/fallback until the probe schema and status lookup both succeed.
3749
+ 5. Put health: "<verified-healthcheck-tag>" on every provider option, then create/update and refetch
3750
+ the quota/fallback. A provider without a verified health tag is an incomplete resilience asset.
3751
+ If no safe repeatable probe exists, stop and explain the blocker; never invent an endpoint or omit
3752
+ health silently.
3753
+
3754
+ Runtime contract:
3755
+ - Read the linked health status before provider selection.
3756
+ - Never select a provider whose linked status is unavailable, even when every provider is down.
3757
+ Return NO_HEALTHY_PROVIDERS/NO_PROVIDERS_AVAILABLE instead of forcing traffic through it.
3758
+ - When a selected provider exhausts its bounded retries, immediately mark the linked healthcheck
3759
+ unavailable. The current fallback or quota invocation must immediately continue/reselect from
3760
+ the remaining healthy options; subsequent invocations must also skip it. Never wait for the
3761
+ health poll before performing local failover.
3762
+ - Runtime success does not close the circuit. Only a successful scheduled or explicit health probe
3763
+ restores available, preventing one opportunistic request from bypassing recovery validation.
3764
+ - One global Tickets-hosted scheduler is the fallback runner when no fresh local SDK monitor result
3765
+ exists. Do not require application code to call monitor() for platform healthchecks to run.
3766
+ - Remote and local runtimes share health through the product's centrally persisted health state,
3767
+ not through a common Redis instance. SDK runtime-manifest polling compares healthRevision and
3768
+ atomically refreshes an in-process health snapshot in the background. Quota/fallback routing uses
3769
+ synchronous snapshot reads; never add a bootstrap, Redis, or backend lookup to the invocation path.
3770
+ A local provider failure trips the in-process state immediately and persists it asynchronously so
3771
+ other instances receive it on their next lightweight poll.
3772
+ - A transition from available to unavailable sends one alert to accepted workspace participants;
3773
+ repeated unhealthy probe results must not generate duplicate transition emails.
3774
+
3734
3775
  HEALTHCHECKS — continuous probe with failure notifications:
3735
- Scheduled probes have a platform-owned fallback runner in the Ductape proxy. A local SDK monitor
3736
- may also run them: while it consistently persists a fresh lastChecked record, the proxy defers
3737
- that product/env/check. The proxy freshness window accounts for the SDK's batched backend status
3776
+ Scheduled probes have a platform-owned global fallback runner in the Ductape Tickets service. A local SDK monitor
3777
+ may also run them: while it consistently persists a fresh lastChecked record, the global worker defers
3778
+ that product/env/check. The server freshness window accounts for the SDK's batched backend status
3738
3779
  flush (currently five minutes), not only the shorter probe interval. If records stop arriving and
3739
- the freshness window expires, the proxy automatically takes over. Do not instruct users to
3740
- disable the proxy fallback when using a local monitor.
3780
+ the freshness window expires, the global worker automatically takes over. Do not instruct users to
3781
+ disable the server fallback when using a local monitor.
3741
3782
 
3742
3783
  Workbench definition shape:
3743
3784
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "MCP server that exposes Ductape SDK operations via the backend proxy",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "build": "tsc",
18
- "test": "npm run build && node scripts/check-cli-command-security.mjs && node scripts/check-frontend-analytics-guidance.mjs && node scripts/check-events-discovery.mjs && node scripts/check-schema-fallback.mjs && node scripts/check-paystack-action-schema.mjs && node scripts/check-portable-functions.mjs && node scripts/check-feature-control-flow.mjs && node scripts/check-project-link-guidance.mjs && node scripts/check-graph-vector-projection-guidance.mjs && node scripts/check-asset-file-guidance.mjs && node scripts/check-database-action-contract-guidance.mjs && node scripts/check-runtime-sync-guidance.mjs && node scripts/check-runtime-input-recovery.mjs",
18
+ "test": "npm run build && node scripts/check-cli-command-security.mjs && node scripts/check-frontend-analytics-guidance.mjs && node scripts/check-events-discovery.mjs && node scripts/check-schema-fallback.mjs && node scripts/check-paystack-action-schema.mjs && node scripts/check-portable-functions.mjs && node scripts/check-feature-control-flow.mjs && node scripts/check-project-link-guidance.mjs && node scripts/check-graph-vector-projection-guidance.mjs && node scripts/check-asset-file-guidance.mjs && node scripts/check-database-action-contract-guidance.mjs && node scripts/check-runtime-sync-guidance.mjs && node scripts/check-runtime-input-recovery.mjs && node scripts/check-resilience-health-guidance.mjs",
19
19
  "start": "node dist/index.js",
20
20
  "dev": "tsx src/index.ts"
21
21
  },