Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
version: 11
- uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "24"
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
version: 11
- uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "24"
cache: pnpm
registry-url: "https://registry.npmjs.org"
- run: pnpm install --frozen-lockfile
Expand Down
24 changes: 24 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "base-nova",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/styles/tailwind.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "hugeicons",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"registries": {
"@agentic-craft": "https://raw.githubusercontent.com/bitcomplete/agentic-craft/main/public/r/{name}.json"
}
}
2 changes: 1 addition & 1 deletion examples/plan.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Move the billing service to async webhooks

<TLDR>
The billing service currently blocks request handlers for up to 8 seconds while it talks to Stripe. Move the Stripe call into a queued worker so request handlers return in <100ms. Two PRs: queue plumbing + worker.
The billing service currently blocks request handlers for up to 8 seconds while it talks to Stripe. Move the Stripe call into a queued worker so request handlers return in \<100ms. Two PRs: queue plumbing + worker.
</TLDR>

## Why now
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"build:css": "tailwindcss -i src/styles/tailwind.css -o dist/styles.css --minify && node scripts/embed-css.mjs",
"build:manifest": "node scripts/extract-manifest.mjs",
"build:js": "tsup",
"build": "pnpm run build:manifest && pnpm run build:css && pnpm run build:js",
"registry:sync": "npx shadcn@latest add @agentic-craft/tool-call @agentic-craft/tool-tree @agentic-craft/status-indicator --overwrite --yes",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

