Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: "CodeQL config"

paths-ignore:
- "ai_agents/**"

1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ jobs:
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
config-file: ./.github/codeql-config.yml

- name: Build C/C++ project
if: matrix.language == 'c-cpp' && matrix.build-mode == 'manual'
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/frontend_biome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Frontend Biome

on:
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened]
paths:
- "ai_agents/agents/examples/**"
- "ai_agents/playground/**"
- "core/src/ten_manager/designer_frontend/**"
- "Taskfile.yml"
- "biome.json"
- "package.json"
- "package-lock.json"
- ".github/workflows/frontend_biome.yml"
workflow_dispatch:

permissions:
contents: read
pull-requests: read

concurrency:
group: frontend-biome-${{ github.head_ref }}
cancel-in-progress: true

jobs:
call-check-pr-status:
uses: ./.github/workflows/_check_pr_status.yml

biome:
needs: call-check-pr-status
if: ${{ needs.call-check-pr-status.outputs.should_continue == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false

- uses: actions/setup-node@v4
with:
node-version: 20

- uses: go-task/setup-task@v1

- name: Run Biome lint + check
run: task biome-frontend
1 change: 1 addition & 0 deletions .task/checksum/biome-install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
905d59c27bc334ac9878d60432dbbadc
38 changes: 33 additions & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
version: "3"

includes:
ai_agents:
taskfile: ai_agents/Taskfile.yml
dir: ai_agents

vars:
OS: "linux"
ARCH: "x64"
Expand Down Expand Up @@ -37,3 +32,36 @@ tasks:
desc: clean build
cmds:
- rm -rf out

biome-install:
desc: install root node deps (biome)
internal: true
sources:
- package.json
- package-lock.json
generates:
- node_modules/.bin/biome
cmds:
- npm ci

biome-frontend-lint:
desc: run biome lint for frontends
deps: [biome-install]
vars:
FRONTEND_PATHS: "ai_agents/agents/examples ai_agents/playground core/src/ten_manager/designer_frontend"
cmds:
- ./node_modules/.bin/biome lint {{.FRONTEND_PATHS}}

biome-frontend-check:
desc: run biome check for frontends
deps: [biome-install]
vars:
FRONTEND_PATHS: "ai_agents/agents/examples ai_agents/playground core/src/ten_manager/designer_frontend"
cmds:
- ./node_modules/.bin/biome check {{.FRONTEND_PATHS}}

biome-frontend:
desc: run biome lint and check for frontends
cmds:
- task: biome-frontend-lint
- task: biome-frontend-check
2 changes: 1 addition & 1 deletion ai_agents/agents/examples/demo/frontend/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"lib": "@/lib",
"hooks": "@/hooks"
}
}
}
48 changes: 27 additions & 21 deletions ai_agents/agents/examples/demo/frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
/** @type {import('next').NextConfig} */
import path from 'path'
import fs from 'fs'
import { fileURLToPath } from 'url'

import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

// Derive __dirname in ESM
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const nextConfig = {
// basePath: '/ai-agent',
// output: 'export',
output: 'standalone',
output: "standalone",
reactStrictMode: false,
webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.('.svg'),
)
rule.test?.test?.(".svg")
);

config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
Expand All @@ -30,33 +31,38 @@ const nextConfig = {
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ['@svgr/webpack'],
},
)
use: ["@svgr/webpack"],
}
);

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i
fileLoaderRule.exclude = /\.svg$/i;

// Ensure TS path alias `@/*` resolves to `src/*` in webpack too
config.resolve = config.resolve || {}
config.resolve = config.resolve || {};
config.resolve.alias = {
...(config.resolve.alias || {}),
'@': path.resolve(__dirname, 'src'),
}
"@": path.resolve(__dirname, "src"),
};

// Debug logs to verify alias + file presence during CI builds
try {
const aliasPath = config.resolve.alias['@']
const utilPath = path.join(aliasPath, 'lib', 'utils.ts')
const aliasPath = config.resolve.alias["@"];
const utilPath = path.join(aliasPath, "lib", "utils.ts");
// eslint-disable-next-line no-console
console.log('[next.config] alias @ →', aliasPath, '| utils.ts exists =', fs.existsSync(utilPath))
console.log(
"[next.config] alias @ →",
aliasPath,
"| utils.ts exists =",
fs.existsSync(utilPath)
);
} catch (e) {
// eslint-disable-next-line no-console
console.log('[next.config] alias debug error:', e?.message)
console.log("[next.config] alias debug error:", e?.message);
}

return config
}
return config;
},
};

export default nextConfig;
2 changes: 1 addition & 1 deletion ai_agents/agents/examples/demo/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
"typescript": "^5"
},
"packageManager": "[email protected]"
}
}
4 changes: 2 additions & 2 deletions ai_agents/agents/examples/demo/frontend/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
viewportWidth: 375,
exclude: /node_modules/,
include: /\/src\/platform\/mobile\//,
}
},
},
}
};
Loading
Loading