openalmanac 0.2.43 → 0.2.45

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/dist/setup.js +24 -27
  2. package/package.json +1 -1
package/dist/setup.js CHANGED
@@ -102,12 +102,17 @@ const LOGO_LINES = [
102
102
  "\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255a\u2550\u255d \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u255a\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u255a\u2588\u2588\u2588\u2588\u2588\u2588\u2557",
103
103
  "\u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u2550\u2550\u2550\u2550\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u2550\u2550\u255d\u255a\u2550\u255d \u255a\u2550\u255d \u255a\u2550\u2550\u2550\u2550\u2550\u255d",
104
104
  ];
105
- function printBanner() {
105
+ function printBanner(subtitle = "Write and publish articles with your AI agent") {
106
106
  process.stdout.write("\n");
107
107
  for (let i = 0; i < LOGO_LINES.length; i++) {
108
108
  process.stdout.write(`${GRADIENT[i]}${LOGO_LINES[i]}${RST}\n`);
109
109
  }
110
- process.stdout.write(`\n${DIM} Write and publish articles with your AI agent${RST}\n`);
110
+ process.stdout.write(`\n${WHITE_BOLD} ${subtitle}${RST}\n`);
111
+ }
112
+ function renderHeader(mode = "default") {
113
+ printBanner(mode === "reddit"
114
+ ? "Turn any subreddit into a published wiki"
115
+ : "Write and publish articles with your AI agent");
111
116
  }
112
117
  function printBadge() {
113
118
  process.stdout.write(`\n ${ACCENT_BG} almanac ${RST}\n`);
@@ -197,9 +202,9 @@ function configurePermissions(tools) {
197
202
  return tools.length;
198
203
  }
199
204
  /* ── Agent selection screen ─────────────────────────────────────── */
200
- function renderAgentSelect(_cursor) {
205
+ function renderAgentSelect(_cursor, mode = "default") {
201
206
  process.stdout.write("\x1b[2J\x1b[H");
202
- printBanner();
207
+ renderHeader(mode);
203
208
  printBadge();
204
209
  w("");
205
210
  stepActive(`Select your agent`);
@@ -216,9 +221,9 @@ function renderAgentSelect(_cursor) {
216
221
  w(` ${DIM}\u2502${RST} ${BLUE}${BOLD}[enter]${RST} confirm ${DIM}[q] quit${RST}`);
217
222
  w("");
218
223
  }
219
- function runAgentSelect() {
224
+ function runAgentSelect(mode = "default") {
220
225
  return new Promise((resolve) => {
221
- renderAgentSelect(0);
226
+ renderAgentSelect(0, mode);
222
227
  process.stdin.setRawMode(true);
223
228
  process.stdin.resume();
224
229
  process.stdin.setEncoding("utf-8");
@@ -272,7 +277,7 @@ function waitForKey(prompt) {
272
277
  process.stdin.on("data", onData);
273
278
  });
274
279
  }
275
- async function runLoginStep(agent, mcpChanged, toolCount) {
280
+ async function runLoginStep(agent, mcpChanged, toolCount, mode = "default") {
276
281
  const priorSteps = () => {
277
282
  stepDone(`Agent \u2192 ${WHITE_BOLD}${agent}${RST}`);
278
283
  w(BAR);
@@ -283,7 +288,7 @@ async function runLoginStep(agent, mcpChanged, toolCount) {
283
288
  };
284
289
  function renderLoginChoice(name, cursor) {
285
290
  process.stdout.write("\x1b[2J\x1b[H");
286
- printBanner();
291
+ renderHeader(mode);
287
292
  printBadge();
288
293
  w("");
289
294
  priorSteps();
@@ -347,7 +352,7 @@ async function runLoginStep(agent, mcpChanged, toolCount) {
347
352
  }
348
353
  // Show prompt before opening browser
349
354
  process.stdout.write("\x1b[2J\x1b[H");
350
- printBanner();
355
+ renderHeader(mode);
351
356
  printBadge();
352
357
  w("");
353
358
  priorSteps();
@@ -360,7 +365,7 @@ async function runLoginStep(agent, mcpChanged, toolCount) {
360
365
  // Show waiting state with cancel/retry hint
361
366
  const renderWaiting = () => {
362
367
  process.stdout.write("\x1b[2J\x1b[H");
363
- printBanner();
368
+ renderHeader(mode);
364
369
  printBadge();
365
370
  w("");
366
371
  priorSteps();
@@ -423,9 +428,9 @@ async function runLoginStep(agent, mcpChanged, toolCount) {
423
428
  }
424
429
  /* ── Tool permissions TUI ───────────────────────────────────────── */
425
430
  const MAX_NAME = Math.max(...TOOL_GROUPS.map((g) => g.name.length));
426
- function renderToolSelect(selected, cursor, agent, mcpChanged) {
431
+ function renderToolSelect(selected, cursor, agent, mcpChanged, mode = "default") {
427
432
  process.stdout.write("\x1b[2J\x1b[H");
428
- printBanner();
433
+ renderHeader(mode);
429
434
  printBadge();
430
435
  w("");
431
436
  stepDone(`Agent \u2192 ${WHITE_BOLD}${agent}${RST}`);
@@ -446,11 +451,11 @@ function renderToolSelect(selected, cursor, agent, mcpChanged) {
446
451
  w(` ${DIM}\u2502${RST} ${BLUE}${BOLD}[space]${RST} toggle ${BLUE}${BOLD}[\u2191\u2193]${RST} move ${BLUE}${BOLD}[a]${RST} all ${BLUE}${BOLD}[enter]${RST} confirm ${DIM}[q] quit${RST}`);
447
452
  w("");
448
453
  }
449
- function runToolSelect(agent, mcpChanged) {
454
+ function runToolSelect(agent, mcpChanged, mode = "default") {
450
455
  return new Promise((resolve) => {
451
456
  const selected = TOOL_GROUPS.map(() => true);
452
457
  let cursor = 0;
453
- renderToolSelect(selected, cursor, agent, mcpChanged);
458
+ renderToolSelect(selected, cursor, agent, mcpChanged, mode);
454
459
  process.stdin.setRawMode(true);
455
460
  process.stdin.resume();
456
461
  process.stdin.setEncoding("utf-8");
@@ -486,7 +491,7 @@ function runToolSelect(agent, mcpChanged) {
486
491
  resolve(tools);
487
492
  return;
488
493
  }
489
- renderToolSelect(selected, cursor, agent, mcpChanged);
494
+ renderToolSelect(selected, cursor, agent, mcpChanged, mode);
490
495
  };
491
496
  process.stdin.on("data", onData);
492
497
  });
@@ -582,18 +587,10 @@ function installSkill(skillName) {
582
587
  const REDDIT_EXTRA_TOOLS = [
583
588
  "Bash(node */ingest.js *)",
584
589
  ];
585
- /* ── Reddit setup banner ───────────────────────────────────────── */
586
- function printRedditBanner() {
587
- process.stdout.write("\n");
588
- for (let i = 0; i < LOGO_LINES.length; i++) {
589
- process.stdout.write(`${GRADIENT[i]}${LOGO_LINES[i]}${RST}\n`);
590
- }
591
- process.stdout.write(`\n${DIM} Turn any subreddit into a published wiki${RST}\n`);
592
- }
593
590
  /* ── Reddit result screen ──────────────────────────────────────── */
594
591
  function printRedditResult(agent, loginResult, mcpChanged, toolCount) {
595
592
  process.stdout.write("\x1b[2J\x1b[H");
596
- printRedditBanner();
593
+ renderHeader("reddit");
597
594
  printBadge();
598
595
  w("");
599
596
  stepDone(`Agent \u2192 ${WHITE_BOLD}${agent}${RST}`);
@@ -630,12 +627,12 @@ export async function runRedditSetup() {
630
627
  const interactive = process.stdin.isTTY && !skipTui;
631
628
  let agent = "Claude Code";
632
629
  if (interactive) {
633
- agent = await runAgentSelect();
630
+ agent = await runAgentSelect("reddit");
634
631
  }
635
632
  const mcpChanged = configureMcp();
636
633
  let tools;
637
634
  if (interactive) {
638
- tools = await runToolSelect(agent, mcpChanged);
635
+ tools = await runToolSelect(agent, mcpChanged, "reddit");
639
636
  }
640
637
  else {
641
638
  tools = TOOL_GROUPS.flatMap((g) => g.tools);
@@ -646,7 +643,7 @@ export async function runRedditSetup() {
646
643
  // Login step
647
644
  let loginResult;
648
645
  if (interactive) {
649
- loginResult = await runLoginStep(agent, mcpChanged, count);
646
+ loginResult = await runLoginStep(agent, mcpChanged, count, "reddit");
650
647
  }
651
648
  else {
652
649
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openalmanac",
3
- "version": "0.2.43",
3
+ "version": "0.2.45",
4
4
  "description": "OpenAlmanac — pull, edit, and push articles to the open knowledge base",
5
5
  "type": "module",
6
6
  "bin": {