@voidwire/lore 1.1.0 → 1.1.1

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.
@@ -51,12 +51,13 @@ Include both singular and plural forms.
51
51
  Keep under 80 words. Output only the description, no headers or formatting.`,
52
52
  };
53
53
 
54
- const ENRICH_TIMEOUT_MS = 10_000;
54
+ const ENRICH_TIMEOUT_MS = 30_000;
55
+ const ENRICH_MAX_FAILURES = 3;
55
56
 
56
- let enrichmentDisabled = false;
57
+ let enrichmentFailures = 0;
57
58
 
58
59
  async function enrich(type: string, input: string): Promise<string | null> {
59
- if (enrichmentDisabled) return null;
60
+ if (enrichmentFailures >= ENRICH_MAX_FAILURES) return null;
60
61
  const systemPrompt = ENRICH_PROMPTS[type];
61
62
  if (!systemPrompt) return null;
62
63
  try {
@@ -74,16 +75,24 @@ async function enrich(type: string, input: string): Promise<string | null> {
74
75
  ),
75
76
  ),
76
77
  ]);
78
+ enrichmentFailures = 0;
77
79
  return result.text.replace(/<\|[^|]+\|>/g, "").trim();
78
80
  } catch (e) {
79
- console.warn(`Enrichment failed, disabling for remaining entries: ${e}`);
80
- enrichmentDisabled = true;
81
+ enrichmentFailures++;
82
+ console.warn(
83
+ `Enrichment failed (${enrichmentFailures}/${ENRICH_MAX_FAILURES}): ${e}`,
84
+ );
85
+ if (enrichmentFailures >= ENRICH_MAX_FAILURES) {
86
+ console.warn(
87
+ "Max enrichment failures reached, disabling for remaining entries",
88
+ );
89
+ }
81
90
  return null;
82
91
  }
83
92
  }
84
93
 
85
94
  export async function indexPersonal(ctx: IndexerContext): Promise<void> {
86
- enrichmentDisabled = false;
95
+ enrichmentFailures = 0;
87
96
  const personalDir = ctx.config.paths.personal;
88
97
 
89
98
  if (!checkPath("personal", "paths.personal", personalDir)) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidwire/lore",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Unified knowledge CLI - Search, list, and capture your indexed knowledge",
5
5
  "type": "module",
6
6
  "main": "./index.ts",