anip-runtime-utils 0.24.10__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.
- anip_runtime_utils-0.24.10/PKG-INFO +15 -0
- anip_runtime_utils-0.24.10/README.md +30 -0
- anip_runtime_utils-0.24.10/pyproject.toml +26 -0
- anip_runtime_utils-0.24.10/setup.cfg +4 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils/__init__.py +140 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils/agent_consumption.py +2213 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils/normalization.py +110 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils/preflight.py +52 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils.egg-info/PKG-INFO +15 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils.egg-info/SOURCES.txt +14 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils.egg-info/dependency_links.txt +1 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils.egg-info/requires.txt +3 -0
- anip_runtime_utils-0.24.10/src/anip_runtime_utils.egg-info/top_level.txt +1 -0
- anip_runtime_utils-0.24.10/tests/test_agent_consumption.py +1698 -0
- anip_runtime_utils-0.24.10/tests/test_normalization.py +43 -0
- anip_runtime_utils-0.24.10/tests/test_preflight.py +20 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: anip-runtime-utils
|
|
3
|
+
Version: 0.24.10
|
|
4
|
+
Summary: Small shared runtime utilities for ANIP-based agent runtimes
|
|
5
|
+
Author-email: ANIP Protocol <team@anip.dev>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Keywords: anip,runtime,agent
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# anip-runtime-utils
|
|
2
|
+
|
|
3
|
+
Small shared runtime helpers for agent-side deterministic normalization and
|
|
4
|
+
preflight handling.
|
|
5
|
+
|
|
6
|
+
These helpers assist consuming agents with routing, compact prompt construction,
|
|
7
|
+
and contract-derived preflight checks. They are not the trust boundary. The
|
|
8
|
+
authoritative policy decision remains the ANIP service invocation result.
|
|
9
|
+
|
|
10
|
+
Current scope:
|
|
11
|
+
|
|
12
|
+
- metadata-driven enum/default normalization
|
|
13
|
+
- compact agent capability catalog construction from discovery + manifest payloads
|
|
14
|
+
- generic phrase matching
|
|
15
|
+
- generic denied-preflight payload construction
|
|
16
|
+
|
|
17
|
+
Non-goals:
|
|
18
|
+
|
|
19
|
+
- domain vocabulary parsing
|
|
20
|
+
- service-local aliases
|
|
21
|
+
- business-policy decisions that belong in ANIP services
|
|
22
|
+
|
|
23
|
+
This package is intentionally small. It exists to promote clearly reusable
|
|
24
|
+
runtime patterns without pulling GTM-specific logic into a shared layer.
|
|
25
|
+
|
|
26
|
+
`build_agent_capability_catalog(...)` keeps rich ANIP manifests available to the
|
|
27
|
+
runtime while producing a compact routing brief for model prompts. Agent
|
|
28
|
+
runtimes should not blindly send full manifests or package metadata to the LLM
|
|
29
|
+
on every turn; they should send a purpose-built brief and keep the full metadata
|
|
30
|
+
for deterministic normalization, token issuance, invocation, and audit.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "anip-runtime-utils"
|
|
3
|
+
version = "0.24.10"
|
|
4
|
+
description = "Small shared runtime utilities for ANIP-based agent runtimes"
|
|
5
|
+
requires-python = ">=3.11"
|
|
6
|
+
dependencies = []
|
|
7
|
+
authors = [{ name = "ANIP Protocol", email = "team@anip.dev" }]
|
|
8
|
+
license = { text = "Apache-2.0" }
|
|
9
|
+
keywords = ["anip", "runtime", "agent"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 3 - Alpha",
|
|
12
|
+
"License :: OSI Approved :: Apache Software License",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3.11",
|
|
15
|
+
"Programming Language :: Python :: 3.12",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[project.optional-dependencies]
|
|
19
|
+
dev = ["pytest>=8.0"]
|
|
20
|
+
|
|
21
|
+
[build-system]
|
|
22
|
+
requires = ["setuptools>=68.0"]
|
|
23
|
+
build-backend = "setuptools.build_meta"
|
|
24
|
+
|
|
25
|
+
[tool.setuptools.packages.find]
|
|
26
|
+
where = ["src"]
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""Shared runtime utilities for ANIP-based agent runtimes."""
|
|
2
|
+
|
|
3
|
+
from .agent_consumption import (
|
|
4
|
+
build_agent_capability_catalog,
|
|
5
|
+
build_clarification_continuation,
|
|
6
|
+
build_clarification_continuation_prompt,
|
|
7
|
+
build_compact_agent_capability_brief,
|
|
8
|
+
canonical_from_candidates,
|
|
9
|
+
candidate_map_for_input,
|
|
10
|
+
clarification_continuation_from_history,
|
|
11
|
+
app_boundaries_for,
|
|
12
|
+
capability_does_not_produce,
|
|
13
|
+
capability_match_score,
|
|
14
|
+
capability_produces,
|
|
15
|
+
compact_capability_match_score,
|
|
16
|
+
conditional_approval_boundary,
|
|
17
|
+
conditional_approval_missing_inputs,
|
|
18
|
+
conditional_approval_produces,
|
|
19
|
+
content_tokens,
|
|
20
|
+
conversation_contains_value,
|
|
21
|
+
conversation_supports_canonical_value,
|
|
22
|
+
conversation_text_from_history,
|
|
23
|
+
compact_agent_json,
|
|
24
|
+
effective_business_effects,
|
|
25
|
+
has_approval_intent,
|
|
26
|
+
input_meanings_for,
|
|
27
|
+
input_semantics_for,
|
|
28
|
+
infer_declared_input_value,
|
|
29
|
+
has_conditional_approval_boundary,
|
|
30
|
+
is_approval_capability,
|
|
31
|
+
is_conditional_approval_boundary_active,
|
|
32
|
+
is_deictic_reference,
|
|
33
|
+
is_ungrounded_declared_context,
|
|
34
|
+
looks_like_quarter_input,
|
|
35
|
+
metadata_with_manifest_controls,
|
|
36
|
+
normalize_clarification_continuation_plan,
|
|
37
|
+
normalize_declared_input_value,
|
|
38
|
+
normalize_declared_parameters,
|
|
39
|
+
normalize_invocation_plan,
|
|
40
|
+
normalize_reference_value,
|
|
41
|
+
quarter_label_from_text,
|
|
42
|
+
reference_catalog_for,
|
|
43
|
+
render_agent_business_effects,
|
|
44
|
+
render_agent_detail_metadata,
|
|
45
|
+
render_agent_input_spec,
|
|
46
|
+
render_agent_routing_metadata,
|
|
47
|
+
render_compact_agent_capability_line,
|
|
48
|
+
render_compact_agent_input_summary,
|
|
49
|
+
requested_primary_content_effect,
|
|
50
|
+
requested_unsupported_effects,
|
|
51
|
+
required_context_for,
|
|
52
|
+
requires_declared_grounding,
|
|
53
|
+
semantic_text_key,
|
|
54
|
+
select_approval_boundary_capability,
|
|
55
|
+
select_consumable_capability,
|
|
56
|
+
select_declared_effect_capability,
|
|
57
|
+
select_profile_hint_capability,
|
|
58
|
+
selected_agent_capability_detail,
|
|
59
|
+
should_clear_planner_unsupported_for_approval_boundary,
|
|
60
|
+
should_clear_planner_unsupported_for_declared_effect,
|
|
61
|
+
text_tokens,
|
|
62
|
+
token_score,
|
|
63
|
+
user_authored_conversation_text,
|
|
64
|
+
)
|
|
65
|
+
from .normalization import (
|
|
66
|
+
apply_input_metadata_defaults_and_enums,
|
|
67
|
+
infer_allowed_value_from_history,
|
|
68
|
+
normalize_by_allowed_values,
|
|
69
|
+
semantic_key,
|
|
70
|
+
)
|
|
71
|
+
from .preflight import build_denied_preflight_result, contains_any_phrase
|
|
72
|
+
|
|
73
|
+
__all__ = [
|
|
74
|
+
"apply_input_metadata_defaults_and_enums",
|
|
75
|
+
"app_boundaries_for",
|
|
76
|
+
"build_agent_capability_catalog",
|
|
77
|
+
"build_clarification_continuation",
|
|
78
|
+
"build_clarification_continuation_prompt",
|
|
79
|
+
"build_compact_agent_capability_brief",
|
|
80
|
+
"build_denied_preflight_result",
|
|
81
|
+
"canonical_from_candidates",
|
|
82
|
+
"candidate_map_for_input",
|
|
83
|
+
"capability_does_not_produce",
|
|
84
|
+
"capability_match_score",
|
|
85
|
+
"capability_produces",
|
|
86
|
+
"compact_capability_match_score",
|
|
87
|
+
"clarification_continuation_from_history",
|
|
88
|
+
"conditional_approval_boundary",
|
|
89
|
+
"conditional_approval_missing_inputs",
|
|
90
|
+
"conditional_approval_produces",
|
|
91
|
+
"contains_any_phrase",
|
|
92
|
+
"content_tokens",
|
|
93
|
+
"conversation_contains_value",
|
|
94
|
+
"conversation_supports_canonical_value",
|
|
95
|
+
"conversation_text_from_history",
|
|
96
|
+
"compact_agent_json",
|
|
97
|
+
"effective_business_effects",
|
|
98
|
+
"has_approval_intent",
|
|
99
|
+
"has_conditional_approval_boundary",
|
|
100
|
+
"infer_allowed_value_from_history",
|
|
101
|
+
"infer_declared_input_value",
|
|
102
|
+
"input_meanings_for",
|
|
103
|
+
"input_semantics_for",
|
|
104
|
+
"is_approval_capability",
|
|
105
|
+
"is_conditional_approval_boundary_active",
|
|
106
|
+
"is_deictic_reference",
|
|
107
|
+
"is_ungrounded_declared_context",
|
|
108
|
+
"looks_like_quarter_input",
|
|
109
|
+
"metadata_with_manifest_controls",
|
|
110
|
+
"normalize_clarification_continuation_plan",
|
|
111
|
+
"normalize_declared_input_value",
|
|
112
|
+
"normalize_declared_parameters",
|
|
113
|
+
"normalize_invocation_plan",
|
|
114
|
+
"normalize_reference_value",
|
|
115
|
+
"normalize_by_allowed_values",
|
|
116
|
+
"quarter_label_from_text",
|
|
117
|
+
"reference_catalog_for",
|
|
118
|
+
"render_agent_business_effects",
|
|
119
|
+
"render_agent_detail_metadata",
|
|
120
|
+
"render_agent_input_spec",
|
|
121
|
+
"render_agent_routing_metadata",
|
|
122
|
+
"render_compact_agent_capability_line",
|
|
123
|
+
"render_compact_agent_input_summary",
|
|
124
|
+
"requested_primary_content_effect",
|
|
125
|
+
"requested_unsupported_effects",
|
|
126
|
+
"required_context_for",
|
|
127
|
+
"requires_declared_grounding",
|
|
128
|
+
"semantic_key",
|
|
129
|
+
"semantic_text_key",
|
|
130
|
+
"select_approval_boundary_capability",
|
|
131
|
+
"select_consumable_capability",
|
|
132
|
+
"select_declared_effect_capability",
|
|
133
|
+
"select_profile_hint_capability",
|
|
134
|
+
"selected_agent_capability_detail",
|
|
135
|
+
"should_clear_planner_unsupported_for_approval_boundary",
|
|
136
|
+
"should_clear_planner_unsupported_for_declared_effect",
|
|
137
|
+
"text_tokens",
|
|
138
|
+
"token_score",
|
|
139
|
+
"user_authored_conversation_text",
|
|
140
|
+
]
|