feat: add pi lab ai management integration
This commit is contained in:
@@ -534,3 +534,85 @@ pub struct AppendAuditInput {
|
||||
pub target_id: Option<EntityId>,
|
||||
pub metadata_json: String,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// P2: AI tool events (receipts) and file patches — 7-71
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AiToolEventRecord {
|
||||
pub id: EntityId,
|
||||
pub user_id: EntityId,
|
||||
pub workspace_id: Option<EntityId>,
|
||||
pub session_id: EntityId,
|
||||
pub run_id: Option<EntityId>,
|
||||
pub provider: String,
|
||||
pub provider_session_id: Option<String>,
|
||||
pub tool_name: String,
|
||||
pub allowed: bool,
|
||||
pub deny_reason: Option<String>,
|
||||
pub root_uri: String,
|
||||
pub page_path: Option<String>,
|
||||
pub normalized_file_path: Option<String>,
|
||||
pub diff_summary: Option<String>,
|
||||
pub citation_count: i64,
|
||||
pub before_file_version: Option<String>,
|
||||
pub after_file_version: Option<String>,
|
||||
pub payload_json: String,
|
||||
pub created_at: Timestamp,
|
||||
pub deleted_at: Option<Timestamp>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AppendAiToolEventInput {
|
||||
pub id: Option<EntityId>,
|
||||
pub user_id: EntityId,
|
||||
pub workspace_id: Option<EntityId>,
|
||||
pub session_id: EntityId,
|
||||
pub run_id: Option<EntityId>,
|
||||
pub provider: String,
|
||||
pub provider_session_id: Option<String>,
|
||||
pub tool_name: String,
|
||||
pub allowed: bool,
|
||||
pub deny_reason: Option<String>,
|
||||
pub root_uri: String,
|
||||
pub page_path: Option<String>,
|
||||
pub normalized_file_path: Option<String>,
|
||||
pub diff_summary: Option<String>,
|
||||
pub citation_count: i64,
|
||||
pub before_file_version: Option<String>,
|
||||
pub after_file_version: Option<String>,
|
||||
pub payload_json: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AiFilePatchRecord {
|
||||
pub id: EntityId,
|
||||
pub user_id: EntityId,
|
||||
pub workspace_id: Option<EntityId>,
|
||||
pub session_id: EntityId,
|
||||
pub run_id: Option<EntityId>,
|
||||
pub tool_event_id: EntityId,
|
||||
pub root_uri: String,
|
||||
pub relative_path: String,
|
||||
pub before_file_version: Option<String>,
|
||||
pub after_file_version: Option<String>,
|
||||
pub patch_summary_json: String,
|
||||
pub created_at: Timestamp,
|
||||
pub deleted_at: Option<Timestamp>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AppendAiFilePatchInput {
|
||||
pub id: Option<EntityId>,
|
||||
pub user_id: EntityId,
|
||||
pub workspace_id: Option<EntityId>,
|
||||
pub session_id: EntityId,
|
||||
pub run_id: Option<EntityId>,
|
||||
pub tool_event_id: EntityId,
|
||||
pub root_uri: String,
|
||||
pub relative_path: String,
|
||||
pub before_file_version: Option<String>,
|
||||
pub after_file_version: Option<String>,
|
||||
pub patch_summary_json: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user