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
6 changes: 5 additions & 1 deletion .cursor/rules/overview.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ This is the technical documentation for the Agentuity Cloud, which covers:
- Examples, tutorials, samples (/content/Examples)
- And the different SDKs (/content/SDKs)

This doc app is a NextJS app built on top of Fumadocs (https://fumadocs.vercel.app/docs/ui).
This doc app is a NextJS app built on top of Fumadocs (https://fumadocs.vercel.app/docs/ui).

This project also contains the agent the powers RAG and Tutorials. Those agents live in `/agent-docs` directory.
To run the agent server locally, go into that directory with `cd agent-docs` and then start the agent with `agentuity dev`.
To run the NextJS app, do `npm run dev` in the root of this repository. You will want to start these two apps in separate repositories.
69 changes: 69 additions & 0 deletions .cursor/rules/tutorials-structure.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
### Rule: tutorials-structure

Purpose: Define how tutorials are authored and rendered so docs and runnable code stay in sync.

### Structure
- Narrative pages: `content/Tutorial/<tutorial-id>/step-<n>.mdx`
- Section navigation: `content/Tutorial/meta.json` (list MDX page slugs in order)
- Runnable example project: `examples/<tutorial-id>/` (full project; exclude `node_modules/`, `.uv/`)
- Tutorial code snippets: must be imported from files via `<CodeFromFiles />`
- Other, non-project examples: use regular fenced code blocks in MDX

### MDX authoring
- Each step MDX must use frontmatter:
- `title`, `description` (recommended: `stepNumber`, `next`, `prev`)
- Import real code from the example project using repo-root-relative paths via `<CodeFromFiles />`:

```mdx
---
title: Step 1 — Getting Started
description: Intro step
---

<!-- Single snippet -->
<CodeFromFiles snippets={[{ path: "/examples/javascript-sdk/src/agent.ts", lang: "ts", title: "agent.ts" }]} />

<!-- Line range -->
<CodeFromFiles snippets={[{ path: "/examples/javascript-sdk/src/agent.ts", lang: "ts", from: 12, to: 48, title: "Handler section" }]} />

<!-- Multi-language tabs -->
<CodeFromFiles snippets={[
{ path: "/examples/javascript-sdk/src/agent.ts", lang: "ts", title: "TypeScript" },
{ path: "/examples/javascript-sdk-python/src/agent.py", lang: "python", title: "Python" },
]} title="Agent comparison" />
```

### `<CodeFromFiles />` component
- Available in MDX via the docs page components map
- Props:
- `snippets`: array of `{ path, lang?, from?, to?, title? }`
- `path`: repo-root-relative (must start with `/`), validated and read server-side
- `lang`: language for highlighting (auto-inferred if omitted)
- `from`, `to`: 1-based line range (inclusive)
- `title`: label per tab
- `title` (optional): heading displayed above the tabs
- Renders using shared `CodeBlock` styling and `Tabs` for multiple snippets

### Example project conventions (`examples/<tutorial-id>/`)
- Include: `package.json`, `tsconfig.json`, `src/**`, optional `README.md`, optional lockfile
- Exclude: `node_modules/`
- Optional hygiene:
- Add `examples/**` to `.eslintignore` if you don’t want repo-wide linting on example sources
- Add `examples/**` to root `tsconfig.json` `exclude` if you don’t want repo-wide type-checks
- Should be runnable in a sandbox (StackBlitz/CodeSandbox) via `package.json` scripts

### Rendering pipeline
- Fumadocs loads MDX via `lib/source.ts` and `app/(docs)/[[...slug]]/page.tsx`
- `<CodeFromFiles />` reads files at build/server time and renders with `CodeBlock`


### Agent compatibility (optional)
- Step API: `GET /api/tutorials/:id/steps/:stepNumber` returns `{ mdx, snippets }`.
- The chat UI replaces each `<CodeFromFiles />` occurrence with one or more fenced code blocks by consuming entries from `snippets` in order.

### Quality gates (recommended)
- CI verifies:
- All `content/Tutorial/**.mdx` pages referenced by `content/Tutorial/meta.json` build without errors
- All `<CodeFromFiles snippets={[...]}/>` references resolve to existing files
- Optional: the example project type-checks (`tsc --noEmit`) or passes a smoke test

5 changes: 2 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Agent Configuration
AGENT_BASE_URL=http://127.0.0.1:3500
AGENT_ID=agent_9ccc5545e93644bd9d7954e632a55a61

# Alternative: You can also set the full URL instead of BASE_URL + ID
# AGENT_FULL_URL=http://127.0.0.1:3500/agent_9ccc5545e93644bd9d7954e632a55a61
# API key can be found in agent-docs .env AGENTUITY_SDK_KEY
AGENTUITY_API_KEY=
Comment on lines +4 to +5
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Align auth var name with runtime (AGENT_BEARER_TOKEN) or support alias.

env.ts reads AGENT_BEARER_TOKEN; this sample introduces AGENTUITY_API_KEY. Either update env.ts to accept AGENTUITY_API_KEY as an alias (recommended; see my env.ts diff) or change the sample to AGENT_BEARER_TOKEN to avoid 401s. Also add a trailing newline to satisfy dotenv-linter.

Recommended sample tweak:

-# API key can be found in agent-docs .env AGENTUITY_SDK_KEY
-AGENTUITY_API_KEY=
+# Authentication (set one)
+# Prefer AGENT_BEARER_TOKEN; AGENTUITY_API_KEY is accepted as an alias.
+AGENT_BEARER_TOKEN=
+# AGENTUITY_API_KEY=
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# API key can be found in agent-docs .env AGENTUITY_SDK_KEY
AGENTUITY_API_KEY=
# Authentication (set one)
# Prefer AGENT_BEARER_TOKEN; AGENTUITY_API_KEY is accepted as an alias.
AGENT_BEARER_TOKEN=
# AGENTUITY_API_KEY=
🧰 Tools
🪛 dotenv-linter (3.3.0)

[warning] 5-5: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)

🤖 Prompt for AI Agents
In .env.example around lines 4 to 5, the sample variable AGENTUITY_API_KEY
mismatches the runtime env var AGENT_BEARER_TOKEN and will cause auth failures;
update the sample to AGENT_BEARER_TOKEN= and add a trailing newline to satisfy
dotenv-linter; alternatively, if you prefer keeping AGENTUITY_API_KEY, update
env.ts to accept it as an alias by reading both process.env.AGENT_BEARER_TOKEN
and process.env.AGENTUITY_API_KEY (prefer AGENT_BEARER_TOKEN if present) so the
runtime accepts either name and avoid 401s.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ yarn-error.log*
.env*.local
.env.local
.env.production
.env
.vercel
next-env.d.ts
.open-next
Expand Down
54 changes: 0 additions & 54 deletions agent-docs/RAG-TODO.md

This file was deleted.

220 changes: 0 additions & 220 deletions agent-docs/RAG-design.md

This file was deleted.

Loading