Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ build-packages:
done
@echo " 📦 Building packages/server bundle..."
@( cd packages/server && bun run build:server ) || exit $$?
@if [ -f packages/owletto/package.json ]; then \
echo " 📦 Building packages/owletto (web UI)..."; \
( cd packages/owletto && bun run build ) || exit $$?; \
else \
echo " ⚠️ packages/owletto absent — CLI will ship headless (API only)"; \
fi
@echo " 📦 Building packages/cli..."
@( cd packages/cli && bun run build ) || exit $$?
@echo "✅ All packages built successfully!"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:coverage": "bun test packages/core/src packages/agent-worker/src packages/landing/src --coverage",
"typecheck": "tsc --noEmit",
"dev": "./scripts/dev-native.sh",
"build:packages": "cd packages/core && bun run build && cd ../connector-sdk && bun run build && cd ../agent-worker && bun run build && cd ../openclaw-plugin && bun run build && cd ../embeddings && bun run build && cd ../connector-worker && bun run build && cd ../promptfoo-provider && bun run build && cd ../server && bun run build:server && cd ../cli && bun run build",
"build:packages": "cd packages/core && bun run build && cd ../connector-sdk && bun run build && cd ../agent-worker && bun run build && cd ../openclaw-plugin && bun run build && cd ../embeddings && bun run build && cd ../connector-worker && bun run build && cd ../promptfoo-provider && bun run build && cd ../server && bun run build:server && cd .. && if [ -f owletto/package.json ]; then (cd owletto && bun run build); else echo '[build:packages] owletto submodule absent — CLI ships headless (API only)'; fi && cd cli && bun run build",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify pgvector-embedded is built before packages that depend on it

echo "=== Checking if pgvector-embedded is in the build sequence ==="
grep -n "pgvector-embedded" package.json Makefile

echo -e "\n=== Checking packages that import pgvector-embedded ==="
rg -l "`@lobu/pgvector-embedded`" --type=ts --type=json -g '!node_modules' -g '!dist' -g '!*.lock'

Repository: lobu-ai/lobu

Length of output: 599


🏁 Script executed:

git diff HEAD~1 package.json | head -100

Repository: lobu-ai/lobu

Length of output: 243


🏁 Script executed:

cat packages/pgvector-embedded/package.json | head -30

Repository: lobu-ai/lobu

Length of output: 785


🏁 Script executed:

rg "pgvector-embedded" packages/server/package.json packages/cli/package.json

Repository: lobu-ai/lobu

Length of output: 203


🏁 Script executed:

rg "vitest|pgvector" --type=json --type=ts -B 3 -A 3 | head -50

Repository: lobu-ai/lobu

Length of output: 3762


🏁 Script executed:

cat -n packages/server/package.json | grep -A 5 -B 5 "pgvector-embedded"

Repository: lobu-ai/lobu

Length of output: 436


🏁 Script executed:

fd -e "yml" -e "yaml" -e "json" "(workflow|ci|github|action)" | head -10

Repository: lobu-ai/lobu

Length of output: 97


🏁 Script executed:

find . -path "*/.*" -prune -o -name "*.yml" -o -name "*.yaml" | grep -E "(github|workflow|ci|action)" | head -20

Repository: lobu-ai/lobu

Length of output: 109


🏁 Script executed:

ls -la | grep -E "(\.github|action|workflow|ci|\.yml|\.yaml)"

Repository: lobu-ai/lobu

Length of output: 259


🏁 Script executed:

cat packages/server/package.json | grep -A 5 "scripts"

Repository: lobu-ai/lobu

Length of output: 648


🏁 Script executed:

ls -la .github/workflows/

Repository: lobu-ai/lobu

Length of output: 1135


🏁 Script executed:

find .github -type f -name "*.yml" -o -name "*.yaml" | xargs cat | head -200

Repository: lobu-ai/lobu

Length of output: 6749


🏁 Script executed:

cat package.json | grep -A 20 "build:packages"

Repository: lobu-ai/lobu

Length of output: 1870


🏁 Script executed:

cat .github/workflows/security-tests.yml

Repository: lobu-ai/lobu

Length of output: 6829


🏁 Script executed:

grep -n "build:packages\|Makefile" .github/workflows/security-tests.yml

Repository: lobu-ai/lobu

Length of output: 38


🏁 Script executed:

cat packages/server/src/embedded-runtime.ts | head -50

Repository: lobu-ai/lobu

Length of output: 2107


🏁 Script executed:

rg "pgvector-embedded|embedded-postgres|embedded-runtime" packages/server/src/__tests__/webhook-signatures.test.ts

Repository: lobu-ai/lobu

Length of output: 38


🏁 Script executed:

ls -la packages/pgvector-embedded/dist/ 2>/dev/null || echo "dist not found"

Repository: lobu-ai/lobu

Length of output: 71


🏁 Script executed:

