diff --git a/README.md b/README.md index 39e88a6..361f35b 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,8 @@ Runtime/toolchain versions used during development: - OpenShell CLI and gateway compatible with current `NVIDIA/NemoClaw` blueprint constraints - NemoClaw CLI compatible with the current `NVIDIA/NemoClaw` repo +Sandbox creation follows NemoClaw's OpenShell routed-name contract: names are 1-19 characters, start with a lowercase letter, contain only lowercase letters, numbers, and single internal hyphens, and end with a letter or number. + Use `./install_versioned_nemoclaw_openshell.sh` to install or refresh the OpenShell/NemoClaw pair. Override `OPENSHELL_VERSION`, `NEMOCLAW_INSTALL_REF`, or `OPENCLAW_VERSION` only when intentionally testing a different pair. The app uses Next.js `15.5.15`, React `18.3.1`, TypeScript, Tailwind CSS, `ws`, `node-pty`, and the official MCP TypeScript SDK. diff --git a/app/api/sandbox/create/route.ts b/app/api/sandbox/create/route.ts index 1272c0a..01b7696 100644 --- a/app/api/sandbox/create/route.ts +++ b/app/api/sandbox/create/route.ts @@ -27,9 +27,9 @@ const NEMOCLAW_STATE_ROOT = path.join(process.env.HOME || "/tmp", ".nemoclaw") function validateSandboxName(name: string) { if (!name || typeof name !== "string") throw new Error("sandbox name is required") - if (name.length > 63) throw new Error("sandbox name too long (max 63 chars)") - if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(name)) { - throw new Error("sandbox name must be lowercase alphanumeric with optional internal hyphens") + if (name.length > 19) throw new Error("sandbox name too long (max 19 chars)") + if (!/^(?!.*--)[a-z]([a-z0-9-]*[a-z0-9])?$/.test(name)) { + throw new Error("sandbox name must start with a lowercase letter and contain only lowercase letters, numbers, and single internal hyphens") } return name } diff --git a/app/components/ConfigurationPanel.tsx b/app/components/ConfigurationPanel.tsx index 2d1f957..2035c65 100644 --- a/app/components/ConfigurationPanel.tsx +++ b/app/components/ConfigurationPanel.tsx @@ -220,8 +220,8 @@ export default function ConfigurationPanel({ sandboxId, mode = 'existing', onCre ))}
- - setSandboxName(e.target.value)} placeholder={selectedBlueprint === 'nemoclaw-hermes' ? 'my-hermes' : selectedBlueprint === 'nemoclaw-deepagents-code' ? 'my-deepagents-code' : selectedBlueprint === 'nemoclaw-blueprint' ? 'my-assistant' : selectedBlueprint === 'redeploy-image' ? 'my-assistant-copy' : 'custom-sandbox'} className="mt-2 w-full rounded-sm border border-[var(--border-subtle)] bg-[var(--background)] px-3 py-2 text-xs font-mono text-[var(--foreground)]" /> + + setSandboxName(e.target.value)} maxLength={19} pattern="(?!.*--)[a-z](?:[a-z0-9-]*[a-z0-9])?" placeholder={selectedBlueprint === 'nemoclaw-hermes' ? 'my-hermes' : selectedBlueprint === 'nemoclaw-deepagents-code' ? 'my-deepagents-code' : selectedBlueprint === 'nemoclaw-blueprint' ? 'my-assistant' : selectedBlueprint === 'redeploy-image' ? 'my-assistant-copy' : 'custom-sandbox'} className="mt-2 w-full rounded-sm border border-[var(--border-subtle)] bg-[var(--background)] px-3 py-2 text-xs font-mono text-[var(--foreground)] focus:outline-none focus:border-[var(--nvidia-green)]" />
diff --git a/app/components/WizardPanel.tsx b/app/components/WizardPanel.tsx index f64ab3e..b3c6419 100644 --- a/app/components/WizardPanel.tsx +++ b/app/components/WizardPanel.tsx @@ -51,7 +51,8 @@ function contentDispositionFileName(value: string | null, fallback: string) { function defaultCloneName(source?: SandboxInventoryItem) { if (!source) return "" - return `${source.name.replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "")}-clone`.slice(0, 63) + const base = source.name.replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, 13).replace(/-+$/g, "") + return `${base || "sandbox"}-clone` } export default function WizardPanel({ @@ -134,7 +135,7 @@ export default function WizardPanel({ const canContinue = (() => { if (activeStep === "source") return Boolean(sourceSandbox) - if (activeStep === "target") return /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(targetName) && targetName.length <= 63 + if (activeStep === "target") return /^(?!.*--)[a-z]([a-z0-9-]*[a-z0-9])?$/.test(targetName) && targetName.length <= 19 if (activeStep === "options") return Boolean(backupPath.trim() && restorePath.trim()) if (activeStep === "review") return Boolean(sourceSandbox && targetName.trim()) return false @@ -626,9 +627,12 @@ export default function WizardPanel({ setTargetName(event.target.value)} + maxLength={19} + pattern="(?!.*--)[a-z](?:[a-z0-9-]*[a-z0-9])?" placeholder="source-clone" className="w-full rounded-sm border border-[var(--border-subtle)] bg-[var(--background-tertiary)] px-3 py-2 text-xs font-mono text-[var(--foreground)] focus:outline-none focus:border-[var(--nvidia-green)]" /> + 1-19 characters; start with a lowercase letter; no consecutive hyphens. {activeBlueprint?.supportsTailscale && (