Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fc34077
refactor: generalize coding agent to behavior + business; part 1
AshishKumar4 Nov 7, 2025
de53b8e
refactor: agent behaviors, objectives generalized, abstracted + agent…
AshishKumar4 Nov 7, 2025
5685c7d
feat: finish most refactor and get it to build
AshishKumar4 Nov 9, 2025
2aea3c7
feat: add ai-based project type detection and workflow support
AshishKumar4 Nov 10, 2025
e8d07af
fix: template initialization
AshishKumar4 Nov 10, 2025
40ab40e
fix: wire up onConnect to coding agent
AshishKumar4 Nov 10, 2025
740bf1c
feat: improve GitHub Actions workflow reliability
AshishKumar4 Nov 10, 2025
a25e72f
refactor: improve type safety in state migration logic
AshishKumar4 Nov 10, 2025
bb09d92
fix: add optional chaining to prevent runtime errors in blueprint ren…
AshishKumar4 Nov 10, 2025
5e4ebb2
feat: general agent
AshishKumar4 Nov 11, 2025
1faaca1
refactor: reorganize project builder architecture + sandbox templatel…
AshishKumar4 Nov 11, 2025
f5a3be6
feat: add project mode selector with agentic behavior support
AshishKumar4 Nov 11, 2025
feca8ca
fix: files format
AshishKumar4 Nov 11, 2025
bb23e88
fix: ensure workspace directory exists before writing files
AshishKumar4 Nov 11, 2025
234860f
feat: replace template manager with ai template selector
AshishKumar4 Nov 11, 2025
97bc622
refactor: integrate conversation history and sync for agentic builder
AshishKumar4 Nov 12, 2025
060cc9e
fix: template import and state init
AshishKumar4 Nov 12, 2025
5deea6a
fix: template cache clear before import + init meta in behavior const…
AshishKumar4 Nov 12, 2025
bbf1979
fix: ui and convo state management
AshishKumar4 Nov 12, 2025
d45f368
fix: convo id uniqueness and improve message deduplication
AshishKumar4 Nov 12, 2025
868ba34
fix: ui auto focus, preview hiding and blueprints
AshishKumar4 Nov 12, 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
65 changes: 27 additions & 38 deletions .github/workflows/claude-reviews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
pull_request_review_comment:
types: [created]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
comprehensive-review:
name: PR Description & Code Review
Expand All @@ -30,6 +34,29 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Delete Previous Claude Comments
run: |
echo "🧹 Deleting previous Claude comments from github-actions bot..."

# Get all comments from github-actions bot containing 'Claude'
CLAUDE_COMMENTS=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
--jq '[.[] | select(.user.login == "github-actions[bot]") | select(.body | contains("Claude")) | .id]')

if [ "$CLAUDE_COMMENTS" = "[]" ] || [ -z "$CLAUDE_COMMENTS" ]; then
echo "No previous Claude comments found"
else
echo "Found Claude comments to delete:"
echo "$CLAUDE_COMMENTS" | jq -r '.[]' | while read comment_id; do
echo "Deleting comment $comment_id"
gh api repos/${{ github.repository }}/issues/comments/$comment_id -X DELETE || echo "Failed to delete comment $comment_id"
done
echo "✅ Deleted previous Claude comments"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

- name: Detect Critical Paths
id: critical_paths
run: |
Expand Down Expand Up @@ -147,41 +174,3 @@ jobs:
--max-turns ${{ steps.critical_paths.outputs.is_critical == 'true' && '90' || '65' }}
--model claude-sonnet-4-5-20250929

- name: Intelligent Comment Cleanup
uses: anthropics/claude-code-action@v1
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
Clean up stale bot comments on PR #${{ github.event.pull_request.number }}.

**Task:**
1. Fetch all comments on this PR
2. Identify bot comments (users ending in [bot]) that are stale/outdated:
- Old reviews superseded by newer ones
- Old PR description suggestions
- Previously collapsed/outdated markers
- Progress/status comments from previous workflow runs
3. Keep only the most recent comment per category per bot
4. DELETE all stale comments (do not collapse)

**Get all comments:**
```bash
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | {id, user: .user.login, body, created_at}'
```

**Delete a comment:**
```bash
gh api repos/${{ github.repository }}/issues/comments/COMMENT_ID -X DELETE
```

Be intelligent:
- Preserve the newest useful comment in each category
- Delete everything else that's redundant or stale
- If unsure, keep the comment (conservative approach)

