Interface SpaceScopeResolver


public interface SpaceScopeResolver
Tells which space an object belongs to, for the tools that reach one by its id while their call is limited to a space: a tool definition whose space_scope names this resolver (resolver) is called only when the object it reaches belongs to the call's space. For a write that declares space_role: editor, it also tells whether a person could edit the object (canEdit(String, String)).

The spaceOf(String) answer is used for the space decision only and never reaches the model, so a resolver reads as the system: a missing object, an object of no space, an object in another space and an object it can't read all lead to the same refusal. The canEdit(String, String) answer decides whether a digital worker makes the write for a person or asks the space's managers, which the model is told. Neither method may throw; an exception is read as "no space" and "no".

A contributor is a Spring @Service with a unique bean name, non-final (the Kernel/Spring bridge exports it to the MCP server as a proxy of its class), and is looked up at call time, so an add-on that boots after the MCP server is found. A tool whose resolver no add-on provides, or two add-ons provide under one name, is refused.

  • Method Summary

    Modifier and Type
    Method
    Description
    default Boolean
    canEdit(String objectId, String userName)
    Tells whether a person could edit the object in person, for a write whose space_scope declares space_role: editor: a digital worker makes that write for the person only when the answer is true.
     
    spaceOf(String objectId)
     
  • Method Details

    • getName

      String getName()
      Returns:
      the name a tool definition's space_scope.resolver gives, unique on the platform
    • spaceOf

      Long spaceOf(String objectId)
      Parameters:
      objectId - the id the tool call gives: decimal digits, or, when the declaration says id_format: hex32, 32 lowercase hexadecimal digits exactly as sent, or, for id_format: matrix_room, a Matrix room id exactly as sent, with or without its server name
      Returns:
      the id of the space the object belongs to, or null when it is missing, belongs to no space or can't be read
    • canEdit

      default Boolean canEdit(String objectId, String userName)
      Tells whether a person could edit the object in person, for a write whose space_scope declares space_role: editor: a digital worker makes that write for the person only when the answer is true. Like spaceOf(String), it reads as the system, and it must not throw; an exception, like a null answer, is read as "no", and the write then waits for a manager of the space to decide.

      A run nobody asked for (a scheduled one) asks no role: a write a standing approval of a manager covers runs at once, without this method. Any other write it makes is recorded as a proposal, and the manager who approves it is asked about here: such a write runs only on the approval of a manager who could make it in person.

      Parameters:
      objectId - the object's id, as spaceOf(String) receives it
      userName - the person a digital worker would make the write for
      Returns:
      true when the person could edit the object, false when not or when this resolver doesn't tell, the default