::nsmcp::Object ::nsmcp::Object dict getdef ::nsmcp::QuestionBackend ::nsmcp::QuestionBackend → reportingInstructions canonicalResult describe run toolCallResult ::nsmcp::QuestionBackend->::nsmcp::Object ::nsmcp::ChatCompletionsBackend ::nsmcp::ChatCompletionsBackend describe init run streamClose streamData streamDrain streamHeaders streamOpen ::nsmcp::ChatCompletionsBackend->::nsmcp::QuestionBackend ::nsmcp::CodexQuestionBackend ::nsmcp::CodexQuestionBackend describe run ::nsmcp::CodexQuestionBackend->::nsmcp::QuestionBackend

Class ::nsmcp::QuestionBackend

::nsmcp::QuestionBackend[i] create ...

Shared reporting rules for Codex and direct API backends.
Defined in /usr/local/ns/tcl/nsmcp/question-backend.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nsmcp::Object[i]
  • subclass: ::nsmcp::ChatCompletionsBackend[i], ::nsmcp::CodexQuestionBackend[i]

Methods (to be applied on the object)

  • reportingInstructions (scripted, public)

     nsmcp::QuestionBackend[i] reportingInstructions base

    Append diagnostic evidence-reporting rules to backend instructions. Use server-owned policy text so tool results cannot redefine coverage, timing or provenance requirements.

    Parameters:
    base (required)
    Server-owned base instruction string.
    Returns:
    The augmented instruction string.

    Testcases:
    No testcase defined.

Methods (to be applied on instances)

  • canonicalResult (scripted, public)

     <instance of nsmcp::QuestionBackend[i]> canonicalResult json

    Remove redundant textual copies of structured tool evidence. Retain typed structured content and unrelated content blocks; leave nonmatching input unchanged.

    Parameters:
    json (required)
    Serialized JSON supplied by the backend transport.
    Returns:
    The canonical JSON result string.

    Testcases:
    No testcase defined.
  • describe (scripted, public)

     <instance of nsmcp::QuestionBackend[i]> describe

    Describe the abstract question backend. Expose a minimal provider identifier without contacting an external service.

    Returns:
    The backend metadata dictionary.

    Testcases:
    No testcase defined.
  • run (scripted, public)

     <instance of nsmcp::QuestionBackend[i]> run question state emit

    Declare the abstract question execution contract. Concrete providers emit events through the callback and manage their own continuation state.

    Parameters:
    question (required)
    Question text supplied to the selected provider.
    state (required)
    Opaque retained provider continuation or scan state.
    emit (required)
    Event callback prefix; returning false requests cancellation.
    Returns:
    No normal result; raises the abstract-method error.

    Testcases:
    No testcase defined.
  • toolCallResult (scripted, public)

     <instance of nsmcp::QuestionBackend[i]> toolCallResult item

    Extract and normalize a Codex tool-call result. Keep transport and permission errors distinct from successful results and canonicalize duplicated structured evidence.

    Parameters:
    item (required)
    Rooted typed JSON for a completed backend tool-call item.
    Returns:
    Serialized JSON for the normalized tool result, or JSON null when absent.

    Testcases:
    No testcase defined.