Skip to content

Commit 6d54149

Browse files
authored
Merge pull request #89 from objectstack-ai/copilot/add-audit-log-architecture
2 parents 051a46c + 31c2fca commit 6d54149

File tree

93 files changed

+8688
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+8688
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: BillingPeriod
3+
description: BillingPeriod Schema Reference
4+
---
5+
6+
## Allowed Values
7+
8+
* `hourly`
9+
* `daily`
10+
* `weekly`
11+
* `monthly`
12+
* `quarterly`
13+
* `yearly`
14+
* `custom`
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: BudgetLimit
3+
description: BudgetLimit Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **type** | `Enum<'global' \| 'user' \| 'agent' \| 'object' \| 'project' \| 'department'>` || |
11+
| **scope** | `string` | optional | Scope identifier (userId, agentId, etc.) |
12+
| **maxCost** | `number` || Maximum cost limit |
13+
| **currency** | `string` | optional | |
14+
| **period** | `Enum<'hourly' \| 'daily' \| 'weekly' \| 'monthly' \| 'quarterly' \| 'yearly' \| 'custom'>` || |
15+
| **customPeriodDays** | `integer` | optional | Custom period in days |
16+
| **softLimit** | `number` | optional | Soft limit for warnings |
17+
| **warnThresholds** | `number[]` | optional | Warning thresholds (e.g., [0.5, 0.8, 0.95]) |
18+
| **enforced** | `boolean` | optional | Block requests when exceeded |
19+
| **gracePeriodSeconds** | `integer` | optional | Grace period after limit exceeded |
20+
| **allowRollover** | `boolean` | optional | Allow unused budget to rollover |
21+
| **maxRolloverPercentage** | `number` | optional | Max rollover as % of limit |
22+
| **name** | `string` | optional | Budget name |
23+
| **description** | `string` | optional | |
24+
| **active** | `boolean` | optional | |
25+
| **tags** | `string[]` | optional | |
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: BudgetStatus
3+
description: BudgetStatus Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **budgetId** | `string` || |
11+
| **type** | `Enum<'global' \| 'user' \| 'agent' \| 'object' \| 'project' \| 'department'>` || |
12+
| **scope** | `string` | optional | |
13+
| **periodStart** | `string` || ISO 8601 timestamp |
14+
| **periodEnd** | `string` || ISO 8601 timestamp |
15+
| **currentCost** | `number` | optional | |
16+
| **maxCost** | `number` || |
17+
| **currency** | `string` | optional | |
18+
| **percentageUsed** | `number` || Usage as percentage (can exceed 1.0 if over budget) |
19+
| **remainingCost** | `number` || Remaining budget (can be negative if exceeded) |
20+
| **isExceeded** | `boolean` | optional | |
21+
| **isWarning** | `boolean` | optional | |
22+
| **projectedCost** | `number` | optional | Projected cost for period |
23+
| **projectedOverage** | `number` | optional | Projected overage |
24+
| **lastUpdated** | `string` || ISO 8601 timestamp |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: BudgetType
3+
description: BudgetType Schema Reference
4+
---
5+
6+
## Allowed Values
7+
8+
* `global`
9+
* `user`
10+
* `agent`
11+
* `object`
12+
* `project`
13+
* `department`
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: ConversationAnalytics
3+
description: ConversationAnalytics Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **sessionId** | `string` || |
11+
| **totalMessages** | `integer` || |
12+
| **userMessages** | `integer` || |
13+
| **assistantMessages** | `integer` || |
14+
| **systemMessages** | `integer` || |
15+
| **totalTokens** | `integer` || |
16+
| **averageTokensPerMessage** | `number` || |
17+
| **peakTokenUsage** | `integer` || |
18+
| **pruningEvents** | `integer` | optional | |
19+
| **summarizationEvents** | `integer` | optional | |
20+
| **tokensSavedByPruning** | `integer` | optional | |
21+
| **tokensSavedBySummarization** | `integer` | optional | |
22+
| **duration** | `number` | optional | Session duration in seconds |
23+
| **firstMessageAt** | `string` | optional | ISO 8601 timestamp |
24+
| **lastMessageAt** | `string` | optional | ISO 8601 timestamp |
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: ConversationContext
3+
description: ConversationContext Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **sessionId** | `string` || Conversation session ID |
11+
| **userId** | `string` | optional | User identifier |
12+
| **agentId** | `string` | optional | AI agent identifier |
13+
| **object** | `string` | optional | Related object (e.g., "case", "project") |
14+
| **recordId** | `string` | optional | Related record ID |
15+
| **scope** | `Record<string, any>` | optional | Additional context scope |
16+
| **systemMessage** | `string` | optional | System prompt/instructions |
17+
| **metadata** | `Record<string, any>` | optional | |
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: ConversationMessage
3+
description: ConversationMessage Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || Unique message ID |
11+
| **timestamp** | `string` || ISO 8601 timestamp |
12+
| **role** | `Enum<'system' \| 'user' \| 'assistant' \| 'function' \| 'tool'>` || |
13+
| **content** | `string \| object[]` || Message content (text or multimodal) |
14+
| **functionCall** | `object` | optional | Legacy function call |
15+
| **toolCalls** | `object[]` | optional | Tool calls |
16+
| **toolCallId** | `string` | optional | Tool call ID this message responds to |
17+
| **name** | `string` | optional | Name of the function/user |
18+
| **tokens** | `object` | optional | Token usage for this message |
19+
| **pinned** | `boolean` | optional | Prevent removal during pruning |
20+
| **importance** | `number` | optional | Importance score for pruning |
21+
| **embedding** | `number[]` | optional | Vector embedding for semantic search |
22+
| **metadata** | `Record<string, any>` | optional | |
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: ConversationSession
3+
description: ConversationSession Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || Unique session ID |
11+
| **name** | `string` | optional | Session name/title |
12+
| **context** | `object` || |
13+
| **modelId** | `string` | optional | AI model ID |
14+
| **tokenBudget** | `object` || |
15+
| **messages** | `object[]` | optional | |
16+
| **tokens** | `object` | optional | |
17+
| **status** | `Enum<'active' \| 'paused' \| 'completed' \| 'archived'>` | optional | |
18+
| **createdAt** | `string` || ISO 8601 timestamp |
19+
| **updatedAt** | `string` || ISO 8601 timestamp |
20+
| **expiresAt** | `string` | optional | ISO 8601 timestamp |
21+
| **tags** | `string[]` | optional | |
22+
| **metadata** | `Record<string, any>` | optional | |
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: ConversationSummary
3+
description: ConversationSummary Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **summary** | `string` || Conversation summary |
11+
| **keyPoints** | `string[]` | optional | Key discussion points |
12+
| **originalTokens** | `integer` || Original token count |
13+
| **summaryTokens** | `integer` || Summary token count |
14+
| **tokensSaved** | `integer` || Tokens saved |
15+
| **messageRange** | `object` || Range of messages summarized |
16+
| **generatedAt** | `string` || ISO 8601 timestamp |
17+
| **modelId** | `string` | optional | Model used for summarization |
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: CostAlert
3+
description: CostAlert Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || |
11+
| **timestamp** | `string` || ISO 8601 timestamp |
12+
| **type** | `Enum<'threshold_warning' \| 'threshold_critical' \| 'limit_exceeded' \| 'anomaly_detected' \| 'projection_exceeded'>` || |
13+
| **severity** | `Enum<'info' \| 'warning' \| 'critical'>` || |
14+
| **budgetId** | `string` | optional | |
15+
| **budgetType** | `Enum<'global' \| 'user' \| 'agent' \| 'object' \| 'project' \| 'department'>` | optional | |
16+
| **scope** | `string` | optional | |
17+
| **message** | `string` || Alert message |
18+
| **currentCost** | `number` || |
19+
| **maxCost** | `number` | optional | |
20+
| **threshold** | `number` | optional | |
21+
| **currency** | `string` | optional | |
22+
| **recommendations** | `string[]` | optional | |
23+
| **acknowledged** | `boolean` | optional | |
24+
| **acknowledgedBy** | `string` | optional | |
25+
| **acknowledgedAt** | `string` | optional | |
26+
| **resolved** | `boolean` | optional | |
27+
| **metadata** | `Record<string, any>` | optional | |

0 commit comments

Comments
 (0)