@lucern/contracts 0.1.2-alpha.5 → 0.3.0-alpha.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.
Files changed (223) hide show
  1. package/dist/defineFunction-DO97DKs4.d.ts +14 -0
  2. package/dist/defineTable-CBQ03FXl.d.ts +36 -0
  3. package/dist/dsl-BgpoVOVQ.d.ts +110 -0
  4. package/dist/dsl.d.ts +5 -0
  5. package/dist/dsl.js +678 -0
  6. package/dist/dsl.js.map +1 -0
  7. package/dist/function-registry/beliefs.d.ts +479 -0
  8. package/dist/function-registry/beliefs.js +4677 -0
  9. package/dist/function-registry/beliefs.js.map +1 -0
  10. package/dist/function-registry/coding.d.ts +323 -0
  11. package/dist/function-registry/coding.js +4451 -0
  12. package/dist/function-registry/coding.js.map +1 -0
  13. package/dist/function-registry/context.d.ts +206 -0
  14. package/dist/function-registry/context.js +4336 -0
  15. package/dist/function-registry/context.js.map +1 -0
  16. package/dist/function-registry/contracts.d.ts +206 -0
  17. package/dist/function-registry/contracts.js +4284 -0
  18. package/dist/function-registry/contracts.js.map +1 -0
  19. package/dist/function-registry/coordination.d.ts +440 -0
  20. package/dist/function-registry/coordination.js +4405 -0
  21. package/dist/function-registry/coordination.js.map +1 -0
  22. package/dist/function-registry/edges.d.ts +167 -0
  23. package/dist/function-registry/edges.js +4425 -0
  24. package/dist/function-registry/edges.js.map +1 -0
  25. package/dist/function-registry/evidence.d.ts +401 -0
  26. package/dist/function-registry/evidence.js +4598 -0
  27. package/dist/function-registry/evidence.js.map +1 -0
  28. package/dist/function-registry/graph.d.ts +596 -0
  29. package/dist/function-registry/graph.js +4489 -0
  30. package/dist/function-registry/graph.js.map +1 -0
  31. package/dist/function-registry/helpers.d.ts +84 -0
  32. package/dist/function-registry/helpers.js +4280 -0
  33. package/dist/function-registry/helpers.js.map +1 -0
  34. package/dist/function-registry/identity.d.ts +206 -0
  35. package/dist/function-registry/identity.js +4295 -0
  36. package/dist/function-registry/identity.js.map +1 -0
  37. package/dist/function-registry/index.d.ts +32 -0
  38. package/dist/function-registry/index.js +4384 -0
  39. package/dist/function-registry/index.js.map +1 -0
  40. package/dist/function-registry/judgments.d.ts +167 -0
  41. package/dist/function-registry/judgments.js +4308 -0
  42. package/dist/function-registry/judgments.js.map +1 -0
  43. package/dist/function-registry/legacy.d.ts +128 -0
  44. package/dist/function-registry/legacy.js +4259 -0
  45. package/dist/function-registry/legacy.js.map +1 -0
  46. package/dist/function-registry/lenses.d.ts +245 -0
  47. package/dist/function-registry/lenses.js +4343 -0
  48. package/dist/function-registry/lenses.js.map +1 -0
  49. package/dist/function-registry/manifest.d.ts +36 -0
  50. package/dist/function-registry/manifest.js +367 -0
  51. package/dist/function-registry/manifest.js.map +1 -0
  52. package/dist/function-registry/ontologies.d.ts +518 -0
  53. package/dist/function-registry/ontologies.js +4442 -0
  54. package/dist/function-registry/ontologies.js.map +1 -0
  55. package/dist/function-registry/pipeline.d.ts +206 -0
  56. package/dist/function-registry/pipeline.js +4295 -0
  57. package/dist/function-registry/pipeline.js.map +1 -0
  58. package/dist/function-registry/questions.d.ts +557 -0
  59. package/dist/function-registry/questions.js +4528 -0
  60. package/dist/function-registry/questions.js.map +1 -0
  61. package/dist/function-registry/tasks.d.ts +245 -0
  62. package/dist/function-registry/tasks.js +4373 -0
  63. package/dist/function-registry/tasks.js.map +1 -0
  64. package/dist/function-registry/topics.d.ts +284 -0
  65. package/dist/function-registry/topics.js +4350 -0
  66. package/dist/function-registry/topics.js.map +1 -0
  67. package/dist/function-registry/types.d.ts +84 -0
  68. package/dist/function-registry/types.js +3 -0
  69. package/dist/function-registry/types.js.map +1 -0
  70. package/dist/function-registry/worktrees.d.ts +479 -0
  71. package/dist/function-registry/worktrees.js +4522 -0
  72. package/dist/function-registry/worktrees.js.map +1 -0
  73. package/dist/generated/convexSchemas.d.ts +20 -0
  74. package/dist/generated/convexSchemas.js +161 -0
  75. package/dist/generated/convexSchemas.js.map +1 -0
  76. package/dist/generated/schema-manifest.json +5231 -0
  77. package/dist/generated/tableOwnership.d.ts +128 -0
  78. package/dist/generated/tableOwnership.js +278 -0
  79. package/dist/generated/tableOwnership.js.map +1 -0
  80. package/dist/generated/tier-expectations.json +363 -0
  81. package/dist/idOf-DR8tkhQS.d.ts +10 -0
  82. package/dist/index-CV-0_VWJ.d.ts +25 -0
  83. package/dist/index.d.ts +421 -2
  84. package/dist/index.js +7634 -1607
  85. package/dist/index.js.map +1 -1
  86. package/dist/schema-helpers/enumValidation.d.ts +17 -0
  87. package/dist/schema-helpers/enumValidation.js +143 -0
  88. package/dist/schema-helpers/enumValidation.js.map +1 -0
  89. package/dist/schema-helpers/spine/nodes/decision.d.ts +19 -0
  90. package/dist/schema-helpers/spine/nodes/decision.js +81 -0
  91. package/dist/schema-helpers/spine/nodes/decision.js.map +1 -0
  92. package/dist/schema-helpers/spine/tables/epistemicNodes.d.ts +9 -0
  93. package/dist/schema-helpers/spine/tables/epistemicNodes.js +62 -0
  94. package/dist/schema-helpers/spine/tables/epistemicNodes.js.map +1 -0
  95. package/dist/schema-helpers/topicIds.d.ts +17 -0
  96. package/dist/schema-helpers/topicIds.js +21 -0
  97. package/dist/schema-helpers/topicIds.js.map +1 -0
  98. package/dist/schema-helpers/topicLegacyScope.d.ts +19 -0
  99. package/dist/schema-helpers/topicLegacyScope.js +44 -0
  100. package/dist/schema-helpers/topicLegacyScope.js.map +1 -0
  101. package/dist/schema-helpers/validators.d.ts +8 -0
  102. package/dist/schema-helpers/validators.js +18 -0
  103. package/dist/schema-helpers/validators.js.map +1 -0
  104. package/dist/schemas/component-table-manifest.d.ts +74 -0
  105. package/dist/schemas/component-table-manifest.js +26 -0
  106. package/dist/schemas/component-table-manifest.js.map +1 -0
  107. package/dist/schemas/enums.d.ts +12 -0
  108. package/dist/schemas/enums.js +11 -0
  109. package/dist/schemas/enums.js.map +1 -0
  110. package/dist/schemas/index.d.ts +7 -0
  111. package/dist/schemas/index.js +4298 -0
  112. package/dist/schemas/index.js.map +1 -0
  113. package/dist/schemas/manifest.d.ts +24586 -0
  114. package/dist/schemas/manifest.js +4269 -0
  115. package/dist/schemas/manifest.js.map +1 -0
  116. package/dist/schemas/sl-opinion.d.ts +31 -0
  117. package/dist/schemas/sl-opinion.js +19 -0
  118. package/dist/schemas/sl-opinion.js.map +1 -0
  119. package/dist/schemas/tables/identity/agent.d.ts +21 -0
  120. package/dist/schemas/tables/identity/agent.js +41 -0
  121. package/dist/schemas/tables/identity/agent.js.map +1 -0
  122. package/dist/schemas/tables/identity/epistemic.d.ts +18 -0
  123. package/dist/schemas/tables/identity/epistemic.js +38 -0
  124. package/dist/schemas/tables/identity/epistemic.js.map +1 -0
  125. package/dist/schemas/tables/identity/model.d.ts +62 -0
  126. package/dist/schemas/tables/identity/model.js +110 -0
  127. package/dist/schemas/tables/identity/model.js.map +1 -0
  128. package/dist/schemas/tables/identity/platform.d.ts +392 -0
  129. package/dist/schemas/tables/identity/platform.js +475 -0
  130. package/dist/schemas/tables/identity/platform.js.map +1 -0
  131. package/dist/schemas/tables/identity/project.d.ts +22 -0
  132. package/dist/schemas/tables/identity/project.js +48 -0
  133. package/dist/schemas/tables/identity/project.js.map +1 -0
  134. package/dist/schemas/tables/identity/user.d.ts +26 -0
  135. package/dist/schemas/tables/identity/user.js +47 -0
  136. package/dist/schemas/tables/identity/user.js.map +1 -0
  137. package/dist/schemas/tables/kernel/config.d.ts +20 -0
  138. package/dist/schemas/tables/kernel/config.js +39 -0
  139. package/dist/schemas/tables/kernel/config.js.map +1 -0
  140. package/dist/schemas/tables/kernel/coordination.d.ts +30 -0
  141. package/dist/schemas/tables/kernel/coordination.js +57 -0
  142. package/dist/schemas/tables/kernel/coordination.js.map +1 -0
  143. package/dist/schemas/tables/kernel/decision.d.ts +246 -0
  144. package/dist/schemas/tables/kernel/decision.js +371 -0
  145. package/dist/schemas/tables/kernel/decision.js.map +1 -0
  146. package/dist/schemas/tables/kernel/embedding.d.ts +18 -0
  147. package/dist/schemas/tables/kernel/embedding.js +48 -0
  148. package/dist/schemas/tables/kernel/embedding.js.map +1 -0
  149. package/dist/schemas/tables/kernel/epistemic.d.ts +317 -0
  150. package/dist/schemas/tables/kernel/epistemic.js +329 -0
  151. package/dist/schemas/tables/kernel/epistemic.js.map +1 -0
  152. package/dist/schemas/tables/kernel/idempotency.d.ts +13 -0
  153. package/dist/schemas/tables/kernel/idempotency.js +31 -0
  154. package/dist/schemas/tables/kernel/idempotency.js.map +1 -0
  155. package/dist/schemas/tables/kernel/infra.d.ts +183 -0
  156. package/dist/schemas/tables/kernel/infra.js +182 -0
  157. package/dist/schemas/tables/kernel/infra.js.map +1 -0
  158. package/dist/schemas/tables/kernel/intelligence.d.ts +293 -0
  159. package/dist/schemas/tables/kernel/intelligence.js +207 -0
  160. package/dist/schemas/tables/kernel/intelligence.js.map +1 -0
  161. package/dist/schemas/tables/kernel/lens.d.ts +192 -0
  162. package/dist/schemas/tables/kernel/lens.js +122 -0
  163. package/dist/schemas/tables/kernel/lens.js.map +1 -0
  164. package/dist/schemas/tables/kernel/ontology.d.ts +89 -0
  165. package/dist/schemas/tables/kernel/ontology.js +91 -0
  166. package/dist/schemas/tables/kernel/ontology.js.map +1 -0
  167. package/dist/schemas/tables/kernel/platform.d.ts +353 -0
  168. package/dist/schemas/tables/kernel/platform.js +349 -0
  169. package/dist/schemas/tables/kernel/platform.js.map +1 -0
  170. package/dist/schemas/tables/kernel/spine.d.ts +206 -0
  171. package/dist/schemas/tables/kernel/spine.js +243 -0
  172. package/dist/schemas/tables/kernel/spine.js.map +1 -0
  173. package/dist/schemas/tables/kernel/task.d.ts +614 -0
  174. package/dist/schemas/tables/kernel/task.js +189 -0
  175. package/dist/schemas/tables/kernel/task.js.map +1 -0
  176. package/dist/schemas/tables/kernel/topic.d.ts +25 -0
  177. package/dist/schemas/tables/kernel/topic.js +62 -0
  178. package/dist/schemas/tables/kernel/topic.js.map +1 -0
  179. package/dist/schemas/tables/kernel/workflow.d.ts +45 -0
  180. package/dist/schemas/tables/kernel/workflow.js +94 -0
  181. package/dist/schemas/tables/kernel/workflow.js.map +1 -0
  182. package/dist/schemas/tables/kernel/worktree.d.ts +823 -0
  183. package/dist/schemas/tables/kernel/worktree.js +330 -0
  184. package/dist/schemas/tables/kernel/worktree.js.map +1 -0
  185. package/dist/schemas/tables/mc/identity.d.ts +134 -0
  186. package/dist/schemas/tables/mc/identity.js +221 -0
  187. package/dist/schemas/tables/mc/identity.js.map +1 -0
  188. package/dist/schemas/tables/mc/methodology.d.ts +46 -0
  189. package/dist/schemas/tables/mc/methodology.js +69 -0
  190. package/dist/schemas/tables/mc/methodology.js.map +1 -0
  191. package/dist/schemas/tables/mc/pack.d.ts +540 -0
  192. package/dist/schemas/tables/mc/pack.js +294 -0
  193. package/dist/schemas/tables/mc/pack.js.map +1 -0
  194. package/dist/schemas/tables/mc/policy.d.ts +57 -0
  195. package/dist/schemas/tables/mc/policy.js +121 -0
  196. package/dist/schemas/tables/mc/policy.js.map +1 -0
  197. package/dist/schemas/tables/mc/registry.d.ts +155 -0
  198. package/dist/schemas/tables/mc/registry.js +164 -0
  199. package/dist/schemas/tables/mc/registry.js.map +1 -0
  200. package/dist/schemas/tables/mc/runtime.d.ts +119 -0
  201. package/dist/schemas/tables/mc/runtime.js +199 -0
  202. package/dist/schemas/tables/mc/runtime.js.map +1 -0
  203. package/dist/schemas/tables/mc/tenant.d.ts +106 -0
  204. package/dist/schemas/tables/mc/tenant.js +114 -0
  205. package/dist/schemas/tables/mc/tenant.js.map +1 -0
  206. package/dist/schemas/tables/mc/workspace.d.ts +28 -0
  207. package/dist/schemas/tables/mc/workspace.js +52 -0
  208. package/dist/schemas/tables/mc/workspace.js.map +1 -0
  209. package/dist/sdk-methods.contract.d.ts +5 -2
  210. package/dist/{sdk-tools.contract-BnV0hKLp.d.ts → sdk-tools.contract-S4ia0TTo.d.ts} +3 -7
  211. package/dist/sdk-tools.contract.d.ts +2 -2
  212. package/dist/sdk-tools.contract.js +810 -218
  213. package/dist/sdk-tools.contract.js.map +1 -1
  214. package/dist/tool-contracts-C92-9ueT.d.ts +290 -0
  215. package/dist/tool-contracts.d.ts +1 -0
  216. package/dist/{mcp-tools.contract.js → tool-contracts.js} +812 -159
  217. package/dist/tool-contracts.js.map +1 -0
  218. package/dist/workflow-runtime.contract.js +1 -1
  219. package/dist/workflow-runtime.contract.js.map +1 -1
  220. package/package.json +137 -2
  221. package/dist/mcp-tools.contract-D8kXcP6d.d.ts +0 -254
  222. package/dist/mcp-tools.contract.d.ts +0 -1
  223. package/dist/mcp-tools.contract.js.map +0 -1
