@lucern/sdk 0.2.0-alpha.12 → 0.2.0-alpha.2
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.
- package/README.md +166 -609
- package/dist/index.js +3539 -6269
- package/dist/index.js.map +1 -1
- package/dist/{contracts → lucern/contracts/src}/auth-session.contract.d.ts +12 -14
- package/dist/{contracts → lucern/contracts/src}/context-pack.contract.d.ts +58 -56
- package/dist/{contracts → lucern/contracts/src}/lens-filter.contract.d.ts +8 -10
- package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +84 -0
- package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +151 -0
- package/dist/lucern/contracts/src/workflow-runtime.contract.d.ts +161 -0
- package/dist/lucern/mcp-server/src/context-pack-policy.d.ts +119 -0
- package/dist/lucern/mcp-server/src/context-pack-schema.d.ts +18 -0
- package/dist/lucern/modules/graph-primitives/src/ontology-matching.d.ts +78 -0
- package/dist/lucern/modules/graph-primitives/src/text-matching.d.ts +53 -0
- package/dist/lucern/packages/client-core/src/beliefs.d.ts +30 -0
- package/dist/lucern/packages/client-core/src/context.d.ts +29 -0
- package/dist/lucern/packages/client-core/src/contradictions.d.ts +11 -0
- package/dist/lucern/packages/client-core/src/edges.d.ts +11 -0
- package/dist/lucern/packages/client-core/src/events.d.ts +9 -0
- package/dist/lucern/packages/client-core/src/evidence.d.ts +21 -0
- package/dist/lucern/packages/client-core/src/graph.d.ts +17 -0
- package/dist/lucern/packages/client-core/src/identity.d.ts +7 -0
- package/dist/lucern/packages/client-core/src/ids.d.ts +7 -0
- package/dist/lucern/packages/client-core/src/ontologies.d.ts +13 -0
- package/dist/lucern/packages/client-core/src/questions.d.ts +39 -0
- package/dist/lucern/packages/client-core/src/search.d.ts +7 -0
- package/dist/lucern/packages/client-core/src/tasks.d.ts +13 -0
- package/dist/lucern/packages/client-core/src/topics.d.ts +17 -0
- package/dist/lucern/packages/client-core/src/webhooks.d.ts +35 -0
- package/dist/lucern/packages/client-core/src/worktrees.d.ts +17 -0
- package/dist/lucern/packages/domain-beliefs/src/beliefs.d.ts +283 -0
- package/dist/lucern/packages/domain-beliefs/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-context/src/compile.d.ts +11 -0
- package/dist/{contextPackCompiler.d.ts → lucern/packages/domain-context/src/context-pack-compiler.d.ts} +10 -11
- package/dist/lucern/packages/domain-context/src/index.d.ts +4 -0
- package/dist/lucern/packages/domain-context/src/ports.d.ts +58 -0
- package/dist/lucern/packages/domain-context/src/public-types.d.ts +1 -0
- package/dist/lucern/packages/domain-edges/src/contradictions.d.ts +59 -0
- package/dist/lucern/packages/domain-edges/src/edges.d.ts +91 -0
- package/dist/lucern/packages/domain-edges/src/index.d.ts +2 -0
- package/dist/lucern/packages/domain-evidence/src/evidence.d.ts +115 -0
- package/dist/lucern/packages/domain-evidence/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-graph/src/graph.d.ts +150 -0
- package/dist/lucern/packages/domain-identity/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-identity/src/whoami.d.ts +13 -0
- package/dist/lucern/packages/domain-ontologies/src/ontologies.d.ts +123 -0
- package/dist/lucern/packages/domain-questions/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-questions/src/questions.d.ts +147 -0
- package/dist/lucern/packages/domain-search/src/search.d.ts +97 -0
- package/dist/lucern/packages/domain-tasks/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-tasks/src/tasks.d.ts +102 -0
- package/dist/lucern/packages/domain-topics/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-topics/src/topics.d.ts +147 -0
- package/dist/lucern/packages/domain-worktrees/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-worktrees/src/worktrees.d.ts +185 -0
- package/dist/lucern/packages/events/src/index.d.ts +4 -0
- package/dist/lucern/packages/events/src/matching.d.ts +3 -0
- package/dist/lucern/packages/events/src/outbox.d.ts +15 -0
- package/dist/lucern/packages/events/src/types.d.ts +151 -0
- package/dist/lucern/packages/events/src/webhooks.d.ts +9 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/beliefs.d.ts +15 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/context.d.ts +12 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/contradictions.d.ts +7 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/edges.d.ts +7 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/events.d.ts +6 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/evidence.d.ts +21 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/graph.d.ts +10 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/identity.d.ts +5 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/ontologies.d.ts +8 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/questions.d.ts +39 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/search.d.ts +5 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/tasks.d.ts +8 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/topics.d.ts +10 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/webhooks.d.ts +16 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/worktrees.d.ts +10 -0
- package/dist/lucern/packages/sdk-typescript/src/index.d.ts +28 -0
- package/dist/packages/sdk/src/adminClient.d.ts +89 -0
- package/dist/packages/sdk/src/answersClient.d.ts +5 -0
- package/dist/{audiencesClient.d.ts → packages/sdk/src/audiencesClient.d.ts} +18 -30
- package/dist/packages/sdk/src/auditClient.d.ts +21 -0
- package/dist/packages/sdk/src/beliefsClient.d.ts +52 -0
- package/dist/packages/sdk/src/client.d.ts +1558 -0
- package/dist/packages/sdk/src/contextClient.d.ts +9 -0
- package/dist/packages/sdk/src/contracts/api-enums.contract.d.ts +58 -0
- package/dist/{controlObjectOwnership.d.ts → packages/sdk/src/controlObjectOwnership.d.ts} +18 -35
- package/dist/{coreClient.d.ts → packages/sdk/src/coreClient.d.ts} +14 -38
- package/dist/packages/sdk/src/customTools.d.ts +65 -0
- package/dist/packages/sdk/src/decisionsClient.d.ts +97 -0
- package/dist/packages/sdk/src/graphClient.d.ts +191 -0
- package/dist/{harnessClient.d.ts → packages/sdk/src/harnessClient.d.ts} +33 -127
- package/dist/packages/sdk/src/identityClient.d.ts +104 -0
- package/dist/packages/sdk/src/index.d.ts +28 -0
- package/dist/packages/sdk/src/learningClient.d.ts +37 -0
- package/dist/{mcpParityClient.d.ts → packages/sdk/src/mcpParityClient.d.ts} +5 -11
- package/dist/packages/sdk/src/mcpParitySurface.d.ts +8 -0
- package/dist/{ontologyClient.d.ts → packages/sdk/src/ontologyClient.d.ts} +22 -44
- package/dist/packages/sdk/src/packsClient.d.ts +101 -0
- package/dist/{policyClient.d.ts → packages/sdk/src/policyClient.d.ts} +18 -113
- package/dist/packages/sdk/src/reportsClient.d.ts +31 -0
- package/dist/packages/sdk/src/schemaClient.d.ts +54 -0
- package/dist/packages/sdk/src/sdkSurface.d.ts +55 -0
- package/dist/packages/sdk/src/topicsClient.d.ts +45 -0
- package/dist/packages/sdk/src/types.d.ts +470 -0
- package/dist/packages/sdk/src/version.d.ts +2 -0
- package/dist/packages/sdk/src/workflowClient.d.ts +252 -0
- package/package.json +37 -92
- package/CHANGELOG.md +0 -13
- package/dist/adminClient.d.ts +0 -409
- package/dist/adminClient.js +0 -755
- package/dist/adminClient.js.map +0 -1
- package/dist/answersClient.d.ts +0 -23
- package/dist/answersClient.js +0 -333
- package/dist/answersClient.js.map +0 -1
- package/dist/audience/index.d.ts +0 -38
- package/dist/audience/index.js +0 -110
- package/dist/audience/index.js.map +0 -1
- package/dist/audiencesClient.js +0 -472
- package/dist/audiencesClient.js.map +0 -1
- package/dist/auditClient.d.ts +0 -29
- package/dist/auditClient.js +0 -386
- package/dist/auditClient.js.map +0 -1
- package/dist/beliefs/index.d.ts +0 -465
- package/dist/beliefs/index.js +0 -6433
- package/dist/beliefs/index.js.map +0 -1
- package/dist/beliefs/lifecycle.d.ts +0 -24
- package/dist/beliefs/lifecycle.js +0 -98
- package/dist/beliefs/lifecycle.js.map +0 -1
- package/dist/beliefsClient.d.ts +0 -241
- package/dist/beliefsClient.js +0 -646
- package/dist/beliefsClient.js.map +0 -1
- package/dist/client.d.ts +0 -2398
- package/dist/client.js +0 -6411
- package/dist/client.js.map +0 -1
- package/dist/contextClient.d.ts +0 -27
- package/dist/contextClient.js +0 -396
- package/dist/contextClient.js.map +0 -1
- package/dist/contextFacade.d.ts +0 -2
- package/dist/contextFacade.js +0 -73
- package/dist/contextFacade.js.map +0 -1
- package/dist/contextPackCompiler.js +0 -1091
- package/dist/contextPackCompiler.js.map +0 -1
- package/dist/contextPackPolicy.d.ts +0 -84
- package/dist/contextPackPolicy.js +0 -347
- package/dist/contextPackPolicy.js.map +0 -1
- package/dist/contextPackSchema.d.ts +0 -7
- package/dist/contextPackSchema.js +0 -203
- package/dist/contextPackSchema.js.map +0 -1
- package/dist/contextTypes.d.ts +0 -135
- package/dist/contextTypes.js +0 -3
- package/dist/contextTypes.js.map +0 -1
- package/dist/contracts/api-enums.contract.d.ts +0 -81
- package/dist/contracts/api-enums.contract.js +0 -98
- package/dist/contracts/api-enums.contract.js.map +0 -1
- package/dist/contracts/auth-session.contract.js +0 -48
- package/dist/contracts/auth-session.contract.js.map +0 -1
- package/dist/contracts/context-pack.contract.js +0 -98
- package/dist/contracts/context-pack.contract.js.map +0 -1
- package/dist/contracts/contextPack.d.ts +0 -1
- package/dist/contracts/contextPack.js +0 -98
- package/dist/contracts/contextPack.js.map +0 -1
- package/dist/contracts/index.d.ts +0 -9
- package/dist/contracts/index.js +0 -4928
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/lens-filter.contract.js +0 -71
- package/dist/contracts/lens-filter.contract.js.map +0 -1
- package/dist/contracts/lens-workflow.contract.d.ts +0 -87
- package/dist/contracts/lens-workflow.contract.js +0 -123
- package/dist/contracts/lens-workflow.contract.js.map +0 -1
- package/dist/contracts/lensFilter.d.ts +0 -1
- package/dist/contracts/lensFilter.js +0 -71
- package/dist/contracts/lensFilter.js.map +0 -1
- package/dist/contracts/lensWorkflow.d.ts +0 -2
- package/dist/contracts/lensWorkflow.js +0 -123
- package/dist/contracts/lensWorkflow.js.map +0 -1
- package/dist/contracts/mcp-tools.contract.d.ts +0 -1
- package/dist/contracts/mcp-tools.contract.js +0 -3016
- package/dist/contracts/mcp-tools.contract.js.map +0 -1
- package/dist/contracts/mcpTools.d.ts +0 -1
- package/dist/contracts/mcpTools.js +0 -3016
- package/dist/contracts/mcpTools.js.map +0 -1
- package/dist/contracts/prompt.contract.d.ts +0 -26
- package/dist/contracts/prompt.contract.js +0 -12
- package/dist/contracts/prompt.contract.js.map +0 -1
- package/dist/contracts/prompt.d.ts +0 -1
- package/dist/contracts/prompt.js +0 -12
- package/dist/contracts/prompt.js.map +0 -1
- package/dist/contracts/sdk-tools.contract.d.ts +0 -2
- package/dist/contracts/sdk-tools.contract.js +0 -4164
- package/dist/contracts/sdk-tools.contract.js.map +0 -1
- package/dist/contracts/sdkTools.d.ts +0 -2
- package/dist/contracts/sdkTools.js +0 -4164
- package/dist/contracts/sdkTools.js.map +0 -1
- package/dist/contracts/workflow-runtime.contract.d.ts +0 -163
- package/dist/contracts/workflow-runtime.contract.js +0 -245
- package/dist/contracts/workflow-runtime.contract.js.map +0 -1
- package/dist/contracts/workflowRuntime.d.ts +0 -1
- package/dist/contracts/workflowRuntime.js +0 -245
- package/dist/contracts/workflowRuntime.js.map +0 -1
- package/dist/contradictions/index.d.ts +0 -158
- package/dist/contradictions/index.js +0 -6427
- package/dist/contradictions/index.js.map +0 -1
- package/dist/controlObjectOwnership.js +0 -215
- package/dist/controlObjectOwnership.js.map +0 -1
- package/dist/coreClient.js +0 -339
- package/dist/coreClient.js.map +0 -1
- package/dist/customTools.d.ts +0 -88
- package/dist/customTools.js +0 -248
- package/dist/customTools.js.map +0 -1
- package/dist/decisions/index.d.ts +0 -68
- package/dist/decisions/index.js +0 -6429
- package/dist/decisions/index.js.map +0 -1
- package/dist/decisionsClient.d.ts +0 -111
- package/dist/decisionsClient.js +0 -522
- package/dist/decisionsClient.js.map +0 -1
- package/dist/domainContext.d.ts +0 -1
- package/dist/domainContext.js +0 -3
- package/dist/domainContext.js.map +0 -1
- package/dist/edges/index.d.ts +0 -204
- package/dist/edges/index.js +0 -6428
- package/dist/edges/index.js.map +0 -1
- package/dist/events.d.ts +0 -178
- package/dist/events.js +0 -251
- package/dist/events.js.map +0 -1
- package/dist/eventsCore.d.ts +0 -49
- package/dist/eventsCore.js +0 -429
- package/dist/eventsCore.js.map +0 -1
- package/dist/evidence/index.d.ts +0 -295
- package/dist/evidence/index.js +0 -6428
- package/dist/evidence/index.js.map +0 -1
- package/dist/evidenceClient.d.ts +0 -119
- package/dist/evidenceClient.js +0 -350
- package/dist/evidenceClient.js.map +0 -1
- package/dist/facade/context.d.ts +0 -18
- package/dist/facade/context.js +0 -73
- package/dist/facade/context.js.map +0 -1
- package/dist/gatewayFacades.d.ts +0 -589
- package/dist/gatewayFacades.js +0 -2006
- package/dist/gatewayFacades.js.map +0 -1
- package/dist/graphClient.d.ts +0 -271
- package/dist/graphClient.js +0 -698
- package/dist/graphClient.js.map +0 -1
- package/dist/harnessClient.js +0 -607
- package/dist/harnessClient.js.map +0 -1
- package/dist/identityClient.d.ts +0 -140
- package/dist/identityClient.js +0 -497
- package/dist/identityClient.js.map +0 -1
- package/dist/index.d.ts +0 -45
- package/dist/learningClient.d.ts +0 -46
- package/dist/learningClient.js +0 -409
- package/dist/learningClient.js.map +0 -1
- package/dist/lenses/index.d.ts +0 -194
- package/dist/lenses/index.js +0 -6427
- package/dist/lenses/index.js.map +0 -1
- package/dist/mcpParityClient.js +0 -516
- package/dist/mcpParityClient.js.map +0 -1
- package/dist/mcpParitySurface.d.ts +0 -12
- package/dist/mcpParitySurface.js +0 -65
- package/dist/mcpParitySurface.js.map +0 -1
- package/dist/mcpTools-DPZxowDX.d.ts +0 -254
- package/dist/nodes/index.d.ts +0 -62
- package/dist/nodes/index.js +0 -6429
- package/dist/nodes/index.js.map +0 -1
- package/dist/ontologies/index.d.ts +0 -178
- package/dist/ontologies/index.js +0 -6430
- package/dist/ontologies/index.js.map +0 -1
- package/dist/ontologyClient.js +0 -513
- package/dist/ontologyClient.js.map +0 -1
- package/dist/opinion.d.ts +0 -11
- package/dist/opinion.js +0 -35
- package/dist/opinion.js.map +0 -1
- package/dist/packRuntime.d.ts +0 -2
- package/dist/packRuntime.js +0 -3
- package/dist/packRuntime.js.map +0 -1
- package/dist/packsClient.d.ts +0 -131
- package/dist/packsClient.js +0 -525
- package/dist/packsClient.js.map +0 -1
- package/dist/policyClient.js +0 -625
- package/dist/policyClient.js.map +0 -1
- package/dist/questions/index.d.ts +0 -297
- package/dist/questions/index.js +0 -6430
- package/dist/questions/index.js.map +0 -1
- package/dist/realtime/index.d.ts +0 -29
- package/dist/realtime/index.js +0 -23
- package/dist/realtime/index.js.map +0 -1
- package/dist/realtime/refs.d.ts +0 -17
- package/dist/realtime/refs.js +0 -9
- package/dist/realtime/refs.js.map +0 -1
- package/dist/reportsClient.d.ts +0 -41
- package/dist/reportsClient.js +0 -418
- package/dist/reportsClient.js.map +0 -1
- package/dist/schemaClient.d.ts +0 -64
- package/dist/schemaClient.js +0 -434
- package/dist/schemaClient.js.map +0 -1
- package/dist/sdkSurface.d.ts +0 -61
- package/dist/sdkSurface.js +0 -112
- package/dist/sdkSurface.js.map +0 -1
- package/dist/sdkTools-CwXJDACb.d.ts +0 -150
- package/dist/sourcesClient.d.ts +0 -24
- package/dist/sourcesClient.js +0 -339
- package/dist/sourcesClient.js.map +0 -1
- package/dist/topics/index.d.ts +0 -68
- package/dist/topics/index.js +0 -6428
- package/dist/topics/index.js.map +0 -1
- package/dist/topicsClient.d.ts +0 -84
- package/dist/topicsClient.js +0 -492
- package/dist/topicsClient.js.map +0 -1
- package/dist/types.d.ts +0 -715
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/version.d.ts +0 -4
- package/dist/version.js +0 -6
- package/dist/version.js.map +0 -1
- package/dist/workflowClient.d.ts +0 -316
- package/dist/workflowClient.js +0 -830
- package/dist/workflowClient.js.map +0 -1
- package/dist/worktrees/index.d.ts +0 -210
- package/dist/worktrees/index.js +0 -6430
- package/dist/worktrees/index.js.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./evidence";
|
|
@@ -0,0 +1,150 @@
|
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./whoami";
|
|
@@ -0,0 +1,13 @@
|
|
|
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>;
|
|
@@ -0,0 +1,123 @@
|
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./questions";
|
|
@@ -0,0 +1,147 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,97 @@
|
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tasks";
|