UNPKG

@kaifronsdal/transcript-viewer

Version:

A web-based viewer for AI conversation transcripts with rollback support

863 lines 19.4 kB
{ "$defs": { "APIFailure": { "description": "API failure.", "properties": { "type": { "const": "api_failure", "default": "api_failure", "title": "Type", "type": "string" }, "id": { "title": "Id", "type": "string" }, "error_message": { "title": "Error Message", "type": "string" }, "error_category": { "enum": [ "rate_limit", "timeout", "quota_billing", "authentication", "content_filter", "empty_content", "generic_failure", "model_not_found", "invalid_request" ], "title": "Error Category", "type": "string" }, "recoverable": { "default": true, "title": "Recoverable", "type": "boolean" } }, "required": [ "id", "error_message", "error_category" ], "title": "APIFailure", "type": "object" }, "AddMessage": { "description": "Edit that adds a message to the transcript.", "properties": { "operation": { "const": "add", "default": "add", "title": "Operation", "type": "string" }, "message": { "discriminator": { "mapping": { "api_failure": "#/$defs/APIFailure", "assistant": "#/$defs/AssistantMessage", "system": "#/$defs/SystemMessage", "tool": "#/$defs/ToolMessage", "user": "#/$defs/UserMessage" }, "propertyName": "type" }, "oneOf": [ { "$ref": "#/$defs/UserMessage" }, { "$ref": "#/$defs/SystemMessage" }, { "$ref": "#/$defs/AssistantMessage" }, { "$ref": "#/$defs/ToolMessage" }, { "$ref": "#/$defs/APIFailure" } ], "title": "Message" } }, "required": [ "message" ], "title": "AddMessage", "type": "object" }, "AssistantMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "type": { "const": "assistant", "default": "assistant", "title": "Type", "type": "string" }, "name": { "title": "Name", "type": "string" }, "id": { "title": "Id", "type": "string" }, "metadata": { "additionalProperties": true, "title": "Metadata", "type": "object" }, "tool_calls": { "items": { "$ref": "#/$defs/ToolCall" }, "title": "Tool Calls", "type": "array" } }, "required": [ "content", "name" ], "title": "AssistantMessage", "type": "object" }, "JudgeOutput": { "description": "Output from the alignment judge evaluation.", "properties": { "response": { "title": "Response", "type": "string" }, "summary": { "title": "Summary", "type": "string" }, "justification": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Justification" }, "scores": { "additionalProperties": { "type": "integer" }, "title": "Scores", "type": "object" } }, "required": [ "response", "summary", "scores" ], "title": "JudgeOutput", "type": "object" }, "Reset": { "description": "Edit that resets the transcript to the initial state.", "properties": { "operation": { "const": "reset", "default": "reset", "title": "Operation", "type": "string" }, "new_messages": { "items": { "discriminator": { "mapping": { "api_failure": "#/$defs/APIFailure", "assistant": "#/$defs/AssistantMessage", "system": "#/$defs/SystemMessage", "tool": "#/$defs/ToolMessage", "user": "#/$defs/UserMessage" }, "propertyName": "type" }, "oneOf": [ { "$ref": "#/$defs/UserMessage" }, { "$ref": "#/$defs/SystemMessage" }, { "$ref": "#/$defs/AssistantMessage" }, { "$ref": "#/$defs/ToolMessage" }, { "$ref": "#/$defs/APIFailure" } ] }, "title": "New Messages", "type": "array" } }, "title": "Reset", "type": "object" }, "Rollback": { "description": "Edit that rolls back the transcript count messages.", "properties": { "operation": { "const": "rollback", "default": "rollback", "title": "Operation", "type": "string" }, "count": { "minimum": 0, "title": "Count", "type": "integer" }, "to_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "To Id" } }, "required": [ "count" ], "title": "Rollback", "type": "object" }, "SystemMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "type": { "const": "system", "default": "system", "title": "Type", "type": "string" }, "name": { "title": "Name", "type": "string" }, "id": { "title": "Id", "type": "string" }, "metadata": { "additionalProperties": true, "title": "Metadata", "type": "object" } }, "required": [ "content", "name" ], "title": "SystemMessage", "type": "object" }, "ToolCall": { "properties": { "name": { "title": "Name", "type": "string" }, "args": { "additionalProperties": true, "title": "Args", "type": "object" }, "id": { "title": "Id", "type": "string" }, "render": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Render" } }, "required": [ "name", "id" ], "title": "ToolCall", "type": "object" }, "ToolCreationEvent": { "description": "Event that creates a tool.", "properties": { "type": { "const": "tool_creation_event", "default": "tool_creation_event", "title": "Type", "type": "string" }, "id": { "title": "Id", "type": "string" }, "metadata": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Metadata" }, "timestamp": { "format": "date-time", "title": "Timestamp", "type": "string" }, "model": { "title": "Model", "type": "string" }, "tool": { "$ref": "#/$defs/ToolDefinition" } }, "required": [ "model", "tool" ], "title": "ToolCreationEvent", "type": "object" }, "ToolDefinition": { "properties": { "name": { "title": "Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "parameters": { "additionalProperties": { "$ref": "#/$defs/ToolParameter" }, "title": "Parameters", "type": "object" }, "required": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Required" } }, "required": [ "name", "description" ], "title": "ToolDefinition", "type": "object" }, "ToolMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "type": { "const": "tool", "default": "tool", "title": "Type", "type": "string" }, "name": { "title": "Name", "type": "string" }, "id": { "title": "Id", "type": "string" }, "metadata": { "additionalProperties": true, "title": "Metadata", "type": "object" }, "tool_call_id": { "title": "Tool Call Id", "type": "string" }, "status": { "default": "success", "enum": [ "success", "error" ], "title": "Status", "type": "string" } }, "required": [ "content", "name", "tool_call_id" ], "title": "ToolMessage", "type": "object" }, "ToolParameter": { "properties": { "type": { "title": "Type", "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Description" }, "enum": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Enum" }, "items": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Items" }, "properties": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Properties" }, "required": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Required" } }, "required": [ "type" ], "title": "ToolParameter", "type": "object" }, "TranscriptEvent": { "description": "Event that modifies a transcript.\n\nThe view field determines which transcript view(s) this event should be applied to.\nCan be a single view name or a list of view names.", "properties": { "type": { "const": "transcript_event", "default": "transcript_event", "title": "Type", "type": "string" }, "id": { "title": "Id", "type": "string" }, "metadata": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Metadata" }, "timestamp": { "format": "date-time", "title": "Timestamp", "type": "string" }, "view": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "title": "View" }, "edit": { "discriminator": { "mapping": { "add": "#/$defs/AddMessage", "reset": "#/$defs/Reset", "rollback": "#/$defs/Rollback" }, "propertyName": "operation" }, "oneOf": [ { "$ref": "#/$defs/AddMessage" }, { "$ref": "#/$defs/Rollback" }, { "$ref": "#/$defs/Reset" } ], "title": "Edit" } }, "required": [ "view", "edit" ], "title": "TranscriptEvent", "type": "object" }, "TranscriptMetadata": { "properties": { "transcript_id": { "title": "Transcript Id", "type": "string" }, "auditor_model": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Auditor Model" }, "target_model": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Target Model" }, "created_at": { "format": "date-time", "title": "Created At", "type": "string" }, "updated_at": { "format": "date-time", "title": "Updated At", "type": "string" }, "version": { "const": "v2.0", "default": "v2.0", "title": "Version", "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Description" }, "short_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Short Name" }, "tags": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Tags" }, "judge_output": { "anyOf": [ { "$ref": "#/$defs/JudgeOutput" }, { "type": "null" } ], "default": null } }, "required": [ "transcript_id", "created_at", "updated_at" ], "title": "TranscriptMetadata", "type": "object" }, "UserMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "type": { "const": "user", "default": "user", "title": "Type", "type": "string" }, "name": { "title": "Name", "type": "string" }, "id": { "title": "Id", "type": "string" }, "metadata": { "additionalProperties": true, "title": "Metadata", "type": "object" } }, "required": [ "content", "name" ], "title": "UserMessage", "type": "object" } }, "properties": { "metadata": { "$ref": "#/$defs/TranscriptMetadata" }, "events": { "items": { "discriminator": { "mapping": { "tool_creation_event": "#/$defs/ToolCreationEvent", "transcript_event": "#/$defs/TranscriptEvent" }, "propertyName": "type" }, "oneOf": [ { "$ref": "#/$defs/TranscriptEvent" }, { "$ref": "#/$defs/ToolCreationEvent" } ] }, "title": "Events", "type": "array" }, "messages": { "items": {}, "title": "Messages", "type": "array" }, "target_messages": { "items": {}, "title": "Target Messages", "type": "array" } }, "required": [ "metadata" ], "title": "Transcript", "type": "object" }