act-sdk 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.
- act_sdk/__init__.py +8 -0
- act_sdk/bridge.py +87 -0
- act_sdk/decorators.py +57 -0
- act_sdk/errors.py +32 -0
- act_sdk/provider.py +82 -0
- act_sdk/response.py +45 -0
- act_sdk/schema.py +95 -0
- act_sdk-0.1.0.dist-info/METADATA +16 -0
- act_sdk-0.1.0.dist-info/RECORD +12 -0
- act_sdk-0.1.0.dist-info/WHEEL +4 -0
- act_sdk-0.1.0.dist-info/licenses/LICENSE-APACHE +190 -0
- act_sdk-0.1.0.dist-info/licenses/LICENSE-MIT +21 -0
act_sdk/__init__.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""ACT SDK for Python components."""
|
|
2
|
+
|
|
3
|
+
from act_sdk.decorators import tool
|
|
4
|
+
from act_sdk.errors import ActError
|
|
5
|
+
from act_sdk.provider import component
|
|
6
|
+
from act_sdk.response import Content, Json
|
|
7
|
+
|
|
8
|
+
__all__ = ["ActError", "Content", "Json", "component", "tool"]
|
act_sdk/bridge.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""WIT bridge for componentize-py — auto-generates ToolProvider export.
|
|
2
|
+
|
|
3
|
+
Usage in app.py:
|
|
4
|
+
|
|
5
|
+
from act_sdk import component, tool
|
|
6
|
+
from act_sdk.bridge import ToolProvider # noqa: F401 — componentize-py entry point
|
|
7
|
+
|
|
8
|
+
@component
|
|
9
|
+
class MyComponent:
|
|
10
|
+
@tool(description="Do something")
|
|
11
|
+
async def my_tool(self, arg: str) -> str:
|
|
12
|
+
return f"result: {arg}"
|
|
13
|
+
|
|
14
|
+
The ToolProvider class is the componentize-py export. It delegates to the
|
|
15
|
+
@component/@tool registry automatically.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import traceback
|
|
21
|
+
|
|
22
|
+
from wit_world import exports
|
|
23
|
+
from wit_world.imports.types import (
|
|
24
|
+
ContentPart,
|
|
25
|
+
ListToolsResponse,
|
|
26
|
+
LocalizedString_Plain,
|
|
27
|
+
ToolDefinition,
|
|
28
|
+
ToolError,
|
|
29
|
+
ToolEvent_Content,
|
|
30
|
+
ToolEvent_Error,
|
|
31
|
+
ToolResult_Immediate,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
from act_sdk.provider import dispatch_tool, get_tool_definitions
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ToolProvider(exports.ToolProvider):
|
|
38
|
+
"""componentize-py export — bridges WIT interface to @component/@tool registry."""
|
|
39
|
+
|
|
40
|
+
async def get_metadata_schema(self, metadata):
|
|
41
|
+
return None
|
|
42
|
+
|
|
43
|
+
async def list_tools(self, metadata):
|
|
44
|
+
defs = get_tool_definitions()
|
|
45
|
+
return ListToolsResponse(
|
|
46
|
+
metadata=[],
|
|
47
|
+
tools=[
|
|
48
|
+
ToolDefinition(
|
|
49
|
+
name=name,
|
|
50
|
+
description=LocalizedString_Plain(value=desc),
|
|
51
|
+
parameters_schema=schema,
|
|
52
|
+
metadata=meta,
|
|
53
|
+
)
|
|
54
|
+
for name, desc, schema, meta in defs
|
|
55
|
+
],
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
async def call_tool(self, call):
|
|
59
|
+
try:
|
|
60
|
+
result = await dispatch_tool(call.name, bytes(call.arguments))
|
|
61
|
+
if len(result) == 3 and result[2] == "error":
|
|
62
|
+
kind, message, _ = result
|
|
63
|
+
event = ToolEvent_Error(
|
|
64
|
+
ToolError(
|
|
65
|
+
kind=kind,
|
|
66
|
+
message=LocalizedString_Plain(value=message),
|
|
67
|
+
metadata=[],
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
else:
|
|
71
|
+
data, mime = result
|
|
72
|
+
event = ToolEvent_Content(
|
|
73
|
+
ContentPart(
|
|
74
|
+
data=data,
|
|
75
|
+
mime_type=mime,
|
|
76
|
+
metadata=[],
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
except Exception:
|
|
80
|
+
event = ToolEvent_Error(
|
|
81
|
+
ToolError(
|
|
82
|
+
kind="std:internal",
|
|
83
|
+
message=LocalizedString_Plain(value=traceback.format_exc()),
|
|
84
|
+
metadata=[],
|
|
85
|
+
)
|
|
86
|
+
)
|
|
87
|
+
return ToolResult_Immediate([event])
|
act_sdk/decorators.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Decorators for ACT tool functions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import Callable
|
|
8
|
+
|
|
9
|
+
from act_sdk.schema import params_schema
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class ToolInfo:
|
|
14
|
+
"""Metadata collected from @tool decorator."""
|
|
15
|
+
|
|
16
|
+
name: str
|
|
17
|
+
description: str
|
|
18
|
+
parameters_schema: str # JSON string
|
|
19
|
+
func: Callable
|
|
20
|
+
read_only: bool = False
|
|
21
|
+
idempotent: bool = False
|
|
22
|
+
destructive: bool = False
|
|
23
|
+
timeout_ms: int | None = None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def tool(
|
|
27
|
+
description: str,
|
|
28
|
+
*,
|
|
29
|
+
read_only: bool = False,
|
|
30
|
+
idempotent: bool = False,
|
|
31
|
+
destructive: bool = False,
|
|
32
|
+
timeout_ms: int | None = None,
|
|
33
|
+
) -> Callable:
|
|
34
|
+
"""Mark an async method as an ACT tool.
|
|
35
|
+
|
|
36
|
+
Collects metadata and JSON schema at decoration time.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def decorator(func: Callable) -> Callable:
|
|
40
|
+
schema = params_schema(func)
|
|
41
|
+
tool_name = func.__name__
|
|
42
|
+
|
|
43
|
+
info = ToolInfo(
|
|
44
|
+
name=tool_name,
|
|
45
|
+
description=description,
|
|
46
|
+
parameters_schema=json.dumps(schema),
|
|
47
|
+
func=func,
|
|
48
|
+
read_only=read_only,
|
|
49
|
+
idempotent=idempotent,
|
|
50
|
+
destructive=destructive,
|
|
51
|
+
timeout_ms=timeout_ms,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
func._act_tool = info # type: ignore[attr-defined]
|
|
55
|
+
return func
|
|
56
|
+
|
|
57
|
+
return decorator
|
act_sdk/errors.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""ACT error types."""
|
|
2
|
+
|
|
3
|
+
from typing import Self
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ActError(Exception):
|
|
7
|
+
"""ACT tool error with a kind and message."""
|
|
8
|
+
|
|
9
|
+
def __init__(self, kind: str, message: str) -> None:
|
|
10
|
+
super().__init__(message)
|
|
11
|
+
self.kind = kind
|
|
12
|
+
self.message = message
|
|
13
|
+
|
|
14
|
+
@classmethod
|
|
15
|
+
def not_found(cls, message: str) -> Self:
|
|
16
|
+
return cls("std:not-found", message)
|
|
17
|
+
|
|
18
|
+
@classmethod
|
|
19
|
+
def invalid_args(cls, message: str) -> Self:
|
|
20
|
+
return cls("std:invalid-args", message)
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def internal(cls, message: str) -> Self:
|
|
24
|
+
return cls("std:internal", message)
|
|
25
|
+
|
|
26
|
+
@classmethod
|
|
27
|
+
def timeout(cls, message: str) -> Self:
|
|
28
|
+
return cls("std:timeout", message)
|
|
29
|
+
|
|
30
|
+
@classmethod
|
|
31
|
+
def capability_denied(cls, message: str) -> Self:
|
|
32
|
+
return cls("std:capability-denied", message)
|
act_sdk/provider.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""WIT ToolProvider bridge — connects @component class to componentize-py exports."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import traceback
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
import cbor2
|
|
9
|
+
|
|
10
|
+
from act_sdk.decorators import ToolInfo
|
|
11
|
+
from act_sdk.errors import ActError
|
|
12
|
+
from act_sdk.response import encode_response
|
|
13
|
+
|
|
14
|
+
# Global registry — set by @component decorator
|
|
15
|
+
_registered_component: Any = None
|
|
16
|
+
_tool_registry: dict[str, ToolInfo] = {}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def component(cls: type) -> type:
|
|
20
|
+
"""Register a class as the ACT component.
|
|
21
|
+
|
|
22
|
+
Scans for @tool-decorated methods, registers them, and injects the
|
|
23
|
+
WIT ToolProvider bridge into the caller's module so componentize-py
|
|
24
|
+
can find the export automatically.
|
|
25
|
+
"""
|
|
26
|
+
global _registered_component, _tool_registry
|
|
27
|
+
|
|
28
|
+
instance = cls()
|
|
29
|
+
_registered_component = instance
|
|
30
|
+
_tool_registry = {}
|
|
31
|
+
|
|
32
|
+
for attr_name in dir(cls):
|
|
33
|
+
attr = getattr(cls, attr_name, None)
|
|
34
|
+
if callable(attr) and hasattr(attr, "_act_tool"):
|
|
35
|
+
info: ToolInfo = attr._act_tool
|
|
36
|
+
_tool_registry[info.name] = info
|
|
37
|
+
|
|
38
|
+
# Inject WIT bridge into component's module for componentize-py
|
|
39
|
+
import sys
|
|
40
|
+
|
|
41
|
+
from act_sdk.bridge import ToolProvider
|
|
42
|
+
|
|
43
|
+
module = sys.modules.get(cls.__module__)
|
|
44
|
+
if module is not None:
|
|
45
|
+
setattr(module, "ToolProvider", ToolProvider)
|
|
46
|
+
|
|
47
|
+
return cls
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def get_tool_definitions() -> list[tuple[str, str, str, list[tuple[str, bytes]]]]:
|
|
51
|
+
"""Return tool definitions as (name, description, schema_json, metadata) tuples."""
|
|
52
|
+
defs = []
|
|
53
|
+
for info in _tool_registry.values():
|
|
54
|
+
metadata: list[tuple[str, bytes]] = []
|
|
55
|
+
if info.read_only:
|
|
56
|
+
metadata.append(("std:read-only", cbor2.dumps(True)))
|
|
57
|
+
if info.idempotent:
|
|
58
|
+
metadata.append(("std:idempotent", cbor2.dumps(True)))
|
|
59
|
+
if info.destructive:
|
|
60
|
+
metadata.append(("std:destructive", cbor2.dumps(True)))
|
|
61
|
+
if info.timeout_ms is not None:
|
|
62
|
+
metadata.append(("std:timeout-ms", cbor2.dumps(info.timeout_ms)))
|
|
63
|
+
defs.append((info.name, info.description, info.parameters_schema, metadata))
|
|
64
|
+
return defs
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
async def dispatch_tool(
|
|
68
|
+
name: str, arguments: bytes
|
|
69
|
+
) -> tuple[bytes, str] | tuple[str, str, str]:
|
|
70
|
+
"""Dispatch a tool call. Returns (data, mime) on success or (kind, message, "error") on error."""
|
|
71
|
+
info = _tool_registry.get(name)
|
|
72
|
+
if info is None:
|
|
73
|
+
return ("std:not-found", f"Unknown tool: {name}", "error")
|
|
74
|
+
|
|
75
|
+
try:
|
|
76
|
+
args = cbor2.loads(arguments) if arguments else {}
|
|
77
|
+
result = await info.func(_registered_component, **args)
|
|
78
|
+
return encode_response(result)
|
|
79
|
+
except ActError as e:
|
|
80
|
+
return (e.kind, e.message, "error")
|
|
81
|
+
except Exception:
|
|
82
|
+
return ("std:internal", traceback.format_exc(), "error")
|
act_sdk/response.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Response types and encoding for ACT tool results."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import Generic, TypeVar
|
|
7
|
+
|
|
8
|
+
import cbor2
|
|
9
|
+
|
|
10
|
+
T = TypeVar("T")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Json(Generic[T]):
|
|
14
|
+
"""Wrap a value to be serialized as JSON instead of CBOR."""
|
|
15
|
+
|
|
16
|
+
def __init__(self, value: T) -> None:
|
|
17
|
+
self.value = value
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Content:
|
|
21
|
+
"""Wrap raw bytes with an explicit MIME type."""
|
|
22
|
+
|
|
23
|
+
def __init__(self, mime: str, data: bytes) -> None:
|
|
24
|
+
self.mime = mime
|
|
25
|
+
self.data = data
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def encode_response(value: object) -> tuple[bytes, str]:
|
|
29
|
+
"""Encode a tool return value into (data_bytes, mime_type).
|
|
30
|
+
|
|
31
|
+
- str → text/plain
|
|
32
|
+
- bytes → application/octet-stream
|
|
33
|
+
- Json(x) → application/json
|
|
34
|
+
- Content(mime, data) → explicit mime
|
|
35
|
+
- anything else → application/cbor
|
|
36
|
+
"""
|
|
37
|
+
if isinstance(value, str):
|
|
38
|
+
return value.encode("utf-8"), "text/plain"
|
|
39
|
+
if isinstance(value, bytes):
|
|
40
|
+
return value, "application/octet-stream"
|
|
41
|
+
if isinstance(value, Json):
|
|
42
|
+
return json.dumps(value.value).encode("utf-8"), "application/json"
|
|
43
|
+
if isinstance(value, Content):
|
|
44
|
+
return value.data, value.mime
|
|
45
|
+
return cbor2.dumps(value), "application/cbor"
|
act_sdk/schema.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""Type hint → JSON Schema conversion for ACT tool parameters."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import inspect
|
|
6
|
+
import types as _types
|
|
7
|
+
import typing as _typing
|
|
8
|
+
from typing import Any, Callable, get_args, get_origin
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
_PY_TYPE_TO_JSON: dict[type, str] = {
|
|
12
|
+
str: "string",
|
|
13
|
+
int: "integer",
|
|
14
|
+
float: "number",
|
|
15
|
+
bool: "boolean",
|
|
16
|
+
bytes: "string", # base64-encoded in JSON context
|
|
17
|
+
list: "array",
|
|
18
|
+
dict: "object",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _annotation_to_schema(annotation: Any) -> dict[str, Any]:
|
|
23
|
+
"""Convert a single type annotation to a JSON Schema fragment."""
|
|
24
|
+
if annotation is inspect.Parameter.empty:
|
|
25
|
+
return {}
|
|
26
|
+
|
|
27
|
+
origin = get_origin(annotation)
|
|
28
|
+
args = get_args(annotation)
|
|
29
|
+
|
|
30
|
+
# Optional[X] / Union[X, None]
|
|
31
|
+
if origin is _typing.Union or origin is getattr(_types, "UnionType", None):
|
|
32
|
+
non_none = [a for a in args if a is not type(None)]
|
|
33
|
+
if len(non_none) == 1:
|
|
34
|
+
return _annotation_to_schema(non_none[0])
|
|
35
|
+
return {"oneOf": [_annotation_to_schema(a) for a in non_none]}
|
|
36
|
+
|
|
37
|
+
# list[X]
|
|
38
|
+
if origin is list:
|
|
39
|
+
schema: dict[str, Any] = {"type": "array"}
|
|
40
|
+
if args:
|
|
41
|
+
schema["items"] = _annotation_to_schema(args[0])
|
|
42
|
+
return schema
|
|
43
|
+
|
|
44
|
+
# dict[K, V]
|
|
45
|
+
if origin is dict:
|
|
46
|
+
schema = {"type": "object"}
|
|
47
|
+
if len(args) >= 2:
|
|
48
|
+
schema["additionalProperties"] = _annotation_to_schema(args[1])
|
|
49
|
+
return schema
|
|
50
|
+
|
|
51
|
+
# Plain types
|
|
52
|
+
if annotation in _PY_TYPE_TO_JSON:
|
|
53
|
+
return {"type": _PY_TYPE_TO_JSON[annotation]}
|
|
54
|
+
|
|
55
|
+
# Fallback — unknown type, no constraint
|
|
56
|
+
return {}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _is_optional(annotation: Any) -> bool:
|
|
60
|
+
"""Return True if *annotation* is Optional[X] (i.e. Union[X, None])."""
|
|
61
|
+
origin = get_origin(annotation)
|
|
62
|
+
if origin is _typing.Union or origin is getattr(_types, "UnionType", None):
|
|
63
|
+
return any(a is type(None) for a in get_args(annotation))
|
|
64
|
+
return False
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def params_schema(func: Callable) -> dict[str, Any]:
|
|
68
|
+
"""Return a JSON Schema *object* describing the parameters of *func*.
|
|
69
|
+
|
|
70
|
+
``self`` and parameters with no annotation are skipped.
|
|
71
|
+
The return annotation is ignored.
|
|
72
|
+
Optional[X] parameters are not listed in ``required`` even without a default.
|
|
73
|
+
"""
|
|
74
|
+
sig = inspect.signature(func)
|
|
75
|
+
properties: dict[str, Any] = {}
|
|
76
|
+
required: list[str] = []
|
|
77
|
+
|
|
78
|
+
for name, param in sig.parameters.items():
|
|
79
|
+
if name == "self":
|
|
80
|
+
continue
|
|
81
|
+
|
|
82
|
+
prop = _annotation_to_schema(param.annotation)
|
|
83
|
+
|
|
84
|
+
if param.default is not inspect.Parameter.empty:
|
|
85
|
+
prop = dict(prop) # copy before mutating
|
|
86
|
+
prop["default"] = param.default
|
|
87
|
+
elif not _is_optional(param.annotation):
|
|
88
|
+
required.append(name)
|
|
89
|
+
|
|
90
|
+
properties[name] = prop
|
|
91
|
+
|
|
92
|
+
schema: dict[str, Any] = {"type": "object", "properties": properties}
|
|
93
|
+
if required:
|
|
94
|
+
schema["required"] = required
|
|
95
|
+
return schema
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: act-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python SDK for ACT components
|
|
5
|
+
Project-URL: Homepage, https://actcore.dev
|
|
6
|
+
Project-URL: Repository, https://github.com/actcore/act-sdk-py
|
|
7
|
+
Project-URL: Issues, https://github.com/actcore/act-sdk-py/issues
|
|
8
|
+
License-Expression: MIT OR Apache-2.0
|
|
9
|
+
License-File: LICENSE-APACHE
|
|
10
|
+
License-File: LICENSE-MIT
|
|
11
|
+
Keywords: act,ai,component-model,mcp,tools,wasm
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Requires-Python: >=3.12
|
|
16
|
+
Requires-Dist: cbor2>=5.9.0
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
act_sdk/__init__.py,sha256=PDQu_8LL-tO2QVHTeTqFAwXytRxx3IZfqxTjQVQLvsw,256
|
|
2
|
+
act_sdk/bridge.py,sha256=A_S9XGYVfb_DH7dvdKjl_tC_WK51sT3vQSNOK2L97ZQ,2629
|
|
3
|
+
act_sdk/decorators.py,sha256=WsoMPO-4h3a_gCFrbMotXp-uDR99vc3DqIDD1QsS9yY,1320
|
|
4
|
+
act_sdk/errors.py,sha256=vKlsfluaj1BAToTFm7QlCz5guXBjXTIFMKxx-V9eqPc,836
|
|
5
|
+
act_sdk/provider.py,sha256=TeQnSW6mgIHG3iLZW11WxqOV0L2K0vcd8PQuRdmaV5U,2768
|
|
6
|
+
act_sdk/response.py,sha256=uY5VTjkP4r2UijXUWmJ0MfqMfV2qc8HwZ1yhM_1wrsY,1223
|
|
7
|
+
act_sdk/schema.py,sha256=xlX6Q6Qc6G2TlJ_nWWVVD6rBJVFKfMWPNh0yUBFENOU,2913
|
|
8
|
+
act_sdk-0.1.0.dist-info/METADATA,sha256=P13_NwoNQo-I7n-RJDryvVkjMvlioTIyfiiFs1WYwyw,614
|
|
9
|
+
act_sdk-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
10
|
+
act_sdk-0.1.0.dist-info/licenses/LICENSE-APACHE,sha256=1xIqOCvTcVttwijryZAC_7VZVAv38SgoVUCfW-TciKo,10761
|
|
11
|
+
act_sdk-0.1.0.dist-info/licenses/LICENSE-MIT,sha256=qsHMj8kUHZfRutB0aNJGqOWMLdnRSTK1dxp0cE0c4mk,1073
|
|
12
|
+
act_sdk-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,190 @@
|
|
|
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
|
+
Copyright 2026 ACT contributors
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ACT contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|