oharness 0.1.0 → 0.2.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/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # oharness
2
+
3
+ A model-agnostic agent harness for the terminal, built the way Claude Code is:
4
+ the agent loop, tool execution, context management and permissions are one
5
+ layer, and **the model is a replaceable backend**.
6
+
7
+ ```bash
8
+ npm install -g oharness
9
+ export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY / GEMINI_API_KEY
10
+ oharness
11
+ ```
12
+
13
+ Three commands are installed:
14
+
15
+ | | |
16
+ |---|---|
17
+ | `oharness` | the terminal UI — streaming output, permission prompts, slash commands |
18
+ | `oharness-headless` | no UI, no prompts, JSONL on stdout and nothing else |
19
+ | `oharness-web` | a browser frontend on localhost |
20
+
21
+ Switching model mid-conversation (`/model sonnet` → `/model gemini`) converts
22
+ no history, because the history was never held in a vendor's shape.
23
+
24
+ **With no UI there is nobody to ask.** `oharness-headless` denies any call that
25
+ would need a prompt and reports why — letting them through silently would make
26
+ an unattended run more dangerous than a watched one, which is backwards. Grant
27
+ what it needs with permission rules up front, or pass `--permission-mode auto`
28
+ deliberately.
29
+
30
+ Documentation, architecture and the reasoning behind both:
31
+ https://github.com/Jet1217/OHarness
package/dist/ui/auth.d.ts CHANGED
@@ -1,6 +1,38 @@
1
1
  import type { createInterface } from "node:readline/promises";
2
+ import type { Harness } from "@oharness/engine/harness.ts";
3
+ import type { Session } from "@oharness/engine/agent/session.ts";
2
4
  import type { AuthManager } from "@oharness/engine/auth/manager.ts";
3
5
  type Readline = ReturnType<typeof createInterface>;
6
+ /**
7
+ * The half of a login that is not the flow: showing a list, reading a line,
8
+ * saying what happened.
9
+ *
10
+ * It exists because there are two frontends and one login. The full-screen TUI
11
+ * cannot use readline — its alternate buffer would erase anything readline
12
+ * printed — and for a while that meant `/login` there did nothing but tell the
13
+ * user to go and run the CLI in another terminal. Two implementations of the
14
+ * flow would have been the other way to fix it, and the flow is the part with
15
+ * the security decisions in it.
16
+ */
17
+ export interface LoginIo {
18
+ /** Present a list. Returns the index, or undefined if cancelled. */
19
+ select(title: string, options: {
20
+ label: string;
21
+ hint?: string;
22
+ current?: boolean;
23
+ }[], detail?: string[]): Promise<number | undefined>;
24
+ /**
25
+ * Read one line. Must not echo when `secret` is set — these are live
26
+ * credentials, and a terminal's scrollback outlives the session.
27
+ */
28
+ input(message: string, opts?: {
29
+ secret?: boolean;
30
+ placeholder?: string;
31
+ detail?: string[];
32
+ }): Promise<string | undefined>;
33
+ /** Report progress or an outcome. */
34
+ say(text: string): void;
35
+ }
4
36
  /**
5
37
  * Interactive login, driven entirely off the provider's declared methods.
6
38
  *
@@ -8,7 +40,25 @@ type Readline = ReturnType<typeof createInterface>;
8
40
  * fields and the choice between flows all come from the declaration, which is
9
41
  * what lets a new subscription provider be added without touching the CLI.
10
42
  */
11
- export declare function runLogin(auth: AuthManager, rl: Readline, providerId?: string): Promise<void>;
43
+ export declare function runLogin(harness: Harness, io: LoginIo, providerId?: string,
44
+ /**
45
+ * The session to offer the new provider's models to. Optional because
46
+ * `oharness auth login` runs without one — there is no conversation to
47
+ * switch, and the stored catalog is what the next run reads.
48
+ */
49
+ session?: Session): Promise<void>;
12
50
  export declare function runLogout(auth: AuthManager, providerId: string): Promise<void>;