@@ -0,0 +1,17 @@
1
+ type SchemaEnumCategory = "topic_type" | "branch_schema" | "lens_perspective_type" | "belief_type" | "edge_type" | "worktree_type" | "worktree_phase" | "activity_type";
2
+ declare function validateSchemaEnumValue(_ctx: unknown, args: {
3
+ category: SchemaEnumCategory;
4
+ value: string;
5
+ tenantId?: string;
6
+ }): Promise<{
7
+ valid: boolean;
8
+ source: "builtin" | "none";
9
+ }>;
10
+ declare function assertSchemaEnumValue(ctx: unknown, args: {
11
+ category: SchemaEnumCategory;
12
+ value?: string;
13
+ tenantId?: string;
14
+ context: string;
15
+ }): Promise<string | undefined>;
16
+
17
+ export { type SchemaEnumCategory, assertSchemaEnumValue, validateSchemaEnumValue };
@@ -0,0 +1,143 @@
1
+ // src/schema-helpers/enumValidation.ts
2
+ var BUILTIN_ENUM_FALLBACK = {
3
+ topic_type: /* @__PURE__ */ new Set([
4
+ "domain",
5
+ "theme",
6
+ "deal",
7
+ "strategy",
8
+ "constitution",
9
+ "project",
10
+ "portfolio",
11
+ "architecture",
12
+ "capability",
13
+ "runtime",
14
+ "interface",
15
+ "governance",
16
+ "operations",
17
+ "security",
18
+ "data"
19
+ ]),
20
+ branch_schema: /* @__PURE__ */ new Set(["pillar", "track", "dimension", "axis", "phase"]),
21
+ lens_perspective_type: /* @__PURE__ */ new Set([
22
+ "investigation",
23
+ "monitoring",
24
+ "analysis",
25
+ "comparison",
26
+ "taxonomy"
27
+ ]),
28
+ belief_type: /* @__PURE__ */ new Set([
29
+ "belief",
30
+ "hypothesis",
31
+ "principle",
32
+ "invariant",
33
+ "assumption",
34
+ "tenet",
35
+ "prior",
36
+ "preference",
37
+ "goal",
38
+ "forecast",
39
+ "decision",
40
+ "constraint",
41
+ "tradeoff",
42
+ "policy",
43
+ "implementation_choice",
44
+ "implementation_decision",
45
+ "interface_contract",
46
+ "migration_state",
47
+ "code_pattern",
48
+ "deprecation_notice"
49
+ ]),
50
+ edge_type: /* @__PURE__ */ new Set([
51
+ "supports",
52
+ "informs",
53
+ "depends_on",
54
+ "derived_from",
55
+ "contains",
56
+ "tests",
57
+ "supersedes",
58
+ "responds_to",
59
+ "belongs_to",
60
+ "relates_to_thesis",
61
+ "works_at",
62
+ "invested_in",
63
+ "competes_with",
64
+ "participates_in",
65
+ "founded_by",
66
+ "evaluates",
67
+ "performs",
68
+ "function_in",
69
+ "impacts",
70
+ "raised_from",
71
+ "mentioned_in",
72
+ "perspective_on",
73
+ "plays_theme"
74
+ ]),
75
+ worktree_type: /* @__PURE__ */ new Set([
76
+ "belief_test",
77
+ "existential",
78
+ "contradiction",
79
+ "refinement",
80
+ "coverage",
81
+ "discovery",
82
+ "clarification",
83
+ "confirmation"
84
+ ]),
85
+ worktree_phase: /* @__PURE__ */ new Set([
86
+ "cluster_mapping",
87
+ "hypothesis_formation",
88
+ "question_generation",
89
+ "evidence_collection",
90
+ "synthesis",
91
+ "decision",
92
+ "retrospective"
93
+ ]),
94
+ activity_type: /* @__PURE__ */ new Set([
95
+ "create",
96
+ "update",
97
+ "review",
98
+ "merge",
99
+ "archive",
100
+ "comment",
101
+ "status_change",
102
+ "evidence_added",
103
+ "question_added"
104
+ ])
105
+ };
106
+ function normalizeEnumValue(value) {
107
+ return value.trim().toLowerCase();
108
+ }
109
+ async function validateSchemaEnumValue(_ctx, args) {
110
+ const normalized = normalizeEnumValue(args.value);
111
+ if (!normalized) {
112
+ return { valid: false, source: "none" };
113
+ }
114
+ if (BUILTIN_ENUM_FALLBACK[args.category].has(normalized)) {
115
+ return { valid: true, source: "builtin" };
116
+ }
117
+ return { valid: false, source: "none" };
118
+ }
119
+ async function assertSchemaEnumValue(ctx, args) {
120
+ if (typeof args.value !== "string") {
121
+ return;
122
+ }
123
+ const normalized = normalizeEnumValue(args.value);
124
+ if (!normalized) {
125
+ return;
126
+ }
127
+ const validation = await validateSchemaEnumValue(ctx, {
128
+ category: args.category,
129
+ value: normalized,
130
+ tenantId: args.tenantId
131
+ });
132
+ if (!validation.valid) {
133
+ const tenantHint = args.tenantId ? ` for tenant ${args.tenantId}` : "";
134
+ throw new Error(
135
+ `[${args.context}] Invalid value "${normalized}" for category "${args.category}"${tenantHint}. Add it to the contracts schema enum manifest before use.`
136
+ );
137
+ }
138
+ return normalized;
139
+ }
140
+
141
+ export { assertSchemaEnumValue, validateSchemaEnumValue };
142
+ //# sourceMappingURL=enumValidation.js.map
143
+ //# sourceMappingURL=enumValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema-helpers/enumValidation.ts"],"names":[],"mappings":";AAUA,IAAM,qBAAA,GAAyE;AAAA,EAC7E,UAAA,sBAAgB,GAAA,CAAI;AAAA,IAClB,QAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACD,CAAA;AAAA,EACD,aAAA,sBAAmB,GAAA,CAAI,CAAC,UAAU,OAAA,EAAS,WAAA,EAAa,MAAA,EAAQ,OAAO,CAAC,CAAA;AAAA,EACxE,qBAAA,sBAA2B,GAAA,CAAI;AAAA,IAC7B,eAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,YA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AAW,KAAA,EAAO;AACrB,IAAA,MAAM,aAAa,IAAA,CAAK,QAAA,GAAW,CAAA,YAAA,EAAe,IAAA,CAAK,QAAQ,CAAA,CAAA,GAAK,EAAA;AACpE,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,CAAA,EAAI,KAAK,OAAO,CAAA,iBAAA,EAAoB,UAAU,CAAA,gBAAA,EAAmB,IAAA,CAAK,QAAQ,CAAA,CAAA,EAAI,UAAU,CAAA,0DAAA;AAAA,KAE9F;AAAA,EACF;AAEA,EAAA,OAAO,UAAA;AACT","file":"enumValidation.js","sourcesContent":["export type SchemaEnumCategory =\n | \"topic_type\"\n | \"branch_schema\"\n | \"lens_perspective_type\"\n | \"belief_type\"\n | \"edge_type\"\n | \"worktree_type\"\n | \"worktree_phase\"\n | \"activity_type\";\n\nconst BUILTIN_ENUM_FALLBACK: Record<SchemaEnumCategory, ReadonlySet<string>> = {\n topic_type: new Set([\n \"domain\",\n \"theme\",\n \"deal\",\n \"strategy\",\n \"constitution\",\n \"project\",\n \"portfolio\",\n \"architecture\",\n \"capability\",\n \"runtime\",\n \"interface\",\n \"governance\",\n \"operations\",\n \"security\",\n \"data\",\n ]),\n branch_schema: new Set([\"pillar\", \"track\", \"dimension\", \"axis\", \"phase\"]),\n lens_perspective_type: new Set([\n \"investigation\",\n \"monitoring\",\n \"analysis\",\n \"comparison\",\n \"taxonomy\",\n ]),\n belief_type: new Set([\n \"belief\",\n \"hypothesis\",\n \"principle\",\n \"invariant\",\n \"assumption\",\n \"tenet\",\n \"prior\",\n \"preference\",\n \"goal\",\n \"forecast\",\n \"decision\",\n \"constraint\",\n \"tradeoff\",\n \"policy\",\n \"implementation_choice\",\n \"implementation_decision\",\n \"interface_contract\",\n \"migration_state\",\n \"code_pattern\",\n \"deprecation_notice\",\n ]),\n edge_type: new Set([\n \"supports\",\n \"informs\",\n \"depends_on\",\n \"derived_from\",\n \"contains\",\n \"tests\",\n \"supersedes\",\n \"responds_to\",\n \"belongs_to\",\n \"relates_to_thesis\",\n \"works_at\",\n \"invested_in\",\n \"competes_with\",\n \"participates_in\",\n \"founded_by\",\n \"evaluates\",\n \"performs\",\n \"function_in\",\n \"impacts\",\n \"raised_from\",\n \"mentioned_in\",\n \"perspective_on\",\n \"plays_theme\",\n ]),\n worktree_type: new Set([\n \"belief_test\",\n \"existential\",\n \"contradiction\",\n \"refinement\",\n \"coverage\",\n \"discovery\",\n \"clarification\",\n \"confirmation\",\n ]),\n worktree_phase: new Set([\n \"cluster_mapping\",\n \"hypothesis_formation\",\n \"question_generation\",\n \"evidence_collection\",\n \"synthesis\",\n \"decision\",\n \"retrospective\",\n ]),\n activity_type: new Set([\n \"create\",\n \"update\",\n \"review\",\n \"merge\",\n \"archive\",\n \"comment\",\n \"status_change\",\n \"evidence_added\",\n \"question_added\",\n ]),\n};\n\nfunction normalizeEnumValue(value: string): string {\n return value.trim().toLowerCase();\n}\n\nexport async function validateSchemaEnumValue(\n _ctx: unknown,\n args: {\n category: SchemaEnumCategory;\n value: string;\n tenantId?: string;\n }\n): Promise<{ valid: boolean; source: \"builtin\" | \"none\" }> {\n const normalized = normalizeEnumValue(args.value);\n if (!normalized) {\n return { valid: false, source: \"none\" };\n }\n\n if (BUILTIN_ENUM_FALLBACK[args.category].has(normalized)) {\n return { valid: true, source: \"builtin\" };\n }\n\n return { valid: false, source: \"none\" };\n}\n\nexport async function assertSchemaEnumValue(\n ctx: unknown,\n args: {\n category: SchemaEnumCategory;\n value?: string;\n tenantId?: string;\n context: string;\n }\n): Promise<string | undefined> {\n if (typeof args.value !== \"string\") {\n return;\n }\n const normalized = normalizeEnumValue(args.value);\n if (!normalized) {\n return;\n }\n\n const validation = await validateSchemaEnumValue(ctx, {\n category: args.category,\n value: normalized,\n tenantId: args.tenantId,\n });\n\n if (!validation.valid) {\n const tenantHint = args.tenantId ? ` for tenant ${args.tenantId}` : \"\";\n throw new Error(\n `[${args.context}] Invalid value \"${normalized}\" for category \"${args.category}\"${tenantHint}. ` +\n \"Add it to the contracts schema enum manifest before use.\"\n );\n }\n\n return normalized;\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import * as convex_values from 'convex/values';
2
+ import { Infer } from 'convex/values';
3
+
4
+ declare const decisionType: convex_values.VUnion<"invest" | "pass" | "follow_on" | "exit" | "deep_dive" | "monitor" | "deprioritize" | "thesis_adopt" | "thesis_revise" | "thesis_abandon", [convex_values.VLiteral<"invest", "required">, convex_values.VLiteral<"pass", "required">, convex_values.VLiteral<"follow_on", "required">, convex_values.VLiteral<"exit", "required">, convex_values.VLiteral<"deep_dive", "required">, convex_values.VLiteral<"monitor", "required">, convex_values.VLiteral<"deprioritize", "required">, convex_values.VLiteral<"thesis_adopt", "required">, convex_values.VLiteral<"thesis_revise", "required">, convex_values.VLiteral<"thesis_abandon", "required">], "required", never>;
5
+ declare const decisionOutcome: convex_values.VUnion<"pending" | "successful" | "unsuccessful" | "mixed" | "unknown", [convex_values.VLiteral<"pending", "required">, convex_values.VLiteral<"successful", "required">, convex_values.VLiteral<"unsuccessful", "required">, convex_values.VLiteral<"mixed", "required">, convex_values.VLiteral<"unknown", "required">], "required", never>;
6
+ type DecisionType = Infer<typeof decisionType>;
7
+ type DecisionOutcome = Infer<typeof decisionOutcome>;
8
+ declare function isDecisionType(value: string): value is DecisionType;
9
+ declare function canEvaluateOutcome(decisionTypeValue: DecisionType | undefined, decisionDate: number | undefined, now?: number): boolean;
10
+ declare function calculateCalibration(decisions: ReadonlyArray<{
11
+ confidence: number;
12
+ successful: boolean;
13
+ }>): {
14
+ calibrationScore: number;
15
+ overconfident: boolean;
16
+ underconfident: boolean;
17
+ };
18
+
19
+ export { type DecisionOutcome, type DecisionType, calculateCalibration, canEvaluateOutcome, decisionOutcome, decisionType, isDecisionType };
@@ -0,0 +1,81 @@
1
+ import { v } from 'convex/values';
2
+
3
+ // src/schema-helpers/spine/nodes/decision.ts
4
+ var decisionType = v.union(
5
+ v.literal("invest"),
6
+ v.literal("pass"),
7
+ v.literal("follow_on"),
8
+ v.literal("exit"),
9
+ v.literal("deep_dive"),
10
+ v.literal("monitor"),
11
+ v.literal("deprioritize"),
12
+ v.literal("thesis_adopt"),
13
+ v.literal("thesis_revise"),
14
+ v.literal("thesis_abandon")
15
+ );
16
+ var decisionOutcome = v.union(
17
+ v.literal("pending"),
18
+ v.literal("successful"),
19
+ v.literal("unsuccessful"),
20
+ v.literal("mixed"),
21
+ v.literal("unknown")
22
+ );
23
+ var DECISION_TYPES = [
24
+ "invest",
25
+ "pass",
26
+ "follow_on",
27
+ "exit",
28
+ "deep_dive",
29
+ "monitor",
30
+ "deprioritize",
31
+ "thesis_adopt",
32
+ "thesis_revise",
33
+ "thesis_abandon"
34
+ ];
35
+ function isDecisionType(value) {
36
+ return DECISION_TYPES.includes(value);
37
+ }
38
+ function canEvaluateOutcome(decisionTypeValue, decisionDate, now = Date.now()) {
39
+ if (!decisionDate) {
40
+ return false;
41
+ }
42
+ const minWindowMs = {
43
+ invest: 365 * 24 * 60 * 60 * 1e3,
44
+ pass: 180 * 24 * 60 * 60 * 1e3,
45
+ follow_on: 180 * 24 * 60 * 60 * 1e3,
46
+ exit: 90 * 24 * 60 * 60 * 1e3,
47
+ deep_dive: 30 * 24 * 60 * 60 * 1e3,
48
+ monitor: 90 * 24 * 60 * 60 * 1e3,
49
+ deprioritize: 180 * 24 * 60 * 60 * 1e3,
50
+ thesis_adopt: 365 * 24 * 60 * 60 * 1e3,
51
+ thesis_revise: 180 * 24 * 60 * 60 * 1e3,
52
+ thesis_abandon: 365 * 24 * 60 * 60 * 1e3
53
+ }[decisionTypeValue ?? "invest"];
54
+ return now - decisionDate >= minWindowMs;
55
+ }
56
+ function calculateCalibration(decisions) {
57
+ if (decisions.length < 10) {
58
+ return {
59
+ calibrationScore: 0.5,
60
+ overconfident: false,
61
+ underconfident: false
62
+ };
63
+ }
64
+ const highConf = decisions.filter((decision) => decision.confidence > 0.7);
65
+ const medConf = decisions.filter(
66
+ (decision) => decision.confidence >= 0.4 && decision.confidence <= 0.7
67
+ );
68
+ const lowConf = decisions.filter((decision) => decision.confidence < 0.4);
69
+ const highSuccess = highConf.filter((decision) => decision.successful).length / (highConf.length || 1);
70
+ const medSuccess = medConf.filter((decision) => decision.successful).length / (medConf.length || 1);
71
+ const lowSuccess = lowConf.filter((decision) => decision.successful).length / (lowConf.length || 1);
72
+ const calibrated = highSuccess > medSuccess && medSuccess > lowSuccess;
73
+ const overconfident = highSuccess < medSuccess;
74
+ const underconfident = lowSuccess > medSuccess;
75
+ const calibrationScore = calibrated ? 0.8 + (highSuccess - lowSuccess) * 0.2 : 0.5;
76
+ return { calibrationScore, overconfident, underconfident };
77
+ }
78
+
79
+ export { calculateCalibration, canEvaluateOutcome, decisionOutcome, decisionType, isDecisionType };
80
+ //# sourceMappingURL=decision.js.map
81
+ //# sourceMappingURL=decision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/schema-helpers/spine/nodes/decision.ts"],"names":[],"mappings":";;;AAGO,IAAM,eAAe,CAAA,CAAE,KAAA;AAAA,EAC5B,CAAA,CAAE,QAAQ,QAAQ,CAAA;AAAA,EAClB,CAAA,CAAE,QAAQ,MAAM,CAAA;AAAA,EAChB,CAAA,CAAE,QAAQ,WAAW,CAAA;AAAA,EACrB,CAAA,CAAE,QAAQ,MAAM,CAAA;AAAA,EAChB,CAAA,CAAE,QAAQ,WAAW,CAAA;AAAA,EACrB,CAAA,CAAE,QAAQ,SAAS,CAAA;AAAA,EACnB,CAAA,CAAE,QAAQ,cAAc,CAAA;AAAA,EACxB,CAAA,CAAE,QAAQ,cAAc,CAAA;AAAA,EACxB,CAAA,CAAE,QAAQ,eAAe,CAAA;AAAA,EACzB,CAAA,CAAE,QAAQ,gBAAgB;AAC5B;AAEO,IAAM,kBAAkB,CAAA,CAAE,KAAA;AAAA,EAC/B,CAAA,CAAE,QAAQ,SAAS,CAAA;AAAA,EACnB,CAAA,CAAE,QAAQ,YAAY,CAAA;AAAA,EACtB,CAAA,CAA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AA,IAAc,UAAA,GAAa,UAAA;AAC5D,EAAA,MAAM,gBAAgB,WAAA,GAAc,UAAA;AACpC,EAAA,MAAM,iBAAiB,UAAA,GAAa,UAAA;AACpC,EAAA,MAAM,gBAAA,GAAmB,UAAA,GACrB,GAAA,GAAA,CAAO,WAAA,GAAc,cAAc,GAAA,GACnC,GAAA;AAEJ,EAAA,OAAO,EAAE,gBAAA,EAAkB,aAAA,EAAe,cAAA,EAAe;AAC3D","file":"decision.js","sourcesContent":["import type { Infer } from \"convex/values\";\nimport { v } from \"convex/values\";\n\nexport const decisionType = v.union(\n v.literal(\"invest\"),\n v.literal(\"pass\"),\n v.literal(\"follow_on\"),\n v.literal(\"exit\"),\n v.literal(\"deep_dive\"),\n v.literal(\"monitor\"),\n v.literal(\"deprioritize\"),\n v.literal(\"thesis_adopt\"),\n v.literal(\"thesis_revise\"),\n v.literal(\"thesis_abandon\")\n);\n\nexport const decisionOutcome = v.union(\n v.literal(\"pending\"),\n v.literal(\"successful\"),\n v.literal(\"unsuccessful\"),\n v.literal(\"mixed\"),\n v.literal(\"unknown\")\n);\n\nexport type DecisionType = Infer<typeof decisionType>;\nexport type DecisionOutcome = Infer<typeof decisionOutcome>;\n\nconst DECISION_TYPES = [\n \"invest\",\n \"pass\",\n \"follow_on\",\n \"exit\",\n \"deep_dive\",\n \"monitor\",\n \"deprioritize\",\n \"thesis_adopt\",\n \"thesis_revise\",\n \"thesis_abandon\",\n] as const satisfies readonly DecisionType[];\n\nexport function isDecisionType(value: string): value is DecisionType {\n return (DECISION_TYPES as readonly string[]).includes(value);\n}\n\nexport function canEvaluateOutcome(\n decisionTypeValue: DecisionType | undefined,\n decisionDate: number | undefined,\n now: number = Date.now()\n): boolean {\n if (!decisionDate) {\n return false;\n }\n\n const minWindowMs = {\n invest: 365 * 24 * 60 * 60 * 1000,\n pass: 180 * 24 * 60 * 60 * 1000,\n follow_on: 180 * 24 * 60 * 60 * 1000,\n exit: 90 * 24 * 60 * 60 * 1000,\n deep_dive: 30 * 24 * 60 * 60 * 1000,\n monitor: 90 * 24 * 60 * 60 * 1000,\n deprioritize: 180 * 24 * 60 * 60 * 1000,\n thesis_adopt: 365 * 24 * 60 * 60 * 1000,\n thesis_revise: 180 * 24 * 60 * 60 * 1000,\n thesis_abandon: 365 * 24 * 60 * 60 * 1000,\n }[decisionTypeValue ?? \"invest\"];\n\n return now - decisionDate >= minWindowMs;\n}\n\nexport function calculateCalibration(\n decisions: ReadonlyArray<{ confidence: number; successful: boolean }>\n): {\n calibrationScore: number;\n overconfident: boolean;\n underconfident: boolean;\n} {\n if (decisions.length < 10) {\n return {\n calibrationScore: 0.5,\n overconfident: false,\n underconfident: false,\n };\n }\n\n const highConf = decisions.filter((decision) => decision.confidence > 0.7);\n const medConf = decisions.filter(\n (decision) => decision.confidence >= 0.4 && decision.confidence <= 0.7\n );\n const lowConf = decisions.filter((decision) => decision.confidence < 0.4);\n\n const highSuccess =\n highConf.filter((decision) => decision.successful).length /\n (highConf.length || 1);\n const medSuccess =\n medConf.filter((decision) => decision.successful).length /\n (medConf.length || 1);\n const lowSuccess =\n lowConf.filter((decision) => decision.successful).length /\n (lowConf.length || 1);\n\n const calibrated = highSuccess > medSuccess && medSuccess > lowSuccess;\n const overconfident = highSuccess < medSuccess;\n const underconfident = lowSuccess > medSuccess;\n const calibrationScore = calibrated\n ? 0.8 + (highSuccess - lowSuccess) * 0.2\n : 0.5;\n\n return { calibrationScore, overconfident, underconfident };\n}\n"]}
@@ -0,0 +1,9 @@
1
+ type NodeType = "decision" | "belief" | "question" | "theme" | "deal" | "topic" | "claim" | "evidence" | "synthesis" | "answer" | "atomic_fact" | "excerpt" | "source" | "company" | "person" | "investor" | "function" | "value_chain";
2
+ type EpistemicLayer = "L4" | "L3" | "L2" | "L1" | "ontological" | "organizational";
3
+ declare const NODE_TYPES: readonly ["decision", "belief", "question", "theme", "deal", "topic", "claim", "evidence", "synthesis", "answer", "atomic_fact", "excerpt", "source", "company", "person", "investor", "function", "value_chain"];
4
+ declare function isNodeType(value: string): value is NodeType;
5
+ declare function getLayerForNodeType(type: NodeType): EpistemicLayer;
6
+ declare function resolveKnownLayerForNodeType(type: string): EpistemicLayer | undefined;
7
+ declare function isEpistemicNodeType(type: NodeType): boolean;
8
+
9
+ export { type EpistemicLayer, NODE_TYPES, type NodeType, getLayerForNodeType, isEpistemicNodeType, isNodeType, resolveKnownLayerForNodeType };
@@ -0,0 +1,62 @@
1
+ // src/schema-helpers/spine/tables/epistemicNodes.ts
2
+ var NODE_TYPES = [
3
+ "decision",
4
+ "belief",
5
+ "question",
6
+ "theme",
7
+ "deal",
8
+ "topic",
9
+ "claim",
10
+ "evidence",
11
+ "synthesis",
12
+ "answer",
13
+ "atomic_fact",
14
+ "excerpt",
15
+ "source",
16
+ "company",
17
+ "person",
18
+ "investor",
19
+ "function",
20
+ "value_chain"
21
+ ];
22
+ function isNodeType(value) {
23
+ return NODE_TYPES.includes(value);
24
+ }
25
+ function getLayerForNodeType(type) {
26
+ switch (type) {
27
+ case "decision":
28
+ return "L4";
29
+ case "belief":
30
+ case "question":
31
+ case "theme":
32
+ case "deal":
33
+ return "L3";
34
+ case "claim":
35
+ case "evidence":
36
+ case "synthesis":
37
+ case "answer":
38
+ return "L2";
39
+ case "atomic_fact":
40
+ case "excerpt":
41
+ case "source":
42
+ return "L1";
43
+ case "topic":
44
+ return "organizational";
45
+ case "company":
46
+ case "person":
47
+ case "investor":
48
+ case "function":
49
+ case "value_chain":
50
+ return "ontological";
51
+ }
52
+ }
53
+ function resolveKnownLayerForNodeType(type) {
54
+ return isNodeType(type) ? getLayerForNodeType(type) : void 0;
55
+ }
56
+ function isEpistemicNodeType(type) {
57
+ return getLayerForNodeType(type) !== "ontological";
58
+ }
59
+
60
+ export { NODE_TYPES, getLayerForNodeType, isEpistemicNodeType, isNodeType, resolveKnownLayerForNodeType };
61
+ //# sourceMappingURL=epistemicNodes.js.map
62
+ //# sourceMappingURL=epistemicNodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/schema-helpers/spine/tables/epistemicNodes.ts"],"names":[],"mappings":";AA4BO,IAAM,UAAA,GAAa;AAAA,EACxB,UAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,aAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF;AAEO,SAAS,WAAW,KAAA,EAAkC;AAC3D,EAAA,OAAQ,UAAA,CAAiC,SAAS,KAAK,CAAA;AACzD;AAEO,SAAS,oBAAoB,IAAA,EAAgC;AAClE,EAAA,QAAQ,IAAA;AAAM,IACZ,KAAK,UAAA;AACH,MAAA,OAAO,IAAA;AAAA,IACT,KAAK,QAAA;AAAA,IACL,KAAK,UAAA;AAAA,IACL,KAAK,OAAA;AAAA,IACL,KAAK,MAAA;AACH,MAAA,OAAO,IAAA;AAAA,IACT,KAAK,OAAA;AAAA,IACL,KAAK,UAAA;AAAA,IACL,KAAK,WAAA;AAAA,IACL,KAAK,QAAA;AACH,MAAA,OAAO,IAAA;AAAA,IACT,KAAK,aAAA;AAAA,IACL,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AACH,MAAA,OAAO,IAAA;AAAA,IACT,KAAK,OAAA;AACH,MAAA,OAAO,gBAAA;AAAA,IACT,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,UAAA;AAAA,IACL,KAAK,UAAA;AAAA,IACL,KAAK,aAAA;AACH,MAAA,OAAO,aAAA;AAAA;AAEb;AAEO,SAAS,6BACd,IAAA,EAC4B;AAC5B,EAAA,OAAO,UAAA,CAAW,IAAI,CAAA,GAAI,mBAAA,CAAoB,IAAI,CAAA,GAAI,MAAA;AACxD;AAEO,SAAS,oBAAoB,IAAA,EAAyB;AAC3D,EAAA,OAAO,mBAAA,CAAoB,IAAI,CAAA,KAAM,aAAA;AACvC","file":"epistemicNodes.js","sourcesContent":["export type NodeType =\n | \"decision\"\n | \"belief\"\n | \"question\"\n | \"theme\"\n | \"deal\"\n | \"topic\"\n | \"claim\"\n | \"evidence\"\n | \"synthesis\"\n | \"answer\"\n | \"atomic_fact\"\n | \"excerpt\"\n | \"source\"\n | \"company\"\n | \"person\"\n | \"investor\"\n | \"function\"\n | \"value_chain\";\n\nexport type EpistemicLayer =\n | \"L4\"\n | \"L3\"\n | \"L2\"\n | \"L1\"\n | \"ontological\"\n | \"organizational\";\n\nexport const NODE_TYPES = [\n \"decision\",\n \"belief\",\n \"question\",\n \"theme\",\n \"deal\",\n \"topic\",\n \"claim\",\n \"evidence\",\n \"synthesis\",\n \"answer\",\n \"atomic_fact\",\n \"excerpt\",\n \"source\",\n \"company\",\n \"person\",\n \"investor\",\n \"function\",\n \"value_chain\",\n] as const satisfies readonly NodeType[];\n\nexport function isNodeType(value: string): value is NodeType {\n return (NODE_TYPES as readonly string[]).includes(value);\n}\n\nexport function getLayerForNodeType(type: NodeType): EpistemicLayer {\n switch (type) {\n case \"decision\":\n return \"L4\";\n case \"belief\":\n case \"question\":\n case \"theme\":\n case \"deal\":\n return \"L3\";\n case \"claim\":\n case \"evidence\":\n case \"synthesis\":\n case \"answer\":\n return \"L2\";\n case \"atomic_fact\":\n case \"excerpt\":\n case \"source\":\n return \"L1\";\n case \"topic\":\n return \"organizational\";\n case \"company\":\n case \"person\":\n case \"investor\":\n case \"function\":\n case \"value_chain\":\n return \"ontological\";\n }\n}\n\nexport function resolveKnownLayerForNodeType(\n type: string\n): EpistemicLayer | undefined {\n return isNodeType(type) ? getLayerForNodeType(type) : undefined;\n}\n\nexport function isEpistemicNodeType(type: NodeType): boolean {\n return getLayerForNodeType(type) !== \"ontological\";\n}\n"]}
@@ -0,0 +1,17 @@
1
+ type ConvexId<TableName extends string> = string & {
2
+ readonly __tableName: TableName;
3
+ };
4
+ type TopicDocLike = {
5
+ _id: ConvexId<"topics">;
6
+ [key: string]: unknown;
7
+ };
8
+ type TopicLookupContext<TopicDoc extends TopicDocLike = TopicDocLike> = {
9
+ db: {
10
+ get(id: ConvexId<"topics">): Promise<TopicDoc | null>;
11
+ };
12
+ };
13
+ declare function asTopicId(topicId: string): ConvexId<"topics">;
14
+ declare function asOptionalTopicId(topicId?: string | ConvexId<"topics"> | null): ConvexId<"topics"> | undefined;
15
+ declare function getTopicDoc<TopicDoc extends TopicDocLike>(ctx: TopicLookupContext<TopicDoc>, topicId?: string | ConvexId<"topics"> | null): Promise<TopicDoc | null>;
16
+
17
+ export { type ConvexId, type TopicDocLike, asOptionalTopicId, asTopicId, getTopicDoc };
@@ -0,0 +1,21 @@
1
+ // src/schema-helpers/topicIds.ts
2
+ function asTopicId(topicId) {
3
+ return topicId;
4
+ }
5
+ function asOptionalTopicId(topicId) {
6
+ if (!topicId) {
7
+ return void 0;
8
+ }
9
+ return asTopicId(String(topicId));
10
+ }
11
+ async function getTopicDoc(ctx, topicId) {
12
+ const normalizedTopicId = asOptionalTopicId(topicId);
13
+ if (!normalizedTopicId) {
14
+ return null;
15
+ }
16
+ return ctx.db.get(normalizedTopicId);
17
+ }
18
+
19
+ export { asOptionalTopicId, asTopicId, getTopicDoc };
20
+ //# sourceMappingURL=topicIds.js.map
21
+ //# sourceMappingURL=topicIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema-helpers/topicIds.ts"],"names":[],"mappings":";AAeO,SAAS,UAAU,OAAA,EAAqC;AAC7D,EAAA,OAAO,OAAA;AACT;AAEO,SAAS,kBACd,OAAA,EACgC;AAChC,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,SAAA,CAAU,MAAA,CAAO,OAAO,CAAC,CAAA;AAClC;AAEA,eAAsB,WAAA,CACpB,KACA,OAAA,EAC0B;AAC1B,EAAA,MAAM,iBAAA,GAAoB,kBAAkB,OAAO,CAAA;AACnD,EAAA,IAAI,CAAC,iBAAA,EAAmB;AACtB,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,OAAO,GAAA,CAAI,EAAA,CAAG,GAAA,CAAI,iBAAiB,CAAA;AACrC","file":"topicIds.js","sourcesContent":["export type ConvexId<TableName extends string> = string & {\n readonly __tableName: TableName;\n};\n\nexport type TopicDocLike = {\n _id: ConvexId<\"topics\">;\n [key: string]: unknown;\n};\n\ntype TopicLookupContext<TopicDoc extends TopicDocLike = TopicDocLike> = {\n db: {\n get(id: ConvexId<\"topics\">): Promise<TopicDoc | null>;\n };\n};\n\nexport function asTopicId(topicId: string): ConvexId<\"topics\"> {\n return topicId as ConvexId<\"topics\">;\n}\n\nexport function asOptionalTopicId(\n topicId?: string | ConvexId<\"topics\"> | null\n): ConvexId<\"topics\"> | undefined {\n if (!topicId) {\n return undefined;\n }\n return asTopicId(String(topicId));\n}\n\nexport async function getTopicDoc<TopicDoc extends TopicDocLike>(\n ctx: TopicLookupContext<TopicDoc>,\n topicId?: string | ConvexId<\"topics\"> | null\n): Promise<TopicDoc | null> {\n const normalizedTopicId = asOptionalTopicId(topicId);\n if (!normalizedTopicId) {\n return null;\n }\n return ctx.db.get(normalizedTopicId);\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import * as convex_values from 'convex/values';
2
+
3
+ declare const LEGACY_PROJECT_FIELD = "projectId";
4
+ declare const LEGACY_GRAPH_SCOPE_FIELD = "graphScopeProjectId";
5
+ declare const legacyProjectIdArg: {
6
+ readonly projectId: convex_values.VString<string | undefined, "optional">;
7
+ };
8
+ declare const optionalTopicScopeArgs: {
9
+ readonly topicId: convex_values.VString<string | undefined, "optional">;
10
+ readonly projectId: convex_values.VString<string | undefined, "optional">;
11
+ };
12
+ declare const legacyGraphScopeArg: {
13
+ readonly graphScopeProjectId: convex_values.VString<string | undefined, "optional">;
14
+ };
15
+ declare function readLegacyProjectId(source: Record<string, unknown>): string | undefined;
16
+ declare function readLegacyGraphScopeId(source: Record<string, unknown>): string | undefined;
17
+ declare function mergeLegacyGraphScopeMetadata(metadata: unknown, legacyGraphScopeId: string | undefined): Record<string, unknown> | undefined;
18
+
19
+ export { LEGACY_GRAPH_SCOPE_FIELD, LEGACY_PROJECT_FIELD, legacyGraphScopeArg, legacyProjectIdArg, mergeLegacyGraphScopeMetadata, optionalTopicScopeArgs, readLegacyGraphScopeId, readLegacyProjectId };
@@ -0,0 +1,44 @@
1
+ import { v } from 'convex/values';
2
+
3
+ // src/schema-helpers/topicLegacyScope.ts
4
+ var LEGACY_PROJECT_FIELD = "projectId";
5
+ var LEGACY_GRAPH_SCOPE_FIELD = "graphScopeProjectId";
6
+ var legacyProjectIdArg = {
7
+ [LEGACY_PROJECT_FIELD]: v.optional(v.string())
8
+ };
9
+ var optionalTopicScopeArgs = {
10
+ ...legacyProjectIdArg,
11
+ topicId: v.optional(v.string())
12
+ };
13
+ var legacyGraphScopeArg = {
14
+ [LEGACY_GRAPH_SCOPE_FIELD]: v.optional(v.string())
15
+ };
16
+ function normalizeOptionalString(value) {
17
+ return typeof value === "string" && value.length > 0 ? value : void 0;
18
+ }
19
+ function asMetadataRecord(metadata) {
20
+ if (metadata && typeof metadata === "object" && !Array.isArray(metadata)) {
21
+ return { ...metadata };
22
+ }
23
+ return {};
24
+ }
25
+ function readLegacyProjectId(source) {
26
+ return normalizeOptionalString(source[LEGACY_PROJECT_FIELD]);
27
+ }
28
+ function readLegacyGraphScopeId(source) {
29
+ return normalizeOptionalString(source[LEGACY_GRAPH_SCOPE_FIELD]);
30
+ }
31
+ function mergeLegacyGraphScopeMetadata(metadata, legacyGraphScopeId) {
32
+ if (metadata === void 0 && legacyGraphScopeId === void 0) {
33
+ return void 0;
34
+ }
35
+ const nextMetadata = asMetadataRecord(metadata);
36
+ if (legacyGraphScopeId !== void 0) {
37
+ nextMetadata[LEGACY_GRAPH_SCOPE_FIELD] = legacyGraphScopeId;
38
+ }
39
+ return nextMetadata;
40
+ }
41
+
42
+ export { LEGACY_GRAPH_SCOPE_FIELD, LEGACY_PROJECT_FIELD, legacyGraphScopeArg, legacyProjectIdArg, mergeLegacyGraphScopeMetadata, optionalTopicScopeArgs, readLegacyGraphScopeId, readLegacyProjectId };
43
+ //# sourceMappingURL=topicLegacyScope.js.map
44
+ //# sourceMappingURL=topicLegacyScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema-helpers/topicLegacyScope.ts"],"names":[],"mappings":";;;AAEO,IAAM,oBAAA,GAAuB;AAC7B,IAAM,wBAAA,GAA2B;AAEjC,IAAM,kBAAA,GAAqB;AAAA,EAChC,CAAC,oBAAoB,GAAG,EAAE,QAAA,CAAS,CAAA,CAAE,QAAQ;AAC/C;AAEO,IAAM,sBAAA,GAAyB;AAAA,EACpC,GAAG,kBAAA;AAAA,EACH,OAAA,EAAS,CAAA,CAAE,QAAA,CAAS,CAAA,CAAE,QAAQ;AAChC;AAEO,IAAM,mBAAA,GAAsB;AAAA,EACjC,CAAC,wBAAwB,GAAG,EAAE,QAAA,CAAS,CAAA,CAAE,QAAQ;AACnD;AAEA,SAAS,wBAAwB,KAAA,EAAoC;AACnE,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,CAAM,MAAA,GAAS,IAAI,KAAA,GAAQ,MAAA;AACjE;AAEA,SAAS,iBAAiB,QAAA,EAA4C;AACpE,EAAA,IAAI,QAAA,IAAY,OAAO,QAAA,KAAa,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACxE,IAAA,OAAO,EAAE,GAAI,QAAA,EAAqC;AAAA,EACpD;AACA,EAAA,OAAO,EAAC;AACV;AAEO,SAAS,oBACd,MAAA,EACoB;AACpB,EAAA,OAAO,uBAAA,CAAwB,MAAA,CAAO,oBAAoB,CAAC,CAAA;AAC7D;AAEO,SAAS,uBACd,MAAA,EACoB;AACpB,EAAA,OAAO,uBAAA,CAAwB,MAAA,CAAO,wBAAwB,CAAC,CAAA;AACjE;AAEO,SAAS,6BAAA,CACd,UACA,kBAAA,EACqC;AACrC,EAAA,IAAI,QAAA,KAAa,MAAA,IAAa,kBAAA,KAAuB,MAAA,EAAW;AAC9D,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,MAAM,YAAA,GAAe,iBAAiB,QAAQ,CAAA;AAC9C,EAAA,IAAI,uBAAuB,MAAA,EAAW;AACpC,IAAA,YAAA,CAAa,wBAAwB,CAAA,GAAI,kBAAA;AAAA,EAC3C;AACA,EAAA,OAAO,YAAA;AACT","file":"topicLegacyScope.js","sourcesContent":["import { v } from \"convex/values\";\n\nexport const LEGACY_PROJECT_FIELD = \"projectId\";\nexport const LEGACY_GRAPH_SCOPE_FIELD = \"graphScopeProjectId\";\n\nexport const legacyProjectIdArg = {\n [LEGACY_PROJECT_FIELD]: v.optional(v.string()),\n} as const;\n\nexport const optionalTopicScopeArgs = {\n ...legacyProjectIdArg,\n topicId: v.optional(v.string()),\n} as const;\n\nexport const legacyGraphScopeArg = {\n [LEGACY_GRAPH_SCOPE_FIELD]: v.optional(v.string()),\n} as const;\n\nfunction normalizeOptionalString(value: unknown): string | undefined {\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction asMetadataRecord(metadata: unknown): Record<string, unknown> {\n if (metadata && typeof metadata === \"object\" && !Array.isArray(metadata)) {\n return { ...(metadata as Record<string, unknown>) };\n }\n return {};\n}\n\nexport function readLegacyProjectId(\n source: Record<string, unknown>\n): string | undefined {\n return normalizeOptionalString(source[LEGACY_PROJECT_FIELD]);\n}\n\nexport function readLegacyGraphScopeId(\n source: Record<string, unknown>\n): string | undefined {\n return normalizeOptionalString(source[LEGACY_GRAPH_SCOPE_FIELD]);\n}\n\nexport function mergeLegacyGraphScopeMetadata(\n metadata: unknown,\n legacyGraphScopeId: string | undefined\n): Record<string, unknown> | undefined {\n if (metadata === undefined && legacyGraphScopeId === undefined) {\n return undefined;\n }\n\n const nextMetadata = asMetadataRecord(metadata);\n if (legacyGraphScopeId !== undefined) {\n nextMetadata[LEGACY_GRAPH_SCOPE_FIELD] = legacyGraphScopeId;\n }\n return nextMetadata;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import * as convex_values from 'convex/values';
2
+
3
+ declare const permissiveReturn: convex_values.VAny<any, "required", string>;
4
+ declare const looseJsonObject: convex_values.VRecord<Record<string, any>, convex_values.VString<string, "required">, convex_values.VAny<any, "required", string>, "required", string>;
5
+ declare const looseJsonArray: convex_values.VArray<any[], convex_values.VAny<any, "required", string>, "required">;
6
+ declare const looseJsonValue: convex_values.VUnion<string | number | boolean | any[] | Record<string, any> | null, [convex_values.VString<string, "required">, convex_values.VFloat64<number, "required">, convex_values.VBoolean<boolean, "required">, convex_values.VNull<null, "required">, convex_values.VRecord<Record<string, any>, convex_values.VString<string, "required">, convex_values.VAny<any, "required", string>, "required", string>, convex_values.VArray<any[], convex_values.VAny<any, "required", string>, "required">], "required", string>;
7
+
8
+ export { looseJsonArray, looseJsonObject, looseJsonValue, permissiveReturn };
@@ -0,0 +1,18 @@
1
+ import { v } from 'convex/values';
2
+
3
+ // src/schema-helpers/validators.ts
4
+ var permissiveReturn = v.any();
5
+ var looseJsonObject = v.record(v.string(), v.any());
6
+ var looseJsonArray = v.array(v.any());
7
+ var looseJsonValue = v.union(
8
+ v.string(),
9
+ v.number(),
10
+ v.boolean(),
11
+ v.null(),
12
+ looseJsonObject,
13
+ looseJsonArray
14
+ );
15
+
16
+ export { looseJsonArray, looseJsonObject, looseJsonValue, permissiveReturn };
17
+ //# sourceMappingURL=validators.js.map
18
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema-helpers/validators.ts"],"names":[],"mappings":";;;AAEO,IAAM,gBAAA,GAAmB,EAAE,GAAA;AAC3B,IAAM,eAAA,GAAkB,EAAE,MAAA,CAAO,CAAA,CAAE,QAAO,EAAG,CAAA,CAAE,KAAK;AACpD,IAAM,cAAA,GAAiB,CAAA,CAAE,KAAA,CAAM,CAAA,CAAE,KAAK;AACtC,IAAM,iBAAiB,CAAA,CAAE,KAAA;AAAA,EAC9B,EAAE,MAAA,EAAO;AAAA,EACT,EAAE,MAAA,EAAO;AAAA,EACT,EAAE,OAAA,EAAQ;AAAA,EACV,EAAE,IAAA,EAAK;AAAA,EACP,eAAA;AAAA,EACA;AACF","file":"validators.js","sourcesContent":["import { v } from \"convex/values\";\n\nexport const permissiveReturn = v.any();\nexport const looseJsonObject = v.record(v.string(), v.any());\nexport const looseJsonArray = v.array(v.any());\nexport const looseJsonValue = v.union(\n v.string(),\n v.number(),\n v.boolean(),\n v.null(),\n looseJsonObject,\n looseJsonArray\n);\n"]}
@@ -0,0 +1,74 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const ComponentTableManifestSchema: z.ZodObject<{
4
+ manifestVersion: z.ZodString;
5
+ componentName: z.ZodEnum<["kernel", "identity"]>;
6
+ tier: z.ZodEnum<["K", "I"]>;
7
+ packageVersion: z.ZodString;
8
+ tables: z.ZodArray<z.ZodObject<{
9
+ name: z.ZodString;
10
+ fields: z.ZodArray<z.ZodObject<{
11
+ name: z.ZodString;
12
+ type: z.ZodString;
13
+ optional: z.ZodBoolean;
14
+ validator: z.ZodOptional<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ type: string;
17
+ name: string;
18
+ optional: boolean;
19
+ validator?: string | undefined;
20
+ }, {
21
+ type: string;
22
+ name: string;
23
+ optional: boolean;
24
+ validator?: string | undefined;
25
+ }>, "many">;
26
+ }, "strip", z.ZodTypeAny, {
27
+ name: string;
28
+ fields: {
29
+ type: string;
30
+ name: string;
31
+ optional: boolean;
32
+ validator?: string | undefined;
33
+ }[];
34
+ }, {
35
+ name: string;
36
+ fields: {
37
+ type: string;
38
+ name: string;
39
+ optional: boolean;
40
+ validator?: string | undefined;
41
+ }[];
42
+ }>, "many">;
43
+ }, "strip", z.ZodTypeAny, {
44
+ tier: "K" | "I";
45
+ manifestVersion: string;
46
+ componentName: "kernel" | "identity";
47
+ packageVersion: string;
48
+ tables: {
49
+ name: string;
50
+ fields: {
51
+ type: string;
52
+ name: string;
53
+ optional: boolean;
54
+ validator?: string | undefined;
55
+ }[];
56
+ }[];
57
+ }, {
58
+ tier: "K" | "I";
59
+ manifestVersion: string;
60
+ componentName: "kernel" | "identity";
61
+ packageVersion: string;
62
+ tables: {
63
+ name: string;
64
+ fields: {
65
+ type: string;
66
+ name: string;
67
+ optional: boolean;
68
+ validator?: string | undefined;
69
+ }[];
70
+ }[];
71
+ }>;
72
+ type ComponentTableManifest = z.infer<typeof ComponentTableManifestSchema>;
73
+
74
+ export { type ComponentTableManifest, ComponentTableManifestSchema };
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/schemas/component-table-manifest.ts
4
+ var ComponentTableManifestSchema = z.object({
5
+ manifestVersion: z.string(),
6
+ componentName: z.enum(["kernel", "identity"]),
7
+ tier: z.enum(["K", "I"]),
8
+ packageVersion: z.string(),
9
+ tables: z.array(
10
+ z.object({
11
+ name: z.string(),
12
+ fields: z.array(
13
+ z.object({
14
+ name: z.string(),
15
+ type: z.string(),
16
+ optional: z.boolean(),
17
+ validator: z.string().optional()
18
+ })
19
+ )
20
+ })
21
+ )
22
+ });
23
+
24
+ export { ComponentTableManifestSchema };
25
+ //# sourceMappingURL=component-table-manifest.js.map
26
+ //# sourceMappingURL=component-table-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/component-table-manifest.ts"],"names":[],"mappings":";;;AAEO,IAAM,4BAAA,GAA+B,EAAE,MAAA,CAAO;AAAA,EACnD,eAAA,EAAiB,EAAE,MAAA,EAAO;AAAA,EAC1B,eAAe,CAAA,CAAE,IAAA,CAAK,CAAC,QAAA,EAAU,UAAU,CAAC,CAAA;AAAA,EAC5C,MAAM,CAAA,CAAE,IAAA,CAAK,CAAC,GAAA,EAAK,GAAG,CAAC,CAAA;AAAA,EACvB,cAAA,EAAgB,EAAE,MAAA,EAAO;AAAA,EACzB,QAAQ,CAAA,CAAE,KAAA;AAAA,IACR,EAAE,MAAA,CAAO;AAAA,MACP,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,MACf,QAAQ,CAAA,CAAE,KAAA;AAAA,QACR,EAAE,MAAA,CAAO;AAAA,UACP,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,UACf,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA,UACf,QAAA,EAAU,EAAE,OAAA,EAAQ;AAAA,UACpB,SAAA,EAAW,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,SAChC;AAAA;AACH,KACD;AAAA;AAEL,CAAC","file":"component-table-manifest.js","sourcesContent":["import { z } from \"zod\";\n\nexport const ComponentTableManifestSchema = z.object({\n manifestVersion: z.string(),\n componentName: z.enum([\"kernel\", \"identity\"]),\n tier: z.enum([\"K\", \"I\"]),\n packageVersion: z.string(),\n tables: z.array(\n z.object({\n name: z.string(),\n fields: z.array(\n z.object({\n name: z.string(),\n type: z.string(),\n optional: z.boolean(),\n validator: z.string().optional(),\n })\n ),\n })\n ),\n});\n\nexport type ComponentTableManifest = z.infer<\n typeof ComponentTableManifestSchema\n>;\n"]}