@lucern/contracts 1.0.19 → 1.0.20

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 (62) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/function-registry/beliefs.js +13 -20
  3. package/dist/function-registry/beliefs.js.map +1 -1
  4. package/dist/function-registry/coding.js +8 -9
  5. package/dist/function-registry/coding.js.map +1 -1
  6. package/dist/function-registry/context.js +8 -9
  7. package/dist/function-registry/context.js.map +1 -1
  8. package/dist/function-registry/contracts.js +8 -9
  9. package/dist/function-registry/contracts.js.map +1 -1
  10. package/dist/function-registry/coordination.js +8 -9
  11. package/dist/function-registry/coordination.js.map +1 -1
  12. package/dist/function-registry/edges.js +8 -9
  13. package/dist/function-registry/edges.js.map +1 -1
  14. package/dist/function-registry/evidence.js +8 -15
  15. package/dist/function-registry/evidence.js.map +1 -1
  16. package/dist/function-registry/graph.js +8 -9
  17. package/dist/function-registry/graph.js.map +1 -1
  18. package/dist/function-registry/helpers.d.ts +2 -1
  19. package/dist/function-registry/helpers.js +9 -10
  20. package/dist/function-registry/helpers.js.map +1 -1
  21. package/dist/function-registry/identity.js +8 -9
  22. package/dist/function-registry/identity.js.map +1 -1
  23. package/dist/function-registry/index.d.ts +1 -1
  24. package/dist/function-registry/index.js +9 -10
  25. package/dist/function-registry/index.js.map +1 -1
  26. package/dist/function-registry/judgments.js +8 -9
  27. package/dist/function-registry/judgments.js.map +1 -1
  28. package/dist/function-registry/legacy.js +8 -9
  29. package/dist/function-registry/legacy.js.map +1 -1
  30. package/dist/function-registry/lenses.js +8 -9
  31. package/dist/function-registry/lenses.js.map +1 -1
  32. package/dist/function-registry/nodes.js +8 -9
  33. package/dist/function-registry/nodes.js.map +1 -1
  34. package/dist/function-registry/ontologies.js +8 -9
  35. package/dist/function-registry/ontologies.js.map +1 -1
  36. package/dist/function-registry/pipeline.js +8 -9
  37. package/dist/function-registry/pipeline.js.map +1 -1
  38. package/dist/function-registry/questions.js +8 -9
  39. package/dist/function-registry/questions.js.map +1 -1
  40. package/dist/function-registry/tasks.js +8 -9
  41. package/dist/function-registry/tasks.js.map +1 -1
  42. package/dist/function-registry/topics.js +13 -11
  43. package/dist/function-registry/topics.js.map +1 -1
  44. package/dist/function-registry/worktrees.js +8 -9
  45. package/dist/function-registry/worktrees.js.map +1 -1
  46. package/dist/index.js +1 -9
  47. package/dist/index.js.map +1 -1
  48. package/dist/proof-attestation.json +1 -1
  49. package/dist/sdk-methods.contract.d.ts +1 -3
  50. package/dist/sdk-tools.contract.js +1 -9
  51. package/dist/sdk-tools.contract.js.map +1 -1
  52. package/dist/sdk-tools.contract.registry.js +1 -9
  53. package/dist/sdk-tools.contract.registry.js.map +1 -1
  54. package/dist/sdk-tools.contract.values.js +1 -9
  55. package/dist/sdk-tools.contract.values.js.map +1 -1
  56. package/dist/tool-contracts.js +1 -9
  57. package/dist/tool-contracts.js.map +1 -1
  58. package/dist/tool-contracts.lifecycle.js +1 -9
  59. package/dist/tool-contracts.lifecycle.js.map +1 -1
  60. package/dist/tool-contracts.values.js +1 -9
  61. package/dist/tool-contracts.values.js.map +1 -1
  62. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -64,3 +64,6 @@ All notable changes to `@lucern/contracts` are tracked in this repository.
64
64
 
65
65
  ## [1.0.19] - 2026-06-04
66
66
  - Release notes pending.
67
+
68
+ ## [1.0.20] - 2026-06-05
69
+ - Release notes pending.
@@ -3,6 +3,12 @@ import { v } from 'convex/values';
3
3
 
