Operations
Worldant is not stable yet. This quickstart is the target user flow.
Create a world:
world/
migrations/001_create_chess.sql
mutations/chess.move.ts
commands/chess.previewMove.ts
workflows/chess.aiMove.ts
workflows/steps/chess.loadBoard.ts
workflows/steps/chess.chooseMove.ts
workflows/steps/chess.commitAiMove.ts
reactive/chess.board.ts
Build and run:
worldant build
worldant run
Install the generated package from the live world:
@world:registry=http://localhost:3000/__worldant/v1/npm
pnpm install @world/chess
Consume it from any client:
import { chessBoard, move } from "@world/chess";
await move({ gameId, from: "e2", to: "e4" }, { key: "move:e2:e4" });
for await (const board of chessBoard({ gameId })) {
console.log(board);
}
