Merge remote-tracking branch 'origin/main' into role-mcp-access

# Conflicts:
#	AGENTS.md
#	backend/ee-repo-ref.txt
This commit is contained in:
hugocasa
2026-12-03 12:11:29 +01:00
91 changed files with 4001 additions and 969 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ async function create(
`Workspace already has datatable(s): ${existing
.map((d) => d.name)
.join(", ")}. Re-run with --force to add '${dtName}' ` +
"(note: fork metadata on existing datatables is not preserved)",
"(note: fork metadata and settings such as tables forked without rows are not preserved on existing datatables)",
);
}
+18 -6
View File
@@ -23,8 +23,14 @@ import {
readConfigFile,
} from "../../core/conf.ts";
/** Wait for a fork creation started in the background, by the id its request answered with. */
async function waitForForkCreation(parentWorkspace: string, creationId: string) {
/**
* Wait for a fork creation started in the background, by the id its request answered with.
* Resolves to what the created fork goes without.
*/
async function waitForForkCreation(
parentWorkspace: string,
creationId: string,
): Promise<string[]> {
let failingSince: number | undefined;
let lastStep: string | undefined;
while (true) {
@@ -47,7 +53,7 @@ async function waitForForkCreation(parentWorkspace: string, creationId: string)
lastStep = result.step;
log.info(colors.gray(`${lastStep}...`));
}
if (result?.status === "completed") return;
if (result?.status === "completed") return result.warnings ?? [];
if (result?.status === "failed") {
throw new Error(result.error ?? "Unknown error");
}
@@ -355,7 +361,7 @@ async function createWorkspaceFork(
)
);
await wmill.importPgDatabase({
const imported = await wmill.importPgDatabase({
workspace: workspace.workspaceId,
requestBody: {
source: `datatable://${dt.name}`,
@@ -365,6 +371,9 @@ async function createWorkspaceFork(
},
});
for (const warning of imported.split("\n").slice(1)) {
log.warn(colors.yellow(` ${warning}`));
}
log.info(colors.green(` ✓ Datatable "${dt.name}" cloned.`));
forkedDatatables.push({ name: dt.name, new_dbname: newDbName });
} catch (e) {
@@ -420,8 +429,11 @@ async function createWorkspaceFork(
},
});
// A server without background forks ignores the flag and answers once the fork is created.
if (!response.startsWith("Created forked workspace")) {
await waitForForkCreation(workspace.workspaceId, response);
const warnings = response.startsWith("Created forked workspace")
? response.split("\n").slice(1)
: await waitForForkCreation(workspace.workspaceId, response);
for (const warning of warnings) {
log.warn(colors.yellow(warning));
}
log.info(colors.green(`✅ Created forked workspace ${trueWorkspaceId}`));
+1 -1
View File
@@ -10,4 +10,4 @@ export const WM_FORK_PREFIX = "wm-fork";
// (e.g. utils.ts) can read it without importing main.ts and creating a circular
// dependency (main → workspace → utils → main) that triggers a TDZ.
// Re-exported from main.ts for backwards compatibility.
export const VERSION = "1.895.1";
export const VERSION = "1.896.0";