premanmcp 0.15.0 → 0.15.1
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/bin/connect/guide.js +21 -1
- package/bin/integrations.js +27 -15
- package/package.json +1 -1
package/bin/connect/guide.js
CHANGED
|
@@ -149,7 +149,13 @@ export async function discoverEndpoints(
|
|
|
149
149
|
args,
|
|
150
150
|
agent,
|
|
151
151
|
serverName,
|
|
152
|
-
{
|
|
152
|
+
{
|
|
153
|
+
blockedHere = "",
|
|
154
|
+
force = false,
|
|
155
|
+
basePath = ".",
|
|
156
|
+
frameworkHint = undefined,
|
|
157
|
+
handOffBrief = true,
|
|
158
|
+
} = {}
|
|
153
159
|
) {
|
|
154
160
|
try {
|
|
155
161
|
const before = await endpointCounts(args);
|
|
@@ -183,6 +189,20 @@ export async function discoverEndpoints(
|
|
|
183
189
|
// Say why before printing homework: "here is a brief" reads as PreMan not
|
|
184
190
|
// working, when the actual answer is one login away.
|
|
185
191
|
if (blocker) process.stdout.write(`${MARK.skip()} ${blocker}\n`);
|
|
192
|
+
// The brief is written for an agent to execute, not for a person to read.
|
|
193
|
+
// Twenty lines of it in the middle of a setup walk reads as PreMan having
|
|
194
|
+
// failed, and the walk still has questions to ask after this. `endpoints
|
|
195
|
+
// discover` prints the same brief whenever it is actually wanted, so the
|
|
196
|
+
// pointer loses nothing but the wall of text.
|
|
197
|
+
if (!handOffBrief) {
|
|
198
|
+
if (!blocker) {
|
|
199
|
+
process.stdout.write(`${MARK.skip()} no coding agent here to read this repo\n`);
|
|
200
|
+
}
|
|
201
|
+
process.stdout.write(
|
|
202
|
+
` Map it from inside one: ${cliInvocation()} endpoints discover\n`
|
|
203
|
+
);
|
|
204
|
+
return before;
|
|
205
|
+
}
|
|
186
206
|
for (const line of brief.instructions || []) process.stdout.write(`${line}\n`);
|
|
187
207
|
const who = agent ? agent.label : "your coding agent";
|
|
188
208
|
process.stdout.write(`\nHand this brief to ${who}, then run:\n${manualSteps()}`);
|
package/bin/integrations.js
CHANGED
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
import { describeCheckout, explainNoCheckout, resolveCheckout } from "./repo.js";
|
|
18
18
|
import {
|
|
19
|
+
DEFAULT_BACKEND,
|
|
19
20
|
assertOk,
|
|
21
|
+
backendUrl,
|
|
20
22
|
callBackendJson,
|
|
21
23
|
cliInvocation,
|
|
22
24
|
frontendUrl,
|
|
@@ -86,10 +88,14 @@ function showOpeningDesktop() {
|
|
|
86
88
|
};
|
|
87
89
|
}
|
|
88
90
|
|
|
91
|
+
const INSTALLATIONS_URL = "https://github.com/settings/installations";
|
|
92
|
+
|
|
89
93
|
function present(url, what) {
|
|
90
94
|
process.stdout.write(`\n ${url}\n\n`);
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
// A tab appearing is its own confirmation; saying so as well spends a line
|
|
96
|
+
// on what the customer is already looking at. It earns its place only when
|
|
97
|
+
// no tab opened and the link is the way through.
|
|
98
|
+
if (!openUrl(url)) process.stdout.write(`Open the link above to ${what}.\n`);
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
/**
|
|
@@ -293,9 +299,7 @@ export async function githubCommand(args) {
|
|
|
293
299
|
{
|
|
294
300
|
timeoutMs: Number(process.env.PREMAN_GITHUB_POLL_MS) || GITHUB_POLL_TIMEOUT_MS,
|
|
295
301
|
hintAfterMs: 20000,
|
|
296
|
-
hint:
|
|
297
|
-
"Still nothing from GitHub. Picking at least one repository and confirming\n" +
|
|
298
|
-
"is what sends you back here.",
|
|
302
|
+
hint: "Still nothing from GitHub — confirm a repository to come back here.",
|
|
299
303
|
}
|
|
300
304
|
);
|
|
301
305
|
|
|
@@ -319,15 +323,12 @@ function githubHandOff(args, refresh) {
|
|
|
319
323
|
if (installed) {
|
|
320
324
|
return (
|
|
321
325
|
`The App is installed, but no repositories are shared with it.\n` +
|
|
322
|
-
`
|
|
323
|
-
` - Then re-run '${cliInvocation()} github'.\n`
|
|
326
|
+
` Add some at ${INSTALLATIONS_URL}, then re-run '${cliInvocation()} github'.\n`
|
|
324
327
|
);
|
|
325
328
|
}
|
|
326
329
|
return (
|
|
327
|
-
`Nothing from GitHub yet
|
|
328
|
-
` -
|
|
329
|
-
` - Check it: ${frontendUrl(args)} or https://github.com/settings/installations\n` +
|
|
330
|
-
` - Then re-run '${cliInvocation()} github'.\n`
|
|
330
|
+
`Nothing from GitHub yet. Finish the install in the browser — it records itself.\n` +
|
|
331
|
+
` Then re-run '${cliInvocation()} github'.\n`
|
|
331
332
|
);
|
|
332
333
|
}
|
|
333
334
|
|
|
@@ -422,6 +423,17 @@ export async function onboardCommand(
|
|
|
422
423
|
|
|
423
424
|
process.stdout.write("PreMan setup\n\n");
|
|
424
425
|
|
|
426
|
+
// Which PreMan this is talking to is invisible until the very last line,
|
|
427
|
+
// and a stored login from a local run silently redirects the whole walk:
|
|
428
|
+
// the account is created in a database nobody else can see, and the GitHub
|
|
429
|
+
// App redirects to the real callback, so the install never arrives and the
|
|
430
|
+
// wait looks like GitHub being slow. Production says nothing, because there
|
|
431
|
+
// is nothing to warn about; anything else is worth one line up front.
|
|
432
|
+
const target = backendUrl(args);
|
|
433
|
+
if (target !== DEFAULT_BACKEND) {
|
|
434
|
+
process.stdout.write(`${MARK.skip()} Using ${target}, not ${DEFAULT_BACKEND}.\n\n`);
|
|
435
|
+
}
|
|
436
|
+
|
|
425
437
|
const creds = await authenticateTerminal(args);
|
|
426
438
|
connected(`Signed in as ${creds.user_email || "your account"}.`);
|
|
427
439
|
|
|
@@ -449,7 +461,9 @@ export async function onboardCommand(
|
|
|
449
461
|
agent: args.value("--agent", ""),
|
|
450
462
|
interactive: false,
|
|
451
463
|
});
|
|
452
|
-
const counts = await discoverEndpoints(args, agent, args.value("--name", "preman")
|
|
464
|
+
const counts = await discoverEndpoints(args, agent, args.value("--name", "preman"), {
|
|
465
|
+
handOffBrief: false,
|
|
466
|
+
});
|
|
453
467
|
return { state: counts.registered ? "done" : "skipped", counts };
|
|
454
468
|
},
|
|
455
469
|
},
|
|
@@ -483,9 +497,7 @@ export async function onboardCommand(
|
|
|
483
497
|
return;
|
|
484
498
|
}
|
|
485
499
|
process.stdout.write(
|
|
486
|
-
`${checkout.slug} is still not shared
|
|
487
|
-
` Add it at https://github.com/settings/installations, then re-run ` +
|
|
488
|
-
`'${cliInvocation()} github'.\n`
|
|
500
|
+
`${checkout.slug} is still not shared. Add it at ${INSTALLATIONS_URL}.\n`
|
|
489
501
|
);
|
|
490
502
|
},
|
|
491
503
|
});
|