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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/README.md +51 -4
  3. package/dist/adminClient.d.ts +10 -8
  4. package/dist/adminClient.js +242 -39
  5. package/dist/adminClient.js.map +1 -1
  6. package/dist/answersClient.d.ts +2 -0
  7. package/dist/answersClient.js +221 -11
  8. package/dist/answersClient.js.map +1 -1
  9. package/dist/audience/index.d.ts +2 -1
  10. package/dist/audience/index.js +1 -3
  11. package/dist/audience/index.js.map +1 -1
  12. package/dist/audiencesClient.d.ts +18 -16
  13. package/dist/audiencesClient.js +297 -90
  14. package/dist/audiencesClient.js.map +1 -1
  15. package/dist/auditClient.d.ts +2 -0
  16. package/dist/auditClient.js +227 -15
  17. package/dist/auditClient.js.map +1 -1
  18. package/dist/authContext.d.ts +56 -0
  19. package/dist/authContext.js +170 -0
  20. package/dist/authContext.js.map +1 -0
  21. package/dist/authDeviceClient.d.ts +49 -0
  22. package/dist/authDeviceClient.js +121 -0
  23. package/dist/authDeviceClient.js.map +1 -0
  24. package/dist/beliefs/index.d.ts +25 -5
  25. package/dist/beliefs/index.js +3286 -1049
  26. package/dist/beliefs/index.js.map +1 -1
  27. package/dist/beliefsClient.d.ts +4 -2
  28. package/dist/beliefsClient.js +230 -26
  29. package/dist/beliefsClient.js.map +1 -1
  30. package/dist/boundaryClientSurface.d.ts +20 -0
  31. package/dist/boundaryClientSurface.js +73 -0
  32. package/dist/boundaryClientSurface.js.map +1 -0
  33. package/dist/client.d.ts +2969 -27
  34. package/dist/client.js +3286 -1049
  35. package/dist/client.js.map +1 -1
  36. package/dist/clientHelpers.d.ts +48 -0
  37. package/dist/clientHelpers.js +137 -0
  38. package/dist/clientHelpers.js.map +1 -0
  39. package/dist/contextClient.d.ts +6 -3
  40. package/dist/contextClient.js +252 -30
  41. package/dist/contextClient.js.map +1 -1
  42. package/dist/contextFacade.js +25 -16
  43. package/dist/contextFacade.js.map +1 -1
  44. package/dist/contextPackCompiler.js +19 -30
  45. package/dist/contextPackCompiler.js.map +1 -1
  46. package/dist/contextPackPolicy.js +7 -17
  47. package/dist/contextPackPolicy.js.map +1 -1
  48. package/dist/contextTypes.d.ts +2 -0
  49. package/dist/contracts/api-enums.contract.d.ts +1 -1
  50. package/dist/contracts/api-enums.contract.js.map +1 -1
  51. package/dist/contracts/index.d.ts +1 -0
  52. package/dist/contracts/index.js +108 -4
  53. package/dist/contracts/index.js.map +1 -1
  54. package/dist/contracts/lens-filter.contract.js +4 -3
  55. package/dist/contracts/lens-filter.contract.js.map +1 -1
  56. package/dist/contracts/lens-workflow.contract.js +4 -3
  57. package/dist/contracts/lens-workflow.contract.js.map +1 -1
  58. package/dist/contracts/lensFilter.js +4 -3
  59. package/dist/contracts/lensFilter.js.map +1 -1
  60. package/dist/contracts/lensWorkflow.js +4 -3
  61. package/dist/contracts/lensWorkflow.js.map +1 -1
  62. package/dist/contracts/mcpTools.d.ts +46 -1
  63. package/dist/contracts/mcpTools.js +102 -0
  64. package/dist/contracts/mcpTools.js.map +1 -1
  65. package/dist/contradictions/index.d.ts +24 -4
  66. package/dist/contradictions/index.js +3286 -1049
  67. package/dist/contradictions/index.js.map +1 -1
  68. package/dist/coreClient.d.ts +11 -1
  69. package/dist/coreClient.js +222 -14
  70. package/dist/coreClient.js.map +1 -1
  71. package/dist/decisions/index.d.ts +34 -14
  72. package/dist/decisions/index.js +3286 -1049
  73. package/dist/decisions/index.js.map +1 -1
  74. package/dist/decisionsClient.d.ts +6 -12
  75. package/dist/decisionsClient.js +235 -37
  76. package/dist/decisionsClient.js.map +1 -1
  77. package/dist/edges/index.d.ts +47 -87
  78. package/dist/edges/index.js +3286 -1049
  79. package/dist/edges/index.js.map +1 -1
  80. package/dist/embeddingsClient.d.ts +106 -0
  81. package/dist/embeddingsClient.js +731 -0
  82. package/dist/embeddingsClient.js.map +1 -0
  83. package/dist/eventingClient.d.ts +96 -0
  84. package/dist/eventingClient.js +728 -0
  85. package/dist/eventingClient.js.map +1 -0
  86. package/dist/events.js +6 -3
  87. package/dist/events.js.map +1 -1
  88. package/dist/eventsCore.d.ts +3 -1
  89. package/dist/eventsCore.js +222 -14
  90. package/dist/eventsCore.js.map +1 -1
  91. package/dist/evidence/index.d.ts +24 -4
  92. package/dist/evidence/index.js +3286 -1049
  93. package/dist/evidence/index.js.map +1 -1
  94. package/dist/evidenceClient.d.ts +2 -0
  95. package/dist/evidenceClient.js +222 -14
  96. package/dist/evidenceClient.js.map +1 -1
  97. package/dist/facade/context.d.ts +2 -1
  98. package/dist/facade/context.js +25 -16
  99. package/dist/facade/context.js.map +1 -1
  100. package/dist/functionSurface.d.ts +143 -0
  101. package/dist/functionSurface.js +1204 -0
  102. package/dist/functionSurface.js.map +1 -0
  103. package/dist/functionSurfaceClient.d.ts +8 -0
  104. package/dist/functionSurfaceClient.js +1204 -0
  105. package/dist/functionSurfaceClient.js.map +1 -0
  106. package/dist/gatewayFacades.d.ts +63 -46
  107. package/dist/gatewayFacades.js +461 -128
  108. package/dist/gatewayFacades.js.map +1 -1
  109. package/dist/graphAnalysisClient.d.ts +192 -0
  110. package/dist/graphAnalysisClient.js +799 -0
  111. package/dist/graphAnalysisClient.js.map +1 -0
  112. package/dist/graphClient.d.ts +7 -13
  113. package/dist/graphClient.js +244 -45
  114. package/dist/graphClient.js.map +1 -1
  115. package/dist/graphIntel.d.ts +3 -0
  116. package/dist/graphIntel.js +3 -0
  117. package/dist/graphIntel.js.map +1 -0
  118. package/dist/graphIntelligence.d.ts +2 -0
  119. package/dist/graphIntelligence.js +47 -0
  120. package/dist/graphIntelligence.js.map +1 -0
  121. package/dist/graphRecommendationsClient.d.ts +56 -0
  122. package/dist/graphRecommendationsClient.js +664 -0
  123. package/dist/graphRecommendationsClient.js.map +1 -0
  124. package/dist/graphStateClassifierClient.d.ts +73 -0
  125. package/dist/graphStateClassifierClient.js +716 -0
  126. package/dist/graphStateClassifierClient.js.map +1 -0
  127. package/dist/harnessClient.d.ts +15 -24
  128. package/dist/harnessClient.js +235 -42
  129. package/dist/harnessClient.js.map +1 -1
  130. package/dist/identityClient.d.ts +97 -11
  131. package/dist/identityClient.js +409 -33
  132. package/dist/identityClient.js.map +1 -1
  133. package/dist/index.d.ts +28 -5
  134. package/dist/index.js +3863 -1116
  135. package/dist/index.js.map +1 -1
  136. package/dist/infisicalRuntime.d.ts +42 -0
  137. package/dist/infisicalRuntime.js +314 -0
  138. package/dist/infisicalRuntime.js.map +1 -0
  139. package/dist/jobsClient.d.ts +98 -0
  140. package/dist/jobsClient.js +726 -0
  141. package/dist/jobsClient.js.map +1 -0
  142. package/dist/learningClient.d.ts +8 -6
  143. package/dist/learningClient.js +252 -44
  144. package/dist/learningClient.js.map +1 -1
  145. package/dist/lenses/index.d.ts +76 -38
  146. package/dist/lenses/index.js +3286 -1049
  147. package/dist/lenses/index.js.map +1 -1
  148. package/dist/mcpClient.d.ts +28 -0
  149. package/dist/mcpClient.js +668 -0
  150. package/dist/mcpClient.js.map +1 -0
  151. package/dist/modelRuntimeClient.d.ts +72 -0
  152. package/dist/modelRuntimeClient.js +704 -0
  153. package/dist/modelRuntimeClient.js.map +1 -0
  154. package/dist/nodes/index.d.ts +63 -21
  155. package/dist/nodes/index.js +3286 -1049
  156. package/dist/nodes/index.js.map +1 -1
  157. package/dist/ontologies/index.d.ts +53 -32
  158. package/dist/ontologies/index.js +3286 -1049
  159. package/dist/ontologies/index.js.map +1 -1
  160. package/dist/ontologyClient.d.ts +19 -25
  161. package/dist/ontologyClient.js +258 -40
  162. package/dist/ontologyClient.js.map +1 -1
  163. package/dist/ontologyLinksClient.d.ts +71 -0
  164. package/dist/ontologyLinksClient.js +697 -0
  165. package/dist/ontologyLinksClient.js.map +1 -0
  166. package/dist/orgGraphSearchClient.d.ts +85 -0
  167. package/dist/orgGraphSearchClient.js +672 -0
  168. package/dist/orgGraphSearchClient.js.map +1 -0
  169. package/dist/packsClient.d.ts +11 -23
  170. package/dist/packsClient.js +234 -46
  171. package/dist/packsClient.js.map +1 -1
  172. package/dist/policyClient.d.ts +13 -10
  173. package/dist/policyClient.js +243 -25
  174. package/dist/policyClient.js.map +1 -1
  175. package/dist/questions/index.d.ts +24 -4
  176. package/dist/questions/index.js +3286 -1049
  177. package/dist/questions/index.js.map +1 -1
  178. package/dist/realtime/index.d.ts +1 -1
  179. package/dist/reportsClient.d.ts +9 -7
  180. package/dist/reportsClient.js +281 -53
  181. package/dist/reportsClient.js.map +1 -1
  182. package/dist/schemaClient.d.ts +5 -3
  183. package/dist/schemaClient.js +235 -29
  184. package/dist/schemaClient.js.map +1 -1
  185. package/dist/sdkSurface.d.ts +8 -3
  186. package/dist/sdkSurface.js +10 -6
  187. package/dist/sdkSurface.js.map +1 -1
  188. package/dist/sourcesClient.d.ts +2 -0
  189. package/dist/sourcesClient.js +222 -14
  190. package/dist/sourcesClient.js.map +1 -1
  191. package/dist/telemetryClient.d.ts +94 -0
  192. package/dist/telemetryClient.js +741 -0
  193. package/dist/telemetryClient.js.map +1 -0
  194. package/dist/toolRegistryClient.d.ts +115 -0
  195. package/dist/toolRegistryClient.js +767 -0
  196. package/dist/toolRegistryClient.js.map +1 -0
  197. package/dist/topics/index.d.ts +35 -9
  198. package/dist/topics/index.js +3288 -1049
  199. package/dist/topics/index.js.map +1 -1
  200. package/dist/topicsClient.d.ts +4 -0
  201. package/dist/topicsClient.js +237 -24
  202. package/dist/topicsClient.js.map +1 -1
  203. package/dist/types.d.ts +5 -0
  204. package/dist/version.d.ts +1 -1
  205. package/dist/version.js +1 -1
  206. package/dist/version.js.map +1 -1
  207. package/dist/workflowClient.d.ts +58 -40
  208. package/dist/workflowClient.js +243 -58
  209. package/dist/workflowClient.js.map +1 -1
  210. package/dist/worktrees/index.d.ts +69 -33
  211. package/dist/worktrees/index.js +3286 -1049
  212. package/dist/worktrees/index.js.map +1 -1
  213. package/package.json +12 -3
  214. package/dist/client-B6aWUUwp.d.ts +0 -2552
