nexus/server/src/services
Nexus Dev 22e14545d4 fix(nexus): extend tilde expansion and mkdir to all user path endpoints
Follow-up to commit 91530b07 which only covered agents.adapter_config
.cwd. An audit found three additional user-facing endpoints that
accept filesystem paths without normalization. Same zero-terminal bug
in each: user supplies "~/foo", server stores it raw, downstream
consumers can't resolve the tilde.

Extract the two helpers (expandUserPath, normalizeWorkspaceDir) from
the agents.ts closure into a shared utility so all endpoints use the
same primitive.

new: server/src/utils/path-normalization.ts
  - expandUserPath(candidate): resolves ~ / ~/foo to homedir() and
    path.resolve() to absolute. Null-safe on non-string input.
  - normalizeWorkspaceDir(rawPath, { field }): expand + assert
    absolute + mkdir -p + stat isDirectory + log the change.
    Throws unprocessable (422) on any filesystem failure with a
    field-aware error message.

changed: server/src/routes/agents.ts
  - Replaced the inline expandUserPath + normalizeAdapterConfigPaths
    helpers with a narrow wrapper that delegates to the shared utility.
    Three call sites (create, hire, patch) unchanged in behavior.
  - Removed now-unused imports: mkdir, stat, homedir.

changed: server/src/routes/projects.ts
  - POST /projects/:id/workspaces: normalize req.body.cwd before the
    service call.
  - PATCH /projects/:id/workspaces/:workspaceId: same.
  - Added import.

changed: server/src/routes/execution-workspaces.ts
  - PATCH /execution-workspaces/🆔 normalize req.body.cwd before the
    patch object is built.
  - Added import.

changed: server/src/services/nexus-settings.ts
  - In set(): expand ~ in piperBinaryPath and whisperBinaryPath before
    merging and validating. These are executable paths so we expand
    but don't mkdir — caller still has to install the binary itself,
    but the stored path is now resolvable by the server.
  - Added import.

Not extended:
  - Storage provider baseDir: computed at startup from environment,
    not user request body. Sandboxed. No change needed.
  - Instructions bundle paths: indirectly covered — the legacy path
    resolver depends on cwd being absolute, which 91530b07 ensures.
  - Chat file upload object keys: system-generated, not user-supplied.

