feat: define workspace diagnostic contracts
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { validateCanonicalWorkspace } from "./schema.js";
|
||||
import type { CanonicalWorkspace, DwhTransport, VectorTransport } from "./schema.js";
|
||||
|
||||
export type InstallationRole = "DWH" | "VECTOR" | "EMBEDDING";
|
||||
export type InstallationRole = "DWH" | "VECTOR" | "VECTOR_WRITER" | "EMBEDDING";
|
||||
export type InstallationSuffix =
|
||||
| "TRANSPORT"
|
||||
| "HOST"
|
||||
@@ -133,6 +133,9 @@ export function buildInstallationContract(workspace: CanonicalWorkspace): Instal
|
||||
"VECTOR",
|
||||
canonical.semantic_index.vector_store.supported_transports,
|
||||
),
|
||||
...(canonical.semantic_index.vector_writer
|
||||
? [createVariable(namespace, "VECTOR_WRITER", "API_KEY_FILE")]
|
||||
: []),
|
||||
...EMBEDDING_SUFFIXES.map((suffix) => createVariable(namespace, "EMBEDDING", suffix)),
|
||||
],
|
||||
};
|
||||
@@ -170,8 +173,10 @@ export function renderWorkspaceDocs(workspace: CanonicalWorkspace): { envExample
|
||||
"",
|
||||
"Use the following UI fields as installation bindings. Secret fields always contain file paths, never secret values.",
|
||||
"",
|
||||
...(["DWH", "VECTOR", "EMBEDDING"] as const).flatMap((role) => [
|
||||
`## ${role === "DWH" ? "Data warehouse" : role === "VECTOR" ? "Vector store" : "Embedding service"}`,
|
||||
...(["DWH", "VECTOR", "VECTOR_WRITER", "EMBEDDING"] as const)
|
||||
.filter((role) => variablesByRole.has(role))
|
||||
.flatMap((role) => [
|
||||
`## ${role === "DWH" ? "Data warehouse" : role === "VECTOR" ? "Vector store" : role === "VECTOR_WRITER" ? "Vector writer" : "Embedding service"}`,
|
||||
"",
|
||||
...(variablesByRole.get(role) ?? []).map((variable) => (
|
||||
`- \`${variable.name}\`${variable.transports ? ` (for: ${variable.transports.join(", ")})` : ""}`
|
||||
|
||||
Reference in New Issue
Block a user