web-cortex-framework 2.0.0__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/Cargo.lock +3 -2
  2. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/Cargo.toml +2 -1
  3. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/PKG-INFO +2 -2
  4. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/README.md +1 -1
  5. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/Cargo.toml +1 -0
  6. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/router.rs +44 -1
  7. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/pyproject.toml +1 -1
  8. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/python/webcortex/__init__.py +1 -1
  9. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/LICENSE +0 -0
  10. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/agent/provider.rs +0 -0
  11. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/agent/registry.rs +0 -0
  12. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/agent/session.rs +0 -0
  13. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/agent.rs +0 -0
  14. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/app.rs +0 -0
  15. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/audit.rs +0 -0
  16. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/auth.rs +0 -0
  17. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/bridge.rs +0 -0
  18. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/context.rs +0 -0
  19. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/db.rs +0 -0
  20. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/files.rs +0 -0
  21. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/flow.rs +0 -0
  22. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/http.rs +0 -0
  23. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/ledger.rs +0 -0
  24. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/lib.rs +0 -0
  25. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/manifest.rs +0 -0
  26. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/mcp.rs +0 -0
  27. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/middleware.rs +0 -0
  28. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/openapi.rs +0 -0
  29. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/server.rs +0 -0
  30. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/templates.rs +0 -0
  31. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-core/src/typegen.rs +0 -0
  32. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-py/Cargo.toml +0 -0
  33. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-py/src/behaviour.rs +0 -0
  34. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/crates/webcortex-py/src/lib.rs +0 -0
  35. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/python/webcortex/_bridge.py +0 -0
  36. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/python/webcortex/app.py +0 -0
  37. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/python/webcortex/cli.py +0 -0
  38. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/python/webcortex/contextpack.py +0 -0
  39. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/python/webcortex/schema.py +0 -0
  40. {web_cortex_framework-2.0.0 → web_cortex_framework-2.0.1}/python/webcortex/starters.py +0 -0
