Pod-ID (UUID)の削除
This commit is contained in:
parent
7d1b74fb32
commit
3883fab29d
|
|
@ -1 +1,7 @@
|
|||
設計指針を固め、全体の設計を進めるために、全体の俯瞰と細かいディテールを往復している。
|
||||
|
||||
---
|
||||
|
||||
`TODO.md`、`tickets/`はgitで管理されていて、時系列の管理はgitを参照して把握すること。
|
||||
ticketは完了したら削除され、`TODO.md`はチェックを付けて積まれていく。
|
||||
TODO.mdのリンクは完了後に切れるが、そのリンクを元にgitで消されたファイルを読み、内容を把握できる。
|
||||
|
|
|
|||
|
|
@ -1 +1,7 @@
|
|||
設計指針を固め、全体の設計を進めるために、全体の俯瞰と細かいディテールを往復している。
|
||||
|
||||
---
|
||||
|
||||
`TODO.md`、`tickets/`はgitで管理されていて、時系列の管理はgitを参照して把握すること。
|
||||
ticketは完了したら削除され、`TODO.md`はチェックを付けて積まれていく。
|
||||
TODO.mdのリンクは完了後に切れるが、そのリンクを元にgitで消されたファイルを読み、内容を把握できる。
|
||||
|
|
|
|||
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -1173,7 +1173,6 @@ dependencies = [
|
|||
"thiserror",
|
||||
"tokio",
|
||||
"toml",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user