From f4c55248a0c179be2dcc4b0602fc7e39784ab9da Mon Sep 17 00:00:00 2001 From: Pontapalli Ganesh Date: Tue, 10 Nov 2026 14:01:04 +0530 Subject: [PATCH] fix(packages): allow spaces in path specs for shipped extensions SPEC_RE rejected absolute folder paths containing spaces, causing 'Spec must look like...' errors when the portal is installed in a directory with spaces (e.g. 'New Project/pithagoras'). Shipped extensions install by passing their absolute folder path as the spec. The character class [\w@./:+-] excluded spaces, so any path with a space was rejected before reaching the pi CLI. Added a space to the character class: [\w@./:+ -] --- core/server/src/api/packages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/src/api/packages.ts b/core/server/src/api/packages.ts index 4f2cdd67..46a54ae7 100644 --- a/core/server/src/api/packages.ts +++ b/core/server/src/api/packages.ts @@ -39,7 +39,7 @@ async function runPi(args: string[]): Promise<{ stdout: string; stderr: string } // A package spec is passed to the CLI as a single argument (never a shell // string), but keep it to shapes pi documents so typos fail fast and nothing // odd reaches execFile. -const SPEC_RE = /^(npm:|git:|https:\/\/|\.{0,2}\/)[\w@./:+-]+$/; +const SPEC_RE = /^(npm:|git:|https:\/\/|\.{0,2}\/)[\w@./:+ -]+$/; /** An npm package within a range of versions, as an extension that requires it says it: `npm:@^1.0.0` (see install-plan.ts). */ const inRange = (spec: string) => { const match = /^npm:((?:@[\w.~-]+\/)?[\w.~-]+)@(.+)$/.exec(spec);