@lucern/sdk 1.0.28 → 1.0.30

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 (191) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/accessControl.d.ts +31 -31
  3. package/dist/accessControl.js +1 -0
  4. package/dist/adminClient.d.ts +74 -74
  5. package/dist/adminClient.js +38 -30
  6. package/dist/{answersClient.d.ts → answers-client.d.ts} +1 -1
  7. package/dist/{answersClient.js → answers-client.js} +2 -2
  8. package/dist/audience/index.d.ts +12 -12
  9. package/dist/{audiencesClient.d.ts → audiences-client.d.ts} +1 -1
  10. package/dist/audiences-client.js +107 -0
  11. package/dist/{auditClient.d.ts → audit-client.d.ts} +2 -3
  12. package/dist/{auditClient.js → audit-client.js} +8 -7
  13. package/dist/authContext.d.ts +26 -26
  14. package/dist/authDeviceClient.d.ts +11 -11
  15. package/dist/authDeviceClient.js +4 -6
  16. package/dist/beliefs/index.d.ts +56 -28
  17. package/dist/beliefs/index.js +2 -1
  18. package/dist/beliefsClient.d.ts +71 -63
  19. package/dist/beliefsClient.js +90 -67
  20. package/dist/{boundaryClientSurface.d.ts → boundary-client-surface.d.ts} +4 -4
  21. package/dist/{boundaryClientSurface.js → boundary-client-surface.js} +9 -7
  22. package/dist/client-assembly-types.d.ts +219 -0
  23. package/dist/client-assembly-types.js +2 -0
  24. package/dist/{clientConfig.d.ts → client-config.d.ts} +16 -32
  25. package/dist/client-config.js +2 -0
  26. package/dist/{clientEvidenceCompat.d.ts → client-evidence-compat.d.ts} +24 -24
  27. package/dist/{clientEvidenceCompat.js → client-evidence-compat.js} +2 -2
  28. package/dist/client.d.ts +1906 -352
  29. package/dist/client.js +34 -30
  30. package/dist/clientGraphNamespaces.d.ts +35 -25
  31. package/dist/clientGraphNamespaces.js +11 -5
  32. package/dist/clientHelpers.js +8 -5
  33. package/dist/clientKnowledgeNamespaces.d.ts +124 -84
  34. package/dist/clientKnowledgeNamespaces.js +35 -34
  35. package/dist/clientLocalHelpers.d.ts +81 -52
  36. package/dist/clientLocalHelpers.js +193 -43
  37. package/dist/clientPlatformNamespaces.d.ts +1541 -150
  38. package/dist/clientPlatformNamespaces.js +10 -5
  39. package/dist/clientRuntime.d.ts +1 -1
  40. package/dist/clientRuntime.js +1 -1
  41. package/dist/clientWorkflowNamespaces.d.ts +211 -97
  42. package/dist/clientWorkflowNamespaces.js +22 -19
  43. package/dist/contextClient.d.ts +2 -2
  44. package/dist/contextClient.js +79 -50
  45. package/dist/contextFacade.d.ts +1 -1
  46. package/dist/contextFacade.js +2 -0
  47. package/dist/contextPackCompiler.d.ts +52 -52
  48. package/dist/contextPackCompiler.js +192 -122
  49. package/dist/contextPackPolicy.d.ts +22 -22
  50. package/dist/contextPackPolicy.js +21 -9
  51. package/dist/contextPackSchema.d.ts +3 -3
  52. package/dist/contextPackSchema.js +1 -0
  53. package/dist/contextTypes.d.ts +155 -155
  54. package/dist/contracts/api-enums.contract.js +2 -11
  55. package/dist/contracts/auth-session.contract.d.ts +16 -16
  56. package/dist/contracts/auth-session.contract.js +3 -2
  57. package/dist/contracts/context-pack.contract.d.ts +216 -216
  58. package/dist/contracts/contextPack.js +2 -0
  59. package/dist/contracts/index.d.ts +1 -1
  60. package/dist/contracts/index.js +2 -1
  61. package/dist/contracts/lens-filter.contract.d.ts +8 -8
  62. package/dist/contracts/lens-filter.contract.js +10 -10
  63. package/dist/contracts/lens-workflow.contract.d.ts +32 -32
  64. package/dist/contracts/lens-workflow.contract.js +2 -1
  65. package/dist/contracts/lensFilter.js +2 -0
  66. package/dist/contracts/lensWorkflow.js +2 -0
  67. package/dist/contracts/mcpTools.d.ts +19 -19
  68. package/dist/contracts/mcpTools.js +3 -1
  69. package/dist/contracts/prompt.contract.d.ts +12 -12
  70. package/dist/contracts/prompt.js +1 -0
  71. package/dist/contracts/sdk-tools.contract.js +1 -0
  72. package/dist/contracts/sdkTools.js +2 -0
  73. package/dist/contracts/tool-contracts.js +1 -0
  74. package/dist/contracts/workflow-runtime.contract.d.ts +45 -45
  75. package/dist/contracts/workflow-runtime.contract.js +1 -5
  76. package/dist/contracts/workflowRuntime.js +2 -0
  77. package/dist/contradictions/index.d.ts +8 -8
  78. package/dist/contradictions/index.js +1 -0
  79. package/dist/control-plane.d.ts +10 -10
  80. package/dist/control-plane.js +2 -2
  81. package/dist/controlObjectOwnership.d.ts +11 -11
  82. package/dist/controlObjectOwnership.js +1 -0
  83. package/dist/coreClient.d.ts +51 -51
  84. package/dist/coreClient.js +269 -101
  85. package/dist/customTools.d.ts +19 -19
  86. package/dist/customTools.js +4 -2
  87. package/dist/decisions/index.d.ts +18 -18
  88. package/dist/decisions/index.js +1 -0
  89. package/dist/decisionsClient.d.ts +4 -4
  90. package/dist/decisionsClient.js +36 -27
  91. package/dist/edges/index.d.ts +20 -18
  92. package/dist/edges/index.js +1 -0
  93. package/dist/embeddingsClient.d.ts +29 -29
  94. package/dist/embeddingsClient.js +15 -8
  95. package/dist/eventingClient.d.ts +27 -27
  96. package/dist/eventingClient.js +10 -5
  97. package/dist/events.d.ts +83 -83
  98. package/dist/events.js +19 -15
  99. package/dist/eventsCore.d.ts +7 -7
  100. package/dist/eventsCore.js +11 -10
  101. package/dist/evidence/index.d.ts +23 -21
  102. package/dist/evidence/index.js +1 -0
  103. package/dist/evidenceClient.d.ts +23 -23
  104. package/dist/evidenceClient.js +10 -6
  105. package/dist/facade/context.d.ts +9 -9
  106. package/dist/facade/context.js +67 -41
  107. package/dist/functionSurface.js +2 -0
  108. package/dist/functionSurfaceClient.js +2 -0
  109. package/dist/gatewayFacades.d.ts +215 -215
  110. package/dist/gatewayFacades.factories.d.ts +23 -44
  111. package/dist/gatewayFacades.factories.js +63 -62
  112. package/dist/gatewayFacades.js +31 -32
  113. package/dist/graphAnalysisClient.d.ts +60 -60
  114. package/dist/graphAnalysisClient.js +19 -18
  115. package/dist/graphClient.d.ts +34 -34
  116. package/dist/graphClient.js +56 -35
  117. package/dist/graphIntel.js +2 -0
  118. package/dist/graphIntelligence.d.ts +2 -2
  119. package/dist/graphIntelligence.js +1 -1
  120. package/dist/graphRecommendationsClient.d.ts +24 -24
  121. package/dist/graphRecommendationsClient.js +12 -7
  122. package/dist/graphStateClassifierClient.d.ts +13 -13
  123. package/dist/graphStateClassifierClient.js +10 -5
  124. package/dist/harnessClient.d.ts +61 -61
  125. package/dist/harnessClient.js +44 -31
  126. package/dist/identityClient.d.ts +33 -59
  127. package/dist/identityClient.js +126 -98
  128. package/dist/index.d.ts +20 -20
  129. package/dist/index.js +20 -19
  130. package/dist/infisicalRuntime.d.ts +11 -11
  131. package/dist/infisicalRuntime.js +20 -14
  132. package/dist/jobsClient.d.ts +28 -28
  133. package/dist/jobsClient.js +6 -3
  134. package/dist/learningClient.js +13 -8
  135. package/dist/lenses/index.d.ts +124 -28
  136. package/dist/lenses/index.js +1 -0
  137. package/dist/mcpClient.d.ts +1 -1
  138. package/dist/mcpClient.js +3 -3
  139. package/dist/modelRuntimeClient.d.ts +27 -27
  140. package/dist/modelRuntimeClient.js +10 -5
  141. package/dist/nodes/index.d.ts +9 -9
  142. package/dist/nodes/index.js +1 -0
  143. package/dist/ontologies/index.d.ts +68 -22
  144. package/dist/ontologies/index.js +1 -0
  145. package/dist/ontologyClient.js +24 -17
  146. package/dist/ontologyLinksClient.d.ts +35 -35
  147. package/dist/ontologyLinksClient.js +9 -6
  148. package/dist/opinion.d.ts +3 -3
  149. package/dist/opinion.js +12 -5
  150. package/dist/orgGraphSearchClient.d.ts +39 -39
  151. package/dist/orgGraphSearchClient.js +22 -13
  152. package/dist/packsClient.d.ts +1 -1
  153. package/dist/packsClient.js +28 -19
  154. package/dist/policyClient.d.ts +79 -68
  155. package/dist/policyClient.js +18 -12
  156. package/dist/proof-attestation.json +1 -1
  157. package/dist/questions/index.d.ts +38 -27
  158. package/dist/questions/index.js +1 -0
  159. package/dist/realtime/index.d.ts +3 -3
  160. package/dist/realtime/index.js +1 -0
  161. package/dist/realtime/refs.d.ts +2 -2
  162. package/dist/{reportsClient.d.ts → reports-client.d.ts} +2 -2
  163. package/dist/{reportsClient.js → reports-client.js} +19 -13
  164. package/dist/{schemaClient.d.ts → schema-client.d.ts} +2 -3
  165. package/dist/{schemaClient.js → schema-client.js} +14 -11
  166. package/dist/sdkSurface.d.ts +12 -12
  167. package/dist/sdkSurface.js +14 -10
  168. package/dist/secrets.d.ts +1 -1
  169. package/dist/secrets.js +2 -1
  170. package/dist/{sourcesClient.d.ts → sources-client.d.ts} +8 -9
  171. package/dist/{sourcesClient.js → sources-client.js} +4 -5
  172. package/dist/{telemetryClient.d.ts → telemetry-client.d.ts} +14 -14
  173. package/dist/{telemetryClient.js → telemetry-client.js} +6 -4
  174. package/dist/toolRegistryClient.d.ts +46 -46
  175. package/dist/toolRegistryClient.js +22 -11
  176. package/dist/topics/index.d.ts +23 -23
  177. package/dist/topics/index.js +2 -1
  178. package/dist/topicsClient.d.ts +6 -6
  179. package/dist/topicsClient.js +29 -18
  180. package/dist/types.d.ts +356 -355
  181. package/dist/version.d.ts +1 -1
  182. package/dist/version.js +1 -1
  183. package/dist/workflowClient.d.ts +36 -35
  184. package/dist/workflowClient.js +88 -60
  185. package/dist/worktrees/index.d.ts +118 -32
  186. package/dist/worktrees/index.js +2 -1
  187. package/package.json +45 -5
  188. package/dist/audiencesClient.js +0 -115
  189. package/dist/clientAssemblyTypes.d.ts +0 -33
  190. package/dist/clientAssemblyTypes.js +0 -2
  191. package/dist/clientConfig.js +0 -2
