@lucern/sdk 0.3.0-alpha.5 → 0.3.0-alpha.7
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 +3 -0
- package/dist/adminClient.d.ts +8 -8
- package/dist/adminClient.js +47 -36
- package/dist/adminClient.js.map +1 -1
- package/dist/answersClient.js +26 -8
- package/dist/answersClient.js.map +1 -1
- package/dist/audience/index.d.ts +2 -1
- package/dist/audience/index.js +1 -3
- package/dist/audience/index.js.map +1 -1
- package/dist/audiencesClient.d.ts +16 -16
- package/dist/audiencesClient.js +102 -87
- package/dist/audiencesClient.js.map +1 -1
- package/dist/auditClient.js +30 -10
- package/dist/auditClient.js.map +1 -1
- package/dist/authDeviceClient.js +16 -3
- package/dist/authDeviceClient.js.map +1 -1
- package/dist/beliefs/index.d.ts +3 -3
- package/dist/beliefs/index.js +513 -758
- package/dist/beliefs/index.js.map +1 -1
- package/dist/beliefsClient.d.ts +2 -2
- package/dist/beliefsClient.js +31 -19
- package/dist/beliefsClient.js.map +1 -1
- package/dist/boundaryClientSurface.js +10 -3
- package/dist/boundaryClientSurface.js.map +1 -1
- package/dist/client.d.ts +247 -270
- package/dist/client.js +513 -758
- package/dist/client.js.map +1 -1
- package/dist/clientHelpers.d.ts +29 -0
- package/dist/clientHelpers.js +122 -0
- package/dist/clientHelpers.js.map +1 -0
- package/dist/contextClient.js +26 -8
- package/dist/contextClient.js.map +1 -1
- package/dist/contextPackCompiler.js +19 -30
- package/dist/contextPackCompiler.js.map +1 -1
- package/dist/contextPackPolicy.js +7 -17
- package/dist/contextPackPolicy.js.map +1 -1
- package/dist/contracts/index.js +4 -3
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/lens-filter.contract.js +4 -3
- package/dist/contracts/lens-filter.contract.js.map +1 -1
- package/dist/contracts/lens-workflow.contract.js +4 -3
- package/dist/contracts/lens-workflow.contract.js.map +1 -1
- package/dist/contracts/lensFilter.js +4 -3
- package/dist/contracts/lensFilter.js.map +1 -1
- package/dist/contracts/lensWorkflow.js +4 -3
- package/dist/contracts/lensWorkflow.js.map +1 -1
- package/dist/contradictions/index.d.ts +2 -2
- package/dist/contradictions/index.js +513 -758
- package/dist/contradictions/index.js.map +1 -1
- package/dist/coreClient.d.ts +2 -1
- package/dist/coreClient.js +27 -11
- package/dist/coreClient.js.map +1 -1
- package/dist/decisions/index.d.ts +12 -12
- package/dist/decisions/index.js +513 -758
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisionsClient.d.ts +4 -12
- package/dist/decisionsClient.js +37 -31
- package/dist/decisionsClient.js.map +1 -1
- package/dist/edges/index.d.ts +2 -2
- package/dist/edges/index.js +513 -758
- package/dist/edges/index.js.map +1 -1
- package/dist/embeddingsClient.js +37 -14
- package/dist/embeddingsClient.js.map +1 -1
- package/dist/eventingClient.js +37 -14
- package/dist/eventingClient.js.map +1 -1
- package/dist/events.js +6 -3
- package/dist/events.js.map +1 -1
- package/dist/eventsCore.d.ts +1 -1
- package/dist/eventsCore.js +27 -11
- package/dist/eventsCore.js.map +1 -1
- package/dist/evidence/index.d.ts +2 -2
- package/dist/evidence/index.js +513 -758
- package/dist/evidence/index.js.map +1 -1
- package/dist/evidenceClient.js +27 -11
- package/dist/evidenceClient.js.map +1 -1
- package/dist/functionSurface.js +27 -11
- package/dist/functionSurface.js.map +1 -1
- package/dist/functionSurfaceClient.js +27 -11
- package/dist/functionSurfaceClient.js.map +1 -1
- package/dist/gatewayFacades.d.ts +27 -45
- package/dist/gatewayFacades.js +92 -118
- package/dist/gatewayFacades.js.map +1 -1
- package/dist/graphAnalysisClient.js +31 -12
- package/dist/graphAnalysisClient.js.map +1 -1
- package/dist/graphClient.d.ts +5 -13
- package/dist/graphClient.js +42 -35
- package/dist/graphClient.js.map +1 -1
- package/dist/graphRecommendationsClient.js +31 -13
- package/dist/graphRecommendationsClient.js.map +1 -1
- package/dist/graphStateClassifierClient.js +37 -15
- package/dist/graphStateClassifierClient.js.map +1 -1
- package/dist/harnessClient.d.ts +13 -24
- package/dist/harnessClient.js +38 -37
- package/dist/harnessClient.js.map +1 -1
- package/dist/identityClient.d.ts +8 -8
- package/dist/identityClient.js +48 -31
- package/dist/identityClient.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +592 -819
- package/dist/index.js.map +1 -1
- package/dist/infisicalRuntime.js +47 -24
- package/dist/infisicalRuntime.js.map +1 -1
- package/dist/jobsClient.js +37 -15
- package/dist/jobsClient.js.map +1 -1
- package/dist/learningClient.d.ts +6 -6
- package/dist/learningClient.js +55 -39
- package/dist/learningClient.js.map +1 -1
- package/dist/lenses/index.d.ts +29 -35
- package/dist/lenses/index.js +513 -758
- package/dist/lenses/index.js.map +1 -1
- package/dist/mcpClient.js +26 -8
- package/dist/mcpClient.js.map +1 -1
- package/dist/modelRuntimeClient.js +37 -14
- package/dist/modelRuntimeClient.js.map +1 -1
- package/dist/nodes/index.d.ts +17 -17
- package/dist/nodes/index.js +513 -758
- package/dist/nodes/index.js.map +1 -1
- package/dist/ontologies/index.d.ts +31 -30
- package/dist/ontologies/index.js +513 -758
- package/dist/ontologies/index.js.map +1 -1
- package/dist/ontologyClient.d.ts +17 -25
- package/dist/ontologyClient.js +63 -37
- package/dist/ontologyClient.js.map +1 -1
- package/dist/ontologyLinksClient.js +37 -15
- package/dist/ontologyLinksClient.js.map +1 -1
- package/dist/orgGraphSearchClient.js +30 -10
- package/dist/orgGraphSearchClient.js.map +1 -1
- package/dist/packsClient.d.ts +9 -23
- package/dist/packsClient.js +39 -43
- package/dist/packsClient.js.map +1 -1
- package/dist/policyClient.d.ts +11 -10
- package/dist/policyClient.js +48 -22
- package/dist/policyClient.js.map +1 -1
- package/dist/questions/index.d.ts +2 -2
- package/dist/questions/index.js +513 -758
- 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 +84 -48
- package/dist/reportsClient.js.map +1 -1
- package/dist/schemaClient.d.ts +3 -3
- package/dist/schemaClient.js +40 -26
- package/dist/schemaClient.js.map +1 -1
- package/dist/sdkSurface.d.ts +6 -3
- package/dist/sdkSurface.js +10 -6
- package/dist/sdkSurface.js.map +1 -1
- package/dist/sourcesClient.js +27 -11
- package/dist/sourcesClient.js.map +1 -1
- package/dist/telemetryClient.js +37 -15
- package/dist/telemetryClient.js.map +1 -1
- package/dist/toolRegistryClient.d.ts +10 -2
- package/dist/toolRegistryClient.js +50 -16
- package/dist/toolRegistryClient.js.map +1 -1
- package/dist/topics/index.d.ts +5 -5
- package/dist/topics/index.js +513 -758
- package/dist/topics/index.js.map +1 -1
- package/dist/topicsClient.js +37 -16
- package/dist/topicsClient.js.map +1 -1
- 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 +15 -33
- package/dist/workflowClient.js +43 -50
- package/dist/workflowClient.js.map +1 -1
- package/dist/worktrees/index.d.ts +22 -30
- package/dist/worktrees/index.js +513 -758
- package/dist/worktrees/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,9 @@ All notable changes to `@lucern/sdk` will be documented in this file.
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
- No unreleased changes yet.
|
|
7
7
|
|
|
8
|
+
## [0.3.0-alpha.7] - 2026-05-03
|
|
9
|
+
- Rebuild the coherent Lucern package line after Campaign 1 SDK hardening fixes.
|
|
10
|
+
|
|
8
11
|
## [0.2.0-alpha.5] - 2026-04-18
|
|
9
12
|
- Refresh publish from current stackos source under EK-16 T4.
|
|
10
13
|
- Version-numbering note: 0.2.0-alpha.2 through 0.2.0-alpha.5 were published from earlier stackos source on 2026-04-12 by pete_c. This release (alpha.5) is the first to ship the current April 18 source — 56 commits of accumulated changes from the code-separation track.
|
package/dist/adminClient.d.ts
CHANGED
|
@@ -153,11 +153,11 @@ declare function createAdminClient(config?: AdminClientConfig): {
|
|
|
153
153
|
/**
|
|
154
154
|
* Get the control-object ownership contract.
|
|
155
155
|
*/
|
|
156
|
-
getControlObjectOwnership()
|
|
156
|
+
getControlObjectOwnership: () => Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
|
|
157
157
|
/**
|
|
158
158
|
* @deprecated Use getControlObjectOwnership.
|
|
159
159
|
*/
|
|
160
|
-
getControlObjectOwnershipContract()
|
|
160
|
+
getControlObjectOwnershipContract: () => Promise<PlatformGatewaySuccess<ControlObjectOwnershipContract>>;
|
|
161
161
|
/**
|
|
162
162
|
* List workspaces for the current admin scope.
|
|
163
163
|
*/
|
|
@@ -190,33 +190,33 @@ declare function createAdminClient(config?: AdminClientConfig): {
|
|
|
190
190
|
/**
|
|
191
191
|
* Create a membership.
|
|
192
192
|
*/
|
|
193
|
-
createMembership(input: GatewayScope & {
|
|
193
|
+
createMembership: (input: GatewayScope & {
|
|
194
194
|
membershipId?: string;
|
|
195
195
|
principalId: string;
|
|
196
196
|
role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
|
|
197
197
|
status?: "active" | "invited" | "revoked" | "expired";
|
|
198
198
|
source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
|
|
199
|
-
}, idempotencyKey?: string)
|
|
199
|
+
}, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
|
|
200
200
|
/**
|
|
201
201
|
* Update a membership.
|
|
202
202
|
*/
|
|
203
|
-
updateMembership(input: GatewayScope & {
|
|
203
|
+
updateMembership: (input: GatewayScope & {
|
|
204
204
|
membershipId?: string;
|
|
205
205
|
principalId: string;
|
|
206
206
|
role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
|
|
207
207
|
status?: "active" | "invited" | "revoked" | "expired";
|
|
208
208
|
source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
|
|
209
|
-
}, idempotencyKey?: string)
|
|
209
|
+
}, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
|
|
210
210
|
/**
|
|
211
211
|
* @deprecated Use createMembership or updateMembership.
|
|
212
212
|
*/
|
|
213
|
-
upsertMembership(input: GatewayScope & {
|
|
213
|
+
upsertMembership: (input: GatewayScope & {
|
|
214
214
|
membershipId?: string;
|
|
215
215
|
principalId: string;
|
|
216
216
|
role: "platform_admin" | "tenant_admin" | "workspace_admin" | "editor" | "viewer" | "auditor" | "service_agent";
|
|
217
217
|
status?: "active" | "invited" | "revoked" | "expired";
|
|
218
218
|
source?: "bootstrap" | "manual" | "sync" | "sso" | "api" | "scim" | "invitation";
|
|
219
|
-
}, idempotencyKey?: string)
|
|
219
|
+
}, idempotencyKey?: string) => Promise<PlatformGatewaySuccess<unknown>>;
|
|
220
220
|
/**
|
|
221
221
|
* List tenant API keys in the current admin scope.
|
|
222
222
|
*/
|
package/dist/adminClient.js
CHANGED
|
@@ -232,9 +232,7 @@ function generatePortableRequestId() {
|
|
|
232
232
|
8
|
|
233
233
|
).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
234
234
|
}
|
|
235
|
-
|
|
236
|
-
return generatePortableRequestId();
|
|
237
|
-
}
|
|
235
|
+
var randomIdempotencyKey = generatePortableRequestId;
|
|
238
236
|
function isRetryableStatus(status) {
|
|
239
237
|
return status >= 500 || status === 408 || status === 429;
|
|
240
238
|
}
|
|
@@ -299,8 +297,11 @@ function timeoutError(timeoutMs) {
|
|
|
299
297
|
error.name = "AbortError";
|
|
300
298
|
return error;
|
|
301
299
|
}
|
|
300
|
+
function isRecord(value) {
|
|
301
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
302
|
+
}
|
|
302
303
|
function readPolicySummaryFromDetails(details) {
|
|
303
|
-
if (!
|
|
304
|
+
if (!isRecord(details)) {
|
|
304
305
|
return null;
|
|
305
306
|
}
|
|
306
307
|
const directSummary = details.summary;
|
|
@@ -308,11 +309,11 @@ function readPolicySummaryFromDetails(details) {
|
|
|
308
309
|
return directSummary.trim();
|
|
309
310
|
}
|
|
310
311
|
const policy = details.policy;
|
|
311
|
-
if (!
|
|
312
|
+
if (!isRecord(policy)) {
|
|
312
313
|
return null;
|
|
313
314
|
}
|
|
314
315
|
const explanation = policy.explanation;
|
|
315
|
-
if (!
|
|
316
|
+
if (!isRecord(explanation)) {
|
|
316
317
|
return null;
|
|
317
318
|
}
|
|
318
319
|
const nestedSummary = explanation.summary;
|
|
@@ -376,11 +377,11 @@ function createGatewayRequestClient(config = {}) {
|
|
|
376
377
|
if (!text) {
|
|
377
378
|
return null;
|
|
378
379
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
} catch {
|
|
380
|
+
const parsed = tryParseGatewayEnvelopeJson(text);
|
|
381
|
+
if (!parsed.ok) {
|
|
382
382
|
return null;
|
|
383
383
|
}
|
|
384
|
+
return isRecord(parsed.value) ? parsed.value : null;
|
|
384
385
|
}
|
|
385
386
|
function resolveTimeoutMs(method, requestTimeoutMs) {
|
|
386
387
|
if (typeof requestTimeoutMs === "number") {
|
|
@@ -392,16 +393,31 @@ function createGatewayRequestClient(config = {}) {
|
|
|
392
393
|
}
|
|
393
394
|
return config.timeoutMs ?? 15e3;
|
|
394
395
|
}
|
|
396
|
+
function tryParseGatewayEnvelopeJson(text) {
|
|
397
|
+
const trimmed = text.trim();
|
|
398
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) {
|
|
399
|
+
return { ok: false, reason: "non-json" };
|
|
400
|
+
}
|
|
401
|
+
try {
|
|
402
|
+
return { ok: true, value: JSON.parse(trimmed) };
|
|
403
|
+
} catch (error) {
|
|
404
|
+
if (error instanceof SyntaxError) {
|
|
405
|
+
return { ok: false, reason: "invalid-json", error };
|
|
406
|
+
}
|
|
407
|
+
throw error;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
395
410
|
function buildApiError(args) {
|
|
396
411
|
const failure = args.failure;
|
|
397
|
-
const legacyError = failure &&
|
|
412
|
+
const legacyError = failure && isRecord(failure.error) ? failure.error : failure?.legacyError;
|
|
398
413
|
const correlationId = failure?.correlationId ?? args.response.headers.get("x-lucern-correlation-id")?.trim() ?? args.requestId;
|
|
399
414
|
const policyTraceId = failure?.policyTraceId ?? args.response.headers.get("x-lucern-policy-trace-id")?.trim() ?? null;
|
|
400
415
|
const details = failure?.details ?? legacyError?.details;
|
|
401
416
|
const policySummary = readPolicySummaryFromDetails(details);
|
|
417
|
+
const failureMessage = typeof failure?.error === "string" ? failure.error : legacyError?.message;
|
|
402
418
|
return new LucernApiError({
|
|
403
419
|
code: failure?.code ?? legacyError?.code ?? fallbackErrorCode(args.response.status),
|
|
404
|
-
message: policySummary ??
|
|
420
|
+
message: policySummary ?? failureMessage ?? (args.response.ok ? "Platform API returned an invalid success payload." : "Platform API request failed."),
|
|
405
421
|
status: args.response.status,
|
|
406
422
|
invariant: failure?.invariant,
|
|
407
423
|
suggestion: failure?.suggestion,
|
|
@@ -533,7 +549,10 @@ function createListResult(items, legacyKey) {
|
|
|
533
549
|
total: items.length
|
|
534
550
|
};
|
|
535
551
|
if (legacyKey) {
|
|
536
|
-
|
|
552
|
+
return {
|
|
553
|
+
...result,
|
|
554
|
+
[legacyKey]: items
|
|
555
|
+
};
|
|
537
556
|
}
|
|
538
557
|
return result;
|
|
539
558
|
}
|
|
@@ -571,6 +590,17 @@ function asTenantVaultSecretArray(data) {
|
|
|
571
590
|
}
|
|
572
591
|
function createAdminClient(config = {}) {
|
|
573
592
|
const gateway = createGatewayRequestClient(config);
|
|
593
|
+
const getControlObjectOwnership = async () => gateway.request({
|
|
594
|
+
path: "/api/platform/v1/admin/control-ownership"
|
|
595
|
+
});
|
|
596
|
+
const createMembership = async (input, idempotencyKey) => gateway.request({
|
|
597
|
+
path: "/api/platform/v1/memberships",
|
|
598
|
+
method: "POST",
|
|
599
|
+
body: input,
|
|
600
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
601
|
+
});
|
|
602
|
+
const updateMembership = createMembership;
|
|
603
|
+
const upsertMembership = createMembership;
|
|
574
604
|
return {
|
|
575
605
|
/**
|
|
576
606
|
* List tenants visible to the current principal.
|
|
@@ -602,19 +632,11 @@ function createAdminClient(config = {}) {
|
|
|
602
632
|
/**
|
|
603
633
|
* Get the control-object ownership contract.
|
|
604
634
|
*/
|
|
605
|
-
|
|
606
|
-
return gateway.request({
|
|
607
|
-
path: "/api/platform/v1/admin/control-ownership"
|
|
608
|
-
});
|
|
609
|
-
},
|
|
635
|
+
getControlObjectOwnership,
|
|
610
636
|
/**
|
|
611
637
|
* @deprecated Use getControlObjectOwnership.
|
|
612
638
|
*/
|
|
613
|
-
|
|
614
|
-
return gateway.request({
|
|
615
|
-
path: "/api/platform/v1/admin/control-ownership"
|
|
616
|
-
});
|
|
617
|
-
},
|
|
639
|
+
getControlObjectOwnershipContract: getControlObjectOwnership,
|
|
618
640
|
/**
|
|
619
641
|
* List workspaces for the current admin scope.
|
|
620
642
|
*/
|
|
@@ -661,26 +683,15 @@ function createAdminClient(config = {}) {
|
|
|
661
683
|
/**
|
|
662
684
|
* Create a membership.
|
|
663
685
|
*/
|
|
664
|
-
|
|
665
|
-
return gateway.request({
|
|
666
|
-
path: "/api/platform/v1/memberships",
|
|
667
|
-
method: "POST",
|
|
668
|
-
body: input,
|
|
669
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey()
|
|
670
|
-
});
|
|
671
|
-
},
|
|
686
|
+
createMembership,
|
|
672
687
|
/**
|
|
673
688
|
* Update a membership.
|
|
674
689
|
*/
|
|
675
|
-
|
|
676
|
-
return this.createMembership(input, idempotencyKey);
|
|
677
|
-
},
|
|
690
|
+
updateMembership,
|
|
678
691
|
/**
|
|
679
692
|
* @deprecated Use createMembership or updateMembership.
|
|
680
693
|
*/
|
|
681
|
-
|
|
682
|
-
return this.createMembership(input, idempotencyKey);
|
|
683
|
-
},
|
|
694
|
+
upsertMembership,
|
|
684
695
|
/**
|
|
685
696
|
* List tenant API keys in the current admin scope.
|
|
686
697
|
*/
|