|
|
@@ -204,7 +204,7 @@ function normalize(defaults: unknown, raw: string, migrate?: (value: unknown) =>
|
|
|
}
|
|
|
|
|
|
function workspaceStorage(dir: string) {
|
|
|
- const head = dir.slice(0, 12) || "workspace"
|
|
|
+ const head = (dir.slice(0, 12) || "workspace").replace(/[^a-zA-Z0-9._-]/g, "-")
|
|
|
const sum = checksum(dir) ?? "0"
|
|
|
return `opencode.workspace.${head}.${sum}.dat`
|
|
|
}
|
|
|
@@ -300,6 +300,7 @@ export const PersistTesting = {
|
|
|
localStorageDirect,
|
|
|
localStorageWithPrefix,
|
|
|
normalize,
|
|
|
+ workspaceStorage,
|
|
|
}
|
|
|
|
|
|
export const Persist = {
|