@lucern/sdk 0.2.0-alpha.1 → 0.2.0-alpha.10

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 (275) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +691 -61
  3. package/dist/adminClient.d.ts +409 -0
  4. package/dist/adminClient.js +755 -0
  5. package/dist/adminClient.js.map +1 -0
  6. package/dist/answersClient.d.ts +23 -0
  7. package/dist/answersClient.js +333 -0
  8. package/dist/answersClient.js.map +1 -0
  9. package/dist/{packages/sdk/src/audiencesClient.d.ts → audiencesClient.d.ts} +30 -18
  10. package/dist/audiencesClient.js +472 -0
  11. package/dist/audiencesClient.js.map +1 -0
  12. package/dist/auditClient.d.ts +29 -0
  13. package/dist/auditClient.js +386 -0
  14. package/dist/auditClient.js.map +1 -0
  15. package/dist/beliefsClient.d.ts +242 -0
  16. package/dist/beliefsClient.js +616 -0
  17. package/dist/beliefsClient.js.map +1 -0
  18. package/dist/client.d.ts +2398 -0
  19. package/dist/client.js +6378 -0
  20. package/dist/client.js.map +1 -0
  21. package/dist/contextClient.d.ts +27 -0
  22. package/dist/contextClient.js +396 -0
  23. package/dist/contextClient.js.map +1 -0
  24. package/dist/contextFacade.d.ts +2 -0
  25. package/dist/contextFacade.js +73 -0
  26. package/dist/contextFacade.js.map +1 -0
  27. package/dist/{lucern/packages/domain-context/src/context-pack-compiler.d.ts → contextPackCompiler.d.ts} +11 -10
  28. package/dist/contextPackCompiler.js +1091 -0
  29. package/dist/contextPackCompiler.js.map +1 -0
  30. package/dist/contextPackPolicy.d.ts +84 -0
  31. package/dist/contextPackPolicy.js +347 -0
  32. package/dist/contextPackPolicy.js.map +1 -0
  33. package/dist/contextPackSchema.d.ts +7 -0
  34. package/dist/contextPackSchema.js +203 -0
  35. package/dist/contextPackSchema.js.map +1 -0
  36. package/dist/contextTypes.d.ts +135 -0
  37. package/dist/contextTypes.js +3 -0
  38. package/dist/contextTypes.js.map +1 -0
  39. package/dist/contracts/api-enums.contract.d.ts +81 -0
  40. package/dist/contracts/api-enums.contract.js +98 -0
  41. package/dist/contracts/api-enums.contract.js.map +1 -0
  42. package/dist/{lucern/contracts/src → contracts}/auth-session.contract.d.ts +14 -12
  43. package/dist/contracts/auth-session.contract.js +48 -0
  44. package/dist/contracts/auth-session.contract.js.map +1 -0
  45. package/dist/{lucern/contracts/src → contracts}/context-pack.contract.d.ts +56 -58
  46. package/dist/contracts/context-pack.contract.js +98 -0
  47. package/dist/contracts/context-pack.contract.js.map +1 -0
  48. package/dist/contracts/contextPack.d.ts +1 -0
  49. package/dist/contracts/contextPack.js +98 -0
  50. package/dist/contracts/contextPack.js.map +1 -0
  51. package/dist/contracts/index.d.ts +9 -0
  52. package/dist/contracts/index.js +4928 -0
  53. package/dist/contracts/index.js.map +1 -0
  54. package/dist/{lucern/contracts/src → contracts}/lens-filter.contract.d.ts +10 -8
  55. package/dist/contracts/lens-filter.contract.js +71 -0
  56. package/dist/contracts/lens-filter.contract.js.map +1 -0
  57. package/dist/contracts/lens-workflow.contract.d.ts +87 -0
  58. package/dist/contracts/lens-workflow.contract.js +123 -0
  59. package/dist/contracts/lens-workflow.contract.js.map +1 -0
  60. package/dist/contracts/lensFilter.d.ts +1 -0
  61. package/dist/contracts/lensFilter.js +71 -0
  62. package/dist/contracts/lensFilter.js.map +1 -0
  63. package/dist/contracts/lensWorkflow.d.ts +2 -0
  64. package/dist/contracts/lensWorkflow.js +123 -0
  65. package/dist/contracts/lensWorkflow.js.map +1 -0
  66. package/dist/contracts/mcp-tools.contract.d.ts +1 -0
  67. package/dist/contracts/mcp-tools.contract.js +3016 -0
  68. package/dist/contracts/mcp-tools.contract.js.map +1 -0
  69. package/dist/contracts/mcpTools.d.ts +1 -0
  70. package/dist/contracts/mcpTools.js +3016 -0
  71. package/dist/contracts/mcpTools.js.map +1 -0
  72. package/dist/contracts/prompt.contract.d.ts +26 -0
  73. package/dist/contracts/prompt.contract.js +12 -0
  74. package/dist/contracts/prompt.contract.js.map +1 -0
  75. package/dist/contracts/prompt.d.ts +1 -0
  76. package/dist/contracts/prompt.js +12 -0
  77. package/dist/contracts/prompt.js.map +1 -0
  78. package/dist/contracts/sdk-tools.contract.d.ts +2 -0
  79. package/dist/contracts/sdk-tools.contract.js +4164 -0
  80. package/dist/contracts/sdk-tools.contract.js.map +1 -0
  81. package/dist/contracts/sdkTools.d.ts +2 -0
  82. package/dist/contracts/sdkTools.js +4164 -0
  83. package/dist/contracts/sdkTools.js.map +1 -0
  84. package/dist/contracts/workflow-runtime.contract.d.ts +163 -0
  85. package/dist/contracts/workflow-runtime.contract.js +245 -0
  86. package/dist/contracts/workflow-runtime.contract.js.map +1 -0
  87. package/dist/contracts/workflowRuntime.d.ts +1 -0
  88. package/dist/contracts/workflowRuntime.js +245 -0
  89. package/dist/contracts/workflowRuntime.js.map +1 -0
  90. package/dist/{packages/sdk/src/controlObjectOwnership.d.ts → controlObjectOwnership.d.ts} +35 -18
  91. package/dist/controlObjectOwnership.js +215 -0
  92. package/dist/controlObjectOwnership.js.map +1 -0
  93. package/dist/{packages/sdk/src/coreClient.d.ts → coreClient.d.ts} +38 -14
  94. package/dist/coreClient.js +339 -0
  95. package/dist/coreClient.js.map +1 -0
  96. package/dist/customTools.d.ts +88 -0
  97. package/dist/customTools.js +248 -0
  98. package/dist/customTools.js.map +1 -0
  99. package/dist/decisionsClient.d.ts +111 -0
  100. package/dist/decisionsClient.js +522 -0
  101. package/dist/decisionsClient.js.map +1 -0
  102. package/dist/domainContext.d.ts +1 -0
  103. package/dist/domainContext.js +3 -0
  104. package/dist/domainContext.js.map +1 -0
  105. package/dist/events.d.ts +178 -0
  106. package/dist/events.js +249 -0
  107. package/dist/events.js.map +1 -0
  108. package/dist/eventsCore.d.ts +49 -0
  109. package/dist/eventsCore.js +429 -0
  110. package/dist/eventsCore.js.map +1 -0
  111. package/dist/evidenceClient.d.ts +119 -0
  112. package/dist/evidenceClient.js +350 -0
  113. package/dist/evidenceClient.js.map +1 -0
  114. package/dist/facade/context.d.ts +18 -0
  115. package/dist/facade/context.js +73 -0
  116. package/dist/facade/context.js.map +1 -0
  117. package/dist/gatewayFacades.d.ts +589 -0
  118. package/dist/gatewayFacades.js +1976 -0
  119. package/dist/gatewayFacades.js.map +1 -0
  120. package/dist/graphClient.d.ts +271 -0
  121. package/dist/graphClient.js +698 -0
  122. package/dist/graphClient.js.map +1 -0
  123. package/dist/{packages/sdk/src/harnessClient.d.ts → harnessClient.d.ts} +127 -35
  124. package/dist/harnessClient.js +607 -0
  125. package/dist/harnessClient.js.map +1 -0
  126. package/dist/identityClient.d.ts +140 -0
  127. package/dist/identityClient.js +497 -0
  128. package/dist/identityClient.js.map +1 -0
  129. package/dist/index.d.ts +45 -0
  130. package/dist/index.js +5263 -2579
  131. package/dist/index.js.map +1 -1
  132. package/dist/learningClient.d.ts +46 -0
  133. package/dist/learningClient.js +409 -0
  134. package/dist/learningClient.js.map +1 -0
  135. package/dist/{packages/sdk/src/mcpParityClient.d.ts → mcpParityClient.d.ts} +11 -5
  136. package/dist/mcpParityClient.js +516 -0
  137. package/dist/mcpParityClient.js.map +1 -0
  138. package/dist/mcpParitySurface.d.ts +12 -0
  139. package/dist/mcpParitySurface.js +65 -0
  140. package/dist/mcpParitySurface.js.map +1 -0
  141. package/dist/mcpTools-DPZxowDX.d.ts +254 -0
  142. package/dist/{packages/sdk/src/ontologyClient.d.ts → ontologyClient.d.ts} +44 -22
  143. package/dist/ontologyClient.js +513 -0
  144. package/dist/ontologyClient.js.map +1 -0
  145. package/dist/packRuntime.d.ts +2 -0
  146. package/dist/packRuntime.js +3 -0
  147. package/dist/packRuntime.js.map +1 -0
  148. package/dist/packsClient.d.ts +131 -0
  149. package/dist/packsClient.js +525 -0
  150. package/dist/packsClient.js.map +1 -0
  151. package/dist/{packages/sdk/src/policyClient.d.ts → policyClient.d.ts} +113 -18
  152. package/dist/policyClient.js +625 -0
  153. package/dist/policyClient.js.map +1 -0
  154. package/dist/realtime/index.d.ts +29 -0
  155. package/dist/realtime/index.js +23 -0
  156. package/dist/realtime/index.js.map +1 -0
  157. package/dist/realtime/refs.d.ts +17 -0
  158. package/dist/realtime/refs.js +9 -0
  159. package/dist/realtime/refs.js.map +1 -0
  160. package/dist/reportsClient.d.ts +41 -0
  161. package/dist/reportsClient.js +418 -0
  162. package/dist/reportsClient.js.map +1 -0
  163. package/dist/schemaClient.d.ts +64 -0
  164. package/dist/schemaClient.js +434 -0
  165. package/dist/schemaClient.js.map +1 -0
  166. package/dist/sdkSurface.d.ts +61 -0
  167. package/dist/sdkSurface.js +112 -0
  168. package/dist/sdkSurface.js.map +1 -0
  169. package/dist/sdkTools-CwXJDACb.d.ts +150 -0
  170. package/dist/sourcesClient.d.ts +24 -0
  171. package/dist/sourcesClient.js +339 -0
  172. package/dist/sourcesClient.js.map +1 -0
  173. package/dist/topicsClient.d.ts +84 -0
  174. package/dist/topicsClient.js +492 -0
  175. package/dist/topicsClient.js.map +1 -0
  176. package/dist/types.d.ts +715 -0
  177. package/dist/types.js +3 -0
  178. package/dist/types.js.map +1 -0
  179. package/dist/version.d.ts +4 -0
  180. package/dist/version.js +6 -0
  181. package/dist/version.js.map +1 -0
  182. package/dist/workflowClient.d.ts +316 -0
  183. package/dist/workflowClient.js +830 -0
  184. package/dist/workflowClient.js.map +1 -0
  185. package/package.json +41 -37
  186. package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +0 -84
  187. package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +0 -151
  188. package/dist/lucern/contracts/src/workflow-runtime.contract.d.ts +0 -161
  189. package/dist/lucern/mcp-server/src/context-pack-policy.d.ts +0 -119
  190. package/dist/lucern/mcp-server/src/context-pack-schema.d.ts +0 -18
  191. package/dist/lucern/modules/graph-primitives/src/ontology-matching.d.ts +0 -78
  192. package/dist/lucern/modules/graph-primitives/src/text-matching.d.ts +0 -53
  193. package/dist/lucern/packages/client-core/src/beliefs.d.ts +0 -30
  194. package/dist/lucern/packages/client-core/src/context.d.ts +0 -29
  195. package/dist/lucern/packages/client-core/src/contradictions.d.ts +0 -11
  196. package/dist/lucern/packages/client-core/src/edges.d.ts +0 -11
  197. package/dist/lucern/packages/client-core/src/events.d.ts +0 -9
  198. package/dist/lucern/packages/client-core/src/evidence.d.ts +0 -21
  199. package/dist/lucern/packages/client-core/src/graph.d.ts +0 -17
  200. package/dist/lucern/packages/client-core/src/identity.d.ts +0 -7
  201. package/dist/lucern/packages/client-core/src/ids.d.ts +0 -7
  202. package/dist/lucern/packages/client-core/src/ontologies.d.ts +0 -13
  203. package/dist/lucern/packages/client-core/src/questions.d.ts +0 -39
  204. package/dist/lucern/packages/client-core/src/search.d.ts +0 -7
  205. package/dist/lucern/packages/client-core/src/tasks.d.ts +0 -13
  206. package/dist/lucern/packages/client-core/src/topics.d.ts +0 -17
  207. package/dist/lucern/packages/client-core/src/webhooks.d.ts +0 -35
  208. package/dist/lucern/packages/client-core/src/worktrees.d.ts +0 -17
  209. package/dist/lucern/packages/domain-beliefs/src/beliefs.d.ts +0 -283
  210. package/dist/lucern/packages/domain-beliefs/src/index.d.ts +0 -1
  211. package/dist/lucern/packages/domain-context/src/compile.d.ts +0 -11
  212. package/dist/lucern/packages/domain-context/src/index.d.ts +0 -4
  213. package/dist/lucern/packages/domain-context/src/ports.d.ts +0 -58
  214. package/dist/lucern/packages/domain-context/src/public-types.d.ts +0 -1
  215. package/dist/lucern/packages/domain-edges/src/contradictions.d.ts +0 -59
  216. package/dist/lucern/packages/domain-edges/src/edges.d.ts +0 -91
  217. package/dist/lucern/packages/domain-edges/src/index.d.ts +0 -2
  218. package/dist/lucern/packages/domain-evidence/src/evidence.d.ts +0 -115
  219. package/dist/lucern/packages/domain-evidence/src/index.d.ts +0 -1
  220. package/dist/lucern/packages/domain-graph/src/graph.d.ts +0 -150
  221. package/dist/lucern/packages/domain-identity/src/index.d.ts +0 -1
  222. package/dist/lucern/packages/domain-identity/src/whoami.d.ts +0 -13
  223. package/dist/lucern/packages/domain-ontologies/src/ontologies.d.ts +0 -123
  224. package/dist/lucern/packages/domain-questions/src/index.d.ts +0 -1
  225. package/dist/lucern/packages/domain-questions/src/questions.d.ts +0 -147
  226. package/dist/lucern/packages/domain-search/src/search.d.ts +0 -97
  227. package/dist/lucern/packages/domain-tasks/src/index.d.ts +0 -1
  228. package/dist/lucern/packages/domain-tasks/src/tasks.d.ts +0 -102
  229. package/dist/lucern/packages/domain-topics/src/index.d.ts +0 -1
  230. package/dist/lucern/packages/domain-topics/src/topics.d.ts +0 -147
  231. package/dist/lucern/packages/domain-worktrees/src/index.d.ts +0 -1
  232. package/dist/lucern/packages/domain-worktrees/src/worktrees.d.ts +0 -185
  233. package/dist/lucern/packages/events/src/index.d.ts +0 -4
  234. package/dist/lucern/packages/events/src/matching.d.ts +0 -3
  235. package/dist/lucern/packages/events/src/outbox.d.ts +0 -15
  236. package/dist/lucern/packages/events/src/types.d.ts +0 -151
  237. package/dist/lucern/packages/events/src/webhooks.d.ts +0 -9
  238. package/dist/lucern/packages/sdk-typescript/src/facade/beliefs.d.ts +0 -15
  239. package/dist/lucern/packages/sdk-typescript/src/facade/context.d.ts +0 -12
  240. package/dist/lucern/packages/sdk-typescript/src/facade/contradictions.d.ts +0 -7
  241. package/dist/lucern/packages/sdk-typescript/src/facade/edges.d.ts +0 -7
  242. package/dist/lucern/packages/sdk-typescript/src/facade/events.d.ts +0 -6
  243. package/dist/lucern/packages/sdk-typescript/src/facade/evidence.d.ts +0 -21
  244. package/dist/lucern/packages/sdk-typescript/src/facade/graph.d.ts +0 -10
  245. package/dist/lucern/packages/sdk-typescript/src/facade/identity.d.ts +0 -5
  246. package/dist/lucern/packages/sdk-typescript/src/facade/ontologies.d.ts +0 -8
  247. package/dist/lucern/packages/sdk-typescript/src/facade/questions.d.ts +0 -39
  248. package/dist/lucern/packages/sdk-typescript/src/facade/search.d.ts +0 -5
  249. package/dist/lucern/packages/sdk-typescript/src/facade/tasks.d.ts +0 -8
  250. package/dist/lucern/packages/sdk-typescript/src/facade/topics.d.ts +0 -10
  251. package/dist/lucern/packages/sdk-typescript/src/facade/webhooks.d.ts +0 -16
  252. package/dist/lucern/packages/sdk-typescript/src/facade/worktrees.d.ts +0 -10
  253. package/dist/lucern/packages/sdk-typescript/src/index.d.ts +0 -28
  254. package/dist/packages/sdk/src/adminClient.d.ts +0 -89
  255. package/dist/packages/sdk/src/answersClient.d.ts +0 -5
  256. package/dist/packages/sdk/src/auditClient.d.ts +0 -23
  257. package/dist/packages/sdk/src/beliefsClient.d.ts +0 -54
  258. package/dist/packages/sdk/src/client.d.ts +0 -1610
  259. package/dist/packages/sdk/src/contextClient.d.ts +0 -9
  260. package/dist/packages/sdk/src/contracts/api-enums.contract.d.ts +0 -58
  261. package/dist/packages/sdk/src/customTools.d.ts +0 -65
  262. package/dist/packages/sdk/src/decisionsClient.d.ts +0 -110
  263. package/dist/packages/sdk/src/graphClient.d.ts +0 -209
  264. package/dist/packages/sdk/src/identityClient.d.ts +0 -104
  265. package/dist/packages/sdk/src/index.d.ts +0 -28
  266. package/dist/packages/sdk/src/learningClient.d.ts +0 -43
  267. package/dist/packages/sdk/src/mcpParitySurface.d.ts +0 -8
  268. package/dist/packages/sdk/src/packsClient.d.ts +0 -101
  269. package/dist/packages/sdk/src/reportsClient.d.ts +0 -31
  270. package/dist/packages/sdk/src/schemaClient.d.ts +0 -54
  271. package/dist/packages/sdk/src/sdkSurface.d.ts +0 -56
  272. package/dist/packages/sdk/src/topicsClient.d.ts +0 -45
  273. package/dist/packages/sdk/src/types.d.ts +0 -489
  274. package/dist/packages/sdk/src/version.d.ts +0 -2
  275. package/dist/packages/sdk/src/workflowClient.d.ts +0 -274
