ffwf-tau-web 0.17.0__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.
- ffwf_tau_web-0.17.0/.gitignore +15 -0
- ffwf_tau_web-0.17.0/LICENSE +21 -0
- ffwf_tau_web-0.17.0/PKG-INFO +35 -0
- ffwf_tau_web-0.17.0/README.md +21 -0
- ffwf_tau_web-0.17.0/pyproject.toml +42 -0
- ffwf_tau_web-0.17.0/src/tau_web/__init__.py +50 -0
- ffwf_tau_web-0.17.0/src/tau_web/__main__.py +11 -0
- ffwf_tau_web-0.17.0/src/tau_web/_built.py +4 -0
- ffwf_tau_web-0.17.0/src/tau_web/dist/assets/index-BeM9DzPM.css +1 -0
- ffwf_tau_web-0.17.0/src/tau_web/dist/assets/index-Da9jLwNV.js +72 -0
- ffwf_tau_web-0.17.0/src/tau_web/dist/index.html +20 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 John McCardle
|
|
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.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ffwf-tau-web
|
|
3
|
+
Version: 0.17.0
|
|
4
|
+
Summary: tau-code's web client, built, for `tau serve` to serve with no flags.
|
|
5
|
+
Project-URL: Source, https://github.com/jmccardle/tau-code
|
|
6
|
+
Author: Fight Fire with Fire Robotics, LLC
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Environment :: Web Environment
|
|
10
|
+
Classifier: Programming Language :: JavaScript
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.12
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# ffwf-tau-web
|
|
16
|
+
|
|
17
|
+
The web client for [τ](https://pypi.org/project/ffwf-tau/), built, as the Python package
|
|
18
|
+
`tau_web`. With it installed beside τ, `tau serve` serves the client at `/` with no flags:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install ffwf-tau # depends on ffwf-tau-web
|
|
22
|
+
tau serve # open the printed http://127.0.0.1:…/#token=… address
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
It holds files only (`tau_web/dist/`) and runs no Node. Its version follows τ's: ffwf-tau-web
|
|
26
|
+
0.17.x speaks protocol 2 and pairs with ffwf-tau 0.17.x.
|
|
27
|
+
|
|
28
|
+
Check that it matches the τ installed beside it:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
python -m tau_web # exit 0 if the client and τ speak the same protocol
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Built from [tau-code](https://github.com/jmccardle/tau-code) `packages/web`; see
|
|
35
|
+
`packages/web-py` there.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ffwf-tau-web
|
|
2
|
+
|
|
3
|
+
The web client for [τ](https://pypi.org/project/ffwf-tau/), built, as the Python package
|
|
4
|
+
`tau_web`. With it installed beside τ, `tau serve` serves the client at `/` with no flags:
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
pip install ffwf-tau # depends on ffwf-tau-web
|
|
8
|
+
tau serve # open the printed http://127.0.0.1:…/#token=… address
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It holds files only (`tau_web/dist/`) and runs no Node. Its version follows τ's: ffwf-tau-web
|
|
12
|
+
0.17.x speaks protocol 2 and pairs with ffwf-tau 0.17.x.
|
|
13
|
+
|
|
14
|
+
Check that it matches the τ installed beside it:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
python -m tau_web # exit 0 if the client and τ speak the same protocol
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Built from [tau-code](https://github.com/jmccardle/tau-code) `packages/web`; see
|
|
21
|
+
`packages/web-py` there.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# ffwf-tau-web: tau-code's web client, built, as a Python package `tau_web` that τ serves.
|
|
2
|
+
#
|
|
3
|
+
# Data only: `tau_web/dist/` is packages/web/dist without its sourcemaps, copied in by
|
|
4
|
+
# scripts/build-web-wheel.mjs, which also writes `tau_web/_built.py` (the protocol the client
|
|
5
|
+
# speaks). Neither is committed, so this directory does not build on its own: run
|
|
6
|
+
# `npm run package:web-wheel` from the repository root. The sdist carries both, so building a wheel from the sdist needs no Node.
|
|
7
|
+
#
|
|
8
|
+
# THE VERSION IS τ'S, NOT tau-code's. ffwf-tau-web 0.17.x speaks protocol 2 and pairs with
|
|
9
|
+
# ffwf-tau 0.17.x; ffwf-tau depends on this package, so there is deliberately no dependency on
|
|
10
|
+
# ffwf-tau here (it would be circular). Release order: ffwf-tau-web first, then ffwf-tau.
|
|
11
|
+
[build-system]
|
|
12
|
+
requires = ["hatchling>=1.26"]
|
|
13
|
+
build-backend = "hatchling.build"
|
|
14
|
+
|
|
15
|
+
[project]
|
|
16
|
+
name = "ffwf-tau-web"
|
|
17
|
+
version = "0.17.0"
|
|
18
|
+
description = "tau-code's web client, built, for `tau serve` to serve with no flags."
|
|
19
|
+
readme = "README.md"
|
|
20
|
+
license = "MIT"
|
|
21
|
+
license-files = ["LICENSE"]
|
|
22
|
+
requires-python = ">=3.12"
|
|
23
|
+
authors = [{ name = "Fight Fire with Fire Robotics, LLC" }]
|
|
24
|
+
dependencies = []
|
|
25
|
+
classifiers = [
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: JavaScript",
|
|
28
|
+
"Environment :: Web Environment",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Source = "https://github.com/jmccardle/tau-code"
|
|
33
|
+
|
|
34
|
+
[tool.hatch.build]
|
|
35
|
+
# Generated by the build script and gitignored, which hatchling would otherwise leave out.
|
|
36
|
+
artifacts = ["src/tau_web/dist/**", "src/tau_web/_built.py", "LICENSE"]
|
|
37
|
+
|
|
38
|
+
[tool.hatch.build.targets.sdist]
|
|
39
|
+
include = ["src/tau_web", "README.md", "LICENSE", "pyproject.toml"]
|
|
40
|
+
|
|
41
|
+
[tool.hatch.build.targets.wheel]
|
|
42
|
+
packages = ["src/tau_web"]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""tau-code's web client, built: `dist/` is what `tau serve` serves at `/` (it finds this package
|
|
2
|
+
by name, `tau_web`, and needs `dist/index.html`).
|
|
3
|
+
|
|
4
|
+
`PROTOCOL` is the wire protocol the client speaks; `CLIENT_VERSION` is the tau-code version it was
|
|
5
|
+
built from. `check()` (or `python -m tau_web`) compares `PROTOCOL` with the τ installed beside it.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import json
|
|
9
|
+
import shutil
|
|
10
|
+
import subprocess
|
|
11
|
+
import sysconfig
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from typing import Final
|
|
14
|
+
|
|
15
|
+
from tau_web._built import CLIENT_VERSION, PROTOCOL
|
|
16
|
+
|
|
17
|
+
__all__ = ["CLIENT_VERSION", "DIST", "PROTOCOL", "ProtocolMismatch", "check", "tau_protocol"]
|
|
18
|
+
|
|
19
|
+
DIST: Final = Path(__file__).parent / "dist"
|
|
20
|
+
"""The built client: `index.html` and its assets."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ProtocolMismatch(RuntimeError):
|
|
24
|
+
"""The client and the installed τ speak different protocols, or there is no τ to ask."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def tau_protocol(tau: str | None = None) -> int:
|
|
28
|
+
"""The protocol of the τ at `tau`, else the `tau` beside this interpreter, else on PATH: the
|
|
29
|
+
`x-protocol` of what `tau serve --schema` prints. `ProtocolMismatch` if there is none."""
|
|
30
|
+
found = tau or shutil.which("tau", path=sysconfig.get_path("scripts")) or shutil.which("tau")
|
|
31
|
+
if found is None:
|
|
32
|
+
raise ProtocolMismatch("no `tau` beside this Python or on PATH: install ffwf-tau")
|
|
33
|
+
printed = subprocess.run(
|
|
34
|
+
[found, "serve", "--schema"], capture_output=True, text=True, check=True, timeout=60
|
|
35
|
+
).stdout
|
|
36
|
+
protocol = json.loads(printed).get("x-protocol")
|
|
37
|
+
if not isinstance(protocol, int):
|
|
38
|
+
raise ProtocolMismatch(f"`{found} serve --schema` names no x-protocol")
|
|
39
|
+
return protocol
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def check(tau: str | None = None) -> int:
|
|
43
|
+
"""The protocol both speak; `ProtocolMismatch` if τ's is not `PROTOCOL`."""
|
|
44
|
+
theirs = tau_protocol(tau)
|
|
45
|
+
if theirs != PROTOCOL:
|
|
46
|
+
raise ProtocolMismatch(
|
|
47
|
+
f"this web client (tau-code {CLIENT_VERSION}) speaks protocol {PROTOCOL}, "
|
|
48
|
+
f"the installed τ speaks {theirs}: install the ffwf-tau-web that pairs with your ffwf-tau"
|
|
49
|
+
)
|
|
50
|
+
return PROTOCOL
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""`python -m tau_web [TAU]`: exit 0 if this client and τ speak the same protocol, 1 if not."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from tau_web import CLIENT_VERSION, ProtocolMismatch, check
|
|
6
|
+
|
|
7
|
+
try:
|
|
8
|
+
protocol = check(sys.argv[1] if len(sys.argv) > 1 else None)
|
|
9
|
+
except ProtocolMismatch as error:
|
|
10
|
+
sys.exit(f"tau_web: {error}")
|
|
11
|
+
print(f"tau_web: tau-code {CLIENT_VERSION} web client and τ both speak protocol {protocol}")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.tau-app{--tau-fg: var(--vscode-editor-foreground, #cdd6f4);--tau-bg: var(--vscode-editor-background, #1e1e2e);--tau-muted: var(--vscode-descriptionForeground, #9399b2);--tau-border: var(--vscode-panel-border, #313244);--tau-accent: var(--vscode-textLink-foreground, #89b4fa);--tau-warn: var(--vscode-editorWarning-foreground, #f9e2af);--tau-error: var(--vscode-editorError-foreground, #f38ba8);--tau-ok: var(--vscode-testing-iconPassed, #a6e3a1);--tau-input-bg: var(--vscode-input-background, #181825);--tau-raised: var(--vscode-editorWidget-background, #24273a);--tau-button-bg: var(--vscode-button-background, #89b4fa);--tau-button-fg: var(--vscode-button-foreground, #11111b);--tau-mono: var(--vscode-editor-font-family, ui-monospace, "SFMono-Regular", Menlo, monospace);display:flex;flex-direction:column;height:100%;min-height:0;color:var(--tau-fg);background:var(--tau-bg);font-family:var(--vscode-font-family, ui-sans-serif, system-ui, sans-serif);font-size:var(--vscode-font-size, 13px)}.tau-app button{font:inherit;color:var(--tau-button-fg);background:var(--tau-button-bg);border:0;border-radius:4px;padding:3px 10px;cursor:pointer}.tau-app button:disabled{opacity:.45;cursor:default}.tau-app input,.tau-app textarea{font:inherit;color:var(--tau-fg);background:var(--tau-input-bg);border:1px solid var(--tau-border);border-radius:4px;padding:4px 6px}.tau-app textarea{resize:vertical}.tau-app pre{font-family:var(--tau-mono);font-size:.92em;white-space:pre-wrap;word-break:break-word;margin:4px 0 0}.tau-app button.tau-link{background:none;color:var(--tau-accent);padding:0 2px}.tau-hint{color:var(--tau-muted)}.tau-error{color:var(--tau-error)}.tau-info{color:var(--tau-warn)}.tau-spacer{flex:1 1 auto}.tau-status{display:flex;align-items:center;gap:10px;padding:6px 10px;border-bottom:1px solid var(--tau-border);font-size:.9em;flex:0 0 auto;min-width:0}.tau-status>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tau-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--tau-muted);flex:0 0 auto;margin-right:4px}.tau-status-ready .tau-dot{background:var(--tau-ok)}.tau-status-connecting .tau-dot,.tau-status-reconnecting .tau-dot{background:var(--tau-warn)}.tau-status-failed .tau-dot{background:var(--tau-error)}.tau-banner{padding:6px 10px;background:var(--tau-raised);color:var(--tau-warn);border-bottom:1px solid var(--tau-border)}.tau-connection{padding:0 0 16px}.tau-connection>p,.tau-connection>button{margin:12px 16px 0}.tau-cursors{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 10px;border-bottom:1px solid var(--tau-border);flex:0 0 auto}.tau-tab{display:inline-flex;border:1px solid var(--tau-border);border-radius:4px;overflow:hidden}.tau-tab.tau-selected{border-color:var(--tau-accent)}.tau-app .tau-tab button{background:none;color:var(--tau-fg);border-radius:0}.tau-app .tau-tab.tau-selected .tau-tab-main{background:var(--tau-raised)}.tau-app .tau-tab .tau-tab-close{color:var(--tau-muted);padding:3px 6px}.tau-tab-labels{color:var(--tau-accent)}.tau-dot-busy{background:var(--tau-warn);animation:tau-pulse 1s infinite alternate}.tau-dot-done{background:var(--tau-ok)}.tau-dot-aborted,.tau-dot-halted{background:var(--tau-warn)}.tau-dot-failed{background:var(--tau-error)}@keyframes tau-pulse{0%{opacity:1}to{opacity:.3}}.tau-badge{margin-left:6px;padding:0 5px;border-radius:8px;background:var(--tau-warn);color:var(--tau-button-fg);font-size:.85em}.tau-app .tau-chip{display:inline-flex;align-items:center;gap:2px;background:var(--tau-raised);color:var(--tau-fg);border:1px solid var(--tau-border);border-radius:10px;padding:1px 8px;margin:0 2px}.tau-closed{display:inline-flex;flex-wrap:wrap;gap:4px;align-items:center}.tau-main{display:flex;flex:1 1 auto;min-height:0}.tau-transcript{flex:1 1 auto;overflow-y:auto;padding:8px 12px;min-width:0}.tau-row{margin:6px 0;padding:6px 10px;border-left:3px solid transparent;border-radius:3px}.tau-row-head{display:flex;gap:8px;font-size:.85em;color:var(--tau-muted)}.tau-row-node{color:var(--tau-muted);font-variant-numeric:tabular-nums;font-size:.85em}.tau-row-text{white-space:pre-wrap;word-break:break-word}.tau-row-user{background:var(--tau-raised);border-left-color:var(--tau-accent)}.tau-row-user.tau-mine{border-left-color:var(--tau-ok)}.tau-row-assistant{border-left-color:var(--tau-border)}.tau-row-thinking,.tau-row-dim{color:var(--tau-muted)}.tau-row-call{background:var(--tau-input-bg)}.tau-tool{font-family:var(--tau-mono);color:var(--tau-accent)}.tau-row-result.tau-failed{border-left-color:var(--tau-error)}.tau-row-result.tau-ok{border-left-color:var(--tau-ok)}.tau-images-count{font-size:.85em;color:var(--tau-accent)}.tau-images{margin:4px 0 0;padding-left:0;list-style:none;font-family:var(--tau-mono);font-size:.9em;color:var(--tau-muted)}.tau-row-stop{color:var(--tau-warn)}.tau-row summary{cursor:pointer}.tau-live{opacity:.85}.tau-tree{flex:0 0 40%;max-width:560px;border-left:1px solid var(--tau-border);display:flex;flex-direction:column;min-height:0}.tau-tree-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 8px;border-bottom:1px solid var(--tau-border)}.tau-inline{display:inline-flex;gap:4px}.tau-tree-lines{overflow-y:auto;flex:1 1 auto;padding:4px 0}.tau-app .tau-tree-line{display:block;width:100%;text-align:left;background:none;color:var(--tau-fg);border-radius:0;padding:2px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tau-app .tau-tree-line:hover{background:var(--tau-raised)}.tau-app .tau-tree-line.tau-on-line{border-left:2px solid var(--tau-accent)}.tau-app .tau-tree-line.tau-picked{background:var(--tau-raised);outline:1px solid var(--tau-accent)}.tau-footer{flex:0 0 auto;border-top:1px solid var(--tau-border);padding:6px 10px 10px;display:flex;flex-direction:column;gap:6px;max-height:60%;overflow-y:auto}.tau-notices{display:flex;flex-direction:column;gap:2px}.tau-notice{color:var(--tau-warn)}.tau-shown{display:flex;flex-wrap:wrap;gap:12px;font-size:.9em}.tau-questions{display:flex;flex-direction:column;gap:6px}.tau-question,.tau-dialog{border:1px solid var(--tau-warn);border-radius:4px;padding:8px 10px;background:var(--tau-raised)}.tau-dialog{border-color:var(--tau-accent)}.tau-form{display:flex;flex-direction:column;gap:6px}.tau-form-title{font-weight:600}.tau-form-buttons{display:flex;gap:6px}.tau-fields{display:flex;flex-direction:column;gap:6px}.tau-field{display:flex;flex-direction:column;gap:2px}.tau-required{color:var(--tau-error)}.tau-choices{display:flex;flex-wrap:wrap;gap:10px}.tau-choice{display:inline-flex;align-items:center;gap:4px;cursor:pointer}.tau-optional{display:flex;flex-direction:column;gap:4px}.tau-json textarea{width:100%;box-sizing:border-box;font-family:var(--tau-mono)}.tau-items{display:flex;flex-direction:column;gap:2px;font-size:.92em}.tau-item-text{white-space:pre-wrap}.tau-step{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:.92em}.tau-step-state{color:var(--tau-muted)}.tau-composer{display:flex;flex-direction:column;gap:6px}.tau-composer-row{display:flex;gap:6px;align-items:flex-end}.tau-composer-row textarea{flex:1 1 auto}.tau-completions{display:flex;flex-wrap:wrap;gap:4px}html,body,#root{height:100%;margin:0}body{background:#1e1e2e;color:#cdd6f4}
|