Skip to content
Draft
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
1 change: 1 addition & 0 deletions codex-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions codex-rs/character/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ codex-protocol = { workspace = true }
image = { workspace = true, features = ["gif", "jpeg", "png", "pnm", "webp"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
uuid = { workspace = true, features = ["v4"] }

[dev-dependencies]
pretty_assertions = { workspace = true }
Expand Down
18 changes: 18 additions & 0 deletions codex-rs/character/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod avatar;
mod manifest;
mod onboarding;

pub use avatar::AvatarAnimation;
pub use avatar::AvatarAnimationFrame;
Expand All @@ -20,5 +21,22 @@ pub use manifest::ValidationIssue;
pub use manifest::ValidationIssueCode;
pub use manifest::ValidationReport;
pub use manifest::validate_manifest_path;
pub use manifest::validate_canonical_id;
pub use onboarding::ActivationError;
pub use onboarding::ActivationJournal;
pub use onboarding::ActivationJournalCoordinator;
pub use onboarding::ActivationPhase;
pub use onboarding::CharacterWizardRequestV1;
pub use onboarding::CharacterWizardResultV1;
pub use onboarding::LastActiveStore;
pub use onboarding::CharacterPackageSource;
pub use onboarding::DirectoryPackageSource;
pub use onboarding::WizardOperation;
pub use onboarding::WizardOperationId;
pub use onboarding::WizardOperationReceipt;
pub use onboarding::WizardOutcome;
pub use onboarding::encode_bounded_request;
pub use onboarding::resolve_candidate_path;
pub use onboarding::resolve_wizard_executable;

pub const CHARACTER_SCHEMA_VERSION: u32 = 1;
4 changes: 2 additions & 2 deletions codex-rs/character/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ fn validate_manifest_fields(manifest: &CharacterManifestV1, errors: &mut Vec<Val
.at_path("schemaVersion"),
);
}
if !is_valid_id(&manifest.id) {
if !validate_canonical_id(&manifest.id) {
errors.push(
ValidationIssue::new(
ValidationIssueCode::InvalidId,
Expand Down Expand Up @@ -521,7 +521,7 @@ fn collision_errors(entries: &[ValidationReport]) -> Vec<ValidationIssue> {
errors
}

fn is_valid_id(id: &str) -> bool {
pub fn validate_canonical_id(id: &str) -> bool {
let bytes = id.as_bytes();
!bytes.is_empty()
&& bytes.len() <= 64
Expand Down
Loading
Loading