@lucern/sdk 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/accessControl.d.ts +31 -31
- package/dist/accessControl.js +1 -0
- package/dist/adminClient.d.ts +74 -74
- package/dist/adminClient.js +38 -30
- package/dist/{answersClient.d.ts → answers-client.d.ts} +1 -1
- package/dist/{answersClient.js → answers-client.js} +2 -2
- package/dist/audience/index.d.ts +12 -12
- package/dist/{audiencesClient.d.ts → audiences-client.d.ts} +1 -1
- package/dist/audiences-client.js +107 -0
- package/dist/{auditClient.d.ts → audit-client.d.ts} +2 -3
- package/dist/{auditClient.js → audit-client.js} +8 -7
- package/dist/authContext.d.ts +26 -26
- package/dist/authDeviceClient.d.ts +11 -11
- package/dist/authDeviceClient.js +4 -6
- package/dist/beliefs/index.d.ts +56 -28
- package/dist/beliefs/index.js +2 -1
- package/dist/beliefsClient.d.ts +71 -63
- package/dist/beliefsClient.js +90 -67
- package/dist/{boundaryClientSurface.d.ts → boundary-client-surface.d.ts} +4 -4
- package/dist/{boundaryClientSurface.js → boundary-client-surface.js} +9 -7
- package/dist/client-assembly-types.d.ts +219 -0
- package/dist/client-assembly-types.js +2 -0
- package/dist/{clientConfig.d.ts → client-config.d.ts} +16 -32
- package/dist/client-config.js +2 -0
- package/dist/{clientEvidenceCompat.d.ts → client-evidence-compat.d.ts} +24 -24
- package/dist/{clientEvidenceCompat.js → client-evidence-compat.js} +2 -2
- package/dist/client.d.ts +1906 -352
- package/dist/client.js +34 -30
- package/dist/clientGraphNamespaces.d.ts +35 -25
- package/dist/clientGraphNamespaces.js +11 -5
- package/dist/clientHelpers.js +8 -5
- package/dist/clientKnowledgeNamespaces.d.ts +124 -84
- package/dist/clientKnowledgeNamespaces.js +35 -34
- package/dist/clientLocalHelpers.d.ts +81 -52
- package/dist/clientLocalHelpers.js +193 -43
- package/dist/clientPlatformNamespaces.d.ts +1541 -150
- package/dist/clientPlatformNamespaces.js +10 -5
- package/dist/clientRuntime.d.ts +1 -1
- package/dist/clientRuntime.js +1 -1
- package/dist/clientWorkflowNamespaces.d.ts +211 -97
- package/dist/clientWorkflowNamespaces.js +22 -19
- package/dist/contextClient.d.ts +2 -2
- package/dist/contextClient.js +79 -50
- package/dist/contextFacade.d.ts +1 -1
- package/dist/contextFacade.js +2 -0
- package/dist/contextPackCompiler.d.ts +52 -52
- package/dist/contextPackCompiler.js +192 -122
- package/dist/contextPackPolicy.d.ts +22 -22
- package/dist/contextPackPolicy.js +21 -9
- package/dist/contextPackSchema.d.ts +3 -3
- package/dist/contextPackSchema.js +1 -0
- package/dist/contextTypes.d.ts +155 -155
- package/dist/contracts/api-enums.contract.js +2 -11
- package/dist/contracts/auth-session.contract.d.ts +16 -16
- package/dist/contracts/auth-session.contract.js +3 -2
- package/dist/contracts/context-pack.contract.d.ts +216 -216
- package/dist/contracts/contextPack.js +2 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +2 -1
- package/dist/contracts/lens-filter.contract.d.ts +8 -8
- package/dist/contracts/lens-filter.contract.js +10 -10
- package/dist/contracts/lens-workflow.contract.d.ts +32 -32
- package/dist/contracts/lens-workflow.contract.js +2 -1
- package/dist/contracts/lensFilter.js +2 -0
- package/dist/contracts/lensWorkflow.js +2 -0
- package/dist/contracts/mcpTools.d.ts +19 -19
- package/dist/contracts/mcpTools.js +3 -1
- package/dist/contracts/prompt.contract.d.ts +12 -12
- package/dist/contracts/prompt.js +1 -0
- package/dist/contracts/sdk-tools.contract.js +1 -0
- package/dist/contracts/sdkTools.js +2 -0
- package/dist/contracts/tool-contracts.js +1 -0
- package/dist/contracts/workflow-runtime.contract.d.ts +45 -45
- package/dist/contracts/workflow-runtime.contract.js +1 -5
- package/dist/contracts/workflowRuntime.js +2 -0
- package/dist/contradictions/index.d.ts +8 -8
- package/dist/contradictions/index.js +1 -0
- package/dist/control-plane.d.ts +10 -10
- package/dist/control-plane.js +2 -2
- package/dist/controlObjectOwnership.d.ts +11 -11
- package/dist/controlObjectOwnership.js +1 -0
- package/dist/coreClient.d.ts +51 -51
- package/dist/coreClient.js +269 -101
- package/dist/customTools.d.ts +19 -19
- package/dist/customTools.js +4 -2
- package/dist/decisions/index.d.ts +18 -18
- package/dist/decisions/index.js +1 -0
- package/dist/decisionsClient.d.ts +4 -4
- package/dist/decisionsClient.js +36 -27
- package/dist/edges/index.d.ts +20 -18
- package/dist/edges/index.js +1 -0
- package/dist/embeddingsClient.d.ts +29 -29
- package/dist/embeddingsClient.js +15 -8
- package/dist/eventingClient.d.ts +27 -27
- package/dist/eventingClient.js +10 -5
- package/dist/events.d.ts +83 -83
- package/dist/events.js +19 -15
- package/dist/eventsCore.d.ts +7 -7
- package/dist/eventsCore.js +11 -10
- package/dist/evidence/index.d.ts +23 -21
- package/dist/evidence/index.js +1 -0
- package/dist/evidenceClient.d.ts +23 -23
- package/dist/evidenceClient.js +10 -6
- package/dist/facade/context.d.ts +9 -9
- package/dist/facade/context.js +67 -41
- package/dist/functionSurface.js +2 -0
- package/dist/functionSurfaceClient.js +2 -0
- package/dist/gatewayFacades.d.ts +215 -215
- package/dist/gatewayFacades.factories.d.ts +23 -44
- package/dist/gatewayFacades.factories.js +63 -62
- package/dist/gatewayFacades.js +31 -32
- package/dist/graphAnalysisClient.d.ts +60 -60
- package/dist/graphAnalysisClient.js +19 -18
- package/dist/graphClient.d.ts +34 -34
- package/dist/graphClient.js +56 -35
- package/dist/graphIntel.js +2 -0
- package/dist/graphIntelligence.d.ts +2 -2
- package/dist/graphIntelligence.js +1 -1
- package/dist/graphRecommendationsClient.d.ts +24 -24
- package/dist/graphRecommendationsClient.js +12 -7
- package/dist/graphStateClassifierClient.d.ts +13 -13
- package/dist/graphStateClassifierClient.js +10 -5
- package/dist/harnessClient.d.ts +61 -61
- package/dist/harnessClient.js +44 -31
- package/dist/identityClient.d.ts +33 -59
- package/dist/identityClient.js +126 -98
- package/dist/index.d.ts +20 -20
- package/dist/index.js +20 -19
- package/dist/infisicalRuntime.d.ts +11 -11
- package/dist/infisicalRuntime.js +20 -14
- package/dist/jobsClient.d.ts +28 -28
- package/dist/jobsClient.js +6 -3
- package/dist/learningClient.js +13 -8
- package/dist/lenses/index.d.ts +124 -28
- package/dist/lenses/index.js +1 -0
- package/dist/mcpClient.d.ts +1 -1
- package/dist/mcpClient.js +3 -3
- package/dist/modelRuntimeClient.d.ts +27 -27
- package/dist/modelRuntimeClient.js +10 -5
- package/dist/nodes/index.d.ts +9 -9
- package/dist/nodes/index.js +1 -0
- package/dist/ontologies/index.d.ts +68 -22
- package/dist/ontologies/index.js +1 -0
- package/dist/ontologyClient.js +24 -17
- package/dist/ontologyLinksClient.d.ts +35 -35
- package/dist/ontologyLinksClient.js +9 -6
- package/dist/opinion.d.ts +3 -3
- package/dist/opinion.js +12 -5
- package/dist/orgGraphSearchClient.d.ts +39 -39
- package/dist/orgGraphSearchClient.js +22 -13
- package/dist/packsClient.d.ts +1 -1
- package/dist/packsClient.js +28 -19
- package/dist/policyClient.d.ts +79 -68
- package/dist/policyClient.js +18 -12
- package/dist/proof-attestation.json +1 -1
- package/dist/questions/index.d.ts +38 -27
- package/dist/questions/index.js +1 -0
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +1 -0
- package/dist/realtime/refs.d.ts +2 -2
- package/dist/{reportsClient.d.ts → reports-client.d.ts} +2 -2
- package/dist/{reportsClient.js → reports-client.js} +19 -13
- package/dist/{schemaClient.d.ts → schema-client.d.ts} +2 -3
- package/dist/{schemaClient.js → schema-client.js} +14 -11
- package/dist/sdkSurface.d.ts +12 -12
- package/dist/sdkSurface.js +14 -10
- package/dist/secrets.d.ts +1 -1
- package/dist/secrets.js +2 -1
- package/dist/{sourcesClient.d.ts → sources-client.d.ts} +8 -9
- package/dist/{sourcesClient.js → sources-client.js} +4 -5
- package/dist/{telemetryClient.d.ts → telemetry-client.d.ts} +14 -14
- package/dist/{telemetryClient.js → telemetry-client.js} +6 -4
- package/dist/toolRegistryClient.d.ts +46 -46
- package/dist/toolRegistryClient.js +22 -11
- package/dist/topics/index.d.ts +23 -23
- package/dist/topics/index.js +2 -1
- package/dist/topicsClient.d.ts +6 -6
- package/dist/topicsClient.js +29 -18
- package/dist/types.d.ts +356 -355
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workflowClient.d.ts +36 -35
- package/dist/workflowClient.js +88 -60
- package/dist/worktrees/index.d.ts +118 -32
- package/dist/worktrees/index.js +2 -1
- package/package.json +45 -5
- package/dist/audiencesClient.js +0 -115
- package/dist/clientAssemblyTypes.d.ts +0 -33
- package/dist/clientAssemblyTypes.js +0 -2
- package/dist/clientConfig.js +0 -2
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { createGatewayRequestClient, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
|
|
2
|
+
import { createListResult, mapGatewayData } from "./sdkSurface.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create the audiences client for registry entries and grants.
|
|
5
|
+
* @param config - Gateway transport configuration.
|
|
6
|
+
* @returns An object with methods to manage audience registry entries and grants.
|
|
7
|
+
*/
|
|
8
|
+
export function createAudiencesClient(config = {}) {
|
|
9
|
+
const gateway = createGatewayRequestClient(config);
|
|
10
|
+
function serializeBoolean(value) {
|
|
11
|
+
if (typeof value !== "boolean") {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
return value ? "true" : "false";
|
|
15
|
+
}
|
|
16
|
+
const listRegistry = (query = {}) => gateway
|
|
17
|
+
.request({
|
|
18
|
+
path: `/api/platform/v1/audiences/registry${toQueryString({
|
|
19
|
+
...query,
|
|
20
|
+
effective: serializeBoolean(query.effective),
|
|
21
|
+
status: query.status,
|
|
22
|
+
})}`,
|
|
23
|
+
})
|
|
24
|
+
.then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "registryEntries")));
|
|
25
|
+
const createRegistryEntry = (input, idempotencyKey) => gateway.request({
|
|
26
|
+
path: "/api/platform/v1/audiences/registry",
|
|
27
|
+
method: "POST",
|
|
28
|
+
body: input,
|
|
29
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
30
|
+
});
|
|
31
|
+
const updateRegistryEntry = createRegistryEntry;
|
|
32
|
+
const upsertRegistry = createRegistryEntry;
|
|
33
|
+
const getRegistry = listRegistry;
|
|
34
|
+
const listGrants = (query = {}) => gateway
|
|
35
|
+
.request({
|
|
36
|
+
path: `/api/platform/v1/audiences/grants${toQueryString({
|
|
37
|
+
...query,
|
|
38
|
+
audienceKey: query.audienceKey,
|
|
39
|
+
principalId: query.principalId,
|
|
40
|
+
groupId: query.groupId,
|
|
41
|
+
status: query.status,
|
|
42
|
+
})}`,
|
|
43
|
+
})
|
|
44
|
+
.then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "grants")));
|
|
45
|
+
const createGrant = (input, idempotencyKey) => gateway.request({
|
|
46
|
+
path: "/api/platform/v1/audiences/grants",
|
|
47
|
+
method: "POST",
|
|
48
|
+
body: input,
|
|
49
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
50
|
+
});
|
|
51
|
+
const getGrants = listGrants;
|
|
52
|
+
const grant = createGrant;
|
|
53
|
+
const deleteGrant = (input, idempotencyKey) => gateway.request({
|
|
54
|
+
path: "/api/platform/v1/audiences/grants/revoke",
|
|
55
|
+
method: "POST",
|
|
56
|
+
body: input,
|
|
57
|
+
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
58
|
+
});
|
|
59
|
+
const revokeGrant = deleteGrant;
|
|
60
|
+
return {
|
|
61
|
+
/**
|
|
62
|
+
* List audience registry entries.
|
|
63
|
+
*/
|
|
64
|
+
listRegistry,
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Use listRegistry.
|
|
67
|
+
*/
|
|
68
|
+
getRegistry,
|
|
69
|
+
/**
|
|
70
|
+
* Create an audience registry entry.
|
|
71
|
+
*/
|
|
72
|
+
createRegistryEntry,
|
|
73
|
+
/**
|
|
74
|
+
* Update an audience registry entry.
|
|
75
|
+
*/
|
|
76
|
+
updateRegistryEntry,
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated Use createRegistryEntry or updateRegistryEntry.
|
|
79
|
+
*/
|
|
80
|
+
upsertRegistry,
|
|
81
|
+
/**
|
|
82
|
+
* List audience grants.
|
|
83
|
+
*/
|
|
84
|
+
listGrants,
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated Use listGrants.
|
|
87
|
+
*/
|
|
88
|
+
getGrants,
|
|
89
|
+
/**
|
|
90
|
+
* Create an audience grant.
|
|
91
|
+
*/
|
|
92
|
+
createGrant,
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated Use createGrant.
|
|
95
|
+
*/
|
|
96
|
+
grant,
|
|
97
|
+
/**
|
|
98
|
+
* Delete an audience grant by revoking it.
|
|
99
|
+
*/
|
|
100
|
+
deleteGrant,
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use deleteGrant.
|
|
103
|
+
*/
|
|
104
|
+
revokeGrant,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=audiences-client.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type GatewayScope
|
|
1
|
+
import { type GatewayClientConfig, type GatewayScope } from "./coreClient";
|
|
2
2
|
import type { TopicIdentifierInput } from "./types";
|
|
3
|
-
export { LucernApiError };
|
|
4
3
|
export type { GatewayScope, PlatformGatewaySuccess } from "./coreClient";
|
|
5
4
|
/** Configuration for the audit client. */
|
|
6
5
|
export type AuditClientConfig = GatewayClientConfig;
|
|
@@ -22,4 +21,4 @@ export declare function createAuditClient(config?: AuditClientConfig): {
|
|
|
22
21
|
limit?: number;
|
|
23
22
|
} & TopicIdentifierInput): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "events">>>;
|
|
24
23
|
};
|
|
25
|
-
//# sourceMappingURL=
|
|
24
|
+
//# sourceMappingURL=audit-client.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { createGatewayRequestClient,
|
|
2
|
-
import { createListResult, mapGatewayData, normalizeTopicQuery } from "./sdkSurface.js";
|
|
3
|
-
export { LucernApiError };
|
|
1
|
+
import { createGatewayRequestClient, toQueryString, } from "./coreClient.js";
|
|
2
|
+
import { createListResult, mapGatewayData, normalizeTopicQuery, } from "./sdkSurface.js";
|
|
4
3
|
/**
|
|
5
4
|
* Create the audit client for transport-level audit event reads.
|
|
6
5
|
* @param config - Gateway transport configuration.
|
|
@@ -12,11 +11,13 @@ export function createAuditClient(config = {}) {
|
|
|
12
11
|
/**
|
|
13
12
|
* List audit events for the current scope.
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
return gateway
|
|
14
|
+
listEvents(query = {}) {
|
|
15
|
+
return gateway
|
|
16
|
+
.request({
|
|
17
17
|
path: `/api/platform/v1/audit/events${toQueryString(normalizeTopicQuery(query))}`,
|
|
18
|
-
})
|
|
18
|
+
})
|
|
19
|
+
.then((response) => mapGatewayData(response, (data) => createListResult(Array.isArray(data) ? data : [], "events")));
|
|
19
20
|
},
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=audit-client.js.map
|
package/dist/authContext.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import type { SessionAuthMode, SessionDelegationHop, SessionPrincipalType } from "./contracts/auth-session.contract";
|
|
2
2
|
import type { JsonObject } from "./types";
|
|
3
3
|
export type LucernSdkAuthFailureReason = "principal_missing" | "tenant_missing" | "membership_missing" | "workspace_missing" | "clerk_alias_missing" | "clerk_alias_unrecognized" | "policy_denied" | "policy_unavailable" | "policy_unknown";
|
|
4
|
-
export
|
|
4
|
+
export interface PermitReadyAuthContext {
|
|
5
|
+
action?: string;
|
|
6
|
+
context?: JsonObject;
|
|
7
|
+
relation?: string;
|
|
8
|
+
resource?: string;
|
|
5
9
|
subject: string;
|
|
6
10
|
tenant: string;
|
|
7
11
|
workspace: string;
|
|
8
|
-
|
|
9
|
-
action?: string;
|
|
10
|
-
relation?: string;
|
|
11
|
-
context?: JsonObject;
|
|
12
|
-
};
|
|
12
|
+
}
|
|
13
13
|
export type LucernSdkAuthPolicyDecision = "allow" | "deny" | "unknown";
|
|
14
|
-
export
|
|
14
|
+
export interface LucernSdkAuthContextInput {
|
|
15
|
+
authMode?: SessionAuthMode;
|
|
15
16
|
clerkId?: string;
|
|
17
|
+
correlationId?: string;
|
|
18
|
+
delegationChain?: readonly SessionDelegationHop[];
|
|
19
|
+
membershipId?: string;
|
|
20
|
+
permit?: Partial<PermitReadyAuthContext>;
|
|
21
|
+
policyDecision?: LucernSdkAuthPolicyDecision;
|
|
22
|
+
policyTraceId?: string;
|
|
16
23
|
principalId?: string;
|
|
17
|
-
tenantId?: string;
|
|
18
|
-
workspaceId?: string | null;
|
|
19
24
|
principalType?: SessionPrincipalType;
|
|
20
|
-
authMode?: SessionAuthMode;
|
|
21
25
|
roles?: readonly string[];
|
|
22
26
|
scopes?: readonly string[];
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
tenantId?: string;
|
|
28
|
+
workspaceId?: string | null;
|
|
29
|
+
}
|
|
30
|
+
export interface CanonicalLucernSdkAuthContext {
|
|
31
|
+
authMode: SessionAuthMode;
|
|
32
|
+
clerkId?: string;
|
|
25
33
|
correlationId?: string;
|
|
34
|
+
delegationChain: SessionDelegationHop[];
|
|
26
35
|
membershipId?: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
export type CanonicalLucernSdkAuthContext = {
|
|
31
|
-
clerkId?: string;
|
|
36
|
+
permit: PermitReadyAuthContext;
|
|
37
|
+
policyTraceId?: string;
|
|
32
38
|
principalId: string;
|
|
33
|
-
tenantId: string;
|
|
34
|
-
workspaceId: string;
|
|
35
39
|
principalType: SessionPrincipalType;
|
|
36
|
-
authMode: SessionAuthMode;
|
|
37
40
|
roles: string[];
|
|
38
41
|
scopes: string[];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
membershipId?: string;
|
|
43
|
-
permit: PermitReadyAuthContext;
|
|
44
|
-
};
|
|
42
|
+
tenantId: string;
|
|
43
|
+
workspaceId: string;
|
|
44
|
+
}
|
|
45
45
|
export declare class LucernSdkAuthContextError extends Error {
|
|
46
46
|
readonly reason: LucernSdkAuthFailureReason;
|
|
47
47
|
constructor(reason: LucernSdkAuthFailureReason, message: string);
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import type { GatewayClientConfig } from "./coreClient";
|
|
2
|
-
export
|
|
2
|
+
export interface DeviceCodeInput {
|
|
3
3
|
clientId?: string;
|
|
4
4
|
scope?: string;
|
|
5
|
-
}
|
|
6
|
-
export
|
|
5
|
+
}
|
|
6
|
+
export interface DeviceCodeResponse {
|
|
7
7
|
device_code: string;
|
|
8
|
+
expires_in: number;
|
|
9
|
+
interval: number;
|
|
8
10
|
user_code: string;
|
|
9
11
|
verification_uri: string;
|
|
10
12
|
verification_uri_complete: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export type DeviceTokenResponse = {
|
|
13
|
+
}
|
|
14
|
+
export interface DeviceTokenResponse {
|
|
15
15
|
access_token: string;
|
|
16
|
-
token_type: "Bearer";
|
|
17
16
|
expires_in: number;
|
|
17
|
+
principal_id: string;
|
|
18
18
|
scope: string;
|
|
19
19
|
tenant_id: string;
|
|
20
|
-
|
|
21
|
-
principal_id: string;
|
|
20
|
+
token_type: "Bearer";
|
|
22
21
|
user?: {
|
|
23
22
|
id: string;
|
|
24
23
|
principalId: string;
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
workspace_id?: string;
|
|
26
|
+
}
|
|
27
27
|
export type DeviceTokenErrorCode = "authorization_pending" | "slow_down" | "access_denied" | "expired_token" | "invalid_grant" | "invalid_request";
|
|
28
28
|
export declare class DeviceAuthorizationError extends Error {
|
|
29
29
|
readonly error: DeviceTokenErrorCode;
|
package/dist/authDeviceClient.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const TRAILING_SLASH_PATTERN = /\/+$/;
|
|
1
2
|
export class DeviceAuthorizationError extends Error {
|
|
2
3
|
error;
|
|
3
4
|
interval;
|
|
@@ -9,7 +10,7 @@ export class DeviceAuthorizationError extends Error {
|
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
function authBaseUrl(config) {
|
|
12
|
-
return config.baseUrl?.replace(
|
|
13
|
+
return config.baseUrl?.replace(TRAILING_SLASH_PATTERN, "") ?? "";
|
|
13
14
|
}
|
|
14
15
|
async function readJson(response) {
|
|
15
16
|
try {
|
|
@@ -37,10 +38,7 @@ function assertDeviceCodeResponse(payload) {
|
|
|
37
38
|
const verificationUriComplete = readString(payload.verification_uri_complete);
|
|
38
39
|
const expiresIn = payload.expires_in;
|
|
39
40
|
const interval = payload.interval;
|
|
40
|
-
if (!deviceCode ||
|
|
41
|
-
!userCode ||
|
|
42
|
-
!verificationUri ||
|
|
43
|
-
!verificationUriComplete ||
|
|
41
|
+
if (!(deviceCode && userCode && verificationUri && verificationUriComplete) ||
|
|
44
42
|
typeof expiresIn !== "number" ||
|
|
45
43
|
typeof interval !== "number") {
|
|
46
44
|
throw new Error("Gateway returned an invalid device-code response.");
|
|
@@ -97,7 +95,7 @@ function maybeThrowDeviceError(payload) {
|
|
|
97
95
|
export function createAuthDeviceClient(config = {}) {
|
|
98
96
|
const fetchImpl = config.fetchImpl ?? fetch;
|
|
99
97
|
const baseUrl = authBaseUrl(config);
|
|
100
|
-
|
|
98
|
+
function post(path, body) {
|
|
101
99
|
return fetchImpl(`${baseUrl}${path}`, {
|
|
102
100
|
method: "POST",
|
|
103
101
|
headers: { "content-type": "application/json" },
|
package/dist/beliefs/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type LucernClientConfig } from "../client";
|
|
2
2
|
export * as beliefsContracts from "@lucern/contracts/beliefs/v1";
|
|
3
|
-
export * as toolSchemas from "@lucern/contracts/tool-contracts";
|
|
4
3
|
export * as methodSchemas from "@lucern/contracts/sdk-methods.contract";
|
|
4
|
+
export * as toolSchemas from "@lucern/contracts/tool-contracts";
|
|
5
5
|
export type BeliefsClientConfig = LucernClientConfig;
|
|
6
6
|
export type BeliefsClient = ReturnType<typeof createBeliefsClient>;
|
|
7
7
|
export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
8
|
-
createBelief: (input: import("
|
|
9
|
-
getBelief: (nodeId: string) =>
|
|
8
|
+
createBelief: (input: import("..").CreateBeliefInput) => Promise<import("../client-config").GatewayDataEnvelope<import("..").PlatformBeliefRecord>>;
|
|
9
|
+
getBelief: (nodeId: string) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefRecord>>;
|
|
10
10
|
listBeliefs: (args: {
|
|
11
11
|
topicId?: string;
|
|
12
12
|
worktreeId?: string;
|
|
@@ -14,37 +14,65 @@ export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
|
14
14
|
minConfidence?: number;
|
|
15
15
|
limit?: number;
|
|
16
16
|
cursor?: string;
|
|
17
|
-
}) =>
|
|
18
|
-
searchBeliefs:
|
|
17
|
+
}) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefsListResult>>;
|
|
18
|
+
searchBeliefs: (args_0: import("..").JsonObject) => Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
|
|
19
19
|
refineBelief: (nodeId: string, textOrInput: string | {
|
|
20
20
|
text: string;
|
|
21
21
|
rationale?: string;
|
|
22
|
-
}, rationale?: string) =>
|
|
23
|
-
forkBelief: (nodeId: string, input: import("../
|
|
22
|
+
}, rationale?: string) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefRecord>>;
|
|
23
|
+
forkBelief: (nodeId: string, input: import("../client-config").BeliefsCompatForkInput) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefRecord>>;
|
|
24
24
|
archiveBelief: (nodeId: string, input?: string | {
|
|
25
25
|
reason?: string;
|
|
26
26
|
rationale?: string;
|
|
27
|
-
}) =>
|
|
28
|
-
getBeliefLineage: (nodeId: string) =>
|
|
29
|
-
getBeliefConfidenceHistory: (nodeId: string) =>
|
|
27
|
+
}) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
28
|
+
getBeliefLineage: (nodeId: string) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefsLineageResult>>;
|
|
29
|
+
getBeliefConfidenceHistory: (nodeId: string) => Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
30
30
|
raw: {
|
|
31
|
-
create(input: import("
|
|
32
|
-
get(nodeId: string):
|
|
31
|
+
create(input: import("..").CreateBeliefInput): Promise<import("../client-config").GatewayDataEnvelope<import("..").PlatformBeliefRecord>>;
|
|
32
|
+
get(nodeId: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefRecord>>;
|
|
33
33
|
refine(nodeId: string, textOrInput: string | {
|
|
34
34
|
text: string;
|
|
35
35
|
rationale?: string;
|
|
36
|
-
}, rationale?: string):
|
|
37
|
-
updateRationale(input: Parameters<(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
}, rationale?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefRecord>>;
|
|
37
|
+
updateRationale(input: Parameters<(input: {
|
|
38
|
+
id?: string;
|
|
39
|
+
nodeId?: string;
|
|
40
|
+
beliefId?: string;
|
|
41
|
+
rationale?: string;
|
|
42
|
+
}, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
43
|
+
linkBeliefs(input: Parameters<(input: {
|
|
44
|
+
fromNodeId: string;
|
|
45
|
+
toNodeId: string;
|
|
46
|
+
edgeType: string;
|
|
47
|
+
weight?: number;
|
|
48
|
+
context?: string;
|
|
49
|
+
}, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
50
|
+
unlinkEvidence(input: Parameters<(input: {
|
|
51
|
+
beliefNodeId?: string;
|
|
52
|
+
beliefId?: string;
|
|
53
|
+
insightId?: string;
|
|
54
|
+
evidenceId?: string;
|
|
55
|
+
}, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
56
|
+
updateCriticality(input: Parameters<(input: {
|
|
57
|
+
id?: string;
|
|
58
|
+
nodeId?: string;
|
|
59
|
+
beliefId?: string;
|
|
60
|
+
criticality: string;
|
|
61
|
+
}, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
62
|
+
batchUpdateCriticality(input: Parameters<(input: {
|
|
63
|
+
updates: import("../gatewayFacades").GatewayRecord[];
|
|
64
|
+
}, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
65
|
+
reassignTopic(input: Parameters<(input: {
|
|
66
|
+
beliefNodeIds?: string[];
|
|
67
|
+
beliefIds?: string[];
|
|
68
|
+
targetTopicId: string;
|
|
69
|
+
reason?: string;
|
|
70
|
+
}, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[0], idempotencyKey?: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
71
|
+
fork(nodeId: string, input: import("../client-config").BeliefsCompatForkInput): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefRecord>>;
|
|
44
72
|
archive(nodeId: string, input?: string | {
|
|
45
73
|
reason?: string;
|
|
46
74
|
rationale?: string;
|
|
47
|
-
}):
|
|
75
|
+
}): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
48
76
|
list(args: {
|
|
49
77
|
topicId?: string;
|
|
50
78
|
worktreeId?: string;
|
|
@@ -52,13 +80,13 @@ export declare function createBeliefsClient(config?: BeliefsClientConfig): {
|
|
|
52
80
|
minConfidence?: number;
|
|
53
81
|
limit?: number;
|
|
54
82
|
cursor?: string;
|
|
55
|
-
}):
|
|
56
|
-
search:
|
|
57
|
-
lineage(nodeId: string):
|
|
58
|
-
confidenceHistory(nodeId: string):
|
|
59
|
-
opinionHistory:
|
|
60
|
-
createContract(nodeId: string, input: Parameters<(
|
|
61
|
-
bisect(nodeId: string, input: Parameters<(
|
|
83
|
+
}): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefsListResult>>;
|
|
84
|
+
search: (args_0: import("..").JsonObject) => Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
|
|
85
|
+
lineage(nodeId: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").BeliefsLineageResult>>;
|
|
86
|
+
confidenceHistory(nodeId: string): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
87
|
+
opinionHistory: (args_0: string) => Promise<import("..").PlatformGatewaySuccess<Record<string, unknown>> & Record<string, unknown>>;
|
|
88
|
+
createContract(nodeId: string, input: Parameters<(id: string, input: import("../gatewayFacades").BeliefContractInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[1]): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
89
|
+
bisect(nodeId: string, input: Parameters<(id: string, input: import("../gatewayFacades").BeliefBisectInput, idempotencyKey?: string) => Promise<import("..").PlatformGatewaySuccess<import("../gatewayFacades").GatewayRecord>>>[1]): Promise<import("../client-config").GatewayDataEnvelope<import("../gatewayFacades").GatewayRecord>>;
|
|
62
90
|
};
|
|
63
91
|
};
|
|
64
92
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/beliefs/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
// biome-ignore-all lint/performance/noBarrelFile: This file is an @lucern/sdk public import ABI / package subpath compatibility surface; the facade/barrel export is intentional.
|
|
1
2
|
import { createLucernClient } from "../client.js";
|
|
2
3
|
export * as beliefsContracts from "@lucern/contracts/beliefs/v1";
|
|
3
|
-
export * as toolSchemas from "@lucern/contracts/tool-contracts";
|
|
4
4
|
export * as methodSchemas from "@lucern/contracts/sdk-methods.contract";
|
|
5
|
+
export * as toolSchemas from "@lucern/contracts/tool-contracts";
|
|
5
6
|
export function createBeliefsClient(config = {}) {
|
|
6
7
|
const beliefs = createLucernClient(config).beliefs;
|
|
7
8
|
return {
|