tai42-storage-github 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.
@@ -0,0 +1,9 @@
1
+ """GitHub-backed :class:`~tai42_contract.storage.Storage` provider.
2
+
3
+ Importing this package registers :class:`GithubStorage` as the active storage
4
+ provider via an import side-effect.
5
+ """
6
+
7
+ from tai42_storage_github.storage import GithubStorage
8
+
9
+ __all__ = ["GithubStorage"]
@@ -0,0 +1,29 @@
1
+ """Pooled ``httpx.AsyncClient`` for the GitHub storage backend, per event loop.
2
+
3
+ ``trust_env=False`` ignores ambient proxy env vars; connection limits and timeout
4
+ come from :func:`~tai42_storage_github.settings.github_storage_settings`.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import httpx
10
+ from tai42_kit.clients import PooledClient
11
+
12
+ from tai42_storage_github.settings import github_storage_settings
13
+
14
+
15
+ class GithubHttpxClient(PooledClient[httpx.AsyncClient]):
16
+ async def _create(self, **kwargs: object) -> httpx.AsyncClient:
17
+ settings = github_storage_settings()
18
+ return httpx.AsyncClient(
19
+ trust_env=False,
20
+ timeout=httpx.Timeout(settings.timeout_total),
21
+ limits=httpx.Limits(
22
+ max_connections=settings.max_connections,
23
+ max_keepalive_connections=settings.max_keepalive_connections,
24
+ keepalive_expiry=settings.keepalive_expiry,
25
+ ),
26
+ )
27
+
28
+ async def _close(self, client: httpx.AsyncClient) -> None:
29
+ await client.aclose()
File without changes
@@ -0,0 +1,29 @@
1
+ """Settings for the GitHub storage backend (``STORAGE_GITHUB_`` env vars).
2
+
3
+ The token is a :class:`~pydantic.SecretStr` so it never surfaces in a repr, log,
4
+ or traceback.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pydantic import SecretStr
10
+ from pydantic_settings import SettingsConfigDict
11
+ from tai42_kit.settings import TaiBaseSettings, settings_cache
12
+
13
+
14
+ class GithubStorageSettings(TaiBaseSettings):
15
+ model_config = SettingsConfigDict(env_prefix="STORAGE_GITHUB_")
16
+
17
+ username: str | None = None
18
+ repo: str | None = None
19
+ branch: str = "main"
20
+ token: SecretStr | None = None
21
+ timeout_total: float = 15.0
22
+ max_connections: int = 200
23
+ max_keepalive_connections: int = 50
24
+ keepalive_expiry: float = 300.0
25
+
26
+
27
+ @settings_cache
28
+ def github_storage_settings() -> GithubStorageSettings:
29
+ return GithubStorageSettings()
@@ -0,0 +1,216 @@
1
+ """GitHub-backed :class:`~tai42_contract.storage.Storage` provider.
2
+
3
+ Reads use the RAW endpoint (``raw.githubusercontent.com``): the Contents API
4
+ returns empty content for files over 1 MiB. The raw endpoint is CDN-cached, so a
5
+ read shortly after a write may serve stale content for up to ~5 minutes. Writes
6
+ use the Contents API (base64) and are capped below the API limit, raising before
7
+ the request rather than truncating.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import base64
13
+ import logging
14
+
15
+ import httpx
16
+ from tai42_contract.app import tai42_app
17
+ from tai42_contract.storage import Storage, assert_not_root
18
+
19
+ from tai42_storage_github.client import GithubHttpxClient
20
+ from tai42_storage_github.settings import GithubStorageSettings, github_storage_settings
21
+
22
+ logger = logging.getLogger(__name__)
23
+
24
+ RAW_BASE_URL = "https://raw.githubusercontent.com/{username}/{repo}/refs/heads/{branch}"
25
+ CONTENTS_API_URL = "https://api.github.com/repos/{username}/{repo}/contents"
26
+ TREES_API_URL = "https://api.github.com/repos/{username}/{repo}/git/trees/{branch}"
27
+
28
+ # Conservative upload cap below GitHub's Contents API limit; an oversize file
29
+ # raises before the request. Reads are uncapped (raw endpoint).
30
+ MAX_UPLOAD_BYTES = 1024 * 1024
31
+
32
+
33
+ def _join(base: str, path: str) -> str:
34
+ """Join ``path`` onto ``base``, dropping empty and stray-slash segments."""
35
+ joined = "/".join(segment for segment in path.split("/") if segment)
36
+ base = base.rstrip("/")
37
+ return f"{base}/{joined}" if joined else base
38
+
39
+
40
+ def _configured_settings() -> GithubStorageSettings:
41
+ """The cached settings; raises a clear config error naming the env vars when
42
+ owner/repo is unset."""
43
+ settings = github_storage_settings()
44
+ missing = [
45
+ env
46
+ for env, value in (("STORAGE_GITHUB_USERNAME", settings.username), ("STORAGE_GITHUB_REPO", settings.repo))
47
+ if not value
48
+ ]
49
+ if missing:
50
+ raise RuntimeError(f"GitHub storage is not configured: set {' and '.join(missing)} to the target repository.")
51
+ return settings
52
+
53
+
54
+ def _auth_headers(settings: GithubStorageSettings) -> dict[str, str]:
55
+ """Authorization header, present only when a token is configured.
56
+
57
+ The token is read from the :class:`~pydantic.SecretStr` only here and never logged.
58
+ """
59
+ if settings.token is None:
60
+ return {}
61
+ return {"Authorization": f"Bearer {settings.token.get_secret_value()}"}
62
+
63
+
64
+ def _api_headers(settings: GithubStorageSettings) -> dict[str, str]:
65
+ return {
66
+ **_auth_headers(settings),
67
+ "Accept": "application/vnd.github+json",
68
+ "X-GitHub-Api-Version": "2022-11-28",
69
+ }
70
+
71
+
72
+ def _raise_for_status(resp: httpx.Response, action: str, path: str, url: str) -> None:
73
+ """Surface an HTTP error loudly; the log names the URL/status/body, never the token."""
74
+ try:
75
+ resp.raise_for_status()
76
+ except httpx.HTTPStatusError:
77
+ logger.error("HTTP error %s %s (%s): status=%s body=%s", action, path, url, resp.status_code, resp.text[:200])
78
+ raise
79
+
80
+
81
+ # Importing this module registers GithubStorage as the active storage provider.
82
+ @tai42_app.storage.register_storage
83
+ class GithubStorage(Storage):
84
+ async def load(self, path: str) -> str:
85
+ settings = _configured_settings()
86
+ url = _join(RAW_BASE_URL.format(username=settings.username, repo=settings.repo, branch=settings.branch), path)
87
+ async with tai42_app.clients.client_ctx(GithubHttpxClient) as client:
88
+ resp = await client.get(url, headers=_auth_headers(settings))
89
+ self._guard_read(resp, path, url)
90
+ return resp.text
91
+
92
+ async def load_bytes(self, path: str) -> bytes:
93
+ settings = _configured_settings()
94
+ url = _join(RAW_BASE_URL.format(username=settings.username, repo=settings.repo, branch=settings.branch), path)
95
+ async with tai42_app.clients.client_ctx(GithubHttpxClient) as client:
96
+ resp = await client.get(url, headers=_auth_headers(settings))
97
+ self._guard_read(resp, path, url)
98
+ # Raw endpoint has no size cap, unlike the Contents API.
99
+ return resp.content
100
+
101
+ @staticmethod
102
+ def _guard_read(resp: httpx.Response, path: str, url: str) -> None:
103
+ if resp.status_code == 404:
104
+ raise FileNotFoundError(f"Object not found: {path}")
105
+ _raise_for_status(resp, "loading", path, url)
106
+
107
+ async def list(self) -> list[str]:
108
+ return await self._list_blobs("")
109
+
110
+ async def _list_blobs(self, prefix: str) -> list[str]:
111
+ """Every blob path in the repo, optionally filtered to ``prefix``.
112
+
113
+ Uses the recursive Git Trees API (one request); its ``truncated`` flag is
114
+ raised on loudly rather than acting on a partial listing.
115
+ """
116
+ settings = _configured_settings()
117
+ url = TREES_API_URL.format(username=settings.username, repo=settings.repo, branch=settings.branch)
118
+ async with tai42_app.clients.client_ctx(GithubHttpxClient) as client:
119
+ resp = await client.get(url, headers=_api_headers(settings), params={"recursive": "1"})
120
+ _raise_for_status(resp, "listing", prefix or "/", url)
121
+ data = resp.json()
122
+ if not isinstance(data, dict):
123
+ raise RuntimeError(f"Expected a tree object from {url}, got {type(data).__name__}")
124
+ if data.get("truncated"):
125
+ raise RuntimeError(f"GitHub tree listing was truncated; the tree is too large to list safely: {url}")
126
+ return [
127
+ item["path"]
128
+ for item in data.get("tree", [])
129
+ if isinstance(item, dict)
130
+ and item.get("type") == "blob"
131
+ and (not prefix or item["path"].startswith(prefix))
132
+ ]
133
+
134
+ async def upload(self, path: str, content: str) -> None:
135
+ await self._put_contents(path, content.encode("utf-8"))
136
+
137
+ async def upload_bytes(self, path: str, data: bytes, content_type: str | None = None) -> None:
138
+ # GitHub stores no per-object content-type; content_type is unused.
139
+ await self._put_contents(path, data)
140
+
141
+ async def _put_contents(self, path: str, data: bytes) -> None:
142
+ if len(data) > MAX_UPLOAD_BYTES:
143
+ raise ValueError(
144
+ f"Refusing to upload {len(data)} bytes to {path!r}: exceeds the conservative "
145
+ f"{MAX_UPLOAD_BYTES}-byte GitHub Contents API upload cap. Store large objects elsewhere."
146
+ )
147
+ settings = _configured_settings()
148
+ url = _join(CONTENTS_API_URL.format(username=settings.username, repo=settings.repo), path)
149
+ headers = _api_headers(settings)
150
+ encoded = base64.b64encode(data).decode("ascii")
151
+ async with tai42_app.clients.client_ctx(GithubHttpxClient) as client:
152
+ sha: str | None = None
153
+ # A 404 means the object doesn't exist yet (a create); any other
154
+ # failure must surface, not be mistaken for a new object.
155
+ get_resp = await client.get(url, headers=headers, params={"ref": settings.branch})
156
+ if get_resp.status_code == 200:
157
+ existing = get_resp.json()
158
+ if isinstance(existing, dict):
159
+ sha = existing.get("sha")
160
+ elif get_resp.status_code != 404:
161
+ _raise_for_status(get_resp, "resolving for upload", path, url)
162
+
163
+ payload: dict[str, str] = {"message": f"Update {path}", "content": encoded, "branch": settings.branch}
164
+ if sha:
165
+ payload["sha"] = sha
166
+ resp = await client.put(url, headers=headers, json=payload)
167
+ # The 422 backstop: an oversize/invalid payload the API itself rejects.
168
+ _raise_for_status(resp, "uploading", path, url)
169
+
170
+ async def delete(self, path: str) -> None:
171
+ settings = _configured_settings()
172
+ url = _join(CONTENTS_API_URL.format(username=settings.username, repo=settings.repo), path)
173
+ headers = _api_headers(settings)
174
+ async with tai42_app.clients.client_ctx(GithubHttpxClient) as client:
175
+ get_resp = await client.get(url, headers=headers, params={"ref": settings.branch})
176
+ if get_resp.status_code == 404:
177
+ raise FileNotFoundError(f"Object not found: {path}")
178
+ _raise_for_status(get_resp, "resolving for delete", path, url)
179
+
180
+ data = get_resp.json()
181
+ # The Contents API returns a list for a directory and an object for a
182
+ # file; only a file has a deletable blob sha.
183
+ if not isinstance(data, dict):
184
+ raise FileNotFoundError(f"Object not found: {path}")
185
+
186
+ sha = data.get("sha")
187
+ # The delete payload requires the blob sha; a file object without one
188
+ # is an unexpected response, raised on here.
189
+ if not sha:
190
+ raise RuntimeError(f"GitHub Contents API returned no blob sha for {path}; cannot delete it.")
191
+
192
+ payload = {"message": f"Delete {path}", "sha": sha, "branch": settings.branch}
193
+ resp = await client.request("DELETE", url, headers=headers, json=payload)
194
+ _raise_for_status(resp, "deleting", path, url)
195
+
196
+ async def delete_dir(self, path: str) -> None:
197
+ """Delete every file under ``path`` sequentially (GitHub has no bulk delete).
198
+
199
+ A failure mid-loop raises immediately; the partial deletion surfaces loudly.
200
+ """
201
+ assert_not_root(path)
202
+ prefix = path if path.endswith("/") else f"{path}/"
203
+ files = await self._list_blobs(prefix)
204
+ if not files:
205
+ raise FileNotFoundError(f"Directory not found or empty: {path}")
206
+
207
+ for file_path in files:
208
+ try:
209
+ await self.delete(file_path)
210
+ except FileNotFoundError:
211
+ # Already gone (concurrent delete); the delete is idempotent. A
212
+ # real DELETE failure raises HTTPStatusError and is not caught here.
213
+ logger.info("Object %s already gone during dir delete of %s; skipping", file_path, path)
214
+
215
+
216
+ __all__ = ["GithubStorage"]
@@ -0,0 +1,22 @@
1
+ spec_version: 1
2
+ namespace: tai42
3
+ name: storage-github
4
+ package: tai42-storage-github
5
+ version: 0.1.0
6
+ description: "GitHub-backed Storage provider (text + binary/media) for the TAI ecosystem."
7
+ license: Apache-2.0
8
+ homepage: https://tai42.ai
9
+ repository: https://github.com/tai42ai/tai-storage-github
10
+ contract: ">=0.1,<0.2"
11
+ categories: [storage]
12
+ tags: [storage, github, git]
13
+ permissions:
14
+ network: true
15
+ subprocess: false
16
+ filesystem: false
17
+ provides:
18
+ - kind: storage
19
+ name: github
20
+ module: tai42_storage_github
21
+ description: "Storage backend serving text and binary/media content over a GitHub repository."
22
+ tags: [storage, github]
@@ -0,0 +1,122 @@
1
+ Metadata-Version: 2.4
2
+ Name: tai42-storage-github
3
+ Version: 0.1.0
4
+ Summary: GitHub-backed Storage provider (text + binary/media) for the TAI ecosystem.
5
+ Author-email: tai42 <oss@tai42.ai>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://tai42.ai
8
+ Project-URL: Repository, https://github.com/tai42ai/tai-storage-github
9
+ Project-URL: Issues, https://github.com/tai42ai/tai-storage-github/issues
10
+ Project-URL: Changelog, https://github.com/tai42ai/tai-storage-github/blob/main/CHANGELOG.md
11
+ Keywords: tai,storage,github,mcp,content,plugin
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.13
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ License-File: NOTICE
22
+ Requires-Dist: tai42-contract<0.2,>=0.1
23
+ Requires-Dist: tai42-kit<0.2,>=0.1
24
+ Requires-Dist: httpx>=0.28
25
+ Requires-Dist: pydantic>=2.12
26
+ Requires-Dist: pydantic-settings>=2.11
27
+ Dynamic: license-file
28
+
29
+ # tai42-storage-github
30
+
31
+ [![CI](https://github.com/tai42ai/tai-storage-github/actions/workflows/ci.yml/badge.svg)](https://github.com/tai42ai/tai-storage-github/actions/workflows/ci.yml)
32
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
33
+
34
+ A GitHub-backed `Storage` provider for the TAI ecosystem. It stores content as
35
+ files in a GitHub repository and serves the full `tai42_contract.storage.Storage`
36
+ surface — the text methods (`load` / `list` / `upload` / `delete` / `delete_dir`)
37
+ plus the binary/media methods (`load_bytes` / `upload_bytes` / `stat`).
38
+
39
+ ## The TAI ecosystem
40
+
41
+ TAI is an open-source runtime for MCP tools, agents, and workflows. A `Storage`
42
+ backend is "where content physically lives" — a pluggable provider the runtime's
43
+ `ResourceManager` loads and renders content over. This package is one such
44
+ provider (GitHub); siblings back the same contract with S3 (`tai42-storage-s3`) and
45
+ the local filesystem (`tai42-storage-local`). The ecosystem is open-ended: any
46
+ package can back the same contract, so this repo is this provider's own full doc
47
+ home, and the documentation site covers the platform-level story:
48
+
49
+ - Storage & resources concept: https://tai42.ai/concepts/storage-and-resources
50
+ - Build a storage provider (author guide): https://tai42.ai/guides/authors/storage-provider
51
+ - Ecosystem catalog: https://tai42.ai/reference/catalog
52
+
53
+ ## Install
54
+
55
+ Requires **Python 3.13+**. Nothing is on PyPI yet, so install from source — clone
56
+ this repo alongside your `tai42-skeleton` checkout and add it as an editable
57
+ dependency of the environment that runs the server:
58
+
59
+ ```bash
60
+ git clone https://github.com/tai42ai/tai-storage-github
61
+ cd tai-skeleton # or your own app checkout
62
+ uv add --editable ../tai-storage-github # once published: uv add tai42-storage-github
63
+ ```
64
+
65
+ ## Use
66
+
67
+ The backend is loaded by **import side-effect**: importing the `tai42_storage_github`
68
+ package runs its `@tai42_app.storage.register_storage` decorator, making
69
+ `GithubStorage` the active storage provider. Point a manifest's `storage_module`
70
+ at the package:
71
+
72
+ ```yaml
73
+ # manifest.yml
74
+ storage_module: tai42_storage_github
75
+ ```
76
+
77
+ ## Configuration
78
+
79
+ Configure through `STORAGE_GITHUB_`-prefixed environment variables:
80
+
81
+ | Variable | Default | Description |
82
+ | --- | --- | --- |
83
+ | `STORAGE_GITHUB_USERNAME` | — | Repository owner (user or org). |
84
+ | `STORAGE_GITHUB_REPO` | — | Repository name. |
85
+ | `STORAGE_GITHUB_BRANCH` | `main` | Branch to read/write. |
86
+ | `STORAGE_GITHUB_TOKEN` | — | Access token; omit for a public repository. |
87
+ | `STORAGE_GITHUB_TIMEOUT_TOTAL` | `15.0` | HTTP timeout (seconds). |
88
+ | `STORAGE_GITHUB_MAX_CONNECTIONS` | `200` | Connection-pool ceiling. |
89
+ | `STORAGE_GITHUB_MAX_KEEPALIVE_CONNECTIONS` | `50` | Keep-alive pool size. |
90
+ | `STORAGE_GITHUB_KEEPALIVE_EXPIRY` | `300.0` | Keep-alive expiry (seconds). |
91
+
92
+ The token is held as a `SecretStr`; it authenticates requests but never appears in
93
+ a log line, repr, or error message.
94
+
95
+ ## Reads and writes
96
+
97
+ - **Reads** (`load`, `load_bytes`) go through the raw endpoint
98
+ (`raw.githubusercontent.com`), which serves files of any size. The Contents API
99
+ is deliberately **not** used for reads: it silently returns an empty body for a
100
+ file over 1 MiB, so a large object would read as empty bytes. The raw endpoint
101
+ is CDN-cached, so a read shortly after a write may return the previous content
102
+ for up to ~5 minutes.
103
+ - **Writes** (`upload`, `upload_bytes`) go through the Contents API (base64) and
104
+ are capped conservatively at 1 MiB. A larger payload raises `ValueError` before
105
+ the request rather than truncating; the API's own `422` is the backstop.
106
+ - **Listing** uses the recursive Git Trees API (one request) and raises loudly on
107
+ a `truncated` response rather than acting on a partial listing.
108
+ - **`stat`** infers `content_type` from the path suffix — GitHub stores no
109
+ per-object content-type.
110
+
111
+ ## Development
112
+
113
+ ```bash
114
+ uv sync
115
+ uv run pytest
116
+ uv run ruff check .
117
+ uv run pyright
118
+ ```
119
+
120
+ ## License
121
+
122
+ Apache-2.0. See `LICENSE` and `NOTICE`.
@@ -0,0 +1,12 @@
1
+ tai42_storage_github/__init__.py,sha256=r3R_7BfsrEtHfDBWSBlNj0_RPVV63kAD9W9RLAH0lO0,272
2
+ tai42_storage_github/client.py,sha256=NVqdflPL9hnO9rnCZ2mF4bHB8GL-crD1IPYb5IWhF8s,1044
3
+ tai42_storage_github/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ tai42_storage_github/settings.py,sha256=wOPjk1fpp04g7lqcfb1nQ6IHKCiQPHMqsIaH_HrNDlM,840
5
+ tai42_storage_github/storage.py,sha256=6Q5-FI3FuhDZg8L7d6uPGWTun_VVq6Uj1W6WUOW8ARI,10025
6
+ tai42_storage_github/tai-plugin.yml,sha256=fx6A2-KfsqdW1uZJNrWOYI6Op-pyndLCoStVM6HdMAI,643
7
+ tai42_storage_github-0.1.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
8
+ tai42_storage_github-0.1.0.dist-info/licenses/NOTICE,sha256=pp1ZhLVN4DlEOrfF49EwXX5wMgXPzw3ZV_Blu0lJH_k,161
9
+ tai42_storage_github-0.1.0.dist-info/METADATA,sha256=HUHJ9ykK3ITg6zJR2h9u3kn1jki4CBjcE0p2GXOAeS0,5145
10
+ tai42_storage_github-0.1.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
11
+ tai42_storage_github-0.1.0.dist-info/top_level.txt,sha256=buKbUkrqA5slxL7JV2EzalotkY1kYEvR9yZNwRmARiU,21
12
+ tai42_storage_github-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,5 @@
1
+ tai42-storage-github
2
+ Copyright 2026 tai42
3
+
4
+ This product includes software developed at tai42 (https://tai42.ai).
5
+ Licensed under the Apache License, Version 2.0.
@@ -0,0 +1 @@
1
+ tai42_storage_github