Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions functions/_middleware.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export async function onRequest(context) {
const url = new URL(context.request.url);
const host = url.hostname.toLowerCase();

if (host === "donation.ritualdev.in" && !url.pathname.startsWith("/api/") && !url.pathname.startsWith("/_next/")) {
const target =
url.pathname === "/" || url.pathname === "/index.html"
? `https://ritualdev.in/donate/${url.search}`
: `https://ritualdev.in${url.pathname}${url.search}`;
return Response.redirect(target, 302);
}

if (host === "www.ritualdev.in") {
return Response.redirect(`https://ritualdev.in${url.pathname}${url.search}`, 301);
}

return context.next();
}
71 changes: 71 additions & 0 deletions functions/api/audit-order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { buildAuditCheckoutUrl } from "../../src/lib/checkout-urls.js";
import { dispatchOrderWebhook, jsonResponse } from "../../src/lib/cf-webhook.js";

export async function onRequestPost(context) {
try {
const body = await context.request.json();
const {
productName,
targetUrl,
repoUrl,
contactEmail,
launchDate = "ASAP",
packageTier = "starter_199",
notes = "",
orderId: clientOrderId,
} = body || {};

if (!contactEmail || typeof contactEmail !== "string" || !contactEmail.includes("@")) {
return jsonResponse(
{ error: "A valid contact email is required to deliver your audit report." },
400
);
}

if (!targetUrl && !repoUrl) {
return jsonResponse(
{ error: "Please provide either a live web URL or a GitHub repository URL to audit." },
400
);
}

const orderId = clientOrderId || `AUDIT-${Math.floor(10000 + Math.random() * 90000)}`;
const checkoutUrl = buildAuditCheckoutUrl({
orderId,
packageTier,
productName,
targetUrl,
repoUrl,
contactEmail,
});

const deliverySla =
packageTier === "pro_399"
? "24 Hours (Full SaaS + MCP Defense Audit)"
: "24 Hours (Indie Pre-Launch Security Audit)";

const alertText = [
`🛡️ **New Pre-Launch Security Audit Order [${orderId}]**`,
`• **Tier:** ${packageTier} (${deliverySla})`,
`• **Product:** ${productName || "AI Product"}`,
`• **Email:** ${contactEmail.trim().toLowerCase()}`,
`• **Target URL:** ${targetUrl || "N/A"}`,
`• **Repo URL:** ${repoUrl || "N/A"}`,
`• **Timeline:** ${launchDate}`,
`• **Notes:** ${notes || "None"}`,
].join("\n");

await dispatchOrderWebhook(context.env, alertText);

return jsonResponse({
success: true,
orderId,
checkoutUrl,
deliverySla,
message: "Audit order registered. Proceeding to secure checkout.",
});
} catch (err) {
console.error("CF Pages Audit Order Error:", err);
return jsonResponse({ error: "Internal server error registering audit order." }, 500);
}
}
55 changes: 55 additions & 0 deletions functions/api/enterprise.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { dispatchOrderWebhook, jsonResponse } from "../../src/lib/cf-webhook.js";

export async function onRequestPost(context) {
try {
const body = await context.request.json();
const {
fullName,
workEmail,
companyName,
fleetSize,
infraEnvironment,
selectedNeeds,
notes,
} = body || {};

if (!workEmail || typeof workEmail !== "string" || !workEmail.includes("@")) {
return jsonResponse({ error: "A valid corporate work email is required." }, 400);
}

const submissionId = `SLA-REQ-${Math.floor(1000 + Math.random() * 9000)}`;
const leadRecord = {
submissionId,
timestamp: new Date().toISOString(),
fullName: fullName || "Not specified",
workEmail: workEmail.trim().toLowerCase(),
companyName: companyName || "Not specified",
fleetSize: fleetSize || "Not specified",
infraEnvironment: infraEnvironment || "AWS Private VPC",
selectedNeeds: Array.isArray(selectedNeeds) ? selectedNeeds : [],
notes: notes || "",
};

const alertText = [
`🏛️ *Enterprise Defense SLA Inquiry [${submissionId}]*`,
`*Company:* ${leadRecord.companyName}`,
`*Contact:* ${leadRecord.fullName} (${leadRecord.workEmail})`,
`*Fleet Size:* ${leadRecord.fleetSize}`,
`*Target Infra:* ${leadRecord.infraEnvironment}`,
`*Selected Needs:* ${leadRecord.selectedNeeds.join(", ") || "None selected"}`,
`*Notes:* ${leadRecord.notes || "None provided"}`,
].join("\n");

await dispatchOrderWebhook(context.env, alertText);

return jsonResponse({
success: true,
submissionId,
message: "Enterprise SLA inquiry received. A principal security engineer will contact you within 1 business day.",
lead: leadRecord,
});
} catch (err) {
console.error("CF Pages Enterprise API Error:", err);
return jsonResponse({ error: "Internal server error processing enterprise inquiry." }, 500);
}
}
65 changes: 65 additions & 0 deletions functions/api/mcp-order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { buildMcpCheckoutUrl } from "../../src/lib/checkout-urls.js";
import { dispatchOrderWebhook, jsonResponse } from "../../src/lib/cf-webhook.js";

