From df495afac32c528d31129a2885400b457f343bcb Mon Sep 17 00:00:00 2001 From: spacedevin Date: Thu, 5 Nov 2026 13:29:23 -0800 Subject: [PATCH] feat(runtime): editShaderGraph, makeRhythmGame and the shader asset methods The app now answers these RPC methods: build a node shader a step at a time, make a rhythm game from a frame's music, and save, import, list, apply and remove shader assets. --- src/runtime/main.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/runtime/main.ts b/src/runtime/main.ts index 4f29158..8d2ef51 100644 --- a/src/runtime/main.ts +++ b/src/runtime/main.ts @@ -242,6 +242,16 @@ export function createMainApi(rpc: RpcClient = createRpcClient()) { setInstancePlayback: (opts?: PopCraftCommandArgs) => rpc.call('setInstancePlayback', opts || {}), editComponentProperty: (opts?: PopCraftCommandArgs) => rpc.call('editComponentProperty', opts || {}), setShaderFill: (opts?: PopCraftCommandArgs) => rpc.call('setShaderFill', opts || {}), + /** A node shader built a step at a time: `{ id, fill?, op }` (create, addNode, connect, setInput, setOption, …; docs/plugins/methods.md). */ + editShaderGraph: (opts?: PopCraftCommandArgs) => rpc.call('editShaderGraph', opts || {}), + /** Shader assets, reused like images: save `{ id, fill?, name? }`, import `{ fileName, text }` (.wgsl / graph .json), apply `{ asset, id | sequence+clip }`, remove, list. */ + saveShaderAsset: (opts?: PopCraftCommandArgs) => rpc.call('saveShaderAsset', opts || {}), + importShaderAsset: (opts?: PopCraftCommandArgs) => rpc.call('importShaderAsset', opts || {}), + applyShaderAsset: (opts?: PopCraftCommandArgs) => rpc.call('applyShaderAsset', opts || {}), + removeShaderAsset: (opts?: PopCraftCommandArgs) => rpc.call('removeShaderAsset', opts || {}), + getShaderAssets: (opts?: PopCraftCommandArgs) => rpc.call('getShaderAssets', opts || {}), + /** A frame with music made into a rhythm game on its real beats: `{ id, lanes?, keys?, fall?, notes?, colors? }`. */ + makeRhythmGame: (opts?: PopCraftCommandArgs) => rpc.call('makeRhythmGame', opts || {}), createComposition: (opts?: PopCraftCommandArgs) => rpc.call('createComposition', opts || {}), editComposition: (opts?: PopCraftCommandArgs) => rpc.call('editComposition', opts || {}), /**