- Domaine: port ManagedTempStore + modèle (handle opaque, kind Directory/File, état Active/Released, allocation/lease, expiry). - Application: use cases Allocate/Resolve/Release/GcManagedTemp, horodatés via Clock. - Infrastructure: impl FS FsManagedTempStore sous app_data_dir/managed-tmp (root global inter-projets, métadonnées par handle, GC des leases expirés/libérés). - Exposition MCP contrôlée (ManagedTempToolProvider, catalogue) + câblage sandbox: les agents résolvent un handle au lieu d'inventer un path libre. - Tests: application/infrastructure managed_temp.
127 lines
4.7 KiB
Rust
127 lines
4.7 KiB
Rust
//! # IdeA — Infrastructure layer
|
|
//!
|
|
//! Concrete **adapters** implementing the domain ports (ARCHITECTURE §5). All
|
|
//! real-world I/O (`tokio::fs`, broadcast channels, system clock, UUIDs) lives
|
|
//! here, never in `domain` or `application`.
|
|
//!
|
|
//! L1 shipped the DI/event-relay adapters: [`LocalFileSystem`],
|
|
//! [`TokioBroadcastEventBus`], [`SystemClock`], [`UuidGenerator`]. L2 adds the
|
|
//! project persistence adapter [`FsProjectStore`]. L3 adds the local PTY adapter
|
|
//! [`PortablePtyAdapter`]. Git/remote/template adapters arrive in later lots.
|
|
|
|
#![forbid(unsafe_code)]
|
|
#![warn(missing_docs)]
|
|
|
|
pub mod assistant;
|
|
pub mod background_task;
|
|
pub mod chat_attachments;
|
|
pub mod chat_drafts;
|
|
pub mod clock;
|
|
pub mod conversation;
|
|
pub mod conversation_log;
|
|
pub mod eventbus;
|
|
pub mod fileguard;
|
|
pub mod fs;
|
|
pub mod git;
|
|
pub mod id;
|
|
pub mod input;
|
|
pub mod inspector;
|
|
pub mod issues;
|
|
pub mod lock;
|
|
pub mod mailbox;
|
|
pub mod managed_temp;
|
|
pub mod model_catalogue;
|
|
pub mod model_server;
|
|
pub mod orchestrator;
|
|
pub mod pair_attempt_limiter;
|
|
pub mod permission;
|
|
pub mod plugin;
|
|
pub mod process;
|
|
pub mod pty;
|
|
pub mod ratelimit;
|
|
pub mod remote;
|
|
pub mod runtime;
|
|
pub mod runtime_permission;
|
|
pub mod sandbox;
|
|
pub mod scheduler;
|
|
pub mod session;
|
|
pub mod sprints;
|
|
pub mod store;
|
|
pub mod timeparse;
|
|
|
|
pub use assistant::{FsAssistantContextStore, TicketAssistantEnvironmentPreparer};
|
|
pub use background_task::{
|
|
bounded_tail, start_background_ready_inbox_bridge, tail_cap_bytes, BackgroundCompletionSink,
|
|
BackgroundCompletionSinkError, BackgroundCompletionSinkOutcome,
|
|
BackgroundReadyInboxBridgeHandle, BackgroundTaskReadyToDeliver, BoundedTail,
|
|
CommandBackgroundRunner,
|
|
};
|
|
pub use chat_attachments::FsChatAttachmentStore;
|
|
pub use chat_drafts::FsChatDraftStore;
|
|
pub use clock::SystemClock;
|
|
pub use conversation::InMemoryConversationRegistry;
|
|
pub use conversation_log::{
|
|
FsConversationLog, FsHandoffStore, FsProviderSessionStore, HeuristicHandoffSummarizer,
|
|
TURN_LINE_MAX_CHARS, WINDOW,
|
|
};
|
|
pub use eventbus::TokioBroadcastEventBus;
|
|
pub use fileguard::RwFileGuard;
|
|
pub use fs::LocalFileSystem;
|
|
pub use git::Git2Repository;
|
|
pub use id::UuidGenerator;
|
|
pub use input::{MediatedInbox, MillisClock, SystemMillisClock};
|
|
pub use inspector::{
|
|
transcript_activity_token, ClaudeTranscriptInspector, ClaudeTranscriptTurnWatcher,
|
|
};
|
|
pub use issues::{FsIssueNumberAllocator, FsIssueStore};
|
|
pub use lock::{acquire_app_data_dir_lock, AppDataDirLock, AppDataDirLockError};
|
|
pub use mailbox::InMemoryMailbox;
|
|
pub use managed_temp::FsManagedTempStore;
|
|
pub use model_catalogue::{
|
|
EmbeddedCompatibilityMatrix, HttpProviderModelCatalogue, ProcessCliVersionReader,
|
|
};
|
|
pub use model_server::{
|
|
FsModelServerRegistry, HfModelArtifactDownloader, HttpOpenAiCompatibleProbe, LlamaCppRuntime,
|
|
LocalManagedProcess,
|
|
};
|
|
pub use orchestrator::mcp::{
|
|
ManagedTempToolError, ManagedTempToolProvider, McpServer, MemoryTransport, StdioTransport,
|
|
TemplateToolError, TemplateToolProvider, TicketToolError, TicketToolProvider,
|
|
ToolPolicyRegistry,
|
|
};
|
|
pub use orchestrator::{
|
|
process_request_file, FsOrchestratorWatcher, OrchestratorResponse, OrchestratorWatchHandle,
|
|
REQUESTS_SUBDIR,
|
|
};
|
|
pub use pair_attempt_limiter::InMemoryPairAttemptLimiter;
|
|
pub use permission::{ClaudePermissionProjector, CodexPermissionProjector};
|
|
pub use plugin::{
|
|
ExternalMcpPluginSupervisor, FsPluginPackageStore, FsPluginRegistryStore, FsPluginStorageStore,
|
|
};
|
|
pub use process::{LocalEnvironmentReader, LocalProcessSpawner};
|
|
pub use pty::PortablePtyAdapter;
|
|
pub use ratelimit::RateLimitParser;
|
|
pub use remote::{remote_host, LocalHost};
|
|
pub use runtime::CliAgentRuntime;
|
|
pub use runtime_permission::ReadOnlyRuntimePermissionProbe;
|
|
#[cfg(target_os = "linux")]
|
|
pub use sandbox::LandlockSandbox;
|
|
pub use sandbox::{default_enforcer, NoopSandbox};
|
|
pub use scheduler::TokioScheduler;
|
|
pub use session::{ClaudeSdkSession, CodexExecSession, FakeCli, StructuredSessionFactory};
|
|
pub use sprints::FsSprintStore;
|
|
#[cfg(feature = "vector-onnx")]
|
|
pub use store::OnnxEmbedder;
|
|
#[cfg(feature = "vector-http")]
|
|
pub use store::{detect_ollama, HttpEmbedder, DEFAULT_LOCAL_EMBED_ENDPOINT};
|
|
pub use store::{
|
|
embedder_from_profile, index_token_size, onnx_model_is_cached, should_use_vector,
|
|
AdaptiveMemoryRecall, BackgroundTaskReconcileReport, EmbedderEnvProbe, FsBackgroundTaskStore,
|
|
FsDeviceSessionStore, FsEmbedderProfileStore, FsEmbedderPromptStore, FsLiveStateStore,
|
|
FsMcpToolPermissionStore, FsMemoryStore, FsPermissionStore, FsProfileStore, FsProjectStore,
|
|
FsSecretStore, FsSkillStore, FsSystemPermissionStore, FsTemplateStore, FsWindowStateStore,
|
|
HashEmbedder, IdeaiContextStore, NaiveMemoryRecall, OnnxModelInfo, StubEmbedder,
|
|
VectorMemoryRecall, DEFAULT_OLLAMA_BASE_URL, ONNX_CACHE_SUBDIR, RECOMMENDED_ONNX_MODELS,
|
|
VECTOR_HTTP_ENABLED, VECTOR_ONNX_ENABLED,
|
|
};
|