endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
788 stars 70 forks source link

feat(daemon,cli): One handle for every agent #2184

Closed kriskowal closed 3 months ago

kriskowal commented 4 months ago

Toward sending messages between mailboxes in separate nodes, this change gives every agent (both hosts and guests) a powerless handle that can be used to mention the agent without leaking agency.

This is somewhat tricky because this is the first cycle in the formula graph. The agent contains a handle and the handle identifier and formula are just ways of referring to the facet held by the agent. So, writing an agent formula generates a handle formula as a side-effect and populates the agent id for handle table.

This also means that mkguest and mkhost need to designate the handle (so that messages from the other agent are visible) and might optionally also designate a pet name for the agent.

kriskowal commented 4 months ago

@rekmarks This is ready for another review. I’ve appended a fixup commit with the necessary changes to the demo script to get it on the right path again.