Update backend environment variables and refactor AI query route imports

This commit is contained in:
Aadesh Kheria 2026-04-27 17:59:45 -07:00
parent d8b7499cae
commit 331d208c34
2 changed files with 2 additions and 4 deletions

View File

@ -123,4 +123,4 @@ STACK_DOCS_INTERNAL_BASE_URL=# override the docs origin used by the backend's AI
STACK_SPACETIMEDB_URL=# SpacetimeDB host URL; default empty (logging disabled)
STACK_SPACETIMEDB_DB_NAME=# SpacetimeDB database name
STACK_MCP_LOG_TOKEN=# shared secret gating the log_mcp_call reducer; must match EXPECTED_LOG_TOKEN in apps/internal-tool/spacetimedb/src/index.ts
STACK_SPACETIMEDB_SERVICE_TOKEN=# optional; pre-provisioned SpacetimeDB identity token for the backend service. To mint: `curl -X POST <STACK_SPACETIMEDB_URL>/v1/identity` and copy the `token` field.
STACK_SPACETIMEDB_SERVICE_TOKEN=# backend's SpacetimeDB-minted identity token

View File

@ -5,16 +5,14 @@ import {
type CommonLogFields,
type ModeContext,
} from "@/lib/ai/ai-query-handlers";
import { logMcpCall } from "@/lib/ai/mcp-logger";
import { selectModel } from "@/lib/ai/models";
import { getFullSystemPrompt } from "@/lib/ai/prompts";
import { requestBodySchema } from "@/lib/ai/schema";
import { validateImageAttachments } from "@stackframe/stack-shared/dist/ai/image-limits";
import { getTools, validateToolNames } from "@/lib/ai/tools";
import { getVerifiedQaContext } from "@/lib/ai/verified-qa";
import { listManagedProjectIds } from "@/lib/projects";
import { SmartResponse } from "@/route-handlers/smart-response";
import { createSmartRouteHandler } from "@/route-handlers/smart-route-handler";
import { validateImageAttachments } from "@stackframe/stack-shared/dist/ai/image-limits";
import { yupMixed, yupObject, yupString } from "@stackframe/stack-shared/dist/schema-fields";
import { getEnvVariable } from "@stackframe/stack-shared/dist/utils/env";
import { StatusError } from "@stackframe/stack-shared/dist/utils/errors";