utim-cli 1.0.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.
Files changed (42) hide show
  1. utim_cli-1.0.0/CHANGELOG.md +22 -0
  2. utim_cli-1.0.0/LICENSE +21 -0
  3. utim_cli-1.0.0/MANIFEST.in +46 -0
  4. utim_cli-1.0.0/PKG-INFO +134 -0
  5. utim_cli-1.0.0/README.md +82 -0
  6. utim_cli-1.0.0/pyproject.toml +75 -0
  7. utim_cli-1.0.0/setup.cfg +4 -0
  8. utim_cli-1.0.0/setup.py +4 -0
  9. utim_cli-1.0.0/utim_cli/__init__.py +40 -0
  10. utim_cli-1.0.0/utim_cli/agent.py +359 -0
  11. utim_cli-1.0.0/utim_cli/auth.py +208 -0
  12. utim_cli-1.0.0/utim_cli/backup.py +101 -0
  13. utim_cli-1.0.0/utim_cli/billing.py +40 -0
  14. utim_cli-1.0.0/utim_cli/blender_agent.py +1018 -0
  15. utim_cli-1.0.0/utim_cli/bootstrap.py +324 -0
  16. utim_cli-1.0.0/utim_cli/client_utils.py +135 -0
  17. utim_cli-1.0.0/utim_cli/config.py +194 -0
  18. utim_cli-1.0.0/utim_cli/context_pruner.py +504 -0
  19. utim_cli-1.0.0/utim_cli/doctor.py +118 -0
  20. utim_cli-1.0.0/utim_cli/knowledge_graph.py +462 -0
  21. utim_cli-1.0.0/utim_cli/logger.py +121 -0
  22. utim_cli-1.0.0/utim_cli/mcp_clean_wrapper.py +55 -0
  23. utim_cli-1.0.0/utim_cli/mcp_client.py +198 -0
  24. utim_cli-1.0.0/utim_cli/mcp_registry.json +1102 -0
  25. utim_cli-1.0.0/utim_cli/orchestrator.py +3209 -0
  26. utim_cli-1.0.0/utim_cli/reflection.py +200 -0
  27. utim_cli-1.0.0/utim_cli/report.py +100 -0
  28. utim_cli-1.0.0/utim_cli/scrapy_search.py +229 -0
  29. utim_cli-1.0.0/utim_cli/share.py +320 -0
  30. utim_cli-1.0.0/utim_cli/share_tui.py +554 -0
  31. utim_cli-1.0.0/utim_cli/situational_scoring.py +269 -0
  32. utim_cli-1.0.0/utim_cli/state.py +15 -0
  33. utim_cli-1.0.0/utim_cli/tools.py +3381 -0
  34. utim_cli-1.0.0/utim_cli/utim.py +4051 -0
  35. utim_cli-1.0.0/utim_cli/vector_memory.py +629 -0
  36. utim_cli-1.0.0/utim_cli/workspace.py +33 -0
  37. utim_cli-1.0.0/utim_cli.egg-info/PKG-INFO +134 -0
  38. utim_cli-1.0.0/utim_cli.egg-info/SOURCES.txt +40 -0
  39. utim_cli-1.0.0/utim_cli.egg-info/dependency_links.txt +1 -0
  40. utim_cli-1.0.0/utim_cli.egg-info/entry_points.txt +2 -0
  41. utim_cli-1.0.0/utim_cli.egg-info/requires.txt +31 -0
  42. utim_cli-1.0.0/utim_cli.egg-info/top_level.txt +1 -0
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ All notable changes to the UTIM CLI Agent will be documented in this file.
4
+
5
+ ## [1.0.0] - 2026-06-23
6
+
7
+ ### Added
8
+ - **Pre-Commit Syntax Checks**: Code files undergo compilation checks (Python AST, JSON, JavaScript check, TypeScript type checks, YAML parsing) in a temporary buffer before being committed.
9
+ - **Interactive Diff Approvals**: Unified git-style diffs are displayed in the terminal UI for user review and approval before modifications are written.
10
+ - **Dry-Run Mode**: Introduced `--dry-run` CLI flag to run UTIM in read-only mode, showing projected changes and simulated commands without mutations.
11
+ - **Automated Regression Testing Loop**: UTIM automatically detects `pytest`, `npm test`, `cargo test`, `go test`, and `tox` suites, executing them after changes and self-healing test failures.
12
+ - **Robust Session Serialization**: Saves full message history, undo/redo stacks, checklist status, and dynamic config states to `.utim/session_state.json`, allowing pause-and-resume.
13
+ - **ChromaDB Semantic Memory**: Syncs local memories to vector databases and uses embedding search instead of checking huge flat files, preventing latency and reasoning loops.
14
+ - **Uninstall Command**: Developers can now uninstall unused/broken MCP servers from the terminal.
15
+ - **`/doctor` Diagnostics Command**: Added system and MCP connection debugging command.
16
+
17
+ ### Changed
18
+ - Refactored test runners to skip heavy external execution during pytest discovery, avoiding execution hangs.
19
+ - Curated out broken presets from the default MCP registry to prevent package installation 404s.
20
+
21
+ ### Fixed
22
+ - Bypassed pre-computation loops and heavy RAG injection for casual queries (e.g. "hello"), bringing response latency down to normal levels.
utim_cli-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 UTIM Dev Team
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,46 @@
1
+ # MANIFEST.in — controls what's included in the Python source distribution (sdist)
2
+ # The goal: ship only the utim_cli core package, not server code, tests, or landing site.
3
+
4
+ # ── Include essentials ─────────────────────────────────────────────────────────
5
+ include README.md
6
+ include LICENSE
7
+ include CHANGELOG.md
8
+ include pyproject.toml
9
+
10
+ # ── Include the JSON data file bundled with the package ───────────────────────
11
+ include utim_cli/mcp_registry.json
12
+
13
+ # ── Exclude server sub-package (runs on Railway, not on user machines) ─────────
14
+ prune utim_cli/server
15
+
16
+ # ── Exclude tests, landing site, build artifacts ──────────────────────────────
17
+ prune tests
18
+ prune landing
19
+ prune build
20
+ prune scripts
21
+ prune .git
22
+ prune .agents
23
+ prune .utim
24
+ prune .utim_backup
25
+ prune .utim_tmp
26
+ prune .antigravitycli
27
+ prune __pycache__
28
+ prune utim_cli/__pycache__
29
+
30
+ # ── Exclude environment / CI files ────────────────────────────────────────────
31
+ exclude *.db
32
+ exclude *.log
33
+ exclude *.png
34
+ exclude *.jpg
35
+ exclude *.jpeg
36
+ exclude Dockerfile
37
+ exclude Procfile
38
+ exclude railway.toml
39
+ exclude railway.json
40
+ exclude scrapy.cfg
41
+ exclude todo.py
42
+ exclude todo_gui.py
43
+ exclude test_or.py
44
+ exclude test_prompt.py
45
+ exclude bin/utim.cmd
46
+ exclude bin/utim1.cmd
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: utim-cli
3
+ Version: 1.0.0
4
+ Summary: UTIM – Universal Terminal Intelligence Manager. A powerful agentic AI coding assistant for your terminal.
5
+ License: MIT
6
+ Project-URL: Homepage, https://utim.ai
7
+ Project-URL: Documentation, https://utim.ai/docs
8
+ Project-URL: Changelog, https://github.com/emendai/utim/blob/main/CHANGELOG.md
9
+ Project-URL: Issues, https://github.com/emendai/utim/issues
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Development Status :: 4 - Beta
18
+ Classifier: Environment :: Console
19
+ Classifier: Intended Audience :: Developers
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: openai>=1.30.0
24
+ Requires-Dist: requests==2.31.0
25
+ Requires-Dist: aiohttp>=3.9.5
26
+ Requires-Dist: python-dotenv==1.0.1
27
+ Requires-Dist: urllib3==1.26.18
28
+ Requires-Dist: charset-normalizer==3.3.2
29
+ Requires-Dist: chardet==4.0.0
30
+ Requires-Dist: typer>=0.9.0
31
+ Requires-Dist: rich>=13.0.0
32
+ Requires-Dist: prompt_toolkit>=3.0.0
33
+ Requires-Dist: tree-sitter>=0.21.0
34
+ Requires-Dist: tree-sitter-python>=0.21.0
35
+ Requires-Dist: tree-sitter-javascript>=0.21.0
36
+ Requires-Dist: tree-sitter-typescript>=0.21.0
37
+ Requires-Dist: mcp>=0.1.0
38
+ Requires-Dist: nest-asyncio>=1.5.0
39
+ Requires-Dist: python-multipart>=0.0.7
40
+ Provides-Extra: search
41
+ Requires-Dist: scrapy>=2.11.0; extra == "search"
42
+ Requires-Dist: scrapy-playwright>=0.0.34; extra == "search"
43
+ Requires-Dist: beautifulsoup4>=4.12.0; extra == "search"
44
+ Provides-Extra: images
45
+ Requires-Dist: pillow>=9.0.0; extra == "images"
46
+ Provides-Extra: full
47
+ Requires-Dist: scrapy>=2.11.0; extra == "full"
48
+ Requires-Dist: scrapy-playwright>=0.0.34; extra == "full"
49
+ Requires-Dist: beautifulsoup4>=4.12.0; extra == "full"
50
+ Requires-Dist: pillow>=9.0.0; extra == "full"
51
+ Dynamic: license-file
52
+
53
+ # UTIM CLI Agent: Enterprise Coder Assistant
54
+
55
+ UTIM is an agentic developer CLI assistant designed to automate coding tasks directly inside your local terminal, featuring robust safety controls, self-healing quality gates, and local-first semantic memory.
56
+
57
+ ---
58
+
59
+ ## 🚀 Quick Start
60
+
61
+ ### 1. Installation
62
+ Install the package from your local source directory:
63
+
64
+ ```bash
65
+ # Basic installation
66
+ pip install .
67
+
68
+ # Recommended: Full installation (includes semantic vector RAG & web search)
69
+ pip install ".[full]"
70
+ ```
71
+
72
+ ### 2. Provider & Model Configuration
73
+ Start the chat session:
74
+ ```bash
75
+ utim
76
+ ```
77
+ On first run, UTIM checks for `.utim/config.json`. If it does not exist, it runs a provider and model configuration wizard. You can configure:
78
+ - **Default Providers**: OpenRouter, OpenAI, custom servers, etc.
79
+ - **Model Picker**: Press `Ctrl+M` in the chat terminal at any time to configure, pick, add, or delete LLMs.
80
+
81
+ ---
82
+
83
+ ## ⚡ Main CLI Commands
84
+
85
+ - **`utim`**: Starts the interactive chat terminal (TUI).
86
+ - **`utim task "<prompt>"`**: Executes a single task autonomously from the command line and exits. In an interactive terminal (`stdin` is a TTY) file writes and commands prompt for confirmation; when piped/scripted they run in auto-accept mode.
87
+ - **`utim --dry-run`**: Starts the session in **Dry-Run Mode** (all code modifications and shell commands are simulated, not written/executed).
88
+ - **`utim --sandbox`**: Runs all mutating shell command proposals in the intelligent local sandbox (untrusted commands will block until approved).
89
+ - **`utim doctor`** / **`utim init`** / **`utim reset`**: Administrative commands for state diagnosis, initialization, and factory resets.
90
+
91
+ ---
92
+
93
+ ## 🛠️ In-Chat Slash Commands
94
+
95
+ Inside the interactive chat terminal, type these slash commands for direct workspace control:
96
+
97
+ - **`/undo`**: Reverts the last assistant action, restoring files to their exact "before" state and rolling back messages.
98
+ - **`/redo`**: Re-applies the last undone turn, re-writing files and restoring conversation logs.
99
+ - **`/rewind <turn_index>`**: Rolls back the entire session to a specific conversation turn.
100
+ - **`/doctor`**: Run diagnostics on environment variables, Python version, dependencies, API model connections, and MCP server status.
101
+ - **`/report`**: Generates a support bundle under `.utim_tmp/report_bundle.zip` (automatically redacts secrets, passwords, or personal names/files).
102
+ - **`/reset`**: Wipes the current chat history without deleting persistent local vector memory.
103
+
104
+ ---
105
+
106
+ ## 🧠 Architecture & How it Works
107
+
108
+ 1. **Local Memory (`.utim/memory.json` & ChromaDB)**:
109
+ - Global user preferences, rules, and facts are synced to a semantic vector database (`.utim_tmp/vector_db`).
110
+ - Relevant memories are dynamically fetched via semantic similarity (RAG) and injected into the system prompt context, preventing prompt bloating.
111
+ 2. **Undo/Redo Stack & Session State**:
112
+ - Every file change (writes, batch string edits, moves, deletions) computes a diff snapshot.
113
+ - The entire stack is serialized dynamically to `.utim/session_state.json`. You can close your shell, shut down your computer, and resume later with intact rollback features.
114
+ 3. **Workspace Boundary & Safety Controls**:
115
+ - Prior to writing files, UTIM performs **Pre-Commit Syntax Checks** (AST compilation for Python, JSON loads, JS/TS checks).
116
+ - If tests are available (`pytest`, `npm test`, etc.), UTIM runs them in a background **Regression testing loop**, prompting the model to self-heal code errors if assertions fail.
117
+ - **Interactive TUI mode** (`utim`): every file mutation shows an interactive diff dialog; the developer accepts, edits, or rejects individual hunks before they are applied.
118
+ - **CLI task mode** (`utim task`): when running in a real terminal, destructive operations (`rm`, package installs, `>` redirects) prompt for `y/n` confirmation. When stdin is piped/non-interactive all edits are auto-accepted.
119
+ - **Sandbox mode** (`utim --sandbox`): classifies every terminal command as safe or risky and blocks risky commands until explicitly approved.
120
+
121
+ ---
122
+
123
+ ## ⚠️ What this Tool Can and Cannot Do
124
+
125
+ ### Can Do:
126
+ - Read, write, and patch codebases safely.
127
+ - Install and coordinate custom MCP (Model Context Protocol) servers.
128
+ - Self-heal syntax and test errors before files are written.
129
+ - Revert any file modification instantly.
130
+
131
+ ### Cannot Do:
132
+ - **No Remote Code Execution**: Runs locally on your machine.
133
+ - **Unverified Sensitive Reads Blocked**: Reading files or memory matching sensitive keys (like passwords, secret codes, or personal data) is blocked unless verified via your configured verification code.
134
+ - **No Auto-Deletions**: Any command that deletes files outside the working directory is blocked automatically.
@@ -0,0 +1,82 @@
1
+ # UTIM CLI Agent: Enterprise Coder Assistant
2
+
3
+ UTIM is an agentic developer CLI assistant designed to automate coding tasks directly inside your local terminal, featuring robust safety controls, self-healing quality gates, and local-first semantic memory.
4
+
5
+ ---
6
+
7
+ ## 🚀 Quick Start
8
+
9
+ ### 1. Installation
10
+ Install the package from your local source directory:
11
+
12
+ ```bash
13
+ # Basic installation
14
+ pip install .
15
+
16
+ # Recommended: Full installation (includes semantic vector RAG & web search)
17
+ pip install ".[full]"
18
+ ```
19
+
20
+ ### 2. Provider & Model Configuration
21
+ Start the chat session:
22
+ ```bash
23
+ utim
24
+ ```
25
+ On first run, UTIM checks for `.utim/config.json`. If it does not exist, it runs a provider and model configuration wizard. You can configure:
26
+ - **Default Providers**: OpenRouter, OpenAI, custom servers, etc.
27
+ - **Model Picker**: Press `Ctrl+M` in the chat terminal at any time to configure, pick, add, or delete LLMs.
28
+
29
+ ---
30
+
31
+ ## ⚡ Main CLI Commands
32
+
33
+ - **`utim`**: Starts the interactive chat terminal (TUI).
34
+ - **`utim task "<prompt>"`**: Executes a single task autonomously from the command line and exits. In an interactive terminal (`stdin` is a TTY) file writes and commands prompt for confirmation; when piped/scripted they run in auto-accept mode.
35
+ - **`utim --dry-run`**: Starts the session in **Dry-Run Mode** (all code modifications and shell commands are simulated, not written/executed).
36
+ - **`utim --sandbox`**: Runs all mutating shell command proposals in the intelligent local sandbox (untrusted commands will block until approved).
37
+ - **`utim doctor`** / **`utim init`** / **`utim reset`**: Administrative commands for state diagnosis, initialization, and factory resets.
38
+
39
+ ---
40
+
41
+ ## 🛠️ In-Chat Slash Commands
42
+
43
+ Inside the interactive chat terminal, type these slash commands for direct workspace control:
44
+
45
+ - **`/undo`**: Reverts the last assistant action, restoring files to their exact "before" state and rolling back messages.
46
+ - **`/redo`**: Re-applies the last undone turn, re-writing files and restoring conversation logs.
47
+ - **`/rewind <turn_index>`**: Rolls back the entire session to a specific conversation turn.
48
+ - **`/doctor`**: Run diagnostics on environment variables, Python version, dependencies, API model connections, and MCP server status.
49
+ - **`/report`**: Generates a support bundle under `.utim_tmp/report_bundle.zip` (automatically redacts secrets, passwords, or personal names/files).
50
+ - **`/reset`**: Wipes the current chat history without deleting persistent local vector memory.
51
+
52
+ ---
53
+
54
+ ## 🧠 Architecture & How it Works
55
+
56
+ 1. **Local Memory (`.utim/memory.json` & ChromaDB)**:
57
+ - Global user preferences, rules, and facts are synced to a semantic vector database (`.utim_tmp/vector_db`).
58
+ - Relevant memories are dynamically fetched via semantic similarity (RAG) and injected into the system prompt context, preventing prompt bloating.
59
+ 2. **Undo/Redo Stack & Session State**:
60
+ - Every file change (writes, batch string edits, moves, deletions) computes a diff snapshot.
61
+ - The entire stack is serialized dynamically to `.utim/session_state.json`. You can close your shell, shut down your computer, and resume later with intact rollback features.
62
+ 3. **Workspace Boundary & Safety Controls**:
63
+ - Prior to writing files, UTIM performs **Pre-Commit Syntax Checks** (AST compilation for Python, JSON loads, JS/TS checks).
64
+ - If tests are available (`pytest`, `npm test`, etc.), UTIM runs them in a background **Regression testing loop**, prompting the model to self-heal code errors if assertions fail.
65
+ - **Interactive TUI mode** (`utim`): every file mutation shows an interactive diff dialog; the developer accepts, edits, or rejects individual hunks before they are applied.
66
+ - **CLI task mode** (`utim task`): when running in a real terminal, destructive operations (`rm`, package installs, `>` redirects) prompt for `y/n` confirmation. When stdin is piped/non-interactive all edits are auto-accepted.
67
+ - **Sandbox mode** (`utim --sandbox`): classifies every terminal command as safe or risky and blocks risky commands until explicitly approved.
68
+
69
+ ---
70
+
71
+ ## ⚠️ What this Tool Can and Cannot Do
72
+
73
+ ### Can Do:
74
+ - Read, write, and patch codebases safely.
75
+ - Install and coordinate custom MCP (Model Context Protocol) servers.
76
+ - Self-heal syntax and test errors before files are written.
77
+ - Revert any file modification instantly.
78
+
79
+ ### Cannot Do:
80
+ - **No Remote Code Execution**: Runs locally on your machine.
81
+ - **Unverified Sensitive Reads Blocked**: Reading files or memory matching sensitive keys (like passwords, secret codes, or personal data) is blocked unless verified via your configured verification code.
82
+ - **No Auto-Deletions**: Any command that deletes files outside the working directory is blocked automatically.
@@ -0,0 +1,75 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "utim-cli"
7
+ version = "1.0.0"
8
+ description = "UTIM – Universal Terminal Intelligence Manager. A powerful agentic AI coding assistant for your terminal."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { text = "MIT" }
12
+ classifiers = [
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3.9",
15
+ "Programming Language :: Python :: 3.10",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Development Status :: 4 - Beta",
21
+ "Environment :: Console",
22
+ "Intended Audience :: Developers",
23
+ ]
24
+ dependencies = [
25
+ "openai>=1.30.0",
26
+ "requests==2.31.0",
27
+ "aiohttp>=3.9.5",
28
+ "python-dotenv==1.0.1",
29
+ "urllib3==1.26.18",
30
+ "charset-normalizer==3.3.2",
31
+ "chardet==4.0.0",
32
+ "typer>=0.9.0",
33
+ "rich>=13.0.0",
34
+ "prompt_toolkit>=3.0.0",
35
+ "tree-sitter>=0.21.0",
36
+ "tree-sitter-python>=0.21.0",
37
+ "tree-sitter-javascript>=0.21.0",
38
+ "tree-sitter-typescript>=0.21.0",
39
+ "mcp>=0.1.0",
40
+ "nest-asyncio>=1.5.0",
41
+ "python-multipart>=0.0.7",
42
+ ]
43
+
44
+ [project.urls]
45
+ Homepage = "https://utim.ai"
46
+ Documentation = "https://utim.ai/docs"
47
+ Changelog = "https://github.com/emendai/utim/blob/main/CHANGELOG.md"
48
+ Issues = "https://github.com/emendai/utim/issues"
49
+
50
+ [project.optional-dependencies]
51
+ # Optional features
52
+ search = [
53
+ "scrapy>=2.11.0",
54
+ "scrapy-playwright>=0.0.34",
55
+ "beautifulsoup4>=4.12.0",
56
+ ]
57
+ images = [
58
+ "pillow>=9.0.0",
59
+ ]
60
+ full = [
61
+ "scrapy>=2.11.0",
62
+ "scrapy-playwright>=0.0.34",
63
+ "beautifulsoup4>=4.12.0",
64
+ "pillow>=9.0.0",
65
+ ]
66
+
67
+ [project.scripts]
68
+ utim = "utim_cli.utim:app"
69
+
70
+ [tool.setuptools.packages.find]
71
+ include = ["utim_cli*"]
72
+ exclude = ["utim_cli.server*", "tests*", "landing*", "scripts*"]
73
+
74
+ [tool.setuptools.package-data]
75
+ utim_cli = ["mcp_registry.json"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ from setuptools import setup
2
+
3
+ if __name__ == "__main__":
4
+ setup()
@@ -0,0 +1,40 @@
1
+ # UTIM CLI Package
2
+ import builtins, os, pathlib, urllib.parse, re
3
+
4
+ def _make_file_uri(path: str) -> str:
5
+ p = pathlib.Path(path).resolve()
6
+ encoded = urllib.parse.quote(str(p).replace('\\', '/'))
7
+ return f"file:///{encoded}"
8
+
9
+ def _maybe_path_to_uri(text: str) -> str:
10
+ # Detect absolute Windows paths (C:\... or /c/... )
11
+ if re.match(r"^[a-zA-Z]:[\\/].*", text) and os.path.exists(text):
12
+ return f"{text} ({_make_file_uri(text)})"
13
+ # Detect relative paths that exist in cwd
14
+ rel = os.path.abspath(text)
15
+ if os.path.exists(rel):
16
+ return f"{text} ({_make_file_uri(rel)})"
17
+ return text
18
+
19
+ _orig_print = builtins.print
20
+
21
+ def _utim_print(*args, **kwargs):
22
+ formatted = [_maybe_path_to_uri(str(a)) for a in args]
23
+ try:
24
+ _orig_print(*formatted, **kwargs)
25
+ except UnicodeEncodeError:
26
+ import sys
27
+ encoding = sys.stdout.encoding or 'cp1252'
28
+ safe_formatted = []
29
+ for item in formatted:
30
+ safe_item = item.encode(encoding, errors='backslashreplace').decode(encoding)
31
+ safe_formatted.append(safe_item)
32
+ try:
33
+ _orig_print(*safe_formatted, **kwargs)
34
+ except Exception:
35
+ # Absolute fallback to standard ASCII if everything else fails
36
+ ascii_formatted = [item.encode('ascii', errors='replace').decode('ascii') for item in formatted]
37
+ _orig_print(*ascii_formatted, **kwargs)
38
+
39
+ # Override the global print for this package
40
+ builtins.print = _utim_print