@@ -1,18 +1,23 @@
1
1
  import { createGatewayRequestClient, } from "./coreClient.js";
2
+ function deferGatewayRequest(buildRequest) {
3
+ return Promise.resolve().then(buildRequest);
4
+ }
2
5
  function cleanString(value) {
3
6
  return typeof value === "string" && value.trim().length > 0
4
7
  ? value.trim()
5
8
  : undefined;
6
9
  }
7
10
  function cleanNumber(value) {
8
- return typeof value === "number" && Number.isFinite(value) ? value : undefined;
11
+ return typeof value === "number" && Number.isFinite(value)
12
+ ? value
13
+ : undefined;
9
14
  }
10
15
  function cleanBoolean(value) {
11
16
  return typeof value === "boolean" ? value : undefined;
12
17
  }
13
18
  function cleanStringArray(value) {
14
19
  if (!Array.isArray(value)) {
15
- return undefined;
20
+ return;
16
21
  }
17
22
  const cleaned = value
18
23
  .map((item) => cleanString(item))
@@ -31,96 +36,120 @@ function assignNumber(payload, key, value) {
31
36
  payload[key] = cleaned;
32
37
  }
33
38
  }
34
- function buildCompileContextRequest(topicIdOrInput = {}, input = {}) {
35
- const effectiveInput = typeof topicIdOrInput === "string" ? input : topicIdOrInput;
36
- const payload = {};
39
+ function effectiveCompileInput(topicIdOrInput, input) {
40
+ return typeof topicIdOrInput === "string" ? input : topicIdOrInput;
41
+ }
42
+ function assignCompileTopicAndQuery(payload, topicIdOrInput, input) {
37
43
  const topicId = typeof topicIdOrInput === "string"
38
44
  ? cleanString(topicIdOrInput)
39
- : cleanString(effectiveInput.topicId);
45
+ : cleanString(input.topicId);
40
46
  if (topicId) {
41
47
  payload.topicId = topicId;
42
48
  }
43
- const query = cleanString(effectiveInput.query);
49
+ const query = cleanString(input.query);
44
50
  if (query) {
45
51
  payload.query = query;
46
52
  }
47
- assignString(payload, "purpose", effectiveInput.purpose);
48
- assignString(payload, "purposePrompt", effectiveInput.purposePrompt);
49
- assignString(payload, "topicHint", effectiveInput.topicHint);
50
- const tags = cleanStringArray(effectiveInput.tags);
53
+ }
54
+ function assignCompileStringMetadata(payload, input) {
55
+ assignString(payload, "purpose", input.purpose);
56
+ assignString(payload, "purposePrompt", input.purposePrompt);
57
+ assignString(payload, "topicHint", input.topicHint);
58
+ assignString(payload, "sourceRef", input.sourceRef);
59
+ assignString(payload, "sourceKind", input.sourceKind);
60
+ assignString(payload, "lane", input.lane);
61
+ assignString(payload, "status", input.status);
62
+ assignString(payload, "principalId", input.principalId);
63
+ assignString(payload, "workspaceId", input.workspaceId);
64
+ }
65
+ function assignCompileArrayMetadata(payload, input) {
66
+ const tags = cleanStringArray(input.tags);
51
67
  if (tags) {
52
68
  payload.tags = tags;
53
69
  }
54
- const touchedPaths = cleanStringArray(effectiveInput.touchedPaths);
70
+ const touchedPaths = cleanStringArray(input.touchedPaths);
55
71
  if (touchedPaths) {
56
72
  payload.touchedPaths = touchedPaths;
57
73
  }
58
- assignString(payload, "sourceRef", effectiveInput.sourceRef);
59
- assignString(payload, "sourceKind", effectiveInput.sourceKind);
60
- assignNumber(payload, "campaign", effectiveInput.campaign);
61
- assignString(payload, "lane", effectiveInput.lane);
62
- assignString(payload, "status", effectiveInput.status);
63
- assignString(payload, "principalId", effectiveInput.principalId);
64
- assignString(payload, "workspaceId", effectiveInput.workspaceId);
65
- const budget = cleanNumber(effectiveInput.budget);
74
+ }
75
+ function assignCompileBudgets(payload, input) {
76
+ assignNumber(payload, "campaign", input.campaign);
77
+ const budget = cleanNumber(input.budget);
66
78
  if (budget !== undefined) {
67
79
  payload.budget = budget;
68
80
  }
69
- const tokenBudget = cleanNumber(effectiveInput.tokenBudget);
81
+ const tokenBudget = cleanNumber(input.tokenBudget);
70
82
  if (tokenBudget !== undefined) {
71
83
  payload.tokenBudget = tokenBudget;
72
84
  if (budget === undefined) {
73
85
  payload.budget = tokenBudget;
74
86
  }
75
87
  }
76
- const ranking = cleanString(effectiveInput.ranking) ?? cleanString(effectiveInput.rankingProfile);
88
+ assignNumber(payload, "contentTopicLimit", input.contentTopicLimit);
89
+ }
90
+ function assignCompileTraversal(payload, input) {
91
+ const ranking = cleanString(input.ranking) ?? cleanString(input.rankingProfile);
77
92
  if (ranking) {
78
93
  payload.ranking = ranking;
79
94
  }
80
- const limit = cleanNumber(effectiveInput.limit);
95
+ const limit = cleanNumber(input.limit);
81
96
  if (limit !== undefined) {
82
97
  payload.limit = limit;
83
98
  }
84
- assignNumber(payload, "contentTopicLimit", effectiveInput.contentTopicLimit);
85
- const maxDepth = cleanNumber(effectiveInput.maxDepth);
99
+ const maxDepth = cleanNumber(input.maxDepth);
86
100
  if (maxDepth !== undefined) {
87
101
  payload.maxDepth = maxDepth;
88
102
  }
89
- const includeEntities = cleanBoolean(effectiveInput.includeEntities);
103
+ const includeEntities = cleanBoolean(input.includeEntities);
90
104
  if (includeEntities !== undefined) {
91
105
  payload.includeEntities = includeEntities;
92
106
  }
93
- const mode = cleanString(effectiveInput.mode);
107
+ const mode = cleanString(input.mode);
94
108
  if (mode) {
95
109
  payload.mode = mode;
96
110
  }
97
- assignString(payload, "traversalMode", effectiveInput.traversalMode);
98
- assignString(payload, "requestedDepth", effectiveInput.requestedDepth);
99
- const heartbeat = cleanBoolean(effectiveInput.heartbeat);
111
+ assignString(payload, "traversalMode", input.traversalMode);
112
+ assignString(payload, "requestedDepth", input.requestedDepth);
113
+ }
114
+ function assignCompileHeartbeat(payload, input) {
115
+ const heartbeat = cleanBoolean(input.heartbeat);
100
116
  if (heartbeat !== undefined) {
101
117
  payload.heartbeat = heartbeat;
102
118
  }
103
- assignString(payload, "heartbeatIntent", effectiveInput.heartbeatIntent);
104
- assignNumber(payload, "heartbeatBudgetMs", effectiveInput.heartbeatBudgetMs);
105
- assignString(payload, "heartbeatTraceId", effectiveInput.heartbeatTraceId);
106
- assignString(payload, "invocationIntent", effectiveInput.invocationIntent);
107
- assignString(payload, "receiptIntent", effectiveInput.receiptIntent);
108
- const includeFailures = cleanBoolean(effectiveInput.includeFailures);
119
+ assignString(payload, "heartbeatIntent", input.heartbeatIntent);
120
+ assignNumber(payload, "heartbeatBudgetMs", input.heartbeatBudgetMs);
121
+ assignString(payload, "heartbeatTraceId", input.heartbeatTraceId);
122
+ assignString(payload, "invocationIntent", input.invocationIntent);
123
+ assignString(payload, "receiptIntent", input.receiptIntent);
124
+ }
125
+ function assignCompileOptionalControls(payload, input) {
126
+ const includeFailures = cleanBoolean(input.includeFailures);
109
127
  if (includeFailures !== undefined) {
110
128
  payload.includeFailures = includeFailures;
111
129
  }
112
- const worktreeId = cleanString(effectiveInput.worktreeId);
130
+ const worktreeId = cleanString(input.worktreeId);
113
131
  if (worktreeId) {
114
132
  payload.worktreeId = worktreeId;
115
133
  }
116
- const sessionId = cleanString(effectiveInput.sessionId);
134
+ const sessionId = cleanString(input.sessionId);
117
135
  if (sessionId) {
118
136
  payload.sessionId = sessionId;
119
137
  }
120
- if (Array.isArray(effectiveInput.packWeightOverrides) &&
121
- effectiveInput.packWeightOverrides.length > 0) {
122
- payload.packWeightOverrides = effectiveInput.packWeightOverrides;
138
+ if (Array.isArray(input.packWeightOverrides) &&
139
+ input.packWeightOverrides.length > 0) {
140
+ payload.packWeightOverrides = input.packWeightOverrides;
123
141
  }
142
+ }
143
+ function buildCompileContextRequest(topicIdOrInput = {}, input = {}) {
144
+ const effectiveInput = effectiveCompileInput(topicIdOrInput, input);
145
+ const payload = {};
146
+ assignCompileTopicAndQuery(payload, topicIdOrInput, effectiveInput);
147
+ assignCompileStringMetadata(payload, effectiveInput);
148
+ assignCompileArrayMetadata(payload, effectiveInput);
149
+ assignCompileBudgets(payload, effectiveInput);
150
+ assignCompileTraversal(payload, effectiveInput);
151
+ assignCompileHeartbeat(payload, effectiveInput);
152
+ assignCompileOptionalControls(payload, effectiveInput);
124
153
  return {
125
154
  path: "/api/platform/v1/context/compile",
126
155
  method: "POST",
@@ -160,26 +189,26 @@ export function createContextClient(config = {}) {
160
189
  * @param input - Optional compile parameters (query, budget, ranking, etc.).
161
190
  * @returns The compiled context payload with beliefs, questions, and evidence.
162
191
  */
163
- async compile(topicIdOrInput = {}, input = {}) {
192
+ compile(topicIdOrInput = {}, input = {}) {
164
193
  const request = buildCompileContextRequest(topicIdOrInput, input);
165
- return gateway.request({
194
+ return deferGatewayRequest(() => gateway.request({
166
195
  ...request,
167
196
  body: request.body,
168
- });
197
+ }));
169
198
  },
170
- async compileByQuery(input = {}) {
199
+ compileByQuery(input = {}) {
171
200
  const request = buildCompileContextRequest(input);
172
- return gateway.request({
201
+ return deferGatewayRequest(() => gateway.request({
173
202
  ...request,
174
203
  body: request.body,
175
- });
204
+ }));
176
205
  },
177
- async getCampaignContext(input) {
206
+ getCampaignContext(input) {
178
207
  const request = buildGetCampaignContextRequest(input);
179
- return gateway.request({
208
+ return deferGatewayRequest(() => gateway.request({
180
209
  ...request,
181
210
  body: request.body,
182
- });
211
+ }));
183
212
  },
184
213
  };
185
214
  }
@@ -7,5 +7,5 @@
7
7
  *
8
8
  * Added: EK-16 T7.3.4 (2026-04-18).
9
9
  */
10
- export { createContextFacade, type ContextFacadeConfig, type ContextFacadeTransport, } from "./facade/context";
10
+ export { type ContextFacadeConfig, type ContextFacadeTransport, createContextFacade, } from "./facade/context";
11
11
  //# sourceMappingURL=contextFacade.d.ts.map
@@ -1,3 +1,5 @@
1
+ // biome-ignore-all lint/style/useFilenamingConvention: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the camelCase filename is intentional.
2
+ // biome-ignore-all lint/performance/noBarrelFile: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the facade/barrel export is intentional.
1
3
  /**
2
4
  * Context facade factory exposed for testing / audit tooling.
3
5
  *
@@ -1,100 +1,100 @@
1
- import { type ContextCompilationMode, type ContextPackV1, type PackWeightOverride, type ContextRankingProfile } from "./contracts/context-pack.contract";
2
1
  import { resolveEffectiveWeights } from "./contextPackPolicy";
3
- export type ContextPackTopicRow = {
2
+ import { type ContextCompilationMode, type ContextPackV1, type ContextRankingProfile, type PackWeightOverride } from "./contracts/context-pack.contract";
3
+ export interface ContextPackTopicRow {
4
4
  _id: string;
5
+ createdAt?: number;
6
+ depth?: number;
7
+ generatedAt?: number;
5
8
  name?: string;
6
9
  parentTopicId?: string;
7
- depth?: number;
8
10
  status?: string;
9
11
  updatedAt?: number;
10
- createdAt?: number;
11
- generatedAt?: number;
12
- };
13
- type ContextPackBeliefRow = {
12
+ }
13
+ interface ContextPackBeliefRow {
14
14
  _id: string;
15
+ beliefType?: string;
15
16
  canonicalText?: string;
16
17
  confidence?: number;
17
- beliefType?: string;
18
- status?: string;
18
+ createdAt?: number;
19
19
  metadata?: Record<string, unknown>;
20
+ status?: string;
20
21
  updatedAt?: number;
21
- createdAt?: number;
22
- };
23
- type ContextPackQuestionRow = {
22
+ }
23
+ interface ContextPackQuestionRow {
24
24
  _id: string;
25
25
  canonicalText?: string;
26
- status?: string;
26
+ createdAt?: number;
27
27
  metadata?: Record<string, unknown>;
28
+ status?: string;
28
29
  updatedAt?: number;
29
- createdAt?: number;
30
- };
31
- type ContextPackEvidenceRow = {
30
+ }
31
+ interface ContextPackEvidenceRow {
32
32
  _id: string;
33
33
  canonicalText?: string;
34
- sourceUrl?: string;
34
+ createdAt?: number;
35
35
  metadata?: Record<string, unknown>;
36
+ sourceUrl?: string;
36
37
  updatedAt?: number;
37
- createdAt?: number;
38
- };
39
- type ContextPackContradictionRow = {
38
+ }
39
+ interface ContextPackContradictionRow {
40
40
  _id?: string;
41
- globalId?: string;
42
- weight?: number;
43
41
  context?: string;
42
+ createdAt?: number;
44
43
  description?: string;
44
+ globalId?: string;
45
45
  summary?: string;
46
46
  updatedAt?: number;
47
- createdAt?: number;
48
- };
49
- type ContextPackEntityRow = {
47
+ weight?: number;
48
+ }
49
+ interface ContextPackEntityRow {
50
50
  _id: string;
51
- nodeType?: string;
52
- title?: string;
53
51
  canonicalText?: string;
54
52
  connectedBeliefCount?: number;
55
53
  connectedEvidenceCount?: number;
56
54
  metadata?: Record<string, unknown>;
55
+ nodeType?: string;
56
+ title?: string;
57
57
  updatedAt?: number;
58
- };
59
- type ContextPackFailureRow = {
58
+ }
59
+ interface ContextPackFailureRow {
60
60
  _id: string;
61
61
  canonicalText?: string;
62
+ createdAt?: number;
62
63
  metadata?: Record<string, unknown>;
63
64
  updatedAt?: number;
64
- createdAt?: number;
65
- };
66
- export type CompileContextPackPlan = {
67
- topicId: string;
68
- queryText?: string;
69
- tokens: string[];
70
- limit: number;
71
- rankingProfile: ContextRankingProfile;
72
- tokenBudget: number;
65
+ }
66
+ export interface CompileContextPackPlan {
67
+ compilationMode: ContextCompilationMode;
73
68
  descendantDepth: number;
69
+ effectiveWeights: ReturnType<typeof resolveEffectiveWeights>;
74
70
  includeEntities: boolean;
75
- compilationMode: ContextCompilationMode;
76
71
  includeFailures: boolean;
77
- worktreeId?: string;
78
- sessionId?: string;
72
+ limit: number;
79
73
  packWeightOverrides?: PackWeightOverride[];
80
- effectiveWeights: ReturnType<typeof resolveEffectiveWeights>;
74
+ queryText?: string;
75
+ rankingProfile: ContextRankingProfile;
81
76
  scopedTopicIds: string[];
82
- };
83
- export type CompileContextPackPlanInput = {
84
- args: Record<string, unknown> | undefined;
85
- topic: ContextPackTopicRow;
77
+ sessionId?: string;
78
+ tokenBudget: number;
79
+ tokens: string[];
80
+ topicId: string;
81
+ worktreeId?: string;
82
+ }
83
+ export interface CompileContextPackPlanInput {
86
84
  allTopics: ContextPackTopicRow[];
87
- };
88
- export type CompileContextPackSnapshot = {
85
+ args: Record<string, unknown> | undefined;
89
86
  topic: ContextPackTopicRow;
90
- plan: CompileContextPackPlan;
87
+ }
88
+ export interface CompileContextPackSnapshot {
91
89
  beliefs: ContextPackBeliefRow[];
92
- questions: ContextPackQuestionRow[];
93
- evidence: ContextPackEvidenceRow[];
94
90
  contradictions: ContextPackContradictionRow[];
95
91
  entities: ContextPackEntityRow[];
92
+ evidence: ContextPackEvidenceRow[];
96
93
  failures?: ContextPackFailureRow[];
97
- };
94
+ plan: CompileContextPackPlan;
95
+ questions: ContextPackQuestionRow[];
96
+ topic: ContextPackTopicRow;
97
+ }
98
98
  export declare function planContextPackCompilation(input: CompileContextPackPlanInput): CompileContextPackPlan;
99
99
  export declare function compileContextPackFromSnapshot(snapshot: CompileContextPackSnapshot): ContextPackV1;
100
100
  export {};