@grifhinz/logics-manager 2.0.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/LICENSE +21 -0
- package/README.md +452 -0
- package/VERSION +1 -0
- package/logics_manager/__init__.py +5 -0
- package/logics_manager/__main__.py +9 -0
- package/logics_manager/assist.py +2211 -0
- package/logics_manager/audit.py +990 -0
- package/logics_manager/bootstrap.py +123 -0
- package/logics_manager/cli.py +183 -0
- package/logics_manager/config.py +251 -0
- package/logics_manager/doctor.py +127 -0
- package/logics_manager/flow.py +1449 -0
- package/logics_manager/index.py +142 -0
- package/logics_manager/lint.py +622 -0
- package/logics_manager/sync.py +604 -0
- package/package.json +162 -0
- package/pyproject.toml +15 -0
- package/scripts/logics-manager.py +15 -0
- package/scripts/npm/logics-manager.mjs +96 -0
package/package.json
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grifhinz/logics-manager",
|
|
3
|
+
"displayName": "Logics Orchestrator",
|
|
4
|
+
"description": "Visual orchestration for Logics workflows inside VS Code.",
|
|
5
|
+
"version": "2.0.0",
|
|
6
|
+
"publisher": "cdx-logics",
|
|
7
|
+
"icon": "media/icon.png",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/AlexAgo83/logics-manager.git"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"vscode": "^1.86.0"
|
|
14
|
+
},
|
|
15
|
+
"categories": [
|
|
16
|
+
"Other"
|
|
17
|
+
],
|
|
18
|
+
"main": "./dist/extension.js",
|
|
19
|
+
"bin": {
|
|
20
|
+
"logics-manager": "./scripts/npm/logics-manager.mjs"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"VERSION",
|
|
29
|
+
"pyproject.toml",
|
|
30
|
+
"scripts/logics-manager.py",
|
|
31
|
+
"scripts/npm/",
|
|
32
|
+
"logics_manager/*.py",
|
|
33
|
+
"logics_manager/**/*.py"
|
|
34
|
+
],
|
|
35
|
+
"contributes": {
|
|
36
|
+
"viewsContainers": {
|
|
37
|
+
"panel": [
|
|
38
|
+
{
|
|
39
|
+
"id": "logics",
|
|
40
|
+
"title": "Logics",
|
|
41
|
+
"icon": "media/logics.svg"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"views": {
|
|
46
|
+
"logics": [
|
|
47
|
+
{
|
|
48
|
+
"id": "logics.orchestrator",
|
|
49
|
+
"name": "Orchestrator",
|
|
50
|
+
"icon": "media/logics.svg",
|
|
51
|
+
"type": "webview"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"commands": [
|
|
56
|
+
{
|
|
57
|
+
"command": "logics.refresh",
|
|
58
|
+
"title": "Logics: Refresh"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"command": "logics.refreshAgents",
|
|
62
|
+
"title": "Logics: Refresh Agents"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"command": "logics.selectAgent",
|
|
66
|
+
"title": "Logics: Select Agent"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"command": "logics.open",
|
|
70
|
+
"title": "Logics: Open Item"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"command": "logics.promote",
|
|
74
|
+
"title": "Logics: Promote Item"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"command": "logics.newRequest",
|
|
78
|
+
"title": "Logics: New Request"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"command": "logics.createCompanionDoc",
|
|
82
|
+
"title": "Logics: Create Companion Doc"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"command": "logics.checkEnvironment",
|
|
86
|
+
"title": "Logics: Check Environment"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"command": "logics.openHybridInsights",
|
|
90
|
+
"title": "Logics: Open Hybrid Insights"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"command": "logics.openLogicsInsights",
|
|
94
|
+
"title": "Logics: Open Logics Insights"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"command": "logics.assistTriage",
|
|
98
|
+
"title": "Logics: Triage Item"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"command": "logics.assistDiffRisk",
|
|
102
|
+
"title": "Logics: Assess Diff Risk"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"command": "logics.assistValidationChecklist",
|
|
106
|
+
"title": "Logics: Build Validation Checklist"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"command": "logics.assistDocConsistency",
|
|
110
|
+
"title": "Logics: Review Doc Consistency"
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"scripts": {
|
|
115
|
+
"postinstall": "npm run compile",
|
|
116
|
+
"bundle:extension": "node scripts/build/package-extension.mjs",
|
|
117
|
+
"watch:bundle": "node scripts/build/package-extension.mjs --watch",
|
|
118
|
+
"watch:types": "tsc -watch -p ./",
|
|
119
|
+
"compile": "tsc -p ./ && npm run bundle:extension",
|
|
120
|
+
"watch": "npm run watch:bundle",
|
|
121
|
+
"test": "vitest run",
|
|
122
|
+
"test:coverage:src": "node scripts/run-plugin-coverage.mjs src",
|
|
123
|
+
"test:coverage:media": "node scripts/run-plugin-coverage.mjs media",
|
|
124
|
+
"test:coverage": "npm run test:coverage:src && npm run test:coverage:media",
|
|
125
|
+
"test:smoke": "node tests/run_extension_smoke_checks.mjs",
|
|
126
|
+
"test:npm-cli": "node scripts/npm/logics-manager.mjs --help",
|
|
127
|
+
"test:lifecycle": "node tests/run_plugin_lifecycle_checks.mjs",
|
|
128
|
+
"test:watch": "vitest",
|
|
129
|
+
"lint": "npm run lint:ts && npm run lint:es",
|
|
130
|
+
"lint:ts": "tsc -p ./ --noEmit",
|
|
131
|
+
"lint:es": "eslint src/**/*.ts",
|
|
132
|
+
"lint:logics": "node scripts/run-python.mjs -m logics_manager lint",
|
|
133
|
+
"audit:logics": "node scripts/run-python.mjs -m logics_manager audit && node scripts/run-python.mjs -m logics_manager lint",
|
|
134
|
+
"audit:ci": "node scripts/check-npm-audit.mjs",
|
|
135
|
+
"logics:finish:task": "node scripts/run-python.mjs -m logics_manager flow finish task",
|
|
136
|
+
"ci:fast": "npm run compile && npm run lint && npm run test:coverage && npm run test:smoke && npm run lint:logics && npm run package:ci",
|
|
137
|
+
"ci:check": "node scripts/ci-check.mjs",
|
|
138
|
+
"dev": "npm run compile && code --extensionDevelopmentPath=.",
|
|
139
|
+
"debug:webview": "node debug/webview/server.mjs",
|
|
140
|
+
"package:ci": "node scripts/build/package-ci.mjs",
|
|
141
|
+
"package": "npm run compile && node scripts/build/package-release.mjs",
|
|
142
|
+
"install:vsix": "npm run package && node scripts/build/install-vsix.mjs",
|
|
143
|
+
"publish:npm": "node scripts/release/publish-npm.mjs",
|
|
144
|
+
"release:changelog:resolve": "node scripts/release/resolve-release-changelog.mjs --validate-current",
|
|
145
|
+
"release:changelog:validate": "node scripts/release/resolve-release-changelog.mjs --validate-current --require-curated"
|
|
146
|
+
},
|
|
147
|
+
"devDependencies": {
|
|
148
|
+
"@types/node": "^20.10.0",
|
|
149
|
+
"@types/vscode": "^1.86.0",
|
|
150
|
+
"@typescript-eslint/eslint-plugin": "^8.58.1",
|
|
151
|
+
"@typescript-eslint/parser": "^8.58.1",
|
|
152
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
153
|
+
"esbuild": "^0.25.10",
|
|
154
|
+
"eslint": "^10.2.0",
|
|
155
|
+
"jsdom": "^25.0.1",
|
|
156
|
+
"mermaid": "^11.14.0",
|
|
157
|
+
"typescript": "^5.3.3",
|
|
158
|
+
"vitest": "^4.1.2",
|
|
159
|
+
"yaml": "^2.8.3",
|
|
160
|
+
"yauzl": "^3.2.0"
|
|
161
|
+
}
|
|
162
|
+
}
|
package/pyproject.toml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "logics-manager"
|
|
7
|
+
version = "2.0.0"
|
|
8
|
+
description = "Canonical Logics CLI"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
|
|
11
|
+
[project.scripts]
|
|
12
|
+
logics-manager = "logics_manager.cli:main"
|
|
13
|
+
|
|
14
|
+
[tool.setuptools]
|
|
15
|
+
packages = ["logics_manager"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
REPO_ROOT = Path(__file__).resolve().parents[1]
|
|
8
|
+
if str(REPO_ROOT) not in sys.path:
|
|
9
|
+
sys.path.insert(0, str(REPO_ROOT))
|
|
10
|
+
|
|
11
|
+
from logics_manager.cli import main
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
if __name__ == "__main__":
|
|
15
|
+
raise SystemExit(main(sys.argv[1:]))
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
+
|
|
6
|
+
export function buildCandidates(platform = process.platform) {
|
|
7
|
+
return platform === "win32"
|
|
8
|
+
? [
|
|
9
|
+
{ command: "python3", argsPrefix: [] },
|
|
10
|
+
{ command: "python", argsPrefix: [] },
|
|
11
|
+
{ command: "py", argsPrefix: ["-3"] },
|
|
12
|
+
{ command: "py", argsPrefix: [] }
|
|
13
|
+
]
|
|
14
|
+
: [
|
|
15
|
+
{ command: "python3", argsPrefix: [] },
|
|
16
|
+
{ command: "python", argsPrefix: [] }
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function isMissingCommandError(error) {
|
|
21
|
+
const detail = `${error?.message || ""}\n${error?.stderr || ""}\n${error?.stdout || ""}`.toLowerCase();
|
|
22
|
+
return (
|
|
23
|
+
detail.includes("enoent") ||
|
|
24
|
+
detail.includes("not recognized as an internal or external command") ||
|
|
25
|
+
detail.includes("command not found") ||
|
|
26
|
+
detail.includes("python was not found") ||
|
|
27
|
+
detail.includes("cannot find the file specified")
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function parsePythonVersion(text) {
|
|
32
|
+
const match = text.match(/Python\s+(\d+)\.(\d+)(?:\.(\d+))?/i);
|
|
33
|
+
if (!match) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
major: Number.parseInt(match[1], 10),
|
|
38
|
+
minor: Number.parseInt(match[2], 10)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function isSupportedPythonVersion(version) {
|
|
43
|
+
return version.major > 3 || (version.major === 3 && version.minor >= 10);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function resolvePythonLauncher(candidate, spawn = spawnSync) {
|
|
47
|
+
const result = spawn(candidate.command, [...candidate.argsPrefix, "--version"], {
|
|
48
|
+
encoding: "utf8"
|
|
49
|
+
});
|
|
50
|
+
if (result.error || result.status !== 0) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const versionText = `${result.stdout || ""}\n${result.stderr || ""}`.trim();
|
|
55
|
+
const version = parsePythonVersion(versionText);
|
|
56
|
+
if (!version || !isSupportedPythonVersion(version)) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return candidate;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function runLogicsManager(argv = process.argv.slice(2), platform = process.platform, spawn = spawnSync) {
|
|
64
|
+
const candidates = buildCandidates(platform);
|
|
65
|
+
const wrapperDir = dirname(fileURLToPath(import.meta.url));
|
|
66
|
+
const packageRoot = resolve(wrapperDir, "..", "..");
|
|
67
|
+
const scriptPath = resolve(packageRoot, "scripts", "logics-manager.py");
|
|
68
|
+
for (const candidate of candidates) {
|
|
69
|
+
const launcher = resolvePythonLauncher(candidate, spawn);
|
|
70
|
+
if (!launcher) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const result = spawn(launcher.command, [...launcher.argsPrefix, scriptPath, ...argv], {
|
|
75
|
+
stdio: "inherit"
|
|
76
|
+
});
|
|
77
|
+
if (result.status === 0) {
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
if (isMissingCommandError(result.error)) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
return result.status ?? 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
console.error(
|
|
87
|
+
platform === "win32"
|
|
88
|
+
? "Python 3.10+ interpreter not found. Install Python 3.10 or newer and ensure `python3`, `python`, or `py` is available on PATH."
|
|
89
|
+
: "Python 3.10+ interpreter not found. Install Python 3.10 or newer and ensure `python3` or `python` is available on PATH."
|
|
90
|
+
);
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
95
|
+
process.exit(runLogicsManager());
|
|
96
|
+
}
|