@raybase/cli 0.0.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/admin-assets.d.ts +22 -0
- package/dist/admin-assets.d.ts.map +1 -0
- package/dist/admin-assets.js +285 -0
- package/dist/admin-assets.js.map +1 -0
- package/dist/agent-remote-mcp-cli.d.ts +71 -0
- package/dist/agent-remote-mcp-cli.d.ts.map +1 -0
- package/dist/agent-remote-mcp-cli.js +466 -0
- package/dist/agent-remote-mcp-cli.js.map +1 -0
- package/dist/agent-skills-cli.d.ts +4 -0
- package/dist/agent-skills-cli.d.ts.map +1 -0
- package/dist/agent-skills-cli.js +144 -0
- package/dist/agent-skills-cli.js.map +1 -0
- package/dist/agent.d.ts +169 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +531 -0
- package/dist/agent.js.map +1 -0
- package/dist/app-manifest.d.ts +41 -0
- package/dist/app-manifest.d.ts.map +1 -0
- package/dist/app-manifest.js +294 -0
- package/dist/app-manifest.js.map +1 -0
- package/dist/dev-cron-backstop.d.ts +53 -0
- package/dist/dev-cron-backstop.d.ts.map +1 -0
- package/dist/dev-cron-backstop.js +364 -0
- package/dist/dev-cron-backstop.js.map +1 -0
- package/dist/dev-do-watchdog.d.ts +37 -0
- package/dist/dev-do-watchdog.d.ts.map +1 -0
- package/dist/dev-do-watchdog.js +75 -0
- package/dist/dev-do-watchdog.js.map +1 -0
- package/dist/dev-inference-tape.d.ts +35 -0
- package/dist/dev-inference-tape.d.ts.map +1 -0
- package/dist/dev-inference-tape.js +502 -0
- package/dist/dev-inference-tape.js.map +1 -0
- package/dist/dev-ports.d.ts +25 -0
- package/dist/dev-ports.d.ts.map +1 -0
- package/dist/dev-ports.js +84 -0
- package/dist/dev-ports.js.map +1 -0
- package/dist/dev-project-lock.d.ts +24 -0
- package/dist/dev-project-lock.d.ts.map +1 -0
- package/dist/dev-project-lock.js +307 -0
- package/dist/dev-project-lock.js.map +1 -0
- package/dist/env-files.d.ts +10 -0
- package/dist/env-files.d.ts.map +1 -0
- package/dist/env-files.js +108 -0
- package/dist/env-files.js.map +1 -0
- package/dist/external-json.d.ts +3 -0
- package/dist/external-json.d.ts.map +1 -0
- package/dist/external-json.js +21 -0
- package/dist/external-json.js.map +1 -0
- package/dist/frameworks.d.ts +67 -0
- package/dist/frameworks.d.ts.map +1 -0
- package/dist/frameworks.js +210 -0
- package/dist/frameworks.js.map +1 -0
- package/dist/guide-corpus-doctor.d.ts +24 -0
- package/dist/guide-corpus-doctor.d.ts.map +1 -0
- package/dist/guide-corpus-doctor.js +111 -0
- package/dist/guide-corpus-doctor.js.map +1 -0
- package/dist/hosting.d.ts +85 -0
- package/dist/hosting.d.ts.map +1 -0
- package/dist/hosting.js +136 -0
- package/dist/hosting.js.map +1 -0
- package/dist/index.d.ts +253 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11475 -0
- package/dist/index.js.map +1 -0
- package/dist/kit-doctor.d.ts +19 -0
- package/dist/kit-doctor.d.ts.map +1 -0
- package/dist/kit-doctor.js +255 -0
- package/dist/kit-doctor.js.map +1 -0
- package/dist/kit-install.d.ts +67 -0
- package/dist/kit-install.d.ts.map +1 -0
- package/dist/kit-install.js +409 -0
- package/dist/kit-install.js.map +1 -0
- package/dist/kit-manifest.d.ts +154 -0
- package/dist/kit-manifest.d.ts.map +1 -0
- package/dist/kit-manifest.js +252 -0
- package/dist/kit-manifest.js.map +1 -0
- package/dist/kit-registry.d.ts +42 -0
- package/dist/kit-registry.d.ts.map +1 -0
- package/dist/kit-registry.js +231 -0
- package/dist/kit-registry.js.map +1 -0
- package/dist/kit-spec.d.ts +37 -0
- package/dist/kit-spec.d.ts.map +1 -0
- package/dist/kit-spec.js +48 -0
- package/dist/kit-spec.js.map +1 -0
- package/dist/kit-state.d.ts +57 -0
- package/dist/kit-state.d.ts.map +1 -0
- package/dist/kit-state.js +31 -0
- package/dist/kit-state.js.map +1 -0
- package/dist/kits.d.ts +82 -0
- package/dist/kits.d.ts.map +1 -0
- package/dist/kits.js +255 -0
- package/dist/kits.js.map +1 -0
- package/dist/license-keys.d.ts +3 -0
- package/dist/license-keys.d.ts.map +1 -0
- package/dist/license-keys.js +10 -0
- package/dist/license-keys.js.map +1 -0
- package/dist/licensing.d.ts +269 -0
- package/dist/licensing.d.ts.map +1 -0
- package/dist/licensing.js +474 -0
- package/dist/licensing.js.map +1 -0
- package/dist/local-codex-relay.d.ts +19 -0
- package/dist/local-codex-relay.d.ts.map +1 -0
- package/dist/local-codex-relay.js +203 -0
- package/dist/local-codex-relay.js.map +1 -0
- package/dist/module-doctor.d.ts +35 -0
- package/dist/module-doctor.d.ts.map +1 -0
- package/dist/module-doctor.js +966 -0
- package/dist/module-doctor.js.map +1 -0
- package/dist/module-install.d.ts +71 -0
- package/dist/module-install.d.ts.map +1 -0
- package/dist/module-install.js +1133 -0
- package/dist/module-install.js.map +1 -0
- package/dist/module-manifest.d.ts +33 -0
- package/dist/module-manifest.d.ts.map +1 -0
- package/dist/module-manifest.js +301 -0
- package/dist/module-manifest.js.map +1 -0
- package/dist/module-state.d.ts +76 -0
- package/dist/module-state.d.ts.map +1 -0
- package/dist/module-state.js +162 -0
- package/dist/module-state.js.map +1 -0
- package/dist/modules.d.ts +52 -0
- package/dist/modules.d.ts.map +1 -0
- package/dist/modules.js +110 -0
- package/dist/modules.js.map +1 -0
- package/dist/palette-check.d.ts +42 -0
- package/dist/palette-check.d.ts.map +1 -0
- package/dist/palette-check.js +217 -0
- package/dist/palette-check.js.map +1 -0
- package/dist/palette-compile.d.ts +30 -0
- package/dist/palette-compile.d.ts.map +1 -0
- package/dist/palette-compile.js +149 -0
- package/dist/palette-compile.js.map +1 -0
- package/dist/pm.d.ts +11 -0
- package/dist/pm.d.ts.map +1 -0
- package/dist/pm.js +30 -0
- package/dist/pm.js.map +1 -0
- package/dist/project-local-codex-relay.d.ts +11 -0
- package/dist/project-local-codex-relay.d.ts.map +1 -0
- package/dist/project-local-codex-relay.js +95 -0
- package/dist/project-local-codex-relay.js.map +1 -0
- package/dist/shared.d.ts +4 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +38 -0
- package/dist/shared.js.map +1 -0
- package/dist/shell-match.d.ts +29 -0
- package/dist/shell-match.d.ts.map +1 -0
- package/dist/shell-match.js +160 -0
- package/dist/shell-match.js.map +1 -0
- package/dist/template-doctor.d.ts +40 -0
- package/dist/template-doctor.d.ts.map +1 -0
- package/dist/template-doctor.js +722 -0
- package/dist/template-doctor.js.map +1 -0
- package/dist/template-install.d.ts +135 -0
- package/dist/template-install.d.ts.map +1 -0
- package/dist/template-install.js +1311 -0
- package/dist/template-install.js.map +1 -0
- package/dist/template-manifest.d.ts +328 -0
- package/dist/template-manifest.d.ts.map +1 -0
- package/dist/template-manifest.js +533 -0
- package/dist/template-manifest.js.map +1 -0
- package/dist/template-registry.d.ts +76 -0
- package/dist/template-registry.d.ts.map +1 -0
- package/dist/template-registry.js +365 -0
- package/dist/template-registry.js.map +1 -0
- package/dist/template-spec.d.ts +24 -0
- package/dist/template-spec.d.ts.map +1 -0
- package/dist/template-spec.js +38 -0
- package/dist/template-spec.js.map +1 -0
- package/dist/template-state.d.ts +108 -0
- package/dist/template-state.d.ts.map +1 -0
- package/dist/template-state.js +93 -0
- package/dist/template-state.js.map +1 -0
- package/dist/templates.d.ts +123 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +541 -0
- package/dist/templates.js.map +1 -0
- package/dist/theme-match.d.ts +41 -0
- package/dist/theme-match.d.ts.map +1 -0
- package/dist/theme-match.js +92 -0
- package/dist/theme-match.js.map +1 -0
- package/dist/wrangler-secrets.d.ts +15 -0
- package/dist/wrangler-secrets.d.ts.map +1 -0
- package/dist/wrangler-secrets.js +97 -0
- package/dist/wrangler-secrets.js.map +1 -0
- package/kits/datasheet-grid/file-manifest.json +65 -0
- package/kits/datasheet-grid/files/AGENTS.md +6 -0
- package/kits/datasheet-grid/files/docs/datasheet-grid.md +15 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/DatasheetGridRoute.tsx +35 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/README.md +10 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-adapter.ts +30 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-metadata.ts +19 -0
- package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-state.ts +24 -0
- package/kits/datasheet-grid/files/kit.json +119 -0
- package/kits/datasheet-grid/files/skills/datasheet-grid/SKILL.md +16 -0
- package/kits/datasheet-grid/files/tests/datasheet-grid.test.ts +15 -0
- package/kits/datasheet-grid/kit.json +146 -0
- package/kits/index.json +71 -0
- package/kits/resend-email/file-manifest.json +47 -0
- package/kits/resend-email/files/AGENTS.md +7 -0
- package/kits/resend-email/files/docs/resend-email.md +13 -0
- package/kits/resend-email/files/files/src/kits/resend-email/README.md +17 -0
- package/kits/resend-email/files/files/src/kits/resend-email/send-email.ts +44 -0
- package/kits/resend-email/files/kit.json +128 -0
- package/kits/resend-email/files/skills/resend-email/SKILL.md +20 -0
- package/kits/resend-email/files/tests/resend-email.test.ts +54 -0
- package/kits/resend-email/kit.json +159 -0
- package/modules/docs/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/modules/docs/templates/astro-emdash/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/index.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
- package/modules/docs/templates/astro-emdash/site/src/styles-docs.css +3 -0
- package/modules/docs/templates/astro-emdash/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/styles-docs.css +3 -0
- package/modules/docs/templates/react-router/app/components/mdx.tsx +79 -0
- package/modules/docs/templates/react-router/app/lib/layout.shared.tsx +54 -0
- package/modules/docs/templates/react-router/app/lib/source.ts +7 -0
- package/modules/docs/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/modules/docs/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/modules/docs/templates/react-router/app/routes/docs.tsx +13 -0
- package/modules/docs/templates/react-router/content/docs/getting-started.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/index.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/react-router/content/docs/meta.json +4 -0
- package/modules/docs/templates/react-router/source.config.ts +5 -0
- package/modules/docs/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
- package/modules/docs/templates/tanstack-start/content/docs/index.mdx +8 -0
- package/modules/docs/templates/tanstack-start/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/tanstack-start/content/docs/meta.json +4 -0
- package/modules/docs/templates/tanstack-start/source.config.ts +10 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/tanstack-start/src/docs/source.ts +7 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/styles-docs.css +3 -0
- package/modules/guide/templates/astro-emdash/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/astro-emdash/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/astro-emdash/src/guide/actions.ts +8 -0
- package/modules/guide/templates/astro-emdash/src/guide/config.ts +21 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/app/components/guide-widget.tsx +29 -0
- package/modules/guide/templates/react-router/app/guide/actions.ts +3 -0
- package/modules/guide/templates/react-router/app/guide/config.ts +21 -0
- package/modules/guide/templates/react-router/app/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/react-router/app/guide/corpus.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/content/guide/capability-map.md +13 -0
- package/modules/guide/templates/tanstack-start/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/tanstack-start/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/tanstack-start/src/guide/actions.ts +17 -0
- package/modules/guide/templates/tanstack-start/src/guide/config.ts +21 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/resources.json +4 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/astro-emdash/src/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/react-router/app/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/tanstack-start/src/openai-subscription.ts +11 -0
- package/package.json +34 -8
- package/README.md +0 -3
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Check, ChevronDown, Copy, ExternalLink, FileText, Sparkles } from "lucide-react";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
|
|
4
|
+
interface DocsPageActionsProps {
|
|
5
|
+
markdownUrl: string;
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function DocsPageActions(props: DocsPageActionsProps) {
|
|
10
|
+
const [copyState, setCopyState] = useState<"idle" | "copying" | "copied" | "failed">("idle");
|
|
11
|
+
const [open, setOpen] = useState(false);
|
|
12
|
+
const [origin, setOrigin] = useState("");
|
|
13
|
+
const menuRef = useRef<HTMLDivElement>(null);
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
setOrigin(window.location.origin);
|
|
17
|
+
}, []);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!open) return;
|
|
21
|
+
|
|
22
|
+
function onPointerDown(event: PointerEvent) {
|
|
23
|
+
if (!menuRef.current?.contains(event.target as Node)) {
|
|
24
|
+
setOpen(false);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
29
|
+
if (event.key === "Escape") {
|
|
30
|
+
setOpen(false);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
35
|
+
document.addEventListener("keydown", onKeyDown);
|
|
36
|
+
|
|
37
|
+
return () => {
|
|
38
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
39
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
40
|
+
};
|
|
41
|
+
}, [open]);
|
|
42
|
+
|
|
43
|
+
const absoluteMarkdownUrl = useMemo(() => {
|
|
44
|
+
if (!origin) return props.markdownUrl;
|
|
45
|
+
return new URL(props.markdownUrl, origin).toString();
|
|
46
|
+
}, [origin, props.markdownUrl]);
|
|
47
|
+
|
|
48
|
+
const aiPrompt = useMemo(() => {
|
|
49
|
+
return `Read this documentation page and help me use it:\n\n${absoluteMarkdownUrl}`;
|
|
50
|
+
}, [absoluteMarkdownUrl]);
|
|
51
|
+
|
|
52
|
+
const options = [
|
|
53
|
+
{
|
|
54
|
+
label: "View as Markdown",
|
|
55
|
+
href: props.markdownUrl,
|
|
56
|
+
icon: FileText
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: "Open in ChatGPT",
|
|
60
|
+
href: `https://chatgpt.com/?q=${encodeURIComponent(aiPrompt)}`,
|
|
61
|
+
icon: Sparkles
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "Open in Claude",
|
|
65
|
+
href: `https://claude.ai/new?q=${encodeURIComponent(aiPrompt)}`,
|
|
66
|
+
icon: Sparkles
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const copyLabel = {
|
|
71
|
+
idle: "Copy as Markdown",
|
|
72
|
+
copying: "Copying",
|
|
73
|
+
copied: "Copied",
|
|
74
|
+
failed: "Copy failed"
|
|
75
|
+
}[copyState];
|
|
76
|
+
|
|
77
|
+
async function copyMarkdown() {
|
|
78
|
+
setCopyState("copying");
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
const response = await fetch(props.markdownUrl);
|
|
82
|
+
|
|
83
|
+
if (!response.ok) {
|
|
84
|
+
throw new Error(`Failed to load Markdown for ${props.title}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
await navigator.clipboard.writeText(await response.text());
|
|
88
|
+
setCopyState("copied");
|
|
89
|
+
} catch {
|
|
90
|
+
setCopyState("failed");
|
|
91
|
+
} finally {
|
|
92
|
+
window.setTimeout(() => setCopyState("idle"), 1600);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<div className="not-prose my-6 flex flex-wrap items-center gap-2 border-y border-fd-border/70 py-3 text-sm">
|
|
98
|
+
<button
|
|
99
|
+
className="inline-flex h-9 items-center gap-2 rounded-md border border-fd-border bg-fd-background px-3 font-medium text-fd-foreground shadow-xs transition hover:bg-fd-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring"
|
|
100
|
+
disabled={copyState === "copying"}
|
|
101
|
+
type="button"
|
|
102
|
+
onClick={() => void copyMarkdown()}
|
|
103
|
+
>
|
|
104
|
+
{copyState === "copied" ? <Check className="size-4" aria-hidden="true" /> : <Copy className="size-4" aria-hidden="true" />}
|
|
105
|
+
{copyLabel}
|
|
106
|
+
</button>
|
|
107
|
+
|
|
108
|
+
<div className="relative" ref={menuRef}>
|
|
109
|
+
<button
|
|
110
|
+
aria-expanded={open}
|
|
111
|
+
aria-haspopup="menu"
|
|
112
|
+
className="inline-flex h-9 items-center gap-2 rounded-md border border-fd-border bg-fd-background px-3 font-medium text-fd-foreground shadow-xs transition hover:bg-fd-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring"
|
|
113
|
+
type="button"
|
|
114
|
+
onClick={() => setOpen((value) => !value)}
|
|
115
|
+
>
|
|
116
|
+
Open
|
|
117
|
+
<ChevronDown className="size-4 text-fd-muted-foreground" aria-hidden="true" />
|
|
118
|
+
</button>
|
|
119
|
+
|
|
120
|
+
{open ? (
|
|
121
|
+
<div className="absolute left-0 top-10 z-20 w-56 overflow-hidden rounded-md border border-fd-border bg-fd-popover p-1 text-fd-popover-foreground shadow-lg" role="menu">
|
|
122
|
+
{options.map((option) => {
|
|
123
|
+
const Icon = option.icon;
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<a
|
|
127
|
+
className="flex min-h-9 items-center gap-2 rounded-sm px-2.5 py-2 text-sm outline-none transition hover:bg-fd-muted focus-visible:bg-fd-muted"
|
|
128
|
+
href={option.href}
|
|
129
|
+
key={option.label}
|
|
130
|
+
onClick={() => setOpen(false)}
|
|
131
|
+
rel="noreferrer"
|
|
132
|
+
role="menuitem"
|
|
133
|
+
target="_blank"
|
|
134
|
+
>
|
|
135
|
+
<Icon className="size-4 text-fd-muted-foreground" aria-hidden="true" />
|
|
136
|
+
<span className="min-w-0 flex-1 truncate">{option.label}</span>
|
|
137
|
+
<ExternalLink className="size-3.5 text-fd-muted-foreground" aria-hidden="true" />
|
|
138
|
+
</a>
|
|
139
|
+
);
|
|
140
|
+
})}
|
|
141
|
+
</div>
|
|
142
|
+
) : null}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import browserCollections from "collections/browser";
|
|
2
|
+
import { FrameworkProvider } from "fumadocs-core/framework";
|
|
3
|
+
import { useFumadocsLoader, type SerializedPageTree } from "fumadocs-core/source/client";
|
|
4
|
+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
5
|
+
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/layouts/docs/page";
|
|
6
|
+
import { RootProvider } from "fumadocs-ui/provider/base";
|
|
7
|
+
import { DocsPageActions } from "./docs-page-actions";
|
|
8
|
+
import { baseOptions } from "./docs-layout";
|
|
9
|
+
import { getMDXComponents } from "./docs-mdx";
|
|
10
|
+
|
|
11
|
+
export type DocsPageData = {
|
|
12
|
+
path: string;
|
|
13
|
+
url: string;
|
|
14
|
+
title: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
pageTree: SerializedPageTree;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const clientLoader = browserCollections.docs.createClientLoader({
|
|
20
|
+
component({ toc, frontmatter, default: MDX }) {
|
|
21
|
+
const pageUrl = currentDocsData.url.replace(/\/$/, "") || "/docs";
|
|
22
|
+
const markdownUrl = pageUrl === "/docs" ? "/docs/index.md" : `${pageUrl}.md`;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<DocsPage toc={toc}>
|
|
26
|
+
<DocsTitle>{frontmatter.title}</DocsTitle>
|
|
27
|
+
<DocsDescription>{frontmatter.description}</DocsDescription>
|
|
28
|
+
<DocsPageActions markdownUrl={markdownUrl} title={frontmatter.title} />
|
|
29
|
+
<DocsBody>
|
|
30
|
+
<MDX components={getMDXComponents()} />
|
|
31
|
+
</DocsBody>
|
|
32
|
+
</DocsPage>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
let currentDocsData: { url: string } = { url: "/docs" };
|
|
38
|
+
|
|
39
|
+
export async function preloadDocsContent(data: DocsPageData): Promise<void> {
|
|
40
|
+
currentDocsData = data;
|
|
41
|
+
await clientLoader.preload(data.path);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function DocsRoot({ data }: { data: DocsPageData }) {
|
|
45
|
+
currentDocsData = data;
|
|
46
|
+
const loaderData = useFumadocsLoader(data);
|
|
47
|
+
const content = clientLoader.useContent(loaderData.path);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<FrameworkProvider
|
|
51
|
+
Link={({ href, prefetch: _prefetch, ...props }) => <a href={href} {...props} />}
|
|
52
|
+
useParams={() => ({})}
|
|
53
|
+
usePathname={() => currentDocsData.url}
|
|
54
|
+
useRouter={() => ({
|
|
55
|
+
push(url) {
|
|
56
|
+
if (typeof window !== "undefined") window.location.href = url;
|
|
57
|
+
},
|
|
58
|
+
refresh() {
|
|
59
|
+
if (typeof window !== "undefined") window.location.reload();
|
|
60
|
+
}
|
|
61
|
+
})}
|
|
62
|
+
>
|
|
63
|
+
<RootProvider search={{ options: { api: "/docs/api/search" } }}>
|
|
64
|
+
<DocsLayout {...baseOptions()} tree={loaderData.pageTree}>
|
|
65
|
+
{content}
|
|
66
|
+
</DocsLayout>
|
|
67
|
+
</RootProvider>
|
|
68
|
+
</FrameworkProvider>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { source } from "./source";
|
|
2
|
+
|
|
3
|
+
type DocsPage = ReturnType<typeof source.getPage>;
|
|
4
|
+
|
|
5
|
+
export async function getDocsMarkdownResponse(path: string | null) {
|
|
6
|
+
const page = source.getPage(getDocsSlugs(path));
|
|
7
|
+
|
|
8
|
+
if (!page) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return markdownResponse(await getLLMText(page));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function getLLMText(page: NonNullable<DocsPage>) {
|
|
16
|
+
const markdown = renderRuntimeMdxPlaceholders((await page.data.getText("processed")) ?? "");
|
|
17
|
+
|
|
18
|
+
return `# ${page.data.title} (${page.url})\n\n${markdown}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function renderRuntimeMdxPlaceholders(markdown: string) {
|
|
22
|
+
return markdown
|
|
23
|
+
.replace(/<McpServerUrl(Block)?([^>]*)\/>/g, (_match, block: string | undefined, attrs: string) => {
|
|
24
|
+
const value = `[current-app-origin]${mdxStringAttribute(attrs, "path") ?? "/mcp"}`;
|
|
25
|
+
return block ? `\`\`\`text\n${value}\n\`\`\`` : `\`${value}\``;
|
|
26
|
+
})
|
|
27
|
+
.replace(/<ClaudeMcpAddCommand([^>]*)\/>/g, (_match, attrs: string) => {
|
|
28
|
+
const path = mdxStringAttribute(attrs, "path") ?? "/mcp";
|
|
29
|
+
const name = mdxStringAttribute(attrs, "name") ?? "this-app";
|
|
30
|
+
return `\`\`\`bash\nclaude mcp add --transport http ${name} "[current-app-origin]${path}"\n\`\`\``;
|
|
31
|
+
})
|
|
32
|
+
.replace(/<CodexMcpAddCommand([^>]*)\/>/g, (_match, attrs: string) => {
|
|
33
|
+
const path = mdxStringAttribute(attrs, "path") ?? "/mcp";
|
|
34
|
+
const name = mdxStringAttribute(attrs, "name") ?? "this-app";
|
|
35
|
+
return `\`\`\`bash\ncodex mcp add ${name} --url "[current-app-origin]${path}"\n\`\`\``;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function mdxStringAttribute(attrs: string, name: string) {
|
|
40
|
+
const match = attrs.match(new RegExp(`\\b${name}="([^"]*)"`));
|
|
41
|
+
return match?.[1] ?? null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function markdownResponse(markdown: string) {
|
|
45
|
+
return new Response(markdown, {
|
|
46
|
+
headers: {
|
|
47
|
+
"content-type": "text/markdown; charset=utf-8"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function getDocsSlugs(path: string | null) {
|
|
53
|
+
const pathname = path?.trim() || "/docs";
|
|
54
|
+
const withoutBase = pathname
|
|
55
|
+
.replace(/\.mdx?$/, "")
|
|
56
|
+
.replace(/^\/docs(?:\/|$)/, "")
|
|
57
|
+
.replace(/^\/+|\/+$/g, "");
|
|
58
|
+
const withoutIndex = withoutBase === "index" ? "" : withoutBase.replace(/\/index$/, "");
|
|
59
|
+
|
|
60
|
+
return withoutIndex ? withoutIndex.split("/").filter(Boolean) : [];
|
|
61
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/docs/$")({
|
|
5
|
+
server: {
|
|
6
|
+
handlers: {
|
|
7
|
+
GET: async ({ request }) => {
|
|
8
|
+
const { handleDocsRequest } = await import("../../docs/docs-handler");
|
|
9
|
+
return handleDocsRequest(request);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
component: DocumentNavigationFallback
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
function DocumentNavigationFallback() {
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
window.location.assign(window.location.href);
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
export const Route = createFileRoute("/docs/api/markdown")({
|
|
4
|
+
server: {
|
|
5
|
+
handlers: {
|
|
6
|
+
GET: async ({ request }) => {
|
|
7
|
+
const { handleDocsRequest } = await import("../../../docs/docs-handler");
|
|
8
|
+
return handleDocsRequest(request);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
export const Route = createFileRoute("/docs/api/search")({
|
|
4
|
+
server: {
|
|
5
|
+
handlers: {
|
|
6
|
+
GET: async ({ request }) => {
|
|
7
|
+
const { handleDocsRequest } = await import("../../../docs/docs-handler");
|
|
8
|
+
return handleDocsRequest(request);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/docs/")({
|
|
5
|
+
server: {
|
|
6
|
+
handlers: {
|
|
7
|
+
GET: async ({ request }) => {
|
|
8
|
+
const { handleDocsRequest } = await import("../docs/docs-handler");
|
|
9
|
+
return handleDocsRequest(request);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
component: DocumentNavigationFallback
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
function DocumentNavigationFallback() {
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
window.location.assign(window.location.href);
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/docs")({
|
|
5
|
+
server: {
|
|
6
|
+
handlers: {
|
|
7
|
+
GET: async ({ request }) => {
|
|
8
|
+
const { handleDocsRequest } = await import("../docs/docs-handler");
|
|
9
|
+
return handleDocsRequest(request);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
component: DocumentNavigationFallback
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
function DocumentNavigationFallback() {
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
window.location.assign(window.location.href);
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: What Guide can do in this app
|
|
3
|
+
guideContext: app-capability-map
|
|
4
|
+
public: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Guide should answer from the checked-in app docs, help knowledge, and explicit Agent actions registered by the app.
|
|
8
|
+
|
|
9
|
+
It can explain where to go, how common site editing workflows work, what the current user is allowed to do, and which tasks it can help perform.
|
|
10
|
+
|
|
11
|
+
For the Astro/EmDash starter, Guide should help editors open the CMS, find pages, edit reusable sections, preview changes, publish safely, connect approved assistants, and know when to ask the project maintainer for a new page section or layout.
|
|
12
|
+
|
|
13
|
+
Guide should not claim it can publish, delete, or restructure content unless the app registers an explicit action for that task.
|
|
14
|
+
|
|
15
|
+
When the app registers Agent actions, Guide may use those actions only after the user clearly asks and the action policy allows it. If no action is registered for a task, it can explain the workflow but should not claim it can perform the task.
|
|
16
|
+
|
|
17
|
+
Guide should not expose raw tool names, internal errors, JSON, SQL, source-code details, platform settings, or implementation jargon. If context is missing or a tool fails, it should respond plainly, offer a useful next step, and ask one clarifying question only when needed.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useRouter } from "@tanstack/react-router";
|
|
2
|
+
import { RaybaseAgentWidget } from "@raybase/agent-ui";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { guideConfig } from "../guide/config";
|
|
5
|
+
|
|
6
|
+
export function GuideWidget() {
|
|
7
|
+
const router = useRouter();
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const refreshData = () => {
|
|
11
|
+
void router.invalidate();
|
|
12
|
+
};
|
|
13
|
+
window.addEventListener("raybase:data-changed", refreshData);
|
|
14
|
+
return () => window.removeEventListener("raybase:data-changed", refreshData);
|
|
15
|
+
}, [router]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<RaybaseAgentWidget
|
|
19
|
+
agentName={guideConfig.agent?.name ?? "guide"}
|
|
20
|
+
enabled={guideConfig.enabled ?? true}
|
|
21
|
+
isSurfaceEnabled={isGuideSurfaceEnabled}
|
|
22
|
+
resolveSurface={resolveGuideSurface}
|
|
23
|
+
title={guideConfig.agent?.title ?? "Guide"}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type GuideSurface = "app" | "docs";
|
|
29
|
+
|
|
30
|
+
function resolveGuideSurface(route: string): GuideSurface {
|
|
31
|
+
return route.startsWith("/docs") ? "docs" : "app";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function isGuideSurfaceEnabled(surface: string): boolean {
|
|
35
|
+
if (!isGuideSurface(surface)) return false;
|
|
36
|
+
return guideConfig.surfaces?.[surface]?.enabled ?? surface === "app";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isGuideSurface(surface: string): surface is GuideSurface {
|
|
40
|
+
return surface === "app" || surface === "docs";
|
|
41
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RaybaseAction } from "@raybase/core/actions";
|
|
2
|
+
import type { RaybaseEnv } from "@raybase/core/worker";
|
|
3
|
+
import { actions } from "../actions";
|
|
4
|
+
|
|
5
|
+
// Keep Guide on a narrow allow-list of app-declared actions.
|
|
6
|
+
export const guideActions = [
|
|
7
|
+
actions.contentSiteSnapshot
|
|
8
|
+
] satisfies Array<RaybaseAction<any, any, RaybaseEnv>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GuideConfig } from "@raybase/guide";
|
|
2
|
+
|
|
3
|
+
export const guideConfig = {
|
|
4
|
+
enabled: true,
|
|
5
|
+
surfaces: {
|
|
6
|
+
app: { enabled: true, audience: "signed-in" },
|
|
7
|
+
docs: { enabled: true, audience: "signed-in" }
|
|
8
|
+
},
|
|
9
|
+
agent: {
|
|
10
|
+
name: "guide",
|
|
11
|
+
title: "Guide"
|
|
12
|
+
},
|
|
13
|
+
limits: {
|
|
14
|
+
publicIpHourlyRequests: 20,
|
|
15
|
+
publicIpHourlyOutputTokens: 12000,
|
|
16
|
+
publicDailyRequests: 200,
|
|
17
|
+
publicDailyOutputTokens: 60000,
|
|
18
|
+
signedInDailyRequests: 50,
|
|
19
|
+
maxCorpusSnippets: 8
|
|
20
|
+
}
|
|
21
|
+
} satisfies GuideConfig;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"generatedAt": "2026-11-14T04:05:39.782Z",
|
|
4
|
+
"sources": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "docs",
|
|
7
|
+
"path": "content/docs"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"documents": [
|
|
11
|
+
{
|
|
12
|
+
"id": "docs:content/docs:getting-started.mdx",
|
|
13
|
+
"title": "Opening the CMS",
|
|
14
|
+
"source": "docs",
|
|
15
|
+
"text": "Sign in with the account your team gave you, then open the public site and choose CMS from the signed in menu. Start with Pages. Open an existing draft to review the editing pattern, or create a page when you need a new public URL. Use the page content field to arrange reusable sections. Each section owns its own copy, media, links, and display options. Preview before publishing. If a page needs a new reusable section or a layout change, note the goal clearly and ask the project maintainer to add the building block. Local time travel In local development, use the fixed dev chrome or POST /api/dev/time with \"now\":\"2030 08 12T09:00:00.000Z\" to move the application clock. GET /api/dev/time reports virtual and real time; \"reset\":true returns to wall time. Forward jumps start bounded catch up for Jobs, Agent schedules, wakes, and follow ups. Repeating schedules coalesce to one run, while one shot work drains without waiting for the HTTP response. Auth, leases, retries, tokens, provider calls, and diagnostics remain on real time. Moving backward or resetting does not rewrite future dated rows; reset and reseed when a QA scenario crosses that edge. Local tooling can restore the spine's base world with POST /api/dev/seed and \"reset\":true or apply one named variant with \"variant\":\"empty spine\" . Reset is destructive for spine app tables; use sequential calls to layer variants, and use restore after time travel leaves future dated rows. Content site demo data remains owned by site/ . GET /api/dev/manifest serves the same validated manifestVersion: 1 checkpoint written to .raybase/app.manifest.json at dev startup. Route sources use project relative POSIX paths. Restart raybase dev after changing routes or declarations. The endpoint is local only.",
|
|
16
|
+
"url": "/docs/getting-started",
|
|
17
|
+
"routePatterns": [
|
|
18
|
+
"/docs/getting-started",
|
|
19
|
+
"/docs/getting-started/*"
|
|
20
|
+
],
|
|
21
|
+
"public": false,
|
|
22
|
+
"guideContext": null,
|
|
23
|
+
"updatedAt": "2026-11-14T04:05:26.116Z",
|
|
24
|
+
"hash": "sha256:6aec1b2e381585c532b62df227dd807aef7dbf91fe71d1f804a05e7793ce36ae"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "docs:content/docs:index.mdx",
|
|
28
|
+
"title": "Editing the site",
|
|
29
|
+
"source": "docs",
|
|
30
|
+
"text": "The CMS is where signed in editors manage public site pages, drafts, media, and reusable page sections. Use the CMS link in the signed in site menu to open the editing workspace. If the link is not visible, ask the person who manages access to invite you or adjust your role. Most pages are built from a title, slug, metadata, and a sequence of reusable sections. Edit copy and media in the CMS, preview changes, then publish when the page is ready. Keep structural changes deliberate. If you need a new section type, navigation pattern, layout, or data backed block, ask the project maintainer to add it safely.",
|
|
31
|
+
"url": "/docs",
|
|
32
|
+
"routePatterns": [
|
|
33
|
+
"/docs",
|
|
34
|
+
"/docs/*"
|
|
35
|
+
],
|
|
36
|
+
"public": false,
|
|
37
|
+
"guideContext": null,
|
|
38
|
+
"updatedAt": "2026-11-14T04:05:26.115Z",
|
|
39
|
+
"hash": "sha256:cee1dfcd47c0cc800581e7557c206d725f783ebcab122825455ada421faf13b4"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "docs:content/docs:mcp.mdx",
|
|
43
|
+
"title": "Connecting an assistant",
|
|
44
|
+
"source": "docs",
|
|
45
|
+
"text": "Some apps let signed in members connect an approved AI assistant through the app's /mcp endpoint. Only connect assistants you trust. The assistant should explain what it can read or change before you approve a task. If the connection fails, confirm you are signed in and ask the project maintainer whether assistant access is enabled for your role.",
|
|
46
|
+
"url": "/docs/mcp",
|
|
47
|
+
"routePatterns": [
|
|
48
|
+
"/docs/mcp",
|
|
49
|
+
"/docs/mcp/*"
|
|
50
|
+
],
|
|
51
|
+
"public": false,
|
|
52
|
+
"guideContext": null,
|
|
53
|
+
"updatedAt": "2026-11-14T04:05:26.116Z",
|
|
54
|
+
"hash": "sha256:9b7a64f4ce851af9f6664b4de67c6d92c4770228e76f06b3916f050d4b2f6467"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "docs:content/docs:site-templates.mdx",
|
|
58
|
+
"title": "Reusable sections",
|
|
59
|
+
"source": "docs",
|
|
60
|
+
"text": "Templates are reusable Liquid templates for the public content site. Use them when a template fits the page section, layout, or page starter you need and the result should stay editable in the CMS. Discovery works from any directory: Installed templates are staged under site/seed/templates/ / : template.json is the draft Galley template payload. sample content.json carries registry sample data for review. page starters are Liquid templates that compose their sections with % render % tags; they also stage a page seed under site/seed/pages/ .json that points the page's design field at the starter. optional behavior sidecars are copied beside the staged payload when a template declares one. provenance.json records source URLs, generated hashes, dependencies, bindings, and install choices. Packs that read an EmDash collection through galley.dataSources use their manifest default collection when one is declared. Override or provide a required collection with bind : Theme manifests group a family's voice and vocabulary: palettes, sections, and page starter choices. A theme install stages the required dependencies plus the choices you select: palette is required when a theme lists more than one palette. page stages an EmDash page from a theme page starter key or exact template id. Use all optional only when you intentionally want every optional dependency staged. The site's structure is a shell: a layout with its welded nav and footer, selected by the site plan's capacity needs rather than by theme membership. raybase templates shell match nav items 5 footer links 12 theme raybase/lumen studio filters shells that fit and ranks them by voice fit. For one page sites, add anchor to filter to anchor tuned brand bar shells ( nav items 0 is valid — the logo block still renders at zero links). Then stage the chosen shell: activate stages an ephemeral activation.json work order beside the selected layout; during apply, selected templates are published, the active Galley layout pointer (and palette) is updated in the app database, and the work order is deleted. With the Astro/EmDash dev server running, apply staged templates: Without activate , templates are installed as draft templates. Structural pages point their design field at a page starter template; prose pages keep Portable Text in pages.content , where inline galley.block or galley.shared embeds are still supported. With shell add activate , templates:apply publishes the selected shell and section templates, upserts staged page seeds, and activates the layout for public rendering. Review staged JSON before apply and commit .raybase/templates.json , site/seed/templates/ , and site/seed/pages/ . The visual editor edits copy, fields, rich text, and Portable Text content. Page structure lives in Liquid: page starters compose sections with % render % tags, and structural changes remain agent/code work in Galley templates, resolved by installation (bare template ids, no per reference version pins).",
|
|
61
|
+
"url": "/docs/site-templates",
|
|
62
|
+
"routePatterns": [
|
|
63
|
+
"/docs/site-templates",
|
|
64
|
+
"/docs/site-templates/*"
|
|
65
|
+
],
|
|
66
|
+
"public": false,
|
|
67
|
+
"guideContext": null,
|
|
68
|
+
"updatedAt": "2026-11-14T04:05:26.116Z",
|
|
69
|
+
"hash": "sha256:9799eff846de2718833130cbdeda6309a584705c1a536fbe95647c7596fef05f"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RaybaseAgentWidget } from "@raybase/agent-ui";
|
|
2
|
+
import { guideConfig } from "../guide/config";
|
|
3
|
+
|
|
4
|
+
export function GuideWidget() {
|
|
5
|
+
return (
|
|
6
|
+
<RaybaseAgentWidget
|
|
7
|
+
agentName={guideConfig.agent?.name ?? "guide"}
|
|
8
|
+
enabled={guideConfig.enabled ?? true}
|
|
9
|
+
isSurfaceEnabled={isGuideSurfaceEnabled}
|
|
10
|
+
resolveSurface={resolveGuideSurface}
|
|
11
|
+
title={guideConfig.agent?.title ?? "Guide"}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type GuideSurface = "app" | "docs";
|
|
17
|
+
|
|
18
|
+
function resolveGuideSurface(route: string): GuideSurface {
|
|
19
|
+
return route.startsWith("/docs") ? "docs" : "app";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function isGuideSurfaceEnabled(surface: string): boolean {
|
|
23
|
+
if (!isGuideSurface(surface)) return false;
|
|
24
|
+
return guideConfig.surfaces?.[surface]?.enabled ?? surface === "app";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function isGuideSurface(surface: string): surface is GuideSurface {
|
|
28
|
+
return surface === "app" || surface === "docs";
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GuideConfig } from "@raybase/guide";
|
|
2
|
+
|
|
3
|
+
export const guideConfig = {
|
|
4
|
+
enabled: true,
|
|
5
|
+
surfaces: {
|
|
6
|
+
app: { enabled: true, audience: "signed-in" },
|
|
7
|
+
docs: { enabled: true, audience: "signed-in" }
|
|
8
|
+
},
|
|
9
|
+
agent: {
|
|
10
|
+
name: "guide",
|
|
11
|
+
title: "Guide"
|
|
12
|
+
},
|
|
13
|
+
limits: {
|
|
14
|
+
publicIpHourlyRequests: 20,
|
|
15
|
+
publicIpHourlyOutputTokens: 12000,
|
|
16
|
+
publicDailyRequests: 200,
|
|
17
|
+
publicDailyOutputTokens: 60000,
|
|
18
|
+
signedInDailyRequests: 50,
|
|
19
|
+
maxCorpusSnippets: 8
|
|
20
|
+
}
|
|
21
|
+
} satisfies GuideConfig;
|