@lucern/sdk 0.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +97 -0
  2. package/dist/index.js +8980 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/lucern/contracts/src/auth-session.contract.d.ts +53 -0
  5. package/dist/lucern/contracts/src/context-pack.contract.d.ts +494 -0
  6. package/dist/lucern/contracts/src/lens-filter.contract.d.ts +70 -0
  7. package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +84 -0
  8. package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +151 -0
  9. package/dist/lucern/contracts/src/workflow-runtime.contract.d.ts +161 -0
  10. package/dist/lucern/mcp-server/src/context-pack-policy.d.ts +119 -0
  11. package/dist/lucern/mcp-server/src/context-pack-schema.d.ts +18 -0
  12. package/dist/lucern/modules/graph-primitives/src/ontology-matching.d.ts +78 -0
  13. package/dist/lucern/modules/graph-primitives/src/text-matching.d.ts +53 -0
  14. package/dist/lucern/packages/client-core/src/beliefs.d.ts +30 -0
  15. package/dist/lucern/packages/client-core/src/context.d.ts +29 -0
  16. package/dist/lucern/packages/client-core/src/contradictions.d.ts +11 -0
  17. package/dist/lucern/packages/client-core/src/edges.d.ts +11 -0
  18. package/dist/lucern/packages/client-core/src/events.d.ts +9 -0
  19. package/dist/lucern/packages/client-core/src/evidence.d.ts +21 -0
  20. package/dist/lucern/packages/client-core/src/graph.d.ts +17 -0
  21. package/dist/lucern/packages/client-core/src/identity.d.ts +7 -0
  22. package/dist/lucern/packages/client-core/src/ids.d.ts +7 -0
  23. package/dist/lucern/packages/client-core/src/ontologies.d.ts +13 -0
  24. package/dist/lucern/packages/client-core/src/questions.d.ts +39 -0
  25. package/dist/lucern/packages/client-core/src/search.d.ts +7 -0
  26. package/dist/lucern/packages/client-core/src/tasks.d.ts +13 -0
  27. package/dist/lucern/packages/client-core/src/topics.d.ts +17 -0
  28. package/dist/lucern/packages/client-core/src/webhooks.d.ts +35 -0
  29. package/dist/lucern/packages/client-core/src/worktrees.d.ts +17 -0
  30. package/dist/lucern/packages/domain-beliefs/src/beliefs.d.ts +283 -0
  31. package/dist/lucern/packages/domain-beliefs/src/index.d.ts +1 -0
  32. package/dist/lucern/packages/domain-context/src/compile.d.ts +11 -0
  33. package/dist/lucern/packages/domain-context/src/context-pack-compiler.d.ts +101 -0
  34. package/dist/lucern/packages/domain-context/src/index.d.ts +4 -0
  35. package/dist/lucern/packages/domain-context/src/ports.d.ts +58 -0
  36. package/dist/lucern/packages/domain-context/src/public-types.d.ts +1 -0
  37. package/dist/lucern/packages/domain-edges/src/contradictions.d.ts +59 -0
  38. package/dist/lucern/packages/domain-edges/src/edges.d.ts +91 -0
  39. package/dist/lucern/packages/domain-edges/src/index.d.ts +2 -0
  40. package/dist/lucern/packages/domain-evidence/src/evidence.d.ts +115 -0
  41. package/dist/lucern/packages/domain-evidence/src/index.d.ts +1 -0
  42. package/dist/lucern/packages/domain-graph/src/graph.d.ts +150 -0
  43. package/dist/lucern/packages/domain-identity/src/index.d.ts +1 -0
  44. package/dist/lucern/packages/domain-identity/src/whoami.d.ts +13 -0
  45. package/dist/lucern/packages/domain-ontologies/src/ontologies.d.ts +123 -0
  46. package/dist/lucern/packages/domain-questions/src/index.d.ts +1 -0
  47. package/dist/lucern/packages/domain-questions/src/questions.d.ts +147 -0
  48. package/dist/lucern/packages/domain-search/src/search.d.ts +97 -0
  49. package/dist/lucern/packages/domain-tasks/src/index.d.ts +1 -0
  50. package/dist/lucern/packages/domain-tasks/src/tasks.d.ts +102 -0
  51. package/dist/lucern/packages/domain-topics/src/index.d.ts +1 -0
  52. package/dist/lucern/packages/domain-topics/src/topics.d.ts +147 -0
  53. package/dist/lucern/packages/domain-worktrees/src/index.d.ts +1 -0
  54. package/dist/lucern/packages/domain-worktrees/src/worktrees.d.ts +185 -0
  55. package/dist/lucern/packages/events/src/index.d.ts +4 -0
  56. package/dist/lucern/packages/events/src/matching.d.ts +3 -0
  57. package/dist/lucern/packages/events/src/outbox.d.ts +15 -0
  58. package/dist/lucern/packages/events/src/types.d.ts +151 -0
  59. package/dist/lucern/packages/events/src/webhooks.d.ts +9 -0
  60. package/dist/lucern/packages/sdk-typescript/src/facade/beliefs.d.ts +15 -0
  61. package/dist/lucern/packages/sdk-typescript/src/facade/context.d.ts +12 -0
  62. package/dist/lucern/packages/sdk-typescript/src/facade/contradictions.d.ts +7 -0
  63. package/dist/lucern/packages/sdk-typescript/src/facade/edges.d.ts +7 -0
  64. package/dist/lucern/packages/sdk-typescript/src/facade/events.d.ts +6 -0
  65. package/dist/lucern/packages/sdk-typescript/src/facade/evidence.d.ts +21 -0
  66. package/dist/lucern/packages/sdk-typescript/src/facade/graph.d.ts +10 -0
  67. package/dist/lucern/packages/sdk-typescript/src/facade/identity.d.ts +5 -0
  68. package/dist/lucern/packages/sdk-typescript/src/facade/ontologies.d.ts +8 -0
  69. package/dist/lucern/packages/sdk-typescript/src/facade/questions.d.ts +39 -0
  70. package/dist/lucern/packages/sdk-typescript/src/facade/search.d.ts +5 -0
  71. package/dist/lucern/packages/sdk-typescript/src/facade/tasks.d.ts +8 -0
  72. package/dist/lucern/packages/sdk-typescript/src/facade/topics.d.ts +10 -0
  73. package/dist/lucern/packages/sdk-typescript/src/facade/webhooks.d.ts +16 -0
  74. package/dist/lucern/packages/sdk-typescript/src/facade/worktrees.d.ts +10 -0
  75. package/dist/lucern/packages/sdk-typescript/src/index.d.ts +28 -0
  76. package/dist/packages/sdk/src/adminClient.d.ts +89 -0
  77. package/dist/packages/sdk/src/answersClient.d.ts +5 -0
  78. package/dist/packages/sdk/src/audiencesClient.d.ts +87 -0
  79. package/dist/packages/sdk/src/auditClient.d.ts +23 -0
  80. package/dist/packages/sdk/src/beliefsClient.d.ts +54 -0
  81. package/dist/packages/sdk/src/client.d.ts +1610 -0
  82. package/dist/packages/sdk/src/contextClient.d.ts +9 -0
  83. package/dist/packages/sdk/src/contracts/api-enums.contract.d.ts +58 -0
  84. package/dist/packages/sdk/src/controlObjectOwnership.d.ts +293 -0
  85. package/dist/packages/sdk/src/coreClient.d.ts +120 -0
  86. package/dist/packages/sdk/src/customTools.d.ts +65 -0
  87. package/dist/packages/sdk/src/decisionsClient.d.ts +110 -0
  88. package/dist/packages/sdk/src/graphClient.d.ts +209 -0
  89. package/dist/packages/sdk/src/harnessClient.d.ts +222 -0
  90. package/dist/packages/sdk/src/identityClient.d.ts +104 -0
  91. package/dist/packages/sdk/src/index.d.ts +28 -0
  92. package/dist/packages/sdk/src/learningClient.d.ts +43 -0
  93. package/dist/packages/sdk/src/mcpParityClient.d.ts +68 -0
  94. package/dist/packages/sdk/src/mcpParitySurface.d.ts +8 -0
  95. package/dist/packages/sdk/src/ontologyClient.d.ts +115 -0
  96. package/dist/packages/sdk/src/packsClient.d.ts +101 -0
  97. package/dist/packages/sdk/src/policyClient.d.ts +204 -0
  98. package/dist/packages/sdk/src/reportsClient.d.ts +31 -0
  99. package/dist/packages/sdk/src/schemaClient.d.ts +54 -0
  100. package/dist/packages/sdk/src/sdkSurface.d.ts +56 -0
  101. package/dist/packages/sdk/src/topicsClient.d.ts +45 -0
  102. package/dist/packages/sdk/src/types.d.ts +489 -0
  103. package/dist/packages/sdk/src/version.d.ts +2 -0
  104. package/dist/packages/sdk/src/workflowClient.d.ts +274 -0
  105. package/package.json +56 -0
@@ -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";
@@ -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";