// offending code· 3 files flaggedpatterns: 12
--- install scripts ---
### postinstall
node src/interfaces/cli/postinstall.js
### prepare
node scripts/install-githooks.js
### prepack
node scripts/sync-apc-skill.js && node scripts/build-web.js
--- package/package.json (excerpt) ---
{
"name": "@agentprojectcontext/apx",
"version": "1.30.2",
"description": "APX — unified CLI + daemon for the Agent Project Context (APC) standard.",
"publishConfig": {
"access": "public"
},
"license": "MIT",
"type": "module",
"bin": {
"apx": "./src/interfaces/cli/index.js",
"apx-daemon": "./src/host/daemon/index.js",
"apx-mcp": "./src/interfaces/mcp-server/index.js"
},
"files": [
"src/",
"skills/",
"README.md",
"!**/node_modules/**",
"!**/e2e/**",
"!**/playwright-report/**",
"!**/test-results/**",
"!**/*.tsbuildinfo"
],
"engines": {
"node": ">=18"
},
"scripts": {
"start": "node src/host/daemon/index.js",
"smoke": "node src/host/daemon/smoke.js",
"test": "node --test --test-reporter=spec tests/*.test.js",
"build:web": "node scripts/build-web.js",
"preflight": "npm test && node scripts/build-web.js && (cd src/interfaces/web && npx --no-install tsc --noEmit)",
"upgrade": "pnpm install && pnpm add -g .",
"prepare": "node scripts/install-githooks.js",
"prepack": "node scripts/sync-apc-skill.js && node scripts/build-web.js",
"postinstall": "node src/interfaces/cli/postinstall.js"
},
"packageManager": "pnpm@10.25.0",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"@opentui/core": "^0.2.16",
"@opentui/keymap": "^0.2.16",
"@opentui/solid": "^0.2.16",
"@solid-primitives/event-bus": "^1.1.3",
"@solid-primitives/scheduled": "^1.5.2"
--- package/src/interfaces/web/playwright.config.ts (excerpt) ---
import { defineConfig, devices } from "@playwright/test";
// E2E config for the APX web admin panel.
//
// Runs against `vite dev` on :7431, which proxies every daemon API prefix to
// the real daemon on :7430 (see vite.config.ts). Auth is automatic: the panel
// fetches /admin/web-token over the loopback proxy, and the fixture also seeds
// localStorage with the token captured in global-setup.
//
// global-setup registers a throwaway project (temp dir + `apx init`) so the
// mutating CRUD specs never touch the user's real projects; global-teardown
// unregisters it and removes the temp dir.
const WEB_URL = process.env.APX_WEB_URL || "http://localhost:7431";
export default defineConfig({
testDir: "./e2e",
globalSetup: "./e2e/global-setup.ts",
globalTeardown: "./e2e/global-teardown.ts",
// CRUD specs share one throwaway project and assert on ordered state, so we
// run serially with a single worker rather than in parallel.
fullyParallel: false,
workers: 1,
timeout: 30_000,
expect: { timeout: 10_000 },
reporter: [
["list"],
["html", { open: "never", outputFolder: "e2e/.playwright-report" }],
["./e2e/reporter-dated.ts"],
],
use: {
baseURL: WEB_URL,
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "off",
},
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
],
webServer: {
command: "pnpm exec vite --port 7431 --strictPort",
url: WEB_URL,
reuseExistingServer: true,
--- package/src/interfaces/web/vite.config.ts (excerpt) ---
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import path from "node:path";
// Vite config for the APX admin panel.
//
// - Single SPA, no SSR (this is a local admin tool).
// - During `vite dev`, every daemon API prefix is proxied to the running
// daemon so we develop the UI with hot reload against REAL data. Frontend
// routes (/, /settings, /p/:id) are NOT listed, so vite serves index.html
// for them (SPA routing).
// - `vite build` emits to ./dist; the daemon serves that folder when present.
const DAEMON_TARGET = process.env.APX_DAEMON_URL || "http://127.0.0.1:7430";
// Keep in sync with API_PREFIXES in src/host/daemon/api/shared.js — that's the
// source of truth for what is a daemon route. A missing prefix means `vite dev`
// silently serves the SPA shell for that call instead of the real response
// (e.g. an empty /pair/list).
const API_PREFIXES = [
"/health", "/admin", "/projects", "/telegram", "/engines", "/runtimes",
"/messages", "/sessions", "/tools", "/mcp", "/voice", "/tts", "/desktop", "/overlay",
"/transcribe", "/run", "/files", "/memory", "/env", "/pair", "/deck",
"/super-agent", "/identity", "/agents", "/tasks", "/code",
];
const proxy = Object.fromEntries(
API_PREFIXES.map((p) => [p, { target: DAEMON_TARGET, changeOrigin: false, ws: true }])
);
export default defineConfig({
plugins: [react(), tailwindcss()],
base: "/",
resolve: {
alias: {
"@":
--- dynamic destinations ---
→ api.telegram.org (via hostname-var)