speclore 0.1.7 → 0.1.9

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.
@@ -148,7 +148,7 @@ var init_cost_tracker = __esm({
148
148
  totalTokens: promptTokens + completionTokens,
149
149
  estimatedCostUsd: cost
150
150
  });
151
- logger.debug(`AI usage: ${model} \u2014 ${promptTokens}+${completionTokens} tokens, ~$${cost.toFixed(4)}`);
151
+ logger.debug(`AI usage: ${model} - ${promptTokens}+${completionTokens} tokens, ~$${cost.toFixed(4)}`);
152
152
  return cost;
153
153
  }
154
154
  /**
@@ -818,7 +818,7 @@ function acquireLock(specLoreDir) {
818
818
  try {
819
819
  writeFileSync(lockPath, JSON.stringify(lockInfo), { flag: "wx", encoding: "utf-8" });
820
820
  } catch {
821
- logger.debug("Lock write failed \u2014 another process may have acquired it");
821
+ logger.debug("Lock write failed - another process may have acquired it");
822
822
  return false;
823
823
  }
824
824
  logger.debug(`Lock acquired by PID ${process.pid}`);
@@ -1031,8 +1031,7 @@ var PdfReader = class {
1031
1031
  const uint8 = new Uint8Array(buffer);
1032
1032
  const doc = await pdfjsLib.getDocument({
1033
1033
  data: uint8,
1034
- useWorkerFetch: false,
1035
- isEvalSupported: false
1034
+ useWorkerFetch: false
1036
1035
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
1037
1036
  }).promise;
1038
1037
  const textParts = [];
@@ -1042,7 +1041,6 @@ var PdfReader = class {
1042
1041
  const pageText = textContent.items.map((item) => item.str).join("");
1043
1042
  if (pageText) textParts.push(pageText);
1044
1043
  }
1045
- doc.destroy();
1046
1044
  const text = textParts.join("\n");
1047
1045
  return [{
1048
1046
  id: source.replace(/\\/g, "/").replace(/\.pdf$/i, ""),
@@ -1745,8 +1743,7 @@ async function extractPdfText(dataBuffer) {
1745
1743
  const uint8 = new Uint8Array(dataBuffer);
1746
1744
  const doc = await pdfjsLib.getDocument({
1747
1745
  data: uint8,
1748
- useWorkerFetch: false,
1749
- isEvalSupported: false
1746
+ useWorkerFetch: false
1750
1747
  }).promise;
1751
1748
  const textParts = [];
1752
1749
  for (let i = 1; i <= doc.numPages; i++) {
@@ -1755,7 +1752,6 @@ async function extractPdfText(dataBuffer) {
1755
1752
  const pageText = textContent.items.map((item) => item.str).join("");
1756
1753
  if (pageText) textParts.push(pageText);
1757
1754
  }
1758
- doc.destroy();
1759
1755
  return textParts.join("\n");
1760
1756
  }
1761
1757
  async function parsePdfBuffer(dataBuffer, idHint = "document") {
@@ -2522,7 +2518,7 @@ init_logger();
2522
2518
  function readModuleConfig(config) {
2523
2519
  const boundaries = [];
2524
2520
  for (const [name, mod] of Object.entries(config.project.modules)) {
2525
- logger.debug(`Reading module config: ${name} \u2192 ${mod.path}`);
2521
+ logger.debug(`Reading module config: ${name} -> ${mod.path}`);
2526
2522
  boundaries.push({
2527
2523
  name,
2528
2524
  responsibility: mod.responsibility,
@@ -2583,7 +2579,7 @@ async function generateConstraints(projectRoot2, features, _context, config) {
2583
2579
  try {
2584
2580
  await writer.write(content);
2585
2581
  writtenFiles.push(writer.configFile);
2586
- logger.info(`Constraint written via plugin: ${writer.toolName} \u2192 ${writer.configFile}`);
2582
+ logger.info(`Constraint written via plugin: ${writer.toolName} -> ${writer.configFile}`);
2587
2583
  } catch (err) {
2588
2584
  logger.warn(`Writer plugin '${tool}' failed: ${err instanceof Error ? err.message : String(err)}`);
2589
2585
  }
@@ -2635,7 +2631,7 @@ function resolveFromMappingFile(projectRoot2, _feature, scenario) {
2635
2631
  if (mapping.scenarios && scenario.name in mapping.scenarios) {
2636
2632
  const entry = mapping.scenarios[scenario.name];
2637
2633
  if (entry) {
2638
- logger.debug(`Mapping file hit: ${scenario.name} \u2192 ${entry.testMethod}`);
2634
+ logger.debug(`Mapping file hit: ${scenario.name} -> ${entry.testMethod}`);
2639
2635
  return {
2640
2636
  name: scenario.name,
2641
2637
  status: "passed",
@@ -2666,7 +2662,7 @@ function resolveFromTag(projectRoot2, _feature, scenario) {
2666
2662
  while ((match = tagRegex.exec(content)) !== null) {
2667
2663
  if (match[1].trim() === scenario.name) {
2668
2664
  const methodMatch = findTestMethodNearby(content, match.index);
2669
- logger.debug(`Tag hit: ${scenario.name} \u2192 ${methodMatch}`);
2665
+ logger.debug(`Tag hit: ${scenario.name} -> ${methodMatch}`);
2670
2666
  return {
2671
2667
  name: scenario.name,
2672
2668
  status: "passed",
@@ -4465,10 +4461,10 @@ async function startMcpServer() {
4465
4461
  mkdirSync12(specLoreDir, { recursive: true });
4466
4462
  const locked = acquireLock(specLoreDir);
4467
4463
  if (!locked) {
4468
- logger.warn("Could not acquire lock \u2014 another SpecLore instance may be running.");
4464
+ logger.warn("Could not acquire lock - another SpecLore instance may be running.");
4469
4465
  }
4470
4466
  } catch {
4471
- logger.warn("Could not acquire lock \u2014 .speclore/ directory may not exist.");
4467
+ logger.warn("Could not acquire lock - .speclore/ directory may not exist.");
4472
4468
  }
4473
4469
  const transport = new StdioServerTransport();
4474
4470
  await server.connect(transport);