
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
zork-machine
Advanced tools
Zork I: The Great Underground Empire, reimplemented as a streaming state machine using Coremachine.
input stream → Coremachine (Zork) → output stream
(text) (state machine) (state + text)
The key design insight: Coremachine's state machine states represent game phases (playing, dead, victory), while all actual game world state lives in context — rooms, items, inventory, position, flags, score.
┌──────────────────────────────────────────────────────┐
│ Coremachine (Duplex Stream) │
│ │
│ WRITE SIDE READ SIDE │
│ { action: 'COMMAND', → { state: 'playing', │
│ value: { text } } context: { │
│ output: '...', │
│ currentRoom, │
│ inventory, │
│ score, ... │
│ }} │
│ │
│ Machine States: playing | dead | victory │
│ Context: entire game world (rooms, items, flags) │
│ Hypercore: append-only history (undo/redo/replay) │
└──────────────────────────────────────────────────────┘
backward()/forward().{ state, context }). Render it as TUI, HTML, React, native — whatever.node example-pipeline.js
npm install coremachine corestore
node example-coremachine.js
node test.js
import Corestore from 'corestore'
import { Zork } from './zork-machine.js'
const store = new Corestore('./zork-save')
const zork = Zork(store)
// Write commands in
zork.write({ action: 'COMMAND', value: { text: 'open mailbox' } })
// Read state changes out
zork.on('data', ({ state, context }) => {
console.log(context.output) // "Opening the small mailbox reveals a leaflet."
console.log(context.score) // 0
console.log(context.inventory) // []
})
// Or pipe it
inputStream.pipe(zork).pipe(rendererStream)
zork-machine/
├── zork-machine.js # Main export — Coremachine definition factory
├── rooms.js # Room definitions (exits, descriptions, conditions)
├── items.js # Item definitions (properties, handlers, treasures)
├── parser.js # Natural language command parser
├── engine.js # Game logic (movement, items, combat, etc.)
└── package.json
// In rooms.js
'treasure-room': {
name: 'Treasure Room',
description: 'A room full of glittering treasures.',
exits: { south: 'round-room' },
items: ['diamond'],
dark: true // requires light source
}
// In items.js
'diamond': {
name: 'huge diamond',
description: 'There is an enormous diamond here.',
takeable: true,
treasure: true,
score: 15,
onExamine: () => 'A flawless diamond the size of your fist.'
}
// In parser.js ITEM_ALIASES
diamond: 'diamond', gem: 'diamond'
Items can have handler functions for any verb:
'magic-mirror': {
name: 'magic mirror',
onExamine: (ctx) => {
if (ctx.inventory.includes('sword')) {
return 'You see a brave adventurer wielding a glowing sword.'
}
return 'You see a scared-looking adventurer.'
},
onUse: (ctx, target) => {
// Custom logic
}
}
MIT
Game content inspired by Zork I: The Great Underground Empire by Infocom (1980). ZORK is a registered trademark of Infocom, Inc.
FAQs
Zork I implemented as a streaming state machine using Coremachine
The npm package zork-machine receives a total of 33 weekly downloads. As such, zork-machine popularity was classified as not popular.
We found that zork-machine 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.