@lucern/graph-primitives 0.1.0-alpha.3 → 0.3.0-alpha.0

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.
Files changed (38) hide show
  1. package/dist/beliefDecay.js +199 -18
  2. package/dist/beliefDecay.js.map +1 -1
  3. package/dist/beliefEvidenceLinks.js.map +1 -1
  4. package/dist/confidencePropagationDispatch.js.map +1 -1
  5. package/dist/contradictions.js.map +1 -1
  6. package/dist/entityBridge.js.map +1 -1
  7. package/dist/entityLifecycle.js.map +1 -1
  8. package/dist/epistemicAnswers.js +21 -36
  9. package/dist/epistemicAnswers.js.map +1 -1
  10. package/dist/epistemicBeliefs.js +92 -651
  11. package/dist/epistemicBeliefs.js.map +1 -1
  12. package/dist/epistemicContracts.js +65 -624
  13. package/dist/epistemicContracts.js.map +1 -1
  14. package/dist/epistemicEdges.js.map +1 -1
  15. package/dist/epistemicEvidence.js +71 -630
  16. package/dist/epistemicEvidence.js.map +1 -1
  17. package/dist/epistemicHelpers.js +3 -2
  18. package/dist/epistemicHelpers.js.map +1 -1
  19. package/dist/epistemicLinking.js.map +1 -1
  20. package/dist/epistemicNodes.js +49 -585
  21. package/dist/epistemicNodes.js.map +1 -1
  22. package/dist/epistemicQuestions.js +46 -590
  23. package/dist/epistemicQuestions.js.map +1 -1
  24. package/dist/epistemicSources.js +29 -565
  25. package/dist/epistemicSources.js.map +1 -1
  26. package/dist/evaluators/index.js +65 -624
  27. package/dist/evaluators/index.js.map +1 -1
  28. package/dist/index.js +304 -905
  29. package/dist/index.js.map +1 -1
  30. package/dist/ontologyApproval.js.map +1 -1
  31. package/dist/ontologyDefinitions.js.map +1 -1
  32. package/dist/ontologyRegistry.js.map +1 -1
  33. package/dist/projectionReconciliation.js.map +1 -1
  34. package/dist/questionEvidenceLinks.js +188 -2
  35. package/dist/questionEvidenceLinks.js.map +1 -1
  36. package/dist/workspaceIsolation.js +30 -581
  37. package/dist/workspaceIsolation.js.map +1 -1
  38. package/package.json +5 -6
@@ -1461,12 +1461,12 @@ var getByQuestion = query({
1461
1461
  return [];
1462
1462
  }
1463
1463
  const topicId = questionNode.topicId;
1464
- const answers = topicId ? await ctx.db.query("epistemicNodes").withIndex(
1464
+ if (!topicId) {
1465
+ return [];
1466
+ }
1467
+ const answers = await ctx.db.query("epistemicNodes").withIndex(
1465
1468
  "by_topic_type",
1466
1469
  (q) => q.eq("topicId", topicId).eq("nodeType", "answer")
1467
- ).collect() : await ctx.db.query("epistemicNodes").withIndex(
1468
- "by_project_type",
1469
- (q) => q.eq("projectId", questionNode.projectId).eq("nodeType", "answer")
1470
1470
  ).collect();
1471
1471
  const questionIdStr = String(args.questionNodeId);
1472
1472
  const filtered = answers.filter((a) => {
@@ -1494,18 +1494,13 @@ var getLatestForQuestion = query({
1494
1494
  if (!questionNode || questionNode.nodeType !== "question") {
1495
1495
  return null;
1496
1496
  }
1497
- let answers;
1498
- if (questionNode.topicId) {
1499
- answers = await ctx.db.query("epistemicNodes").withIndex(
1500
- "by_topic_type",
1501
- (q) => q.eq("topicId", questionNode.topicId).eq("nodeType", "answer")
1502
- ).filter((q) => q.eq(q.field("status"), "active")).collect();
1503
- } else {
1504
- answers = await ctx.db.query("epistemicNodes").withIndex(
1505
- "by_project_type",
1506
- (q) => q.eq("projectId", questionNode.projectId).eq("nodeType", "answer")
1507
- ).filter((q) => q.eq(q.field("status"), "active")).collect();
1497
+ if (!questionNode.topicId) {
1498
+ return null;
1508
1499
  }
1500
+ const answers = await ctx.db.query("epistemicNodes").withIndex(
1501
+ "by_topic_type",
1502
+ (q) => q.eq("topicId", questionNode.topicId).eq("nodeType", "answer")
1503
+ ).filter((q) => q.eq(q.field("status"), "active")).collect();
1509
1504
  const questionIdStr = String(args.questionNodeId);
1510
1505
  const latest = answers.find((a) => {
1511
1506
  const meta = a.metadata || {};
@@ -1524,28 +1519,18 @@ var getVersionHistory = query({
1524
1519
  if (!questionNode || questionNode.nodeType !== "question") {
1525
1520
  return [];
1526
1521
  }
1527
- let answers;
1528
- if (questionNode.topicId) {
1529
- answers = await ctx.db.query("epistemicNodes").withIndex(
1530
- "by_topic_type",
1531
- (q) => q.eq("topicId", questionNode.topicId).eq("nodeType", "answer")
1532
- ).filter(
1533
- (q) => q.or(
1534
- q.eq(q.field("status"), "active"),
1535
- q.eq(q.field("status"), "superseded")
1536
- )
1537
- ).collect();
1538
- } else {
1539
- answers = await ctx.db.query("epistemicNodes").withIndex(
1540
- "by_project_type",
1541
- (q) => q.eq("projectId", questionNode.projectId).eq("nodeType", "answer")
1542
- ).filter(
1543
- (q) => q.or(
1544
- q.eq(q.field("status"), "active"),
1545
- q.eq(q.field("status"), "superseded")
1546
- )
1547
- ).collect();
1522
+ if (!questionNode.topicId) {
1523
+ return [];
1548
1524
  }
1525
+ const answers = await ctx.db.query("epistemicNodes").withIndex(
1526
+ "by_topic_type",
1527
+ (q) => q.eq("topicId", questionNode.topicId).eq("nodeType", "answer")
1528
+ ).filter(
1529
+ (q) => q.or(
1530
+ q.eq(q.field("status"), "active"),
1531
+ q.eq(q.field("status"), "superseded")
1532
+ )
1533
+ ).collect();
1549
1534
  const questionIdStr = String(args.questionNodeId);
1550
1535
  const history = answers.filter((a) => {
1551
1536
  const meta = a.metadata || {};