codemax-pro 1.3.2 → 1.3.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/index.js +31 -19
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -73,29 +73,42 @@ async function doctor() {
|
|
|
73
73
|
if (!info.version && info.at) dim(info.at);
|
|
74
74
|
} else warn('claude CLI not found — run: npm install -g @anthropic-ai/claude-code');
|
|
75
75
|
|
|
76
|
+
/* Two supported places, for two different situations, and only one of them is the ordinary
|
|
77
|
+
* user's. The local profile is the per-user path; the registry branch under SOFTWARE\Policies
|
|
78
|
+
* is the managed one and a normal account cannot write there at all — reg import answers
|
|
79
|
+
* "Error accessing the registry" — which is by design, since the point of that branch is that
|
|
80
|
+
* only whoever administers the machine controls it.
|
|
81
|
+
*
|
|
82
|
+
* So the profile is what decides whether this is configured. An absent policy is reported as
|
|
83
|
+
* information, never as a fault: calling it a failure sent someone looking for a problem on a
|
|
84
|
+
* machine that was set up correctly. */
|
|
76
85
|
step('Claude Desktop');
|
|
77
86
|
const d = L.readDesktopState();
|
|
87
|
+
const prof = d.profile;
|
|
88
|
+
if (prof && prof.inferenceProvider === 'gateway' && prof.inferenceGatewayBaseUrl === L.API_ENDPOINT) {
|
|
89
|
+
ok(`provider gateway → ${prof.inferenceGatewayBaseUrl}`);
|
|
90
|
+
const scheme = prof.inferenceGatewayAuthScheme;
|
|
91
|
+
(scheme === 'x-api-key' ? ok : bad)(`auth ${scheme || '(default — expect 401)'}`);
|
|
92
|
+
if (scheme !== 'x-api-key') problems++;
|
|
93
|
+
const n = Array.isArray(prof.inferenceModels) ? prof.inferenceModels.length : 0;
|
|
94
|
+
const oneM = Array.isArray(prof.inferenceModels) ? prof.inferenceModels.filter((m) => m && m.supports1m).length : 0;
|
|
95
|
+
(n ? ok : bad)(`models ${n} configured${oneM ? `, ${oneM} with a 1M option` : ''}`);
|
|
96
|
+
if (!n) problems++;
|
|
97
|
+
ok(`fetch egress ${JSON.stringify(prof.coworkEgressAllowedHosts || [])}, preflight ${prof.skipWebFetchPreflight ? 'off' : 'ON'}`);
|
|
98
|
+
dim(prof.file);
|
|
99
|
+
} else {
|
|
100
|
+
bad('not configured — run `codemax-pro` to set it up');
|
|
101
|
+
problems++;
|
|
102
|
+
}
|
|
103
|
+
|
|
78
104
|
if (L.IS_WIN) {
|
|
79
|
-
if (d.policy
|
|
80
|
-
ok(`policy gateway → ${d.policy.baseUrl}`);
|
|
81
|
-
ok(`auth ${d.policy.authScheme || '(default — expect 401)'}`);
|
|
82
|
-
if (d.policy.authScheme !== 'x-api-key') problems++;
|
|
83
|
-
let n = 0; try { n = JSON.parse(d.policy.models || '[]').length; } catch { /* */ }
|
|
84
|
-
(n ? ok : bad)(`models ${n} configured`);
|
|
85
|
-
if (!n) problems++;
|
|
86
|
-
ok(`fetch egress ${d.policy.egress || '(none)'}, preflight ${d.policy.skipPreflight === 'true' ? 'off' : 'ON — needs an external host'}`);
|
|
87
|
-
} else {
|
|
88
|
-
bad('policy not set');
|
|
89
|
-
problems++;
|
|
90
|
-
}
|
|
105
|
+
if (d.policy) dim('a managed policy is also set for this user');
|
|
91
106
|
if (d.machinePolicy) {
|
|
92
107
|
bad('a machine-wide policy exists and OVERRIDES everything above');
|
|
93
108
|
dim(`${L.paths.winMachinePolicy} — whoever manages this device must set it there instead`);
|
|
94
109
|
problems++;
|
|
95
110
|
}
|
|
96
111
|
}
|
|
97
|
-
if (d.profile) { ok(`local profile written`); dim(d.profile.file); }
|
|
98
|
-
else { warn('no local profile — the app may not show these settings in its own UI'); }
|
|
99
112
|
|
|
100
113
|
step('Conflicts');
|
|
101
114
|
const conflicts = L.readEnvConflicts();
|
|
@@ -185,11 +198,10 @@ async function setup(opts) {
|
|
|
185
198
|
step('Claude Desktop');
|
|
186
199
|
const r = L.configureDesktop(key);
|
|
187
200
|
for (const w of r.written) ok(w);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
201
|
+
/* The managed policy branch is attempted and expected to fail for an ordinary account —
|
|
202
|
+
* SOFTWARE\Policies belongs to whoever administers the machine. That is not a problem to
|
|
203
|
+
* report; the per-user profile above is the supported path here and is enough on its own. */
|
|
204
|
+
if (r.policyError) dim('managed policy not written (needs an administrator — not required here)');
|
|
193
205
|
if (!r.written.length) warn('nothing could be written — is the app installed?');
|
|
194
206
|
if (r.machinePolicy) {
|
|
195
207
|
warn('a machine-wide policy exists and overrides what was just written');
|