oh-aicoding-tool 0.1.9 → 0.1.11

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.
Files changed (2) hide show
  1. package/bin/cli.js +59 -60
  2. package/package.json +2 -2
package/bin/cli.js CHANGED
@@ -209,10 +209,9 @@ async function debugKeys() {
209
209
  });
210
210
  }
211
211
 
212
- async function askMultiChoice(rl, title, choices, subtitle) {
213
- if (process.stdin.isTTY && process.stdout.isTTY) {
214
- rl.pause();
215
- return await new Promise((resolve) => {
212
+ async function askMultiChoice(title, choices, subtitle) {
213
+ if (process.stdin.isTTY && process.stdout.isTTY) {
214
+ return await new Promise((resolve) => {
216
215
  let index = 0;
217
216
  let keyBuffer = "";
218
217
  const selected = new Set(choices.filter((choice) => choice.selected).map((choice) => choice.value));
@@ -222,10 +221,9 @@ async function askMultiChoice(rl, title, choices, subtitle) {
222
221
  stdin.off("data", onData);
223
222
  if (stdin.isTTY) stdin.setRawMode(false);
224
223
  stdin.pause();
225
- rl.resume();
226
- clearScreen();
227
- resolve(value);
228
- }
224
+ clearScreen();
225
+ resolve(value);
226
+ }
229
227
 
230
228
  function toggle() {
231
229
  const value = choices[index].value;
@@ -273,10 +271,12 @@ async function askMultiChoice(rl, title, choices, subtitle) {
273
271
  renderMultiChoice(title, choices, index, selected, subtitle);
274
272
  });
275
273
  }
276
-
277
- choices.forEach((choice, index) => console.log(` ${index + 1}. ${choice.label}`));
278
- const answer = await rl.question("Select numbers separated by comma > ");
279
- return answer
274
+
275
+ choices.forEach((choice, index) => console.log(` ${index + 1}. ${choice.label}`));
276
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
277
+ const answer = await rl.question("Select numbers separated by comma > ");
278
+ rl.close();
279
+ return answer
280
280
  .split(/[, ]+/)
281
281
  .map((item) => Number.parseInt(item, 10) - 1)
282
282
  .filter((index) => Number.isInteger(index) && choices[index])
@@ -301,54 +301,53 @@ async function askCompanyEmail(rl) {
301
301
  }
302
302
  }
303
303
 
304
- async function interactive() {
305
- if (!process.stdin.isTTY) {
306
- printHelp();
307
- return 0;
308
- }
309
-
310
- const rl = createInterface({ input: process.stdin, output: process.stdout });
311
- try {
312
- const tools = await askMultiChoice(
313
- rl,
314
- "Select tools to install or configure",
315
- [
316
- { label: "Langfuse tracing", value: "langfuse", selected: true, description: "Configure Claude Code, OpenCode, or Codex tracing." },
317
- { label: "Issue report plugin", value: "report", selected: true, description: "Install /report-ai-issue and configure Company email." },
318
- ],
319
- "Install menu"
320
- );
321
-
322
- let reportTarget = "";
323
- let email = "";
324
- if (tools.includes("report")) {
325
- const targets = await askMultiChoice(
326
- rl,
327
- "Select issue report install targets",
328
- [
329
- { label: "OpenCode", value: "opencode", selected: true, description: "Install OpenCode plugin and command." },
330
- { label: "Claude Code", value: "claude", selected: false, description: "Install Claude command and hook integration." },
331
- ],
332
- "Issue report setup"
333
- );
334
- reportTarget = targets.length === 2 ? "both" : targets[0] || "";
335
- if (reportTarget) email = await askCompanyEmail(rl);
336
- }
337
-
338
- rl.close();
339
- let code = 0;
340
- if (tools.includes("langfuse")) code ||= runPackageBin("oh-langfuse", "oh-langfuse", ["setup"]);
341
- if (tools.includes("report") && reportTarget) {
342
- const args = ["install", reportTarget];
343
- if (email) args.push("--email", email);
344
- else args.push("--skip-email");
345
- code ||= runPackageBin("oh-aireport", "oh-aireport", args);
346
- }
347
- return code;
348
- } finally {
349
- rl.close();
350
- }
351
- }
304
+ async function interactive() {
305
+ if (!process.stdin.isTTY) {
306
+ printHelp();
307
+ return 0;
308
+ }
309
+
310
+ const tools = await askMultiChoice(
311
+ "Select tools to install or configure",
312
+ [
313
+ { label: "Langfuse tracing", value: "langfuse", selected: true, description: "Configure Claude Code, OpenCode, or Codex tracing." },
314
+ { label: "Issue report plugin", value: "report", selected: true, description: "Install /report-ai-issue and configure Company email." },
315
+ ],
316
+ "Install menu"
317
+ );
318
+
319
+ let reportTarget = "";
320
+ let email = "";
321
+ if (tools.includes("report")) {
322
+ const targets = await askMultiChoice(
323
+ "Select issue report install targets",
324
+ [
325
+ { label: "OpenCode", value: "opencode", selected: true, description: "Install OpenCode plugin and command." },
326
+ { label: "Claude Code", value: "claude", selected: false, description: "Install Claude command and hook integration." },
327
+ ],
328
+ "Issue report setup"
329
+ );
330
+ reportTarget = targets.length === 2 ? "both" : targets[0] || "";
331
+ if (reportTarget) {
332
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
333
+ try {
334
+ email = await askCompanyEmail(rl);
335
+ } finally {
336
+ rl.close();
337
+ }
338
+ }
339
+ }
340
+
341
+ let code = 0;
342
+ if (tools.includes("langfuse")) code ||= runPackageBin("oh-langfuse", "oh-langfuse", ["setup"]);
343
+ if (tools.includes("report") && reportTarget) {
344
+ const args = ["install", reportTarget];
345
+ if (email) args.push("--email", email);
346
+ else args.push("--skip-email");
347
+ code ||= runPackageBin("oh-aireport", "oh-aireport", args);
348
+ }
349
+ return code;
350
+ }
352
351
 
353
352
  async function main() {
354
353
  const argv = process.argv.slice(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-aicoding-tool",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Interactive installer for AI coding tools: Langfuse tracing and oh-ai-report.",
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "license": "UNLICENSED",
27
27
  "dependencies": {
28
- "oh-langfuse": "^0.1.10",
28
+ "oh-langfuse": "^0.1.12",
29
29
  "oh-aireport": "^0.1.1"
30
30
  }
31
31
  }