4
4
  // src/function-registry/beliefs.ts
5
5
 
6
+ // src/ids/index.ts
7
+ var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
8
+ function isUuidV7(value) {
9
+ return UUID_PATTERN.test(value) && value[14]?.toLowerCase() === "7";
10
+ }
11
+
6
12
  // src/tool-contracts.lifecycle.ts
7
13
  var CREATE_BELIEF = {
8
14
  name: "create_belief",
@@ -14,15 +20,7 @@ var CREATE_BELIEF = {
14
20
  },
15
21
  topicGlobalId: {
16
22
  type: "string",
17
- description: "Required globalId (UUID) of the topic node in epistemicNodes that anchors the belief"
18
- },
19
- topicNodeId: {
20
- type: "string",
21
- description: "Optional internal epistemicNodes _id for the topic anchor. Prefer topicGlobalId for public callers."
22
- },
23
- topicId: {
24
- type: "string",
25
- description: "Deprecated compatibility alias for topicGlobalId. Must identify a topic epistemicNode, not a legacy topics-table row."
23
+ description: "Required UUIDv7 globalId of the topic node in epistemicNodes that anchors the belief. Legacy topics-table ids, Convex storage locators, and UUIDv4 values are refused."
26
24
  },
27
25
  baseRate: {
28
26
  type: "number",
@@ -5313,6 +5311,7 @@ z.enum(["private", "team", "firm", "external", "public"]);
5313
5311
 
5314
5312
  // src/function-registry/helpers.ts
5315
5313
  var jsonObjectSchema = z.record(z.unknown());
5314
+ var uuidV7StringSchema = z.string().refine(isUuidV7, "must be UUIDv7");
5316
5315
  var sdkSessionIdSchema = z.string().optional();
5317
5316
  function mcpContractShape(contract) {
5318
5317
  const required = new Set(contract.required);
@@ -5793,14 +5792,8 @@ var predictionMetaSchema = z.object({
5793
5792
  });
5794
5793
  var createBeliefArgs = z.object({
5795
5794
  canonicalText: z.string().describe("The belief statement the agent holds to be true."),
5796
- topicGlobalId: z.string().describe(
5797
- "Required globalId of the topic epistemicNode that anchors this belief. Belief creation creates a belongs_to edge directly to that topic node."
5798
- ),
5799
- topicNodeId: z.string().optional().describe(
5800
- "Optional internal epistemicNodes _id for the topic anchor. Prefer topicGlobalId for public callers."
5801
- ),
5802
- topicId: z.string().optional().describe(
5803
- "Deprecated compatibility alias for topicGlobalId. Must identify a topic epistemicNode, not a legacy topics-table row."
5795
+ topicGlobalId: uuidV7StringSchema.describe(
5796
+ "Required UUIDv7 globalId of the topic epistemicNode that anchors this belief. Belief creation creates a belongs_to edge directly to that topic node."
5804
5797
  ),
5805
5798
  baseRate: z.number().optional().describe("Prior base rate used to seed the vacuous opinion."),
5806
5799
  beliefStatus: beliefLifecycleStatusSchema.optional().describe(
@@ -5847,9 +5840,8 @@ var createBeliefInput = (input, context) => {
5847
5840
  return withUserId(
5848
5841
  compactRecord({
5849
5842
  projectId: input.projectId,
5850
- topicId: input.topicGlobalId ?? input.topicNodeId ?? input.topicId,
5843
+ topicId: input.topicGlobalId,
5851
5844
  topicGlobalId: input.topicGlobalId,
5852
- topicNodeId: input.topicNodeId,
5853
5845
  formulation: input.formulation ?? input.canonicalText,
5854
5846
  beliefType: input.beliefType,
5855
5847
  rationale: input.rationale,
@@ -5908,7 +5900,8 @@ var beliefsContracts = [
5908
5900
  kind: "mutation",
5909
5901
  inputProjection: createBeliefInput
5910
5902
  },
5911
- args: createBeliefArgs
5903
+ args: createBeliefArgs,
5904
+ input: createBeliefArgs
5912
5905
  }),
5913
5906
  surfaceContract({
5914
5907
  name: "get_belief",