tass 0.1.6__py3-none-any.whl → 0.1.7__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.
- src/app.py +117 -43
- src/constants.py +1 -1
- {tass-0.1.6.dist-info → tass-0.1.7.dist-info}/METADATA +3 -3
- tass-0.1.7.dist-info/RECORD +10 -0
- tass-0.1.7.dist-info/licenses/LICENSE +21 -0
- tass-0.1.6.dist-info/RECORD +0 -10
- tass-0.1.6.dist-info/licenses/LICENSE +0 -202
- {tass-0.1.6.dist-info → tass-0.1.7.dist-info}/WHEEL +0 -0
- {tass-0.1.6.dist-info → tass-0.1.7.dist-info}/entry_points.txt +0 -0
src/app.py
CHANGED
|
@@ -4,8 +4,12 @@ import subprocess
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
import requests
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
from rich.console import Console, Group
|
|
9
|
+
from rich.live import Live
|
|
8
10
|
from rich.markdown import Markdown
|
|
11
|
+
from rich.panel import Panel
|
|
12
|
+
from rich.text import Text
|
|
9
13
|
|
|
10
14
|
from src.constants import (
|
|
11
15
|
SYSTEM_PROMPT,
|
|
@@ -52,7 +56,6 @@ class TassApp:
|
|
|
52
56
|
response = requests.get(f"{self.host}/v1/models", timeout=2)
|
|
53
57
|
if response.status_code == 200:
|
|
54
58
|
console.print(f"[green]Connection established to {self.host}[/green]")
|
|
55
|
-
return
|
|
56
59
|
except Exception:
|
|
57
60
|
console.print(f"[red]Unable to verify new host {self.host}. Continuing with it anyway.[/red]")
|
|
58
61
|
|
|
@@ -72,14 +75,17 @@ class TassApp:
|
|
|
72
75
|
f"{self.host}/v1/chat/completions",
|
|
73
76
|
json={
|
|
74
77
|
"messages": self.messages + [{"role": "user", "content": prompt}],
|
|
75
|
-
"
|
|
78
|
+
"tools": TOOLS, # For caching purposes
|
|
79
|
+
"chat_template_kwargs": {
|
|
80
|
+
"reasoning_effort": "medium",
|
|
81
|
+
},
|
|
76
82
|
},
|
|
77
83
|
)
|
|
78
84
|
data = response.json()
|
|
79
85
|
summary = data["choices"][0]["message"]["content"]
|
|
80
86
|
self.messages = [self.messages[0], {"role": "assistant", "content": f"Summary of the conversation so far:\n{summary}"}]
|
|
81
87
|
|
|
82
|
-
def call_llm(self) ->
|
|
88
|
+
def call_llm(self) -> bool:
|
|
83
89
|
response = requests.post(
|
|
84
90
|
f"{self.host}/v1/chat/completions",
|
|
85
91
|
json={
|
|
@@ -87,39 +93,107 @@ class TassApp:
|
|
|
87
93
|
"tools": TOOLS,
|
|
88
94
|
"chat_template_kwargs": {
|
|
89
95
|
"reasoning_effort": "medium",
|
|
90
|
-
}
|
|
96
|
+
},
|
|
97
|
+
"stream": True,
|
|
91
98
|
},
|
|
99
|
+
stream=True,
|
|
92
100
|
)
|
|
93
101
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
content = ""
|
|
103
|
+
reasoning_content = ""
|
|
104
|
+
tool_calls_map = {}
|
|
105
|
+
|
|
106
|
+
def generate_layout(reasoning_content: str, content: str):
|
|
107
|
+
groups = []
|
|
108
|
+
|
|
109
|
+
if reasoning_content:
|
|
110
|
+
groups.append(Text(""))
|
|
111
|
+
groups.append(Panel(Text(reasoning_content, style="grey50"), title="Thought process", title_align="left", style="grey50"))
|
|
112
|
+
|
|
113
|
+
if content:
|
|
114
|
+
groups.append(Text(""))
|
|
115
|
+
groups.append(Markdown(content))
|
|
116
|
+
groups.append(Text(""))
|
|
117
|
+
|
|
118
|
+
return Group(*groups)
|
|
119
|
+
|
|
120
|
+
with Live(generate_layout(reasoning_content, content), refresh_per_second=10) as live:
|
|
121
|
+
for line in response.iter_lines():
|
|
122
|
+
line = line.decode("utf-8")
|
|
123
|
+
if not line.strip():
|
|
124
|
+
continue
|
|
125
|
+
|
|
126
|
+
if line == "data: [DONE]":
|
|
127
|
+
continue
|
|
128
|
+
|
|
129
|
+
chunk = json.loads(line.removeprefix("data:"))
|
|
130
|
+
delta = chunk["choices"][0]["delta"]
|
|
131
|
+
if delta.get("content"):
|
|
132
|
+
content += delta["content"]
|
|
133
|
+
last_three_lines = "\n".join(reasoning_content.rstrip().split("\n")[-3:])
|
|
134
|
+
live.update(generate_layout(last_three_lines, content.rstrip()))
|
|
135
|
+
if delta.get("reasoning_content" ):
|
|
136
|
+
reasoning_content += delta["reasoning_content"]
|
|
137
|
+
last_three_lines = "\n".join(reasoning_content.rstrip().split("\n")[-3:])
|
|
138
|
+
live.update(generate_layout(last_three_lines, content.rstrip()))
|
|
139
|
+
|
|
140
|
+
for tool_call_delta in delta.get("tool_calls", []):
|
|
141
|
+
index = tool_call_delta["index"]
|
|
142
|
+
if index not in tool_calls_map:
|
|
143
|
+
tool_calls_map[index] = (
|
|
144
|
+
{
|
|
145
|
+
"index": index,
|
|
146
|
+
"id": "",
|
|
147
|
+
"type": "",
|
|
148
|
+
"function": {
|
|
149
|
+
"name": "",
|
|
150
|
+
"arguments": "",
|
|
151
|
+
},
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
tool_call = tool_calls_map[index]
|
|
156
|
+
if tool_call_delta.get("id"):
|
|
157
|
+
tool_call["id"] += tool_call_delta["id"]
|
|
158
|
+
if tool_call_delta.get("type"):
|
|
159
|
+
tool_call["type"] += tool_call_delta["type"]
|
|
160
|
+
if tool_call_delta.get("function"):
|
|
161
|
+
function = tool_call_delta["function"]
|
|
162
|
+
if function.get("name"):
|
|
163
|
+
tool_call["function"]["name"] += function["name"]
|
|
164
|
+
if function.get("arguments"):
|
|
165
|
+
tool_call["function"]["arguments"] += function["arguments"]
|
|
166
|
+
|
|
167
|
+
if chunk["choices"][0]["finish_reason"]:
|
|
168
|
+
last_three_lines = "\n".join(reasoning_content.rstrip().split("\n")[-3:])
|
|
169
|
+
live.update(generate_layout(last_three_lines, content.rstrip()))
|
|
98
170
|
|
|
99
|
-
tool_name = message["tool_calls"][0]["function"]["name"]
|
|
100
|
-
tool_args_str = message["tool_calls"][0]["function"]["arguments"]
|
|
101
171
|
self.messages.append(
|
|
102
172
|
{
|
|
103
173
|
"role": "assistant",
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"id": "id1",
|
|
108
|
-
"type": "function",
|
|
109
|
-
"function": {
|
|
110
|
-
"name": tool_name,
|
|
111
|
-
"arguments": tool_args_str
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
]
|
|
174
|
+
"content": content,
|
|
175
|
+
"reasoning_content": reasoning_content,
|
|
176
|
+
"tool_calls": list(tool_calls_map.values()),
|
|
115
177
|
}
|
|
116
178
|
)
|
|
179
|
+
|
|
180
|
+
if not tool_calls_map:
|
|
181
|
+
return True
|
|
182
|
+
|
|
117
183
|
try:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
184
|
+
for tool_call in tool_calls_map.values():
|
|
185
|
+
tool = self.TOOLS_MAP[tool_call["function"]["name"]]
|
|
186
|
+
tool_args = json.loads(tool_call["function"]["arguments"])
|
|
187
|
+
result = tool(**tool_args)
|
|
188
|
+
self.messages.append(
|
|
189
|
+
{
|
|
190
|
+
"role": "tool",
|
|
191
|
+
"tool_call_id": tool_call["id"],
|
|
192
|
+
"name": tool_call["function"]["name"],
|
|
193
|
+
"content": result,
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
return False
|
|
123
197
|
except Exception as e:
|
|
124
198
|
self.messages.append({"role": "user", "content": str(e)})
|
|
125
199
|
return self.call_llm()
|
|
@@ -139,14 +213,15 @@ class TassApp:
|
|
|
139
213
|
)
|
|
140
214
|
except Exception as e:
|
|
141
215
|
console.print(" [red]read_file failed[/red]")
|
|
142
|
-
console.print(f" [red]{str(e)}[/red]")
|
|
216
|
+
console.print(f" [red]{str(e).strip()}[/red]")
|
|
143
217
|
return f"read_file failed: {str(e)}"
|
|
144
218
|
|
|
145
219
|
out = result.stdout
|
|
146
|
-
err = result.stderr
|
|
220
|
+
err = result.stderr.strip()
|
|
147
221
|
if result.returncode != 0:
|
|
148
222
|
console.print(" [red]read_file failed[/red]")
|
|
149
|
-
|
|
223
|
+
if err:
|
|
224
|
+
console.print(f" [red]{err}[/red]")
|
|
150
225
|
return f"read_file failed: {err}"
|
|
151
226
|
|
|
152
227
|
lines = []
|
|
@@ -204,7 +279,7 @@ class TassApp:
|
|
|
204
279
|
|
|
205
280
|
prev_line_num = line_num if line_num == 1 else line_num - 1
|
|
206
281
|
line_before = "" if i == 0 else f" {original_lines[i - 1]}\n"
|
|
207
|
-
line_after = "" if
|
|
282
|
+
line_after = "" if edit["line_end"] == len(original_lines) else f"\n {original_lines[edit['line_end']]}"
|
|
208
283
|
replaced_with_minuses = "\n".join([f"-{line}" for line in replaced_lines]) if file_exists else ""
|
|
209
284
|
replace_with_pluses = "\n".join([f"+{line}" for line in edit["replace"].split("\n")])
|
|
210
285
|
diff_text = f"{diff_text}\n\n@@ -{prev_line_num},{len(replaced_lines)} +{prev_line_num},{len(replace_lines)} @@\n{line_before}{replaced_with_minuses}\n{replace_with_pluses}{line_after}"
|
|
@@ -223,8 +298,8 @@ class TassApp:
|
|
|
223
298
|
f.write("\n".join(final_lines))
|
|
224
299
|
except Exception as e:
|
|
225
300
|
console.print(" [red]edit_file failed[/red]")
|
|
226
|
-
console.print(f" [red]{str(e)}[/red]")
|
|
227
|
-
return f"edit_file failed: {str(e)}"
|
|
301
|
+
console.print(f" [red]{str(e).strip()}[/red]")
|
|
302
|
+
return f"edit_file failed: {str(e).strip()}"
|
|
228
303
|
|
|
229
304
|
console.print(" [green]Command succeeded[/green]")
|
|
230
305
|
return f"Successfully edited {path}"
|
|
@@ -256,16 +331,17 @@ class TassApp:
|
|
|
256
331
|
)
|
|
257
332
|
except Exception as e:
|
|
258
333
|
console.print(" [red]subprocess.run failed[/red]")
|
|
259
|
-
console.print(f" [red]{str(e)}[/red]")
|
|
260
|
-
return f"subprocess.run failed: {str(e)}"
|
|
334
|
+
console.print(f" [red]{str(e).strip()}[/red]")
|
|
335
|
+
return f"subprocess.run failed: {str(e).strip()}"
|
|
261
336
|
|
|
262
337
|
out = result.stdout
|
|
263
|
-
err = result.stderr
|
|
338
|
+
err = result.stderr.strip()
|
|
264
339
|
if result.returncode == 0:
|
|
265
340
|
console.print(" [green]Command succeeded[/green]")
|
|
266
341
|
else:
|
|
267
342
|
console.print(f" [red]Command failed[/red] (code {result.returncode})")
|
|
268
|
-
|
|
343
|
+
if err:
|
|
344
|
+
console.print(f" [red]{err}[/red]")
|
|
269
345
|
|
|
270
346
|
if len(out.split("\n")) > 1000:
|
|
271
347
|
out_first_1000 = "\n".join(out.split("\n")[:1000])
|
|
@@ -286,13 +362,14 @@ class TassApp:
|
|
|
286
362
|
def run(self):
|
|
287
363
|
try:
|
|
288
364
|
self._check_llm_host()
|
|
365
|
+
console.print()
|
|
289
366
|
except KeyboardInterrupt:
|
|
290
367
|
console.print("\nBye!")
|
|
291
368
|
return
|
|
292
369
|
|
|
293
370
|
while True:
|
|
294
371
|
try:
|
|
295
|
-
user_input = console.input("
|
|
372
|
+
user_input = console.input("> ").strip()
|
|
296
373
|
except KeyboardInterrupt:
|
|
297
374
|
console.print("\nBye!")
|
|
298
375
|
break
|
|
@@ -308,14 +385,11 @@ class TassApp:
|
|
|
308
385
|
|
|
309
386
|
while True:
|
|
310
387
|
try:
|
|
311
|
-
|
|
388
|
+
finished = self.call_llm()
|
|
312
389
|
except Exception as e:
|
|
313
390
|
console.print(f"Failed to call LLM: {str(e)}")
|
|
314
391
|
break
|
|
315
392
|
|
|
316
|
-
if
|
|
317
|
-
console.print("")
|
|
318
|
-
console.print(Markdown(llm_resp))
|
|
319
|
-
self.messages.append({"role": "assistant", "content": llm_resp})
|
|
393
|
+
if finished:
|
|
320
394
|
self.summarize()
|
|
321
395
|
break
|
src/constants.py
CHANGED
|
@@ -2,7 +2,7 @@ from pathlib import Path
|
|
|
2
2
|
|
|
3
3
|
_cwd_path = Path.cwd().resolve()
|
|
4
4
|
|
|
5
|
-
SYSTEM_PROMPT = f"""You are Terminal
|
|
5
|
+
SYSTEM_PROMPT = f"""You are tass, or Terminal Assistant, a helpful AI that executes shell commands based on natural-language requests.
|
|
6
6
|
|
|
7
7
|
If the user's request involves making changes to the filesystem such as creating or deleting files or directories, you MUST first check whether the file or directory exists before proceeding.
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tass
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: A terminal assistant that allows you to ask an LLM to run commands.
|
|
5
5
|
Project-URL: Homepage, https://github.com/cetincan0/tass
|
|
6
6
|
Author: Can Cetin
|
|
7
|
-
License:
|
|
7
|
+
License: MIT
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Requires-Python: >=3.10
|
|
10
10
|
Requires-Dist: requests>=2.32.5
|
|
@@ -22,7 +22,7 @@ This tool can run commands including ones that can modify, move, or delete files
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
24
24
|
```
|
|
25
|
-
uv
|
|
25
|
+
uv tool install tass
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
You can run it with
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
src/__init__.py,sha256=tu2q9W5_pkq30l3tRMTGahColBAAubbLP6LaB3l3IFg,89
|
|
2
|
+
src/app.py,sha256=FiLsJ3islthq0xtGWrZPbb0b8nGq83lZI49UaypEUkA,14647
|
|
3
|
+
src/cli.py,sha256=op3fYcyfek_KqCCiA-Zdlc9jVZSCi036whMmR2ZjjAs,76
|
|
4
|
+
src/constants.py,sha256=pzriopu167r3yOOcnC80sMjPKEZoDmYV8e8i5aK0rvM,4629
|
|
5
|
+
src/utils.py,sha256=rKq34DVmFbsWPy7R6Bfdvv1ztzFLPT4hUd8BFpPHjqs,681
|
|
6
|
+
tass-0.1.7.dist-info/METADATA,sha256=mlHbC9XpdUsFUMwKTjjhyWPsaVkHjDZH6iZ26Op8Dd4,1071
|
|
7
|
+
tass-0.1.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
8
|
+
tass-0.1.7.dist-info/entry_points.txt,sha256=pviKuIOuHvaQ7_YiFxatJEY8XYfh3EzVWy4LJh0v-A0,38
|
|
9
|
+
tass-0.1.7.dist-info/licenses/LICENSE,sha256=Cdr-_YJHgGaf2vJjcoOsRJySkDaogUhu3yIDvpz7GEQ,1066
|
|
10
|
+
tass-0.1.7.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Can Cetin
|
|
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.
|
tass-0.1.6.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
src/__init__.py,sha256=tu2q9W5_pkq30l3tRMTGahColBAAubbLP6LaB3l3IFg,89
|
|
2
|
-
src/app.py,sha256=SZGIStkRskTraOARKR-sh8hjfQT7EXwJBG-oymIABhU,11466
|
|
3
|
-
src/cli.py,sha256=op3fYcyfek_KqCCiA-Zdlc9jVZSCi036whMmR2ZjjAs,76
|
|
4
|
-
src/constants.py,sha256=2MWn3-tvZjJ2xW68BE7S1V8CgqDuBt3cBG5Bx8ILrKY,4620
|
|
5
|
-
src/utils.py,sha256=rKq34DVmFbsWPy7R6Bfdvv1ztzFLPT4hUd8BFpPHjqs,681
|
|
6
|
-
tass-0.1.6.dist-info/METADATA,sha256=xu-OHc1sIrlDrxXVCUSdPmzYnjVam5tYB96EYJiTWCc,1079
|
|
7
|
-
tass-0.1.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
8
|
-
tass-0.1.6.dist-info/entry_points.txt,sha256=pviKuIOuHvaQ7_YiFxatJEY8XYfh3EzVWy4LJh0v-A0,38
|
|
9
|
-
tass-0.1.6.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
10
|
-
tass-0.1.6.dist-info/RECORD,,
|
|
@@ -1,202 +0,0 @@
|
|
|
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.
|
|
File without changes
|
|
File without changes
|