@productbrain/mcp 0.0.1-beta.1815 → 0.0.1-beta.1818

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.
@@ -1751,6 +1751,7 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
1751
1751
  const linksCreated = [];
1752
1752
  const linksSuggested = [];
1753
1753
  const userLinkResults = [];
1754
+ const advisedLinks = [];
1754
1755
  let conflictCandidates = [];
1755
1756
  const pendingRelations = [];
1756
1757
  const skipAutoDiscovery = links && links.length > 0;
@@ -1871,6 +1872,12 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
1871
1872
  relationType: pending.type,
1872
1873
  linkReason: pending.meta.linkReason
1873
1874
  });
1875
+ } else if (result.status === "advised") {
1876
+ advisedLinks.push({
1877
+ targetName: pending.meta.targetName,
1878
+ targetCollection: pending.meta.targetCollection,
1879
+ relationType: pending.type
1880
+ });
1874
1881
  }
1875
1882
  } else {
1876
1883
  if (result.ok) {
@@ -1887,6 +1894,9 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
1887
1894
  }
1888
1895
  }
1889
1896
  }
1897
+ if (advisedLinks.length > 0) {
1898
+ entryWarnings.push(`${advisedLinks.length} auto-link(s) advised, not written (untypeable) \u2014 accept with \`relations action=create\` to promote.`);
1899
+ }
1890
1900
  const captureCtx = {
1891
1901
  collection: resolvedCollection,
1892
1902
  name,
@@ -2385,6 +2395,7 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2385
2395
  entryId: "",
2386
2396
  ok: false,
2387
2397
  autoLinks: 0,
2398
+ advisedLinks: 0,
2388
2399
  status: "draft",
2389
2400
  classifiedBy,
2390
2401
  confidence,
@@ -2400,6 +2411,7 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2400
2411
  entryId: "",
2401
2412
  ok: false,
2402
2413
  autoLinks: 0,
2414
+ advisedLinks: 0,
2403
2415
  status: "draft",
2404
2416
  classifiedBy,
2405
2417
  confidence,
@@ -2508,6 +2520,7 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2508
2520
  });
2509
2521
  }
2510
2522
  let autoLinkCount = 0;
2523
+ let advisedLinkCount = 0;
2511
2524
  let entryOverlapCount = 0;
2512
2525
  const searchQuery = extractSearchTerms(entry.name, entry.description);
2513
2526
  if (searchQuery) {
@@ -2532,6 +2545,10 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2532
2545
  sessionId: agentId ?? void 0
2533
2546
  });
2534
2547
  autoLinkCount = batchRes.created;
2548
+ advisedLinkCount = batchRes.advised ?? 0;
2549
+ if (advisedLinkCount > 0) {
2550
+ batchEntryWarnings.push(`${advisedLinkCount} auto-link(s) advised, not written (untypeable) \u2014 accept with \`relations action=create\` to promote.`);
2551
+ }
2535
2552
  }
2536
2553
  } catch {
2537
2554
  }
@@ -2581,6 +2598,7 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2581
2598
  entryId: finalEntryId,
2582
2599
  ok: true,
2583
2600
  autoLinks: autoLinkCount,
2601
+ advisedLinks: advisedLinkCount,
2584
2602
  status: finalStatus,
2585
2603
  classifiedBy,
2586
2604
  confidence,
@@ -2605,6 +2623,7 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2605
2623
  entryId: "",
2606
2624
  ok: false,
2607
2625
  autoLinks: 0,
2626
+ advisedLinks: 0,
2608
2627
  status: "draft",
2609
2628
  classifiedBy,
2610
2629
  confidence,
@@ -2626,6 +2645,7 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2626
2645
  logger: "product-brain"
2627
2646
  });
2628
2647
  const totalAutoLinks = created.reduce((sum, r) => sum + r.autoLinks, 0);
2648
+ const totalAdvisedLinks = created.reduce((sum, r) => sum + r.advisedLinks, 0);
2629
2649
  const byCollection = /* @__PURE__ */ new Map();
2630
2650
  for (const r of created) {
2631
2651
  byCollection.set(r.collection, (byCollection.get(r.collection) ?? 0) + 1);
@@ -2633,7 +2653,7 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2633
2653
  const lines = [
2634
2654
  `# Batch Capture Complete`,
2635
2655
  `**${created.length}** created, **${failed.length}** failed, **${skippedLowConfidence.length}** skipped out of ${entries.length} total.`,
2636
- `**Auto-links created:** ${totalAutoLinks}`,
2656
+ `**Auto-links created:** ${totalAutoLinks}${totalAdvisedLinks > 0 ? `, ${totalAdvisedLinks} advised` : ""}`,
2637
2657
  ""
2638
2658
  ];
2639
2659
  if (classifiedCount > 0) {
@@ -7133,6 +7153,7 @@ async function runWrapupCommitAll(data, cachedSuggestions) {
7133
7153
  const results = [];
7134
7154
  let linksCreated = 0;
7135
7155
  let linksFailed = 0;
7156
+ let linksAdvised = 0;
7136
7157
  const linkFailureDetails = [];
7137
7158
  let proposalsCreated = 0;
7138
7159
  const allDrafts = [...data.drafts, ...data.overflowDrafts ?? []];
@@ -7197,9 +7218,10 @@ async function runWrapupCommitAll(data, cachedSuggestions) {
7197
7218
  sessionId
7198
7219
  });
7199
7220
  linksCreated += batchResult?.created ?? 0;
7221
+ linksAdvised += batchResult?.advised ?? 0;
7200
7222
  if (batchResult && batchResult.failed > 0) {
7201
7223
  linksFailed += batchResult.failed;
7202
- const failedResults = batchResult.results.map((r, i) => ({ ...r, index: i })).filter((r) => !r.ok);
7224
+ const failedResults = batchResult.results.map((r, i) => ({ ...r, index: i })).filter((r) => !r.ok && r.status !== "advised");
7203
7225
  for (const fr of failedResults) {
7204
7226
  const rel = batchRels[fr.index];
7205
7227
  if (rel) {
@@ -7226,7 +7248,10 @@ async function runWrapupCommitAll(data, cachedSuggestions) {
7226
7248
  ...s.confidence !== void 0 ? { confidence: s.confidence } : {},
7227
7249
  sessionId
7228
7250
  });
7229
- if (result?.status !== "proposal_created") {
7251
+ if (result?.status === "proposal_created") {
7252
+ } else if (result?.advised) {
7253
+ linksAdvised++;
7254
+ } else {
7230
7255
  linksCreated++;
7231
7256
  }
7232
7257
  } catch (err) {
@@ -7254,6 +7279,9 @@ async function runWrapupCommitAll(data, cachedSuggestions) {
7254
7279
  if (linksFailed > 0) {
7255
7280
  lines.push(`**${linksFailed}** link${linksFailed === 1 ? "" : "s"} failed to create.`);
7256
7281
  }
7282
+ if (linksAdvised > 0) {
7283
+ lines.push(`**${linksAdvised}** auto-link(s) advised, not written (untypeable) \u2014 accept with \`relations action=create\` to promote.`);
7284
+ }
7257
7285
  if (failed.length > 0) {
7258
7286
  lines.push("");
7259
7287
  lines.push("### Failed to accept");
@@ -14711,4 +14739,4 @@ export {
14711
14739
  createProductBrainServer,
14712
14740
  initFeatureFlags
14713
14741
  };
14714
- //# sourceMappingURL=chunk-VRAAJA3M.js.map
14742
+ //# sourceMappingURL=chunk-I6LKRXFS.js.map