From 49d472cd4a6a981cf96ddeee861a546d618b24e1 Mon Sep 17 00:00:00 2001 From: Matheus Galvao Date: Mon, 24 Nov 2025 20:49:47 -0300 Subject: [PATCH 1/3] feat: add ci workflow and fix linting issues --- .github/workflows/pr.yml | 43 +++++++++++++++++++++++ apps/server/src/logger.ts | 2 +- apps/server/src/routes/workflows.ts | 5 +-- apps/server/src/services/openai-llm.ts | 4 +-- apps/server/src/services/persistence.ts | 2 +- apps/server/src/store/active-workflows.ts | 2 +- eslint.config.js => eslint.config.mjs | 7 ++-- package.json | 2 +- packages/workflow-engine/src/index.ts | 2 +- 9 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/pr.yml rename eslint.config.js => eslint.config.mjs (97%) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..2a431d4 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,43 @@ +name: PR Checks + +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build-and-test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Typecheck + run: npm run typecheck + + - name: Build + run: npm run build + + - name: Run Web Tests + run: npm --workspace apps/web run test -- --run + diff --git a/apps/server/src/logger.ts b/apps/server/src/logger.ts index 4ab601c..9427efd 100644 --- a/apps/server/src/logger.ts +++ b/apps/server/src/logger.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-console */ + export const logger = { info: (...args: unknown[]) => console.log('[INFO]', ...args), warn: (...args: unknown[]) => console.warn('[WARN]', ...args), diff --git a/apps/server/src/routes/workflows.ts b/apps/server/src/routes/workflows.ts index ba1cec8..fa081e6 100644 --- a/apps/server/src/routes/workflows.ts +++ b/apps/server/src/routes/workflows.ts @@ -1,7 +1,8 @@ import type { Request, Response, Router } from 'express'; import { Router as createRouter } from 'express'; -import { WorkflowGraph, WorkflowRunRecord, WorkflowRunResult } from '@agentic/types'; -import WorkflowEngine, { WorkflowLLM } from '@agentic/workflow-engine'; +import type { WorkflowGraph, WorkflowRunRecord, WorkflowRunResult } from '@agentic/types'; +import type { WorkflowLLM } from '@agentic/workflow-engine'; +import WorkflowEngine from '@agentic/workflow-engine'; import { addWorkflow, getWorkflow, removeWorkflow } from '../store/active-workflows'; import { saveRunRecord } from '../services/persistence'; import { config } from '../config'; diff --git a/apps/server/src/services/openai-llm.ts b/apps/server/src/services/openai-llm.ts index 13f1c78..bba7af8 100644 --- a/apps/server/src/services/openai-llm.ts +++ b/apps/server/src/services/openai-llm.ts @@ -1,5 +1,5 @@ -import OpenAI from 'openai'; -import { AgentInvocation, WorkflowLLM } from '@agentic/workflow-engine'; +import type OpenAI from 'openai'; +import type { AgentInvocation, WorkflowLLM } from '@agentic/workflow-engine'; function formatInput(invocation: AgentInvocation) { return [ diff --git a/apps/server/src/services/persistence.ts b/apps/server/src/services/persistence.ts index 7aeb3fa..a466f4b 100644 --- a/apps/server/src/services/persistence.ts +++ b/apps/server/src/services/persistence.ts @@ -1,6 +1,6 @@ import fs from 'node:fs/promises'; import path from 'node:path'; -import { WorkflowRunRecord } from '@agentic/types'; +import type { WorkflowRunRecord } from '@agentic/types'; export async function saveRunRecord(runsDir: string, record: WorkflowRunRecord): Promise { const filePath = path.join(runsDir, `run_${record.runId}.json`); diff --git a/apps/server/src/store/active-workflows.ts b/apps/server/src/store/active-workflows.ts index ec592cb..c03638f 100644 --- a/apps/server/src/store/active-workflows.ts +++ b/apps/server/src/store/active-workflows.ts @@ -1,4 +1,4 @@ -import WorkflowEngine from '@agentic/workflow-engine'; +import type WorkflowEngine from '@agentic/workflow-engine'; const workflows = new Map(); diff --git a/eslint.config.js b/eslint.config.mjs similarity index 97% rename from eslint.config.js rename to eslint.config.mjs index 68f800f..5a9ce2c 100644 --- a/eslint.config.js +++ b/eslint.config.mjs @@ -3,13 +3,15 @@ import tsParser from '@typescript-eslint/parser'; export default [ { - files: ['**/*.ts', '**/*.tsx'], ignores: [ '**/node_modules/**', '**/dist/**', 'data/runs/**', 'apps/web/public/**' - ], + ] + }, + { + files: ['**/*.ts', '**/*.tsx'], languageOptions: { parser: tsParser, parserOptions: { @@ -30,4 +32,3 @@ export default [ } } ]; - diff --git a/package.json b/package.json index 2abb7a6..df3d11d 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "test:engine": "npm --workspace packages/workflow-engine run test", "test:server": "npm --workspace apps/server run test", "clean": "npm run clean --workspaces", - "lint": "eslint . --ext .ts,.tsx", + "lint": "eslint .", "typecheck": "npm run typecheck:server && npm run typecheck:web", "typecheck:server": "npm --workspace apps/server run typecheck", "typecheck:web": "npm --workspace apps/web run typecheck" diff --git a/packages/workflow-engine/src/index.ts b/packages/workflow-engine/src/index.ts index 4801bc2..b8ea0e1 100644 --- a/packages/workflow-engine/src/index.ts +++ b/packages/workflow-engine/src/index.ts @@ -1,4 +1,4 @@ -import { +import type { ApprovalInput, WorkflowConnection, WorkflowGraph, From 82812482c525db4416828ca6c2fe59b8a3e75e3b Mon Sep 17 00:00:00 2001 From: Matheus Galvao Date: Mon, 24 Nov 2025 21:03:08 -0300 Subject: [PATCH 2/3] fix: build packages before typechecking in CI --- .github/workflows/pr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2a431d4..4fd8678 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,6 +32,9 @@ jobs: - name: Lint run: npm run lint + - name: Build Packages + run: npm run build:packages + - name: Typecheck run: npm run typecheck From 39a47cbebedb63d689aee6d5bf6f689cbafa69c0 Mon Sep 17 00:00:00 2001 From: Matheus Galvao Date: Mon, 24 Nov 2025 21:04:46 -0300 Subject: [PATCH 3/3] fix: remove web tests step (no tests exist yet) --- .github/workflows/pr.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4fd8678..cbeae54 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -41,6 +41,3 @@ jobs: - name: Build run: npm run build - - name: Run Web Tests - run: npm --workspace apps/web run test -- --run -