npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

goap-minimal

v1.0.0

Published

Minimal Goal-Oriented Action Planner (GOAP) in JSY: forward-search planning plus the three-state Goto/Animate runtime from Jeff Orkin's F.E.A.R. AI, in the STRIPS lineage. Built on astar-minimal.

Readme

goap-minimal

A minimal Goal-Oriented Action Planner in JSY (a syntax preprocessor for JavaScript from the jsy-lang project), after Jeff Orkin's Three States and a Plan: The A.I. of F.E.A.R. You declare a world state, a set of actions (preconditions, effects, cost), and prioritized goals; the planner searches forward from the current state and returns the cheapest action sequence that reaches the goal. A small three-state runtime (Goto / Animate / UseSmartObject) executes a plan and replans when the world changes.

Built on astar-minimal for the underlying A* search.

Documentation

  • Explainer: background, the STRIPS/F.E.A.R. history, and why this implementation is built the way it is (forward search, the planner/consumer boundary, skills versus stats).
  • API reference: exact signatures, the condition/effect grammar, and its caveats.

Install

npm install goap-minimal

Usage

import { Agent, Action, Goal, AgentRuntime } from 'goap-minimal'

const agent = new Agent({ ammo: 0 })

agent.addAction(new Action('Reload', {}, { ammo: 6 }))
agent.addAction(new Action('Attack', { ammo: { gte: 1 } }, { kTargetIsDead: true, ammo: { inc: -1 } }))
agent.addGoal(new Goal('KillEnemy', { kTargetIsDead: true }))

const { plan } = agent.plan()          // [Reload, Attack]

const rt = new AgentRuntime(agent)
rt.run()                               // ticks through FSM states until the goal is met
  • Conditions are booleans (kTargetIsDead: true) or numeric comparisons ({ gte, lte, gt, lt, eq }).
  • Effects are assignments (ammo: 6) or numeric deltas (ammo: { inc: -1 }).
  • Cost is the fourth Action argument (default 1); the planner minimizes total plan cost.

See the API reference for the full grammar and its closed-world/value caveats.

Build

npm install
npm run build

JSY sources in code/ compile to ES modules in esm/.

Test

npm test        # builds, then runs the two suites below
node esm/test_goap.js          # cooperative chain, numeric, cheaper-plan, no-plan
node esm/test_runtime.js       # FSM execution and replan-on-world-change

astar-minimal ships and tests its own A* search independently; see that package for its test suite.