export async function onRequestPost(context) {
try {
const body = await context.request.json();
const {
companyName,
apiDocsUrl,
contactEmail,
tier = "standard_349",
preferredTransport = "stdio + sse",
includeMonetization = true,
notes = "",
orderId: clientOrderId,
} = body || {};

if (!contactEmail || typeof contactEmail !== "string" || !contactEmail.includes("@")) {
return jsonResponse(
{ error: "A valid corporate or personal contact email is required." },
400
);
}

if (!apiDocsUrl && !notes) {
return jsonResponse(
{ error: "Please provide your API documentation URL, OpenAPI JSON link, or endpoint notes." },
400
);
}

const orderId = clientOrderId || `MCP-SVC-${Math.floor(10000 + Math.random() * 90000)}`;
const checkoutUrl = buildMcpCheckoutUrl({
orderId,
tier,
companyName,
apiDocsUrl,
contactEmail,
preferredTransport,
includeMonetization,
});

const alertText = [
`🚀 **New Custom MCP Server Order [${orderId}]**`,
`• **Tier:** ${tier === "pro_699" ? "$699 (Monetized & Cloud MCP)" : "$349 (Standard 48h Connector)"}`,
`• **Company:** ${companyName || "Client Project"}`,
`• **Email:** ${contactEmail.trim().toLowerCase()}`,
`• **API Docs:** ${apiDocsUrl || "See notes"}`,
`• **Transport:** ${preferredTransport} | Monetize: ${Boolean(includeMonetization)}`,
`• **Notes:** ${notes || "None"}`,
].join("\n");

await dispatchOrderWebhook(context.env, alertText);

return jsonResponse({
success: true,
orderId,
checkoutUrl,
message: "MCP Server build order registered. Redirecting to checkout.",
});
} catch (err) {
console.error("CF Pages MCP Order Error:", err);
return jsonResponse({ error: "Internal server error registering MCP build order." }, 500);
}
}
30 changes: 30 additions & 0 deletions functions/api/partner-order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { preparePartnerOrder } from "../../src/lib/checkout-urls.js";
import { corsPreflightResponse, dispatchOrderWebhook, jsonResponse } from "../../src/lib/cf-webhook.js";

export async function onRequestOptions() {
return corsPreflightResponse();
}

export async function onRequestPost(context) {
try {
const body = await context.request.json();
const prepared = preparePartnerOrder(body);
if (prepared.error) {
return jsonResponse({ error: prepared.error }, prepared.status || 400);
}

await dispatchOrderWebhook(context.env, prepared.summary);

return jsonResponse({
success: true,
orderId: prepared.orderId,
tier: prepared.tier,
amountUsd: prepared.amountUsd,
checkoutUrl: prepared.checkoutUrl,
message: "DevShelf spotlight reservation registered. Proceeding to checkout.",
});
} catch (err) {
console.error("CF Pages Partner Order Error:", err);
return jsonResponse({ error: "Internal server error registering spotlight order." }, 500);
}
}
22 changes: 22 additions & 0 deletions functions/api/webhooks/dodo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { jsonResponse } from "../../../src/lib/cf-webhook.js";
import { handleDodoWebhookEvent } from "../../../src/lib/dodo-webhook.js";

export async function onRequestPost(context) {
const rawBody = await context.request.text();
const result = await handleDodoWebhookEvent({
rawBody,
headers: context.request.headers,
env: context.env,
});

if (!result.ok) {
return jsonResponse({ error: result.error }, result.status);
}

return jsonResponse({
received: true,
eventType: result.eventType,
paymentId: result.paymentId,
fulfillmentNote: result.fulfillmentNote,
});
}
7 changes: 7 additions & 0 deletions public/_headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=()
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data: https:; connect-src 'self' https:; frame-ancestors 'self';
10 changes: 8 additions & 2 deletions public/api/v1/registry/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": "2.0.0",
"registry": "RitualDev Verified Autonomous Tool & Skill Registry",
"homepage": "https://ritualdev.in/devshelf",
"updatedAt": "2026-11-08T15:06:43.294Z",
"updatedAt": "2026-11-10T11:54:48.343Z",
"totalTools": 575,
"documentation": "https://ritualdev.in/docs/agent-registry",
"compliance": {
Expand Down Expand Up @@ -4904,7 +4904,13 @@
"status": "VERIFIED_SAFE",
"verifiedAt": "2026-11-08T00:00:00Z"
},
"installCommand": "git clone https://github.com/akii-technologies-ltd/akii-seo-ai-search-optimizer"
"installCommand": "/plugin marketplace add https://github.com/akii-technologies-ltd/akii-seo-ai-search-optimizer\n/plugin install akii-seo-ai-search-optimizer@akii",
"installCommands": [
"/plugin marketplace add https://github.com/akii-technologies-ltd/akii-seo-ai-search-optimizer",
"/plugin install akii-seo-ai-search-optimizer@akii"
],
"installNote": "To install the plugin, open Claude Code and run these as two separate commands:",
"installDocsUrl": "https://github.com/akii-technologies-ltd/akii-seo-ai-search-optimizer#installation"
},
{
"id": "mockforge-ai",
Expand Down
Binary file added public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading