@cloudgrid-io/mcp 0.12.0 → 0.14.0
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/package.json +1 -1
- package/src/corpus/capability-map.md +82 -2
- package/src/corpus/examples/crm/index.md +273 -0
- package/src/corpus/examples/kanban/index.md +256 -0
- package/src/corpus/templates/_cloudgrid.yaml.reference +228 -0
- package/src/corpus/templates/admin-dashboard/README.md +75 -0
- package/src/corpus/templates/admin-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/admin-dashboard/index.md +81 -0
- package/src/corpus/templates/admin-dashboard/services/web/app/api/orders/route.js +64 -0
- package/src/corpus/templates/admin-dashboard/services/web/app/api/users/route.js +63 -0
- package/src/corpus/templates/admin-dashboard/services/web/app/layout.js +39 -0
- package/src/corpus/templates/admin-dashboard/services/web/app/page.js +73 -0
- package/src/corpus/templates/admin-dashboard/services/web/app/resource-table.js +94 -0
- package/src/corpus/templates/admin-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/admin-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/ai-app/cloudgrid.yaml +225 -11
- package/src/corpus/templates/ai-app/index.md +3 -11
- package/src/corpus/templates/ai-knowledge-base/AGENTS.md +254 -0
- package/src/corpus/templates/ai-knowledge-base/README.md +28 -0
- package/src/corpus/templates/ai-knowledge-base/cloudgrid.yaml +238 -0
- package/src/corpus/templates/ai-knowledge-base/index.md +81 -0
- package/src/corpus/templates/analytics-dashboard/README.md +85 -0
- package/src/corpus/templates/analytics-dashboard/cloudgrid.yaml +232 -0
- package/src/corpus/templates/analytics-dashboard/index.md +316 -0
- package/src/corpus/templates/analytics-dashboard/services/web/app/api/events/route.js +60 -0
- package/src/corpus/templates/analytics-dashboard/services/web/app/event-form.js +100 -0
- package/src/corpus/templates/analytics-dashboard/services/web/app/layout.js +41 -0
- package/src/corpus/templates/analytics-dashboard/services/web/app/page.js +54 -0
- package/src/corpus/templates/analytics-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/analytics-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/api-dashboard/README.md +84 -0
- package/src/corpus/templates/api-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/api-dashboard/index.md +310 -0
- package/src/corpus/templates/api-dashboard/services/web/app/api/requests/route.js +62 -0
- package/src/corpus/templates/api-dashboard/services/web/app/dashboard.js +156 -0
- package/src/corpus/templates/api-dashboard/services/web/app/layout.js +42 -0
- package/src/corpus/templates/api-dashboard/services/web/app/page.js +39 -0
- package/src/corpus/templates/api-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/api-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/api-docs/README.md +28 -0
- package/src/corpus/templates/api-docs/cloudgrid.yaml +228 -0
- package/src/corpus/templates/api-docs/index.html +136 -0
- package/src/corpus/templates/api-docs/index.md +28 -0
- package/src/corpus/templates/api-service/cloudgrid.yaml +224 -9
- package/src/corpus/templates/api-service/index.md +3 -11
- package/src/corpus/templates/app-with-data/cloudgrid.yaml +226 -8
- package/src/corpus/templates/app-with-data/index.md +3 -8
- package/src/corpus/templates/appointment-booking/AGENTS.md +223 -0
- package/src/corpus/templates/appointment-booking/README.md +16 -0
- package/src/corpus/templates/appointment-booking/cloudgrid.yaml +250 -0
- package/src/corpus/templates/appointment-booking/index.md +72 -0
- package/src/corpus/templates/approval-workflow/AGENTS.md +170 -0
- package/src/corpus/templates/approval-workflow/README.md +12 -0
- package/src/corpus/templates/approval-workflow/cloudgrid.yaml +237 -0
- package/src/corpus/templates/approval-workflow/index.md +58 -0
- package/src/corpus/templates/billing-dashboard/AGENTS.md +199 -0
- package/src/corpus/templates/billing-dashboard/README.md +18 -0
- package/src/corpus/templates/billing-dashboard/cloudgrid.yaml +235 -0
- package/src/corpus/templates/billing-dashboard/index.md +87 -0
- package/src/corpus/templates/blog-cms/README.md +94 -0
- package/src/corpus/templates/blog-cms/cloudgrid.yaml +233 -0
- package/src/corpus/templates/blog-cms/index.md +358 -0
- package/src/corpus/templates/blog-cms/services/web/app/admin/admin-editor.js +133 -0
- package/src/corpus/templates/blog-cms/services/web/app/admin/page.js +33 -0
- package/src/corpus/templates/blog-cms/services/web/app/api/posts/route.js +84 -0
- package/src/corpus/templates/blog-cms/services/web/app/layout.js +47 -0
- package/src/corpus/templates/blog-cms/services/web/app/page.js +56 -0
- package/src/corpus/templates/blog-cms/services/web/app/posts/[slug]/page.js +45 -0
- package/src/corpus/templates/blog-cms/services/web/lib/db.js +32 -0
- package/src/corpus/templates/blog-cms/services/web/package.json +16 -0
- package/src/corpus/templates/booking-system/AGENTS.md +189 -0
- package/src/corpus/templates/booking-system/README.md +17 -0
- package/src/corpus/templates/booking-system/cloudgrid.yaml +248 -0
- package/src/corpus/templates/booking-system/index.md +86 -0
- package/src/corpus/templates/calendar-scheduler/AGENTS.md +226 -0
- package/src/corpus/templates/calendar-scheduler/README.md +25 -0
- package/src/corpus/templates/calendar-scheduler/cloudgrid.yaml +259 -0
- package/src/corpus/templates/calendar-scheduler/index.md +85 -0
- package/src/corpus/templates/changelog/README.md +27 -0
- package/src/corpus/templates/changelog/cloudgrid.yaml +228 -0
- package/src/corpus/templates/changelog/index.html +80 -0
- package/src/corpus/templates/changelog/index.md +28 -0
- package/src/corpus/templates/company-website/README.md +54 -0
- package/src/corpus/templates/company-website/cloudgrid.yaml +233 -0
- package/src/corpus/templates/company-website/index.html +309 -0
- package/src/corpus/templates/company-website/index.md +29 -0
- package/src/corpus/templates/course-platform/AGENTS.md +161 -0
- package/src/corpus/templates/course-platform/README.md +26 -0
- package/src/corpus/templates/course-platform/cloudgrid.yaml +237 -0
- package/src/corpus/templates/course-platform/index.md +70 -0
- package/src/corpus/templates/crm/README.md +72 -0
- package/src/corpus/templates/crm/cloudgrid.yaml +233 -0
- package/src/corpus/templates/crm/index.md +71 -0
- package/src/corpus/templates/crm/services/web/app/api/contacts/route.js +80 -0
- package/src/corpus/templates/crm/services/web/app/contact-manager.js +102 -0
- package/src/corpus/templates/crm/services/web/app/layout.js +35 -0
- package/src/corpus/templates/crm/services/web/app/page.js +34 -0
- package/src/corpus/templates/crm/services/web/lib/db.js +32 -0
- package/src/corpus/templates/crm/services/web/package.json +16 -0
- package/src/corpus/templates/dashboard/cloudgrid.yaml +228 -4
- package/src/corpus/templates/dashboard/index.md +3 -5
- package/src/corpus/templates/deck/cloudgrid.yaml +228 -4
- package/src/corpus/templates/deck/index.md +3 -5
- package/src/corpus/templates/directory/README.md +75 -0
- package/src/corpus/templates/directory/cloudgrid.yaml +233 -0
- package/src/corpus/templates/directory/index.md +334 -0
- package/src/corpus/templates/directory/services/web/app/api/entries/route.js +63 -0
- package/src/corpus/templates/directory/services/web/app/directory-list.js +146 -0
- package/src/corpus/templates/directory/services/web/app/layout.js +44 -0
- package/src/corpus/templates/directory/services/web/app/page.js +38 -0
- package/src/corpus/templates/directory/services/web/lib/db.js +32 -0
- package/src/corpus/templates/directory/services/web/package.json +16 -0
- package/src/corpus/templates/docs-site/README.md +28 -0
- package/src/corpus/templates/docs-site/cloudgrid.yaml +228 -0
- package/src/corpus/templates/docs-site/index.html +122 -0
- package/src/corpus/templates/docs-site/index.md +28 -0
- package/src/corpus/templates/erp/AGENTS.md +116 -0
- package/src/corpus/templates/erp/README.md +17 -0
- package/src/corpus/templates/erp/cloudgrid.yaml +235 -0
- package/src/corpus/templates/erp/index.md +81 -0
- package/src/corpus/templates/event-board/README.md +74 -0
- package/src/corpus/templates/event-board/cloudgrid.yaml +233 -0
- package/src/corpus/templates/event-board/index.md +299 -0
- package/src/corpus/templates/event-board/services/web/app/api/events/route.js +61 -0
- package/src/corpus/templates/event-board/services/web/app/event-form.js +118 -0
- package/src/corpus/templates/event-board/services/web/app/layout.js +39 -0
- package/src/corpus/templates/event-board/services/web/app/page.js +34 -0
- package/src/corpus/templates/event-board/services/web/lib/db.js +32 -0
- package/src/corpus/templates/event-board/services/web/package.json +16 -0
- package/src/corpus/templates/expense-tracker/README.md +76 -0
- package/src/corpus/templates/expense-tracker/cloudgrid.yaml +233 -0
- package/src/corpus/templates/expense-tracker/index.md +305 -0
- package/src/corpus/templates/expense-tracker/services/web/app/api/expenses/route.js +61 -0
- package/src/corpus/templates/expense-tracker/services/web/app/expense-form.js +145 -0
- package/src/corpus/templates/expense-tracker/services/web/app/layout.js +42 -0
- package/src/corpus/templates/expense-tracker/services/web/app/page.js +34 -0
- package/src/corpus/templates/expense-tracker/services/web/lib/db.js +32 -0
- package/src/corpus/templates/expense-tracker/services/web/package.json +16 -0
- package/src/corpus/templates/feature-request-board/README.md +87 -0
- package/src/corpus/templates/feature-request-board/cloudgrid.yaml +233 -0
- package/src/corpus/templates/feature-request-board/index.md +317 -0
- package/src/corpus/templates/feature-request-board/services/web/app/api/requests/route.js +92 -0
- package/src/corpus/templates/feature-request-board/services/web/app/board.js +91 -0
- package/src/corpus/templates/feature-request-board/services/web/app/layout.js +43 -0
- package/src/corpus/templates/feature-request-board/services/web/app/page.js +35 -0
- package/src/corpus/templates/feature-request-board/services/web/lib/db.js +32 -0
- package/src/corpus/templates/feature-request-board/services/web/package.json +16 -0
- package/src/corpus/templates/financial-dashboard/README.md +80 -0
- package/src/corpus/templates/financial-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/financial-dashboard/index.md +326 -0
- package/src/corpus/templates/financial-dashboard/services/web/app/api/entries/route.js +63 -0
- package/src/corpus/templates/financial-dashboard/services/web/app/entry-board.js +130 -0
- package/src/corpus/templates/financial-dashboard/services/web/app/layout.js +46 -0
- package/src/corpus/templates/financial-dashboard/services/web/app/page.js +31 -0
- package/src/corpus/templates/financial-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/financial-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/forum/AGENTS.md +196 -0
- package/src/corpus/templates/forum/README.md +12 -0
- package/src/corpus/templates/forum/cloudgrid.yaml +237 -0
- package/src/corpus/templates/forum/index.md +66 -0
- package/src/corpus/templates/hr-portal/AGENTS.md +174 -0
- package/src/corpus/templates/hr-portal/README.md +14 -0
- package/src/corpus/templates/hr-portal/cloudgrid.yaml +237 -0
- package/src/corpus/templates/hr-portal/index.md +56 -0
- package/src/corpus/templates/internal-tools-portal/AGENTS.md +201 -0
- package/src/corpus/templates/internal-tools-portal/README.md +17 -0
- package/src/corpus/templates/internal-tools-portal/cloudgrid.yaml +237 -0
- package/src/corpus/templates/internal-tools-portal/index.md +62 -0
- package/src/corpus/templates/inventory/README.md +71 -0
- package/src/corpus/templates/inventory/cloudgrid.yaml +233 -0
- package/src/corpus/templates/inventory/index.md +68 -0
- package/src/corpus/templates/inventory/services/web/app/api/items/route.js +88 -0
- package/src/corpus/templates/inventory/services/web/app/inventory-manager.js +101 -0
- package/src/corpus/templates/inventory/services/web/app/layout.js +36 -0
- package/src/corpus/templates/inventory/services/web/app/page.js +37 -0
- package/src/corpus/templates/inventory/services/web/lib/db.js +32 -0
- package/src/corpus/templates/inventory/services/web/package.json +16 -0
- package/src/corpus/templates/invoice/README.md +71 -0
- package/src/corpus/templates/invoice/cloudgrid.yaml +233 -0
- package/src/corpus/templates/invoice/index.md +68 -0
- package/src/corpus/templates/invoice/services/web/app/api/invoices/route.js +82 -0
- package/src/corpus/templates/invoice/services/web/app/invoice-manager.js +101 -0
- package/src/corpus/templates/invoice/services/web/app/layout.js +35 -0
- package/src/corpus/templates/invoice/services/web/app/page.js +34 -0
- package/src/corpus/templates/invoice/services/web/lib/db.js +32 -0
- package/src/corpus/templates/invoice/services/web/package.json +16 -0
- package/src/corpus/templates/job-board/README.md +71 -0
- package/src/corpus/templates/job-board/cloudgrid.yaml +233 -0
- package/src/corpus/templates/job-board/index.md +68 -0
- package/src/corpus/templates/job-board/services/web/app/api/jobs/route.js +66 -0
- package/src/corpus/templates/job-board/services/web/app/job-board.js +73 -0
- package/src/corpus/templates/job-board/services/web/app/layout.js +35 -0
- package/src/corpus/templates/job-board/services/web/app/page.js +32 -0
- package/src/corpus/templates/job-board/services/web/lib/db.js +32 -0
- package/src/corpus/templates/job-board/services/web/package.json +16 -0
- package/src/corpus/templates/kanban/README.md +72 -0
- package/src/corpus/templates/kanban/cloudgrid.yaml +233 -0
- package/src/corpus/templates/kanban/index.md +71 -0
- package/src/corpus/templates/kanban/services/web/app/api/cards/route.js +70 -0
- package/src/corpus/templates/kanban/services/web/app/board.js +93 -0
- package/src/corpus/templates/kanban/services/web/app/layout.js +37 -0
- package/src/corpus/templates/kanban/services/web/app/page.js +32 -0
- package/src/corpus/templates/kanban/services/web/lib/db.js +32 -0
- package/src/corpus/templates/kanban/services/web/package.json +16 -0
- package/src/corpus/templates/landing-page/cloudgrid.yaml +228 -4
- package/src/corpus/templates/landing-page/index.md +3 -5
- package/src/corpus/templates/lms/AGENTS.md +193 -0
- package/src/corpus/templates/lms/README.md +27 -0
- package/src/corpus/templates/lms/cloudgrid.yaml +237 -0
- package/src/corpus/templates/lms/index.md +79 -0
- package/src/corpus/templates/marketplace/AGENTS.md +208 -0
- package/src/corpus/templates/marketplace/README.md +22 -0
- package/src/corpus/templates/marketplace/cloudgrid.yaml +233 -0
- package/src/corpus/templates/marketplace/index.md +76 -0
- package/src/corpus/templates/membership-site/AGENTS.md +160 -0
- package/src/corpus/templates/membership-site/README.md +18 -0
- package/src/corpus/templates/membership-site/cloudgrid.yaml +236 -0
- package/src/corpus/templates/membership-site/index.md +66 -0
- package/src/corpus/templates/monitoring-dashboard/README.md +84 -0
- package/src/corpus/templates/monitoring-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/monitoring-dashboard/index.md +328 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/app/api/checks/route.js +76 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/app/check-form.js +124 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/app/layout.js +44 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/app/page.js +49 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/monitoring-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/online-store/AGENTS.md +153 -0
- package/src/corpus/templates/online-store/README.md +16 -0
- package/src/corpus/templates/online-store/cloudgrid.yaml +234 -0
- package/src/corpus/templates/online-store/index.md +81 -0
- package/src/corpus/templates/portfolio/README.md +29 -0
- package/src/corpus/templates/portfolio/cloudgrid.yaml +228 -0
- package/src/corpus/templates/portfolio/index.html +126 -0
- package/src/corpus/templates/portfolio/index.md +28 -0
- package/src/corpus/templates/product-catalog/README.md +74 -0
- package/src/corpus/templates/product-catalog/cloudgrid.yaml +232 -0
- package/src/corpus/templates/product-catalog/index.md +330 -0
- package/src/corpus/templates/product-catalog/services/web/app/api/products/route.js +69 -0
- package/src/corpus/templates/product-catalog/services/web/app/catalog.js +153 -0
- package/src/corpus/templates/product-catalog/services/web/app/layout.js +49 -0
- package/src/corpus/templates/product-catalog/services/web/app/page.js +36 -0
- package/src/corpus/templates/product-catalog/services/web/lib/db.js +32 -0
- package/src/corpus/templates/product-catalog/services/web/package.json +16 -0
- package/src/corpus/templates/product-launch/README.md +46 -0
- package/src/corpus/templates/product-launch/cloudgrid.yaml +234 -0
- package/src/corpus/templates/product-launch/index.html +320 -0
- package/src/corpus/templates/product-launch/index.md +34 -0
- package/src/corpus/templates/project-management/README.md +83 -0
- package/src/corpus/templates/project-management/cloudgrid.yaml +233 -0
- package/src/corpus/templates/project-management/index.md +346 -0
- package/src/corpus/templates/project-management/services/web/app/api/projects/route.js +48 -0
- package/src/corpus/templates/project-management/services/web/app/api/tasks/route.js +85 -0
- package/src/corpus/templates/project-management/services/web/app/board.js +182 -0
- package/src/corpus/templates/project-management/services/web/app/layout.js +45 -0
- package/src/corpus/templates/project-management/services/web/app/page.js +49 -0
- package/src/corpus/templates/project-management/services/web/lib/db.js +32 -0
- package/src/corpus/templates/project-management/services/web/package.json +16 -0
- package/src/corpus/templates/property-listings/README.md +76 -0
- package/src/corpus/templates/property-listings/cloudgrid.yaml +233 -0
- package/src/corpus/templates/property-listings/index.md +335 -0
- package/src/corpus/templates/property-listings/services/web/app/api/properties/route.js +73 -0
- package/src/corpus/templates/property-listings/services/web/app/layout.js +45 -0
- package/src/corpus/templates/property-listings/services/web/app/listings.js +152 -0
- package/src/corpus/templates/property-listings/services/web/app/page.js +53 -0
- package/src/corpus/templates/property-listings/services/web/lib/db.js +32 -0
- package/src/corpus/templates/property-listings/services/web/package.json +16 -0
- package/src/corpus/templates/quiz-platform/README.md +84 -0
- package/src/corpus/templates/quiz-platform/cloudgrid.yaml +233 -0
- package/src/corpus/templates/quiz-platform/index.md +313 -0
- package/src/corpus/templates/quiz-platform/services/web/app/api/questions/route.js +69 -0
- package/src/corpus/templates/quiz-platform/services/web/app/layout.js +47 -0
- package/src/corpus/templates/quiz-platform/services/web/app/page.js +37 -0
- package/src/corpus/templates/quiz-platform/services/web/app/quiz.js +188 -0
- package/src/corpus/templates/quiz-platform/services/web/lib/db.js +32 -0
- package/src/corpus/templates/quiz-platform/services/web/package.json +16 -0
- package/src/corpus/templates/report/cloudgrid.yaml +228 -4
- package/src/corpus/templates/report/index.md +3 -5
- package/src/corpus/templates/restaurant-reservations/AGENTS.md +258 -0
- package/src/corpus/templates/restaurant-reservations/README.md +17 -0
- package/src/corpus/templates/restaurant-reservations/cloudgrid.yaml +258 -0
- package/src/corpus/templates/restaurant-reservations/index.md +62 -0
- package/src/corpus/templates/revenue-dashboard/README.md +75 -0
- package/src/corpus/templates/revenue-dashboard/cloudgrid.yaml +233 -0
- package/src/corpus/templates/revenue-dashboard/index.md +307 -0
- package/src/corpus/templates/revenue-dashboard/services/web/app/api/sales/route.js +60 -0
- package/src/corpus/templates/revenue-dashboard/services/web/app/layout.js +40 -0
- package/src/corpus/templates/revenue-dashboard/services/web/app/page.js +87 -0
- package/src/corpus/templates/revenue-dashboard/services/web/app/sale-form.js +63 -0
- package/src/corpus/templates/revenue-dashboard/services/web/lib/db.js +32 -0
- package/src/corpus/templates/revenue-dashboard/services/web/package.json +16 -0
- package/src/corpus/templates/saas-marketing/README.md +30 -0
- package/src/corpus/templates/saas-marketing/cloudgrid.yaml +228 -0
- package/src/corpus/templates/saas-marketing/index.html +212 -0
- package/src/corpus/templates/saas-marketing/index.md +28 -0
- package/src/corpus/templates/status-page/README.md +28 -0
- package/src/corpus/templates/status-page/cloudgrid.yaml +228 -0
- package/src/corpus/templates/status-page/index.html +117 -0
- package/src/corpus/templates/status-page/index.md +28 -0
- package/src/corpus/templates/subscription-management/AGENTS.md +191 -0
- package/src/corpus/templates/subscription-management/README.md +21 -0
- package/src/corpus/templates/subscription-management/cloudgrid.yaml +236 -0
- package/src/corpus/templates/subscription-management/index.md +73 -0
- package/src/corpus/templates/task-manager/README.md +72 -0
- package/src/corpus/templates/task-manager/cloudgrid.yaml +233 -0
- package/src/corpus/templates/task-manager/index.md +71 -0
- package/src/corpus/templates/task-manager/services/web/app/api/tasks/route.js +77 -0
- package/src/corpus/templates/task-manager/services/web/app/layout.js +39 -0
- package/src/corpus/templates/task-manager/services/web/app/page.js +33 -0
- package/src/corpus/templates/task-manager/services/web/app/task-list.js +110 -0
- package/src/corpus/templates/task-manager/services/web/lib/db.js +32 -0
- package/src/corpus/templates/task-manager/services/web/package.json +16 -0
- package/src/corpus/templates/ticket-system/README.md +71 -0
- package/src/corpus/templates/ticket-system/cloudgrid.yaml +233 -0
- package/src/corpus/templates/ticket-system/index.md +68 -0
- package/src/corpus/templates/ticket-system/services/web/app/api/tickets/route.js +81 -0
- package/src/corpus/templates/ticket-system/services/web/app/layout.js +36 -0
- package/src/corpus/templates/ticket-system/services/web/app/page.js +35 -0
- package/src/corpus/templates/ticket-system/services/web/app/ticket-queue.js +112 -0
- package/src/corpus/templates/ticket-system/services/web/lib/db.js +32 -0
- package/src/corpus/templates/ticket-system/services/web/package.json +16 -0
- package/src/corpus/templates/time-tracking/README.md +81 -0
- package/src/corpus/templates/time-tracking/cloudgrid.yaml +233 -0
- package/src/corpus/templates/time-tracking/index.md +298 -0
- package/src/corpus/templates/time-tracking/services/web/app/api/entries/route.js +66 -0
- package/src/corpus/templates/time-tracking/services/web/app/entry-form.js +106 -0
- package/src/corpus/templates/time-tracking/services/web/app/layout.js +39 -0
- package/src/corpus/templates/time-tracking/services/web/app/page.js +30 -0
- package/src/corpus/templates/time-tracking/services/web/lib/db.js +32 -0
- package/src/corpus/templates/time-tracking/services/web/package.json +16 -0
- package/src/corpus/templates/travel-booking/AGENTS.md +207 -0
- package/src/corpus/templates/travel-booking/README.md +17 -0
- package/src/corpus/templates/travel-booking/cloudgrid.yaml +249 -0
- package/src/corpus/templates/travel-booking/index.md +88 -0
- package/src/corpus/templates/waitlist/README.md +38 -0
- package/src/corpus/templates/waitlist/cloudgrid.yaml +228 -0
- package/src/corpus/templates/waitlist/index.html +69 -0
- package/src/corpus/templates/waitlist/index.md +39 -0
- package/src/corpus/templates/web-app/cloudgrid.yaml +228 -4
- package/src/corpus/templates/web-app/index.md +3 -5
- package/src/corpus/workflows/admin-dashboard.md +102 -0
- package/src/corpus/workflows/ai-knowledge-base.md +137 -0
- package/src/corpus/workflows/analytics-dashboard.md +104 -0
- package/src/corpus/workflows/api-dashboard.md +102 -0
- package/src/corpus/workflows/api-docs.md +36 -0
- package/src/corpus/workflows/appointment-booking.md +143 -0
- package/src/corpus/workflows/approval-workflow.md +124 -0
- package/src/corpus/workflows/billing-dashboard.md +120 -0
- package/src/corpus/workflows/blog-cms.md +104 -0
- package/src/corpus/workflows/booking-system.md +116 -0
- package/src/corpus/workflows/calendar-scheduler.md +134 -0
- package/src/corpus/workflows/changelog.md +33 -0
- package/src/corpus/workflows/company-website.md +46 -0
- package/src/corpus/workflows/course-platform.md +126 -0
- package/src/corpus/workflows/crm.md +101 -0
- package/src/corpus/workflows/directory.md +101 -0
- package/src/corpus/workflows/docs-site.md +35 -0
- package/src/corpus/workflows/erp.md +125 -0
- package/src/corpus/workflows/event-board.md +102 -0
- package/src/corpus/workflows/expense-tracker.md +102 -0
- package/src/corpus/workflows/feature-request-board.md +105 -0
- package/src/corpus/workflows/financial-dashboard.md +103 -0
- package/src/corpus/workflows/forum.md +128 -0
- package/src/corpus/workflows/hr-portal.md +115 -0
- package/src/corpus/workflows/internal-tools-portal.md +125 -0
- package/src/corpus/workflows/inventory.md +101 -0
- package/src/corpus/workflows/invoice.md +101 -0
- package/src/corpus/workflows/job-board.md +101 -0
- package/src/corpus/workflows/kanban.md +102 -0
- package/src/corpus/workflows/lms.md +113 -0
- package/src/corpus/workflows/marketplace.md +123 -0
- package/src/corpus/workflows/membership-site.md +128 -0
- package/src/corpus/workflows/monitoring-dashboard.md +104 -0
- package/src/corpus/workflows/online-store.md +114 -0
- package/src/corpus/workflows/portfolio.md +35 -0
- package/src/corpus/workflows/product-catalog.md +105 -0
- package/src/corpus/workflows/product-launch.md +43 -0
- package/src/corpus/workflows/project-management.md +106 -0
- package/src/corpus/workflows/property-listings.md +101 -0
- package/src/corpus/workflows/quiz-platform.md +105 -0
- package/src/corpus/workflows/restaurant-reservations.md +123 -0
- package/src/corpus/workflows/revenue-dashboard.md +102 -0
- package/src/corpus/workflows/saas-marketing.md +37 -0
- package/src/corpus/workflows/status-page.md +35 -0
- package/src/corpus/workflows/subscription-management.md +141 -0
- package/src/corpus/workflows/task-manager.md +101 -0
- package/src/corpus/workflows/ticket-system.md +101 -0
- package/src/corpus/workflows/time-tracking.md +104 -0
- package/src/corpus/workflows/travel-booking.md +115 -0
- package/src/corpus/workflows/waitlist.md +42 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# AGENTS.md — ai-knowledge-base blueprint (structure guide)
|
|
2
|
+
|
|
3
|
+
This is a **blueprint**, not a runnable app. It ships a `cloudgrid.yaml` and this
|
|
4
|
+
guide so an agent can *build* a retrieval-augmented "ask my docs" knowledge base
|
|
5
|
+
correctly on CloudGrid. There is no app code to copy — read this, generate the
|
|
6
|
+
files, then deploy.
|
|
7
|
+
|
|
8
|
+
An AI knowledge base is a persistent Next.js + Mongo runtime app (same base shape
|
|
9
|
+
as `app-with-data` / `crm`) with a **RAG** loop layered on: ingest documents →
|
|
10
|
+
chunk them → embed each chunk → store the vectors → at query time embed the
|
|
11
|
+
question, retrieve the nearest chunks, and ask the model to answer grounded in
|
|
12
|
+
them (with citations). Both the embedding and the answer step run through
|
|
13
|
+
CloudGrid's **AI Gateway** (`@cloudgrid-io/ai`, injected via `needs: { ai: true }`).
|
|
14
|
+
|
|
15
|
+
> **Vector-store status (read this first):** the ideal store for embeddings is
|
|
16
|
+
> `needs: vector` (pgvector on Postgres, injecting `VECTOR_PGVECTOR_URL`), but it
|
|
17
|
+
> is **PENDING platform issue #1545** and not yet provisioned. The **`ai` part
|
|
18
|
+
> works today.** Until #1545 ships, store embeddings in **Mongo** (a `chunks`
|
|
19
|
+
> collection with an `embedding: number[]` field) and compute cosine similarity in
|
|
20
|
+
> the app. This blueprint's `cloudgrid.yaml` therefore declares
|
|
21
|
+
> `needs: { ai: true, database: true }` and keeps `vector: pgvector` commented.
|
|
22
|
+
> Section 7 describes the drop-in swap once #1545 lands.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 1. File tree
|
|
27
|
+
|
|
28
|
+
App code MUST live under `services/web/` — `path: /` in `cloudgrid.yaml` is the
|
|
29
|
+
URL mount, NOT the filesystem path. Files at the repo root fail with
|
|
30
|
+
`Error: Service directory not found: …/services/web`.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
cloudgrid.yaml # name + services.web(nextjs,/) + needs:{ai:true, database:true}
|
|
34
|
+
services/web/
|
|
35
|
+
package.json # next, react, react-dom, mongodb, @cloudgrid-io/ai
|
|
36
|
+
lib/
|
|
37
|
+
db.js # lazy Mongo client from DATABASE_MONGODB_URL (legacy MONGODB_URL fallback)
|
|
38
|
+
ai.js # lazy @cloudgrid-io/ai client from AI_GATEWAY_URL — embed() + chat()
|
|
39
|
+
chunk.js # pure fn: splitIntoChunks(text) -> string[] (e.g. ~800-token windows, overlap)
|
|
40
|
+
retrieve.js # embed query -> cosine-rank chunks in Mongo -> top-k with scores
|
|
41
|
+
app/
|
|
42
|
+
layout.js # root layout + inline CSS
|
|
43
|
+
page.js # server component: doc list + upload form + ask box
|
|
44
|
+
documents/[id]/page.js # a document's chunks / indexing status
|
|
45
|
+
ask-box.js # client component: POST a question, stream/show the grounded answer + citations
|
|
46
|
+
api/
|
|
47
|
+
documents/route.js # GET list docs / POST ingest (chunk -> embed -> store) / DELETE (doc + its chunks)
|
|
48
|
+
ask/route.js # POST { question } -> retrieve top-k chunks -> chat() grounded answer + sources
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Keep it minimal and real; grow routes/collections as needed. Reuse the
|
|
52
|
+
`app-with-data` App-Router GET/POST/DELETE route shape for the CRUD parts.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 2. Mongo collections + fields
|
|
57
|
+
|
|
58
|
+
The grid provisions one MongoDB database (`needs: { database: true }`). Suggested
|
|
59
|
+
collections (`_id` is the Mongo ObjectId on every doc):
|
|
60
|
+
|
|
61
|
+
**`documents`** — a source document the user added
|
|
62
|
+
- `title` (string)
|
|
63
|
+
- `source` (string — filename, URL, or "pasted")
|
|
64
|
+
- `status` (string: `indexing` | `ready` | `failed`)
|
|
65
|
+
- `chunkCount` (number — how many chunks it produced)
|
|
66
|
+
- `createdAt` (Date)
|
|
67
|
+
|
|
68
|
+
**`chunks`** — one embeddable slice of a document (the retrieval unit)
|
|
69
|
+
- `documentId` (ObjectId ref → documents)
|
|
70
|
+
- `text` (string — the chunk content, returned as a citation)
|
|
71
|
+
- `ordinal` (number — chunk order within the doc)
|
|
72
|
+
- `embedding` (number[] — the embedding vector; e.g. length 1536)
|
|
73
|
+
- `createdAt` (Date)
|
|
74
|
+
|
|
75
|
+
Until issue #1545 lands, `chunks.embedding` lives in Mongo and you rank in the
|
|
76
|
+
app (Section 3). When pgvector ships, the vectors move to Postgres and `chunks`
|
|
77
|
+
keeps only the text + a foreign key (Section 7).
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 3. How CloudGrid injects things
|
|
82
|
+
|
|
83
|
+
You never provision infra or set connection strings by hand. Declared inputs are
|
|
84
|
+
injected as env vars at `grid dev` (local) and at runtime (after `grid plug`):
|
|
85
|
+
|
|
86
|
+
| What | Declared in cloudgrid.yaml | Injected env var(s) | Read in code |
|
|
87
|
+
|------|----------------------------|---------------------|--------------|
|
|
88
|
+
| MongoDB | `needs: { database: true }` | `DATABASE_MONGODB_URL` (+ legacy `MONGODB_URL`) | `lib/db.js` |
|
|
89
|
+
| AI Gateway | `needs: { ai: true }` | `AI_GATEWAY_URL` | `lib/ai.js` (via `@cloudgrid-io/ai`) |
|
|
90
|
+
| Vector store (PENDING #1545) | `needs: { vector: pgvector }` | `VECTOR_PGVECTOR_URL` (+ legacy `PGVECTOR_URL`) | `lib/retrieve.js` — not yet available |
|
|
91
|
+
| Auth key (optional) | `vault: { AUTH_PROVIDER_KEY: auth-provider-key }` | `AUTH_PROVIDER_KEY` | `lib/auth.js` |
|
|
92
|
+
| Stripe key (optional) | `vault: { STRIPE_KEY: stripe-live-key }` | `STRIPE_KEY` | `lib/stripe.js` |
|
|
93
|
+
|
|
94
|
+
The **AI Gateway needs no API key** — `needs: { ai: true }` injects
|
|
95
|
+
`AI_GATEWAY_URL` and `@cloudgrid-io/ai` routes through it. The `vault:` block only
|
|
96
|
+
**maps** an org vault item key → an env var name; store the real value once with
|
|
97
|
+
`grid secrets set <vault-item-key> <value>`. Never commit a secret; never hardcode
|
|
98
|
+
a connection string.
|
|
99
|
+
|
|
100
|
+
**Read injected values LAZILY inside a getter, never at module top level** — a
|
|
101
|
+
top-level `const uri = process.env.DATABASE_MONGODB_URL` fails `next build` (the
|
|
102
|
+
module is imported for route analysis before the grid injects the var). Same rule
|
|
103
|
+
for the AI client.
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
// lib/db.js — same proven shape as app-with-data
|
|
107
|
+
import { MongoClient } from "mongodb";
|
|
108
|
+
export async function getDb() {
|
|
109
|
+
const uri = process.env.DATABASE_MONGODB_URL || process.env.MONGODB_URL;
|
|
110
|
+
if (!uri) throw new Error("DATABASE_MONGODB_URL not set — run via `grid dev` / `grid plug`.");
|
|
111
|
+
globalThis.__mongo ??= new MongoClient(uri).connect();
|
|
112
|
+
return (await globalThis.__mongo).db();
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
// lib/ai.js — lazy AI Gateway client (no API key; the gateway URL is injected)
|
|
118
|
+
import { createClient } from "@cloudgrid-io/ai";
|
|
119
|
+
function ai() {
|
|
120
|
+
const url = process.env.AI_GATEWAY_URL;
|
|
121
|
+
if (!url) throw new Error("AI_GATEWAY_URL not set — declare needs:{ai:true} and run via `grid dev`/`grid plug`.");
|
|
122
|
+
globalThis.__ai ??= createClient({ baseURL: url });
|
|
123
|
+
return globalThis.__ai;
|
|
124
|
+
}
|
|
125
|
+
// embed one or many strings -> vectors (used for both indexing and queries)
|
|
126
|
+
export async function embed(texts) {
|
|
127
|
+
const res = await ai().embeddings.create({ input: Array.isArray(texts) ? texts : [texts] });
|
|
128
|
+
return res.data.map((d) => d.embedding);
|
|
129
|
+
}
|
|
130
|
+
// grounded chat answer
|
|
131
|
+
export async function chat(messages) {
|
|
132
|
+
const res = await ai().chat.completions.create({ messages });
|
|
133
|
+
return res.choices[0].message.content;
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 4. The RAG loop (build this)
|
|
140
|
+
|
|
141
|
+
### Ingest (`POST /api/documents`)
|
|
142
|
+
1. Accept a title + raw text (or a fetched URL's text).
|
|
143
|
+
2. `splitIntoChunks(text)` in `lib/chunk.js` — a pure function producing ~800-token
|
|
144
|
+
windows with a small overlap so context isn't cut mid-idea.
|
|
145
|
+
3. Insert a `documents` doc with `status: "indexing"`.
|
|
146
|
+
4. `embed(chunkTexts)` (batch) via `lib/ai.js`, then insert one `chunks` doc per
|
|
147
|
+
chunk with its `embedding`, `text`, `ordinal`, and `documentId`.
|
|
148
|
+
5. Update the document to `status: "ready"`, `chunkCount: n`.
|
|
149
|
+
|
|
150
|
+
### Retrieve (`lib/retrieve.js`)
|
|
151
|
+
1. `embed(question)` -> query vector.
|
|
152
|
+
2. Until pgvector (#1545): load candidate `chunks`, compute cosine similarity in
|
|
153
|
+
the app, keep the top-k (e.g. k=5). Keep it a pure, testable ranking function
|
|
154
|
+
so it swaps cleanly to a pgvector query later.
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
// lib/retrieve.js — cosine top-k over Mongo-stored embeddings (pre-#1545)
|
|
158
|
+
import { getDb } from "./db.js";
|
|
159
|
+
import { embed } from "./ai.js";
|
|
160
|
+
const dot = (a, b) => a.reduce((s, x, i) => s + x * b[i], 0);
|
|
161
|
+
const norm = (a) => Math.sqrt(dot(a, a));
|
|
162
|
+
const cosine = (a, b) => dot(a, b) / (norm(a) * norm(b) || 1);
|
|
163
|
+
export async function retrieve(question, k = 5) {
|
|
164
|
+
const [q] = await embed(question);
|
|
165
|
+
const db = await getDb();
|
|
166
|
+
const chunks = await db.collection("chunks").find({}).toArray();
|
|
167
|
+
return chunks
|
|
168
|
+
.map((c) => ({ text: c.text, documentId: c.documentId, score: cosine(q, c.embedding) }))
|
|
169
|
+
.sort((a, b) => b.score - a.score)
|
|
170
|
+
.slice(0, k);
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Answer (`POST /api/ask`)
|
|
175
|
+
1. `retrieve(question)` -> top-k chunks.
|
|
176
|
+
2. Build a system prompt: *"Answer ONLY from the provided context; if it isn't
|
|
177
|
+
there, say you don't know. Cite the chunks you used."* Put the retrieved chunk
|
|
178
|
+
texts (with ids) in the context.
|
|
179
|
+
3. `chat([...])` via `lib/ai.js`; return the answer plus the source chunks so the
|
|
180
|
+
UI can render **citations**. Grounding + citations are the point — never let the
|
|
181
|
+
model answer from parametric memory alone.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 5. Wiring optional auth / payments
|
|
186
|
+
|
|
187
|
+
Not needed for a personal KB, but common when the KB is internal or paid:
|
|
188
|
+
|
|
189
|
+
- **Auth (gate the chat UI):** add an auth SDK (`@clerk/nextjs` or
|
|
190
|
+
`@auth0/nextjs-auth0`) to `package.json`, uncomment the `vault:` block mapping
|
|
191
|
+
`AUTH_PROVIDER_KEY`, init it in `lib/auth.js` from `process.env.AUTH_PROVIDER_KEY`,
|
|
192
|
+
and protect `/` + `/api/*` in `middleware.js`. Store the value with
|
|
193
|
+
`grid secrets set auth-provider-key …`; set any non-secret public key via
|
|
194
|
+
`grid env`.
|
|
195
|
+
- **Payments (charge for access):** add `stripe` to `package.json`, uncomment the
|
|
196
|
+
`vault:` block mapping `STRIPE_KEY`, add a lazy `lib/stripe.js` reading
|
|
197
|
+
`process.env.STRIPE_KEY`, a Checkout route, and a signature-verified
|
|
198
|
+
`api/webhooks/stripe/route.js`. Store `grid secrets set stripe-live-key sk_live_…`.
|
|
199
|
+
|
|
200
|
+
Both keys ride the CloudGrid **vault** — the yaml maps the vault item to an env
|
|
201
|
+
var, and `grid secrets set` stores the real value. Never inline a key.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 6. Deploy steps
|
|
206
|
+
|
|
207
|
+
Runtime app → **local edition** only (Claude Desktop / Claude Code / CLI); the
|
|
208
|
+
hosted edition cannot build a runtime container. Order matters — `plug` needs a
|
|
209
|
+
linked directory, so `init` first.
|
|
210
|
+
|
|
211
|
+
1. `grid init` (or `gridctl_init`) an app `<name>` — creates the entity +
|
|
212
|
+
`.cloudgrid/link.json` and a starter `cloudgrid.yaml` with empty `services:{}`.
|
|
213
|
+
2. Fill: put the app under `services/web/` and set `cloudgrid.yaml` to this
|
|
214
|
+
blueprint's active fields (`services.web` nextjs `/`, `needs:{ai:true,
|
|
215
|
+
database:true}`).
|
|
216
|
+
3. (If you added auth/payments) store the vault secrets with `grid secrets set`;
|
|
217
|
+
non-secret public config → `grid env`. The AI Gateway and Mongo need no secrets
|
|
218
|
+
— they are injected by `needs`.
|
|
219
|
+
4. (Optional) `grid dev` to run locally against the injected dev Mongo + AI Gateway.
|
|
220
|
+
5. `grid plug` to deploy. A runtime deploy is **ASYNC** — the first response is
|
|
221
|
+
`status: building`, not a live URL. Poll `grid status` (surface a liveness
|
|
222
|
+
signal, never a bare wait) until Ready.
|
|
223
|
+
6. Once live, return the app URL. Re-plug the same entity to update the same URL.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 7. When pgvector (#1545) lands — the swap
|
|
228
|
+
|
|
229
|
+
Once `needs: vector` is available, migrate off the in-app cosine ranking:
|
|
230
|
+
|
|
231
|
+
1. Uncomment `vector: pgvector` in `cloudgrid.yaml`'s `needs:` block (dim 1536 to
|
|
232
|
+
match your embedding model). The grid then injects `VECTOR_PGVECTOR_URL` (+
|
|
233
|
+
legacy `PGVECTOR_URL`).
|
|
234
|
+
2. Store each chunk's embedding in a pgvector `vector` column instead of the Mongo
|
|
235
|
+
`chunks.embedding` array; keep the chunk `text` either in Postgres or as a
|
|
236
|
+
Mongo row keyed by the same id.
|
|
237
|
+
3. Rewrite `lib/retrieve.js` to run an ORDER-BY-distance query
|
|
238
|
+
(`ORDER BY embedding <=> $queryVec LIMIT k`) against `VECTOR_PGVECTOR_URL`
|
|
239
|
+
instead of loading all chunks and ranking in JS. Because `retrieve()` is already
|
|
240
|
+
a single function returning `{ text, documentId, score }[]`, `POST /api/ask`
|
|
241
|
+
and the UI don't change.
|
|
242
|
+
|
|
243
|
+
Read the pgvector URL with the same lazy-getter discipline (never at module top
|
|
244
|
+
level).
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## 8. Edition note
|
|
249
|
+
|
|
250
|
+
Because this is a built + deployed container (Next.js + Mongo + AI Gateway), it
|
|
251
|
+
requires the **local edition** (Claude Desktop / Claude Code) or the CLI. The
|
|
252
|
+
hosted edition (Claude Web / hosted MCP) is inline-only and can only publish
|
|
253
|
+
static pages — offer a static explainer page there, but the real knowledge base
|
|
254
|
+
must be built and plugged from the local edition.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# ai-knowledge-base template — RAG "ask my docs" blueprint
|
|
2
|
+
|
|
3
|
+
A blueprint for a retrieval-augmented knowledge-base chatbot on CloudGrid: a
|
|
4
|
+
persistent Next.js + Mongo app that ingests documents, chunks and embeds them,
|
|
5
|
+
and answers questions grounded in the retrieved chunks (with citations) — the
|
|
6
|
+
`app-with-data` runtime shape with a RAG loop layered on. Embeddings and answers
|
|
7
|
+
run through CloudGrid's AI Gateway (`@cloudgrid-io/ai`, injected via
|
|
8
|
+
`needs: { ai: true }` — works today); the ideal vector store `needs: vector`
|
|
9
|
+
(pgvector) is **PENDING platform issue #1545**, so embeddings live in Mongo and
|
|
10
|
+
similarity is computed in-app until it ships. Because RAG involves choices
|
|
11
|
+
(chunking, embedding model, retrieval), this template ships the **structure and
|
|
12
|
+
`cloudgrid.yaml`, not finished app code** — adapt it and build.
|
|
13
|
+
|
|
14
|
+
> **This is a blueprint: structure + cloudgrid.yaml, adapt and build.** Read
|
|
15
|
+
> `AGENTS.md` for the file tree, Mongo collections, CloudGrid injection table
|
|
16
|
+
> (needs + AI Gateway + the pgvector #1545 note), the RAG loop, optional
|
|
17
|
+
> auth/payments wiring, and the deploy flow — then generate the app under
|
|
18
|
+
> `services/web/` and `grid plug` it (runtime, local edition, async — poll to a
|
|
19
|
+
> live URL).
|
|
20
|
+
|
|
21
|
+
## Files
|
|
22
|
+
|
|
23
|
+
- `cloudgrid.yaml` — active fields: `name`, `services.web` (nextjs, `/`), and
|
|
24
|
+
`needs: { ai: true, database: true }`. `vector: pgvector` is present but
|
|
25
|
+
commented (PENDING #1545); the optional `vault:` block (auth/payments) is
|
|
26
|
+
commented too.
|
|
27
|
+
- `AGENTS.md` — the structure guide (read this first).
|
|
28
|
+
- `index.md` — the fetch-bundle summary + cloudgrid.yaml.
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# cloudgrid.yaml — Complete Example
|
|
3
|
+
# ============================================================================
|
|
4
|
+
#
|
|
5
|
+
# This file shows EVERY field the platform supports, with comments explaining
|
|
6
|
+
# each one. It is a reference — no real project would use all of these at once.
|
|
7
|
+
#
|
|
8
|
+
# STANDARD: every CloudGrid template ships its cloudgrid.yaml in THIS full form.
|
|
9
|
+
# Uncomment ONLY the fields the archetype needs (always: name + services; plus
|
|
10
|
+
# needs: for runtime apps). Leave everything else commented. Comments are
|
|
11
|
+
# ignored by the parser, so the file deploys to exactly the active fields.
|
|
12
|
+
#
|
|
13
|
+
# Only two fields are required: name and services. Everything else is optional.
|
|
14
|
+
# Full docs: docs/cloudgrid-yaml-reference.md
|
|
15
|
+
# ============================================================================
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# ─── IDENTITY ───────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
# Entity slug (REQUIRED). 2-42 chars, lowercase alphanumeric + hyphens.
|
|
21
|
+
# Must start and end with a letter or digit.
|
|
22
|
+
# Becomes part of your public URL: <name>-<4hex>.<org>.cloudgrid.io
|
|
23
|
+
name: my-knowledge-base
|
|
24
|
+
|
|
25
|
+
# One-line summary. Max 280 chars. If omitted, Grid Brain auto-generates one.
|
|
26
|
+
# description: Order processing API for the e-commerce platform
|
|
27
|
+
|
|
28
|
+
# Single emoji or short text shown as the entity icon. Max 64 chars.
|
|
29
|
+
# icon: "📦"
|
|
30
|
+
|
|
31
|
+
# Entity type: 'app' (default) or 'agent'. An agent is an app with an agent: block.
|
|
32
|
+
# kind: app
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# ─── NETWORKING ─────────────────────────────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
# Whether this entity serves public HTTP traffic.
|
|
38
|
+
# true = public URL + Ingress (default). false = internal only.
|
|
39
|
+
# expose: true
|
|
40
|
+
|
|
41
|
+
# Additional domain names this entity serves on (the platform URL is always active).
|
|
42
|
+
# custom_domains:
|
|
43
|
+
# - orders.example.com
|
|
44
|
+
# - shop.example.com
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# ─── HEALTH PROBE (entity-level override) ──────────────────────────────────
|
|
48
|
+
|
|
49
|
+
# Override the default health check for the entire entity.
|
|
50
|
+
# probe:
|
|
51
|
+
# path: /healthz # HTTP path to probe (default: /).
|
|
52
|
+
# expected: "<500" # '<500' (default), '200', '2xx'.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# ─── DEPLOY NOTIFICATIONS ──────────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
# Slack notification to the org's default channel on deploy failure.
|
|
58
|
+
# true = notify (default), false = silent.
|
|
59
|
+
# notify: true
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# ─── SCALING ────────────────────────────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
# Replica scaling intent.
|
|
65
|
+
# 'auto' — platform decides from the grid tier (default).
|
|
66
|
+
# 'alert' — single-replica, emit a SPOF warning at plug time.
|
|
67
|
+
# 1-10 — explicit replica count, clamped to the grid max.
|
|
68
|
+
# scale: auto
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# ─── INFRASTRUCTURE NEEDS ──────────────────────────────────────────────────
|
|
72
|
+
#
|
|
73
|
+
# Declare infrastructure; the platform provisions it and injects connection
|
|
74
|
+
# details as env vars. Nine needs: database, cache, kv, queue, pubsub, vector,
|
|
75
|
+
# object_storage, disk, ai. Simplest form is `true`.
|
|
76
|
+
#
|
|
77
|
+
needs:
|
|
78
|
+
# database — MongoDB. Injects DATABASE_MONGODB_URL (+ legacy MONGODB_URL).
|
|
79
|
+
# true | pool | dedicated | { tier: external, secret: MY_DB }
|
|
80
|
+
database: true
|
|
81
|
+
# # cache — Redis, LRU eviction (derived data). Injects CACHE_REDIS_URL (+ REDIS_URL).
|
|
82
|
+
# # true | redis | { engine: external, secret: MY_REDIS_URL }
|
|
83
|
+
# cache: true
|
|
84
|
+
# # kv — Redis, no eviction (durable: flags, idempotency). Injects KV_REDIS_URL.
|
|
85
|
+
# kv: true
|
|
86
|
+
# # queue — Redis job-queue substrate (BullMQ). Injects QUEUE_REDIS_URL.
|
|
87
|
+
# queue: true
|
|
88
|
+
# # pubsub — Redis broadcast pub/sub. Injects PUBSUB_REDIS_URL.
|
|
89
|
+
# pubsub: true
|
|
90
|
+
# # vector — pgvector on Postgres. Injects VECTOR_PGVECTOR_URL (+ PGVECTOR_URL).
|
|
91
|
+
# # true | pgvector | { engine: pgvector, dim: 1536 }
|
|
92
|
+
# # NOTE: `needs: vector` (pgvector) is the intended store for RAG embeddings but
|
|
93
|
+
# # is PENDING platform issue #1545 — not yet provisioned. Until it ships, store
|
|
94
|
+
# # embeddings in Mongo (a `chunks` collection with an `embedding: number[]` field)
|
|
95
|
+
# # and do cosine similarity in the app. Flip this on once #1545 lands.
|
|
96
|
+
# vector: pgvector
|
|
97
|
+
# # object_storage — GCS bucket. Injects OBJECT_STORAGE_GCS_BUCKET, _GCS_REGION.
|
|
98
|
+
# # true | { size: 10Gi }
|
|
99
|
+
# object_storage: true
|
|
100
|
+
# # disk — persistent FS mount (PVC). Injects DISK_PATH. Pins to 1 replica.
|
|
101
|
+
# # true | { size: 1Gi, mount: /var/data } (forbidden: /proc /sys /dev)
|
|
102
|
+
# disk: true
|
|
103
|
+
# ai — AI Gateway via @cloudgrid-io/ai. Injects AI_GATEWAY_URL. true | false.
|
|
104
|
+
# Powers embeddings (for indexing docs + queries) and chat completions (the
|
|
105
|
+
# answer step). Works today.
|
|
106
|
+
ai: true
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# ─── INTER-ENTITY COMMUNICATION ────────────────────────────────────────────
|
|
110
|
+
|
|
111
|
+
# Entities this app calls (outbound). Service-account token injected per pair.
|
|
112
|
+
# calls:
|
|
113
|
+
# - org:atomic/billing-api
|
|
114
|
+
|
|
115
|
+
# Inbound caller policy — who can call YOUR entity.
|
|
116
|
+
# callers:
|
|
117
|
+
# policy: auto # 'auto' | 'manual' (default).
|
|
118
|
+
# scope: org # 'org' (default) | 'space' | 'explicit'.
|
|
119
|
+
# fallback: deny # 'deny' (default) | 'warn'.
|
|
120
|
+
# # allowed_apps: # required only when scope: explicit
|
|
121
|
+
# # - org:atomic/frontend
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# ─── VAULT ──────────────────────────────────────────────────────────────────
|
|
125
|
+
|
|
126
|
+
# Map org vault items to env vars. Keys UPPER_SNAKE_CASE; values = vault item keys.
|
|
127
|
+
# This RAG blueprint needs NO secret by default — the AI Gateway is injected via
|
|
128
|
+
# `needs: { ai: true }` (no API key to manage). Uncomment a vault block ONLY if
|
|
129
|
+
# you add auth (gate the chat UI) or payments. Store the value once with
|
|
130
|
+
# `grid secrets set <vault-item-key> …`; the block only maps it to an env var.
|
|
131
|
+
# vault:
|
|
132
|
+
# AUTH_PROVIDER_KEY: auth-provider-key # if you gate the KB behind Clerk/Auth0
|
|
133
|
+
# STRIPE_KEY: stripe-live-key # if you charge for access
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
# ─── CONNECTORS AND HOOKS ──────────────────────────────────────────────────
|
|
137
|
+
|
|
138
|
+
# connectors:
|
|
139
|
+
# - id: team-slack
|
|
140
|
+
# target: org # 'system' | 'org'.
|
|
141
|
+
# channel: "#deploys"
|
|
142
|
+
# hooks:
|
|
143
|
+
# - on: deploy.failed # release.published | deploy.failed | feedback.received | entity.created
|
|
144
|
+
# via: team-slack
|
|
145
|
+
# template: "Deploy failed for {entity_name}: {error}"
|
|
146
|
+
# channel: "#alerts"
|
|
147
|
+
# triggers:
|
|
148
|
+
# - from: team-slack
|
|
149
|
+
# event: message
|
|
150
|
+
# channel: "#support"
|
|
151
|
+
# route: /webhooks/slack
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
# ─── LOCAL DEVELOPMENT ──────────────────────────────────────────────────────
|
|
155
|
+
|
|
156
|
+
# Config for `grid dev`. Redact fields in dev data snapshots.
|
|
157
|
+
# dev:
|
|
158
|
+
# snapshot:
|
|
159
|
+
# mask:
|
|
160
|
+
# - users.email
|
|
161
|
+
# - users.phone
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
# ─── AGENT METADATA ────────────────────────────────────────────────────────
|
|
165
|
+
|
|
166
|
+
# An agent is an app with kind: agent (above) and an agent: block.
|
|
167
|
+
# agent:
|
|
168
|
+
# purpose: Sync customer data from external CRM every night
|
|
169
|
+
# schedule: "0 2 * * *"
|
|
170
|
+
# trigger: webhook
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# ─── PRIVATE RESOURCE AUTO-DEPENDENCIES ────────────────────────────────────
|
|
174
|
+
|
|
175
|
+
# When true (default), private resources are auto-injected as depends_on.
|
|
176
|
+
# auto_depends_on_private_requires: true
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
# ─── SERVICES (REQUIRED) ───────────────────────────────────────────────────
|
|
180
|
+
#
|
|
181
|
+
# At least one service is required. Key = service name (slug rules).
|
|
182
|
+
# Types: node, nextjs, python, static, cron.
|
|
183
|
+
#
|
|
184
|
+
services:
|
|
185
|
+
web:
|
|
186
|
+
# type (REQUIRED): node | nextjs | python | static | cron
|
|
187
|
+
type: nextjs
|
|
188
|
+
# HTTP route: '/' | '/api' | false (internal) | omitted (=false + warning).
|
|
189
|
+
# Only one service per entity can claim '/'.
|
|
190
|
+
path: /
|
|
191
|
+
# Container port (default 8080; read process.env.PORT). Not for cron.
|
|
192
|
+
# port: 3000
|
|
193
|
+
# nextjs only: base_image: distroless (default) | alpine
|
|
194
|
+
# base_image: distroless
|
|
195
|
+
# node only: lang: javascript (default) | typescript
|
|
196
|
+
# lang: typescript
|
|
197
|
+
# Custom source location (default services/<name>/). '.' = project root.
|
|
198
|
+
# source:
|
|
199
|
+
# path: src/worker
|
|
200
|
+
# Health probe: false/omitted (TCP) | true (/health) | "/path" | {path,expected}
|
|
201
|
+
# health:
|
|
202
|
+
# path: /api/health
|
|
203
|
+
# expected: "200"
|
|
204
|
+
# Static runtime env vars (strings). Reserved: PORT, APP_NAME, SERVICE_NAME,
|
|
205
|
+
# NODE_ENV, MONGODB_URL, REDIS_URL, AI_GATEWAY_URL, N8N_WEBHOOK_URL, CLOUDGRID_*.
|
|
206
|
+
# env:
|
|
207
|
+
# LOG_LEVEL: info
|
|
208
|
+
# Sibling services/private resources that must be Ready first (no cron, no cycles).
|
|
209
|
+
# depends_on:
|
|
210
|
+
# - worker
|
|
211
|
+
# Per-service needs override (merges with app-level needs).
|
|
212
|
+
# needs:
|
|
213
|
+
# queue: true
|
|
214
|
+
# Static-only build step:
|
|
215
|
+
# build:
|
|
216
|
+
# command: npm run build
|
|
217
|
+
# output: dist
|
|
218
|
+
# env:
|
|
219
|
+
# VITE_API_URL: https://api.example.com
|
|
220
|
+
# node_version: "22" # static build step: '18'|'20'|'22'|'24' (quoted)
|
|
221
|
+
# Cron-only: schedule (REQUIRED), timezone (UTC|EST|PST), run (job | https URL)
|
|
222
|
+
# schedule: "0 9 * * 1"
|
|
223
|
+
# timezone: UTC
|
|
224
|
+
# run: job
|
|
225
|
+
# Verbose per-service persistence (prefer needs.disk):
|
|
226
|
+
# persist:
|
|
227
|
+
# - name: scratch
|
|
228
|
+
# path: /tmp/scratch
|
|
229
|
+
# size: 500Mi
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
# ============================================================================
|
|
233
|
+
# NOTES
|
|
234
|
+
# - NOT here: org:/entity_id: (→ .cloudgrid/link.json), secrets (→ grid secrets set),
|
|
235
|
+
# Dockerfile (platform generates from services.*.type).
|
|
236
|
+
# - Deploy: grid plug | Local with grid resources: grid dev
|
|
237
|
+
# - Full reference: docs/cloudgrid-yaml-reference.md | CLI: docs/cli-reference.md
|
|
238
|
+
# ============================================================================
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Template: ai-knowledge-base (blueprint — RAG "ask my docs" on Next.js + Mongo + AI Gateway)
|
|
2
|
+
|
|
3
|
+
A **blueprint** for a retrieval-augmented knowledge base / "ask my docs" chatbot:
|
|
4
|
+
ingest documents, chunk + embed them, and answer questions grounded in the
|
|
5
|
+
retrieved chunks with citations. It is the persistent Next.js + Mongo runtime
|
|
6
|
+
shape (same base as `app-with-data` / `crm`) with a RAG loop layered on. This
|
|
7
|
+
template ships **structure, not app code** — read the structure guide, then build
|
|
8
|
+
the app following it.
|
|
9
|
+
|
|
10
|
+
**This is a blueprint (tier D):** the deliverable is `cloudgrid.yaml` +
|
|
11
|
+
`AGENTS.md`. Fetch the bundle, read `AGENTS.md`, then generate the files under
|
|
12
|
+
`services/web/` and deploy.
|
|
13
|
+
|
|
14
|
+
- **Structure guide:** `gridctl_fetch("template", "ai-knowledge-base")` → read
|
|
15
|
+
**`AGENTS.md`** (file tree, Mongo collections, CloudGrid injection table, the
|
|
16
|
+
RAG loop, the pgvector #1545 note, optional auth/payments, deploy steps).
|
|
17
|
+
|
|
18
|
+
**Key rules (same runtime discipline as `app-with-data`):**
|
|
19
|
+
|
|
20
|
+
1. **App code MUST live under `services/web/`, not the repo root.** `path: /` in
|
|
21
|
+
`cloudgrid.yaml` is the URL mount, NOT the filesystem path.
|
|
22
|
+
2. **Read injected values LAZILY (inside a getter), never at module top level** —
|
|
23
|
+
a top-level read fails `next build`. The grid injects `DATABASE_MONGODB_URL`
|
|
24
|
+
(+ legacy `MONGODB_URL`) for Mongo and `AI_GATEWAY_URL` for the AI Gateway.
|
|
25
|
+
3. **Declare `needs: { ai: true, database: true }`** (canonical shape). Never
|
|
26
|
+
author `requires:`, and never set `needs:` and `requires:` together (the
|
|
27
|
+
validator rejects the combination).
|
|
28
|
+
4. **Ground answers in retrieved chunks + cite them** — never answer from the
|
|
29
|
+
model's parametric memory alone. Keep chunking/retrieval as pure functions.
|
|
30
|
+
|
|
31
|
+
**Vector store:** `needs: vector` (pgvector, injecting `VECTOR_PGVECTOR_URL`) is
|
|
32
|
+
the intended embedding store but is **PENDING platform issue #1545**. The `ai`
|
|
33
|
+
part works today — until #1545 ships, store embeddings in a Mongo `chunks`
|
|
34
|
+
collection and rank by cosine similarity in the app; swap to a pgvector
|
|
35
|
+
ORDER-BY-distance query when it lands (see `AGENTS.md` §7).
|
|
36
|
+
|
|
37
|
+
Runtime app → **local edition** only (async build, poll to a live URL).
|
|
38
|
+
|
|
39
|
+
## cloudgrid.yaml
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
# On disk this file is the full-annotated reference (templates/_cloudgrid.yaml.reference) with EVERY
|
|
43
|
+
# field present as a comment; only the fields below are uncommented, so it
|
|
44
|
+
# deploys to exactly these active fields. `vector: pgvector` is present but kept
|
|
45
|
+
# COMMENTED (PENDING #1545).
|
|
46
|
+
name: my-knowledge-base
|
|
47
|
+
services:
|
|
48
|
+
web:
|
|
49
|
+
type: nextjs
|
|
50
|
+
path: /
|
|
51
|
+
needs:
|
|
52
|
+
ai: true
|
|
53
|
+
database: true
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> **Capability:** `needs: { database: true }` → the deployer provisions Mongo and
|
|
57
|
+
> injects `DATABASE_MONGODB_URL` (plus legacy `MONGODB_URL`). `needs: { ai: true }`
|
|
58
|
+
> → injects `AI_GATEWAY_URL`; `@cloudgrid-io/ai` routes embeddings + chat through
|
|
59
|
+
> it with no API key to manage. `needs: { vector: pgvector }` (would inject
|
|
60
|
+
> `VECTOR_PGVECTOR_URL`) is PENDING #1545. See the capability-map for the full
|
|
61
|
+
> injection table.
|
|
62
|
+
|
|
63
|
+
## Structure guide
|
|
64
|
+
|
|
65
|
+
The real content of this blueprint is **`AGENTS.md`** — fetch the template bundle
|
|
66
|
+
and read it. It covers the `services/web/` file tree, the `documents` / `chunks`
|
|
67
|
+
collections, the CloudGrid injection table (needs + AI Gateway + the #1545 note),
|
|
68
|
+
the ingest → retrieve → answer RAG loop with lazy `lib/db.js` / `lib/ai.js` /
|
|
69
|
+
`lib/retrieve.js`, optional auth/payments via `vault:`, and the
|
|
70
|
+
`grid init → fill → grid plug → poll` deploy flow.
|
|
71
|
+
|
|
72
|
+
## Adapt it
|
|
73
|
+
|
|
74
|
+
- Pick your chunking window/overlap and embedding model in `lib/chunk.js` /
|
|
75
|
+
`lib/ai.js`; tune retrieval `k`.
|
|
76
|
+
- Add auth (uncomment `vault: { AUTH_PROVIDER_KEY }`) to gate the KB, or payments
|
|
77
|
+
(`vault: { STRIPE_KEY }`) to charge for access.
|
|
78
|
+
- When pgvector #1545 lands, uncomment `needs: { vector: pgvector }` and swap
|
|
79
|
+
`lib/retrieve.js` to an ORDER-BY-distance query (`AGENTS.md` §7).
|
|
80
|
+
- Build under `services/web/`, then `grid dev` (local) / `grid plug` (async — poll
|
|
81
|
+
to a live URL).
|