@@ -0,0 +1,1204 @@
1
+ // src/authContext.ts
2
+ var LucernSdkAuthContextError = class extends Error {
3
+ reason;
4
+ constructor(reason, message) {
5
+ super(message);
6
+ this.name = "LucernSdkAuthContextError";
7
+ this.reason = reason;
8
+ }
9
+ };
10
+ function cleanString(value) {
11
+ const normalized = value?.trim();
12
+ return normalized ? normalized : void 0;
13
+ }
14
+ function cleanStringList(values) {
15
+ if (!values) {
16
+ return [];
17
+ }
18
+ return values.map((value) => value.trim()).filter(
19
+ (value, index, list) => value.length > 0 && list.indexOf(value) === index
20
+ );
21
+ }
22
+ function requireString(value, reason, label) {
23
+ const normalized = cleanString(value);
24
+ if (!normalized) {
25
+ throw new LucernSdkAuthContextError(
26
+ reason,
27
+ `Canonical Lucern SDK auth context is missing ${label}.`
28
+ );
29
+ }
30
+ return normalized;
31
+ }
32
+ function requirePrincipalType(principalType) {
33
+ if (!principalType) {
34
+ throw new LucernSdkAuthContextError(
35
+ "principal_missing",
36
+ "Canonical Lucern SDK auth context is missing principalType."
37
+ );
38
+ }
39
+ return principalType;
40
+ }
41
+ function requireAuthMode(authMode) {
42
+ if (!authMode) {
43
+ throw new LucernSdkAuthContextError(
44
+ "principal_missing",
45
+ "Canonical Lucern SDK auth context is missing authMode."
46
+ );
47
+ }
48
+ return authMode;
49
+ }
50
+ function ensurePermitMatch(args) {
51
+ const actual = cleanString(args.actual);
52
+ if (actual && actual !== args.expected) {
53
+ throw new LucernSdkAuthContextError(
54
+ "policy_denied",
55
+ `Canonical Lucern SDK auth context has conflicting Permit ${args.field}.`
56
+ );
57
+ }
58
+ }
59
+ function normalizeCanonicalLucernAuthContext(input) {
60
+ if (!input) {
61
+ throw new LucernSdkAuthContextError(
62
+ "principal_missing",
63
+ "Canonical Lucern SDK auth context is required."
64
+ );
65
+ }
66
+ if (input.policyDecision === "deny") {
67
+ throw new LucernSdkAuthContextError(
68
+ "policy_denied",
69
+ "Canonical Lucern SDK auth context carries a denied policy decision."
70
+ );
71
+ }
72
+ const principalId = requireString(
73
+ input.principalId,
74
+ "principal_missing",
75
+ "principalId"
76
+ );
77
+ const tenantId = requireString(input.tenantId, "tenant_missing", "tenantId");
78
+ const workspaceId = requireString(
79
+ input.workspaceId,
80
+ "workspace_missing",
81
+ "workspaceId"
82
+ );
83
+ const roles = cleanStringList(input.roles);
84
+ const scopes = cleanStringList(input.scopes);
85
+ const principalType = requirePrincipalType(input.principalType);
86
+ const authMode = requireAuthMode(input.authMode);
87
+ const roleBasedInteractiveAuth = authMode === "interactive_user" && roles.length > 0;
88
+ if (roles.length === 0 || scopes.length === 0 && !roleBasedInteractiveAuth) {
89
+ throw new LucernSdkAuthContextError(
90
+ "membership_missing",
91
+ "Canonical Lucern SDK auth context requires non-empty roles and scopes."
92
+ );
93
+ }
94
+ const subject = cleanString(input.permit?.subject) ?? principalId;
95
+ const tenant = cleanString(input.permit?.tenant) ?? tenantId;
96
+ const workspace = cleanString(input.permit?.workspace) ?? workspaceId;
97
+ ensurePermitMatch({
98
+ field: "subject",
99
+ expected: principalId,
100
+ actual: subject
101
+ });
102
+ ensurePermitMatch({ field: "tenant", expected: tenantId, actual: tenant });
103
+ ensurePermitMatch({
104
+ field: "workspace",
105
+ expected: workspaceId,
106
+ actual: workspace
107
+ });
108
+ const context = input.permit?.context ? { ...input.permit.context } : void 0;
109
+ return {
110
+ clerkId: cleanString(input.clerkId),
111
+ principalId,
112
+ tenantId,
113
+ workspaceId,
114
+ principalType,
115
+ authMode,
116
+ roles,
117
+ scopes,
118
+ delegationChain: input.delegationChain ? [...input.delegationChain] : [],
119
+ policyTraceId: cleanString(input.policyTraceId),
120
+ correlationId: cleanString(input.correlationId),
121
+ membershipId: cleanString(input.membershipId),
122
+ permit: {
123
+ subject,
124
+ tenant,
125
+ workspace,
126
+ resource: cleanString(input.permit?.resource),
127
+ action: cleanString(input.permit?.action),
128
+ relation: cleanString(input.permit?.relation),
129
+ context
130
+ }
131
+ };
132
+ }
133
+ function createCanonicalAuthHeaders(authContext) {
134
+ const headers = {
135
+ "x-lucern-principal-id": authContext.principalId,
136
+ "x-lucern-principal-type": authContext.principalType,
137
+ "x-lucern-tenant": authContext.tenantId,
138
+ "x-lucern-tenant-id": authContext.tenantId,
139
+ "x-lucern-workspace": authContext.workspaceId,
140
+ "x-lucern-workspace-id": authContext.workspaceId,
141
+ "x-lucern-auth-mode": authContext.authMode,
142
+ "x-lucern-roles": authContext.roles.join(","),
143
+ "x-lucern-scopes": authContext.scopes.join(","),
144
+ "x-lucern-permit-context": JSON.stringify(authContext.permit)
145
+ };
146
+ if (authContext.clerkId) {
147
+ headers["x-lucern-clerk-id"] = authContext.clerkId;
148
+ headers["x-lucern-user-id"] = authContext.clerkId;
149
+ }
150
+ if (authContext.delegationChain.length > 0) {
151
+ headers["x-lucern-delegation-chain"] = JSON.stringify(
152
+ authContext.delegationChain
153
+ );
154
+ }
155
+ if (authContext.policyTraceId) {
156
+ headers["x-lucern-policy-trace-id"] = authContext.policyTraceId;
157
+ }
158
+ if (authContext.correlationId) {
159
+ headers["x-correlation-id"] = authContext.correlationId;
160
+ headers["x-lucern-correlation-id"] = authContext.correlationId;
161
+ }
162
+ if (authContext.membershipId) {
163
+ headers["x-lucern-membership-id"] = authContext.membershipId;
164
+ }
165
+ return headers;
166
+ }
167
+
168
+ // src/coreClient.ts
169
+ var LucernApiError = class extends Error {
170
+ code;
171
+ status;
172
+ invariant;
173
+ suggestion;
174
+ details;
175
+ requestId;
176
+ correlationId;
177
+ policyTraceId;
178
+ constructor(args) {
179
+ super(args.message);
180
+ this.name = "LucernApiError";
181
+ this.code = args.code;
182
+ this.status = args.status;
183
+ this.invariant = args.invariant;
184
+ this.suggestion = args.suggestion;
185
+ this.details = args.details;
186
+ this.requestId = args.requestId;
187
+ this.correlationId = args.correlationId;
188
+ this.policyTraceId = args.policyTraceId;
189
+ }
190
+ };
191
+ function fillRandomBytes(length) {
192
+ const bytes = new Uint8Array(length);
193
+ if (typeof globalThis.crypto?.getRandomValues === "function") {
194
+ globalThis.crypto.getRandomValues(bytes);
195
+ return bytes;
196
+ }
197
+ for (let index = 0; index < length; index += 1) {
198
+ bytes[index] = Math.floor(Math.random() * 256);
199
+ }
200
+ return bytes;
201
+ }
202
+ function generatePortableRequestId() {
203
+ if (typeof globalThis.crypto?.randomUUID === "function") {
204
+ return globalThis.crypto.randomUUID();
205
+ }
206
+ const bytes = fillRandomBytes(16);
207
+ bytes[6] = bytes[6] & 15 | 64;
208
+ bytes[8] = bytes[8] & 63 | 128;
209
+ const hex = Array.from(bytes, (value) => value.toString(16).padStart(2, "0"));
210
+ return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(
211
+ 6,
212
+ 8
213
+ ).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
214
+ }
215
+ var randomIdempotencyKey = generatePortableRequestId;
216
+ function isRetryableStatus(status) {
217
+ return status >= 500 || status === 408 || status === 429;
218
+ }
219
+ function fallbackErrorCode(status) {
220
+ if (status === 401) {
221
+ return "AUTHENTICATION_REQUIRED";
222
+ }
223
+ if (status === 403) {
224
+ return "FORBIDDEN";
225
+ }
226
+ if (status === 404) {
227
+ return "NOT_FOUND";
228
+ }
229
+ if (status === 408) {
230
+ return "UPSTREAM_ERROR";
231
+ }
232
+ if (status === 409) {
233
+ return "CONFLICT";
234
+ }
235
+ if (status === 429) {
236
+ return "RATE_LIMIT_EXCEEDED";
237
+ }
238
+ if (status >= 500) {
239
+ return "UPSTREAM_ERROR";
240
+ }
241
+ return "INTERNAL_ERROR";
242
+ }
243
+ function delay(ms) {
244
+ return new Promise((resolve) => setTimeout(resolve, ms));
245
+ }
246
+ function parseRetryAfterMs(value) {
247
+ if (!value) {
248
+ return null;
249
+ }
250
+ const trimmed = value.trim();
251
+ if (!trimmed) {
252
+ return null;
253
+ }
254
+ const numeric = Number(trimmed);
255
+ if (Number.isFinite(numeric)) {
256
+ return Math.max(0, Math.round(numeric * 1e3));
257
+ }
258
+ const parsedDate = Date.parse(trimmed);
259
+ if (Number.isFinite(parsedDate)) {
260
+ return Math.max(0, parsedDate - Date.now());
261
+ }
262
+ return null;
263
+ }
264
+ function computeRetryDelayMs(args) {
265
+ const baseDelay = args.status === 429 ? Math.max(
266
+ args.retryAfterMs ?? 0,
267
+ Math.min(1e3 * 2 ** args.attempt, 1e4)
268
+ ) : Math.min(1e3 * 2 ** args.attempt, 4e3);
269
+ if (args.status !== 429) {
270
+ return baseDelay;
271
+ }
272
+ const jitterWindow = Math.max(250, Math.round(baseDelay * 0.25));
273
+ return baseDelay + Math.round(Math.random() * jitterWindow);
274
+ }
275
+ function timeoutError(timeoutMs) {
276
+ const error = new Error(`Request timed out after ${timeoutMs}ms`);
277
+ error.name = "AbortError";
278
+ return error;
279
+ }
280
+ function isRecord(value) {
281
+ return value !== null && typeof value === "object" && !Array.isArray(value);
282
+ }
283
+ function readPolicySummaryFromDetails(details) {
284
+ if (!isRecord(details)) {
285
+ return null;
286
+ }
287
+ const directSummary = details.summary;
288
+ if (typeof directSummary === "string" && directSummary.trim().length > 0) {
289
+ return directSummary.trim();
290
+ }
291
+ const policy = details.policy;
292
+ if (!isRecord(policy)) {
293
+ return null;
294
+ }
295
+ const explanation = policy.explanation;
296
+ if (!isRecord(explanation)) {
297
+ return null;
298
+ }
299
+ const nestedSummary = explanation.summary;
300
+ if (typeof nestedSummary === "string" && nestedSummary.trim().length > 0) {
301
+ return nestedSummary.trim();
302
+ }
303
+ return null;
304
+ }
305
+ async function resolveConfiguredAuthContext(authContext) {
306
+ if (typeof authContext === "function") {
307
+ return await authContext();
308
+ }
309
+ return authContext;
310
+ }
311
+ function mergeHeaderRecord(base, addition) {
312
+ const headers = new Headers(base);
313
+ for (const [key, value] of Object.entries(addition)) {
314
+ const existing = headers.get(key);
315
+ if (existing !== null && existing !== value) {
316
+ throw new LucernSdkAuthContextError(
317
+ "policy_denied",
318
+ `Canonical Lucern SDK auth context conflicts with existing ${key} header.`
319
+ );
320
+ }
321
+ headers.set(key, value);
322
+ }
323
+ return Object.fromEntries(headers.entries());
324
+ }
325
+ function createGatewayRequestClient(config = {}) {
326
+ const fetchImpl = config.fetchImpl ?? fetch;
327
+ const baseUrl = config.baseUrl?.replace(/\/+$/, "") ?? "";
328
+ const maxRetries = config.maxRetries ?? 2;
329
+ const requestIdFactory = config.requestIdFactory ?? (() => generatePortableRequestId());
330
+ async function resolveAuthHeaders() {
331
+ const base = config.getAuthHeaders ? await config.getAuthHeaders() : {};
332
+ const authContextInput = await resolveConfiguredAuthContext(
333
+ config.authContext
334
+ );
335
+ if (!authContextInput && !config.requireCanonicalAuthContext) {
336
+ return base;
337
+ }
338
+ const authContext = normalizeCanonicalLucernAuthContext(authContextInput);
339
+ return mergeHeaderRecord(base, createCanonicalAuthHeaders(authContext));
340
+ }
341
+ async function fetchWithTimeout(url, init, timeoutMs) {
342
+ const controller = new AbortController();
343
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
344
+ try {
345
+ return await fetchImpl(url, { ...init, signal: controller.signal });
346
+ } catch (error) {
347
+ if (controller.signal.aborted) {
348
+ throw timeoutError(timeoutMs);
349
+ }
350
+ throw error;
351
+ } finally {
352
+ clearTimeout(timer);
353
+ }
354
+ }
355
+ async function parsePayload(response) {
356
+ const text = await response.text();
357
+ if (!text) {
358
+ return null;
359
+ }
360
+ const parsed = tryParseGatewayEnvelopeJson(text);
361
+ if (!parsed.ok) {
362
+ return null;
363
+ }
364
+ return isRecord(parsed.value) ? parsed.value : null;
365
+ }
366
+ function resolveTimeoutMs(method, requestTimeoutMs) {
367
+ if (typeof requestTimeoutMs === "number") {
368
+ return requestTimeoutMs;
369
+ }
370
+ const methodTimeoutMs = config.timeoutMsByMethod?.[method];
371
+ if (typeof methodTimeoutMs === "number") {
372
+ return methodTimeoutMs;
373
+ }
374
+ return config.timeoutMs ?? 15e3;
375
+ }
376
+ function tryParseGatewayEnvelopeJson(text) {
377
+ const trimmed = text.trim();
378
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) {
379
+ return { ok: false, reason: "non-json" };
380
+ }
381
+ try {
382
+ return { ok: true, value: JSON.parse(trimmed) };
383
+ } catch (error) {
384
+ if (error instanceof SyntaxError) {
385
+ return { ok: false, reason: "invalid-json", error };
386
+ }
387
+ throw error;
388
+ }
389
+ }
390
+ function buildApiError(args) {
391
+ const failure = args.failure;
392
+ const legacyError = failure && isRecord(failure.error) ? failure.error : failure?.legacyError;
393
+ const correlationId = failure?.correlationId ?? args.response.headers.get("x-lucern-correlation-id")?.trim() ?? args.requestId;
394
+ const policyTraceId = failure?.policyTraceId ?? args.response.headers.get("x-lucern-policy-trace-id")?.trim() ?? null;
395
+ const details = failure?.details ?? legacyError?.details;
396
+ const policySummary = readPolicySummaryFromDetails(details);
397
+ const failureMessage = typeof failure?.error === "string" ? failure.error : legacyError?.message;
398
+ return new LucernApiError({
399
+ code: failure?.code ?? legacyError?.code ?? fallbackErrorCode(args.response.status),
400
+ message: policySummary ?? failureMessage ?? (args.response.ok ? "Platform API returned an invalid success payload." : "Platform API request failed."),
401
+ status: args.response.status,
402
+ invariant: failure?.invariant,
403
+ suggestion: failure?.suggestion,
404
+ details,
405
+ requestId: args.requestId,
406
+ correlationId,
407
+ policyTraceId
408
+ });
409
+ }
410
+ async function request(args) {
411
+ const authHeaders = await resolveAuthHeaders();
412
+ const method = args.method ?? "GET";
413
+ const timeoutMs = resolveTimeoutMs(method, args.timeoutMs);
414
+ const headers = new Headers({
415
+ "content-type": "application/json",
416
+ ...authHeaders
417
+ });
418
+ if (args.idempotencyKey) {
419
+ headers.set("idempotency-key", args.idempotencyKey);
420
+ }
421
+ const requestId = headers.get("x-correlation-id")?.trim() || headers.get("x-request-id")?.trim() || args.requestId || requestIdFactory();
422
+ if (!headers.has("x-correlation-id") && !headers.has("x-request-id")) {
423
+ headers.set("x-correlation-id", requestId);
424
+ }
425
+ const url = `${baseUrl}${args.path}`;
426
+ const serializedBody = args.body ? JSON.stringify(args.body) : void 0;
427
+ const init = {
428
+ method,
429
+ headers,
430
+ body: serializedBody
431
+ };
432
+ let lastError;
433
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
434
+ const hookRequestContext = {
435
+ requestId,
436
+ attempt,
437
+ maxRetries,
438
+ method,
439
+ path: args.path,
440
+ url,
441
+ headers: new Headers(headers),
442
+ body: serializedBody,
443
+ timeoutMs
444
+ };
445
+ await config.onRequest?.(hookRequestContext);
446
+ const startedAt = Date.now();
447
+ try {
448
+ const response = await fetchWithTimeout(url, init, timeoutMs);
449
+ const responseClone = response.clone();
450
+ const payload = await parsePayload(response);
451
+ const retryAfterMs = parseRetryAfterMs(
452
+ response.headers.get("Retry-After")
453
+ );
454
+ if (!response.ok || !payload?.success) {
455
+ const failure = payload && !payload.success ? payload : null;
456
+ const apiError = buildApiError({
457
+ requestId,
458
+ response,
459
+ failure
460
+ });
461
+ const willRetry = attempt < maxRetries && isRetryableStatus(response.status);
462
+ await config.onResponse?.({
463
+ ...hookRequestContext,
464
+ durationMs: Date.now() - startedAt,
465
+ status: response.status,
466
+ response: responseClone,
467
+ error: apiError,
468
+ correlationId: apiError.correlationId ?? requestId,
469
+ policyTraceId: apiError.policyTraceId ?? null,
470
+ retryAfterMs,
471
+ willRetry
472
+ });
473
+ if (willRetry) {
474
+ lastError = apiError;
475
+ await delay(
476
+ computeRetryDelayMs({
477
+ attempt,
478
+ status: response.status,
479
+ retryAfterMs
480
+ })
481
+ );
482
+ continue;
483
+ }
484
+ throw apiError;
485
+ }
486
+ const successPayload = payload;
487
+ await config.onResponse?.({
488
+ ...hookRequestContext,
489
+ durationMs: Date.now() - startedAt,
490
+ status: response.status,
491
+ response: responseClone,
492
+ correlationId: successPayload.correlationId ?? response.headers.get("x-lucern-correlation-id")?.trim() ?? requestId,
493
+ policyTraceId: successPayload.policyTraceId ?? response.headers.get("x-lucern-policy-trace-id")?.trim() ?? null,
494
+ idempotentReplay: successPayload.idempotentReplay,
495
+ retryAfterMs,
496
+ willRetry: false
497
+ });
498
+ return successPayload;
499
+ } catch (fetchError) {
500
+ if (fetchError instanceof LucernApiError) {
501
+ throw fetchError;
502
+ }
503
+ const willRetry = attempt < maxRetries;
504
+ await config.onResponse?.({
505
+ ...hookRequestContext,
506
+ durationMs: Date.now() - startedAt,
507
+ error: fetchError,
508
+ correlationId: requestId,
509
+ policyTraceId: null,
510
+ willRetry
511
+ });
512
+ lastError = fetchError;
513
+ if (willRetry) {
514
+ await delay(computeRetryDelayMs({ attempt }));
515
+ }
516
+ }
517
+ }
518
+ throw lastError instanceof Error ? lastError : new Error("Platform API request failed after retries.");
519
+ }
520
+ return {
521
+ request
522
+ };
523
+ }
524
+
525
+ // src/generated/functionSurface.ts
526
+ var FUNCTION_SURFACE_METHOD_PATHS = [
527
+ "answers.answerQuestion",
528
+ "answers.createAnswer",
529
+ "answers.getAnswer",
530
+ "beliefs.archiveBelief",
531
+ "beliefs.bisectConfidence",
532
+ "beliefs.createBelief",
533
+ "beliefs.forkBelief",
534
+ "beliefs.getBelief",
535
+ "beliefs.getConfidenceHistory",
536
+ "beliefs.listBeliefs",
537
+ "beliefs.modulateConfidence",
538
+ "beliefs.refineBelief",
539
+ "beliefs.searchBeliefs",
540
+ "bootstrap.generateSessionHandoff",
541
+ "coding.getChangeHistory",
542
+ "coding.getCodeContext",
543
+ "coding.getFailureLog",
544
+ "coding.recordAttempt",
545
+ "context.analyzeTopicDensity",
546
+ "context.applyAutoBranching",
547
+ "context.compileContext",
548
+ "context.discover",
549
+ "context.discoverEntityConnections",
550
+ "context.getLatticeCoverage",
551
+ "context.recordScopeLearning",
552
+ "context.seedBeliefLattice",
553
+ "context.triggerBeliefReview",
554
+ "contracts.createEpistemicContract",
555
+ "contracts.evaluateContract",
556
+ "contracts.getContractStatus",
557
+ "contradictions.flagContradiction",
558
+ "coordination.broadcastMessage",
559
+ "coordination.claimFiles",
560
+ "coordination.endSession",
561
+ "coordination.getAgentInbox",
562
+ "coordination.heartbeatSession",
563
+ "coordination.listActiveSessions",
564
+ "coordination.registerSession",
565
+ "coordination.sendAgentMessage",
566
+ "edges.batchCreateEdges",
567
+ "edges.createEdge",
568
+ "edges.queryLineage",
569
+ "edges.removeEdge",
570
+ "edges.removeEdgesBetween",
571
+ "edges.updateEdge",
572
+ "evidence.addEvidence",
573
+ "evidence.createEvidence",
574
+ "evidence.getEvidence",
575
+ "evidence.linkEvidence",
576
+ "evidence.linkEvidenceToBelief",
577
+ "evidence.linkEvidenceToQuestion",
578
+ "evidence.listEvidence",
579
+ "evidence.searchEvidence",
580
+ "graph.detectConfirmationBias",
581
+ "graph.findContradictions",
582
+ "graph.getGraphGaps",
583
+ "graph.getGraphNeighborhood",
584
+ "graph.getGraphStructureAnalysis",
585
+ "graph.getTopicCoverage",
586
+ "graph.traceEntityImpact",
587
+ "graph.traverseGraph",
588
+ "graphAnalysis.listGraphIntelligenceQueries",
589
+ "graphAnalysis.runGraphIntelligenceQuery",
590
+ "identity.checkPermission",
591
+ "identity.filterByPermission",
592
+ "identity.whoami",
593
+ "judgments.getAuditTrail",
594
+ "judgments.recordJudgment",
595
+ "lenses.applyLensToTopic",
596
+ "lenses.createLens",
597
+ "lenses.listLenses",
598
+ "lenses.removeLensFromTopic",
599
+ "nodes.archiveEpistemicNode",
600
+ "nodes.batchCreateEpistemicNodes",
601
+ "nodes.createEpistemicNode",
602
+ "nodes.getEpistemicNode",
603
+ "nodes.listEpistemicNodes",
604
+ "nodes.supersedeEpistemicNode",
605
+ "nodes.updateEpistemicNode",
606
+ "nodes.verifyEpistemicNode",
607
+ "observations.getObservationContext",
608
+ "observations.ingestObservation",
609
+ "ontologies.applyOntology",
610
+ "ontologies.archiveOntology",
611
+ "ontologies.createOntology",
612
+ "ontologies.createOntologyVersion",
613
+ "ontologies.deprecateOntologyVersion",
614
+ "ontologies.getOntology",
615
+ "ontologies.listOntologies",
616
+ "ontologies.matchEntityType",
617
+ "ontologies.publishOntologyVersion",
618
+ "ontologies.resolveEffectiveOntology",
619
+ "ontologies.updateOntology",
620
+ "policy.manageWritePolicy",
621
+ "questions.archiveQuestion",
622
+ "questions.createQuestion",
623
+ "questions.findMissingQuestions",
624
+ "questions.getFalsificationQuestions",
625
+ "questions.getHighPriorityQuestions",
626
+ "questions.getQuestion",
627
+ "questions.listQuestions",
628
+ "questions.refineQuestion",
629
+ "questions.updateQuestionStatus",
630
+ "tasks.completeTask",
631
+ "tasks.createTask",
632
+ "tasks.listTasks",
633
+ "tasks.updateTask",
634
+ "topics.createTopic",
635
+ "topics.getTopic",
636
+ "topics.getTopicGraphSpine",
637
+ "topics.getTopicTree",
638
+ "topics.listTopics",
639
+ "topics.materializeTopicGraph",
640
+ "topics.updateTopic",
641
+ "worktrees.activateWorktree",
642
+ "worktrees.addWorktree",
643
+ "worktrees.beginBuildSession",
644
+ "worktrees.listAllWorktrees",
645
+ "worktrees.listCampaigns",
646
+ "worktrees.listWorktrees",
647
+ "worktrees.merge",
648
+ "worktrees.openPullRequest",
649
+ "worktrees.pipelineSnapshot",
650
+ "worktrees.push",
651
+ "worktrees.updateWorktreeMetadata",
652
+ "worktrees.updateWorktreeTargets"
653
+ ];
654
+ var CONTRACTS = {
655
+ "activate_worktree": { method: "POST", path: "/worktrees/activate", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
656
+ "add_evidence": { method: "POST", path: "/evidence/add", kind: "mutation", idempotent: true, surfaceIntent: "compatibility" },
657
+ "add_worktree": { method: "POST", path: "/worktrees", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
658
+ "analyze_topic_density": { method: "POST", path: "/scope/topic-density", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
659
+ "answer_question": { method: "POST", path: "/questions/answer", kind: "mutation", idempotent: true, surfaceIntent: "compatibility" },
660
+ "apply_auto_branching": { method: "POST", path: "/scope/auto-branching", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
661
+ "apply_lens_to_topic": { method: "POST", path: "/lenses/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
662
+ "apply_ontology": { method: "POST", path: "/ontologies/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
663
+ "archive_belief": { method: "DELETE", path: "/beliefs", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
664
+ "archive_epistemic_node": { method: "POST", path: "/nodes/archive", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
665
+ "archive_ontology": { method: "DELETE", path: "/ontologies", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
666
+ "archive_question": { method: "DELETE", path: "/questions", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
667
+ "batch_create_edges": { method: "POST", path: "/edges/batch", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
668
+ "batch_create_epistemic_nodes": { method: "POST", path: "/nodes/batch", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
669
+ "begin_build_session": { method: "POST", path: "/mcp/build-session/begin", kind: "mutation", idempotent: true, surfaceIntent: "system" },
670
+ "bisect_confidence": { method: "POST", path: "/beliefs/confidence/bisect", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
671
+ "broadcast_message": { method: "POST", path: "/coordination/messages/broadcast", kind: "mutation", idempotent: true, surfaceIntent: "system" },
672
+ "check_permission": { method: "POST", path: "/identity/check-permission", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
673
+ "claim_files": { method: "POST", path: "/coordination/file-claims", kind: "mutation", idempotent: true, surfaceIntent: "system" },
674
+ "compile_context": { method: "POST", path: "/context/compile", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
675
+ "complete_task": { method: "POST", path: "/tasks/complete", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
676
+ "create_answer": { method: "POST", path: "/answers", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
677
+ "create_belief": { method: "POST", path: "/beliefs", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
678
+ "create_edge": { method: "POST", path: "/edges", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
679
+ "create_epistemic_contract": { method: "POST", path: "/contracts", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
680
+ "create_epistemic_node": { method: "POST", path: "/nodes", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
681
+ "create_evidence": { method: "POST", path: "/evidence", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
682
+ "create_lens": { method: "POST", path: "/lenses", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
683
+ "create_ontology": { method: "POST", path: "/ontologies", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
684
+ "create_ontology_version": { method: "POST", path: "/ontologies/versions", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
685
+ "create_question": { method: "POST", path: "/questions", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
686
+ "create_task": { method: "POST", path: "/tasks", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
687
+ "create_topic": { method: "POST", path: "/topics", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
688
+ "deprecate_ontology_version": { method: "POST", path: "/ontologies/versions/deprecate", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
689
+ "detect_confirmation_bias": { method: "POST", path: "/graph/confirmation-bias", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
690
+ "discover": { method: "POST", path: "/context/discover", kind: "query", idempotent: false, surfaceIntent: "compatibility" },
691
+ "discover_entity_connections": { method: "POST", path: "/context/entity-connections", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
692
+ "end_session": { method: "POST", path: "/coordination/end-session", kind: "mutation", idempotent: true, surfaceIntent: "system" },
693
+ "evaluate_contract": { method: "POST", path: "/contracts/evaluate", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
694
+ "filter_by_permission": { method: "POST", path: "/identity/filter-by-permission", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
695
+ "find_contradictions": { method: "POST", path: "/graph/contradictions", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
696
+ "find_missing_questions": { method: "POST", path: "/questions/missing", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
697
+ "flag_contradiction": { method: "POST", path: "/contradictions", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
698
+ "fork_belief": { method: "POST", path: "/beliefs/fork", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
699
+ "generate_session_handoff": { method: "POST", path: "/bootstrap/session-handoff", kind: "query", idempotent: false, surfaceIntent: "system" },
700
+ "get_agent_inbox": { method: "POST", path: "/coordination/messages/inbox", kind: "query", idempotent: false, surfaceIntent: "system" },
701
+ "get_answer": { method: "GET", path: "/answers/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
702
+ "get_audit_trail": { method: "POST", path: "/judgments/audit-trail", kind: "query", idempotent: false, surfaceIntent: "system" },
703
+ "get_belief": { method: "GET", path: "/beliefs/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
704
+ "get_change_history": { method: "POST", path: "/coding/change-history", kind: "query", idempotent: false, surfaceIntent: "system" },
705
+ "get_code_context": { method: "POST", path: "/coding/context", kind: "query", idempotent: false, surfaceIntent: "system" },
706
+ "get_confidence_history": { method: "POST", path: "/beliefs/confidence-history", kind: "query", idempotent: false, surfaceIntent: "compatibility" },
707
+ "get_contract_status": { method: "POST", path: "/contracts/status", kind: "query", idempotent: false, surfaceIntent: "mcp_governance" },
708
+ "get_epistemic_node": { method: "GET", path: "/nodes/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
709
+ "get_evidence": { method: "GET", path: "/evidence/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
710
+ "get_failure_log": { method: "POST", path: "/coding/failure-log", kind: "query", idempotent: false, surfaceIntent: "system" },
711
+ "get_falsification_questions": { method: "POST", path: "/questions/falsification", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
712
+ "get_graph_gaps": { method: "POST", path: "/graph/gaps", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
713
+ "get_graph_neighborhood": { method: "POST", path: "/graph/neighborhood", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
714
+ "get_graph_structure_analysis": { method: "POST", path: "/graph/structure-analysis", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
715
+ "get_high_priority_questions": { method: "POST", path: "/questions/high-priority", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
716
+ "get_lattice_coverage": { method: "POST", path: "/scope/belief-lattice/coverage", kind: "query", idempotent: false, surfaceIntent: "system" },
717
+ "get_observation_context": { method: "POST", path: "/observations/context", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
718
+ "get_ontology": { method: "GET", path: "/ontologies/get", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
719
+ "get_question": { method: "GET", path: "/questions/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
720
+ "get_topic": { method: "GET", path: "/topics/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
721
+ "get_topic_coverage": { method: "POST", path: "/graph/topic-coverage", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
722
+ "get_topic_graph_spine": { method: "GET", path: "/topics/graph-spine", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
723
+ "get_topic_tree": { method: "GET", path: "/topics/tree", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
724
+ "heartbeat_session": { method: "POST", path: "/coordination/heartbeat-session", kind: "mutation", idempotent: true, surfaceIntent: "system" },
725
+ "identity_whoami": { method: "GET", path: "/identity/whoami", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
726
+ "ingest_observation": { method: "POST", path: "/observations/ingest", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
727
+ "link_evidence": { method: "POST", path: "/evidence/link", kind: "mutation", idempotent: true, surfaceIntent: "compatibility" },
728
+ "link_evidence_to_belief": { method: "POST", path: "/evidence/link-belief", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
729
+ "link_evidence_to_question": { method: "POST", path: "/evidence/link-question", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
730
+ "list_active_sessions": { method: "POST", path: "/coordination/active-sessions", kind: "query", idempotent: false, surfaceIntent: "system" },
731
+ "list_all_worktrees": { method: "GET", path: "/worktrees/all", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
732
+ "list_beliefs": { method: "GET", path: "/beliefs", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
733
+ "list_campaigns": { method: "GET", path: "/worktrees/campaigns", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
734
+ "list_epistemic_nodes": { method: "GET", path: "/nodes", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
735
+ "list_evidence": { method: "GET", path: "/evidence", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
736
+ "list_graph_intelligence_queries": { method: "POST", path: "/graph-intelligence/queries", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
737
+ "list_lenses": { method: "GET", path: "/lenses", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
738
+ "list_ontologies": { method: "GET", path: "/ontologies", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
739
+ "list_questions": { method: "GET", path: "/questions", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
740
+ "list_tasks": { method: "GET", path: "/tasks", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
741
+ "list_topics": { method: "GET", path: "/topics", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
742
+ "list_worktrees": { method: "GET", path: "/worktrees", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
743
+ "manage_write_policy": { method: "POST", path: "/policy/write-policy/manage", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
744
+ "match_entity_type": { method: "POST", path: "/ontologies/match-entity-type", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
745
+ "materialize_topic_graph": { method: "POST", path: "/topics/materialize-graph", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
746
+ "merge": { method: "POST", path: "/worktrees/merge", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
747
+ "modulate_confidence": { method: "POST", path: "/beliefs/confidence", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
748
+ "open_pull_request": { method: "POST", path: "/worktrees/open-pull-request", kind: "mutation", idempotent: true, surfaceIntent: "system" },
749
+ "pipeline_snapshot": { method: "POST", path: "/worktrees/pipeline-snapshot", kind: "query", idempotent: false, surfaceIntent: "system" },
750
+ "publish_ontology_version": { method: "POST", path: "/ontologies/versions/publish", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
751
+ "push": { method: "POST", path: "/worktrees/push", kind: "mutation", idempotent: true, surfaceIntent: "system" },
752
+ "query_lineage": { method: "POST", path: "/edges/lineage", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
753
+ "record_attempt": { method: "POST", path: "/coding/attempts", kind: "mutation", idempotent: true, surfaceIntent: "system" },
754
+ "record_judgment": { method: "POST", path: "/judgments", kind: "mutation", idempotent: true, surfaceIntent: "system" },
755
+ "record_scope_learning": { method: "POST", path: "/scope/learnings", kind: "mutation", idempotent: true, surfaceIntent: "system" },
756
+ "refine_belief": { method: "PATCH", path: "/beliefs/refine", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
757
+ "refine_question": { method: "PATCH", path: "/questions/refine", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
758
+ "register_session": { method: "POST", path: "/coordination/register-session", kind: "mutation", idempotent: true, surfaceIntent: "system" },
759
+ "remove_edge": { method: "DELETE", path: "/edges", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
760
+ "remove_edges_between": { method: "DELETE", path: "/edges/between", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
761
+ "remove_lens_from_topic": { method: "DELETE", path: "/lenses/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
762
+ "resolve_effective_ontology": { method: "POST", path: "/ontologies/effective", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
763
+ "run_graph_intelligence_query": { method: "POST", path: "/graph-intelligence/run", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
764
+ "search_beliefs": { method: "POST", path: "/beliefs/search", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
765
+ "search_evidence": { method: "POST", path: "/evidence/search", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
766
+ "seed_belief_lattice": { method: "POST", path: "/scope/belief-lattice/seed", kind: "mutation", idempotent: true, surfaceIntent: "system" },
767
+ "send_agent_message": { method: "POST", path: "/coordination/messages/send", kind: "mutation", idempotent: true, surfaceIntent: "system" },
768
+ "supersede_epistemic_node": { method: "POST", path: "/nodes/supersede", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
769
+ "trace_entity_impact": { method: "POST", path: "/graph/trace-entity-impact", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
770
+ "traverse_graph": { method: "POST", path: "/graph/traverse", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
771
+ "trigger_belief_review": { method: "POST", path: "/context/belief-review", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
772
+ "update_edge": { method: "PATCH", path: "/edges", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
773
+ "update_epistemic_node": { method: "PATCH", path: "/nodes", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
774
+ "update_ontology": { method: "PATCH", path: "/ontologies", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
775
+ "update_question_status": { method: "PATCH", path: "/questions/status", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
776
+ "update_task": { method: "PATCH", path: "/tasks", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
777
+ "update_topic": { method: "PATCH", path: "/topics", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
778
+ "update_worktree_metadata": { method: "PATCH", path: "/worktrees/metadata", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
779
+ "update_worktree_targets": { method: "PATCH", path: "/worktrees/targets", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
780
+ "verify_epistemic_node": { method: "POST", path: "/nodes/verify", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" }
781
+ };
782
+ function createSessionId() {
783
+ return typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : randomIdempotencyKey();
784
+ }
785
+ function withSdkSessionId(input, sessionId) {
786
+ return {
787
+ ...input,
788
+ __sdkSessionId: typeof input.__sdkSessionId === "string" ? input.__sdkSessionId : sessionId
789
+ };
790
+ }
791
+ function toFunctionSurfaceQuery(input) {
792
+ const params = new URLSearchParams();
793
+ for (const [key, value] of Object.entries(input)) {
794
+ if (value === void 0) {
795
+ continue;
796
+ }
797
+ const serialized2 = typeof value === "string" ? value : JSON.stringify(value);
798
+ if (serialized2 !== void 0) {
799
+ params.set(key, serialized2);
800
+ }
801
+ }
802
+ const serialized = params.toString();
803
+ return serialized ? `?${serialized}` : "";
804
+ }
805
+ function createFunctionSurfaceClient(config = {}) {
806
+ const gateway = createGatewayRequestClient(config);
807
+ const sessionId = createSessionId();
808
+ function execute(name, input, idempotencyKey) {
809
+ const contract = CONTRACTS[name];
810
+ const payload = withSdkSessionId(input, sessionId);
811
+ const path = contract.method === "GET" ? `${contract.path}${toFunctionSurfaceQuery(payload)}` : contract.path;
812
+ return gateway.request({
813
+ path: `/api/platform/v1${path}`,
814
+ method: contract.method,
815
+ body: contract.method === "GET" ? void 0 : payload,
816
+ idempotencyKey: contract.kind !== "query" && Boolean(contract.idempotent) ? idempotencyKey ?? randomIdempotencyKey() : void 0
817
+ });
818
+ }
819
+ return {
820
+ sessionId,
821
+ activateWorktree(input = {}, idempotencyKey) {
822
+ return execute("activate_worktree", input, idempotencyKey);
823
+ },
824
+ addEvidence(input = {}, idempotencyKey) {
825
+ return execute("add_evidence", input, idempotencyKey);
826
+ },
827
+ addWorktree(input = {}, idempotencyKey) {
828
+ return execute("add_worktree", input, idempotencyKey);
829
+ },
830
+ analyzeTopicDensity(input = {}, idempotencyKey) {
831
+ return execute("analyze_topic_density", input, idempotencyKey);
832
+ },
833
+ answerQuestion(input = {}, idempotencyKey) {
834
+ return execute("answer_question", input, idempotencyKey);
835
+ },
836
+ applyAutoBranching(input = {}, idempotencyKey) {
837
+ return execute("apply_auto_branching", input, idempotencyKey);
838
+ },
839
+ applyLensToTopic(input = {}, idempotencyKey) {
840
+ return execute("apply_lens_to_topic", input, idempotencyKey);
841
+ },
842
+ applyOntology(input = {}, idempotencyKey) {
843
+ return execute("apply_ontology", input, idempotencyKey);
844
+ },
845
+ archiveBelief(input = {}, idempotencyKey) {
846
+ return execute("archive_belief", input, idempotencyKey);
847
+ },
848
+ archiveEpistemicNode(input = {}, idempotencyKey) {
849
+ return execute("archive_epistemic_node", input, idempotencyKey);
850
+ },
851
+ archiveOntology(input = {}, idempotencyKey) {
852
+ return execute("archive_ontology", input, idempotencyKey);
853
+ },
854
+ archiveQuestion(input = {}, idempotencyKey) {
855
+ return execute("archive_question", input, idempotencyKey);
856
+ },
857
+ batchCreateEdges(input = {}, idempotencyKey) {
858
+ return execute("batch_create_edges", input, idempotencyKey);
859
+ },
860
+ batchCreateEpistemicNodes(input = {}, idempotencyKey) {
861
+ return execute("batch_create_epistemic_nodes", input, idempotencyKey);
862
+ },
863
+ beginBuildSession(input = {}, idempotencyKey) {
864
+ return execute("begin_build_session", input, idempotencyKey);
865
+ },
866
+ bisectConfidence(input = {}, idempotencyKey) {
867
+ return execute("bisect_confidence", input, idempotencyKey);
868
+ },
869
+ broadcastMessage(input = {}, idempotencyKey) {
870
+ return execute("broadcast_message", input, idempotencyKey);
871
+ },
872
+ checkPermission(input = {}, idempotencyKey) {
873
+ return execute("check_permission", input, idempotencyKey);
874
+ },
875
+ claimFiles(input = {}, idempotencyKey) {
876
+ return execute("claim_files", input, idempotencyKey);
877
+ },
878
+ compileContext(input = {}, idempotencyKey) {
879
+ return execute("compile_context", input, idempotencyKey);
880
+ },
881
+ completeTask(input = {}, idempotencyKey) {
882
+ return execute("complete_task", input, idempotencyKey);
883
+ },
884
+ createAnswer(input = {}, idempotencyKey) {
885
+ return execute("create_answer", input, idempotencyKey);
886
+ },
887
+ createBelief(input = {}, idempotencyKey) {
888
+ return execute("create_belief", input, idempotencyKey);
889
+ },
890
+ createEdge(input = {}, idempotencyKey) {
891
+ return execute("create_edge", input, idempotencyKey);
892
+ },
893
+ createEpistemicContract(input = {}, idempotencyKey) {
894
+ return execute("create_epistemic_contract", input, idempotencyKey);
895
+ },
896
+ createEpistemicNode(input = {}, idempotencyKey) {
897
+ return execute("create_epistemic_node", input, idempotencyKey);
898
+ },
899
+ createEvidence(input = {}, idempotencyKey) {
900
+ return execute("create_evidence", input, idempotencyKey);
901
+ },
902
+ createLens(input = {}, idempotencyKey) {
903
+ return execute("create_lens", input, idempotencyKey);
904
+ },
905
+ createOntology(input = {}, idempotencyKey) {
906
+ return execute("create_ontology", input, idempotencyKey);
907
+ },
908
+ createOntologyVersion(input = {}, idempotencyKey) {
909
+ return execute("create_ontology_version", input, idempotencyKey);
910
+ },
911
+ createQuestion(input = {}, idempotencyKey) {
912
+ return execute("create_question", input, idempotencyKey);
913
+ },
914
+ createTask(input = {}, idempotencyKey) {
915
+ return execute("create_task", input, idempotencyKey);
916
+ },
917
+ createTopic(input = {}, idempotencyKey) {
918
+ return execute("create_topic", input, idempotencyKey);
919
+ },
920
+ deprecateOntologyVersion(input = {}, idempotencyKey) {
921
+ return execute("deprecate_ontology_version", input, idempotencyKey);
922
+ },
923
+ detectConfirmationBias(input = {}, idempotencyKey) {
924
+ return execute("detect_confirmation_bias", input, idempotencyKey);
925
+ },
926
+ discover(input = {}, idempotencyKey) {
927
+ return execute("discover", input, idempotencyKey);
928
+ },
929
+ discoverEntityConnections(input = {}, idempotencyKey) {
930
+ return execute("discover_entity_connections", input, idempotencyKey);
931
+ },
932
+ endSession(input = {}, idempotencyKey) {
933
+ return execute("end_session", input, idempotencyKey);
934
+ },
935
+ evaluateContract(input = {}, idempotencyKey) {
936
+ return execute("evaluate_contract", input, idempotencyKey);
937
+ },
938
+ filterByPermission(input = {}, idempotencyKey) {
939
+ return execute("filter_by_permission", input, idempotencyKey);
940
+ },
941
+ findContradictions(input = {}, idempotencyKey) {
942
+ return execute("find_contradictions", input, idempotencyKey);
943
+ },
944
+ findMissingQuestions(input = {}, idempotencyKey) {
945
+ return execute("find_missing_questions", input, idempotencyKey);
946
+ },
947
+ flagContradiction(input = {}, idempotencyKey) {
948
+ return execute("flag_contradiction", input, idempotencyKey);
949
+ },
950
+ forkBelief(input = {}, idempotencyKey) {
951
+ return execute("fork_belief", input, idempotencyKey);
952
+ },
953
+ generateSessionHandoff(input = {}, idempotencyKey) {
954
+ return execute("generate_session_handoff", input, idempotencyKey);
955
+ },
956
+ getAgentInbox(input = {}, idempotencyKey) {
957
+ return execute("get_agent_inbox", input, idempotencyKey);
958
+ },
959
+ getAnswer(input = {}, idempotencyKey) {
960
+ return execute("get_answer", input, idempotencyKey);
961
+ },
962
+ getAuditTrail(input = {}, idempotencyKey) {
963
+ return execute("get_audit_trail", input, idempotencyKey);
964
+ },
965
+ getBelief(input = {}, idempotencyKey) {
966
+ return execute("get_belief", input, idempotencyKey);
967
+ },
968
+ getChangeHistory(input = {}, idempotencyKey) {
969
+ return execute("get_change_history", input, idempotencyKey);
970
+ },
971
+ getCodeContext(input = {}, idempotencyKey) {
972
+ return execute("get_code_context", input, idempotencyKey);
973
+ },
974
+ getConfidenceHistory(input = {}, idempotencyKey) {
975
+ return execute("get_confidence_history", input, idempotencyKey);
976
+ },
977
+ getContractStatus(input = {}, idempotencyKey) {
978
+ return execute("get_contract_status", input, idempotencyKey);
979
+ },
980
+ getEpistemicNode(input = {}, idempotencyKey) {
981
+ return execute("get_epistemic_node", input, idempotencyKey);
982
+ },
983
+ getEvidence(input = {}, idempotencyKey) {
984
+ return execute("get_evidence", input, idempotencyKey);
985
+ },
986
+ getFailureLog(input = {}, idempotencyKey) {
987
+ return execute("get_failure_log", input, idempotencyKey);
988
+ },
989
+ getFalsificationQuestions(input = {}, idempotencyKey) {
990
+ return execute("get_falsification_questions", input, idempotencyKey);
991
+ },
992
+ getGraphGaps(input = {}, idempotencyKey) {
993
+ return execute("get_graph_gaps", input, idempotencyKey);
994
+ },
995
+ getGraphNeighborhood(input = {}, idempotencyKey) {
996
+ return execute("get_graph_neighborhood", input, idempotencyKey);
997
+ },
998
+ getGraphStructureAnalysis(input = {}, idempotencyKey) {
999
+ return execute("get_graph_structure_analysis", input, idempotencyKey);
1000
+ },
1001
+ getHighPriorityQuestions(input = {}, idempotencyKey) {
1002
+ return execute("get_high_priority_questions", input, idempotencyKey);
1003
+ },
1004
+ getLatticeCoverage(input = {}, idempotencyKey) {
1005
+ return execute("get_lattice_coverage", input, idempotencyKey);
1006
+ },
1007
+ getObservationContext(input = {}, idempotencyKey) {
1008
+ return execute("get_observation_context", input, idempotencyKey);
1009
+ },
1010
+ getOntology(input = {}, idempotencyKey) {
1011
+ return execute("get_ontology", input, idempotencyKey);
1012
+ },
1013
+ getQuestion(input = {}, idempotencyKey) {
1014
+ return execute("get_question", input, idempotencyKey);
1015
+ },
1016
+ getTopic(input = {}, idempotencyKey) {
1017
+ return execute("get_topic", input, idempotencyKey);
1018
+ },
1019
+ getTopicCoverage(input = {}, idempotencyKey) {
1020
+ return execute("get_topic_coverage", input, idempotencyKey);
1021
+ },
1022
+ getTopicGraphSpine(input = {}, idempotencyKey) {
1023
+ return execute("get_topic_graph_spine", input, idempotencyKey);
1024
+ },
1025
+ getTopicTree(input = {}, idempotencyKey) {
1026
+ return execute("get_topic_tree", input, idempotencyKey);
1027
+ },
1028
+ heartbeatSession(input = {}, idempotencyKey) {
1029
+ return execute("heartbeat_session", input, idempotencyKey);
1030
+ },
1031
+ whoami(input = {}, idempotencyKey) {
1032
+ return execute("identity_whoami", input, idempotencyKey);
1033
+ },
1034
+ ingestObservation(input = {}, idempotencyKey) {
1035
+ return execute("ingest_observation", input, idempotencyKey);
1036
+ },
1037
+ linkEvidence(input = {}, idempotencyKey) {
1038
+ return execute("link_evidence", input, idempotencyKey);
1039
+ },
1040
+ linkEvidenceToBelief(input = {}, idempotencyKey) {
1041
+ return execute("link_evidence_to_belief", input, idempotencyKey);
1042
+ },
1043
+ linkEvidenceToQuestion(input = {}, idempotencyKey) {
1044
+ return execute("link_evidence_to_question", input, idempotencyKey);
1045
+ },
1046
+ listActiveSessions(input = {}, idempotencyKey) {
1047
+ return execute("list_active_sessions", input, idempotencyKey);
1048
+ },
1049
+ listAllWorktrees(input = {}, idempotencyKey) {
1050
+ return execute("list_all_worktrees", input, idempotencyKey);
1051
+ },
1052
+ listBeliefs(input = {}, idempotencyKey) {
1053
+ return execute("list_beliefs", input, idempotencyKey);
1054
+ },
1055
+ listCampaigns(input = {}, idempotencyKey) {
1056
+ return execute("list_campaigns", input, idempotencyKey);
1057
+ },
1058
+ listEpistemicNodes(input = {}, idempotencyKey) {
1059
+ return execute("list_epistemic_nodes", input, idempotencyKey);
1060
+ },
1061
+ listEvidence(input = {}, idempotencyKey) {
1062
+ return execute("list_evidence", input, idempotencyKey);
1063
+ },
1064
+ listGraphIntelligenceQueries(input = {}, idempotencyKey) {
1065
+ return execute("list_graph_intelligence_queries", input, idempotencyKey);
1066
+ },
1067
+ listLenses(input = {}, idempotencyKey) {
1068
+ return execute("list_lenses", input, idempotencyKey);
1069
+ },
1070
+ listOntologies(input = {}, idempotencyKey) {
1071
+ return execute("list_ontologies", input, idempotencyKey);
1072
+ },
1073
+ listQuestions(input = {}, idempotencyKey) {
1074
+ return execute("list_questions", input, idempotencyKey);
1075
+ },
1076
+ listTasks(input = {}, idempotencyKey) {
1077
+ return execute("list_tasks", input, idempotencyKey);
1078
+ },
1079
+ listTopics(input = {}, idempotencyKey) {
1080
+ return execute("list_topics", input, idempotencyKey);
1081
+ },
1082
+ listWorktrees(input = {}, idempotencyKey) {
1083
+ return execute("list_worktrees", input, idempotencyKey);
1084
+ },
1085
+ manageWritePolicy(input = {}, idempotencyKey) {
1086
+ return execute("manage_write_policy", input, idempotencyKey);
1087
+ },
1088
+ matchEntityType(input = {}, idempotencyKey) {
1089
+ return execute("match_entity_type", input, idempotencyKey);
1090
+ },
1091
+ materializeTopicGraph(input = {}, idempotencyKey) {
1092
+ return execute("materialize_topic_graph", input, idempotencyKey);
1093
+ },
1094
+ merge(input = {}, idempotencyKey) {
1095
+ return execute("merge", input, idempotencyKey);
1096
+ },
1097
+ modulateConfidence(input = {}, idempotencyKey) {
1098
+ return execute("modulate_confidence", input, idempotencyKey);
1099
+ },
1100
+ openPullRequest(input = {}, idempotencyKey) {
1101
+ return execute("open_pull_request", input, idempotencyKey);
1102
+ },
1103
+ pipelineSnapshot(input = {}, idempotencyKey) {
1104
+ return execute("pipeline_snapshot", input, idempotencyKey);
1105
+ },
1106
+ publishOntologyVersion(input = {}, idempotencyKey) {
1107
+ return execute("publish_ontology_version", input, idempotencyKey);
1108
+ },
1109
+ push(input = {}, idempotencyKey) {
1110
+ return execute("push", input, idempotencyKey);
1111
+ },
1112
+ queryLineage(input = {}, idempotencyKey) {
1113
+ return execute("query_lineage", input, idempotencyKey);
1114
+ },
1115
+ recordAttempt(input = {}, idempotencyKey) {
1116
+ return execute("record_attempt", input, idempotencyKey);
1117
+ },
1118
+ recordJudgment(input = {}, idempotencyKey) {
1119
+ return execute("record_judgment", input, idempotencyKey);
1120
+ },
1121
+ recordScopeLearning(input = {}, idempotencyKey) {
1122
+ return execute("record_scope_learning", input, idempotencyKey);
1123
+ },
1124
+ refineBelief(input = {}, idempotencyKey) {
1125
+ return execute("refine_belief", input, idempotencyKey);
1126
+ },
1127
+ refineQuestion(input = {}, idempotencyKey) {
1128
+ return execute("refine_question", input, idempotencyKey);
1129
+ },
1130
+ registerSession(input = {}, idempotencyKey) {
1131
+ return execute("register_session", input, idempotencyKey);
1132
+ },
1133
+ removeEdge(input = {}, idempotencyKey) {
1134
+ return execute("remove_edge", input, idempotencyKey);
1135
+ },
1136
+ removeEdgesBetween(input = {}, idempotencyKey) {
1137
+ return execute("remove_edges_between", input, idempotencyKey);
1138
+ },
1139
+ removeLensFromTopic(input = {}, idempotencyKey) {
1140
+ return execute("remove_lens_from_topic", input, idempotencyKey);
1141
+ },
1142
+ resolveEffectiveOntology(input = {}, idempotencyKey) {
1143
+ return execute("resolve_effective_ontology", input, idempotencyKey);
1144
+ },
1145
+ runGraphIntelligenceQuery(input = {}, idempotencyKey) {
1146
+ return execute("run_graph_intelligence_query", input, idempotencyKey);
1147
+ },
1148
+ searchBeliefs(input = {}, idempotencyKey) {
1149
+ return execute("search_beliefs", input, idempotencyKey);
1150
+ },
1151
+ searchEvidence(input = {}, idempotencyKey) {
1152
+ return execute("search_evidence", input, idempotencyKey);
1153
+ },
1154
+ seedBeliefLattice(input = {}, idempotencyKey) {
1155
+ return execute("seed_belief_lattice", input, idempotencyKey);
1156
+ },
1157
+ sendAgentMessage(input = {}, idempotencyKey) {
1158
+ return execute("send_agent_message", input, idempotencyKey);
1159
+ },
1160
+ supersedeEpistemicNode(input = {}, idempotencyKey) {
1161
+ return execute("supersede_epistemic_node", input, idempotencyKey);
1162
+ },
1163
+ traceEntityImpact(input = {}, idempotencyKey) {
1164
+ return execute("trace_entity_impact", input, idempotencyKey);
1165
+ },
1166
+ traverseGraph(input = {}, idempotencyKey) {
1167
+ return execute("traverse_graph", input, idempotencyKey);
1168
+ },
1169
+ triggerBeliefReview(input = {}, idempotencyKey) {
1170
+ return execute("trigger_belief_review", input, idempotencyKey);
1171
+ },
1172
+ updateEdge(input = {}, idempotencyKey) {
1173
+ return execute("update_edge", input, idempotencyKey);
1174
+ },
1175
+ updateEpistemicNode(input = {}, idempotencyKey) {
1176
+ return execute("update_epistemic_node", input, idempotencyKey);
1177
+ },
1178
+ updateOntology(input = {}, idempotencyKey) {
1179
+ return execute("update_ontology", input, idempotencyKey);
1180
+ },
1181
+ updateQuestionStatus(input = {}, idempotencyKey) {
1182
+ return execute("update_question_status", input, idempotencyKey);
1183
+ },
1184
+ updateTask(input = {}, idempotencyKey) {
1185
+ return execute("update_task", input, idempotencyKey);
1186
+ },
1187
+ updateTopic(input = {}, idempotencyKey) {
1188
+ return execute("update_topic", input, idempotencyKey);
1189
+ },
1190
+ updateWorktreeMetadata(input = {}, idempotencyKey) {
1191
+ return execute("update_worktree_metadata", input, idempotencyKey);
1192
+ },
1193
+ updateWorktreeTargets(input = {}, idempotencyKey) {
1194
+ return execute("update_worktree_targets", input, idempotencyKey);
1195
+ },
1196
+ verifyEpistemicNode(input = {}, idempotencyKey) {
1197
+ return execute("verify_epistemic_node", input, idempotencyKey);
1198
+ }
1199
+ };
1200
+ }
1201
+
1202
+ export { FUNCTION_SURFACE_METHOD_PATHS, createFunctionSurfaceClient };
1203
+ //# sourceMappingURL=functionSurfaceClient.js.map
1204
+ //# sourceMappingURL=functionSurfaceClient.js.map