Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 0 additions & 22 deletions .env.baseai.example

This file was deleted.

8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "next/core-web-vitals",
"rules": {
"react/no-unescaped-entities": "off"
}
"extends": "next/core-web-vitals",
"rules": {
"react/no-unescaped-entities": "off"
}
}
8 changes: 5 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"files.associations": {
"*.mdx": "markdown",
}
"files.associations": {
"*.mdx": "markdown"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
59 changes: 30 additions & 29 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,54 @@

## Build Commands

- **Type Check**: `npx tsc --noEmit`
- **Build**: `npm run build`
- **Dev**: `npm run dev`
- **Lint**: `npm run lint`
- **Type Check**: `npx tsc --noEmit`
- **Build**: `npm run build`
- **Dev**: `npm run dev`
- **Lint**: `npm run lint`

## AI Chat Integration

This site uses **runLLM** for the AI chat widget. The integration is implemented via:

- **Location**: `src/app/layout.tsx`
- **Widget**: runLLM script loaded via Next.js `<Script>` component
- **Configuration**:
- Position: BOTTOM_RIGHT
- Theme color: #FF5543 (Sourcegraph brand color)
- Button text: "Ask AI"
- Keyboard shortcut: Mod+j
- **Location**: `src/app/layout.tsx`
- **Widget**: runLLM script loaded via Next.js `<Script>` component
- **Configuration**:
- Position: BOTTOM_RIGHT
- Theme color: #FF5543 (Sourcegraph brand color)
- Button text: "Ask AI"
- Keyboard shortcut: Mod+j

### runLLM Configuration

To update the runLLM assistant ID or other settings, modify the Script component in `src/app/layout.tsx`:

```tsx
<Script
id="runllm-widget-script"
type="module"
src="https://widget.runllm.com"
crossOrigin=""
runllm-keyboard-shortcut="Mod+j"
runllm-name="Sourcegraph AI Assistant"
runllm-position="BOTTOM_RIGHT"
runllm-assistant-id="YOUR_ASSISTANT_ID" // Update this
runllm-theme-color="#FF5543"
runllm-floating-button-text="Ask AI"
async
id="runllm-widget-script"
type="module"
src="https://widget.runllm.com"
crossOrigin=""
runllm-keyboard-shortcut="Mod+j"
runllm-name="Sourcegraph AI Assistant"
runllm-position="BOTTOM_RIGHT"
runllm-assistant-id="YOUR_ASSISTANT_ID" // Update this
runllm-theme-color="#FF5543"
runllm-floating-button-text="Ask AI"
async
/>
```

### Previous Integration

Previously used **Langbase** with custom React components. This has been completely removed:
- Removed `@langbase/components` and `langbase` packages
- Removed custom chat components (`src/app/chat.tsx`, `src/components/ChatBot/`)
- Removed API routes (`src/app/api/chat/`)
- Removed memory creation scripts

- Removed `@langbase/components` and `langbase` packages
- Removed custom chat components (`src/app/chat.tsx`, `src/components/ChatBot/`)
- Removed API routes (`src/app/api/chat/`)
- Removed memory creation scripts

## Important Notes

- **Assistant ID**: The `runllm-assistant-id` is currently set to "YOUR_ASSISTANT_ID" and needs to be updated with the actual Sourcegraph runLLM assistant ID
- **Deployment**: After updating the assistant ID, add the deployment URL to the runLLM dashboard
- **Styling**: The widget inherits the site's theme and uses the Sourcegraph brand color (#FF5543)
- **Assistant ID**: The `runllm-assistant-id` is currently set to "YOUR_ASSISTANT_ID" and needs to be updated with the actual Sourcegraph runLLM assistant ID
- **Deployment**: After updating the assistant ID, add the deployment URL to the runLLM dashboard
- **Styling**: The widget inherits the site's theme and uses the Sourcegraph brand color (#FF5543)
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ cd docs

Before the dependencies are installed make sure your local machine has the following versions of `node` and `pnpm` installed:

* node: `v20.8.1`
* pnpm: `8.13.1`
- node: `v20.8.1`
- pnpm: `8.13.1`

**Note**: If you have `mise` available you can install the above versions for only this repository by running the following command from your terminal in the root folder:

Expand All @@ -48,6 +48,7 @@ Finally, open [`http://localhost:3000`](http://localhost:3000) in your browser t
## Writing and contributing to Sourcegraph Docs

### (Easy) Using GitHub to edit existing files

You can easily update existing docs pages using [GitHub's file editor](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files). All you need to do is:

1. Find the corresponding `.mdx` file in the [folder structure](#folder-structure).
Expand All @@ -58,9 +59,10 @@ You can easily update existing docs pages using [GitHub's file editor](https://d
6. Click on the green "Propose changes" button to create a PR.
7. Add a PR reviewer to the Reviewers panel by clicking on the gear icon.
8. Tag `@maedahbatool` in the `#docs` Slack channel and link to your PR to get a quick review.
> NOTE: "Edit from GitHub" is generally recommended for text-based edits. For more structural-based contributions like adding React components and code blocks, it's always better to go with a local setup. This way, you can preview changes before you commit.
> NOTE: "Edit from GitHub" is generally recommended for text-based edits. For more structural-based contributions like adding React components and code blocks, it's always better to go with a local setup. This way, you can preview changes before you commit.

### (Advanced) Local dev environment

To add new or update existing docs content. Create a new branch and checkout by via:

```sh
Expand All @@ -71,8 +73,8 @@ git switch -c BRANCH_NAME_HERE

The folder structure is exactly the same here. All the docs reside within the `/docs` folder. Here you'll find separate folders for every docs section like `cody`, `code_search`, `cli`, etc.

- Navigate to the relevant relevant section for your contribution
- If you're adding a new page, create a new MDX file (e.g., `my-new-page.mdx`) in the appropriate folder
- Navigate to the relevant relevant section for your contribution
- If you're adding a new page, create a new MDX file (e.g., `my-new-page.mdx`) in the appropriate folder

### Using MDX

Expand Down Expand Up @@ -115,25 +117,25 @@ This snippet creates a single `<QuickLink>` titled as "Get Cody". You can add as

Here are the list of all the supported components we have:

- `<QuickLinks>`
- `<ProductLinks>`
- `<LinkCards>`
- `<Callout>`
- `<QuickLinks>`
- `<ProductLinks>`
- `<LinkCards>`
- `<Callout>`

For a better docs experience, we'll continue adding more components in the future.

### Adding a link

To add a `link` to any docs page, use the following routing syntax: `[Link text](path-to-link)`.

- Do not include `/docs` in the link paths. The base URL will be `sourcegraph.com/docs`
- There should be **no file extension** in the path name
- Do not include `/docs` in the link paths. The base URL will be `sourcegraph.com/docs`
- There should be **no file extension** in the path name

For example, if you want to link to the Cody Quickstart somewhere in the Code Search docs, you should use:

```markdown
- This is a link to [Cody Quickstart](/cody/quickstart) in Code Search docs
- This is a way to hash-link to [Cody for VSCode installation](/cody/clients/install-vscode#verifying-the-installation) in Code Search docs
- This is a link to [Cody Quickstart](/cody/quickstart) in Code Search docs
- This is a way to hash-link to [Cody for VSCode installation](/cody/clients/install-vscode#verifying-the-installation) in Code Search docs
```

### Adding media assets (images, videos and gifs)
Expand All @@ -158,8 +160,8 @@ When you open a PR Vercel deploys and provides you with a preview deployment lin

Once you're satisfied with your changes, follow these steps:

- Commit your changes
- Create a pull request to the [Sourcegraph documentation repository](https://github.com/sourcegraph/docs).
- Tag `@maedahbatool` in `#docs` channel through Slack to get a quick review
- Commit your changes
- Create a pull request to the [Sourcegraph documentation repository](https://github.com/sourcegraph/docs).
- Tag `@maedahbatool` in `#docs` channel through Slack to get a quick review

Thank you for contributing to Sourcegraph documentation! Your efforts help us provide top-notch learning experiences for our users. If you have any questions or need assistance, feel free to reach out.
2 changes: 1 addition & 1 deletion baseai/baseai.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseAIConfig } from 'baseai';
import type {BaseAIConfig} from 'baseai';

export const config: BaseAIConfig = {
log: {
Expand Down
8 changes: 4 additions & 4 deletions baseai/memory/memory-sg-docs-live/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MemoryI } from '@baseai/core';
import {MemoryI} from '@baseai/core';

const memoryDocs = (): MemoryI => ({
name: 'memory-sg-docs-live',
Expand All @@ -15,10 +15,10 @@ const memoryDocs = (): MemoryI => ({
const url = `https://sourcegraph.com/docs/${doc.path}`;
return {
url,
name: doc.name,
name: doc.name
};
},
},
}
}
});

export default memoryDocs;
Expand Down
32 changes: 16 additions & 16 deletions components.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/styles/tailwind.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/styles/tailwind.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
Loading