@macaw-ai/client 0.0.0-stage → 0.9.10
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.
- package/LICENSE.md +339 -0
- package/bin/install.js +278 -0
- package/package.json +37 -4
- package/payload/README.md +56 -0
- package/payload/secureAI/LICENSE +190 -0
- package/payload/secureAI/NOTICE +5 -0
- package/payload/secureAI/demos/policy-controls/1_uncontrolled.py +139 -0
- package/payload/secureAI/demos/policy-controls/2_with_macaw.py +139 -0
- package/payload/secureAI/demos/policy-controls/3_with_user_policies.py +162 -0
- package/payload/secureAI/demos/policy-controls/credentials.txt +12 -0
- package/payload/secureAI/demos/policy-controls/malicious_report.txt +21 -0
- package/payload/secureAI/demos/policy-controls/sales_report.txt +20 -0
- package/payload/secureAI/demos/tutorial-1-rbac/README.md +143 -0
- package/payload/secureAI/demos/tutorial-1-rbac/app.py +147 -0
- package/payload/secureAI/demos/tutorial-1-rbac/authprompts_demo.py +306 -0
- package/payload/secureAI/demos/tutorial-1-rbac/config/claims-config.yaml +152 -0
- package/payload/secureAI/demos/tutorial-1-rbac/demo_secureopenai_with_policies.py +150 -0
- package/payload/secureAI/demos/tutorial-1-rbac/policies/bu_Analytics.json +8 -0
- package/payload/secureAI/demos/tutorial-1-rbac/policies/company_FinTech_Corp.json +70 -0
- package/payload/secureAI/demos/tutorial-1-rbac/policies/llm-base.json +69 -0
- package/payload/secureAI/demos/tutorial-1-rbac/policies/team_Reporting.json +8 -0
- package/payload/secureAI/demos/tutorial-1-rbac/policies/user_alice.json +32 -0
- package/payload/secureAI/demos/tutorial-1-rbac/policies/user_bob.json +28 -0
- package/payload/secureAI/demos/tutorial-1-rbac/policies/user_carol.json +34 -0
- package/payload/secureAI/demos/tutorial-1-rbac/requirements.txt +6 -0
- package/payload/secureAI/demos/tutorial-1-rbac/setup/auth0_complete_setup.sh +392 -0
- package/payload/secureAI/demos/tutorial-1-rbac/setup/keycloak_complete_setup.sh +320 -0
- package/payload/secureAI/demos/tutorial-2-intent/Policies/alation-remote-proxy.json +155 -0
- package/payload/secureAI/demos/tutorial-2-intent/Policies/bu.json +22 -0
- package/payload/secureAI/demos/tutorial-2-intent/Policies/company.json +17 -0
- package/payload/secureAI/demos/tutorial-2-intent/Policies/user_alice.json +48 -0
- package/payload/secureAI/demos/tutorial-2-intent/Policies/user_bob.json +83 -0
- package/payload/secureAI/demos/tutorial-2-intent/README.md +213 -0
- package/payload/secureAI/demos/tutorial-2-intent/script.py +188 -0
- package/payload/secureAI/demos/tutorial-2-intent/setup/alation_verifier.py +177 -0
- package/payload/secureAI/demos/tutorial-2-intent/setup/get_alation_user_token.py +180 -0
- package/payload/secureAI/examples/README.md +244 -0
- package/payload/secureAI/examples/anthropic/anthropic_1a_dropin_simple.py +103 -0
- package/payload/secureAI/examples/anthropic/anthropic_1b_multiuser_bind.py +190 -0
- package/payload/secureAI/examples/anthropic/anthropic_1b_multiuser_bind_streaming.py +190 -0
- package/payload/secureAI/examples/anthropic/anthropic_1c_a2a_invoke.py +156 -0
- package/payload/secureAI/examples/attestations/1a_trade_alice.py +215 -0
- package/payload/secureAI/examples/attestations/1a_trade_bob.py +164 -0
- package/payload/secureAI/examples/attestations/1b_grant_admin.py +170 -0
- package/payload/secureAI/examples/attestations/1b_grant_researcher.py +231 -0
- package/payload/secureAI/examples/attestations/README.md +128 -0
- package/payload/secureAI/examples/langchain/langchain_1a_dropin_simple.py +199 -0
- package/payload/secureAI/examples/langchain/langchain_1b_multiuser.py +262 -0
- package/payload/secureAI/examples/langchain/langchain_1c_orchestration.py +332 -0
- package/payload/secureAI/examples/langchain/langchain_1d_llm_openai.py +130 -0
- package/payload/secureAI/examples/langchain/langchain_1e_llm_anthropic.py +130 -0
- package/payload/secureAI/examples/langchain/langchain_1f_memory.py +214 -0
- package/payload/secureAI/examples/litellm/litellm_1a_dropin_simple.py +131 -0
- package/payload/secureAI/examples/mcp/1a_simple_invocation.py +115 -0
- package/payload/secureAI/examples/mcp/1b_discovery_and_resources.py +142 -0
- package/payload/secureAI/examples/mcp/1c_logging_client.py +100 -0
- package/payload/secureAI/examples/mcp/1d_progress_client.py +100 -0
- package/payload/secureAI/examples/mcp/1e_sampling_client.py +150 -0
- package/payload/secureAI/examples/mcp/1e_sampling_server.py +90 -0
- package/payload/secureAI/examples/mcp/1f_elicitation_client.py +127 -0
- package/payload/secureAI/examples/mcp/1f_elicitation_server.py +73 -0
- package/payload/secureAI/examples/mcp/1g_roots_client.py +122 -0
- package/payload/secureAI/examples/mcp/1g_roots_server.py +85 -0
- package/payload/secureAI/examples/mcp/2a_proxy_snowflake.py +212 -0
- package/payload/secureAI/examples/mcp/2b_proxy_databricks.py +299 -0
- package/payload/secureAI/examples/mcp/2c_proxy_stdio_fetch.py +91 -0
- package/payload/secureAI/examples/mcp/2d_proxy_stdio_salesforce.py +119 -0
- package/payload/secureAI/examples/mcp/2e_proxy_multiuser.py +136 -0
- package/payload/secureAI/examples/mcp/2f_proxy_stdio_databricks.py +144 -0
- package/payload/secureAI/examples/mcp/3a_native_mcp_client.py +104 -0
- package/payload/secureAI/examples/mcp/3b_native_mcp_proxy.py +114 -0
- package/payload/secureAI/examples/mcp/3c_native_mcp_sampling.py +180 -0
- package/payload/secureAI/examples/mcp/3d_native_mcp_2026.py +135 -0
- package/payload/secureAI/examples/mcp/securemcp_calculator.py +248 -0
- package/payload/secureAI/examples/mcp/securemcp_server.py +75 -0
- package/payload/secureAI/examples/openai/openai_1a_dropin_simple.py +102 -0
- package/payload/secureAI/examples/openai/openai_1b_multiuser_bind.py +193 -0
- package/payload/secureAI/examples/openai/openai_1b_multiuser_bind_streaming.py +199 -0
- package/payload/secureAI/examples/openai/openai_1c_a2a_invoke.py +156 -0
- package/payload/secureAI/examples/openai/openai_1d_invocation_patterns.py +337 -0
- package/payload/secureAI/examples/phishing-resistance/1a_login_alice.py +180 -0
- package/payload/secureAI/examples/phishing-resistance/1b_trade_alice.py +241 -0
- package/payload/secureAI/examples/phishing-resistance/1b_trade_bob.py +164 -0
- package/payload/secureAI/examples/phishing-resistance/README.md +124 -0
- package/payload/secureAI/examples/phishing-resistance/get_token.py +114 -0
- package/payload/secureAI/examples/pydantic_ai/README.md +88 -0
- package/payload/secureAI/examples/pydantic_ai/policies/app_pydantic-agent.json +10 -0
- package/payload/secureAI/examples/pydantic_ai/pydanticai_1a_dropin_simple.py +90 -0
- package/payload/secureAI/examples/pydantic_ai/pydanticai_1b_model_routing.py +85 -0
- package/payload/secureAI/examples/pydantic_ai/pydanticai_1c_native_tools.py +83 -0
- package/payload/secureAI/examples/pydantic_ai/pydanticai_1d_multiuser_bind.py +104 -0
- package/payload/secureAI/examples/pydantic_ai/pydanticai_1e_mcp_compose.py +92 -0
- package/payload/secureAI/macaw_adapters/__init__.py +55 -0
- package/payload/secureAI/macaw_adapters/anthropic/REFERENCE.md +374 -0
- package/payload/secureAI/macaw_adapters/anthropic/__init__.py +22 -0
- package/payload/secureAI/macaw_adapters/anthropic/secure_anthropic.py +792 -0
- package/payload/secureAI/macaw_adapters/anthropic_ext_tools/__init__.py +25 -0
- package/payload/secureAI/macaw_adapters/anthropic_ext_tools/secure_anthropic.py +840 -0
- package/payload/secureAI/macaw_adapters/langchain/REFERENCE.md +234 -0
- package/payload/secureAI/macaw_adapters/langchain/__init__.py +100 -0
- package/payload/secureAI/macaw_adapters/langchain/_utils.py +83 -0
- package/payload/secureAI/macaw_adapters/langchain/agents.py +296 -0
- package/payload/secureAI/macaw_adapters/langchain/anthropic.py +456 -0
- package/payload/secureAI/macaw_adapters/langchain/callbacks.py +306 -0
- package/payload/secureAI/macaw_adapters/langchain/memory.py +352 -0
- package/payload/secureAI/macaw_adapters/langchain/openai.py +410 -0
- package/payload/secureAI/macaw_adapters/langchain/tools.py +174 -0
- package/payload/secureAI/macaw_adapters/litellm/README.md +216 -0
- package/payload/secureAI/macaw_adapters/litellm/__init__.py +143 -0
- package/payload/secureAI/macaw_adapters/litellm/secure_litellm.py +686 -0
- package/payload/secureAI/macaw_adapters/mcp/REFERENCE.md +460 -0
- package/payload/secureAI/macaw_adapters/mcp/__init__.py +65 -0
- package/payload/secureAI/macaw_adapters/mcp/_endpoint.py +193 -0
- package/payload/secureAI/macaw_adapters/mcp/_endpoint2.py +225 -0
- package/payload/secureAI/macaw_adapters/mcp/_serve.py +25 -0
- package/payload/secureAI/macaw_adapters/mcp/client.py +721 -0
- package/payload/secureAI/macaw_adapters/mcp/decorators.py +228 -0
- package/payload/secureAI/macaw_adapters/mcp/fastmcp_compat.py +353 -0
- package/payload/secureAI/macaw_adapters/mcp/mcp.py +785 -0
- package/payload/secureAI/macaw_adapters/mcp/proxy.py +626 -0
- package/payload/secureAI/macaw_adapters/mcp/server.py +317 -0
- package/payload/secureAI/macaw_adapters/mcp/subscriptions.py +450 -0
- package/payload/secureAI/macaw_adapters/openai/REFERENCE.md +368 -0
- package/payload/secureAI/macaw_adapters/openai/__init__.py +22 -0
- package/payload/secureAI/macaw_adapters/openai/secure_openai.py +833 -0
- package/payload/secureAI/macaw_adapters/openai_ext_tools/REFERENCE.md +368 -0
- package/payload/secureAI/macaw_adapters/openai_ext_tools/__init__.py +25 -0
- package/payload/secureAI/macaw_adapters/openai_ext_tools/secure_openai.py +876 -0
- package/payload/secureAI/macaw_adapters/pydantic_ai/__init__.py +36 -0
- package/payload/secureAI/macaw_adapters/pydantic_ai/_core.py +257 -0
- package/payload/secureAI/macaw_adapters/pydantic_ai/agent.py +218 -0
- package/payload/secureAI/macaw_adapters/pydantic_ai/model.py +99 -0
- package/payload/secureAI/macaw_adapters/pydantic_ai/toolset.py +86 -0
- package/payload/secureAI/test_harness_quick.py +296 -0
- package/wheels/macaw_adapters-0.9.10.1-py3-none-any.whl +0 -0
- package/wheels/macaw_client-0.9.10.1-cp312-cp312-macosx_11_0_arm64.whl +0 -0
- package/wheels/macaw_client-0.9.10.1-cp312-cp312-manylinux_2_17_x86_64.whl +0 -0
- package/wheels/macaw_client-0.9.10.1-cp314-cp314-macosx_11_0_arm64.whl +0 -0
- package/wheels/macaw_client-0.9.10.1-cp314-cp314-manylinux_2_17_x86_64.whl +0 -0
- package/wheels/macaw_client-0.9.10.1-cp314-cp314-win_amd64.whl +0 -0
- package/wheels/macaw_client-0.9.10.1-cp39-cp39-macosx_11_0_arm64.whl +0 -0
- package/README.md +0 -3
package/LICENSE.md
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
MACAW CLIENT SOFTWARE LICENSE AGREEMENT
|
|
2
|
+
|
|
3
|
+
Version 1.0
|
|
4
|
+
Effective Date: January 2025
|
|
5
|
+
|
|
6
|
+
This MACAW Client Software License Agreement ("Agreement") is a legal agreement
|
|
7
|
+
between you (either an individual or a legal entity, "You" or "User") and MACAW
|
|
8
|
+
Security, Inc., a Delaware corporation ("MACAW Security," "we," "us," or "our").
|
|
9
|
+
|
|
10
|
+
BY DOWNLOADING, INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE, YOU AGREE
|
|
11
|
+
TO BE BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THESE TERMS,
|
|
12
|
+
DO NOT DOWNLOAD, INSTALL, OR USE THE SOFTWARE.
|
|
13
|
+
|
|
14
|
+
================================================================================
|
|
15
|
+
1. DEFINITIONS
|
|
16
|
+
================================================================================
|
|
17
|
+
|
|
18
|
+
1.1 "Software" means the MACAW Client library, including any compiled binaries,
|
|
19
|
+
source code (if provided), documentation, updates, patches, and any related
|
|
20
|
+
materials provided by MACAW Security.
|
|
21
|
+
|
|
22
|
+
1.2 "Commercial Use" means any use of the Software in connection with a business,
|
|
23
|
+
commercial enterprise, or for-profit activity, including but not limited to:
|
|
24
|
+
(a) use in production environments serving paying customers; (b) use in
|
|
25
|
+
internal business operations; (c) use in products or services offered for
|
|
26
|
+
sale or license; or (d) use by or on behalf of a government entity.
|
|
27
|
+
|
|
28
|
+
1.3 "Documentation" means any user guides, technical documentation, API
|
|
29
|
+
references, and other materials provided by MACAW Security relating to
|
|
30
|
+
the Software.
|
|
31
|
+
|
|
32
|
+
1.4 "MACAW Services" means the backend services, APIs, LocalAgent, and
|
|
33
|
+
infrastructure operated by MACAW Security that the Software connects to.
|
|
34
|
+
|
|
35
|
+
================================================================================
|
|
36
|
+
2. LICENSE GRANT
|
|
37
|
+
================================================================================
|
|
38
|
+
|
|
39
|
+
2.1 Grant of License. Subject to the terms and conditions of this Agreement,
|
|
40
|
+
MACAW Security hereby grants You a limited, worldwide, royalty-free,
|
|
41
|
+
non-exclusive, non-transferable, non-sublicensable, revocable license to:
|
|
42
|
+
|
|
43
|
+
(a) download, install, and use the Software;
|
|
44
|
+
(b) integrate the Software into Your applications and systems;
|
|
45
|
+
(c) make reasonable copies of the Software for backup purposes; and
|
|
46
|
+
(d) use the Documentation in connection with Your permitted use of
|
|
47
|
+
the Software.
|
|
48
|
+
|
|
49
|
+
2.2 Permitted Free Use. You may use the Software free of charge for:
|
|
50
|
+
|
|
51
|
+
(a) Development and Testing: Use in development, staging, and testing
|
|
52
|
+
environments for the purpose of evaluating, developing, or testing
|
|
53
|
+
applications that integrate with the Software;
|
|
54
|
+
|
|
55
|
+
(b) Personal Projects: Non-commercial personal projects that are not
|
|
56
|
+
used in connection with any business or commercial activity; and
|
|
57
|
+
|
|
58
|
+
(c) Open Source Projects: Integration into open source software projects
|
|
59
|
+
that are distributed under an OSI-approved open source license,
|
|
60
|
+
provided that the Software itself is not redistributed and end users
|
|
61
|
+
obtain the Software directly from MACAW Security.
|
|
62
|
+
|
|
63
|
+
2.3 Commercial Use License. Commercial Use of the Software requires a separate
|
|
64
|
+
commercial license agreement with MACAW Security. Please contact
|
|
65
|
+
support@macawsecurity.com to obtain a commercial license.
|
|
66
|
+
|
|
67
|
+
2.4 License to MACAW Services. Use of the Software in connection with MACAW
|
|
68
|
+
Services is subject to the MACAW Security Terms of Service available at
|
|
69
|
+
https://www.macawsecurity.ai/terms.
|
|
70
|
+
|
|
71
|
+
================================================================================
|
|
72
|
+
3. RESTRICTIONS
|
|
73
|
+
================================================================================
|
|
74
|
+
|
|
75
|
+
3.1 General Restrictions. Except as expressly permitted in this Agreement,
|
|
76
|
+
You shall not (and shall not permit any third party to):
|
|
77
|
+
|
|
78
|
+
(a) reverse engineer, decompile, disassemble, or otherwise attempt to
|
|
79
|
+
derive the source code, algorithms, data structures, or underlying
|
|
80
|
+
ideas of the Software, except to the extent such restriction is
|
|
81
|
+
expressly prohibited by applicable law;
|
|
82
|
+
|
|
83
|
+
(b) modify, adapt, translate, or create derivative works based on the
|
|
84
|
+
Software;
|
|
85
|
+
|
|
86
|
+
(c) rent, lease, lend, sell, sublicense, assign, distribute, publish,
|
|
87
|
+
transfer, or otherwise make the Software available to any third party;
|
|
88
|
+
|
|
89
|
+
(d) remove, alter, or obscure any proprietary notices, labels, or marks
|
|
90
|
+
on the Software or Documentation;
|
|
91
|
+
|
|
92
|
+
(e) use the Software to develop a product or service that competes with
|
|
93
|
+
the Software or MACAW Services;
|
|
94
|
+
|
|
95
|
+
(f) use the Software to circumvent, disable, or interfere with any
|
|
96
|
+
security, authentication, or access control mechanisms;
|
|
97
|
+
|
|
98
|
+
(g) use the Software in any manner that violates applicable laws,
|
|
99
|
+
regulations, or third-party rights;
|
|
100
|
+
|
|
101
|
+
(h) use the Software to transmit any malware, viruses, or other
|
|
102
|
+
malicious code;
|
|
103
|
+
|
|
104
|
+
(i) use the Software to conduct security testing, penetration testing,
|
|
105
|
+
or vulnerability scanning of MACAW Services without prior written
|
|
106
|
+
authorization; or
|
|
107
|
+
|
|
108
|
+
(j) benchmark, test, or publish performance comparisons of the Software
|
|
109
|
+
without MACAW Security's prior written consent.
|
|
110
|
+
|
|
111
|
+
3.2 Export Restrictions. The Software may be subject to export control laws
|
|
112
|
+
and regulations. You agree to comply with all applicable export and
|
|
113
|
+
re-export control laws and regulations, including the Export Administration
|
|
114
|
+
Regulations maintained by the U.S. Department of Commerce.
|
|
115
|
+
|
|
116
|
+
================================================================================
|
|
117
|
+
4. INTELLECTUAL PROPERTY
|
|
118
|
+
================================================================================
|
|
119
|
+
|
|
120
|
+
4.1 Ownership. The Software is licensed, not sold. MACAW Security and its
|
|
121
|
+
licensors retain all right, title, and interest in and to the Software,
|
|
122
|
+
including all intellectual property rights therein. This Agreement does
|
|
123
|
+
not grant You any rights to trademarks, service marks, or trade names
|
|
124
|
+
of MACAW Security.
|
|
125
|
+
|
|
126
|
+
4.2 Feedback. If You provide any feedback, suggestions, or recommendations
|
|
127
|
+
regarding the Software ("Feedback"), You hereby grant MACAW Security a
|
|
128
|
+
perpetual, irrevocable, worldwide, royalty-free license to use, modify,
|
|
129
|
+
and incorporate such Feedback into the Software and MACAW Services
|
|
130
|
+
without any obligation to You.
|
|
131
|
+
|
|
132
|
+
4.3 Third-Party Components. The Software may include third-party open source
|
|
133
|
+
components subject to separate license terms. A list of such components
|
|
134
|
+
and their respective licenses is provided in the NOTICE file accompanying
|
|
135
|
+
the Software. To the extent there is a conflict between this Agreement
|
|
136
|
+
and any open source license, the open source license terms shall govern
|
|
137
|
+
solely with respect to the applicable open source component.
|
|
138
|
+
|
|
139
|
+
================================================================================
|
|
140
|
+
5. DATA AND PRIVACY
|
|
141
|
+
================================================================================
|
|
142
|
+
|
|
143
|
+
5.1 Data Collection. The Software may collect and transmit certain data to
|
|
144
|
+
MACAW Services, including but not limited to: usage metrics, error reports,
|
|
145
|
+
and diagnostic information. Such data collection is subject to the MACAW
|
|
146
|
+
Security Privacy Policy available at https://www.macawsecurity.ai/privacy.
|
|
147
|
+
|
|
148
|
+
5.2 Your Data. As between You and MACAW Security, You retain all rights to
|
|
149
|
+
any data, content, or materials that You process using the Software
|
|
150
|
+
("Your Data"). You grant MACAW Security only such rights to Your Data
|
|
151
|
+
as are necessary to provide the MACAW Services.
|
|
152
|
+
|
|
153
|
+
================================================================================
|
|
154
|
+
6. DISCLAIMER OF WARRANTIES
|
|
155
|
+
================================================================================
|
|
156
|
+
|
|
157
|
+
6.1 AS-IS BASIS. THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT
|
|
158
|
+
WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
|
|
159
|
+
MACAW SECURITY EXPRESSLY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS,
|
|
160
|
+
IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING BUT NOT LIMITED TO:
|
|
161
|
+
|
|
162
|
+
(a) IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
163
|
+
PURPOSE, TITLE, AND NON-INFRINGEMENT;
|
|
164
|
+
|
|
165
|
+
(b) WARRANTIES ARISING FROM COURSE OF DEALING, USAGE, OR TRADE PRACTICE;
|
|
166
|
+
|
|
167
|
+
(c) WARRANTIES THAT THE SOFTWARE WILL BE UNINTERRUPTED, ERROR-FREE,
|
|
168
|
+
SECURE, OR FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS; AND
|
|
169
|
+
|
|
170
|
+
(d) WARRANTIES REGARDING THE ACCURACY, RELIABILITY, OR COMPLETENESS
|
|
171
|
+
OF ANY RESULTS OBTAINED FROM THE SOFTWARE.
|
|
172
|
+
|
|
173
|
+
6.2 BETA FEATURES. Any features or functionality designated as "beta,"
|
|
174
|
+
"preview," "experimental," or similar are provided without any warranty
|
|
175
|
+
and may be modified or discontinued at any time without notice.
|
|
176
|
+
|
|
177
|
+
================================================================================
|
|
178
|
+
7. LIMITATION OF LIABILITY
|
|
179
|
+
================================================================================
|
|
180
|
+
|
|
181
|
+
7.1 EXCLUSION OF DAMAGES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
|
|
182
|
+
IN NO EVENT SHALL MACAW SECURITY OR ITS AFFILIATES, LICENSORS, OR SERVICE
|
|
183
|
+
PROVIDERS BE LIABLE FOR ANY:
|
|
184
|
+
|
|
185
|
+
(a) INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, PUNITIVE, OR EXEMPLARY
|
|
186
|
+
DAMAGES;
|
|
187
|
+
|
|
188
|
+
(b) LOSS OF PROFITS, REVENUE, BUSINESS, SAVINGS, OR GOODWILL;
|
|
189
|
+
|
|
190
|
+
(c) LOSS OF DATA OR DATA BREACH;
|
|
191
|
+
|
|
192
|
+
(d) COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
193
|
+
|
|
194
|
+
(e) BUSINESS INTERRUPTION OR LOSS OF USE;
|
|
195
|
+
|
|
196
|
+
ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT OR THE USE OR
|
|
197
|
+
INABILITY TO USE THE SOFTWARE, REGARDLESS OF THE THEORY OF LIABILITY
|
|
198
|
+
(CONTRACT, TORT, STRICT LIABILITY, OR OTHERWISE), EVEN IF MACAW SECURITY
|
|
199
|
+
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
200
|
+
|
|
201
|
+
7.2 CAP ON LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
|
|
202
|
+
MACAW SECURITY'S TOTAL CUMULATIVE LIABILITY ARISING OUT OF OR RELATED
|
|
203
|
+
TO THIS AGREEMENT SHALL NOT EXCEED THE GREATER OF: (A) THE AMOUNTS
|
|
204
|
+
PAID BY YOU TO MACAW SECURITY FOR THE SOFTWARE DURING THE TWELVE (12)
|
|
205
|
+
MONTHS PRECEDING THE CLAIM; OR (B) ONE HUNDRED U.S. DOLLARS ($100).
|
|
206
|
+
|
|
207
|
+
7.3 ESSENTIAL PURPOSE. THE LIMITATIONS IN THIS SECTION 7 SHALL APPLY
|
|
208
|
+
NOTWITHSTANDING ANY FAILURE OF THE ESSENTIAL PURPOSE OF ANY LIMITED
|
|
209
|
+
REMEDY AND TO THE FULLEST EXTENT PERMITTED BY LAW.
|
|
210
|
+
|
|
211
|
+
================================================================================
|
|
212
|
+
8. INDEMNIFICATION
|
|
213
|
+
================================================================================
|
|
214
|
+
|
|
215
|
+
8.1 Your Indemnification. You agree to indemnify, defend, and hold harmless
|
|
216
|
+
MACAW Security and its officers, directors, employees, agents, affiliates,
|
|
217
|
+
and licensors from and against any and all claims, damages, losses,
|
|
218
|
+
liabilities, costs, and expenses (including reasonable attorneys' fees)
|
|
219
|
+
arising out of or relating to:
|
|
220
|
+
|
|
221
|
+
(a) Your use of the Software in violation of this Agreement;
|
|
222
|
+
(b) Your violation of any applicable law or regulation;
|
|
223
|
+
(c) Your violation of any third-party rights; or
|
|
224
|
+
(d) Any data or content You process using the Software.
|
|
225
|
+
|
|
226
|
+
================================================================================
|
|
227
|
+
9. TERM AND TERMINATION
|
|
228
|
+
================================================================================
|
|
229
|
+
|
|
230
|
+
9.1 Term. This Agreement is effective until terminated.
|
|
231
|
+
|
|
232
|
+
9.2 Termination by You. You may terminate this Agreement at any time by
|
|
233
|
+
ceasing all use of the Software and destroying all copies in Your
|
|
234
|
+
possession or control.
|
|
235
|
+
|
|
236
|
+
9.3 Termination by MACAW Security. MACAW Security may terminate this
|
|
237
|
+
Agreement immediately upon written notice if:
|
|
238
|
+
|
|
239
|
+
(a) You breach any provision of this Agreement;
|
|
240
|
+
(b) You become subject to bankruptcy, insolvency, or similar proceedings;
|
|
241
|
+
(c) MACAW Security discontinues the Software; or
|
|
242
|
+
(d) Required by law or regulatory authority.
|
|
243
|
+
|
|
244
|
+
9.4 Effect of Termination. Upon termination:
|
|
245
|
+
|
|
246
|
+
(a) All licenses granted hereunder shall immediately terminate;
|
|
247
|
+
(b) You shall cease all use of the Software;
|
|
248
|
+
(c) You shall destroy all copies of the Software in Your possession; and
|
|
249
|
+
(d) Sections 1, 3, 4, 5, 6, 7, 8, 10, and 11 shall survive termination.
|
|
250
|
+
|
|
251
|
+
================================================================================
|
|
252
|
+
10. GOVERNING LAW AND DISPUTE RESOLUTION
|
|
253
|
+
================================================================================
|
|
254
|
+
|
|
255
|
+
10.1 Governing Law. This Agreement shall be governed by and construed in
|
|
256
|
+
accordance with the laws of the State of California, United States,
|
|
257
|
+
without regard to its conflict of laws principles.
|
|
258
|
+
|
|
259
|
+
10.2 Jurisdiction. Any legal action or proceeding arising out of or relating
|
|
260
|
+
to this Agreement shall be brought exclusively in the state or federal
|
|
261
|
+
courts located in San Francisco County, California, and You hereby
|
|
262
|
+
consent to the personal jurisdiction and venue of such courts.
|
|
263
|
+
|
|
264
|
+
10.3 Arbitration. At MACAW Security's sole discretion, any dispute arising
|
|
265
|
+
out of or relating to this Agreement may be resolved by binding
|
|
266
|
+
arbitration administered by JAMS in San Francisco, California, in
|
|
267
|
+
accordance with its Comprehensive Arbitration Rules. The arbitrator's
|
|
268
|
+
decision shall be final and binding, and judgment may be entered in
|
|
269
|
+
any court of competent jurisdiction.
|
|
270
|
+
|
|
271
|
+
10.4 Class Action Waiver. YOU AND MACAW SECURITY AGREE THAT EACH MAY BRING
|
|
272
|
+
CLAIMS AGAINST THE OTHER ONLY IN YOUR OR ITS INDIVIDUAL CAPACITY AND
|
|
273
|
+
NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY PURPORTED CLASS OR
|
|
274
|
+
REPRESENTATIVE PROCEEDING.
|
|
275
|
+
|
|
276
|
+
10.5 Injunctive Relief. Notwithstanding the foregoing, MACAW Security may
|
|
277
|
+
seek injunctive or other equitable relief in any court of competent
|
|
278
|
+
jurisdiction to protect its intellectual property rights.
|
|
279
|
+
|
|
280
|
+
================================================================================
|
|
281
|
+
11. GENERAL PROVISIONS
|
|
282
|
+
================================================================================
|
|
283
|
+
|
|
284
|
+
11.1 Entire Agreement. This Agreement constitutes the entire agreement
|
|
285
|
+
between You and MACAW Security regarding the Software and supersedes
|
|
286
|
+
all prior agreements, understandings, and communications.
|
|
287
|
+
|
|
288
|
+
11.2 Amendment. MACAW Security may modify this Agreement at any time by
|
|
289
|
+
posting a revised version on its website. Your continued use of the
|
|
290
|
+
Software after such modification constitutes acceptance of the
|
|
291
|
+
modified terms.
|
|
292
|
+
|
|
293
|
+
11.3 Waiver. No failure or delay by MACAW Security in exercising any right
|
|
294
|
+
under this Agreement shall constitute a waiver of that right.
|
|
295
|
+
|
|
296
|
+
11.4 Severability. If any provision of this Agreement is held invalid or
|
|
297
|
+
unenforceable, the remaining provisions shall continue in full force
|
|
298
|
+
and effect, and the invalid provision shall be modified to the minimum
|
|
299
|
+
extent necessary to make it valid and enforceable.
|
|
300
|
+
|
|
301
|
+
11.5 Assignment. You may not assign or transfer this Agreement or any rights
|
|
302
|
+
hereunder without MACAW Security's prior written consent. MACAW Security
|
|
303
|
+
may assign this Agreement without restriction.
|
|
304
|
+
|
|
305
|
+
11.6 Notices. All notices under this Agreement shall be in writing and
|
|
306
|
+
deemed given when delivered by email or certified mail. Notices to
|
|
307
|
+
MACAW Security should be sent to:
|
|
308
|
+
|
|
309
|
+
MACAW Security, Inc.
|
|
310
|
+
Email: support@macawsecurity.com
|
|
311
|
+
|
|
312
|
+
11.7 Force Majeure. Neither party shall be liable for any failure or delay
|
|
313
|
+
in performance due to causes beyond its reasonable control, including
|
|
314
|
+
acts of God, natural disasters, war, terrorism, riots, embargoes,
|
|
315
|
+
acts of civil or military authorities, fire, floods, accidents,
|
|
316
|
+
strikes, or shortages of transportation, facilities, fuel, energy,
|
|
317
|
+
labor, or materials.
|
|
318
|
+
|
|
319
|
+
11.8 U.S. Government Rights. If You are a U.S. Government end user, the
|
|
320
|
+
Software is a "commercial item" as defined in 48 C.F.R. 2.101,
|
|
321
|
+
consisting of "commercial computer software" and "commercial computer
|
|
322
|
+
software documentation," as such terms are used in 48 C.F.R. 12.212.
|
|
323
|
+
The Software is licensed to U.S. Government end users only as a
|
|
324
|
+
commercial item and with only those rights as are granted to all
|
|
325
|
+
other end users pursuant to this Agreement.
|
|
326
|
+
|
|
327
|
+
================================================================================
|
|
328
|
+
12. CONTACT INFORMATION
|
|
329
|
+
================================================================================
|
|
330
|
+
|
|
331
|
+
For questions, support, or to obtain a commercial license, please contact:
|
|
332
|
+
|
|
333
|
+
MACAW Security, Inc.
|
|
334
|
+
Email: support@macawsecurity.com
|
|
335
|
+
Website: https://www.macawsecurity.ai
|
|
336
|
+
|
|
337
|
+
================================================================================
|
|
338
|
+
|
|
339
|
+
Copyright (c) 2025 MACAW Security, Inc. All rights reserved.
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Set up MACAW for a Python project: pick an interpreter we have a wheel for,
|
|
3
|
+
// install the client and the adapters into it, get a key, and leave the
|
|
4
|
+
// examples somewhere the user can run them.
|
|
5
|
+
//
|
|
6
|
+
// Everything lands in one directory the user chooses, config included, so a
|
|
7
|
+
// second install elsewhere is a second workspace rather than a collision.
|
|
8
|
+
// That is also why MACAW_HOME is mentioned at the end: the client searches
|
|
9
|
+
// $MACAW_HOME, then the current directory, then home - so from inside the
|
|
10
|
+
// install directory it already works, and the variable is only for running
|
|
11
|
+
// from somewhere else.
|
|
12
|
+
|
|
13
|
+
import { spawnSync } from "node:child_process";
|
|
14
|
+
import { createInterface } from "node:readline/promises";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
import fs from "node:fs";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
import os from "node:os";
|
|
19
|
+
|
|
20
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
const PKG = path.join(HERE, "..");
|
|
22
|
+
const API = process.env.MACAW_API_URL || "https://api.macawsecurity.ai";
|
|
23
|
+
|
|
24
|
+
const C = process.stdout.isTTY
|
|
25
|
+
? { dim: "\x1b[2m", b: "\x1b[1m", g: "\x1b[32m", y: "\x1b[33m", r: "\x1b[31m", c: "\x1b[36m", x: "\x1b[0m" }
|
|
26
|
+
: { dim: "", b: "", g: "", y: "", r: "", c: "", x: "" };
|
|
27
|
+
|
|
28
|
+
const ok = (s) => console.log(` ${C.g}✓${C.x} ${s}`);
|
|
29
|
+
const no = (s) => console.log(` ${C.r}✗${C.x} ${s}`);
|
|
30
|
+
const info = (s) => console.log(` ${C.c}→${C.x} ${s}`);
|
|
31
|
+
|
|
32
|
+
// ---------------------------------------------------------------- wheels ---
|
|
33
|
+
|
|
34
|
+
// The matrix is whatever shipped in this package, so the installer never
|
|
35
|
+
// offers a Python we stopped building or misses one we added.
|
|
36
|
+
function bundledWheels() {
|
|
37
|
+
const dir = path.join(PKG, "wheels");
|
|
38
|
+
if (!fs.existsSync(dir)) return [];
|
|
39
|
+
return fs.readdirSync(dir)
|
|
40
|
+
.filter((f) => f.startsWith("macaw_client-") && f.endsWith(".whl"))
|
|
41
|
+
.map((f) => {
|
|
42
|
+
const m = f.match(/-(cp\d+)-\1-(.+)\.whl$/);
|
|
43
|
+
return m ? { file: path.join(dir, f), tag: m[1], platform: m[2] } : null;
|
|
44
|
+
})
|
|
45
|
+
.filter(Boolean);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function platformTag() {
|
|
49
|
+
if (process.platform === "darwin") return process.arch === "arm64" ? "macosx_11_0_arm64" : "macosx_10_9_x86_64";
|
|
50
|
+
if (process.platform === "linux") return "manylinux_2_17_x86_64";
|
|
51
|
+
if (process.platform === "win32") return "win_amd64";
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// cp314 -> "3.14", for both display and the interpreter name we look for.
|
|
56
|
+
const version = (tag) => `${tag.slice(2, 3)}.${tag.slice(3)}`;
|
|
57
|
+
|
|
58
|
+
// Newest first. Not parseFloat: that reads 3.9 as larger than 3.14 and would
|
|
59
|
+
// hand a machine with both the older interpreter.
|
|
60
|
+
const byVersionDesc = (a, b) => {
|
|
61
|
+
const [am, an] = a.split(".").map(Number);
|
|
62
|
+
const [bm, bn] = b.split(".").map(Number);
|
|
63
|
+
return bm - am || bn - an;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// ---------------------------------------------------------------- python ---
|
|
67
|
+
|
|
68
|
+
function pythonVersionOf(exe) {
|
|
69
|
+
const r = spawnSync(exe, ["-c", "import sys;print('%d.%d' % sys.version_info[:2])"],
|
|
70
|
+
{ encoding: "utf8" });
|
|
71
|
+
return r.status === 0 ? r.stdout.trim() : null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Newest first, so a machine with several gets the one we would rather it use.
|
|
75
|
+
function findPython(wheels) {
|
|
76
|
+
const wanted = [...new Set(wheels.map((w) => version(w.tag)))].sort(byVersionDesc);
|
|
77
|
+
|
|
78
|
+
for (const v of wanted) {
|
|
79
|
+
for (const exe of [`python${v}`, `python3.${v.split(".")[1]}`]) {
|
|
80
|
+
if (pythonVersionOf(exe) === v) return { exe, version: v };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Whatever `python3` is may still be one we ship for.
|
|
84
|
+
const v = pythonVersionOf("python3");
|
|
85
|
+
if (v && wanted.includes(v)) return { exe: "python3", version: v };
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// --------------------------------------------------------------- the pip ---
|
|
90
|
+
|
|
91
|
+
// This is a client to a service the whole machine talks to, so it should be
|
|
92
|
+
// importable from anywhere, not pinned inside one project. No venv is created:
|
|
93
|
+
// one the user did not ask for is worse than none, and it would put the library
|
|
94
|
+
// where their own code cannot see it.
|
|
95
|
+
//
|
|
96
|
+
// Homebrew and Debian mark their interpreters externally managed and refuse a
|
|
97
|
+
// plain install. Their own message says what to do - --break-system-packages,
|
|
98
|
+
// and "STRONGLY recommend that you additionally pass --user". The pair is the
|
|
99
|
+
// point: --user writes to ~/.local and never into the managed prefix, which is
|
|
100
|
+
// the thing the error exists to protect.
|
|
101
|
+
function pipInstall(python, files) {
|
|
102
|
+
const base = ["-m", "pip", "install", "--disable-pip-version-check", "-q"];
|
|
103
|
+
const run = (args) =>
|
|
104
|
+
spawnSync(python, [...base, ...args, ...files], { stdio: ["ignore", "pipe", "pipe"], encoding: "utf8" });
|
|
105
|
+
|
|
106
|
+
const inVenv = spawnSync(python, ["-c", "import sys;print(sys.prefix!=sys.base_prefix)"],
|
|
107
|
+
{ encoding: "utf8" }).stdout?.trim() === "True";
|
|
108
|
+
|
|
109
|
+
let r = run(inVenv ? [] : ["--user"]);
|
|
110
|
+
if (r.status === 0) return { ok: true, where: inVenv ? "the active virtualenv" : "~/.local" };
|
|
111
|
+
|
|
112
|
+
if (/externally-managed-environment/i.test(r.stderr || "")) {
|
|
113
|
+
info("this Python is externally managed - installing to ~/.local, which leaves it untouched");
|
|
114
|
+
r = run(["--user", "--break-system-packages"]);
|
|
115
|
+
if (r.status === 0) return { ok: true, where: "~/.local" };
|
|
116
|
+
}
|
|
117
|
+
return { ok: false, err: (r.stderr || r.stdout || "").trim() };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ------------------------------------------------------------ activation ---
|
|
121
|
+
|
|
122
|
+
async function activate() {
|
|
123
|
+
const start = await fetch(`${API}/api/device/code`, {
|
|
124
|
+
method: "POST",
|
|
125
|
+
headers: { "Content-Type": "application/json" },
|
|
126
|
+
// 'default' is the regular console. secCC sends 'seccc' and gets its own
|
|
127
|
+
// view; a Python SDK install has no business landing there.
|
|
128
|
+
body: JSON.stringify({ device_name: `${os.hostname()} (client)`, platform: "default" }),
|
|
129
|
+
}).then((r) => r.json()).catch(() => null);
|
|
130
|
+
|
|
131
|
+
if (!start?.device_code) {
|
|
132
|
+
no(`Could not reach ${API}`);
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// One clickable link, whatever the plane returned. A control plane older
|
|
137
|
+
// than verification_uri_complete still gives us both halves, so compose it
|
|
138
|
+
// rather than falling back to "here is a URL, now type this code".
|
|
139
|
+
const url = start.verification_uri_complete
|
|
140
|
+
|| (start.verification_uri && start.user_code
|
|
141
|
+
&& `${start.verification_uri}?user_code=${encodeURIComponent(start.user_code)}`)
|
|
142
|
+
|| start.verification_uri;
|
|
143
|
+
console.log("");
|
|
144
|
+
console.log(` Approve here: ${C.c}${url}${C.x}`);
|
|
145
|
+
// The code is in the link. Worth printing separately only when it is not -
|
|
146
|
+
// an older control plane, or someone reading it off another machine.
|
|
147
|
+
if (!url.includes("user_code=")) console.log(` Code ${C.b}${start.user_code}${C.x}`);
|
|
148
|
+
console.log("");
|
|
149
|
+
console.log(" Waiting for approval...");
|
|
150
|
+
|
|
151
|
+
const deadline = Date.now() + (start.expires_in ?? 600) * 1000;
|
|
152
|
+
const every = (start.interval ?? 5) * 1000;
|
|
153
|
+
while (Date.now() < deadline) {
|
|
154
|
+
await new Promise((r) => setTimeout(r, every));
|
|
155
|
+
const poll = await fetch(`${API}/api/device/poll?device_code=${encodeURIComponent(start.device_code)}`)
|
|
156
|
+
.then((r) => r.json()).catch(() => null);
|
|
157
|
+
if (poll?.status === "complete") return { key: poll.api_key, workspace: poll.workspace };
|
|
158
|
+
if (poll?.status === "expired") { no("That code expired. Run this again."); return null; }
|
|
159
|
+
}
|
|
160
|
+
no("Timed out waiting for approval");
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// ------------------------------------------------------------------ main ---
|
|
165
|
+
|
|
166
|
+
async function main() {
|
|
167
|
+
console.log("");
|
|
168
|
+
console.log(`${C.b} MACAW${C.x}`);
|
|
169
|
+
console.log("");
|
|
170
|
+
|
|
171
|
+
const wheels = bundledWheels();
|
|
172
|
+
const plat = platformTag();
|
|
173
|
+
const usable = wheels.filter((w) => w.platform === plat);
|
|
174
|
+
|
|
175
|
+
if (!usable.length) {
|
|
176
|
+
no(`No build for ${process.platform}/${process.arch}.`);
|
|
177
|
+
info("Builds we ship:");
|
|
178
|
+
for (const w of wheels) console.log(` Python ${version(w.tag)} ${w.platform}`);
|
|
179
|
+
process.exit(1);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// --check answers "would this work here, and with what" and changes nothing.
|
|
183
|
+
// Useful before installing, and the first thing to ask when it did not work.
|
|
184
|
+
if (process.argv.includes("--check")) {
|
|
185
|
+
const py = findPython(usable);
|
|
186
|
+
console.log(` platform ${process.platform}/${process.arch} → ${plat}`);
|
|
187
|
+
const shipped = [...new Set(usable.map((w) => version(w.tag)))].sort(byVersionDesc);
|
|
188
|
+
console.log(` we ship ${shipped.map((v) => "Python " + v).join(", ")}`);
|
|
189
|
+
console.log(py ? ` found ${py.exe} (${py.version})` : ` found nothing we have a build for`);
|
|
190
|
+
console.log(` endpoint ${API}`);
|
|
191
|
+
process.exit(py ? 0 : 1);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
195
|
+
const ask = async (q, dflt) => {
|
|
196
|
+
if (!process.stdin.isTTY) return dflt; // nobody to answer
|
|
197
|
+
const a = (await rl.question(q)).trim();
|
|
198
|
+
return a === "" ? dflt : a;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// 1 — where
|
|
202
|
+
const chosen = await ask(` Where should MACAW go? ${C.dim}[./macaw]${C.x} `, "./macaw");
|
|
203
|
+
const dir = path.resolve(chosen.replace(/^~(?=$|\/)/, os.homedir()));
|
|
204
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
205
|
+
ok(dir);
|
|
206
|
+
|
|
207
|
+
// 2 — python
|
|
208
|
+
const py = findPython(usable);
|
|
209
|
+
if (!py) {
|
|
210
|
+
no("No Python here that we have a build for.");
|
|
211
|
+
info(`On ${plat} we ship: ${[...new Set(usable.map((w) => version(w.tag)))].sort(byVersionDesc).join(", ")}`);
|
|
212
|
+
rl.close();
|
|
213
|
+
process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
ok(`Python ${py.version}`);
|
|
216
|
+
const newest = usable.map((w) => version(w.tag)).sort(byVersionDesc)[0];
|
|
217
|
+
if (py.version !== newest) {
|
|
218
|
+
console.log(` ${C.y}⚠${C.x} We are moving to Python ${newest}.`);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// 3 — a key, or a workspace
|
|
222
|
+
console.log("");
|
|
223
|
+
let key = await ask(` API Key ${C.dim}[Enter creates a new workspace]${C.x} `, "");
|
|
224
|
+
let workspace = "";
|
|
225
|
+
if (key === "") {
|
|
226
|
+
const got = await activate();
|
|
227
|
+
if (!got) { rl.close(); process.exit(1); }
|
|
228
|
+
key = got.key;
|
|
229
|
+
workspace = got.workspace || "";
|
|
230
|
+
ok(`Activated in workspace ${workspace}`);
|
|
231
|
+
} else if (!key.startsWith("mw_")) {
|
|
232
|
+
no("An API key starts with 'mw_'");
|
|
233
|
+
rl.close();
|
|
234
|
+
process.exit(1);
|
|
235
|
+
}
|
|
236
|
+
rl.close();
|
|
237
|
+
|
|
238
|
+
// 4 — install
|
|
239
|
+
console.log("");
|
|
240
|
+
const wheel = usable.find((w) => version(w.tag) === py.version);
|
|
241
|
+
const adapters = fs.existsSync(path.join(PKG, "wheels"))
|
|
242
|
+
? fs.readdirSync(path.join(PKG, "wheels")).filter((f) => f.startsWith("macaw_adapters-"))
|
|
243
|
+
.map((f) => path.join(PKG, "wheels", f))
|
|
244
|
+
: [];
|
|
245
|
+
const r = pipInstall(py.exe, [wheel.file, ...adapters]);
|
|
246
|
+
if (!r.ok) { no("pip install failed"); console.log(r.err); process.exit(1); }
|
|
247
|
+
ok(`macaw-client and macaw-adapters installed into ${r.where}`);
|
|
248
|
+
|
|
249
|
+
// 5 — the tree, and the config beside it
|
|
250
|
+
// Whatever build.sh assembled, verbatim. A list here would be a second
|
|
251
|
+
// place to keep in step, and it already fell out of step once.
|
|
252
|
+
const payload = path.join(PKG, "payload");
|
|
253
|
+
if (fs.existsSync(payload)) fs.cpSync(payload, dir, { recursive: true });
|
|
254
|
+
const cfgDir = path.join(dir, ".macaw");
|
|
255
|
+
fs.mkdirSync(cfgDir, { recursive: true, mode: 0o700 });
|
|
256
|
+
fs.writeFileSync(path.join(cfgDir, "config.json"), JSON.stringify({
|
|
257
|
+
transport: "http",
|
|
258
|
+
http_enabled: true,
|
|
259
|
+
macaw_endpoint: `${API}/rpc`,
|
|
260
|
+
api_key: key,
|
|
261
|
+
workspace,
|
|
262
|
+
multi_tenancy_enabled: true,
|
|
263
|
+
}, null, 2) + "\n", { mode: 0o600 });
|
|
264
|
+
ok("examples, demos and config written");
|
|
265
|
+
|
|
266
|
+
// 6 — what to do with it
|
|
267
|
+
console.log("");
|
|
268
|
+
console.log(`${C.b} Check it${C.x}`);
|
|
269
|
+
console.log(` cd ${dir}`);
|
|
270
|
+
console.log(` ${py.exe} secureAI/test_harness_quick.py`);
|
|
271
|
+
console.log("");
|
|
272
|
+
console.log(` ${C.dim}To use MACAW from other directories, point MACAW_HOME at${C.x}`);
|
|
273
|
+
console.log(` ${C.dim}this directory in your shell:${C.x}`);
|
|
274
|
+
console.log(` MACAW_HOME=${dir}`);
|
|
275
|
+
console.log("");
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
main().catch((e) => { no(e.message); process.exit(1); });
|
package/package.json
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@macaw-ai/client",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.9.10",
|
|
4
|
+
"description": "Set up the MACAW client for a Python project: installs the SDK and adapters, creates a workspace, leaves the examples ready to run.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"macaw-client-install": "bin/install.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/install.js",
|
|
11
|
+
"wheels",
|
|
12
|
+
"payload",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
|
+
"homepage": "https://macawsecurity.ai",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/mohanua/macaw-client-distro.git"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"macaw",
|
|
27
|
+
"agent",
|
|
28
|
+
"policy",
|
|
29
|
+
"security",
|
|
30
|
+
"governance",
|
|
31
|
+
"openai",
|
|
32
|
+
"anthropic",
|
|
33
|
+
"langchain",
|
|
34
|
+
"mcp"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
}
|
|
39
|
+
}
|