docs: publish reviewed CHAT-01C private readback contracts (#1507)
This commit is contained in:
@@ -0,0 +1,835 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://example.invalid/mosaic/chat-01c/draft-1",
|
||||
"title": "CHAT-01C private request and safe projection drafts",
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/$defs/privateClientRequest"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/privateStatePage"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/uploadRange"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/privateRecovery"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/privateRefusal"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/privateTextPreview"
|
||||
}
|
||||
],
|
||||
"$defs": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 128,
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
|
||||
},
|
||||
"revision": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 9007199254740991
|
||||
},
|
||||
"digest": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-f0-9]{64}$"
|
||||
},
|
||||
"target": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"conversation": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"branch": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"execution": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"controllerGeneration": {
|
||||
"$ref": "#/$defs/revision"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"conversation",
|
||||
"branch",
|
||||
"execution",
|
||||
"controllerGeneration"
|
||||
]
|
||||
},
|
||||
"privateClientRequest": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"version",
|
||||
"kind",
|
||||
"id",
|
||||
"connection",
|
||||
"conversation",
|
||||
"command"
|
||||
],
|
||||
"properties": {
|
||||
"version": {
|
||||
"const": 1
|
||||
},
|
||||
"kind": {
|
||||
"const": "privateClientRequest"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"connection": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"conversation": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"command": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"operation",
|
||||
"cursor",
|
||||
"limit"
|
||||
],
|
||||
"properties": {
|
||||
"operation": {
|
||||
"const": "read-private-state"
|
||||
},
|
||||
"cursor": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"operation",
|
||||
"upload",
|
||||
"revision",
|
||||
"offset",
|
||||
"length"
|
||||
],
|
||||
"properties": {
|
||||
"operation": {
|
||||
"const": "read-upload-range"
|
||||
},
|
||||
"upload": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 20971520
|
||||
},
|
||||
"length": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 262144
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"operation",
|
||||
"item",
|
||||
"revision",
|
||||
"payloadDigest"
|
||||
],
|
||||
"properties": {
|
||||
"operation": {
|
||||
"const": "recover-refused-draft"
|
||||
},
|
||||
"item": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"payloadDigest": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-f0-9]{64}$"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"operation": {
|
||||
"const": "preview-upload-text"
|
||||
},
|
||||
"upload": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"operation",
|
||||
"upload",
|
||||
"revision"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"draftView": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"kind": {
|
||||
"const": "draft"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"text": {
|
||||
"type": "string",
|
||||
"maxLength": 262144
|
||||
},
|
||||
"state": {
|
||||
"enum": [
|
||||
"unsent",
|
||||
"submitted",
|
||||
"discarded"
|
||||
]
|
||||
},
|
||||
"attachments": {
|
||||
"type": "array",
|
||||
"maxItems": 10,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"$ref": "#/$defs/id"
|
||||
}
|
||||
},
|
||||
"recoveredFrom": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"branch": {
|
||||
"$ref": "#/$defs/id"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"kind",
|
||||
"id",
|
||||
"revision",
|
||||
"text",
|
||||
"state",
|
||||
"attachments",
|
||||
"recoveredFrom",
|
||||
"branch"
|
||||
]
|
||||
},
|
||||
"uploadView": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"kind": {
|
||||
"const": "upload"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"filename": {
|
||||
"type": "string",
|
||||
"maxLength": 255
|
||||
},
|
||||
"mediaType": {
|
||||
"type": "string",
|
||||
"maxLength": 127
|
||||
},
|
||||
"size": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 20971520
|
||||
},
|
||||
"digest": {
|
||||
"$ref": "#/$defs/digest"
|
||||
},
|
||||
"state": {
|
||||
"enum": [
|
||||
"receiving",
|
||||
"staged",
|
||||
"transferring",
|
||||
"delivered",
|
||||
"sent",
|
||||
"rejected",
|
||||
"discarded"
|
||||
]
|
||||
},
|
||||
"receivedBytes": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 20971520
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"kind",
|
||||
"id",
|
||||
"revision",
|
||||
"filename",
|
||||
"mediaType",
|
||||
"size",
|
||||
"digest",
|
||||
"state",
|
||||
"receivedBytes"
|
||||
]
|
||||
},
|
||||
"queueView": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"kind": {
|
||||
"const": "queue"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"state": {
|
||||
"enum": [
|
||||
"admitted",
|
||||
"queued",
|
||||
"dispatched",
|
||||
"acknowledged",
|
||||
"working",
|
||||
"finished",
|
||||
"failed",
|
||||
"delivery-unknown",
|
||||
"recovered-as-draft",
|
||||
"recovery-failed",
|
||||
"dispatch-refused",
|
||||
"rejected"
|
||||
]
|
||||
},
|
||||
"payloadDigest": {
|
||||
"$ref": "#/$defs/digest"
|
||||
},
|
||||
"reason": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"request": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"draft": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/$defs/target"
|
||||
},
|
||||
"frozenInputState": {
|
||||
"enum": [
|
||||
"available",
|
||||
"integrity-unavailable"
|
||||
]
|
||||
},
|
||||
"frozenInput": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/frozenInputView"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"kind",
|
||||
"id",
|
||||
"revision",
|
||||
"state",
|
||||
"payloadDigest",
|
||||
"reason",
|
||||
"request",
|
||||
"draft",
|
||||
"target",
|
||||
"frozenInputState",
|
||||
"frozenInput"
|
||||
],
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"frozenInputState": {
|
||||
"const": "available"
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"frozenInput": {
|
||||
"$ref": "#/$defs/frozenInputView"
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"properties": {
|
||||
"frozenInput": {
|
||||
"type": "null"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"receiptView": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"kind": {
|
||||
"const": "receipt"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"request": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"state": {
|
||||
"enum": [
|
||||
"admitted",
|
||||
"queued",
|
||||
"dispatched",
|
||||
"acknowledged",
|
||||
"working",
|
||||
"finished",
|
||||
"failed",
|
||||
"delivery-unknown",
|
||||
"recovered-as-draft",
|
||||
"recovery-failed",
|
||||
"dispatch-refused",
|
||||
"rejected"
|
||||
]
|
||||
},
|
||||
"reason": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"kind",
|
||||
"id",
|
||||
"revision",
|
||||
"request",
|
||||
"state",
|
||||
"reason"
|
||||
]
|
||||
},
|
||||
"confirmationView": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"kind": {
|
||||
"const": "confirmation"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"operation": {
|
||||
"enum": [
|
||||
"force-stop",
|
||||
"recover",
|
||||
"acquire-recovery-control"
|
||||
]
|
||||
},
|
||||
"target": {
|
||||
"$ref": "#/$defs/target"
|
||||
},
|
||||
"state": {
|
||||
"enum": [
|
||||
"pending",
|
||||
"confirmed",
|
||||
"consumed",
|
||||
"expired",
|
||||
"cancelled",
|
||||
"reconfirm-required"
|
||||
]
|
||||
},
|
||||
"expiresAt": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 9007199254740991
|
||||
},
|
||||
"stop": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"kind",
|
||||
"id",
|
||||
"revision",
|
||||
"operation",
|
||||
"target",
|
||||
"state",
|
||||
"expiresAt",
|
||||
"stop"
|
||||
]
|
||||
},
|
||||
"privateStatePage": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"version": {
|
||||
"const": 1
|
||||
},
|
||||
"kind": {
|
||||
"const": "privateStatePage"
|
||||
},
|
||||
"actor": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"conversation": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"snapshot": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"sourceRevision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"maxItems": 100,
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/$defs/draftView"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/uploadView"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/queueView"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/receiptView"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/confirmationView"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"nextCursor": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"kind",
|
||||
"actor",
|
||||
"conversation",
|
||||
"snapshot",
|
||||
"sourceRevision",
|
||||
"items",
|
||||
"nextCursor"
|
||||
]
|
||||
},
|
||||
"uploadRange": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"version": {
|
||||
"const": 1
|
||||
},
|
||||
"kind": {
|
||||
"const": "uploadRange"
|
||||
},
|
||||
"upload": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 20971520
|
||||
},
|
||||
"length": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 262144
|
||||
},
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 20971520
|
||||
},
|
||||
"digest": {
|
||||
"$ref": "#/$defs/digest"
|
||||
},
|
||||
"rangeDigest": {
|
||||
"$ref": "#/$defs/digest"
|
||||
},
|
||||
"dataBase64": {
|
||||
"type": "string",
|
||||
"maxLength": 349528,
|
||||
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
|
||||
},
|
||||
"disposition": {
|
||||
"const": "attachment"
|
||||
},
|
||||
"mediaType": {
|
||||
"const": "application/octet-stream"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"kind",
|
||||
"upload",
|
||||
"revision",
|
||||
"offset",
|
||||
"length",
|
||||
"total",
|
||||
"digest",
|
||||
"rangeDigest",
|
||||
"dataBase64",
|
||||
"disposition",
|
||||
"mediaType"
|
||||
]
|
||||
},
|
||||
"privateRecovery": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"version": {
|
||||
"const": 1
|
||||
},
|
||||
"kind": {
|
||||
"const": "privateRecovery"
|
||||
},
|
||||
"item": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"draft": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"state": {
|
||||
"const": "recovered-as-draft"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"kind",
|
||||
"item",
|
||||
"revision",
|
||||
"draft",
|
||||
"state"
|
||||
]
|
||||
},
|
||||
"privateRefusal": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"version": {
|
||||
"const": 1
|
||||
},
|
||||
"kind": {
|
||||
"const": "privateRefusal"
|
||||
},
|
||||
"request": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"reason": {
|
||||
"enum": [
|
||||
"request",
|
||||
"operation",
|
||||
"channel",
|
||||
"grant",
|
||||
"scope",
|
||||
"cursor",
|
||||
"projection-size",
|
||||
"upload",
|
||||
"integrity",
|
||||
"range",
|
||||
"item",
|
||||
"conflicting-request",
|
||||
"state",
|
||||
"preview"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"kind",
|
||||
"request",
|
||||
"reason"
|
||||
]
|
||||
},
|
||||
"privateTextPreview": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"version": {
|
||||
"const": 1
|
||||
},
|
||||
"kind": {
|
||||
"const": "privateTextPreview"
|
||||
},
|
||||
"upload": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"digest": {
|
||||
"$ref": "#/$defs/digest"
|
||||
},
|
||||
"text": {
|
||||
"type": "string",
|
||||
"maxLength": 1572864
|
||||
},
|
||||
"renderMode": {
|
||||
"const": "textContent-only"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"kind",
|
||||
"upload",
|
||||
"revision",
|
||||
"digest",
|
||||
"text",
|
||||
"renderMode"
|
||||
]
|
||||
},
|
||||
"frozenInputView": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"branch": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"draftRevision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"text": {
|
||||
"type": "string",
|
||||
"maxLength": 262144
|
||||
},
|
||||
"uploads": {
|
||||
"type": "array",
|
||||
"maxItems": 10,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/$defs/id"
|
||||
},
|
||||
"revision": {
|
||||
"$ref": "#/$defs/revision"
|
||||
},
|
||||
"filename": {
|
||||
"type": "string",
|
||||
"maxLength": 255
|
||||
},
|
||||
"size": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 20971520
|
||||
},
|
||||
"digest": {
|
||||
"$ref": "#/$defs/digest"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"revision",
|
||||
"filename",
|
||||
"size",
|
||||
"digest"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"branch",
|
||||
"draftRevision",
|
||||
"text",
|
||||
"uploads"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user