ioc-cfn-mas-client-lib 0.2.0__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 (79) hide show
  1. ioc_cfn_mas_client_lib-0.2.0/LICENSE.md +201 -0
  2. ioc_cfn_mas_client_lib-0.2.0/PKG-INFO +473 -0
  3. ioc_cfn_mas_client_lib-0.2.0/README.md +430 -0
  4. ioc_cfn_mas_client_lib-0.2.0/pyproject.toml +86 -0
  5. ioc_cfn_mas_client_lib-0.2.0/setup.cfg +4 -0
  6. ioc_cfn_mas_client_lib-0.2.0/src/generated/__init__.py +104 -0
  7. ioc_cfn_mas_client_lib-0.2.0/src/generated/api/__init__.py +12 -0
  8. ioc_cfn_mas_client_lib-0.2.0/src/generated/api/memory_operations_api.py +372 -0
  9. ioc_cfn_mas_client_lib-0.2.0/src/generated/api/metrics_api.py +430 -0
  10. ioc_cfn_mas_client_lib-0.2.0/src/generated/api/semantic_alignment_api.py +664 -0
  11. ioc_cfn_mas_client_lib-0.2.0/src/generated/api/shared_memories_api.py +956 -0
  12. ioc_cfn_mas_client_lib-0.2.0/src/generated/api_client.py +808 -0
  13. ioc_cfn_mas_client_lib-0.2.0/src/generated/api_response.py +25 -0
  14. ioc_cfn_mas_client_lib-0.2.0/src/generated/configuration.py +604 -0
  15. ioc_cfn_mas_client_lib-0.2.0/src/generated/exceptions.py +222 -0
  16. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/__init__.py +43 -0
  17. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/agent.py +95 -0
  18. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/agent_reply.py +104 -0
  19. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/alignment_response.py +96 -0
  20. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/create_or_update_accepted_response.py +96 -0
  21. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/create_or_update_request.py +104 -0
  22. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/create_or_update_response.py +96 -0
  23. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/decide_request.py +103 -0
  24. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/extraction_payload.py +98 -0
  25. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/extraction_payload_metadata.py +99 -0
  26. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/header.py +92 -0
  27. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/memory_operation_payload.py +105 -0
  28. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/memory_operation_request.py +98 -0
  29. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/memory_operation_response.py +96 -0
  30. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/metric_record.py +106 -0
  31. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/metrics_filters.py +99 -0
  32. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/metrics_pagination.py +96 -0
  33. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/metrics_period.py +95 -0
  34. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/metrics_query_response.py +118 -0
  35. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/onboard_vector_store_request.py +98 -0
  36. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/onboard_vector_store_response.py +98 -0
  37. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/query_request.py +105 -0
  38. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/query_response.py +94 -0
  39. ioc_cfn_mas_client_lib-0.2.0/src/generated/models/start_request.py +107 -0
  40. ioc_cfn_mas_client_lib-0.2.0/src/generated/rest.py +267 -0
  41. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/__init__.py +3 -0
  42. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_agent.py +58 -0
  43. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_agent_reply.py +59 -0
  44. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_alignment_response.py +57 -0
  45. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_create_or_update_accepted_response.py +60 -0
  46. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_create_or_update_request.py +65 -0
  47. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_create_or_update_response.py +58 -0
  48. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_decide_request.py +68 -0
  49. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_extraction_payload.py +60 -0
  50. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_extraction_payload_metadata.py +56 -0
  51. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_header.py +55 -0
  52. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_memory_operation_payload.py +61 -0
  53. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_memory_operation_request.py +69 -0
  54. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_memory_operation_response.py +60 -0
  55. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_memory_operations_api.py +42 -0
  56. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_metric_record.py +68 -0
  57. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_metrics_api.py +42 -0
  58. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_metrics_filters.py +58 -0
  59. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_metrics_pagination.py +60 -0
  60. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_metrics_period.py +58 -0
  61. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_metrics_query_response.py +93 -0
  62. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_onboard_vector_store_request.py +57 -0
  63. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_onboard_vector_store_response.py +59 -0
  64. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_query_request.py +65 -0
  65. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_query_response.py +56 -0
  66. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_semantic_alignment_api.py +49 -0
  67. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_shared_memories_api.py +56 -0
  68. ioc_cfn_mas_client_lib-0.2.0/src/generated/test/test_start_request.py +69 -0
  69. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client/__init__.py +10 -0
  70. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client/client.py +606 -0
  71. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client/instrumentation/__init__.py +10 -0
  72. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client/instrumentation/a2a.py +335 -0
  73. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client/mcp/mcp_client.py +277 -0
  74. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client/mcp/mcp_client_sample.py +206 -0
  75. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client_lib.egg-info/PKG-INFO +473 -0
  76. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client_lib.egg-info/SOURCES.txt +77 -0
  77. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client_lib.egg-info/dependency_links.txt +1 -0
  78. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client_lib.egg-info/requires.txt +18 -0
  79. ioc_cfn_mas_client_lib-0.2.0/src/ioc_cfn_mas_client_lib.egg-info/top_level.txt +2 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,473 @@