claude_args: |
--allowed-tools "Bash(gh api repos/*/issues/*/comments:*),Bash(gh api repos/*/issues/comments/*:*)"
--max-turns 8
--model claude-haiku-4-5-20251001
6 changes: 3 additions & 3 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export default {
'type-empty': [2, 'never'],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'header-max-length': [2, 'always', 100],
'header-max-length': [2, 'always', 150],
'body-leading-blank': [1, 'always'],
'body-max-line-length': [2, 'always', 100],
'body-max-line-length': [2, 'always', 200],
'footer-leading-blank': [1, 'always'],
'footer-max-line-length': [2, 'always', 100],
'footer-max-line-length': [2, 'always', 200],
},
};
15 changes: 11 additions & 4 deletions src/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,24 @@ export type {
} from 'worker/database/types';

// Agent/Generator Types
export type {
export type {
Blueprint as BlueprintType,
PhasicBlueprint,
CodeReviewOutputType,
FileConceptType,
FileOutputType as GeneratedFile,
} from 'worker/agents/schemas';

export type {
CodeGenState
export type {
AgentState,
PhasicState
} from 'worker/agents/core/state';

export type {
BehaviorType,
ProjectType
} from 'worker/agents/core/types';

export type {
ConversationMessage,
} from 'worker/agents/inferutils/common';
Expand All @@ -168,7 +175,7 @@ export type {
export type { RateLimitError } from "worker/services/rate-limit/errors";
export type { AgentPreviewResponse, CodeGenArgs } from 'worker/api/controllers/agent/types';
export type { RateLimitErrorResponse } from 'worker/api/responses';
export { RateLimitExceededError, SecurityError, SecurityErrorType } from 'shared/types/errors';
export { RateLimitExceededError, SecurityError, SecurityErrorType } from '../shared/types/errors.js';

export type { AIModels } from 'worker/agents/inferutils/config.types';
// Model selection types
Expand Down
83 changes: 83 additions & 0 deletions src/components/project-mode-selector.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { useState } from 'react';

export type ProjectMode = 'app' | 'presentation' | 'general';

interface ProjectModeSelectorProps {
value: ProjectMode;
onChange: (mode: ProjectMode) => void;
disabled?: boolean;
className?: string;
}

export function ProjectModeSelector({ value, onChange, disabled = false, className = '' }: ProjectModeSelectorProps) {
const [hoveredMode, setHoveredMode] = useState<ProjectMode | null>(null);

const modes = [
{
id: 'app' as const,
label: 'App',
description: 'Full-stack applications',
},
{
id: 'presentation' as const,
label: 'Slides',
description: 'Interactive presentations',
},
{
id: 'general' as const,
label: 'Chat',
description: 'Conversational assistant',
},
];

return (
<div className={`flex items-center gap-1 ${className}`}>
{modes.map((mode, index) => {
const isSelected = value === mode.id;
const isHovered = hoveredMode === mode.id;

return (
<div key={mode.id} className="flex items-center">
<button
type="button"
disabled={disabled}
onClick={() => onChange(mode.id)}
onMouseEnter={() => setHoveredMode(mode.id)}
onMouseLeave={() => setHoveredMode(null)}
className={`
relative px-3 py-1.5 text-sm font-normal
transition-all duration-200 ease-out
${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}
${
isSelected
? 'text-text-primary'
: 'text-text-primary/40 hover:text-text-primary/70'
}
`}
>
{mode.label}

{/* Subtle underline indicator for selected state */}
{isSelected && (
<div className="absolute bottom-0 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-accent" />
)}

{/* Tooltip on hover */}
{isHovered && !disabled && (
<div className="absolute -bottom-8 left-1/2 -translate-x-1/2 whitespace-nowrap px-2 py-1 bg-bg-2/95 backdrop-blur-sm border border-text-primary/10 rounded-md text-xs text-text-secondary pointer-events-none z-50">
{mode.description}
<div className="absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-bg-2 border-l border-t border-text-primary/10 rotate-45" />
</div>
)}
</button>

{/* Separator dot (except after last item) */}
{index < modes.length - 1 && (
<div className="w-1 h-1 rounded-full bg-text-primary/10" />
)}
</div>
);
})}
</div>
);
}
6 changes: 3 additions & 3 deletions src/lib/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ import type{
AgentPreviewResponse,
PlatformStatusData,
RateLimitError
} from '@/api-types';
} from '../api-types.js';
import {

RateLimitExceededError,
SecurityError,
SecurityErrorType,
} from '@/api-types';
} from '../api-types.js';
import { toast } from 'sonner';

/**
Expand Down
Loading
Loading