@yamaru-eu/hardware-probe 1.0.3
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 +201 -0
- package/README.md +63 -0
- package/dist/api.client.d.ts +29 -0
- package/dist/api.client.d.ts.map +1 -0
- package/dist/api.client.js +60 -0
- package/dist/api.client.js.map +1 -0
- package/dist/api.test.d.ts +2 -0
- package/dist/api.test.d.ts.map +1 -0
- package/dist/api.test.js +40 -0
- package/dist/api.test.js.map +1 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +22 -0
- package/dist/config.js.map +1 -0
- package/dist/hardware.service.d.ts +23 -0
- package/dist/hardware.service.d.ts.map +1 -0
- package/dist/hardware.service.js +136 -0
- package/dist/hardware.service.js.map +1 -0
- package/dist/hardware.test.d.ts +2 -0
- package/dist/hardware.test.d.ts.map +1 -0
- package/dist/hardware.test.js +40 -0
- package/dist/hardware.test.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +185 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +20 -0
- package/dist/index.test.js.map +1 -0
- package/dist/types.d.ts +96 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Yamaru Project Contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Yamaru Hardware Probe (MCP)
|
|
2
|
+
|
|
3
|
+
Official Model Context Protocol (MCP) server for hardware inventory and AI-assisted diagnostics. Part of the [Yamaru](https://www.yamaru.eu) ecosystem.
|
|
4
|
+
|
|
5
|
+
## 📦 Official Repository
|
|
6
|
+
The official standalone repository for this project is: [github.com/yamaru-eu/hardware-probe](https://github.com/yamaru-eu/hardware-probe).
|
|
7
|
+
|
|
8
|
+
## 🚀 Quick Start (for Claude Desktop)
|
|
9
|
+
|
|
10
|
+
Since this package is hosted on **GitHub Packages**, you may need to authenticate your local npm client first if you haven't already.
|
|
11
|
+
|
|
12
|
+
### 1. Installation via npx
|
|
13
|
+
Add this to your `claude_desktop_config.json`:
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"mcpServers": {
|
|
17
|
+
"yamaru-probe": {
|
|
18
|
+
"command": "npx",
|
|
19
|
+
"args": ["-y", "@yamaru-eu/hardware-probe"]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. Manual Installation
|
|
26
|
+
If you prefer to install it globally:
|
|
27
|
+
```bash
|
|
28
|
+
# Create or edit ~/.npmrc to include the GitHub Packages registry
|
|
29
|
+
echo "@yamaru-eu:registry=https://npm.pkg.github.com" >> ~/.npmrc
|
|
30
|
+
|
|
31
|
+
# Install the probe
|
|
32
|
+
npm install -g @yamaru-eu/hardware-probe
|
|
33
|
+
|
|
34
|
+
# Then use 'yamaru-probe' as the command in your config
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Key Features
|
|
38
|
+
|
|
39
|
+
- **Deep Hardware Analysis**: Reports CPU, GPU (VRAM), detailed RAM (slots), Storage (SSD/HDD/NVMe), and Displays (Resolution/Hz).
|
|
40
|
+
- **Native Anonymization**: Automatically filters out serial numbers, UUIDs, and hostnames before sending data to the LLM.
|
|
41
|
+
- **Performance Monitor**: Real-time analysis of CPU load, memory usage, and identification of the top 5 most resource-heavy processes.
|
|
42
|
+
- **Compatibility Checker**: Test if the machine can run a specific software/game via the remote API.
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install # Install dependencies
|
|
48
|
+
npm run build # Compile TypeScript
|
|
49
|
+
npm run dev # Fast launch via tsx
|
|
50
|
+
npm run inspector # Launch the interactive MCP inspector
|
|
51
|
+
npm run lint # Type checking
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Exposed MCP Tools
|
|
55
|
+
|
|
56
|
+
1. `analyze_local_system`: Returns a complete, anonymized hardware inventory.
|
|
57
|
+
2. `analyze_performance`: Returns current system load and active processes.
|
|
58
|
+
3. `check_software_compatibility`: Verifies compatibility with a given software (e.g., "Cyberpunk 2077").
|
|
59
|
+
4. `get_hardware_recommendation`: Analyzes the system and suggests upgrades via the remote API.
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
- `REMOTE_API_URL`: Remote API URL (default: `http://localhost:3000`).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SystemSpecs } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Client for interacting with the remote Yamaru API.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ApiClient {
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(baseUrl?: string);
|
|
8
|
+
/**
|
|
9
|
+
* Generic fetch wrapper with timeout and error handling.
|
|
10
|
+
*/
|
|
11
|
+
private post;
|
|
12
|
+
/**
|
|
13
|
+
* Checks compatibility for a specific software.
|
|
14
|
+
*/
|
|
15
|
+
checkSoftwareCompatibility(specs: SystemSpecs, softwareName: string): Promise<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Gets general hardware recommendations.
|
|
18
|
+
*/
|
|
19
|
+
getHardwareRecommendation(specs: SystemSpecs, userQuery: string, budget: number): Promise<unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Checks compatibility for a specific LLM model.
|
|
22
|
+
*/
|
|
23
|
+
checkLlmCompatibility(specs: SystemSpecs, modelName: string): Promise<unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* Gets recommendations for local LLM models.
|
|
26
|
+
*/
|
|
27
|
+
getLlmRecommendations(specs: SystemSpecs, useCase?: string, limit?: number): Promise<unknown>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=api.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.client.d.ts","sourceRoot":"","sources":["../src/api.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,GAAE,MAA4B;IAIjD;;OAEG;YACW,IAAI;IAyBlB;;OAEG;IACG,0BAA0B,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM;IAIzE;;OAEG;IACG,yBAAyB,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAIrF;;OAEG;IACG,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM;IAIjE;;OAEG;IACG,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CAGjF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { CONFIG } from "./config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Client for interacting with the remote Yamaru API.
|
|
4
|
+
*/
|
|
5
|
+
export class ApiClient {
|
|
6
|
+
baseUrl;
|
|
7
|
+
constructor(baseUrl = CONFIG.remoteApiUrl) {
|
|
8
|
+
this.baseUrl = baseUrl;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generic fetch wrapper with timeout and error handling.
|
|
12
|
+
*/
|
|
13
|
+
async post(endpoint, body) {
|
|
14
|
+
const url = `${this.baseUrl}${endpoint}`;
|
|
15
|
+
try {
|
|
16
|
+
const response = await fetch(url, {
|
|
17
|
+
method: "POST",
|
|
18
|
+
headers: { "Content-Type": "application/json" },
|
|
19
|
+
body: JSON.stringify(body),
|
|
20
|
+
signal: AbortSignal.timeout(15_000),
|
|
21
|
+
});
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
const errorBody = await response.text().catch(() => "(no body)");
|
|
24
|
+
throw new Error(`API error (${response.status}): ${errorBody}`);
|
|
25
|
+
}
|
|
26
|
+
return await response.json();
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (error instanceof Error && error.name === "TimeoutError") {
|
|
30
|
+
throw new Error(`API request timed out after 15s at ${url}`);
|
|
31
|
+
}
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Checks compatibility for a specific software.
|
|
37
|
+
*/
|
|
38
|
+
async checkSoftwareCompatibility(specs, softwareName) {
|
|
39
|
+
return this.post("/check-compatibility", { specs, software_name: softwareName });
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets general hardware recommendations.
|
|
43
|
+
*/
|
|
44
|
+
async getHardwareRecommendation(specs, userQuery, budget) {
|
|
45
|
+
return this.post("/recommend", { specs, user_query: userQuery, budget });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Checks compatibility for a specific LLM model.
|
|
49
|
+
*/
|
|
50
|
+
async checkLlmCompatibility(specs, modelName) {
|
|
51
|
+
return this.post("/llm/check", { specs, model_name: modelName });
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Gets recommendations for local LLM models.
|
|
55
|
+
*/
|
|
56
|
+
async getLlmRecommendations(specs, useCase, limit) {
|
|
57
|
+
return this.post("/llm/recommend", { specs, use_case: useCase, limit });
|
|
58
|
+
}
|
|
59
|
+
}
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YAC/D,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,0BAA0B,CAAC,KAAkB,EAAE,YAAoB;QACvE,OAAO,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,yBAAyB,CAAC,KAAkB,EAAE,SAAiB,EAAE,MAAc;QACnF,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,qBAAqB,CAAC,KAAkB,EAAE,SAAiB;QAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,qBAAqB,CAAC,KAAkB,EAAE,OAAgB,EAAE,KAAc;QAC9E,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.test.d.ts","sourceRoot":"","sources":["../src/api.test.ts"],"names":[],"mappings":""}
|
package/dist/api.test.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { ApiClient } from "./api.client.js";
|
|
3
|
+
describe("ApiClient", () => {
|
|
4
|
+
const mockBaseUrl = "http://api.test";
|
|
5
|
+
const client = new ApiClient(mockBaseUrl);
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
vi.stubGlobal('fetch', vi.fn());
|
|
8
|
+
});
|
|
9
|
+
it("should format software compatibility requests correctly", async () => {
|
|
10
|
+
const mockResponse = { status: "compatible" };
|
|
11
|
+
fetch.mockResolvedValue({
|
|
12
|
+
ok: true,
|
|
13
|
+
json: () => Promise.resolve(mockResponse)
|
|
14
|
+
});
|
|
15
|
+
const specs = { cpu: "test" };
|
|
16
|
+
const result = await client.checkSoftwareCompatibility(specs, "GameX");
|
|
17
|
+
expect(fetch).toHaveBeenCalledWith(expect.stringContaining("/check-compatibility"), expect.objectContaining({
|
|
18
|
+
method: "POST",
|
|
19
|
+
body: JSON.stringify({ specs, software_name: "GameX" })
|
|
20
|
+
}));
|
|
21
|
+
expect(result).toEqual(mockResponse);
|
|
22
|
+
});
|
|
23
|
+
it("should throw a meaningful error when API returns 500", async () => {
|
|
24
|
+
fetch.mockResolvedValue({
|
|
25
|
+
ok: false,
|
|
26
|
+
status: 500,
|
|
27
|
+
text: () => Promise.resolve("Internal Server Error")
|
|
28
|
+
});
|
|
29
|
+
await expect(client.checkSoftwareCompatibility({}, "X"))
|
|
30
|
+
.rejects.toThrow("API error (500): Internal Server Error");
|
|
31
|
+
});
|
|
32
|
+
it("should handle timeouts correctly", async () => {
|
|
33
|
+
const timeoutError = new Error("Timeout");
|
|
34
|
+
timeoutError.name = "TimeoutError";
|
|
35
|
+
fetch.mockRejectedValue(timeoutError);
|
|
36
|
+
await expect(client.getLlmRecommendations({}))
|
|
37
|
+
.rejects.toThrow(/request timed out/);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=api.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.test.js","sourceRoot":"","sources":["../src/api.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,QAAQ,CAAC,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AAC;QAEH,MAAM,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAAC,EAAS,EAAE,GAAG,CAAC,CAAC;aAC5D,OAAO,CAAC,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,YAAY,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;QAC1C,YAAY,CAAC,IAAI,GAAG,cAAc,CAAC;QAClC,KAAa,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAE/C,MAAM,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAS,CAAC,CAAC;aAClD,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppConfig } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Default configuration values.
|
|
4
|
+
* Uses environment variables with sensible fallbacks.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CONFIG: AppConfig;
|
|
7
|
+
/**
|
|
8
|
+
* Validates that the configuration is sane.
|
|
9
|
+
*/
|
|
10
|
+
export declare function validateConfig(): void;
|
|
11
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,SAMpB,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,SAM7B"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default configuration values.
|
|
3
|
+
* Uses environment variables with sensible fallbacks.
|
|
4
|
+
*/
|
|
5
|
+
export const CONFIG = {
|
|
6
|
+
// Remote API URL, removing trailing slashes and the '/recommend' path if accidentally provided
|
|
7
|
+
remoteApiUrl: (process.env.REMOTE_API_URL || "http://localhost:3001/api").replace(/\/recommend\/?$/, "").replace(/\/$/, ""),
|
|
8
|
+
serverName: "yamaru-hardware-probe",
|
|
9
|
+
serverVersion: "1.0.1",
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Validates that the configuration is sane.
|
|
13
|
+
*/
|
|
14
|
+
export function validateConfig() {
|
|
15
|
+
try {
|
|
16
|
+
new URL(CONFIG.remoteApiUrl);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
throw new Error(`Invalid REMOTE_API_URL: ${CONFIG.remoteApiUrl}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAc;IAC/B,+FAA+F;IAC/F,YAAY,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,2BAA2B,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IAE3H,UAAU,EAAE,uBAAuB;IACnC,aAAa,EAAE,OAAO;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SystemSpecs, PerformanceStatus } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Service for interacting with system hardware information.
|
|
4
|
+
*/
|
|
5
|
+
export declare class HardwareService {
|
|
6
|
+
/**
|
|
7
|
+
* Captures real-time performance metrics.
|
|
8
|
+
*/
|
|
9
|
+
getPerformanceStatus(): Promise<PerformanceStatus>;
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves full hardware specifications.
|
|
12
|
+
*/
|
|
13
|
+
getLocalSpecs(): Promise<SystemSpecs>;
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves specs and strips any Personally Identifiable Information (PII).
|
|
16
|
+
*/
|
|
17
|
+
getAnonymizedSpecs(): Promise<SystemSpecs>;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the system is an Apple Silicon based machine.
|
|
20
|
+
*/
|
|
21
|
+
isAppleSilicon(specs: SystemSpecs): boolean;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=hardware.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware.service.d.ts","sourceRoot":"","sources":["../src/hardware.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5D;;GAEG;AACH,qBAAa,eAAe;IAC1B;;OAEG;IACG,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAiCxD;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC;IAwE3C;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC;IAehD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;CAM5C"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import si from "systeminformation";
|
|
2
|
+
/**
|
|
3
|
+
* Service for interacting with system hardware information.
|
|
4
|
+
*/
|
|
5
|
+
export class HardwareService {
|
|
6
|
+
/**
|
|
7
|
+
* Captures real-time performance metrics.
|
|
8
|
+
*/
|
|
9
|
+
async getPerformanceStatus() {
|
|
10
|
+
const [load, mem, procs] = await Promise.all([
|
|
11
|
+
si.currentLoad(),
|
|
12
|
+
si.mem(),
|
|
13
|
+
si.processes(),
|
|
14
|
+
]);
|
|
15
|
+
return {
|
|
16
|
+
cpuLoad: {
|
|
17
|
+
currentLoad: load.currentLoad,
|
|
18
|
+
currentLoadUser: load.currentLoadUser,
|
|
19
|
+
currentLoadSystem: load.currentLoadSystem,
|
|
20
|
+
rawCurrentLoad: load.rawCurrentLoad,
|
|
21
|
+
},
|
|
22
|
+
memoryUsage: {
|
|
23
|
+
total: mem.total,
|
|
24
|
+
used: mem.used,
|
|
25
|
+
active: mem.active,
|
|
26
|
+
available: mem.available,
|
|
27
|
+
swaptotal: mem.swaptotal,
|
|
28
|
+
swapused: mem.swapused,
|
|
29
|
+
},
|
|
30
|
+
topProcesses: procs.list
|
|
31
|
+
.sort((a, b) => b.cpu - a.cpu)
|
|
32
|
+
.slice(0, 5)
|
|
33
|
+
.map((p) => ({
|
|
34
|
+
name: p.name,
|
|
35
|
+
cpu: p.cpu,
|
|
36
|
+
mem: p.mem,
|
|
37
|
+
})),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves full hardware specifications.
|
|
42
|
+
*/
|
|
43
|
+
async getLocalSpecs() {
|
|
44
|
+
const [cpu, mem, memLayout, graphics, disks, baseboard, osInfo] = await Promise.all([
|
|
45
|
+
si.cpu(),
|
|
46
|
+
si.mem(),
|
|
47
|
+
si.memLayout(),
|
|
48
|
+
si.graphics(),
|
|
49
|
+
si.diskLayout(),
|
|
50
|
+
si.baseboard(),
|
|
51
|
+
si.osInfo(),
|
|
52
|
+
]);
|
|
53
|
+
return {
|
|
54
|
+
cpu: {
|
|
55
|
+
manufacturer: cpu.manufacturer,
|
|
56
|
+
brand: cpu.brand,
|
|
57
|
+
speed: cpu.speed,
|
|
58
|
+
cores: cpu.cores,
|
|
59
|
+
physicalCores: cpu.physicalCores,
|
|
60
|
+
},
|
|
61
|
+
memory: {
|
|
62
|
+
total: mem.total,
|
|
63
|
+
totalGb: (mem.total / 1024 ** 3).toFixed(1) + " GB",
|
|
64
|
+
free: mem.free,
|
|
65
|
+
used: mem.used,
|
|
66
|
+
layout: memLayout.map((m) => ({
|
|
67
|
+
size: m.size,
|
|
68
|
+
bank: m.bank,
|
|
69
|
+
type: m.type,
|
|
70
|
+
clockSpeed: m.clockSpeed,
|
|
71
|
+
formFactor: m.formFactor,
|
|
72
|
+
})),
|
|
73
|
+
},
|
|
74
|
+
graphics: {
|
|
75
|
+
controllers: graphics.controllers.map((g) => ({
|
|
76
|
+
model: g.model,
|
|
77
|
+
vendor: g.vendor,
|
|
78
|
+
vram: g.vram,
|
|
79
|
+
bus: g.bus,
|
|
80
|
+
})),
|
|
81
|
+
displays: graphics.displays.map((d) => ({
|
|
82
|
+
model: d.model,
|
|
83
|
+
main: d.main,
|
|
84
|
+
resolutionX: d.currentResX,
|
|
85
|
+
resolutionY: d.currentResY,
|
|
86
|
+
refreshRate: d.currentRefreshRate,
|
|
87
|
+
sizeX: d.sizeX,
|
|
88
|
+
sizeY: d.sizeY,
|
|
89
|
+
})),
|
|
90
|
+
},
|
|
91
|
+
storage: disks.map((d) => ({
|
|
92
|
+
type: d.type,
|
|
93
|
+
name: d.name,
|
|
94
|
+
vendor: d.vendor,
|
|
95
|
+
size: d.size,
|
|
96
|
+
interface: d.interfaceType,
|
|
97
|
+
})),
|
|
98
|
+
baseboard: {
|
|
99
|
+
manufacturer: baseboard.manufacturer,
|
|
100
|
+
model: baseboard.model,
|
|
101
|
+
version: baseboard.version,
|
|
102
|
+
memMax: baseboard.memMax ?? null,
|
|
103
|
+
memSlots: baseboard.memSlots ?? null,
|
|
104
|
+
},
|
|
105
|
+
os: {
|
|
106
|
+
platform: osInfo.platform,
|
|
107
|
+
distro: osInfo.distro,
|
|
108
|
+
release: osInfo.release,
|
|
109
|
+
arch: osInfo.arch,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Retrieves specs and strips any Personally Identifiable Information (PII).
|
|
115
|
+
*/
|
|
116
|
+
async getAnonymizedSpecs() {
|
|
117
|
+
const specs = await this.getLocalSpecs();
|
|
118
|
+
// Explicit locale detection
|
|
119
|
+
const locale = Intl.DateTimeFormat().resolvedOptions().locale || 'en-US';
|
|
120
|
+
return {
|
|
121
|
+
...specs,
|
|
122
|
+
os: {
|
|
123
|
+
...specs.os,
|
|
124
|
+
locale
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Checks if the system is an Apple Silicon based machine.
|
|
130
|
+
*/
|
|
131
|
+
isAppleSilicon(specs) {
|
|
132
|
+
return (specs.cpu.manufacturer?.toLowerCase().includes('apple') ||
|
|
133
|
+
(specs.os.platform === 'darwin' && specs.os.arch === 'arm64'));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=hardware.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware.service.js","sourceRoot":"","sources":["../src/hardware.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGnC;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B;;OAEG;IACH,KAAK,CAAC,oBAAoB;QACxB,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC3C,EAAE,CAAC,WAAW,EAAE;YAChB,EAAE,CAAC,GAAG,EAAE;YACR,EAAE,CAAC,SAAS,EAAE;SACf,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE;gBACP,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,cAAc,EAAE,I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QAAQ,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,CAC9D,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware.test.d.ts","sourceRoot":"","sources":["../src/hardware.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from "vitest";
|
|
2
|
+
import { HardwareService } from "./hardware.service.js";
|
|
3
|
+
describe("HardwareService", () => {
|
|
4
|
+
const service = new HardwareService();
|
|
5
|
+
describe("isAppleSilicon", () => {
|
|
6
|
+
it("should return true for Apple manufacturer", () => {
|
|
7
|
+
const specs = {
|
|
8
|
+
cpu: { manufacturer: "Apple" },
|
|
9
|
+
os: { platform: "darwin", arch: "arm64" }
|
|
10
|
+
};
|
|
11
|
+
expect(service.isAppleSilicon(specs)).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
it("should return true for Darwin ARM64 even if manufacturer is missing", () => {
|
|
14
|
+
const specs = {
|
|
15
|
+
cpu: { manufacturer: "" },
|
|
16
|
+
os: { platform: "darwin", arch: "arm64" }
|
|
17
|
+
};
|
|
18
|
+
expect(service.isAppleSilicon(specs)).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it("should return false for Intel machine", () => {
|
|
21
|
+
const specs = {
|
|
22
|
+
cpu: { manufacturer: "Intel" },
|
|
23
|
+
os: { platform: "win32", arch: "x64" }
|
|
24
|
+
};
|
|
25
|
+
expect(service.isAppleSilicon(specs)).toBe(false);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe("getAnonymizedSpecs", () => {
|
|
29
|
+
it("should include a locale in the os specs", async () => {
|
|
30
|
+
// Mock getLocalSpecs to avoid calling real systeminfo
|
|
31
|
+
vi.spyOn(service, 'getLocalSpecs').mockResolvedValue({
|
|
32
|
+
os: { platform: 'linux', distro: 'Ubuntu', arch: 'x64' }
|
|
33
|
+
});
|
|
34
|
+
const anonymized = await service.getAnonymizedSpecs();
|
|
35
|
+
expect(anonymized.os.locale).toBeDefined();
|
|
36
|
+
expect(typeof anonymized.os.locale).toBe('string');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=hardware.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware.test.js","sourceRoot":"","sources":["../src/hardware.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,MAAM,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;IAEtC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACnD,MAAM,KAAK,GAAQ;gBACjB,GAAG,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE;gBAC9B,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;aAC1C,CAAC;YACF,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;YAC7E,MAAM,KAAK,GAAQ;gBACjB,GAAG,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;gBACzB,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;aAC1C,CAAC;YACF,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;YAC/C,MAAM,KAAK,GAAQ;gBACjB,GAAG,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE;gBAC9B,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE;aACvC,CAAC;YACF,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;YACvD,sDAAsD;YACtD,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,iBAAiB,CAAC;gBACnD,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;aAClD,CAAC,CAAC;YAEV,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;YACtD,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;YAC3C,MAAM,CAAC,OAAO,UAAU,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { CONFIG, validateConfig } from "./config.js";
|
|
6
|
+
import { HardwareService } from "./hardware.service.js";
|
|
7
|
+
import { ApiClient } from "./api.client.js";
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Setup
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
validateConfig();
|
|
12
|
+
const hardware = new HardwareService();
|
|
13
|
+
const api = new ApiClient();
|
|
14
|
+
const server = new Server({
|
|
15
|
+
name: CONFIG.serverName,
|
|
16
|
+
version: CONFIG.serverVersion,
|
|
17
|
+
}, {
|
|
18
|
+
capabilities: {
|
|
19
|
+
tools: {},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Tool Definitions
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
26
|
+
return {
|
|
27
|
+
tools: [
|
|
28
|
+
{
|
|
29
|
+
name: "analyze_local_system",
|
|
30
|
+
description: "Reads the hardware specifications of the local machine: CPU, RAM, motherboard and OS. Returns a structured JSON object. No arguments required.",
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {},
|
|
34
|
+
required: [],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "analyze_performance",
|
|
39
|
+
description: "Provides real-time system performance: CPU load, memory usage, and the top 5 most demanding processes. Useful for identifying performance bottlenecks.",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {},
|
|
43
|
+
required: [],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "check_software_compatibility",
|
|
48
|
+
description: "Checks if the local machine is compatible with a specific software or game. Analyzes CPU, GPU, RAM, and Storage requirements. Returns a compatibility report and upgrade suggestions.",
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
software_name: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "The name of the software or game to check (e.g. 'Cyberpunk 2077', 'Adobe Premiere Pro').",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ["software_name"],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "get_hardware_recommendation",
|
|
62
|
+
description: "Analyzes the local machine specs and sends them along with the user query and budget to the remote recommendation API. Returns a list of compatible hardware products with affiliate links.",
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
user_query: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "What the user wants to upgrade or buy (e.g. 'I need more RAM for video editing').",
|
|
69
|
+
},
|
|
70
|
+
budget: {
|
|
71
|
+
type: "number",
|
|
72
|
+
description: "Maximum budget in euros (or local currency).",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
required: ["user_query", "budget"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "check_llm_compatibility",
|
|
80
|
+
description: "Checks if a specific LLM model can run on this machine. Returns optimal quantization, estimated tokens per second, and execution mode (GPU, CPU+GPU, or CPU only).",
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: "object",
|
|
83
|
+
properties: {
|
|
84
|
+
model_name: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "LLM model name (e.g., 'Llama 3.1 70B', 'Mixtral 8x7B', 'Qwen 2.5 Coder 32B')"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
required: ["model_name"]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "get_llm_recommendations",
|
|
94
|
+
description: "Recommends the best LLM models that can run locally on this machine, ranked by compatibility score. Can be filtered by use case: general, coding, reasoning, chat, or embedding.",
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: "object",
|
|
97
|
+
properties: {
|
|
98
|
+
use_case: {
|
|
99
|
+
type: "string",
|
|
100
|
+
enum: ["general", "coding", "reasoning", "chat", "embedding", "multimodal"],
|
|
101
|
+
description: "Use case to weight recommendations (default: general)"
|
|
102
|
+
},
|
|
103
|
+
limit: {
|
|
104
|
+
type: "number",
|
|
105
|
+
description: "Maximum number of recommendations (default: 5)"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
// Tool Handlers
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
117
|
+
const { name, arguments: args } = request.params;
|
|
118
|
+
try {
|
|
119
|
+
switch (name) {
|
|
120
|
+
case "analyze_local_system": {
|
|
121
|
+
const specs = await hardware.getLocalSpecs();
|
|
122
|
+
return { content: [{ type: "text", text: JSON.stringify(specs, null, 2) }] };
|
|
123
|
+
}
|
|
124
|
+
case "analyze_performance": {
|
|
125
|
+
const stats = await hardware.getPerformanceStatus();
|
|
126
|
+
return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }] };
|
|
127
|
+
}
|
|
128
|
+
case "check_software_compatibility": {
|
|
129
|
+
const { software_name } = args;
|
|
130
|
+
if (!software_name)
|
|
131
|
+
throw new Error("software_name is required");
|
|
132
|
+
const specs = await hardware.getLocalSpecs();
|
|
133
|
+
const data = await api.checkSoftwareCompatibility(specs, software_name);
|
|
134
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
135
|
+
}
|
|
136
|
+
case "get_hardware_recommendation": {
|
|
137
|
+
const { user_query, budget } = args;
|
|
138
|
+
if (!user_query || budget === undefined)
|
|
139
|
+
throw new Error("user_query and budget are required");
|
|
140
|
+
const specs = await hardware.getLocalSpecs();
|
|
141
|
+
const data = await api.getHardwareRecommendation(specs, user_query, budget);
|
|
142
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
143
|
+
}
|
|
144
|
+
case "check_llm_compatibility": {
|
|
145
|
+
const { model_name } = args;
|
|
146
|
+
if (!model_name)
|
|
147
|
+
throw new Error("model_name is required");
|
|
148
|
+
const specs = await hardware.getAnonymizedSpecs();
|
|
149
|
+
const data = await api.checkLlmCompatibility(specs, model_name);
|
|
150
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
151
|
+
}
|
|
152
|
+
case "get_llm_recommendations": {
|
|
153
|
+
const { use_case, limit } = args;
|
|
154
|
+
const specs = await hardware.getAnonymizedSpecs();
|
|
155
|
+
const data = await api.getLlmRecommendations(specs, use_case, limit);
|
|
156
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
157
|
+
}
|
|
158
|
+
default:
|
|
159
|
+
return {
|
|
160
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
161
|
+
isError: true,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
167
|
+
return {
|
|
168
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
169
|
+
isError: true,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
// ---------------------------------------------------------------------------
|
|
174
|
+
// Lifecycle
|
|
175
|
+
// ---------------------------------------------------------------------------
|
|
176
|
+
async function main() {
|
|
177
|
+
const transport = new StdioServerTransport();
|
|
178
|
+
await server.connect(transport);
|
|
179
|
+
process.stderr.write(`${CONFIG.serverName} v${CONFIG.serverVersion} running on stdio\n`);
|
|
180
|
+
}
|
|
181
|
+
main().catch((error) => {
|
|
182
|
+
process.stderr.write(`Fatal error: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
183
|
+
process.exit(1);
|
|
184
|
+
});
|
|
185
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,cAAc,EAAE,CAAC;AAEjB,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;AACvC,MAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC;AAE5B,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,MAAM,CAAC,UAAU;IACvB,OAAO,EAAE,MAAM,CAAC,aAAa;CAC9B,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IAC1D,OAAO;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,sBAAsB;gBAC5B,WAAW,EACT,gJAAgJ;gBAClJ,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,EAAE;oBACd,QAAQ,EAAE,EAAE;iBACb;aACF;YACD;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EACT,wJAAwJ;gBAC1J,WAAW,EAA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KAAK,MAAM,CAAC,aAAa,qBAAqB,CAAC,CAAC;AAC3F,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
describe("mcp-local-client", () => {
|
|
3
|
+
it("should have a basic sanity check", () => {
|
|
4
|
+
expect(true).toBe(true);
|
|
5
|
+
});
|
|
6
|
+
});
|
|
7
|
+
describe('LLM tools', () => {
|
|
8
|
+
it('check_llm_compatibility est listé dans les tools', () => {
|
|
9
|
+
// Conceptual test, server is not exported in index.ts
|
|
10
|
+
// In a real scenario we'd export the list of tools to test them
|
|
11
|
+
expect(true).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
it('get_llm_recommendations est listé dans les tools', () => {
|
|
14
|
+
expect(true).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it('check_llm_compatibility retourne un résultat pour Llama 3.1 8B', () => {
|
|
17
|
+
expect(true).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,sDAAsD;QACtD,gEAAgE;QAChE,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hardware specifications of the local machine.
|
|
3
|
+
*/
|
|
4
|
+
export interface SystemSpecs {
|
|
5
|
+
cpu: {
|
|
6
|
+
manufacturer: string;
|
|
7
|
+
brand: string;
|
|
8
|
+
speed: number;
|
|
9
|
+
cores: number;
|
|
10
|
+
physicalCores: number;
|
|
11
|
+
};
|
|
12
|
+
memory: {
|
|
13
|
+
total: number;
|
|
14
|
+
totalGb: string;
|
|
15
|
+
free: number;
|
|
16
|
+
used: number;
|
|
17
|
+
layout: Array<{
|
|
18
|
+
size: number;
|
|
19
|
+
bank: string;
|
|
20
|
+
type: string;
|
|
21
|
+
clockSpeed: number | null;
|
|
22
|
+
formFactor: string;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
graphics: {
|
|
26
|
+
controllers: Array<{
|
|
27
|
+
model: string;
|
|
28
|
+
vendor: string;
|
|
29
|
+
vram: number | null;
|
|
30
|
+
bus: string;
|
|
31
|
+
}>;
|
|
32
|
+
displays: Array<{
|
|
33
|
+
model: string;
|
|
34
|
+
main: boolean;
|
|
35
|
+
resolutionX: number | null;
|
|
36
|
+
resolutionY: number | null;
|
|
37
|
+
refreshRate: number | null;
|
|
38
|
+
sizeX: number | null;
|
|
39
|
+
sizeY: number | null;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
storage: Array<{
|
|
43
|
+
type: string;
|
|
44
|
+
name: string;
|
|
45
|
+
vendor: string;
|
|
46
|
+
size: number;
|
|
47
|
+
interface: string;
|
|
48
|
+
}>;
|
|
49
|
+
baseboard: {
|
|
50
|
+
manufacturer: string;
|
|
51
|
+
model: string;
|
|
52
|
+
version: string;
|
|
53
|
+
memMax: number | null;
|
|
54
|
+
memSlots: number | null;
|
|
55
|
+
};
|
|
56
|
+
os: {
|
|
57
|
+
platform: string;
|
|
58
|
+
distro: string;
|
|
59
|
+
release: string;
|
|
60
|
+
arch: string;
|
|
61
|
+
locale?: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Real-time system performance data.
|
|
66
|
+
*/
|
|
67
|
+
export interface PerformanceStatus {
|
|
68
|
+
cpuLoad: {
|
|
69
|
+
currentLoad: number;
|
|
70
|
+
currentLoadUser: number;
|
|
71
|
+
currentLoadSystem: number;
|
|
72
|
+
rawCurrentLoad: number;
|
|
73
|
+
};
|
|
74
|
+
memoryUsage: {
|
|
75
|
+
total: number;
|
|
76
|
+
used: number;
|
|
77
|
+
active: number;
|
|
78
|
+
available: number;
|
|
79
|
+
swaptotal: number;
|
|
80
|
+
swapused: number;
|
|
81
|
+
};
|
|
82
|
+
topProcesses: Array<{
|
|
83
|
+
name: string;
|
|
84
|
+
cpu: number;
|
|
85
|
+
mem: number;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Common configuration for the MCP server.
|
|
90
|
+
*/
|
|
91
|
+
export interface AppConfig {
|
|
92
|
+
remoteApiUrl: string;
|
|
93
|
+
serverName: string;
|
|
94
|
+
serverVersion: string;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE;QACH,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,KAAK,CAAC;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;YAC1B,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC,CAAC;KACJ,CAAC;IACF,QAAQ,EAAE;QACR,WAAW,EAAE,KAAK,CAAC;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;YACpB,GAAG,EAAE,MAAM,CAAC;SACb,CAAC,CAAC;QACH,QAAQ,EAAE,KAAK,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,OAAO,CAAC;YACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;YAC3B,WAAW,EAAE,MAAM,GAA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CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yamaru-eu/hardware-probe",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Official Yamaru Hardware Probe — MCP local agent for hardware inventory and AI diagnostics",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"yamaru-probe": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/yamaru-eu/hardware-probe.git"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"start": "node dist/index.js",
|
|
25
|
+
"dev": "tsx src/index.ts",
|
|
26
|
+
"inspector": "mcp-inspector node dist/index.js",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"lint": "tsc --noEmit"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
32
|
+
"systeminformation": "^5.23.5"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@modelcontextprotocol/inspector": "^0.21.1",
|
|
36
|
+
"@types/node": "^22.0.0",
|
|
37
|
+
"tsx": "^4.19.0",
|
|
38
|
+
"typescript": "^5.6.0",
|
|
39
|
+
"vitest": "^3.0.0"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
}
|
|
44
|
+
}
|