@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,102 @@
|
|
|
1
|
+
type TaskStatus = "todo" | "in_progress" | "blocked" | "done";
|
|
2
|
+
type TaskPriority = "low" | "medium" | "high" | "urgent";
|
|
3
|
+
type TaskType = "research" | "interview" | "analysis" | "data_collection" | "general";
|
|
4
|
+
export type TaskRecord = {
|
|
5
|
+
id: string;
|
|
6
|
+
taskId: string;
|
|
7
|
+
topicId?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
status: TaskStatus;
|
|
11
|
+
priority: TaskPriority;
|
|
12
|
+
taskType: TaskType;
|
|
13
|
+
linkedBeliefId?: string;
|
|
14
|
+
linkedQuestionId?: string;
|
|
15
|
+
linkedWorktreeId?: string;
|
|
16
|
+
outputSummary?: string;
|
|
17
|
+
createdAt?: number;
|
|
18
|
+
updatedAt?: number;
|
|
19
|
+
completedAt?: number;
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
};
|
|
22
|
+
export type TaskListResult = {
|
|
23
|
+
tasks: TaskRecord[];
|
|
24
|
+
count: number;
|
|
25
|
+
};
|
|
26
|
+
export type CreateTaskInput = {
|
|
27
|
+
topicId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
taskType?: string;
|
|
31
|
+
priority?: string;
|
|
32
|
+
linkedBeliefId?: string;
|
|
33
|
+
linkedQuestionId?: string;
|
|
34
|
+
linkedWorktreeId?: string;
|
|
35
|
+
metadata?: Record<string, unknown>;
|
|
36
|
+
};
|
|
37
|
+
export type UpdateTaskInput = {
|
|
38
|
+
id: string;
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
priority?: string;
|
|
42
|
+
status?: string;
|
|
43
|
+
linkedBeliefId?: string;
|
|
44
|
+
linkedQuestionId?: string;
|
|
45
|
+
linkedWorktreeId?: string;
|
|
46
|
+
metadata?: Record<string, unknown>;
|
|
47
|
+
};
|
|
48
|
+
export type CompleteTaskInput = {
|
|
49
|
+
id: string;
|
|
50
|
+
outputSummary?: string;
|
|
51
|
+
};
|
|
52
|
+
export type ListTasksQuery = {
|
|
53
|
+
topicId?: string;
|
|
54
|
+
worktreeId?: string;
|
|
55
|
+
status?: string;
|
|
56
|
+
limit?: number;
|
|
57
|
+
};
|
|
58
|
+
type TaskCreatePortInput = {
|
|
59
|
+
topicId: string;
|
|
60
|
+
title: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
taskType: TaskType;
|
|
63
|
+
priority: TaskPriority;
|
|
64
|
+
linkedBeliefId?: string;
|
|
65
|
+
linkedQuestionId?: string;
|
|
66
|
+
linkedWorktreeId?: string;
|
|
67
|
+
metadata?: Record<string, unknown>;
|
|
68
|
+
};
|
|
69
|
+
type TaskUpdatePortInput = {
|
|
70
|
+
taskRawId: string;
|
|
71
|
+
title?: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
priority?: TaskPriority;
|
|
74
|
+
status?: TaskStatus;
|
|
75
|
+
linkedBeliefId?: string;
|
|
76
|
+
linkedQuestionId?: string;
|
|
77
|
+
linkedWorktreeId?: string;
|
|
78
|
+
metadata?: Record<string, unknown>;
|
|
79
|
+
};
|
|
80
|
+
type TaskCompletePortInput = {
|
|
81
|
+
taskRawId: string;
|
|
82
|
+
outputSummary?: string;
|
|
83
|
+
};
|
|
84
|
+
export type TasksPort = {
|
|
85
|
+
fetchTask: (rawId: string) => Promise<unknown | null>;
|
|
86
|
+
listTasksByTopic: (args: {
|
|
87
|
+
topicId: string;
|
|
88
|
+
status?: TaskStatus;
|
|
89
|
+
limit?: number;
|
|
90
|
+
}) => Promise<unknown[]>;
|
|
91
|
+
listTasksByWorktree: (args: {
|
|
92
|
+
worktreeId: string;
|
|
93
|
+
}) => Promise<unknown[]>;
|
|
94
|
+
createTask: (input: TaskCreatePortInput) => Promise<unknown>;
|
|
95
|
+
updateTask: (input: TaskUpdatePortInput) => Promise<unknown>;
|
|
96
|
+
completeTask: (input: TaskCompletePortInput) => Promise<unknown>;
|
|
97
|
+
};
|
|
98
|
+
export declare function createTask(deps: TasksPort, input: CreateTaskInput): Promise<TaskRecord>;
|
|
99
|
+
export declare function updateTask(deps: TasksPort, input: UpdateTaskInput): Promise<TaskRecord>;
|
|
100
|
+
export declare function completeTask(deps: TasksPort, input: CompleteTaskInput): Promise<TaskRecord>;
|
|
101
|
+
export declare function listTasks(deps: TasksPort, query: ListTasksQuery): Promise<TaskListResult>;
|
|
102
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./topics";
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
type TopicStatus = "active" | "archived" | "watching";
|
|
2
|
+
type TopicVisibility = "private" | "team" | "firm" | "external" | "public";
|
|
3
|
+
type TopicCoverageState = "full" | "partial" | "empty";
|
|
4
|
+
export type TopicRecord = {
|
|
5
|
+
id: string;
|
|
6
|
+
topicId: string;
|
|
7
|
+
globalId?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
type: string;
|
|
11
|
+
depth?: number;
|
|
12
|
+
status?: TopicStatus;
|
|
13
|
+
parentTopicId?: string | null;
|
|
14
|
+
tenantId?: string;
|
|
15
|
+
workspaceId?: string;
|
|
16
|
+
visibility?: TopicVisibility;
|
|
17
|
+
createdAt?: number;
|
|
18
|
+
updatedAt?: number;
|
|
19
|
+
};
|
|
20
|
+
export type TopicListResult = {
|
|
21
|
+
topics: TopicRecord[];
|
|
22
|
+
total: number;
|
|
23
|
+
};
|
|
24
|
+
export type TopicTreeNode = TopicRecord & {
|
|
25
|
+
path?: string[];
|
|
26
|
+
};
|
|
27
|
+
export type TopicTreeResult = {
|
|
28
|
+
tree: TopicTreeNode[];
|
|
29
|
+
};
|
|
30
|
+
export type TopicCoverageRecord = {
|
|
31
|
+
topicId: string;
|
|
32
|
+
name: string;
|
|
33
|
+
type: string;
|
|
34
|
+
depth: number;
|
|
35
|
+
beliefs: number;
|
|
36
|
+
questions: number;
|
|
37
|
+
evidence: number;
|
|
38
|
+
coverage: TopicCoverageState;
|
|
39
|
+
};
|
|
40
|
+
export type TopicCoverageSummary = {
|
|
41
|
+
totalTopics: number;
|
|
42
|
+
coveredTopics: number;
|
|
43
|
+
emptyTopics: number;
|
|
44
|
+
coveragePercent: number;
|
|
45
|
+
totalBeliefs: number;
|
|
46
|
+
totalQuestions: number;
|
|
47
|
+
totalEvidence: number;
|
|
48
|
+
};
|
|
49
|
+
export type TopicCoverageResult = {
|
|
50
|
+
topics: TopicCoverageRecord[];
|
|
51
|
+
summary: TopicCoverageSummary;
|
|
52
|
+
scopeTopicId?: string | null;
|
|
53
|
+
};
|
|
54
|
+
export type CreateTopicInput = {
|
|
55
|
+
name: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
type?: string;
|
|
58
|
+
parentTopicId?: string;
|
|
59
|
+
ontologyId?: string;
|
|
60
|
+
tenantId?: string;
|
|
61
|
+
workspaceId?: string;
|
|
62
|
+
visibility?: TopicVisibility;
|
|
63
|
+
createdBy?: string;
|
|
64
|
+
};
|
|
65
|
+
export type UpdateTopicInput = {
|
|
66
|
+
id: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
type?: string;
|
|
70
|
+
ontologyId?: string;
|
|
71
|
+
clearOntologyId?: boolean;
|
|
72
|
+
status?: TopicStatus;
|
|
73
|
+
visibility?: TopicVisibility;
|
|
74
|
+
};
|
|
75
|
+
export type GetTopicInput = {
|
|
76
|
+
id: string;
|
|
77
|
+
};
|
|
78
|
+
export type ListTopicsQuery = {
|
|
79
|
+
ontologyId?: string;
|
|
80
|
+
parentTopicId?: string;
|
|
81
|
+
status?: TopicStatus | string;
|
|
82
|
+
type?: string;
|
|
83
|
+
};
|
|
84
|
+
export type GetTopicTreeInput = {
|
|
85
|
+
id: string;
|
|
86
|
+
maxDepth?: number;
|
|
87
|
+
};
|
|
88
|
+
export type GetTopicCoverageInput = {
|
|
89
|
+
id: string;
|
|
90
|
+
includeDescendants?: boolean;
|
|
91
|
+
maxDepth?: number;
|
|
92
|
+
};
|
|
93
|
+
type CreateTopicPortInput = {
|
|
94
|
+
name: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
type: string;
|
|
97
|
+
parentTopicRawId?: string;
|
|
98
|
+
ontologyId?: string;
|
|
99
|
+
tenantId?: string;
|
|
100
|
+
workspaceId?: string;
|
|
101
|
+
visibility?: TopicVisibility;
|
|
102
|
+
createdBy?: string;
|
|
103
|
+
};
|
|
104
|
+
type UpdateTopicPortInput = {
|
|
105
|
+
topicRawId: string;
|
|
106
|
+
name?: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
type?: string;
|
|
109
|
+
ontologyId?: string;
|
|
110
|
+
clearOntologyId?: boolean;
|
|
111
|
+
status?: TopicStatus;
|
|
112
|
+
visibility?: TopicVisibility;
|
|
113
|
+
};
|
|
114
|
+
export type TopicsPort = {
|
|
115
|
+
fetchTopic: (rawId: string) => Promise<unknown | null>;
|
|
116
|
+
listTopics: (query: {
|
|
117
|
+
ontologyId?: string;
|
|
118
|
+
parentTopicRawId?: string;
|
|
119
|
+
status?: string;
|
|
120
|
+
type?: string;
|
|
121
|
+
}) => Promise<unknown[]>;
|
|
122
|
+
createTopic: (input: CreateTopicPortInput) => Promise<unknown>;
|
|
123
|
+
updateTopic?: (input: UpdateTopicPortInput) => Promise<unknown>;
|
|
124
|
+
fetchTopicTree: (args: {
|
|
125
|
+
rootRawId: string;
|
|
126
|
+
maxDepth?: number;
|
|
127
|
+
}) => Promise<unknown>;
|
|
128
|
+
listBeliefsByTopic: (args: {
|
|
129
|
+
topicId: string;
|
|
130
|
+
limit?: number;
|
|
131
|
+
}) => Promise<unknown[]>;
|
|
132
|
+
listQuestionsByTopic: (args: {
|
|
133
|
+
topicId: string;
|
|
134
|
+
limit?: number;
|
|
135
|
+
}) => Promise<unknown[]>;
|
|
136
|
+
listEvidenceByTopic: (args: {
|
|
137
|
+
topicId: string;
|
|
138
|
+
limit?: number;
|
|
139
|
+
}) => Promise<unknown[]>;
|
|
140
|
+
};
|
|
141
|
+
export declare function createTopic(deps: TopicsPort, input: CreateTopicInput): Promise<TopicRecord>;
|
|
142
|
+
export declare function updateTopic(deps: TopicsPort, input: UpdateTopicInput): Promise<TopicRecord>;
|
|
143
|
+
export declare function getTopic(deps: TopicsPort, input: GetTopicInput): Promise<TopicRecord>;
|
|
144
|
+
export declare function listTopics(deps: TopicsPort, query?: ListTopicsQuery): Promise<TopicListResult>;
|
|
145
|
+
export declare function getTopicTree(deps: TopicsPort, input: GetTopicTreeInput): Promise<TopicTreeResult>;
|
|
146
|
+
export declare function getTopicCoverage(deps: TopicsPort, input: GetTopicCoverageInput): Promise<TopicCoverageResult>;
|
|
147
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./worktrees";
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
type WorktreeStatus = "planning" | "active" | "paused" | "completed" | "merged" | "failed" | "archived";
|
|
2
|
+
export type WorktreeRecord = {
|
|
3
|
+
worktreeId: string;
|
|
4
|
+
id: string;
|
|
5
|
+
topicId?: string;
|
|
6
|
+
title: string;
|
|
7
|
+
status?: WorktreeStatus | string;
|
|
8
|
+
branchId?: string | null;
|
|
9
|
+
objective?: string;
|
|
10
|
+
hypothesis?: string;
|
|
11
|
+
gate?: string;
|
|
12
|
+
track?: string;
|
|
13
|
+
trackPosition?: number;
|
|
14
|
+
executionBand?: number;
|
|
15
|
+
executionOrder?: number;
|
|
16
|
+
dependsOn?: string[];
|
|
17
|
+
blocks?: string[];
|
|
18
|
+
targetBeliefIds?: string[];
|
|
19
|
+
targetQuestionIds?: string[];
|
|
20
|
+
questionCount?: number;
|
|
21
|
+
taskCount?: number;
|
|
22
|
+
frameworkSuggestions?: unknown[];
|
|
23
|
+
dependencySuggestions?: unknown[];
|
|
24
|
+
autoShapeApplied?: boolean;
|
|
25
|
+
proofArtifacts?: unknown[] | null;
|
|
26
|
+
staffingHint?: string | null;
|
|
27
|
+
lastReconciledAt?: number | null;
|
|
28
|
+
autoFixPolicy?: Record<string, unknown> | null;
|
|
29
|
+
lensId?: string | null;
|
|
30
|
+
createdAt?: number;
|
|
31
|
+
updatedAt?: number;
|
|
32
|
+
};
|
|
33
|
+
export type WorktreeListResult = {
|
|
34
|
+
worktrees: WorktreeRecord[];
|
|
35
|
+
total: number;
|
|
36
|
+
};
|
|
37
|
+
export type CreateWorktreeInput = {
|
|
38
|
+
title: string;
|
|
39
|
+
topicId: string;
|
|
40
|
+
objective?: string;
|
|
41
|
+
hypothesis?: string;
|
|
42
|
+
beliefIds?: string[];
|
|
43
|
+
autoShape?: boolean;
|
|
44
|
+
domainPackId?: string;
|
|
45
|
+
executionOrder?: number;
|
|
46
|
+
dependsOn?: string[];
|
|
47
|
+
blocks?: string[];
|
|
48
|
+
gate?: string;
|
|
49
|
+
proofArtifacts?: unknown[];
|
|
50
|
+
staffingHint?: string;
|
|
51
|
+
lastReconciledAt?: number;
|
|
52
|
+
autoFixPolicy?: Record<string, unknown>;
|
|
53
|
+
lensId?: string;
|
|
54
|
+
};
|
|
55
|
+
export type ListWorktreesQuery = {
|
|
56
|
+
topicId: string;
|
|
57
|
+
status?: string;
|
|
58
|
+
limit?: number;
|
|
59
|
+
};
|
|
60
|
+
export type ActivateWorktreeInput = {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
export type MergeWorktreeInput = {
|
|
64
|
+
id: string;
|
|
65
|
+
summary?: string;
|
|
66
|
+
outcomes: Array<{
|
|
67
|
+
beliefId: string;
|
|
68
|
+
confidence: number;
|
|
69
|
+
rationale: string;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
export type MergeWorktreeResult = {
|
|
73
|
+
worktreeId: string;
|
|
74
|
+
status: "merged";
|
|
75
|
+
beliefsScored: number;
|
|
76
|
+
failedBeliefs: Array<{
|
|
77
|
+
beliefId: string;
|
|
78
|
+
reason: string;
|
|
79
|
+
}>;
|
|
80
|
+
summary?: string;
|
|
81
|
+
mergedAt: number;
|
|
82
|
+
};
|
|
83
|
+
export type UpdateWorktreeTargetsInput = {
|
|
84
|
+
id: string;
|
|
85
|
+
addBeliefIds?: string[];
|
|
86
|
+
addQuestionIds?: string[];
|
|
87
|
+
removeBeliefIds?: string[];
|
|
88
|
+
removeQuestionIds?: string[];
|
|
89
|
+
};
|
|
90
|
+
export type UpdateWorktreeInput = {
|
|
91
|
+
id: string;
|
|
92
|
+
objective?: string;
|
|
93
|
+
hypothesis?: string;
|
|
94
|
+
rationale?: string;
|
|
95
|
+
track?: string;
|
|
96
|
+
trackPosition?: number;
|
|
97
|
+
executionBand?: number;
|
|
98
|
+
executionOrder?: number;
|
|
99
|
+
dependsOn?: string[];
|
|
100
|
+
blocks?: string[];
|
|
101
|
+
gate?: string;
|
|
102
|
+
status?: string;
|
|
103
|
+
topicId?: string;
|
|
104
|
+
additionalTopicIds?: string[];
|
|
105
|
+
proofArtifacts?: unknown[];
|
|
106
|
+
staffingHint?: string;
|
|
107
|
+
lastReconciledAt?: number;
|
|
108
|
+
autoFixPolicy?: unknown;
|
|
109
|
+
lensId?: string;
|
|
110
|
+
};
|
|
111
|
+
type CreateWorktreePortInput = {
|
|
112
|
+
title: string;
|
|
113
|
+
topicRawId: string;
|
|
114
|
+
objective?: string;
|
|
115
|
+
hypothesis?: string;
|
|
116
|
+
beliefRawIds?: string[];
|
|
117
|
+
autoShape?: boolean;
|
|
118
|
+
domainPackId?: string;
|
|
119
|
+
executionOrder?: number;
|
|
120
|
+
dependsOn?: string[];
|
|
121
|
+
blocks?: string[];
|
|
122
|
+
gate?: string;
|
|
123
|
+
proofArtifacts?: unknown[];
|
|
124
|
+
staffingHint?: string;
|
|
125
|
+
lastReconciledAt?: number;
|
|
126
|
+
autoFixPolicy?: Record<string, unknown>;
|
|
127
|
+
lensId?: string;
|
|
128
|
+
};
|
|
129
|
+
type UpdateWorktreeTargetsPortInput = {
|
|
130
|
+
worktreeRawId: string;
|
|
131
|
+
addBeliefRawIds?: string[];
|
|
132
|
+
addQuestionRawIds?: string[];
|
|
133
|
+
removeBeliefRawIds?: string[];
|
|
134
|
+
removeQuestionRawIds?: string[];
|
|
135
|
+
};
|
|
136
|
+
type UpdateWorktreeMetadataPortInput = {
|
|
137
|
+
worktreeRawId: string;
|
|
138
|
+
objective?: string;
|
|
139
|
+
hypothesis?: string;
|
|
140
|
+
rationale?: string;
|
|
141
|
+
track?: string;
|
|
142
|
+
trackPosition?: number;
|
|
143
|
+
executionBand?: number;
|
|
144
|
+
executionOrder?: number;
|
|
145
|
+
dependsOn?: string[];
|
|
146
|
+
blocks?: string[];
|
|
147
|
+
gate?: string;
|
|
148
|
+
status?: string;
|
|
149
|
+
topicId?: string;
|
|
150
|
+
additionalTopicIds?: string[];
|
|
151
|
+
proofArtifacts?: unknown[];
|
|
152
|
+
staffingHint?: string;
|
|
153
|
+
lastReconciledAt?: number;
|
|
154
|
+
autoFixPolicy?: unknown;
|
|
155
|
+
lensId?: string;
|
|
156
|
+
};
|
|
157
|
+
export type WorktreesPort = {
|
|
158
|
+
fetchWorktree: (rawId: string) => Promise<unknown | null>;
|
|
159
|
+
listWorktreesByTopic: (args: {
|
|
160
|
+
topicId: string;
|
|
161
|
+
limit?: number;
|
|
162
|
+
}) => Promise<unknown[]>;
|
|
163
|
+
createWorktree: (input: CreateWorktreePortInput) => Promise<unknown>;
|
|
164
|
+
activateWorktree: (args: {
|
|
165
|
+
worktreeRawId: string;
|
|
166
|
+
}) => Promise<unknown>;
|
|
167
|
+
completeWorktree: (args: {
|
|
168
|
+
worktreeRawId: string;
|
|
169
|
+
summary: string;
|
|
170
|
+
}) => Promise<unknown>;
|
|
171
|
+
scoreBeliefOutcome: (args: {
|
|
172
|
+
beliefRawId: string;
|
|
173
|
+
confidence: number;
|
|
174
|
+
rationale: string;
|
|
175
|
+
}) => Promise<unknown>;
|
|
176
|
+
updateWorktreeMetadata: (input: UpdateWorktreeMetadataPortInput) => Promise<unknown>;
|
|
177
|
+
updateWorktreeTargets: (input: UpdateWorktreeTargetsPortInput) => Promise<unknown>;
|
|
178
|
+
};
|
|
179
|
+
export declare function createWorktree(deps: WorktreesPort, input: CreateWorktreeInput): Promise<WorktreeRecord>;
|
|
180
|
+
export declare function listWorktrees(deps: WorktreesPort, query: ListWorktreesQuery): Promise<WorktreeListResult>;
|
|
181
|
+
export declare function activateWorktree(deps: WorktreesPort, input: ActivateWorktreeInput): Promise<WorktreeRecord>;
|
|
182
|
+
export declare function updateWorktree(deps: WorktreesPort, input: UpdateWorktreeInput): Promise<WorktreeRecord>;
|
|
183
|
+
export declare function updateWorktreeTargets(deps: WorktreesPort, input: UpdateWorktreeTargetsInput): Promise<WorktreeRecord>;
|
|
184
|
+
export declare function mergeWorktree(deps: WorktreesPort, input: MergeWorktreeInput): Promise<MergeWorktreeResult>;
|
|
185
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CreateDomainEventInput, type DomainActorType, type DomainEvent, type EventCursor } from "./types";
|
|
2
|
+
export declare function createEventId(): string;
|
|
3
|
+
export declare function normalizeRetentionDays(value: number | undefined): number;
|
|
4
|
+
export declare function buildDomainEvent(input: CreateDomainEventInput): DomainEvent;
|
|
5
|
+
export declare function compareEventCursor(left: EventCursor, right: EventCursor): number;
|
|
6
|
+
export declare function encodeEventCursor(cursor: EventCursor): string;
|
|
7
|
+
export declare function decodeEventCursor(cursor: string | undefined): EventCursor | null;
|
|
8
|
+
export declare function isAfterCursor(event: Pick<DomainEvent, "timestamp" | "eventId">, cursor: EventCursor | null): boolean;
|
|
9
|
+
export declare function sortEventsByCursor<T extends Pick<DomainEvent, "timestamp" | "eventId">>(events: readonly T[]): T[];
|
|
10
|
+
export declare function inferActorType(args: {
|
|
11
|
+
sessionType?: "agent" | "user";
|
|
12
|
+
authMode?: string;
|
|
13
|
+
principalType?: string;
|
|
14
|
+
}): DomainActorType;
|
|
15
|
+
export declare function emitDomainEvent(invokeMutation: (reference: any, args: CreateDomainEventInput) => Promise<unknown>, input: CreateDomainEventInput): Promise<unknown>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
export declare const DOMAIN_EVENT_VERSION: "1.0";
|
|
2
|
+
export declare const EVENT_RETENTION_DEFAULT_DAYS = 30;
|
|
3
|
+
export declare const WEBHOOK_MAX_ATTEMPTS = 5;
|
|
4
|
+
export declare const WEBHOOK_RETRY_DELAYS_MS: readonly [1000, 5000, 30000, 300000];
|
|
5
|
+
export declare const DOMAIN_EVENT_TYPES: readonly ["belief.created", "belief.forked", "belief.confidence_updated", "belief.archived", "belief.refined", "belief.contract_created", "belief.contract_evaluated", "belief.lineage_queried", "evidence.created", "evidence.linked", "evidence.search_executed", "question.created", "question.answered", "question.refined", "question.status_updated", "question.archived", "edge.created", "contradiction.flagged", "worktree.created", "worktree.activated", "worktree.merged", "worktree.targets_updated", "worktree.metadata_updated", "topic.created", "topic.updated", "topic.archived", "task.created", "task.completed", "task.updated", "ontology.bound", "context.compiled", "identity.key_created", "identity.key_rotated", "identity.key_revoked", "webhook.test"];
|
|
6
|
+
export type DomainEventType = (typeof DOMAIN_EVENT_TYPES)[number];
|
|
7
|
+
export type DomainResourceType = "belief" | "evidence" | "question" | "edge" | "contradiction" | "worktree" | "topic" | "task" | "ontology" | "context" | "identity" | "webhook";
|
|
8
|
+
export type DomainActorType = "human" | "agent" | "service";
|
|
9
|
+
export type DomainEventData = Record<string, unknown>;
|
|
10
|
+
export type DomainEvent = {
|
|
11
|
+
eventId: string;
|
|
12
|
+
type: DomainEventType | string;
|
|
13
|
+
version: typeof DOMAIN_EVENT_VERSION;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
tenantId?: string;
|
|
16
|
+
workspaceId?: string;
|
|
17
|
+
topicId: string;
|
|
18
|
+
resourceId: string;
|
|
19
|
+
resourceType: DomainResourceType | string;
|
|
20
|
+
actorId: string;
|
|
21
|
+
actorType: DomainActorType;
|
|
22
|
+
data: DomainEventData;
|
|
23
|
+
correlationId?: string;
|
|
24
|
+
expiresAt: number;
|
|
25
|
+
};
|
|
26
|
+
export type CreateDomainEventInput = {
|
|
27
|
+
eventId?: string;
|
|
28
|
+
timestamp?: number;
|
|
29
|
+
tenantId?: string;
|
|
30
|
+
workspaceId?: string;
|
|
31
|
+
topicId: string;
|
|
32
|
+
type: DomainEventType | string;
|
|
33
|
+
resourceId: string;
|
|
34
|
+
resourceType: DomainResourceType | string;
|
|
35
|
+
actorId: string;
|
|
36
|
+
actorType: DomainActorType;
|
|
37
|
+
data?: DomainEventData;
|
|
38
|
+
correlationId?: string;
|
|
39
|
+
retentionDays?: number;
|
|
40
|
+
};
|
|
41
|
+
export type EventCursor = {
|
|
42
|
+
timestamp: number;
|
|
43
|
+
eventId: string;
|
|
44
|
+
};
|
|
45
|
+
export type EventListQuery = {
|
|
46
|
+
topicId?: string;
|
|
47
|
+
after?: string;
|
|
48
|
+
types?: string[];
|
|
49
|
+
startTime?: number;
|
|
50
|
+
endTime?: number;
|
|
51
|
+
limit?: number;
|
|
52
|
+
};
|
|
53
|
+
export type EventListResult = {
|
|
54
|
+
events: DomainEvent[];
|
|
55
|
+
nextCursor: string | null;
|
|
56
|
+
};
|
|
57
|
+
export type WebhookSecretMode = "configured";
|
|
58
|
+
export type WebhookRecord = {
|
|
59
|
+
id: string;
|
|
60
|
+
webhookId: string;
|
|
61
|
+
tenantId?: string;
|
|
62
|
+
workspaceId?: string;
|
|
63
|
+
topicId?: string;
|
|
64
|
+
url: string;
|
|
65
|
+
events: string[];
|
|
66
|
+
active: boolean;
|
|
67
|
+
secretConfigured: boolean;
|
|
68
|
+
createdAt: number;
|
|
69
|
+
updatedAt: number;
|
|
70
|
+
createdBy: string;
|
|
71
|
+
updatedBy: string;
|
|
72
|
+
lastDeliveryAt?: number;
|
|
73
|
+
lastSuccessfulDeliveryAt?: number;
|
|
74
|
+
};
|
|
75
|
+
export type WebhookCreateInput = {
|
|
76
|
+
url: string;
|
|
77
|
+
events: string[];
|
|
78
|
+
secret: string;
|
|
79
|
+
topicId?: string;
|
|
80
|
+
active?: boolean;
|
|
81
|
+
};
|
|
82
|
+
export type WebhookUpdateInput = {
|
|
83
|
+
url?: string;
|
|
84
|
+
events?: string[];
|
|
85
|
+
secret?: string;
|
|
86
|
+
topicId?: string | null;
|
|
87
|
+
active?: boolean;
|
|
88
|
+
};
|
|
89
|
+
export type WebhookDeliveryStatus = "pending" | "delivering" | "succeeded" | "failed" | "dead_letter";
|
|
90
|
+
export type WebhookDeliveryRecord = {
|
|
91
|
+
id: string;
|
|
92
|
+
deliveryId: string;
|
|
93
|
+
webhookId: string;
|
|
94
|
+
eventId: string;
|
|
95
|
+
eventType: string;
|
|
96
|
+
topicId: string;
|
|
97
|
+
status: WebhookDeliveryStatus;
|
|
98
|
+
attemptCount: number;
|
|
99
|
+
maxAttempts: number;
|
|
100
|
+
nextAttemptAt?: number;
|
|
101
|
+
lastAttemptAt?: number;
|
|
102
|
+
lastStatusCode?: number;
|
|
103
|
+
lastError?: string;
|
|
104
|
+
deliveredAt?: number;
|
|
105
|
+
createdAt: number;
|
|
106
|
+
updatedAt: number;
|
|
107
|
+
};
|
|
108
|
+
export type WebhookDeliveryAttemptRecord = {
|
|
109
|
+
id: string;
|
|
110
|
+
attemptId: string;
|
|
111
|
+
deliveryId: string;
|
|
112
|
+
webhookId: string;
|
|
113
|
+
eventId: string;
|
|
114
|
+
eventType: string;
|
|
115
|
+
attemptNumber: number;
|
|
116
|
+
status: "succeeded" | "failed";
|
|
117
|
+
statusCode?: number;
|
|
118
|
+
error?: string;
|
|
119
|
+
responseBody?: string;
|
|
120
|
+
durationMs?: number;
|
|
121
|
+
createdAt: number;
|
|
122
|
+
};
|
|
123
|
+
export type WebhookDeliveriesResult = {
|
|
124
|
+
deliveries: Array<WebhookDeliveryRecord & {
|
|
125
|
+
attempts?: WebhookDeliveryAttemptRecord[];
|
|
126
|
+
}>;
|
|
127
|
+
};
|
|
128
|
+
export type WebhookHealthResult = {
|
|
129
|
+
webhookId: string;
|
|
130
|
+
totalAttempts: number;
|
|
131
|
+
successfulAttempts: number;
|
|
132
|
+
failedAttempts: number;
|
|
133
|
+
successRate: number;
|
|
134
|
+
pendingDeliveries: number;
|
|
135
|
+
deadLetterDeliveries: number;
|
|
136
|
+
lastDeliveryAt?: number;
|
|
137
|
+
lastSuccessfulDeliveryAt?: number;
|
|
138
|
+
};
|
|
139
|
+
export type WebhookTestResult = {
|
|
140
|
+
webhookId: string;
|
|
141
|
+
deliveryId: string;
|
|
142
|
+
status: WebhookDeliveryStatus;
|
|
143
|
+
attempts: number;
|
|
144
|
+
};
|
|
145
|
+
export type ReplayEventsInput = EventListQuery & {
|
|
146
|
+
webhookId?: string;
|
|
147
|
+
};
|
|
148
|
+
export type ReplayEventsResult = EventListResult & {
|
|
149
|
+
replayedDeliveries?: number;
|
|
150
|
+
replayedWebhookId?: string;
|
|
151
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type WebhookDeliveryStatus, type WebhookRecord } from "./types";
|
|
2
|
+
export declare function assertValidWebhookUrl(url: string): string;
|
|
3
|
+
export declare function normalizeWebhookPatterns(patterns: readonly string[]): string[];
|
|
4
|
+
export declare function assertValidWebhookSecret(secret: string): string;
|
|
5
|
+
export declare function computeWebhookSignature(payload: string, secret: string): Promise<string>;
|
|
6
|
+
export declare function nextDeliveryAttemptAt(currentAttemptCount: number, now?: number): number | undefined;
|
|
7
|
+
export declare function resolveDeliveryFailureStatus(attemptCount: number): WebhookDeliveryStatus;
|
|
8
|
+
export declare function sanitizeWebhookRecord(value: Record<string, unknown>): WebhookRecord;
|
|
9
|
+
export declare function truncateWebhookResponseBody(responseBody: string | undefined, maxLength?: number): string | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type BeliefsClientCoreConfig } from "@/lucern/packages/client-core/src/beliefs";
|
|
2
|
+
export type BeliefsFacadeConfig = BeliefsClientCoreConfig;
|
|
3
|
+
export declare function createBeliefsFacade(config?: BeliefsFacadeConfig): {
|
|
4
|
+
create(input: Parameters<(input: import("..").CreateBeliefInput, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsCreateResponse>>[0], idempotencyKey?: Parameters<(input: import("..").CreateBeliefInput, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsCreateResponse>>[1]): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsCreateResponse>;
|
|
5
|
+
get(id: string): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsGetResponse>;
|
|
6
|
+
list(query: Parameters<(query: import("..").ListBeliefsQuery) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsListResponse>>[0]): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsListResponse>;
|
|
7
|
+
refine(id: string, input: Parameters<(id: string, input: Omit<import("..").BeliefRefineInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsRefineResponse>>[1], idempotencyKey?: Parameters<(id: string, input: Omit<import("..").BeliefRefineInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsRefineResponse>>[2]): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsRefineResponse>;
|
|
8
|
+
fork(id: string, input: Parameters<(id: string, input: Omit<import("..").ForkBeliefInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsForkResponse>>[1], idempotencyKey?: Parameters<(id: string, input: Omit<import("..").ForkBeliefInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsForkResponse>>[2]): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsForkResponse>;
|
|
9
|
+
updateConfidence(id: string, input: Parameters<(id: string, input: Omit<import("..").UpdateBeliefConfidenceInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsUpdateConfidenceResponse>>[1], idempotencyKey?: Parameters<(id: string, input: Omit<import("..").UpdateBeliefConfidenceInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsUpdateConfidenceResponse>>[2]): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsUpdateConfidenceResponse>;
|
|
10
|
+
archive(id: string, input?: Parameters<(id: string, input?: Omit<import("..").ArchiveBeliefInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsArchiveResponse>>[1], idempotencyKey?: Parameters<(id: string, input?: Omit<import("..").ArchiveBeliefInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsArchiveResponse>>[2]): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsArchiveResponse>;
|
|
11
|
+
lineage(id: string): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsLineageResponse>;
|
|
12
|
+
confidenceHistory(id: string): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsConfidenceHistoryResponse>;
|
|
13
|
+
createContract(id: string, input: Parameters<(id: string, input: import("..").BeliefContractCreateInput, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsCreateContractResponse>>[1], idempotencyKey?: Parameters<(id: string, input: import("..").BeliefContractCreateInput, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsCreateContractResponse>>[2]): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsCreateContractResponse>;
|
|
14
|
+
bisect(id: string, input: Parameters<(id: string, input: Omit<import("..").BisectBeliefConfidenceInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsBisectResponse>>[1], idempotencyKey?: Parameters<(id: string, input: Omit<import("..").BisectBeliefConfidenceInput, "id">, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsBisectResponse>>[2]): Promise<import("@/lucern/packages/client-core/src/beliefs").BeliefsBisectResponse>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CompileContextInput, type ContextClientRequest } from "../../../client-core/src/context";
|
|
2
|
+
import type { PublicCompiledContext } from "../../../domain-context/src";
|
|
3
|
+
export type ContextFacadeTransport = {
|
|
4
|
+
request<T>(request: ContextClientRequest): Promise<T>;
|
|
5
|
+
};
|
|
6
|
+
export type ContextFacadeConfig = {
|
|
7
|
+
transport: ContextFacadeTransport;
|
|
8
|
+
};
|
|
9
|
+
export declare function createContextFacade(config: ContextFacadeConfig): {
|
|
10
|
+
compile(topicId: string, input?: CompileContextInput): Promise<PublicCompiledContext>;
|
|
11
|
+
};
|
|
12
|
+
export type { CompileContextInput, PublicCompiledContext };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ContradictionsClientCoreConfig } from "@/lucern/packages/client-core/src/contradictions";
|
|
2
|
+
export type ContradictionsFacadeConfig = ContradictionsClientCoreConfig;
|
|
3
|
+
export declare function createContradictionsFacade(config?: ContradictionsFacadeConfig): {
|
|
4
|
+
flag(input: Parameters<(input: import("..").FlagContradictionInput, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/contradictions").ContradictionsFlagResponse>>[0], idempotencyKey?: Parameters<(input: import("..").FlagContradictionInput, idempotencyKey?: string) => Promise<import("@/lucern/packages/client-core/src/contradictions").ContradictionsFlagResponse>>[1]): Promise<import("@/lucern/packages/client-core/src/contradictions").ContradictionsFlagResponse>;
|
|
5
|
+
list(query: Parameters<(query: import("..").ListContradictionsQuery) => Promise<import("@/lucern/packages/client-core/src/contradictions").ContradictionsListResponse>>[0]): Promise<import("@/lucern/packages/client-core/src/contradictions").ContradictionsListResponse>;
|
|
6
|
+
get(id: string): Promise<import("@/lucern/packages/client-core/src/contradictions").ContradictionsGetResponse>;
|
|
7
|
+
};
|