@lucern/sdk 0.3.0-alpha.17 → 0.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -12
- package/README.md +4 -110
- package/dist/adminClient.d.ts +8 -8
- package/dist/adminClient.js +40 -70
- package/dist/adminClient.js.map +1 -1
- package/dist/answersClient.js +12 -49
- package/dist/answersClient.js.map +1 -1
- package/dist/audience/index.d.ts +1 -2
- package/dist/audience/index.js +3 -1
- package/dist/audience/index.js.map +1 -1
- package/dist/audiencesClient.d.ts +16 -16
- package/dist/audiencesClient.js +91 -125
- package/dist/audiencesClient.js.map +1 -1
- package/dist/auditClient.js +14 -53
- package/dist/auditClient.js.map +1 -1
- package/dist/authContext.d.ts +2 -2
- package/dist/authContext.js +3 -4
- package/dist/authContext.js.map +1 -1
- package/dist/authDeviceClient.js +3 -16
- package/dist/authDeviceClient.js.map +1 -1
- package/dist/beliefs/index.d.ts +4 -9
- package/dist/beliefs/index.js +1305 -1943
- package/dist/beliefs/index.js.map +1 -1
- package/dist/beliefsClient.d.ts +2 -2
- package/dist/beliefsClient.js +23 -54
- package/dist/beliefsClient.js.map +1 -1
- package/dist/boundaryClientSurface.js +3 -10
- package/dist/boundaryClientSurface.js.map +1 -1
- package/dist/client-EiG9nJOY.d.ts +2911 -0
- package/dist/client.d.ts +41 -3038
- package/dist/client.js +1305 -1943
- package/dist/client.js.map +1 -1
- package/dist/contextClient.d.ts +3 -4
- package/dist/contextClient.js +30 -79
- package/dist/contextClient.js.map +1 -1
- package/dist/contextFacade.js +16 -25
- package/dist/contextFacade.js.map +1 -1
- package/dist/contextPackCompiler.js +30 -19
- package/dist/contextPackCompiler.js.map +1 -1
- package/dist/contextPackPolicy.js +17 -7
- package/dist/contextPackPolicy.js.map +1 -1
- package/dist/contextTypes.d.ts +0 -2
- package/dist/contracts/api-enums.contract.d.ts +2 -2
- package/dist/contracts/api-enums.contract.js +1 -6
- package/dist/contracts/api-enums.contract.js.map +1 -1
- package/dist/contracts/auth-session.contract.d.ts +1 -1
- package/dist/contracts/auth-session.contract.js +2 -14
- package/dist/contracts/auth-session.contract.js.map +1 -1
- package/dist/contracts/index.js +6 -30
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/lens-filter.contract.js +3 -4
- package/dist/contracts/lens-filter.contract.js.map +1 -1
- package/dist/contracts/lens-workflow.contract.js +3 -4
- package/dist/contracts/lens-workflow.contract.js.map +1 -1
- package/dist/contracts/lensFilter.js +3 -4
- package/dist/contracts/lensFilter.js.map +1 -1
- package/dist/contracts/lensWorkflow.js +3 -4
- package/dist/contracts/lensWorkflow.js.map +1 -1
- package/dist/contracts/mcpTools.js +0 -6
- package/dist/contracts/mcpTools.js.map +1 -1
- package/dist/contradictions/index.d.ts +3 -8
- package/dist/contradictions/index.js +1305 -1943
- package/dist/contradictions/index.js.map +1 -1
- package/dist/coreClient.d.ts +2 -19
- package/dist/coreClient.js +15 -50
- package/dist/coreClient.js.map +1 -1
- package/dist/decisions/index.d.ts +13 -18
- package/dist/decisions/index.js +1305 -1943
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisionsClient.d.ts +12 -4
- package/dist/decisionsClient.js +35 -60
- package/dist/decisionsClient.js.map +1 -1
- package/dist/edges/index.d.ts +86 -31
- package/dist/edges/index.js +1305 -1943
- package/dist/edges/index.js.map +1 -1
- package/dist/embeddingsClient.js +18 -60
- package/dist/embeddingsClient.js.map +1 -1
- package/dist/eventingClient.js +18 -60
- package/dist/eventingClient.js.map +1 -1
- package/dist/events.js +3 -6
- package/dist/events.js.map +1 -1
- package/dist/eventsCore.d.ts +1 -1
- package/dist/eventsCore.js +15 -50
- package/dist/eventsCore.js.map +1 -1
- package/dist/evidence/index.d.ts +3 -8
- package/dist/evidence/index.js +1305 -1943
- package/dist/evidence/index.js.map +1 -1
- package/dist/evidenceClient.js +15 -50
- package/dist/evidenceClient.js.map +1 -1
- package/dist/facade/context.d.ts +1 -2
- package/dist/facade/context.js +16 -25
- package/dist/facade/context.js.map +1 -1
- package/dist/gatewayFacades.d.ts +48 -90
- package/dist/gatewayFacades.js +128 -251
- package/dist/gatewayFacades.js.map +1 -1
- package/dist/graphAnalysisClient.d.ts +1 -53
- package/dist/graphAnalysisClient.js +17 -81
- package/dist/graphAnalysisClient.js.map +1 -1
- package/dist/graphClient.d.ts +13 -6
- package/dist/graphClient.js +39 -65
- package/dist/graphClient.js.map +1 -1
- package/dist/graphRecommendationsClient.js +17 -54
- package/dist/graphRecommendationsClient.js.map +1 -1
- package/dist/graphStateClassifierClient.js +19 -60
- package/dist/graphStateClassifierClient.js.map +1 -1
- package/dist/harnessClient.d.ts +24 -13
- package/dist/harnessClient.js +41 -61
- package/dist/harnessClient.js.map +1 -1
- package/dist/identityClient.d.ts +9 -27
- package/dist/identityClient.js +39 -203
- package/dist/identityClient.js.map +1 -1
- package/dist/index.d.ts +6 -15
- package/dist/index.js +1171 -2256
- package/dist/index.js.map +1 -1
- package/dist/jobsClient.js +19 -60
- package/dist/jobsClient.js.map +1 -1
- package/dist/learningClient.d.ts +6 -6
- package/dist/learningClient.js +43 -78
- package/dist/learningClient.js.map +1 -1
- package/dist/lenses/index.d.ts +37 -60
- package/dist/lenses/index.js +1305 -1943
- package/dist/lenses/index.js.map +1 -1
- package/dist/mcpClient.js +13 -51
- package/dist/mcpClient.js.map +1 -1
- package/dist/modelRuntimeClient.js +18 -60
- package/dist/modelRuntimeClient.js.map +1 -1
- package/dist/nodes/index.d.ts +22 -49
- package/dist/nodes/index.js +1305 -1943
- package/dist/nodes/index.js.map +1 -1
- package/dist/ontologies/index.d.ts +31 -37
- package/dist/ontologies/index.js +1305 -1943
- package/dist/ontologies/index.js.map +1 -1
- package/dist/ontologyClient.d.ts +25 -17
- package/dist/ontologyClient.js +41 -86
- package/dist/ontologyClient.js.map +1 -1
- package/dist/ontologyLinksClient.js +19 -60
- package/dist/ontologyLinksClient.js.map +1 -1
- package/dist/orgGraphSearchClient.js +14 -53
- package/dist/orgGraphSearchClient.js.map +1 -1
- package/dist/packRuntime.d.ts +1 -2
- package/dist/packsClient.d.ts +23 -9
- package/dist/packsClient.js +47 -62
- package/dist/packsClient.js.map +1 -1
- package/dist/policyClient.d.ts +10 -11
- package/dist/policyClient.js +26 -71
- package/dist/policyClient.js.map +1 -1
- package/dist/questions/index.d.ts +3 -8
- package/dist/questions/index.js +1305 -1943
- package/dist/questions/index.js.map +1 -1
- package/dist/realtime/index.d.ts +1 -1
- package/dist/reportsClient.d.ts +7 -7
- package/dist/reportsClient.js +52 -107
- package/dist/reportsClient.js.map +1 -1
- package/dist/schemaClient.d.ts +3 -3
- package/dist/schemaClient.js +30 -63
- package/dist/schemaClient.js.map +1 -1
- package/dist/sdkSurface.d.ts +3 -6
- package/dist/sdkSurface.js +6 -10
- package/dist/sdkSurface.js.map +1 -1
- package/dist/sourcesClient.js +15 -50
- package/dist/sourcesClient.js.map +1 -1
- package/dist/telemetryClient.js +19 -60
- package/dist/telemetryClient.js.map +1 -1
- package/dist/toolRegistryClient.d.ts +2 -10
- package/dist/toolRegistryClient.js +20 -73
- package/dist/toolRegistryClient.js.map +1 -1
- package/dist/topics/index.d.ts +8 -19
- package/dist/topics/index.js +1305 -1945
- package/dist/topics/index.js.map +1 -1
- package/dist/topicsClient.d.ts +0 -2
- package/dist/topicsClient.js +20 -60
- package/dist/topicsClient.js.map +1 -1
- package/dist/types.d.ts +0 -17
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/workflowClient.d.ts +40 -58
- package/dist/workflowClient.js +54 -66
- package/dist/workflowClient.js.map +1 -1
- package/dist/worktrees/index.d.ts +33 -54
- package/dist/worktrees/index.js +1305 -1943
- package/dist/worktrees/index.js.map +1 -1
- package/package.json +3 -17
- package/dist/accessControl.d.ts +0 -79
- package/dist/accessControl.js +0 -1270
- package/dist/accessControl.js.map +0 -1
- package/dist/clientHelpers.d.ts +0 -48
- package/dist/clientHelpers.js +0 -137
- package/dist/clientHelpers.js.map +0 -1
- package/dist/control-plane.d.ts +0 -69
- package/dist/control-plane.js +0 -674
- package/dist/control-plane.js.map +0 -1
- package/dist/functionSurface.d.ts +0 -144
- package/dist/functionSurface.js +0 -1227
- package/dist/functionSurface.js.map +0 -1
- package/dist/functionSurfaceClient.d.ts +0 -8
- package/dist/functionSurfaceClient.js +0 -1227
- package/dist/functionSurfaceClient.js.map +0 -1
- package/dist/graphIntel.d.ts +0 -4
- package/dist/graphIntel.js +0 -3
- package/dist/graphIntel.js.map +0 -1
- package/dist/graphIntelligence.d.ts +0 -2
- package/dist/graphIntelligence.js +0 -47
- package/dist/graphIntelligence.js.map +0 -1
- package/dist/infisicalRuntime.d.ts +0 -43
- package/dist/infisicalRuntime.js +0 -346
- package/dist/infisicalRuntime.js.map +0 -1
- package/dist/secrets.d.ts +0 -1
- package/dist/secrets.js +0 -3
- package/dist/secrets.js.map +0 -1
package/dist/beliefs/index.js
CHANGED
|
@@ -38,14 +38,14 @@ function requireString(value, reason, label) {
|
|
|
38
38
|
}
|
|
39
39
|
return normalized;
|
|
40
40
|
}
|
|
41
|
-
function requirePrincipalType(
|
|
42
|
-
if (!
|
|
41
|
+
function requirePrincipalType(principalType) {
|
|
42
|
+
if (!principalType) {
|
|
43
43
|
throw new LucernSdkAuthContextError(
|
|
44
44
|
"principal_missing",
|
|
45
45
|
"Canonical Lucern SDK auth context is missing principalType."
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return principalType;
|
|
49
49
|
}
|
|
50
50
|
function requireAuthMode(authMode) {
|
|
51
51
|
if (!authMode) {
|
|
@@ -91,15 +91,14 @@ function normalizeCanonicalLucernAuthContext(input) {
|
|
|
91
91
|
);
|
|
92
92
|
const roles = cleanStringList(input.roles);
|
|
93
93
|
const scopes = cleanStringList(input.scopes);
|
|
94
|
-
|
|
95
|
-
const authMode = requireAuthMode(input.authMode);
|
|
96
|
-
const roleBasedInteractiveAuth = authMode === "interactive_user" && roles.length > 0;
|
|
97
|
-
if (roles.length === 0 || scopes.length === 0 && !roleBasedInteractiveAuth) {
|
|
94
|
+
if (roles.length === 0 || scopes.length === 0) {
|
|
98
95
|
throw new LucernSdkAuthContextError(
|
|
99
96
|
"membership_missing",
|
|
100
97
|
"Canonical Lucern SDK auth context requires non-empty roles and scopes."
|
|
101
98
|
);
|
|
102
99
|
}
|
|
100
|
+
const principalType = requirePrincipalType(input.principalType);
|
|
101
|
+
const authMode = requireAuthMode(input.authMode);
|
|
103
102
|
const subject = cleanString(input.permit?.subject) ?? principalId;
|
|
104
103
|
const tenant = cleanString(input.permit?.tenant) ?? tenantId;
|
|
105
104
|
const workspace = cleanString(input.permit?.workspace) ?? workspaceId;
|
|
@@ -120,7 +119,7 @@ function normalizeCanonicalLucernAuthContext(input) {
|
|
|
120
119
|
principalId,
|
|
121
120
|
tenantId,
|
|
122
121
|
workspaceId,
|
|
123
|
-
principalType
|
|
122
|
+
principalType,
|
|
124
123
|
authMode,
|
|
125
124
|
roles,
|
|
126
125
|
scopes,
|
|
@@ -241,7 +240,9 @@ function generatePortableRequestId() {
|
|
|
241
240
|
8
|
|
242
241
|
).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
243
242
|
}
|
|
244
|
-
|
|
243
|
+
function randomIdempotencyKey() {
|
|
244
|
+
return generatePortableRequestId();
|
|
245
|
+
}
|
|
245
246
|
function isRetryableStatus(status) {
|
|
246
247
|
return status >= 500 || status === 408 || status === 429;
|
|
247
248
|
}
|
|
@@ -306,11 +307,8 @@ function timeoutError(timeoutMs) {
|
|
|
306
307
|
error.name = "AbortError";
|
|
307
308
|
return error;
|
|
308
309
|
}
|
|
309
|
-
function isRecord(value) {
|
|
310
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
311
|
-
}
|
|
312
310
|
function readPolicySummaryFromDetails(details) {
|
|
313
|
-
if (!
|
|
311
|
+
if (!details || typeof details !== "object" || Array.isArray(details)) {
|
|
314
312
|
return null;
|
|
315
313
|
}
|
|
316
314
|
const directSummary = details.summary;
|
|
@@ -318,11 +316,11 @@ function readPolicySummaryFromDetails(details) {
|
|
|
318
316
|
return directSummary.trim();
|
|
319
317
|
}
|
|
320
318
|
const policy = details.policy;
|
|
321
|
-
if (!
|
|
319
|
+
if (!policy || typeof policy !== "object" || Array.isArray(policy)) {
|
|
322
320
|
return null;
|
|
323
321
|
}
|
|
324
322
|
const explanation = policy.explanation;
|
|
325
|
-
if (!
|
|
323
|
+
if (!explanation || typeof explanation !== "object" || Array.isArray(explanation)) {
|
|
326
324
|
return null;
|
|
327
325
|
}
|
|
328
326
|
const nestedSummary = explanation.summary;
|
|
@@ -351,31 +349,13 @@ function mergeHeaderRecord(base, addition) {
|
|
|
351
349
|
}
|
|
352
350
|
return Object.fromEntries(headers.entries());
|
|
353
351
|
}
|
|
354
|
-
function cleanHeaderValue(value) {
|
|
355
|
-
const normalized = value?.trim();
|
|
356
|
-
return normalized ? normalized : void 0;
|
|
357
|
-
}
|
|
358
352
|
function createGatewayRequestClient(config = {}) {
|
|
359
353
|
const fetchImpl = config.fetchImpl ?? fetch;
|
|
360
354
|
const baseUrl = config.baseUrl?.replace(/\/+$/, "") ?? "";
|
|
361
355
|
const maxRetries = config.maxRetries ?? 2;
|
|
362
356
|
const requestIdFactory = config.requestIdFactory ?? (() => generatePortableRequestId());
|
|
363
357
|
async function resolveAuthHeaders() {
|
|
364
|
-
const
|
|
365
|
-
const headers = new Headers(provided);
|
|
366
|
-
const setIfAbsent = (name, value) => {
|
|
367
|
-
const normalized = cleanHeaderValue(value);
|
|
368
|
-
if (normalized && !headers.has(name)) {
|
|
369
|
-
headers.set(name, normalized);
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
setIfAbsent("x-lucern-key", config.apiKey);
|
|
373
|
-
setIfAbsent("x-lucern-session-token", config.userToken);
|
|
374
|
-
setIfAbsent("x-lucern-environment", config.environment);
|
|
375
|
-
setIfAbsent("x-lucern-clerk-id", config.clerkId);
|
|
376
|
-
setIfAbsent("x-lucern-user-id", config.userId ?? config.clerkId);
|
|
377
|
-
setIfAbsent("x-lucern-deployment-host", config.deploymentHost);
|
|
378
|
-
const base = Object.fromEntries(headers.entries());
|
|
358
|
+
const base = config.getAuthHeaders ? await config.getAuthHeaders() : {};
|
|
379
359
|
const authContextInput = await resolveConfiguredAuthContext(
|
|
380
360
|
config.authContext
|
|
381
361
|
);
|
|
@@ -404,11 +384,11 @@ function createGatewayRequestClient(config = {}) {
|
|
|
404
384
|
if (!text) {
|
|
405
385
|
return null;
|
|
406
386
|
}
|
|
407
|
-
|
|
408
|
-
|
|
387
|
+
try {
|
|
388
|
+
return JSON.parse(text);
|
|
389
|
+
} catch {
|
|
409
390
|
return null;
|
|
410
391
|
}
|
|
411
|
-
return isRecord(parsed.value) ? parsed.value : null;
|
|
412
392
|
}
|
|
413
393
|
function resolveTimeoutMs(method, requestTimeoutMs) {
|
|
414
394
|
if (typeof requestTimeoutMs === "number") {
|
|
@@ -420,31 +400,16 @@ function createGatewayRequestClient(config = {}) {
|
|
|
420
400
|
}
|
|
421
401
|
return config.timeoutMs ?? 15e3;
|
|
422
402
|
}
|
|
423
|
-
function tryParseGatewayEnvelopeJson(text) {
|
|
424
|
-
const trimmed = text.trim();
|
|
425
|
-
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) {
|
|
426
|
-
return { ok: false, reason: "non-json" };
|
|
427
|
-
}
|
|
428
|
-
try {
|
|
429
|
-
return { ok: true, value: JSON.parse(trimmed) };
|
|
430
|
-
} catch (error) {
|
|
431
|
-
if (error instanceof SyntaxError) {
|
|
432
|
-
return { ok: false, reason: "invalid-json", error };
|
|
433
|
-
}
|
|
434
|
-
throw error;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
403
|
function buildApiError(args) {
|
|
438
404
|
const failure = args.failure;
|
|
439
|
-
const legacyError = failure &&
|
|
405
|
+
const legacyError = failure && typeof failure.error === "object" && failure.error !== null ? failure.error : failure?.legacyError;
|
|
440
406
|
const correlationId = failure?.correlationId ?? args.response.headers.get("x-lucern-correlation-id")?.trim() ?? args.requestId;
|
|
441
407
|
const policyTraceId = failure?.policyTraceId ?? args.response.headers.get("x-lucern-policy-trace-id")?.trim() ?? null;
|
|
442
408
|
const details = failure?.details ?? legacyError?.details;
|
|
443
409
|
const policySummary = readPolicySummaryFromDetails(details);
|
|
444
|
-
const failureMessage = typeof failure?.error === "string" ? failure.error : legacyError?.message;
|
|
445
410
|
return new LucernApiError({
|
|
446
411
|
code: failure?.code ?? legacyError?.code ?? fallbackErrorCode(args.response.status),
|
|
447
|
-
message: policySummary ??
|
|
412
|
+
message: policySummary ?? (typeof failure?.error === "string" ? failure.error : legacyError?.message ?? (args.response.ok ? "Platform API returned an invalid success payload." : "Platform API request failed.")),
|
|
448
413
|
status: args.response.status,
|
|
449
414
|
invariant: failure?.invariant,
|
|
450
415
|
suggestion: failure?.suggestion,
|
|
@@ -570,11 +535,8 @@ function createGatewayRequestClient(config = {}) {
|
|
|
570
535
|
}
|
|
571
536
|
|
|
572
537
|
// src/sdkSurface.ts
|
|
573
|
-
function isRecord2(value) {
|
|
574
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
575
|
-
}
|
|
576
538
|
function asRecord(value) {
|
|
577
|
-
return
|
|
539
|
+
return value && typeof value === "object" ? value : {};
|
|
578
540
|
}
|
|
579
541
|
function cleanString2(value) {
|
|
580
542
|
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
@@ -635,7 +597,9 @@ function normalizeNodeWriteInput(value) {
|
|
|
635
597
|
}
|
|
636
598
|
return next;
|
|
637
599
|
}
|
|
638
|
-
|
|
600
|
+
function normalizeNodeVerificationStatus(value) {
|
|
601
|
+
return normalizeVerificationStatus(value);
|
|
602
|
+
}
|
|
639
603
|
function normalizeTopicQuery(value) {
|
|
640
604
|
const topicId = cleanString2(value.topicId);
|
|
641
605
|
if (!topicId) {
|
|
@@ -662,10 +626,7 @@ function createListResult(items, legacyKey) {
|
|
|
662
626
|
total: items.length
|
|
663
627
|
};
|
|
664
628
|
if (legacyKey) {
|
|
665
|
-
|
|
666
|
-
...result,
|
|
667
|
-
[legacyKey]: items
|
|
668
|
-
};
|
|
629
|
+
result[legacyKey] = items;
|
|
669
630
|
}
|
|
670
631
|
return result;
|
|
671
632
|
}
|
|
@@ -709,17 +670,6 @@ function asTenantVaultSecretArray(data) {
|
|
|
709
670
|
}
|
|
710
671
|
function createAdminClient(config = {}) {
|
|
711
672
|
const gateway = createGatewayRequestClient(config);
|
|
712
|
-
const getControlObjectOwnership = async () => gateway.request({
|
|
713
|
-
path: "/api/platform/v1/admin/control-ownership"
|
|
714
|
-
});
|
|
715
|
-
const createMembership = async (input, idempotencyKey) => gateway.request({
|
|
716
|
-
path: "/api/platform/v1/memberships",
|
|
717
|
-
method: "POST",
|
|
718
|
-
body: input,
|
|
719
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
720
|
-
});
|
|
721
|
-
const updateMembership = createMembership;
|
|
722
|
-
const upsertMembership = createMembership;
|
|
723
673
|
return {
|
|
724
674
|
/**
|
|
725
675
|
* List tenants visible to the current principal.
|
|
@@ -751,11 +701,19 @@ function createAdminClient(config = {}) {
|
|
|
751
701
|
/**
|
|
752
702
|
* Get the control-object ownership contract.
|
|
753
703
|
*/
|
|
754
|
-
getControlObjectOwnership
|
|
704
|
+
async getControlObjectOwnership() {
|
|
705
|
+
return gateway.request({
|
|
706
|
+
path: "/api/platform/v1/admin/control-ownership"
|
|
707
|
+
});
|
|
708
|
+
},
|
|
755
709
|
/**
|
|
756
710
|
* @deprecated Use getControlObjectOwnership.
|
|
757
711
|
*/
|
|
758
|
-
getControlObjectOwnershipContract
|
|
712
|
+
async getControlObjectOwnershipContract() {
|
|
713
|
+
return gateway.request({
|
|
714
|
+
path: "/api/platform/v1/admin/control-ownership"
|
|
715
|
+
});
|
|
716
|
+
},
|
|
759
717
|
/**
|
|
760
718
|
* List workspaces for the current admin scope.
|
|
761
719
|
*/
|
|
@@ -802,15 +760,26 @@ function createAdminClient(config = {}) {
|
|
|
802
760
|
/**
|
|
803
761
|
* Create a membership.
|
|
804
762
|
*/
|
|
805
|
-
createMembership,
|
|
763
|
+
async createMembership(input, idempotencyKey) {
|
|
764
|
+
return gateway.request({
|
|
765
|
+
path: "/api/platform/v1/memberships",
|
|
766
|
+
method: "POST",
|
|
767
|
+
body: input,
|
|
768
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
769
|
+
});
|
|
770
|
+
},
|
|
806
771
|
/**
|
|
807
772
|
* Update a membership.
|
|
808
773
|
*/
|
|
809
|
-
updateMembership,
|
|
774
|
+
async updateMembership(input, idempotencyKey) {
|
|
775
|
+
return this.createMembership(input, idempotencyKey);
|
|
776
|
+
},
|
|
810
777
|
/**
|
|
811
778
|
* @deprecated Use createMembership or updateMembership.
|
|
812
779
|
*/
|
|
813
|
-
upsertMembership,
|
|
780
|
+
async upsertMembership(input, idempotencyKey) {
|
|
781
|
+
return this.createMembership(input, idempotencyKey);
|
|
782
|
+
},
|
|
814
783
|
/**
|
|
815
784
|
* List tenant API keys in the current admin scope.
|
|
816
785
|
*/
|
|
@@ -1072,852 +1041,135 @@ function createAdminClient(config = {}) {
|
|
|
1072
1041
|
};
|
|
1073
1042
|
}
|
|
1074
1043
|
|
|
1075
|
-
// src/
|
|
1076
|
-
function
|
|
1077
|
-
const normalized = value?.trim();
|
|
1078
|
-
return normalized ? normalized : void 0;
|
|
1079
|
-
}
|
|
1080
|
-
function isRecord3(value) {
|
|
1081
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
1082
|
-
}
|
|
1083
|
-
function cleanRequiredString(value, label) {
|
|
1084
|
-
const normalized = cleanOptionalString(value);
|
|
1085
|
-
if (!normalized) {
|
|
1086
|
-
throw new Error(`${label} is required`);
|
|
1087
|
-
}
|
|
1088
|
-
return normalized;
|
|
1089
|
-
}
|
|
1090
|
-
function readTopicId(input) {
|
|
1091
|
-
return cleanOptionalString(input.topicId) ?? cleanOptionalString(input.projectId);
|
|
1092
|
-
}
|
|
1093
|
-
function requireTopicId(input) {
|
|
1094
|
-
const topicId = readTopicId(input);
|
|
1095
|
-
if (!topicId) {
|
|
1096
|
-
throw new Error("topicId is required");
|
|
1097
|
-
}
|
|
1098
|
-
return topicId;
|
|
1099
|
-
}
|
|
1100
|
-
function assertKnownKeys(input, allowed, operation) {
|
|
1101
|
-
const allowedSet = new Set(allowed);
|
|
1102
|
-
const unknownKeys = Object.keys(input).filter((key) => !allowedSet.has(key));
|
|
1103
|
-
if (unknownKeys.length > 0) {
|
|
1104
|
-
throw new Error(
|
|
1105
|
-
`${operation} received unsupported field(s): ${unknownKeys.join(", ")}`
|
|
1106
|
-
);
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
function knownPayload(input, allowed, operation) {
|
|
1110
|
-
assertKnownKeys(input, allowed, operation);
|
|
1111
|
-
return { ...input };
|
|
1112
|
-
}
|
|
1113
|
-
function topicPayload(input, allowed, operation) {
|
|
1114
|
-
assertKnownKeys(input, allowed, operation);
|
|
1115
|
-
return {
|
|
1116
|
-
...input,
|
|
1117
|
-
topicId: requireTopicId(input),
|
|
1118
|
-
projectId: void 0
|
|
1119
|
-
};
|
|
1120
|
-
}
|
|
1121
|
-
function listResultFromEnvelope(data, legacyKey) {
|
|
1122
|
-
const record = isRecord3(data) ? data : {};
|
|
1123
|
-
const legacyItems = record[legacyKey];
|
|
1124
|
-
return createListResult(
|
|
1125
|
-
Array.isArray(legacyItems) ? legacyItems : Array.isArray(data) ? data : [],
|
|
1126
|
-
legacyKey
|
|
1127
|
-
);
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
// src/control-plane.ts
|
|
1131
|
-
var LucernControlPlaneIdentityError = class extends Error {
|
|
1132
|
-
reason;
|
|
1133
|
-
principalStatus;
|
|
1134
|
-
tenantStatus;
|
|
1135
|
-
workspaceStatus;
|
|
1136
|
-
details;
|
|
1137
|
-
constructor(failure) {
|
|
1138
|
-
super(failure.message);
|
|
1139
|
-
this.name = "LucernControlPlaneIdentityError";
|
|
1140
|
-
this.reason = failure.reason;
|
|
1141
|
-
this.principalStatus = failure.principalStatus;
|
|
1142
|
-
this.tenantStatus = failure.tenantStatus;
|
|
1143
|
-
this.workspaceStatus = failure.workspaceStatus;
|
|
1144
|
-
this.details = failure.details;
|
|
1145
|
-
}
|
|
1146
|
-
};
|
|
1147
|
-
function cleanString3(value) {
|
|
1148
|
-
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
1149
|
-
}
|
|
1150
|
-
function stringList(value) {
|
|
1151
|
-
if (!Array.isArray(value)) {
|
|
1152
|
-
return [];
|
|
1153
|
-
}
|
|
1154
|
-
return [
|
|
1155
|
-
...new Set(
|
|
1156
|
-
value.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter(Boolean)
|
|
1157
|
-
)
|
|
1158
|
-
];
|
|
1159
|
-
}
|
|
1160
|
-
function principalType(value) {
|
|
1161
|
-
switch (value) {
|
|
1162
|
-
case "service":
|
|
1163
|
-
case "service_principal":
|
|
1164
|
-
return "service";
|
|
1165
|
-
case "agent":
|
|
1166
|
-
return "agent";
|
|
1167
|
-
case "group":
|
|
1168
|
-
return "group";
|
|
1169
|
-
case "external_viewer":
|
|
1170
|
-
case "external_stakeholder":
|
|
1171
|
-
return "external_viewer";
|
|
1172
|
-
default:
|
|
1173
|
-
return "human";
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
function adminFlags(roles) {
|
|
1177
|
-
const normalized = roles.map((role) => role.toLowerCase());
|
|
1178
|
-
const isPlatformAdmin = normalized.includes("platform_admin");
|
|
1179
|
-
const isTenantAdmin = isPlatformAdmin || normalized.includes("tenant_admin");
|
|
1180
|
-
const isWorkspaceAdmin = isTenantAdmin || normalized.includes("workspace_admin") || normalized.includes("workspace_owner");
|
|
1181
|
-
return { isPlatformAdmin, isTenantAdmin, isWorkspaceAdmin };
|
|
1182
|
-
}
|
|
1183
|
-
function normalizeResolvedInteractivePrincipal(payload) {
|
|
1184
|
-
if ("ok" in payload && payload.ok === false) {
|
|
1185
|
-
throw new LucernControlPlaneIdentityError(payload);
|
|
1186
|
-
}
|
|
1187
|
-
const principalId = cleanString3(payload.principalId);
|
|
1188
|
-
const clerkId = cleanString3(payload.clerkId);
|
|
1189
|
-
const tenantId = cleanString3(payload.tenantId);
|
|
1190
|
-
if (!principalId || !clerkId || !tenantId) {
|
|
1191
|
-
throw new LucernControlPlaneIdentityError({
|
|
1192
|
-
ok: false,
|
|
1193
|
-
reason: "resolver_unavailable",
|
|
1194
|
-
message: "Control-plane principal resolver returned an incomplete principal context.",
|
|
1195
|
-
principalStatus: payload.principalStatus ?? "missing",
|
|
1196
|
-
tenantStatus: payload.tenantStatus,
|
|
1197
|
-
workspaceStatus: payload.workspaceStatus
|
|
1198
|
-
});
|
|
1199
|
-
}
|
|
1200
|
-
const roles = stringList(payload.roles);
|
|
1201
|
-
const scopes = stringList(payload.scopes);
|
|
1202
|
-
const workspaceId = cleanString3(payload.workspaceId) ?? null;
|
|
1203
|
-
const flags = adminFlags(roles);
|
|
1204
|
-
return {
|
|
1205
|
-
principalId,
|
|
1206
|
-
principalType: principalType(payload.principalType),
|
|
1207
|
-
clerkId,
|
|
1208
|
-
tenantId,
|
|
1209
|
-
workspaceId,
|
|
1210
|
-
roles,
|
|
1211
|
-
scopes,
|
|
1212
|
-
groupIds: stringList(payload.groupIds),
|
|
1213
|
-
permittedToolNames: stringList(payload.permittedToolNames),
|
|
1214
|
-
permittedPackKeys: stringList(payload.permittedPackKeys),
|
|
1215
|
-
principalStatus: cleanString3(payload.principalStatus) ?? "active",
|
|
1216
|
-
tenantStatus: cleanString3(payload.tenantStatus) ?? "active",
|
|
1217
|
-
workspaceStatus: cleanString3(payload.workspaceStatus) ?? (workspaceId ? "active" : "none"),
|
|
1218
|
-
isPlatformAdmin: typeof payload.isPlatformAdmin === "boolean" ? payload.isPlatformAdmin : flags.isPlatformAdmin,
|
|
1219
|
-
isTenantAdmin: typeof payload.isTenantAdmin === "boolean" ? payload.isTenantAdmin : flags.isTenantAdmin,
|
|
1220
|
-
isWorkspaceAdmin: typeof payload.isWorkspaceAdmin === "boolean" ? payload.isWorkspaceAdmin : flags.isWorkspaceAdmin,
|
|
1221
|
-
permit: {
|
|
1222
|
-
subject: cleanString3(payload.permit?.subject) ?? principalId,
|
|
1223
|
-
tenant: cleanString3(payload.permit?.tenant) ?? tenantId,
|
|
1224
|
-
...workspaceId ? { workspace: cleanString3(payload.permit?.workspace) ?? workspaceId } : {}
|
|
1225
|
-
},
|
|
1226
|
-
authMode: "interactive_user",
|
|
1227
|
-
sessionId: payload.sessionId,
|
|
1228
|
-
delegatedBy: payload.delegatedBy,
|
|
1229
|
-
expiresAt: payload.expiresAt
|
|
1230
|
-
};
|
|
1231
|
-
}
|
|
1232
|
-
function createControlPlaneIdentityClient(config = {}) {
|
|
1233
|
-
const gateway = createGatewayRequestClient(config);
|
|
1234
|
-
return {
|
|
1235
|
-
async resolveInteractivePrincipal(input) {
|
|
1236
|
-
return gateway.request({
|
|
1237
|
-
path: "/api/platform/v1/control-plane/identity/resolve-interactive-principal",
|
|
1238
|
-
method: "POST",
|
|
1239
|
-
body: input
|
|
1240
|
-
}).then(
|
|
1241
|
-
(response) => mapGatewayData(response, normalizeResolvedInteractivePrincipal)
|
|
1242
|
-
);
|
|
1243
|
-
}
|
|
1244
|
-
};
|
|
1245
|
-
}
|
|
1246
|
-
function createControlPlaneClient(config = {}) {
|
|
1247
|
-
return {
|
|
1248
|
-
identity: createControlPlaneIdentityClient(config)
|
|
1249
|
-
};
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
// src/identityClient.ts
|
|
1253
|
-
function createIdentityWhoamiClient(config = {}) {
|
|
1044
|
+
// src/answersClient.ts
|
|
1045
|
+
function createAnswersClient(config = {}) {
|
|
1254
1046
|
const gateway = createGatewayRequestClient(config);
|
|
1255
1047
|
return {
|
|
1256
|
-
|
|
1048
|
+
/**
|
|
1049
|
+
* Get the current answer for a question.
|
|
1050
|
+
* @param questionId - The question node identifier.
|
|
1051
|
+
* @returns The answer record for the given question.
|
|
1052
|
+
*/
|
|
1053
|
+
async get(questionId) {
|
|
1257
1054
|
return gateway.request({
|
|
1258
|
-
path:
|
|
1055
|
+
path: `/api/platform/v1/questions/${encodeURIComponent(questionId)}/answer`
|
|
1259
1056
|
});
|
|
1260
1057
|
}
|
|
1261
1058
|
};
|
|
1262
1059
|
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
"principalId",
|
|
1267
|
-
"integrationKey",
|
|
1268
|
-
"secretRef",
|
|
1269
|
-
"policySubject",
|
|
1270
|
-
"policyAction",
|
|
1271
|
-
"policyResource",
|
|
1272
|
-
"decision",
|
|
1273
|
-
"config",
|
|
1274
|
-
"configKey",
|
|
1275
|
-
"configValue",
|
|
1276
|
-
"provider",
|
|
1277
|
-
"status",
|
|
1278
|
-
"metadata",
|
|
1279
|
-
"limit",
|
|
1280
|
-
"cursor"
|
|
1281
|
-
];
|
|
1282
|
-
function tenantIdentityQuery(input) {
|
|
1283
|
-
return {
|
|
1284
|
-
tenantId: cleanRequiredString(input.tenantId, "tenantId"),
|
|
1285
|
-
workspaceId: input.workspaceId,
|
|
1286
|
-
principalId: input.principalId,
|
|
1287
|
-
limit: input.limit,
|
|
1288
|
-
cursor: input.cursor
|
|
1289
|
-
};
|
|
1290
|
-
}
|
|
1291
|
-
function tenantIdentityBody(input, operation) {
|
|
1292
|
-
return knownPayload(input, TENANT_IDENTITY_FIELDS, operation);
|
|
1293
|
-
}
|
|
1294
|
-
function createIdentityClient(config = {}) {
|
|
1060
|
+
|
|
1061
|
+
// src/audiencesClient.ts
|
|
1062
|
+
function createAudiencesClient(config = {}) {
|
|
1295
1063
|
const gateway = createGatewayRequestClient(config);
|
|
1296
|
-
const whoamiClient = createIdentityWhoamiClient(config);
|
|
1297
|
-
const requestPrincipalWrite = (method, input, idempotencyKey) => gateway.request({
|
|
1298
|
-
path: "/api/platform/v1/identity/principals",
|
|
1299
|
-
method,
|
|
1300
|
-
body: input,
|
|
1301
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1302
|
-
});
|
|
1303
|
-
const updatePrincipal = (input, idempotencyKey) => requestPrincipalWrite("PATCH", input, idempotencyKey);
|
|
1304
|
-
const deleteKey = (keyId, input = {}, idempotencyKey) => gateway.request({
|
|
1305
|
-
path: `/api/platform/v1/identity/keys/${encodeURIComponent(keyId)}/revoke`,
|
|
1306
|
-
method: "POST",
|
|
1307
|
-
body: input,
|
|
1308
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1309
|
-
});
|
|
1310
1064
|
return {
|
|
1311
1065
|
/**
|
|
1312
|
-
*
|
|
1313
|
-
*/
|
|
1314
|
-
async whoami() {
|
|
1315
|
-
return whoamiClient.whoami().then(
|
|
1316
|
-
(response) => mapGatewayData(response, (data) => ({
|
|
1317
|
-
principalId: data.principalId,
|
|
1318
|
-
principalType: data.principalType,
|
|
1319
|
-
clerkId: data.clerkId,
|
|
1320
|
-
tenantId: data.tenantId ?? null,
|
|
1321
|
-
workspaceId: data.workspaceId ?? null,
|
|
1322
|
-
scopes: Array.isArray(data.scopes) ? data.scopes : [],
|
|
1323
|
-
roles: Array.isArray(data.roles) ? data.roles : [],
|
|
1324
|
-
groupIds: Array.isArray(data.groupIds) ? data.groupIds : [],
|
|
1325
|
-
permittedToolNames: Array.isArray(data.permittedToolNames) ? data.permittedToolNames : [],
|
|
1326
|
-
permittedPackKeys: Array.isArray(data.permittedPackKeys) ? data.permittedPackKeys : [],
|
|
1327
|
-
principalStatus: data.principalStatus,
|
|
1328
|
-
tenantStatus: data.tenantStatus,
|
|
1329
|
-
workspaceStatus: data.workspaceStatus,
|
|
1330
|
-
isPlatformAdmin: data.isPlatformAdmin === true,
|
|
1331
|
-
isTenantAdmin: data.isTenantAdmin === true,
|
|
1332
|
-
isWorkspaceAdmin: data.isWorkspaceAdmin === true,
|
|
1333
|
-
permit: data.permit ?? (data.tenantId ? {
|
|
1334
|
-
subject: data.principalId,
|
|
1335
|
-
tenant: data.tenantId,
|
|
1336
|
-
...data.workspaceId ? { workspace: data.workspaceId } : {}
|
|
1337
|
-
} : void 0),
|
|
1338
|
-
authMode: data.authMode,
|
|
1339
|
-
sessionId: data.sessionId,
|
|
1340
|
-
delegatedBy: data.delegatedBy,
|
|
1341
|
-
expiresAt: data.expiresAt
|
|
1342
|
-
}))
|
|
1343
|
-
);
|
|
1344
|
-
},
|
|
1345
|
-
/**
|
|
1346
|
-
* Resolve a Clerk subject through the tenant control-plane Permit projection.
|
|
1347
|
-
* @deprecated Prefer lucern.controlPlane.identity.resolveInteractivePrincipal().
|
|
1348
|
-
*/
|
|
1349
|
-
async resolveInteractivePrincipal(input) {
|
|
1350
|
-
return gateway.request({
|
|
1351
|
-
path: "/api/platform/v1/control-plane/identity/resolve-interactive-principal",
|
|
1352
|
-
method: "POST",
|
|
1353
|
-
body: input
|
|
1354
|
-
}).then(
|
|
1355
|
-
(response) => mapGatewayData(response, normalizeResolvedInteractivePrincipal)
|
|
1356
|
-
);
|
|
1357
|
-
},
|
|
1358
|
-
/**
|
|
1359
|
-
* List principals in the current identity scope.
|
|
1066
|
+
* List audience registry entries.
|
|
1360
1067
|
*/
|
|
1361
|
-
async
|
|
1068
|
+
async listRegistry(query5 = {}) {
|
|
1362
1069
|
return gateway.request({
|
|
1363
|
-
path: `/api/platform/v1/
|
|
1070
|
+
path: `/api/platform/v1/audiences/registry${toQueryString({
|
|
1071
|
+
...query5,
|
|
1072
|
+
effective: typeof query5.effective === "boolean" ? query5.effective ? "true" : "false" : void 0,
|
|
1073
|
+
status: query5.status
|
|
1074
|
+
})}`
|
|
1364
1075
|
}).then(
|
|
1365
1076
|
(response) => mapGatewayData(
|
|
1366
1077
|
response,
|
|
1367
1078
|
(data) => createListResult(
|
|
1368
1079
|
Array.isArray(data) ? data : [],
|
|
1369
|
-
"
|
|
1080
|
+
"registryEntries"
|
|
1370
1081
|
)
|
|
1371
1082
|
)
|
|
1372
1083
|
);
|
|
1373
1084
|
},
|
|
1374
1085
|
/**
|
|
1375
|
-
*
|
|
1086
|
+
* @deprecated Use listRegistry.
|
|
1376
1087
|
*/
|
|
1377
|
-
async
|
|
1378
|
-
return
|
|
1088
|
+
async getRegistry(query5 = {}) {
|
|
1089
|
+
return this.listRegistry(query5);
|
|
1379
1090
|
},
|
|
1380
1091
|
/**
|
|
1381
|
-
*
|
|
1092
|
+
* Create an audience registry entry.
|
|
1382
1093
|
*/
|
|
1383
|
-
|
|
1094
|
+
async createRegistryEntry(input, idempotencyKey) {
|
|
1095
|
+
return gateway.request({
|
|
1096
|
+
path: "/api/platform/v1/audiences/registry",
|
|
1097
|
+
method: "POST",
|
|
1098
|
+
body: input,
|
|
1099
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1100
|
+
});
|
|
1101
|
+
},
|
|
1384
1102
|
/**
|
|
1385
|
-
*
|
|
1103
|
+
* Update an audience registry entry.
|
|
1386
1104
|
*/
|
|
1387
|
-
|
|
1105
|
+
async updateRegistryEntry(input, idempotencyKey) {
|
|
1106
|
+
return this.createRegistryEntry(input, idempotencyKey);
|
|
1107
|
+
},
|
|
1388
1108
|
/**
|
|
1389
|
-
*
|
|
1109
|
+
* @deprecated Use createRegistryEntry or updateRegistryEntry.
|
|
1390
1110
|
*/
|
|
1391
|
-
async
|
|
1111
|
+
async upsertRegistry(input, idempotencyKey) {
|
|
1112
|
+
return this.createRegistryEntry(input, idempotencyKey);
|
|
1113
|
+
},
|
|
1114
|
+
/**
|
|
1115
|
+
* List audience grants.
|
|
1116
|
+
*/
|
|
1117
|
+
async listGrants(query5 = {}) {
|
|
1392
1118
|
return gateway.request({
|
|
1393
|
-
path: `/api/platform/v1/
|
|
1119
|
+
path: `/api/platform/v1/audiences/grants${toQueryString({
|
|
1120
|
+
...query5,
|
|
1121
|
+
audienceKey: query5.audienceKey,
|
|
1122
|
+
principalId: query5.principalId,
|
|
1123
|
+
groupId: query5.groupId,
|
|
1124
|
+
status: query5.status
|
|
1125
|
+
})}`
|
|
1394
1126
|
}).then(
|
|
1395
1127
|
(response) => mapGatewayData(
|
|
1396
1128
|
response,
|
|
1397
|
-
(data) => createListResult(Array.isArray(data) ? data : [], "
|
|
1129
|
+
(data) => createListResult(Array.isArray(data) ? data : [], "grants")
|
|
1398
1130
|
)
|
|
1399
1131
|
);
|
|
1400
1132
|
},
|
|
1401
1133
|
/**
|
|
1402
|
-
*
|
|
1134
|
+
* @deprecated Use listGrants.
|
|
1403
1135
|
*/
|
|
1404
|
-
async
|
|
1136
|
+
async getGrants(query5 = {}) {
|
|
1137
|
+
return this.listGrants(query5);
|
|
1138
|
+
},
|
|
1139
|
+
/**
|
|
1140
|
+
* Create an audience grant.
|
|
1141
|
+
*/
|
|
1142
|
+
async createGrant(input, idempotencyKey) {
|
|
1405
1143
|
return gateway.request({
|
|
1406
|
-
path: "/api/platform/v1/
|
|
1144
|
+
path: "/api/platform/v1/audiences/grants",
|
|
1407
1145
|
method: "POST",
|
|
1408
1146
|
body: input,
|
|
1409
1147
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1410
1148
|
});
|
|
1411
1149
|
},
|
|
1412
1150
|
/**
|
|
1413
|
-
*
|
|
1151
|
+
* @deprecated Use createGrant.
|
|
1414
1152
|
*/
|
|
1415
|
-
async
|
|
1416
|
-
return
|
|
1417
|
-
path: `/api/platform/v1/identity/keys/${encodeURIComponent(keyId)}/rotate`,
|
|
1418
|
-
method: "POST",
|
|
1419
|
-
body: input,
|
|
1420
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1421
|
-
});
|
|
1153
|
+
async grant(input, idempotencyKey) {
|
|
1154
|
+
return this.createGrant(input, idempotencyKey);
|
|
1422
1155
|
},
|
|
1423
1156
|
/**
|
|
1424
|
-
* Delete an
|
|
1425
|
-
*/
|
|
1426
|
-
deleteKey,
|
|
1427
|
-
/**
|
|
1428
|
-
* @deprecated Use deleteKey.
|
|
1429
|
-
*/
|
|
1430
|
-
revokeKey: deleteKey,
|
|
1431
|
-
/**
|
|
1432
|
-
* Search Clerk users by email or display attributes.
|
|
1157
|
+
* Delete an audience grant by revoking it.
|
|
1433
1158
|
*/
|
|
1434
|
-
async
|
|
1435
|
-
return gateway.request({
|
|
1436
|
-
path: `/api/platform/v1/identity/clerk-users${toQueryString({ q })}`
|
|
1437
|
-
});
|
|
1438
|
-
},
|
|
1439
|
-
async getTenantConfig(input) {
|
|
1440
|
-
return gateway.request({
|
|
1441
|
-
path: `/api/platform/v1/identity/tenant-config${toQueryString(
|
|
1442
|
-
tenantIdentityQuery(input)
|
|
1443
|
-
)}`
|
|
1444
|
-
});
|
|
1445
|
-
},
|
|
1446
|
-
async updateTenantConfig(input, idempotencyKey) {
|
|
1447
|
-
cleanRequiredString(input.tenantId, "tenantId");
|
|
1448
|
-
return gateway.request({
|
|
1449
|
-
path: "/api/platform/v1/identity/tenant-config",
|
|
1450
|
-
method: "PATCH",
|
|
1451
|
-
body: tenantIdentityBody(
|
|
1452
|
-
input,
|
|
1453
|
-
"identity.updateTenantConfig"
|
|
1454
|
-
),
|
|
1455
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1456
|
-
});
|
|
1457
|
-
},
|
|
1458
|
-
async listIntegrations(input) {
|
|
1459
|
-
return gateway.request({
|
|
1460
|
-
path: `/api/platform/v1/identity/integrations${toQueryString(
|
|
1461
|
-
tenantIdentityQuery(input)
|
|
1462
|
-
)}`
|
|
1463
|
-
}).then(
|
|
1464
|
-
(response) => mapGatewayData(
|
|
1465
|
-
response,
|
|
1466
|
-
(data) => listResultFromEnvelope(
|
|
1467
|
-
data,
|
|
1468
|
-
"integrations"
|
|
1469
|
-
)
|
|
1470
|
-
)
|
|
1471
|
-
);
|
|
1472
|
-
},
|
|
1473
|
-
async upsertIntegration(input, idempotencyKey) {
|
|
1474
|
-
cleanRequiredString(input.tenantId, "tenantId");
|
|
1475
|
-
cleanRequiredString(input.integrationKey, "integrationKey");
|
|
1159
|
+
async deleteGrant(input, idempotencyKey) {
|
|
1476
1160
|
return gateway.request({
|
|
1477
|
-
path: "/api/platform/v1/
|
|
1478
|
-
method: "PUT",
|
|
1479
|
-
body: tenantIdentityBody(
|
|
1480
|
-
input,
|
|
1481
|
-
"identity.upsertIntegration"
|
|
1482
|
-
),
|
|
1483
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1484
|
-
});
|
|
1485
|
-
},
|
|
1486
|
-
async listSecrets(input) {
|
|
1487
|
-
return gateway.request({
|
|
1488
|
-
path: `/api/platform/v1/identity/secrets${toQueryString(
|
|
1489
|
-
tenantIdentityQuery(input)
|
|
1490
|
-
)}`
|
|
1491
|
-
}).then(
|
|
1492
|
-
(response) => mapGatewayData(
|
|
1493
|
-
response,
|
|
1494
|
-
(data) => listResultFromEnvelope(
|
|
1495
|
-
data,
|
|
1496
|
-
"secrets"
|
|
1497
|
-
)
|
|
1498
|
-
)
|
|
1499
|
-
);
|
|
1500
|
-
},
|
|
1501
|
-
async putSecretReference(input, idempotencyKey) {
|
|
1502
|
-
cleanRequiredString(input.tenantId, "tenantId");
|
|
1503
|
-
cleanRequiredString(input.secretRef, "secretRef");
|
|
1504
|
-
return gateway.request({
|
|
1505
|
-
path: "/api/platform/v1/identity/secrets",
|
|
1506
|
-
method: "PUT",
|
|
1507
|
-
body: tenantIdentityBody(
|
|
1508
|
-
input,
|
|
1509
|
-
"identity.putSecretReference"
|
|
1510
|
-
),
|
|
1511
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1512
|
-
});
|
|
1513
|
-
},
|
|
1514
|
-
async evaluatePolicy(input, idempotencyKey) {
|
|
1515
|
-
cleanRequiredString(input.tenantId, "tenantId");
|
|
1516
|
-
cleanRequiredString(input.policySubject, "policySubject");
|
|
1517
|
-
cleanRequiredString(input.policyAction, "policyAction");
|
|
1518
|
-
cleanRequiredString(input.policyResource, "policyResource");
|
|
1519
|
-
return gateway.request({
|
|
1520
|
-
path: "/api/platform/v1/identity/policy/evaluate",
|
|
1161
|
+
path: "/api/platform/v1/audiences/grants/revoke",
|
|
1521
1162
|
method: "POST",
|
|
1522
|
-
body:
|
|
1523
|
-
input,
|
|
1524
|
-
"identity.evaluatePolicy"
|
|
1525
|
-
),
|
|
1163
|
+
body: input,
|
|
1526
1164
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1527
1165
|
});
|
|
1528
1166
|
},
|
|
1529
|
-
async recordPolicyDecision(input, idempotencyKey) {
|
|
1530
|
-
cleanRequiredString(input.tenantId, "tenantId");
|
|
1531
|
-
cleanRequiredString(input.decision, "decision");
|
|
1532
|
-
return gateway.request({
|
|
1533
|
-
path: "/api/platform/v1/identity/policy/decisions",
|
|
1534
|
-
method: "POST",
|
|
1535
|
-
body: tenantIdentityBody(
|
|
1536
|
-
input,
|
|
1537
|
-
"identity.recordPolicyDecision"
|
|
1538
|
-
),
|
|
1539
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1540
|
-
});
|
|
1541
|
-
}
|
|
1542
|
-
};
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
// src/accessControl.ts
|
|
1546
|
-
var LucernAccessControlError = class extends LucernSdkAuthContextError {
|
|
1547
|
-
policyDecision;
|
|
1548
|
-
constructor(reason, message, policyDecision) {
|
|
1549
|
-
super(reason, message);
|
|
1550
|
-
this.name = "LucernAccessControlError";
|
|
1551
|
-
this.policyDecision = policyDecision;
|
|
1552
|
-
}
|
|
1553
|
-
};
|
|
1554
|
-
function cleanString4(value) {
|
|
1555
|
-
const normalized = value?.trim();
|
|
1556
|
-
return normalized ? normalized : void 0;
|
|
1557
|
-
}
|
|
1558
|
-
function cleanStringList2(values) {
|
|
1559
|
-
if (!values) {
|
|
1560
|
-
return [];
|
|
1561
|
-
}
|
|
1562
|
-
return [
|
|
1563
|
-
...new Set(
|
|
1564
|
-
values.map((value) => value.trim()).filter((value) => value.length > 0)
|
|
1565
|
-
)
|
|
1566
|
-
];
|
|
1567
|
-
}
|
|
1568
|
-
function requireString2(value, reason, label) {
|
|
1569
|
-
const normalized = cleanString4(value);
|
|
1570
|
-
if (!normalized) {
|
|
1571
|
-
throw new LucernAccessControlError(
|
|
1572
|
-
reason,
|
|
1573
|
-
`Lucern SDK access control requires ${label}.`
|
|
1574
|
-
);
|
|
1575
|
-
}
|
|
1576
|
-
return normalized;
|
|
1577
|
-
}
|
|
1578
|
-
function normalizePrincipalType(principalType2) {
|
|
1579
|
-
if (principalType2 === "agent") {
|
|
1580
|
-
return "agent";
|
|
1581
|
-
}
|
|
1582
|
-
if (principalType2 === "service") {
|
|
1583
|
-
return "service";
|
|
1584
|
-
}
|
|
1585
|
-
if (principalType2 === "group") {
|
|
1586
|
-
return "group";
|
|
1587
|
-
}
|
|
1588
|
-
if (principalType2 === "external_viewer") {
|
|
1589
|
-
return "external_viewer";
|
|
1590
|
-
}
|
|
1591
|
-
return "human";
|
|
1592
|
-
}
|
|
1593
|
-
function aliasKey(alias) {
|
|
1594
|
-
return `${alias.provider}:${alias.providerProjectId ?? ""}:${alias.externalSubjectId}`;
|
|
1595
|
-
}
|
|
1596
|
-
function normalizeAliases(input, canonicalClerkUserId) {
|
|
1597
|
-
const aliases = /* @__PURE__ */ new Map();
|
|
1598
|
-
for (const alias of input ?? []) {
|
|
1599
|
-
const externalSubjectId = cleanString4(alias.externalSubjectId);
|
|
1600
|
-
if (!externalSubjectId) {
|
|
1601
|
-
continue;
|
|
1602
|
-
}
|
|
1603
|
-
const normalized = {
|
|
1604
|
-
provider: cleanString4(alias.provider) ?? "clerk",
|
|
1605
|
-
providerProjectId: cleanString4(alias.providerProjectId),
|
|
1606
|
-
externalSubjectId,
|
|
1607
|
-
status: cleanString4(alias.status)
|
|
1608
|
-
};
|
|
1609
|
-
aliases.set(aliasKey(normalized), normalized);
|
|
1610
|
-
}
|
|
1611
|
-
if (canonicalClerkUserId) {
|
|
1612
|
-
const canonicalAlias = {
|
|
1613
|
-
provider: "clerk",
|
|
1614
|
-
externalSubjectId: canonicalClerkUserId,
|
|
1615
|
-
status: "active"
|
|
1616
|
-
};
|
|
1617
|
-
aliases.set(aliasKey(canonicalAlias), canonicalAlias);
|
|
1618
|
-
}
|
|
1619
|
-
return [...aliases.values()];
|
|
1620
|
-
}
|
|
1621
|
-
function isKnownClerkSubject(args) {
|
|
1622
|
-
if (args.clerkId === args.canonicalClerkUserId) {
|
|
1623
|
-
return true;
|
|
1624
|
-
}
|
|
1625
|
-
return args.aliases.some(
|
|
1626
|
-
(alias) => alias.provider === "clerk" && alias.externalSubjectId === args.clerkId
|
|
1627
|
-
);
|
|
1628
|
-
}
|
|
1629
|
-
function authContextToPrincipalInput(input) {
|
|
1630
|
-
const normalized = normalizeCanonicalLucernAuthContext(input);
|
|
1631
|
-
return {
|
|
1632
|
-
principalId: normalized.principalId,
|
|
1633
|
-
principalType: normalized.principalType,
|
|
1634
|
-
canonicalClerkUserId: normalized.clerkId,
|
|
1635
|
-
clerkId: normalized.clerkId,
|
|
1636
|
-
tenantId: normalized.tenantId,
|
|
1637
|
-
workspaceId: normalized.workspaceId,
|
|
1638
|
-
roles: normalized.roles,
|
|
1639
|
-
scopes: normalized.scopes
|
|
1640
|
-
};
|
|
1641
|
-
}
|
|
1642
|
-
function isAuthContextInput(input) {
|
|
1643
|
-
return "authMode" in input || "permit" in input || "delegationChain" in input;
|
|
1644
|
-
}
|
|
1645
|
-
function normalizeCanonicalPrincipalIdentity(input, options = {}) {
|
|
1646
|
-
const principalInput = isAuthContextInput(input) ? authContextToPrincipalInput(input) : input;
|
|
1647
|
-
const principalId = requireString2(
|
|
1648
|
-
principalInput.principalId,
|
|
1649
|
-
"principal_missing",
|
|
1650
|
-
"principalId"
|
|
1651
|
-
);
|
|
1652
|
-
const principalType2 = normalizePrincipalType(principalInput.principalType);
|
|
1653
|
-
const observedClerkId = cleanString4(options.observedClerkId);
|
|
1654
|
-
const canonicalClerkUserId = cleanString4(principalInput.canonicalClerkUserId) ?? cleanString4(principalInput.clerkId);
|
|
1655
|
-
if (principalType2 === "human" && !canonicalClerkUserId) {
|
|
1656
|
-
throw new LucernAccessControlError(
|
|
1657
|
-
"clerk_alias_missing",
|
|
1658
|
-
"Human principals require one canonical Clerk user id."
|
|
1659
|
-
);
|
|
1660
|
-
}
|
|
1661
|
-
const aliases = normalizeAliases(
|
|
1662
|
-
principalInput.clerkIdentityAliases,
|
|
1663
|
-
canonicalClerkUserId
|
|
1664
|
-
);
|
|
1665
|
-
if (observedClerkId && !isKnownClerkSubject({
|
|
1666
|
-
clerkId: observedClerkId,
|
|
1667
|
-
canonicalClerkUserId,
|
|
1668
|
-
aliases
|
|
1669
|
-
})) {
|
|
1670
|
-
throw new LucernAccessControlError(
|
|
1671
|
-
"clerk_alias_unrecognized",
|
|
1672
|
-
"Observed Clerk user id does not match the canonical human principal id."
|
|
1673
|
-
);
|
|
1674
|
-
}
|
|
1675
|
-
return {
|
|
1676
|
-
principalId,
|
|
1677
|
-
principalType: principalType2,
|
|
1678
|
-
canonicalClerkUserId,
|
|
1679
|
-
clerkIdentityAliases: aliases,
|
|
1680
|
-
tenantId: cleanString4(principalInput.tenantId),
|
|
1681
|
-
workspaceId: cleanString4(principalInput.workspaceId),
|
|
1682
|
-
roles: cleanStringList2(principalInput.roles),
|
|
1683
|
-
scopes: cleanStringList2(principalInput.scopes)
|
|
1684
|
-
};
|
|
1685
|
-
}
|
|
1686
|
-
function formatPermitResource(resource) {
|
|
1687
|
-
if (typeof resource === "string") {
|
|
1688
|
-
return requireString2(resource, "policy_denied", "policyResource");
|
|
1689
|
-
}
|
|
1690
|
-
const type = requireString2(resource.type, "policy_denied", "resource.type");
|
|
1691
|
-
const key = requireString2(resource.key, "policy_denied", "resource.key");
|
|
1692
|
-
return key.startsWith(`${type}:`) ? key : `${type}:${key}`;
|
|
1693
|
-
}
|
|
1694
|
-
function resourceRequiresWorkspace(resource) {
|
|
1695
|
-
if (typeof resource === "string") {
|
|
1696
|
-
return !resource.startsWith("tenant:");
|
|
1697
|
-
}
|
|
1698
|
-
return resource.type !== "tenant";
|
|
1699
|
-
}
|
|
1700
|
-
function buildPolicyInput(identity, input) {
|
|
1701
|
-
const tenantId = requireString2(
|
|
1702
|
-
input.tenantId ?? identity.tenantId,
|
|
1703
|
-
"tenant_missing",
|
|
1704
|
-
"tenantId"
|
|
1705
|
-
);
|
|
1706
|
-
const workspaceId = cleanString4(input.workspaceId ?? identity.workspaceId);
|
|
1707
|
-
if (resourceRequiresWorkspace(input.resource) && !workspaceId) {
|
|
1708
|
-
throw new LucernAccessControlError(
|
|
1709
|
-
"workspace_missing",
|
|
1710
|
-
"Workspace-scoped Permit checks require workspaceId."
|
|
1711
|
-
);
|
|
1712
|
-
}
|
|
1713
|
-
return {
|
|
1714
|
-
tenantId,
|
|
1715
|
-
workspaceId,
|
|
1716
|
-
principalId: identity.principalId,
|
|
1717
|
-
policySubject: identity.principalId,
|
|
1718
|
-
policyAction: requireString2(input.action, "policy_denied", "policyAction"),
|
|
1719
|
-
policyResource: formatPermitResource(input.resource),
|
|
1720
|
-
metadata: input.context
|
|
1721
|
-
};
|
|
1722
|
-
}
|
|
1723
|
-
async function resolveConfiguredPrincipalInput(authContext) {
|
|
1724
|
-
if (typeof authContext === "function") {
|
|
1725
|
-
return await authContext();
|
|
1726
|
-
}
|
|
1727
|
-
return authContext;
|
|
1728
|
-
}
|
|
1729
|
-
function assertPermitAllowed(decision) {
|
|
1730
|
-
if (decision.decision !== "allow") {
|
|
1731
|
-
throw new LucernAccessControlError(
|
|
1732
|
-
decision.decision === "deny" ? "policy_denied" : "policy_unknown",
|
|
1733
|
-
`Permit denied ${decision.policyAction} on ${decision.policyResource}.`,
|
|
1734
|
-
decision
|
|
1735
|
-
);
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
function createAccessControlClient(config = {}) {
|
|
1739
|
-
const identityClient = createIdentityClient(config);
|
|
1740
|
-
async function resolveIdentity(input, observedClerkId) {
|
|
1741
|
-
const identityInput = input ?? await resolveConfiguredPrincipalInput(config.authContext);
|
|
1742
|
-
if (!identityInput) {
|
|
1743
|
-
throw new LucernAccessControlError(
|
|
1744
|
-
"principal_missing",
|
|
1745
|
-
"Lucern SDK access control requires a canonical principal identity."
|
|
1746
|
-
);
|
|
1747
|
-
}
|
|
1748
|
-
return normalizeCanonicalPrincipalIdentity(identityInput, {
|
|
1749
|
-
observedClerkId
|
|
1750
|
-
});
|
|
1751
|
-
}
|
|
1752
|
-
async function checkAccess(input, idempotencyKey) {
|
|
1753
|
-
const identity = await resolveIdentity(input.identity, input.observedClerkId);
|
|
1754
|
-
const policyInput = buildPolicyInput(identity, input);
|
|
1755
|
-
try {
|
|
1756
|
-
const response = await identityClient.evaluatePolicy(
|
|
1757
|
-
policyInput,
|
|
1758
|
-
idempotencyKey
|
|
1759
|
-
);
|
|
1760
|
-
return {
|
|
1761
|
-
identity,
|
|
1762
|
-
policyInput,
|
|
1763
|
-
decision: response.data
|
|
1764
|
-
};
|
|
1765
|
-
} catch (error) {
|
|
1766
|
-
if (error instanceof LucernSdkAuthContextError) {
|
|
1767
|
-
throw error;
|
|
1768
|
-
}
|
|
1769
|
-
throw new LucernAccessControlError(
|
|
1770
|
-
"policy_unavailable",
|
|
1771
|
-
"Permit policy check failed closed before an allow decision was returned."
|
|
1772
|
-
);
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
async function requireAccess(input, idempotencyKey) {
|
|
1776
|
-
const result = await checkAccess(input, idempotencyKey);
|
|
1777
|
-
assertPermitAllowed(result.decision);
|
|
1778
|
-
return result;
|
|
1779
|
-
}
|
|
1780
|
-
async function canAccess(input, idempotencyKey) {
|
|
1781
|
-
try {
|
|
1782
|
-
await requireAccess(input, idempotencyKey);
|
|
1783
|
-
return true;
|
|
1784
|
-
} catch {
|
|
1785
|
-
return false;
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
return {
|
|
1789
|
-
normalizePrincipal: normalizeCanonicalPrincipalIdentity,
|
|
1790
|
-
checkAccess,
|
|
1791
|
-
requireAccess,
|
|
1792
|
-
canAccess
|
|
1793
|
-
};
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
// src/answersClient.ts
|
|
1797
|
-
function createAnswersClient(config = {}) {
|
|
1798
|
-
const gateway = createGatewayRequestClient(config);
|
|
1799
|
-
return {
|
|
1800
|
-
/**
|
|
1801
|
-
* Get the current answer for a question.
|
|
1802
|
-
* @param questionId - The question node identifier.
|
|
1803
|
-
* @returns The answer record for the given question.
|
|
1804
|
-
*/
|
|
1805
|
-
async get(questionId) {
|
|
1806
|
-
return gateway.request({
|
|
1807
|
-
path: `/api/platform/v1/questions/${encodeURIComponent(questionId)}/answer`
|
|
1808
|
-
});
|
|
1809
|
-
}
|
|
1810
|
-
};
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
// src/audiencesClient.ts
|
|
1814
|
-
function createAudiencesClient(config = {}) {
|
|
1815
|
-
const gateway = createGatewayRequestClient(config);
|
|
1816
|
-
const listRegistry = async (query5 = {}) => {
|
|
1817
|
-
return gateway.request({
|
|
1818
|
-
path: `/api/platform/v1/audiences/registry${toQueryString({
|
|
1819
|
-
...query5,
|
|
1820
|
-
effective: typeof query5.effective === "boolean" ? query5.effective ? "true" : "false" : void 0,
|
|
1821
|
-
status: query5.status
|
|
1822
|
-
})}`
|
|
1823
|
-
}).then(
|
|
1824
|
-
(response) => mapGatewayData(
|
|
1825
|
-
response,
|
|
1826
|
-
(data) => createListResult(Array.isArray(data) ? data : [], "registryEntries")
|
|
1827
|
-
)
|
|
1828
|
-
);
|
|
1829
|
-
};
|
|
1830
|
-
const createRegistryEntry = async (input, idempotencyKey) => {
|
|
1831
|
-
return gateway.request({
|
|
1832
|
-
path: "/api/platform/v1/audiences/registry",
|
|
1833
|
-
method: "POST",
|
|
1834
|
-
body: input,
|
|
1835
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1836
|
-
});
|
|
1837
|
-
};
|
|
1838
|
-
const updateRegistryEntry = createRegistryEntry;
|
|
1839
|
-
const upsertRegistry = createRegistryEntry;
|
|
1840
|
-
const getRegistry = listRegistry;
|
|
1841
|
-
const listGrants = async (query5 = {}) => {
|
|
1842
|
-
return gateway.request({
|
|
1843
|
-
path: `/api/platform/v1/audiences/grants${toQueryString({
|
|
1844
|
-
...query5,
|
|
1845
|
-
audienceKey: query5.audienceKey,
|
|
1846
|
-
principalId: query5.principalId,
|
|
1847
|
-
groupId: query5.groupId,
|
|
1848
|
-
status: query5.status
|
|
1849
|
-
})}`
|
|
1850
|
-
}).then(
|
|
1851
|
-
(response) => mapGatewayData(
|
|
1852
|
-
response,
|
|
1853
|
-
(data) => createListResult(Array.isArray(data) ? data : [], "grants")
|
|
1854
|
-
)
|
|
1855
|
-
);
|
|
1856
|
-
};
|
|
1857
|
-
const createGrant = async (input, idempotencyKey) => {
|
|
1858
|
-
return gateway.request({
|
|
1859
|
-
path: "/api/platform/v1/audiences/grants",
|
|
1860
|
-
method: "POST",
|
|
1861
|
-
body: input,
|
|
1862
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1863
|
-
});
|
|
1864
|
-
};
|
|
1865
|
-
const getGrants = listGrants;
|
|
1866
|
-
const grant = createGrant;
|
|
1867
|
-
const deleteGrant = async (input, idempotencyKey) => {
|
|
1868
|
-
return gateway.request({
|
|
1869
|
-
path: "/api/platform/v1/audiences/grants/revoke",
|
|
1870
|
-
method: "POST",
|
|
1871
|
-
body: input,
|
|
1872
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
1873
|
-
});
|
|
1874
|
-
};
|
|
1875
|
-
const revokeGrant = deleteGrant;
|
|
1876
|
-
return {
|
|
1877
|
-
/**
|
|
1878
|
-
* List audience registry entries.
|
|
1879
|
-
*/
|
|
1880
|
-
listRegistry,
|
|
1881
|
-
/**
|
|
1882
|
-
* @deprecated Use listRegistry.
|
|
1883
|
-
*/
|
|
1884
|
-
getRegistry,
|
|
1885
|
-
/**
|
|
1886
|
-
* Create an audience registry entry.
|
|
1887
|
-
*/
|
|
1888
|
-
createRegistryEntry,
|
|
1889
|
-
/**
|
|
1890
|
-
* Update an audience registry entry.
|
|
1891
|
-
*/
|
|
1892
|
-
updateRegistryEntry,
|
|
1893
|
-
/**
|
|
1894
|
-
* @deprecated Use createRegistryEntry or updateRegistryEntry.
|
|
1895
|
-
*/
|
|
1896
|
-
upsertRegistry,
|
|
1897
|
-
/**
|
|
1898
|
-
* List audience grants.
|
|
1899
|
-
*/
|
|
1900
|
-
listGrants,
|
|
1901
|
-
/**
|
|
1902
|
-
* @deprecated Use listGrants.
|
|
1903
|
-
*/
|
|
1904
|
-
getGrants,
|
|
1905
|
-
/**
|
|
1906
|
-
* Create an audience grant.
|
|
1907
|
-
*/
|
|
1908
|
-
createGrant,
|
|
1909
|
-
/**
|
|
1910
|
-
* @deprecated Use createGrant.
|
|
1911
|
-
*/
|
|
1912
|
-
grant,
|
|
1913
|
-
/**
|
|
1914
|
-
* Delete an audience grant by revoking it.
|
|
1915
|
-
*/
|
|
1916
|
-
deleteGrant,
|
|
1917
1167
|
/**
|
|
1918
1168
|
* @deprecated Use deleteGrant.
|
|
1919
1169
|
*/
|
|
1920
|
-
revokeGrant
|
|
1170
|
+
async revokeGrant(input, idempotencyKey) {
|
|
1171
|
+
return this.deleteGrant(input, idempotencyKey);
|
|
1172
|
+
}
|
|
1921
1173
|
};
|
|
1922
1174
|
}
|
|
1923
1175
|
|
|
@@ -1958,18 +1210,8 @@ function authBaseUrl(config) {
|
|
|
1958
1210
|
return config.baseUrl?.replace(/\/+$/, "") ?? "";
|
|
1959
1211
|
}
|
|
1960
1212
|
async function readJson(response) {
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
return isRecord4(payload) ? payload : {};
|
|
1964
|
-
} catch (error) {
|
|
1965
|
-
return unreadableJsonBodyFallback();
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
function unreadableJsonBodyFallback(_error) {
|
|
1969
|
-
return {};
|
|
1970
|
-
}
|
|
1971
|
-
function isRecord4(value) {
|
|
1972
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1213
|
+
const payload = await response.json().catch(() => ({}));
|
|
1214
|
+
return payload && typeof payload === "object" && !Array.isArray(payload) ? payload : {};
|
|
1973
1215
|
}
|
|
1974
1216
|
function readString(value) {
|
|
1975
1217
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
@@ -2011,10 +1253,7 @@ function assertDeviceTokenResponse(payload) {
|
|
|
2011
1253
|
tenant_id: tenantId,
|
|
2012
1254
|
workspace_id: readString(payload.workspace_id),
|
|
2013
1255
|
principal_id: principalId,
|
|
2014
|
-
user:
|
|
2015
|
-
id: payload.user.id,
|
|
2016
|
-
principalId: payload.user.principalId
|
|
2017
|
-
} : void 0
|
|
1256
|
+
user: payload.user && typeof payload.user === "object" && !Array.isArray(payload.user) ? payload.user : void 0
|
|
2018
1257
|
};
|
|
2019
1258
|
}
|
|
2020
1259
|
function maybeThrowDeviceError(payload) {
|
|
@@ -2162,12 +1401,12 @@ function createBeliefsClient(config = {}) {
|
|
|
2162
1401
|
body: normalizeModulateConfidenceInput(input),
|
|
2163
1402
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2164
1403
|
});
|
|
2165
|
-
|
|
1404
|
+
async function getOpinionHistory(beliefId) {
|
|
2166
1405
|
const response = await gateway.request({
|
|
2167
1406
|
path: `/api/platform/v1/beliefs/${encodeURIComponent(beliefId)}/confidence-history`
|
|
2168
1407
|
});
|
|
2169
1408
|
return mapOpinionHistoryEntriesFromGatewayData(response.data);
|
|
2170
|
-
}
|
|
1409
|
+
}
|
|
2171
1410
|
return {
|
|
2172
1411
|
/**
|
|
2173
1412
|
* Create a belief within a topic scope.
|
|
@@ -2212,9 +1451,13 @@ function createBeliefsClient(config = {}) {
|
|
|
2212
1451
|
* trigger = cause of the score change
|
|
2213
1452
|
* triggeringRef = optional pointer to the evidence or worktree that drove the change
|
|
2214
1453
|
*/
|
|
2215
|
-
getOpinionHistory
|
|
1454
|
+
async getOpinionHistory(beliefId) {
|
|
1455
|
+
return getOpinionHistory(beliefId);
|
|
1456
|
+
},
|
|
2216
1457
|
/** @deprecated Use getOpinionHistory(). */
|
|
2217
|
-
getConfidenceHistory
|
|
1458
|
+
async getConfidenceHistory(beliefId) {
|
|
1459
|
+
return getOpinionHistory(beliefId);
|
|
1460
|
+
},
|
|
2218
1461
|
/**
|
|
2219
1462
|
* Fork a scored belief into a new formulation.
|
|
2220
1463
|
*/
|
|
@@ -2357,6 +1600,57 @@ function createEvidenceClient(config = {}) {
|
|
|
2357
1600
|
};
|
|
2358
1601
|
}
|
|
2359
1602
|
|
|
1603
|
+
// src/boundaryClientSurface.ts
|
|
1604
|
+
function cleanOptionalString(value) {
|
|
1605
|
+
const normalized = value?.trim();
|
|
1606
|
+
return normalized ? normalized : void 0;
|
|
1607
|
+
}
|
|
1608
|
+
function cleanRequiredString(value, label) {
|
|
1609
|
+
const normalized = cleanOptionalString(value);
|
|
1610
|
+
if (!normalized) {
|
|
1611
|
+
throw new Error(`${label} is required`);
|
|
1612
|
+
}
|
|
1613
|
+
return normalized;
|
|
1614
|
+
}
|
|
1615
|
+
function readTopicId(input) {
|
|
1616
|
+
return cleanOptionalString(input.topicId) ?? cleanOptionalString(input.projectId);
|
|
1617
|
+
}
|
|
1618
|
+
function requireTopicId(input) {
|
|
1619
|
+
const topicId = readTopicId(input);
|
|
1620
|
+
if (!topicId) {
|
|
1621
|
+
throw new Error("topicId is required");
|
|
1622
|
+
}
|
|
1623
|
+
return topicId;
|
|
1624
|
+
}
|
|
1625
|
+
function assertKnownKeys(input, allowed, operation) {
|
|
1626
|
+
const allowedSet = new Set(allowed);
|
|
1627
|
+
const unknownKeys = Object.keys(input).filter((key) => !allowedSet.has(key));
|
|
1628
|
+
if (unknownKeys.length > 0) {
|
|
1629
|
+
throw new Error(
|
|
1630
|
+
`${operation} received unsupported field(s): ${unknownKeys.join(", ")}`
|
|
1631
|
+
);
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
function knownPayload(input, allowed, operation) {
|
|
1635
|
+
assertKnownKeys(input, allowed, operation);
|
|
1636
|
+
return { ...input };
|
|
1637
|
+
}
|
|
1638
|
+
function topicPayload(input, allowed, operation) {
|
|
1639
|
+
assertKnownKeys(input, allowed, operation);
|
|
1640
|
+
return {
|
|
1641
|
+
...input,
|
|
1642
|
+
topicId: requireTopicId(input),
|
|
1643
|
+
projectId: void 0
|
|
1644
|
+
};
|
|
1645
|
+
}
|
|
1646
|
+
function listResultFromEnvelope(data, legacyKey) {
|
|
1647
|
+
const record = data && typeof data === "object" ? data : {};
|
|
1648
|
+
return createListResult(
|
|
1649
|
+
Array.isArray(record[legacyKey]) ? record[legacyKey] : Array.isArray(data) ? data : [],
|
|
1650
|
+
legacyKey
|
|
1651
|
+
);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
2360
1654
|
// src/eventingClient.ts
|
|
2361
1655
|
var EVENTING_FIELDS = [
|
|
2362
1656
|
"tenantId",
|
|
@@ -2724,391 +2018,693 @@ async function invokeRegisteredCustomTool(fullName, params, context) {
|
|
|
2724
2018
|
// src/ontologyClient.ts
|
|
2725
2019
|
function createOntologyClient(config = {}) {
|
|
2726
2020
|
const gateway = createGatewayRequestClient(config);
|
|
2727
|
-
|
|
2021
|
+
return {
|
|
2022
|
+
/**
|
|
2023
|
+
* List ontology definitions matching optional filters.
|
|
2024
|
+
*/
|
|
2025
|
+
async list(filters = {}) {
|
|
2026
|
+
return gateway.request({
|
|
2027
|
+
path: `/api/platform/v1/ontologies${toQueryString(filters)}`
|
|
2028
|
+
}).then(
|
|
2029
|
+
(response) => mapGatewayData(response, (data) => {
|
|
2030
|
+
const record = data && typeof data === "object" && !Array.isArray(data) ? data : {};
|
|
2031
|
+
const ontologies = Array.isArray(record.ontologies) ? record.ontologies : Array.isArray(record.definitions) ? record.definitions : Array.isArray(data) ? data : [];
|
|
2032
|
+
const total = typeof record.total === "number" && Number.isFinite(record.total) ? record.total : ontologies.length;
|
|
2033
|
+
return {
|
|
2034
|
+
...record,
|
|
2035
|
+
...createListResult(ontologies, "definitions"),
|
|
2036
|
+
ontologies,
|
|
2037
|
+
total
|
|
2038
|
+
};
|
|
2039
|
+
})
|
|
2040
|
+
);
|
|
2041
|
+
},
|
|
2042
|
+
/**
|
|
2043
|
+
* Get an ontology definition by identifier.
|
|
2044
|
+
*/
|
|
2045
|
+
async get(id) {
|
|
2046
|
+
return gateway.request({
|
|
2047
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`
|
|
2048
|
+
});
|
|
2049
|
+
},
|
|
2050
|
+
/**
|
|
2051
|
+
* Bind an ontology definition to a topic.
|
|
2052
|
+
*/
|
|
2053
|
+
async bind(input, idempotencyKey) {
|
|
2054
|
+
return gateway.request({
|
|
2055
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(input.ontologyId)}/bind`,
|
|
2056
|
+
method: "POST",
|
|
2057
|
+
body: {
|
|
2058
|
+
topicId: input.topicId
|
|
2059
|
+
},
|
|
2060
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2061
|
+
});
|
|
2062
|
+
},
|
|
2063
|
+
/**
|
|
2064
|
+
* List ontology definitions.
|
|
2065
|
+
*/
|
|
2066
|
+
async listDefinitions(filters = {}) {
|
|
2067
|
+
return this.list(filters);
|
|
2068
|
+
},
|
|
2069
|
+
/**
|
|
2070
|
+
* Get an ontology definition.
|
|
2071
|
+
*/
|
|
2072
|
+
async getDefinition(id) {
|
|
2073
|
+
return this.get(id);
|
|
2074
|
+
},
|
|
2075
|
+
/**
|
|
2076
|
+
* Create an ontology definition.
|
|
2077
|
+
*/
|
|
2078
|
+
async createDefinition(input, idempotencyKey) {
|
|
2079
|
+
return gateway.request({
|
|
2080
|
+
path: "/api/platform/v1/ontologies",
|
|
2081
|
+
method: "POST",
|
|
2082
|
+
body: input,
|
|
2083
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2084
|
+
});
|
|
2085
|
+
},
|
|
2086
|
+
/**
|
|
2087
|
+
* Update an ontology definition.
|
|
2088
|
+
*/
|
|
2089
|
+
async updateDefinition(id, input, idempotencyKey) {
|
|
2090
|
+
return gateway.request({
|
|
2091
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
|
|
2092
|
+
method: "PATCH",
|
|
2093
|
+
body: input,
|
|
2094
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2095
|
+
});
|
|
2096
|
+
},
|
|
2097
|
+
/**
|
|
2098
|
+
* Archive an ontology definition.
|
|
2099
|
+
*/
|
|
2100
|
+
async archiveDefinition(id, idempotencyKey) {
|
|
2101
|
+
return gateway.request({
|
|
2102
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`,
|
|
2103
|
+
method: "DELETE",
|
|
2104
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2105
|
+
});
|
|
2106
|
+
},
|
|
2107
|
+
/**
|
|
2108
|
+
* List versions for an ontology definition.
|
|
2109
|
+
*/
|
|
2110
|
+
async listVersions(ontologyId, filters = {}) {
|
|
2111
|
+
return gateway.request({
|
|
2112
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions${toQueryString(filters)}`
|
|
2113
|
+
}).then(
|
|
2114
|
+
(response) => mapGatewayData(
|
|
2115
|
+
response,
|
|
2116
|
+
(data) => createListResult(Array.isArray(data) ? data : [], "versions")
|
|
2117
|
+
)
|
|
2118
|
+
);
|
|
2119
|
+
},
|
|
2120
|
+
/**
|
|
2121
|
+
* Create an ontology version.
|
|
2122
|
+
*/
|
|
2123
|
+
async createVersion(ontologyId, input, idempotencyKey) {
|
|
2124
|
+
return gateway.request({
|
|
2125
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions`,
|
|
2126
|
+
method: "POST",
|
|
2127
|
+
body: input,
|
|
2128
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2129
|
+
});
|
|
2130
|
+
},
|
|
2131
|
+
/**
|
|
2132
|
+
* Publish an ontology version.
|
|
2133
|
+
*/
|
|
2134
|
+
async publishVersion(ontologyId, versionId, idempotencyKey) {
|
|
2135
|
+
return gateway.request({
|
|
2136
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions/${encodeURIComponent(versionId)}/publish`,
|
|
2137
|
+
method: "POST",
|
|
2138
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2139
|
+
});
|
|
2140
|
+
},
|
|
2141
|
+
/**
|
|
2142
|
+
* Deprecate an ontology version.
|
|
2143
|
+
*/
|
|
2144
|
+
async deprecateVersion(ontologyId, versionId, idempotencyKey) {
|
|
2145
|
+
return gateway.request({
|
|
2146
|
+
path: `/api/platform/v1/ontologies/${encodeURIComponent(ontologyId)}/versions/${encodeURIComponent(versionId)}/deprecate`,
|
|
2147
|
+
method: "POST",
|
|
2148
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2149
|
+
});
|
|
2150
|
+
},
|
|
2151
|
+
/**
|
|
2152
|
+
* List topics directly bound to a specific ontology definition.
|
|
2153
|
+
* Uses the topics gateway with ontologyId filter.
|
|
2154
|
+
*/
|
|
2155
|
+
async listTopics(ontologyId) {
|
|
2156
|
+
return gateway.request({
|
|
2157
|
+
path: `/api/platform/v1/topics?ontologyId=${encodeURIComponent(ontologyId)}`
|
|
2158
|
+
}).then(
|
|
2159
|
+
(response) => mapGatewayData(
|
|
2160
|
+
response,
|
|
2161
|
+
(data) => createListResult(Array.isArray(data) ? data : [], "topics")
|
|
2162
|
+
)
|
|
2163
|
+
);
|
|
2164
|
+
},
|
|
2165
|
+
/**
|
|
2166
|
+
* @deprecated Use listTopics.
|
|
2167
|
+
*/
|
|
2168
|
+
async listTopicsByOntology(ontologyId) {
|
|
2169
|
+
return this.listTopics(ontologyId);
|
|
2170
|
+
}
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
// src/graphClient.ts
|
|
2175
|
+
function createGraphClient(config = {}) {
|
|
2176
|
+
const gateway = createGatewayRequestClient(config);
|
|
2177
|
+
return {
|
|
2178
|
+
/**
|
|
2179
|
+
* List graph nodes matching the provided filters.
|
|
2180
|
+
*/
|
|
2181
|
+
async listNodes(query5) {
|
|
2182
|
+
return gateway.request({
|
|
2183
|
+
path: `/api/platform/v1/graph/nodes${toQueryString(
|
|
2184
|
+
normalizeTopicQuery(query5)
|
|
2185
|
+
)}`
|
|
2186
|
+
}).then(
|
|
2187
|
+
(response) => mapGatewayData(response, (data) => mapAliasedList(data, "nodes"))
|
|
2188
|
+
);
|
|
2189
|
+
},
|
|
2190
|
+
/**
|
|
2191
|
+
* @deprecated Use listNodes.
|
|
2192
|
+
*/
|
|
2193
|
+
async queryNodes(query5) {
|
|
2194
|
+
return this.listNodes(query5);
|
|
2195
|
+
},
|
|
2196
|
+
/**
|
|
2197
|
+
* Retrieve a single graph node by nodeId or globalId.
|
|
2198
|
+
*/
|
|
2199
|
+
async getNode(query5) {
|
|
2200
|
+
return gateway.request({
|
|
2201
|
+
path: `/api/platform/v1/graph/nodes${toQueryString(query5)}`
|
|
2202
|
+
}).then(
|
|
2203
|
+
(response) => mapGatewayData(
|
|
2204
|
+
response,
|
|
2205
|
+
(data) => withSdkAliases(data)
|
|
2206
|
+
)
|
|
2207
|
+
);
|
|
2208
|
+
},
|
|
2209
|
+
/**
|
|
2210
|
+
* Create a graph node.
|
|
2211
|
+
*/
|
|
2212
|
+
async createNode(input, idempotencyKey) {
|
|
2213
|
+
return gateway.request({
|
|
2214
|
+
path: "/api/platform/v1/graph/nodes",
|
|
2215
|
+
method: "POST",
|
|
2216
|
+
body: normalizeNodeWriteInput(input),
|
|
2217
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2218
|
+
}).then(
|
|
2219
|
+
(response) => mapGatewayData(
|
|
2220
|
+
response,
|
|
2221
|
+
(data) => withSdkAliases(data)
|
|
2222
|
+
)
|
|
2223
|
+
);
|
|
2224
|
+
},
|
|
2225
|
+
/**
|
|
2226
|
+
* Update a graph node.
|
|
2227
|
+
*/
|
|
2228
|
+
async updateNode(input, idempotencyKey) {
|
|
2229
|
+
return gateway.request({
|
|
2230
|
+
path: "/api/platform/v1/graph/nodes",
|
|
2231
|
+
method: "PUT",
|
|
2232
|
+
body: normalizeNodeWriteInput(input),
|
|
2233
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2234
|
+
}).then(
|
|
2235
|
+
(response) => mapGatewayData(
|
|
2236
|
+
response,
|
|
2237
|
+
(data) => withSdkAliases(data)
|
|
2238
|
+
)
|
|
2239
|
+
);
|
|
2240
|
+
},
|
|
2241
|
+
/**
|
|
2242
|
+
* Batch create graph nodes through the admin route surface.
|
|
2243
|
+
*/
|
|
2244
|
+
async batchCreateNodes(input, idempotencyKey) {
|
|
2245
|
+
return gateway.request({
|
|
2246
|
+
path: "/api/platform/v1/graph/nodes/batch",
|
|
2247
|
+
method: "POST",
|
|
2248
|
+
body: {
|
|
2249
|
+
nodes: input.nodes.map((node) => normalizeNodeWriteInput(node))
|
|
2250
|
+
},
|
|
2251
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2252
|
+
});
|
|
2253
|
+
},
|
|
2254
|
+
/**
|
|
2255
|
+
* Supersede an existing graph node with a new canonical version.
|
|
2256
|
+
*/
|
|
2257
|
+
async supersedeNode(input, idempotencyKey) {
|
|
2258
|
+
return gateway.request({
|
|
2259
|
+
path: "/api/platform/v1/graph/nodes/supersede",
|
|
2260
|
+
method: "POST",
|
|
2261
|
+
body: input,
|
|
2262
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2263
|
+
});
|
|
2264
|
+
},
|
|
2265
|
+
/**
|
|
2266
|
+
* Update a node's verification status.
|
|
2267
|
+
*/
|
|
2268
|
+
async verifyNode(input, idempotencyKey) {
|
|
2269
|
+
const verificationStatus = normalizeNodeVerificationStatus(input.verificationStatus) ?? input.verificationStatus;
|
|
2270
|
+
return gateway.request({
|
|
2271
|
+
path: "/api/platform/v1/graph/nodes/verify",
|
|
2272
|
+
method: "POST",
|
|
2273
|
+
body: {
|
|
2274
|
+
...input,
|
|
2275
|
+
verificationStatus
|
|
2276
|
+
},
|
|
2277
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2278
|
+
});
|
|
2279
|
+
},
|
|
2280
|
+
/**
|
|
2281
|
+
* Permanently delete a node via the admin-only hard-delete route.
|
|
2282
|
+
*/
|
|
2283
|
+
async hardDeleteNode(input, idempotencyKey) {
|
|
2284
|
+
return gateway.request({
|
|
2285
|
+
path: "/api/platform/v1/graph/nodes/hard-delete",
|
|
2286
|
+
method: "POST",
|
|
2287
|
+
body: input,
|
|
2288
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2289
|
+
});
|
|
2290
|
+
},
|
|
2728
2291
|
/**
|
|
2729
|
-
* List
|
|
2292
|
+
* List graph edges matching the provided filters.
|
|
2730
2293
|
*/
|
|
2731
|
-
async
|
|
2294
|
+
async listEdges(query5) {
|
|
2732
2295
|
return gateway.request({
|
|
2733
|
-
path: `/api/platform/v1/
|
|
2296
|
+
path: `/api/platform/v1/graph/edges${toQueryString(
|
|
2297
|
+
normalizeTopicQuery(query5)
|
|
2298
|
+
)}`
|
|
2734
2299
|
}).then(
|
|
2735
|
-
(response) => mapGatewayData(
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
const total = typeof record.total === "number" && Number.isFinite(record.total) ? record.total : definitions.length;
|
|
2740
|
-
return {
|
|
2741
|
-
...record,
|
|
2742
|
-
...createListResult(definitions, "definitions"),
|
|
2743
|
-
ontologies: definitions,
|
|
2744
|
-
total
|
|
2745
|
-
};
|
|
2746
|
-
})
|
|
2300
|
+
(response) => mapGatewayData(
|
|
2301
|
+
response,
|
|
2302
|
+
(data) => mapAliasedList(data, "edges")
|
|
2303
|
+
)
|
|
2747
2304
|
);
|
|
2748
2305
|
},
|
|
2749
2306
|
/**
|
|
2750
|
-
*
|
|
2307
|
+
* @deprecated Use listEdges.
|
|
2751
2308
|
*/
|
|
2752
|
-
async
|
|
2753
|
-
return
|
|
2754
|
-
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`
|
|
2755
|
-
});
|
|
2309
|
+
async queryEdges(query5) {
|
|
2310
|
+
return this.listEdges(query5);
|
|
2756
2311
|
},
|
|
2757
2312
|
/**
|
|
2758
|
-
*
|
|
2313
|
+
* Create a graph edge.
|
|
2759
2314
|
*/
|
|
2760
|
-
async
|
|
2315
|
+
async createEdge(input, idempotencyKey) {
|
|
2761
2316
|
return gateway.request({
|
|
2762
|
-
path:
|
|
2317
|
+
path: "/api/platform/v1/graph/edges",
|
|
2763
2318
|
method: "POST",
|
|
2764
|
-
body:
|
|
2765
|
-
topicId: input.topicId
|
|
2766
|
-
},
|
|
2319
|
+
body: normalizeTopicQuery(input),
|
|
2767
2320
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2768
2321
|
});
|
|
2769
2322
|
},
|
|
2770
2323
|
/**
|
|
2771
|
-
*
|
|
2324
|
+
* Delete one or more edges matching the provided filter.
|
|
2772
2325
|
*/
|
|
2773
|
-
async
|
|
2326
|
+
async deleteEdge(query5, idempotencyKey) {
|
|
2774
2327
|
return gateway.request({
|
|
2775
|
-
path:
|
|
2776
|
-
method: "
|
|
2777
|
-
body: input,
|
|
2328
|
+
path: `/api/platform/v1/graph/edges${toQueryString(query5)}`,
|
|
2329
|
+
method: "DELETE",
|
|
2778
2330
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2779
2331
|
});
|
|
2780
2332
|
},
|
|
2781
2333
|
/**
|
|
2782
|
-
*
|
|
2334
|
+
* Retrieve a graph neighborhood around a root node.
|
|
2783
2335
|
*/
|
|
2784
|
-
async
|
|
2336
|
+
async neighborhood(query5) {
|
|
2785
2337
|
return gateway.request({
|
|
2786
|
-
path: `/api/platform/v1/
|
|
2787
|
-
method: "PATCH",
|
|
2788
|
-
body: input,
|
|
2789
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2338
|
+
path: `/api/platform/v1/graph/neighborhood${toQueryString(query5)}`
|
|
2790
2339
|
});
|
|
2791
2340
|
},
|
|
2792
2341
|
/**
|
|
2793
|
-
*
|
|
2342
|
+
* Traverse the graph from a starting node.
|
|
2794
2343
|
*/
|
|
2795
|
-
async
|
|
2344
|
+
async traverse(query5) {
|
|
2796
2345
|
return gateway.request({
|
|
2797
|
-
path:
|
|
2798
|
-
method: "
|
|
2799
|
-
|
|
2346
|
+
path: "/api/platform/v1/graph/traverse",
|
|
2347
|
+
method: "POST",
|
|
2348
|
+
body: normalizeTopicQuery(query5)
|
|
2800
2349
|
});
|
|
2801
2350
|
},
|
|
2802
2351
|
/**
|
|
2803
|
-
*
|
|
2352
|
+
* Analyze graph structure for a topic.
|
|
2804
2353
|
*/
|
|
2805
|
-
async
|
|
2354
|
+
async analyze(query5 = {}) {
|
|
2355
|
+
const normalized = normalizeTopicQuery(query5);
|
|
2806
2356
|
return gateway.request({
|
|
2807
|
-
path: `/api/platform/v1/
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
);
|
|
2357
|
+
path: `/api/platform/v1/graph/analyze${toQueryString({
|
|
2358
|
+
topicId: typeof normalized.topicId === "string" ? normalized.topicId : void 0,
|
|
2359
|
+
metric: typeof normalized.metric === "string" ? normalized.metric : void 0,
|
|
2360
|
+
limit: typeof normalized.limit === "number" ? normalized.limit : void 0
|
|
2361
|
+
})}`
|
|
2362
|
+
});
|
|
2814
2363
|
},
|
|
2815
2364
|
/**
|
|
2816
|
-
*
|
|
2365
|
+
* Detect confirmation-bias patterns for a topic graph.
|
|
2817
2366
|
*/
|
|
2818
|
-
async
|
|
2367
|
+
async bias(query5 = {}) {
|
|
2368
|
+
const normalized = normalizeTopicQuery(query5);
|
|
2819
2369
|
return gateway.request({
|
|
2820
|
-
path: `/api/platform/v1/
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2370
|
+
path: `/api/platform/v1/graph/bias${toQueryString({
|
|
2371
|
+
topicId: typeof normalized.topicId === "string" ? normalized.topicId : void 0,
|
|
2372
|
+
threshold: typeof normalized.threshold === "number" ? normalized.threshold : void 0,
|
|
2373
|
+
limit: typeof normalized.limit === "number" ? normalized.limit : void 0
|
|
2374
|
+
})}`
|
|
2824
2375
|
});
|
|
2825
2376
|
},
|
|
2826
2377
|
/**
|
|
2827
|
-
*
|
|
2378
|
+
* Find graph gaps for beliefs that still need testing.
|
|
2828
2379
|
*/
|
|
2829
|
-
async
|
|
2380
|
+
async gaps(query5) {
|
|
2381
|
+
const normalized = normalizeTopicQuery(query5);
|
|
2830
2382
|
return gateway.request({
|
|
2831
|
-
path: `/api/platform/v1/
|
|
2832
|
-
|
|
2833
|
-
|
|
2383
|
+
path: `/api/platform/v1/graph/gaps${toQueryString({
|
|
2384
|
+
topicId: typeof normalized.topicId === "string" ? normalized.topicId : void 0,
|
|
2385
|
+
minConfidence: typeof normalized.minConfidence === "number" ? normalized.minConfidence : void 0
|
|
2386
|
+
})}`
|
|
2834
2387
|
});
|
|
2835
2388
|
},
|
|
2836
2389
|
/**
|
|
2837
|
-
*
|
|
2390
|
+
* Search across graph resources within a topic.
|
|
2838
2391
|
*/
|
|
2839
|
-
async
|
|
2392
|
+
async search(query5) {
|
|
2840
2393
|
return gateway.request({
|
|
2841
|
-
path:
|
|
2394
|
+
path: "/api/platform/v1/search",
|
|
2842
2395
|
method: "POST",
|
|
2843
|
-
|
|
2396
|
+
body: normalizeTopicQuery(query5)
|
|
2844
2397
|
});
|
|
2845
2398
|
},
|
|
2846
2399
|
/**
|
|
2847
|
-
*
|
|
2848
|
-
* Uses the topics gateway with ontologyId filter.
|
|
2400
|
+
* Retrieve a graph neighborhood around a root node.
|
|
2849
2401
|
*/
|
|
2850
|
-
async
|
|
2402
|
+
async getNeighborhood(query5) {
|
|
2403
|
+
return this.neighborhood(query5);
|
|
2404
|
+
},
|
|
2405
|
+
/**
|
|
2406
|
+
* Retrieve the shortest known path between two graph nodes.
|
|
2407
|
+
*/
|
|
2408
|
+
async getPath(query5) {
|
|
2851
2409
|
return gateway.request({
|
|
2852
|
-
path: `/api/platform/v1/
|
|
2853
|
-
})
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2410
|
+
path: `/api/platform/v1/graph/path${toQueryString(query5)}`
|
|
2411
|
+
});
|
|
2412
|
+
},
|
|
2413
|
+
/**
|
|
2414
|
+
* Retrieve graph analytics for the requested metric.
|
|
2415
|
+
*/
|
|
2416
|
+
async getAnalytics(query5 = {}) {
|
|
2417
|
+
return gateway.request({
|
|
2418
|
+
path: `/api/platform/v1/graph/analytics${toQueryString(query5)}`
|
|
2419
|
+
});
|
|
2859
2420
|
}
|
|
2860
2421
|
};
|
|
2861
|
-
return Object.assign(client, {
|
|
2862
|
-
listDefinitions: client.list,
|
|
2863
|
-
getDefinition: client.get,
|
|
2864
|
-
listTopicsByOntology: client.listTopics
|
|
2865
|
-
});
|
|
2866
2422
|
}
|
|
2867
2423
|
|
|
2868
|
-
// src/
|
|
2869
|
-
function
|
|
2424
|
+
// src/identityClient.ts
|
|
2425
|
+
function createIdentityWhoamiClient(config = {}) {
|
|
2870
2426
|
const gateway = createGatewayRequestClient(config);
|
|
2871
|
-
|
|
2427
|
+
return {
|
|
2428
|
+
async whoami() {
|
|
2429
|
+
return gateway.request({
|
|
2430
|
+
path: "/api/platform/v1/identity/whoami"
|
|
2431
|
+
});
|
|
2432
|
+
}
|
|
2433
|
+
};
|
|
2434
|
+
}
|
|
2435
|
+
var TENANT_IDENTITY_FIELDS = [
|
|
2436
|
+
"tenantId",
|
|
2437
|
+
"workspaceId",
|
|
2438
|
+
"principalId",
|
|
2439
|
+
"integrationKey",
|
|
2440
|
+
"secretRef",
|
|
2441
|
+
"policySubject",
|
|
2442
|
+
"policyAction",
|
|
2443
|
+
"policyResource",
|
|
2444
|
+
"decision",
|
|
2445
|
+
"config",
|
|
2446
|
+
"configKey",
|
|
2447
|
+
"configValue",
|
|
2448
|
+
"provider",
|
|
2449
|
+
"status",
|
|
2450
|
+
"metadata",
|
|
2451
|
+
"limit",
|
|
2452
|
+
"cursor"
|
|
2453
|
+
];
|
|
2454
|
+
function tenantIdentityQuery(input) {
|
|
2455
|
+
return {
|
|
2456
|
+
tenantId: cleanRequiredString(input.tenantId, "tenantId"),
|
|
2457
|
+
workspaceId: input.workspaceId,
|
|
2458
|
+
principalId: input.principalId,
|
|
2459
|
+
limit: input.limit,
|
|
2460
|
+
cursor: input.cursor
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2463
|
+
function tenantIdentityBody(input, operation) {
|
|
2464
|
+
return knownPayload(input, TENANT_IDENTITY_FIELDS, operation);
|
|
2465
|
+
}
|
|
2466
|
+
function createIdentityClient(config = {}) {
|
|
2467
|
+
const gateway = createGatewayRequestClient(config);
|
|
2468
|
+
const whoamiClient = createIdentityWhoamiClient(config);
|
|
2469
|
+
const requestPrincipalWrite = (method, input, idempotencyKey) => gateway.request({
|
|
2470
|
+
path: "/api/platform/v1/identity/principals",
|
|
2471
|
+
method,
|
|
2472
|
+
body: input,
|
|
2473
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2474
|
+
});
|
|
2475
|
+
return {
|
|
2872
2476
|
/**
|
|
2873
|
-
*
|
|
2477
|
+
* Resolve the current authenticated identity summary.
|
|
2874
2478
|
*/
|
|
2875
|
-
async
|
|
2876
|
-
return
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2479
|
+
async whoami() {
|
|
2480
|
+
return whoamiClient.whoami().then(
|
|
2481
|
+
(response) => mapGatewayData(response, (data) => ({
|
|
2482
|
+
principalId: data.principalId,
|
|
2483
|
+
principalType: data.principalType,
|
|
2484
|
+
tenantId: data.tenantId ?? null,
|
|
2485
|
+
workspaceId: data.workspaceId ?? null,
|
|
2486
|
+
scopes: Array.isArray(data.scopes) ? data.scopes : [],
|
|
2487
|
+
roles: Array.isArray(data.roles) ? data.roles : [],
|
|
2488
|
+
isPlatformAdmin: data.isPlatformAdmin === true,
|
|
2489
|
+
isTenantAdmin: data.isTenantAdmin === true,
|
|
2490
|
+
isWorkspaceAdmin: data.isWorkspaceAdmin === true,
|
|
2491
|
+
authMode: data.authMode,
|
|
2492
|
+
sessionId: data.sessionId,
|
|
2493
|
+
delegatedBy: data.delegatedBy,
|
|
2494
|
+
expiresAt: data.expiresAt
|
|
2495
|
+
}))
|
|
2882
2496
|
);
|
|
2883
2497
|
},
|
|
2884
2498
|
/**
|
|
2885
|
-
*
|
|
2499
|
+
* List principals in the current identity scope.
|
|
2886
2500
|
*/
|
|
2887
|
-
async
|
|
2501
|
+
async listPrincipals(query5 = {}) {
|
|
2888
2502
|
return gateway.request({
|
|
2889
|
-
path: `/api/platform/v1/
|
|
2503
|
+
path: `/api/platform/v1/identity/principals${toQueryString(query5)}`
|
|
2890
2504
|
}).then(
|
|
2891
2505
|
(response) => mapGatewayData(
|
|
2892
2506
|
response,
|
|
2893
|
-
(data) =>
|
|
2507
|
+
(data) => createListResult(
|
|
2508
|
+
Array.isArray(data) ? data : [],
|
|
2509
|
+
"principals"
|
|
2510
|
+
)
|
|
2894
2511
|
)
|
|
2895
2512
|
);
|
|
2896
2513
|
},
|
|
2897
2514
|
/**
|
|
2898
|
-
* Create a
|
|
2515
|
+
* Create a principal.
|
|
2899
2516
|
*/
|
|
2900
|
-
async
|
|
2901
|
-
return
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2517
|
+
async createPrincipal(input, idempotencyKey) {
|
|
2518
|
+
return requestPrincipalWrite("POST", input, idempotencyKey);
|
|
2519
|
+
},
|
|
2520
|
+
/**
|
|
2521
|
+
* Update a principal.
|
|
2522
|
+
*/
|
|
2523
|
+
async updatePrincipal(input, idempotencyKey) {
|
|
2524
|
+
return requestPrincipalWrite("PATCH", input, idempotencyKey);
|
|
2525
|
+
},
|
|
2526
|
+
/**
|
|
2527
|
+
* @deprecated Use createPrincipal or updatePrincipal.
|
|
2528
|
+
*/
|
|
2529
|
+
async upsertPrincipal(input, idempotencyKey) {
|
|
2530
|
+
return requestPrincipalWrite("PATCH", input, idempotencyKey);
|
|
2912
2531
|
},
|
|
2913
2532
|
/**
|
|
2914
|
-
*
|
|
2533
|
+
* List keys in the current identity scope.
|
|
2915
2534
|
*/
|
|
2916
|
-
async
|
|
2535
|
+
async listKeys(query5 = {}) {
|
|
2917
2536
|
return gateway.request({
|
|
2918
|
-
path:
|
|
2919
|
-
method: "PUT",
|
|
2920
|
-
body: normalizeNodeWriteInput(input),
|
|
2921
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2537
|
+
path: `/api/platform/v1/identity/keys${toQueryString(query5)}`
|
|
2922
2538
|
}).then(
|
|
2923
2539
|
(response) => mapGatewayData(
|
|
2924
2540
|
response,
|
|
2925
|
-
(data) =>
|
|
2541
|
+
(data) => createListResult(Array.isArray(data) ? data : [], "keys")
|
|
2926
2542
|
)
|
|
2927
2543
|
);
|
|
2928
2544
|
},
|
|
2929
2545
|
/**
|
|
2930
|
-
*
|
|
2931
|
-
*/
|
|
2932
|
-
async batchCreateNodes(input, idempotencyKey) {
|
|
2933
|
-
return gateway.request({
|
|
2934
|
-
path: "/api/platform/v1/graph/nodes/batch",
|
|
2935
|
-
method: "POST",
|
|
2936
|
-
body: {
|
|
2937
|
-
nodes: input.nodes.map((node) => normalizeNodeWriteInput(node))
|
|
2938
|
-
},
|
|
2939
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2940
|
-
});
|
|
2941
|
-
},
|
|
2942
|
-
/**
|
|
2943
|
-
* Supersede an existing graph node with a new canonical version.
|
|
2546
|
+
* Create an API key.
|
|
2944
2547
|
*/
|
|
2945
|
-
async
|
|
2548
|
+
async createKey(input, idempotencyKey) {
|
|
2946
2549
|
return gateway.request({
|
|
2947
|
-
path: "/api/platform/v1/
|
|
2550
|
+
path: "/api/platform/v1/identity/keys",
|
|
2948
2551
|
method: "POST",
|
|
2949
2552
|
body: input,
|
|
2950
2553
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2951
2554
|
});
|
|
2952
2555
|
},
|
|
2953
2556
|
/**
|
|
2954
|
-
*
|
|
2557
|
+
* Rotate an API key.
|
|
2955
2558
|
*/
|
|
2956
|
-
async
|
|
2957
|
-
const verificationStatus = normalizeNodeVerificationStatus(input.verificationStatus) ?? input.verificationStatus;
|
|
2559
|
+
async rotateKey(keyId, input = {}, idempotencyKey) {
|
|
2958
2560
|
return gateway.request({
|
|
2959
|
-
path:
|
|
2561
|
+
path: `/api/platform/v1/identity/keys/${encodeURIComponent(keyId)}/rotate`,
|
|
2960
2562
|
method: "POST",
|
|
2961
|
-
body:
|
|
2962
|
-
...input,
|
|
2963
|
-
verificationStatus
|
|
2964
|
-
},
|
|
2563
|
+
body: input,
|
|
2965
2564
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2966
2565
|
});
|
|
2967
2566
|
},
|
|
2968
2567
|
/**
|
|
2969
|
-
*
|
|
2568
|
+
* Delete an API key by revoking it.
|
|
2970
2569
|
*/
|
|
2971
|
-
async
|
|
2570
|
+
async deleteKey(keyId, input = {}, idempotencyKey) {
|
|
2972
2571
|
return gateway.request({
|
|
2973
|
-
path:
|
|
2572
|
+
path: `/api/platform/v1/identity/keys/${encodeURIComponent(keyId)}/revoke`,
|
|
2974
2573
|
method: "POST",
|
|
2975
2574
|
body: input,
|
|
2976
2575
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2977
2576
|
});
|
|
2978
2577
|
},
|
|
2979
2578
|
/**
|
|
2980
|
-
*
|
|
2579
|
+
* @deprecated Use deleteKey.
|
|
2981
2580
|
*/
|
|
2982
|
-
async
|
|
2983
|
-
return
|
|
2984
|
-
path: `/api/platform/v1/graph/edges${toQueryString(
|
|
2985
|
-
normalizeTopicQuery(query5)
|
|
2986
|
-
)}`
|
|
2987
|
-
}).then(
|
|
2988
|
-
(response) => mapGatewayData(
|
|
2989
|
-
response,
|
|
2990
|
-
(data) => mapAliasedList(data, "edges")
|
|
2991
|
-
)
|
|
2992
|
-
);
|
|
2581
|
+
async revokeKey(keyId, input = {}, idempotencyKey) {
|
|
2582
|
+
return this.deleteKey(keyId, input, idempotencyKey);
|
|
2993
2583
|
},
|
|
2994
2584
|
/**
|
|
2995
|
-
*
|
|
2585
|
+
* Search Clerk users by email or display attributes.
|
|
2996
2586
|
*/
|
|
2997
|
-
async
|
|
2587
|
+
async searchClerkUsers(q) {
|
|
2998
2588
|
return gateway.request({
|
|
2999
|
-
path:
|
|
3000
|
-
method: "POST",
|
|
3001
|
-
body: normalizeTopicQuery(input),
|
|
3002
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
2589
|
+
path: `/api/platform/v1/identity/clerk-users${toQueryString({ q })}`
|
|
3003
2590
|
});
|
|
3004
2591
|
},
|
|
3005
|
-
|
|
3006
|
-
* Delete one or more edges matching the provided filter.
|
|
3007
|
-
*/
|
|
3008
|
-
async deleteEdge(query5, idempotencyKey) {
|
|
2592
|
+
async getTenantConfig(input) {
|
|
3009
2593
|
return gateway.request({
|
|
3010
|
-
path: `/api/platform/v1/
|
|
3011
|
-
|
|
3012
|
-
|
|
2594
|
+
path: `/api/platform/v1/identity/tenant-config${toQueryString(
|
|
2595
|
+
tenantIdentityQuery(input)
|
|
2596
|
+
)}`
|
|
3013
2597
|
});
|
|
3014
2598
|
},
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
*/
|
|
3018
|
-
async neighborhood(query5) {
|
|
2599
|
+
async updateTenantConfig(input, idempotencyKey) {
|
|
2600
|
+
cleanRequiredString(input.tenantId, "tenantId");
|
|
3019
2601
|
return gateway.request({
|
|
3020
|
-
path:
|
|
2602
|
+
path: "/api/platform/v1/identity/tenant-config",
|
|
2603
|
+
method: "PATCH",
|
|
2604
|
+
body: tenantIdentityBody(
|
|
2605
|
+
input,
|
|
2606
|
+
"identity.updateTenantConfig"
|
|
2607
|
+
),
|
|
2608
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
3021
2609
|
});
|
|
3022
2610
|
},
|
|
3023
|
-
|
|
3024
|
-
* Traverse the graph from a starting node.
|
|
3025
|
-
*/
|
|
3026
|
-
async traverse(query5) {
|
|
2611
|
+
async listIntegrations(input) {
|
|
3027
2612
|
return gateway.request({
|
|
3028
|
-
path:
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
})
|
|
2613
|
+
path: `/api/platform/v1/identity/integrations${toQueryString(
|
|
2614
|
+
tenantIdentityQuery(input)
|
|
2615
|
+
)}`
|
|
2616
|
+
}).then(
|
|
2617
|
+
(response) => mapGatewayData(
|
|
2618
|
+
response,
|
|
2619
|
+
(data) => listResultFromEnvelope(
|
|
2620
|
+
data,
|
|
2621
|
+
"integrations"
|
|
2622
|
+
)
|
|
2623
|
+
)
|
|
2624
|
+
);
|
|
3032
2625
|
},
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
async analyze(query5 = {}) {
|
|
3037
|
-
const normalized = normalizeTopicQuery(query5);
|
|
2626
|
+
async upsertIntegration(input, idempotencyKey) {
|
|
2627
|
+
cleanRequiredString(input.tenantId, "tenantId");
|
|
2628
|
+
cleanRequiredString(input.integrationKey, "integrationKey");
|
|
3038
2629
|
return gateway.request({
|
|
3039
|
-
path:
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
2630
|
+
path: "/api/platform/v1/identity/integrations",
|
|
2631
|
+
method: "PUT",
|
|
2632
|
+
body: tenantIdentityBody(
|
|
2633
|
+
input,
|
|
2634
|
+
"identity.upsertIntegration"
|
|
2635
|
+
),
|
|
2636
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
3044
2637
|
});
|
|
3045
2638
|
},
|
|
3046
|
-
|
|
3047
|
-
* Detect confirmation-bias patterns for a topic graph.
|
|
3048
|
-
*/
|
|
3049
|
-
async bias(query5 = {}) {
|
|
3050
|
-
const normalized = normalizeTopicQuery(query5);
|
|
2639
|
+
async listSecrets(input) {
|
|
3051
2640
|
return gateway.request({
|
|
3052
|
-
path: `/api/platform/v1/
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
2641
|
+
path: `/api/platform/v1/identity/secrets${toQueryString(
|
|
2642
|
+
tenantIdentityQuery(input)
|
|
2643
|
+
)}`
|
|
2644
|
+
}).then(
|
|
2645
|
+
(response) => mapGatewayData(
|
|
2646
|
+
response,
|
|
2647
|
+
(data) => listResultFromEnvelope(
|
|
2648
|
+
data,
|
|
2649
|
+
"secrets"
|
|
2650
|
+
)
|
|
2651
|
+
)
|
|
2652
|
+
);
|
|
3058
2653
|
},
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
async gaps(query5) {
|
|
3063
|
-
const normalized = normalizeTopicQuery(query5);
|
|
2654
|
+
async putSecretReference(input, idempotencyKey) {
|
|
2655
|
+
cleanRequiredString(input.tenantId, "tenantId");
|
|
2656
|
+
cleanRequiredString(input.secretRef, "secretRef");
|
|
3064
2657
|
return gateway.request({
|
|
3065
|
-
path:
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
2658
|
+
path: "/api/platform/v1/identity/secrets",
|
|
2659
|
+
method: "PUT",
|
|
2660
|
+
body: tenantIdentityBody(
|
|
2661
|
+
input,
|
|
2662
|
+
"identity.putSecretReference"
|
|
2663
|
+
),
|
|
2664
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
3069
2665
|
});
|
|
3070
2666
|
},
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
2667
|
+
async evaluatePolicy(input, idempotencyKey) {
|
|
2668
|
+
cleanRequiredString(input.tenantId, "tenantId");
|
|
2669
|
+
cleanRequiredString(input.policySubject, "policySubject");
|
|
2670
|
+
cleanRequiredString(input.policyAction, "policyAction");
|
|
2671
|
+
cleanRequiredString(input.policyResource, "policyResource");
|
|
3075
2672
|
return gateway.request({
|
|
3076
|
-
path: "/api/platform/v1/
|
|
2673
|
+
path: "/api/platform/v1/identity/policy/evaluate",
|
|
3077
2674
|
method: "POST",
|
|
3078
|
-
body:
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
*/
|
|
3084
|
-
async getPath(query5) {
|
|
3085
|
-
return gateway.request({
|
|
3086
|
-
path: `/api/platform/v1/graph/path${toQueryString(query5)}`
|
|
2675
|
+
body: tenantIdentityBody(
|
|
2676
|
+
input,
|
|
2677
|
+
"identity.evaluatePolicy"
|
|
2678
|
+
),
|
|
2679
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
3087
2680
|
});
|
|
3088
2681
|
},
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
async getAnalytics(query5 = {}) {
|
|
2682
|
+
async recordPolicyDecision(input, idempotencyKey) {
|
|
2683
|
+
cleanRequiredString(input.tenantId, "tenantId");
|
|
2684
|
+
cleanRequiredString(input.decision, "decision");
|
|
3093
2685
|
return gateway.request({
|
|
3094
|
-
path:
|
|
2686
|
+
path: "/api/platform/v1/identity/policy/decisions",
|
|
2687
|
+
method: "POST",
|
|
2688
|
+
body: tenantIdentityBody(
|
|
2689
|
+
input,
|
|
2690
|
+
"identity.recordPolicyDecision"
|
|
2691
|
+
),
|
|
2692
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
3095
2693
|
});
|
|
3096
2694
|
}
|
|
3097
2695
|
};
|
|
3098
|
-
return Object.assign(client, {
|
|
3099
|
-
queryNodes: client.listNodes,
|
|
3100
|
-
queryEdges: client.listEdges,
|
|
3101
|
-
getNeighborhood: client.neighborhood
|
|
3102
|
-
});
|
|
3103
2696
|
}
|
|
3104
2697
|
|
|
3105
2698
|
// src/topicsClient.ts
|
|
3106
|
-
function
|
|
2699
|
+
function asRecord3(value) {
|
|
2700
|
+
return value && typeof value === "object" ? value : {};
|
|
2701
|
+
}
|
|
2702
|
+
function cleanString3(value) {
|
|
3107
2703
|
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
3108
2704
|
}
|
|
3109
2705
|
function normalizeTopicRecord(value) {
|
|
3110
|
-
const record =
|
|
3111
|
-
const topicId =
|
|
2706
|
+
const record = asRecord3(value);
|
|
2707
|
+
const topicId = cleanString3(record.topicId) ?? cleanString3(record.id) ?? cleanString3(record._id);
|
|
3112
2708
|
return withTopicAlias({
|
|
3113
2709
|
...record,
|
|
3114
2710
|
...topicId ? { topicId } : {}
|
|
@@ -3132,7 +2728,7 @@ function createTopicsClient(config = {}) {
|
|
|
3132
2728
|
})}`
|
|
3133
2729
|
}).then(
|
|
3134
2730
|
(response) => mapGatewayData(response, (data) => {
|
|
3135
|
-
const record =
|
|
2731
|
+
const record = asRecord3(data);
|
|
3136
2732
|
const items = Array.isArray(record.topics) ? record.topics.map(normalizeTopicRecord) : [];
|
|
3137
2733
|
return {
|
|
3138
2734
|
...createListResult(items, "topics"),
|
|
@@ -3149,7 +2745,7 @@ function createTopicsClient(config = {}) {
|
|
|
3149
2745
|
}).then(
|
|
3150
2746
|
(response) => mapGatewayData(
|
|
3151
2747
|
response,
|
|
3152
|
-
(data) => normalizeTopicRecord(
|
|
2748
|
+
(data) => normalizeTopicRecord(asRecord3(data).topic ?? data)
|
|
3153
2749
|
)
|
|
3154
2750
|
);
|
|
3155
2751
|
},
|
|
@@ -3185,7 +2781,7 @@ function createTopicsClient(config = {}) {
|
|
|
3185
2781
|
)}`
|
|
3186
2782
|
}).then(
|
|
3187
2783
|
(response) => mapGatewayData(response, (data) => {
|
|
3188
|
-
const record =
|
|
2784
|
+
const record = asRecord3(data);
|
|
3189
2785
|
return {
|
|
3190
2786
|
tree: Array.isArray(record.tree) ? record.tree.map(normalizeTopicTreeNode) : []
|
|
3191
2787
|
};
|
|
@@ -3604,7 +3200,7 @@ function createEventsFacade(config = {}) {
|
|
|
3604
3200
|
function createGraphFacade(config = {}) {
|
|
3605
3201
|
const graphClient = createGraphClient(config);
|
|
3606
3202
|
const gateway = createGatewayRequestClient(config);
|
|
3607
|
-
|
|
3203
|
+
return {
|
|
3608
3204
|
async neighborhood(input) {
|
|
3609
3205
|
return graphClient.neighborhood({
|
|
3610
3206
|
globalId: input.globalId,
|
|
@@ -3612,6 +3208,18 @@ function createGraphFacade(config = {}) {
|
|
|
3612
3208
|
maxDepth: input.maxDepth
|
|
3613
3209
|
});
|
|
3614
3210
|
},
|
|
3211
|
+
async traverse(input) {
|
|
3212
|
+
return graphClient.traverse(input);
|
|
3213
|
+
},
|
|
3214
|
+
async analyze(input = {}) {
|
|
3215
|
+
return graphClient.analyze(input);
|
|
3216
|
+
},
|
|
3217
|
+
async bias(input = {}) {
|
|
3218
|
+
return graphClient.bias(input);
|
|
3219
|
+
},
|
|
3220
|
+
async gaps(input) {
|
|
3221
|
+
return graphClient.gaps(input);
|
|
3222
|
+
},
|
|
3615
3223
|
async falsify(input, idempotencyKey = randomIdempotencyKey()) {
|
|
3616
3224
|
return gateway.request({
|
|
3617
3225
|
path: "/api/platform/v1/graph/falsify",
|
|
@@ -3621,12 +3229,6 @@ function createGraphFacade(config = {}) {
|
|
|
3621
3229
|
});
|
|
3622
3230
|
}
|
|
3623
3231
|
};
|
|
3624
|
-
return Object.assign(graphFacade, {
|
|
3625
|
-
traverse: graphClient.traverse,
|
|
3626
|
-
analyze: graphClient.analyze,
|
|
3627
|
-
bias: graphClient.bias,
|
|
3628
|
-
gaps: graphClient.gaps
|
|
3629
|
-
});
|
|
3630
3232
|
}
|
|
3631
3233
|
function createIdentityFacade(config = {}) {
|
|
3632
3234
|
const identityClient = createIdentityClient(config);
|
|
@@ -3640,12 +3242,15 @@ function createIdentityFacade(config = {}) {
|
|
|
3640
3242
|
function createOntologiesFacade(config = {}) {
|
|
3641
3243
|
const ontologyClient = createOntologyClient(config);
|
|
3642
3244
|
const gateway = createGatewayRequestClient(config);
|
|
3643
|
-
|
|
3245
|
+
return {
|
|
3644
3246
|
async get(id) {
|
|
3645
3247
|
return gateway.request({
|
|
3646
3248
|
path: `/api/platform/v1/ontologies/${encodeURIComponent(id)}`
|
|
3647
3249
|
});
|
|
3648
3250
|
},
|
|
3251
|
+
async list(query5 = {}) {
|
|
3252
|
+
return ontologyClient.list(query5);
|
|
3253
|
+
},
|
|
3649
3254
|
async bind(input, idempotencyKey) {
|
|
3650
3255
|
return gateway.request({
|
|
3651
3256
|
path: `/api/platform/v1/ontologies/${encodeURIComponent(input.ontologyId)}/bind`,
|
|
@@ -3665,9 +3270,6 @@ function createOntologiesFacade(config = {}) {
|
|
|
3665
3270
|
});
|
|
3666
3271
|
}
|
|
3667
3272
|
};
|
|
3668
|
-
return Object.assign(ontologyFacade, {
|
|
3669
|
-
list: ontologyClient.list
|
|
3670
|
-
});
|
|
3671
3273
|
}
|
|
3672
3274
|
function createQuestionsFacade(config = {}) {
|
|
3673
3275
|
const gateway = createGatewayRequestClient(config);
|
|
@@ -3827,8 +3429,6 @@ function createTasksFacade(config = {}) {
|
|
|
3827
3429
|
description: input.description,
|
|
3828
3430
|
priority: input.priority,
|
|
3829
3431
|
status: input.status,
|
|
3830
|
-
assigneeId: input.assigneeId,
|
|
3831
|
-
blockedReason: input.blockedReason,
|
|
3832
3432
|
linkedBeliefId: input.linkedBeliefId,
|
|
3833
3433
|
linkedQuestionId: input.linkedQuestionId,
|
|
3834
3434
|
linkedWorktreeId: input.linkedWorktreeId,
|
|
@@ -3862,9 +3462,15 @@ function createTasksFacade(config = {}) {
|
|
|
3862
3462
|
function createTopicsFacade(config = {}) {
|
|
3863
3463
|
const topicsClient = createTopicsClient(config);
|
|
3864
3464
|
return {
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3465
|
+
async create(input, idempotencyKey) {
|
|
3466
|
+
return topicsClient.create(input, idempotencyKey);
|
|
3467
|
+
},
|
|
3468
|
+
async get(id) {
|
|
3469
|
+
return topicsClient.get(id);
|
|
3470
|
+
},
|
|
3471
|
+
async list(query5 = {}) {
|
|
3472
|
+
return topicsClient.list(query5);
|
|
3473
|
+
},
|
|
3868
3474
|
async update(input, idempotencyKey) {
|
|
3869
3475
|
const { id, ...rest } = input;
|
|
3870
3476
|
return topicsClient.update(id, rest, idempotencyKey);
|
|
@@ -3880,8 +3486,12 @@ function createTopicsFacade(config = {}) {
|
|
|
3880
3486
|
maxDepth: input.maxDepth
|
|
3881
3487
|
});
|
|
3882
3488
|
},
|
|
3883
|
-
|
|
3884
|
-
|
|
3489
|
+
async remove(id, idempotencyKey = randomIdempotencyKey()) {
|
|
3490
|
+
return topicsClient.remove(id, idempotencyKey);
|
|
3491
|
+
},
|
|
3492
|
+
async bulkCreate(input, idempotencyKey = randomIdempotencyKey()) {
|
|
3493
|
+
return topicsClient.bulkCreate(input, idempotencyKey);
|
|
3494
|
+
}
|
|
3885
3495
|
};
|
|
3886
3496
|
}
|
|
3887
3497
|
function createWebhooksFacade(config = {}) {
|
|
@@ -4081,7 +3691,7 @@ function createWorktreesFacade(config = {}) {
|
|
|
4081
3691
|
// src/decisionsClient.ts
|
|
4082
3692
|
function createDecisionsClient(config = {}) {
|
|
4083
3693
|
const gateway = createGatewayRequestClient(config);
|
|
4084
|
-
|
|
3694
|
+
return {
|
|
4085
3695
|
/**
|
|
4086
3696
|
* List judgments for a topic scope.
|
|
4087
3697
|
*/
|
|
@@ -4159,6 +3769,12 @@ function createDecisionsClient(config = {}) {
|
|
|
4159
3769
|
})
|
|
4160
3770
|
);
|
|
4161
3771
|
},
|
|
3772
|
+
/**
|
|
3773
|
+
* @deprecated Use listPendingOutcomeReviews.
|
|
3774
|
+
*/
|
|
3775
|
+
async listPendingJudgmentOutcomeReview(query5) {
|
|
3776
|
+
return this.listPendingOutcomeReviews(query5);
|
|
3777
|
+
},
|
|
4162
3778
|
/**
|
|
4163
3779
|
* Get audit integrity checks for judgment transitions.
|
|
4164
3780
|
*/
|
|
@@ -4191,6 +3807,12 @@ function createDecisionsClient(config = {}) {
|
|
|
4191
3807
|
)
|
|
4192
3808
|
);
|
|
4193
3809
|
},
|
|
3810
|
+
/**
|
|
3811
|
+
* @deprecated Use createJudgment.
|
|
3812
|
+
*/
|
|
3813
|
+
async recordJudgment(input, idempotencyKey) {
|
|
3814
|
+
return this.createJudgment(input, idempotencyKey);
|
|
3815
|
+
},
|
|
4194
3816
|
/**
|
|
4195
3817
|
* Update the outcome for an existing judgment.
|
|
4196
3818
|
*/
|
|
@@ -4201,13 +3823,14 @@ function createDecisionsClient(config = {}) {
|
|
|
4201
3823
|
body: input,
|
|
4202
3824
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
4203
3825
|
});
|
|
3826
|
+
},
|
|
3827
|
+
/**
|
|
3828
|
+
* @deprecated Use updateJudgmentOutcome.
|
|
3829
|
+
*/
|
|
3830
|
+
async recordJudgmentOutcome(judgmentId, input, idempotencyKey) {
|
|
3831
|
+
return this.updateJudgmentOutcome(judgmentId, input, idempotencyKey);
|
|
4204
3832
|
}
|
|
4205
3833
|
};
|
|
4206
|
-
return Object.assign(client, {
|
|
4207
|
-
listPendingJudgmentOutcomeReview: client.listPendingOutcomeReviews,
|
|
4208
|
-
recordJudgment: client.createJudgment,
|
|
4209
|
-
recordJudgmentOutcome: client.updateJudgmentOutcome
|
|
4210
|
-
});
|
|
4211
3834
|
}
|
|
4212
3835
|
|
|
4213
3836
|
// src/embeddingsClient.ts
|
|
@@ -4323,7 +3946,7 @@ function createEmbeddingsClient(config = {}) {
|
|
|
4323
3946
|
}
|
|
4324
3947
|
|
|
4325
3948
|
// src/contextClient.ts
|
|
4326
|
-
function
|
|
3949
|
+
function cleanString4(value) {
|
|
4327
3950
|
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
4328
3951
|
}
|
|
4329
3952
|
function cleanNumber(value) {
|
|
@@ -4332,55 +3955,50 @@ function cleanNumber(value) {
|
|
|
4332
3955
|
function cleanBoolean(value) {
|
|
4333
3956
|
return typeof value === "boolean" ? value : void 0;
|
|
4334
3957
|
}
|
|
4335
|
-
function buildCompileContextRequest(
|
|
4336
|
-
const
|
|
4337
|
-
const
|
|
4338
|
-
const topicId = typeof topicIdOrInput === "string" ? cleanString6(topicIdOrInput) : cleanString6(effectiveInput.topicId);
|
|
4339
|
-
if (topicId) {
|
|
4340
|
-
payload.topicId = topicId;
|
|
4341
|
-
}
|
|
4342
|
-
const query5 = cleanString6(effectiveInput.query);
|
|
3958
|
+
function buildCompileContextRequest(topicId, input = {}) {
|
|
3959
|
+
const payload = { topicId };
|
|
3960
|
+
const query5 = cleanString4(input.query);
|
|
4343
3961
|
if (query5) {
|
|
4344
3962
|
payload.query = query5;
|
|
4345
3963
|
}
|
|
4346
|
-
const budget = cleanNumber(
|
|
3964
|
+
const budget = cleanNumber(input.budget) ?? cleanNumber(input.tokenBudget);
|
|
4347
3965
|
if (budget !== void 0) {
|
|
4348
3966
|
payload.budget = budget;
|
|
4349
3967
|
}
|
|
4350
|
-
const ranking =
|
|
3968
|
+
const ranking = cleanString4(input.ranking) ?? cleanString4(input.rankingProfile);
|
|
4351
3969
|
if (ranking) {
|
|
4352
3970
|
payload.ranking = ranking;
|
|
4353
3971
|
}
|
|
4354
|
-
const limit = cleanNumber(
|
|
3972
|
+
const limit = cleanNumber(input.limit);
|
|
4355
3973
|
if (limit !== void 0) {
|
|
4356
3974
|
payload.limit = limit;
|
|
4357
3975
|
}
|
|
4358
|
-
const maxDepth = cleanNumber(
|
|
3976
|
+
const maxDepth = cleanNumber(input.maxDepth);
|
|
4359
3977
|
if (maxDepth !== void 0) {
|
|
4360
3978
|
payload.maxDepth = maxDepth;
|
|
4361
3979
|
}
|
|
4362
|
-
const includeEntities = cleanBoolean(
|
|
3980
|
+
const includeEntities = cleanBoolean(input.includeEntities);
|
|
4363
3981
|
if (includeEntities !== void 0) {
|
|
4364
3982
|
payload.includeEntities = includeEntities;
|
|
4365
3983
|
}
|
|
4366
|
-
const mode =
|
|
3984
|
+
const mode = cleanString4(input.mode);
|
|
4367
3985
|
if (mode) {
|
|
4368
3986
|
payload.mode = mode;
|
|
4369
3987
|
}
|
|
4370
|
-
const includeFailures = cleanBoolean(
|
|
3988
|
+
const includeFailures = cleanBoolean(input.includeFailures);
|
|
4371
3989
|
if (includeFailures !== void 0) {
|
|
4372
3990
|
payload.includeFailures = includeFailures;
|
|
4373
3991
|
}
|
|
4374
|
-
const worktreeId =
|
|
3992
|
+
const worktreeId = cleanString4(input.worktreeId);
|
|
4375
3993
|
if (worktreeId) {
|
|
4376
3994
|
payload.worktreeId = worktreeId;
|
|
4377
3995
|
}
|
|
4378
|
-
const sessionId =
|
|
3996
|
+
const sessionId = cleanString4(input.sessionId);
|
|
4379
3997
|
if (sessionId) {
|
|
4380
3998
|
payload.sessionId = sessionId;
|
|
4381
3999
|
}
|
|
4382
|
-
if (Array.isArray(
|
|
4383
|
-
payload.packWeightOverrides =
|
|
4000
|
+
if (Array.isArray(input.packWeightOverrides) && input.packWeightOverrides.length > 0) {
|
|
4001
|
+
payload.packWeightOverrides = input.packWeightOverrides;
|
|
4384
4002
|
}
|
|
4385
4003
|
return {
|
|
4386
4004
|
path: "/api/platform/v1/context/compile",
|
|
@@ -4392,20 +4010,13 @@ function createContextClient(config = {}) {
|
|
|
4392
4010
|
const gateway = createGatewayRequestClient(config);
|
|
4393
4011
|
return {
|
|
4394
4012
|
/**
|
|
4395
|
-
* Compile a focused reasoning context pack.
|
|
4396
|
-
* @param
|
|
4013
|
+
* Compile a focused reasoning context pack for a topic scope.
|
|
4014
|
+
* @param topicId - The topic to compile context for.
|
|
4397
4015
|
* @param input - Optional compile parameters (query, budget, ranking, etc.).
|
|
4398
4016
|
* @returns The compiled context payload with beliefs, questions, and evidence.
|
|
4399
4017
|
*/
|
|
4400
|
-
async compile(
|
|
4401
|
-
const request = buildCompileContextRequest(
|
|
4402
|
-
return gateway.request({
|
|
4403
|
-
...request,
|
|
4404
|
-
body: request.body
|
|
4405
|
-
});
|
|
4406
|
-
},
|
|
4407
|
-
async compileByQuery(input = {}) {
|
|
4408
|
-
const request = buildCompileContextRequest(input);
|
|
4018
|
+
async compile(topicId, input = {}) {
|
|
4019
|
+
const request = buildCompileContextRequest(topicId, input);
|
|
4409
4020
|
return gateway.request({
|
|
4410
4021
|
...request,
|
|
4411
4022
|
body: request.body
|
|
@@ -4510,33 +4121,9 @@ function graphAnalysisQuery(input) {
|
|
|
4510
4121
|
cursor: input.cursor
|
|
4511
4122
|
};
|
|
4512
4123
|
}
|
|
4513
|
-
function normalizeRunQueryPayload(input) {
|
|
4514
|
-
return {
|
|
4515
|
-
...input,
|
|
4516
|
-
topicId: requireTopicId2(input),
|
|
4517
|
-
projectId: void 0
|
|
4518
|
-
};
|
|
4519
|
-
}
|
|
4520
4124
|
function createGraphAnalysisClient(config = {}) {
|
|
4521
4125
|
const gateway = createGatewayRequestClient(config);
|
|
4522
4126
|
return {
|
|
4523
|
-
listGraphIntelligenceQueries(input = {}) {
|
|
4524
|
-
return gateway.request({
|
|
4525
|
-
path: "/api/platform/v1/graph-intelligence/queries",
|
|
4526
|
-
method: "POST",
|
|
4527
|
-
body: {
|
|
4528
|
-
categoryId: input.categoryId,
|
|
4529
|
-
mode: input.mode
|
|
4530
|
-
}
|
|
4531
|
-
});
|
|
4532
|
-
},
|
|
4533
|
-
runGraphIntelligenceQuery(input) {
|
|
4534
|
-
return gateway.request({
|
|
4535
|
-
path: "/api/platform/v1/graph-intelligence/run",
|
|
4536
|
-
method: "POST",
|
|
4537
|
-
body: normalizeRunQueryPayload(input)
|
|
4538
|
-
});
|
|
4539
|
-
},
|
|
4540
4127
|
saveAnalysis(input, idempotencyKey) {
|
|
4541
4128
|
return gateway.request({
|
|
4542
4129
|
path: "/api/platform/v1/graph-analysis/analyses",
|
|
@@ -4618,9 +4205,7 @@ function createGraphAnalysisClient(config = {}) {
|
|
|
4618
4205
|
topicId: requireTopicId2(input),
|
|
4619
4206
|
workspaceId: input.workspaceId,
|
|
4620
4207
|
analysisId: input.analysisId,
|
|
4621
|
-
|
|
4622
|
-
sourceNodeIds: input.sourceNodeIds?.join(",") ?? (input.nodeId ? input.nodeId : void 0),
|
|
4623
|
-
sourceEdgeIds: input.sourceEdgeIds?.join(",") ?? (input.edgeId ? input.edgeId : void 0),
|
|
4208
|
+
since: input.since,
|
|
4624
4209
|
limit: input.limit,
|
|
4625
4210
|
cursor: input.cursor
|
|
4626
4211
|
})}`
|
|
@@ -4843,7 +4428,7 @@ function createGraphStateClassifierClient(config = {}) {
|
|
|
4843
4428
|
// src/harnessClient.ts
|
|
4844
4429
|
function createHarnessClient(config = {}) {
|
|
4845
4430
|
const gateway = createGatewayRequestClient(config);
|
|
4846
|
-
|
|
4431
|
+
return {
|
|
4847
4432
|
/**
|
|
4848
4433
|
* List agent definitions.
|
|
4849
4434
|
*/
|
|
@@ -4876,6 +4461,12 @@ function createHarnessClient(config = {}) {
|
|
|
4876
4461
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
4877
4462
|
});
|
|
4878
4463
|
},
|
|
4464
|
+
/**
|
|
4465
|
+
* @deprecated Use createAgentDefinition.
|
|
4466
|
+
*/
|
|
4467
|
+
async registerAgentDefinition(input, idempotencyKey) {
|
|
4468
|
+
return this.createAgentDefinition(input, idempotencyKey);
|
|
4469
|
+
},
|
|
4879
4470
|
/**
|
|
4880
4471
|
* Update an agent definition.
|
|
4881
4472
|
*/
|
|
@@ -4914,6 +4505,12 @@ function createHarnessClient(config = {}) {
|
|
|
4914
4505
|
)
|
|
4915
4506
|
);
|
|
4916
4507
|
},
|
|
4508
|
+
/**
|
|
4509
|
+
* @deprecated Use listAgentRuns.
|
|
4510
|
+
*/
|
|
4511
|
+
async listRunsForAgent(agentId, scope = {}) {
|
|
4512
|
+
return this.listAgentRuns(agentId, scope);
|
|
4513
|
+
},
|
|
4917
4514
|
/**
|
|
4918
4515
|
* List tool definitions.
|
|
4919
4516
|
*/
|
|
@@ -4946,6 +4543,12 @@ function createHarnessClient(config = {}) {
|
|
|
4946
4543
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
4947
4544
|
});
|
|
4948
4545
|
},
|
|
4546
|
+
/**
|
|
4547
|
+
* @deprecated Use createToolDefinition.
|
|
4548
|
+
*/
|
|
4549
|
+
async registerToolDefinition(input, idempotencyKey) {
|
|
4550
|
+
return this.createToolDefinition(input, idempotencyKey);
|
|
4551
|
+
},
|
|
4949
4552
|
/**
|
|
4950
4553
|
* Update a tool definition.
|
|
4951
4554
|
*/
|
|
@@ -4980,6 +4583,12 @@ function createHarnessClient(config = {}) {
|
|
|
4980
4583
|
)
|
|
4981
4584
|
);
|
|
4982
4585
|
},
|
|
4586
|
+
/**
|
|
4587
|
+
* @deprecated Use listRunEntries.
|
|
4588
|
+
*/
|
|
4589
|
+
async listRunLedgerEntries(scope = {}) {
|
|
4590
|
+
return this.listRunEntries(scope);
|
|
4591
|
+
},
|
|
4983
4592
|
/**
|
|
4984
4593
|
* Create a harness run.
|
|
4985
4594
|
*/
|
|
@@ -5054,12 +4663,6 @@ function createHarnessClient(config = {}) {
|
|
|
5054
4663
|
});
|
|
5055
4664
|
}
|
|
5056
4665
|
};
|
|
5057
|
-
return Object.assign(client, {
|
|
5058
|
-
registerAgentDefinition: client.createAgentDefinition,
|
|
5059
|
-
listRunsForAgent: client.listAgentRuns,
|
|
5060
|
-
registerToolDefinition: client.createToolDefinition,
|
|
5061
|
-
listRunLedgerEntries: client.listRunEntries
|
|
5062
|
-
});
|
|
5063
4666
|
}
|
|
5064
4667
|
|
|
5065
4668
|
// src/jobsClient.ts
|
|
@@ -5187,41 +4790,45 @@ function createJobsClient(config = {}) {
|
|
|
5187
4790
|
// src/learningClient.ts
|
|
5188
4791
|
function createLearningClient(config = {}) {
|
|
5189
4792
|
const gateway = createGatewayRequestClient(config);
|
|
5190
|
-
const listRecentExecutions = async (args = {}) => gateway.request({
|
|
5191
|
-
path: `/api/platform/v1/learning/executions/recent${toQueryString({
|
|
5192
|
-
...normalizeTopicQuery(args),
|
|
5193
|
-
namespace: args.namespace,
|
|
5194
|
-
audienceMode: args.audienceMode,
|
|
5195
|
-
success: typeof args.success === "boolean" ? args.success ? "true" : "false" : void 0,
|
|
5196
|
-
limit: typeof args.limit === "number" && Number.isFinite(args.limit) ? String(args.limit) : void 0
|
|
5197
|
-
})}`
|
|
5198
|
-
}).then(
|
|
5199
|
-
(response) => mapGatewayData(
|
|
5200
|
-
response,
|
|
5201
|
-
(data) => createListResult(Array.isArray(data) ? data : [], "executions")
|
|
5202
|
-
)
|
|
5203
|
-
);
|
|
5204
|
-
const getExecutionStats = async (args = {}) => gateway.request({
|
|
5205
|
-
path: `/api/platform/v1/learning/executions/stats${toQueryString({
|
|
5206
|
-
...normalizeTopicQuery(args),
|
|
5207
|
-
namespace: args.namespace,
|
|
5208
|
-
audienceMode: args.audienceMode,
|
|
5209
|
-
hours: typeof args.hours === "number" && Number.isFinite(args.hours) ? String(args.hours) : void 0
|
|
5210
|
-
})}`
|
|
5211
|
-
});
|
|
5212
4793
|
return {
|
|
5213
4794
|
/**
|
|
5214
4795
|
* List recent execution records.
|
|
5215
4796
|
*/
|
|
5216
|
-
listRecentExecutions
|
|
4797
|
+
async listRecentExecutions(args = {}) {
|
|
4798
|
+
return gateway.request({
|
|
4799
|
+
path: `/api/platform/v1/learning/executions/recent${toQueryString({
|
|
4800
|
+
...normalizeTopicQuery(args),
|
|
4801
|
+
namespace: args.namespace,
|
|
4802
|
+
audienceMode: args.audienceMode,
|
|
4803
|
+
success: typeof args.success === "boolean" ? args.success ? "true" : "false" : void 0,
|
|
4804
|
+
limit: typeof args.limit === "number" && Number.isFinite(args.limit) ? String(args.limit) : void 0
|
|
4805
|
+
})}`
|
|
4806
|
+
}).then(
|
|
4807
|
+
(response) => mapGatewayData(
|
|
4808
|
+
response,
|
|
4809
|
+
(data) => createListResult(Array.isArray(data) ? data : [], "executions")
|
|
4810
|
+
)
|
|
4811
|
+
);
|
|
4812
|
+
},
|
|
5217
4813
|
/**
|
|
5218
4814
|
* @deprecated Use listRecentExecutions.
|
|
5219
4815
|
*/
|
|
5220
|
-
getRecentExecutions
|
|
4816
|
+
async getRecentExecutions(args = {}) {
|
|
4817
|
+
return this.listRecentExecutions(args);
|
|
4818
|
+
},
|
|
5221
4819
|
/**
|
|
5222
4820
|
* Get aggregate execution statistics.
|
|
5223
4821
|
*/
|
|
5224
|
-
getExecutionStats
|
|
4822
|
+
async getExecutionStats(args = {}) {
|
|
4823
|
+
return gateway.request({
|
|
4824
|
+
path: `/api/platform/v1/learning/executions/stats${toQueryString({
|
|
4825
|
+
...normalizeTopicQuery(args),
|
|
4826
|
+
namespace: args.namespace,
|
|
4827
|
+
audienceMode: args.audienceMode,
|
|
4828
|
+
hours: typeof args.hours === "number" && Number.isFinite(args.hours) ? String(args.hours) : void 0
|
|
4829
|
+
})}`
|
|
4830
|
+
});
|
|
4831
|
+
}
|
|
5225
4832
|
};
|
|
5226
4833
|
}
|
|
5227
4834
|
function toJsonValue(value) {
|
|
@@ -5261,8 +4868,7 @@ function createMcpClient(config = {}) {
|
|
|
5261
4868
|
transportKind: input.transportKind,
|
|
5262
4869
|
sessionId: input.sessionId,
|
|
5263
4870
|
agentIdentity: input.agentIdentity,
|
|
5264
|
-
workspaceId: input.workspaceId
|
|
5265
|
-
worktreeId: input.worktreeId
|
|
4871
|
+
workspaceId: input.workspaceId
|
|
5266
4872
|
};
|
|
5267
4873
|
return gateway.request({
|
|
5268
4874
|
path: `${MCP_GATEWAY_BOOTSTRAP_ENDPOINT}${toQueryString(scope)}`,
|
|
@@ -5353,12 +4959,8 @@ var CONTRACTS = {
|
|
|
5353
4959
|
"apply_lens_to_topic": { method: "POST", path: "/lenses/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
5354
4960
|
"apply_ontology": { method: "POST", path: "/ontologies/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
5355
4961
|
"archive_belief": { method: "DELETE", path: "/beliefs", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5356
|
-
"archive_epistemic_node": { method: "POST", path: "/nodes/archive", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5357
4962
|
"archive_ontology": { method: "DELETE", path: "/ontologies", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
5358
4963
|
"archive_question": { method: "DELETE", path: "/questions", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5359
|
-
"batch_create_edges": { method: "POST", path: "/edges/batch", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
5360
|
-
"batch_create_epistemic_nodes": { method: "POST", path: "/nodes/batch", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5361
|
-
"begin_build_session": { method: "POST", path: "/mcp/build-session/begin", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
5362
4964
|
"bisect_confidence": { method: "POST", path: "/beliefs/confidence/bisect", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5363
4965
|
"broadcast_message": { method: "POST", path: "/coordination/messages/broadcast", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
5364
4966
|
"check_permission": { method: "POST", path: "/identity/check-permission", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
@@ -5369,7 +4971,6 @@ var CONTRACTS = {
|
|
|
5369
4971
|
"create_belief": { method: "POST", path: "/beliefs", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5370
4972
|
"create_edge": { method: "POST", path: "/edges", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
5371
4973
|
"create_epistemic_contract": { method: "POST", path: "/contracts", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
5372
|
-
"create_epistemic_node": { method: "POST", path: "/nodes", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5373
4974
|
"create_evidence": { method: "POST", path: "/evidence", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5374
4975
|
"create_lens": { method: "POST", path: "/lenses", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
5375
4976
|
"create_ontology": { method: "POST", path: "/ontologies", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
@@ -5397,7 +4998,6 @@ var CONTRACTS = {
|
|
|
5397
4998
|
"get_code_context": { method: "POST", path: "/coding/context", kind: "query", idempotent: false, surfaceIntent: "system" },
|
|
5398
4999
|
"get_confidence_history": { method: "POST", path: "/beliefs/confidence-history", kind: "query", idempotent: false, surfaceIntent: "compatibility" },
|
|
5399
5000
|
"get_contract_status": { method: "POST", path: "/contracts/status", kind: "query", idempotent: false, surfaceIntent: "mcp_governance" },
|
|
5400
|
-
"get_epistemic_node": { method: "GET", path: "/nodes/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5401
5001
|
"get_evidence": { method: "GET", path: "/evidence/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5402
5002
|
"get_failure_log": { method: "POST", path: "/coding/failure-log", kind: "query", idempotent: false, surfaceIntent: "system" },
|
|
5403
5003
|
"get_falsification_questions": { method: "POST", path: "/questions/falsification", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
@@ -5411,7 +5011,6 @@ var CONTRACTS = {
|
|
|
5411
5011
|
"get_question": { method: "GET", path: "/questions/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5412
5012
|
"get_topic": { method: "GET", path: "/topics/get", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5413
5013
|
"get_topic_coverage": { method: "POST", path: "/graph/topic-coverage", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
5414
|
-
"get_topic_graph_spine": { method: "GET", path: "/topics/graph-spine", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5415
5014
|
"get_topic_tree": { method: "GET", path: "/topics/tree", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5416
5015
|
"heartbeat_session": { method: "POST", path: "/coordination/heartbeat-session", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
5417
5016
|
"identity_whoami": { method: "GET", path: "/identity/whoami", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
@@ -5423,9 +5022,7 @@ var CONTRACTS = {
|
|
|
5423
5022
|
"list_all_worktrees": { method: "GET", path: "/worktrees/all", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5424
5023
|
"list_beliefs": { method: "GET", path: "/beliefs", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5425
5024
|
"list_campaigns": { method: "GET", path: "/worktrees/campaigns", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5426
|
-
"list_epistemic_nodes": { method: "GET", path: "/nodes", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5427
5025
|
"list_evidence": { method: "GET", path: "/evidence", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5428
|
-
"list_graph_intelligence_queries": { method: "POST", path: "/graph-intelligence/queries", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
5429
5026
|
"list_lenses": { method: "GET", path: "/lenses", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5430
5027
|
"list_ontologies": { method: "GET", path: "/ontologies", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5431
5028
|
"list_questions": { method: "GET", path: "/questions", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
@@ -5434,7 +5031,6 @@ var CONTRACTS = {
|
|
|
5434
5031
|
"list_worktrees": { method: "GET", path: "/worktrees", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5435
5032
|
"manage_write_policy": { method: "POST", path: "/policy/write-policy/manage", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
5436
5033
|
"match_entity_type": { method: "POST", path: "/ontologies/match-entity-type", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5437
|
-
"materialize_topic_graph": { method: "POST", path: "/topics/materialize-graph", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5438
5034
|
"merge": { method: "POST", path: "/worktrees/merge", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
5439
5035
|
"modulate_confidence": { method: "POST", path: "/beliefs/confidence", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5440
5036
|
"open_pull_request": { method: "POST", path: "/worktrees/open-pull-request", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
@@ -5448,29 +5044,21 @@ var CONTRACTS = {
|
|
|
5448
5044
|
"refine_belief": { method: "PATCH", path: "/beliefs/refine", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5449
5045
|
"refine_question": { method: "PATCH", path: "/questions/refine", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5450
5046
|
"register_session": { method: "POST", path: "/coordination/register-session", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
5451
|
-
"remove_edge": { method: "DELETE", path: "/edges", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
5452
|
-
"remove_edges_between": { method: "DELETE", path: "/edges/between", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
5453
5047
|
"remove_lens_from_topic": { method: "DELETE", path: "/lenses/apply", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
5454
5048
|
"resolve_effective_ontology": { method: "POST", path: "/ontologies/effective", kind: "query", idempotent: false, surfaceIntent: "mcp_workflow" },
|
|
5455
|
-
"resolve_interactive_principal": { method: "POST", path: "/control-plane/identity/resolve-interactive-principal", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5456
|
-
"run_graph_intelligence_query": { method: "POST", path: "/graph-intelligence/run", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
5457
5049
|
"search_beliefs": { method: "POST", path: "/beliefs/search", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5458
5050
|
"search_evidence": { method: "POST", path: "/evidence/search", kind: "query", idempotent: false, surfaceIntent: "mcp_core" },
|
|
5459
5051
|
"seed_belief_lattice": { method: "POST", path: "/scope/belief-lattice/seed", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
5460
5052
|
"send_agent_message": { method: "POST", path: "/coordination/messages/send", kind: "mutation", idempotent: true, surfaceIntent: "system" },
|
|
5461
|
-
"supersede_epistemic_node": { method: "POST", path: "/nodes/supersede", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5462
5053
|
"trace_entity_impact": { method: "POST", path: "/graph/trace-entity-impact", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
5463
5054
|
"traverse_graph": { method: "POST", path: "/graph/traverse", kind: "query", idempotent: false, surfaceIntent: "mcp_analysis" },
|
|
5464
5055
|
"trigger_belief_review": { method: "POST", path: "/context/belief-review", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
5465
|
-
"update_edge": { method: "PATCH", path: "/edges", kind: "mutation", idempotent: true, surfaceIntent: "mcp_analysis" },
|
|
5466
|
-
"update_epistemic_node": { method: "PATCH", path: "/nodes", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5467
5056
|
"update_ontology": { method: "PATCH", path: "/ontologies", kind: "mutation", idempotent: true, surfaceIntent: "mcp_governance" },
|
|
5468
5057
|
"update_question_status": { method: "PATCH", path: "/questions/status", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5469
5058
|
"update_task": { method: "PATCH", path: "/tasks", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
5470
5059
|
"update_topic": { method: "PATCH", path: "/topics", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" },
|
|
5471
5060
|
"update_worktree_metadata": { method: "PATCH", path: "/worktrees/metadata", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" },
|
|
5472
|
-
"update_worktree_targets": { method: "PATCH", path: "/worktrees/targets", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" }
|
|
5473
|
-
"verify_epistemic_node": { method: "POST", path: "/nodes/verify", kind: "mutation", idempotent: true, surfaceIntent: "mcp_core" }
|
|
5061
|
+
"update_worktree_targets": { method: "PATCH", path: "/worktrees/targets", kind: "mutation", idempotent: true, surfaceIntent: "mcp_workflow" }
|
|
5474
5062
|
};
|
|
5475
5063
|
function createSessionId() {
|
|
5476
5064
|
return typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : randomIdempotencyKey();
|
|
@@ -5538,24 +5126,12 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5538
5126
|
archiveBelief(input = {}, idempotencyKey) {
|
|
5539
5127
|
return execute("archive_belief", input, idempotencyKey);
|
|
5540
5128
|
},
|
|
5541
|
-
archiveEpistemicNode(input = {}, idempotencyKey) {
|
|
5542
|
-
return execute("archive_epistemic_node", input, idempotencyKey);
|
|
5543
|
-
},
|
|
5544
5129
|
archiveOntology(input = {}, idempotencyKey) {
|
|
5545
5130
|
return execute("archive_ontology", input, idempotencyKey);
|
|
5546
5131
|
},
|
|
5547
5132
|
archiveQuestion(input = {}, idempotencyKey) {
|
|
5548
5133
|
return execute("archive_question", input, idempotencyKey);
|
|
5549
5134
|
},
|
|
5550
|
-
batchCreateEdges(input = {}, idempotencyKey) {
|
|
5551
|
-
return execute("batch_create_edges", input, idempotencyKey);
|
|
5552
|
-
},
|
|
5553
|
-
batchCreateEpistemicNodes(input = {}, idempotencyKey) {
|
|
5554
|
-
return execute("batch_create_epistemic_nodes", input, idempotencyKey);
|
|
5555
|
-
},
|
|
5556
|
-
beginBuildSession(input = {}, idempotencyKey) {
|
|
5557
|
-
return execute("begin_build_session", input, idempotencyKey);
|
|
5558
|
-
},
|
|
5559
5135
|
bisectConfidence(input = {}, idempotencyKey) {
|
|
5560
5136
|
return execute("bisect_confidence", input, idempotencyKey);
|
|
5561
5137
|
},
|
|
@@ -5586,9 +5162,6 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5586
5162
|
createEpistemicContract(input = {}, idempotencyKey) {
|
|
5587
5163
|
return execute("create_epistemic_contract", input, idempotencyKey);
|
|
5588
5164
|
},
|
|
5589
|
-
createEpistemicNode(input = {}, idempotencyKey) {
|
|
5590
|
-
return execute("create_epistemic_node", input, idempotencyKey);
|
|
5591
|
-
},
|
|
5592
5165
|
createEvidence(input = {}, idempotencyKey) {
|
|
5593
5166
|
return execute("create_evidence", input, idempotencyKey);
|
|
5594
5167
|
},
|
|
@@ -5670,9 +5243,6 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5670
5243
|
getContractStatus(input = {}, idempotencyKey) {
|
|
5671
5244
|
return execute("get_contract_status", input, idempotencyKey);
|
|
5672
5245
|
},
|
|
5673
|
-
getEpistemicNode(input = {}, idempotencyKey) {
|
|
5674
|
-
return execute("get_epistemic_node", input, idempotencyKey);
|
|
5675
|
-
},
|
|
5676
5246
|
getEvidence(input = {}, idempotencyKey) {
|
|
5677
5247
|
return execute("get_evidence", input, idempotencyKey);
|
|
5678
5248
|
},
|
|
@@ -5712,9 +5282,6 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5712
5282
|
getTopicCoverage(input = {}, idempotencyKey) {
|
|
5713
5283
|
return execute("get_topic_coverage", input, idempotencyKey);
|
|
5714
5284
|
},
|
|
5715
|
-
getTopicGraphSpine(input = {}, idempotencyKey) {
|
|
5716
|
-
return execute("get_topic_graph_spine", input, idempotencyKey);
|
|
5717
|
-
},
|
|
5718
5285
|
getTopicTree(input = {}, idempotencyKey) {
|
|
5719
5286
|
return execute("get_topic_tree", input, idempotencyKey);
|
|
5720
5287
|
},
|
|
@@ -5748,15 +5315,9 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5748
5315
|
listCampaigns(input = {}, idempotencyKey) {
|
|
5749
5316
|
return execute("list_campaigns", input, idempotencyKey);
|
|
5750
5317
|
},
|
|
5751
|
-
listEpistemicNodes(input = {}, idempotencyKey) {
|
|
5752
|
-
return execute("list_epistemic_nodes", input, idempotencyKey);
|
|
5753
|
-
},
|
|
5754
5318
|
listEvidence(input = {}, idempotencyKey) {
|
|
5755
5319
|
return execute("list_evidence", input, idempotencyKey);
|
|
5756
5320
|
},
|
|
5757
|
-
listGraphIntelligenceQueries(input = {}, idempotencyKey) {
|
|
5758
|
-
return execute("list_graph_intelligence_queries", input, idempotencyKey);
|
|
5759
|
-
},
|
|
5760
5321
|
listLenses(input = {}, idempotencyKey) {
|
|
5761
5322
|
return execute("list_lenses", input, idempotencyKey);
|
|
5762
5323
|
},
|
|
@@ -5781,9 +5342,6 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5781
5342
|
matchEntityType(input = {}, idempotencyKey) {
|
|
5782
5343
|
return execute("match_entity_type", input, idempotencyKey);
|
|
5783
5344
|
},
|
|
5784
|
-
materializeTopicGraph(input = {}, idempotencyKey) {
|
|
5785
|
-
return execute("materialize_topic_graph", input, idempotencyKey);
|
|
5786
|
-
},
|
|
5787
5345
|
merge(input = {}, idempotencyKey) {
|
|
5788
5346
|
return execute("merge", input, idempotencyKey);
|
|
5789
5347
|
},
|
|
@@ -5823,24 +5381,12 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5823
5381
|
registerSession(input = {}, idempotencyKey) {
|
|
5824
5382
|
return execute("register_session", input, idempotencyKey);
|
|
5825
5383
|
},
|
|
5826
|
-
removeEdge(input = {}, idempotencyKey) {
|
|
5827
|
-
return execute("remove_edge", input, idempotencyKey);
|
|
5828
|
-
},
|
|
5829
|
-
removeEdgesBetween(input = {}, idempotencyKey) {
|
|
5830
|
-
return execute("remove_edges_between", input, idempotencyKey);
|
|
5831
|
-
},
|
|
5832
5384
|
removeLensFromTopic(input = {}, idempotencyKey) {
|
|
5833
5385
|
return execute("remove_lens_from_topic", input, idempotencyKey);
|
|
5834
5386
|
},
|
|
5835
5387
|
resolveEffectiveOntology(input = {}, idempotencyKey) {
|
|
5836
5388
|
return execute("resolve_effective_ontology", input, idempotencyKey);
|
|
5837
5389
|
},
|
|
5838
|
-
resolveInteractivePrincipal(input = {}, idempotencyKey) {
|
|
5839
|
-
return execute("resolve_interactive_principal", input, idempotencyKey);
|
|
5840
|
-
},
|
|
5841
|
-
runGraphIntelligenceQuery(input = {}, idempotencyKey) {
|
|
5842
|
-
return execute("run_graph_intelligence_query", input, idempotencyKey);
|
|
5843
|
-
},
|
|
5844
5390
|
searchBeliefs(input = {}, idempotencyKey) {
|
|
5845
5391
|
return execute("search_beliefs", input, idempotencyKey);
|
|
5846
5392
|
},
|
|
@@ -5853,9 +5399,6 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5853
5399
|
sendAgentMessage(input = {}, idempotencyKey) {
|
|
5854
5400
|
return execute("send_agent_message", input, idempotencyKey);
|
|
5855
5401
|
},
|
|
5856
|
-
supersedeEpistemicNode(input = {}, idempotencyKey) {
|
|
5857
|
-
return execute("supersede_epistemic_node", input, idempotencyKey);
|
|
5858
|
-
},
|
|
5859
5402
|
traceEntityImpact(input = {}, idempotencyKey) {
|
|
5860
5403
|
return execute("trace_entity_impact", input, idempotencyKey);
|
|
5861
5404
|
},
|
|
@@ -5865,12 +5408,6 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5865
5408
|
triggerBeliefReview(input = {}, idempotencyKey) {
|
|
5866
5409
|
return execute("trigger_belief_review", input, idempotencyKey);
|
|
5867
5410
|
},
|
|
5868
|
-
updateEdge(input = {}, idempotencyKey) {
|
|
5869
|
-
return execute("update_edge", input, idempotencyKey);
|
|
5870
|
-
},
|
|
5871
|
-
updateEpistemicNode(input = {}, idempotencyKey) {
|
|
5872
|
-
return execute("update_epistemic_node", input, idempotencyKey);
|
|
5873
|
-
},
|
|
5874
5411
|
updateOntology(input = {}, idempotencyKey) {
|
|
5875
5412
|
return execute("update_ontology", input, idempotencyKey);
|
|
5876
5413
|
},
|
|
@@ -5888,9 +5425,6 @@ function createFunctionSurfaceClient(config = {}) {
|
|
|
5888
5425
|
},
|
|
5889
5426
|
updateWorktreeTargets(input = {}, idempotencyKey) {
|
|
5890
5427
|
return execute("update_worktree_targets", input, idempotencyKey);
|
|
5891
|
-
},
|
|
5892
|
-
verifyEpistemicNode(input = {}, idempotencyKey) {
|
|
5893
|
-
return execute("verify_epistemic_node", input, idempotencyKey);
|
|
5894
5428
|
}
|
|
5895
5429
|
};
|
|
5896
5430
|
}
|
|
@@ -6098,7 +5632,7 @@ var ORG_GRAPH_SEARCH_FIELDS = [
|
|
|
6098
5632
|
"cursor",
|
|
6099
5633
|
"provenanceScope"
|
|
6100
5634
|
];
|
|
6101
|
-
function
|
|
5635
|
+
function cleanString5(value, label) {
|
|
6102
5636
|
const normalized = value?.trim();
|
|
6103
5637
|
if (!normalized) {
|
|
6104
5638
|
throw new Error(`${label} is required`);
|
|
@@ -6120,9 +5654,9 @@ function searchBody(input) {
|
|
|
6120
5654
|
"orgGraphSearch.search"
|
|
6121
5655
|
);
|
|
6122
5656
|
return {
|
|
6123
|
-
tenantId:
|
|
6124
|
-
workspaceId:
|
|
6125
|
-
query:
|
|
5657
|
+
tenantId: cleanString5(input.tenantId, "tenantId"),
|
|
5658
|
+
workspaceId: cleanString5(input.workspaceId, "workspaceId"),
|
|
5659
|
+
query: cleanString5(input.query, "query"),
|
|
6126
5660
|
nodeTypes: input.nodeTypes,
|
|
6127
5661
|
minConfidence: input.minConfidence,
|
|
6128
5662
|
limit: input.limit,
|
|
@@ -6132,8 +5666,8 @@ function searchBody(input) {
|
|
|
6132
5666
|
}
|
|
6133
5667
|
function listQuery2(input) {
|
|
6134
5668
|
return {
|
|
6135
|
-
tenantId:
|
|
6136
|
-
workspaceId:
|
|
5669
|
+
tenantId: cleanString5(input.tenantId, "tenantId"),
|
|
5670
|
+
workspaceId: cleanString5(input.workspaceId, "workspaceId"),
|
|
6137
5671
|
nodeTypes: input.nodeTypes?.join(","),
|
|
6138
5672
|
minConfidence: input.minConfidence,
|
|
6139
5673
|
limit: input.limit,
|
|
@@ -6167,8 +5701,8 @@ function createOrgGraphSearchClient(config = {}) {
|
|
|
6167
5701
|
return gateway.request({
|
|
6168
5702
|
path: `/api/platform/v1/org-graph-search/nodes/${nodePath}${toQueryString(
|
|
6169
5703
|
{
|
|
6170
|
-
tenantId:
|
|
6171
|
-
workspaceId:
|
|
5704
|
+
tenantId: cleanString5(input.tenantId, "tenantId"),
|
|
5705
|
+
workspaceId: cleanString5(input.workspaceId, "workspaceId"),
|
|
6172
5706
|
globalId: nodeId ? void 0 : globalId
|
|
6173
5707
|
}
|
|
6174
5708
|
)}`
|
|
@@ -6196,7 +5730,7 @@ function createOrgGraphSearchClient(config = {}) {
|
|
|
6196
5730
|
// src/packsClient.ts
|
|
6197
5731
|
function createPacksClient(config = {}) {
|
|
6198
5732
|
const gateway = createGatewayRequestClient(config);
|
|
6199
|
-
|
|
5733
|
+
return {
|
|
6200
5734
|
/**
|
|
6201
5735
|
* List catalog entries for available packs.
|
|
6202
5736
|
*/
|
|
@@ -6210,6 +5744,12 @@ function createPacksClient(config = {}) {
|
|
|
6210
5744
|
)
|
|
6211
5745
|
);
|
|
6212
5746
|
},
|
|
5747
|
+
/**
|
|
5748
|
+
* @deprecated Use listCatalog.
|
|
5749
|
+
*/
|
|
5750
|
+
async getCatalog() {
|
|
5751
|
+
return this.listCatalog();
|
|
5752
|
+
},
|
|
6213
5753
|
/**
|
|
6214
5754
|
* Get the discovery catalog for packs.
|
|
6215
5755
|
*/
|
|
@@ -6239,6 +5779,12 @@ function createPacksClient(config = {}) {
|
|
|
6239
5779
|
)
|
|
6240
5780
|
);
|
|
6241
5781
|
},
|
|
5782
|
+
/**
|
|
5783
|
+
* @deprecated Use listStates.
|
|
5784
|
+
*/
|
|
5785
|
+
async getStates(query5 = {}) {
|
|
5786
|
+
return this.listStates(query5);
|
|
5787
|
+
},
|
|
6242
5788
|
/**
|
|
6243
5789
|
* Get health details for a pack.
|
|
6244
5790
|
*/
|
|
@@ -6262,6 +5808,12 @@ function createPacksClient(config = {}) {
|
|
|
6262
5808
|
)
|
|
6263
5809
|
);
|
|
6264
5810
|
},
|
|
5811
|
+
/**
|
|
5812
|
+
* @deprecated Use listTelemetry.
|
|
5813
|
+
*/
|
|
5814
|
+
async getTelemetry(query5 = {}) {
|
|
5815
|
+
return this.listTelemetry(query5);
|
|
5816
|
+
},
|
|
6265
5817
|
/**
|
|
6266
5818
|
* Create a pack entitlement.
|
|
6267
5819
|
*/
|
|
@@ -6273,6 +5825,18 @@ function createPacksClient(config = {}) {
|
|
|
6273
5825
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
6274
5826
|
});
|
|
6275
5827
|
},
|
|
5828
|
+
/**
|
|
5829
|
+
* Update a pack entitlement.
|
|
5830
|
+
*/
|
|
5831
|
+
async updateEntitlement(input, idempotencyKey) {
|
|
5832
|
+
return this.createEntitlement(input, idempotencyKey);
|
|
5833
|
+
},
|
|
5834
|
+
/**
|
|
5835
|
+
* @deprecated Use createEntitlement or updateEntitlement.
|
|
5836
|
+
*/
|
|
5837
|
+
async upsertEntitlement(input, idempotencyKey) {
|
|
5838
|
+
return this.createEntitlement(input, idempotencyKey);
|
|
5839
|
+
},
|
|
6276
5840
|
/**
|
|
6277
5841
|
* Install a pack.
|
|
6278
5842
|
*/
|
|
@@ -6329,13 +5893,6 @@ function createPacksClient(config = {}) {
|
|
|
6329
5893
|
});
|
|
6330
5894
|
}
|
|
6331
5895
|
};
|
|
6332
|
-
return Object.assign(client, {
|
|
6333
|
-
getCatalog: client.listCatalog,
|
|
6334
|
-
getStates: client.listStates,
|
|
6335
|
-
getTelemetry: client.listTelemetry,
|
|
6336
|
-
updateEntitlement: client.createEntitlement,
|
|
6337
|
-
upsertEntitlement: client.createEntitlement
|
|
6338
|
-
});
|
|
6339
5896
|
}
|
|
6340
5897
|
|
|
6341
5898
|
// src/policyClient.ts
|
|
@@ -6371,14 +5928,6 @@ function asRolePolicyArray(data) {
|
|
|
6371
5928
|
}
|
|
6372
5929
|
return data.map(asRolePolicyRecord).filter((row) => Boolean(row));
|
|
6373
5930
|
}
|
|
6374
|
-
function buildFilterByPermissionResponse(permission, allowedTopicIds, deniedTopics, count) {
|
|
6375
|
-
const result = {};
|
|
6376
|
-
result.permission = permission;
|
|
6377
|
-
result.allowedTopicIds = allowedTopicIds;
|
|
6378
|
-
result.deniedTopics = deniedTopics;
|
|
6379
|
-
result.count = count;
|
|
6380
|
-
return result;
|
|
6381
|
-
}
|
|
6382
5931
|
function createPolicyClient(config = {}) {
|
|
6383
5932
|
const gateway = createGatewayRequestClient(config);
|
|
6384
5933
|
return {
|
|
@@ -6601,15 +6150,15 @@ function createPolicyClient(config = {}) {
|
|
|
6601
6150
|
});
|
|
6602
6151
|
const allowedTopicIds = Array.isArray(response.data?.allowedTopicIds) ? response.data.allowedTopicIds : [];
|
|
6603
6152
|
const deniedTopics = Array.isArray(response.data?.deniedTopics) ? response.data.deniedTopics : [];
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6153
|
+
return {
|
|
6154
|
+
success: true,
|
|
6155
|
+
data: {
|
|
6156
|
+
permission,
|
|
6157
|
+
allowedTopicIds,
|
|
6158
|
+
deniedTopics,
|
|
6159
|
+
count: typeof response.data?.count === "number" ? response.data.count : allowedTopicIds.length
|
|
6160
|
+
}
|
|
6161
|
+
};
|
|
6613
6162
|
}
|
|
6614
6163
|
};
|
|
6615
6164
|
}
|
|
@@ -6617,66 +6166,64 @@ function createPolicyClient(config = {}) {
|
|
|
6617
6166
|
// src/reportsClient.ts
|
|
6618
6167
|
function createReportsClient(config = {}) {
|
|
6619
6168
|
const gateway = createGatewayRequestClient(config);
|
|
6620
|
-
const listTemplates = async (args = {}) => gateway.request({
|
|
6621
|
-
path: `/api/platform/v1/reports/templates${toQueryString({
|
|
6622
|
-
slug: args.slug
|
|
6623
|
-
})}`
|
|
6624
|
-
}).then(
|
|
6625
|
-
(response) => mapGatewayData(response, (data) => {
|
|
6626
|
-
const rows = asListItems(data, "templates");
|
|
6627
|
-
return createListResult(rows, "templates");
|
|
6628
|
-
})
|
|
6629
|
-
);
|
|
6630
|
-
const listReports = async (input, args = {}) => {
|
|
6631
|
-
const topicId = resolveTopicId(input);
|
|
6632
|
-
if (!topicId) {
|
|
6633
|
-
throw new Error("topicId is required");
|
|
6634
|
-
}
|
|
6635
|
-
return gateway.request({
|
|
6636
|
-
path: `/api/platform/v1/reports/topics/${encodeURIComponent(topicId)}${toQueryString(
|
|
6637
|
-
{
|
|
6638
|
-
summary: typeof args.summary === "boolean" ? args.summary ? "true" : "false" : void 0
|
|
6639
|
-
}
|
|
6640
|
-
)}`
|
|
6641
|
-
}).then(
|
|
6642
|
-
(response) => mapGatewayData(
|
|
6643
|
-
response,
|
|
6644
|
-
(data) => createListResult(Array.isArray(data) ? data : [], "reports")
|
|
6645
|
-
)
|
|
6646
|
-
);
|
|
6647
|
-
};
|
|
6648
|
-
const getReport = async (reportId) => gateway.request({
|
|
6649
|
-
path: `/api/platform/v1/reports/${encodeURIComponent(reportId)}`
|
|
6650
|
-
});
|
|
6651
6169
|
return {
|
|
6652
6170
|
/**
|
|
6653
6171
|
* List report templates.
|
|
6654
6172
|
*/
|
|
6655
|
-
listTemplates
|
|
6173
|
+
async listTemplates(args = {}) {
|
|
6174
|
+
return gateway.request({
|
|
6175
|
+
path: `/api/platform/v1/reports/templates${toQueryString({
|
|
6176
|
+
slug: args.slug
|
|
6177
|
+
})}`
|
|
6178
|
+
}).then(
|
|
6179
|
+
(response) => mapGatewayData(response, (data) => {
|
|
6180
|
+
const record = data && typeof data === "object" ? data : {};
|
|
6181
|
+
const rows = Array.isArray(data) ? data : Array.isArray(record.templates) ? record.templates : [];
|
|
6182
|
+
return createListResult(rows, "templates");
|
|
6183
|
+
})
|
|
6184
|
+
);
|
|
6185
|
+
},
|
|
6656
6186
|
/**
|
|
6657
6187
|
* @deprecated Use listTemplates.
|
|
6658
6188
|
*/
|
|
6659
|
-
getTemplates
|
|
6189
|
+
async getTemplates(args = {}) {
|
|
6190
|
+
return this.listTemplates(args);
|
|
6191
|
+
},
|
|
6660
6192
|
/**
|
|
6661
6193
|
* List reports for a topic scope.
|
|
6662
6194
|
*/
|
|
6663
|
-
listReports,
|
|
6195
|
+
async listReports(input, args = {}) {
|
|
6196
|
+
const topicId = resolveTopicId(input);
|
|
6197
|
+
if (!topicId) {
|
|
6198
|
+
throw new Error("topicId is required");
|
|
6199
|
+
}
|
|
6200
|
+
return gateway.request({
|
|
6201
|
+
path: `/api/platform/v1/reports/topics/${encodeURIComponent(topicId)}${toQueryString(
|
|
6202
|
+
{
|
|
6203
|
+
summary: typeof args.summary === "boolean" ? args.summary ? "true" : "false" : void 0
|
|
6204
|
+
}
|
|
6205
|
+
)}`
|
|
6206
|
+
}).then(
|
|
6207
|
+
(response) => mapGatewayData(
|
|
6208
|
+
response,
|
|
6209
|
+
(data) => createListResult(Array.isArray(data) ? data : [], "reports")
|
|
6210
|
+
)
|
|
6211
|
+
);
|
|
6212
|
+
},
|
|
6664
6213
|
/**
|
|
6665
6214
|
* Get a generated report.
|
|
6666
6215
|
*/
|
|
6667
|
-
getReport
|
|
6216
|
+
async getReport(reportId) {
|
|
6217
|
+
return gateway.request({
|
|
6218
|
+
path: `/api/platform/v1/reports/${encodeURIComponent(reportId)}`
|
|
6219
|
+
});
|
|
6220
|
+
}
|
|
6668
6221
|
};
|
|
6669
6222
|
}
|
|
6670
6223
|
|
|
6671
6224
|
// src/schemaClient.ts
|
|
6672
6225
|
function createSchemaClient(config = {}) {
|
|
6673
6226
|
const gateway = createGatewayRequestClient(config);
|
|
6674
|
-
const createEntitlement = (input, idempotencyKey) => gateway.request({
|
|
6675
|
-
path: "/api/platform/v1/schema/entitlements",
|
|
6676
|
-
method: "POST",
|
|
6677
|
-
body: input,
|
|
6678
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
6679
|
-
});
|
|
6680
6227
|
return {
|
|
6681
6228
|
/**
|
|
6682
6229
|
* List schema packs.
|
|
@@ -6728,108 +6275,27 @@ function createSchemaClient(config = {}) {
|
|
|
6728
6275
|
/**
|
|
6729
6276
|
* Create a schema entitlement.
|
|
6730
6277
|
*/
|
|
6731
|
-
createEntitlement,
|
|
6278
|
+
async createEntitlement(input, idempotencyKey) {
|
|
6279
|
+
return gateway.request({
|
|
6280
|
+
path: "/api/platform/v1/schema/entitlements",
|
|
6281
|
+
method: "POST",
|
|
6282
|
+
body: input,
|
|
6283
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
6284
|
+
});
|
|
6285
|
+
},
|
|
6732
6286
|
/**
|
|
6733
6287
|
* Update a schema entitlement.
|
|
6734
6288
|
*/
|
|
6735
|
-
updateEntitlement
|
|
6289
|
+
async updateEntitlement(input, idempotencyKey) {
|
|
6290
|
+
return this.createEntitlement(input, idempotencyKey);
|
|
6291
|
+
},
|
|
6736
6292
|
/**
|
|
6737
6293
|
* @deprecated Use createEntitlement or updateEntitlement.
|
|
6738
6294
|
*/
|
|
6739
|
-
upsertEntitlement
|
|
6740
|
-
|
|
6741
|
-
}
|
|
6742
|
-
|
|
6743
|
-
// src/clientHelpers.ts
|
|
6744
|
-
function normalizeCustomNamespace(namespace) {
|
|
6745
|
-
return namespace.trim() || "custom";
|
|
6746
|
-
}
|
|
6747
|
-
function normalizeCustomToolPayload(input) {
|
|
6748
|
-
return input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
6749
|
-
}
|
|
6750
|
-
function resolveCustomToolFullName(name) {
|
|
6751
|
-
return name.includes(".") ? name : `custom.${name}`;
|
|
6752
|
-
}
|
|
6753
|
-
function buildBeliefsRefinePayload(textOrInput, rationale) {
|
|
6754
|
-
return typeof textOrInput === "string" ? { text: textOrInput, rationale } : { text: textOrInput.text, rationale: textOrInput.rationale };
|
|
6755
|
-
}
|
|
6756
|
-
function buildBeliefsArchivePayload(input) {
|
|
6757
|
-
return typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
|
|
6758
|
-
}
|
|
6759
|
-
function asNodeArray(data) {
|
|
6760
|
-
const rows = asListItems(data, "nodes");
|
|
6761
|
-
if (rows.length > 0) {
|
|
6762
|
-
return rows.filter(
|
|
6763
|
-
(value) => Boolean(value) && typeof value === "object"
|
|
6764
|
-
);
|
|
6765
|
-
}
|
|
6766
|
-
if (data && typeof data === "object") {
|
|
6767
|
-
return [data];
|
|
6768
|
-
}
|
|
6769
|
-
return [];
|
|
6770
|
-
}
|
|
6771
|
-
function requireTopicId4(args) {
|
|
6772
|
-
const topicId = resolveTopicId(args);
|
|
6773
|
-
if (!topicId) {
|
|
6774
|
-
throw new Error("topicId is required");
|
|
6775
|
-
}
|
|
6776
|
-
return topicId;
|
|
6777
|
-
}
|
|
6778
|
-
function requireTopicOrProjectId(args) {
|
|
6779
|
-
const topicId = args.topicId?.trim() || args.projectId?.trim() || void 0;
|
|
6780
|
-
if (!topicId) {
|
|
6781
|
-
throw new Error("topicId is required");
|
|
6782
|
-
}
|
|
6783
|
-
return topicId;
|
|
6784
|
-
}
|
|
6785
|
-
var AUDIT_NODE_REFERENCE_KEY_PATTERN = /(^|_)(id|nodeid|beliefid|resourceid|targetid|sourceid|subjectid|globalid|entityid|recordid|fromnodeid|tonodeid|linkednodeid|linkedbeliefid|nodeids|beliefids|resourceids)$/i;
|
|
6786
|
-
function matchesAuditNodeReference(value, nodeId) {
|
|
6787
|
-
if (Array.isArray(value)) {
|
|
6788
|
-
return value.some((entry) => matchesAuditNodeReference(entry, nodeId));
|
|
6789
|
-
}
|
|
6790
|
-
if (!value || typeof value !== "object") {
|
|
6791
|
-
return false;
|
|
6792
|
-
}
|
|
6793
|
-
return Object.entries(value).some(([key, entry]) => {
|
|
6794
|
-
if (typeof entry === "string" && entry === nodeId && AUDIT_NODE_REFERENCE_KEY_PATTERN.test(key)) {
|
|
6795
|
-
return true;
|
|
6796
|
-
}
|
|
6797
|
-
if (Array.isArray(entry) && AUDIT_NODE_REFERENCE_KEY_PATTERN.test(key) && entry.some((item) => item === nodeId)) {
|
|
6798
|
-
return true;
|
|
6799
|
-
}
|
|
6800
|
-
return matchesAuditNodeReference(entry, nodeId);
|
|
6801
|
-
});
|
|
6802
|
-
}
|
|
6803
|
-
function requireText(args) {
|
|
6804
|
-
const text = resolveText(args);
|
|
6805
|
-
if (!text) {
|
|
6806
|
-
throw new Error("text is required");
|
|
6807
|
-
}
|
|
6808
|
-
return text;
|
|
6809
|
-
}
|
|
6810
|
-
function requireBaseRate(args) {
|
|
6811
|
-
const baseRate = typeof args.baseRate === "number" && Number.isFinite(args.baseRate) ? args.baseRate : 0.5;
|
|
6812
|
-
if (baseRate < 0 || baseRate > 1) {
|
|
6813
|
-
throw new Error("baseRate must be within [0, 1].");
|
|
6814
|
-
}
|
|
6815
|
-
return baseRate;
|
|
6816
|
-
}
|
|
6817
|
-
function sdkQueryString(input) {
|
|
6818
|
-
const params = new URLSearchParams();
|
|
6819
|
-
for (const [key, value] of Object.entries(input)) {
|
|
6820
|
-
if (value === void 0 || value === null) {
|
|
6821
|
-
continue;
|
|
6822
|
-
}
|
|
6823
|
-
if (Array.isArray(value)) {
|
|
6824
|
-
if (value.length > 0) {
|
|
6825
|
-
params.set(key, value.join(","));
|
|
6826
|
-
}
|
|
6827
|
-
continue;
|
|
6295
|
+
async upsertEntitlement(input, idempotencyKey) {
|
|
6296
|
+
return this.createEntitlement(input, idempotencyKey);
|
|
6828
6297
|
}
|
|
6829
|
-
|
|
6830
|
-
}
|
|
6831
|
-
const serialized = params.toString();
|
|
6832
|
-
return serialized ? `?${serialized}` : "";
|
|
6298
|
+
};
|
|
6833
6299
|
}
|
|
6834
6300
|
|
|
6835
6301
|
// src/telemetryClient.ts
|
|
@@ -7002,16 +6468,6 @@ function query4(input) {
|
|
|
7002
6468
|
cursor: input.cursor
|
|
7003
6469
|
};
|
|
7004
6470
|
}
|
|
7005
|
-
function effectiveToolsQuery(input) {
|
|
7006
|
-
return {
|
|
7007
|
-
...query4(input),
|
|
7008
|
-
callerRole: input.callerRole,
|
|
7009
|
-
surface: input.surface,
|
|
7010
|
-
sessionType: input.sessionType,
|
|
7011
|
-
permittedToolNames: input.permittedToolNames ? JSON.stringify(input.permittedToolNames) : void 0,
|
|
7012
|
-
executableOnly: input.executableOnly
|
|
7013
|
-
};
|
|
7014
|
-
}
|
|
7015
6471
|
function writeBody(input, operation) {
|
|
7016
6472
|
return knownPayload(input, TOOL_REGISTRY_FIELDS, operation);
|
|
7017
6473
|
}
|
|
@@ -7040,9 +6496,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
7040
6496
|
},
|
|
7041
6497
|
listEffectiveTools(input) {
|
|
7042
6498
|
return gateway.request({
|
|
7043
|
-
path: `/api/platform/v1/tools/effective${toQueryString(
|
|
7044
|
-
effectiveToolsQuery(input)
|
|
7045
|
-
)}`
|
|
6499
|
+
path: `/api/platform/v1/tools/effective${toQueryString(query4(input))}`
|
|
7046
6500
|
}).then(
|
|
7047
6501
|
(response) => mapGatewayData(
|
|
7048
6502
|
response,
|
|
@@ -7133,7 +6587,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
7133
6587
|
}
|
|
7134
6588
|
|
|
7135
6589
|
// src/version.ts
|
|
7136
|
-
var LUCERN_SDK_VERSION = "0.
|
|
6590
|
+
var LUCERN_SDK_VERSION = "0.2.0-alpha.1";
|
|
7137
6591
|
|
|
7138
6592
|
// src/workflowClient.ts
|
|
7139
6593
|
function normalizeLensQuery(value) {
|
|
@@ -7327,6 +6781,12 @@ function createWorkflowClient(config = {}) {
|
|
|
7327
6781
|
)
|
|
7328
6782
|
);
|
|
7329
6783
|
},
|
|
6784
|
+
/**
|
|
6785
|
+
* @deprecated Use createWorktree.
|
|
6786
|
+
*/
|
|
6787
|
+
async addWorktree(input, idempotencyKey) {
|
|
6788
|
+
return client.createWorktree(input, idempotencyKey);
|
|
6789
|
+
},
|
|
7330
6790
|
/**
|
|
7331
6791
|
* Merge a worktree into the main belief line.
|
|
7332
6792
|
*/
|
|
@@ -7524,29 +6984,58 @@ function createWorkflowClient(config = {}) {
|
|
|
7524
6984
|
body: input,
|
|
7525
6985
|
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
7526
6986
|
});
|
|
6987
|
+
},
|
|
6988
|
+
/**
|
|
6989
|
+
* @deprecated Use createBranch.
|
|
6990
|
+
*/
|
|
6991
|
+
async createPillar(input, idempotencyKey) {
|
|
6992
|
+
return client.createBranch(input, idempotencyKey);
|
|
6993
|
+
},
|
|
6994
|
+
/**
|
|
6995
|
+
* @deprecated Use addWorktree.
|
|
6996
|
+
*/
|
|
6997
|
+
async createSprint(input, idempotencyKey) {
|
|
6998
|
+
return client.createWorktree(input, idempotencyKey);
|
|
6999
|
+
},
|
|
7000
|
+
/**
|
|
7001
|
+
* @deprecated Use merge.
|
|
7002
|
+
*/
|
|
7003
|
+
async completeSprint(worktreeId, input, idempotencyKey) {
|
|
7004
|
+
return client.merge(worktreeId, input, idempotencyKey);
|
|
7005
|
+
},
|
|
7006
|
+
/**
|
|
7007
|
+
* @deprecated Use openPullRequest.
|
|
7008
|
+
*/
|
|
7009
|
+
async requestReview(worktreeId, input, idempotencyKey) {
|
|
7010
|
+
return client.openPullRequest(worktreeId, input, idempotencyKey);
|
|
7011
|
+
},
|
|
7012
|
+
/**
|
|
7013
|
+
* @deprecated Use push.
|
|
7014
|
+
*/
|
|
7015
|
+
async publishFindings(worktreeId, input, idempotencyKey) {
|
|
7016
|
+
return client.push(worktreeId, input, idempotencyKey);
|
|
7527
7017
|
}
|
|
7528
7018
|
};
|
|
7529
|
-
return
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7019
|
+
return client;
|
|
7020
|
+
}
|
|
7021
|
+
|
|
7022
|
+
// src/client.ts
|
|
7023
|
+
function asNodeArray(data) {
|
|
7024
|
+
const rows = asListItems(data, "nodes");
|
|
7025
|
+
if (rows.length > 0) {
|
|
7026
|
+
return rows.filter(
|
|
7027
|
+
(value) => Boolean(value) && typeof value === "object"
|
|
7028
|
+
);
|
|
7029
|
+
}
|
|
7030
|
+
if (data && typeof data === "object") {
|
|
7031
|
+
return [data];
|
|
7032
|
+
}
|
|
7033
|
+
return [];
|
|
7537
7034
|
}
|
|
7538
|
-
|
|
7539
|
-
// src/client.ts
|
|
7540
7035
|
function toGatewayConfig(config) {
|
|
7541
7036
|
return {
|
|
7542
7037
|
baseUrl: config.baseUrl,
|
|
7543
7038
|
fetchImpl: config.fetchImpl,
|
|
7544
|
-
apiKey: config.apiKey,
|
|
7545
|
-
userToken: config.userToken,
|
|
7546
|
-
environment: config.environment,
|
|
7547
|
-
clerkId: config.clerkId,
|
|
7548
|
-
userId: config.userId,
|
|
7549
|
-
deploymentHost: config.deploymentHost,
|
|
7550
7039
|
maxRetries: config.maxRetries,
|
|
7551
7040
|
timeoutMs: config.timeoutMs,
|
|
7552
7041
|
timeoutMsByMethod: config.timeoutMsByMethod,
|
|
@@ -7555,15 +7044,62 @@ function toGatewayConfig(config) {
|
|
|
7555
7044
|
onResponse: config.onResponse,
|
|
7556
7045
|
authContext: config.authContext,
|
|
7557
7046
|
requireCanonicalAuthContext: config.requireCanonicalAuthContext,
|
|
7558
|
-
getAuthHeaders:
|
|
7047
|
+
getAuthHeaders: async () => {
|
|
7048
|
+
const base = config.getAuthHeaders ? await config.getAuthHeaders() : {};
|
|
7049
|
+
if (config.apiKey && !base["x-lucern-key"] && !base.Authorization) {
|
|
7050
|
+
base["x-lucern-key"] = config.apiKey;
|
|
7051
|
+
}
|
|
7052
|
+
if (config.userToken && !base["x-lucern-session-token"]) {
|
|
7053
|
+
base["x-lucern-session-token"] = config.userToken;
|
|
7054
|
+
}
|
|
7055
|
+
if (config.environment && !base["x-lucern-environment"]) {
|
|
7056
|
+
base["x-lucern-environment"] = config.environment;
|
|
7057
|
+
}
|
|
7058
|
+
return base;
|
|
7059
|
+
}
|
|
7559
7060
|
};
|
|
7560
7061
|
}
|
|
7561
|
-
function
|
|
7562
|
-
const
|
|
7563
|
-
if (
|
|
7564
|
-
|
|
7062
|
+
function requireTopicId4(args) {
|
|
7063
|
+
const topicId = resolveTopicId(args);
|
|
7064
|
+
if (!topicId) {
|
|
7065
|
+
throw new Error("topicId is required");
|
|
7066
|
+
}
|
|
7067
|
+
return topicId;
|
|
7068
|
+
}
|
|
7069
|
+
var AUDIT_NODE_REFERENCE_KEY_PATTERN = /(^|_)(id|nodeid|beliefid|resourceid|targetid|sourceid|subjectid|globalid|entityid|recordid|fromnodeid|tonodeid|linkednodeid|linkedbeliefid|nodeids|beliefids|resourceids)$/i;
|
|
7070
|
+
function matchesAuditNodeReference(value, nodeId) {
|
|
7071
|
+
if (Array.isArray(value)) {
|
|
7072
|
+
return value.some((entry) => matchesAuditNodeReference(entry, nodeId));
|
|
7073
|
+
}
|
|
7074
|
+
if (!value || typeof value !== "object") {
|
|
7075
|
+
return false;
|
|
7076
|
+
}
|
|
7077
|
+
return Object.entries(value).some(([key, entry]) => {
|
|
7078
|
+
if (typeof entry === "string" && entry === nodeId && AUDIT_NODE_REFERENCE_KEY_PATTERN.test(key)) {
|
|
7079
|
+
return true;
|
|
7080
|
+
}
|
|
7081
|
+
if (Array.isArray(entry) && AUDIT_NODE_REFERENCE_KEY_PATTERN.test(key) && entry.some((item) => item === nodeId)) {
|
|
7082
|
+
return true;
|
|
7083
|
+
}
|
|
7084
|
+
return matchesAuditNodeReference(entry, nodeId);
|
|
7085
|
+
});
|
|
7086
|
+
}
|
|
7087
|
+
function requireText(args) {
|
|
7088
|
+
const text = resolveText(args);
|
|
7089
|
+
if (!text) {
|
|
7090
|
+
throw new Error("text is required");
|
|
7091
|
+
}
|
|
7092
|
+
return text;
|
|
7093
|
+
}
|
|
7094
|
+
function requireBaseRate(args) {
|
|
7095
|
+
const baseRate = typeof args.baseRate === "number" && Number.isFinite(args.baseRate) ? args.baseRate : 0.5;
|
|
7096
|
+
if (baseRate < 0 || baseRate > 1) {
|
|
7097
|
+
throw new Error("baseRate must be within [0, 1].");
|
|
7565
7098
|
}
|
|
7566
|
-
return
|
|
7099
|
+
return baseRate;
|
|
7100
|
+
}
|
|
7101
|
+
function exposeGatewayData(response) {
|
|
7102
|
+
return Object.assign({}, response, response.data);
|
|
7567
7103
|
}
|
|
7568
7104
|
function createLucernClient(config = {}) {
|
|
7569
7105
|
const gatewayConfig = toGatewayConfig(config);
|
|
@@ -7584,7 +7120,6 @@ function createLucernClient(config = {}) {
|
|
|
7584
7120
|
const auditClient = createAuditClient(gatewayConfig);
|
|
7585
7121
|
const authDeviceClient = createAuthDeviceClient(gatewayConfig);
|
|
7586
7122
|
const adminClient = createAdminClient(gatewayConfig);
|
|
7587
|
-
const accessControlClient = createAccessControlClient(gatewayConfig);
|
|
7588
7123
|
const answersClient = createAnswersClient(gatewayConfig);
|
|
7589
7124
|
const contradictionsFacade = createContradictionsFacade(gatewayConfig);
|
|
7590
7125
|
const edgesFacade = createEdgesFacade(gatewayConfig);
|
|
@@ -7604,7 +7139,6 @@ function createLucernClient(config = {}) {
|
|
|
7604
7139
|
const ontologyLinksClient = createOntologyLinksClient(gatewayConfig);
|
|
7605
7140
|
const orgGraphSearchClient = createOrgGraphSearchClient(gatewayConfig);
|
|
7606
7141
|
const functionSurfaceClient = createFunctionSurfaceClient(gatewayConfig);
|
|
7607
|
-
const controlPlaneClient = createControlPlaneClient(gatewayConfig);
|
|
7608
7142
|
const toolRegistryClient = createToolRegistryClient(gatewayConfig);
|
|
7609
7143
|
const modelRuntimeClient = createModelRuntimeClient(gatewayConfig);
|
|
7610
7144
|
const packsClient = createPacksClient(gatewayConfig);
|
|
@@ -7654,11 +7188,11 @@ function createLucernClient(config = {}) {
|
|
|
7654
7188
|
}
|
|
7655
7189
|
}
|
|
7656
7190
|
const invokeCustomTool = async (fullName, input = {}) => {
|
|
7657
|
-
const payload =
|
|
7191
|
+
const payload = input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
7658
7192
|
return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
|
|
7659
7193
|
};
|
|
7660
7194
|
const getCustomNamespace = (namespace) => {
|
|
7661
|
-
const normalized =
|
|
7195
|
+
const normalized = namespace.trim() || "custom";
|
|
7662
7196
|
const cached = customNamespaceCache.get(normalized);
|
|
7663
7197
|
if (cached) {
|
|
7664
7198
|
return cached;
|
|
@@ -7790,7 +7324,7 @@ function createLucernClient(config = {}) {
|
|
|
7790
7324
|
topicId,
|
|
7791
7325
|
nodeType: "contradiction",
|
|
7792
7326
|
limit: 500
|
|
7793
|
-
}) : args.nodeId ? await graphClient.
|
|
7327
|
+
}) : args.nodeId ? await graphClient.queryNodes({ nodeId: args.nodeId }) : { data: [] };
|
|
7794
7328
|
const contradictions = asNodeArray(response.data).filter((node) => {
|
|
7795
7329
|
const status = typeof node.metadata?.status === "string" ? node.metadata.status : typeof node.status === "string" ? node.status : "unresolved";
|
|
7796
7330
|
if (args.status && status !== args.status) {
|
|
@@ -7970,141 +7504,39 @@ function createLucernClient(config = {}) {
|
|
|
7970
7504
|
}).then(exposeGatewayData);
|
|
7971
7505
|
}
|
|
7972
7506
|
const nodesNamespace = {
|
|
7973
|
-
list
|
|
7507
|
+
list(query5) {
|
|
7508
|
+
return graphClient.listNodes(query5);
|
|
7509
|
+
},
|
|
7974
7510
|
get(input) {
|
|
7975
7511
|
return graphClient.getNode(
|
|
7976
7512
|
typeof input === "string" ? { nodeId: input } : input
|
|
7977
7513
|
);
|
|
7978
7514
|
},
|
|
7979
7515
|
create(input, idempotencyKey) {
|
|
7980
|
-
return
|
|
7981
|
-
},
|
|
7982
|
-
createEpistemicNode(input, idempotencyKey) {
|
|
7983
|
-
return functionSurfaceClient.createEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
7516
|
+
return graphClient.createNode(input, idempotencyKey);
|
|
7984
7517
|
},
|
|
7985
7518
|
update(input, idempotencyKey) {
|
|
7986
|
-
return
|
|
7987
|
-
},
|
|
7988
|
-
updateEpistemicNode(input, idempotencyKey) {
|
|
7989
|
-
return functionSurfaceClient.updateEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
7519
|
+
return graphClient.updateNode(input, idempotencyKey);
|
|
7990
7520
|
},
|
|
7991
7521
|
batchCreate(input, idempotencyKey) {
|
|
7992
|
-
return
|
|
7993
|
-
},
|
|
7994
|
-
batchCreateEpistemicNodes(input, idempotencyKey) {
|
|
7995
|
-
return functionSurfaceClient.batchCreateEpistemicNodes(input, idempotencyKey).then(exposeGatewayData);
|
|
7996
|
-
},
|
|
7997
|
-
listByTopicAndType(input) {
|
|
7998
|
-
return gateway.request({
|
|
7999
|
-
path: `/api/platform/v1/nodes${sdkQueryString({
|
|
8000
|
-
topicId: requireTopicOrProjectId(input),
|
|
8001
|
-
nodeType: input.nodeType,
|
|
8002
|
-
nodeTypes: input.nodeTypes,
|
|
8003
|
-
query: input.query,
|
|
8004
|
-
sourceText: input.sourceText,
|
|
8005
|
-
limit: input.limit,
|
|
8006
|
-
cursor: input.cursor
|
|
8007
|
-
})}`
|
|
8008
|
-
}).then(exposeGatewayData);
|
|
8009
|
-
},
|
|
8010
|
-
countByTopicAndType(input) {
|
|
8011
|
-
return gateway.request({
|
|
8012
|
-
path: `/api/platform/v1/nodes/count${sdkQueryString({
|
|
8013
|
-
topicId: requireTopicOrProjectId(input),
|
|
8014
|
-
nodeType: input.nodeType,
|
|
8015
|
-
nodeTypes: input.nodeTypes,
|
|
8016
|
-
query: input.query,
|
|
8017
|
-
limit: input.limit
|
|
8018
|
-
})}`
|
|
8019
|
-
}).then(exposeGatewayData);
|
|
7522
|
+
return graphClient.batchCreateNodes(input, idempotencyKey);
|
|
8020
7523
|
},
|
|
8021
7524
|
supersede(input, idempotencyKey) {
|
|
8022
|
-
return
|
|
7525
|
+
return graphClient.supersedeNode(input, idempotencyKey);
|
|
8023
7526
|
},
|
|
8024
7527
|
verify(input, idempotencyKey) {
|
|
8025
|
-
return
|
|
8026
|
-
},
|
|
8027
|
-
archive(input, idempotencyKey) {
|
|
8028
|
-
return functionSurfaceClient.archiveEpistemicNode(input, idempotencyKey).then(exposeGatewayData);
|
|
8029
|
-
},
|
|
8030
|
-
hardDelete: graphClient.hardDeleteNode
|
|
8031
|
-
};
|
|
8032
|
-
const publicationNamespace = {
|
|
8033
|
-
create(input, idempotencyKey) {
|
|
8034
|
-
return gateway.request({
|
|
8035
|
-
path: "/api/platform/v1/publication",
|
|
8036
|
-
method: "POST",
|
|
8037
|
-
body: input,
|
|
8038
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
8039
|
-
}).then(exposeGatewayData);
|
|
8040
|
-
},
|
|
8041
|
-
update(publicationId, input, idempotencyKey) {
|
|
8042
|
-
return gateway.request({
|
|
8043
|
-
path: `/api/platform/v1/publication/${encodeURIComponent(
|
|
8044
|
-
publicationId
|
|
8045
|
-
)}`,
|
|
8046
|
-
method: "PATCH",
|
|
8047
|
-
body: input,
|
|
8048
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
8049
|
-
}).then(exposeGatewayData);
|
|
8050
|
-
},
|
|
8051
|
-
list(input = {}) {
|
|
8052
|
-
return gateway.request({
|
|
8053
|
-
path: `/api/platform/v1/publication${sdkQueryString(input)}`
|
|
8054
|
-
}).then(exposeGatewayData);
|
|
8055
|
-
},
|
|
8056
|
-
getByTopic(input) {
|
|
8057
|
-
const topicId = typeof input === "string" ? input : input.topicId;
|
|
8058
|
-
const workspaceId = typeof input === "string" ? void 0 : input.workspaceId;
|
|
8059
|
-
return gateway.request({
|
|
8060
|
-
path: `/api/platform/v1/publication/by-topic/${encodeURIComponent(
|
|
8061
|
-
topicId
|
|
8062
|
-
)}${sdkQueryString({ workspaceId })}`
|
|
8063
|
-
}).then(exposeGatewayData);
|
|
8064
|
-
},
|
|
8065
|
-
publish(publicationId, input = {}, idempotencyKey) {
|
|
8066
|
-
return gateway.request({
|
|
8067
|
-
path: `/api/platform/v1/publication/${encodeURIComponent(
|
|
8068
|
-
publicationId
|
|
8069
|
-
)}/publish`,
|
|
8070
|
-
method: "POST",
|
|
8071
|
-
body: input,
|
|
8072
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
8073
|
-
}).then(exposeGatewayData);
|
|
8074
|
-
},
|
|
8075
|
-
unpublish(publicationId, input = {}, idempotencyKey) {
|
|
8076
|
-
return gateway.request({
|
|
8077
|
-
path: `/api/platform/v1/publication/${encodeURIComponent(
|
|
8078
|
-
publicationId
|
|
8079
|
-
)}/unpublish`,
|
|
8080
|
-
method: "POST",
|
|
8081
|
-
body: input,
|
|
8082
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
8083
|
-
}).then(exposeGatewayData);
|
|
7528
|
+
return graphClient.verifyNode(input, idempotencyKey);
|
|
8084
7529
|
},
|
|
8085
|
-
|
|
8086
|
-
return
|
|
8087
|
-
path: `/api/platform/v1/publication/${encodeURIComponent(
|
|
8088
|
-
publicationId
|
|
8089
|
-
)}${sdkQueryString(input)}`,
|
|
8090
|
-
method: "DELETE"
|
|
8091
|
-
}).then(exposeGatewayData);
|
|
8092
|
-
}
|
|
8093
|
-
};
|
|
8094
|
-
const ontologyLinksNamespace = {
|
|
8095
|
-
...ontologyLinksClient,
|
|
8096
|
-
resolveThemeSource(input) {
|
|
8097
|
-
return gateway.request({
|
|
8098
|
-
path: "/api/platform/v1/ontology-links/theme-source",
|
|
8099
|
-
method: "POST",
|
|
8100
|
-
body: input
|
|
8101
|
-
}).then(exposeGatewayData);
|
|
7530
|
+
hardDelete(input, idempotencyKey) {
|
|
7531
|
+
return graphClient.hardDeleteNode(input, idempotencyKey);
|
|
8102
7532
|
}
|
|
8103
7533
|
};
|
|
8104
7534
|
return {
|
|
8105
7535
|
config,
|
|
8106
7536
|
version: LUCERN_SDK_VERSION,
|
|
8107
|
-
search
|
|
7537
|
+
search(query5, options) {
|
|
7538
|
+
return searchResources(query5, options);
|
|
7539
|
+
},
|
|
8108
7540
|
events: {
|
|
8109
7541
|
list(query5 = {}) {
|
|
8110
7542
|
return eventsFacade.list(query5).then(exposeGatewayData);
|
|
@@ -8140,7 +7572,10 @@ function createLucernClient(config = {}) {
|
|
|
8140
7572
|
return beliefsFacade.get(nodeId).then(exposeGatewayData);
|
|
8141
7573
|
},
|
|
8142
7574
|
refine(nodeId, textOrInput, rationale) {
|
|
8143
|
-
const payload =
|
|
7575
|
+
const payload = typeof textOrInput === "string" ? { text: textOrInput, rationale } : {
|
|
7576
|
+
text: textOrInput.text,
|
|
7577
|
+
rationale: textOrInput.rationale
|
|
7578
|
+
};
|
|
8144
7579
|
return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
|
|
8145
7580
|
},
|
|
8146
7581
|
updateConfidence(nodeId, input) {
|
|
@@ -8178,7 +7613,7 @@ function createLucernClient(config = {}) {
|
|
|
8178
7613
|
}).then(exposeGatewayData);
|
|
8179
7614
|
},
|
|
8180
7615
|
archive(nodeId, input) {
|
|
8181
|
-
const payload =
|
|
7616
|
+
const payload = typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
|
|
8182
7617
|
return beliefsFacade.archive(nodeId, payload).then(exposeGatewayData);
|
|
8183
7618
|
},
|
|
8184
7619
|
list(args) {
|
|
@@ -8198,7 +7633,9 @@ function createLucernClient(config = {}) {
|
|
|
8198
7633
|
confidenceHistory(nodeId) {
|
|
8199
7634
|
return beliefsFacade.confidenceHistory(nodeId).then(exposeGatewayData);
|
|
8200
7635
|
},
|
|
8201
|
-
opinionHistory
|
|
7636
|
+
opinionHistory(nodeId) {
|
|
7637
|
+
return getOpinionHistory(nodeId);
|
|
7638
|
+
},
|
|
8202
7639
|
createContract(nodeId, input) {
|
|
8203
7640
|
return beliefsFacade.createContract(nodeId, input).then(exposeGatewayData);
|
|
8204
7641
|
},
|
|
@@ -8233,13 +7670,7 @@ function createLucernClient(config = {}) {
|
|
|
8233
7670
|
}
|
|
8234
7671
|
},
|
|
8235
7672
|
edges: {
|
|
8236
|
-
create(args
|
|
8237
|
-
if (args.from && args.to) {
|
|
8238
|
-
return functionSurfaceClient.createEdge(args, idempotencyKey).then(exposeGatewayData);
|
|
8239
|
-
}
|
|
8240
|
-
if (!args.sourceId || !args.targetId) {
|
|
8241
|
-
throw new Error("from/to graph refs or sourceId/targetId are required");
|
|
8242
|
-
}
|
|
7673
|
+
create(args) {
|
|
8243
7674
|
return edgesFacade.create({
|
|
8244
7675
|
sourceId: args.sourceId,
|
|
8245
7676
|
targetId: args.targetId,
|
|
@@ -8250,32 +7681,17 @@ function createLucernClient(config = {}) {
|
|
|
8250
7681
|
context: args.context ?? args.reasoning
|
|
8251
7682
|
}).then(exposeGatewayData);
|
|
8252
7683
|
},
|
|
8253
|
-
createEdge(input, idempotencyKey) {
|
|
8254
|
-
return functionSurfaceClient.createEdge(input, idempotencyKey).then(exposeGatewayData);
|
|
8255
|
-
},
|
|
8256
7684
|
update(input, idempotencyKey) {
|
|
8257
|
-
return
|
|
8258
|
-
},
|
|
8259
|
-
updateEdge(input, idempotencyKey) {
|
|
8260
|
-
return functionSurfaceClient.updateEdge(input, idempotencyKey).then(exposeGatewayData);
|
|
7685
|
+
return edgesFacade.update(input, idempotencyKey).then(exposeGatewayData);
|
|
8261
7686
|
},
|
|
8262
7687
|
remove(input, idempotencyKey) {
|
|
8263
|
-
return
|
|
8264
|
-
},
|
|
8265
|
-
removeEdge(input, idempotencyKey) {
|
|
8266
|
-
return functionSurfaceClient.removeEdge(input, idempotencyKey).then(exposeGatewayData);
|
|
7688
|
+
return edgesFacade.remove(input, idempotencyKey).then(exposeGatewayData);
|
|
8267
7689
|
},
|
|
8268
7690
|
removeBetween(input, idempotencyKey) {
|
|
8269
|
-
return
|
|
8270
|
-
},
|
|
8271
|
-
removeEdgesBetween(input, idempotencyKey) {
|
|
8272
|
-
return functionSurfaceClient.removeEdgesBetween(input, idempotencyKey).then(exposeGatewayData);
|
|
7691
|
+
return edgesFacade.removeBetween(input, idempotencyKey).then(exposeGatewayData);
|
|
8273
7692
|
},
|
|
8274
7693
|
batchCreate(input, idempotencyKey) {
|
|
8275
|
-
return
|
|
8276
|
-
},
|
|
8277
|
-
batchCreateEdges(input, idempotencyKey) {
|
|
8278
|
-
return functionSurfaceClient.batchCreateEdges(input, idempotencyKey).then(exposeGatewayData);
|
|
7694
|
+
return edgesFacade.batchCreate(input, idempotencyKey).then(exposeGatewayData);
|
|
8279
7695
|
},
|
|
8280
7696
|
delete(input, idempotencyKey) {
|
|
8281
7697
|
return edgesFacade.delete(input, idempotencyKey).then(exposeGatewayData);
|
|
@@ -8473,10 +7889,10 @@ function createLucernClient(config = {}) {
|
|
|
8473
7889
|
}));
|
|
8474
7890
|
},
|
|
8475
7891
|
getHighPriority(args) {
|
|
8476
|
-
return
|
|
7892
|
+
return this.list({
|
|
8477
7893
|
topicId: requireTopicId4(args),
|
|
8478
7894
|
status: args.includeAnswered ? void 0 : "open"
|
|
8479
|
-
}).then(
|
|
7895
|
+
}).then((data) => {
|
|
8480
7896
|
const questions = Array.isArray(data.questions) ? data.questions : [];
|
|
8481
7897
|
const rank = (priority) => {
|
|
8482
7898
|
switch (priority) {
|
|
@@ -8506,7 +7922,9 @@ function createLucernClient(config = {}) {
|
|
|
8506
7922
|
},
|
|
8507
7923
|
graph: {
|
|
8508
7924
|
nodes: nodesNamespace,
|
|
8509
|
-
createEdge
|
|
7925
|
+
createEdge(input) {
|
|
7926
|
+
return graphClient.createEdge(input);
|
|
7927
|
+
},
|
|
8510
7928
|
neighborhood(args) {
|
|
8511
7929
|
return graphFacade.neighborhood({
|
|
8512
7930
|
globalId: args.globalId,
|
|
@@ -8565,7 +7983,7 @@ function createLucernClient(config = {}) {
|
|
|
8565
7983
|
bisectConfidence,
|
|
8566
7984
|
listBeliefs,
|
|
8567
7985
|
detectConfirmationBias(topicId, threshold) {
|
|
8568
|
-
return
|
|
7986
|
+
return this.bias({
|
|
8569
7987
|
topicId,
|
|
8570
7988
|
threshold,
|
|
8571
7989
|
limit: 200
|
|
@@ -8576,7 +7994,7 @@ function createLucernClient(config = {}) {
|
|
|
8576
7994
|
}));
|
|
8577
7995
|
},
|
|
8578
7996
|
getStructureAnalysis(topicId) {
|
|
8579
|
-
return
|
|
7997
|
+
return this.analyze({
|
|
8580
7998
|
topicId,
|
|
8581
7999
|
limit: 200
|
|
8582
8000
|
}).then((response) => ({
|
|
@@ -8594,69 +8012,39 @@ function createLucernClient(config = {}) {
|
|
|
8594
8012
|
}));
|
|
8595
8013
|
}
|
|
8596
8014
|
},
|
|
8597
|
-
themes: {
|
|
8598
|
-
listByTopic(input) {
|
|
8599
|
-
return gateway.request({
|
|
8600
|
-
path: `/api/platform/v1/themes${sdkQueryString({
|
|
8601
|
-
topicId: requireTopicOrProjectId(input),
|
|
8602
|
-
query: input.query,
|
|
8603
|
-
limit: input.limit,
|
|
8604
|
-
cursor: input.cursor
|
|
8605
|
-
})}`
|
|
8606
|
-
}).then(exposeGatewayData);
|
|
8607
|
-
}
|
|
8608
|
-
},
|
|
8609
|
-
graphSearch: {
|
|
8610
|
-
keywordSearchNodes(input) {
|
|
8611
|
-
return gateway.request({
|
|
8612
|
-
path: "/api/platform/v1/graph-search/keyword-nodes",
|
|
8613
|
-
method: "POST",
|
|
8614
|
-
body: {
|
|
8615
|
-
...input,
|
|
8616
|
-
topicId: requireTopicOrProjectId(input),
|
|
8617
|
-
projectId: void 0
|
|
8618
|
-
}
|
|
8619
|
-
}).then(exposeGatewayData);
|
|
8620
|
-
}
|
|
8621
|
-
},
|
|
8622
|
-
classifiers: {
|
|
8623
|
-
listBeliefCandidates(input) {
|
|
8624
|
-
return gateway.request({
|
|
8625
|
-
path: `/api/platform/v1/classifiers/belief-candidates${sdkQueryString({
|
|
8626
|
-
topicId: requireTopicOrProjectId(input),
|
|
8627
|
-
classifierKey: input.classifierKey,
|
|
8628
|
-
query: input.query,
|
|
8629
|
-
limit: input.limit,
|
|
8630
|
-
cursor: input.cursor
|
|
8631
|
-
})}`
|
|
8632
|
-
}).then(exposeGatewayData);
|
|
8633
|
-
}
|
|
8634
|
-
},
|
|
8635
|
-
archetypes: {
|
|
8636
|
-
getJudgmentSignature(input) {
|
|
8637
|
-
return gateway.request({
|
|
8638
|
-
path: `/api/platform/v1/archetypes/judgment-signature${sdkQueryString({
|
|
8639
|
-
topicId: requireTopicOrProjectId(input),
|
|
8640
|
-
principalId: input.principalId
|
|
8641
|
-
})}`
|
|
8642
|
-
}).then(exposeGatewayData);
|
|
8643
|
-
}
|
|
8644
|
-
},
|
|
8645
8015
|
judgments: {
|
|
8646
|
-
create
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8016
|
+
create(input) {
|
|
8017
|
+
return decisionsClient.createJudgment(input);
|
|
8018
|
+
},
|
|
8019
|
+
record(input) {
|
|
8020
|
+
return decisionsClient.recordJudgment(input);
|
|
8021
|
+
},
|
|
8022
|
+
list(query5) {
|
|
8023
|
+
return decisionsClient.listJudgments(query5);
|
|
8024
|
+
},
|
|
8025
|
+
get(judgmentId) {
|
|
8026
|
+
return decisionsClient.getJudgment(judgmentId);
|
|
8027
|
+
},
|
|
8028
|
+
recordOutcome(judgmentId, input) {
|
|
8029
|
+
return decisionsClient.recordJudgmentOutcome(judgmentId, input);
|
|
8030
|
+
},
|
|
8031
|
+
updateOutcome(judgmentId, input) {
|
|
8032
|
+
return decisionsClient.updateJudgmentOutcome(judgmentId, input);
|
|
8033
|
+
},
|
|
8652
8034
|
readiness(topicId) {
|
|
8653
|
-
return decisionsClient.getJudgmentReadiness({
|
|
8035
|
+
return decisionsClient.getJudgmentReadiness({
|
|
8036
|
+
topicId
|
|
8037
|
+
});
|
|
8654
8038
|
},
|
|
8655
8039
|
calibration(topicId) {
|
|
8656
|
-
return decisionsClient.getJudgmentCalibration({
|
|
8040
|
+
return decisionsClient.getJudgmentCalibration({
|
|
8041
|
+
topicId
|
|
8042
|
+
});
|
|
8657
8043
|
},
|
|
8658
8044
|
pendingOutcomeReview(topicId) {
|
|
8659
|
-
return decisionsClient.listPendingJudgmentOutcomeReview({
|
|
8045
|
+
return decisionsClient.listPendingJudgmentOutcomeReview({
|
|
8046
|
+
topicId
|
|
8047
|
+
});
|
|
8660
8048
|
},
|
|
8661
8049
|
transitionAuditIntegrity(args) {
|
|
8662
8050
|
return decisionsClient.getJudgmentTransitionAuditIntegrity({
|
|
@@ -8665,69 +8053,29 @@ function createLucernClient(config = {}) {
|
|
|
8665
8053
|
});
|
|
8666
8054
|
}
|
|
8667
8055
|
},
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
list: decisionsClient.listJudgments,
|
|
8672
|
-
get: decisionsClient.getJudgment,
|
|
8673
|
-
recordOutcome: decisionsClient.recordJudgmentOutcome,
|
|
8674
|
-
lessons(decisionId, input, idempotencyKey) {
|
|
8675
|
-
return gateway.request({
|
|
8676
|
-
path: `/api/platform/v1/decisions/${encodeURIComponent(
|
|
8677
|
-
decisionId
|
|
8678
|
-
)}/lessons`,
|
|
8679
|
-
method: "POST",
|
|
8680
|
-
body: input,
|
|
8681
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
8682
|
-
}).then(exposeGatewayData);
|
|
8056
|
+
worktrees: {
|
|
8057
|
+
createBranch(input) {
|
|
8058
|
+
return workflowClient.createBranch(input);
|
|
8683
8059
|
},
|
|
8684
|
-
|
|
8685
|
-
return
|
|
8686
|
-
path: `/api/platform/v1/decisions/${encodeURIComponent(
|
|
8687
|
-
decisionId
|
|
8688
|
-
)}/archive`,
|
|
8689
|
-
method: "POST",
|
|
8690
|
-
body: input,
|
|
8691
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
8692
|
-
}).then(exposeGatewayData);
|
|
8060
|
+
createLens(input) {
|
|
8061
|
+
return workflowClient.createLens(input);
|
|
8693
8062
|
},
|
|
8694
|
-
|
|
8695
|
-
return
|
|
8063
|
+
listLenses(query5) {
|
|
8064
|
+
return workflowClient.listLenses(query5);
|
|
8696
8065
|
},
|
|
8697
|
-
|
|
8698
|
-
return
|
|
8066
|
+
applyLensToTopic(input) {
|
|
8067
|
+
return workflowClient.applyLensToTopic(input);
|
|
8068
|
+
},
|
|
8069
|
+
removeLensFromTopic(input) {
|
|
8070
|
+
return workflowClient.removeLensFromTopic(input);
|
|
8699
8071
|
},
|
|
8700
|
-
pendingOutcomeReview(topicId) {
|
|
8701
|
-
return decisionsClient.listPendingJudgmentOutcomeReview({ topicId });
|
|
8702
|
-
}
|
|
8703
|
-
},
|
|
8704
|
-
worktrees: {
|
|
8705
|
-
createBranch: workflowClient.createBranch,
|
|
8706
|
-
createLens: workflowClient.createLens,
|
|
8707
|
-
listLenses: workflowClient.listLenses,
|
|
8708
|
-
applyLensToTopic: workflowClient.applyLensToTopic,
|
|
8709
|
-
removeLensFromTopic: workflowClient.removeLensFromTopic,
|
|
8710
8072
|
create(input) {
|
|
8711
8073
|
return worktreesFacade.create({
|
|
8712
8074
|
title: input.title,
|
|
8713
8075
|
topicId: requireTopicId4(input),
|
|
8714
8076
|
objective: input.objective,
|
|
8715
8077
|
hypothesis: input.hypothesis,
|
|
8716
|
-
rationale: input.rationale,
|
|
8717
|
-
worktreeType: input.worktreeType,
|
|
8718
|
-
startDate: input.startDate,
|
|
8719
|
-
endDate: input.endDate,
|
|
8720
|
-
durationWeeks: input.durationWeeks,
|
|
8721
|
-
confidenceImpact: input.confidenceImpact,
|
|
8722
|
-
beliefFocus: input.beliefFocus,
|
|
8723
8078
|
beliefIds: input.beliefIds,
|
|
8724
|
-
targetBeliefIds: input.targetBeliefIds,
|
|
8725
|
-
targetQuestionIds: input.targetQuestionIds,
|
|
8726
|
-
keyQuestions: input.keyQuestions,
|
|
8727
|
-
evidenceSignals: input.evidenceSignals,
|
|
8728
|
-
decisionGate: input.decisionGate,
|
|
8729
|
-
goCriteria: input.goCriteria,
|
|
8730
|
-
noGoSignals: input.noGoSignals,
|
|
8731
8079
|
autoShape: input.autoShape,
|
|
8732
8080
|
domainPackId: input.domainPackId,
|
|
8733
8081
|
campaign: input.campaign,
|
|
@@ -8740,8 +8088,7 @@ function createLucernClient(config = {}) {
|
|
|
8740
8088
|
proofArtifacts: input.proofArtifacts,
|
|
8741
8089
|
staffingHint: typeof input.staffingHint === "string" ? input.staffingHint : void 0,
|
|
8742
8090
|
lastReconciledAt: input.lastReconciledAt,
|
|
8743
|
-
autoFixPolicy: input.autoFixPolicy
|
|
8744
|
-
lensId: input.lensId
|
|
8091
|
+
autoFixPolicy: input.autoFixPolicy
|
|
8745
8092
|
});
|
|
8746
8093
|
},
|
|
8747
8094
|
add(input) {
|
|
@@ -8750,21 +8097,7 @@ function createLucernClient(config = {}) {
|
|
|
8750
8097
|
topicId: requireTopicId4(input),
|
|
8751
8098
|
objective: input.objective,
|
|
8752
8099
|
hypothesis: input.hypothesis,
|
|
8753
|
-
rationale: input.rationale,
|
|
8754
|
-
worktreeType: input.worktreeType,
|
|
8755
|
-
startDate: input.startDate,
|
|
8756
|
-
endDate: input.endDate,
|
|
8757
|
-
durationWeeks: input.durationWeeks,
|
|
8758
|
-
confidenceImpact: input.confidenceImpact,
|
|
8759
|
-
beliefFocus: input.beliefFocus,
|
|
8760
8100
|
beliefIds: input.beliefIds,
|
|
8761
|
-
targetBeliefIds: input.targetBeliefIds,
|
|
8762
|
-
targetQuestionIds: input.targetQuestionIds,
|
|
8763
|
-
keyQuestions: input.keyQuestions,
|
|
8764
|
-
evidenceSignals: input.evidenceSignals,
|
|
8765
|
-
decisionGate: input.decisionGate,
|
|
8766
|
-
goCriteria: input.goCriteria,
|
|
8767
|
-
noGoSignals: input.noGoSignals,
|
|
8768
8101
|
autoShape: input.autoShape,
|
|
8769
8102
|
domainPackId: input.domainPackId,
|
|
8770
8103
|
campaign: input.campaign,
|
|
@@ -8777,8 +8110,7 @@ function createLucernClient(config = {}) {
|
|
|
8777
8110
|
proofArtifacts: input.proofArtifacts,
|
|
8778
8111
|
staffingHint: typeof input.staffingHint === "string" ? input.staffingHint : void 0,
|
|
8779
8112
|
lastReconciledAt: input.lastReconciledAt,
|
|
8780
|
-
autoFixPolicy: input.autoFixPolicy
|
|
8781
|
-
lensId: input.lensId
|
|
8113
|
+
autoFixPolicy: input.autoFixPolicy
|
|
8782
8114
|
});
|
|
8783
8115
|
},
|
|
8784
8116
|
list(query5) {
|
|
@@ -8788,22 +8120,6 @@ function createLucernClient(config = {}) {
|
|
|
8788
8120
|
limit: query5.limit
|
|
8789
8121
|
});
|
|
8790
8122
|
},
|
|
8791
|
-
listByTopic(query5) {
|
|
8792
|
-
return worktreesFacade.list({
|
|
8793
|
-
topicId: requireTopicId4(query5),
|
|
8794
|
-
status: query5.status,
|
|
8795
|
-
limit: query5.limit
|
|
8796
|
-
});
|
|
8797
|
-
},
|
|
8798
|
-
findByPairedSprint(input) {
|
|
8799
|
-
return gateway.request({
|
|
8800
|
-
path: `/api/platform/v1/worktrees/paired-sprint${sdkQueryString({
|
|
8801
|
-
sprintId: input.sprintId,
|
|
8802
|
-
topicId: input.topicId ?? input.projectId,
|
|
8803
|
-
limit: input.limit
|
|
8804
|
-
})}`
|
|
8805
|
-
}).then(exposeGatewayData);
|
|
8806
|
-
},
|
|
8807
8123
|
activate(worktreeId) {
|
|
8808
8124
|
return worktreesFacade.activate({ id: worktreeId });
|
|
8809
8125
|
},
|
|
@@ -8811,9 +8127,7 @@ function createLucernClient(config = {}) {
|
|
|
8811
8127
|
const dependsOn = Array.isArray(input.dependsOn) ? input.dependsOn.filter(
|
|
8812
8128
|
(value) => typeof value === "string"
|
|
8813
8129
|
) : void 0;
|
|
8814
|
-
const blocks = Array.isArray(input.blocks) ? input.blocks.filter(
|
|
8815
|
-
(value) => typeof value === "string"
|
|
8816
|
-
) : void 0;
|
|
8130
|
+
const blocks = Array.isArray(input.blocks) ? input.blocks.filter((value) => typeof value === "string") : void 0;
|
|
8817
8131
|
return worktreesFacade.update({
|
|
8818
8132
|
id: typeof input.worktreeId === "string" ? input.worktreeId : "",
|
|
8819
8133
|
hypothesis: typeof input.hypothesis === "string" ? input.hypothesis : void 0,
|
|
@@ -8827,23 +8141,7 @@ function createLucernClient(config = {}) {
|
|
|
8827
8141
|
});
|
|
8828
8142
|
},
|
|
8829
8143
|
update(input) {
|
|
8830
|
-
|
|
8831
|
-
(value) => typeof value === "string"
|
|
8832
|
-
) : void 0;
|
|
8833
|
-
const blocks = Array.isArray(input.blocks) ? input.blocks.filter(
|
|
8834
|
-
(value) => typeof value === "string"
|
|
8835
|
-
) : void 0;
|
|
8836
|
-
return worktreesFacade.update({
|
|
8837
|
-
id: typeof input.worktreeId === "string" ? input.worktreeId : "",
|
|
8838
|
-
hypothesis: typeof input.hypothesis === "string" ? input.hypothesis : void 0,
|
|
8839
|
-
campaign: typeof input.campaign === "number" ? input.campaign : void 0,
|
|
8840
|
-
lane: typeof input.lane === "string" ? input.lane : void 0,
|
|
8841
|
-
laneOrderInCampaign: typeof input.laneOrderInCampaign === "number" ? input.laneOrderInCampaign : void 0,
|
|
8842
|
-
orderInLane: typeof input.orderInLane === "number" ? input.orderInLane : void 0,
|
|
8843
|
-
dependsOn,
|
|
8844
|
-
blocks,
|
|
8845
|
-
gate: typeof input.gate === "string" ? input.gate : void 0
|
|
8846
|
-
});
|
|
8144
|
+
return this.updateMetadata(input);
|
|
8847
8145
|
},
|
|
8848
8146
|
updateTargets(input) {
|
|
8849
8147
|
return worktreesFacade.updateTargets({
|
|
@@ -8854,7 +8152,9 @@ function createLucernClient(config = {}) {
|
|
|
8854
8152
|
removeQuestionIds: input.removeQuestionIds
|
|
8855
8153
|
});
|
|
8856
8154
|
},
|
|
8857
|
-
listAll
|
|
8155
|
+
listAll(query5 = {}) {
|
|
8156
|
+
return workflowClient.listAllWorktrees(query5);
|
|
8157
|
+
},
|
|
8858
8158
|
merge(worktreeId, input) {
|
|
8859
8159
|
return worktreesFacade.merge({
|
|
8860
8160
|
id: worktreeId,
|
|
@@ -8862,12 +8162,18 @@ function createLucernClient(config = {}) {
|
|
|
8862
8162
|
summary: input.summary
|
|
8863
8163
|
});
|
|
8864
8164
|
},
|
|
8865
|
-
push
|
|
8866
|
-
|
|
8165
|
+
push(worktreeId, input) {
|
|
8166
|
+
return workflowClient.push(worktreeId, input);
|
|
8167
|
+
},
|
|
8168
|
+
openPullRequest(worktreeId, input) {
|
|
8169
|
+
return workflowClient.openPullRequest(worktreeId, input);
|
|
8170
|
+
},
|
|
8867
8171
|
pipelineSnapshot(topicId) {
|
|
8868
8172
|
return functionSurfaceClient.pipelineSnapshot({ topicId });
|
|
8869
8173
|
},
|
|
8870
|
-
complete
|
|
8174
|
+
complete(input, idempotencyKey) {
|
|
8175
|
+
return worktreesFacade.complete(input, idempotencyKey);
|
|
8176
|
+
},
|
|
8871
8177
|
advancePhase(worktreeId, idempotencyKey) {
|
|
8872
8178
|
return worktreesFacade.advancePhase(
|
|
8873
8179
|
{ worktreeId },
|
|
@@ -8880,8 +8186,12 @@ function createLucernClient(config = {}) {
|
|
|
8880
8186
|
idempotencyKey
|
|
8881
8187
|
);
|
|
8882
8188
|
},
|
|
8883
|
-
patchState
|
|
8884
|
-
|
|
8189
|
+
patchState(input, idempotencyKey) {
|
|
8190
|
+
return worktreesFacade.patchState(input, idempotencyKey);
|
|
8191
|
+
},
|
|
8192
|
+
bulkCreate(input, idempotencyKey) {
|
|
8193
|
+
return worktreesFacade.bulkCreate(input, idempotencyKey);
|
|
8194
|
+
}
|
|
8885
8195
|
},
|
|
8886
8196
|
context: {
|
|
8887
8197
|
listTopics(query5 = {}) {
|
|
@@ -8892,15 +8202,27 @@ function createLucernClient(config = {}) {
|
|
|
8892
8202
|
type: query5.type
|
|
8893
8203
|
});
|
|
8894
8204
|
},
|
|
8895
|
-
compile
|
|
8896
|
-
|
|
8205
|
+
compile(topicId, input = {}) {
|
|
8206
|
+
return contextClient.compile(topicId, input);
|
|
8207
|
+
},
|
|
8208
|
+
recordScopeLearning(input, idempotencyKey) {
|
|
8209
|
+
return functionSurfaceClient.recordScopeLearning(input, idempotencyKey);
|
|
8210
|
+
},
|
|
8897
8211
|
discover(input) {
|
|
8898
8212
|
return discoverTopics(input);
|
|
8899
8213
|
},
|
|
8900
|
-
analyzeTopicDensity
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8214
|
+
analyzeTopicDensity(input) {
|
|
8215
|
+
return functionSurfaceClient.analyzeTopicDensity(input);
|
|
8216
|
+
},
|
|
8217
|
+
applyAutoBranching(input, idempotencyKey) {
|
|
8218
|
+
return functionSurfaceClient.applyAutoBranching(input, idempotencyKey);
|
|
8219
|
+
},
|
|
8220
|
+
seedBeliefLattice(input = {}, idempotencyKey) {
|
|
8221
|
+
return functionSurfaceClient.seedBeliefLattice(input, idempotencyKey);
|
|
8222
|
+
},
|
|
8223
|
+
getLatticeCoverage(input = {}) {
|
|
8224
|
+
return functionSurfaceClient.getLatticeCoverage(input);
|
|
8225
|
+
},
|
|
8904
8226
|
matchEntityType(input) {
|
|
8905
8227
|
return ontologiesFacade.match(input).then(exposeGatewayData);
|
|
8906
8228
|
},
|
|
@@ -8949,31 +8271,6 @@ function createLucernClient(config = {}) {
|
|
|
8949
8271
|
status: typeof input.status === "string" ? input.status : void 0,
|
|
8950
8272
|
limit: typeof input.limit === "number" ? input.limit : void 0
|
|
8951
8273
|
});
|
|
8952
|
-
},
|
|
8953
|
-
listByTopic(input) {
|
|
8954
|
-
return tasksFacade.list({
|
|
8955
|
-
topicId: requireTopicId4(input),
|
|
8956
|
-
status: typeof input.status === "string" ? input.status : void 0,
|
|
8957
|
-
limit: typeof input.limit === "number" ? input.limit : void 0
|
|
8958
|
-
});
|
|
8959
|
-
},
|
|
8960
|
-
listByWorktree(input) {
|
|
8961
|
-
return tasksFacade.list({
|
|
8962
|
-
topicId: typeof input.topicId === "string" ? input.topicId : void 0,
|
|
8963
|
-
worktreeId: input.worktreeId,
|
|
8964
|
-
status: typeof input.status === "string" ? input.status : void 0,
|
|
8965
|
-
limit: typeof input.limit === "number" ? input.limit : void 0
|
|
8966
|
-
});
|
|
8967
|
-
},
|
|
8968
|
-
linkChat(taskId, input, idempotencyKey) {
|
|
8969
|
-
return gateway.request({
|
|
8970
|
-
path: `/api/platform/v1/tasks/${encodeURIComponent(
|
|
8971
|
-
taskId
|
|
8972
|
-
)}/link-chat`,
|
|
8973
|
-
method: "POST",
|
|
8974
|
-
body: input,
|
|
8975
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
8976
|
-
}).then(exposeGatewayData);
|
|
8977
8274
|
}
|
|
8978
8275
|
},
|
|
8979
8276
|
topics: {
|
|
@@ -8985,9 +8282,21 @@ function createLucernClient(config = {}) {
|
|
|
8985
8282
|
type: input.type
|
|
8986
8283
|
});
|
|
8987
8284
|
},
|
|
8988
|
-
get
|
|
8285
|
+
get(topicId) {
|
|
8286
|
+
return topicsFacade.get(topicId);
|
|
8287
|
+
},
|
|
8989
8288
|
create(input) {
|
|
8990
|
-
return
|
|
8289
|
+
return topicsFacade.create({
|
|
8290
|
+
name: input.name,
|
|
8291
|
+
description: input.description,
|
|
8292
|
+
type: input.type,
|
|
8293
|
+
parentTopicId: input.parentTopicId,
|
|
8294
|
+
ontologyId: input.ontologyId,
|
|
8295
|
+
tenantId: input.tenantId,
|
|
8296
|
+
workspaceId: input.workspaceId,
|
|
8297
|
+
visibility: input.visibility,
|
|
8298
|
+
createdBy: input.createdBy
|
|
8299
|
+
});
|
|
8991
8300
|
},
|
|
8992
8301
|
update(topicId, input) {
|
|
8993
8302
|
return topicsFacade.update({
|
|
@@ -9020,19 +8329,11 @@ function createLucernClient(config = {}) {
|
|
|
9020
8329
|
maxDepth: query5.maxDepth
|
|
9021
8330
|
});
|
|
9022
8331
|
},
|
|
9023
|
-
remove
|
|
9024
|
-
|
|
9025
|
-
materializeGraph(input = {}, idempotencyKey) {
|
|
9026
|
-
return functionSurfaceClient.materializeTopicGraph(input, idempotencyKey).then(exposeGatewayData);
|
|
9027
|
-
},
|
|
9028
|
-
materializeTopicGraph(input = {}, idempotencyKey) {
|
|
9029
|
-
return functionSurfaceClient.materializeTopicGraph(input, idempotencyKey).then(exposeGatewayData);
|
|
9030
|
-
},
|
|
9031
|
-
graphSpine(input = {}) {
|
|
9032
|
-
return functionSurfaceClient.getTopicGraphSpine(input).then(exposeGatewayData);
|
|
8332
|
+
remove(topicId, idempotencyKey) {
|
|
8333
|
+
return topicsFacade.remove(topicId, idempotencyKey);
|
|
9033
8334
|
},
|
|
9034
|
-
|
|
9035
|
-
return
|
|
8335
|
+
bulkCreate(input, idempotencyKey) {
|
|
8336
|
+
return topicsFacade.bulkCreate(input, idempotencyKey);
|
|
9036
8337
|
}
|
|
9037
8338
|
},
|
|
9038
8339
|
answers: {
|
|
@@ -9132,15 +8433,33 @@ function createLucernClient(config = {}) {
|
|
|
9132
8433
|
raw: ontologyClient
|
|
9133
8434
|
},
|
|
9134
8435
|
coordination: {
|
|
9135
|
-
registerSession
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
8436
|
+
registerSession(input = {}, idempotencyKey) {
|
|
8437
|
+
return functionSurfaceClient.registerSession(input, idempotencyKey);
|
|
8438
|
+
},
|
|
8439
|
+
heartbeatSession(input = {}, idempotencyKey) {
|
|
8440
|
+
return functionSurfaceClient.heartbeatSession(input, idempotencyKey);
|
|
8441
|
+
},
|
|
8442
|
+
endSession(input = {}, idempotencyKey) {
|
|
8443
|
+
return functionSurfaceClient.endSession(input, idempotencyKey);
|
|
8444
|
+
},
|
|
8445
|
+
listActiveSessions(input = {}) {
|
|
8446
|
+
return functionSurfaceClient.listActiveSessions(input);
|
|
8447
|
+
},
|
|
8448
|
+
sendAgentMessage(input, idempotencyKey) {
|
|
8449
|
+
return functionSurfaceClient.sendAgentMessage(input, idempotencyKey);
|
|
8450
|
+
},
|
|
8451
|
+
broadcastMessage(input, idempotencyKey) {
|
|
8452
|
+
return functionSurfaceClient.broadcastMessage(input, idempotencyKey);
|
|
8453
|
+
},
|
|
8454
|
+
getInbox(input = {}) {
|
|
8455
|
+
return functionSurfaceClient.getAgentInbox(input);
|
|
8456
|
+
},
|
|
8457
|
+
getAgentInbox(input = {}) {
|
|
8458
|
+
return functionSurfaceClient.getAgentInbox(input);
|
|
8459
|
+
},
|
|
8460
|
+
claimFiles(input, idempotencyKey) {
|
|
8461
|
+
return functionSurfaceClient.claimFiles(input, idempotencyKey);
|
|
8462
|
+
}
|
|
9144
8463
|
},
|
|
9145
8464
|
policy: {
|
|
9146
8465
|
checkPermission(input) {
|
|
@@ -9171,24 +8490,38 @@ function createLucernClient(config = {}) {
|
|
|
9171
8490
|
principalId: typeof input.principalId === "string" ? input.principalId : void 0
|
|
9172
8491
|
});
|
|
9173
8492
|
},
|
|
9174
|
-
// Backward compatibility shim: keep the policy namespace exposing the
|
|
9175
|
-
// historical manageWritePolicy entry point.
|
|
9176
8493
|
manageWritePolicy(input, idempotencyKey) {
|
|
9177
8494
|
return functionSurfaceClient.manageWritePolicy(input, idempotencyKey);
|
|
9178
8495
|
},
|
|
9179
8496
|
raw: policyClient
|
|
9180
8497
|
},
|
|
9181
8498
|
observations: {
|
|
9182
|
-
ingest
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
8499
|
+
ingest(input, idempotencyKey) {
|
|
8500
|
+
return functionSurfaceClient.ingestObservation(input, idempotencyKey);
|
|
8501
|
+
},
|
|
8502
|
+
ingestObservation(input, idempotencyKey) {
|
|
8503
|
+
return functionSurfaceClient.ingestObservation(input, idempotencyKey);
|
|
8504
|
+
},
|
|
8505
|
+
getContext(input) {
|
|
8506
|
+
return functionSurfaceClient.getObservationContext(input);
|
|
8507
|
+
},
|
|
8508
|
+
getObservationContext(input) {
|
|
8509
|
+
return functionSurfaceClient.getObservationContext(input);
|
|
8510
|
+
}
|
|
9186
8511
|
},
|
|
9187
8512
|
coding: {
|
|
9188
|
-
getCodeContext
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
8513
|
+
getCodeContext(input) {
|
|
8514
|
+
return functionSurfaceClient.getCodeContext(input);
|
|
8515
|
+
},
|
|
8516
|
+
getChangeHistory(input) {
|
|
8517
|
+
return functionSurfaceClient.getChangeHistory(input);
|
|
8518
|
+
},
|
|
8519
|
+
recordAttempt(input, idempotencyKey) {
|
|
8520
|
+
return functionSurfaceClient.recordAttempt(input, idempotencyKey);
|
|
8521
|
+
},
|
|
8522
|
+
getFailureLog(input) {
|
|
8523
|
+
return functionSurfaceClient.getFailureLog(input);
|
|
8524
|
+
}
|
|
9192
8525
|
},
|
|
9193
8526
|
contracts: {
|
|
9194
8527
|
create(input) {
|
|
@@ -9214,19 +8547,19 @@ function createLucernClient(config = {}) {
|
|
|
9214
8547
|
}
|
|
9215
8548
|
},
|
|
9216
8549
|
bootstrap: {
|
|
9217
|
-
generateSessionHandoff
|
|
8550
|
+
generateSessionHandoff(input) {
|
|
8551
|
+
return functionSurfaceClient.generateSessionHandoff(input);
|
|
8552
|
+
}
|
|
9218
8553
|
},
|
|
9219
8554
|
embeddings: embeddingsClient,
|
|
9220
8555
|
graphAnalysis: graphAnalysisClient,
|
|
9221
8556
|
graphRecommendations: graphRecommendationsClient,
|
|
9222
8557
|
orgGraphSearch: orgGraphSearchClient,
|
|
9223
|
-
ontologyLinks:
|
|
8558
|
+
ontologyLinks: ontologyLinksClient,
|
|
9224
8559
|
graphStateClassifier: graphStateClassifierClient,
|
|
9225
8560
|
modelRuntime: modelRuntimeClient,
|
|
9226
8561
|
jobs: jobsClient,
|
|
9227
8562
|
telemetry: telemetryClient,
|
|
9228
|
-
publication: publicationNamespace,
|
|
9229
|
-
contentPublication: publicationNamespace,
|
|
9230
8563
|
tools: {
|
|
9231
8564
|
listCatalog: toolRegistryClient.listCatalog,
|
|
9232
8565
|
listExecutable: toolRegistryClient.listExecutable,
|
|
@@ -9236,15 +8569,25 @@ function createLucernClient(config = {}) {
|
|
|
9236
8569
|
createAcl: toolRegistryClient.createAcl,
|
|
9237
8570
|
deleteAcl: toolRegistryClient.deleteAcl,
|
|
9238
8571
|
registerCustomTool: toolRegistryClient.registerCustomTool,
|
|
9239
|
-
register
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
8572
|
+
register(registration) {
|
|
8573
|
+
return registerCustomTool(registration);
|
|
8574
|
+
},
|
|
8575
|
+
unregister(fullName) {
|
|
8576
|
+
return unregisterCustomTool(fullName);
|
|
8577
|
+
},
|
|
8578
|
+
list() {
|
|
8579
|
+
return listRegisteredCustomTools();
|
|
8580
|
+
},
|
|
8581
|
+
clear() {
|
|
8582
|
+
clearRegisteredCustomTools();
|
|
8583
|
+
},
|
|
9243
8584
|
invoke(name, input = {}) {
|
|
9244
|
-
const fullName =
|
|
8585
|
+
const fullName = name.includes(".") ? name : `custom.${name}`;
|
|
9245
8586
|
return invokeCustomTool(fullName, input);
|
|
9246
8587
|
},
|
|
9247
|
-
namespace
|
|
8588
|
+
namespace(namespace) {
|
|
8589
|
+
return getCustomNamespace(namespace);
|
|
8590
|
+
}
|
|
9248
8591
|
},
|
|
9249
8592
|
packs: {
|
|
9250
8593
|
/**
|
|
@@ -9259,25 +8602,31 @@ function createLucernClient(config = {}) {
|
|
|
9259
8602
|
get isInstalled() {
|
|
9260
8603
|
return _packInstalled;
|
|
9261
8604
|
},
|
|
9262
|
-
listCatalog
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
nodes: nodesNamespace,
|
|
9271
|
-
controlPlane: {
|
|
9272
|
-
identity: {
|
|
9273
|
-
resolveInteractivePrincipal: controlPlaneClient.identity.resolveInteractivePrincipal
|
|
8605
|
+
listCatalog() {
|
|
8606
|
+
return packsClient.listCatalog();
|
|
8607
|
+
},
|
|
8608
|
+
catalog() {
|
|
8609
|
+
return packsClient.getCatalog();
|
|
8610
|
+
},
|
|
8611
|
+
listStates(scope) {
|
|
8612
|
+
return packsClient.listStates(scope);
|
|
9274
8613
|
},
|
|
9275
|
-
|
|
8614
|
+
states(scope) {
|
|
8615
|
+
return packsClient.getStates(scope);
|
|
8616
|
+
},
|
|
8617
|
+
install(input) {
|
|
8618
|
+
return packsClient.install(input);
|
|
8619
|
+
},
|
|
8620
|
+
enable(input) {
|
|
8621
|
+
return packsClient.enable(input);
|
|
8622
|
+
},
|
|
8623
|
+
disable(input) {
|
|
8624
|
+
return packsClient.disable(input);
|
|
8625
|
+
}
|
|
9276
8626
|
},
|
|
8627
|
+
nodes: nodesNamespace,
|
|
9277
8628
|
identity: {
|
|
9278
8629
|
...identityFacade,
|
|
9279
|
-
access: accessControlClient,
|
|
9280
|
-
resolveInteractivePrincipal: identityClient.resolveInteractivePrincipal,
|
|
9281
8630
|
evaluatePolicy: identityClient.evaluatePolicy,
|
|
9282
8631
|
recordPolicyDecision: identityClient.recordPolicyDecision,
|
|
9283
8632
|
putSecretReference: identityClient.putSecretReference,
|
|
@@ -9286,16 +8635,30 @@ function createLucernClient(config = {}) {
|
|
|
9286
8635
|
raw: identityClient
|
|
9287
8636
|
},
|
|
9288
8637
|
mcp: {
|
|
9289
|
-
bootstrapSession
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
8638
|
+
bootstrapSession(input) {
|
|
8639
|
+
return mcpClient.bootstrapSession(input);
|
|
8640
|
+
},
|
|
8641
|
+
checkWritePolicy(input) {
|
|
8642
|
+
return mcpClient.checkWritePolicy(input);
|
|
8643
|
+
},
|
|
8644
|
+
beginBuildSession(input) {
|
|
8645
|
+
return mcpClient.beginBuildSession(input);
|
|
8646
|
+
},
|
|
8647
|
+
evaluateEngineeringContract(input) {
|
|
8648
|
+
return mcpClient.evaluateEngineeringContract(input);
|
|
8649
|
+
},
|
|
8650
|
+
evaluateResearchContract(input) {
|
|
8651
|
+
return mcpClient.evaluateResearchContract(input);
|
|
8652
|
+
}
|
|
9294
8653
|
},
|
|
9295
8654
|
auth: {
|
|
9296
8655
|
device: {
|
|
9297
|
-
createCode
|
|
9298
|
-
|
|
8656
|
+
createCode(input) {
|
|
8657
|
+
return authDeviceClient.createDeviceCode(input);
|
|
8658
|
+
},
|
|
8659
|
+
pollToken(deviceCode) {
|
|
8660
|
+
return authDeviceClient.pollDeviceToken(deviceCode);
|
|
8661
|
+
}
|
|
9299
8662
|
}
|
|
9300
8663
|
},
|
|
9301
8664
|
custom: getCustomNamespace("custom"),
|
|
@@ -9322,7 +8685,6 @@ function createLucernClient(config = {}) {
|
|
|
9322
8685
|
ontologyLinks: ontologyLinksClient,
|
|
9323
8686
|
orgGraphSearch: orgGraphSearchClient,
|
|
9324
8687
|
functionSurface: functionSurfaceClient,
|
|
9325
|
-
controlPlane: controlPlaneClient,
|
|
9326
8688
|
toolRegistry: toolRegistryClient,
|
|
9327
8689
|
modelRuntime: modelRuntimeClient,
|
|
9328
8690
|
packs: packsClient,
|