chore: merge develop into hare/develop
This commit is contained in:
@@ -358,6 +358,38 @@ Deno.serve({ hostname: "127.0.0.1", port }, async (request) => {
|
||||
if (url.pathname === `/api/w/${workspaceId}/working-directories`) {
|
||||
return json({ workspace_id: workspaceId, items: [], diagnostics: [] });
|
||||
}
|
||||
if (url.pathname === `/api/w/${workspaceId}/workers/launch-options`) {
|
||||
return json({
|
||||
workspace_id: workspaceId,
|
||||
runtimes: [{
|
||||
runtime_id: "embedded-worker-runtime",
|
||||
display_name: "Embedded Runtime",
|
||||
built_in: true,
|
||||
worker_creation_available: true,
|
||||
working_directory_required: false,
|
||||
status: "active",
|
||||
diagnostics: [],
|
||||
}],
|
||||
default_profile: "builtin:companion",
|
||||
profiles: [
|
||||
{
|
||||
id: "builtin:companion",
|
||||
label: "Companion",
|
||||
description: "General Workspace assistance with explicit subject Memory support.",
|
||||
feature_connections: { subjektiv: true },
|
||||
},
|
||||
{
|
||||
id: "builtin:standalone",
|
||||
label: "Standalone",
|
||||
description: "Independent Worker without Workspace subject Memory support.",
|
||||
feature_connections: { subjektiv: false },
|
||||
},
|
||||
],
|
||||
repositories: [],
|
||||
working_directories: [],
|
||||
diagnostics: [],
|
||||
});
|
||||
}
|
||||
|
||||
const subjectsPath = `/api/w/${workspaceId}/subjektiv/subjects`;
|
||||
if (url.pathname === subjectsPath) {
|
||||
|
||||
@@ -146,7 +146,7 @@ async function swipeMainToEnd(page: Page): Promise<void> {
|
||||
throw new Error("touch input did not reach the end of the resident Memory surface");
|
||||
}
|
||||
|
||||
Deno.test("production subject Memory shell renders exact states, safe Markdown, provenance, and one scroll owner", async () => {
|
||||
Deno.test("production subject Memory and Worker launch shells preserve exact scoped behavior", async () => {
|
||||
const build = await new Deno.Command(Deno.execPath(), {
|
||||
args: ["task", "build"],
|
||||
cwd: workspaceRoot,
|
||||
@@ -407,6 +407,49 @@ Deno.test("production subject Memory shell renders exact states, safe Markdown,
|
||||
await page.close();
|
||||
}
|
||||
await stateContext.close();
|
||||
|
||||
const launchContext = await browser.newContext({ viewport: { width: 768, height: 900 } });
|
||||
const launchPage = await launchContext.newPage();
|
||||
await launchPage.goto(`${baseUrl}/w/${workspaceId}/workers/new`);
|
||||
await launchPage.getByRole("heading", { name: "New Worker", level: 1 }).waitFor();
|
||||
const subjectConnection = launchPage.locator(
|
||||
'[data-worker-feature-connection="subjektiv"]',
|
||||
);
|
||||
await subjectConnection.waitFor();
|
||||
const subjectSelect = launchPage.getByRole("combobox", {
|
||||
name: "Subject Memory connection",
|
||||
});
|
||||
assertEquals(await subjectSelect.locator('option[value="error-subject"]').count(), 0);
|
||||
assertEquals(await subjectSelect.locator('option[value="paged-subject"]').count(), 0);
|
||||
await launchPage.getByRole("button", { name: "Load more subjects" }).click();
|
||||
await subjectSelect.locator('option[value="paged-subject"]').waitFor({ state: "attached" });
|
||||
await subjectSelect.selectOption(subjectId);
|
||||
assertEquals(await subjectSelect.inputValue(), subjectId);
|
||||
assertEquals(
|
||||
await subjectConnection.locator("code", { hasText: subjectId }).count(),
|
||||
1,
|
||||
);
|
||||
|
||||
const profileSelect = launchPage.getByRole("combobox", { name: "Profile" });
|
||||
await profileSelect.selectOption("builtin:standalone");
|
||||
assertEquals(await subjectConnection.count(), 0);
|
||||
await profileSelect.selectOption("builtin:companion");
|
||||
await subjectConnection.waitFor();
|
||||
assertEquals(await subjectSelect.inputValue(), "");
|
||||
|
||||
await subjectSelect.selectOption(subjectId);
|
||||
const createRequestPromise = launchPage.waitForRequest((request) =>
|
||||
request.method() === "POST" &&
|
||||
new URL(request.url()).pathname === `/api/w/${workspaceId}/workers`
|
||||
);
|
||||
await launchPage.getByRole("button", { name: "Start Worker" }).click();
|
||||
const createRequest = await createRequestPromise;
|
||||
const createPayload = createRequest.postDataJSON();
|
||||
assertEquals(createPayload.profile, "builtin:companion");
|
||||
assertEquals(createPayload.feature_connections, {
|
||||
subjektiv: { subject_id: subjectId },
|
||||
});
|
||||
await launchContext.close();
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user