From e5c7c4e8c65b2f3b4fc6e838c6c3213edcf0d672 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 7 Oct 2026 08:15:26 +0000 Subject: [PATCH 1/2] Restore JAML document seed bundles and URL-backed seed queue JAML view accepts a full filter plus seeds: list via paste or upload. The worker parses large documents off the main thread, applies deck and stake to Blueprint, loads the navigable seed queue, and runs motely-wasm against the listed seeds. Shareable URLs carry seed lists up to a safe length with seedIndex for stepping. Co-authored-by: Nathanial P. Howard --- ___tests___/jamlDocument.spec.ts | 54 ++++ src/App.tsx | 2 + src/components/SeedQueue.tsx | 2 +- src/components/SeedQueueBootstrap.tsx | 21 ++ .../blueprint/jamlView/JamlView.tsx | 272 ++++++++++++++---- .../blueprint/jamlView/searchWorker.ts | 22 +- src/components/blueprint/layout/header.tsx | 3 +- src/modules/jamlDocumentParse.ts | 121 ++++++++ src/modules/state/store.ts | 65 ++++- 9 files changed, 502 insertions(+), 60 deletions(-) create mode 100644 ___tests___/jamlDocument.spec.ts create mode 100644 src/components/SeedQueueBootstrap.tsx create mode 100644 src/modules/jamlDocumentParse.ts diff --git a/___tests___/jamlDocument.spec.ts b/___tests___/jamlDocument.spec.ts new file mode 100644 index 0000000..e893204 --- /dev/null +++ b/___tests___/jamlDocument.spec.ts @@ -0,0 +1,54 @@ +import { readFileSync } from "node:fs"; +import { describe, expect, it } from "vitest"; +import { parseJamlDocument } from "../src/modules/jamlDocumentParse"; +import { parseSeedList } from "../src/modules/state/store"; + +describe("parseJamlDocument", () => { + it("splits filter clauses from a seeds list and reads deck/stake", () => { + const doc = parseJamlDocument(`name: demo +deck: Ghost +stake: White +must: + - tag: NegativeTag + antes: [1] +seeds: + - ALEEB + - PIROCKS +`); + expect(doc.name).toBe("demo"); + expect(doc.deck).toBe("Ghost"); + expect(doc.stake).toBe("White"); + expect(doc.seeds).toEqual(["ALEEB", "PIROCKS"]); + expect(doc.filterJaml).toContain("must:"); + expect(doc.filterJaml).not.toMatch(/^seeds:/m); + }); + + it("feeds parseSeedList for whole JAML uploads", () => { + const text = `deck: Red +stake: White +must: + - joker: Any + antes: [1] +seeds: + - WEEJOKER + - ALEEB +`; + expect(parseSeedList(text)).toEqual(["WEEJOKER", "ALEEB"]); + }); +}); + +describe("simpleCola fixture", () => { + it("loads 46,210 seeds without keeping them in the filter body", () => { + const path = "/home/ubuntu/.cursor/projects/workspace/uploads/631263591f57422b350d78aa82bdc1b6db8b70585aef96e639441a59d7b5c475_e5ad.jaml"; + const text = readFileSync(path, "utf8"); + const started = performance.now(); + const doc = parseJamlDocument(text); + const elapsed = performance.now() - started; + expect(doc.seeds).toHaveLength(46210); + expect(doc.deck).toBe("Ghost"); + expect(doc.stake).toBe("White"); + expect(doc.filterJaml).toContain("simpleCola"); + expect(doc.filterJaml).not.toMatch(/^seeds:/m); + expect(elapsed).toBeLessThan(5000); + }); +}); diff --git a/src/App.tsx b/src/App.tsx index da19e3f..02461de 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,6 +16,7 @@ import { BlueprintThemeProvider, useBlueprintTheme } from "./modules/state/theme import { JamlSearchProvider } from "./modules/state/jamlSearchContext.tsx"; import AssistantDrawer from "./components/AssistantDrawer.tsx"; import { SeedQueueHotkeys } from "./components/SeedQueue.tsx"; +import { SeedQueueBootstrap } from "./components/SeedQueueBootstrap.tsx"; import { startWebMcp } from "./modules/webmcp/register.ts"; startWebMcp(); @@ -49,6 +50,7 @@ export default function App() { + diff --git a/src/components/SeedQueue.tsx b/src/components/SeedQueue.tsx index 7e32a3e..7b26288 100644 --- a/src/components/SeedQueue.tsx +++ b/src/components/SeedQueue.tsx @@ -98,7 +98,7 @@ export function SeedQueuePanel() {