openalmanac 0.2.47 → 0.2.48
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.js +30 -24
- package/package.json +1 -1
package/dist/setup.js
CHANGED
|
@@ -102,17 +102,12 @@ 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() {
|
|
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${
|
|
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");
|
|
110
|
+
process.stdout.write(`\n${DIM} Write and publish articles with your AI agent${RST}\n`);
|
|
116
111
|
}
|
|
117
112
|
function printBadge() {
|
|
118
113
|
process.stdout.write(`\n ${ACCENT_BG} almanac ${RST}\n`);
|
|
@@ -202,9 +197,9 @@ function configurePermissions(tools) {
|
|
|
202
197
|
return tools.length;
|
|
203
198
|
}
|
|
204
199
|
/* ── Agent selection screen ─────────────────────────────────────── */
|
|
205
|
-
function renderAgentSelect(_cursor
|
|
200
|
+
function renderAgentSelect(_cursor) {
|
|
206
201
|
process.stdout.write("\x1b[2J\x1b[H");
|
|
207
|
-
|
|
202
|
+
printBanner();
|
|
208
203
|
printBadge();
|
|
209
204
|
w("");
|
|
210
205
|
stepActive(`Select your agent`);
|
|
@@ -221,9 +216,9 @@ function renderAgentSelect(_cursor, mode = "default") {
|
|
|
221
216
|
w(` ${DIM}\u2502${RST} ${BLUE}${BOLD}[enter]${RST} confirm ${DIM}[q] quit${RST}`);
|
|
222
217
|
w("");
|
|
223
218
|
}
|
|
224
|
-
function runAgentSelect(
|
|
219
|
+
function runAgentSelect() {
|
|
225
220
|
return new Promise((resolve) => {
|
|
226
|
-
renderAgentSelect(0
|
|
221
|
+
renderAgentSelect(0);
|
|
227
222
|
process.stdin.setRawMode(true);
|
|
228
223
|
process.stdin.resume();
|
|
229
224
|
process.stdin.setEncoding("utf-8");
|
|
@@ -277,7 +272,7 @@ function waitForKey(prompt) {
|
|
|
277
272
|
process.stdin.on("data", onData);
|
|
278
273
|
});
|
|
279
274
|
}
|
|
280
|
-
async function runLoginStep(agent, mcpChanged, toolCount
|
|
275
|
+
async function runLoginStep(agent, mcpChanged, toolCount) {
|
|
281
276
|
const priorSteps = () => {
|
|
282
277
|
stepDone(`Agent \u2192 ${WHITE_BOLD}${agent}${RST}`);
|
|
283
278
|
w(BAR);
|
|
@@ -288,7 +283,7 @@ async function runLoginStep(agent, mcpChanged, toolCount, mode = "default") {
|
|
|
288
283
|
};
|
|
289
284
|
function renderLoginChoice(name, cursor) {
|
|
290
285
|
process.stdout.write("\x1b[2J\x1b[H");
|
|
291
|
-
|
|
286
|
+
printBanner();
|
|
292
287
|
printBadge();
|
|
293
288
|
w("");
|
|
294
289
|
priorSteps();
|
|
@@ -352,7 +347,7 @@ async function runLoginStep(agent, mcpChanged, toolCount, mode = "default") {
|
|
|
352
347
|
}
|
|
353
348
|
// Show prompt before opening browser
|
|
354
349
|
process.stdout.write("\x1b[2J\x1b[H");
|
|
355
|
-
|
|
350
|
+
printBanner();
|
|
356
351
|
printBadge();
|
|
357
352
|
w("");
|
|
358
353
|
priorSteps();
|
|
@@ -365,7 +360,7 @@ async function runLoginStep(agent, mcpChanged, toolCount, mode = "default") {
|
|
|
365
360
|
// Show waiting state with cancel/retry hint
|
|
366
361
|
const renderWaiting = () => {
|
|
367
362
|
process.stdout.write("\x1b[2J\x1b[H");
|
|
368
|
-
|
|
363
|
+
printBanner();
|
|
369
364
|
printBadge();
|
|
370
365
|
w("");
|
|
371
366
|
priorSteps();
|
|
@@ -428,9 +423,9 @@ async function runLoginStep(agent, mcpChanged, toolCount, mode = "default") {
|
|
|
428
423
|
}
|
|
429
424
|
/* ── Tool permissions TUI ───────────────────────────────────────── */
|
|
430
425
|
const MAX_NAME = Math.max(...TOOL_GROUPS.map((g) => g.name.length));
|
|
431
|
-
function renderToolSelect(selected, cursor, agent, mcpChanged
|
|
426
|
+
function renderToolSelect(selected, cursor, agent, mcpChanged) {
|
|
432
427
|
process.stdout.write("\x1b[2J\x1b[H");
|
|
433
|
-
|
|
428
|
+
printBanner();
|
|
434
429
|
printBadge();
|
|
435
430
|
w("");
|
|
436
431
|
stepDone(`Agent \u2192 ${WHITE_BOLD}${agent}${RST}`);
|
|
@@ -451,11 +446,11 @@ function renderToolSelect(selected, cursor, agent, mcpChanged, mode = "default")
|
|
|
451
446
|
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}`);
|
|
452
447
|
w("");
|
|
453
448
|
}
|
|
454
|
-
function runToolSelect(agent, mcpChanged
|
|
449
|
+
function runToolSelect(agent, mcpChanged) {
|
|
455
450
|
return new Promise((resolve) => {
|
|
456
451
|
const selected = TOOL_GROUPS.map(() => true);
|
|
457
452
|
let cursor = 0;
|
|
458
|
-
renderToolSelect(selected, cursor, agent, mcpChanged
|
|
453
|
+
renderToolSelect(selected, cursor, agent, mcpChanged);
|
|
459
454
|
process.stdin.setRawMode(true);
|
|
460
455
|
process.stdin.resume();
|
|
461
456
|
process.stdin.setEncoding("utf-8");
|
|
@@ -491,7 +486,7 @@ function runToolSelect(agent, mcpChanged, mode = "default") {
|
|
|
491
486
|
resolve(tools);
|
|
492
487
|
return;
|
|
493
488
|
}
|
|
494
|
-
renderToolSelect(selected, cursor, agent, mcpChanged
|
|
489
|
+
renderToolSelect(selected, cursor, agent, mcpChanged);
|
|
495
490
|
};
|
|
496
491
|
process.stdin.on("data", onData);
|
|
497
492
|
});
|
|
@@ -587,10 +582,18 @@ function installSkill(skillName) {
|
|
|
587
582
|
const REDDIT_EXTRA_TOOLS = [
|
|
588
583
|
"Bash(node */ingest.js *)",
|
|
589
584
|
];
|
|
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 wiki${RST}\n`);
|
|
592
|
+
}
|
|
590
593
|
/* ── Reddit result screen ──────────────────────────────────────── */
|
|
591
594
|
function printRedditResult(agent, loginResult, mcpChanged, toolCount) {
|
|
592
595
|
process.stdout.write("\x1b[2J\x1b[H");
|
|
593
|
-
|
|
596
|
+
printRedditBanner();
|
|
594
597
|
printBadge();
|
|
595
598
|
w("");
|
|
596
599
|
stepDone(`Agent \u2192 ${WHITE_BOLD}${agent}${RST}`);
|
|
@@ -617,6 +620,9 @@ function printRedditResult(agent, loginResult, mcpChanged, toolCount) {
|
|
|
617
620
|
w(row(` ${WHITE_BOLD}Next steps${RST}`));
|
|
618
621
|
w(empty);
|
|
619
622
|
w(row(` ${BLUE}1.${RST} Type ${WHITE_BOLD}claude${RST} to start Claude Code`));
|
|
623
|
+
w(row(` ${BLUE}2.${RST} Run ${BLUE}/reddit-wiki r/<subreddit>${RST}`));
|
|
624
|
+
w(empty);
|
|
625
|
+
w(row(` ${DIM}Ask "how does reddit wiki work?" to learn more${RST}`));
|
|
620
626
|
w(empty);
|
|
621
627
|
w(` ${BLUE_DIM}\u2570${"─".repeat(innerW)}\u256f${RST}`);
|
|
622
628
|
w("");
|
|
@@ -627,12 +633,12 @@ export async function runRedditSetup() {
|
|
|
627
633
|
const interactive = process.stdin.isTTY && !skipTui;
|
|
628
634
|
let agent = "Claude Code";
|
|
629
635
|
if (interactive) {
|
|
630
|
-
agent = await runAgentSelect(
|
|
636
|
+
agent = await runAgentSelect();
|
|
631
637
|
}
|
|
632
638
|
const mcpChanged = configureMcp();
|
|
633
639
|
let tools;
|
|
634
640
|
if (interactive) {
|
|
635
|
-
tools = await runToolSelect(agent, mcpChanged
|
|
641
|
+
tools = await runToolSelect(agent, mcpChanged);
|
|
636
642
|
}
|
|
637
643
|
else {
|
|
638
644
|
tools = TOOL_GROUPS.flatMap((g) => g.tools);
|
|
@@ -643,7 +649,7 @@ export async function runRedditSetup() {
|
|
|
643
649
|
// Login step
|
|
644
650
|
let loginResult;
|
|
645
651
|
if (interactive) {
|
|
646
|
-
loginResult = await runLoginStep(agent, mcpChanged, count
|
|
652
|
+
loginResult = await runLoginStep(agent, mcpChanged, count);
|
|
647
653
|
}
|
|
648
654
|
else {
|
|
649
655
|
try {
|