machineconfig 3.3__py3-none-any.whl → 3.5__py3-none-any.whl
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 machineconfig might be problematic. Click here for more details.
- machineconfig/cluster/sessions_managers/wt_local_manager.py +1 -1
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +1 -1
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +1 -1
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +1 -1
- machineconfig/cluster/templates/utils.py +1 -1
- machineconfig/jobs/linux/msc/cli_agents.sh +18 -2
- machineconfig/jobs/python/python_ve_symlink.py +1 -1
- machineconfig/jobs/python/vscode/api.py +1 -1
- machineconfig/jobs/python/vscode/select_interpreter.py +2 -2
- machineconfig/jobs/python/vscode/sync_code.py +1 -1
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +1 -1
- machineconfig/jobs/python_custom_installers/dev/espanso.py +1 -1
- machineconfig/jobs/python_custom_installers/hx.py +1 -1
- machineconfig/jobs/python_generic_installers/config.json +0 -11
- machineconfig/profile/create.py +3 -3
- machineconfig/profile/shell.py +1 -1
- machineconfig/scripts/python/ai/mcinit.py +23 -67
- machineconfig/scripts/python/ai/solutions/__init__.py +0 -0
- machineconfig/scripts/python/ai/solutions/_shared.py +5 -0
- machineconfig/scripts/python/ai/solutions/claude/claude.py +8 -0
- machineconfig/scripts/python/ai/solutions/cline/cline.py +10 -0
- machineconfig/scripts/python/ai/solutions/copilot/github_copilot.py +35 -0
- machineconfig/scripts/python/ai/solutions/copilot/privacy.md +4 -0
- machineconfig/scripts/python/ai/solutions/crush/crush.json +216 -0
- machineconfig/scripts/python/ai/solutions/crush/crush.py +25 -0
- machineconfig/scripts/python/ai/solutions/crush/privacy.md +2 -0
- machineconfig/scripts/python/ai/solutions/cursor/cursors.py +10 -0
- machineconfig/scripts/python/ai/solutions/gemini/gemini.py +14 -0
- machineconfig/scripts/python/ai/solutions/generic.py +41 -0
- machineconfig/scripts/python/ai/solutions/kilocode/privacy.md +3 -0
- machineconfig/scripts/python/ai/solutions/opencode/opencode.json +4 -0
- machineconfig/scripts/python/ai/solutions/opencode/opencode.py +1 -0
- machineconfig/scripts/python/choose_wezterm_theme.py +1 -1
- machineconfig/scripts/python/cloud_copy.py +2 -2
- machineconfig/scripts/python/cloud_mount.py +2 -2
- machineconfig/scripts/python/cloud_repo_sync.py +3 -2
- machineconfig/scripts/python/croshell.py +12 -7
- machineconfig/scripts/python/devops_add_identity.py +1 -1
- machineconfig/scripts/python/devops_add_ssh_key.py +1 -1
- machineconfig/scripts/python/devops_backup_retrieve.py +4 -3
- machineconfig/scripts/python/devops_update_repos.py +2 -2
- machineconfig/scripts/python/dotfile.py +1 -1
- machineconfig/scripts/python/fire_agents.py +3 -3
- machineconfig/scripts/python/fire_agents_help_launch.py +2 -2
- machineconfig/scripts/python/fire_jobs.py +8 -8
- machineconfig/scripts/python/fire_jobs_layout_helper.py +2 -2
- machineconfig/scripts/python/ftpx.py +2 -2
- machineconfig/scripts/python/helpers/cloud_helpers.py +2 -1
- machineconfig/scripts/python/helpers/helpers2.py +4 -3
- machineconfig/scripts/python/helpers/helpers4.py +1 -1
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +2 -2
- machineconfig/scripts/python/mount_nfs.py +1 -1
- machineconfig/scripts/python/mount_ssh.py +1 -1
- machineconfig/scripts/python/repos.py +6 -3
- machineconfig/scripts/python/repos_helper_clone.py +121 -0
- machineconfig/scripts/python/repos_helper_record.py +2 -2
- machineconfig/scripts/python/start_slidev.py +1 -1
- machineconfig/scripts/python/wsl_windows_transfer.py +1 -1
- machineconfig/setup_windows/wt_and_pwsh/install_nerd_fonts.py +1 -1
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +3 -3
- machineconfig/utils/{utils2.py → accessories.py} +13 -29
- machineconfig/utils/code.py +2 -2
- machineconfig/utils/installer.py +2 -2
- machineconfig/utils/installer_utils/installer_abc.py +1 -1
- machineconfig/utils/installer_utils/installer_class.py +2 -2
- machineconfig/utils/io.py +94 -0
- machineconfig/utils/links.py +2 -2
- machineconfig/utils/notifications.py +0 -9
- machineconfig/utils/{path_reduced.py → path_extended.py} +1 -1
- machineconfig/utils/{path.py → path_helper.py} +1 -1
- machineconfig/utils/procs.py +1 -1
- machineconfig/utils/{utils5.py → scheduler.py} +3 -8
- machineconfig/utils/ssh.py +2 -2
- machineconfig/utils/terminal.py +12 -2
- machineconfig/utils/ve.py +2 -16
- {machineconfig-3.3.dist-info → machineconfig-3.5.dist-info}/METADATA +1 -4
- {machineconfig-3.3.dist-info → machineconfig-3.5.dist-info}/RECORD +87 -71
- machineconfig/utils/io_save.py +0 -95
- /machineconfig/scripts/python/ai/{chatmodes → solutions/copilot/chatmodes}/Thinking-Beast-Mode.chatmode.md +0 -0
- /machineconfig/scripts/python/ai/{chatmodes → solutions/copilot/chatmodes}/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md +0 -0
- /machineconfig/scripts/python/ai/{chatmodes → solutions/copilot/chatmodes}/deepResearch.chatmode.md +0 -0
- /machineconfig/scripts/python/ai/{instructions → solutions/copilot/instructions}/python/dev.instructions.md +0 -0
- /machineconfig/scripts/python/ai/{prompts → solutions/copilot/prompts}/allLintersAndTypeCheckers.prompt.md +0 -0
- /machineconfig/scripts/python/ai/{prompts → solutions/copilot/prompts}/research-report-skeleton.prompt.md +0 -0
- /machineconfig/scripts/python/ai/{configs/.gemini → solutions/gemini}/settings.json +0 -0
- {machineconfig-3.3.dist-info → machineconfig-3.5.dist-info}/WHEEL +0 -0
- {machineconfig-3.3.dist-info → machineconfig-3.5.dist-info}/entry_points.txt +0 -0
- {machineconfig-3.3.dist-info → machineconfig-3.5.dist-info}/top_level.txt +0 -0
|
@@ -6,7 +6,7 @@ import logging
|
|
|
6
6
|
import subprocess
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import Optional, Dict, List, Any
|
|
9
|
-
from machineconfig.utils.
|
|
9
|
+
from machineconfig.utils.scheduler import Scheduler
|
|
10
10
|
from machineconfig.cluster.sessions_managers.wt_local import WTLayoutGenerator
|
|
11
11
|
from machineconfig.utils.schemas.layouts.layout_types import LayoutConfig
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@ import uuid
|
|
|
4
4
|
import logging
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from typing import Optional, Any
|
|
7
|
-
from machineconfig.utils.
|
|
7
|
+
from machineconfig.utils.scheduler import Scheduler
|
|
8
8
|
from machineconfig.cluster.sessions_managers.wt_local import run_command_in_wt_tab
|
|
9
9
|
from machineconfig.cluster.sessions_managers.wt_remote import WTRemoteLayoutGenerator
|
|
10
10
|
from machineconfig.utils.schemas.layouts.layout_types import TabConfig
|
|
@@ -11,7 +11,7 @@ from typing import Optional, List
|
|
|
11
11
|
from rich.console import Console
|
|
12
12
|
|
|
13
13
|
from machineconfig.cluster.sessions_managers.zellij_utils.monitoring_types import SessionReport, GlobalSummary, StartResult, ActiveSessionInfo, StatusRow
|
|
14
|
-
from machineconfig.utils.
|
|
14
|
+
from machineconfig.utils.scheduler import Scheduler
|
|
15
15
|
from machineconfig.cluster.sessions_managers.zellij_local import ZellijLayoutGenerator
|
|
16
16
|
from machineconfig.utils.schemas.layouts.layout_types import LayoutConfig
|
|
17
17
|
|
|
@@ -3,7 +3,7 @@ import json
|
|
|
3
3
|
import uuid
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from typing import Optional, Dict
|
|
6
|
-
from machineconfig.utils.
|
|
6
|
+
from machineconfig.utils.scheduler import Scheduler
|
|
7
7
|
from machineconfig.cluster.sessions_managers.zellij_local import run_command_in_zellij_tab
|
|
8
8
|
from machineconfig.cluster.sessions_managers.zellij_remote import ZellijRemoteLayoutGenerator
|
|
9
9
|
from machineconfig.utils.schemas.layouts.layout_types import LayoutConfig
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
# Terminal-based CLI agents and tools for productivity and coding.
|
|
4
5
|
npm install -g @google/gemini-cli
|
|
5
6
|
npm install -g @charmland/crush
|
|
6
|
-
npm install -g opencode-ai@latest
|
|
7
|
+
npm install -g opencode-ai@latest # or curl -fsSL https://opencode.ai/install | bash
|
|
8
|
+
uv tool install --force --python python3.12 --with pip aider-chat@latest
|
|
7
9
|
|
|
8
|
-
curl https://cursor.com/install -fsS | bash
|
|
9
10
|
|
|
11
|
+
# cursor-cli
|
|
12
|
+
curl https://cursor.com/install -fsS | bash
|
|
10
13
|
cd $HOME/Downloads
|
|
11
14
|
curl --proto '=https' --tlsv1.2 -sSf "https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip" -o "q.zip"
|
|
12
15
|
unzip q.zip
|
|
@@ -14,3 +17,16 @@ unzip q.zip
|
|
|
14
17
|
rm q.zip
|
|
15
18
|
rm -rfd q
|
|
16
19
|
|
|
20
|
+
# Vscode extensions for AI-assisted coding.
|
|
21
|
+
# Github copilot
|
|
22
|
+
# Roo
|
|
23
|
+
# Cline
|
|
24
|
+
# Kilocode
|
|
25
|
+
# Continue
|
|
26
|
+
# CodeGPT
|
|
27
|
+
# qodo (and cli)
|
|
28
|
+
|
|
29
|
+
# Editors based on AI
|
|
30
|
+
# Kiro
|
|
31
|
+
# Cursor
|
|
32
|
+
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# import os
|
|
4
4
|
# import json
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from machineconfig.utils.
|
|
7
|
-
from machineconfig.utils.
|
|
6
|
+
from machineconfig.utils.io import save_json
|
|
7
|
+
from machineconfig.utils.io import read_json
|
|
8
8
|
import argparse
|
|
9
9
|
import platform
|
|
10
10
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# from platform import system
|
|
4
4
|
from typing import Optional
|
|
5
5
|
from machineconfig.utils.schemas.installer.installer_types import InstallerData
|
|
6
|
-
from machineconfig.utils.
|
|
6
|
+
from machineconfig.utils.path_extended import PathExtended as PathExtended
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
config_dict: InstallerData = {
|
|
@@ -68,7 +68,7 @@ def main(version: Optional[str]):
|
|
|
68
68
|
print("🚀 Installing Espanso using installer...")
|
|
69
69
|
from machineconfig.utils.installer_utils.installer_class import Installer
|
|
70
70
|
|
|
71
|
-
installer = Installer
|
|
71
|
+
installer = Installer(config_dict)
|
|
72
72
|
installer.install(version=None)
|
|
73
73
|
|
|
74
74
|
config = """
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Installers do not add runtime files to the machine, hence this script.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from machineconfig.utils.
|
|
5
|
+
from machineconfig.utils.path_extended import PathExtended as PathExtended
|
|
6
6
|
from machineconfig.utils.installer_utils.installer_abc import WINDOWS_INSTALL_PATH
|
|
7
7
|
from typing import Optional
|
|
8
8
|
import platform
|
|
@@ -366,17 +366,6 @@
|
|
|
366
366
|
"stripVersion": true,
|
|
367
367
|
"exeName": "mprocs"
|
|
368
368
|
},
|
|
369
|
-
{
|
|
370
|
-
"appName": "opencommit",
|
|
371
|
-
"repoURL": "npm install -g opencommit",
|
|
372
|
-
"doc": "📝 Opencommit is a cli tool to help you write better commit messages.",
|
|
373
|
-
"filenameTemplate": {
|
|
374
|
-
"amd64": {},
|
|
375
|
-
"arm64": {}
|
|
376
|
-
},
|
|
377
|
-
"stripVersion": false,
|
|
378
|
-
"exeName": "opencommit"
|
|
379
|
-
},
|
|
380
369
|
{
|
|
381
370
|
"appName": "ouch",
|
|
382
371
|
"repoURL": "https://github.com/ouch-org/ouch",
|
machineconfig/profile/create.py
CHANGED
|
@@ -6,17 +6,17 @@ This script Takes away all config files from the computer, place them in one dir
|
|
|
6
6
|
|
|
7
7
|
from rich.console import Console
|
|
8
8
|
|
|
9
|
-
from machineconfig.utils.
|
|
9
|
+
from machineconfig.utils.path_extended import PathExtended as PathExtended
|
|
10
10
|
from machineconfig.utils.links import symlink_func, symlink_copy
|
|
11
11
|
from machineconfig.utils.options import display_options
|
|
12
12
|
from machineconfig.utils.source_of_truth import LIBRARY_ROOT, REPO_ROOT
|
|
13
|
-
from machineconfig.utils.utils2 import read_toml
|
|
14
13
|
from machineconfig.profile.shell import create_default_shell_profile
|
|
15
14
|
|
|
16
15
|
import platform
|
|
17
16
|
import os
|
|
18
17
|
import ctypes
|
|
19
18
|
import subprocess
|
|
19
|
+
import tomllib
|
|
20
20
|
from typing import Optional, Any, TypedDict
|
|
21
21
|
|
|
22
22
|
system = platform.system() # Linux or Windows
|
|
@@ -39,7 +39,7 @@ class SymlinkMapper(TypedDict):
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def apply_mapper(choice: Optional[str] = None):
|
|
42
|
-
symlink_mapper: dict[str, dict[str, SymlinkMapper]] =
|
|
42
|
+
symlink_mapper: dict[str, dict[str, SymlinkMapper]] = tomllib.loads(LIBRARY_ROOT.joinpath("profile/mapper.toml").read_text(encoding="utf-8"))
|
|
43
43
|
prioritize_to_this = True
|
|
44
44
|
exclude: list[str] = [] # "wsl_linux", "wsl_windows"
|
|
45
45
|
|
machineconfig/profile/shell.py
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from machineconfig.utils.ve import get_repo_root
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
from machineconfig.scripts.python.ai.solutions import generic
|
|
4
|
+
from machineconfig.scripts.python.ai.solutions.claude import claude
|
|
5
|
+
from machineconfig.scripts.python.ai.solutions.cline import cline
|
|
6
|
+
from machineconfig.scripts.python.ai.solutions.copilot import github_copilot
|
|
7
|
+
from machineconfig.scripts.python.ai.solutions.crush import crush
|
|
8
|
+
from machineconfig.scripts.python.ai.solutions.cursor import cursors
|
|
9
|
+
from machineconfig.scripts.python.ai.solutions.gemini import gemini
|
|
10
|
+
from machineconfig.utils.accessories import get_repo_root
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
def add_ai_configs(repo_root: Path) -> None:
|
|
11
|
-
import machineconfig as mc
|
|
12
|
-
|
|
13
|
-
mc_root = Path(mc.__file__).parent
|
|
14
|
-
|
|
15
14
|
repo_root_resolved = get_repo_root(repo_root)
|
|
16
15
|
if repo_root_resolved is not None:
|
|
17
16
|
repo_root = repo_root_resolved # this means you can run the command from any subdirectory of the repo.
|
|
@@ -22,6 +21,9 @@ def add_ai_configs(repo_root: Path) -> None:
|
|
|
22
21
|
command_to_run = """
|
|
23
22
|
uv init --python 3.13
|
|
24
23
|
uv venv
|
|
24
|
+
uv add --upgrade-package pylint pyright mypy pyrefly ty --dev # linters and type checkers
|
|
25
|
+
uv add --upgrade-package pytest --dev
|
|
26
|
+
|
|
25
27
|
"""
|
|
26
28
|
import subprocess
|
|
27
29
|
|
|
@@ -30,66 +32,20 @@ uv venv
|
|
|
30
32
|
print("Terminating mcinit ...")
|
|
31
33
|
return
|
|
32
34
|
|
|
33
|
-
instructions_repository_dir = mc_root.joinpath("scripts/python/ai/instructions")
|
|
34
|
-
chatmodes_dir = mc_root.joinpath("scripts/python/ai/chatmodes")
|
|
35
|
-
prompts_dir = mc_root.joinpath("scripts/python/ai/prompts")
|
|
36
|
-
# python_rules_file = instructions_repository_dir.joinpath("python/dev.md")
|
|
37
|
-
|
|
38
|
-
# VSCODE:
|
|
39
|
-
# as per: https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions
|
|
40
|
-
# Copilot Chat on github website chat & basic guideline.
|
|
41
|
-
repo_root.joinpath(".github/chatmodes").mkdir(parents=True, exist_ok=True)
|
|
42
|
-
repo_root.joinpath(".github/prompts").mkdir(parents=True, exist_ok=True)
|
|
43
|
-
repo_root.joinpath(".github/instructions").mkdir(parents=True, exist_ok=True)
|
|
44
|
-
for a_chatmode in chatmodes_dir.iterdir():
|
|
45
|
-
repo_root.joinpath(".github/chatmodes", a_chatmode.name.split(".")[0] + ".chatmode.md").write_text(data=a_chatmode.read_text(encoding="utf-8"), encoding="utf-8")
|
|
46
|
-
for a_prompt in prompts_dir.iterdir():
|
|
47
|
-
repo_root.joinpath(".github/prompts", a_prompt.name.split(".")[0] + ".prompt.md").write_text(data=a_prompt.read_text(encoding="utf-8"), encoding="utf-8")
|
|
48
|
-
for an_instruction in instructions_repository_dir.rglob("*.md"):
|
|
49
|
-
repo_root.joinpath(".github/instructions", an_instruction.name.split(".")[0] + ".instruction.md").write_text(data=an_instruction.read_text(encoding="utf-8"), encoding="utf-8")
|
|
50
|
-
tmp = repo_root.joinpath(".github/copilot-instructions.md")
|
|
51
|
-
|
|
52
|
-
generic_instructions = instructions_repository_dir.joinpath("python/dev.instructions.md")
|
|
53
|
-
tmp.write_text(data=generic_instructions.read_text(encoding="utf-8"), encoding="utf-8")
|
|
54
|
-
|
|
55
|
-
# CURSOR, GEMINI, CLAUDE CODE, CRUSH, CLINE.
|
|
56
|
-
tmp = repo_root.joinpath(".cursor/rules/python_dev.mdc")
|
|
57
|
-
tmp.parent.mkdir(parents=True, exist_ok=True)
|
|
58
|
-
tmp.write_text(data=generic_instructions.read_text(encoding="utf-8"), encoding="utf-8")
|
|
59
|
-
tmp = repo_root.joinpath("CLAUDE.md")
|
|
60
|
-
tmp.write_text(data=generic_instructions.read_text(encoding="utf-8"), encoding="utf-8")
|
|
61
|
-
tmp = repo_root.joinpath("CRUSH.md")
|
|
62
|
-
tmp.write_text(data=generic_instructions.read_text(encoding="utf-8"), encoding="utf-8")
|
|
63
|
-
|
|
64
|
-
tmp = repo_root.joinpath("GEMINI.md")
|
|
65
|
-
tmp.write_text(data=generic_instructions.read_text(encoding="utf-8"), encoding="utf-8")
|
|
66
|
-
gemini_settings = mc_root.joinpath("scripts/python/ai/configs/.gemini/settings.json")
|
|
67
|
-
repo_root.joinpath(".gemini").mkdir(parents=True, exist_ok=True)
|
|
68
|
-
repo_root.joinpath(".gemini/settings.json").write_text(data=gemini_settings.read_text(encoding="utf-8"), encoding="utf-8")
|
|
69
|
-
|
|
70
|
-
tmp = repo_root.joinpath(".clinerules")
|
|
71
|
-
tmp.mkdir(parents=True, exist_ok=True)
|
|
72
|
-
tmp.joinpath("python_dev.md").write_text(data=generic_instructions.read_text(encoding="utf-8"), encoding="utf-8")
|
|
73
|
-
|
|
74
|
-
# OTHERS
|
|
75
|
-
scripts_dir = mc_root.joinpath("scripts/python/ai/scripts")
|
|
76
|
-
repo_root.joinpath(".scripts").mkdir(parents=True, exist_ok=True)
|
|
77
|
-
for a_script in scripts_dir.iterdir():
|
|
78
|
-
repo_root.joinpath(".scripts", a_script.name).write_text(data=a_script.read_text(encoding="utf-8"), encoding="utf-8")
|
|
79
|
-
|
|
80
35
|
dot_ai_dir = repo_root.joinpath(".ai")
|
|
81
36
|
dot_ai_dir.mkdir(parents=True, exist_ok=True)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
37
|
+
dot_scripts_dir = repo_root.joinpath(".scripts")
|
|
38
|
+
dot_scripts_dir.mkdir(parents=True, exist_ok=True)
|
|
39
|
+
generic.create_dot_scripts(repo_root=repo_root)
|
|
40
|
+
generic.adjust_gitignore(repo_root=repo_root)
|
|
41
|
+
|
|
42
|
+
github_copilot.build_configuration(repo_root=repo_root)
|
|
43
|
+
cursors.build_configuration(repo_root=repo_root)
|
|
44
|
+
gemini.build_configuration(repo_root=repo_root)
|
|
45
|
+
claude.build_configuration(repo_root=repo_root)
|
|
46
|
+
crush.build_configuration(repo_root=repo_root)
|
|
47
|
+
cline.build_configuration(repo_root=repo_root)
|
|
48
|
+
|
|
93
49
|
|
|
94
50
|
|
|
95
51
|
def main() -> None:
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def build_configuration(repo_root: Path) -> None:
|
|
7
|
+
instructions_path = get_generic_instructions_path()
|
|
8
|
+
repo_root.joinpath("CLAUDE.md").write_text(data=instructions_path.read_text(encoding="utf-8"), encoding="utf-8")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def build_configuration(repo_root: Path) -> None:
|
|
7
|
+
instructions_path = get_generic_instructions_path()
|
|
8
|
+
cline_dir = repo_root.joinpath(".clinerules")
|
|
9
|
+
cline_dir.mkdir(parents=True, exist_ok=True)
|
|
10
|
+
cline_dir.joinpath("python_dev.md").write_text(data=instructions_path.read_text(encoding="utf-8"), encoding="utf-8")
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
|
|
4
|
+
from machineconfig.utils.source_of_truth import LIBRARY_ROOT
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def build_configuration(repo_root: Path) -> None:
|
|
9
|
+
instructions_repository_dir = LIBRARY_ROOT.joinpath("scripts/python/ai/solutions/copilot/instructions")
|
|
10
|
+
chatmodes_dir = LIBRARY_ROOT.joinpath("scripts/python/ai/solutions/copilot/chatmodes")
|
|
11
|
+
prompts_dir = LIBRARY_ROOT.joinpath("scripts/python/ai/solutions/copilot/prompts")
|
|
12
|
+
|
|
13
|
+
github_dir = repo_root.joinpath(".github")
|
|
14
|
+
chatmodes_target_dir = github_dir.joinpath("chatmodes")
|
|
15
|
+
prompts_target_dir = github_dir.joinpath("prompts")
|
|
16
|
+
instructions_target_dir = github_dir.joinpath("instructions")
|
|
17
|
+
|
|
18
|
+
chatmodes_target_dir.mkdir(parents=True, exist_ok=True)
|
|
19
|
+
prompts_target_dir.mkdir(parents=True, exist_ok=True)
|
|
20
|
+
instructions_target_dir.mkdir(parents=True, exist_ok=True)
|
|
21
|
+
|
|
22
|
+
for chatmode in chatmodes_dir.iterdir():
|
|
23
|
+
chatmode_target = chatmodes_target_dir.joinpath(f"{chatmode.name.split('.')[0]}.chatmode.md")
|
|
24
|
+
chatmode_target.write_text(data=chatmode.read_text(encoding="utf-8"), encoding="utf-8")
|
|
25
|
+
|
|
26
|
+
for prompt in prompts_dir.iterdir():
|
|
27
|
+
prompt_target = prompts_target_dir.joinpath(f"{prompt.name.split('.')[0]}.prompt.md")
|
|
28
|
+
prompt_target.write_text(data=prompt.read_text(encoding="utf-8"), encoding="utf-8")
|
|
29
|
+
|
|
30
|
+
for instruction in instructions_repository_dir.rglob("*.md"):
|
|
31
|
+
instruction_target = instructions_target_dir.joinpath(f"{instruction.name.split('.')[0]}.instruction.md")
|
|
32
|
+
instruction_target.write_text(data=instruction.read_text(encoding="utf-8"), encoding="utf-8")
|
|
33
|
+
|
|
34
|
+
generic_instructions_path = get_generic_instructions_path()
|
|
35
|
+
github_dir.joinpath("copilot-instructions.md").write_text(data=generic_instructions_path.read_text(encoding="utf-8"), encoding="utf-8")
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://charm.land/crush.json",
|
|
3
|
+
"providers": {
|
|
4
|
+
"openai": {
|
|
5
|
+
"id": "openai",
|
|
6
|
+
"name": "OpenAI",
|
|
7
|
+
"base_url": "https://api.openai.com/v1",
|
|
8
|
+
"type": "openai",
|
|
9
|
+
"api_key": "$OPENAI_API_KEY",
|
|
10
|
+
"extra_headers": {
|
|
11
|
+
"OpenAI-Beta": "assistants=v2"
|
|
12
|
+
},
|
|
13
|
+
"models": [
|
|
14
|
+
{
|
|
15
|
+
"id": "gpt-4o",
|
|
16
|
+
"name": "GPT-4o",
|
|
17
|
+
"cost_per_1m_in": 5,
|
|
18
|
+
"cost_per_1m_out": 15,
|
|
19
|
+
"cost_per_1m_in_cached": 1,
|
|
20
|
+
"cost_per_1m_out_cached": 3,
|
|
21
|
+
"context_window": 128000,
|
|
22
|
+
"default_max_tokens": 16384,
|
|
23
|
+
"can_reason": false,
|
|
24
|
+
"has_reasoning_efforts": false,
|
|
25
|
+
"supports_attachments": true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "gpt-4o-mini",
|
|
29
|
+
"name": "GPT-4o mini",
|
|
30
|
+
"cost_per_1m_in": 0.15,
|
|
31
|
+
"cost_per_1m_out": 0.6,
|
|
32
|
+
"cost_per_1m_in_cached": 0.05,
|
|
33
|
+
"cost_per_1m_out_cached": 0.2,
|
|
34
|
+
"context_window": 128000,
|
|
35
|
+
"default_max_tokens": 8192,
|
|
36
|
+
"can_reason": false,
|
|
37
|
+
"has_reasoning_efforts": false,
|
|
38
|
+
"supports_attachments": true
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"anthropic": {
|
|
43
|
+
"id": "anthropic",
|
|
44
|
+
"name": "Anthropic",
|
|
45
|
+
"base_url": "https://api.anthropic.com/v1",
|
|
46
|
+
"type": "anthropic",
|
|
47
|
+
"api_key": "$ANTHROPIC_API_KEY",
|
|
48
|
+
"extra_headers": {
|
|
49
|
+
"anthropic-version": "2023-06-01"
|
|
50
|
+
},
|
|
51
|
+
"models": [
|
|
52
|
+
{
|
|
53
|
+
"id": "claude-3-5-sonnet-20240620",
|
|
54
|
+
"name": "Claude 3.5 Sonnet",
|
|
55
|
+
"cost_per_1m_in": 3,
|
|
56
|
+
"cost_per_1m_out": 15,
|
|
57
|
+
"cost_per_1m_in_cached": 3.75,
|
|
58
|
+
"cost_per_1m_out_cached": 0.3,
|
|
59
|
+
"context_window": 200000,
|
|
60
|
+
"default_max_tokens": 8000,
|
|
61
|
+
"can_reason": true,
|
|
62
|
+
"has_reasoning_efforts": true,
|
|
63
|
+
"default_reasoning_effort": "medium",
|
|
64
|
+
"supports_attachments": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "claude-3-haiku-20240307",
|
|
68
|
+
"name": "Claude 3 Haiku",
|
|
69
|
+
"cost_per_1m_in": 0.25,
|
|
70
|
+
"cost_per_1m_out": 1.25,
|
|
71
|
+
"cost_per_1m_in_cached": 0.05,
|
|
72
|
+
"cost_per_1m_out_cached": 0.1,
|
|
73
|
+
"context_window": 200000,
|
|
74
|
+
"default_max_tokens": 4000,
|
|
75
|
+
"can_reason": true,
|
|
76
|
+
"has_reasoning_efforts": true,
|
|
77
|
+
"default_reasoning_effort": "low",
|
|
78
|
+
"supports_attachments": true
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"openrouter": {
|
|
83
|
+
"id": "openrouter",
|
|
84
|
+
"name": "OpenRouter",
|
|
85
|
+
"base_url": "https://openrouter.ai/api/v1",
|
|
86
|
+
"type": "openai",
|
|
87
|
+
"api_key": "$OPENROUTER_API_KEY",
|
|
88
|
+
"models": [
|
|
89
|
+
{
|
|
90
|
+
"id": "deepseek/deepseek-chat",
|
|
91
|
+
"name": "Deepseek V3",
|
|
92
|
+
"cost_per_1m_in": 0.27,
|
|
93
|
+
"cost_per_1m_out": 1.1,
|
|
94
|
+
"cost_per_1m_in_cached": 0.07,
|
|
95
|
+
"cost_per_1m_out_cached": 0.3,
|
|
96
|
+
"context_window": 64000,
|
|
97
|
+
"default_max_tokens": 5000,
|
|
98
|
+
"can_reason": true,
|
|
99
|
+
"has_reasoning_efforts": false,
|
|
100
|
+
"supports_attachments": false
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"ollama": {
|
|
105
|
+
"id": "ollama",
|
|
106
|
+
"name": "Ollama",
|
|
107
|
+
"base_url": "http://localhost:11434/v1/",
|
|
108
|
+
"type": "openai",
|
|
109
|
+
"models": [
|
|
110
|
+
{
|
|
111
|
+
"id": "qwen2.5-coder:14b",
|
|
112
|
+
"name": "Qwen2.5 Coder 14B",
|
|
113
|
+
"cost_per_1m_in": 0,
|
|
114
|
+
"cost_per_1m_out": 0,
|
|
115
|
+
"cost_per_1m_in_cached": 0,
|
|
116
|
+
"cost_per_1m_out_cached": 0,
|
|
117
|
+
"context_window": 32768,
|
|
118
|
+
"default_max_tokens": 4096,
|
|
119
|
+
"can_reason": false,
|
|
120
|
+
"has_reasoning_efforts": false,
|
|
121
|
+
"supports_attachments": false
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"models": {
|
|
127
|
+
"large": {
|
|
128
|
+
"provider": "anthropic",
|
|
129
|
+
"model": "claude-3-5-sonnet-20240620",
|
|
130
|
+
"think": true,
|
|
131
|
+
"max_tokens": 6000
|
|
132
|
+
},
|
|
133
|
+
"small": {
|
|
134
|
+
"provider": "openai",
|
|
135
|
+
"model": "gpt-4o-mini",
|
|
136
|
+
"max_tokens": 4096
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"lsp": {
|
|
140
|
+
"python": {
|
|
141
|
+
"command": "pyright-langserver",
|
|
142
|
+
"args": ["--stdio"],
|
|
143
|
+
"filetypes": ["py"],
|
|
144
|
+
"env": {
|
|
145
|
+
"PYRIGHT_PYTHON_FORCE_VERSION": "3.13"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"ruff": {
|
|
149
|
+
"command": "ruff",
|
|
150
|
+
"args": ["server"],
|
|
151
|
+
"filetypes": ["py"]
|
|
152
|
+
},
|
|
153
|
+
"json": {
|
|
154
|
+
"command": "vscode-json-languageserver",
|
|
155
|
+
"args": ["--stdio"]
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"mcp": {
|
|
159
|
+
"filesystem": {
|
|
160
|
+
"type": "stdio",
|
|
161
|
+
"command": "uv",
|
|
162
|
+
"args": [
|
|
163
|
+
"run",
|
|
164
|
+
"python",
|
|
165
|
+
"-m",
|
|
166
|
+
"machineconfig.scripts.python.ai.solutions._shared"
|
|
167
|
+
],
|
|
168
|
+
"timeout": 120,
|
|
169
|
+
"env": {
|
|
170
|
+
"UV_PROJECT_ENV": "$(pwd)"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"github-docs": {
|
|
174
|
+
"type": "http",
|
|
175
|
+
"url": "https://api.github.com/mcp/",
|
|
176
|
+
"timeout": 90,
|
|
177
|
+
"headers": {
|
|
178
|
+
"Authorization": "$(echo Bearer $GITHUB_MCP_TOKEN)",
|
|
179
|
+
"X-Crush-Client": "machineconfig"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"architect": {
|
|
183
|
+
"type": "sse",
|
|
184
|
+
"url": "https://architect.mcp.machineconfig.local/stream",
|
|
185
|
+
"timeout": 120,
|
|
186
|
+
"headers": {
|
|
187
|
+
"Authorization": "$(echo Bearer $ARCHITECT_MCP_TOKEN)"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"options": {
|
|
192
|
+
"context_paths": [
|
|
193
|
+
"CRUSH.md",
|
|
194
|
+
"src/machineconfig/scripts/python/ai/solutions/crush/privacy.md",
|
|
195
|
+
".github/copilot-instructions.md",
|
|
196
|
+
"src/machineconfig/scripts/python/ai/solutions/_shared.py"
|
|
197
|
+
],
|
|
198
|
+
"tui": {
|
|
199
|
+
"compact_mode": true,
|
|
200
|
+
"diff_mode": "unified"
|
|
201
|
+
},
|
|
202
|
+
"debug": false,
|
|
203
|
+
"debug_lsp": false,
|
|
204
|
+
"disable_auto_summarize": false,
|
|
205
|
+
"data_directory": ".crush"
|
|
206
|
+
},
|
|
207
|
+
"permissions": {
|
|
208
|
+
"allowed_tools": [
|
|
209
|
+
"view",
|
|
210
|
+
"ls",
|
|
211
|
+
"glob",
|
|
212
|
+
"grep",
|
|
213
|
+
"write"
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
ref: https://github.com/charmbracelet/crush
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
import platform
|
|
10
|
+
from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def build_configuration(repo_root: Path) -> None:
|
|
15
|
+
instructions_path = get_generic_instructions_path()
|
|
16
|
+
repo_root.joinpath("CRUSH.md").write_text(data=instructions_path.read_text(encoding="utf-8"), encoding="utf-8")
|
|
17
|
+
|
|
18
|
+
repo_settings = repo_root.joinpath(".crush.json")
|
|
19
|
+
ignore_settings = repo_root.joinpath(".crushignore")
|
|
20
|
+
if platform.system() == "Windows":
|
|
21
|
+
global_settings = Path.home().joinpath("AppData/Local/crush/crush.json")
|
|
22
|
+
else:
|
|
23
|
+
global_settings = Path.home().joinpath(".config/crush/crush.json")
|
|
24
|
+
|
|
25
|
+
_ = repo_settings, ignore_settings, global_settings # to avoid unused variable warnings
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def build_configuration(repo_root: Path) -> None:
|
|
7
|
+
instructions_path = get_generic_instructions_path()
|
|
8
|
+
cursor_rules_path = repo_root.joinpath(".cursor/rules/python_dev.mdc")
|
|
9
|
+
cursor_rules_path.parent.mkdir(parents=True, exist_ok=True)
|
|
10
|
+
cursor_rules_path.write_text(data=instructions_path.read_text(encoding="utf-8"), encoding="utf-8")
|