memgarden 0.12.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- memgarden-0.12.2/.github/workflows/release.yml +167 -0
- memgarden-0.12.2/.github/workflows/tests.yml +74 -0
- memgarden-0.12.2/.gitignore +6 -0
- memgarden-0.12.2/LICENSE +202 -0
- memgarden-0.12.2/PKG-INFO +610 -0
- memgarden-0.12.2/README.md +382 -0
- memgarden-0.12.2/docs/RELEASING.md +74 -0
- memgarden-0.12.2/evals/README.md +92 -0
- memgarden-0.12.2/evals/baseline.json +169 -0
- memgarden-0.12.2/evals/capture.py +183 -0
- memgarden-0.12.2/evals/corpus/cards.jsonl +17 -0
- memgarden-0.12.2/evals/corpus/conversations.jsonl +5 -0
- memgarden-0.12.2/evals/corpus/gate.jsonl +11 -0
- memgarden-0.12.2/evals/corpus/gate_leak.jsonl +5 -0
- memgarden-0.12.2/evals/corpus/queries.jsonl +10 -0
- memgarden-0.12.2/evals/garden_language.py +66 -0
- memgarden-0.12.2/evals/gate.py +104 -0
- memgarden-0.12.2/evals/recall.py +231 -0
- memgarden-0.12.2/evals/run.py +182 -0
- memgarden-0.12.2/examples/demo-agent/README.md +53 -0
- memgarden-0.12.2/examples/demo-agent/agent.py +177 -0
- memgarden-0.12.2/examples/demo-agent/model.py +74 -0
- memgarden-0.12.2/examples/demo-agent/store.py +67 -0
- memgarden-0.12.2/examples/mount_in_ten_minutes.py +153 -0
- memgarden-0.12.2/examples/quickstart.py +115 -0
- memgarden-0.12.2/packages/agent-protocol-core/LICENSE +202 -0
- memgarden-0.12.2/packages/agent-protocol-core/README.md +26 -0
- memgarden-0.12.2/packages/agent-protocol-core/pyproject.toml +27 -0
- memgarden-0.12.2/packages/agent-protocol-core/src/agent_protocol_core/__init__.py +11 -0
- memgarden-0.12.2/packages/agent-protocol-core/src/agent_protocol_core/protocol_leak.py +280 -0
- memgarden-0.12.2/packages/agent-protocol-core/src/agent_protocol_core/self_thinking.py +320 -0
- memgarden-0.12.2/pyproject.toml +54 -0
- memgarden-0.12.2/src/memgarden/__init__.py +93 -0
- memgarden-0.12.2/src/memgarden/adapt.py +120 -0
- memgarden-0.12.2/src/memgarden/cli/__init__.py +219 -0
- memgarden-0.12.2/src/memgarden/cli/__main__.py +4 -0
- memgarden-0.12.2/src/memgarden/component.py +955 -0
- memgarden-0.12.2/src/memgarden/config.py +72 -0
- memgarden-0.12.2/src/memgarden/contract/__init__.py +90 -0
- memgarden-0.12.2/src/memgarden/contract/gardens.jsonl +15 -0
- memgarden-0.12.2/src/memgarden/contracts.py +524 -0
- memgarden-0.12.2/src/memgarden/dreaming.py +164 -0
- memgarden-0.12.2/src/memgarden/garden_language.py +158 -0
- memgarden-0.12.2/src/memgarden/guards/__init__.py +1 -0
- memgarden-0.12.2/src/memgarden/guards/dream_gates.py +91 -0
- memgarden-0.12.2/src/memgarden/mcp/__init__.py +148 -0
- memgarden-0.12.2/src/memgarden/naming.py +261 -0
- memgarden-0.12.2/src/memgarden/observability.py +163 -0
- memgarden-0.12.2/src/memgarden/policies.py +334 -0
- memgarden-0.12.2/src/memgarden/ports.py +79 -0
- memgarden-0.12.2/src/memgarden/prompts/__init__.py +1 -0
- memgarden-0.12.2/src/memgarden/prompts/buckets.py +226 -0
- memgarden-0.12.2/src/memgarden/prompts/capture.py +331 -0
- memgarden-0.12.2/src/memgarden/prompts/dream.py +257 -0
- memgarden-0.12.2/src/memgarden/prompts/migrate.py +169 -0
- memgarden-0.12.2/src/memgarden/records.py +232 -0
- memgarden-0.12.2/src/memgarden/scoring/__init__.py +1 -0
- memgarden-0.12.2/src/memgarden/scoring/relevance.py +600 -0
- memgarden-0.12.2/src/memgarden/scoring/selector.py +296 -0
- memgarden-0.12.2/src/memgarden/selection.py +240 -0
- memgarden-0.12.2/src/memgarden/storage.py +441 -0
- memgarden-0.12.2/src/memgarden/stores/__init__.py +0 -0
- memgarden-0.12.2/src/memgarden/stores/memory.py +112 -0
- memgarden-0.12.2/src/memgarden/stores/sqlite.py +196 -0
- memgarden-0.12.2/src/memgarden/text/__init__.py +1 -0
- memgarden-0.12.2/src/memgarden/text/card_guard.py +105 -0
- memgarden-0.12.2/src/memgarden/text/card_text.py +380 -0
- memgarden-0.12.2/src/memgarden/text/leak_signals.py +102 -0
- memgarden-0.12.2/src/memgarden/timestamps.py +66 -0
- memgarden-0.12.2/tests/test_cli.py +182 -0
- memgarden-0.12.2/tests/test_component.py +765 -0
- memgarden-0.12.2/tests/test_mcp.py +139 -0
- memgarden-0.12.2/tests/test_no_host_leakage.py +44 -0
- memgarden-0.12.2/tests/test_purity.py +425 -0
- memgarden-0.12.2/tests/test_selection_paths_agree.py +144 -0
- memgarden-0.12.2/tests/test_store_contract.py +218 -0
- memgarden-0.12.2/uv.lock +166 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
# 打 tag 时由 CI 构建并发布 wheel,同时生成构建出处凭证(provenance attestation)。
|
|
4
|
+
#
|
|
5
|
+
# 为什么不在本机编好再传:哈希锁只能证明「装进镜像的字节 = Release 上那份字节」,
|
|
6
|
+
# 证明不了「这份字节是由公开 tag 的源码编出来的」。本机编 + 手工上传时,有仓库
|
|
7
|
+
# 权限的人可以传一个跟源码对不上的 wheel,别人看源码看不出问题。
|
|
8
|
+
#
|
|
9
|
+
# 由 tag 触发的 CI 编译 + GitHub 签发的 attestation 把这一环补上:凭证里绑定了
|
|
10
|
+
# 仓库、workflow、commit 和产物摘要,任何人都能用
|
|
11
|
+
# gh attestation verify <wheel> --repo teleport-computer/memgarden
|
|
12
|
+
# 独立验证这个 wheel 确实由这个仓库的这个 commit 编出来。
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
push:
|
|
16
|
+
tags: ["v*"]
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
inputs:
|
|
19
|
+
tag:
|
|
20
|
+
description: "要重新发布的 tag(不填则用当前 ref)"
|
|
21
|
+
required: false
|
|
22
|
+
|
|
23
|
+
permissions:
|
|
24
|
+
contents: write # 建 Release、传产物
|
|
25
|
+
id-token: write # 换取 OIDC token 用于签发凭证
|
|
26
|
+
attestations: write # 写 attestation
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
build:
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@v4
|
|
33
|
+
with:
|
|
34
|
+
ref: ${{ github.event.inputs.tag || github.ref }}
|
|
35
|
+
|
|
36
|
+
- uses: actions/setup-python@v5
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.12"
|
|
39
|
+
|
|
40
|
+
- name: Install uv
|
|
41
|
+
run: pipx install uv
|
|
42
|
+
|
|
43
|
+
- name: Tag 与 pyproject 版本必须一致
|
|
44
|
+
# 不一致就停:否则会出现「tag 是 v0.1.3、wheel 却是 0.1.2」这种
|
|
45
|
+
# 凭证与产物名对不上的情况,验证方无从判断该信哪个。
|
|
46
|
+
run: |
|
|
47
|
+
TAG="${GITHUB_REF_NAME#v}"
|
|
48
|
+
PKG=$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2)
|
|
49
|
+
CORE=$(grep -m1 '^version = ' packages/agent-protocol-core/pyproject.toml | cut -d'"' -f2)
|
|
50
|
+
echo "tag=$TAG memgarden=$PKG agent-protocol-core=$CORE"
|
|
51
|
+
test "$TAG" = "$PKG" || { echo "::error::tag $TAG 与 memgarden 版本 $PKG 不一致"; exit 1; }
|
|
52
|
+
test "$TAG" = "$CORE" || { echo "::error::tag $TAG 与 agent-protocol-core 版本 $CORE 不一致"; exit 1; }
|
|
53
|
+
|
|
54
|
+
- name: 跑测试
|
|
55
|
+
# 发一个测试不过的包出去比不发更糟 —— 装它的人会以为它是可用的。
|
|
56
|
+
# --extra dev 才会带上 pytest(本机 venv 里碰巧有,CI 是干净环境)
|
|
57
|
+
run: uv run --extra dev pytest tests/ -q
|
|
58
|
+
|
|
59
|
+
- name: 示例必须能脱离宿主跑通
|
|
60
|
+
# 这是包对外的核心承诺(无 io、无 API key、无网络),
|
|
61
|
+
# 发版时验一次,比等使用者发现便宜得多。
|
|
62
|
+
run: uv run python examples/quickstart.py
|
|
63
|
+
|
|
64
|
+
- name: 构建两个包
|
|
65
|
+
run: |
|
|
66
|
+
uv build
|
|
67
|
+
(cd packages/agent-protocol-core && uv build)
|
|
68
|
+
# out/ 给 Release 和 attestation(两个包一起);
|
|
69
|
+
# out-core/ 和 out-mem/ 给 PyPI —— **必须分开**,见下面 publish 那两个 job。
|
|
70
|
+
mkdir -p out out-core out-mem
|
|
71
|
+
cp dist/* out/
|
|
72
|
+
cp packages/agent-protocol-core/dist/* out/
|
|
73
|
+
cp packages/agent-protocol-core/dist/* out-core/
|
|
74
|
+
cp dist/* out-mem/
|
|
75
|
+
|
|
76
|
+
- name: 传产物给发布 job
|
|
77
|
+
uses: actions/upload-artifact@v4
|
|
78
|
+
with:
|
|
79
|
+
name: dists
|
|
80
|
+
path: |
|
|
81
|
+
out-core/
|
|
82
|
+
out-mem/
|
|
83
|
+
|
|
84
|
+
- name: 生成构建出处凭证
|
|
85
|
+
uses: actions/attest-build-provenance@v1
|
|
86
|
+
with:
|
|
87
|
+
subject-path: "out/*"
|
|
88
|
+
|
|
89
|
+
- name: 记录产物摘要
|
|
90
|
+
# 打进 job 日志,方便对照 Release 页和宿主 lock 里的哈希。
|
|
91
|
+
run: |
|
|
92
|
+
echo "### 产物摘要" >> "$GITHUB_STEP_SUMMARY"
|
|
93
|
+
echo '```' >> "$GITHUB_STEP_SUMMARY"
|
|
94
|
+
sha256sum out/* >> "$GITHUB_STEP_SUMMARY"
|
|
95
|
+
echo '```' >> "$GITHUB_STEP_SUMMARY"
|
|
96
|
+
sha256sum out/*
|
|
97
|
+
|
|
98
|
+
- name: 发布到 Release
|
|
99
|
+
env:
|
|
100
|
+
GH_TOKEN: ${{ github.token }}
|
|
101
|
+
run: |
|
|
102
|
+
TAG="${GITHUB_REF_NAME}"
|
|
103
|
+
if gh release view "$TAG" >/dev/null 2>&1; then
|
|
104
|
+
gh release upload "$TAG" out/* --clobber
|
|
105
|
+
else
|
|
106
|
+
gh release create "$TAG" out/* --title "memgarden $TAG" --generate-notes
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
# --------------------------------------------------------------------------
|
|
110
|
+
# PyPI 发布拆成两个 job,各带一个 environment
|
|
111
|
+
#
|
|
112
|
+
# ## 为什么必须拆
|
|
113
|
+
#
|
|
114
|
+
# PyPI 的 Trusted Publisher 是按「owner + 仓库 + workflow + environment」匹配的。
|
|
115
|
+
# 两个包在**同一个仓库、同一个 workflow**里,如果都不填 environment,
|
|
116
|
+
# 两条配置除了项目名完全一样 —— PyPI 判为歧义,直接拒绝注册第二条:
|
|
117
|
+
#
|
|
118
|
+
# A pending trusted publisher matching this configuration has already
|
|
119
|
+
# been registered for a different project name.
|
|
120
|
+
#
|
|
121
|
+
# 加上不同的 environment,两条配置就能区分开了。
|
|
122
|
+
#
|
|
123
|
+
# ## 顺带解决了发布顺序
|
|
124
|
+
#
|
|
125
|
+
# memgarden 依赖 agent-protocol-core 的**精确版本**。core 先发(needs 保证),
|
|
126
|
+
# 否则 PyPI 上会短暂存在一个装不上的 memgarden。
|
|
127
|
+
#
|
|
128
|
+
# ## 仓库里仍然不存 token
|
|
129
|
+
#
|
|
130
|
+
# 走 OIDC。id-token: write 是每个 job 各自声明的 —— 顶层的 permissions
|
|
131
|
+
# 不会自动传给这里。
|
|
132
|
+
|
|
133
|
+
publish-core:
|
|
134
|
+
needs: build
|
|
135
|
+
runs-on: ubuntu-latest
|
|
136
|
+
environment: pypi-core
|
|
137
|
+
permissions:
|
|
138
|
+
id-token: write
|
|
139
|
+
steps:
|
|
140
|
+
- uses: actions/download-artifact@v4
|
|
141
|
+
with:
|
|
142
|
+
name: dists
|
|
143
|
+
- name: 发布 agent-protocol-core 到 PyPI
|
|
144
|
+
# 没配 PyPI 侧时这一步会失败,**失败方向是安全的**:发不出去,
|
|
145
|
+
# 而不是用错凭据发出去。Release 已经在 build job 里发完了,不受影响。
|
|
146
|
+
continue-on-error: true
|
|
147
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
148
|
+
with:
|
|
149
|
+
packages-dir: out-core/
|
|
150
|
+
skip-existing: true
|
|
151
|
+
|
|
152
|
+
publish-memgarden:
|
|
153
|
+
needs: publish-core # core 必须先在 PyPI 上,否则 memgarden 装不上
|
|
154
|
+
runs-on: ubuntu-latest
|
|
155
|
+
environment: pypi-memgarden
|
|
156
|
+
permissions:
|
|
157
|
+
id-token: write
|
|
158
|
+
steps:
|
|
159
|
+
- uses: actions/download-artifact@v4
|
|
160
|
+
with:
|
|
161
|
+
name: dists
|
|
162
|
+
- name: 发布 memgarden 到 PyPI
|
|
163
|
+
continue-on-error: true
|
|
164
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
165
|
+
with:
|
|
166
|
+
packages-dir: out-mem/
|
|
167
|
+
skip-existing: true
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: tests
|
|
2
|
+
|
|
3
|
+
# 每次 push / PR 都跑。发版 workflow 也会再跑一次 —— 那次是发版前的最后一道闸,
|
|
4
|
+
# 不是重复:Release 是不可回收的,测试不过的包发出去,装它的人会以为它可用。
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: ["main"]
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
- run: pipx install uv
|
|
23
|
+
- name: 契约测试 + 纯度守卫
|
|
24
|
+
# --extra dev 才会带上 pytest(本机 venv 里碰巧有,CI 是干净环境)
|
|
25
|
+
run: uv run --extra dev pytest tests/ -q
|
|
26
|
+
- name: 示例必须能脱离宿主跑通
|
|
27
|
+
# 「无 io、无 API key、无网络」是这个包对外的核心承诺。
|
|
28
|
+
# 只跑单测证明不了它 —— 单测本来就在仓库里跑。
|
|
29
|
+
run: uv run python examples/quickstart.py
|
|
30
|
+
- name: 不花钱的四层 eval(挑卡 / 落库闸 / 语言 / 语料自查)
|
|
31
|
+
# 这不是重复单测。单测证明"函数按写的那样跑";这几层证明"跑出来的结果是对的"。
|
|
32
|
+
# 半年里最贵的三次事故都属于后者:管道全通、单测全绿,而用户召不回自己的
|
|
33
|
+
# 记忆、花园自己翻了语言、真记忆被闸门静默吃掉。
|
|
34
|
+
run: uv run --extra dev python evals/run.py --baseline evals/baseline.json
|
|
35
|
+
|
|
36
|
+
- name: 落卡质量 eval(真模型)
|
|
37
|
+
# 没 key 就 SKIP 并明说 —— 提示词行为的 bug 只有真模型能暴露,
|
|
38
|
+
# 单测把 agent stub 掉了,什么都验不到。
|
|
39
|
+
env:
|
|
40
|
+
DEEPSEEK_API_KEY: ${{ secrets.EVAL_DEEPSEEK_API_KEY }}
|
|
41
|
+
run: uv run --extra dev python evals/capture.py --provider deepseek --model deepseek-chat
|
|
42
|
+
- name: 装完之后 CLI 真的能敲
|
|
43
|
+
# [project.scripts] 写错、入口 import 不到,只有真装一次才发现 ——
|
|
44
|
+
# 而「装完能不能用」正是别人愿不愿意继续读下去的门槛。
|
|
45
|
+
run: |
|
|
46
|
+
# 旧版本 wheel 留在 dist 里会让 pip 解析打架
|
|
47
|
+
rm -rf dist packages/agent-protocol-core/dist
|
|
48
|
+
# **两个包都要构建** —— 根目录的 uv build 只出主包,
|
|
49
|
+
# 而 memgarden 依赖同源的 agent-protocol-core。漏掉它就装不上。
|
|
50
|
+
uv build
|
|
51
|
+
(cd packages/agent-protocol-core && uv build)
|
|
52
|
+
mkdir -p /tmp/wheels
|
|
53
|
+
cp dist/*.whl /tmp/wheels/
|
|
54
|
+
cp packages/agent-protocol-core/dist/*.whl /tmp/wheels/
|
|
55
|
+
python -m venv /tmp/cli-check
|
|
56
|
+
# --no-index 是必须的:agent-protocol-core 没发到 PyPI,
|
|
57
|
+
# 不加的话 pip 会去索引上找它、找不到就整个装失败。
|
|
58
|
+
/tmp/cli-check/bin/pip install --no-index --find-links /tmp/wheels memgarden
|
|
59
|
+
# ① 命令能敲([project.scripts] 写错只有真装一次才发现)
|
|
60
|
+
/tmp/cli-check/bin/memgarden manifest > /dev/null
|
|
61
|
+
# ② 能当库用,且**只 import 顶层** —— 这是对外承诺的接入方式
|
|
62
|
+
/tmp/cli-check/bin/python -c "from memgarden import GardenComponent, CaptureRequest"
|
|
63
|
+
echo "CLI + SDK OK"
|
|
64
|
+
|
|
65
|
+
- name: wheel 能构建,且带许可证
|
|
66
|
+
run: |
|
|
67
|
+
uv build
|
|
68
|
+
python - <<'PY'
|
|
69
|
+
import zipfile, glob, sys
|
|
70
|
+
whl = glob.glob("dist/*.whl")[0]
|
|
71
|
+
names = zipfile.ZipFile(whl).namelist()
|
|
72
|
+
assert any("LICENSE" in n for n in names), f"wheel 里没有 LICENSE:{whl}"
|
|
73
|
+
print(f"OK {whl} 带许可证")
|
|
74
|
+
PY
|
memgarden-0.12.2/LICENSE
ADDED
|
@@ -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.
|