diff --git a/crates/api/src/dto/pack.rs b/crates/api/src/dto/pack.rs
index 5a4f993..f705819 100644
--- a/crates/api/src/dto/pack.rs
+++ b/crates/api/src/dto/pack.rs
@@ -48,10 +48,15 @@ pub struct CreatePackRequest {
#[schema(example = json!(["messaging", "collaboration"]))]
pub tags: Vec,
- /// Runtime dependencies (refs of required packs)
+ /// Runtime dependencies (e.g., shell, python, nodejs)
+ #[serde(default)]
+ #[schema(example = json!(["shell", "python"]))]
+ pub runtime_deps: Vec,
+
+ /// Pack dependencies (refs of required packs)
#[serde(default)]
#[schema(example = json!(["core"]))]
- pub runtime_deps: Vec,
+ pub dependencies: Vec,
/// Whether this is a standard/built-in pack
#[serde(default)]
@@ -152,10 +157,14 @@ pub struct UpdatePackRequest {
#[schema(example = json!(["messaging", "collaboration", "webhooks"]))]
pub tags: Option>,
- /// Runtime dependencies
- #[schema(example = json!(["core", "http"]))]
+ /// Runtime dependencies (e.g., shell, python, nodejs)
+ #[schema(example = json!(["shell", "python"]))]
pub runtime_deps: Option>,
+ /// Pack dependencies (refs of required packs)
+ #[schema(example = json!(["core", "http"]))]
+ pub dependencies: Option>,
+
/// Whether this is a standard pack
#[schema(example = false)]
pub is_standard: Option,
@@ -200,10 +209,14 @@ pub struct PackResponse {
#[schema(example = json!(["messaging", "collaboration"]))]
pub tags: Vec,
- /// Runtime dependencies
- #[schema(example = json!(["core"]))]
+ /// Runtime dependencies (e.g., shell, python, nodejs)
+ #[schema(example = json!(["shell", "python"]))]
pub runtime_deps: Vec,
+ /// Pack dependencies (refs of required packs)
+ #[schema(example = json!(["core"]))]
+ pub dependencies: Vec,
+
/// Is standard pack
#[schema(example = false)]
pub is_standard: bool,
@@ -271,6 +284,7 @@ impl From for PackResponse {
meta: pack.meta,
tags: pack.tags,
runtime_deps: pack.runtime_deps,
+ dependencies: pack.dependencies,
is_standard: pack.is_standard,
created: pack.created,
updated: pack.updated,
@@ -803,6 +817,7 @@ mod tests {
assert_eq!(req.version, "1.0.0");
assert!(req.tags.is_empty());
assert!(req.runtime_deps.is_empty());
+ assert!(req.dependencies.is_empty());
assert!(!req.is_standard);
}
@@ -818,6 +833,7 @@ mod tests {
meta: default_empty_object(),
tags: vec![],
runtime_deps: vec![],
+ dependencies: vec![],
is_standard: false,
};
diff --git a/crates/api/src/routes/packs.rs b/crates/api/src/routes/packs.rs
index ae65b8f..262c87d 100644
--- a/crates/api/src/routes/packs.rs
+++ b/crates/api/src/routes/packs.rs
@@ -139,6 +139,7 @@ pub async fn create_pack(
meta: request.meta,
tags: request.tags,
runtime_deps: request.runtime_deps,
+ dependencies: request.dependencies,
is_standard: request.is_standard,
installers: serde_json::json!({}),
};
@@ -222,6 +223,7 @@ pub async fn update_pack(
meta: request.meta,
tags: request.tags,
runtime_deps: request.runtime_deps,
+ dependencies: request.dependencies,
is_standard: request.is_standard,
installers: None,
};
@@ -522,6 +524,15 @@ async fn register_pack_internal(
})
.unwrap_or_default(),
runtime_deps: pack_yaml
+ .get("runtime_deps")
+ .and_then(|v| v.as_sequence())
+ .map(|seq| {
+ seq.iter()
+ .filter_map(|v| v.as_str().map(|s| s.to_string()))
+ .collect()
+ })
+ .unwrap_or_default(),
+ dependencies: pack_yaml
.get("dependencies")
.and_then(|v| v.as_sequence())
.map(|seq| {
diff --git a/crates/api/tests/helpers.rs b/crates/api/tests/helpers.rs
index 5a602dd..aa5298b 100644
--- a/crates/api/tests/helpers.rs
+++ b/crates/api/tests/helpers.rs
@@ -433,6 +433,7 @@ pub async fn create_test_pack(pool: &PgPool, ref_name: &str) -> Result {
}),
tags: vec!["test".to_string()],
runtime_deps: vec![],
+ dependencies: vec![],
is_standard: false,
installers: json!({}),
};
diff --git a/crates/api/tests/sse_execution_stream_tests.rs b/crates/api/tests/sse_execution_stream_tests.rs
index f57da86..b6b3770 100644
--- a/crates/api/tests/sse_execution_stream_tests.rs
+++ b/crates/api/tests/sse_execution_stream_tests.rs
@@ -41,6 +41,7 @@ async fn setup_test_pack_and_action(pool: &PgPool) -> Result<(Pack, Action)> {
meta: json!({"author": "test"}),
tags: vec!["test".to_string()],
runtime_deps: vec![],
+ dependencies: vec![],
is_standard: false,
installers: json!({}),
};
diff --git a/crates/api/tests/webhook_api_tests.rs b/crates/api/tests/webhook_api_tests.rs
index 60b2198..e129a44 100644
--- a/crates/api/tests/webhook_api_tests.rs
+++ b/crates/api/tests/webhook_api_tests.rs
@@ -39,6 +39,7 @@ async fn create_test_pack(state: &AppState, name: &str) -> i64 {
meta: serde_json::json!({}),
tags: vec![],
runtime_deps: vec![],
+ dependencies: vec![],
is_standard: false,
installers: json!({}),
};
diff --git a/crates/api/tests/webhook_security_tests.rs b/crates/api/tests/webhook_security_tests.rs
index bdf77ba..649713f 100644
--- a/crates/api/tests/webhook_security_tests.rs
+++ b/crates/api/tests/webhook_security_tests.rs
@@ -47,6 +47,7 @@ async fn create_test_pack(state: &AppState, name: &str) -> i64 {
meta: serde_json::json!({}),
tags: vec![],
runtime_deps: vec![],
+ dependencies: vec![],
is_standard: false,
installers: json!({}),
};
diff --git a/crates/cli/src/commands/pack_index.rs b/crates/cli/src/commands/pack_index.rs
index 042a185..3a6a717 100644
--- a/crates/cli/src/commands/pack_index.rs
+++ b/crates/cli/src/commands/pack_index.rs
@@ -146,7 +146,7 @@ pub async fn handle_index_update(
.unwrap_or_default();
let runtime_deps: Vec = pack_yaml
- .get("dependencies")
+ .get("runtime_deps")
.and_then(|v| v.as_sequence())
.map(|seq| {
seq.iter()
diff --git a/crates/common/src/models.rs b/crates/common/src/models.rs
index cfa39aa..7d3bc7f 100644
--- a/crates/common/src/models.rs
+++ b/crates/common/src/models.rs
@@ -393,6 +393,7 @@ pub mod pack {
pub meta: JsonDict,
pub tags: Vec,
pub runtime_deps: Vec,
+ pub dependencies: Vec,
pub is_standard: bool,
pub installers: JsonDict,
// Installation metadata (nullable for non-installed packs)
diff --git a/crates/common/src/repositories/pack.rs b/crates/common/src/repositories/pack.rs
index ea76b1f..fd48726 100644
--- a/crates/common/src/repositories/pack.rs
+++ b/crates/common/src/repositories/pack.rs
@@ -31,6 +31,7 @@ pub struct CreatePackInput {
pub meta: JsonDict,
pub tags: Vec,
pub runtime_deps: Vec,
+ pub dependencies: Vec,
pub is_standard: bool,
pub installers: JsonDict,
}
@@ -46,30 +47,24 @@ pub struct UpdatePackInput {
pub meta: Option,
pub tags: Option>,
pub runtime_deps: Option>,
+ pub dependencies: Option>,
pub is_standard: Option,
pub installers: Option,
}
+const PACK_COLUMNS: &str = "id, ref, label, description, version, conf_schema, config, meta, tags, runtime_deps, dependencies, is_standard, installers, source_type, source_url, source_ref, checksum, checksum_verified, installed_at, installed_by, installation_method, storage_path, created, updated";
+
#[async_trait::async_trait]
impl FindById for PackRepository {
async fn find_by_id<'e, E>(executor: E, id: i64) -> Result
- {/* Runtime Dependencies */}
+ {/* Pack Dependencies */}