Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 131 additions & 2 deletions container/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ const docTemplate = `{
},
"/v1/sessions/workspace/{workspace}": {
"get": {
"description": "Returns session information for a specific workspace directory. Use ?full=true for complete session data including messages.",
"description": "Returns session information for a specific workspace. Accepts workspace ID (UUID) or path. Use ?full=true for complete session data including messages.",
"produces": [
"application/json"
],
Expand All @@ -1715,7 +1715,7 @@ const docTemplate = `{
"parameters": [
{
"type": "string",
"description": "Workspace directory path",
"description": "Workspace ID (UUID) or directory path",
"name": "workspace",
"in": "path",
"required": true
Expand Down Expand Up @@ -2240,6 +2240,22 @@ const docTemplate = `{
"$ref": "#/definitions/github_com_vanpelt_catnip_internal_models.SessionListEntry"
}
},
"latestMessage": {
"description": "Latest assistant message text (always populated when available)",
"type": "string"
},
"latestSessionTitle": {
"description": "Latest session title (from PTY escape sequences or session history)",
"type": "string"
},
"latestThought": {
"description": "Latest thinking/reasoning content (always populated when available)",
"type": "string"
},
"latestUserPrompt": {
"description": "Latest user prompt from history (always populated when available)",
"type": "string"
},
"messageCount": {
"description": "Total message count in full data",
"type": "integer"
Expand All @@ -2259,6 +2275,21 @@ const docTemplate = `{
}
]
},
"stats": {
"description": "Session statistics (token counts, tool usage, etc.)",
"allOf": [
{
"$ref": "#/definitions/github_com_vanpelt_catnip_internal_models.SessionStats"
}
]
},
"todos": {
"description": "Current todo items from the session",
"type": "array",
"items": {
"$ref": "#/definitions/github_com_vanpelt_catnip_internal_models.Todo"
}
},
"userPrompts": {
"description": "User prompts from ~/.claude.json (only when full=true)",
"type": "array",
Expand Down Expand Up @@ -2450,6 +2481,104 @@ const docTemplate = `{
}
}
},
"github_com_vanpelt_catnip_internal_models.SessionStats": {
"description": "Session statistics including token counts and activity metrics",
"type": "object",
"properties": {
"activeDurationSeconds": {
"description": "Active duration in seconds (time Claude was actually working)",
"type": "number",
"example": 1800.25
},
"activeToolNames": {
"description": "Tool usage counts by name",
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"apiCallCount": {
"description": "Number of API calls made",
"type": "integer",
"example": 12
},
"assistantMessages": {
"description": "Number of assistant messages",
"type": "integer",
"example": 27
},
"cacheCreationTokens": {
"description": "Cache creation tokens",
"type": "integer",
"example": 30000
},
"cacheReadTokens": {
"description": "Cache read tokens (context reuse)",
"type": "integer",
"example": 120000
},
"compactionCount": {
"description": "Number of context compactions",
"type": "integer",
"example": 1
},
"humanPromptCount": {
"description": "Number of human prompts (user messages with text, not tool results)",
"type": "integer",
"example": 10
},
"imageCount": {
"description": "Number of images in the conversation",
"type": "integer",
"example": 2
},
"lastContextSizeTokens": {
"description": "Last message's cache_read value (actual context size in tokens)",
"type": "integer",
"example": 125000
},
"sessionDurationSeconds": {
"description": "Session duration in seconds (wall-clock time)",
"type": "number",
"example": 3600.5
},
"subAgentCount": {
"description": "Number of sub-agents spawned",
"type": "integer",
"example": 3
},
"thinkingBlockCount": {
"description": "Number of thinking blocks",
"type": "integer",
"example": 8
},
"toolCallCount": {
"description": "Total tool calls made",
"type": "integer",
"example": 35
},
"totalInputTokens": {
"description": "Total input tokens used",
"type": "integer",
"example": 150000
},
"totalMessages": {
"description": "Total number of messages in the session",
"type": "integer",
"example": 42
},
"totalOutputTokens": {
"description": "Total output tokens generated",
"type": "integer",
"example": 85000
},
"userMessages": {
"description": "Number of user messages",
"type": "integer",
"example": 15
}
}
},
"github_com_vanpelt_catnip_internal_models.TitleEntry": {
"type": "object",
"properties": {
Expand Down
133 changes: 131 additions & 2 deletions container/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,7 @@
},
"/v1/sessions/workspace/{workspace}": {
"get": {
"description": "Returns session information for a specific workspace directory. Use ?full=true for complete session data including messages.",
"description": "Returns session information for a specific workspace. Accepts workspace ID (UUID) or path. Use ?full=true for complete session data including messages.",
"produces": [
"application/json"
],
Expand All @@ -1712,7 +1712,7 @@
"parameters": [
{
"type": "string",
"description": "Workspace directory path",
"description": "Workspace ID (UUID) or directory path",
"name": "workspace",
"in": "path",
"required": true
Expand Down Expand Up @@ -2237,6 +2237,22 @@
"$ref": "#/definitions/github_com_vanpelt_catnip_internal_models.SessionListEntry"
}
},
"latestMessage": {
"description": "Latest assistant message text (always populated when available)",
"type": "string"
},
"latestSessionTitle": {
"description": "Latest session title (from PTY escape sequences or session history)",
"type": "string"
},
"latestThought": {
"description": "Latest thinking/reasoning content (always populated when available)",
"type": "string"
},
"latestUserPrompt": {
"description": "Latest user prompt from history (always populated when available)",
"type": "string"
},
"messageCount": {
"description": "Total message count in full data",
"type": "integer"
Expand All @@ -2256,6 +2272,21 @@
}
]
},
"stats": {
"description": "Session statistics (token counts, tool usage, etc.)",
"allOf": [
{
"$ref": "#/definitions/github_com_vanpelt_catnip_internal_models.SessionStats"
}
]
},
"todos": {
"description": "Current todo items from the session",
"type": "array",
"items": {
"$ref": "#/definitions/github_com_vanpelt_catnip_internal_models.Todo"
}
},
"userPrompts": {
"description": "User prompts from ~/.claude.json (only when full=true)",
"type": "array",
Expand Down Expand Up @@ -2447,6 +2478,104 @@
}
}
},
"github_com_vanpelt_catnip_internal_models.SessionStats": {
"description": "Session statistics including token counts and activity metrics",
"type": "object",
"properties": {
"activeDurationSeconds": {
"description": "Active duration in seconds (time Claude was actually working)",
"type": "number",
"example": 1800.25
},
"activeToolNames": {
"description": "Tool usage counts by name",
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"apiCallCount": {
"description": "Number of API calls made",
"type": "integer",
"example": 12
},
"assistantMessages": {
"description": "Number of assistant messages",
"type": "integer",
"example": 27
},
"cacheCreationTokens": {
"description": "Cache creation tokens",
"type": "integer",
"example": 30000
},
"cacheReadTokens": {
"description": "Cache read tokens (context reuse)",
"type": "integer",
"example": 120000
},
"compactionCount": {
"description": "Number of context compactions",
"type": "integer",
"example": 1
},
"humanPromptCount": {
"description": "Number of human prompts (user messages with text, not tool results)",
"type": "integer",
"example": 10
},
"imageCount": {
"description": "Number of images in the conversation",
"type": "integer",
"example": 2
},
"lastContextSizeTokens": {
"description": "Last message's cache_read value (actual context size in tokens)",
"type": "integer",
"example": 125000
},
"sessionDurationSeconds": {
"description": "Session duration in seconds (wall-clock time)",
"type": "number",
"example": 3600.5
},
"subAgentCount": {
"description": "Number of sub-agents spawned",
"type": "integer",
"example": 3
},
"thinkingBlockCount": {
"description": "Number of thinking blocks",
"type": "integer",
"example": 8
},
"toolCallCount": {
"description": "Total tool calls made",
"type": "integer",
"example": 35
},
"totalInputTokens": {
"description": "Total input tokens used",
"type": "integer",
"example": 150000
},
"totalMessages": {
"description": "Total number of messages in the session",
"type": "integer",
"example": 42
},
"totalOutputTokens": {
"description": "Total output tokens generated",
"type": "integer",
"example": 85000
},
"userMessages": {
"description": "Number of user messages",
"type": "integer",
"example": 15
}
}
},
"github_com_vanpelt_catnip_internal_models.TitleEntry": {
"type": "object",
"properties": {
Expand Down
Loading