chore: update package scripts and improve CI workflow

- Enhanced package.json scripts by adding a new linting command for the MCP workspace and updating the check script to include MCP linting.
- Modified CI workflow to replace individual typecheck and lint steps with a consolidated validation step for improved efficiency.
- Introduced a new TypeScript configuration for testing in the MCP server, enhancing type checking capabilities.
- Reorganized imports in several components for better clarity and maintainability.
This commit is contained in:
iliya 2026-03-07 19:37:59 +02:00
parent 5c2b6fe68c
commit f7130c3437
7 changed files with 31 additions and 18 deletions

View file

@ -62,14 +62,8 @@ jobs:
restore-keys: |
eslint-${{ runner.os }}-
- name: Typecheck
run: pnpm typecheck:workspace
- name: Lint
run: pnpm lint
- name: Build
run: pnpm build:workspace
- name: Validate workspace truth gate
run: pnpm check
test:
strategy:

View file

@ -27,9 +27,11 @@
"scripts": {
"build": "tsup",
"dev": "tsx src/index.ts",
"lint": "eslint \"src/**/*.ts\"",
"test": "vitest run",
"test:watch": "vitest",
"typecheck": "tsc --noEmit",
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
"prepublishOnly": "pnpm build"
},
"dependencies": {

View file

@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"noEmit": true,
"types": ["node", "vitest/globals"]
},
"include": ["src/**/*.ts", "test/**/*.ts"],
"exclude": ["node_modules", "dist"]
}

View file

@ -30,15 +30,16 @@
"dist:linux": "electron-builder --linux",
"preview": "electron-vite preview",
"typecheck": "tsc --noEmit",
"typecheck:workspace": "pnpm typecheck && pnpm --filter agent-teams-mcp typecheck",
"typecheck:workspace": "pnpm typecheck && pnpm --filter agent-teams-mcp typecheck && pnpm --filter agent-teams-mcp typecheck:test",
"lint": "eslint src/ --cache --cache-location .eslintcache --cache-strategy content",
"lint:mcp": "pnpm --filter agent-teams-mcp lint",
"lint:fix": "eslint src/ --fix --cache --cache-location .eslintcache --cache-strategy content",
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css}\"",
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css}\"",
"build:workspace": "pnpm build && pnpm --filter agent-teams-controller build && pnpm --filter agent-teams-mcp build",
"test:workspace": "pnpm test && pnpm --filter agent-teams-controller test && pnpm --filter agent-teams-mcp test",
"check:workspace": "pnpm typecheck:workspace && pnpm test:workspace && pnpm build:workspace",
"check": "pnpm check:workspace && pnpm lint",
"check": "pnpm check:workspace && pnpm lint && pnpm lint:mcp",
"fix": "pnpm lint:fix && pnpm format",
"quality": "pnpm check && pnpm format:check && npx knip",
"test:chunks": "tsx test/test-chunk-building.ts",

View file

@ -8,13 +8,13 @@ import { cn } from '@renderer/lib/utils';
import { useStore } from '@renderer/store';
import { normalizePath } from '@renderer/utils/pathNormalize';
import { projectColor } from '@renderer/utils/projectColor';
import { deriveTaskDisplayId } from '@shared/utils/taskIdentity';
import {
getNonEmptyTaskCategories,
groupTasksByDate,
groupTasksByProject,
sortTasksByFreshness,
} from '@renderer/utils/taskGrouping';
import { deriveTaskDisplayId } from '@shared/utils/taskIdentity';
import {
Archive,
ArrowUpDown,

View file

@ -23,9 +23,9 @@ import {
} from '@renderer/utils/agentMessageFormatting';
import { formatAgentRole } from '@renderer/utils/formatAgentRole';
import { stripAgentBlocks } from '@shared/constants/agentBlocks';
import { formatTaskDisplayLabel } from '@shared/utils/taskIdentity';
import { extractMarkdownPlainText } from '@shared/utils/markdownTextSearch';
import { isRateLimitMessage } from '@shared/utils/rateLimitDetector';
import { formatTaskDisplayLabel } from '@shared/utils/taskIdentity';
import { AlertTriangle, ChevronRight, ListPlus, RefreshCw, Reply } from 'lucide-react';
import { isManagedCollapseState } from './collapseState';

View file

@ -53,7 +53,13 @@ const TOKEN_COLOR_CLASS: Record<TokenType, string> = {
function readWorktreeHistory(teamName: string): string[] {
try {
const raw = localStorage.getItem(`team:worktreeHistory:${teamName}`);
return raw ? JSON.parse(raw) : [];
if (!raw) {
return [];
}
const parsed: unknown = JSON.parse(raw);
return Array.isArray(parsed)
? parsed.filter((item): item is string => typeof item === 'string')
: [];
} catch {
return [];
}
@ -184,7 +190,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
{/* Collapsible header */}
<button
type="button"
className="flex items-center gap-1 text-xs text-text-secondary hover:text-text transition-colors"
className="flex items-center gap-1 text-xs text-text-secondary transition-colors hover:text-text"
onClick={() => setIsOpen(!isOpen)}
>
<ChevronRight
@ -217,7 +223,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
<PopoverAnchor asChild>
<Input
placeholder="worktree-name"
className="h-7 text-xs font-mono"
className="h-7 font-mono text-xs"
value={worktreeName}
onChange={(e) => onWorktreeNameChange(e.target.value)}
onFocus={() => setShowHistory(true)}
@ -244,7 +250,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
<button
key={name}
type="button"
className="w-full rounded px-2 py-1 text-left text-xs font-mono text-text-secondary hover:bg-surface-raised hover:text-text"
className="w-full rounded px-2 py-1 text-left font-mono text-xs text-text-secondary hover:bg-surface-raised hover:text-text"
onMouseDown={(e) => {
e.preventDefault(); // Prevent input blur
onWorktreeNameChange(name);
@ -265,7 +271,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
Command preview
</span>
<div className="overflow-x-auto rounded border border-border bg-surface-sidebar px-2.5 py-1.5">
<code className="flex flex-wrap gap-x-1 gap-y-0.5 text-[11px] font-mono leading-relaxed">
<code className="flex flex-wrap gap-x-1 gap-y-0.5 font-mono text-[11px] leading-relaxed">
{previewTokens.map((token, i) => (
<span key={i} className={TOKEN_COLOR_CLASS[token.type]}>
{token.text}
@ -283,7 +289,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
<div className="flex items-center gap-2">
<Input
placeholder="--max-turns 5"
className="h-7 flex-1 text-xs font-mono"
className="h-7 flex-1 font-mono text-xs"
value={customArgs}
onChange={(e) => handleCustomArgsChange(e.target.value)}
/>