"build": "rm -rf dist && pnpm run build:manifest && pnpm run build:css && pnpm run build:js",
"dev": "pnpm run build:manifest && pnpm run build:css && tsup --watch",
"test": "vitest run",
"test:watch": "vitest",
Expand All @@ -48,7 +49,7 @@
"prepublishOnly": "pnpm run build"
},
"dependencies": {
"@hugeicons/core-free-icons": "^4.0.0",
"@hugeicons/core-free-icons": "^4.2.0",
"@hugeicons/react": "^1.1.6",
"@mdx-js/mdx": "^3.1.0",
"clsx": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
allowBuilds:
'@parcel/watcher': true
esbuild: true
4 changes: 4 additions & 0 deletions scripts/extract-manifest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,15 @@ function collectPublicExports(indexFile) {
// them in the manifest would only confuse agents.
const INTERNAL_NAMES = new Set([
"ToolCallPrimitive",
"ToolCallTrigger",
"ToolCallLabel",
"ToolCallContent",
"ToolCallError",
"ToolCallRetry",
"ToolTreePrimitive",
"ToolTreeTrigger",
"ToolTreeContent",
"StatusIndicator",
]);

function isComponentDeclaration(name, node) {
Expand Down
29 changes: 19 additions & 10 deletions src/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// `components` to MDXContent so authors don't need import statements.
//
// Structure mirrors the shadcn registry layout (`ui/`): components are
// imported from `./ui/<name>`. Two of them (tool-call, tool-tree) are
// vendored verbatim from agentic-craft's registry. The rest are local
// implementations that mimic agentic-craft's editorial visual language
// — they are intended to be replaced by registry components when (if)
// the upstream project publishes them.
// imported from `./ui/<name>`. Three of them (tool-call, tool-tree,
// status-indicator) are installed from the agentic-craft shadcn
// registry — run `pnpm registry:sync` to pull upstream updates; do not
// edit those files by hand. The rest are local implementations that
// mimic agentic-craft's editorial visual language.

import * as React from "react";
import { HugeiconsIcon } from "@hugeicons/react";
Expand All @@ -26,18 +26,22 @@ import {
import type { IconSvgElement } from "@hugeicons/react";
import { cn } from "@/lib/utils.js";

// Vendored from agentic-craft registry —
// https://github.com/arielconti10/agentic-craft/tree/main/registry/base-nova/ui
// Installed from the agentic-craft registry (bitcomplete/agentic-craft)
// via `npx shadcn add @agentic-craft/<name>` — see components.json.
export {
ToolCall as ToolCallPrimitive,
ToolCallTrigger,
ToolCallLabel,
ToolCallContent,
ToolCallError,
ToolCallRetry,
} from "./ui/tool-call.js";
export {
ToolTree as ToolTreePrimitive,
ToolTreeTrigger,
ToolTreeContent,
} from "./ui/tool-tree.js";
export { StatusIndicator } from "./ui/status-indicator.js";

export { TLDR } from "./ui/tldr.js";
export { Callout } from "./ui/callout.js";
Expand All @@ -64,7 +68,7 @@ export {

// ── ToolCall MDX wrapper ─────────────────────────────────────────────
// Our MDX API is flat: `<ToolCall name="bash" status="ok" timing="0.4s"
// args="..."/>`. The vendored primitive expects a hugeicons `icon`,
// args="..."/>`. The registry primitive expects a hugeicons `icon`,
// `<ToolCallLabel>`, and `<ToolCallContent>`. This wrapper translates.
// status: "ok"|"fail"|"running"|"skip" maps to "completed"|"failed"|
// "running"|"completed" (skip = quiet completed).
Expand All @@ -90,7 +94,7 @@ const iconByName: Record<string, IconSvgElement> = {

type ToolStatus = "running" | "ok" | "fail" | "skip";

// We render <details>/<summary> rather than the vendored React
// We render <details>/<summary> rather than the registry's React
// ToolCall/ToolTree from agentic-craft. Their primitives use
// React.useState for expand/collapse — that works in their Next.js
// app but pin ships static HTML with no React runtime in the browser,
Expand Down Expand Up @@ -407,6 +411,7 @@ export function ToolCallGroup({
*/
export function ToolTree({
label = "Running tools",
defaultOpen,
children,
}: {
/** Header shown above the children. */
Expand All @@ -416,7 +421,11 @@ export function ToolTree({
children?: React.ReactNode;
}) {
return (
<details data-slot="tool-tree" className="my-3 group/tree">
<details
data-slot="tool-tree"
open={defaultOpen || undefined}
className="my-3 group/tree"
>
<summary className="flex cursor-pointer items-center gap-2 py-1.5 list-none [&::-webkit-details-marker]:hidden">
<span className="relative inline-flex size-5 shrink-0 items-center justify-center">
<HugeiconsIcon
Expand Down
2 changes: 1 addition & 1 deletion src/components/styles.ts

Large diffs are not rendered by default.

108 changes: 108 additions & 0 deletions src/components/ui/status-indicator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
"use client"

import {
Alert01Icon,
Clock01Icon,
Loading03Icon,
Tick01Icon,
} from "@hugeicons/core-free-icons"
import { HugeiconsIcon } from "@hugeicons/react"

import { cn } from "@/lib/utils"

type StatusIndicatorStatus =
| "pending"
| "idle"
| "active"
| "complete"
| "blocked"
| "warning"
| "error"

const statusIndicatorLabels: Record<StatusIndicatorStatus, string> = {
pending: "Pending",
idle: "Idle",
active: "Active",
complete: "Complete",
blocked: "Blocked",
warning: "Warning",
error: "Error",
}

/* The product-wide status vocabulary: one shape per state so status never
relies on color alone — check in a soft square (complete), spinner
(active), dashed circle (pending/idle), clock (blocked), alert (warning /
error). Icon-only on screen; the label survives via sr-only text and a
title tooltip. */
function StatusIndicator({
status,
label,
className,
}: {
status: StatusIndicatorStatus
/** Override the visually hidden/tooltip text, e.g. "Proposed". */
label?: string
className?: string
}) {
const text = label ?? statusIndicatorLabels[status]
return (
<span
data-slot="status-indicator"
data-status={status}
title={text}
className={cn(
"flex size-5 shrink-0 items-center justify-center",
className
)}
>
{status === "complete" ? (
<span className="flex size-5 items-center justify-center rounded-md bg-foreground/10">
<HugeiconsIcon
icon={Tick01Icon}
size={12}
strokeWidth={2}
className="text-foreground/70"
aria-hidden="true"
/>
</span>
) : status === "active" ? (
<HugeiconsIcon
icon={Loading03Icon}
size={14}
strokeWidth={1.5}
className="animate-spin text-foreground/70 motion-reduce:animate-none"
aria-hidden="true"
/>
) : status === "pending" || status === "idle" ? (
<span className="size-3 rounded-full border border-dashed border-muted-foreground/70" />
) : status === "blocked" ? (
<HugeiconsIcon
icon={Clock01Icon}
size={14}
strokeWidth={1.5}
className="text-muted-foreground"
aria-hidden="true"
/>
) : status === "warning" ? (
<HugeiconsIcon
icon={Alert01Icon}
size={14}
strokeWidth={1.5}
className="text-muted-foreground"
aria-hidden="true"
/>
) : (
<HugeiconsIcon
icon={Alert01Icon}
size={14}
strokeWidth={1.5}
className="text-destructive"
aria-hidden="true"
/>
)}
<span className="sr-only">{text}</span>
</span>
)
}

export { StatusIndicator, statusIndicatorLabels, type StatusIndicatorStatus }
Loading
Loading