feat: stage exact Plugin Tools through shared Worker composition

Extract the unchanged canonical plan model for typed Runtime snapshots without a Server dependency cycle. Bind Tool consumer identities to persisted Session/call IDs, use the owner-issued context and current publication authorization, and register through FeatureInstallPlan with cooperative shutdown.

Validation so far: root cargo check --locked, portable model 6 tests/doctest, Worker actual Component adapter 7 focused tests, Server plan 9 tests via shared isolation. Full product launch owner/pin lifecycle and Remote/Embedded vertical integration remain a subsequent coherent change.
This commit is contained in:
2026-10-30 04:42:53 +09:00
parent 3a13301f75
commit 165153c63c
42 changed files with 2123 additions and 424 deletions
+1
View File
@@ -12,6 +12,7 @@ typescript = ["dep:ts-rs", "protocol/typescript"]
[dependencies]
api-macros = { workspace = true, features = ["reqwest", "axum", "openapi"] }
memory.workspace = true
plugin-plan.workspace = true
merge-request.workspace = true
protocol = { workspace = true, features = ["json-schema"] }
runtime-api.workspace = true
+38
View File
@@ -122,6 +122,44 @@ pub struct PluginArtifact {
pub revocation_reason: Option<String>,
}
impl plugin_plan::ArtifactDescriptor for PluginArtifact {
fn artifact_identity(&self) -> plugin_plan::ArtifactIdentityProjection {
plugin_plan::ArtifactIdentityProjection {
package_id: self.package_id.clone(),
version: self.version.clone(),
package_digest: self.package_digest.clone(),
artifact_digest: self.artifact_digest.clone(),
artifact_size: self.artifact_size,
schema_version: self.schema_version,
world: self.world.clone(),
required_imports: self.required_imports.clone(),
tools: self.tools.iter().map(|tool| tool.name.clone()).collect(),
connections: self
.connections
.iter()
.map(|slot| slot.name.clone())
.collect(),
requested_grants: self
.requested_grants
.iter()
.map(|grant| match grant {
PluginGrantMetadata::Logging => plugin_plan::PluginGrant::Logging,
PluginGrantMetadata::Https { slot } => {
plugin_plan::PluginGrant::Https { slot: slot.clone() }
}
})
.collect(),
config_schema: plugin_plan::PluginSchemaIdentity {
identity: self.config_schema.identity.clone(),
version: self.config_schema.version.clone(),
digest: self.config_schema.digest.clone(),
namespace: self.config_schema.namespace.clone(),
},
revoked: self.revoked,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
#[serde(deny_unknown_fields)]