From 2e55691fbed0e45dc076e5737886073340092f06 Mon Sep 17 00:00:00 2001 From: srivtx Date: Sat, 24 Oct 2026 01:19:07 +0530 Subject: [PATCH 1/2] morpho: the app from the command line, for AI agents Designing in the app as an agent meant reading effect and template sources to learn what exists, and judging work through screenshot after screenshot. morpho answers in short text or one PNG instead: - catalog: every material, modifier, shape, preset, recipe, motion and keyframe option with ranges and defaults, generated from the Inspector's own registries - describe: a design as a text tree, settings changed from defaults only - scene / set: templates as .morpho files, edited by Layer.setting=value with range checks and errors that list what would work - render: a frame, or a captioned filmstrip with --at / --frames - vary: a grid of variations in one image - check: problems in words (engine errors, off canvas, unseen layers, low-contrast text, blank frames, motion jumps, loop seams) - compare: scores and a difference image against a reference - serve: a warm browser, so drawing commands take under a second Catalog, describe and set run in Node through Vite's SSR loader; drawing runs the app headless on the GPU (SwiftShader with --cpu or as a fallback), with the live preview held still while a job runs. Co-Authored-By: Claude Opus 5.5 --- package.json | 1 + scripts/morpho.mjs | 357 +++++++++++++++++++++++++++++++++++++ ui/src/agent/agent.test.ts | 199 +++++++++++++++++++++ ui/src/agent/catalog.ts | 240 +++++++++++++++++++++++++ ui/src/agent/check.ts | 180 +++++++++++++++++++ ui/src/agent/describe.ts | 145 +++++++++++++++ ui/src/agent/edit.ts | 200 +++++++++++++++++++++ ui/src/agent/node.ts | 14 ++ ui/src/agent/page.ts | 344 +++++++++++++++++++++++++++++++++++ ui/src/main.tsx | 2 + 10 files changed, 1682 insertions(+) create mode 100644 scripts/morpho.mjs create mode 100644 ui/src/agent/agent.test.ts create mode 100644 ui/src/agent/catalog.ts create mode 100644 ui/src/agent/check.ts create mode 100644 ui/src/agent/describe.ts create mode 100644 ui/src/agent/edit.ts create mode 100644 ui/src/agent/node.ts create mode 100644 ui/src/agent/page.ts diff --git a/package.json b/package.json index 61a35d0..d5f5d87 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "preview": "vite preview", "test": "cargo test --workspace --exclude morphotype-app && vitest run", "test:e2e": "node scripts/e2e.mjs", + "morpho": "node scripts/morpho.mjs", "typecheck": "tsc --noEmit -p ui", "tauri": "tauri" }, diff --git a/scripts/morpho.mjs b/scripts/morpho.mjs new file mode 100644 index 0000000..8423b0c --- /dev/null +++ b/scripts/morpho.mjs @@ -0,0 +1,357 @@ +// morpho: the app from the command line, for AI agents and scripts. Every +// command answers in short text or one PNG, so learning what exists, reading a +// design, editing it and judging it doesn't take source reading or a pile of +// screenshots. +// +// npm run morpho -- catalog [name|section] what materials, modifiers, shapes, motion… exist +// npm run morpho -- describe the design as a text tree (changed settings only) +// npm run morpho -- scene