Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9d3e9a3
add dependabot config
St0rmz1 Dec 12, 2025
683994b
Merge pull request #139 from replicatedhq/feat/add-dependabot-config
St0rmz1 Dec 12, 2025
15d0cd1
deps(app)(deps): bump next from 15.4.8 to 15.5.9 in /chartsmith-app
dependabot[bot] Dec 12, 2025
02783cd
deps(app)(deps): bump tar from 7.4.3 to 7.5.2 in /chartsmith-app
dependabot[bot] Dec 12, 2025
2e7e4ea
security: Upgrade React to 19.1.4 to fix CVE-2025-55184 and CVE-2025-…
St0rmz1 Dec 12, 2025
780d36b
Merge pull request #164 from replicatedhq/replicated-release
marccampbell Dec 12, 2025
fd379a3
Merge pull request #163 from replicatedhq/fix/react-cve-2025-55184-55183
St0rmz1 Dec 12, 2025
367fdaf
Merge pull request #162 from replicatedhq/dependabot/npm_and_yarn/cha…
St0rmz1 Dec 12, 2025
dabea46
Merge pull request #161 from replicatedhq/dependabot/npm_and_yarn/cha…
St0rmz1 Dec 12, 2025
051bbd3
deps(app)(deps): bump tailwind-merge in /chartsmith-app
dependabot[bot] Dec 12, 2025
c0b718c
Merge pull request #160 from replicatedhq/dependabot/npm_and_yarn/cha…
St0rmz1 Dec 12, 2025
04e8bd4
deps(app)(deps): bump jotai from 2.12.2 to 2.16.0 in /chartsmith-app
dependabot[bot] Dec 12, 2025
e3c53bf
Merge pull request #159 from replicatedhq/dependabot/npm_and_yarn/cha…
St0rmz1 Dec 12, 2025
548cdd3
deps(app)(deps): bump lucide-react in /chartsmith-app (#155)
dependabot[bot] Dec 12, 2025
cbb860f
deps(app)(deps): bump the production-dependencies group (#154)
dependabot[bot] Dec 12, 2025
3aeb669
deps(extension)(deps): bump ws in /chartsmith-extension (#150)
dependabot[bot] Dec 12, 2025
347b017
deps(extension)(deps): bump jotai in /chartsmith-extension (#147)
dependabot[bot] Dec 12, 2025
ebad72d
deps(extension)(deps): bump the react-ecosystem group (#141)
dependabot[bot] Dec 12, 2025
b7f3c12
deps(extension)(deps-dev): bump tar-fs in /chartsmith-extension (#165)
dependabot[bot] Dec 12, 2025
bf5225e
security: fix all dependabot HIGH and MEDIUM vulnerabilities (#167)
St0rmz1 Dec 12, 2025
4a01809
deps(app)(deps-dev): bump the development-dependencies group across 1…
dependabot[bot] Dec 12, 2025
a674910
deps(app)(deps): bump react and @types/react in /chartsmith-app (#173)
dependabot[bot] Dec 12, 2025
1361cc9
deps(app)(deps): bump monaco-editor in /chartsmith-app (#174)
dependabot[bot] Dec 12, 2025
349fd60
deps(app)(deps): bump centrifuge from 5.3.4 to 5.5.2 in /chartsmith-a…
dependabot[bot] Dec 12, 2025
e726d48
deps(app)(deps): bump dotenv from 16.5.0 to 17.2.3 in /chartsmith-app…
dependabot[bot] Dec 12, 2025
ca65c1e
deps(app)(deps): bump diff and @types/diff in /chartsmith-app (#172)
dependabot[bot] Dec 12, 2025
905c385
deps(app)(deps): bump pg and @types/pg in /chartsmith-app (#157)
dependabot[bot] Dec 12, 2025
4615346
feat(pr01): install AI SDK packages (ai, @ai-sdk/react, @ai-sdk/anthr…
boxingknight Dec 9, 2025
aab30c2
feat(pr01): add feature flag infrastructure and useAIChat hook abstra…
boxingknight Dec 9, 2025
6e3f76c
feat: migrate to Vercel AI SDK and update .gitignore
boxingknight Dec 10, 2025
060f510
chore: organize debugging and setup files, update .gitignore
boxingknight Dec 11, 2025
e9557c4
chore: hide entire docs/ folder from git
boxingknight Dec 11, 2025
4042a8f
Final additions before PR
boxingknight Dec 11, 2025
415480c
Updating files to fix syntax errors
boxingknight Dec 12, 2025
99a441e
chore: remove tests and debug files to slim down PR
boxingknight Dec 14, 2025
bdb8409
fix: cursor suggestions
boxingknight Dec 15, 2025
f499cd7
fix
boxingknight Dec 15, 2025
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
170 changes: 170 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
# Dependabot Configuration for ChartSmith
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# Go Modules - Root
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "go"
commit-message:
prefix: "deps"
include: "scope"
# Group minor and patch updates together to reduce PR noise
groups:
go-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"

# Go Modules - Helm Utils
- package-ecosystem: "gomod"
directory: "/helm-utils"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "go"
- "helm-utils"
commit-message:
prefix: "deps(helm-utils)"
include: "scope"
groups:
helm-utils-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"

# Go Modules - Dagger
- package-ecosystem: "gomod"
directory: "/dagger"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "go"
- "dagger"
commit-message:
prefix: "deps(dagger)"
include: "scope"
groups:
dagger-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"

# NPM - ChartSmith App
- package-ecosystem: "npm"
directory: "/chartsmith-app"
schedule:
interval: "weekly"
day: "tuesday"
time: "09:00"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "npm"
- "chartsmith-app"
commit-message:
prefix: "deps(app)"
include: "scope"
# Ignore major version updates for React and Next.js (handle manually)
ignore:
- dependency-name: "react"
update-types: ["version-update:semver-major"]
- dependency-name: "react-dom"
update-types: ["version-update:semver-major"]
- dependency-name: "next"
update-types: ["version-update:semver-major"]
# Group non-breaking updates to reduce PR noise
groups:
react-ecosystem:
patterns:
- "react*"
- "@types/react*"
update-types:
- "minor"
- "patch"
development-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"
production-dependencies:
dependency-type: "production"
update-types:
- "patch"

# NPM - ChartSmith Extension
- package-ecosystem: "npm"
directory: "/chartsmith-extension"
schedule:
interval: "weekly"
day: "tuesday"
time: "09:00"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "npm"
- "chartsmith-extension"
commit-message:
prefix: "deps(extension)"
include: "scope"
# Ignore major version updates for React (handle manually)
ignore:
- dependency-name: "react"
update-types: ["version-update:semver-major"]
- dependency-name: "react-dom"
update-types: ["version-update:semver-major"]
groups:
react-ecosystem:
patterns:
- "react*"
- "@types/react*"
update-types:
- "minor"
- "patch"
development-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"

# GitHub Actions (if/when workflows are added)
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
include: "scope"
groups:
github-actions:
patterns:
- "*"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ test-results/
.specstory/
chart/chartsmith/*.tgz
.direnv/

# Local setup documentation and scripts (not committed to git)
docs/
scripts/
.env
24 changes: 23 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,26 @@ It's made for both the developer working on it and for AI models to read and app
## Workers
- The go code is where we put all workers.
- Jobs for workers are enqueued and scheduled using postgres notify and a work_queue table.
- Status from the workers is communicated via Centrifugo messages to the client.
- Status from the workers is communicated via Centrifugo messages to the client.

## Chat & LLM Integration

Chartsmith uses the Vercel AI SDK for all conversational chat functionality.
The Go worker outputs AI SDK Data Stream Protocol format, which the frontend
consumes via the useChat hook.

### Architecture
- Frontend: useChat hook manages chat state
- API Route: /api/chat proxies to Go worker
- Backend: Go worker outputs AI SDK protocol (HTTP SSE)
- Streaming: Server-Sent Events instead of WebSocket

### Key Components
- pkg/llm/aisdk.go: Adapter for AI SDK protocol
- pkg/api/chat.go: HTTP endpoint for chat streaming
- chartsmith-app/hooks/useAIChat.ts: Frontend hook wrapper
- chartsmith-app/app/api/chat/route.ts: Next.js API route

### Note on Centrifugo
Centrifugo is still used for non-chat events (plans, renders, artifacts).
Chat messages flow exclusively through the AI SDK HTTP SSE protocol.
12 changes: 0 additions & 12 deletions CLAUDE.md

This file was deleted.

25 changes: 25 additions & 0 deletions chartsmith-app/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,28 @@ This is a next.js project that is the front end for chartsmith.
- We aren't using Next.JS API routes, except when absolutely necessary.
- Front end should call server actions, which call lib/* functions.
- Database queries are not allowed in the server action. Server actions are just wrappers for which lib functions we expose.

## Chat & LLM Integration

Chartsmith uses the Vercel AI SDK for all chat functionality:

- **Frontend**: `useChat` hook from `@ai-sdk/react` manages chat state
- **API Route**: `/api/chat` Next.js route proxies to Go worker
- **Backend**: Go worker outputs AI SDK Data Stream Protocol (HTTP SSE)
- **Streaming**: Server-Sent Events (SSE) instead of WebSocket
- **State**: Managed by AI SDK hook, integrated with Jotai for workspace state

### Flow
```
User Input → ChatContainer → useAIChat → /api/chat → Go Worker → AI SDK Protocol → useChat → UI
```

### Key Components
- `useAIChat`: Wraps `useChat` with Chartsmith-specific logic
- `/api/chat`: Next.js API route that proxies to Go worker
- `pkg/llm/aisdk.go`: Go adapter for AI SDK protocol
- `pkg/api/chat.go`: HTTP endpoint for chat streaming

### Note on Centrifugo
Centrifugo is still used for non-chat events (plans, renders, artifacts).
Chat messages flow exclusively through the AI SDK HTTP SSE protocol.
78 changes: 78 additions & 0 deletions chartsmith-app/app/api/auth/test-auth/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { NextRequest, NextResponse } from 'next/server';
import { validateTestAuth } from '@/lib/auth/actions/test-auth';
import { logger } from '@/lib/utils/logger';

export async function GET(request: NextRequest) {
// Only allow in development/test mode
if (process.env.NODE_ENV === 'production') {
return NextResponse.json({ error: 'Test auth not allowed in production' }, { status: 403 });
}

if (process.env.ENABLE_TEST_AUTH !== 'true' && process.env.NEXT_PUBLIC_ENABLE_TEST_AUTH !== 'true') {
return NextResponse.json({ error: 'Test auth not enabled' }, { status: 403 });
}

try {
logger.debug('Test auth API called');
const jwt = await validateTestAuth();

if (!jwt) {
return NextResponse.json({ error: 'Failed to generate test token' }, { status: 500 });
}

logger.debug('Test auth successful, setting cookie via API', { jwtLength: jwt.length });

// Check if this is a programmatic request (e.g., from Playwright) that wants the JWT
const wantsJson = request.headers.get('accept')?.includes('application/json') ||
request.nextUrl.searchParams.get('format') === 'json';

if (wantsJson) {
// Return JWT in JSON for programmatic access (e.g., Playwright tests)
return NextResponse.json({
token: jwt,
redirect: '/'
});
}

// Set cookie expiration
const expires = new Date();
expires.setDate(expires.getDate() + 7);

// Create redirect response
const redirectUrl = new URL('/', request.url);
const response = NextResponse.redirect(redirectUrl);

// Try both methods: cookies API and manual header
// Method 1: Use cookies() API
response.cookies.set('session', jwt, {
expires,
path: '/',
sameSite: 'lax',
httpOnly: false,
});

// Method 2: Also manually set header as backup
const cookieValue = `session=${jwt}; Path=/; SameSite=Lax; Expires=${expires.toUTCString()}`;
const existingSetCookie = response.headers.get('Set-Cookie');
if (existingSetCookie) {
// Append if header already exists
response.headers.set('Set-Cookie', `${existingSetCookie}, ${cookieValue}`);
} else {
response.headers.set('Set-Cookie', cookieValue);
}

logger.debug('Cookie set via both methods', {
jwtLength: jwt.length,
jwtPrefix: jwt.substring(0, 30) + '...',
setCookieHeader: response.headers.get('Set-Cookie')?.substring(0, 150) || 'none'
});

return response;
} catch (error) {
logger.error('Test auth API failed', { error });
return NextResponse.json({
error: 'Test authentication failed',
details: error instanceof Error ? error.message : String(error)
}, { status: 500 });
}
}
Loading