vigiles API reference
    Preparing search index...

    Function startMock

    • Start the scripted mock on a free port. Each /v1/messages POST consumes the next turn (the last turn repeats if the client asks for more). Resolves to a handle with the base url and a close().

      Parameters

      • script: readonly ModelTurn[]
      • opts: { onRequest?: (req: ModelRequest) => void; onTurn?: (info: TurnInfo) => void } = {}
        • OptionalonRequest?: (req: ModelRequest) => void

          Called with each /v1/messages request as it arrives — used by the in-sandbox mock entry to stream requests to a file for the parent.

        • OptionalonTurn?: (info: TurnInfo) => void

      Returns Promise<MockHandle>