Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 3 additions & 39 deletions components/DreamSymbolsSeerChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
interface DreamSymbolsSeerChatInterfaceProps {
analysis: DreamAnalysis | null | undefined;
userId?: string;
userProfile?: any;

Check warning on line 25 in components/DreamSymbolsSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

Unexpected any. Specify a different type
sessionId?: string;
dreamData?: any;

Check warning on line 27 in components/DreamSymbolsSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

Unexpected any. Specify a different type
}

const SEE_MORE_THRESHOLD = 320;
Expand All @@ -40,8 +40,6 @@
const UNAVAILABLE_MESSAGE =
"The request didn't go through. Please try again in a moment.";

const RETRY_DELAY_MS = 1500;

const DREAM_SYMBOLS_STARTER_QUESTIONS = [
'What does my dream about water mean?',
'Why do I keep dreaming about the same person or place?',
Expand Down Expand Up @@ -152,16 +150,9 @@
);
};

const isRetryableStatus = (status: number) =>
status === 500 || status >= 502;

try {
let response = await performFetch();

if (!response.ok && isRetryableStatus(response.status)) {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
response = await performFetch();
}
// Do not auto-retry: enforceToolSeerGate debits before the LLM runs.
const response = await performFetch();

if (!response.ok) {
setStreamingMessageId(null);
Expand Down Expand Up @@ -206,34 +197,7 @@
} catch (err) {
devLog.error('Dream Symbols Seer error', err, 'DreamSymbolsSeerChatInterface');
setStreamingMessageId(null);
try {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
const retryResponse = await performFetch();
if (!retryResponse.ok) {
setUnavailableMessage();
return;
}
const reader = retryResponse.body?.getReader();
const decoder = new TextDecoder();
let accumulatedContent = '';
if (reader) {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
accumulatedContent += chunk;
streamingLengthRef.current = accumulatedContent.length;
setMessages((prev) =>
prev.map((msg) =>
msg.id === aiMessageId ? { ...msg, content: stripAttributionForDisplay(accumulatedContent) } : msg
)
);
}
}
setStreamingMessageId(null);
} catch {
setUnavailableMessage();
}
setUnavailableMessage();
} finally {
setIsLoading(false);
}
Expand Down Expand Up @@ -372,7 +336,7 @@
Ask me anything about your dreams…
</p>
<p className="text-sm text-amber-800 mb-3 max-w-md mx-auto">
I'll interpret symbols and themes from your dreams to reveal messages from your subconscious and current life state.

Check warning on line 339 in components/DreamSymbolsSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

`'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;`
</p>
<p className="text-amber-900 text-sm font-medium mt-3 mb-1 text-left max-w-md mx-auto">
You can ask about:
Expand Down
42 changes: 3 additions & 39 deletions components/FaceReadingSeerChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
interface FaceReadingSeerChatInterfaceProps {
analysis: FaceReadingAnalysis | null | undefined;
userId?: string;
userProfile?: any;

Check warning on line 25 in components/FaceReadingSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

Unexpected any. Specify a different type
sessionId?: string;
}

Expand All @@ -39,8 +39,6 @@
const UNAVAILABLE_MESSAGE =
"The request didn't go through. Please try again in a moment.";

const RETRY_DELAY_MS = 1500;

const FACE_READING_STARTER_QUESTIONS = [
'What does my face say about my personality?',
'What strengths or challenges does my face indicate?',
Expand Down Expand Up @@ -144,16 +142,9 @@
);
};

const isRetryableStatus = (status: number) =>
status === 500 || status >= 502;

try {
let response = await performFetch();

if (!response.ok && isRetryableStatus(response.status)) {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
response = await performFetch();
}
// Do not auto-retry: enforceToolSeerGate debits before the LLM runs.
const response = await performFetch();

if (!response.ok) {
setStreamingMessageId(null);
Expand Down Expand Up @@ -198,34 +189,7 @@
} catch (err) {
devLog.error('Face Reading Seer error', err, 'FaceReadingSeerChatInterface');
setStreamingMessageId(null);
try {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
const retryResponse = await performFetch();
if (!retryResponse.ok) {
setUnavailableMessage();
return;
}
const reader = retryResponse.body?.getReader();
const decoder = new TextDecoder();
let accumulatedContent = '';
if (reader) {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
accumulatedContent += chunk;
streamingLengthRef.current = accumulatedContent.length;
setMessages((prev) =>
prev.map((msg) =>
msg.id === aiMessageId ? { ...msg, content: stripAttributionForDisplay(accumulatedContent) } : msg
)
);
}
}
setStreamingMessageId(null);
} catch {
setUnavailableMessage();
}
setUnavailableMessage();
} finally {
setIsLoading(false);
}
Expand Down Expand Up @@ -364,7 +328,7 @@
Ask me anything about your facial features and life tendencies…
</p>
<p className="text-sm text-amber-800 mb-3 max-w-md mx-auto">
I'll interpret facial structure and features to reveal personality traits, strengths, challenges, and life patterns.

Check warning on line 331 in components/FaceReadingSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

`'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;`
</p>
<p className="text-amber-900 text-sm font-medium mt-3 mb-1 text-left max-w-md mx-auto">
You can ask about:
Expand Down
42 changes: 3 additions & 39 deletions components/FengShuiSeerChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
interface FengShuiSeerChatInterfaceProps {
analysis: FengShuiAnalysis | null | undefined;
userId?: string;
userProfile?: any;

Check warning on line 32 in components/FengShuiSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

Unexpected any. Specify a different type
sessionId?: string;
/** User-provided facing direction (e.g. North, East). Enables layout-aware advice. */
facingDirection?: string;
Expand All @@ -50,8 +50,6 @@
const UNAVAILABLE_MESSAGE =
"The request didn't go through. Please try again in a moment.";

const RETRY_DELAY_MS = 1500;

const FENGSHUI_STARTER_QUESTIONS = [
'How can I support wealth and abundance energy in my home without overdoing symbols?',
'What commonly blocks qi at the entrance, and how do I fix it?',
Expand Down Expand Up @@ -160,16 +158,9 @@
);
};

const isRetryableStatus = (status: number) =>
status === 500 || status >= 502;

try {
let response = await performFetch();

if (!response.ok && isRetryableStatus(response.status)) {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
response = await performFetch();
}
// Do not auto-retry: enforceToolSeerGate debits before the LLM runs.
const response = await performFetch();

if (!response.ok) {
setStreamingMessageId(null);
Expand Down Expand Up @@ -214,34 +205,7 @@
} catch (err) {
devLog.error('Feng Shui Seer error', err, 'FengShuiSeerChatInterface');
setStreamingMessageId(null);
try {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
const retryResponse = await performFetch();
if (!retryResponse.ok) {
setUnavailableMessage();
return;
}
const reader = retryResponse.body?.getReader();
const decoder = new TextDecoder();
let accumulatedContent = '';
if (reader) {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
accumulatedContent += chunk;
streamingLengthRef.current = accumulatedContent.length;
setMessages((prev) =>
prev.map((msg) =>
msg.id === aiMessageId ? { ...msg, content: stripAttributionForDisplay(accumulatedContent) } : msg
)
);
}
}
setStreamingMessageId(null);
} catch {
setUnavailableMessage();
}
setUnavailableMessage();
} finally {
setIsLoading(false);
}
Expand Down Expand Up @@ -382,7 +346,7 @@
Ask me anything about your space and energy flow…
</p>
<p className="text-sm text-slate-700 mb-3 max-w-md mx-auto">
I'll analyze your environment to identify imbalances and suggest adjustments that support harmony, productivity, and well-being.

Check warning on line 349 in components/FengShuiSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

`'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;`
</p>
<p className="text-slate-600 text-sm font-medium mt-3 mb-1 text-left max-w-md mx-auto">
You can ask about:
Expand Down
42 changes: 3 additions & 39 deletions components/HorarySeerChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
interface HorarySeerChatInterfaceProps {
horaryData: HoraryChartPayload | null | undefined;
userId?: string;
userProfile?: any;

Check warning on line 25 in components/HorarySeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

Unexpected any. Specify a different type
sessionId?: string;
}

Expand All @@ -39,8 +39,6 @@
const UNAVAILABLE_MESSAGE =
"The request didn't go through. Please try again in a moment.";

const RETRY_DELAY_MS = 1500;

const HORARY_STARTER_QUESTIONS = [
'Will my app launch succeed if I release it now?',
'Will this partnership work out?',
Expand Down Expand Up @@ -148,16 +146,9 @@
);
};

const isRetryableStatus = (status: number) =>
status === 500 || status >= 502;

try {
let response = await performFetch();

if (!response.ok && isRetryableStatus(response.status)) {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
response = await performFetch();
}
// Do not auto-retry: enforceToolSeerGate debits before the LLM runs.
const response = await performFetch();

if (!response.ok) {
setStreamingMessageId(null);
Expand Down Expand Up @@ -203,34 +194,7 @@
} catch (err) {
devLog.error('Horary Seer error', err, 'HorarySeerChatInterface');
setStreamingMessageId(null);
try {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
const retryResponse = await performFetch();
if (!retryResponse.ok) {
setUnavailableMessage();
return;
}
const reader = retryResponse.body?.getReader();
const decoder = new TextDecoder();
let accumulatedContent = '';
if (reader) {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
accumulatedContent += chunk;
streamingLengthRef.current = accumulatedContent.length;
setMessages((prev) =>
prev.map((msg) =>
msg.id === aiMessageId ? { ...msg, content: stripAttributionForDisplay(accumulatedContent) } : msg
)
);
}
}
setStreamingMessageId(null);
} catch {
setUnavailableMessage();
}
setUnavailableMessage();
} finally {
setIsLoading(false);
}
Expand Down
42 changes: 3 additions & 39 deletions components/KPSeerChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
interface KPSeerChatInterfaceProps {
analysis: KPAnalysis | null | undefined;
userId?: string;
userProfile?: any;

Check warning on line 25 in components/KPSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

Unexpected any. Specify a different type
sessionId?: string;
}

