Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Merge remote-tracking branch 'gh/train/nov30-u4b' into train/nov30-final

milind-sonic0dd16d1d476
diff --cc src/components/app/PageTools.test.ts
index ee3f5da61e,55e044fad5..2abca474f0
--- a/src/components/app/PageTools.test.ts
+++ b/src/components/app/PageTools.test.ts
@@@ -72,15 -73,12 +75,15 @@@ const PICK = { jsonrpc: "2.0", method:
beforeEach(() => {
fetchMock.mockReset();
- fetchMock.mockImplementation(async (path) => {
+ fetchMock.mockImplementation(async (path, init) => {
const url = new URL(path, "http://omb.test");
- if (url.pathname.endsWith("/app/publish")) return json(200, { ok: true, card: LIVE });
+ if (url.pathname.endsWith("/app/publish")) {
+ const asked = JSON.parse(String(init?.body ?? "{}")) as { visibility?: string };
+ return json(200, { ok: true, card: asked.visibility === "owner" ? OWNER : LIVE });
+ }
if (url.pathname.endsWith("/unpublish")) return json(200, { ok: true, card: { ...LIVE, state: "unpublished" } });
const rev = url.searchParams.get("rev");
- return json(200, botHtmlDocument({ messageId: "a1", rev: rev === null ? 0 : Number(rev), html: `<p>${rev === null ? "newest" : `version ${Number(rev) + 1}`}</p>` }));
+ return json(200, botHtmlDocument({ messageId: "a1", rev: rev === null ? newestRev : Number(rev), html: `<p>${rev === null ? "newest" : `version ${Number(rev) + 1}`}</p>` }));
});
vi.stubGlobal("fetch", fetchMock);
vi.stubGlobal("ogb", { openExternal });
diff --cc src/components/app/PageTools.tsx
index ff027804bb,e1d1c78bf1..95f843d763
--- a/src/components/app/PageTools.tsx
+++ b/src/components/app/PageTools.tsx
@@@ -13,8 -13,8 +13,8 @@@ import { addPointedChip, usePointedChip
import { latestWebPanels, setWebPanels, useWebPanels } from "@/lib/web-panel-preferences";
import { findPinnedPage, MAX_WEB_PANELS, togglePinnedPage, type PinnedChatPage } from "@/lib/web-panels";
import type { AppDocument, AppPayload } from "../../../shared/app";
- import { marksMessage, pointMessage, readPointEvent } from "../../../shared/app-frame/point";
+ import { marksMessage, pointMessage, readPointEvent, type PointMark, type PointSelectionState } from "../../../shared/app-frame/point";
-import type { PublishedPageCard } from "../../../shared/published-page";
+import type { PublishedPageCard, PublishedPageVisibility } from "../../../shared/published-page";
import { canonicalDownloadFilename } from "../AttachmentPreview";
import { appDownloadPath, publishAppPage, unpublishPage } from "./app-api";
import { AppFrame, type AppFrameHandle } from "./AppFrame";