chore: publish clean community baseline
Deploy / deploy (push) Successful in 2m32s
CI / Rust Checks (push) Successful in 5m35s
CI / UI Checks (push) Successful in 4s
CI / Deployment Manifests (push) Successful in 3s
CI / Frontend E2E (push) Successful in 4m35s

This commit is contained in:
github-ops
2026-06-17 06:15:46 +00:00
commit a3a8a6c6a9
317 changed files with 73239 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
use serde::{Deserialize, Serialize};
use std::fmt;
macro_rules! define_id {
($name:ident) => {
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
pub struct $name(String);
impl $name {
pub fn new(value: impl Into<String>) -> Self {
Self(value.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
impl From<String> for $name {
fn from(value: String) -> Self {
Self(value)
}
}
impl From<&str> for $name {
fn from(value: &str) -> Self {
Self(value.to_owned())
}
}
impl AsRef<str> for $name {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl fmt::Display for $name {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str(self.as_str())
}
}
};
}
define_id!(OperationId);
define_id!(DescriptorId);
define_id!(ToolId);
define_id!(SampleId);
define_id!(AuthProfileId);
define_id!(WorkspaceId);
define_id!(TenantId);
define_id!(UserId);
define_id!(UserSessionId);
define_id!(AgentId);
define_id!(InvitationId);
define_id!(PlatformApiKeyId);
define_id!(InvocationLogId);
define_id!(AuditEventId);
define_id!(SecretId);
define_id!(StreamSessionId);
define_id!(AsyncJobId);
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn ids_implement_display() {
let workspace_id = WorkspaceId::new("ws_default");
assert_eq!(workspace_id.to_string(), "ws_default");
assert_eq!(format!("{workspace_id}"), "ws_default");
}
}