spoke-operations 0.18.1

SPOKE lifecycle helpers — pure functions over spoke-schemas wire types
//! SPOKE lifecycle helpers — pure functions over `spoke-schemas` wire types.

mod adapter;
mod adoption;
mod assemble;
mod body;
mod computable;
mod cognition;
mod extensions;
mod error;
mod finding;
mod history;
mod knowledge_entry;
mod judgment;
mod memory;
mod mind_state;
mod occ;
mod promote;
mod relate;
mod result;
mod scope;
mod timeline;
mod tools;
mod upsert;
mod util;

pub use assemble::{
    build_assemble_packet, knowledge_entry_to_assemble_entry, BuildAssemblePacketInput,
    KnowledgeEntryForAssemble,
};
pub use body::{
    filter_body_attributes_by_trait_type, find_body_attribute, list_body_attributes,
    BodyAttributesInput,
};
pub use computable::{
    validate_computable_field_map, validate_computable_log_entry, validate_compute_request,
    validate_compute_request_wire, validate_project_request, validate_project_request_wire,
};
pub use error::{from_error_envelope, to_error_envelope};
pub use extensions::{
    merge_extension_maps, merge_module_maps, preserve_extension_maps, preserve_module_maps,
    ExtensionMap, ModuleMap,
};
pub use finding::{is_valid_finding_status_transition, transition_finding_status};
pub use knowledge_entry::{
    assert_unique_active_knowledge_entry, get_knowledge_entry_owner,
    is_valid_knowledge_entry_status_transition, knowledge_entry_visible_to_viewpoint,
    transition_knowledge_entry_status, AssertUniqueActiveKnowledgeEntryInput,
};
pub use mind_state::validate_mind_state;
pub use cognition::{
    cognition_record_matches_filter, project_cognition_records, select_cognition_records,
    validate_cognition_content, validate_cognition_filter, validate_cognition_module,
    validate_cognition_projection, validate_cognition_record, validate_cognition_selection,
    validate_observation_module, CurrentViewPolicy,
};
pub use occ::assert_revision_match;
pub use promote::{apply_promote_acceptance, validate_promote_request, validate_promote_request_wire};
pub use relate::{validate_relate_request, RelateMode, ValidateRelateRequestContext};
pub use scope::{
    assert_supported_cognition_selection, cognition_records_of_authorized_entries,
    cognition_records_of_authorized_entry, filter_knowledge_entries_by_scope,
    filter_timeline_events_by_scope, timeline_event_matches_scope,
};
pub use timeline::{
    filter_timeline_events_by_moment_scale, order_timeline_events_by_ids,
    order_timeline_events_by_precedes, OrderTimelineEventsByPrecedesOptions,
};
pub use tools::helpers::{
    find_tool, list_tools, parse_tool_capability_id, tool_capability_id,
    validate_manifest_tools, validate_tool_arguments, validate_tool_descriptor,
    ToolCapabilityId,
};
pub use tools::orchestrate::orchestrate_invoke_tool;
pub use tools::port::{ToolInvokePort, ToolInvokeRequest, ToolInvokeResponse};
pub use upsert::{
    validate_upsert_knowledge_entry, UpsertMode, ValidateUpsertKnowledgeEntryContext,
};
pub use result::{
    spoke_ok, spoke_ok_unit, spoke_reject, SpokeReject, SpokeRejectCode, SpokeResult,
};
pub use adapter::{
    orchestrate_assemble, orchestrate_check, orchestrate_compute, orchestrate_fork_assemble,
    orchestrate_fork_check, orchestrate_project, orchestrate_promote, orchestrate_relate,
    orchestrate_upsert, BaselineAdapter, BaselinePorts, CheckRunInput, ComputableAdapter,
    ComputablePort, ComputablePorts, FindingPort, ForkAdapter, ForkPorts, ForkTimelineQueryPort,
    FullAdapter, FullPorts, HostManifestPort, KnowledgeEntryPort, KnowledgeQueryPort,
    RelationPort, RuleQueryPort, ScopeQueryPort, ScopedKnowledgePort,
};
pub use memory::{
    content_serialized_bytes, grant_covers, is_freeze_allowlisted, jcs_sha256_hex,
    jcs_sha256_hex_excluding, validate_grant_issuance, validate_memory_candidates_list,
    validate_memory_candidates_review, validate_memory_capture, validate_memory_grants_grant,
    validate_memory_grants_list, validate_memory_imports_stage, validate_memory_recall,
    validate_memory_records_create, validate_memory_records_list, validate_memory_records_update,
    validate_memory_reflections_generate, validate_memory_reflections_list,
    validate_memory_reflections_state, validate_memory_spaces_list,
    validate_memory_subjects_fence, GrantRequirement, IssuedGrant,
};
pub use adapter::orchestrate::orchestrate_extract;
pub use adapter::ports::{ExtractRunInput, ExtractionPort, ExtractionResult};
pub use adapter::{AdoptionPort, AdoptionPorts};
pub use adapter::{HistoryPort, HistoryPorts};
pub use adapter::{MemoryPort, MemoryPorts};
pub use adoption::{
    assert_adoption_anchor_preserved, resolve_retirement_chain, RetirementChainEntry,
    RetirementTerminal, ADOPTION_LEGACY_EXTENSIONS_NAMESPACE, RETIREMENT_CHAIN_MAX_EDGES,
};
pub use history::{revision_snapshots_equal_canonical, HistoryPruneResult};
pub use judgment::{judgments_equal_canonical, validate_judgment, validate_judgment_typed};

/// Re-export wire types for integrator convenience.
pub use spoke_schemas;

/// The manifest-carried `ToolDescriptor`. typify emits the schema twice — the
/// standalone `spoke_schemas::ToolDescriptor` and an inline copy inside
/// `host_capability_manifest` — and `HostCapabilityManifest.tools` uses the
/// latter. The tools helpers operate on this type; import it from here to
/// avoid the duplicate-name trap.
pub use spoke_schemas::host_capability_manifest::ToolDescriptor;