cat packages/server/package.json | grep -E '"dependencies"|"devDependencies"' -A 50 | head -60

Repository: lobu-ai/lobu

Length of output: 1848


🏁 Script executed:

head -30 packages/server/src/__tests__/webhook-signatures.test.ts

Repository: lobu-ai/lobu

Length of output: 1354


🏁 Script executed:

cat packages/pgvector-embedded/package.json | grep -E '"scripts"|"main"|"types"|"exports"' -A 10

Repository: lobu-ai/lobu

Length of output: 482


🏁 Script executed:

git log --oneline packages/pgvector-embedded/package.json 2>/dev/null | head -5

Repository: lobu-ai/lobu

Length of output: 119


🏁 Script executed:

grep -n "pgvector-embedded" .github/workflows/ci.yml

Repository: lobu-ai/lobu

Length of output: 275


🏁 Script executed:

cat .github/workflows/build-pgvector-embedded.yml | head -100

Repository: lobu-ai/lobu

Length of output: 3868


🏁 Script executed:

# Final check: Is pgvector-embedded actually built before server in the build:packages sequence?
echo "=== build:packages sequence ==="
cat package.json | jq -r '.scripts."build:packages"' | tr '&&' '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | grep -E "cd|run"

Repository: lobu-ai/lobu

Length of output: 545


Add pgvector-embedded to the build:packages sequence before server.

The package.json build:packages script is missing pgvector-embedded, which both server and cli depend on as workspace dependencies. The Makefile correctly includes it (after core), but package.json does not, creating an inconsistency. When server builds without pgvector-embedded's dist files available, workspace resolution can fail, which would explain the @lobu/pgvector-embedded error. Add pgvector-embedded to the build sequence after core and before connector-sdk to match the Makefile.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 22, The build:packages npm script is missing the
workspace package `@lobu/pgvector-embedded`, causing workspace resolution
failures; update the "build:packages" script to run the build for
pgvector-embedded (add a step invoking bun run build in the pgvector-embedded
package) immediately after packages/core and before connector-sdk so the
sequence matches the Makefile and ensures pgvector-embedded's dist files are
available for server and cli builds.

"build:lobu": "cd packages/embeddings && bun run build && cd ../..",
"watch:packages": "tsc -b --watch packages/core packages/agent-worker",
"test:packages": "cd packages/core && bun run test && cd ../agent-worker && bun run test",
Expand Down
10 changes: 10 additions & 0 deletions packages/cli/scripts/build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ copyDirIfExists("../connectors/src", "dist/connectors");
// Copy database migrations for the bundled PGlite local server.
copyDirIfExists("../../db/migrations", "dist/db/migrations");

// Copy the built owletto web UI (admin/console SPA) next to the server bundle
// so `lobu run` serves it — OAuth, MCP-client setup, and connection CRUD have
// no surface without it. owletto is a private submodule (`private: true`);
// only its compiled `dist/` ships in the CLI tarball, never the source. CI's
// publish flow builds it (`bun run build` in packages/owletto, gated on the
// submodule being present) before this script runs. Missing locally (fork or
// uninitialised submodule) → the copy is skipped and `lobu run` boots headless
// (API only), matching prior behaviour. `dev.ts` points WEB_DIST_DIR here.
copyDirIfExists("../owletto/dist", "dist/owletto/dist");

// Copy server bundles so `lobu run` is self-contained.
// @lobu/server is private (`private: true` in its package.json),
// so `npx @lobu/cli` users can never resolve it via npm — they only get
Expand Down
12 changes: 12 additions & 0 deletions packages/cli/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,24 @@ export async function devCommand(
envVars.LOBU_PROVIDER_REGISTRY_PATH ||
(existsSync(bundledProvidersPath) ? bundledProvidersPath : undefined);

// Bundled CLIs ship the built owletto web UI next to the server bundle (see
// packages/cli/scripts/build.cjs). Point the server at it unless the user or
// .env already set WEB_DIST_DIR. In a monorepo checkout the bundle's sibling
// dir has no owletto/dist, so this stays undefined and the server's own
// monorepo-relative lookup / Vite dev path takes over.
const bundledWebDistPath = join(dirname(bundlePath), "owletto", "dist");
const webDistDir =
process.env.WEB_DIST_DIR ||
envVars.WEB_DIST_DIR ||
(existsSync(bundledWebDistPath) ? bundledWebDistPath : undefined);

const childEnv: Record<string, string> = {
...mergedEnv,
LOBU_DEV_PROJECT_PATH: projectPath,
...(providerRegistryPath
? { LOBU_PROVIDER_REGISTRY_PATH: providerRegistryPath }
: {}),
...(webDistDir ? { WEB_DIST_DIR: webDistDir } : {}),
PORT: String(portNum),
GATEWAY_PORT: String(portNum),
...(logLevel ? { LOG_LEVEL: logLevel } : {}),
Expand Down
Loading