MCPcopy Create free account
hub / github.com/WeaveMindAI/weft / dispatchAction

Function dispatchAction

sidecars/examples/javascript/src/index.js:41–56  ·  view source on GitHub ↗
(action, payload)

Source from the content-addressed store, hash-verified

39// =============================================================================
40
41async function dispatchAction(action, payload) {
42 switch (action) {
43 // Required by contract: readiness check.
44 // Return ready: true when the server can process actions.
45 // Gate on core dependencies (DB pool, etc.), NOT on user-initiated
46 // connections (QR scans, OAuth flows).
47 // The orchestrator blocks provisioning until this returns ready.
48 case "ping": {
49 // TODO: add your own checks here, e.g.:
50 // await db.query("SELECT 1");
51 return { ready: true };
52 }
53 default:
54 throw new Error(`Unknown action: ${action}`);
55 }
56}
57
58// =============================================================================
59// CONTRACT HANDLERS, you usually don't need to modify these

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected