ray-finance 0.1.1 → 0.1.3

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/cli/chat.js CHANGED
@@ -144,10 +144,17 @@ export async function startChat() {
144
144
  if (ageMs < 6 * 60 * 60 * 1000) { // linked within last 6 hours
145
145
  const { runDailySync } = await import("../daily-sync.js");
146
146
  bgSyncTimer = setInterval(async () => {
147
+ // Silence all output during background sync
148
+ const origWrite = process.stdout.write;
149
+ const origErr = process.stderr.write;
150
+ process.stdout.write = () => true;
151
+ process.stderr.write = () => true;
147
152
  try {
148
153
  await runDailySync(db);
149
154
  }
150
155
  catch { }
156
+ process.stdout.write = origWrite;
157
+ process.stderr.write = origErr;
151
158
  }, 15 * 60 * 1000); // every 15 minutes
152
159
  bgSyncTimer.unref(); // don't prevent process exit
153
160
  }
@@ -205,8 +212,14 @@ export async function startChat() {
205
212
  console.log(rule);
206
213
  const input = await rawReadLine(chalk.dim("❯ "), [rule, footerText]);
207
214
  const trimmed = input.trim();
208
- if (!trimmed)
215
+ if (!trimmed) {
216
+ // Clear the prompt frame (top rule + prompt + bottom rule + footer)
217
+ process.stdout.write("\x1b[3A\r");
218
+ for (let i = 0; i < 4; i++)
219
+ process.stdout.write("\x1b[2K\x1b[1B");
220
+ process.stdout.write("\x1b[4A\r");
209
221
  continue;
222
+ }
210
223
  // Replace prompt frame with gray-background user message
211
224
  // Move up 4 lines (footer, bottom rule, prompt, top rule) and clear them
212
225
  process.stdout.write("\x1b[4A\r");
package/dist/cli/setup.js CHANGED
@@ -6,11 +6,17 @@ import { heading, dim } from "./format.js";
6
6
  function stepHeader(current, total) {
7
7
  return chalk.dim(`Step ${current}/${total}`);
8
8
  }
9
+ const theme = {
10
+ style: {
11
+ answer: (text) => chalk.yellowBright(text),
12
+ highlight: (text) => chalk.yellowBright(text),
13
+ },
14
+ };
9
15
  export async function runSetup() {
10
16
  const inquirer = (await import("inquirer")).default;
11
17
  console.log(`\n${heading("Ray Finance Setup")}\n`);
12
18
  if (isConfigured()) {
13
- const { proceed } = await inquirer.prompt([{
19
+ const { proceed } = await inquirer.prompt([{ theme,
14
20
  type: "confirm",
15
21
  name: "proceed",
16
22
  message: "Ray is already configured. Reconfigure?",
@@ -19,7 +25,7 @@ export async function runSetup() {
19
25
  if (!proceed)
20
26
  return;
21
27
  }
22
- const { setupMode } = await inquirer.prompt([{
28
+ const { setupMode } = await inquirer.prompt([{ theme,
23
29
  type: "list",
24
30
  name: "setupMode",
25
31
  message: "How would you like to set up Ray?",
@@ -31,14 +37,14 @@ export async function runSetup() {
31
37
  let canLink = false;
32
38
  if (setupMode === "managed") {
33
39
  console.log(stepHeader(1, 3));
34
- const { userName } = await inquirer.prompt([{
40
+ const { userName } = await inquirer.prompt([{ theme,
35
41
  type: "input",
36
42
  name: "userName",
37
43
  message: "Your name:",
38
44
  default: config.userName !== "User" ? config.userName : undefined,
39
45
  }]);
40
46
  console.log(stepHeader(2, 3));
41
- const { hasKey } = await inquirer.prompt([{
47
+ const { hasKey } = await inquirer.prompt([{ theme,
42
48
  type: "list",
43
49
  name: "hasKey",
44
50
  message: "Do you have a Ray API key?",
@@ -71,7 +77,7 @@ export async function runSetup() {
71
77
  }
72
78
  console.log(dim(" Complete checkout, then paste your key below.\n"));
73
79
  }
74
- const { rayApiKey } = await inquirer.prompt([{
80
+ const { rayApiKey } = await inquirer.prompt([{ theme,
75
81
  type: "password",
76
82
  name: "rayApiKey",
77
83
  message: "Ray API key:",
@@ -96,12 +102,14 @@ export async function runSetup() {
96
102
  console.log(stepHeader(1, 4));
97
103
  const answers = await inquirer.prompt([
98
104
  {
105
+ theme,
99
106
  type: "input",
100
107
  name: "userName",
101
108
  message: "Your name:",
102
109
  default: config.userName !== "User" ? config.userName : undefined,
103
110
  },
104
111
  {
112
+ theme,
105
113
  type: "password",
106
114
  name: "anthropicKey",
107
115
  message: "Anthropic API key:",
@@ -109,6 +117,7 @@ export async function runSetup() {
109
117
  validate: (v) => v.length > 0 || "Required",
110
118
  },
111
119
  {
120
+ theme,
112
121
  type: "list",
113
122
  name: "model",
114
123
  message: "AI model:",
@@ -120,18 +129,21 @@ export async function runSetup() {
120
129
  default: config.model,
121
130
  },
122
131
  {
132
+ theme,
123
133
  type: "password",
124
134
  name: "plaidClientId",
125
135
  message: "Plaid production client ID (enter to skip):",
126
136
  default: config.plaidClientId || undefined,
127
137
  },
128
138
  {
139
+ theme,
129
140
  type: "password",
130
141
  name: "plaidSecret",
131
142
  message: "Plaid production secret (enter to skip):",
132
143
  default: config.plaidSecret || undefined,
133
144
  },
134
145
  {
146
+ theme,
135
147
  type: "password",
136
148
  name: "dbEncryptionKey",
137
149
  message: "Database encryption key (enter to skip):",
@@ -168,7 +180,7 @@ export async function runSetup() {
168
180
  // Ask to link first account
169
181
  if (canLink) {
170
182
  console.log(stepHeader(setupMode === "managed" ? 3 : 4, setupMode === "managed" ? 3 : 4));
171
- const { wantLink } = await inquirer.prompt([{
183
+ const { wantLink } = await inquirer.prompt([{ theme,
172
184
  type: "confirm",
173
185
  name: "wantLink",
174
186
  message: "Link your first bank account now?",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ray-finance",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Local-first CLI that turns your bank data into a personal AI financial advisor",
5
5
  "type": "module",
6
6
  "license": "MIT",