Pod-ID (UUID)の削除
This commit is contained in:
@@ -16,7 +16,6 @@ serde_json = "1.0.149"
|
||||
thiserror = "2.0"
|
||||
tokio = { version = "1.49", features = ["fs", "io-util", "macros", "net", "rt-multi-thread", "signal", "sync"] }
|
||||
toml = "1.1.2"
|
||||
uuid = { version = "1.23.0", features = ["v7", "serde"] }
|
||||
|
||||
[dev-dependencies]
|
||||
async-trait = "0.1.89"
|
||||
|
||||
@@ -7,7 +7,7 @@ mod pod;
|
||||
|
||||
pub use controller::{PodController, PodHandle};
|
||||
pub use manifest::{PodManifest, ProviderConfig, ProviderKind, Scope};
|
||||
pub use pod::{Pod, PodError, PodId, PodRunResult, apply_worker_manifest, new_pod_id};
|
||||
pub use pod::{Pod, PodError, PodRunResult, apply_worker_manifest};
|
||||
pub use protocol::{ErrorCode, Event, Method, TurnResult};
|
||||
pub use provider::{ProviderError, build_client};
|
||||
pub use runtime_dir::RuntimeDir;
|
||||
|
||||
@@ -7,20 +7,11 @@ use llm_worker_persistence::{
|
||||
|
||||
use manifest::{PodManifest, Scope, WorkerManifest};
|
||||
|
||||
/// Pod identifier. UUID v7 (time-ordered).
|
||||
pub type PodId = uuid::Uuid;
|
||||
|
||||
/// Generate a new Pod ID.
|
||||
pub fn new_pod_id() -> PodId {
|
||||
uuid::Uuid::now_v7()
|
||||
}
|
||||
|
||||
/// An independent agent execution unit.
|
||||
///
|
||||
/// Wraps a persistent [`Session`] with manifest metadata and an optional
|
||||
/// directory scope. This is the primary abstraction in insomnia.
|
||||
pub struct Pod<C: LlmClient, St: Store> {
|
||||
id: PodId,
|
||||
manifest: PodManifest,
|
||||
session: Session<C, St>,
|
||||
scope: Option<Scope>,
|
||||
@@ -40,7 +31,6 @@ impl<C: LlmClient, St: Store> Pod<C, St> {
|
||||
) -> Result<Self, PodError> {
|
||||
let session = Session::new(worker, store, SessionConfig::default()).await?;
|
||||
Ok(Self {
|
||||
id: new_pod_id(),
|
||||
manifest,
|
||||
session,
|
||||
scope,
|
||||
@@ -49,7 +39,6 @@ impl<C: LlmClient, St: Store> Pod<C, St> {
|
||||
|
||||
/// Restore a Pod from a persisted session.
|
||||
pub async fn restore(
|
||||
id: PodId,
|
||||
session_id: SessionId,
|
||||
manifest: PodManifest,
|
||||
client: C,
|
||||
@@ -58,18 +47,12 @@ impl<C: LlmClient, St: Store> Pod<C, St> {
|
||||
) -> Result<Self, PodError> {
|
||||
let session = Session::restore(client, store, session_id, SessionConfig::default()).await?;
|
||||
Ok(Self {
|
||||
id,
|
||||
manifest,
|
||||
session,
|
||||
scope,
|
||||
})
|
||||
}
|
||||
|
||||
/// The Pod's unique identifier.
|
||||
pub fn id(&self) -> PodId {
|
||||
self.id
|
||||
}
|
||||
|
||||
/// The session ID used for persistence.
|
||||
pub fn session_id(&self) -> SessionId {
|
||||
self.session.session_id()
|
||||
@@ -121,7 +104,6 @@ impl<St: Store> Pod<Box<dyn LlmClient>, St> {
|
||||
apply_worker_manifest(&mut worker, &manifest.worker);
|
||||
let session = Session::new(worker, store, SessionConfig::default()).await?;
|
||||
Ok(Self {
|
||||
id: new_pod_id(),
|
||||
manifest,
|
||||
session,
|
||||
scope,
|
||||
|
||||
Reference in New Issue
Block a user