Verification: npx tsc --noEmit on server — zero errors introduced in
any touched file. Dev server on :6100 still returns 200.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 18:22:33 +00:00
..
renderers feat: Phase 44 — Video & Presentations (Remotion MP4, SSE progress) 2026-04-05 09:57:11 +00:00
access.ts Remove api trigger kind and mark webhook as coming soon 2026-03-20 06:54:03 -05:00
activity-log.ts Add username log censor setting 2026-03-20 08:50:00 -05:00
activity.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
agent-instructions.ts chore: mark bootstrapPromptTemplate as deprecated 2026-03-26 11:12:25 -05:00
agent-permissions.ts Implement agent hiring, approval workflows, config revisions, LLM reflection, and sidebar badges 2026-02-19 13:02:41 -06:00
agents.ts Fix budget auth and monthly spend rollups 2026-03-16 15:41:48 -05:00
approvals.ts Add username log censor setting 2026-03-20 08:50:00 -05:00
assets.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
assistant-memory.ts feat(33-01,33-02): memory service + sanitizer, personal assistant page 2026-04-04 03:55:49 +00:00
board-auth.ts Address Greptile review on board CLI auth 2026-03-23 08:46:05 -05:00
budgets.ts Fix budget incident resolution edge cases 2026-03-16 16:48:13 -05:00
chat-files.ts feat(25-07): create placeholderService and add markAsPlaceholder method 2026-04-04 03:55:48 +00:00
chat.ts fix(25): handle missing chat_files table in listMessages and update addMessage test 2026-04-04 03:55:48 +00:00
companies.ts Add feedback voting and thumbs capture flow 2026-04-02 09:11:49 -05:00
company-export-readme.ts [nexus] fix(06): resolve verifier gaps — portability fallback, export readme, CLI company descriptions, server error msg 2026-04-04 03:55:42 +00:00
company-portability.ts [nexus] fix(06): resolve verifier gaps — portability fallback, export readme, CLI company descriptions, server error msg 2026-04-04 03:55:42 +00:00
company-skills.ts feat(09-01): extract GitHub fetch helpers to shared module 2026-04-04 03:55:47 +00:00
content-job-runner.ts feat: Phase 44 — Video & Presentations (Remotion MP4, SSE progress) 2026-04-05 09:57:11 +00:00
content-job-store.ts feat: Phase 40 — Job Infrastructure (content jobs, SSE events, namespaced storage) 2026-04-05 09:55:08 +00:00
converter-capabilities.ts feat: Phase 42 — Wallpapers, Social, Format Conversion & Voice (12 platforms, convert pipeline, offline badge) 2026-04-05 09:56:53 +00:00
costs.ts Fix budget auth and monthly spend rollups 2026-03-16 15:41:48 -05:00
cron.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
dashboard.ts feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
default-agent-instructions.ts feat(08-01): add Generalist agent template bundle and wire role mapping 2026-04-04 03:55:42 +00:00
documents.ts Add feedback voting and thumbs capture flow 2026-04-02 09:11:49 -05:00
execution-workspace-policy.ts fix: address latest Greptile runtime review 2026-03-23 19:43:50 -05:00
execution-workspaces.ts Fix shared workspace close semantics 2026-03-29 10:55:26 -05:00
feedback-redaction.ts Add feedback voting and thumbs capture flow 2026-04-02 09:11:49 -05:00
feedback-share-client.ts Restore feedback trace export fixes 2026-04-03 15:59:42 -05:00
feedback.ts Restore feedback trace export fixes 2026-04-03 15:59:42 -05:00
finance.ts feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
git-file-service.ts feat(25-06): merge git file service and history endpoint from worktree 2026-04-04 03:55:48 +00:00
github-fetch.ts fix: harden GHE URL detection and extract shared GitHub helpers 2026-04-01 21:05:48 +00:00
github-skill-helpers.ts feat(09-01): extract GitHub fetch helpers to shared module 2026-04-04 03:55:42 +00:00
goals.ts Improve onboarding defaults and issue goal fallback 2026-03-12 08:50:31 -05:00
google-oauth.ts feat(31-02): add googleOAuthService with PKCE generation and token management 2026-04-04 03:55:49 +00:00
hardware.ts feat(39-02): voice capability probe in hardware service 2026-04-04 03:55:50 +00:00
heartbeat-run-summary.ts Fix issue run lookup and heartbeat run summaries 2026-03-11 17:23:33 -05:00
heartbeat.ts feat(28-02,28-03): Ollama UI surface + Hermes runtime dashboard 2026-04-04 03:55:49 +00:00
hire-hook.ts feat(openclaw): add adapter hire-approved hooks 2026-03-06 08:17:42 -06:00
index.ts feat: Phase 40 — Job Infrastructure (content jobs, SSE events, namespaced storage) 2026-04-05 09:55:08 +00:00
instance-settings.ts feat(inbox): add operator search and keyboard controls 2026-04-02 11:45:15 -05:00
issue-approvals.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
issue-assignment-wakeup.ts fix: close remaining routine merge blockers 2026-03-20 16:40:27 -05:00
issue-goal-fallback.ts Seed onboarding project and issue goal context 2026-03-24 11:48:59 -05:00
issues.ts feat(routines): add workspace-aware routine runs 2026-04-02 11:38:57 -05:00
live-events.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
local-service-supervisor.ts Add idempotent local dev service management 2026-03-29 10:55:26 -05:00
memory-sanitizer.ts feat(33-01,33-02): memory service + sanitizer, personal assistant page 2026-04-04 03:55:49 +00:00
nexus-settings.ts fix(nexus): extend tilde expansion and mkdir to all user path endpoints 2026-04-10 18:22:33 +00:00
ollama.ts feat(30-01): hardware detection, nexus-settings, extended model catalog 2026-04-04 03:55:49 +00:00
placeholder-service.ts feat(25-07): create placeholderService and add markAsPlaceholder method 2026-04-04 03:55:48 +00:00
plugin-capability-validator.ts Add plugin telemetry bridge capability 2026-04-02 10:47:29 -05:00
plugin-config-validator.ts Refactor secret-ref format registration to use a UI hint for Paperclip secret UUIDs 2026-03-14 15:43:56 -07:00
plugin-dev-watcher.ts Tighten plugin dev file watching 2026-03-14 12:07:04 -05:00
plugin-event-bus.ts Simplify plugin runtime and cleanup lifecycle 2026-03-13 16:58:29 -05:00
plugin-host-service-cleanup.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-host-services.ts Add plugin telemetry bridge capability 2026-04-02 10:47:29 -05:00
plugin-job-coordinator.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-job-scheduler.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-job-store.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-lifecycle.ts Simplify plugin runtime and cleanup lifecycle 2026-03-13 16:58:29 -05:00
plugin-loader.ts Enhance plugin loading and toolbar integration 2026-03-14 15:27:45 -07:00
plugin-log-retention.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-manifest-validator.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-registry.ts Simplify plugin runtime and cleanup lifecycle 2026-03-13 16:58:29 -05:00
plugin-runtime-sandbox.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-secrets-handler.ts Simplify plugin runtime and cleanup lifecycle 2026-03-13 16:58:29 -05:00
plugin-state-store.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-stream-bus.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-tool-dispatcher.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-tool-registry.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
plugin-worker-manager.ts Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
project-workspace-runtime-config.ts Add workspace runtime controls 2026-03-29 10:55:26 -05:00
projects.ts fix: append short UUID suffix to project slugs when non-ASCII characters are stripped to prevent slug collisions 2026-03-31 16:35:30 +00:00
pushService.ts feat(26-04): create push_subscriptions schema, migration, pushService, and push routes 2026-04-04 03:55:48 +00:00
puter-inference.ts feat: Phase 41 — Diagrams, Icons & Theme Engine (Mermaid, SVG icons, OKLCH palettes) 2026-04-05 09:56:37 +00:00
puter-proxy.ts feat(31-01): implement puterProxyService, puterProxyRoutes, and unit tests 2026-04-04 03:55:49 +00:00
quota-windows.ts feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
routines.ts Add versioned telemetry events 2026-04-03 09:25:00 -05:00
run-log-store.ts fix(server): use home-based path for run logs instead of cwd 2026-03-07 16:18:14 -08:00
secrets.ts Add routines automation workflows 2026-03-19 08:39:24 -05:00
sidebar-badges.ts Add touched/unread inbox issue semantics 2026-03-06 08:21:03 -06:00
skill-registry-db.ts feat: Phase 45 — Content as Skills (9 SKILL.md files, Creative group, gap fixes) 2026-04-05 09:57:20 +00:00
skill-registry-fetcher.ts feat: Phase 45 — Content as Skills (9 SKILL.md files, Creative group, gap fixes) 2026-04-05 09:57:20 +00:00
skill-registry-groups.ts [nexus] feat(19-01): unit tests for adapter-aware install/uninstall and Hermes dual-source 2026-04-04 03:55:42 +00:00
skill-registry-ratings.ts feat(12-01): personalRatings schema, DB DDL, skillRatingService, and tests 2026-04-04 03:55:42 +00:00
skill-registry-schema.ts [nexus] feat(19-01): adapter-aware skill service layer — source column, uninstall file removal, syncHermesNativeSkills 2026-04-04 03:55:42 +00:00
skill-registry.ts [nexus] feat(19-01): adapter-aware skill service layer — source column, uninstall file removal, syncHermesNativeSkills 2026-04-04 03:55:42 +00:00
telegram.ts feat(38-02): add voice message handling + TTS reply to Telegram bridge 2026-04-04 03:55:50 +00:00
voice-pipeline.ts feat(39-01): sentence-buffered TTS streaming + multi-language synthesis 2026-04-04 03:55:50 +00:00
work-products.ts Address remaining Greptile workspace review 2026-03-17 10:12:44 -05:00
workspace-operation-log-store.ts Add workspace operation tracking and fix project properties JSX 2026-03-17 09:36:35 -05:00
workspace-operations.ts Add username log censor setting 2026-03-20 08:50:00 -05:00
workspace-runtime.ts fix: use sh instead of /bin/sh as shell fallback on Windows (#891) 2026-04-02 17:34:26 -07:00