13
51
  export declare function printAuthStatus(auth: AuthManager): Promise<void>;
52
+ /**
53
+ * A `LoginIo` over readline, for `oharness auth login` and any run without the
54
+ * full-screen UI.
55
+ *
56
+ * Masking is done by silencing readline's echo for the duration of the
57
+ * question rather than by printing a bullet per keystroke: readline redraws
58
+ * the whole line on every edit, so a bullet-per-character implementation has
59
+ * to reimplement cursor movement to stay correct, and gets it wrong the first
60
+ * time someone presses Left. Nothing shown at all is honest about the fact
61
+ * that this field does not support editing, and leaves nothing behind.
62
+ */
63
+ export declare function readlineIo(rl: Readline): LoginIo;
14
64
  export {};
package/dist/ui/auth.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { spawn } from "node:child_process";
2
+ import { Writable } from "node:stream";
2
3
  import { errorMessage } from "@oharness/engine/core/errors.ts";
3
4
  import { c } from "./render.js";
5
+ // ---------------------------------------------------------------------------
6
+ // The flow
7
+ // ---------------------------------------------------------------------------
4
8
  /**
5
9
  * Interactive login, driven entirely off the provider's declared methods.
6
10
  *
@@ -8,62 +12,176 @@ import { c } from "./render.js";
8
12
  * fields and the choice between flows all come from the declaration, which is
9
13
  * what lets a new subscription provider be added without touching the CLI.
10
14
  */
