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:
parent
5c2b6fe68c
commit
f7130c3437
7 changed files with 31 additions and 18 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
|
@ -62,14 +62,8 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
eslint-${{ runner.os }}-
|
eslint-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Typecheck
|
- name: Validate workspace truth gate
|
||||||
run: pnpm typecheck:workspace
|
run: pnpm check
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
run: pnpm lint
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: pnpm build:workspace
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,11 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"dev": "tsx src/index.ts",
|
"dev": "tsx src/index.ts",
|
||||||
|
"lint": "eslint \"src/**/*.ts\"",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
|
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
|
||||||
"prepublishOnly": "pnpm build"
|
"prepublishOnly": "pnpm build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
10
mcp-server/tsconfig.test.json
Normal file
10
mcp-server/tsconfig.test.json
Normal 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"]
|
||||||
|
}
|
||||||
|
|
@ -30,15 +30,16 @@
|
||||||
"dist:linux": "electron-builder --linux",
|
"dist:linux": "electron-builder --linux",
|
||||||
"preview": "electron-vite preview",
|
"preview": "electron-vite preview",
|
||||||
"typecheck": "tsc --noEmit",
|
"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": "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",
|
"lint:fix": "eslint src/ --fix --cache --cache-location .eslintcache --cache-strategy content",
|
||||||
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css}\"",
|
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css}\"",
|
||||||
"format:check": "prettier --check \"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",
|
"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",
|
"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: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",
|
"fix": "pnpm lint:fix && pnpm format",
|
||||||
"quality": "pnpm check && pnpm format:check && npx knip",
|
"quality": "pnpm check && pnpm format:check && npx knip",
|
||||||
"test:chunks": "tsx test/test-chunk-building.ts",
|
"test:chunks": "tsx test/test-chunk-building.ts",
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,13 @@ import { cn } from '@renderer/lib/utils';
|
||||||
import { useStore } from '@renderer/store';
|
import { useStore } from '@renderer/store';
|
||||||
import { normalizePath } from '@renderer/utils/pathNormalize';
|
import { normalizePath } from '@renderer/utils/pathNormalize';
|
||||||
import { projectColor } from '@renderer/utils/projectColor';
|
import { projectColor } from '@renderer/utils/projectColor';
|
||||||
import { deriveTaskDisplayId } from '@shared/utils/taskIdentity';
|
|
||||||
import {
|
import {
|
||||||
getNonEmptyTaskCategories,
|
getNonEmptyTaskCategories,
|
||||||
groupTasksByDate,
|
groupTasksByDate,
|
||||||
groupTasksByProject,
|
groupTasksByProject,
|
||||||
sortTasksByFreshness,
|
sortTasksByFreshness,
|
||||||
} from '@renderer/utils/taskGrouping';
|
} from '@renderer/utils/taskGrouping';
|
||||||
|
import { deriveTaskDisplayId } from '@shared/utils/taskIdentity';
|
||||||
import {
|
import {
|
||||||
Archive,
|
Archive,
|
||||||
ArrowUpDown,
|
ArrowUpDown,
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@ import {
|
||||||
} from '@renderer/utils/agentMessageFormatting';
|
} from '@renderer/utils/agentMessageFormatting';
|
||||||
import { formatAgentRole } from '@renderer/utils/formatAgentRole';
|
import { formatAgentRole } from '@renderer/utils/formatAgentRole';
|
||||||
import { stripAgentBlocks } from '@shared/constants/agentBlocks';
|
import { stripAgentBlocks } from '@shared/constants/agentBlocks';
|
||||||
import { formatTaskDisplayLabel } from '@shared/utils/taskIdentity';
|
|
||||||
import { extractMarkdownPlainText } from '@shared/utils/markdownTextSearch';
|
import { extractMarkdownPlainText } from '@shared/utils/markdownTextSearch';
|
||||||
import { isRateLimitMessage } from '@shared/utils/rateLimitDetector';
|
import { isRateLimitMessage } from '@shared/utils/rateLimitDetector';
|
||||||
|
import { formatTaskDisplayLabel } from '@shared/utils/taskIdentity';
|
||||||
import { AlertTriangle, ChevronRight, ListPlus, RefreshCw, Reply } from 'lucide-react';
|
import { AlertTriangle, ChevronRight, ListPlus, RefreshCw, Reply } from 'lucide-react';
|
||||||
|
|
||||||
import { isManagedCollapseState } from './collapseState';
|
import { isManagedCollapseState } from './collapseState';
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,13 @@ const TOKEN_COLOR_CLASS: Record<TokenType, string> = {
|
||||||
function readWorktreeHistory(teamName: string): string[] {
|
function readWorktreeHistory(teamName: string): string[] {
|
||||||
try {
|
try {
|
||||||
const raw = localStorage.getItem(`team:worktreeHistory:${teamName}`);
|
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 {
|
} catch {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
@ -184,7 +190,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
|
||||||
{/* Collapsible header */}
|
{/* Collapsible header */}
|
||||||
<button
|
<button
|
||||||
type="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)}
|
onClick={() => setIsOpen(!isOpen)}
|
||||||
>
|
>
|
||||||
<ChevronRight
|
<ChevronRight
|
||||||
|
|
@ -217,7 +223,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
|
||||||
<PopoverAnchor asChild>
|
<PopoverAnchor asChild>
|
||||||
<Input
|
<Input
|
||||||
placeholder="worktree-name"
|
placeholder="worktree-name"
|
||||||
className="h-7 text-xs font-mono"
|
className="h-7 font-mono text-xs"
|
||||||
value={worktreeName}
|
value={worktreeName}
|
||||||
onChange={(e) => onWorktreeNameChange(e.target.value)}
|
onChange={(e) => onWorktreeNameChange(e.target.value)}
|
||||||
onFocus={() => setShowHistory(true)}
|
onFocus={() => setShowHistory(true)}
|
||||||
|
|
@ -244,7 +250,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
|
||||||
<button
|
<button
|
||||||
key={name}
|
key={name}
|
||||||
type="button"
|
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) => {
|
onMouseDown={(e) => {
|
||||||
e.preventDefault(); // Prevent input blur
|
e.preventDefault(); // Prevent input blur
|
||||||
onWorktreeNameChange(name);
|
onWorktreeNameChange(name);
|
||||||
|
|
@ -265,7 +271,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
|
||||||
Command preview
|
Command preview
|
||||||
</span>
|
</span>
|
||||||
<div className="overflow-x-auto rounded border border-border bg-surface-sidebar px-2.5 py-1.5">
|
<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) => (
|
{previewTokens.map((token, i) => (
|
||||||
<span key={i} className={TOKEN_COLOR_CLASS[token.type]}>
|
<span key={i} className={TOKEN_COLOR_CLASS[token.type]}>
|
||||||
{token.text}
|
{token.text}
|
||||||
|
|
@ -283,7 +289,7 @@ export const AdvancedCliSection: React.FC<AdvancedCliSectionProps> = ({
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Input
|
<Input
|
||||||
placeholder="--max-turns 5"
|
placeholder="--max-turns 5"
|
||||||
className="h-7 flex-1 text-xs font-mono"
|
className="h-7 flex-1 font-mono text-xs"
|
||||||
value={customArgs}
|
value={customArgs}
|
||||||
onChange={(e) => handleCustomArgsChange(e.target.value)}
|
onChange={(e) => handleCustomArgsChange(e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue