2026-05-11 01:08:31 -07:00
|
|
|
import { createMDX } from "fumadocs-mdx/next";
|
|
|
|
|
|
|
|
|
|
const withMDX = createMDX();
|
|
|
|
|
|
|
|
|
|
/** @type {import('next').NextConfig} */
|
2026-05-11 16:40:34 -07:00
|
|
|
const config = {
|
2026-05-15 02:30:20 +02:00
|
|
|
basePath: "/ktx",
|
2026-05-11 16:40:34 -07:00
|
|
|
async rewrites() {
|
2026-05-28 13:00:49 +02:00
|
|
|
return {
|
|
|
|
|
beforeFiles: [
|
|
|
|
|
{
|
|
|
|
|
source: "/stars",
|
|
|
|
|
has: [{ type: "host", value: "ktx.sh" }],
|
|
|
|
|
destination: "https://ktx-stars.vercel.app/stars",
|
|
|
|
|
basePath: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
source: "/stars/:path*",
|
|
|
|
|
has: [{ type: "host", value: "ktx.sh" }],
|
|
|
|
|
destination: "https://ktx-stars.vercel.app/stars/:path*",
|
|
|
|
|
basePath: false,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
afterFiles: [
|
|
|
|
|
{
|
|
|
|
|
source: "/docs/:path*.md",
|
|
|
|
|
destination: "/llms.mdx/docs/:path*",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
2026-05-11 16:40:34 -07:00
|
|
|
},
|
2026-05-15 02:30:20 +02:00
|
|
|
async redirects() {
|
2026-06-05 15:05:22 -04:00
|
|
|
// Alias-host canonicalization MUST come before the generic root/docs
|
|
|
|
|
// redirects below. Those generic rules have no host guard, so if they ran
|
|
|
|
|
// first they would inject a "/ktx" basePath into the path on the alias
|
|
|
|
|
// hosts, which the alias catch-alls would then prepend a second time —
|
|
|
|
|
// producing https://docs.kaelio.com/ktx/ktx/docs/... Redirects also run
|
|
|
|
|
// before beforeFiles rewrites, so the ktx.sh catch-all must exclude
|
|
|
|
|
// /stars* to let the stars dashboard rewrite proxy through.
|
2026-05-15 02:30:20 +02:00
|
|
|
return [
|
docs: rewrite Semantic Querying concept with imperative-vs-declarative diagram (#156)
* docs: rewrite Semantic Querying concept with imperative-vs-declarative diagram
Reframe semantic-layer-internals.mdx around the contract the semantic
layer offers an agent: declare what you want (a Semantic Query), KTX
figures out how to compute it. Replaces the old "Context-Aware SQL"
framing with a clear imperative-vs-declarative narrative.
Adds a React Flow component (semantic-layer-flow.tsx) that contrasts a
buggy 4-table agent-authored SQL (chasm trap, LEFT-JOIN-in-WHERE,
hardcoded DATE_TRUNC) against the chasm-safe per-fact CTE SQL the
planner actually emits, including the outer GROUP BY over the requested
dimensions. Both lanes converge into a shared warehouse node and each
SQL card now has parallel bullet notes (failures on the left, KTX
behavior on the right).
Side fixes bundled in:
- include the /ktx basePath in the favicon metadata so the icon resolves
under the production prefix
- migrate docs-site/middleware.ts to docs-site/proxy.ts (Next 16 rename)
- redirect / to /ktx/docs/getting-started/introduction so the apex docs
URL works
- add tests covering the apex redirect, the favicon basePath, and the
middleware-to-proxy rename
- propagate the Semantic Query terminology across the ktx-sl CLI
reference, the context-layer concept page, and the agent-clients /
primary-sources integration pages
* Fix CI dead-code failures
* docs-site: polish semantic-layer-internals code blocks and flow diagram
- Make CodeBlock a server component so children traverse synchronously
under React 19 RSC streaming; previously extractText returned "" in
dev SSR, leaving code blocks empty.
- Add custom JSON/YAML/SQL/code-like tokenizers with theme-aware token
classes; drop the colored file-glyph dot and gradient tab-head.
- Tighten tab-head: subtle grey background, smaller monospace filename
in muted grey, smaller rectangular language pill placed to the left
of the filename.
- Polish the React Flow semantic-layer diagram (controls, fit-view
padding, edge types).
* docs-site: annotate imperative SQL, add section anchor, drop ClickHouse
- Wire numbered red badges to each problematic span in the "Without KTX"
SQL with hover sync between SQL gutter, lines, and the notes list.
- Add #imperative-vs-declarative anchor on the flow section header so
the eyebrow link is shareable; reveals a # glyph on hover/focus.
- Align the compiled-SQL note dots to the first-line midpoint
(mt-[6px] instead of mt-1) so 4px dots sit at y=8 in a 16px line.
- Remove all ClickHouse references from docs-site (primary-sources,
quickstart, ktx-setup, contributing, agents-setup, mechanics test,
warehouse drivers in the flow diagram).
* test: drop ClickHouse contributing-docs assertion
Align the workspace-package mirror test with the ClickHouse removal
from docs-site (75907eb). The connector-clickhouse package still
exists in packages/, but contributing.mdx no longer lists it, so the
test that mirrored docs against the workspace was failing.
2026-05-19 23:41:29 +02:00
|
|
|
{
|
2026-06-05 15:05:22 -04:00
|
|
|
source: "/slack",
|
|
|
|
|
has: [{ type: "host", value: "ktx.sh" }],
|
|
|
|
|
destination:
|
|
|
|
|
"https://join.slack.com/t/ktxcommunity/shared_invite/zt-3y9b44m1x-LVyNNJD5nwaZHq4XS29LMQ",
|
2026-05-16 12:06:34 +02:00
|
|
|
permanent: false,
|
|
|
|
|
basePath: false,
|
|
|
|
|
},
|
2026-05-15 02:30:20 +02:00
|
|
|
{
|
|
|
|
|
source: "/:path*",
|
|
|
|
|
has: [{ type: "host", value: "docs.ktx.sh" }],
|
|
|
|
|
destination: "https://docs.kaelio.com/ktx/:path*",
|
|
|
|
|
permanent: true,
|
|
|
|
|
basePath: false,
|
|
|
|
|
},
|
2026-05-27 18:20:51 +02:00
|
|
|
{
|
2026-06-05 15:05:22 -04:00
|
|
|
source: "/:path((?!stars(?:/|$)).*)",
|
2026-05-27 18:20:51 +02:00
|
|
|
has: [{ type: "host", value: "ktx.sh" }],
|
2026-06-05 15:05:22 -04:00
|
|
|
destination: "https://docs.kaelio.com/ktx/:path",
|
|
|
|
|
permanent: true,
|
|
|
|
|
basePath: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
source: "/",
|
|
|
|
|
destination: "/ktx/docs/getting-started/introduction",
|
2026-05-27 18:20:51 +02:00
|
|
|
permanent: false,
|
|
|
|
|
basePath: false,
|
|
|
|
|
},
|
2026-05-15 02:30:20 +02:00
|
|
|
{
|
2026-06-05 15:05:22 -04:00
|
|
|
source: "/docs",
|
|
|
|
|
destination: "/docs/getting-started/introduction",
|
|
|
|
|
permanent: false,
|
2026-05-15 02:30:20 +02:00
|
|
|
basePath: false,
|
|
|
|
|
},
|
docs: consolidate AI Resources into a single page (#274)
* docs: consolidate AI Resources into a single page
The AI Resources section was four pages (agent-quickstart, markdown-access,
agent-instructions, prompt-recipes) that repeated the same docs-consumption
guidance. Collapse them into one page at /docs/ai-resources covering markdown
endpoints, retrieval order, the task router, agent instructions, prompts, and
guardrails.
Also fix a stale claim: the page actions are a single "Copy as Markdown"
button, not the documented "Copy MD / View MD / Copy MDX" trio.
Update the cross-references in README, the introduction cards, the quickstart,
and the llms.txt entry points to the consolidated page.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(docs-site): redirect retired AI Resources slugs, preserving .md route
Redirect the retired per-page slugs (/docs/ai-resources/*) to the consolidated
page. Because Next evaluates redirects before the .md rewrite, a single
catch-all would 308 a cached per-page Markdown URL to the HTML page and break
the agent Markdown contract. Match the .md variant first and keep its suffix so
it lands on /docs/ai-resources.md.
Extend the routing test to assert both the HTML and .md redirects, and that
following the .md URL end to end serves text/markdown.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs: move AI Resources under the Community & Resources section
As a single page, AI Resources rendered as an orphaned, unbolded link wedged
between the top-level multi-page sections instead of as a section of its own.
Move it under Community (renamed "Community & Resources") so it renders as a
normal child link, consistent with how the single-page Configuration section
already works.
Redirect the former top-level URL and the retired per-page slugs (HTML and .md,
the .md variants first so cached Markdown URLs keep their suffix) to the new
home, relabel the llms.txt group to match, and repoint the README, introduction,
quickstart, and llms.txt cross-links.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 21:28:56 -07:00
|
|
|
{
|
|
|
|
|
// AI Resources collapsed from four pages to one and now lives under the
|
|
|
|
|
// Community & Resources section. Redirect the old top-level URL and the
|
|
|
|
|
// retired per-page slugs to the new home. Redirects run before the .md
|
|
|
|
|
// rewrite, so the Markdown variants must be matched first and keep their
|
|
|
|
|
// .md suffix; otherwise a cached Markdown URL would 308 to the HTML page
|
|
|
|
|
// and break the agent Markdown contract.
|
|
|
|
|
source: "/docs/ai-resources.md",
|
|
|
|
|
destination: "/docs/community/ai-resources.md",
|
|
|
|
|
permanent: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
source: "/docs/ai-resources/:slug([^/]+\\.md)",
|
|
|
|
|
destination: "/docs/community/ai-resources.md",
|
|
|
|
|
permanent: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
source: "/docs/ai-resources",
|
|
|
|
|
destination: "/docs/community/ai-resources",
|
|
|
|
|
permanent: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
source: "/docs/ai-resources/:slug",
|
|
|
|
|
destination: "/docs/community/ai-resources",
|
|
|
|
|
permanent: true,
|
|
|
|
|
},
|
2026-05-15 02:30:20 +02:00
|
|
|
];
|
|
|
|
|
},
|
2026-05-11 16:40:34 -07:00
|
|
|
};
|
2026-05-11 01:08:31 -07:00
|
|
|
|
|
|
|
|
export default withMDX(config);
|