noggin

Response envelope

The versioned wrapper the CLI's --json mode, MCP tool responses, and noggin-rpc verb responses share. Same shape everywhere so downstream consumers pattern-match once:

{
  status: 'ok' | 'error',
  envelopeVersion: number,      // RESPONSE_ENVELOPE_VERSION
  verb: string | null,
  data?: <verb result>,         // when status === 'ok'
  error?: {
    code: NogginErrorCode | string,
    message: string,
    exitCode: number,
    data?: NogginErrorData,
  },                            // when status === 'error'
}

Two pages:

Versioning

The envelope version increments only when the wrapper's shape changes (a new field on the error side, a rename, etc.). It's completely independent of SCHEMA_VERSION, which versions the on-disk NogginDocument. Both are exported as constants.