msdev 0.9.0__tar.gz → 0.10.1__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 (95) hide show
  1. msdev-0.10.1/LICENSE +124 -0
  2. msdev-0.10.1/PKG-INFO +235 -0
  3. msdev-0.10.1/README.md +210 -0
  4. msdev-0.10.1/pyproject.toml +50 -0
  5. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/__init__.py +1 -1
  6. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/cli.py +148 -517
  7. msdev-0.10.1/src/msdev/core/__init__.py +1 -0
  8. msdev-0.10.1/src/msdev/core/compat.py +182 -0
  9. msdev-0.10.1/src/msdev/core/config.py +373 -0
  10. msdev-0.10.1/src/msdev/core/container_helper.py +251 -0
  11. msdev-0.10.1/src/msdev/core/env_transfer.py +364 -0
  12. msdev-0.10.1/src/msdev/core/helper_deploy.py +143 -0
  13. msdev-0.10.1/src/msdev/core/host_files.py +92 -0
  14. msdev-0.10.1/src/msdev/core/host_mutations.py +332 -0
  15. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/inventory.py +6 -1
  16. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/limits.py +2 -2
  17. msdev-0.10.1/src/msdev/core/local_rpc.py +85 -0
  18. msdev-0.10.1/src/msdev/core/multiplex.py +143 -0
  19. msdev-0.10.1/src/msdev/core/request_client.py +174 -0
  20. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/resources.py +5 -66
  21. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/services/__init__.py +23 -22
  22. msdev-0.10.1/src/msdev/core/services/capabilities.py +115 -0
  23. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/services/context.py +0 -2
  24. msdev-0.10.1/src/msdev/core/services/environment.py +331 -0
  25. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/services/node.py +1 -25
  26. msdev-0.10.1/src/msdev/core/services/results.py +65 -0
  27. msdev-0.10.1/src/msdev/core/ssh_tunnel.py +552 -0
  28. msdev-0.10.1/src/msdev/core/stream_limits.py +17 -0
  29. msdev-0.10.1/src/msdev/core/stream_server.py +606 -0
  30. msdev-0.10.1/src/msdev/core/stream_transport.py +360 -0
  31. msdev-0.10.1/src/msdev/core/streamproto.py +129 -0
  32. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/transport.py +306 -119
  33. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/daemon.py +286 -211
  34. msdev-0.10.1/src/msdev.egg-info/PKG-INFO +235 -0
  35. msdev-0.10.1/src/msdev.egg-info/SOURCES.txt +70 -0
  36. {msdev-0.9.0 → msdev-0.10.1}/tests/test_cli.py +11 -334
  37. msdev-0.10.1/tests/test_cli_only_architecture.py +59 -0
  38. msdev-0.10.1/tests/test_compat.py +45 -0
  39. {msdev-0.9.0 → msdev-0.10.1}/tests/test_config.py +82 -1
  40. msdev-0.10.1/tests/test_container_helper.py +234 -0
  41. {msdev-0.9.0 → msdev-0.10.1}/tests/test_daemon.py +195 -98
  42. msdev-0.10.1/tests/test_daemon_container_stream.py +84 -0
  43. msdev-0.10.1/tests/test_docker_stream_dispatch.py +237 -0
  44. msdev-0.10.1/tests/test_env_put_get_scenario.py +134 -0
  45. msdev-0.10.1/tests/test_env_read_write_scenario.py +134 -0
  46. msdev-0.10.1/tests/test_env_transfer.py +61 -0
  47. msdev-0.10.1/tests/test_exec_default_timeout_scenario.py +134 -0
  48. msdev-0.10.1/tests/test_helper_deploy.py +185 -0
  49. {msdev-0.9.0 → msdev-0.10.1}/tests/test_model_services.py +0 -2
  50. {msdev-0.9.0 → msdev-0.10.1}/tests/test_msdev_cli_skill.py +20 -30
  51. msdev-0.10.1/tests/test_multiplex.py +199 -0
  52. {msdev-0.9.0 → msdev-0.10.1}/tests/test_node_env_config.py +2 -48
  53. msdev-0.10.1/tests/test_node_env_services.py +187 -0
  54. msdev-0.10.1/tests/test_request_client.py +241 -0
  55. msdev-0.10.1/tests/test_ssh_tunnel.py +57 -0
  56. msdev-0.10.1/tests/test_stream_server.py +510 -0
  57. msdev-0.10.1/tests/test_stream_transport.py +314 -0
  58. msdev-0.10.1/tests/test_streamproto.py +65 -0
  59. msdev-0.9.0/tests/test_node_execution_services.py → msdev-0.10.1/tests/test_target_exec_services.py +0 -3
  60. msdev-0.9.0/tests/test_resource_guides.py → msdev-0.10.1/tests/test_target_guides.py +0 -18
  61. {msdev-0.9.0 → msdev-0.10.1}/tests/test_transport.py +240 -141
  62. msdev-0.10.1/tests/test_windows_local_scenario.py +87 -0
  63. msdev-0.9.0/PKG-INFO +0 -295
  64. msdev-0.9.0/README.md +0 -286
  65. msdev-0.9.0/pyproject.toml +0 -28
  66. msdev-0.9.0/src/msdev/core/__init__.py +0 -1
  67. msdev-0.9.0/src/msdev/core/config.py +0 -193
  68. msdev-0.9.0/src/msdev/core/services/environment.py +0 -84
  69. msdev-0.9.0/src/msdev/core/services/workspace.py +0 -567
  70. msdev-0.9.0/src/msdev/core/workspace/__init__.py +0 -36
  71. msdev-0.9.0/src/msdev/core/workspace/access.py +0 -1216
  72. msdev-0.9.0/src/msdev/core/workspace/client.py +0 -274
  73. msdev-0.9.0/src/msdev/core/workspace/paths.py +0 -45
  74. msdev-0.9.0/src/msdev/core/workspace/registry.py +0 -151
  75. msdev-0.9.0/src/msdev/session/__init__.py +0 -13
  76. msdev-0.9.0/src/msdev/session/export.py +0 -190
  77. msdev-0.9.0/src/msdev/session/log.py +0 -269
  78. msdev-0.9.0/src/msdev.egg-info/PKG-INFO +0 -295
  79. msdev-0.9.0/src/msdev.egg-info/SOURCES.txt +0 -50
  80. msdev-0.9.0/tests/test_cli_only_architecture.py +0 -93
  81. msdev-0.9.0/tests/test_cli_session.py +0 -202
  82. msdev-0.9.0/tests/test_node_env_services.py +0 -63
  83. msdev-0.9.0/tests/test_workspace.py +0 -837
  84. msdev-0.9.0/tests/test_workspace_client.py +0 -335
  85. msdev-0.9.0/tests/test_workspace_services.py +0 -414
  86. {msdev-0.9.0 → msdev-0.10.1}/setup.cfg +0 -0
  87. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/guides.py +0 -0
  88. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/services/execution.py +0 -0
  89. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/services/model.py +0 -0
  90. {msdev-0.9.0 → msdev-0.10.1}/src/msdev/core/services/npu.py +0 -0
  91. {msdev-0.9.0 → msdev-0.10.1}/src/msdev.egg-info/dependency_links.txt +0 -0
  92. {msdev-0.9.0 → msdev-0.10.1}/src/msdev.egg-info/entry_points.txt +0 -0
  93. {msdev-0.9.0 → msdev-0.10.1}/src/msdev.egg-info/top_level.txt +0 -0
  94. {msdev-0.9.0 → msdev-0.10.1}/tests/test_inventory.py +0 -0
  95. {msdev-0.9.0 → msdev-0.10.1}/tests/test_model_cli.py +0 -0
