user-defined-ask.js 412 B

12345678910
  1. // A user object with its own `.ask` method must NOT register as an ask site:
  2. // site detection resolves the callee symbol to the facade, not by method name.
  3. const notAnAgent = {
  4. ask(question) {
  5. return question.toUpperCase();
  6. },
  7. };
  8. const shouted = notAnAgent.ask("hello");
  9. const real = await __host.ask("ask#1", __host.createActor("actor#1", "scanner"), `Answer, given ${shouted}`);
  10. return real;