@lucern/sdk 0.3.0-alpha.8 → 0.3.0-alpha.9
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/dist/beliefs/index.d.ts +1 -0
- package/dist/beliefs/index.js +21 -9
- package/dist/beliefs/index.js.map +1 -1
- package/dist/client.d.ts +5 -2
- package/dist/client.js +21 -9
- package/dist/client.js.map +1 -1
- package/dist/clientHelpers.d.ts +21 -2
- package/dist/clientHelpers.js +16 -1
- package/dist/clientHelpers.js.map +1 -1
- package/dist/contradictions/index.d.ts +1 -0
- package/dist/contradictions/index.js +21 -9
- package/dist/contradictions/index.js.map +1 -1
- package/dist/decisions/index.d.ts +1 -0
- package/dist/decisions/index.js +21 -9
- package/dist/decisions/index.js.map +1 -1
- package/dist/edges/index.d.ts +1 -0
- package/dist/edges/index.js +21 -9
- package/dist/edges/index.js.map +1 -1
- package/dist/evidence/index.d.ts +1 -0
- package/dist/evidence/index.js +21 -9
- package/dist/evidence/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/dist/lenses/index.d.ts +1 -0
- package/dist/lenses/index.js +21 -9
- package/dist/lenses/index.js.map +1 -1
- package/dist/nodes/index.d.ts +1 -0
- package/dist/nodes/index.js +21 -9
- package/dist/nodes/index.js.map +1 -1
- package/dist/ontologies/index.d.ts +1 -0
- package/dist/ontologies/index.js +21 -9
- package/dist/ontologies/index.js.map +1 -1
- package/dist/questions/index.d.ts +1 -0
- package/dist/questions/index.js +21 -9
- package/dist/questions/index.js.map +1 -1
- package/dist/topics/index.d.ts +1 -0
- package/dist/topics/index.js +21 -9
- package/dist/topics/index.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/worktrees/index.d.ts +1 -0
- package/dist/worktrees/index.js +21 -9
- package/dist/worktrees/index.js.map +1 -1
- package/package.json +4 -4
package/dist/client.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ import { LearningClientConfig } from './learningClient.js';
|
|
|
38
38
|
import { ReportsClientConfig } from './reportsClient.js';
|
|
39
39
|
import { SourcesClientConfig, UpsertSourceSpec } from './sourcesClient.js';
|
|
40
40
|
import { WorkflowClientConfig, WorkflowLensPerspectiveType, WorkflowLensStatus, AddWorktreeInput, WorkflowWorktreeStatus, UpdateWorktreeTargetsInput, MergeInput, CreateTaskInput, CompleteTaskInput, UpdateTaskInput, WorkflowBranchStatus, CompleteWorktreeInput, AdvanceWorktreePhaseInput, SetWorktreePhaseInput, PatchWorktreeStateInput, BulkCreateWorktreesInput, ListTopicsInput, SwitchTopicContextInput } from './workflowClient.js';
|
|
41
|
+
import { CustomToolInput as CustomToolInput$1 } from './clientHelpers.js';
|
|
41
42
|
import './authContext.js';
|
|
42
43
|
import './contracts/auth-session.contract.js';
|
|
43
44
|
import './contracts/workflow-runtime.contract.js';
|
|
@@ -50,7 +51,7 @@ import 'zod';
|
|
|
50
51
|
import '@lucern/contracts/tool-contracts';
|
|
51
52
|
|
|
52
53
|
type ClientConfig = BeliefsClientConfig | SourcesClientConfig | GraphClientConfig | DecisionsClientConfig | AnswersClientConfig | ContextClientConfig | WorkflowClientConfig | AuditClientConfig | AdminClientConfig | EvidenceClientConfig | EmbeddingsClientConfig | EventingClientConfig | GraphAnalysisClientConfig | GraphRecommendationsClientConfig | GraphStateClassifierClientConfig | IdentityClientConfig | JobsClientConfig | ModelRuntimeClientConfig | OntologyLinksClientConfig | OrgGraphSearchClientConfig | PolicyClientConfig | PacksClientConfig | ReportsClientConfig | LearningClientConfig | TelemetryClientConfig | ToolRegistryClientConfig | FunctionSurfaceClientConfig | OntologyClientConfig | HarnessClientConfig | SchemaClientConfig | AudiencesClientConfig | TopicsClientConfig;
|
|
53
|
-
type CustomToolInput =
|
|
54
|
+
type CustomToolInput = CustomToolInput$1;
|
|
54
55
|
type CustomToolInvoker = (input?: CustomToolInput) => Promise<unknown>;
|
|
55
56
|
type CustomToolNamespace = Record<string, CustomToolInvoker>;
|
|
56
57
|
type GatewayDataEnvelope<T extends Record<string, unknown>> = PlatformGatewaySuccess<T> & T;
|
|
@@ -2169,7 +2170,9 @@ declare function createLucernClient(config?: LucernClientConfig): {
|
|
|
2169
2170
|
name?: string;
|
|
2170
2171
|
status?: "active" | "archived";
|
|
2171
2172
|
defaultProjectVisibility?: "private" | "team" | "firm" | "external" | "public";
|
|
2172
|
-
restore
|
|
2173
|
+
restore
|
|
2174
|
+
/** Target environment. Defaults to production if not specified. */
|
|
2175
|
+
? /** Target environment. Defaults to production if not specified. */: boolean;
|
|
2173
2176
|
metadata?: JsonObject;
|
|
2174
2177
|
}, idempotencyKey?: string): Promise<PlatformGatewaySuccess<unknown>>;
|
|
2175
2178
|
listMemberships(query?: GatewayScope & {
|
package/dist/client.js
CHANGED
|
@@ -6256,6 +6256,21 @@ function createSchemaClient(config = {}) {
|
|
|
6256
6256
|
}
|
|
6257
6257
|
|
|
6258
6258
|
// src/clientHelpers.ts
|
|
6259
|
+
function normalizeCustomNamespace(namespace) {
|
|
6260
|
+
return namespace.trim() || "custom";
|
|
6261
|
+
}
|
|
6262
|
+
function normalizeCustomToolPayload(input) {
|
|
6263
|
+
return input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
6264
|
+
}
|
|
6265
|
+
function resolveCustomToolFullName(name) {
|
|
6266
|
+
return name.includes(".") ? name : `custom.${name}`;
|
|
6267
|
+
}
|
|
6268
|
+
function buildBeliefsRefinePayload(textOrInput, rationale) {
|
|
6269
|
+
return typeof textOrInput === "string" ? { text: textOrInput, rationale } : { text: textOrInput.text, rationale: textOrInput.rationale };
|
|
6270
|
+
}
|
|
6271
|
+
function buildBeliefsArchivePayload(input) {
|
|
6272
|
+
return typeof input === "string" ? { reason: input } : input ? { reason: input.reason ?? input.rationale } : void 0;
|
|
6273
|
+
}
|
|
6259
6274
|
function asNodeArray(data) {
|
|
6260
6275
|
const rows = asListItems(data, "nodes");
|
|
6261
6276
|
if (rows.length > 0) {
|
|
@@ -6633,7 +6648,7 @@ function createToolRegistryClient(config = {}) {
|
|
|
6633
6648
|
}
|
|
6634
6649
|
|
|
6635
6650
|
// src/version.ts
|
|
6636
|
-
var LUCERN_SDK_VERSION = "0.3.0-alpha.
|
|
6651
|
+
var LUCERN_SDK_VERSION = "0.3.0-alpha.9";
|
|
6637
6652
|
|
|
6638
6653
|
// src/workflowClient.ts
|
|
6639
6654
|
function normalizeLensQuery(value) {
|
|
@@ -7154,11 +7169,11 @@ function createLucernClient(config = {}) {
|
|
|
7154
7169
|
}
|
|
7155
7170
|
}
|
|
7156
7171
|
const invokeCustomTool = async (fullName, input = {}) => {
|
|
7157
|
-
const payload =
|
|
7172
|
+
const payload = normalizeCustomToolPayload(input);
|
|
7158
7173
|
return invokeRegisteredCustomTool(fullName, payload, { source: "sdk" });
|
|
7159
7174
|
};
|
|
7160
7175
|
const getCustomNamespace = (namespace) => {
|
|
7161
|
-
const normalized = namespace
|
|
7176
|
+
const normalized = normalizeCustomNamespace(namespace);
|
|
7162
7177
|
const cached = customNamespaceCache.get(normalized);
|
|
7163
7178
|
if (cached) {
|
|
7164
7179
|
return cached;
|
|
@@ -7618,10 +7633,7 @@ function createLucernClient(config = {}) {
|
|
|
7618
7633
|
return beliefsFacade.get(nodeId).then(exposeGatewayData);
|
|
7619
7634
|
},
|
|
7620
7635
|
refine(nodeId, textOrInput, rationale) {
|
|
7621
|
-
const payload =
|
|
7622
|
-
text: textOrInput.text,
|
|
7623
|
-
rationale: textOrInput.rationale
|
|
7624
|
-
};
|
|
7636
|
+
const payload = buildBeliefsRefinePayload(textOrInput, rationale);
|
|
7625
7637
|
return beliefsFacade.refine(nodeId, payload).then(exposeGatewayData);
|
|
7626
7638
|
},
|
|
7627
7639
|
updateConfidence(nodeId, input) {
|
|
@@ -7659,7 +7671,7 @@ function createLucernClient(config = {}) {
|
|
|
7659
7671
|
}).then(exposeGatewayData);
|
|
7660
7672
|
},
|
|
7661
7673
|
archive(nodeId, input) {
|
|
7662
|
-
const payload =
|
|
7674
|
+
const payload = buildBeliefsArchivePayload(input);
|
|
7663
7675
|
return beliefsFacade.archive(nodeId, payload).then(exposeGatewayData);
|
|
7664
7676
|
},
|
|
7665
7677
|
list(args) {
|
|
@@ -8699,7 +8711,7 @@ function createLucernClient(config = {}) {
|
|
|
8699
8711
|
list: listRegisteredCustomTools,
|
|
8700
8712
|
clear: clearRegisteredCustomTools,
|
|
8701
8713
|
invoke(name, input = {}) {
|
|
8702
|
-
const fullName = name
|
|
8714
|
+
const fullName = resolveCustomToolFullName(name);
|
|
8703
8715
|
return invokeCustomTool(fullName, input);
|
|
8704
8716
|
},
|
|
8705
8717
|
namespace: getCustomNamespace
|