Skip to content

Puppet master2 to dev - #16

Merged
KudenikovNS merged 78 commits into
devfrom
puppet-master2
Jul 8, 2026
Merged

Puppet master2 to dev#16
KudenikovNS merged 78 commits into
devfrom
puppet-master2

Conversation

@KudenikovNS

Copy link
Copy Markdown
Collaborator

No description provided.

z-hunter added 30 commits June 26, 2026 00:50
…ion has been implemented: the player's text parser and the autonomous AI (Puppet Master) now share a common runtime and semantic query environment. This resolves the issue of logic desynchronization:

An ActorWorldQuery has been created for common perception queries (visibility, interaction availability).

An ActorNavigationService has been created for common navigation (pathfinding, approaching objects), replacing duplicate AI heuristics.

The LOOK, EXAMINE, OPEN, CLOSE, TAKE, PUT, and USE commands have been migrated to a common GameSemanticAPI contract.

Inventory Protection: The TAKE action is now strictly routed through GameSemanticAPI.takeEntityForActor. This fixes a vulnerability that allowed NPCs to see and steal items from the player's protected inventory.

A single ActorCommandExecutor is now used to execute custom (author) commands.

2. NPC Improvements and the #HALTNPC Command

A generation-based cancellation token system has been implemented. The #HALTNPC utility console command has been added, which immediately aborts pathfinding, wait logic, and LLM generation for all NPCs in the scene, returning them to a dormant state.

Individual NPC cursors have been added for reading SceneLogs, and the concept of a perception radius has been introduced. This ensures that AI characters do not miss events if there are multiple observers in the scene.

3. Console Debug System Optimization (PEEK)

Log Writing Fix: Console.logDebug debug logs are now correctly written to the buffer even when the fullscreen console is closed, so they can be examined later when it is opened.

AI Log Separation: AI puppeteer debug commands have been clearly separated. #PEEKPM-ON now produces a compact, easy-to-read report of current triggers, plans, and NPC inventories, stripped of raw JSON. Only #PEEKLLM-ON is now used to output raw, full prompts and LLM responses.

Parser Log Improvements: The #PEEK-ON command has been reformatted. Instead of outputting eight separate JSON blocks, the parser now generates a single, structured, human-readable block --- PARSER PEEK ---, describing the entered command, inventory, parsing stage (regex, NLP, LLM), and the result.

4. Update to Agent Internal Tools (Codex / Antigravity) In the development infrastructure itself, delegation of technical tasks via the Gemini CLI has been abandoned in favor of the Antigravity CLI (agy.exe). A robust "headless" launch mode (Windows ConPTY wrapper) has been implemented for managing terminals without graphical windows.
Optimize actor-aware command requirement checks so authored commands resolve declared entity ids directly instead of rebuilding broad scene scopes. This prevents player commands such as TURN ON TV from scanning every visible/reachable object and accidentally invoking expensive perception/path planning after the unified actor runtime refactor.

Make fast actor perception truly cheap for inactive Subscene objects by adding a fast approach status probe that does not run route planning. Keep full planApproach reserved for actual movement/navigation execution.

Restore robust PM speech wakeups by separating player speech listeners from action observers, so dialogue is not filtered by action-observation radius.

Add parser timing output to #peek-on and PM context trace output to #peekpm-on to make future runtime stalls easier to localize.