Expand All @@ -39,8 +39,6 @@
const UNAVAILABLE_MESSAGE =
"The request didn't go through. Please try again in a moment.";

const RETRY_DELAY_MS = 1500;

const KP_STARTER_QUESTIONS = [
'Will my app launch succeed?',
'Will I get this job offer?',
Expand Down Expand Up @@ -139,16 +137,9 @@
);
};

const isRetryableStatus = (status: number) =>
status === 500 || status >= 502;

try {
let response = await performFetch();

if (!response.ok && isRetryableStatus(response.status)) {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
response = await performFetch();
}
// Do not auto-retry: enforceToolSeerGate debits before the LLM runs.
const response = await performFetch();

if (!response.ok) {
setStreamingMessageId(null);
Expand Down Expand Up @@ -194,34 +185,7 @@
} catch (err) {
devLog.error('KP Seer error', err, 'KPSeerChatInterface');
setStreamingMessageId(null);
try {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
const retryResponse = await performFetch();
if (!retryResponse.ok) {
setUnavailableMessage();
return;
}
const reader = retryResponse.body?.getReader();
const decoder = new TextDecoder();
let accumulatedContent = '';
if (reader) {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
accumulatedContent += chunk;
streamingLengthRef.current = accumulatedContent.length;
setMessages((prev) =>
prev.map((msg) =>
msg.id === aiMessageId ? { ...msg, content: stripAttributionForDisplay(accumulatedContent) } : msg
)
);
}
}
setStreamingMessageId(null);
} catch {
setUnavailableMessage();
}
setUnavailableMessage();
} finally {
setIsLoading(false);
}
Expand Down Expand Up @@ -375,7 +339,7 @@
KP works best when you ask about a single event or decision.
</p>
<p className="text-sm text-amber-800 mb-3 max-w-md mx-auto">
Before you ask, be specific about: what exactly you want to know, and the outcome you're asking about.

Check warning on line 342 in components/KPSeerChatInterface.tsx

View workflow job for this annotation

GitHub Actions / Lint + Jest

`'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;`
</p>
<p className="text-amber-900 text-sm font-medium mt-3 mb-1 text-left max-w-md mx-auto">
You can ask about:
Expand Down
42 changes: 3 additions & 39 deletions components/RunesSeerChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ const REGENERATE_MESSAGE =
const UNAVAILABLE_MESSAGE =
"The request didn't go through. Please try again in a moment.";

const RETRY_DELAY_MS = 1500;

const RUNES_STARTER_QUESTIONS = [
'What do the runes say about my situation?',
'What energy surrounds this decision?',
Expand Down Expand Up @@ -145,16 +143,9 @@ export default function RunesSeerChatInterface({
);
};

const isRetryableStatus = (status: number) =>
status === 500 || status >= 502;

try {
let response = await performFetch();

if (!response.ok && isRetryableStatus(response.status)) {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
response = await performFetch();
}
// Do not auto-retry: enforceToolSeerGate debits before the LLM runs.
const response = await performFetch();

if (!response.ok) {
setStreamingMessageId(null);
Expand Down Expand Up @@ -199,34 +190,7 @@ export default function RunesSeerChatInterface({
} catch (err) {
devLog.error('Runes Seer error', err, 'RunesSeerChatInterface');
setStreamingMessageId(null);
try {
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
const retryResponse = await performFetch();
if (!retryResponse.ok) {
setUnavailableMessage();
return;
}
const reader = retryResponse.body?.getReader();
const decoder = new TextDecoder();
let accumulatedContent = '';
if (reader) {
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
accumulatedContent += chunk;
streamingLengthRef.current = accumulatedContent.length;
setMessages((prev) =>
prev.map((msg) =>
msg.id === aiMessageId ? { ...msg, content: stripAttributionForDisplay(accumulatedContent) } : msg
)
);
}
}
setStreamingMessageId(null);
} catch {
setUnavailableMessage();
}
setUnavailableMessage();
} finally {
setIsLoading(false);
}
Expand Down
Loading
Loading