Skip to content

fix: resolve #3025 — Pet Dæmon: Guest code evaluation requests#3167

Open
tudragon154203 wants to merge 2 commits intoendojs:masterfrom
tudragon154203:contribai/feat/add-guest-code-evaluation-request-capabi
Open

fix: resolve #3025 — Pet Dæmon: Guest code evaluation requests#3167
tudragon154203 wants to merge 2 commits intoendojs:masterfrom
tudragon154203:contribai/feat/add-guest-code-evaluation-request-capabi

Conversation

@tudragon154203
Copy link
Copy Markdown

Summary

fix: resolve #3025 — Pet Dæmon: Guest code evaluation requests

Problem

Severity: High | File: packages/pet-daemon/src/guest-evaluate.js

Create a new module that provides the evaluate function to guest code. This function should accept a program string and package it as an evaluation request message to be sent to the host via the mail system. The function should return a promise that resolves or rejects based on the host's response (allow/deny).

Solution

Export a makeGuestEvaluator(mailbox) function that returns an evaluate(program) async function. The evaluate function should construct a structured mail message of type 'evaluation-request' containing the source code, send it through the mailbox, and await a response message of type 'evaluation-response'. Include source location metadata and a unique request ID for correlation.

Changes

  • packages/pet-daemon/src/guest-evaluate.js (new)
  • packages/pet-daemon/src/host-evaluate-handler.js (new)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

Generated by ContribAI v5.15.0

Fixes endojs#3025

Signed-off-by: tudragon154203 <76395825+tudragon154203@users.noreply.github.com>
Fixes endojs#3025

Signed-off-by: tudragon154203 <76395825+tudragon154203@users.noreply.github.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

⚠️ No Changeset found

Latest commit: 8771c33

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

Pet Dæmon: Guest code evaluation requests

1 participant