@lucern/sdk 0.2.0-alpha.6 → 0.2.0-alpha.8
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 +13 -0
- package/dist/{lib/platform/sdk/adminClient.d.ts → adminClient.d.ts} +56 -51
- package/dist/adminClient.js +755 -0
- package/dist/adminClient.js.map +1 -0
- package/dist/answersClient.d.ts +23 -0
- package/dist/answersClient.js +333 -0
- package/dist/answersClient.js.map +1 -0
- package/dist/{lib/platform/sdk/audiencesClient.d.ts → audiencesClient.d.ts} +24 -18
- package/dist/audiencesClient.js +472 -0
- package/dist/audiencesClient.js.map +1 -0
- package/dist/auditClient.d.ts +29 -0
- package/dist/auditClient.js +386 -0
- package/dist/auditClient.js.map +1 -0
- package/dist/{lib/platform/sdk/beliefsClient.d.ts → beliefsClient.d.ts} +32 -27
- package/dist/beliefsClient.js +477 -0
- package/dist/beliefsClient.js.map +1 -0
- package/dist/{lib/platform/sdk/client.d.ts → client.d.ts} +404 -395
- package/dist/client.js +6134 -0
- package/dist/client.js.map +1 -0
- package/dist/{lib/platform/sdk/contextClient.d.ts → contextClient.d.ts} +13 -7
- package/dist/contextClient.js +396 -0
- package/dist/contextClient.js.map +1 -0
- package/dist/contextFacade.d.ts +2 -0
- package/dist/contextFacade.js +73 -0
- package/dist/contextFacade.js.map +1 -0
- package/dist/{lib/platform/sdk/contextPackCompiler.d.ts → contextPackCompiler.d.ts} +11 -9
- package/dist/contextPackCompiler.js +1091 -0
- package/dist/contextPackCompiler.js.map +1 -0
- package/dist/contextPackPolicy.d.ts +84 -0
- package/dist/contextPackPolicy.js +347 -0
- package/dist/contextPackPolicy.js.map +1 -0
- package/dist/contextPackSchema.d.ts +7 -0
- package/dist/contextPackSchema.js +203 -0
- package/dist/contextPackSchema.js.map +1 -0
- package/dist/{lib/platform/sdk/contextTypes.d.ts → contextTypes.d.ts} +15 -13
- package/dist/contextTypes.js +3 -0
- package/dist/contextTypes.js.map +1 -0
- package/dist/contracts/api-enums.contract.d.ts +81 -0
- package/dist/contracts/api-enums.contract.js +92 -0
- package/dist/contracts/api-enums.contract.js.map +1 -0
- package/dist/contracts/auth-session.contract.d.ts +55 -0
- package/dist/contracts/auth-session.contract.js +48 -0
- package/dist/contracts/auth-session.contract.js.map +1 -0
- package/dist/{lucern/contracts/src → contracts}/context-pack.contract.d.ts +56 -58
- package/dist/contracts/context-pack.contract.js +98 -0
- package/dist/contracts/context-pack.contract.js.map +1 -0
- package/dist/contracts/contextPack.d.ts +1 -0
- package/dist/contracts/contextPack.js +98 -0
- package/dist/contracts/contextPack.js.map +1 -0
- package/dist/contracts/index.d.ts +9 -0
- package/dist/contracts/index.js +4892 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/{lucern/contracts/src → contracts}/lens-filter.contract.d.ts +10 -8
- package/dist/contracts/lens-filter.contract.js +71 -0
- package/dist/contracts/lens-filter.contract.js.map +1 -0
- package/dist/contracts/lens-workflow.contract.d.ts +87 -0
- package/dist/contracts/lens-workflow.contract.js +123 -0
- package/dist/contracts/lens-workflow.contract.js.map +1 -0
- package/dist/contracts/lensFilter.d.ts +1 -0
- package/dist/contracts/lensFilter.js +71 -0
- package/dist/contracts/lensFilter.js.map +1 -0
- package/dist/contracts/lensWorkflow.d.ts +2 -0
- package/dist/contracts/lensWorkflow.js +123 -0
- package/dist/contracts/lensWorkflow.js.map +1 -0
- package/dist/contracts/mcp-tools.contract.d.ts +1 -0
- package/dist/contracts/mcp-tools.contract.js +2986 -0
- package/dist/contracts/mcp-tools.contract.js.map +1 -0
- package/dist/contracts/mcpTools.d.ts +1 -0
- package/dist/contracts/mcpTools.js +2986 -0
- package/dist/contracts/mcpTools.js.map +1 -0
- package/dist/{lucern/contracts/src → contracts}/prompt.contract.d.ts +5 -3
- package/dist/contracts/prompt.contract.js +12 -0
- package/dist/contracts/prompt.contract.js.map +1 -0
- package/dist/contracts/prompt.d.ts +1 -0
- package/dist/contracts/prompt.js +12 -0
- package/dist/contracts/prompt.js.map +1 -0
- package/dist/contracts/sdk-tools.contract.d.ts +2 -0
- package/dist/contracts/sdk-tools.contract.js +4134 -0
- package/dist/contracts/sdk-tools.contract.js.map +1 -0
- package/dist/contracts/sdkTools.d.ts +2 -0
- package/dist/contracts/sdkTools.js +4134 -0
- package/dist/contracts/sdkTools.js.map +1 -0
- package/dist/contracts/workflow-runtime.contract.d.ts +163 -0
- package/dist/contracts/workflow-runtime.contract.js +245 -0
- package/dist/contracts/workflow-runtime.contract.js.map +1 -0
- package/dist/contracts/workflowRuntime.d.ts +1 -0
- package/dist/contracts/workflowRuntime.js +245 -0
- package/dist/contracts/workflowRuntime.js.map +1 -0
- package/dist/{lib/platform/sdk/controlObjectOwnership.d.ts → controlObjectOwnership.d.ts} +20 -18
- package/dist/controlObjectOwnership.js +215 -0
- package/dist/controlObjectOwnership.js.map +1 -0
- package/dist/{lib/platform/sdk/coreClient.d.ts → coreClient.d.ts} +19 -14
- package/dist/coreClient.js +339 -0
- package/dist/coreClient.js.map +1 -0
- package/dist/{lib/platform/sdk/customTools.d.ts → customTools.d.ts} +21 -16
- package/dist/customTools.js +248 -0
- package/dist/customTools.js.map +1 -0
- package/dist/{lib/platform/sdk/decisionsClient.d.ts → decisionsClient.d.ts} +29 -24
- package/dist/decisionsClient.js +522 -0
- package/dist/decisionsClient.js.map +1 -0
- package/dist/domainContext.d.ts +1 -0
- package/dist/domainContext.js +3 -0
- package/dist/domainContext.js.map +1 -0
- package/dist/events.d.ts +178 -0
- package/dist/events.js +249 -0
- package/dist/events.js.map +1 -0
- package/dist/eventsCore.d.ts +49 -0
- package/dist/eventsCore.js +429 -0
- package/dist/eventsCore.js.map +1 -0
- package/dist/facade/context.d.ts +18 -0
- package/dist/facade/context.js +73 -0
- package/dist/facade/context.js.map +1 -0
- package/dist/{lib/platform/sdk/gatewayFacades.d.ts → gatewayFacades.d.ts} +31 -26
- package/dist/gatewayFacades.js +1953 -0
- package/dist/gatewayFacades.js.map +1 -0
- package/dist/{lib/platform/sdk/graphClient.d.ts → graphClient.d.ts} +57 -52
- package/dist/graphClient.js +698 -0
- package/dist/graphClient.js.map +1 -0
- package/dist/{lib/platform/sdk/harnessClient.d.ts → harnessClient.d.ts} +44 -39
- package/dist/harnessClient.js +607 -0
- package/dist/harnessClient.js.map +1 -0
- package/dist/{lib/platform/sdk/identityClient.d.ts → identityClient.d.ts} +17 -11
- package/dist/identityClient.js +497 -0
- package/dist/identityClient.js.map +1 -0
- package/dist/index.d.ts +42 -3
- package/dist/index.js +11381 -3
- package/dist/index.js.map +1 -0
- package/dist/{lib/platform/sdk/learningClient.d.ts → learningClient.d.ts} +13 -7
- package/dist/learningClient.js +409 -0
- package/dist/learningClient.js.map +1 -0
- package/dist/{lib/platform/sdk/mcpParityClient.d.ts → mcpParityClient.d.ts} +10 -5
- package/dist/mcpParityClient.js +516 -0
- package/dist/mcpParityClient.js.map +1 -0
- package/dist/mcpParitySurface.d.ts +12 -0
- package/dist/mcpParitySurface.js +65 -0
- package/dist/mcpParitySurface.js.map +1 -0
- package/dist/mcpTools-DPZxowDX.d.ts +254 -0
- package/dist/{lib/platform/sdk/ontologyClient.d.ts → ontologyClient.d.ts} +28 -22
- package/dist/ontologyClient.js +513 -0
- package/dist/ontologyClient.js.map +1 -0
- package/dist/packRuntime.d.ts +2 -0
- package/dist/packRuntime.js +3 -0
- package/dist/packRuntime.js.map +1 -0
- package/dist/{lib/platform/sdk/packsClient.d.ts → packsClient.d.ts} +34 -29
- package/dist/packsClient.js +525 -0
- package/dist/packsClient.js.map +1 -0
- package/dist/{lib/platform/sdk/policyClient.d.ts → policyClient.d.ts} +26 -20
- package/dist/policyClient.js +625 -0
- package/dist/policyClient.js.map +1 -0
- package/dist/realtime/index.d.ts +29 -0
- package/dist/realtime/index.js +23 -0
- package/dist/realtime/index.js.map +1 -0
- package/dist/realtime/refs.d.ts +17 -0
- package/dist/realtime/refs.js +9 -0
- package/dist/realtime/refs.js.map +1 -0
- package/dist/reportsClient.d.ts +41 -0
- package/dist/reportsClient.js +418 -0
- package/dist/reportsClient.js.map +1 -0
- package/dist/{lib/platform/sdk/schemaClient.d.ts → schemaClient.d.ts} +20 -15
- package/dist/schemaClient.js +434 -0
- package/dist/schemaClient.js.map +1 -0
- package/dist/sdkSurface.d.ts +61 -0
- package/dist/sdkSurface.js +112 -0
- package/dist/sdkSurface.js.map +1 -0
- package/dist/sdkTools-CwXJDACb.d.ts +150 -0
- package/dist/{lib/platform/sdk/topicsClient.d.ts → topicsClient.d.ts} +24 -18
- package/dist/topicsClient.js +492 -0
- package/dist/topicsClient.js.map +1 -0
- package/dist/{lib/platform/sdk/types.d.ts → types.d.ts} +84 -80
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/dist/{lib/platform/sdk/workflowClient.d.ts → workflowClient.d.ts} +60 -57
- package/dist/workflowClient.js +830 -0
- package/dist/workflowClient.js.map +1 -0
- package/package.json +25 -43
- package/dist/.generated +0 -2
- package/dist/lib/platform/auth/credentials.d.ts +0 -5
- package/dist/lib/platform/auth/credentials.js +0 -40
- package/dist/lib/platform/sdk/adminClient.js +0 -384
- package/dist/lib/platform/sdk/answersClient.d.ts +0 -16
- package/dist/lib/platform/sdk/answersClient.js +0 -21
- package/dist/lib/platform/sdk/audiencesClient.js +0 -111
- package/dist/lib/platform/sdk/auditClient.d.ts +0 -24
- package/dist/lib/platform/sdk/auditClient.js +0 -21
- package/dist/lib/platform/sdk/beliefsClient.js +0 -124
- package/dist/lib/platform/sdk/client.js +0 -1831
- package/dist/lib/platform/sdk/contextClient.js +0 -86
- package/dist/lib/platform/sdk/contextFacade.d.ts +0 -10
- package/dist/lib/platform/sdk/contextFacade.js +0 -10
- package/dist/lib/platform/sdk/contextPackCompiler.js +0 -534
- package/dist/lib/platform/sdk/contextTypes.js +0 -1
- package/dist/lib/platform/sdk/controlObjectOwnership.js +0 -220
- package/dist/lib/platform/sdk/coreClient.js +0 -366
- package/dist/lib/platform/sdk/customTools.js +0 -247
- package/dist/lib/platform/sdk/decisionsClient.js +0 -129
- package/dist/lib/platform/sdk/domainContext.d.ts +0 -1
- package/dist/lib/platform/sdk/domainContext.js +0 -1
- package/dist/lib/platform/sdk/events.d.ts +0 -176
- package/dist/lib/platform/sdk/events.js +0 -261
- package/dist/lib/platform/sdk/eventsCore.d.ts +0 -13
- package/dist/lib/platform/sdk/eventsCore.js +0 -13
- package/dist/lib/platform/sdk/gatewayFacades.js +0 -845
- package/dist/lib/platform/sdk/graphClient.js +0 -235
- package/dist/lib/platform/sdk/harnessClient.js +0 -219
- package/dist/lib/platform/sdk/identityClient.js +0 -131
- package/dist/lib/platform/sdk/index.d.ts +0 -49
- package/dist/lib/platform/sdk/index.js +0 -49
- package/dist/lib/platform/sdk/learningClient.js +0 -53
- package/dist/lib/platform/sdk/mcpParityClient.js +0 -196
- package/dist/lib/platform/sdk/mcpParitySurface.d.ts +0 -10
- package/dist/lib/platform/sdk/mcpParitySurface.js +0 -57
- package/dist/lib/platform/sdk/ontologyClient.js +0 -161
- package/dist/lib/platform/sdk/packRuntime.d.ts +0 -1
- package/dist/lib/platform/sdk/packRuntime.js +0 -1
- package/dist/lib/platform/sdk/packsClient.js +0 -157
- package/dist/lib/platform/sdk/policyClient.js +0 -277
- package/dist/lib/platform/sdk/promptCatalog.d.ts +0 -1
- package/dist/lib/platform/sdk/promptCatalog.js +0 -1
- package/dist/lib/platform/sdk/reportsClient.d.ts +0 -34
- package/dist/lib/platform/sdk/reportsClient.js +0 -64
- package/dist/lib/platform/sdk/schemaClient.js +0 -71
- package/dist/lib/platform/sdk/sdkSurface.d.ts +0 -56
- package/dist/lib/platform/sdk/sdkSurface.js +0 -140
- package/dist/lib/platform/sdk/topicsClient.js +0 -118
- package/dist/lib/platform/sdk/types.js +0 -1
- package/dist/lib/platform/sdk/version.d.ts +0 -2
- package/dist/lib/platform/sdk/version.js +0 -2
- package/dist/lib/platform/sdk/workflowClient.js +0 -366
- package/dist/lucern/contracts/src/api-enums.contract.d.ts +0 -58
- package/dist/lucern/contracts/src/api-enums.contract.js +0 -147
- package/dist/lucern/contracts/src/auth-context.contract.d.ts +0 -8
- package/dist/lucern/contracts/src/auth-context.contract.js +0 -8
- package/dist/lucern/contracts/src/auth-session.contract.d.ts +0 -8
- package/dist/lucern/contracts/src/auth-session.contract.js +0 -8
- package/dist/lucern/contracts/src/auth.contract.d.ts +0 -88
- package/dist/lucern/contracts/src/auth.contract.js +0 -57
- package/dist/lucern/contracts/src/context-pack.contract.js +0 -169
- package/dist/lucern/contracts/src/convex-admin.contract.d.ts +0 -5
- package/dist/lucern/contracts/src/convex-admin.contract.js +0 -1
- package/dist/lucern/contracts/src/events-types.contract.d.ts +0 -8
- package/dist/lucern/contracts/src/events-types.contract.js +0 -8
- package/dist/lucern/contracts/src/events.contract.d.ts +0 -176
- package/dist/lucern/contracts/src/events.contract.js +0 -159
- package/dist/lucern/contracts/src/gateway.contract.d.ts +0 -74
- package/dist/lucern/contracts/src/gateway.contract.js +0 -19
- package/dist/lucern/contracts/src/ids.contract.d.ts +0 -7
- package/dist/lucern/contracts/src/ids.contract.js +0 -24
- package/dist/lucern/contracts/src/index.d.ts +0 -29
- package/dist/lucern/contracts/src/index.js +0 -29
- package/dist/lucern/contracts/src/lens-filter.contract.js +0 -95
- package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +0 -84
- package/dist/lucern/contracts/src/lens-workflow.contract.js +0 -54
- package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +0 -151
- package/dist/lucern/contracts/src/mcp-tools.contract.js +0 -3281
- package/dist/lucern/contracts/src/ontology-matching.contract.d.ts +0 -8
- package/dist/lucern/contracts/src/ontology-matching.contract.js +0 -8
- package/dist/lucern/contracts/src/prompt.contract.js +0 -24
- package/dist/lucern/contracts/src/sdk-methods.contract.d.ts +0 -358
- package/dist/lucern/contracts/src/sdk-methods.contract.js +0 -19
- package/dist/lucern/contracts/src/sdk-tools.contract.d.ts +0 -92
- package/dist/lucern/contracts/src/sdk-tools.contract.js +0 -1398
- package/dist/lucern/contracts/src/text-matching.contract.d.ts +0 -53
- package/dist/lucern/contracts/src/text-matching.contract.js +0 -277
- package/dist/lucern/contracts/src/topic-scope.contract.d.ts +0 -8
- package/dist/lucern/contracts/src/topic-scope.contract.js +0 -8
- package/dist/lucern/contracts/src/workflow-runtime.contract.d.ts +0 -161
- package/dist/lucern/contracts/src/workflow-runtime.contract.js +0 -257
- package/dist/realtime-refs.d.ts +0 -1
- package/dist/realtime-refs.js +0 -1
- package/dist/realtime.d.ts +0 -1
- package/dist/realtime.js +0 -1
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/** Default namespace assigned to custom tools when none is specified. */
|
|
3
|
-
const DEFAULT_CUSTOM_NAMESPACE = "custom";
|
|
4
|
-
/** Namespace strings reserved for platform-internal tools. */
|
|
5
|
-
const RESERVED_NAMESPACES = new Set(["lucern"]);
|
|
6
|
-
/** Error thrown when custom tool registration or invocation fails validation. */
|
|
7
|
-
export class CustomToolRegistryError extends Error {
|
|
8
|
-
constructor(message) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = "CustomToolRegistryError";
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
const customToolRegistry = new Map();
|
|
14
|
-
function normalizeSegment(value, field) {
|
|
15
|
-
const normalized = value.trim();
|
|
16
|
-
if (!normalized) {
|
|
17
|
-
throw new CustomToolRegistryError(`Custom tool ${field} is required.`);
|
|
18
|
-
}
|
|
19
|
-
if (!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(normalized)) {
|
|
20
|
-
throw new CustomToolRegistryError(`Invalid custom tool ${field}: "${value}". Use letters, numbers, "_" or "-".`);
|
|
21
|
-
}
|
|
22
|
-
return normalized;
|
|
23
|
-
}
|
|
24
|
-
function normalizeNamespace(namespace) {
|
|
25
|
-
const resolved = normalizeSegment(namespace ?? DEFAULT_CUSTOM_NAMESPACE, "namespace");
|
|
26
|
-
if (RESERVED_NAMESPACES.has(resolved.toLowerCase())) {
|
|
27
|
-
throw new CustomToolRegistryError(`Namespace "${resolved}" is reserved for platform tools.`);
|
|
28
|
-
}
|
|
29
|
-
return resolved;
|
|
30
|
-
}
|
|
31
|
-
function normalizeName(name) {
|
|
32
|
-
if (name.includes(".")) {
|
|
33
|
-
throw new CustomToolRegistryError(`Custom tool name "${name}" must not include "."; use namespace + name.`);
|
|
34
|
-
}
|
|
35
|
-
return normalizeSegment(name, "name");
|
|
36
|
-
}
|
|
37
|
-
function buildFullName(namespace, shortName) {
|
|
38
|
-
return `${namespace}.${shortName}`;
|
|
39
|
-
}
|
|
40
|
-
function unwrapSchema(schema) {
|
|
41
|
-
if (schema instanceof z.ZodOptional) {
|
|
42
|
-
return { schema: schema.unwrap(), required: false };
|
|
43
|
-
}
|
|
44
|
-
if (schema instanceof z.ZodDefault) {
|
|
45
|
-
const removeDefault = schema.removeDefault;
|
|
46
|
-
if (typeof removeDefault === "function") {
|
|
47
|
-
return { schema: removeDefault.call(schema), required: false };
|
|
48
|
-
}
|
|
49
|
-
const inner = schema
|
|
50
|
-
._def?.innerType;
|
|
51
|
-
return { schema: inner ?? schema, required: false };
|
|
52
|
-
}
|
|
53
|
-
return { schema, required: true };
|
|
54
|
-
}
|
|
55
|
-
function resolveParameterType(schema) {
|
|
56
|
-
if (schema instanceof z.ZodString) {
|
|
57
|
-
return { type: "string" };
|
|
58
|
-
}
|
|
59
|
-
if (schema instanceof z.ZodEnum) {
|
|
60
|
-
return { type: "string", enum: schema.options };
|
|
61
|
-
}
|
|
62
|
-
if (schema instanceof z.ZodNativeEnum) {
|
|
63
|
-
const values = Object.values(schema.enum).filter((value) => typeof value === "string");
|
|
64
|
-
return values.length > 0
|
|
65
|
-
? { type: "string", enum: values }
|
|
66
|
-
: { type: "string" };
|
|
67
|
-
}
|
|
68
|
-
if (schema instanceof z.ZodLiteral) {
|
|
69
|
-
const literalValue = schema.value;
|
|
70
|
-
if (typeof literalValue === "string") {
|
|
71
|
-
return { type: "string", enum: [literalValue] };
|
|
72
|
-
}
|
|
73
|
-
if (typeof literalValue === "number") {
|
|
74
|
-
return { type: "number" };
|
|
75
|
-
}
|
|
76
|
-
if (typeof literalValue === "boolean") {
|
|
77
|
-
return { type: "boolean" };
|
|
78
|
-
}
|
|
79
|
-
return { type: "object" };
|
|
80
|
-
}
|
|
81
|
-
if (schema instanceof z.ZodNumber) {
|
|
82
|
-
return { type: "number" };
|
|
83
|
-
}
|
|
84
|
-
if (schema instanceof z.ZodBoolean) {
|
|
85
|
-
return { type: "boolean" };
|
|
86
|
-
}
|
|
87
|
-
if (schema instanceof z.ZodArray) {
|
|
88
|
-
return { type: "array" };
|
|
89
|
-
}
|
|
90
|
-
return { type: "object" };
|
|
91
|
-
}
|
|
92
|
-
function schemaTypeLabel(schema) {
|
|
93
|
-
if (schema instanceof z.ZodString || schema instanceof z.ZodEnum) {
|
|
94
|
-
return "string";
|
|
95
|
-
}
|
|
96
|
-
if (schema instanceof z.ZodNumber) {
|
|
97
|
-
return "number";
|
|
98
|
-
}
|
|
99
|
-
if (schema instanceof z.ZodBoolean) {
|
|
100
|
-
return "boolean";
|
|
101
|
-
}
|
|
102
|
-
if (schema instanceof z.ZodArray) {
|
|
103
|
-
return "array";
|
|
104
|
-
}
|
|
105
|
-
if (schema instanceof z.ZodObject) {
|
|
106
|
-
return "object";
|
|
107
|
-
}
|
|
108
|
-
return "unknown";
|
|
109
|
-
}
|
|
110
|
-
function parseObjectSchema(value, fieldName) {
|
|
111
|
-
if (!(value instanceof z.ZodObject)) {
|
|
112
|
-
throw new CustomToolRegistryError(`${fieldName} must be a Zod object schema.`);
|
|
113
|
-
}
|
|
114
|
-
return value;
|
|
115
|
-
}
|
|
116
|
-
function deriveParameters(schema) {
|
|
117
|
-
const shape = schema.shape;
|
|
118
|
-
const parameters = {};
|
|
119
|
-
const required = [];
|
|
120
|
-
for (const [key, raw] of Object.entries(shape)) {
|
|
121
|
-
const { schema: unwrapped, required: isRequired } = unwrapSchema(raw);
|
|
122
|
-
const parameterType = resolveParameterType(unwrapped);
|
|
123
|
-
parameters[key] = {
|
|
124
|
-
type: parameterType.type,
|
|
125
|
-
description: raw.description ?? `${key} parameter`,
|
|
126
|
-
...(parameterType.enum ? { enum: parameterType.enum } : {}),
|
|
127
|
-
};
|
|
128
|
-
if (isRequired) {
|
|
129
|
-
required.push(key);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return { parameters, required };
|
|
133
|
-
}
|
|
134
|
-
function deriveResponse(schema) {
|
|
135
|
-
if (schema instanceof z.ZodObject) {
|
|
136
|
-
const fields = Object.fromEntries(Object.entries(schema.shape).map(([key, value]) => {
|
|
137
|
-
const zodValue = value;
|
|
138
|
-
const label = schemaTypeLabel(unwrapSchema(zodValue).schema);
|
|
139
|
-
const description = zodValue.description ?? "custom output field";
|
|
140
|
-
return [key, `${label} — ${description}`];
|
|
141
|
-
}));
|
|
142
|
-
return {
|
|
143
|
-
description: "Custom tool result payload",
|
|
144
|
-
fields,
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
return {
|
|
148
|
-
description: "Custom tool result payload",
|
|
149
|
-
fields: {
|
|
150
|
-
result: `${schemaTypeLabel(schema)} — custom output payload`,
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function buildContract(fullName, namespace, registration, inputSchema) {
|
|
155
|
-
const { parameters, required } = deriveParameters(inputSchema);
|
|
156
|
-
return {
|
|
157
|
-
name: fullName,
|
|
158
|
-
description: registration.description,
|
|
159
|
-
parameters,
|
|
160
|
-
required,
|
|
161
|
-
response: deriveResponse(registration.outputSchema),
|
|
162
|
-
ownerModule: registration.ownerModule ?? `${namespace}-extension`,
|
|
163
|
-
ontologyPrimitive: registration.ontologyPrimitive ?? "task",
|
|
164
|
-
tier: registration.tier ?? "workhorse",
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Register a custom SDK tool in the in-memory registry.
|
|
169
|
-
* @param registration - The tool definition including name, schemas, and handler.
|
|
170
|
-
* @param options - Optional flags; set `replace` to overwrite an existing registration.
|
|
171
|
-
* @returns The fully resolved registered tool entry.
|
|
172
|
-
*/
|
|
173
|
-
export function registerCustomTool(registration, options = {}) {
|
|
174
|
-
const namespace = normalizeNamespace(registration.namespace);
|
|
175
|
-
const shortName = normalizeName(registration.name);
|
|
176
|
-
const fullName = buildFullName(namespace, shortName);
|
|
177
|
-
if (customToolRegistry.has(fullName) && !options.replace) {
|
|
178
|
-
throw new CustomToolRegistryError(`Custom tool "${fullName}" is already registered.`);
|
|
179
|
-
}
|
|
180
|
-
const inputSchema = parseObjectSchema(registration.inputSchema, "inputSchema");
|
|
181
|
-
const outputSchema = registration.outputSchema;
|
|
182
|
-
const contract = buildContract(fullName, namespace, registration, inputSchema);
|
|
183
|
-
const metadata = {
|
|
184
|
-
category: registration.metadata?.category,
|
|
185
|
-
tags: registration.metadata?.tags ?? [],
|
|
186
|
-
requiredScopes: registration.metadata?.requiredScopes ?? ["custom:execute"],
|
|
187
|
-
};
|
|
188
|
-
const registered = {
|
|
189
|
-
fullName,
|
|
190
|
-
namespace,
|
|
191
|
-
shortName,
|
|
192
|
-
metadata,
|
|
193
|
-
contract,
|
|
194
|
-
inputSchema,
|
|
195
|
-
outputSchema,
|
|
196
|
-
invoke: async (input, context) => {
|
|
197
|
-
const parsedInput = inputSchema.parse(input);
|
|
198
|
-
const rawOutput = await registration.handler(parsedInput, context);
|
|
199
|
-
return outputSchema.parse(rawOutput);
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
customToolRegistry.set(fullName, registered);
|
|
203
|
-
return registered;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Remove a custom SDK tool from the registry.
|
|
207
|
-
* @param fullName - Fully qualified tool name (`namespace.name`).
|
|
208
|
-
* @returns `true` if the tool was found and removed, `false` otherwise.
|
|
209
|
-
*/
|
|
210
|
-
export function unregisterCustomTool(fullName) {
|
|
211
|
-
return customToolRegistry.delete(fullName.trim());
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Get a custom SDK tool by fully qualified name.
|
|
215
|
-
* @param fullName - Fully qualified tool name (`namespace.name`).
|
|
216
|
-
* @returns The registered tool entry, or `undefined` if not found.
|
|
217
|
-
*/
|
|
218
|
-
export function getRegisteredCustomTool(fullName) {
|
|
219
|
-
return customToolRegistry.get(fullName.trim());
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* List all registered custom SDK tools, sorted alphabetically by full name.
|
|
223
|
-
* @returns An array of all registered tool entries.
|
|
224
|
-
*/
|
|
225
|
-
export function listRegisteredCustomTools() {
|
|
226
|
-
return [...customToolRegistry.values()].sort((left, right) => left.fullName.localeCompare(right.fullName));
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Clear the registered custom tool registry.
|
|
230
|
-
*/
|
|
231
|
-
export function clearRegisteredCustomTools() {
|
|
232
|
-
customToolRegistry.clear();
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Invoke a registered custom SDK tool by fully qualified name.
|
|
236
|
-
* @param fullName - Fully qualified tool name (`namespace.name`).
|
|
237
|
-
* @param params - JSON-serializable input parameters for the tool handler.
|
|
238
|
-
* @param context - Invocation context indicating the call source.
|
|
239
|
-
* @returns The validated output from the tool handler.
|
|
240
|
-
*/
|
|
241
|
-
export async function invokeRegisteredCustomTool(fullName, params, context) {
|
|
242
|
-
const registered = getRegisteredCustomTool(fullName);
|
|
243
|
-
if (!registered) {
|
|
244
|
-
throw new CustomToolRegistryError(`Custom tool "${fullName}" is not registered.`);
|
|
245
|
-
}
|
|
246
|
-
return registered.invoke(params, context);
|
|
247
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { createGatewayRequestClient, LucernApiError, randomIdempotencyKey, toQueryString, } from "./coreClient.js";
|
|
2
|
-
import { createListResult, mapGatewayData, normalizeTopicQuery, withTopicAlias, } from "./sdkSurface.js";
|
|
3
|
-
export { LucernApiError };
|
|
4
|
-
/**
|
|
5
|
-
* Create the judgments client for decision lifecycle operations.
|
|
6
|
-
* @param config - Gateway transport configuration.
|
|
7
|
-
* @returns An object with methods to manage judgments, outcomes, readiness, and calibration.
|
|
8
|
-
*/
|
|
9
|
-
export function createDecisionsClient(config = {}) {
|
|
10
|
-
const gateway = createGatewayRequestClient(config);
|
|
11
|
-
return {
|
|
12
|
-
/**
|
|
13
|
-
* List judgments for a topic scope.
|
|
14
|
-
*/
|
|
15
|
-
async listJudgments(query) {
|
|
16
|
-
return gateway.request({
|
|
17
|
-
path: `/api/platform/v1/graph/judgments${toQueryString({
|
|
18
|
-
...normalizeTopicQuery(query),
|
|
19
|
-
includeArchived: typeof query.includeArchived === "boolean"
|
|
20
|
-
? query.includeArchived
|
|
21
|
-
? "true"
|
|
22
|
-
: "false"
|
|
23
|
-
: undefined,
|
|
24
|
-
limit: query.limit,
|
|
25
|
-
})}`,
|
|
26
|
-
}).then((response) => mapGatewayData(response, (data) => {
|
|
27
|
-
const rows = Array.isArray(data) ? data : [];
|
|
28
|
-
const judgments = rows.map((row) => withTopicAlias(row));
|
|
29
|
-
return {
|
|
30
|
-
...createListResult(judgments, "judgments"),
|
|
31
|
-
};
|
|
32
|
-
}));
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* Get a single judgment by identifier.
|
|
36
|
-
*/
|
|
37
|
-
async getJudgment(judgmentId) {
|
|
38
|
-
return gateway.request({
|
|
39
|
-
path: `/api/platform/v1/graph/judgments/${encodeURIComponent(judgmentId)}`,
|
|
40
|
-
}).then((response) => mapGatewayData(response, (data) => data && typeof data === "object"
|
|
41
|
-
? withTopicAlias(data)
|
|
42
|
-
: data));
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* Get readiness signals for creating a judgment.
|
|
46
|
-
*/
|
|
47
|
-
async getJudgmentReadiness(query) {
|
|
48
|
-
return gateway.request({
|
|
49
|
-
path: `/api/platform/v1/graph/judgments/readiness${toQueryString(normalizeTopicQuery(query))}`,
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
/**
|
|
53
|
-
* Get calibration analytics for judgment outcomes.
|
|
54
|
-
*/
|
|
55
|
-
async getJudgmentCalibration(query) {
|
|
56
|
-
return gateway.request({
|
|
57
|
-
path: `/api/platform/v1/graph/judgments/calibration${toQueryString(normalizeTopicQuery(query))}`,
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
/**
|
|
61
|
-
* List judgments still awaiting outcome review.
|
|
62
|
-
*/
|
|
63
|
-
async listPendingOutcomeReviews(query) {
|
|
64
|
-
return gateway.request({
|
|
65
|
-
path: `/api/platform/v1/graph/judgments/pending-outcome-review${toQueryString(normalizeTopicQuery(query))}`,
|
|
66
|
-
}).then((response) => mapGatewayData(response, (data) => {
|
|
67
|
-
const rows = Array.isArray(data) ? data : [];
|
|
68
|
-
const reviews = rows.map((row) => withTopicAlias(row));
|
|
69
|
-
return createListResult(reviews, "reviews");
|
|
70
|
-
}));
|
|
71
|
-
},
|
|
72
|
-
/**
|
|
73
|
-
* @deprecated Use listPendingOutcomeReviews.
|
|
74
|
-
*/
|
|
75
|
-
async listPendingJudgmentOutcomeReview(query) {
|
|
76
|
-
return this.listPendingOutcomeReviews(query);
|
|
77
|
-
},
|
|
78
|
-
/**
|
|
79
|
-
* Get audit integrity checks for judgment transitions.
|
|
80
|
-
*/
|
|
81
|
-
async getJudgmentTransitionAuditIntegrity(query) {
|
|
82
|
-
return gateway.request({
|
|
83
|
-
path: `/api/platform/v1/graph/judgments/transition-audit-integrity${toQueryString({
|
|
84
|
-
...normalizeTopicQuery(query),
|
|
85
|
-
judgmentId: query.judgmentId,
|
|
86
|
-
includePassing: typeof query.includePassing === "boolean"
|
|
87
|
-
? query.includePassing
|
|
88
|
-
? "true"
|
|
89
|
-
: "false"
|
|
90
|
-
: undefined,
|
|
91
|
-
})}`,
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* Create a judgment.
|
|
96
|
-
*/
|
|
97
|
-
async createJudgment(input, idempotencyKey) {
|
|
98
|
-
return gateway.request({
|
|
99
|
-
path: "/api/platform/v1/graph/judgments",
|
|
100
|
-
method: "POST",
|
|
101
|
-
body: normalizeTopicQuery(input),
|
|
102
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
103
|
-
}).then((response) => mapGatewayData(response, (data) => withTopicAlias(data)));
|
|
104
|
-
},
|
|
105
|
-
/**
|
|
106
|
-
* @deprecated Use createJudgment.
|
|
107
|
-
*/
|
|
108
|
-
async recordJudgment(input, idempotencyKey) {
|
|
109
|
-
return this.createJudgment(input, idempotencyKey);
|
|
110
|
-
},
|
|
111
|
-
/**
|
|
112
|
-
* Update the outcome for an existing judgment.
|
|
113
|
-
*/
|
|
114
|
-
async updateJudgmentOutcome(judgmentId, input, idempotencyKey) {
|
|
115
|
-
return gateway.request({
|
|
116
|
-
path: `/api/platform/v1/graph/judgments/${encodeURIComponent(judgmentId)}/outcome`,
|
|
117
|
-
method: "POST",
|
|
118
|
-
body: input,
|
|
119
|
-
idempotencyKey: idempotencyKey ?? randomIdempotencyKey(),
|
|
120
|
-
});
|
|
121
|
-
},
|
|
122
|
-
/**
|
|
123
|
-
* @deprecated Use updateJudgmentOutcome.
|
|
124
|
-
*/
|
|
125
|
-
async recordJudgmentOutcome(judgmentId, input, idempotencyKey) {
|
|
126
|
-
return this.updateJudgmentOutcome(judgmentId, input, idempotencyKey);
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CompileContextInput, ContextCompilationMode, ContextPackSectionKey, ContextRankingProfile, PackWeightOverride, PublicCompiledContext, PublicContextBelief, PublicContextContradiction, PublicContextEntity, PublicContextEvidence, PublicContextInjectionPolicy, PublicContextQuestion, RankingWeightVector, } from "./contextTypes";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
export declare const DOMAIN_EVENT_VERSION: "1.0";
|
|
2
|
-
export declare const EVENT_RETENTION_DEFAULT_DAYS = 30;
|
|
3
|
-
export declare const WEBHOOK_MAX_ATTEMPTS = 5;
|
|
4
|
-
export declare const WEBHOOK_RETRY_DELAYS_MS: readonly [1000, 5000, 30000, 300000];
|
|
5
|
-
export declare const DOMAIN_EVENT_TYPES: readonly ["belief.created", "belief.forked", "belief.confidence_updated", "belief.archived", "belief.refined", "belief.contract_created", "belief.contract_evaluated", "belief.lineage_queried", "evidence.created", "evidence.linked", "evidence.search_executed", "question.created", "question.answered", "question.refined", "question.status_updated", "question.archived", "edge.created", "contradiction.flagged", "worktree.created", "worktree.activated", "worktree.merged", "worktree.targets_updated", "worktree.metadata_updated", "topic.created", "topic.updated", "topic.archived", "task.created", "task.completed", "task.updated", "ontology.bound", "context.compiled", "identity.key_created", "identity.key_rotated", "identity.key_revoked", "webhook.test"];
|
|
6
|
-
export type DomainEventType = (typeof DOMAIN_EVENT_TYPES)[number];
|
|
7
|
-
export type DomainResourceType = "belief" | "evidence" | "question" | "edge" | "contradiction" | "worktree" | "topic" | "task" | "ontology" | "context" | "identity" | "webhook";
|
|
8
|
-
export type DomainActorType = "human" | "agent" | "service";
|
|
9
|
-
export type DomainEventData = Record<string, unknown>;
|
|
10
|
-
export type DomainEvent = {
|
|
11
|
-
eventId: string;
|
|
12
|
-
type: DomainEventType | string;
|
|
13
|
-
version: typeof DOMAIN_EVENT_VERSION;
|
|
14
|
-
timestamp: number;
|
|
15
|
-
tenantId?: string;
|
|
16
|
-
workspaceId?: string;
|
|
17
|
-
topicId: string;
|
|
18
|
-
resourceId: string;
|
|
19
|
-
resourceType: DomainResourceType | string;
|
|
20
|
-
actorId: string;
|
|
21
|
-
actorType: DomainActorType;
|
|
22
|
-
data: DomainEventData;
|
|
23
|
-
correlationId?: string;
|
|
24
|
-
expiresAt: number;
|
|
25
|
-
};
|
|
26
|
-
export type CreateDomainEventInput = {
|
|
27
|
-
eventId?: string;
|
|
28
|
-
timestamp?: number;
|
|
29
|
-
tenantId?: string;
|
|
30
|
-
workspaceId?: string;
|
|
31
|
-
topicId: string;
|
|
32
|
-
type: DomainEventType | string;
|
|
33
|
-
resourceId: string;
|
|
34
|
-
resourceType: DomainResourceType | string;
|
|
35
|
-
actorId: string;
|
|
36
|
-
actorType: DomainActorType;
|
|
37
|
-
data?: DomainEventData;
|
|
38
|
-
correlationId?: string;
|
|
39
|
-
retentionDays?: number;
|
|
40
|
-
};
|
|
41
|
-
export type EventCursor = {
|
|
42
|
-
timestamp: number;
|
|
43
|
-
eventId: string;
|
|
44
|
-
};
|
|
45
|
-
export type EventListQuery = {
|
|
46
|
-
topicId?: string;
|
|
47
|
-
after?: string;
|
|
48
|
-
types?: string[];
|
|
49
|
-
startTime?: number;
|
|
50
|
-
endTime?: number;
|
|
51
|
-
limit?: number;
|
|
52
|
-
};
|
|
53
|
-
export type EventListResult = {
|
|
54
|
-
events: DomainEvent[];
|
|
55
|
-
nextCursor: string | null;
|
|
56
|
-
};
|
|
57
|
-
export type WebhookSecretMode = "configured";
|
|
58
|
-
export type WebhookRecord = {
|
|
59
|
-
id: string;
|
|
60
|
-
webhookId: string;
|
|
61
|
-
tenantId?: string;
|
|
62
|
-
workspaceId?: string;
|
|
63
|
-
topicId?: string;
|
|
64
|
-
url: string;
|
|
65
|
-
events: string[];
|
|
66
|
-
active: boolean;
|
|
67
|
-
secretConfigured: boolean;
|
|
68
|
-
createdAt: number;
|
|
69
|
-
updatedAt: number;
|
|
70
|
-
createdBy: string;
|
|
71
|
-
updatedBy: string;
|
|
72
|
-
lastDeliveryAt?: number;
|
|
73
|
-
lastSuccessfulDeliveryAt?: number;
|
|
74
|
-
};
|
|
75
|
-
export type WebhookCreateInput = {
|
|
76
|
-
url: string;
|
|
77
|
-
events: string[];
|
|
78
|
-
secret: string;
|
|
79
|
-
topicId?: string;
|
|
80
|
-
active?: boolean;
|
|
81
|
-
};
|
|
82
|
-
export type WebhookUpdateInput = {
|
|
83
|
-
url?: string;
|
|
84
|
-
events?: string[];
|
|
85
|
-
secret?: string;
|
|
86
|
-
topicId?: string | null;
|
|
87
|
-
active?: boolean;
|
|
88
|
-
};
|
|
89
|
-
export type WebhookDeliveryStatus = "pending" | "delivering" | "succeeded" | "failed" | "dead_letter";
|
|
90
|
-
export type WebhookDeliveryRecord = {
|
|
91
|
-
id: string;
|
|
92
|
-
deliveryId: string;
|
|
93
|
-
webhookId: string;
|
|
94
|
-
eventId: string;
|
|
95
|
-
eventType: string;
|
|
96
|
-
topicId: string;
|
|
97
|
-
status: WebhookDeliveryStatus;
|
|
98
|
-
attemptCount: number;
|
|
99
|
-
maxAttempts: number;
|
|
100
|
-
nextAttemptAt?: number;
|
|
101
|
-
lastAttemptAt?: number;
|
|
102
|
-
lastStatusCode?: number;
|
|
103
|
-
lastError?: string;
|
|
104
|
-
deliveredAt?: number;
|
|
105
|
-
createdAt: number;
|
|
106
|
-
updatedAt: number;
|
|
107
|
-
};
|
|
108
|
-
export type WebhookDeliveryAttemptRecord = {
|
|
109
|
-
id: string;
|
|
110
|
-
attemptId: string;
|
|
111
|
-
deliveryId: string;
|
|
112
|
-
webhookId: string;
|
|
113
|
-
eventId: string;
|
|
114
|
-
eventType: string;
|
|
115
|
-
attemptNumber: number;
|
|
116
|
-
status: "succeeded" | "failed";
|
|
117
|
-
statusCode?: number;
|
|
118
|
-
error?: string;
|
|
119
|
-
responseBody?: string;
|
|
120
|
-
durationMs?: number;
|
|
121
|
-
createdAt: number;
|
|
122
|
-
};
|
|
123
|
-
export type WebhookDeliveriesResult = {
|
|
124
|
-
deliveries: Array<WebhookDeliveryRecord & {
|
|
125
|
-
attempts?: WebhookDeliveryAttemptRecord[];
|
|
126
|
-
}>;
|
|
127
|
-
};
|
|
128
|
-
export type WebhookHealthResult = {
|
|
129
|
-
webhookId: string;
|
|
130
|
-
totalAttempts: number;
|
|
131
|
-
successfulAttempts: number;
|
|
132
|
-
failedAttempts: number;
|
|
133
|
-
successRate: number;
|
|
134
|
-
pendingDeliveries: number;
|
|
135
|
-
deadLetterDeliveries: number;
|
|
136
|
-
lastDeliveryAt?: number;
|
|
137
|
-
lastSuccessfulDeliveryAt?: number;
|
|
138
|
-
};
|
|
139
|
-
export type WebhookTestResult = {
|
|
140
|
-
webhookId: string;
|
|
141
|
-
deliveryId: string;
|
|
142
|
-
status: WebhookDeliveryStatus;
|
|
143
|
-
attempts: number;
|
|
144
|
-
};
|
|
145
|
-
export type ReplayEventsInput = EventListQuery & {
|
|
146
|
-
webhookId?: string;
|
|
147
|
-
};
|
|
148
|
-
export type ReplayEventsResult = EventListResult & {
|
|
149
|
-
replayedDeliveries?: number;
|
|
150
|
-
replayedWebhookId?: string;
|
|
151
|
-
};
|
|
152
|
-
export declare function eventPatternToRegExp(pattern: string): RegExp;
|
|
153
|
-
export declare function matchesEventPattern(eventType: string, pattern: string): boolean;
|
|
154
|
-
export declare function matchesAnyEventPattern(eventType: string, patterns: readonly string[]): boolean;
|
|
155
|
-
export declare function createEventId(): string;
|
|
156
|
-
export declare function normalizeRetentionDays(value: number | undefined): number;
|
|
157
|
-
export declare function buildDomainEvent(input: CreateDomainEventInput): DomainEvent;
|
|
158
|
-
export declare function compareEventCursor(left: EventCursor, right: EventCursor): number;
|
|
159
|
-
export declare function encodeEventCursor(cursor: EventCursor): string;
|
|
160
|
-
export declare function decodeEventCursor(cursor: string | undefined): EventCursor | null;
|
|
161
|
-
export declare function isAfterCursor(event: Pick<DomainEvent, "timestamp" | "eventId">, cursor: EventCursor | null): boolean;
|
|
162
|
-
export declare function sortEventsByCursor<T extends Pick<DomainEvent, "timestamp" | "eventId">>(events: readonly T[]): T[];
|
|
163
|
-
export declare function inferActorType(args: {
|
|
164
|
-
sessionType?: "agent" | "user";
|
|
165
|
-
authMode?: string;
|
|
166
|
-
principalType?: string;
|
|
167
|
-
}): DomainActorType;
|
|
168
|
-
export declare function emitDomainEvent(invokeMutation: (reference: any, args: CreateDomainEventInput) => Promise<unknown>, input: CreateDomainEventInput): Promise<unknown>;
|
|
169
|
-
export declare function assertValidWebhookUrl(url: string): string;
|
|
170
|
-
export declare function normalizeWebhookPatterns(patterns: readonly string[]): string[];
|
|
171
|
-
export declare function assertValidWebhookSecret(secret: string): string;
|
|
172
|
-
export declare function computeWebhookSignature(payload: string, secret: string): Promise<string>;
|
|
173
|
-
export declare function nextDeliveryAttemptAt(currentAttemptCount: number, now?: number): number | undefined;
|
|
174
|
-
export declare function resolveDeliveryFailureStatus(attemptCount: number): WebhookDeliveryStatus;
|
|
175
|
-
export declare function sanitizeWebhookRecord(value: Record<string, unknown>): WebhookRecord;
|
|
176
|
-
export declare function truncateWebhookResponseBody(responseBody: string | undefined, maxLength?: number): string | undefined;
|