Skip to content

Commit 5541640

Browse files
committed
feat: remove HCL support, ACL-only for a3s-code-core
BREAKING CHANGE: a3s-code now only supports ACL format for config - Remove hcl-rs dependency - Remove from_hcl() function and all HCL parsing helpers - Remove hcl_body_to_json, snake_to_camel, hcl_expr_to_json, eval_func_call - Update agent_api.rs to use ACL format - Bump version to 1.10.0 for all code SDKs
1 parent dd2f27d commit 5541640

7 files changed

Lines changed: 33 additions & 799 deletions

File tree

core/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "a3s-code-core"
3-
version = "1.9.4"
3+
version = "1.10.0"
44
edition = "2021"
55
authors = ["A3S Lab Team"]
66
license = "MIT"
@@ -33,9 +33,6 @@ serde_json = "1.0"
3333
serde_yaml = "0.9"
3434
toml = "0.8"
3535

36-
# HCL config parsing
37-
hcl-rs = "0.18"
38-
3936
# ACL config parsing
4037
a3s-acl = { git = "https://github.com/A3S-Lab/ACL.git", tag = "v0.2.0", version = "0.2.0" }
4138

core/src/agent_api.rs

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ impl Agent {
683683
// ACL string (starts with ACL labeled block like providers "openai" { })
684684
CodeConfig::from_acl(&source).context("Failed to parse config as ACL string")?
685685
} else {
686-
// Try to parse as HCL string
687-
CodeConfig::from_hcl(&source).context("Failed to parse config as HCL string")?
686+
// Try to parse as ACL string (legacy format without quotes)
687+
CodeConfig::from_acl(&source).context("Failed to parse config as ACL string")?
688688
};
689689

690690
Self::from_config(config).await
@@ -3326,54 +3326,48 @@ dir content
33263326
}
33273327

33283328
#[tokio::test]
3329-
async fn test_new_with_hcl_string() {
3330-
let hcl = r#"
3331-
default_model = "anthropic/claude-sonnet-4-20250514"
3332-
providers {
3333-
name = "anthropic"
3334-
api_key = "test-key"
3335-
models {
3336-
id = "claude-sonnet-4-20250514"
3329+
async fn test_new_with_acl_string() {
3330+
let acl = r#"
3331+
default_model "anthropic/claude-sonnet-4-20250514"
3332+
providers "anthropic" {
3333+
apiKey = "test-key"
3334+
models "claude-sonnet-4-20250514" {
33373335
name = "Claude Sonnet 4"
33383336
}
33393337
}
33403338
"#;
3341-
let agent = Agent::new(hcl).await;
3339+
let agent = Agent::new(acl).await;
33423340
assert!(agent.is_ok());
33433341
}
33443342

33453343
#[tokio::test]
3346-
async fn test_create_alias_hcl() {
3347-
let hcl = r#"
3348-
default_model = "anthropic/claude-sonnet-4-20250514"
3349-
providers {
3350-
name = "anthropic"
3351-
api_key = "test-key"
3352-
models {
3353-
id = "claude-sonnet-4-20250514"
3344+
async fn test_create_alias_acl() {
3345+
let acl = r#"
3346+
default_model "anthropic/claude-sonnet-4-20250514"
3347+
providers "anthropic" {
3348+
apiKey = "test-key"
3349+
models "claude-sonnet-4-20250514" {
33543350
name = "Claude Sonnet 4"
33553351
}
33563352
}
33573353
"#;
3358-
let agent = Agent::create(hcl).await;
3354+
let agent = Agent::create(acl).await;
33593355
assert!(agent.is_ok());
33603356
}
33613357

33623358
#[tokio::test]
33633359
async fn test_create_and_new_produce_same_result() {
3364-
let hcl = r#"
3365-
default_model = "anthropic/claude-sonnet-4-20250514"
3366-
providers {
3367-
name = "anthropic"
3368-
api_key = "test-key"
3369-
models {
3370-
id = "claude-sonnet-4-20250514"
3360+
let acl = r#"
3361+
default_model "anthropic/claude-sonnet-4-20250514"
3362+
providers "anthropic" {
3363+
apiKey = "test-key"
3364+
models "claude-sonnet-4-20250514" {
33713365
name = "Claude Sonnet 4"
33723366
}
33733367
}
33743368
"#;
3375-
let agent_new = Agent::new(hcl).await;
3376-
let agent_create = Agent::create(hcl).await;
3369+
let agent_new = Agent::new(acl).await;
3370+
let agent_create = Agent::create(acl).await;
33773371
assert!(agent_new.is_ok());
33783372
assert!(agent_create.is_ok());
33793373

0 commit comments

Comments
 (0)