@grifhinz/logics-manager 2.0.4 → 2.1.0
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.
- package/README.md +164 -157
- package/VERSION +1 -1
- package/logics_manager/assist.py +366 -0
- package/logics_manager/cli.py +116 -38
- package/logics_manager/flow.py +580 -8
- package/logics_manager/mcp.py +1188 -0
- package/logics_manager/sync.py +613 -0
- package/logics_manager/termstyle.py +75 -0
- package/package.json +10 -1
- package/pyproject.toml +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import re
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
RESET = "\033[0m"
|
|
9
|
+
BOLD = "\033[1m"
|
|
10
|
+
CYAN = "\033[36m"
|
|
11
|
+
GREEN = "\033[32m"
|
|
12
|
+
YELLOW = "\033[33m"
|
|
13
|
+
MAGENTA = "\033[35m"
|
|
14
|
+
BLUE = "\033[34m"
|
|
15
|
+
RED = "\033[31m"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _color_mode() -> str:
|
|
19
|
+
value = os.environ.get("LOGICS_MANAGER_COLOR", "auto").strip().lower()
|
|
20
|
+
if value in {"always", "auto", "never"}:
|
|
21
|
+
return value
|
|
22
|
+
return "auto"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def supports_color(stream=None) -> bool:
|
|
26
|
+
if stream is None:
|
|
27
|
+
stream = sys.stdout
|
|
28
|
+
mode = _color_mode()
|
|
29
|
+
if mode == "always":
|
|
30
|
+
return True
|
|
31
|
+
if mode == "never" or os.environ.get("NO_COLOR") is not None:
|
|
32
|
+
return False
|
|
33
|
+
return bool(getattr(stream, "isatty", lambda: False)())
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def wrap(text: str, *codes: str) -> str:
|
|
37
|
+
if not codes:
|
|
38
|
+
return text
|
|
39
|
+
return f"{''.join(codes)}{text}{RESET}"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
_TITLE_RE = re.compile(r"^Logics .* CLI$")
|
|
43
|
+
_SECTION_RE = re.compile(r"^(Usage|Commands|Kinds|Top-level options|Runtime and diagnostics|Review and governance|Context and prompts|Examples|Flags):$")
|
|
44
|
+
_COMMAND_RE = re.compile(r"^\s{2,}[a-z][a-z0-9-]*(?:\s|$)")
|
|
45
|
+
_FLAG_LINE_RE = re.compile(r"^\s{4,}--")
|
|
46
|
+
_EXAMPLE_RE = re.compile(r"^\s{2,}logics-manager\b")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def colorize_help(text: str) -> str:
|
|
50
|
+
if not supports_color():
|
|
51
|
+
return text
|
|
52
|
+
|
|
53
|
+
lines: list[str] = []
|
|
54
|
+
for line in text.splitlines():
|
|
55
|
+
stripped = line.strip()
|
|
56
|
+
if not stripped:
|
|
57
|
+
lines.append(line)
|
|
58
|
+
continue
|
|
59
|
+
if _TITLE_RE.match(stripped):
|
|
60
|
+
lines.append(wrap(line, BOLD, CYAN))
|
|
61
|
+
continue
|
|
62
|
+
if _SECTION_RE.match(stripped):
|
|
63
|
+
lines.append(wrap(line, BOLD, MAGENTA))
|
|
64
|
+
continue
|
|
65
|
+
if _EXAMPLE_RE.match(line):
|
|
66
|
+
lines.append(wrap(line, GREEN))
|
|
67
|
+
continue
|
|
68
|
+
if _FLAG_LINE_RE.match(line):
|
|
69
|
+
lines.append(wrap(line, YELLOW))
|
|
70
|
+
continue
|
|
71
|
+
if _COMMAND_RE.match(line):
|
|
72
|
+
lines.append(wrap(line, BLUE))
|
|
73
|
+
continue
|
|
74
|
+
lines.append(line)
|
|
75
|
+
return "\n".join(lines)
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@grifhinz/logics-manager",
|
|
3
3
|
"displayName": "Logics Orchestrator",
|
|
4
4
|
"description": "Visual orchestration for Logics workflows inside VS Code.",
|
|
5
|
-
"version": "2.0
|
|
5
|
+
"version": "2.1.0",
|
|
6
6
|
"publisher": "cdx-logics",
|
|
7
7
|
"icon": "media/icon.png",
|
|
8
8
|
"repository": {
|
|
@@ -149,6 +149,7 @@
|
|
|
149
149
|
"@types/vscode": "^1.86.0",
|
|
150
150
|
"@typescript-eslint/eslint-plugin": "^8.58.1",
|
|
151
151
|
"@typescript-eslint/parser": "^8.58.1",
|
|
152
|
+
"@vscode/vsce": "^3.9.1",
|
|
152
153
|
"@vitest/coverage-v8": "^4.1.2",
|
|
153
154
|
"esbuild": "^0.25.10",
|
|
154
155
|
"eslint": "^10.2.0",
|
|
@@ -158,5 +159,13 @@
|
|
|
158
159
|
"vitest": "^4.1.2",
|
|
159
160
|
"yaml": "^2.8.3",
|
|
160
161
|
"yauzl": "^3.2.0"
|
|
162
|
+
},
|
|
163
|
+
"overrides": {
|
|
164
|
+
"fast-uri": "3.1.2",
|
|
165
|
+
"minimatch@10.2.5": {
|
|
166
|
+
"brace-expansion": "5.0.6"
|
|
167
|
+
},
|
|
168
|
+
"qs": "6.15.2",
|
|
169
|
+
"ws": "8.21.0"
|
|
161
170
|
}
|
|
162
171
|
}
|