11
- export async function runLogin(auth, rl, providerId) {
12
- const provider = providerId
13
- ? auth.get(providerId)
14
- : await pickProvider(auth, rl);
15
+ export async function runLogin(harness, io, providerId,
16
+ /**
17
+ * The session to offer the new provider's models to. Optional because
18
+ * `oharness auth login` runs without one — there is no conversation to
19
+ * switch, and the stored catalog is what the next run reads.
20
+ */
21
+ session) {
22
+ const auth = harness.auth;
23
+ const provider = providerId ? auth.get(providerId) : await pickProvider(harness, io);
15
24
  if (!provider) {
16
- console.log(c.red(`Unknown provider${providerId ? ` "${providerId}"` : ""}. Known: ${auth
17
- .list()
18
- .map((p) => p.id)
19
- .join(", ")}`));
25
+ if (providerId) {
26
+ io.say(c.red(`Unknown provider "${providerId}". Known: ${auth.list().map((p) => p.id).join(", ")}`));
27
+ }
20
28
  return;
21
29
  }
22
30
  if (provider.methods.length === 0) {
23
- console.log(c.yellow(`${provider.label} declares no login methods.`));
31
+ io.say(c.yellow(`${provider.label} declares no login methods.`));
24
32
  return;
25
33
  }
26
- const methodIndex = await pickMethod(provider.methods, rl);
34
+ const methodIndex = await pickMethod(provider.methods, io);
27
35
  if (methodIndex === undefined)
28
36
  return;
29
37
  const method = provider.methods[methodIndex];
30
- const answers = await collectAnswers(auth, method, rl);
38
+ // Where to get a key, opened rather than described. The alternative is the
39
+ // user leaving to search for a page we already know the address of.
40
+ const docsUrl = harness.providers.catalogEntry(provider.id)?.docsUrl;
41
+ if (method.type === "api" && docsUrl) {
42
+ io.say(c.gray(`Keys are issued at ${docsUrl}`));
43
+ await openBrowser(docsUrl);
44
+ }
45
+ const answers = await collectAnswers(auth, method, io);
31
46
  if (!answers)
32
47
  return;
48
+ // What is there now, so a credential that turns out not to work does not
49
+ // take a working one with it. Signing in again with a mistyped key is an
50
+ // ordinary thing to do, and the old behaviour made it cost the key that was
51
+ // already there.
52
+ const previous = await auth.store.get(provider.id);
33
53
  try {
34
54
  if (method.type === "api") {
35
55
  await auth.submit(provider.id, methodIndex, answers);
36
- console.log(c.green(`✓ Signed in to ${provider.label}`));
37
- return;
38
- }
39
- const flow = await auth.authorize(provider.id, methodIndex, answers);
40
- console.log(`\n${c.bold(flow.instructions)}`);
41
- // A flow with no URL delivers its code elsewhere (email); printing and
42
- // opening an empty address would just look broken.
43
- if (flow.url) {
44
- console.log(c.cyan(flow.url));
45
- await openBrowser(flow.url);
46
- }
47
- if (flow.method === "auto") {
48
- console.log(c.gray("\nWaiting for authorization…"));
49
- const result = await flow.callback();
50
- await auth.complete(provider.id, result);
51
56
  }
52
57
  else {
53
- const code = (await rl.question(c.yellow("\nPaste the code here: "))).trim();
54
- if (!code) {
55
- console.log(c.yellow("Cancelled."));
56
- return;
58
+ const flow = await auth.authorize(provider.id, methodIndex, answers);
59
+ io.say(c.bold(flow.instructions));
60
+ // A flow with no URL delivers its code elsewhere (email); printing and
61
+ // opening an empty address would just look broken.
62
+ if (flow.url) {
63
+ io.say(c.cyan(flow.url));
64
+ await openBrowser(flow.url);
65
+ }
66
+ if (flow.method === "auto") {
67
+ io.say(c.gray("Waiting for authorization…"));
68
+ await auth.complete(provider.id, await flow.callback());
69
+ }
70
+ else {
71
+ const code = await io.input("Paste the code here");
72
+ if (!code) {
73
+ io.say(c.yellow("Cancelled."));
74
+ return;
75
+ }
76
+ await auth.complete(provider.id, await flow.callback(code));
57
77
  }
58
- const result = await flow.callback(code);
59
- await auth.complete(provider.id, result);
60
78
  }
61
- console.log(c.green(`✓ Signed in to ${provider.label}`));
62
79
  }
63
80
  catch (err) {
64
- console.log(c.red(`✗ Login failed: ${errorMessage(err)}`));
81
+ io.say(c.red(`✗ Login failed: ${errorMessage(err)}`));
82
+ return;
83
+ }
84
+ const result = await confirm(harness, provider, io);
85
+ if (!result.accepted && previous) {
86
+ await auth.store.set(provider.id, previous);
87
+ io.say(c.gray("The credential that was already stored has been kept."));
88
+ return;
89
+ }
90
+ // The picker is the better version of the hint, so only one of them runs.
91
+ if (session && session.model.provider !== provider.id && result.models.length > 0) {
92
+ await offerSwitch(session, result.models, io);
93
+ }
94
+ else {
95
+ sayModelHint(result.models, io);
65
96
  }
66
97
  }
98
+ /**
99
+ * Finish the errand, rather than leaving the last step as homework.
100
+ *
101
+ * Somebody who just signed in to a provider did it in order to use it, and
102
+ * until the session's model changes nothing about the conversation has moved —
103
+ * the next message still goes to whatever was selected before, which for a
104
+ * first login is a provider with no credentials at all.
105
+ *
106
+ * Only offered when the session is pointed somewhere else. Re-authenticating
107
+ * the provider already in use is a repair, and a "which model?" list is not
108
+ * what a repair should end with.
109
+ */
110
+ async function offerSwitch(session, models, io) {
111
+ // Enough to choose from without turning the answer into a scroll. The rest
112
+ // stay one `/model` away, which the line below says.
113
+ const shortlist = models.slice(0, 8);
114
+ const picked = await io.select(`Switch to ${models[0].provider}?`, [
115
+ ...shortlist.map((model) => ({ label: model.id })),
116
+ { label: `Keep ${session.model.id}`, hint: "switch later with /model" },
117
+ ], models.length > shortlist.length
118
+ ? [`${shortlist.length} of ${models.length} — /model lists them all`]
119
+ : undefined);
120
+ if (picked === undefined || picked >= shortlist.length)
121
+ return;
122
+ try {
123
+ const change = session.setModel(shortlist[picked].id);
124
+ io.say(c.green(`⇄ ${change.from.id} → ${change.to.id}`));
125
+ }
126
+ catch (err) {
127
+ io.say(c.red(errorMessage(err)));
128
+ }
129
+ }
130
+ /**
131
+ * Prove the credential works, and keep what proving it produced.
132
+ *
133
+ * Storing a key and calling that success was the old behaviour, and it moved
134
+ * the discovery of a typo to the middle of the first turn — an hour later, in
135
+ * a 401 from a vendor whose error text does not mention which of several keys
136
+ * it means. One `/models` call settles it here, while the person who typed it
137
+ * is still looking at the screen.
138
+ *
139
+ * The same call is also where the model list comes from. Every provider but
140
+ * `official` ships with no models in the bundled catalog, so a login that
141
+ * stopped at "signed in" left the user to guess that `/models refresh` was the
142
+ * next step and then pick an id out of three hundred with no help.
143
+ *
144
+ * Returns whether the credential is worth keeping, and what it can reach. A
145
+ * rejection is not proof
146
+ * the key is wrong — an endpoint that cannot be reached fails here too — so
147
+ * the caller only rolls back to a credential that already existed, and a
148
+ * first login keeps what was typed for the user to fix.
149
+ */
150
+ async function confirm(harness, provider, io) {
151
+ io.say(c.gray(`Checking ${provider.label}…`));
152
+ let result;
153
+ try {
154
+ result = await harness.verifyProvider(provider.id);
155
+ }
156
+ catch (err) {
157
+ // The provider is not in the registry at all — an auth entry with no
158
+ // model provider behind it. Nothing to check, and the credential is
159
+ // stored either way.
160
+ io.say(c.green(`✓ Signed in to ${provider.label}`) + c.gray(` (${errorMessage(err)})`));
161
+ return { accepted: true, models: [] };
162
+ }
163
+ if (result.status === "failed") {
164
+ io.say(c.red(`✗ ${provider.label} rejected that credential: ${result.error}`));
165
+ return { accepted: false, models: [] };
166
+ }
167
+ if (result.status === "unsupported") {
168
+ // Anthropic and Google publish no `/models`, so there is nothing to check.
169
+ // Saying "verified" here would be a claim we did not earn.
170
+ io.say(c.green(`✓ Signed in to ${provider.label}`));
171
+ return { accepted: true, models: [] };
172
+ }
173
+ const count = result.models.length;
174
+ io.say(c.green(`✓ Signed in to ${provider.label} — ${count} model${count === 1 ? "" : "s"}`));
175
+ return { accepted: true, models: result.models };
176
+ }
177
+ /** Where the models went, for the runs that do not end in a picker. */
178
+ function sayModelHint(models, io) {
179
+ if (models.length === 0)
180
+ return;
181
+ const sample = models.slice(0, 3).map((model) => model.id);
182
+ io.say(c.gray(`e.g. ${sample.join(", ")}${models.length > sample.length ? ", …" : ""}`));
183
+ io.say(c.gray("Switch with /model, or list them all with /models."));
184
+ }
67
185
  export async function runLogout(auth, providerId) {
68
186
  const removed = await auth.logout(providerId);
69
187
  console.log(removed
@@ -76,6 +194,32 @@ export async function runLogout(auth, providerId) {
76
194
  console.log(c.yellow(`Note: ${providerId} still authenticates via ${resolved?.source ?? "another source"}.`));
77
195
  }
78
196
  }
197
+ /**
198
+ * When an access token runs out, said the way somebody reads it.
199
+ *
200
+ * This printed `toISOString()`, which is UTC and said so nowhere. Eight time
201
+ * zones east that renders a credential with an hour left on it as one that
202
+ * expired this morning — and the line above it says the provider is signed in,
203
+ * so the two together read as a sign-in that did not take. Both of us believed
204
+ * it before the timestamps were compared.
205
+ *
206
+ * Relative rather than local-absolute, because these last an hour and are
207
+ * renewed on the way into every request. "in 54 minutes" is the whole of what
208
+ * the number is for; a wall-clock time is arithmetic the reader has to do.
209
+ * Past an hour it hands back to a date, where absolute is what one means.
210
+ */
211
+ function untilText(at) {
212
+ const minutes = Math.round((at - Date.now()) / 60_000);
213
+ if (minutes >= 0 && minutes < 90)
214
+ return `expires in ${minutes} min`;
215
+ if (minutes < 0 && minutes > -90)
216
+ return `expired ${-minutes} min ago`;
217
+ const when = new Date(at).toLocaleString(undefined, {
218
+ dateStyle: "short",
219
+ timeStyle: "short",
220
+ });
221
+ return minutes < 0 ? `expired ${when}` : `expires ${when}`;
222
+ }
79
223
  export async function printAuthStatus(auth) {
80
224
  const statuses = await auth.status();
81
225
  for (const status of statuses) {
@@ -83,64 +227,79 @@ export async function printAuthStatus(auth) {
83
227
  const detail = status.authenticated
84
228
  ? c.gray(status.source ?? "authenticated")
85
229
  : c.gray("not signed in");
86
- const expiry = status.expiresAt && status.expiresAt > 0
87
- ? c.gray(` expires ${new Date(status.expiresAt).toISOString().slice(0, 16).replace("T", " ")}`)
88
- : "";
230
+ const expiry = status.expiresAt && status.expiresAt > 0 ? c.gray(` ${untilText(status.expiresAt)}`) : "";
89
231
  console.log(`${mark} ${status.providerId.padEnd(12)} ${detail}${expiry}`);
90
232
  }
91
233
  console.log(c.gray(`\nCredentials: ${auth.store.location}`));
92
234
  console.log(c.gray("Sign in with: oharness auth login <provider>"));
93
235
  }
94
236
  // ---------------------------------------------------------------------------
95
- async function pickProvider(auth, rl) {
96
- const providers = auth.list();
97
- console.log(c.bold("Which provider?"));
98
- providers.forEach((provider, index) => {
99
- console.log(` ${index + 1}. ${provider.label} ${c.gray(`(${provider.id})`)}`);
237
+ // Choosing what to sign in to
238
+ // ---------------------------------------------------------------------------
239
+ /**
240
+ * The provider list, ordered and annotated.
241
+ *
242
+ * It used to be twenty-eight bare names in registration order, which is the
243
+ * order they happen to appear in a JSON file. Everything used to fix that is
244
+ * already in the catalog and was simply not read: which vendor this project
245
+ * stands behind, which ones are worth showing first, and a line saying what
246
+ * each one is. The signed-in marks come from the auth manager, so a list that
247
+ * is mostly "already done" reads that way instead of inviting a second login.
248
+ */
249
+ async function pickProvider(harness, io) {
250
+ const statuses = new Map((await harness.auth.status()).map((status) => [status.providerId, status]));
251
+ const ranked = [...harness.auth.list()].sort((a, b) => rank(harness, a) - rank(harness, b));
252
+ const options = ranked.map((provider) => {
253
+ const entry = harness.providers.catalogEntry(provider.id);
254
+ const status = statuses.get(provider.id);
255
+ const hint = status?.authenticated
256
+ ? `signed in — ${status.source ?? "stored"}`
257
+ : entry?.description ?? provider.id;
258
+ return {
259
+ label: provider.label,
260
+ hint,
261
+ ...(status?.authenticated ? { current: true } : {}),
262
+ };
100
263
  });
101
- const answer = (await rl.question(c.yellow("> "))).trim();
102
- const index = Number(answer) - 1;
103
- return Number.isInteger(index) ? providers[index] : undefined;
264
+ const picked = await io.select("Which provider?", options);
265
+ return picked === undefined ? undefined : ranked[picked];
104
266
  }
105
- async function pickMethod(methods, rl) {
267
+ /** Recommended first, then popular, then the rest in catalog order. */
268
+ function rank(harness, provider) {
269
+ const entry = harness.providers.catalogEntry(provider.id);
270
+ if (entry?.recommended)
271
+ return 0;
272
+ if (entry?.popular)
273
+ return 1;
274
+ return 2;
275
+ }
276
+ async function pickMethod(methods, io) {
106
277
  if (methods.length === 1)
107
278
  return 0;
108
- console.log(c.bold("\nHow do you want to sign in?"));
109
- methods.forEach((method, index) => {
110
- console.log(` ${index + 1}. ${method.label} ${c.gray(`(${method.type})`)}`);
111
- });
112
- const answer = (await rl.question(c.yellow("> "))).trim();
113
- const index = Number(answer) - 1;
114
- if (!Number.isInteger(index) || index < 0 || index >= methods.length) {
115
- console.log(c.yellow("Cancelled."));
116
- return undefined;
117
- }
118
- return index;
279
+ return io.select("How do you want to sign in?", methods.map((method) => ({ label: method.label, hint: method.type })));
119
280
  }
120
281
  /**
121
282
  * Walk the declared prompts. Re-filtered after each answer so a `when`
122
283
  * condition can reveal or hide later prompts based on what was just entered.
123
284
  */
124
- async function collectAnswers(auth, method, rl) {
285
+ async function collectAnswers(auth, method, io) {
125
286
  const answers = {};
126
287
  const asked = new Set();
127
288
  while (true) {
128
- const pending = auth
129
- .promptsFor(method, answers)
130
- .find((prompt) => !asked.has(prompt.key));
289
+ const pending = auth.promptsFor(method, answers).find((prompt) => !asked.has(prompt.key));
131
290
  if (!pending)
132
291
  break;
133
292
  asked.add(pending.key);
134
- const value = await ask(pending, rl);
293
+ const value = await ask(pending, io);
135
294
  if (value === undefined) {
136
- console.log(c.yellow("Cancelled."));
295
+ io.say(c.yellow("Cancelled."));
137
296
  return undefined;
138
297
  }
139
298
  answers[pending.key] = value;
140
299
  if (pending.type === "text" && pending.validate) {
141
300
  const error = pending.validate(value);
142
301
  if (error) {
143
- console.log(c.red(` ${error}`));
302
+ io.say(c.red(` ${error}`));
144
303
  asked.delete(pending.key);
145
304
  delete answers[pending.key];
146
305
  }
@@ -148,19 +307,23 @@ async function collectAnswers(auth, method, rl) {
148
307
  }
149
308
  return answers;
150
309
  }
151
- async function ask(prompt, rl) {
310
+ async function ask(prompt, io) {
152
311
  if (prompt.type === "select") {
153
- console.log(`\n${prompt.message}`);
154
- prompt.options.forEach((option, index) => {
155
- console.log(` ${index + 1}. ${option.label}${option.hint ? c.gray(` — ${option.hint}`) : ""}`);
156
- });
157
- const answer = (await rl.question(c.yellow("> "))).trim();
158
- const index = Number(answer) - 1;
159
- return prompt.options[index]?.value;
160
- }
161
- const suffix = prompt.placeholder ? c.gray(` (${prompt.placeholder})`) : "";
162
- const answer = await rl.question(`\n${prompt.message}${suffix}${c.yellow(": ")}`);
163
- return answer.trim() === "" ? undefined : answer.trim();
312
+ const picked = await io.select(prompt.message, prompt.options.map((option) => ({
313
+ label: option.label,
314
+ ...(option.hint ? { hint: option.hint } : {}),
315
+ })));
316
+ return picked === undefined ? undefined : prompt.options[picked]?.value;
317
+ }
318
+ const value = await io.input(prompt.message, {
319
+ ...(prompt.secret ? { secret: true } : {}),
320
+ ...(prompt.placeholder ? { placeholder: prompt.placeholder } : {}),
321
+ });
322
+ // `KEY="sk-…"` is the shape a key arrives in when it is copied out of a
323
+ // `.env`, and refusing it was pedantry: the quotes are unambiguous and
324
+ // stripping them is what the user meant. What `validate` still rejects is a
325
+ // value with an interior space, which is a different mistake.
326
+ return value === undefined ? undefined : value.trim().replace(/^["']|["']$/g, "");
164
327
  }
165
328
  /** Best effort — a headless host just reads the URL off the terminal. */
166
329
  async function openBrowser(url) {
@@ -174,4 +337,69 @@ async function openBrowser(url) {
174
337
  // Ignore: the URL is already printed above.
175
338
  }
176
339
  }
340
+ // ---------------------------------------------------------------------------
341
+ // The scrolling-terminal frontend
342
+ // ---------------------------------------------------------------------------
343
+ /**
344
+ * A `LoginIo` over readline, for `oharness auth login` and any run without the
345
+ * full-screen UI.
346
+ *
347
+ * Masking is done by silencing readline's echo for the duration of the
348
+ * question rather than by printing a bullet per keystroke: readline redraws
349
+ * the whole line on every edit, so a bullet-per-character implementation has
350
+ * to reimplement cursor movement to stay correct, and gets it wrong the first
351
+ * time someone presses Left. Nothing shown at all is honest about the fact
352
+ * that this field does not support editing, and leaves nothing behind.
353
+ */
354
+ export function readlineIo(rl) {
355
+ return {
356
+ async select(title, options, detail) {
357
+ console.log(c.bold(`\n${title}`));
358
+ for (const line of detail ?? [])
359
+ console.log(c.gray(line));
360
+ options.forEach((option, index) => {
361
+ const mark = option.current ? c.green("✓") : " ";
362
+ const hint = option.hint ? c.gray(` — ${option.hint}`) : "";
363
+ console.log(`${mark} ${index + 1}. ${option.label}${hint}`);
364
+ });
365
+ const answer = (await rl.question(c.yellow("> "))).trim();
366
+ const index = Number(answer) - 1;
367
+ if (!Number.isInteger(index) || index < 0 || index >= options.length) {
368
+ return undefined;
369
+ }
370
+ return index;
371
+ },
372
+ async input(message, opts) {
373
+ for (const line of opts?.detail ?? [])
374
+ console.log(c.gray(line));
375
+ const suffix = opts?.placeholder ? c.gray(` (${opts.placeholder})`) : "";
376
+ const prompt = `\n${message}${suffix}${c.yellow(": ")}`;
377
+ if (!opts?.secret) {
378
+ const answer = await rl.question(prompt);
379
+ return answer.trim() === "" ? undefined : answer.trim();
380
+ }
381
+ const iface = rl;
382
+ const real = iface.output;
383
+ real.write(prompt);
384
+ // Swapping the stream rather than overriding `_writeToOutput`: that
385
+ // method is a deprecated alias in current Node and the line editor
386
+ // writes through an internal symbol instead, so overriding it masks
387
+ // nothing while looking like it does. Every echo path ends at
388
+ // `this.output`, which is why this one holds.
389
+ iface.output = new Writable({ write(_chunk, _encoding, done) { done(); } });
390
+ try {
391
+ const answer = await rl.question("");
392
+ return answer.trim() === "" ? undefined : answer.trim();
393
+ }
394
+ finally {
395
+ iface.output = real;
396
+ // The newline the user typed was swallowed with everything else.
397
+ real.write("\n");
398
+ }
399
+ },
400
+ say(text) {
401
+ console.log(text);
402
+ },
403
+ };
404
+ }
177
405
  //# sourceMappingURL=auth.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/ui/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAG/D,OAAO,EAAE,CAAC,EAAE,M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