
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A React library for AI-generated interactive games with reinforcement learning support
A React library for AI-generated interactive games with built-in reinforcement learning support.
npm install carverjs
yarn add carverjs
pnpm add carverjs
import { GamePlayer, type GameModel } from 'carverjs';
const gameModel: GameModel = {
id: 'quick-start-demo',
name: 'Forest Adventure',
initialScene: 'clearing',
config: {
gridSize: 32,
animationSpeed: 300,
debugMode: false
},
scenes: [
{
id: 'clearing',
name: 'Forest Clearing',
width: 10,
height: 10,
player: {
startPosition: { x: 2, y: 2 },
color: '#4CAF50',
health: 3
},
entities: [],
objectives: [
{
id: 'reach-grove',
type: 'reach',
reward: 50,
description: 'Reach the glowing grove to continue your adventure.'
}
],
transitions: [
{
targetScene: 'grove',
trigger: () => true,
animation: 'fade',
duration: 300
}
]
},
{
id: 'grove',
name: 'Ancient Grove',
width: 10,
height: 10,
player: {
startPosition: { x: 5, y: 5 },
color: '#4CAF50',
health: 3
},
entities: [],
objectives: [
{
id: 'complete-journey',
type: 'reach',
reward: 100,
description: 'Explore the grove to finish the demo.'
}
]
}
]
};
function App() {
return (
<div className="container mx-auto p-4">
<GamePlayer gameModel={gameModel} />
</div>
);
}
The main component for rendering interactive game scenes.
interface GamePlayerProps {
gameModel: GameModel;
mode?: 'solo' | 'vsAgent';
onAction?: (sceneId: string, action: GameAction) => void;
}
Renders individual game scenes with animations.
interface SceneRendererProps {
scene?: GameScene | null;
className?: string;
}
Interactive buttons for game actions.
interface ActionButtonProps {
action: GameAction;
onClick: () => void;
disabled?: boolean;
}
CarverJS includes built-in RL capabilities:
import { GameEnv, QLearningAgent } from 'carverjs';
// Create environment
const env = new GameEnv(gameModel);
// Create and train agent
const agent = new QLearningAgent({
learningRate: 0.1,
explorationRate: 0.9,
discountFactor: 0.95
});
// Training loop
for (let episode = 0; episode < 1000; episode++) {
const state = env.reset();
while (!env.isDone()) {
const action = agent.chooseAction(state);
const { nextState, reward, done } = env.step(action);
agent.learn(state, action, reward, nextState);
state = nextState;
}
}
'use client';
import { GamePlayer } from 'carverjs';
import { gameModel } from './game-data';
export default function GamePage() {
return (
<main className="container mx-auto py-8">
<GamePlayer gameModel={gameModel} />
</main>
);
}
import { GamePlayer } from 'carverjs';
import { gameModel } from '../data/game-model';
export default function Game() {
return <GamePlayer gameModel={gameModel} />;
}
import { GamePlayer } from 'carverjs';
import './App.css';
function App() {
return (
<div className="App">
<GamePlayer gameModel={gameModel} />
</div>
);
}
CarverJS is written in TypeScript and includes full type definitions:
import type {
GameModel,
GameScene,
NarrativeScene,
GameAction,
GamePlayerProps,
AgentStats
} from 'carverjs';
CarverJS components are styled with Tailwind CSS. Make sure Tailwind is installed in your project:
npm install -D tailwindcss
# Clone the repository
git clone https://github.com/yourusername/carverjs.git
cd carverjs
# Install dependencies
npm install
# Start development server
npm run dev
# Run Storybook
npm run storybook
# Build library
npm run build
# Run tests
npm test
interface GameScene {
id: string;
title: string;
description: string;
image?: string;
animation?: 'fadeIn' | 'slideLeft' | 'zoomIn';
actions: GameAction[];
}
interface GameAction {
label: string;
nextId: string;
effect?: string;
}
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)MIT License - see LICENSE file for details.
Made with ❤️ by Your Name
FAQs
A React library for AI-generated interactive games with reinforcement learning support
We found that carverjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.