chore: prune unused apps and services for the moeka fork
CI / Lint (push) Canceled after 0s
CI / Build Test (stage-web) (push) Canceled after 0s
CI / Build Test (ui-loading-screens) (push) Canceled after 0s
CI / Build Test (ui-transitions) (push) Canceled after 0s
CI / Unit Test (push) Canceled after 0s
CI / Type Check (push) Canceled after 0s
CI / Check Provenance (push) Canceled after 0s
Sync Labels / sync-labels (push) Successful in 1m43s
CI / Lint (push) Canceled after 0s
CI / Build Test (stage-web) (push) Canceled after 0s
CI / Build Test (ui-loading-screens) (push) Canceled after 0s
CI / Build Test (ui-transitions) (push) Canceled after 0s
CI / Unit Test (push) Canceled after 0s
CI / Type Check (push) Canceled after 0s
CI / Check Provenance (push) Canceled after 0s
Sync Labels / sync-labels (push) Successful in 1m43s
- Remove stage-tamagotchi, stage-pocket, server, and engine workspaces with their workflows, addons, and docs - Switch the toolchain from pnpm to bun, replace lockfiles with bun.lock - Rewrite remaining product references to Moeka
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# AIRI Minecraft Service
|
||||
# Moeka Minecraft Service
|
||||
|
||||
This workspace runs AIRI's dedicated Minecraft bot. It connects a Mineflayer runtime to a Minecraft server, loads the cognitive stack in `src/cognitive`, and bridges status, context, and command traffic back to AIRI so the Stage settings shell can observe the service.
|
||||
This workspace runs Moeka's dedicated Minecraft bot. It connects a Mineflayer runtime to a Minecraft server, loads the cognitive stack in `src/cognitive`, and bridges status, context, and command traffic back to Moeka so the Stage settings shell can observe the service.
|
||||
|
||||
## Deprecation Notice
|
||||
|
||||
@@ -21,7 +21,7 @@ Treat this service as a local-development and trusted-server tool only.
|
||||
1. Install workspace dependencies from the repo root:
|
||||
|
||||
```bash
|
||||
pnpm i
|
||||
bun install
|
||||
```
|
||||
|
||||
2. Copy the template:
|
||||
@@ -35,20 +35,20 @@ Treat this service as a local-development and trusted-server tool only.
|
||||
4. Start the service:
|
||||
|
||||
```bash
|
||||
pnpm -F @proj-airi/minecraft-bot dev
|
||||
bun run --filter @proj-airi/minecraft-bot dev
|
||||
```
|
||||
|
||||
Or, from `integrations/minecraft/`:
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
bun run dev
|
||||
```
|
||||
|
||||
5. The bot should automatically connect to both AIRI and the Minecraft server.
|
||||
5. The bot should automatically connect to both Moeka and the Minecraft server.
|
||||
|
||||
## Cognitive Architecture
|
||||
|
||||
AIRI's Minecraft agent is built on a **four-layered cognitive architecture** inspired by cognitive science, enabling reactive, conscious, and physically grounded behaviors.
|
||||
Moeka's Minecraft agent is built on a **four-layered cognitive architecture** inspired by cognitive science, enabling reactive, conscious, and physically grounded behaviors.
|
||||
|
||||
### Architecture Overview
|
||||
|
||||
@@ -165,7 +165,7 @@ Player: "build a house"
|
||||
|
||||
```txt
|
||||
src/
|
||||
├── airi/ # AIRI bridge, module shell, status publishing
|
||||
├── airi/ # Moeka bridge, module shell, status publishing
|
||||
├── cognitive/ # 🧠 Perception → Reflex → Conscious → Action
|
||||
│ ├── perception/ # Event definitions + rule evaluation
|
||||
│ │ ├── events/
|
||||
@@ -239,10 +239,10 @@ src/
|
||||
|
||||
### Commands
|
||||
|
||||
- `pnpm dev` - Start the bot in development mode
|
||||
- `pnpm lint` - Run ESLint
|
||||
- `pnpm typecheck` - Run TypeScript type checking
|
||||
- `pnpm test` - Run tests
|
||||
- `bun run dev` - Start the bot in development mode
|
||||
- `bun run lint` - Run ESLint
|
||||
- `bun run typecheck` - Run TypeScript type checking
|
||||
- `bun run test` - Run tests
|
||||
|
||||
## 🙏 Acknowledgements
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: minecraft-debug-mcp
|
||||
description: Operate and debug the live Minecraft bot through its built-in MCP REPL server. Use when work requires starting the bot with `pnpm dev`, connecting to the local MCP endpoint, inspecting cognitive state/logs/history, injecting synthetic chat/events, or running targeted REPL code against the running brain during investigation and development.
|
||||
description: Operate and debug the live Minecraft bot through its built-in MCP REPL server. Use when work requires starting the bot with `bun run dev`, connecting to the local MCP endpoint, inspecting cognitive state/logs/history, injecting synthetic chat/events, or running targeted REPL code against the running brain during investigation and development.
|
||||
---
|
||||
|
||||
# Minecraft Debug MCP
|
||||
@@ -11,7 +11,7 @@ Use this skill to run the local bot and interact with its MCP debug interface sa
|
||||
|
||||
## Quick Start Workflow
|
||||
|
||||
1. Run `pnpm dev` from `/path/to/project/root/integrations/minecraft` and keep it running.
|
||||
1. Run `bun run dev` from `/path/to/project/root/integrations/minecraft` and keep it running.
|
||||
2. Wait for `MCP REPL server running at http://localhost:3001` in logs.
|
||||
3. Connect MCP client to `http://localhost:3001/sse`.
|
||||
4. Verify readiness with a read-only call:
|
||||
@@ -27,7 +27,7 @@ Use this skill to run the local bot and interact with its MCP debug interface sa
|
||||
- Keep `execute_repl` snippets minimal and reversible.
|
||||
- Use `inject_chat` for conversational simulation and `inject_event` only when specific event-shape testing is required.
|
||||
- Treat `inject_chat` as side-effectful: it can trigger actual in-game bot replies/actions.
|
||||
- If MCP connection fails, check that `pnpm dev` is still running and port `3001` is free.
|
||||
- If MCP connection fails, check that `bun run dev` is still running and port `3001` is free.
|
||||
|
||||
## Tooling Strategy
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
interface:
|
||||
display_name: 'Minecraft Debug MCP'
|
||||
short_description: 'Operate the live Minecraft debug MCP bot safely'
|
||||
default_prompt: 'Start the bot with pnpm dev, connect to the minecraft-debug MCP, inspect brain state/logs, and execute focused debug actions.'
|
||||
default_prompt: 'Start the bot with bun run dev, connect to the minecraft-debug MCP, inspect brain state/logs, and execute focused debug actions.'
|
||||
|
||||
@@ -58,7 +58,7 @@ The bot starts this server during normal runtime from:
|
||||
## Troubleshooting
|
||||
|
||||
- Connection refused:
|
||||
- Ensure `pnpm dev` is running in the service directory.
|
||||
- Ensure `bun run dev` is running in the service directory.
|
||||
- Confirm logs include `MCP REPL server running at http://localhost:3001`.
|
||||
- 404/invalid endpoint:
|
||||
- Use `/sse` as MCP entrypoint.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@proj-airi/minecraft-bot",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"description": "An intelligent Minecraft bot powered by LLM. AIRI can understand natural language commands, interact with the world, and assist players in various tasks.",
|
||||
"description": "An intelligent Minecraft bot powered by LLM. Moeka can understand natural language commands, interact with the world, and assist players in various tasks.",
|
||||
"scripts": {
|
||||
"dev": "NODE_OPTIONS=--no-node-snapshot tsx --env-file=.env --env-file-if-exists=.env.local src/main.ts",
|
||||
"start": "NODE_OPTIONS=--no-node-snapshot tsx --env-file=.env --env-file-if-exists=.env.local src/main.ts",
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('airiBridge spark command routing', () => {
|
||||
* @example
|
||||
* expect(eventBus.emit).toHaveBeenCalledWith(expect.objectContaining({ type: 'signal:airi_command' }))
|
||||
*/
|
||||
it('routes spark commands as AIRI commands instead of chat messages', () => {
|
||||
it('routes spark commands as Moeka commands instead of chat messages', () => {
|
||||
const { bridge, eventBus, handlers } = createBridgeHarness()
|
||||
const commandHandler = handlers.get('spark:command')
|
||||
|
||||
@@ -78,7 +78,7 @@ describe('airiBridge spark command routing', () => {
|
||||
type: 'signal:airi_command',
|
||||
payload: expect.objectContaining({
|
||||
type: 'airi_command',
|
||||
description: 'Directive from AIRI: "collect wood"',
|
||||
description: 'Directive from Moeka: "collect wood"',
|
||||
sourceId: 'airi',
|
||||
metadata: expect.objectContaining({
|
||||
message: 'collect wood',
|
||||
|
||||
@@ -17,7 +17,7 @@ interface SparkCommandData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects the Minecraft cognitive runtime to AIRI server events.
|
||||
* Connects the Minecraft cognitive runtime to Moeka server events.
|
||||
*
|
||||
* Use when:
|
||||
* - Minecraft must publish context and notifications to Stage runtimes.
|
||||
@@ -28,7 +28,7 @@ interface SparkCommandData {
|
||||
* - {@link setCommandAvailable} follows the active bot lifecycle.
|
||||
*
|
||||
* Returns:
|
||||
* - Event handlers and send operations for the Minecraft side of the AIRI server seam.
|
||||
* - Event handlers and send operations for the Minecraft side of the Moeka server seam.
|
||||
*/
|
||||
export class AiriBridge {
|
||||
private readonly logger = useLogg('airi-bridge').useGlobalConfig()
|
||||
@@ -55,7 +55,7 @@ export class AiriBridge {
|
||||
|
||||
this.sendEmit(cmd.commandId, 'queued', 'Command received')
|
||||
|
||||
// A spark:command is high-level guidance from the AIRI server. It must carry enough weight to
|
||||
// A spark:command is high-level guidance from the Moeka server. It must carry enough weight to
|
||||
// trigger a fresh decision (Conscious) cycle, never be silently filed into history — so we
|
||||
// always route it through handleActionIntent (→ signal:airi_command → enqueueEvent → decision cycle).
|
||||
//
|
||||
@@ -195,10 +195,10 @@ export class AiriBridge {
|
||||
}
|
||||
|
||||
private handleActionIntent(cmd: SparkCommandData): void {
|
||||
// A spark:command is high-level guidance from the AIRI server. Route it through the explicit
|
||||
// A spark:command is high-level guidance from the Moeka server. Route it through the explicit
|
||||
// `airi_command` signal so the brain runs a fresh decision cycle
|
||||
// (resetNoActionFollowupBudget('airi_command'), normal Conscious wake-up) instead of silently
|
||||
// filing it into history. The directive is attributed to the AIRI server as a neutral source,
|
||||
// filing it into history. The directive is attributed to the Moeka server as a neutral source,
|
||||
// not to any specific in-game player. The status context tells Stage when this relay is available
|
||||
// while this bridge remains the final receiver-side availability gate.
|
||||
const firstOption = cmd.guidance?.options?.[0]
|
||||
@@ -212,7 +212,7 @@ export class AiriBridge {
|
||||
|
||||
const sourceId = 'airi'
|
||||
|
||||
this.logger.log('Routing spark:command as an AIRI directive', {
|
||||
this.logger.log('Routing spark:command as an Moeka directive', {
|
||||
commandId: cmd.commandId,
|
||||
message,
|
||||
})
|
||||
@@ -221,13 +221,13 @@ export class AiriBridge {
|
||||
type: 'signal:airi_command',
|
||||
payload: Object.freeze({
|
||||
type: 'airi_command' as const,
|
||||
description: `Directive from AIRI: "${message}"`,
|
||||
description: `Directive from Moeka: "${message}"`,
|
||||
sourceId,
|
||||
confidence: 1.0,
|
||||
timestamp: Date.now(),
|
||||
metadata: {
|
||||
message,
|
||||
// Keep the spark provenance for debugging; the brain sees a typed AIRI directive.
|
||||
// Keep the spark provenance for debugging; the brain sees a typed Moeka directive.
|
||||
sparkCommandId: cmd.commandId,
|
||||
sparkIntent: cmd.intent,
|
||||
},
|
||||
|
||||
@@ -9,12 +9,12 @@ type ContextBot = Parameters<MinecraftContextService['bindBot']>[0]
|
||||
/** Minimal bot stub exposing only the status fields owned by the context module. */
|
||||
function fakeBot(): ContextBot {
|
||||
return {
|
||||
username: 'Airi',
|
||||
username: 'Moeka',
|
||||
bot: {
|
||||
entity: { position: { x: 1, y: 2, z: 3 } },
|
||||
health: 20,
|
||||
game: { gameMode: 'survival' },
|
||||
players: { Airi: {}, dssadg: {}, Bob: {} },
|
||||
players: { Moeka: {}, dssadg: {}, Bob: {} },
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ describe('minecraftContextService desktop relay context', () => {
|
||||
const update = captured[0]
|
||||
expect(update.lane).toBe('minecraft:status')
|
||||
expect(update.strategy).toBe('replace-self')
|
||||
expect(update.text).toContain('Bot online: Airi')
|
||||
expect(update.text).toContain('Bot online: Moeka')
|
||||
expect(update.text).toContain('Desktop command relay: available.')
|
||||
expect(update.text).toContain('builtIn_emitSparkCommand')
|
||||
expect(update.text).toContain('destinations to ["minecraft-bot"]')
|
||||
|
||||
@@ -86,7 +86,7 @@ function collectFrontendDestinations(event: ModuleAnnouncedEvent) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Publishes Minecraft capability and status context through the AIRI server event seam.
|
||||
* Publishes Minecraft capability and status context through the Moeka server event seam.
|
||||
*
|
||||
* Use when:
|
||||
* - A Stage runtime must discover how to relay a user instruction without Minecraft-specific UI code.
|
||||
@@ -94,7 +94,7 @@ function collectFrontendDestinations(event: ModuleAnnouncedEvent) {
|
||||
*
|
||||
* Expects:
|
||||
* - {@link bindBot} and {@link unbindBot} follow the Mineflayer runtime lifecycle.
|
||||
* - The AIRI bridge is initialized before status updates are published.
|
||||
* - The Moeka bridge is initialized before status updates are published.
|
||||
*
|
||||
* Returns:
|
||||
* - Replace-self status context that describes relay availability and the existing generic relay tool.
|
||||
|
||||
@@ -24,13 +24,13 @@ export function startAiriClientConnection(client: AiriClientLike, deps: {
|
||||
deps.logger.withFields({
|
||||
url: deps.url,
|
||||
error: errorMessageFrom(error) ?? 'Unknown error',
|
||||
}).warn('AIRI server is unavailable; continuing startup without AIRI and retrying in background')
|
||||
}).warn('Moeka server is unavailable; continuing startup without Moeka and retrying in background')
|
||||
}
|
||||
|
||||
const reportDisconnected = () => {
|
||||
deps.logger.withFields({
|
||||
url: deps.url,
|
||||
}).warn('AIRI server connection closed; retrying in background')
|
||||
}).warn('Moeka server connection closed; retrying in background')
|
||||
}
|
||||
|
||||
void client.connect()
|
||||
@@ -39,8 +39,8 @@ export function startAiriClientConnection(client: AiriClientLike, deps: {
|
||||
url: deps.url,
|
||||
}).log(
|
||||
unavailableReported
|
||||
? 'Connected to AIRI server after background retry'
|
||||
: 'Connected to AIRI server',
|
||||
? 'Connected to Moeka server after background retry'
|
||||
: 'Connected to Moeka server',
|
||||
)
|
||||
unavailableReported = false
|
||||
})
|
||||
@@ -48,7 +48,7 @@ export function startAiriClientConnection(client: AiriClientLike, deps: {
|
||||
deps.logger.withFields({
|
||||
url: deps.url,
|
||||
error: errorMessageFrom(error) ?? 'Unknown error',
|
||||
}).warn('AIRI client stopped retrying')
|
||||
}).warn('Moeka client stopped retrying')
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -85,7 +85,7 @@ function createAiriCommandEvent() {
|
||||
type: 'perception',
|
||||
payload: {
|
||||
type: 'airi_command',
|
||||
description: 'Directive from AIRI: "continue"',
|
||||
description: 'Directive from Moeka: "continue"',
|
||||
sourceId: 'airi',
|
||||
confidence: 1,
|
||||
timestamp: Date.now(),
|
||||
@@ -307,7 +307,7 @@ inv;
|
||||
expect(deps.llmAgent.callLLM).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('clears giveUp and proceeds when an AIRI command arrives', async () => {
|
||||
it('clears giveUp and proceeds when an Moeka command arrives', async () => {
|
||||
const deps: any = createDeps('await skip()')
|
||||
const brain: any = new Brain(deps)
|
||||
brain.givenUp = true
|
||||
@@ -326,7 +326,7 @@ inv;
|
||||
expect(deps.llmAgent.callLLM).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('keeps suppressing non-chat and non-AIRI perceptions while giveUp is active', async () => {
|
||||
it('keeps suppressing non-chat and non-Moeka perceptions while giveUp is active', async () => {
|
||||
const deps: any = createDeps('await skip()')
|
||||
const brain: any = new Brain(deps)
|
||||
brain.givenUp = true
|
||||
@@ -532,7 +532,7 @@ describe('brain queue coalescing', () => {
|
||||
expect((brain.queue[0].event.payload as any).type).toBe('chat_message')
|
||||
})
|
||||
|
||||
it('promotes AIRI commands ahead of queued ordinary perceptions', () => {
|
||||
it('promotes Moeka commands ahead of queued ordinary perceptions', () => {
|
||||
const brain: any = new Brain(createDeps('await skip()'))
|
||||
|
||||
brain.queue = [
|
||||
|
||||
@@ -220,7 +220,7 @@ const NO_ACTION_BUDGET_ALERT_SOURCE_ID = 'brain:no_action_budget'
|
||||
|
||||
/**
|
||||
* Priority tiers for event scheduling (lower = higher priority).
|
||||
* Player chat and AIRI commands always take precedence over stale system feedback.
|
||||
* Player chat and Moeka commands always take precedence over stale system feedback.
|
||||
*/
|
||||
const EVENT_PRIORITY_URGENT_PERCEPTION = 0
|
||||
const EVENT_PRIORITY_PERCEPTION = 1
|
||||
@@ -336,13 +336,13 @@ export class Brain {
|
||||
|
||||
// Perception Handler
|
||||
this.unsubscribeEventBus = this.deps.eventBus.subscribe<PerceptionSignal>('conscious:signal:*', (event: TracedEvent<PerceptionSignal>) => {
|
||||
// AIRI context updates are injected into conversation history without triggering a full cognitive cycle
|
||||
// Moeka context updates are injected into conversation history without triggering a full cognitive cycle
|
||||
if (event.payload.type === 'airi_context') {
|
||||
this.conversationHistory.push({
|
||||
role: 'user',
|
||||
content: `[AIRI_CONTEXT] ${event.payload.description}`,
|
||||
})
|
||||
this.deps.logger.log('INFO', `Brain: Injected AIRI context: ${event.payload.description.slice(0, 80)}`)
|
||||
this.deps.logger.log('INFO', `Brain: Injected Moeka context: ${event.payload.description.slice(0, 80)}`)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1578,7 +1578,7 @@ export class Brain {
|
||||
}
|
||||
|
||||
/**
|
||||
* Coalesce the event queue: promote high-priority events (player chat, AIRI commands)
|
||||
* Coalesce the event queue: promote high-priority events (player chat, Moeka commands)
|
||||
* ahead of stale low-priority events (feedback, no-action follow-ups),
|
||||
* and drop redundant stale follow-ups when a higher-priority event exists.
|
||||
*/
|
||||
|
||||
@@ -414,7 +414,7 @@ describe('javaScriptPlanner', () => {
|
||||
expect(planned.actions).toHaveLength(0)
|
||||
})
|
||||
|
||||
it('bridges AIRI notification callbacks through the isolate', async () => {
|
||||
it('bridges Moeka notification callbacks through the isolate', async () => {
|
||||
const planner = new JavaScriptPlanner()
|
||||
const executeAction = vi.fn(async action => `ok:${action.tool}`)
|
||||
const notifyAiri = vi.fn()
|
||||
|
||||
@@ -19,7 +19,7 @@ You are an autonomous agent playing Minecraft.
|
||||
- Use `await` on tool calls when later logic depends on the result.
|
||||
- Globals refreshed every turn: `snapshot`, `self`, `environment`, `social`, `threat`, `attention`, `autonomy`, `event`, `now`, `query`, `patterns`, `botCall`, `currentInput`, `llmLog`, `actionQueue`, `noActionBudget`, `errorBurstGuard`, `history`.
|
||||
- Persistent globals: `mem` (cross-turn memory), `lastRun` (this run), `prevRun` (previous run), `lastAction` (latest action result), `log(...)`.
|
||||
- AIRI communication: `notifyAiri(headline, note?, urgency?)`, `updateAiriContext(text, hints?, lane?)` — see **AIRI Communication** section below.
|
||||
- Moeka communication: `notifyAiri(headline, note?, urgency?)`, `updateAiriContext(text, hints?, lane?)` — see **Moeka Communication** section below.
|
||||
- History query: `history.recent(n)`, `history.search(query)`, `history.playerChats(n)`, `history.turns(n)`.
|
||||
- Budget helpers: `setNoActionBudget(n)` and `getNoActionBudget()` control/inspect eval-only no-action follow-up budget.
|
||||
- Cross-turn result access: use `prevRun.returnRaw` for typed values (arrays/objects). If you need text output, stringify `returnRaw` explicitly.
|
||||
@@ -222,19 +222,19 @@ Common patterns:
|
||||
- Pathfinding has an **ETA-based timeout** (2× estimated travel time + grace). The ETA accounts for digging, block placement, parkour, and walking speed.
|
||||
- If navigation fails with `reason: 'timeout'` or `reason: 'stagnation'`, try a closer intermediate waypoint, a different route, or `giveUp`.
|
||||
- If navigation fails with `reason: 'noPath'`, the destination is unreachable from the current position.
|
||||
## AIRI Communication
|
||||
You are connected to AIRI, an overseeing character. Two functions let you push information up to AIRI; they are fire-and-forget and never block your turn.
|
||||
## Moeka Communication
|
||||
You are connected to Moeka, an overseeing character. Two functions let you push information up to Moeka; they are fire-and-forget and never block your turn.
|
||||
|
||||
### Receiving instructions from AIRI
|
||||
When `event.type === "perception"` and `event.payload?.type === "airi_command"`, the instruction came from AIRI via a high-level command. Treat it as high-priority supervisory intent and begin executing it immediately, unless it conflicts with safety rules or the bound master-identity rules. The instruction text is in `event.payload.description`.
|
||||
### Receiving instructions from Moeka
|
||||
When `event.type === "perception"` and `event.payload?.type === "airi_command"`, the instruction came from Moeka via a high-level command. Treat it as high-priority supervisory intent and begin executing it immediately, unless it conflicts with safety rules or the bound master-identity rules. The instruction text is in `event.payload.description`.
|
||||
|
||||
### `notifyAiri(headline, note?, urgency?)`
|
||||
Push an episodic alert to AIRI. Use for significant, non-routine events only.
|
||||
Push an episodic alert to Moeka. Use for significant, non-routine events only.
|
||||
|
||||
**Call this for:**
|
||||
- Near-death or death (`self.health <= 4`)
|
||||
- A task is blocked and you cannot resolve it alone
|
||||
- A player interaction that AIRI should be aware of (e.g. a player is being hostile, or asks about AIRI directly)
|
||||
- A player interaction that Moeka should be aware of (e.g. a player is being hostile, or asks about Moeka directly)
|
||||
- A major discovery (found a dungeon, village, rare ore vein)
|
||||
- A long-running task just completed
|
||||
|
||||
@@ -260,7 +260,7 @@ await giveUp({ reason: 'no iron available' })
|
||||
```
|
||||
|
||||
### `updateAiriContext(text, hints?, lane?)`
|
||||
Push a persistent context update to AIRI. Use to keep AIRI's shared understanding current without triggering a reaction.
|
||||
Push a persistent context update to Moeka. Use to keep Moeka's shared understanding current without triggering a reaction.
|
||||
|
||||
**Call this for:**
|
||||
- Task completion summary (what you did, outcome, inventory changes)
|
||||
@@ -303,7 +303,7 @@ updateAiriContext('Built a small shelter at spawn (0, 65, 0). Has a bed and craf
|
||||
- Some relocation actions (for example `goToCoordinate`) automatically detach auto-follow so exploration does not keep snapping back.
|
||||
## Rules
|
||||
- **Native Reasoning**: You can think before outputting your action.
|
||||
- **AIRI Instructions**: When `event.type === "perception"` and `event.payload?.type === "airi_command"`, this is a directive from the overseeing AIRI character. Treat it as high-priority supervisory intent and begin executing it immediately, unless it conflicts with safety rules or the bound master-identity rules.
|
||||
- **Moeka Instructions**: When `event.type === "perception"` and `event.payload?.type === "airi_command"`, this is a directive from the overseeing Moeka character. Treat it as high-priority supervisory intent and begin executing it immediately, unless it conflicts with safety rules or the bound master-identity rules.
|
||||
- **Strict JavaScript Output**: Output ONLY executable JavaScript. Comments are possible but discouraged and will be ignored.
|
||||
- **Handling Feedback**: Treat `actionQueue` as the source of truth for in-flight control actions. `[FEEDBACK]` is for terminal summaries/failures, not guaranteed per action.
|
||||
- **Tool Choice**: For read/query tasks, use `query` first. For world mutations, use dedicated action tools. For low-level actions without a dedicated tool, use `await botCall('method', [args])` — never reference raw `bot`/`mineflayer`.
|
||||
|
||||
+2
-2
@@ -17,11 +17,11 @@ import { damageTakenEvent } from './damage-taken'
|
||||
function makeCtx(health: number, entity: Record<string, any>, nearby: Record<string, any> = {}): any {
|
||||
return {
|
||||
bot: { health, entity, entities: nearby },
|
||||
selfUsername: 'Airi',
|
||||
selfUsername: 'Moeka',
|
||||
maxDistance: 32,
|
||||
distanceTo: (e: any) => (typeof e?._distance === 'number' ? e._distance : null),
|
||||
distanceToPos: () => null,
|
||||
isSelf: (e: any) => e?.username === 'Airi',
|
||||
isSelf: (e: any) => e?.username === 'Moeka',
|
||||
entityId: (e: any) => String(e?.id ?? 'unknown'),
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -59,11 +59,11 @@ describe('damage_taken cause inference', () => {
|
||||
function makeCtx(health: number, entity: Record<string, any>, nearby: Record<string, any> = {}): any {
|
||||
return {
|
||||
bot: { health, entity, entities: nearby },
|
||||
selfUsername: 'Airi',
|
||||
selfUsername: 'Moeka',
|
||||
maxDistance: 32,
|
||||
distanceTo: (e: any) => (typeof e?._distance === 'number' ? e._distance : null),
|
||||
distanceToPos: () => null,
|
||||
isSelf: (e: any) => e?.username === 'Airi',
|
||||
isSelf: (e: any) => e?.username === 'Moeka',
|
||||
entityId: (e: any) => String(e?.id ?? 'unknown'),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ export type PerceptionSignalType
|
||||
| 'social_gesture' // e.g. waving
|
||||
| 'social_presence'
|
||||
| 'system_message' // e.g. death messages, join/leave
|
||||
| 'airi_command' // instruction from AIRI via spark:command
|
||||
| 'airi_context' // context update from AIRI via context:update
|
||||
| 'airi_command' // instruction from Moeka via spark:command
|
||||
| 'airi_context' // context update from Moeka via context:update
|
||||
|
||||
export interface PerceptionSignal {
|
||||
type: PerceptionSignalType
|
||||
|
||||
@@ -80,7 +80,7 @@ async function main() {
|
||||
// NOTICE:
|
||||
// The bot's Node event loop occasionally goes quiet for ~30s (busy mineflayer packet handling /
|
||||
// perception ticks), during which the heartbeat ping timer can't fire, so the default 30s
|
||||
// readTimeout would trip and tear down the AIRI connection — making the in-game bot flap
|
||||
// readTimeout would trip and tear down the Moeka connection — making the in-game bot flap
|
||||
// online/offline and the desktop's game-command relay unusable. Widen the read tolerance to 120s
|
||||
// (still under the server's 60s-per-miss TTL for a single ~30s gap) and keep pings frequent so
|
||||
// the connection recovers immediately once the loop frees up.
|
||||
@@ -189,7 +189,7 @@ async function main() {
|
||||
logger.errorWithError('Failed to stop Minecraft runtime cleanly', err)
|
||||
})
|
||||
.finally(() => {
|
||||
// TODO: Add an explicit AIRI-side deregistration path on shutdown instead of relying on
|
||||
// TODO: Add an explicit Moeka-side deregistration path on shutdown instead of relying on
|
||||
// websocket close / heartbeat expiry. Right now the Minecraft page can briefly sit in a
|
||||
// stale state after the bot exits, which is annoying and easy to misread as still online.
|
||||
airiClient.close()
|
||||
|
||||
@@ -11,7 +11,7 @@ import { McData } from '../utils/mcdata'
|
||||
|
||||
/**
|
||||
* Default radius (in blocks) for the bot's "vision" — how far skill-level scans look for blocks,
|
||||
* entities, players, etc. Raised from the original 16 to 48 so Airi can find/act on things farther
|
||||
* entities, players, etc. Raised from the original 16 to 48 so Moeka can find/act on things farther
|
||||
* away (cows to hunt, ores to mine, drops to collect). This only affects in-bot scanning work — it
|
||||
* does NOT meaningfully change backbone-LLM token cost, because scan results stay in the sandbox/
|
||||
* skills and never enter the prompt (only the compact [PERCEPTION] name summary does). The real
|
||||
|
||||
Reference in New Issue
Block a user