Skip to content

Commit bc5e1f4

Browse files
shinohara-rinnekomeowww
authored andcommitted
feat(minecraft): attempt at sliding window for salience detection
1 parent f1c06e5 commit bc5e1f4

File tree

12 files changed

+604
-729
lines changed

12 files changed

+604
-729
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default [
2+
{
3+
ignores: [
4+
'docs/**',
5+
],
6+
rules: {
7+
perfectionist: 'off',
8+
},
9+
},
10+
]

services/minecraft/src/cognitive/conscious/brain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ export class Brain {
5757
this.log('INFO', 'Brain: Initializing...')
5858

5959
// Unified Perception Signal Handler
60-
this.deps.eventManager.on<PerceptionSignal>('perception', async (event) => {
61-
this.log('INFO', `Brain: Received perception signal: ${event.payload.type} - ${event.payload.description}`)
62-
await this.enqueueEvent(bot, event)
63-
})
60+
// this.deps.eventManager.on<PerceptionSignal>('perception', async (event) => {
61+
// this.log('INFO', `Brain: Received perception signal: ${event.payload.type} - ${event.payload.description}`)
62+
// await this.enqueueEvent(bot, event)
63+
// })
6464

6565
// Listen to Task Execution Events (Action Feedback)
6666
this.deps.taskExecutor.on('action:completed', async ({ action, result }) => {

services/minecraft/src/cognitive/index.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { createPerceptionFrameFromChat } from './perception/frame'
88

99
export function CognitiveEngine(options: CognitiveEngineOptions): MineflayerPlugin {
1010
let container: ReturnType<typeof createAgentContainer>
11-
let tickHandler: ((ctx: { delta: number }) => void) | null = null
1211
let spawnHandler: (() => void) | null = null
1312
let started = false
1413

@@ -22,7 +21,6 @@ export function CognitiveEngine(options: CognitiveEngineOptions): MineflayerPlug
2221

2322
const actionAgent = container.resolve('actionAgent')
2423
const chatAgent = container.resolve('chatAgent')
25-
const eventManager = container.resolve('eventManager')
2624
const perceptionPipeline = container.resolve('perceptionPipeline')
2725
const brain = container.resolve('brain')
2826
const reflexManager = container.resolve('reflexManager')
@@ -50,13 +48,6 @@ export function CognitiveEngine(options: CognitiveEngineOptions): MineflayerPlug
5048
// Initialize perception pipeline (raw events + detectors)
5149
perceptionPipeline.init(botWithAgents)
5250

53-
tickHandler = ({ delta }) => {
54-
reflexManager.tick(delta)
55-
perceptionPipeline.tick(delta)
56-
}
57-
58-
bot.onTick('tick', tickHandler)
59-
6051
// Set message handling via EventManager
6152
const chatHandler = new ChatMessageHandler(bot.username)
6253
bot.bot.on('chat', (username, message) => {
@@ -74,27 +65,6 @@ export function CognitiveEngine(options: CognitiveEngineOptions): MineflayerPlug
7465
spawnHandler = () => startCognitive()
7566
bot.bot.once('spawn', spawnHandler)
7667
}
77-
78-
options.airiClient.onEvent('input:text:voice', (event) => {
79-
eventManager.emit({
80-
type: 'stimulus',
81-
payload: {
82-
content: event.data.transcription,
83-
metadata: {
84-
displayName: (event.data.discord?.guildMember as any)?.nick || (event.data.discord?.guildMember as any)?.user?.username || 'Voice Stimulus',
85-
},
86-
},
87-
source: {
88-
type: 'airi',
89-
id: (event.data.discord?.guildMember as any)?.user?.id || 'unknown',
90-
reply: (msg) => {
91-
// TODO: implement Airi voice reply if needed, or just chat in MC
92-
bot.bot.chat(msg)
93-
},
94-
},
95-
timestamp: Date.now(),
96-
})
97-
})
9868
},
9969

10070
async beforeCleanup(bot) {
@@ -119,11 +89,6 @@ export function CognitiveEngine(options: CognitiveEngineOptions): MineflayerPlug
11989
}
12090
started = false
12191

122-
if (tickHandler) {
123-
bot.offTick('tick', tickHandler)
124-
tickHandler = null
125-
}
126-
12792
bot.bot.removeAllListeners('chat')
12893
},
12994
}

services/minecraft/src/cognitive/perception/attention-detector.test.ts

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)