{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/shazhou-ww/silvermoon/raw/refs/heads/main/schema/v2/idea-event.schema.json",
  "title": "Silvermoon idea state event v2",
  "description": "One canonical UTF-8 JSONL record in an idea's events.jsonl file, with LF and at most 1048576 bytes including LF. The file may be empty; otherwise every record ends with LF and sequence starts at 1 and remains consecutive. Runtime also enforces canonical byte encoding, a regular-file layout, nonempty transitions and the abandoned boundary.",
  "type": "object",
  "required": ["sequence", "type"],
  "properties": {
    "sequence": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
    "type": { "type": "string" }
  },
  "oneOf": [
    {
      "properties": {
        "type": { "const": "setAlias" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["alias"],
          "properties": { "alias": { "anyOf": [
            { "$ref": "../v1/idea-status.schema.json#/properties/alias" }, { "type": "null" }
          ] } }
        }
      },
      "required": ["payload"]
    },
    {
      "properties": {
        "type": { "const": "setLanguage" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["language"],
          "properties": { "language": { "anyOf": [
            { "$ref": "../v1/definitions.schema.json#/$defs/languageTag" }, { "type": "null" }
          ] } }
        }
      },
      "required": ["payload"]
    },
    {
      "properties": {
        "type": { "const": "submitIdeal" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["idealRevision"],
          "properties": { "idealRevision": { "$ref": "../v1/definitions.schema.json#/$defs/objectId" } }
        }
      },
      "required": ["payload"]
    },
    {
      "properties": {
        "type": { "const": "submitInner" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["implementationRevision"],
          "properties": { "implementationRevision": { "$ref": "../v1/definitions.schema.json#/$defs/objectId" } }
        }
      },
      "required": ["payload"]
    },
    {
      "properties": {
        "type": { "const": "submitOuter" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["deploymentRevision"],
          "properties": { "deploymentRevision": { "$ref": "../v1/definitions.schema.json#/$defs/objectId" } }
        }
      },
      "required": ["payload"]
    },
    {
      "properties": {
        "type": { "const": "acceptIdeal" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["idealRevision"],
          "properties": { "idealRevision": { "$ref": "../v1/definitions.schema.json#/$defs/objectId" } }
        }
      },
      "required": ["payload"]
    },
    {
      "properties": {
        "type": { "const": "acceptInner" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["implementationRevision"],
          "properties": { "implementationRevision": { "$ref": "../v1/definitions.schema.json#/$defs/objectId" } }
        }
      },
      "required": ["payload"]
    },
    {
      "properties": {
        "type": { "const": "acceptOuter" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["deploymentRevision"],
          "properties": { "deploymentRevision": { "$ref": "../v1/definitions.schema.json#/$defs/objectId" } }
        }
      },
      "required": ["payload"]
    },
    { "properties": { "type": { "const": "abandon" } } },
    { "properties": { "type": { "const": "resume" } } },
    {
      "properties": {
        "type": { "const": "ping" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["message"],
          "properties": { "message": { "type": "string", "pattern": "\\S" } }
        }
      },
      "required": ["payload"]
    },
    {
      "properties": {
        "type": { "const": "pong" },
        "payload": {
          "type": "object", "additionalProperties": false, "required": ["message"],
          "properties": { "message": { "type": "string", "pattern": "\\S" } }
        }
      },
      "required": ["payload"]
    }
  ],
  "unevaluatedProperties": false
}
