tamcoder 0.1.90__tar.gz → 0.1.93__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.

Potentially problematic release.


This version of tamcoder might be problematic. Click here for more details.

@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tamcoder
3
- Version: 0.1.90
3
+ Version: 0.1.93
4
4
  Summary: Tamcoder — TypeScript coding agent runtime (PyPI shim that installs the official Linux x86_64 release)
5
5
  Project-URL: Homepage, https://gpt.tamfitronics.com/tamcoder
6
- Project-URL: Repository, https://gpt.tamfitronics.com/tamcoder
6
+ Project-URL: Repository, https://github.com/tamfitronics/tamcoder
7
7
  Project-URL: Documentation, https://gpt.tamfitronics.com/tamcoder
8
- Project-URL: Changelog, https://gpt.tamfitronics.com/tamcoder/releases/
9
8
  License: MIT
10
9
  License-File: LICENSE
11
10
  Keywords: ai,cli,coding-agent,tamcoder,typescript
@@ -20,8 +19,6 @@ Classifier: Programming Language :: Python :: 3.12
20
19
  Classifier: Programming Language :: Python :: 3.13
21
20
  Classifier: Topic :: Software Development :: Build Tools
22
21
  Requires-Python: >=3.10
23
- Requires-Dist: requests>=2.31.0
24
- Requires-Dist: tqdm>=4.66.0
25
22
  Provides-Extra: dev
26
23
  Requires-Dist: build>=1.2.0; extra == 'dev'
27
24
  Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
@@ -66,4 +63,4 @@ The `tamcoder` command checks the public release version at startup. No workspac
66
63
 
67
64
  ## License
68
65
 
69
- MIT
66
+ MIT
@@ -33,4 +33,4 @@ The `tamcoder` command checks the public release version at startup. No workspac
33
33
 
34
34
  ## License
35
35
 
36
- MIT
36
+ MIT
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["hatchling"]
2
+ requires = ["hatchling>=1.0.0"]
3
3
  build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "tamcoder"
7
- version = "0.1.90"
7
+ version = "0.1.93"
8
8
  description = "Tamcoder — TypeScript coding agent runtime (PyPI shim that installs the official Linux x86_64 release)"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -21,17 +21,12 @@ classifiers = [
21
21
  "Programming Language :: Python :: 3.13",
22
22
  "Topic :: Software Development :: Build Tools",
23
23
  ]
24
- dependencies = [
25
- "requests>=2.31.0",
26
- "tqdm>=4.66.0",
27
- ]
28
24
  keywords = ["tamcoder", "coding-agent", "typescript", "cli", "ai"]
29
25
 
30
26
  [project.urls]
31
27
  Homepage = "https://gpt.tamfitronics.com/tamcoder"
32
- Repository = "https://gpt.tamfitronics.com/tamcoder"
28
+ Repository = "https://github.com/tamfitronics/tamcoder"
33
29
  Documentation = "https://gpt.tamfitronics.com/tamcoder"
34
- Changelog = "https://gpt.tamfitronics.com/tamcoder/releases/"
35
30
 
36
31
  [project.scripts]
37
32
  tamcoder = "tamcoder.__main__:main"
