80 lines
3.6 KiB
TypeScript
80 lines
3.6 KiB
TypeScript
// The module list of this app, and the only registry there is (decision AT-D2, spec §4.1).
|
|
// `buildRegistry` turns these manifests into the router, the navigation, the jobs, the events, the
|
|
// permissions, the tables and the isolation-fixture list, so nothing is listed twice anywhere else.
|
|
//
|
|
// Adding a domain module is two steps: `pnpm new:module <id>` writes modules/<id>/, then its
|
|
// manifest joins the array below. Nothing in apps/ changes.
|
|
|
|
import { authModule } from "@conusai-kit/auth"
|
|
import type { Container, ModuleManifest, TransportCaller } from "@conusai-kit/core"
|
|
import { filesModule } from "@conusai-kit/files"
|
|
import { guidesModule } from "@conusai-kit/guides" // kit:guides
|
|
import type { I18n } from "@conusai-kit/i18n"
|
|
import { proposalsModule } from "@conusai-kit/proposals"
|
|
import { supportModule } from "@conusai-kit/support" // kit:support
|
|
import { tenancyModule } from "@conusai-kit/tenancy"
|
|
import type { ProjectPage } from "@conusai-kit/ui"
|
|
import { accountModule } from "./account/index.js"
|
|
import { agentModule } from "./agent/index.js"
|
|
import { brandingModule } from "./branding/index.js"
|
|
import { documentsModule } from "./documents/index.js"
|
|
import { knowledgeModule } from "./knowledge/index.js"
|
|
import { notesModule } from "./notes/index.js"
|
|
|
|
/**
|
|
* The kernel modules every app on this template runs: organizations, sign-in, uploads, and the
|
|
* review of what a model proposed -- and, opt-in, the in-app guides of the platform's Guides service
|
|
* and the support chat of its Support service (`kit template:prune --without guides` or
|
|
* `--without support` removes one and every line marked for it).
|
|
*/
|
|
export const kernelModules: readonly ModuleManifest[] = [
|
|
tenancyModule,
|
|
authModule,
|
|
filesModule,
|
|
proposalsModule,
|
|
...optIn(),
|
|
]
|
|
|
|
/** The opt-in kernel modules this app enabled. */
|
|
function optIn(): ModuleManifest[] {
|
|
const enabled: ModuleManifest[] = []
|
|
enabled.push(guidesModule) // kit:guides
|
|
enabled.push(supportModule) // kit:support
|
|
return enabled
|
|
}
|
|
|
|
/**
|
|
* This app's own domain modules. `account` is the person's own account (export my data, delete my
|
|
* account) over every installed module's share of it (kit-tenancy's `tenancy.account` point).
|
|
* `knowledge` is the retrieval module (collections, indexing,
|
|
* cited search) and `agent` the bounded agent runtime's integration (runs and the approval
|
|
* queue); both ship the Postgres profile, and their fail-closed Convex binding files stay
|
|
* unregistered until their effect/jobs have composed Node actions (see their READMEs).
|
|
*/
|
|
export const domainModules: readonly ModuleManifest[] = [
|
|
brandingModule,
|
|
documentsModule,
|
|
notesModule,
|
|
knowledgeModule,
|
|
agentModule,
|
|
accountModule,
|
|
]
|
|
|
|
export const appModules: readonly ModuleManifest[] = [...kernelModules, ...domainModules]
|
|
|
|
/** A module's pages under a project, as the web shell calls them. */
|
|
export type ModuleProjectPage = ProjectPage<TransportCaller, I18n, Container>
|
|
|
|
/**
|
|
* The pages of the modules that bring their own, by the first path segment under a project
|
|
* (`/<org>/<workspace>/<project>/<segment>/...`). The web shell has one catch-all route that looks
|
|
* a segment up here, so a module with pages is added with its manifest above and a line below, and
|
|
* no route file. Loaded on demand: the worker, which imports this file for the manifests, never
|
|
* loads a page (or React).
|
|
*/
|
|
export const modulePages: Readonly<Record<string, () => Promise<ModuleProjectPage>>> = {
|
|
notes: async () => (await import("./notes/ui/pages.js")).notesPage,
|
|
knowledge: async () => (await import("./knowledge/ui/pages.js")).knowledgePage,
|
|
agent: async () => (await import("./agent/ui/pages.js")).agentPage,
|
|
}
|