intentgate 0.1.0__py3-none-any.whl
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.
- intentgate/__init__.py +46 -0
- intentgate/client.py +257 -0
- intentgate/exceptions.py +119 -0
- intentgate-0.1.0.dist-info/METADATA +228 -0
- intentgate-0.1.0.dist-info/RECORD +7 -0
- intentgate-0.1.0.dist-info/WHEEL +4 -0
- intentgate-0.1.0.dist-info/licenses/LICENSE +201 -0
intentgate/__init__.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Python SDK for the IntentGate authorization gateway.
|
|
2
|
+
|
|
3
|
+
The intent of this package is the "three lines of agent code" promise
|
|
4
|
+
from the IntentGate pitch:
|
|
5
|
+
|
|
6
|
+
from intentgate import Gateway
|
|
7
|
+
gw = Gateway(url="http://localhost:8080", token=os.environ["INTENTGATE_TOKEN"])
|
|
8
|
+
result = gw.tool_call("read_invoice", arguments={"id": "123"},
|
|
9
|
+
intent_prompt="Process today's AP invoices")
|
|
10
|
+
|
|
11
|
+
`tool_call` raises a typed exception when the gateway blocks; the
|
|
12
|
+
exception carries which check fired and why. See `exceptions` for the
|
|
13
|
+
full hierarchy.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from intentgate.client import (
|
|
17
|
+
ContentBlock,
|
|
18
|
+
Gateway,
|
|
19
|
+
IntentGateMetadata,
|
|
20
|
+
ToolCallResult,
|
|
21
|
+
)
|
|
22
|
+
from intentgate.exceptions import (
|
|
23
|
+
BudgetError,
|
|
24
|
+
CapabilityError,
|
|
25
|
+
GatewayError,
|
|
26
|
+
IntentError,
|
|
27
|
+
IntentGateError,
|
|
28
|
+
PolicyError,
|
|
29
|
+
ProtocolError,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
__all__ = [
|
|
33
|
+
"Gateway",
|
|
34
|
+
"ToolCallResult",
|
|
35
|
+
"ContentBlock",
|
|
36
|
+
"IntentGateMetadata",
|
|
37
|
+
"IntentGateError",
|
|
38
|
+
"GatewayError",
|
|
39
|
+
"ProtocolError",
|
|
40
|
+
"CapabilityError",
|
|
41
|
+
"IntentError",
|
|
42
|
+
"PolicyError",
|
|
43
|
+
"BudgetError",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
__version__ = "0.1.0"
|
intentgate/client.py
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"""HTTP client for the IntentGate gateway.
|
|
2
|
+
|
|
3
|
+
The :class:`Gateway` wraps the JSON-RPC envelope, the Authorization
|
|
4
|
+
header, and the X-Intent-Prompt header so callers can invoke
|
|
5
|
+
``gw.tool_call(...)`` like any other method and have errors materialize
|
|
6
|
+
as typed Python exceptions.
|
|
7
|
+
|
|
8
|
+
Sync only in v0.1. An async variant (anyio / httpx.AsyncClient) is
|
|
9
|
+
straightforward to add behind the same Gateway facade if a customer
|
|
10
|
+
asks; not on the v0.1 critical path.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import itertools
|
|
16
|
+
from collections.abc import Iterator
|
|
17
|
+
from dataclasses import dataclass, field
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
import httpx
|
|
21
|
+
|
|
22
|
+
from intentgate import exceptions
|
|
23
|
+
|
|
24
|
+
# JSON-RPC method we currently use. The MCP spec defines others
|
|
25
|
+
# (tools/list, initialize, ping); the gateway proxies those in a later
|
|
26
|
+
# session and the SDK will gain helpers for them then.
|
|
27
|
+
_TOOLS_CALL_METHOD = "tools/call"
|
|
28
|
+
|
|
29
|
+
# Default timeout for a single tool-call. Most policy decisions are
|
|
30
|
+
# millisecond-scale; LLM-backed intent extraction can push to a few
|
|
31
|
+
# hundred milliseconds. 10s is forgiving for cold starts and slow CI.
|
|
32
|
+
_DEFAULT_TIMEOUT_S = 10.0
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass(frozen=True)
|
|
36
|
+
class ContentBlock:
|
|
37
|
+
"""One piece of the tool's response, in MCP shape.
|
|
38
|
+
|
|
39
|
+
v0.1 only emits ``type="text"`` blocks; future tool servers may
|
|
40
|
+
return ``image``, ``resource``, etc.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
type: str
|
|
44
|
+
text: str = ""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@dataclass(frozen=True)
|
|
48
|
+
class IntentGateMetadata:
|
|
49
|
+
"""The gateway's per-call decision summary.
|
|
50
|
+
|
|
51
|
+
Pulled from the ``_intentgate`` vendor extension on the JSON-RPC
|
|
52
|
+
result. Always present on a successful tool_call, since the gateway
|
|
53
|
+
populates it for every allowed call.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
decision: str
|
|
57
|
+
reason: str = ""
|
|
58
|
+
check: str = ""
|
|
59
|
+
latency_ms: int = 0
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@dataclass(frozen=True)
|
|
63
|
+
class ToolCallResult:
|
|
64
|
+
"""Successful tool-call response.
|
|
65
|
+
|
|
66
|
+
``content`` is the upstream tool's output; ``is_error`` reflects
|
|
67
|
+
the MCP-level ``isError`` flag (a tool indicating its own failure
|
|
68
|
+
versus the gateway transport-level errors that raise exceptions);
|
|
69
|
+
``intentgate`` is the gateway's decision metadata.
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
content: list[ContentBlock] = field(default_factory=list)
|
|
73
|
+
is_error: bool = False
|
|
74
|
+
intentgate: IntentGateMetadata | None = None
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class Gateway:
|
|
78
|
+
"""Thin client for the IntentGate gateway.
|
|
79
|
+
|
|
80
|
+
Example::
|
|
81
|
+
|
|
82
|
+
from intentgate import Gateway
|
|
83
|
+
gw = Gateway(url="http://localhost:8080", token=os.environ["INTENTGATE_TOKEN"])
|
|
84
|
+
result = gw.tool_call(
|
|
85
|
+
"read_invoice",
|
|
86
|
+
arguments={"id": "123"},
|
|
87
|
+
intent_prompt="Process today's AP invoices",
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
The constructor binds the gateway URL and an optional capability
|
|
91
|
+
token; supply both once and the client uses them for every call.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
url: Base URL of the gateway, e.g. ``http://localhost:8080``.
|
|
95
|
+
Trailing slash is tolerated.
|
|
96
|
+
token: Capability token from ``igctl mint`` (or your tenant's
|
|
97
|
+
mint service). When ``None``, no Authorization header is
|
|
98
|
+
sent; the gateway will reject with CapabilityError if it's
|
|
99
|
+
in strict mode.
|
|
100
|
+
timeout: Per-request timeout in seconds.
|
|
101
|
+
client: Optional pre-configured httpx.Client. Useful for
|
|
102
|
+
test injection, custom transports, or shared connection
|
|
103
|
+
pooling. When supplied, the SDK does NOT close it in
|
|
104
|
+
``close``; the caller owns its lifecycle.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
def __init__(
|
|
108
|
+
self,
|
|
109
|
+
url: str,
|
|
110
|
+
token: str | None = None,
|
|
111
|
+
*,
|
|
112
|
+
timeout: float = _DEFAULT_TIMEOUT_S,
|
|
113
|
+
client: httpx.Client | None = None,
|
|
114
|
+
) -> None:
|
|
115
|
+
self._url = url.rstrip("/")
|
|
116
|
+
self._token = token
|
|
117
|
+
self._owns_client = client is None
|
|
118
|
+
self._client = client or httpx.Client(timeout=timeout)
|
|
119
|
+
self._ids: Iterator[int] = itertools.count(1)
|
|
120
|
+
|
|
121
|
+
# --- public API ---------------------------------------------------
|
|
122
|
+
|
|
123
|
+
def tool_call(
|
|
124
|
+
self,
|
|
125
|
+
tool: str,
|
|
126
|
+
arguments: dict[str, Any] | None = None,
|
|
127
|
+
*,
|
|
128
|
+
intent_prompt: str | None = None,
|
|
129
|
+
request_id: int | str | None = None,
|
|
130
|
+
) -> ToolCallResult:
|
|
131
|
+
"""Invoke a tool through the gateway.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
tool: Tool name (e.g. ``"read_invoice"``). Required.
|
|
135
|
+
arguments: Arguments to pass through to the tool. The
|
|
136
|
+
gateway logs only the keys, never the values.
|
|
137
|
+
intent_prompt: The user's original prompt. Sent in the
|
|
138
|
+
``X-Intent-Prompt`` header; the gateway feeds it to the
|
|
139
|
+
intent extractor and verifies the requested tool is
|
|
140
|
+
consistent with the extracted intent. Optional, but
|
|
141
|
+
strongly recommended in production — without it the
|
|
142
|
+
intent check is skipped (or denies in strict mode).
|
|
143
|
+
request_id: JSON-RPC ``id`` for the request. When ``None``,
|
|
144
|
+
a sequential per-Gateway counter is used.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
:class:`ToolCallResult` for an allowed call.
|
|
148
|
+
|
|
149
|
+
Raises:
|
|
150
|
+
CapabilityError: capability stage denied (-32010).
|
|
151
|
+
IntentError: intent stage denied (-32011).
|
|
152
|
+
PolicyError: policy stage denied (-32012).
|
|
153
|
+
BudgetError: budget stage denied (-32013).
|
|
154
|
+
ProtocolError: any other JSON-RPC error (parse, method not
|
|
155
|
+
found, invalid params, internal error).
|
|
156
|
+
GatewayError: network or HTTP transport error reaching
|
|
157
|
+
the gateway.
|
|
158
|
+
"""
|
|
159
|
+
if not tool:
|
|
160
|
+
raise ValueError("tool is required")
|
|
161
|
+
|
|
162
|
+
rid: int | str = request_id if request_id is not None else next(self._ids)
|
|
163
|
+
body = {
|
|
164
|
+
"jsonrpc": "2.0",
|
|
165
|
+
"id": rid,
|
|
166
|
+
"method": _TOOLS_CALL_METHOD,
|
|
167
|
+
"params": {
|
|
168
|
+
"name": tool,
|
|
169
|
+
"arguments": arguments or {},
|
|
170
|
+
},
|
|
171
|
+
}
|
|
172
|
+
headers = {"Content-Type": "application/json"}
|
|
173
|
+
if self._token:
|
|
174
|
+
headers["Authorization"] = f"Bearer {self._token}"
|
|
175
|
+
if intent_prompt:
|
|
176
|
+
headers["X-Intent-Prompt"] = intent_prompt
|
|
177
|
+
|
|
178
|
+
try:
|
|
179
|
+
resp = self._client.post(self._url + "/v1/mcp", json=body, headers=headers)
|
|
180
|
+
except httpx.HTTPError as e:
|
|
181
|
+
raise exceptions.GatewayError(f"transport error: {e!s}", code=0, data=None) from e
|
|
182
|
+
|
|
183
|
+
if resp.status_code // 100 != 2:
|
|
184
|
+
raise exceptions.GatewayError(
|
|
185
|
+
f"gateway returned HTTP {resp.status_code}",
|
|
186
|
+
code=0,
|
|
187
|
+
data=resp.text[:500] if resp.text else None,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
try:
|
|
191
|
+
payload = resp.json()
|
|
192
|
+
except ValueError as e:
|
|
193
|
+
raise exceptions.GatewayError(f"non-JSON response: {e!s}", code=0) from e
|
|
194
|
+
|
|
195
|
+
return _parse_response(payload)
|
|
196
|
+
|
|
197
|
+
# --- lifecycle ----------------------------------------------------
|
|
198
|
+
|
|
199
|
+
def close(self) -> None:
|
|
200
|
+
"""Close the underlying HTTP client.
|
|
201
|
+
|
|
202
|
+
Only meaningful when ``Gateway`` constructed its own client
|
|
203
|
+
(i.e. the caller didn't pass one in). When the caller supplied
|
|
204
|
+
an ``httpx.Client``, ``close`` is a no-op.
|
|
205
|
+
"""
|
|
206
|
+
if self._owns_client:
|
|
207
|
+
self._client.close()
|
|
208
|
+
|
|
209
|
+
def __enter__(self) -> Gateway:
|
|
210
|
+
return self
|
|
211
|
+
|
|
212
|
+
def __exit__(self, *_: object) -> None:
|
|
213
|
+
self.close()
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# --- response parsing -------------------------------------------------
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def _parse_response(payload: dict) -> ToolCallResult:
|
|
220
|
+
"""Translate a JSON-RPC response into a ToolCallResult or raise."""
|
|
221
|
+
if not isinstance(payload, dict):
|
|
222
|
+
raise exceptions.ProtocolError("response is not a JSON object", code=0)
|
|
223
|
+
|
|
224
|
+
if "error" in payload and payload["error"] is not None:
|
|
225
|
+
err = payload["error"]
|
|
226
|
+
code = int(err.get("code", 0))
|
|
227
|
+
message = str(err.get("message", "gateway error"))
|
|
228
|
+
data = err.get("data")
|
|
229
|
+
exc_cls = exceptions.for_code(code)
|
|
230
|
+
raise exc_cls(message, code=code, data=data)
|
|
231
|
+
|
|
232
|
+
result = payload.get("result")
|
|
233
|
+
if not isinstance(result, dict):
|
|
234
|
+
raise exceptions.ProtocolError("response missing 'result' object", code=0, data=payload)
|
|
235
|
+
|
|
236
|
+
raw_content = result.get("content") or []
|
|
237
|
+
content = [
|
|
238
|
+
ContentBlock(type=str(b.get("type", "")), text=str(b.get("text", "")))
|
|
239
|
+
for b in raw_content
|
|
240
|
+
if isinstance(b, dict)
|
|
241
|
+
]
|
|
242
|
+
|
|
243
|
+
ig: IntentGateMetadata | None = None
|
|
244
|
+
raw_ig = result.get("_intentgate")
|
|
245
|
+
if isinstance(raw_ig, dict):
|
|
246
|
+
ig = IntentGateMetadata(
|
|
247
|
+
decision=str(raw_ig.get("decision", "")),
|
|
248
|
+
reason=str(raw_ig.get("reason", "")),
|
|
249
|
+
check=str(raw_ig.get("check", "")),
|
|
250
|
+
latency_ms=int(raw_ig.get("latency_ms", 0)),
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
return ToolCallResult(
|
|
254
|
+
content=content,
|
|
255
|
+
is_error=bool(result.get("isError", False)),
|
|
256
|
+
intentgate=ig,
|
|
257
|
+
)
|
intentgate/exceptions.py
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"""Exception hierarchy for the IntentGate SDK.
|
|
2
|
+
|
|
3
|
+
Every gateway response that isn't a clean allow becomes an exception.
|
|
4
|
+
The hierarchy lets callers catch broadly (``except IntentGateError``) or
|
|
5
|
+
narrowly (``except CapabilityError``) depending on whether they want to
|
|
6
|
+
distinguish *which* check fired.
|
|
7
|
+
|
|
8
|
+
The four pipeline-stage exceptions correspond one-to-one with the
|
|
9
|
+
gateway's JSON-RPC error codes:
|
|
10
|
+
|
|
11
|
+
================== ================= =========
|
|
12
|
+
Exception JSON-RPC code Stage
|
|
13
|
+
================== ================= =========
|
|
14
|
+
CapabilityError -32010 capability
|
|
15
|
+
IntentError -32011 intent
|
|
16
|
+
PolicyError -32012 policy
|
|
17
|
+
BudgetError -32013 budget
|
|
18
|
+
================== ================= =========
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class IntentGateError(Exception):
|
|
25
|
+
"""Base class for every error this SDK raises.
|
|
26
|
+
|
|
27
|
+
Attributes:
|
|
28
|
+
code: JSON-RPC error code returned by the gateway, or 0 if the
|
|
29
|
+
error originated client-side (network, JSON parse, etc.).
|
|
30
|
+
message: Human-readable summary from the gateway's "message"
|
|
31
|
+
field. Stable across versions; safe to show in user-facing
|
|
32
|
+
UIs.
|
|
33
|
+
data: The optional "data" field — typically a one-line reason
|
|
34
|
+
string explaining which caveat or rule fired.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
code: int = 0
|
|
38
|
+
message: str = ""
|
|
39
|
+
data: object | None = None
|
|
40
|
+
|
|
41
|
+
def __init__(self, message: str, *, code: int = 0, data: object | None = None) -> None:
|
|
42
|
+
super().__init__(message)
|
|
43
|
+
self.code = code
|
|
44
|
+
self.message = message
|
|
45
|
+
self.data = data
|
|
46
|
+
|
|
47
|
+
def __str__(self) -> str: # pragma: no cover — trivial
|
|
48
|
+
if self.data:
|
|
49
|
+
return f"{self.message}: {self.data}"
|
|
50
|
+
return self.message
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class GatewayError(IntentGateError):
|
|
54
|
+
"""Network / transport error reaching the gateway, or an HTTP
|
|
55
|
+
response that isn't well-formed JSON-RPC.
|
|
56
|
+
|
|
57
|
+
Use this to distinguish "the gateway is unreachable" from "the
|
|
58
|
+
gateway said no" — the four stage-specific exceptions below mean
|
|
59
|
+
the gateway was reachable and chose to deny.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class ProtocolError(IntentGateError):
|
|
64
|
+
"""JSON-RPC error returned by the gateway that isn't one of the
|
|
65
|
+
four stage codes — typically -32600..-32603 from the spec
|
|
66
|
+
(parse error, invalid request, method not found, invalid params,
|
|
67
|
+
internal error).
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# --- Stage-specific errors ---------------------------------------------
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class CapabilityError(IntentGateError):
|
|
75
|
+
"""The capability check denied the call: token signature invalid,
|
|
76
|
+
expired, agent mismatch, tool not in caveat allow-list, etc.
|
|
77
|
+
JSON-RPC code -32010.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class IntentError(IntentGateError):
|
|
82
|
+
"""The intent check denied the call: the requested tool isn't in
|
|
83
|
+
the structured intent the extractor produced from the user prompt.
|
|
84
|
+
JSON-RPC code -32011.
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class PolicyError(IntentGateError):
|
|
89
|
+
"""The OPA policy denied the call. The reason carries the Rego
|
|
90
|
+
rule's explanation. JSON-RPC code -32012.
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class BudgetError(IntentGateError):
|
|
95
|
+
"""A max_calls caveat in the token has been exhausted. JSON-RPC
|
|
96
|
+
code -32013.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# --- Internal helper ---------------------------------------------------
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
_CODE_TO_EXC: dict[int, type[IntentGateError]] = {
|
|
104
|
+
-32010: CapabilityError,
|
|
105
|
+
-32011: IntentError,
|
|
106
|
+
-32012: PolicyError,
|
|
107
|
+
-32013: BudgetError,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def for_code(code: int) -> type[IntentGateError]:
|
|
112
|
+
"""Return the exception class that corresponds to a JSON-RPC code.
|
|
113
|
+
|
|
114
|
+
Stage codes (-32010 through -32013) map to their stage-specific
|
|
115
|
+
subclass. Everything else (parse error, method not found, internal
|
|
116
|
+
error, custom server errors not in the stage range) maps to
|
|
117
|
+
:class:`ProtocolError`.
|
|
118
|
+
"""
|
|
119
|
+
return _CODE_TO_EXC.get(code, ProtocolError)
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: intentgate
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for the IntentGate authorization gateway
|
|
5
|
+
Project-URL: Homepage, https://github.com/NetGnarus/intentgate-sdk-python
|
|
6
|
+
Project-URL: Documentation, https://github.com/NetGnarus/intentgate-sdk-python#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/NetGnarus/intentgate-sdk-python
|
|
8
|
+
Project-URL: Issues, https://github.com/NetGnarus/intentgate-sdk-python/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/NetGnarus/intentgate-sdk-python/releases
|
|
10
|
+
Author: IntentGate contributors
|
|
11
|
+
License: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: ai-agents,authorization,intentgate,mcp,security
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Security
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: httpx<1,>=0.27
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: respx>=0.21; extra == 'dev'
|
|
31
|
+
Requires-Dist: ruff<1,>=0.6; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# IntentGate Python SDK
|
|
35
|
+
|
|
36
|
+
[](https://github.com/NetGnarus/intentgate-sdk-python/actions/workflows/ci.yml)
|
|
37
|
+
[](https://pypi.org/project/intentgate/)
|
|
38
|
+
[](https://pypi.org/project/intentgate/)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
|
|
41
|
+
The official Python client for the
|
|
42
|
+
[IntentGate authorization gateway](https://github.com/NetGnarus/intentgate-gateway).
|
|
43
|
+
|
|
44
|
+
## Companion repositories
|
|
45
|
+
|
|
46
|
+
| Repo | Purpose |
|
|
47
|
+
| ---- | ------- |
|
|
48
|
+
| [intentgate-gateway](https://github.com/NetGnarus/intentgate-gateway) | Go gateway with the four-check pipeline. The thing this SDK talks to. |
|
|
49
|
+
| [intentgate-extractor](https://github.com/NetGnarus/intentgate-extractor) | Optional FastAPI service that turns user prompts into structured intent. |
|
|
50
|
+
| [intentgate-sdk-python](https://github.com/NetGnarus/intentgate-sdk-python) | Python SDK for agents (this repo). |
|
|
51
|
+
| [intentgate-helm](https://github.com/NetGnarus/intentgate-helm) | Helm chart that deploys the gateway, extractor, and Redis to Kubernetes. |
|
|
52
|
+
|
|
53
|
+
## What it is
|
|
54
|
+
|
|
55
|
+
A thin client that lets your AI agent call tools through the
|
|
56
|
+
IntentGate gateway with a Pythonic API. The SDK handles the JSON-RPC
|
|
57
|
+
envelope, the Bearer token, the `X-Intent-Prompt` header, and turns
|
|
58
|
+
gateway error responses into typed Python exceptions.
|
|
59
|
+
|
|
60
|
+
## Three lines of agent code
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from intentgate import Gateway
|
|
64
|
+
|
|
65
|
+
gw = Gateway(url="http://localhost:8080", token=os.environ["INTENTGATE_TOKEN"])
|
|
66
|
+
result = gw.tool_call(
|
|
67
|
+
"read_invoice",
|
|
68
|
+
arguments={"id": "123"},
|
|
69
|
+
intent_prompt="Process today's AP invoices",
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
That's it. Construct once, call as many times as you like. When the
|
|
74
|
+
gateway blocks the call, `tool_call` raises a typed exception you can
|
|
75
|
+
catch.
|
|
76
|
+
|
|
77
|
+
## Install
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
pip install intentgate
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Released versions are published to [PyPI](https://pypi.org/project/intentgate/)
|
|
84
|
+
on every `vX.Y.Z` git tag via signed OIDC trusted publishing — see
|
|
85
|
+
`.github/workflows/release.yml`.
|
|
86
|
+
|
|
87
|
+
To install the development tip:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
pip install git+https://github.com/NetGnarus/intentgate-sdk-python.git
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Exception hierarchy
|
|
94
|
+
|
|
95
|
+
Every blocked call raises an exception. The class tells you which
|
|
96
|
+
gateway check fired:
|
|
97
|
+
|
|
98
|
+
| Exception | JSON-RPC code | When |
|
|
99
|
+
| ------------------ | ------------- | --------------------------------------------------------------------------------- |
|
|
100
|
+
| `CapabilityError` | `-32010` | Token signature invalid, expired, agent mismatch, tool not in caveat allow-list. |
|
|
101
|
+
| `IntentError` | `-32011` | Tool isn't in the intent extracted from the user prompt. |
|
|
102
|
+
| `PolicyError` | `-32012` | OPA policy returned deny. The reason carries the Rego rule's explanation. |
|
|
103
|
+
| `BudgetError` | `-32013` | A `max_calls` caveat in the token has been exhausted. |
|
|
104
|
+
| `ProtocolError` | other JSON-RPC| Malformed request, method not found, etc. Usually means an SDK ↔ gateway version mismatch. |
|
|
105
|
+
| `GatewayError` | n/a | Couldn't reach the gateway, or got a non-2xx HTTP response. |
|
|
106
|
+
| `IntentGateError` | (base) | Catch this if you don't care which check fired. |
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from intentgate import Gateway, PolicyError, BudgetError, IntentGateError
|
|
110
|
+
|
|
111
|
+
try:
|
|
112
|
+
result = gw.tool_call("transfer_funds", arguments={"amount_eur": 50_000})
|
|
113
|
+
except PolicyError as e:
|
|
114
|
+
log.warning("policy blocked: %s (%s)", e.message, e.data)
|
|
115
|
+
except BudgetError:
|
|
116
|
+
log.error("agent ran out of budgeted calls")
|
|
117
|
+
except IntentGateError as e:
|
|
118
|
+
# everything else: re-raise or surface to user
|
|
119
|
+
raise
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## API reference
|
|
123
|
+
|
|
124
|
+
### `Gateway(url, token=None, *, timeout=10.0, client=None)`
|
|
125
|
+
|
|
126
|
+
Construct a client.
|
|
127
|
+
|
|
128
|
+
- `url` — base URL of the gateway, e.g. `http://localhost:8080`. Trailing slash is tolerated.
|
|
129
|
+
- `token` — capability token from `igctl mint`. When `None`, no `Authorization` header is sent.
|
|
130
|
+
- `timeout` — per-request timeout in seconds.
|
|
131
|
+
- `client` — pre-configured `httpx.Client` for advanced use (test injection, custom transports). The SDK only closes the client it created itself.
|
|
132
|
+
|
|
133
|
+
`Gateway` is also a context manager:
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
with Gateway(url="...", token="...") as gw:
|
|
137
|
+
gw.tool_call(...)
|
|
138
|
+
# client closed automatically
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `Gateway.tool_call(tool, arguments=None, *, intent_prompt=None, request_id=None) -> ToolCallResult`
|
|
142
|
+
|
|
143
|
+
Invoke a tool through the gateway.
|
|
144
|
+
|
|
145
|
+
- `tool` — tool name like `"read_invoice"`. Required.
|
|
146
|
+
- `arguments` — pass-through dict to the tool. The gateway logs only the keys, never the values.
|
|
147
|
+
- `intent_prompt` — the user's natural-language request. Sent as the `X-Intent-Prompt` header. Strongly recommended in production; without it the intent check is skipped (or denies in strict mode).
|
|
148
|
+
- `request_id` — JSON-RPC `id`. Defaults to a per-Gateway sequential integer.
|
|
149
|
+
|
|
150
|
+
Returns a `ToolCallResult` with:
|
|
151
|
+
|
|
152
|
+
- `content: list[ContentBlock]` — what the upstream tool returned (MCP shape, currently `type="text"` only).
|
|
153
|
+
- `is_error: bool` — MCP-level "tool reported an error" flag (distinct from gateway-level errors that raise exceptions).
|
|
154
|
+
- `intentgate: IntentGateMetadata | None` — gateway decision summary (`decision`, `reason`, `check`, `latency_ms`).
|
|
155
|
+
|
|
156
|
+
## Typical usage in an agent
|
|
157
|
+
|
|
158
|
+
The pitch's "three lines" referred to the SDK setup. In practice an
|
|
159
|
+
agent wraps each tool through the gateway:
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from intentgate import Gateway
|
|
163
|
+
|
|
164
|
+
class FinanceAgent:
|
|
165
|
+
def __init__(self, gateway_url: str, token: str, prompt: str) -> None:
|
|
166
|
+
self.gw = Gateway(url=gateway_url, token=token)
|
|
167
|
+
self.prompt = prompt
|
|
168
|
+
|
|
169
|
+
def read_invoice(self, invoice_id: str) -> str:
|
|
170
|
+
result = self.gw.tool_call(
|
|
171
|
+
"read_invoice",
|
|
172
|
+
arguments={"id": invoice_id},
|
|
173
|
+
intent_prompt=self.prompt,
|
|
174
|
+
)
|
|
175
|
+
return result.content[0].text
|
|
176
|
+
|
|
177
|
+
def transfer_funds(self, amount_eur: int, recipient: str) -> None:
|
|
178
|
+
self.gw.tool_call(
|
|
179
|
+
"transfer_funds",
|
|
180
|
+
arguments={"amount_eur": amount_eur, "recipient": recipient},
|
|
181
|
+
intent_prompt=self.prompt,
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Develop locally
|
|
186
|
+
|
|
187
|
+
```sh
|
|
188
|
+
make install # creates .venv, installs -e ".[dev]"
|
|
189
|
+
make lint # ruff check + ruff format --check
|
|
190
|
+
make lint-fix # auto-fix lint + format
|
|
191
|
+
make test # pytest
|
|
192
|
+
make build # sdist + wheel into dist/ (sanity check before tagging a release)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Tests use `respx` to mock httpx at the transport level — no real
|
|
196
|
+
network required, no running gateway needed.
|
|
197
|
+
|
|
198
|
+
## Project layout
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
src/intentgate/
|
|
202
|
+
__init__.py # public API: Gateway, exceptions, dataclasses
|
|
203
|
+
client.py # Gateway client + ToolCallResult dataclasses
|
|
204
|
+
exceptions.py # IntentGateError hierarchy (CapabilityError, IntentError, ...)
|
|
205
|
+
tests/
|
|
206
|
+
test_client.py # respx-mocked HTTP behavior
|
|
207
|
+
.github/workflows/ # CI (lint + tests across Python 3.10–3.13) and release (publish to PyPI on tag)
|
|
208
|
+
Makefile # install / lint / lint-fix / test / build / clean
|
|
209
|
+
pyproject.toml # hatchling build, ruff config, pytest config
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Versioning
|
|
213
|
+
|
|
214
|
+
Pre-release. The wire protocol with the gateway is stable (JSON-RPC
|
|
215
|
+
2.0 + the IntentGate-specific error codes), but the Python API surface
|
|
216
|
+
may change before `1.0.0`. Pin to a minor version when integrating.
|
|
217
|
+
|
|
218
|
+
## Contributing
|
|
219
|
+
|
|
220
|
+
Apache 2.0 and welcomes community contributions. A formal `CONTRIBUTING.md`
|
|
221
|
+
is coming with the v0.1 → v1.0 polish pass. For now, please open an
|
|
222
|
+
issue to discuss any non-trivial change before sending a PR.
|
|
223
|
+
|
|
224
|
+
## Security
|
|
225
|
+
|
|
226
|
+
If you find a security vulnerability, please **do not** open a public
|
|
227
|
+
issue. Email security@netgnarus.com (or open a GitHub Security Advisory
|
|
228
|
+
on this repo) and we'll respond within two business days.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
intentgate/__init__.py,sha256=nZvUNM1qVPpGMo8pQQ1IQBXaM6HAQKbplGIvaWf-iRA,1112
|
|
2
|
+
intentgate/client.py,sha256=y9IYqSqDBB8FivIiD2QR87TVkmebZSMhVEXcp0TY86A,8847
|
|
3
|
+
intentgate/exceptions.py,sha256=DiaYVcJyYYhdcfegciCBOJdWV0XpjOKNtl_5Vp6p4u8,3852
|
|
4
|
+
intentgate-0.1.0.dist-info/METADATA,sha256=_CtTapuor---Q9BGfyRIK1H7RU1IlooLkEyLJGnAqJc,9489
|
|
5
|
+
intentgate-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
6
|
+
intentgate-0.1.0.dist-info/licenses/LICENSE,sha256=y_VrqQZ4u-QmxMELTN93KsmknvWKFPJ0EZzq-4YIFDw,11321
|
|
7
|
+
intentgate-0.1.0.dist-info/RECORD,,
|
|
@@ -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 describing the origin of the Work and
|
|
141
|
+
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 2026 IntentGate contributors
|
|
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
|
|
200
|
+
implied. See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|