Tests: npm run typecheck; npm test.
z-hunter added 28 commits July 2, 2026 21:14
- Successful physical actions are recorded in the SceneLog, but do not trigger a PM anymore.
- All Actor observers within their perceptionRadius receive the event if they can see the source/target.
- The NPC will read the accumulated actions upon their next normal awakening.
- The Player will immediately see the observed action in the console: [Linda is looking under Sofa].
- The radius only affects actions; the audibility of the dialogue remains unchanged.
…ction and fix examine container content detection
- Add implicit MOVE_TO before TAKE when a target is not yet reachable.
- Preserve safe SAY/MEMORY_SET prefixes during rejected plans so useful dialogue/memory updates are not lost.
- Add route-aware approach planning and a 3-attempt MOVE_TO retry guard with LLM warnings.
- Fix scene/object visibility handling so actor pickup can permanently reveal hidden items across scenes.
- Tighten navigation/interaction lookup for routed targets and improve related regression coverage.
- Update PM/system docs and add focused tests for the new behavior.
- Include current scene/object data updates used by the reproduction and verification work.
… separate GO TO / GO THROUGH exit activation
- Added notify crate to Tauri backend to emit file-event
- Updated Vite configureServer to emit file-event via WebSocket
- Implemented FileEventEmitter in fileApi.ts
- Added useFileWatcher React hook
- Removed manual 'Sync TA' button and replaced with automatic update
- Updated tech-spec.md
1. **`NPCsys.md`**: Updated the log cursor lookup from `SceneLog.lastPmProcessedAtByNpc[npc.name]` to `SceneLog.lastPmProcessedAtByNpc[npc.id]` to ensure stable identifier usage.
2. **`exit.md`**: Corrected the misspelling from `QUIT THROURH THE DOOR` to `QUIT THROUGH THE DOOR`.
3. **`public/scenes/Corridor.json`** (Overlapping door Quad): Skipped as the specified `Quad` object (lines 358-424) had no overlapping `Exit` components or an object named `door_to_MilesFlat` remaining to remove.
4. **`public/scenes/Corridor.json`** (Triggerbox "Ex3"): Removed the empty duplicate `Exit` component from `Ex3` so it only has one valid component.
5. **`public/text/scenes/Corridor.json`**: Updated the generic placeholder scene text with Corridor-specific text (`"title": "Corridor"` and `"description": "A dimly lit corridor stretching out before you."`).
6. **`public/text/system/npc-pm-system.md`**: Tightened the NPC actionability rules to explicitly instruct the PM to treat items as inspectable only if they are explicitly marked as such in the current context.
7. **`src/components/editor/properties/PropertiesPanel.tsx`**: Excluded section 5 (Script Events) from the force-collapse behavior by adding `id !== 5`.
8. **`src/components/tools/SpriteBottomMenu.tsx`**: Updated the F6 key navigation handling to check `spriteEditor.isDirty` and display a confirmation prompt before leaving if there are unsaved sprite edits.
9. **`src/editor.css` & `src/components/editor/properties/ActorProperties.tsx`**: Updated Section 4's style from using the `blue` alias to a new `azure` alias that properly maps to `var(--sec-color-4)`.
10. **`src/mechanics/Parser.ts`**: Added a defensive check to `runCustomCommand` so that if `game.actorCommands.executeCommand` returns a falsy value, it safely falls back with a failure message instead of crashing.
11. **`src/platform/fileApi.ts`**: Updated `validateSafePath` to reject absolute, drive-letter, and UNC paths, strictly limiting it to relative path usage to prevent sandbox escaping.
12. **`src/systems/ActorWorldQuery.ts`**: Guarded the focus reference in `getActionObservers` by skipping distance calculations entirely if `focusPoint` is invalid or missing.
13. **`src/systems/ComponentSystem.ts`**: Explicitly validated and normalized all fields (`id`, `title`, `kind`, `lastSeenSceneId`, `lastSeenAt`) in the `knownEntities` cleanup instead of blindly spreading the old raw entry.
14. **`src/tools/SpriteEditor.ts`**: Updated the F6 key handler to properly verify `this.isDirty` and block/confirm navigation if there are pending sprite modifications.
15. **`src/tools/SpriteEditor.ts`**: Adjusted the `saveProjectFile` flow so that `isDirty` is only cleared if the sprite payload hasn't changed since the async save began.
16. **`src/vetool.tsx`**: Clamped the bounds in the `resizing` branch to ensure they stay strictly within `videoWidth` and `videoHeight` limits.
17. **`src/vetool.tsx`**: Added unsaved-changes protection to the F1 and F5 shortcut paths.
18. **`src/vetool.tsx`**: Revoked the old `videoUrl` object URL when loading a new local file to prevent memory leaks.
19. **`src/vetool.tsx`**: Enhanced the pending configuration load to verify the file matches the configured `videoFilename` and display a warning if there's a mismatch.
20. **`vite.config.ts`**: Updated the Data-URL logic to throw an error immediately if the payload prefix indicates base64 encoding but cannot be properly matched, rather than silently falling back.
- Auto-expand the 'Components' section and insert new components at the top when adding them in the properties panel.

- Fix 'Actor Props' section not collapsing correctly by wrapping its content inside the section block.

- Change the Assign Sprite hotkey from Insert to Alt-S.

- Add the 'Sprite' action to the editor's bottom menu (Alt layer), enabling it only for objects that support sprites (Static, Entity, Actor).
…tics console, and updated tech-spec and session docs
…rom known NPC action events:

take + itemId: the item is remembered as in <actorId>.
put + itemId/targetId: the item is remembered from the target; if the target has an Inventory and the relation is not specified, it is considered in <targetId>.
Only events that the NPC itself has performed or that are in its knownByActorIds are applied, i.e., without omniscience.

Added tests:
observed actor takes an item -> remembered location becomes in actor
observed actor puts an item into another inventory -> remembered location becomes in receiver
@KudenikovNS
KudenikovNS merged commit b6fb3c8 into dev Jul 8, 2026
1 check passed
@KudenikovNS
KudenikovNS deleted the puppet-master2 branch July 8, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants