diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 7a7b5d03..40bd2e11 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -10,5 +10,5 @@ contact_links: url: https://docs.kaelio.com/ktx/docs/community/support about: Full guide on where to ask what — Slack vs. GitHub Issues vs. docs. - name: Security issues - url: https://github.com/Kaelio/ktx/security/advisories/new + url: https://github.com/Kaelio/ktx-ai-data-agents-context/security/advisories/new about: Report security vulnerabilities privately via GitHub Security Advisories. Please do not file security issues publicly. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cace9460..4c981e98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,12 +212,12 @@ jobs: uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4 with: token: ${{ secrets.CODECOV_TOKEN }} - slug: Kaelio/ktx + slug: Kaelio/ktx-ai-data-agents-context files: ./packages/cli/coverage/lcov.info flags: typescript name: typescript disable_search: true - fail_ci_if_error: false + fail_ci_if_error: true - name: Warn when Codecov token is missing for TypeScript if: env.CODECOV_TOKEN_CONFIGURED != 'true' @@ -231,12 +231,12 @@ jobs: uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4 with: token: ${{ secrets.CODECOV_TOKEN }} - slug: Kaelio/ktx + slug: Kaelio/ktx-ai-data-agents-context files: ./coverage/python.xml flags: python name: python disable_search: true - fail_ci_if_error: false + fail_ci_if_error: true - name: Warn when Codecov token is missing for Python if: env.CODECOV_TOKEN_CONFIGURED != 'true' diff --git a/.github/workflows/star-history.yml b/.github/workflows/star-history.yml index b7d90c43..e8156407 100644 --- a/.github/workflows/star-history.yml +++ b/.github/workflows/star-history.yml @@ -35,7 +35,7 @@ jobs: set -euo pipefail # cachebust forces star-history to regenerate instead of serving its # own server-side cache; --location follows the slug-normalizing 301. - url="https://api.star-history.com/svg?repos=Kaelio/ktx&type=Date&cachebust=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" + url="https://api.star-history.com/svg?repos=Kaelio/ktx-ai-data-agents-context&type=Date&cachebust=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" curl --fail --location --silent --show-error \ --retry 3 --retry-delay 5 --max-time 60 \ -o assets/star-history.svg.new "$url" diff --git a/AGENTS.md b/AGENTS.md index 4bdecf89..7acbb732 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -64,25 +64,6 @@ When rules conflict, follow this order: 4. Code quality: types, readable boundaries, focused modules 5. Performance where it matters -## Opinionated Product Defaults - -- **MUST**: Prefer one canonical behavior over configurable alternatives. A new - flag, config field, environment variable, mode, strategy option, adapter hook, - or fallback path is a product feature and must be justified by an explicit - user request or a real correctness requirement. -- **MUST NOT**: Add speculative flexibility for imagined users, migrations, - review preferences, local workflows, or "just in case" scenarios. If the - requested behavior can work with one solid default, implement that default. -- **MUST NOT**: Add boolean switches that create two runtime paths unless both - paths are essential and the user explicitly asked for the choice. Boolean - policy knobs are especially suspect because they double the state space and - test surface. -- **MUST**: When a design seems to need a new option, first try to remove the - need by choosing the stronger default, tightening the invariant, or failing - clearly. Ask the user before adding the option if it still seems necessary. -- **MUST**: Delete obsolete branches, tests, docs, and config when removing a - behavior. Do not preserve dormant compatibility paths. - ## Repository Shape **ktx** is a pnpm + uv workspace. @@ -178,120 +159,6 @@ and naming asymmetries are bugs in waiting — see [`docs/code-design.md`](docs/code-design.md). Treat the `MUST` / `MUST NOT` rules there with the same weight as the ones in this file. -## Design Reasoning Defaults - -When proposing a design, an approach, or any non-trivial change, apply these -defaults and run the self-check before presenting it. They encode the -corrections users most often have to make; reaching these conclusions -autonomously — without being asked the leading question — is the bar. - -- **MUST**: Optimize for the best outcome, not for an unstated constraint. Do not - silently adopt "smallest change", "least effort", "cheapest", or "least user - intervention" as the goal unless the user said so. Default to the most correct, - durable solution, and present cost / effort / scope as information for the user - to weigh — not as a ceiling you impose on their behalf. -- **MUST**: Separate one-time cost from recurring cost before discarding an - option. A fixed cost paid once (a setup-time computation, an extra LLM call - during setup, a contract change) to make every later run cheaper or more - correct is usually worth it. Do not reject it with recurring-cost reasoning; - quantify both sides. (Example smell: "don't add an LLM call to a cost-cutting - feature" — wrong when the call is one-time and the savings recur.) -- **MUST**: Treat a user's example as a representative of a class, not as the - spec. Design for the general population the example stands for, then stress-test - against deliberately different instances — another warehouse, dialect, stack - layout, or input shape — before committing. If a design only works because of an - incidental property of the example (e.g. "the noise happened to be in a separate - schema *on this demo*"), it is curve-fitting; generalize it or state the - assumption explicitly. -- **MUST**: Prefer deriving from the system's own state over enumerating cases. - Favor an allowlist computed from declared/observed state (config, scanned - catalog, query log, the user's own inputs) over a denylist of known-bad - specifics (particular tables, schemas, tools, or vendors). A hardcoded or - hand-maintained list of external specifics is a smell: it rots and fails on the - next stack. The only acceptable static patterns are genuinely universal - invariants (e.g. DB-engine system catalogs) and ktx's own self-emitted - signatures. -- **MUST**: Give each capability one implementation and route every caller - through it. When some behavior — running a query, resolving a credential or - config reference, authenticating, selecting a dialect, loading config — - already has a working implementation that some call sites use, make new or - divergent call sites depend on that path instead of standing up a second one. - Parallel implementations of one capability drift apart silently: a fix, a - newly supported input, or an added case lands on one path and not the other, - so one entry point (a CLI command, an MCP tool, an ingest stage) succeeds - while another fails on the same input. When two paths already do the same - job, collapse onto the shared one and delete the duplicate instead of - keeping both. When fixing a defect that lives on one path, fix the shared - implementation; do not patch the symptom on a forked branch, which preserves - the divergence you set out to remove. -- **SHOULD**: Before inventing an abstraction or hand-rolling structural logic, - search for what already exists and reuse it — the codebase's canonical - representation (a structured ref/key type) instead of a parallel string scheme, - and a mandated/available tool (e.g. `sqlglot` for SQL structure; see - [SQL and Structured Parsing](#sql-and-structured-parsing)) instead of - hand-parsing. Normalize ambiguous input to the canonical form at the boundary; - do not carry the ambiguity downstream. This is the single-source-of-truth / DRY - item from the Priority Hierarchy applied at design time. - -Before presenting a design, answer these explicitly: - -1. Am I optimizing for a goal the user actually stated, or one I assumed? -2. Does this generalize beyond the example in front of me? Name a real case where - it would break. -3. Am I enumerating known-bad cases when I could derive scope from the system's - own declared/observed state? -4. Is there an existing canonical representation or mandated tool I should reuse - instead of building or parsing my own? -5. Am I discarding the better option on a weak or misapplied constraint - (one-time vs recurring cost, "more surface area", "more work now")? -6. Does another entry point already perform this operation through a shared - implementation? If so, am I routing through that path instead of forking a - parallel one — and if I'm fixing a bug, am I fixing the shared layer rather - than one branch? -7. Am I adding a user-visible option or alternate runtime path that the user did - not ask for? If yes, can one opinionated default solve the problem instead? -8. Does this option multiply behavior by caller path, config value, or local - state? If yes, remove it unless it is explicitly required. - -A user question that nudges toward an alternative ("would X help?", "should I -always do Y?", "will you hardcode Z?") is a signal that a better option exists. -Investigate the implied direction and reason it through *before* defending the -original proposal — and prefer to have asked yourself the question first. - -Example: If generated context changes should be saved, choose one save policy -and route ingest, setup, memory, indexing, and docs through it. Do not add an -`auto_commit`-style switch unless the user explicitly asks for staged-only runs -and accepts the extra runtime path. - -## Code Comments and Docstrings - -Code must be self-explanatory. Clear names, types, and signatures do the -documenting; a comment or docstring exists only to state what the code cannot -show. Everything else belongs in the PR description or nowhere. - -- **MUST**: Keep each comment to 1-3 lines stating only what the code cannot - show: a cross-file invariant ("error-severity issues never reach here — the - doctor exits on them first"), a required ordering ("ktx.yaml is written - before git init, so a crash cannot leave a bare `.git`"), or a library quirk - ("zod reports unknown record keys as `invalid_key`"). -- **MUST**: Hold docstrings (Python `"""..."""`, JSDoc/TSDoc) to the same bar. - A docstring states a function's purpose or contract in 1-3 lines; when a real - quirk or invariant motivates the code, note it once and briefly. Let - self-explanatory code carry the rest — a well-named, well-typed function - often needs no docstring at all. -- **MUST**: State each invariant once, at the public entry point. Do not repeat - the same guarantee across a module docstring, a helper, its wrapper, and the - call site. -- **MUST NOT**: Write multi-paragraph docstrings or prose comment blocks — - design rationale, alternatives considered, change narration ("is now written - before…"), caller enumerations ("shared by X, Y, and Z"), worked examples - that restate the code, or the same explanation repeated in a module docstring - and the function it describes. That is the author addressing the reviewer; it - belongs in the PR description and rots once merged. -- **MAY**: Open a regression test with a 1-3 line comment stating the scenario - it guards when the test name cannot carry it. Omit design history and - references to removed designs. - ## TypeScript Standards - Use Node 22+ and pnpm workspace commands. @@ -411,8 +278,7 @@ use `PascalCase` without the suffix. ## Telemetry -**ktx** ships PostHog usage telemetry. Catalog telemetry events use strict -schemas. When adding commands or events: +**ktx** ships PostHog usage telemetry. When adding commands or events: - **MUST NOT**: Add fields that carry user data — file paths, hostnames, environment values, SQL text, schema/table/column names, error messages, @@ -429,24 +295,6 @@ schemas. When adding commands or events: of collected data changes. Adding another event with no new field types needs no docs change. -### Error reports - -**ktx** also sends PostHog Error Tracking `$exception` events when telemetry is -enabled. This channel is separate from the strict catalog event schema and is -used only for exception diagnostics. - -`$exception` events may include stack frames, error class names, raw error -messages, cause chains, `source`, `handled`, `fatal`, runtime version fields, -OS/runtime fields, and the hashed `projectId` when known. Stack frames may -include local file paths and the local username when those appear in paths. - -`$exception` events must never intentionally include secrets, credentials, -database URLs, auth headers, raw argv, raw environment values, SQL text, -schema/table/column names as explicit properties, customer row data, user prompt -text, or raw MCP arguments. Reporters must redact call-site-provided secret -snapshots and common static credential patterns before the SDK serializes the -exception. - ## Documentation and Specs - Keep public documentation in `README.md`, package READMEs, example READMEs, @@ -533,8 +381,8 @@ rather than silently skipping it. - **MUST**: Disable monospace ligatures on every surface that uses the `var(--font-mono)` family (Geist Mono). Geist Mono fuses `--` into an em-dash glyph that visually eats the adjacent space, so prompts like - `npx skills add Kaelio/ktx --skill ktx` render as - `Kaelio/ktx--skill ktx`. + `npx skills add Kaelio/ktx-ai-data-agents-context --skill ktx` render as + `Kaelio/ktx-ai-data-agents-context--skill ktx`. - **MUST**: When adding a new container that renders user-visible monospace text outside `` / `
` (e.g. a styled `
` for a copyable prompt), verify the global ligature-off rule in diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 212dd9e6..157921f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to ktx +# Contributing to KTX -Thanks for your interest in **ktx**. This page covers **how to contribute** and +Thanks for your interest in KTX. This page covers **how to contribute** and the **contributor rewards program**. For development setup, repository layout, and verification commands, see the [Contributing guide in the docs](https://docs.kaelio.com/ktx/docs/community/contributing). @@ -8,8 +8,8 @@ layout, and verification commands, see the ## How to contribute 1. Browse open issues labeled - [`good first issue`](https://github.com/Kaelio/ktx/labels/good%20first%20issue) - or [`help wanted`](https://github.com/Kaelio/ktx/labels/help%20wanted). + [`good first issue`](https://github.com/Kaelio/ktx-ai-data-agents-context/labels/good%20first%20issue) + or [`help wanted`](https://github.com/Kaelio/ktx-ai-data-agents-context/labels/help%20wanted). 2. Comment on the issue to claim it. A maintainer will confirm scope and assign it to you. 3. For changes not covered by an existing issue, open one first so we can @@ -23,7 +23,7 @@ layout, and verification commands, see the ## Contributor rewards program We send merch to contributors whose pull requests get merged. The goal is -to thank the people building **ktx** with us, not to drive volume. +to thank the people building KTX with us, not to drive volume. ### How it works @@ -76,18 +76,18 @@ See the [Community & Support](https://docs.kaelio.com/ktx/docs/community/support page for the full guide. The short version: - **Questions, "how do I...", setup help, sharing patterns**: join the - [**ktx** Slack](https://join.slack.com/t/ktxcommunity/shared_invite/zt-3y9b44m1x-LVyNNJD5nwaZHq4XS29LMQ). + [KTX Slack](https://join.slack.com/t/ktxcommunity/shared_invite/zt-3y9b44m1x-LVyNNJD5nwaZHq4XS29LMQ). - **Bugs**: use the [Bug report](.github/ISSUE_TEMPLATE/bug_report.yml) template. - **Feature requests**: use the [Feature request](.github/ISSUE_TEMPLATE/feature_request.yml) template. - **Security**: report privately via - [GitHub Security Advisories](https://github.com/Kaelio/ktx/security/advisories/new), + [GitHub Security Advisories](https://github.com/Kaelio/ktx-ai-data-agents-context/security/advisories/new), not as a public issue. ## Code of conduct -**ktx** follows the +KTX follows the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). Be respectful, assume good intent, and keep discussion focused on the project. Report concerns to the maintainers in Slack or by email at diff --git a/README.md b/README.md index 3f704f04..d417d77a 100644 --- a/README.md +++ b/README.md @@ -8,25 +8,21 @@

npm version - Codecov - Tests + Codecov + Tests Documentation Join the ktx Slack community - License - Y Combinator P25 + License + Y Combinator P25

Quickstart · CLI Reference · - Agent Setup · + Agent Setup · Slack

-

- Built and maintained by Kaelio -

- --- **ktx** is a self-improving context layer that teaches agents how to query your @@ -34,9 +30,8 @@ warehouse accurately - from approved metric definitions, joinable columns, and business knowledge it builds and maintains for you. > [!NOTE] -> Run **ktx** with your own LLM API keys or a local agent sign-in — a -> **Claude Pro/Max** subscription through Claude Code, or your local Codex -> authentication. No extra usage billing from **ktx**. +> Run **ktx** with your own LLM API keys or a **Claude Pro/Max** subscription. +> No extra usage billing from **ktx**.

@@ -135,7 +130,7 @@ Agent integration ready: yes (codex:project) > your project directory: > > ```text -> Run npx skills add Kaelio/ktx --skill ktx and use the ktx skill to install +> Run npx skills add Kaelio/ktx-ai-data-agents-context --skill ktx and use the ktx skill to install > and configure ktx in this project. > ``` @@ -143,14 +138,6 @@ Agent integration ready: yes (codex:project) > If `ktx status` prints `ktx mcp start --project-dir ...`, run it before > opening your agent client. -## Upgrading - -Re-run the global install with the `@latest` tag: - -```bash -npm install -g @kaelio/ktx@latest -``` - ## First commands | Command | Purpose | @@ -188,9 +175,8 @@ then the current directory. Pass `--project-dir ` when scripting. No. **ktx** runs locally. The only data leaving your machine is what you send to the LLM provider you configured. - **Which LLM backends are supported?** - Anthropic API, Google Vertex AI, AI Gateway, the local Claude Code session - through the Claude Agent SDK, and your local Codex authentication through the - Codex SDK. See + Anthropic API, Google Vertex AI, AI Gateway, and the local Claude Code + session through the Claude Agent SDK. See [LLM configuration](https://docs.kaelio.com/ktx/docs/guides/llm-configuration). - **How is ktx different from a dbt or MetricFlow semantic layer?** **ktx** *ingests* those layers and combines them with raw-table @@ -209,13 +195,13 @@ then the current directory. Pass `--project-dir ` when scripting. - [The Context Layer](https://docs.kaelio.com/ktx/docs/concepts/the-context-layer) - [Building Context](https://docs.kaelio.com/ktx/docs/guides/building-context) - [CLI Reference](https://docs.kaelio.com/ktx/docs/cli-reference/ktx) -- [AI Resources](https://docs.kaelio.com/ktx/docs/community/ai-resources) +- [Agent Quickstart](https://docs.kaelio.com/ktx/docs/ai-resources/agent-quickstart) - [Community & Support](https://docs.kaelio.com/ktx/docs/community/support) ## Community - **[Slack](https://join.slack.com/t/ktxcommunity/shared_invite/zt-3y9b44m1x-LVyNNJD5nwaZHq4XS29LMQ)** — ask questions, share what you're building, and chat with maintainers. -- **[GitHub Issues](https://github.com/Kaelio/ktx/issues)** — report bugs and request features. +- **[GitHub Issues](https://github.com/Kaelio/ktx-ai-data-agents-context/issues)** — report bugs and request features. - **[Contributing](https://docs.kaelio.com/ktx/docs/community/contributing)** — set up the repo, run tests, and open a PR. ## Development @@ -259,17 +245,11 @@ uv run pytest -q ## Telemetry -**ktx** collects privacy-conscious usage telemetry to understand installs and -improve setup, command reliability, and data-agent workflows. Catalog telemetry -events do not record file paths, hostnames, SQL, schema names, table names, -column names, error messages, raw environment values, or argv. Error reports use -PostHog Error Tracking and can include stack frames and raw error messages, -which may contain local file paths or the local username in those paths. -**ktx** redacts secrets, credentials, database URLs, auth headers, argv, raw -environment values, SQL text, row data, and user-typed prompt or MCP argument -text from the explicit `$exception` payload. See -[Telemetry](https://docs.kaelio.com/ktx/docs/community/telemetry) for the event -catalog and opt-out options. +**ktx** collects anonymous usage telemetry from interactive CLI runs to +improve setup, command reliability, and data-agent workflows. No file paths, +hostnames, SQL, schema names, error messages, or argv are recorded. See +[Telemetry](https://docs.kaelio.com/ktx/docs/community/telemetry) for the +event catalog and opt-out options. ## License @@ -278,7 +258,7 @@ catalog and opt-out options. ## Star History

- + ktx Star History Chart

diff --git a/SECURITY.md b/SECURITY.md index 2b9dee1d..7d0c1909 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,20 +2,20 @@ ## Reporting a vulnerability -If you believe you've found a security vulnerability in **ktx**, please report it +If you believe you've found a security vulnerability in KTX, please report it **privately** through GitHub Security Advisories: -[Report a vulnerability](https://github.com/Kaelio/ktx/security/advisories/new) +[Report a vulnerability](https://github.com/Kaelio/ktx-ai-data-agents-context/security/advisories/new) If you cannot use GitHub Security Advisories, email `support@kaelio.com` -instead. Please do **not** open a public issue, post in the **ktx** Slack, or +instead. Please do **not** open a public issue, post in the KTX Slack, or share details elsewhere until we have published a fix. When reporting, please include: - A description of the issue and its impact - Steps to reproduce -- The **ktx** version affected +- The KTX version affected ## What to expect diff --git a/assets/star-history.svg b/assets/star-history.svg index 3c4da9ba..16b5fc6a 100644 --- a/assets/star-history.svg +++ b/assets/star-history.svg @@ -1 +1 @@ -star-history.comMay 17May 24May 31Jun 07Jun 14Jun 21 20040060080010001200kaelio/ktxStar HistoryDateGitHub Stars +star-history.comMay 17May 24May 31 100200300400500600kaelio/ktxStar HistoryDateGitHub Stars diff --git a/docs-site/app/global.css b/docs-site/app/global.css index 2a50ba81..929e06b4 100644 --- a/docs-site/app/global.css +++ b/docs-site/app/global.css @@ -869,97 +869,6 @@ body::after { 50% { opacity: 0.65; transform: scale(0.9); } } -/* ═══════════════════════════════════════════ - GitHub star widget (sidebar footer pill) - Rendered as the `icon` of a fumadocs icon-link, so it sits in the footer - pill beside the Slack mark and the theme toggle. GitHub mark + star glyph - + live count; the star rotates to coral on hover. The !important sizes win - over fumadocs' `[&_svg]:size-4.5` rule on the wrapping link. - ═══════════════════════════════════════════ */ -.ktx-stars { - display: inline-flex; - align-items: center; - gap: 6px; - font-family: var(--font-display), var(--font-sans), sans-serif; - font-size: 13px; - line-height: 1; -} - -/* Push the stars to the opposite (right) end of the footer pill, leaving the - Slack mark on the left — like justify-content: space-between. The auto margin - absorbs the pill's free space; we cancel the theme toggle's own ms-auto so - that single gap lands before the stars, not between stars and the toggle. */ -#nd-sidebar a[aria-label="Star ktx on GitHub"] { - margin-inline-start: auto; -} - -#nd-sidebar [data-theme-toggle] { - margin-inline-start: 0; -} - -.ktx-stars-gh { - width: 16px !important; - height: 16px !important; - flex-shrink: 0; -} - -.ktx-stars-count-wrap { - display: inline-flex; - align-items: center; - gap: 4px; -} - -.ktx-stars-star { - width: 12px !important; - height: 12px !important; - flex-shrink: 0; - fill: currentColor; - opacity: 0.7; - transition: - transform 0.3s var(--ktx-ease), - fill 0.3s var(--ktx-ease), - opacity 0.3s var(--ktx-ease); -} - -/* The wrapping fumadocs link owns the hover; rotate + colour the star from it. */ -#nd-sidebar a:hover .ktx-stars-star { - transform: rotate(-14deg) scale(1.12); - fill: var(--ktx-coral); - opacity: 1; -} - -.ktx-stars-count { - font-weight: 600; - font-variant-numeric: tabular-nums; - letter-spacing: -0.01em; -} - -/* Skeleton shown only on the rare cold (uncached) fetch */ -.ktx-stars-skeleton-bar { - display: inline-block; - width: 26px; - height: 10px; - border-radius: 4px; - background: linear-gradient( - 90deg, - var(--color-fd-muted) 25%, - color-mix(in oklch, var(--color-fd-muted-foreground) 28%, var(--color-fd-muted)) 50%, - var(--color-fd-muted) 75% - ); - background-size: 200% 100%; - animation: ktx-stars-shimmer 1.4s ease-in-out infinite; -} - -@keyframes ktx-stars-shimmer { - from { background-position: 200% 0; } - to { background-position: -200% 0; } -} - -@media (prefers-reduced-motion: reduce) { - #nd-sidebar a:hover .ktx-stars-star { transform: none; } - .ktx-stars-skeleton-bar { animation: none; } -} - /* Dot grid */ .dot-grid { background-image: radial-gradient( diff --git a/docs-site/app/layout.config.tsx b/docs-site/app/layout.config.tsx index 09654884..3245ab09 100644 --- a/docs-site/app/layout.config.tsx +++ b/docs-site/app/layout.config.tsx @@ -1,22 +1,22 @@ import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared"; +import { GitHubIcon } from "@/components/github-icon"; import { Logo } from "@/components/logo"; import { SlackIcon } from "@/components/slack-icon"; -import { GitHubStars, GITHUB_REPO_URL } from "@/components/github-stars"; -import { ThemeToggle } from "@/components/theme-toggle"; export const baseOptions: BaseLayoutProps = { nav: { - title: Logo, + title: , transparentMode: "top", }, - // Custom two-icon switcher (light / dark) where each icon selects its own - // theme. The default "light-dark" switcher is a single blind toggle — both - // icons just flip the theme, so clicking the sun while already in light mode - // jumps to dark, which reads as broken. - slots: { - themeSwitch: ThemeToggle, - }, links: [ + { + type: "icon", + label: "GitHub", + icon: , + text: "GitHub", + url: "https://github.com/kaelio/ktx", + external: true, + }, { type: "icon", label: "Join the ktx Slack community", @@ -25,13 +25,5 @@ export const baseOptions: BaseLayoutProps = { url: "https://join.slack.com/t/ktxcommunity/shared_invite/zt-3y9b44m1x-LVyNNJD5nwaZHq4XS29LMQ", external: true, }, - { - type: "icon", - label: "Star ktx on GitHub", - icon: , - text: "GitHub", - url: GITHUB_REPO_URL, - external: true, - }, ], }; diff --git a/docs-site/components/diagram-studio/flows.ts b/docs-site/components/diagram-studio/flows.ts index e63cc512..cddf75cb 100644 --- a/docs-site/components/diagram-studio/flows.ts +++ b/docs-site/components/diagram-studio/flows.ts @@ -305,8 +305,8 @@ export const runtimeEdges: Edge[] = [ sourceHandle: "to-context", target: "context", targetHandle: "in", - type: "smoothstep", - label: "search + read", + type: "default", + label: "search", ...labelBg, style: edgeStyle, markerStart: marker, @@ -318,7 +318,7 @@ export const runtimeEdges: Edge[] = [ sourceHandle: "to-warehouse", target: "warehouse", targetHandle: "in", - type: "smoothstep", + type: "default", label: "read-only", ...labelBg, style: edgeStyle, diff --git a/docs-site/components/github-stars.tsx b/docs-site/components/github-stars.tsx deleted file mode 100644 index b7f62143..00000000 --- a/docs-site/components/github-stars.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { Suspense } from "react"; -import { GitHubIcon } from "@/components/github-icon"; - -const REPO = "kaelio/ktx"; -export const GITHUB_REPO_URL = `https://github.com/${REPO}`; -const API_URL = `https://api.github.com/repos/${REPO}`; - -async function fetchStarCount(): Promise { - try { - const res = await fetch(API_URL, { - headers: { Accept: "application/vnd.github+json" }, - // Revalidate hourly. GitHub's unauthenticated REST limit is 60 req/h per - // IP, so a single cached server-side fetch keeps the count fresh while - // never exposing visitors to rate limits or layout shift. - next: { revalidate: 3600 }, - }); - if (!res.ok) return null; - const data = (await res.json()) as { stargazers_count?: unknown }; - return typeof data.stargazers_count === "number" - ? data.stargazers_count - : null; - } catch { - return null; - } -} - -/** Compact, GitHub-style count: 847 → "847", 1234 → "1.2k", 12345 → "12.3k". */ -function formatStars(count: number): string { - if (count < 1000) return count.toLocaleString("en-US"); - const thousands = count / 1000; - const rounded = - thousands >= 100 ? Math.round(thousands) : Math.round(thousands * 10) / 10; - return `${rounded}k`; -} - -function StarGlyph() { - return ( - - ); -} - -async function StarsInner() { - const count = await fetchStarCount(); - return ( - - - {count !== null ? ( - - - {formatStars(count)} - - ) : ( - Star - )} - - ); -} - -function StarsSkeleton() { - return ( -