@@ -1,115 +0,0 @@
1
- export type EvidenceTargetType = "belief" | "question";
2
- type EvidenceRelation = "supports" | "contradicts" | "neutral";
3
- export type EvidenceRecord = {
4
- id: string;
5
- nodeId: string;
6
- evidenceId: string;
7
- globalId?: string;
8
- topicId?: string;
9
- text: string;
10
- title?: string;
11
- kind?: string;
12
- source?: string;
13
- sourceType?: string;
14
- externalSourceType?: string;
15
- status?: string;
16
- relation?: EvidenceRelation;
17
- confidence?: number;
18
- linkedBeliefId?: string;
19
- linkedQuestionId?: string;
20
- createdAt?: number;
21
- updatedAt?: number;
22
- metadata?: Record<string, unknown>;
23
- };
24
- export type EvidenceListResult = {
25
- evidence: EvidenceRecord[];
26
- nextCursor: null;
27
- };
28
- export type EvidenceSearchResult = {
29
- evidenceId: string;
30
- nodeId: string;
31
- globalId?: string;
32
- text: string;
33
- source?: string;
34
- kind?: string;
35
- relevanceScore: number;
36
- };
37
- export type EvidenceSearchPage = {
38
- results: EvidenceSearchResult[];
39
- nextCursor: null;
40
- };
41
- export type LinkEvidenceResult = {
42
- edgeId: string;
43
- evidenceId: string;
44
- targetId: string;
45
- targetType: EvidenceTargetType;
46
- weight: number;
47
- beliefId?: string;
48
- questionId?: string;
49
- };
50
- export type CreateEvidenceInput = {
51
- topicId: string;
52
- text: string;
53
- source?: string;
54
- targetId?: string;
55
- targetType?: EvidenceTargetType;
56
- weight?: number;
57
- metadata?: Record<string, unknown>;
58
- title?: string;
59
- content?: string;
60
- contentType?: string;
61
- kind?: string;
62
- };
63
- export type ListEvidenceQuery = {
64
- topicId?: string;
65
- targetId?: string;
66
- limit?: number;
67
- cursor?: string;
68
- };
69
- export type SearchEvidenceQuery = {
70
- q: string;
71
- topicId?: string;
72
- targetId?: string;
73
- limit?: number;
74
- cursor?: string;
75
- };
76
- type TargetRef = {
77
- type: EvidenceTargetType;
78
- rawId: string;
79
- };
80
- type EvidenceCreatePortInput = Omit<CreateEvidenceInput, "targetId"> & {
81
- target?: TargetRef;
82
- weight: number;
83
- };
84
- type EvidenceLinkPortInput = {
85
- evidenceRawId: string;
86
- targetRawId: string;
87
- weight: number;
88
- rationale?: string;
89
- };
90
- export type EvidencePort = {
91
- fetchEvidence: (rawId: string) => Promise<unknown | null>;
92
- listEvidenceByTopic: (args: {
93
- topicId: string;
94
- limit?: number;
95
- }) => Promise<unknown[]>;
96
- listEvidenceForBelief: (rawBeliefId: string) => Promise<unknown[]>;
97
- listEvidenceForQuestion: (rawQuestionId: string) => Promise<unknown[]>;
98
- createEvidence: (input: EvidenceCreatePortInput) => Promise<unknown>;
99
- linkEvidenceToBelief: (input: EvidenceLinkPortInput) => Promise<unknown>;
100
- linkEvidenceToQuestion: (input: EvidenceLinkPortInput) => Promise<unknown>;
101
- };
102
- export declare function getEvidence(deps: EvidencePort, input: {
103
- id: string;
104
- }): Promise<EvidenceRecord>;
105
- export declare function listEvidence(deps: EvidencePort, query: ListEvidenceQuery): Promise<EvidenceListResult>;
106
- export declare function searchEvidence(deps: EvidencePort, query: SearchEvidenceQuery): Promise<EvidenceSearchPage>;
107
- export declare function createEvidence(deps: EvidencePort, input: CreateEvidenceInput): Promise<EvidenceRecord>;
108
- export declare function linkEvidence(deps: EvidencePort, input: {
109
- evidenceId: string;
110
- targetId: string;
111
- targetType?: string;
112
- weight?: number;
113
- rationale?: string;
114
- }): Promise<LinkEvidenceResult>;
115
- export {};
@@ -1 +0,0 @@
1
- export * from "./evidence";
@@ -1,150 +0,0 @@
1
- type GraphDirection = "up" | "down" | "both";
2
- type GraphNodeRecord = Record<string, unknown>;
3
- type GraphEdgeRecord = Record<string, unknown>;
4
- type GraphBeliefGapRecord = {
5
- beliefId: string;
6
- text: string;
7
- confidence: number | null;
8
- suggestedQuestions: string[];
9
- };
10
- export type GraphNeighborhoodInput = {
11
- globalId?: string;
12
- globalIds?: string[];
13
- maxDepth?: number;
14
- };
15
- export type GraphNeighborhoodResult = {
16
- nodes: GraphNodeRecord[];
17
- edges: GraphEdgeRecord[];
18
- depth: number;
19
- };
20
- export type GraphTraverseInput = {
21
- startNode: string;
22
- direction?: string;
23
- maxDepth?: number;
24
- topicId?: string;
25
- };
26
- export type GraphTraverseResult = {
27
- startNode: string;
28
- direction: GraphDirection;
29
- maxDepth: number;
30
- nodes: GraphNodeRecord[];
31
- edges: GraphEdgeRecord[];
32
- depth: number;
33
- topicId?: string;
34
- };
35
- export type GraphAnalyzeInput = {
36
- topicId: string;
37
- metric?: string;
38
- limit?: number;
39
- };
40
- export type GraphAnalyzeResult = {
41
- topicId: string;
42
- metric: string;
43
- payload: Record<string, unknown>;
44
- };
45
- export type GraphBiasInput = {
46
- topicId: string;
47
- threshold?: number;
48
- limit?: number;
49
- };
50
- export type GraphBiasBelief = {
51
- nodeId: string;
52
- biasScore: number;
53
- riskLevel: string;
54
- supportingCount: number;
55
- challengingCount: number;
56
- };
57
- export type GraphBiasResult = {
58
- topicId: string;
59
- metric: "confirmation_bias";
60
- threshold: number;
61
- beliefs: GraphBiasBelief[];
62
- payload: Record<string, unknown>;
63
- };
64
- export type GraphGapsInput = {
65
- topicId: string;
66
- minConfidence?: number;
67
- };
68
- export type GraphGapsResult = {
69
- topicId: string;
70
- gaps: GraphBeliefGapRecord[];
71
- totalGaps: number;
72
- };
73
- type GraphBeliefRecord = {
74
- beliefId?: string;
75
- nodeId?: string;
76
- topicId?: string;
77
- text?: string;
78
- canonicalText?: string;
79
- confidence?: number | null;
80
- };
81
- type GraphQuestionRecord = {
82
- questionId?: string;
83
- nodeId?: string;
84
- linkedBeliefId?: string;
85
- };
86
- type GraphTestingEdgeRecord = {
87
- fromNodeId?: string;
88
- toNodeId?: string;
89
- edgeType?: string;
90
- };
91
- export type GraphFalsifyInput = {
92
- topicId?: string;
93
- beliefId?: string;
94
- beliefIds?: string[];
95
- minConfidence?: number;
96
- };
97
- export type GraphFalsificationQuestion = {
98
- questionText: string;
99
- falsificationPotential: number;
100
- targetBeliefId: string;
101
- targetBeliefText: string;
102
- };
103
- export type GraphFalsifyResult = {
104
- topicId: string;
105
- questions: GraphFalsificationQuestion[];
106
- };
107
- export type GraphPort = {
108
- neighborhood: (input: {
109
- globalIds: string[];
110
- maxDepth: number;
111
- }) => Promise<unknown>;
112
- traverse: (input: {
113
- startNode: string;
114
- direction: GraphDirection;
115
- maxDepth: number;
116
- topicId?: string;
117
- }) => Promise<unknown>;
118
- analyze: (input: {
119
- topicId: string;
120
- metric: string;
121
- limit?: number;
122
- }) => Promise<unknown>;
123
- bias: (input: {
124
- topicId: string;
125
- threshold: number;
126
- limit?: number;
127
- }) => Promise<unknown>;
128
- listBeliefs: (input: {
129
- topicId: string;
130
- minConfidence?: number;
131
- limit?: number;
132
- }) => Promise<GraphBeliefRecord[]>;
133
- fetchBelief: (input: {
134
- beliefId: string;
135
- }) => Promise<GraphBeliefRecord | null>;
136
- listQuestions: (input: {
137
- topicId: string;
138
- limit?: number;
139
- }) => Promise<GraphQuestionRecord[]>;
140
- listTestingEdges: (input: {
141
- topicId: string;
142
- }) => Promise<GraphTestingEdgeRecord[]>;
143
- };
144
- export declare function graphNeighborhood(deps: GraphPort, input: GraphNeighborhoodInput): Promise<GraphNeighborhoodResult>;
145
- export declare function graphTraverse(deps: GraphPort, input: GraphTraverseInput): Promise<GraphTraverseResult>;
146
- export declare function graphAnalyze(deps: GraphPort, input: GraphAnalyzeInput): Promise<GraphAnalyzeResult>;
147
- export declare function graphBias(deps: GraphPort, input: GraphBiasInput): Promise<GraphBiasResult>;
148
- export declare function graphGaps(deps: GraphPort, input: GraphGapsInput): Promise<GraphGapsResult>;
149
- export declare function graphFalsify(deps: GraphPort, input: GraphFalsifyInput): Promise<GraphFalsifyResult>;
150
- export {};
@@ -1 +0,0 @@
1
- export * from "./whoami";
@@ -1,13 +0,0 @@
1
- export type IdentitySummary = {
2
- principalId: string;
3
- principalType: string;
4
- tenantId?: string;
5
- workspaceId?: string;
6
- scopes?: string[];
7
- roles?: string[];
8
- };
9
- export type WhoamiPort = {
10
- resolveIdentitySummary: (() => IdentitySummary) | (() => Promise<IdentitySummary>);
11
- };
12
- export declare function normalizeIdentitySummary(value: IdentitySummary): IdentitySummary;
13
- export declare function whoami(deps: WhoamiPort): Promise<IdentitySummary>;
@@ -1,123 +0,0 @@
1
- type OntologyTier = "platform" | "pack" | "tenant";
2
- type OntologyStatus = "draft" | "active" | "deprecated" | "archived";
3
- type OntologyVersionStatus = "draft" | "published" | "deprecated";
4
- export type OntologyEntitySubtype = {
5
- value: string;
6
- label: string;
7
- description?: string;
8
- };
9
- export type OntologyEntityType = {
10
- value: string;
11
- label: string;
12
- description?: string;
13
- schema?: unknown;
14
- subtypes?: OntologyEntitySubtype[];
15
- };
16
- export type OntologyEdgeType = {
17
- value: string;
18
- label: string;
19
- description?: string;
20
- sourceTypes?: string[];
21
- targetTypes?: string[];
22
- constraintSeverity?: "warn" | "info";
23
- };
24
- export type OntologyPublishedVersion = {
25
- id: string;
26
- version: string;
27
- status: OntologyVersionStatus;
28
- entityTypes: OntologyEntityType[];
29
- edgeTypes: OntologyEdgeType[];
30
- releaseNotes?: string;
31
- publishedAt?: number;
32
- publishedBy?: string;
33
- };
34
- export type OntologyRecord = {
35
- id: string;
36
- ontologyId: string;
37
- ontologyKey: string;
38
- name: string;
39
- description?: string;
40
- tier?: OntologyTier;
41
- status?: OntologyStatus;
42
- tenantId?: string;
43
- parentOntologyId?: string;
44
- createdBy?: string;
45
- createdAt?: number;
46
- updatedAt?: number;
47
- publishedVersion: OntologyPublishedVersion | null;
48
- };
49
- export type OntologyListQuery = {
50
- tenantId?: string;
51
- tier?: OntologyTier | string;
52
- status?: OntologyStatus | string;
53
- };
54
- export type OntologyListResult = {
55
- ontologies: OntologyRecord[];
56
- total: number;
57
- };
58
- export type GetOntologyInput = {
59
- id?: string;
60
- ontologyKey?: string;
61
- tenantId?: string;
62
- };
63
- export type BindOntologyInput = {
64
- ontologyId: string;
65
- topicId: string;
66
- };
67
- export type OntologyBindingResult = {
68
- applied: true;
69
- source: "direct";
70
- ontologyId: string;
71
- ontologyKey: string;
72
- ontologyName: string;
73
- topicId: string;
74
- topicName?: string;
75
- updatedAt?: number;
76
- };
77
- export type OntologyTypeMatch = {
78
- entityType: string;
79
- label: string;
80
- score: number;
81
- reason: string;
82
- };
83
- export type OntologyMatchInput = {
84
- text: string;
85
- topicId?: string;
86
- ontologyId?: string;
87
- minScore?: number;
88
- limit?: number;
89
- };
90
- export type OntologyMatchResult = {
91
- text: string;
92
- matchCount: number;
93
- matches: OntologyTypeMatch[];
94
- ontologyId?: string;
95
- message?: string;
96
- };
97
- export type OntologiesPort = {
98
- fetchOntology: (rawId: string) => Promise<unknown | null>;
99
- fetchOntologyByKey?: (ontologyKey: string, tenantId?: string) => Promise<unknown | null>;
100
- listOntologies: (query: {
101
- tenantId?: string;
102
- tier?: OntologyTier;
103
- status?: OntologyStatus;
104
- }) => Promise<unknown[]>;
105
- fetchPublishedVersion: (ontologyRawId: string) => Promise<unknown | null>;
106
- bindOntologyToTopic: (args: {
107
- ontologyRawId: string;
108
- topicRawId: string;
109
- }) => Promise<unknown>;
110
- fetchTopic: (topicRawId: string) => Promise<unknown | null>;
111
- resolveMatchVocabulary: (input: {
112
- ontologyRawId?: string;
113
- topicRawId?: string;
114
- }) => Promise<{
115
- ontologyRawId?: string;
116
- entityTypes: OntologyEntityType[];
117
- } | null>;
118
- };
119
- export declare function listOntologies(deps: OntologiesPort, query?: OntologyListQuery): Promise<OntologyListResult>;
120
- export declare function getOntology(deps: OntologiesPort, input: GetOntologyInput): Promise<OntologyRecord>;
121
- export declare function bindOntology(deps: OntologiesPort, input: BindOntologyInput): Promise<OntologyBindingResult>;
122
- export declare function matchOntology(deps: OntologiesPort, input: OntologyMatchInput): Promise<OntologyMatchResult>;
123
- export {};
@@ -1 +0,0 @@
1
- export * from "./questions";
@@ -1,147 +0,0 @@
1
- type QuestionStatus = "open" | "researching" | "answered" | "parked" | "closed";
2
- type QuestionPriority = "low" | "medium" | "high" | "urgent";
3
- type AnswerConfidence = "weak" | "medium" | "strong";
4
- export type QuestionRecord = {
5
- id: string;
6
- nodeId: string;
7
- questionId: string;
8
- globalId?: string;
9
- topicId?: string;
10
- text: string;
11
- status: QuestionStatus;
12
- priority: QuestionPriority;
13
- category?: string;
14
- linkedBeliefId?: string;
15
- linkedWorktreeId?: string;
16
- answer?: string;
17
- createdAt?: number;
18
- updatedAt?: number;
19
- metadata?: Record<string, unknown>;
20
- };
21
- export type QuestionListResult = {
22
- questions: QuestionRecord[];
23
- nextCursor: null;
24
- };
25
- export type QuestionAnswerResult = {
26
- questionId: string;
27
- answerId: string;
28
- status: "answered";
29
- };
30
- export type QuestionArchiveResult = QuestionRecord & {
31
- previousStatus: string;
32
- newStatus: "archived";
33
- };
34
- export type CreateQuestionInput = {
35
- topicId: string;
36
- text: string;
37
- priority?: string;
38
- linkedBeliefId?: string;
39
- metadata?: Record<string, unknown>;
40
- };
41
- export type ListQuestionsQuery = {
42
- topicId?: string;
43
- status?: string;
44
- priority?: string;
45
- worktreeId?: string;
46
- limit?: number;
47
- cursor?: string;
48
- };
49
- type QuestionCreatePortInput = {
50
- topicId: string;
51
- text: string;
52
- priority?: QuestionPriority;
53
- linkedBeliefRawId?: string;
54
- metadata?: Record<string, unknown>;
55
- };
56
- type QuestionRefinePortInput = {
57
- questionRawId: string;
58
- text: string;
59
- rationale?: string;
60
- };
61
- type QuestionStatusPortInput = {
62
- questionRawId: string;
63
- status: QuestionStatus;
64
- rationale?: string;
65
- };
66
- type QuestionAnswerPortInput = {
67
- questionRawId: string;
68
- topicId: string;
69
- text: string;
70
- confidence?: AnswerConfidence;
71
- evidenceRawIds?: string[];
72
- rationale?: string;
73
- };
74
- export type QuestionsPort = {
75
- fetchQuestion: (rawId: string) => Promise<unknown | null>;
76
- listQuestionsByTopic: (args: {
77
- topicId: string;
78
- limit?: number;
79
- }) => Promise<unknown[]>;
80
- createQuestion: (input: QuestionCreatePortInput) => Promise<unknown>;
81
- refineQuestion: (input: QuestionRefinePortInput) => Promise<unknown>;
82
- updateQuestionStatus: (input: QuestionStatusPortInput) => Promise<unknown>;
83
- createAnswer: (input: QuestionAnswerPortInput) => Promise<unknown>;
84
- };
85
- export declare function createQuestion(deps: QuestionsPort, input: CreateQuestionInput): Promise<QuestionRecord>;
86
- export declare function getQuestion(deps: QuestionsPort, input: {
87
- id: string;
88
- }): Promise<QuestionRecord>;
89
- export declare function listQuestions(deps: QuestionsPort, query: ListQuestionsQuery): Promise<QuestionListResult>;
90
- export declare function refineQuestion(deps: QuestionsPort, input: {
91
- id: string;
92
- text: string;
93
- rationale?: string;
94
- }): Promise<{
95
- previousText: string;
96
- updatedText: string;
97
- id: string;
98
- nodeId: string;
99
- questionId: string;
100
- globalId?: string;
101
- topicId?: string;
102
- text: string;
103
- status: QuestionStatus;
104
- priority: QuestionPriority;
105
- category?: string;
106
- linkedBeliefId?: string;
107
- linkedWorktreeId?: string;
108
- answer?: string;
109
- createdAt?: number;
110
- updatedAt?: number;
111
- metadata?: Record<string, unknown>;
112
- }>;
113
- export declare function updateQuestionStatus(deps: QuestionsPort, input: {
114
- id: string;
115
- status: string;
116
- rationale?: string;
117
- }): Promise<{
118
- previousStatus: QuestionStatus;
119
- newStatus: QuestionStatus;
120
- id: string;
121
- nodeId: string;
122
- questionId: string;
123
- globalId?: string;
124
- topicId?: string;
125
- text: string;
126
- status: QuestionStatus;
127
- priority: QuestionPriority;
128
- category?: string;
129
- linkedBeliefId?: string;
130
- linkedWorktreeId?: string;
131
- answer?: string;
132
- createdAt?: number;
133
- updatedAt?: number;
134
- metadata?: Record<string, unknown>;
135
- }>;
136
- export declare function archiveQuestion(deps: QuestionsPort, input: {
137
- id: string;
138
- rationale?: string;
139
- }): Promise<QuestionArchiveResult>;
140
- export declare function answerQuestion(deps: QuestionsPort, input: {
141
- id: string;
142
- text: string;
143
- confidence?: string;
144
- evidenceIds?: string[];
145
- rationale?: string;
146
- }): Promise<QuestionAnswerResult>;
147
- export {};
@@ -1,97 +0,0 @@
1
- type SearchResourceType = "belief" | "evidence" | "question";
2
- type SearchBeliefRecord = {
3
- beliefId?: string;
4
- nodeId?: string;
5
- globalId?: string;
6
- text?: string;
7
- canonicalText?: string;
8
- confidence?: number | null;
9
- status?: string;
10
- };
11
- type SearchEvidenceRecord = {
12
- evidenceId?: string;
13
- nodeId?: string;
14
- globalId?: string;
15
- text?: string;
16
- source?: string;
17
- kind?: string;
18
- relevanceScore?: number;
19
- };
20
- type SearchQuestionRecord = {
21
- questionId?: string;
22
- nodeId?: string;
23
- globalId?: string;
24
- text?: string;
25
- status?: string;
26
- priority?: string;
27
- linkedBeliefId?: string;
28
- };
29
- export type SearchInput = {
30
- q: string;
31
- topicId: string;
32
- types?: SearchResourceType[];
33
- status?: string;
34
- minConfidence?: number;
35
- limit?: number;
36
- cursor?: string;
37
- };
38
- export type SearchBeliefHit = {
39
- type: "belief";
40
- beliefId: string;
41
- nodeId: string;
42
- globalId?: string;
43
- text: string;
44
- confidence: number | null;
45
- status?: string;
46
- relevanceScore: number;
47
- };
48
- export type SearchEvidenceHit = {
49
- type: "evidence";
50
- evidenceId: string;
51
- nodeId: string;
52
- globalId?: string;
53
- text: string;
54
- source?: string;
55
- kind?: string;
56
- relevanceScore: number;
57
- };
58
- export type SearchQuestionHit = {
59
- type: "question";
60
- questionId: string;
61
- nodeId: string;
62
- globalId?: string;
63
- text: string;
64
- status?: string;
65
- priority?: string;
66
- linkedBeliefId?: string;
67
- relevanceScore: number;
68
- };
69
- export type SearchResult = SearchBeliefHit | SearchEvidenceHit | SearchQuestionHit;
70
- export type SearchResponse = {
71
- q: string;
72
- topicId: string;
73
- types: SearchResourceType[];
74
- results: SearchResult[];
75
- beliefs: SearchBeliefHit[];
76
- evidence: SearchEvidenceHit[];
77
- questions: SearchQuestionHit[];
78
- };
79
- export type SearchPort = {
80
- listBeliefs: (input: {
81
- topicId: string;
82
- status?: string;
83
- minConfidence?: number;
84
- limit?: number;
85
- }) => Promise<SearchBeliefRecord[]>;
86
- searchEvidence: (input: {
87
- q: string;
88
- topicId: string;
89
- limit?: number;
90
- }) => Promise<SearchEvidenceRecord[]>;
91
- listQuestions: (input: {
92
- topicId: string;
93
- limit?: number;
94
- }) => Promise<SearchQuestionRecord[]>;
95
- };
96
- export declare function searchResources(deps: SearchPort, input: SearchInput): Promise<SearchResponse>;
97
- export {};
@@ -1 +0,0 @@
1
- export * from "./tasks";