@@ -49,7 +44,6 @@ dev = [
49
44
 
50
45
  [tool.hatch.build.targets.sdist]
51
46
  # Use default selection; Hatch will include the "src/tamcoder" package.
52
- # Explicit configuration removed to avoid shipping the empty top-level "tamcoder/" dir.
53
47
 
54
48
  [tool.hatch.build.targets.wheel]
55
49
  packages = ["src/tamcoder"]
@@ -1,3 +1,3 @@
1
1
  """Tamcoder PyPI shim — installs the official TypeScript release."""
2
- __version__ = "0.1.90"
3
- __all__ = ["__version__"]
2
+ __version__ = "0.1.93"
3
+ __all__ = ["__version__"]
@@ -22,7 +22,6 @@ except ImportError as e:
22
22
  RELEASE_BASE = os.environ.get("TAMCODER_RELEASE_BASE", "https://gpt.tamfitronics.com/tamcoder")
23
23
  INSTALL_PREFIX = Path(os.environ.get("TAMCODER_INSTALL_PREFIX", Path.home() / ".local"))
24
24
  ARTIFACT_ROOT = Path("/mnt/tamcoder/users")
25
- ARTIFACT_BASE = ARTIFACT_ROOT.parent
26
25
 
27
26
 
28
27
  def fetch_latest() -> dict:
@@ -38,71 +37,32 @@ def download_file(url: str, dest: Path, desc: str = "Downloading") -> None:
38
37
  resp = requests.get(url, stream=True, timeout=60)
39
38
  resp.raise_for_status()
40
39
  total = int(resp.headers.get("content-length", 0))
41
- with open(dest, "wb") as f, tqdm(
42
- total=total, unit="B", unit_scale=True, unit_divisor=1024, desc=desc
43
- ) as pbar:
44
- for chunk in resp.iter_content(chunk_size=8192):
45
- if chunk:
40
+ with open(dest, "wb") as f:
41
+ if total > 0:
42
+ for chunk in tqdm(resp.iter_content(chunk_size=8192), total=total // 8192, unit="B", unit_scale=True, desc=desc):
46
43
  f.write(chunk)
47
- pbar.update(len(chunk))
44
+ else:
45
+ f.write(resp.content)
48
46
 
49
47
 
50
- def verify_sha256(filepath: Path, expected: str) -> bool:
51
- """Verify SHA-256 checksum."""
52
- sha256 = hashlib.sha256()
53
- with open(filepath, "rb") as f:
54
- for chunk in iter(lambda: f.read(8192), b""):
55
- sha256.update(chunk)
56
- actual = sha256.hexdigest()
48
+ def verify_sha256(path: Path, expected: str) -> bool:
49
+ """Verify SHA-256 checksum of a file."""
50
+ actual = hashlib.sha256(path.read_bytes()).hexdigest()
57
51
  return actual == expected
58
52
 
59
53
 
60
- def ensure_artifact_directory(directory: Path, mode: int) -> None:
61
- """Create directory with sticky permissions, using sudo if needed."""
62
- if directory.exists():
63
- return
64
- try:
65
- directory.mkdir(mode=mode, parents=True, exist_ok=True)
66
- return
67
- except PermissionError:
68
- pass
69
- # Try with sudo
70
- try:
71
- subprocess.run(["sudo", "install", "-d", "-m", str(mode), str(directory)], check=True)
72
- return
73
- except (subprocess.CalledProcessError, FileNotFoundError):
74
- pass
75
- print(f"Cannot create {directory}; need permission to provision {ARTIFACT_BASE} and {ARTIFACT_ROOT}",
76
- file=sys.stderr)
77
- sys.exit(1)
78
-
79
-
80
- def ensure_sticky_mode(path: Path) -> None:
81
- """Ensure directory has sticky bit (1777)."""
82
- try:
83
- path.chmod(0o1777)
84
- return
85
- except PermissionError:
86
- pass
87
- try:
88
- subprocess.run(["sudo", "chmod", "1777", str(path)], check=True)
89
- return
90
- except (subprocess.CalledProcessError, FileNotFoundError):
91
- pass
92
- print(f"Cannot configure {path} as shared sticky directory; run 'sudo chmod 1777 {path}'",
93
- file=sys.stderr)
94
- sys.exit(1)
95
-
96
-
97
54
  def check_node() -> None:
98
- """Verify Node.js 22+ is available at /usr/bin/node."""
99
- node_path = Path("/usr/bin/node")
100
- if not node_path.exists():
101
- print("Node.js 22 or newer is required at /usr/bin/node", file=sys.stderr)
102
- sys.exit(1)
55
+ """Check that Node.js 22 or newer is available."""
103
56
  try:
104
- result = subprocess.run([str(node_path), "--version"], capture_output=True, text=True, check=True)
105
- version_str = result.stdout.strip().lstrip("v")
57
+ result = subprocess.run(
58
+ ["node", "--version"],
59
+ capture_output=True,
60
+ text=True,
61
+ check=True,
62
+ )
63
+ version_str = result.stdout.strip()
64
+ if version_str.startswith("v"):
65
+ version_str = version_str[1:]
106
66
  major = int(version_str.split(".")[0])
107
67
  if major < 22:
108
68
  print(f"Node.js 22 or newer is required (found {major})", file=sys.stderr)
@@ -157,8 +117,8 @@ def install_release(version: str, asset_name: str) -> Path:
157
117
  link.symlink_to(bin_path)
158
118
 
159
119
  # Artifact directories
160
- ensure_artifact_directory(ARTIFACT_BASE, 0o755)
161
- ensure_artifact_directory(ARTIFACT_ROOT, 0o1777)
120
+ ensure_artifact_directory(ARTIFACT_ROOT, 0o755)
121
+ ensure_artifact_directory(Path("/mnt/tamcoder/users"), 0o1777)
162
122
  ensure_sticky_mode(ARTIFACT_ROOT)
163
123
 
164
124
  if not os.access(ARTIFACT_ROOT, os.W_OK):
@@ -168,6 +128,25 @@ def install_release(version: str, asset_name: str) -> Path:
168
128
  return release_dir
169
129
 
170
130
 
131
+ def ensure_artifact_directory(path: Path, mode: int) -> None:
132
+ """Create artifact directory if missing with requested mode."""
133
+ if not path.exists():
134
+ path.mkdir(parents=True, exist_ok=True)
135
+ os.chmod(str(path), mode)
136
+
137
+
138
+ def ensure_sticky_mode(path: Path) -> None:
139
+ """Ensure the sticky bit is set."""
140
+ if os.name != "posix":
141
+ return
142
+ try:
143
+ current = os.stat(str(path)).st_mode
144
+ if not (current & 0o1000):
145
+ os.chmod(str(path), current | 0o1000)
146
+ except OSError:
147
+ pass
148
+
149
+
171
150
  def main() -> int:
172
151
  """Main entry point."""
173
152
  # Handle update check flag
@@ -223,4 +202,4 @@ def main() -> int:
223
202
 
224
203
 
225
204
  if __name__ == "__main__":
226
- sys.exit(main())
205
+ sys.exit(main())
@@ -23,7 +23,7 @@ def make_test_archive(tmp_path: Path) -> Path:
23
23
  (bin_dir / "tamcoder").chmod(0o755)
24
24
  (dist_dir / "appServerMain.js").write_text("console.log('ok')\n")
25
25
 
26
- archive = tmp_path / "tamcoder-0.1.89-linux-x64.tar.gz"
26
+ archive = tmp_path / "tamcoder-0.1.92-linux-x64.tar.gz"
27
27
  import tarfile
28
28
  with tarfile.open(archive, "w:gz") as tar:
29
29
  tar.add(app_dir, arcname="app")
@@ -43,10 +43,10 @@ def test_verify_sha256_ok():
43
43
  def test_fetch_latest_success(requests_mock):
44
44
  requests_mock.get(
45
45
  "https://gpt.tamfitronics.com/tamcoder/latest.json",
46
- json={"version": "0.1.89", "asset": "tamcoder-0.1.89-linux-x64.tar.gz"},
46
+ json={"version": "0.1.92", "asset": "tamcoder-0.1.92-linux-x64.tar.gz"},
47
47
  )
48
48
  data = fetch_latest()
49
- assert data["version"] == "0.1.89"
49
+ assert data["version"] == "0.1.92"
50
50
 
51
51
 
52
52
  def test_fetch_latest_failure(requests_mock):