@@ -2616,7 +2616,7 @@ dependencies = [
2616
2616
 
2617
2617
  [[package]]
2618
2618
  name = "webcortex-core"
2619
- version = "2.0.0"
2619
+ version = "2.0.1"
2620
2620
  dependencies = [
2621
2621
  "base64 0.23.1",
2622
2622
  "bytes",
@@ -2628,6 +2628,7 @@ dependencies = [
2628
2628
  "matchit",
2629
2629
  "mime_guess",
2630
2630
  "minijinja",
2631
+ "percent-encoding",
2631
2632
  "reqwest",
2632
2633
  "serde",
2633
2634
  "serde_json",
@@ -2642,7 +2643,7 @@ dependencies = [
2642
2643
 
2643
2644
  [[package]]
2644
2645
  name = "webcortex-py"
2645
- version = "2.0.0"
2646
+ version = "2.0.1"
2646
2647
  dependencies = [
2647
2648
  "bytes",
2648
2649
  "futures",
@@ -3,7 +3,7 @@ members = ["crates/webcortex-core", "crates/webcortex-py"]
3
3
  resolver = "3"
4
4
 
5
5
  [workspace.package]
6
- version = "2.0.0"
6
+ version = "2.0.1"
7
7
  edition = "2024"
8
8
  license = "Apache-2.0"
9
9
  rust-version = "1.85"
@@ -20,6 +20,7 @@ hyper-util = { version = "0.1", features = ["full"] }
20
20
  http-body-util = "0.1"
21
21
  bytes = "1"
22
22
  matchit = "0.9"
23
+ percent-encoding = "2"
23
24
  serde = { version = "1", features = ["derive"] }
24
25
  serde_json = "1"
25
26
  tracing = "0.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: web-cortex-framework
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: Apache Software License
@@ -427,7 +427,7 @@ tested, the known limits, and what v2 added to the surface.
427
427
 
428
428
  ## Status
429
429
 
430
- v2.0.0. Working and tested: the manifest IR, router, native ops (static /
430
+ v2.0.1. Working and tested: the manifest IR, router, native ops (static /
431
431
  query / proxy / page / files / flow), the free-threaded Python bridge,
432
432
  authentication and scopes, rate limiting, CORS, security headers, graceful
433
433
  shutdown, Behaviours with concurrent leaves, the agent runtime with handoffs,
@@ -399,7 +399,7 @@ tested, the known limits, and what v2 added to the surface.
399
399
 
400
400
  ## Status
401
401
 
402
- v2.0.0. Working and tested: the manifest IR, router, native ops (static /
402
+ v2.0.1. Working and tested: the manifest IR, router, native ops (static /
403
403
  query / proxy / page / files / flow), the free-threaded Python bridge,
404
404
  authentication and scopes, rate limiting, CORS, security headers, graceful
405
405
  shutdown, Behaviours with concurrent leaves, the agent runtime with handoffs,
@@ -18,6 +18,7 @@ hyper-util.workspace = true
18
18
  http-body-util.workspace = true
19
19
  bytes.workspace = true
20
20
  matchit.workspace = true
21
+ percent-encoding.workspace = true
21
22
  serde.workspace = true
22
23
  serde_json.workspace = true
23
24
  tracing.workspace = true
@@ -48,7 +48,7 @@ impl Router {
48
48
  let path_params = m
49
49
  .params
50
50
  .iter()
51
- .map(|(k, v)| (k.to_string(), v.to_string()))
51
+ .map(|(k, v)| (k.to_string(), decode_param(v)))
52
52
  .collect();
53
53
  return Ok(Matched { route_id: *m.value, path_params });
54
54
  }
@@ -70,3 +70,46 @@ impl Router {
70
70
  out
71
71
  }
72
72
  }
73
+
74
+ /// Percent-decode one captured path parameter.
75
+ ///
76
+ /// Matching runs on the raw request path, so `%2F` can never become a segment
77
+ /// separator and change which route is chosen; only the *captured value* is
78
+ /// decoded, once, after the match. `/books/by-author/Frank%20Herbert` therefore
79
+ /// binds `author = "Frank Herbert"` and `/books/%31/blurb` binds `id = "1"`,
80
+ /// which is what the query, the Python handler and the tool schema all expect.
81
+ /// A parameter that is not valid UTF-8 once decoded is kept as sent, so a
82
+ /// handler sees the original bytes rather than a lossy rewrite.
83
+ fn decode_param(raw: &str) -> String {
84
+ if !raw.contains('%') {
85
+ return raw.to_string();
86
+ }
87
+ match percent_encoding::percent_decode_str(raw).decode_utf8() {
88
+ Ok(decoded) => decoded.into_owned(),
89
+ Err(_) => raw.to_string(),
90
+ }
91
+ }
92
+
93
+ #[cfg(test)]
94
+ mod tests {
95
+ use super::decode_param;
96
+
97
+ #[test]
98
+ fn decodes_percent_sequences_in_a_captured_parameter() {
99
+ assert_eq!(decode_param("Frank%20Herbert"), "Frank Herbert");
100
+ assert_eq!(decode_param("%31"), "1");
101
+ assert_eq!(decode_param("caf%C3%A9"), "café");
102
+ }
103
+
104
+ #[test]
105
+ fn leaves_plain_and_plus_alone() {
106
+ // `+` is a space only in form bodies, never in a path segment.
107
+ assert_eq!(decode_param("Frank+Herbert"), "Frank+Herbert");
108
+ assert_eq!(decode_param("plain"), "plain");
109
+ }
110
+
111
+ #[test]
112
+ fn keeps_invalid_utf8_as_sent() {
113
+ assert_eq!(decode_param("%FF%FE"), "%FF%FE");
114
+ }
115
+ }
@@ -7,7 +7,7 @@ build-backend = "maturin"
7
7
  # The split is for ergonomics, the same way djangorestframework imports as
8
8
  # `rest_framework`.
9
9
  name = "web-cortex-framework"
10
- version = "2.0.0"
10
+ version = "2.0.1"
11
11
  description = "A Rust-cored Python web framework where every route is also an agent tool."
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.12"
@@ -17,7 +17,7 @@ server exposing six tools — from nine lines.
17
17
  from ._bridge import HTTPError, Request, Response, free_threaded
18
18
  from .app import WebCortex, Resource
19
19
 
20
- __version__ = "2.0.0"
20
+ __version__ = "2.0.1"
21
21
 
22
22
  __all__ = [
23
23
  "WebCortex",