1
+ Metadata-Version: 2.4
2
+ Name: ioc-cfn-mas-client-lib
3
+ Version: 0.2.0
4
+ Summary: Python SDK client library for IoC Cognition Fabric Node Multi-Agent System
5
+ Author-email: Outshift Open <oss@cisco.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/outshift-open/ioc-cfn-mas-client-lib
8
+ Project-URL: Documentation, https://github.com/outshift-open/ioc-cfn-mas-client-lib/blob/main/README.md
9
+ Project-URL: Repository, https://github.com/outshift-open/ioc-cfn-mas-client-lib
10
+ Project-URL: Issues, https://github.com/outshift-open/ioc-cfn-mas-client-lib/issues
11
+ Project-URL: Changelog, https://github.com/outshift-open/ioc-cfn-mas-client-lib/blob/main/CHANGELOG.md
12
+ Keywords: ioc,cognition-fabric,mas,multi-agent-system,sdk,cfn
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE.md
25
+ Requires-Dist: pydantic>=2.5
26
+ Requires-Dist: urllib3>=1.26
27
+ Requires-Dist: python-dateutil>=2.8
28
+ Requires-Dist: typing-extensions>=4.7
29
+ Requires-Dist: a2a-sdk[http-server]==0.3.26
30
+ Requires-Dist: uvicorn>=0.44.0
31
+ Requires-Dist: aiohttp>=3.8.0
32
+ Requires-Dist: grpcio>=1.60
33
+ Requires-Dist: grpcio-tools>=1.60
34
+ Requires-Dist: xds-protos>=1.60
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=7.4; extra == "dev"
37
+ Requires-Dist: pytest-cov>=4.1; extra == "dev"
38
+ Requires-Dist: ruff>=0.4; extra == "dev"
39
+ Requires-Dist: mypy>=1.8; extra == "dev"
40
+ Requires-Dist: build>=1.0; extra == "dev"
41
+ Requires-Dist: twine>=4.0; extra == "dev"
42
+ Dynamic: license-file
43
+
44
+ # Internet of Cognition (IOC) - Cognition Fabric Node (CFN) MAS Client Library
45
+
46
+ [![PyPI version](https://badge.fury.io/py/ioc-cfn-mas-client-lib.svg)](https://badge.fury.io/py/ioc-cfn-mas-client-lib)
47
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
48
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
49
+
50
+ Python SDK client library for the Internet of Cognition (IoC) Cognition Fabric Node Multi-Agent System.
51
+
52
+ ## Overview
53
+
54
+ This repository contains:
55
+
56
+ - `src/ioc_cfn_mas_client/client.py`: a small, user\-facing `Client` wrapper\.
57
+ - `src/generated/`: OpenAPI\-generated code \(implementation detail\)\. Avoid editing generated files directly\.
58
+
59
+ ## Installation
60
+
61
+ **Requires Python >= 3.10**
62
+
63
+ ```bash
64
+ pip install ioc-cfn-mas-client-lib
65
+ ```
66
+
67
+ ## Quick start
68
+
69
+ Create a client using the CFN URL:
70
+
71
+ ```python
72
+ from ioc_cfn_mas_client.client import Client
73
+
74
+ client = Client(cfn_url="http://localhost:9002")
75
+ ```
76
+
77
+ ### Shared Memories API
78
+
79
+ #### Create or update shared memories from trace data
80
+
81
+ ```python
82
+ # Create memories from trace data (e.g., OpenTelemetry traces)
83
+ trace_data = [
84
+ {
85
+ "TraceId": "trace-001",
86
+ "SpanId": "span-001",
87
+ "SpanName": "user_login",
88
+ "ServiceName": "auth-service",
89
+ "SpanAttributes": {"user_id": "user123"},
90
+ "Duration": 150
91
+ }
92
+ ]
93
+
94
+ response = client.create_shared_memories(
95
+ workspace_id="your_workspace_id",
96
+ mas_id="your_mas_id",
97
+ data=trace_data,
98
+ format="observe-sdk-otel", # or "openclaw"
99
+ agent_id="your_agent_id", # Optional
100
+ )
101
+ ```
102
+
103
+ #### Query shared memories with natural language
104
+
105
+ ```python
106
+ # Query memories using natural language intent
107
+ results = client.query_shared_memories(
108
+ workspace_id="your_workspace_id",
109
+ mas_id="your_mas_id",
110
+ intent="Find information about user login events",
111
+ agent_id="your_agent_id",
112
+ additional_context=[{"context": "prior conversation"}], # Optional
113
+ )
114
+ ```
115
+
116
+ ### Memory Operations API (Proxy to Remote Providers)
117
+
118
+ Forward memory operations to remote providers like Mem0 or Graphiti:
119
+
120
+ ```python
121
+ # GET memories from remote provider
122
+ response = client.memory_operation(
123
+ workspace_id="your_workspace_id",
124
+ mas_id="your_mas_id",
125
+ agent_id="your_agent_id",
126
+ http_method="GET",
127
+ http_url="v1/memories/?user_id=test-user",
128
+ )
129
+
130
+ # POST memories to remote provider
131
+ response = client.memory_operation(
132
+ workspace_id="your_workspace_id",
133
+ mas_id="your_mas_id",
134
+ agent_id="your_agent_id",
135
+ http_method="POST",
136
+ http_url="/v1/memories/",
137
+ http_body={
138
+ "messages": [{"role": "user", "content": "I prefer dark mode"}],
139
+ "user_id": "test-user"
140
+ },
141
+ )
142
+ ```
143
+
144
+ ### Semantic Alignment API
145
+
146
+ Run multi\-agent alignment sessions:
147
+
148
+ ```python
149
+ # Start a alignment session
150
+ response = client.start_alignment(
151
+ workspace_id="your_workspace_id",
152
+ mas_id="your_mas_id",
153
+ session_id="session-123",
154
+ agents=[
155
+ {"id": "agent1", "name": "Planner Agent"},
156
+ {"id": "agent2", "name": "Executor Agent"}
157
+ ],
158
+ content_text="Plan a deployment strategy",
159
+ n_steps=10, # Optional, defaults to 20
160
+ )
161
+
162
+ # Advance alignment with agent replies
163
+ response = client.advance_alignment(
164
+ workspace_id="your_workspace_id",
165
+ mas_id="your_mas_id",
166
+ session_id="session-123",
167
+ agent_replies=[
168
+ {
169
+ "agent_id": "agent1",
170
+ "action": "counter_offer",
171
+ "offer": {"strategy": "blue-green deployment"}
172
+ },
173
+ {
174
+ "agent_id": "agent2",
175
+ "action": "accept"
176
+ }
177
+ ],
178
+ )
179
+ ```
180
+
181
+ ### Google A2A Protocol Integration
182
+
183
+ Use `A2AInstrumentor` to automatically track all A2A agents without decorators (monkey patching approach):
184
+
185
+ ```python
186
+ from ioc_cfn_mas_client import Client, A2AInstrumentor
187
+ from a2a.server.agent_execution import AgentExecutor
188
+
189
+ client = Client(cfn_url="http://localhost:9002")
190
+
191
+ # One-time setup - instruments ALL AgentExecutor classes automatically
192
+ instrumentor = A2AInstrumentor(
193
+ client=client,
194
+ workspace_id="my-workspace",
195
+ mas_id="my-mas",
196
+ publish_input=True, # Publish incoming A2A messages
197
+ publish_output=True, # Publish task results
198
+ )
199
+ instrumentor.instrument()
200
+
201
+ # Now ALL agents are automatically tracked - no decorators needed!
202
+ class MyA2AAgent(AgentExecutor):
203
+ async def execute(self, context, event_queue):
204
+ """Execute agent - automatically published to CFN."""
205
+ # Your A2A agent logic here
206
+ # All interactions automatically saved to CFN shared memory
207
+ pass
208
+ ```
209
+
210
+
211
+
212
+ **Key Features:**
213
+
214
+ - **Zero code changes** - works with any A2A agent
215
+ - Automatic publishing of A2A messages to CFN shared memory
216
+ - Uses monkey patching (similar to OpenTelemetry auto-instrumentation)
217
+ - Preserves A2A protocol structure (messages, tasks, artifacts)
218
+ - Can be enabled/disabled globally with `uninstrument()`
219
+
220
+ For detailed documentation, see [docs/A2A_INTEGRATION.md](docs/A2A_INTEGRATION.md).
221
+
222
+ **Example:**
223
+
224
+ ```bash
225
+ # Terminal 1 - Start Agent B server
226
+ uv run python examples/instrumentation/a2a/multi_agent_example.py --server
227
+
228
+ # Terminal 2 - Run Agent A client
229
+ uv run python examples/instrumentation/a2a/multi_agent_example.py --client
230
+ ```
231
+
232
+ See [examples/instrumentation/a2a/multi_agent_example.py](examples/instrumentation/a2a/multi_agent_example.py) for the complete code, and [examples/instrumentation/README.md](examples/instrumentation/README.md) for more details.
233
+
234
+ ### MCP Client Integration
235
+
236
+ Use the MCP (Model Context Protocol) client methods integrated into the main Client class:
237
+
238
+ ```python
239
+ from ioc_cfn_mas_client import Client
240
+
241
+ # Initialize client with MCP server URL
242
+ client = Client(cfn_url="http://localhost:9001")
243
+
244
+ # Retain shared memories using MCP-style interface
245
+ result = await client.retain(
246
+ workspace_id="my-workspace",
247
+ mas_id="my-mas",
248
+ payload={
249
+ "metadata": {"format": "openclaw"},
250
+ "data": [{"example": "conversation data"}]
251
+ },
252
+ agent_id="my-agent"
253
+ )
254
+ print(f"Retain result: {result['status']}")
255
+
256
+ # Recall shared memories using natural language intent
257
+ result = await client.recall(
258
+ workspace_id="my-workspace",
259
+ mas_id="my-mas",
260
+ intent="Find information about user preferences",
261
+ search_strategy="semantic_graph_traversal",
262
+ agent_id="my-agent"
263
+ )
264
+ print(f"Recall result: {result['message']}")
265
+ ```
266
+
267
+ **Key Features:**
268
+
269
+ - **Integrated MCP Methods** - `retain()` and `recall()` methods built into the main Client class
270
+ - **Mock Responses** - Returns structured mock data for testing without live MCP server
271
+ - **OpenClaw Format** - Supports conversation data for retain operations
272
+ - **Natural Language Queries** - Use intent-based queries for recall operations
273
+ - **Semantic Search** - Built-in semantic graph traversal for memory retrieval
274
+
275
+ **Examples:**
276
+
277
+ ```bash
278
+ # Run the MCP client example demonstrating retain/recall methods
279
+ uv run python examples/mcp/client_example.py
280
+
281
+ # For direct MCP protocol testing (advanced users):
282
+ uv run python -m src.ioc_cfn_mas_client.mcp.mcp_client_sample --operation list_tools
283
+ uv run python -m src.ioc_cfn_mas_client.mcp.mcp_client_sample --operation retain
284
+ uv run python -m src.ioc_cfn_mas_client.mcp.mcp_client_sample --operation recall
285
+ ```
286
+
287
+ For complete examples and implementation details, see [examples/mcp/client_example.py](examples/mcp/client_example.py) and [src/ioc_cfn_mas_client/mcp/](src/ioc_cfn_mas_client/mcp/).
288
+
289
+ ### A2A Sidecar Proxy Pattern (Production - ZTA Approach with Istio)
290
+
291
+ For production deployments, use the **Envoy-based sidecar** following the **ZTA (Zero Trust Architecture)** pattern with **Istio service mesh**. This provides **truly transparent** interception with zero agent configuration.
292
+
293
+ **Prerequisites:** Istio must be installed in your Kubernetes cluster.
294
+
295
+ ```
296
+ ┌──────────────────────────────────────┐
297
+ │ Kubernetes Pod │
298
+ │ │
299
+ │ Agent (UNCHANGED) → Istio/iptables │
300
+ │ ↓ │
301
+ │ Envoy Proxy │
302
+ │ ↓ │
303
+ │ ext_authz (A2A Parser) │
304
+ │ ↓ │
305
+ │ Logs/CFN API │
306
+ └──────────────────────────────────────┘
307
+ ```
308
+
309
+ **Quick Start:**
310
+
311
+ ```bash
312
+ # 1. Build ext-authz image (Istio approach)
313
+ docker build -t ext-authz-only:latest -f sidecar/istio/Dockerfile .
314
+
315
+ # 2. Apply EnvoyFilter to Kubernetes (requires Istio)
316
+ kubectl apply -f sidecar/istio/envoy-filter.yaml
317
+
318
+ # 3. Deploy your agent with ext-authz sidecar container
319
+ # See examples/sidecar/k8s/ for complete manifests
320
+
321
+ # 4. That's it! Agent is completely agnostic - no changes needed!
322
+ ```
323
+
324
+ **Key Features:**
325
+
326
+ - **✅ Truly agnostic** - zero code changes, zero configuration changes
327
+ - **✅ Istio-based** - automatic sidecar injection and iptables setup
328
+ - **✅ Production-ready** - uses Istio service mesh
329
+ - **✅ Language agnostic** - works with any HTTP client (Python, Go, Node.js, Java, Rust, etc.)
330
+ - **✅ High performance** - Envoy proxy (50K+ req/s)
331
+ - **✅ Protocol-aware** - parses A2A messages (JSON-RPC 2.0)
332
+
333
+ **Architecture:**
334
+
335
+ - **Istio**: Automatic sidecar injection and traffic interception
336
+ - **Envoy Proxy**: C++ high-performance proxy for traffic interception
337
+ - **ext_authz Service**: Python gRPC service for A2A message parsing
338
+
339
+ **Documentation:**
340
+
341
+ - [Sidecar README](sidecar/README.md) - Complete implementation guide
342
+ - [Working Demo](examples/sidecar/) - End-to-end example with Istio
343
+ - [ZTA Implementation Summary](docs/ZTA_IMPLEMENTATION_SUMMARY.md) - Architecture details
344
+ - [Transparent Interception Guide](docs/TRANSPARENT_INTERCEPTION.md) - How iptables works
345
+
346
+ **Comparison with Monkey-Patching:**
347
+
348
+ | Feature | Envoy Sidecar (ZTA) | Monkey-Patching |
349
+ |---------|---------------------|-----------------|
350
+ | **Agent Code** | ✅ Unchanged | ⚠️ One instrumentation call |
351
+ | **Agent Config** | ✅ Unchanged | ✅ Unchanged |
352
+ | **Languages** | Any (Python, Go, Node.js, Java, etc.) | Python only |
353
+ | **Performance** | 50K+ req/s | Minimal overhead |
354
+ | **Production** | ✅ Recommended | Development only |
355
+ | **Platform** | Kubernetes | Any |
356
+ | **Isolation** | Strong (separate process) | Weak (same process) |
357
+
358
+ **Recommendation:** Use **Envoy sidecar for production** (truly agnostic, language-independent), **monkey-patching for development/testing** (quick setup, Python-only).
359
+
360
+ ### Advanced Usage
361
+
362
+ For power users who need direct access to the generated OpenAPI clients:
363
+
364
+ ```python
365
+ # Access the underlying API clients
366
+ shared_memories_api = client.shared_memories_api
367
+ memory_operations_api = client.memory_operations_api
368
+ semantic_alignment_api = client.semantic_alignment_api
369
+
370
+ # Use generated methods directly
371
+ response = shared_memories_api.api_workspaces_workspace_id_multi_agentic_systems_mas_id_shared_memories_post_with_http_info(...)
372
+ ```
373
+
374
+ For a complete example, see `examples/example.py`\.
375
+
376
+ ## Configuration
377
+
378
+ The `Client` constructor accepts the following parameters:
379
+
380
+ - `cfn_url` \(required\): CFN API endpoint URL \(e\.g\., `http://localhost:9002`\)
381
+ - `timeout` \(optional\): Request timeout in seconds
382
+ - `configuration` \(optional\): Pre\-configured Configuration object \(for advanced users\)
383
+ - `api_client` \(optional\): Pre\-configured ApiClient object \(for advanced users\)
384
+
385
+ ### Environment variables
386
+
387
+ Optional environment variable:
388
+
389
+ - `CFN_URL`: CFN API endpoint URL \(defaults to `http://localhost:9002` if not set\)
390
+
391
+ ## Development (macOS)
392
+
393
+ Using `uv`:
394
+
395
+ ```bash
396
+ uv venv
397
+ source .venv/bin/activate
398
+ uv pip install -e ".[dev]"
399
+
400
+ # Run tests
401
+ uv run pytest
402
+
403
+ # Run examples
404
+ uv run python examples/example.py
405
+ ```
406
+
407
+ ## OpenAPI SDK generation
408
+
409
+ - **OpenAPI spec source**: [ioc-cfn-svc public-api-v1.1.yaml](https://github.com/outshift-open/ioc-cfn-svc/blob/main/docs/public-api/public-api-v1.1.yaml)
410
+ - **Local spec**: `openapi/public-api-v1.1.yaml` (copied from source)
411
+ - **Generated output**: `src/generated/`
412
+
413
+ ### Prerequisites
414
+
415
+ **Docker** (required):
416
+
417
+ ```bash
418
+ docker pull openapitools/openapi-generator-cli
419
+ ```
420
+
421
+ Or use the make target:
422
+
423
+ ```bash
424
+ make pull-openapi-generator
425
+ ```
426
+
427
+ ### Generate
428
+
429
+ ```bash
430
+ make gen-openapi
431
+ ```
432
+
433
+ This regenerates `src/generated/` from `openapi/public-api-v1.1.yaml` using Docker.
434
+
435
+ **Important**: After regenerating, add copyright/license headers to the generated files:
436
+
437
+ ```bash
438
+ make add-headers-generated
439
+ ```
440
+
441
+ This adds Apache 2.0 license headers to all generated Python files to maintain OSPO compliance.
442
+
443
+ **Note**: The spec follows Python naming conventions (snake_case for methods/fields, PascalCase for classes). See [ioc-cfn-svc public API docs](https://github.com/outshift-open/ioc-cfn-svc/tree/main/docs/public-api) for details.
444
+
445
+ ### Updating the spec
446
+
447
+ To update to a newer version:
448
+
449
+ 1. Copy the latest spec from ioc-cfn-svc:
450
+
451
+ ```bash
452
+ cp /path/to/ioc-cfn-svc/docs/public-api/public-api-v1.1.yaml openapi/
453
+ ```
454
+
455
+ 2. Regenerate:
456
+
457
+ ```bash
458
+ make gen-openapi
459
+ ```
460
+
461
+ 3. Update `client.py` if the API surface changed\.
462
+
463
+ ## License
464
+
465
+ This project is licensed under the Apache License, Version 2.0 - see the [LICENSE.md](LICENSE.md) file for full details.
466
+
467
+ Copyright (c) 2024-2026 Cisco Systems, Inc. and its affiliates. All rights reserved.
468
+
469
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
470
+
471
+ http://www.apache.org/licenses/LICENSE-2.0
472
+
473
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.