@tempoxyz/mercator 0.0.835 → 0.0.836
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/dist/setup-preferences.js +1 -0
- package/dist/setup-render.js +13 -6
- package/dist/setup.d.ts +1 -0
- package/dist/setup.js +14 -6
- package/package.json +1 -1
|
@@ -57,6 +57,7 @@ export async function saveSetupPreferences(options, result, home = homedir()) {
|
|
|
57
57
|
schemaVersion: 1,
|
|
58
58
|
client: [...new Set(result.clients.map(({ client }) => client))],
|
|
59
59
|
agents: options.agents &&
|
|
60
|
+
(options.client.length === 0 || options.client.includes('codex')) &&
|
|
60
61
|
(options.refresh === true ||
|
|
61
62
|
options.plugin ||
|
|
62
63
|
result.clients.some(({ client }) => client === 'codex')),
|
package/dist/setup-render.js
CHANGED
|
@@ -117,6 +117,7 @@ export function formatSetupResult(result, color = false, debug, suggestedQueries
|
|
|
117
117
|
lines.push('', styleText('Integrations', 'bold', color), ...integrations);
|
|
118
118
|
}
|
|
119
119
|
const readiness = [];
|
|
120
|
+
const clientOnly = 'clientOnly' in result && result.clientOnly;
|
|
120
121
|
if ('nativePayments' in result) {
|
|
121
122
|
for (const payment of result.nativePayments) {
|
|
122
123
|
const glyph = payment.status === 'ready' ? '✓' : payment.status === 'planned' ? '→' : '!';
|
|
@@ -149,9 +150,11 @@ export function formatSetupResult(result, color = false, debug, suggestedQueries
|
|
|
149
150
|
readiness.push(` ${result.diagnosis.error}`);
|
|
150
151
|
}
|
|
151
152
|
if (readiness.length > 0) {
|
|
152
|
-
lines.push('', styleText('CLI readiness', 'bold', color), ...readiness);
|
|
153
|
+
lines.push('', styleText(clientOnly ? 'Client verification' : 'CLI readiness', 'bold', color), ...readiness);
|
|
153
154
|
if (result.clients.length > 0 || ('plugin' in result && result.plugin)) {
|
|
154
|
-
lines.push(
|
|
155
|
+
lines.push(clientOnly
|
|
156
|
+
? 'Complete OAuth and call get_connection_status in the selected client. Mercator CLI authorization is not required.'
|
|
157
|
+
: 'Agent clients authorize separately. Complete OAuth and call get_connection_status in each client.');
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
if (!result.dryRun && 'diagnosis' in result && result.diagnosis.spending)
|
|
@@ -211,12 +214,16 @@ export function formatSetupResult(result, color = false, debug, suggestedQueries
|
|
|
211
214
|
}
|
|
212
215
|
}
|
|
213
216
|
if (!result.ready) {
|
|
214
|
-
lines.push('', 'Your completed setup was preserved.', '', ...(
|
|
217
|
+
lines.push('', 'Your completed setup was preserved.', '', ...(clientOnly
|
|
215
218
|
? [
|
|
216
|
-
'
|
|
217
|
-
' mercator setup',
|
|
219
|
+
'Verify the connection in the selected client with search_services and get_connection_status.',
|
|
218
220
|
]
|
|
219
|
-
:
|
|
221
|
+
: 'diagnosis' in result && result.diagnosis.authorization === 'required'
|
|
222
|
+
? [
|
|
223
|
+
'Retry CLI login and readiness checks in an interactive terminal:',
|
|
224
|
+
' mercator setup',
|
|
225
|
+
]
|
|
226
|
+
: ['Retry readiness checks:', ' mercator doctor']));
|
|
220
227
|
return appendDebugContext(lines.join('\n'), result, debug, color);
|
|
221
228
|
}
|
|
222
229
|
const everythingCurrent = !claudeSkillsReload &&
|
package/dist/setup.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ export declare function setup(options: SetupOptions, dependencies: SetupDependen
|
|
|
122
122
|
client: ClientId;
|
|
123
123
|
status: 'already_configured' | 'configured' | 'conflict' | 'planned' | 'reconfigured' | 'skipped';
|
|
124
124
|
}[];
|
|
125
|
+
clientOnly?: boolean;
|
|
125
126
|
diagnosis: import("./doctor.js").DoctorReport;
|
|
126
127
|
dryRun: boolean;
|
|
127
128
|
nativePayments: import("./native-payments.js").NativePaymentReport[];
|
package/dist/setup.js
CHANGED
|
@@ -20,6 +20,8 @@ export function validateSetupOptions(options) {
|
|
|
20
20
|
export async function setup(options, dependencies, progress, telemetry, diagnostics) {
|
|
21
21
|
const warnings = [];
|
|
22
22
|
validateSetupOptions(options);
|
|
23
|
+
const clientOnly = options.client.length > 0;
|
|
24
|
+
const codexSelected = !clientOnly || options.client.includes(Client.Codex);
|
|
23
25
|
if (options.manual) {
|
|
24
26
|
return {
|
|
25
27
|
clients: [],
|
|
@@ -160,7 +162,8 @@ export async function setup(options, dependencies, progress, telemetry, diagnost
|
|
|
160
162
|
// under --yes/--force. Those flags do not transfer ownership of native plugins.
|
|
161
163
|
const preserved = new Map();
|
|
162
164
|
for (const client of [Client.Claude, Client.Codex]) {
|
|
163
|
-
if (!clients.includes(client) &&
|
|
165
|
+
if (!clients.includes(client) &&
|
|
166
|
+
!(client === Client.Codex && options.plugin && codexSelected))
|
|
164
167
|
continue;
|
|
165
168
|
if (client === Client.Claude && detectedStates.get(client) === 'unavailable')
|
|
166
169
|
continue;
|
|
@@ -200,7 +203,8 @@ export async function setup(options, dependencies, progress, telemetry, diagnost
|
|
|
200
203
|
warnings.push(registration.action);
|
|
201
204
|
}
|
|
202
205
|
clients = clients.filter((client) => !preserved.has(client));
|
|
203
|
-
const canManageCodex =
|
|
206
|
+
const canManageCodex = codexSelected &&
|
|
207
|
+
!preserved.has(Client.Codex) &&
|
|
204
208
|
(!preserved.has(Client.Claude) || clients.includes(Client.Codex));
|
|
205
209
|
const installDesktopPlugin = options.plugin && canManageCodex;
|
|
206
210
|
if (!options.dryRun && !options.yes) {
|
|
@@ -456,7 +460,7 @@ export async function setup(options, dependencies, progress, telemetry, diagnost
|
|
|
456
460
|
try {
|
|
457
461
|
const diagnosticEndpoints = new Set(clients.map((client) => clientEndpoint(client, options.url)));
|
|
458
462
|
const diagnosticEndpoint = diagnosticEndpoints.size === 1 ? [...diagnosticEndpoints][0] : options.url;
|
|
459
|
-
diagnosis = await runDiagnostic(diagnostics, { phase: 'readiness' }, () => diagnoseWithoutWallet(diagnosticEndpoint ?? options.url, dependencies, progress, diagnostics, Boolean(options.interactive && !options.yes && !options.refresh)));
|
|
463
|
+
diagnosis = await runDiagnostic(diagnostics, { phase: 'readiness' }, () => diagnoseWithoutWallet(diagnosticEndpoint ?? options.url, dependencies, progress, diagnostics, Boolean(options.interactive && !options.yes && !options.refresh), !clientOnly));
|
|
460
464
|
diagnostics?.info({
|
|
461
465
|
phase: 'readiness-result',
|
|
462
466
|
state: diagnosis.ready ? 'ready' : 'failed',
|
|
@@ -490,6 +494,7 @@ export async function setup(options, dependencies, progress, telemetry, diagnost
|
|
|
490
494
|
}
|
|
491
495
|
: {}),
|
|
492
496
|
clients: clientResults,
|
|
497
|
+
...(clientOnly ? { clientOnly: true } : {}),
|
|
493
498
|
diagnosis: diagnosis.report,
|
|
494
499
|
dryRun: false,
|
|
495
500
|
nativePayments,
|
|
@@ -590,10 +595,10 @@ function describeSetupPlan(plan) {
|
|
|
590
595
|
: `Update ${plan.path}`;
|
|
591
596
|
}
|
|
592
597
|
/** Checks remote MCP readiness without requiring a local payment wallet. */
|
|
593
|
-
async function diagnoseWithoutWallet(endpoint, dependencies, progress, diagnostics, interactive = false) {
|
|
598
|
+
async function diagnoseWithoutWallet(endpoint, dependencies, progress, diagnostics, interactive = false, useCliSession = true) {
|
|
594
599
|
const protectedEndpoint = isProtectedMcpEndpoint(endpoint);
|
|
595
600
|
let fetcher;
|
|
596
|
-
if (protectedEndpoint) {
|
|
601
|
+
if (protectedEndpoint && useCliSession) {
|
|
597
602
|
try {
|
|
598
603
|
fetcher = await dependencies.mcpFetch(endpoint);
|
|
599
604
|
}
|
|
@@ -606,7 +611,10 @@ async function diagnoseWithoutWallet(endpoint, dependencies, progress, diagnosti
|
|
|
606
611
|
? dependencies.diagnose(endpoint, fetcher, progress?.report, diagnostics)
|
|
607
612
|
: dependencies.diagnose(endpoint, fetcher, progress?.report);
|
|
608
613
|
let diagnosed = await diagnose();
|
|
609
|
-
if (protectedEndpoint &&
|
|
614
|
+
if (protectedEndpoint &&
|
|
615
|
+
diagnosed.authorization === 'required' &&
|
|
616
|
+
interactive &&
|
|
617
|
+
useCliSession) {
|
|
610
618
|
progress?.report('Authorize the Mercator CLI in your browser...');
|
|
611
619
|
await progress?.preparePrompt?.();
|
|
612
620
|
try {
|