msdev-0.10.1/LICENSE ADDED
@@ -0,0 +1,124 @@
1
+ 木兰宽松许可证, 第2版
2
+
3
+ 2020年1月 http://license.coscl.org.cn/MulanPSL2
4
+
5
+ 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
6
+
7
+ 0. 定义
8
+
9
+ “软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
10
+
11
+ “贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
12
+
13
+ “贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
14
+
15
+ “法人实体” 是指提交贡献的机构及其“关联实体”。
16
+
17
+ “关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
18
+
19
+ 1. 授予版权许可
20
+
21
+ 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
22
+
23
+ 2. 授予专利许可
24
+
25
+ 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
26
+
27
+ 3. 无商标许可
28
+
29
+ “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
30
+
31
+ 4. 分发限制
32
+
33
+ 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
34
+
35
+ 5. 免责声明与责任限制
36
+
37
+ “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
38
+
39
+ 6. 语言
40
+
41
+ “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
42
+
43
+ 条款结束
44
+
45
+ 如何将木兰宽松许可证,第2版,应用到您的软件
46
+
47
+ 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
48
+
49
+ 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
50
+
51
+ 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
52
+
53
+ 3, 请将如下声明文本放入每个源文件的头部注释中。
54
+
55
+ Copyright (c) [Year] [name of copyright holder]
56
+ [Software Name] is licensed under Mulan PSL v2.
57
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
58
+ You may obtain a copy of Mulan PSL v2 at:
59
+ http://license.coscl.org.cn/MulanPSL2
60
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
61
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
62
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
63
+ See the Mulan PSL v2 for more details.
64
+ Mulan Permissive Software License,Version 2
65
+ Mulan Permissive Software License,Version 2 (Mulan PSL v2)
66
+
67
+ January 2020 http://license.coscl.org.cn/MulanPSL2
68
+
69
+ Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
70
+
71
+ 0. Definition
72
+
73
+ Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
74
+
75
+ Contribution means the copyrightable work licensed by a particular Contributor under this License.
76
+
77
+ Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
78
+
79
+ Legal Entity means the entity making a Contribution and all its Affiliates.
80
+
81
+ Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
82
+
83
+ 1. Grant of Copyright License
84
+
85
+ Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
86
+
87
+ 2. Grant of Patent License
88
+
89
+ Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
90
+
91
+ 3. No Trademark License
92
+
93
+ No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
94
+
95
+ 4. Distribution Restriction
96
+
97
+ You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
98
+
99
+ 5. Disclaimer of Warranty and Limitation of Liability
100
+
101
+ THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
102
+
103
+ 6. Language
104
+
105
+ THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
106
+
107
+ END OF THE TERMS AND CONDITIONS
108
+
109
+ How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
110
+
111
+ To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
112
+
113
+ Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
114
+ Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
115
+ Attach the statement to the appropriate annotated syntax at the beginning of each source file.
116
+ Copyright (c) [Year] [name of copyright holder]
117
+ [Software Name] is licensed under Mulan PSL v2.
118
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
119
+ You may obtain a copy of Mulan PSL v2 at:
120
+ http://license.coscl.org.cn/MulanPSL2
121
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
122
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
123
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
124
+ See the Mulan PSL v2 for more details.
msdev-0.10.1/PKG-INFO ADDED
@@ -0,0 +1,235 @@
1
+ Metadata-Version: 2.4
2
+ Name: msdev
3
+ Version: 0.10.1
4
+ Summary: Portable nodes and execution environments for msModelSlim development
5
+ Author: msModelSlim Agent Contributors
6
+ License-Expression: MulanPSL-2.0
7
+ Project-URL: Homepage, https://gitcode.com/rookie_hongchuan/msdev
8
+ Project-URL: Repository, https://gitcode.com/rookie_hongchuan/msdev
9
+ Keywords: ssh,docker,conda,venv,remote,npu,mlops,devops
10
+ Classifier: Environment :: Console
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Operating System :: Microsoft :: Windows
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Topic :: Software Development :: Build Tools
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Dynamic: license-file
25
+
26
+ # msdev
27
+
28
+ `msdev` manages connection Nodes and execution Envs. A Node owns SSH and its
29
+ per-user `msdevd`; an Env references a Node and adds a host/Docker runtime plus
30
+ optional conda/venv/uv layers.
31
+
32
+ The CLI is intentionally stateless:
33
+
34
+ - Node-scoped NPU/model operations name `--node` or use `--all`;
35
+ - execution names `--env`;
36
+ - no harness conversation binding or implicit current Env exists;
37
+ - MCP is not part of the architecture.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ git clone https://gitcode.com/rookie_hongchuan/msdev.git
43
+ cd msdev
44
+ python3 -m pip install -e .
45
+ msdev --help
46
+ ```
47
+
48
+ The package installs `msdev` and `msdevd`.
49
+
50
+ ## Windows client
51
+
52
+ The typical setup is a **Windows laptop talking to Linux Nodes** via OpenSSH
53
+ (`C:\Windows\System32\OpenSSH\ssh.exe`). Native Windows OpenSSH does not
54
+ implement ControlMaster multiplexing, so msdev:
55
+
56
+ - omits `ControlMaster`/`ControlPath` on Windows (override with
57
+ `MSDEV_SSH_CONTROL_MASTER=1` only if your SSH client actually supports mux);
58
+ - starts a persistent `ssh -L` LocalForward tunnel automatically on the first
59
+ RPC (same role as ControlMaster). Explicit `msdev node connect NODE` is
60
+ optional; disable persist with `MSDEV_SSH_LOCAL_FORWARD_PERSIST=0`;
61
+ - reuses that tunnel for captured RPC and default streaming `msdev exec`;
62
+ `env put`/`get` stay on scp/ssh streams (file bytes do not go through JSON RPC);
63
+ - hides SSH console windows (`CREATE_NO_WINDOW`) and kills process trees with
64
+ `taskkill /T` on timeout or cancel;
65
+ - serves a TCP loopback endpoint for local `msdevd` when this Python build has
66
+ no `AF_UNIX` sockets.
67
+
68
+ Install with `python -m pip install -e .`. `install-user.py` writes
69
+ `msdev.cmd` / `msdevd.cmd` under `%USERPROFILE%\.local\bin`.
70
+
71
+ Remote paths inside a Linux Env remain POSIX (`/srv/...`). Local `env put`/`get`
72
+ on Windows accept Windows absolute paths (`C:\...`).
73
+
74
+ Local `exec` on Windows wraps Conda with `conda run` and venvs with
75
+ `Scripts\activate.bat` (remote Linux Nodes still use POSIX `sh`/`bash` wrappers).
76
+ If `ssh` is not on PATH, msdev looks in `%SystemRoot%\System32\OpenSSH\`.
77
+
78
+ ## Nodes and execution environments
79
+
80
+ Register a host from `~/.ssh/config`:
81
+
82
+ ```bash
83
+ msdev node add dev-122 --ssh-host dev-122
84
+ msdev node list
85
+ msdev node status dev-122
86
+ ```
87
+
88
+ Adding a Node atomically creates a same-named host Env. Bootstrap or refresh
89
+ the remote user daemon:
90
+
91
+ ```bash
92
+ msdev node bootstrap dev-122
93
+ ```
94
+
95
+ Persistent OpenSSH masters are optional:
96
+
97
+ ```bash
98
+ msdev node connect dev-122
99
+ msdev node disconnect dev-122
100
+ ```
101
+
102
+ Nodes and Envs have separate private Markdown guides:
103
+
104
+ ```bash
105
+ msdev node guide dev-122
106
+ msdev node guide dev-122 --write ./dev-122-guide.md
107
+ msdev env guide dev-122
108
+ msdev env guide dev-122 --write ./host-env-guide.md
109
+ ```
110
+
111
+ Guides are stored under `~/.config/msdev/guides/nodes/` and
112
+ `~/.config/msdev/guides/environments/`, with private permissions and a 256 KiB
113
+ limit. Agents read the applicable guides once before first use in a session.
114
+
115
+ Open a human-operated interactive shell in an Env:
116
+
117
+ ```bash
118
+ msdev env shell dev-122
119
+ msdev env shell dev-122 --cwd /srv/project
120
+ ```
121
+
122
+ The command allocates an OpenSSH PTY and enters the Env's Docker runtime and
123
+ conda/venv/uv layers. Exiting returns
124
+ to the local shell. Only the shell session start and final status are visible
125
+ to msdev; commands typed inside it are not individually logged. Agent
126
+ automation should continue using `msdev exec`.
127
+
128
+ Create another Env on the same Node for Docker and Python layers:
129
+
130
+ ```bash
131
+ msdev env add dev-122-vllm \
132
+ --node dev-122 \
133
+ --docker-container vllm-ascend \
134
+ --layer conda:base \
135
+ --layer venv:/srv/project/.venv
136
+ ```
137
+
138
+ ## File put, get, read, and write
139
+
140
+ Bulk transfer copies a local file into an Env filesystem, or fetches one back:
141
+
142
+ ```bash
143
+ msdev env put dev-122 ./config.yaml /srv/project/config.yaml
144
+ msdev env get dev-122 /srv/project/config.yaml --output ./config.yaml
145
+ msdev env get dev-122 /srv/project/config.yaml > ./config.yaml
146
+ ```
147
+
148
+ Editing uses content-oriented read/write. Paths inside the Env must be
149
+ absolute. Host Envs use direct filesystem copy locally and ``scp``/``ssh``
150
+ streams remotely. Docker Envs stage through the node with ``docker cp``.
151
+ File bytes never pass through JSON RPC.
152
+
153
+ ```bash
154
+ msdev env read dev-122 /srv/project/config.yaml
155
+ msdev env read dev-122 /srv/project/config.yaml --json
156
+ msdev env write dev-122 /srv/project/note.md --file /tmp/note.md
157
+ msdev env write dev-122 /srv/project/note.md < /tmp/note.md
158
+ msdev env write dev-122 /srv/project/note.md --file /tmp/note.md \
159
+ --expected-sha256 <digest>
160
+ ```
161
+
162
+ Read before replacing an existing file. `--expected-sha256` is compare-and-swap
163
+ replacement that refuses to overwrite a changed remote file.
164
+
165
+ ## NPU inventory
166
+
167
+ ```bash
168
+ msdev npu list --node dev-122 --json
169
+ msdev npu list --all --json
170
+ ```
171
+
172
+ ## Command execution
173
+
174
+ Commands execute synchronously and stream stdout and stderr to the terminal as
175
+ they are produced. Cursor or Claude Code should use their native background
176
+ terminal support for long jobs. Long jobs may also write a persistent progress
177
+ log when later inspection is required.
178
+
179
+ ```bash
180
+ msdev exec \
181
+ --env dev-122 \
182
+ --cwd /srv/project \
183
+ --timeout-seconds 1800 \
184
+ --env-var MODE=test \
185
+ -- python3 run.py
186
+ ```
187
+
188
+ `--timeout-seconds` defaults to `-1` (no deadline). Any positive finite duration
189
+ is also accepted. A positive timeout kills the complete command
190
+ process group and returns exit code 124. Cancelling the local CLI closes the RPC
191
+ connection, causing `msdevd` to kill and reap the remote process group. Finite
192
+ SSH/Unix RPC deadlines include a short completion grace for output drain and
193
+ serialization.
194
+
195
+ `--result-json` selects captured, non-streaming execution and prints one
196
+ structured JSON result containing stdout and stderr.
197
+
198
+ ## Model inventory
199
+
200
+ Examples:
201
+
202
+ ```bash
203
+ msdev model discover --node dev-122 --root /data/models
204
+ msdev model list --node dev-122 --json
205
+ msdev model list --all --json
206
+ msdev model inspect model://qwen/Qwen3-32B@main --node dev-122
207
+ msdev model validate model://qwen/Qwen3-32B@main --node dev-122
208
+ msdev model audit --node dev-122
209
+ ```
210
+
211
+ Use `msdev model --help` and the individual subcommand help for register,
212
+ update, replicas, refresh, verify, export, import, and rebind.
213
+
214
+ ## Architecture
215
+
216
+ ```text
217
+ msdev CLI
218
+ -> typed core service
219
+ -> UnixRpcTransport or SshRpcTransport
220
+ -> per-user msdevd
221
+ -> host/container command, env file transfer, NPU, or inventory
222
+ ```
223
+
224
+ Remote RPC responses and command output are bounded. Node/Env registries use
225
+ locked atomic updates.
226
+
227
+ ## Testing
228
+
229
+ ```bash
230
+ python3 -m unittest discover -s tests -v
231
+ ```
232
+
233
+ Feature work must include at least one actual scenario test on the real
234
+ control path (`msdev` CLI → service → transport → `msdevd` → effect). Unit
235
+ tests alone are not sufficient.
msdev-0.10.1/README.md ADDED
@@ -0,0 +1,210 @@
1
+ # msdev
2
+
3
+ `msdev` manages connection Nodes and execution Envs. A Node owns SSH and its
4
+ per-user `msdevd`; an Env references a Node and adds a host/Docker runtime plus
5
+ optional conda/venv/uv layers.
6
+
7
+ The CLI is intentionally stateless:
8
+
9
+ - Node-scoped NPU/model operations name `--node` or use `--all`;
10
+ - execution names `--env`;
11
+ - no harness conversation binding or implicit current Env exists;
12
+ - MCP is not part of the architecture.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ git clone https://gitcode.com/rookie_hongchuan/msdev.git
18
+ cd msdev
19
+ python3 -m pip install -e .
20
+ msdev --help
21
+ ```
22
+
23
+ The package installs `msdev` and `msdevd`.
24
+
25
+ ## Windows client
26
+
27
+ The typical setup is a **Windows laptop talking to Linux Nodes** via OpenSSH
28
+ (`C:\Windows\System32\OpenSSH\ssh.exe`). Native Windows OpenSSH does not
29
+ implement ControlMaster multiplexing, so msdev:
30
+
31
+ - omits `ControlMaster`/`ControlPath` on Windows (override with
32
+ `MSDEV_SSH_CONTROL_MASTER=1` only if your SSH client actually supports mux);
33
+ - starts a persistent `ssh -L` LocalForward tunnel automatically on the first
34
+ RPC (same role as ControlMaster). Explicit `msdev node connect NODE` is
35
+ optional; disable persist with `MSDEV_SSH_LOCAL_FORWARD_PERSIST=0`;
36
+ - reuses that tunnel for captured RPC and default streaming `msdev exec`;
37
+ `env put`/`get` stay on scp/ssh streams (file bytes do not go through JSON RPC);
38
+ - hides SSH console windows (`CREATE_NO_WINDOW`) and kills process trees with
39
+ `taskkill /T` on timeout or cancel;
40
+ - serves a TCP loopback endpoint for local `msdevd` when this Python build has
41
+ no `AF_UNIX` sockets.
42
+
43
+ Install with `python -m pip install -e .`. `install-user.py` writes
44
+ `msdev.cmd` / `msdevd.cmd` under `%USERPROFILE%\.local\bin`.
45
+
46
+ Remote paths inside a Linux Env remain POSIX (`/srv/...`). Local `env put`/`get`
47
+ on Windows accept Windows absolute paths (`C:\...`).
48
+
49
+ Local `exec` on Windows wraps Conda with `conda run` and venvs with
50
+ `Scripts\activate.bat` (remote Linux Nodes still use POSIX `sh`/`bash` wrappers).
51
+ If `ssh` is not on PATH, msdev looks in `%SystemRoot%\System32\OpenSSH\`.
52
+
53
+ ## Nodes and execution environments
54
+
55
+ Register a host from `~/.ssh/config`:
56
+
57
+ ```bash
58
+ msdev node add dev-122 --ssh-host dev-122
59
+ msdev node list
60
+ msdev node status dev-122
61
+ ```
62
+
63
+ Adding a Node atomically creates a same-named host Env. Bootstrap or refresh
64
+ the remote user daemon:
65
+
66
+ ```bash
67
+ msdev node bootstrap dev-122
68
+ ```
69
+
70
+ Persistent OpenSSH masters are optional:
71
+
72
+ ```bash
73
+ msdev node connect dev-122
74
+ msdev node disconnect dev-122
75
+ ```
76
+
77
+ Nodes and Envs have separate private Markdown guides:
78
+
79
+ ```bash
80
+ msdev node guide dev-122
81
+ msdev node guide dev-122 --write ./dev-122-guide.md
82
+ msdev env guide dev-122
83
+ msdev env guide dev-122 --write ./host-env-guide.md
84
+ ```
85
+
86
+ Guides are stored under `~/.config/msdev/guides/nodes/` and
87
+ `~/.config/msdev/guides/environments/`, with private permissions and a 256 KiB
88
+ limit. Agents read the applicable guides once before first use in a session.
89
+
90
+ Open a human-operated interactive shell in an Env:
91
+
92
+ ```bash
93
+ msdev env shell dev-122
94
+ msdev env shell dev-122 --cwd /srv/project
95
+ ```
96
+
97
+ The command allocates an OpenSSH PTY and enters the Env's Docker runtime and
98
+ conda/venv/uv layers. Exiting returns
99
+ to the local shell. Only the shell session start and final status are visible
100
+ to msdev; commands typed inside it are not individually logged. Agent
101
+ automation should continue using `msdev exec`.
102
+
103
+ Create another Env on the same Node for Docker and Python layers:
104
+
105
+ ```bash
106
+ msdev env add dev-122-vllm \
107
+ --node dev-122 \
108
+ --docker-container vllm-ascend \
109
+ --layer conda:base \
110
+ --layer venv:/srv/project/.venv
111
+ ```
112
+
113
+ ## File put, get, read, and write
114
+
115
+ Bulk transfer copies a local file into an Env filesystem, or fetches one back:
116
+
117
+ ```bash
118
+ msdev env put dev-122 ./config.yaml /srv/project/config.yaml
119
+ msdev env get dev-122 /srv/project/config.yaml --output ./config.yaml
120
+ msdev env get dev-122 /srv/project/config.yaml > ./config.yaml
121
+ ```
122
+
123
+ Editing uses content-oriented read/write. Paths inside the Env must be
124
+ absolute. Host Envs use direct filesystem copy locally and ``scp``/``ssh``
125
+ streams remotely. Docker Envs stage through the node with ``docker cp``.
126
+ File bytes never pass through JSON RPC.
127
+
128
+ ```bash
129
+ msdev env read dev-122 /srv/project/config.yaml
130
+ msdev env read dev-122 /srv/project/config.yaml --json
131
+ msdev env write dev-122 /srv/project/note.md --file /tmp/note.md
132
+ msdev env write dev-122 /srv/project/note.md < /tmp/note.md
133
+ msdev env write dev-122 /srv/project/note.md --file /tmp/note.md \
134
+ --expected-sha256 <digest>
135
+ ```
136
+
137
+ Read before replacing an existing file. `--expected-sha256` is compare-and-swap
138
+ replacement that refuses to overwrite a changed remote file.
139
+
140
+ ## NPU inventory
141
+
142
+ ```bash
143
+ msdev npu list --node dev-122 --json
144
+ msdev npu list --all --json
145
+ ```
146
+
147
+ ## Command execution
148
+
149
+ Commands execute synchronously and stream stdout and stderr to the terminal as
150
+ they are produced. Cursor or Claude Code should use their native background
151
+ terminal support for long jobs. Long jobs may also write a persistent progress
152
+ log when later inspection is required.
153
+
154
+ ```bash
155
+ msdev exec \
156
+ --env dev-122 \
157
+ --cwd /srv/project \
158
+ --timeout-seconds 1800 \
159
+ --env-var MODE=test \
160
+ -- python3 run.py
161
+ ```
162
+
163
+ `--timeout-seconds` defaults to `-1` (no deadline). Any positive finite duration
164
+ is also accepted. A positive timeout kills the complete command
165
+ process group and returns exit code 124. Cancelling the local CLI closes the RPC
166
+ connection, causing `msdevd` to kill and reap the remote process group. Finite
167
+ SSH/Unix RPC deadlines include a short completion grace for output drain and
168
+ serialization.
169
+
170
+ `--result-json` selects captured, non-streaming execution and prints one
171
+ structured JSON result containing stdout and stderr.
172
+
173
+ ## Model inventory
174
+
175
+ Examples:
176
+
177
+ ```bash
178
+ msdev model discover --node dev-122 --root /data/models
179
+ msdev model list --node dev-122 --json
180
+ msdev model list --all --json
181
+ msdev model inspect model://qwen/Qwen3-32B@main --node dev-122
182
+ msdev model validate model://qwen/Qwen3-32B@main --node dev-122
183
+ msdev model audit --node dev-122
184
+ ```
185
+
186
+ Use `msdev model --help` and the individual subcommand help for register,
187
+ update, replicas, refresh, verify, export, import, and rebind.
188
+
189
+ ## Architecture
190
+
191
+ ```text
192
+ msdev CLI
193
+ -> typed core service
194
+ -> UnixRpcTransport or SshRpcTransport
195
+ -> per-user msdevd
196
+ -> host/container command, env file transfer, NPU, or inventory
197
+ ```
198
+
199
+ Remote RPC responses and command output are bounded. Node/Env registries use
200
+ locked atomic updates.
201
+
202
+ ## Testing
203
+
204
+ ```bash
205
+ python3 -m unittest discover -s tests -v
206
+ ```
207
+
208
+ Feature work must include at least one actual scenario test on the real
209
+ control path (`msdev` CLI → service → transport → `msdevd` → effect). Unit
210
+ tests alone are not sufficient.
@@ -0,0 +1,50 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "msdev"
7
+ version = "0.10.1"
8
+ description = "Portable nodes and execution environments for msModelSlim development"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MulanPSL-2.0"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ { name = "msModelSlim Agent Contributors" },
15
+ ]
16
+ keywords = ["ssh", "docker", "conda", "venv", "remote", "npu", "mlops", "devops"]
17
+ classifiers = [
18
+ "Environment :: Console",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Operating System :: MacOS",
26
+ "Operating System :: Microsoft :: Windows",
27
+ "Operating System :: POSIX :: Linux",
28
+ "Topic :: Software Development :: Build Tools",
29
+ ]
30
+ dependencies = []
31
+
32
+ [project.urls]
33
+ Homepage = "https://gitcode.com/rookie_hongchuan/msdev"
34
+ Repository = "https://gitcode.com/rookie_hongchuan/msdev"
35
+
36
+ [project.scripts]
37
+ msdev = "msdev.cli:main"
38
+ msdevd = "msdev.daemon:main"
39
+
40
+ [tool.setuptools]
41
+ package-dir = { "" = "src" }
42
+
43
+ [tool.setuptools.packages.find]
44
+ where = ["src"]
45
+
46
+ [tool.setuptools.package-data]
47
+ msdev = ["helpers/msdev-file-helper-*"]
48
+
49
+ [tool.pytest.ini_options]
50
+ testpaths = ["tests"]
@@ -1,3 +1,3 @@
1
1
  """Portable node and execution-environment tooling for msModelSlim."""
2
2
 
3
- __version__ = "0.9.0"
3
+ __version__ = "0.10.1"