@lucern/sdk 0.2.0-alpha.1
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/README.md +97 -0
- package/dist/index.js +8980 -0
- package/dist/index.js.map +1 -0
- package/dist/lucern/contracts/src/auth-session.contract.d.ts +53 -0
- package/dist/lucern/contracts/src/context-pack.contract.d.ts +494 -0
- package/dist/lucern/contracts/src/lens-filter.contract.d.ts +70 -0
- package/dist/lucern/contracts/src/lens-workflow.contract.d.ts +84 -0
- package/dist/lucern/contracts/src/mcp-tools.contract.d.ts +151 -0
- package/dist/lucern/contracts/src/workflow-runtime.contract.d.ts +161 -0
- package/dist/lucern/mcp-server/src/context-pack-policy.d.ts +119 -0
- package/dist/lucern/mcp-server/src/context-pack-schema.d.ts +18 -0
- package/dist/lucern/modules/graph-primitives/src/ontology-matching.d.ts +78 -0
- package/dist/lucern/modules/graph-primitives/src/text-matching.d.ts +53 -0
- package/dist/lucern/packages/client-core/src/beliefs.d.ts +30 -0
- package/dist/lucern/packages/client-core/src/context.d.ts +29 -0
- package/dist/lucern/packages/client-core/src/contradictions.d.ts +11 -0
- package/dist/lucern/packages/client-core/src/edges.d.ts +11 -0
- package/dist/lucern/packages/client-core/src/events.d.ts +9 -0
- package/dist/lucern/packages/client-core/src/evidence.d.ts +21 -0
- package/dist/lucern/packages/client-core/src/graph.d.ts +17 -0
- package/dist/lucern/packages/client-core/src/identity.d.ts +7 -0
- package/dist/lucern/packages/client-core/src/ids.d.ts +7 -0
- package/dist/lucern/packages/client-core/src/ontologies.d.ts +13 -0
- package/dist/lucern/packages/client-core/src/questions.d.ts +39 -0
- package/dist/lucern/packages/client-core/src/search.d.ts +7 -0
- package/dist/lucern/packages/client-core/src/tasks.d.ts +13 -0
- package/dist/lucern/packages/client-core/src/topics.d.ts +17 -0
- package/dist/lucern/packages/client-core/src/webhooks.d.ts +35 -0
- package/dist/lucern/packages/client-core/src/worktrees.d.ts +17 -0
- package/dist/lucern/packages/domain-beliefs/src/beliefs.d.ts +283 -0
- package/dist/lucern/packages/domain-beliefs/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-context/src/compile.d.ts +11 -0
- package/dist/lucern/packages/domain-context/src/context-pack-compiler.d.ts +101 -0
- package/dist/lucern/packages/domain-context/src/index.d.ts +4 -0
- package/dist/lucern/packages/domain-context/src/ports.d.ts +58 -0
- package/dist/lucern/packages/domain-context/src/public-types.d.ts +1 -0
- package/dist/lucern/packages/domain-edges/src/contradictions.d.ts +59 -0
- package/dist/lucern/packages/domain-edges/src/edges.d.ts +91 -0
- package/dist/lucern/packages/domain-edges/src/index.d.ts +2 -0
- package/dist/lucern/packages/domain-evidence/src/evidence.d.ts +115 -0
- package/dist/lucern/packages/domain-evidence/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-graph/src/graph.d.ts +150 -0
- package/dist/lucern/packages/domain-identity/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-identity/src/whoami.d.ts +13 -0
- package/dist/lucern/packages/domain-ontologies/src/ontologies.d.ts +123 -0
- package/dist/lucern/packages/domain-questions/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-questions/src/questions.d.ts +147 -0
- package/dist/lucern/packages/domain-search/src/search.d.ts +97 -0
- package/dist/lucern/packages/domain-tasks/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-tasks/src/tasks.d.ts +102 -0
- package/dist/lucern/packages/domain-topics/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-topics/src/topics.d.ts +147 -0
- package/dist/lucern/packages/domain-worktrees/src/index.d.ts +1 -0
- package/dist/lucern/packages/domain-worktrees/src/worktrees.d.ts +185 -0
- package/dist/lucern/packages/events/src/index.d.ts +4 -0
- package/dist/lucern/packages/events/src/matching.d.ts +3 -0
- package/dist/lucern/packages/events/src/outbox.d.ts +15 -0
- package/dist/lucern/packages/events/src/types.d.ts +151 -0
- package/dist/lucern/packages/events/src/webhooks.d.ts +9 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/beliefs.d.ts +15 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/context.d.ts +12 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/contradictions.d.ts +7 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/edges.d.ts +7 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/events.d.ts +6 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/evidence.d.ts +21 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/graph.d.ts +10 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/identity.d.ts +5 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/ontologies.d.ts +8 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/questions.d.ts +39 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/search.d.ts +5 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/tasks.d.ts +8 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/topics.d.ts +10 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/webhooks.d.ts +16 -0
- package/dist/lucern/packages/sdk-typescript/src/facade/worktrees.d.ts +10 -0
- package/dist/lucern/packages/sdk-typescript/src/index.d.ts +28 -0
- package/dist/packages/sdk/src/adminClient.d.ts +89 -0
- package/dist/packages/sdk/src/answersClient.d.ts +5 -0
- package/dist/packages/sdk/src/audiencesClient.d.ts +87 -0
- package/dist/packages/sdk/src/auditClient.d.ts +23 -0
- package/dist/packages/sdk/src/beliefsClient.d.ts +54 -0
- package/dist/packages/sdk/src/client.d.ts +1610 -0
- package/dist/packages/sdk/src/contextClient.d.ts +9 -0
- package/dist/packages/sdk/src/contracts/api-enums.contract.d.ts +58 -0
- package/dist/packages/sdk/src/controlObjectOwnership.d.ts +293 -0
- package/dist/packages/sdk/src/coreClient.d.ts +120 -0
- package/dist/packages/sdk/src/customTools.d.ts +65 -0
- package/dist/packages/sdk/src/decisionsClient.d.ts +110 -0
- package/dist/packages/sdk/src/graphClient.d.ts +209 -0
- package/dist/packages/sdk/src/harnessClient.d.ts +222 -0
- package/dist/packages/sdk/src/identityClient.d.ts +104 -0
- package/dist/packages/sdk/src/index.d.ts +28 -0
- package/dist/packages/sdk/src/learningClient.d.ts +43 -0
- package/dist/packages/sdk/src/mcpParityClient.d.ts +68 -0
- package/dist/packages/sdk/src/mcpParitySurface.d.ts +8 -0
- package/dist/packages/sdk/src/ontologyClient.d.ts +115 -0
- package/dist/packages/sdk/src/packsClient.d.ts +101 -0
- package/dist/packages/sdk/src/policyClient.d.ts +204 -0
- package/dist/packages/sdk/src/reportsClient.d.ts +31 -0
- package/dist/packages/sdk/src/schemaClient.d.ts +54 -0
- package/dist/packages/sdk/src/sdkSurface.d.ts +56 -0
- package/dist/packages/sdk/src/topicsClient.d.ts +45 -0
- package/dist/packages/sdk/src/types.d.ts +489 -0
- package/dist/packages/sdk/src/version.d.ts +2 -0
- package/dist/packages/sdk/src/workflowClient.d.ts +274 -0
- package/package.json +56 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type McpParityMethod = {
|
|
2
|
+
toolName: string;
|
|
3
|
+
methodPath: string;
|
|
4
|
+
kind: "read" | "mutation";
|
|
5
|
+
};
|
|
6
|
+
export declare const SDK_MCP_PARITY_METHODS: readonly McpParityMethod[];
|
|
7
|
+
export declare const SDK_MCP_PARITY_METHOD_PATHS: string[];
|
|
8
|
+
export declare const SDK_MCP_PARITY_TOOL_NAMES: string[];
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type GatewayClientConfig, type GatewayScope } from "./coreClient";
|
|
2
|
+
import type { JsonObject } from "./types";
|
|
3
|
+
export type OntologyClientConfig = GatewayClientConfig;
|
|
4
|
+
export type OntologyBindingInput = GatewayScope & {
|
|
5
|
+
ontologyId: string;
|
|
6
|
+
topicId: string;
|
|
7
|
+
};
|
|
8
|
+
export type OntologyDefinitionInput = GatewayScope & {
|
|
9
|
+
ontologyKey: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
tenantId?: string;
|
|
13
|
+
tier?: "platform" | "pack" | "tenant";
|
|
14
|
+
};
|
|
15
|
+
export type OntologyDefinitionUpdateInput = GatewayScope & {
|
|
16
|
+
name?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
status?: "draft" | "active" | "deprecated";
|
|
19
|
+
};
|
|
20
|
+
export type OntologyVersionInput = GatewayScope & {
|
|
21
|
+
version: string;
|
|
22
|
+
entityTypes: Array<{
|
|
23
|
+
value: string;
|
|
24
|
+
label: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
schema?: JsonObject;
|
|
27
|
+
subtypes?: Array<{
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
}>;
|
|
32
|
+
}>;
|
|
33
|
+
edgeTypes: Array<{
|
|
34
|
+
value: string;
|
|
35
|
+
label: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
sourceTypes?: string[];
|
|
38
|
+
targetTypes?: string[];
|
|
39
|
+
constraintSeverity?: "warn" | "info";
|
|
40
|
+
}>;
|
|
41
|
+
releaseNotes?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Create the ontology client for ontology definitions and versions.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createOntologyClient(config?: OntologyClientConfig): {
|
|
47
|
+
list(filters?: GatewayScope & {
|
|
48
|
+
tenantId?: string;
|
|
49
|
+
tier?: string;
|
|
50
|
+
status?: string;
|
|
51
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<{
|
|
52
|
+
ontologies: any[];
|
|
53
|
+
total: number;
|
|
54
|
+
items: any[];
|
|
55
|
+
definitions: any[];
|
|
56
|
+
}>>;
|
|
57
|
+
get(id: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
58
|
+
bind(input: OntologyBindingInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
59
|
+
/**
|
|
60
|
+
* List ontology definitions.
|
|
61
|
+
*/
|
|
62
|
+
listDefinitions(filters?: GatewayScope & {
|
|
63
|
+
tenantId?: string;
|
|
64
|
+
tier?: string;
|
|
65
|
+
status?: string;
|
|
66
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<{
|
|
67
|
+
ontologies: any[];
|
|
68
|
+
total: number;
|
|
69
|
+
items: any[];
|
|
70
|
+
definitions: any[];
|
|
71
|
+
}>>;
|
|
72
|
+
/**
|
|
73
|
+
* Get an ontology definition.
|
|
74
|
+
*/
|
|
75
|
+
getDefinition(id: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
76
|
+
/**
|
|
77
|
+
* Create an ontology definition.
|
|
78
|
+
*/
|
|
79
|
+
createDefinition(input: OntologyDefinitionInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
80
|
+
/**
|
|
81
|
+
* Update an ontology definition.
|
|
82
|
+
*/
|
|
83
|
+
updateDefinition(id: string, input: OntologyDefinitionUpdateInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
84
|
+
/**
|
|
85
|
+
* Archive an ontology definition.
|
|
86
|
+
*/
|
|
87
|
+
archiveDefinition(id: string, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
88
|
+
/**
|
|
89
|
+
* List versions for an ontology definition.
|
|
90
|
+
*/
|
|
91
|
+
listVersions(ontologyId: string, filters?: GatewayScope & {
|
|
92
|
+
status?: string;
|
|
93
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "versions">>>;
|
|
94
|
+
/**
|
|
95
|
+
* Create an ontology version.
|
|
96
|
+
*/
|
|
97
|
+
createVersion(ontologyId: string, input: OntologyVersionInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
98
|
+
/**
|
|
99
|
+
* Publish an ontology version.
|
|
100
|
+
*/
|
|
101
|
+
publishVersion(ontologyId: string, versionId: string, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
102
|
+
/**
|
|
103
|
+
* Deprecate an ontology version.
|
|
104
|
+
*/
|
|
105
|
+
deprecateVersion(ontologyId: string, versionId: string, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
106
|
+
/**
|
|
107
|
+
* List topics directly bound to a specific ontology definition.
|
|
108
|
+
* Uses the topics gateway with ontologyId filter.
|
|
109
|
+
*/
|
|
110
|
+
listTopics(ontologyId: string): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "topics">>>;
|
|
111
|
+
/**
|
|
112
|
+
* @deprecated Use listTopics.
|
|
113
|
+
*/
|
|
114
|
+
listTopicsByOntology(ontologyId: string): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "topics">>>;
|
|
115
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type GatewayClientConfig, type GatewayScope, LucernApiError } from "./coreClient";
|
|
2
|
+
import type { JsonObject } from "./types";
|
|
3
|
+
export { LucernApiError };
|
|
4
|
+
export type { GatewayScope, PlatformGatewaySuccess } from "./coreClient";
|
|
5
|
+
export type PacksClientConfig = GatewayClientConfig;
|
|
6
|
+
export type PackInstallInput = GatewayScope & {
|
|
7
|
+
packKey: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
autoEnable?: boolean;
|
|
10
|
+
metadata?: JsonObject;
|
|
11
|
+
};
|
|
12
|
+
export type PackEnableInput = GatewayScope & {
|
|
13
|
+
packKey: string;
|
|
14
|
+
metadata?: JsonObject;
|
|
15
|
+
};
|
|
16
|
+
export type PackDisableInput = GatewayScope & {
|
|
17
|
+
packKey: string;
|
|
18
|
+
force?: boolean;
|
|
19
|
+
metadata?: JsonObject;
|
|
20
|
+
};
|
|
21
|
+
export type PackUpgradeInput = GatewayScope & {
|
|
22
|
+
packKey: string;
|
|
23
|
+
mode: "prepare" | "canary" | "commit" | "rollback";
|
|
24
|
+
targetVersion?: string;
|
|
25
|
+
metadata?: JsonObject;
|
|
26
|
+
};
|
|
27
|
+
export type PackEntitlementInput = GatewayScope & {
|
|
28
|
+
packKey: string;
|
|
29
|
+
status: "active" | "disabled" | "revoked";
|
|
30
|
+
allowedLifecycles?: Array<"active" | "beta" | "experimental">;
|
|
31
|
+
minVersion?: string;
|
|
32
|
+
maxVersion?: string;
|
|
33
|
+
metadata?: JsonObject;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Create the packs client for pack catalog, state, and entitlement operations.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createPacksClient(config?: PacksClientConfig): {
|
|
39
|
+
/**
|
|
40
|
+
* List catalog entries for available packs.
|
|
41
|
+
*/
|
|
42
|
+
listCatalog(): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "catalog">>>;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated Use listCatalog.
|
|
45
|
+
*/
|
|
46
|
+
getCatalog(): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "catalog">>>;
|
|
47
|
+
/**
|
|
48
|
+
* List pack states for the current scope.
|
|
49
|
+
*/
|
|
50
|
+
listStates(query?: GatewayScope): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "states">>>;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Use listStates.
|
|
53
|
+
*/
|
|
54
|
+
getStates(query?: GatewayScope): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "states">>>;
|
|
55
|
+
/**
|
|
56
|
+
* Get health details for a pack.
|
|
57
|
+
*/
|
|
58
|
+
getHealth(packKey: string, query?: GatewayScope): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
59
|
+
/**
|
|
60
|
+
* List pack telemetry entries.
|
|
61
|
+
*/
|
|
62
|
+
listTelemetry(query?: GatewayScope & {
|
|
63
|
+
lookbackHours?: number;
|
|
64
|
+
limit?: number;
|
|
65
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "telemetry">>>;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use listTelemetry.
|
|
68
|
+
*/
|
|
69
|
+
getTelemetry(query?: GatewayScope & {
|
|
70
|
+
lookbackHours?: number;
|
|
71
|
+
limit?: number;
|
|
72
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "telemetry">>>;
|
|
73
|
+
/**
|
|
74
|
+
* Create a pack entitlement.
|
|
75
|
+
*/
|
|
76
|
+
createEntitlement(input: PackEntitlementInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
77
|
+
/**
|
|
78
|
+
* Update a pack entitlement.
|
|
79
|
+
*/
|
|
80
|
+
updateEntitlement(input: PackEntitlementInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated Use createEntitlement or updateEntitlement.
|
|
83
|
+
*/
|
|
84
|
+
upsertEntitlement(input: PackEntitlementInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
85
|
+
/**
|
|
86
|
+
* Install a pack.
|
|
87
|
+
*/
|
|
88
|
+
install(input: PackInstallInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
89
|
+
/**
|
|
90
|
+
* Enable a pack.
|
|
91
|
+
*/
|
|
92
|
+
enable(input: PackEnableInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
93
|
+
/**
|
|
94
|
+
* Disable a pack.
|
|
95
|
+
*/
|
|
96
|
+
disable(input: PackDisableInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
97
|
+
/**
|
|
98
|
+
* Upgrade a pack.
|
|
99
|
+
*/
|
|
100
|
+
upgrade(input: PackUpgradeInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
101
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { type GatewayClientConfig, type GatewayScope, LucernApiError } from "./coreClient";
|
|
2
|
+
export { LucernApiError };
|
|
3
|
+
export type { GatewayScope, PlatformGatewaySuccess } from "./coreClient";
|
|
4
|
+
export type PolicyClientConfig = GatewayClientConfig;
|
|
5
|
+
export type PermissionKind = "read" | "write";
|
|
6
|
+
export type WritePolicyPermission = "allow" | "deny" | "review_required";
|
|
7
|
+
type TopicRecord = {
|
|
8
|
+
topicId?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
isOwner?: boolean;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
export type PolicyDecisionExplanation = {
|
|
15
|
+
summary?: string;
|
|
16
|
+
matchedReasonCode?: string;
|
|
17
|
+
steps?: Array<{
|
|
18
|
+
stage?: string;
|
|
19
|
+
outcome?: string;
|
|
20
|
+
reasonCode?: string;
|
|
21
|
+
detail?: string;
|
|
22
|
+
}>;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
export type PermissionDecision = {
|
|
26
|
+
allowed?: boolean;
|
|
27
|
+
decision?: string;
|
|
28
|
+
reasonCode?: string;
|
|
29
|
+
principalId?: string;
|
|
30
|
+
topicId?: string;
|
|
31
|
+
permission?: string;
|
|
32
|
+
policyVersion?: string;
|
|
33
|
+
traceId?: string | null;
|
|
34
|
+
explanation?: PolicyDecisionExplanation;
|
|
35
|
+
};
|
|
36
|
+
export type WritePolicyRecord = {
|
|
37
|
+
id?: string;
|
|
38
|
+
topicId?: string;
|
|
39
|
+
role?: string;
|
|
40
|
+
toolCategory?: string;
|
|
41
|
+
permission?: WritePolicyPermission;
|
|
42
|
+
maxWritesPerSession?: number;
|
|
43
|
+
enabled?: boolean;
|
|
44
|
+
rationale?: string;
|
|
45
|
+
createdAt?: number;
|
|
46
|
+
updatedAt?: number;
|
|
47
|
+
createdBy?: string;
|
|
48
|
+
resolution?: string;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
export type WritePolicyCreateInput = GatewayScope & {
|
|
52
|
+
topicId?: string;
|
|
53
|
+
role: string;
|
|
54
|
+
toolCategory: string;
|
|
55
|
+
permission: WritePolicyPermission;
|
|
56
|
+
maxWritesPerSession?: number;
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
rationale?: string;
|
|
59
|
+
createdBy?: string;
|
|
60
|
+
};
|
|
61
|
+
export type WritePolicyUpdateInput = GatewayScope & {
|
|
62
|
+
topicId?: string;
|
|
63
|
+
clearTopicId?: boolean;
|
|
64
|
+
role?: string;
|
|
65
|
+
toolCategory?: string;
|
|
66
|
+
permission?: WritePolicyPermission;
|
|
67
|
+
maxWritesPerSession?: number;
|
|
68
|
+
clearMaxWritesPerSession?: boolean;
|
|
69
|
+
enabled?: boolean;
|
|
70
|
+
rationale?: string;
|
|
71
|
+
clearRationale?: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Create the policy client for permission checks and grants.
|
|
75
|
+
*/
|
|
76
|
+
export declare function createPolicyClient(config?: PolicyClientConfig): {
|
|
77
|
+
/**
|
|
78
|
+
* List policy decisions in the current scope.
|
|
79
|
+
*/
|
|
80
|
+
listDecisions(query?: GatewayScope & {
|
|
81
|
+
action?: string;
|
|
82
|
+
decision?: string;
|
|
83
|
+
traceId?: string;
|
|
84
|
+
principalId?: string;
|
|
85
|
+
topicId?: string;
|
|
86
|
+
limit?: number;
|
|
87
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "decisions">>>;
|
|
88
|
+
/**
|
|
89
|
+
* Create a permission grant.
|
|
90
|
+
*/
|
|
91
|
+
grant(input: GatewayScope & {
|
|
92
|
+
topicId: string;
|
|
93
|
+
permission: PermissionKind;
|
|
94
|
+
principal?: string;
|
|
95
|
+
principalId?: string;
|
|
96
|
+
groupId?: string;
|
|
97
|
+
beliefClusterId?: string;
|
|
98
|
+
expiresAt?: number;
|
|
99
|
+
}, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
100
|
+
/**
|
|
101
|
+
* Delete a permission grant by revoking it.
|
|
102
|
+
*/
|
|
103
|
+
revoke(input: GatewayScope & {
|
|
104
|
+
topicId: string;
|
|
105
|
+
principal?: string;
|
|
106
|
+
principalId?: string;
|
|
107
|
+
groupId?: string;
|
|
108
|
+
beliefClusterId?: string;
|
|
109
|
+
}, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
110
|
+
listWritePolicies(query?: GatewayScope & {
|
|
111
|
+
topicId?: string;
|
|
112
|
+
role?: string;
|
|
113
|
+
toolCategory?: string;
|
|
114
|
+
enabled?: boolean;
|
|
115
|
+
}): Promise<{
|
|
116
|
+
data: {
|
|
117
|
+
policies: WritePolicyRecord[];
|
|
118
|
+
};
|
|
119
|
+
success: true;
|
|
120
|
+
correlationId: string;
|
|
121
|
+
policyTraceId: string | null;
|
|
122
|
+
idempotentReplay: boolean;
|
|
123
|
+
}>;
|
|
124
|
+
createWritePolicy(input: WritePolicyCreateInput, idempotencyKey?: string): Promise<{
|
|
125
|
+
data: {
|
|
126
|
+
id: string | undefined;
|
|
127
|
+
created: boolean;
|
|
128
|
+
policy: WritePolicyRecord | null;
|
|
129
|
+
};
|
|
130
|
+
success: true;
|
|
131
|
+
correlationId: string;
|
|
132
|
+
policyTraceId: string | null;
|
|
133
|
+
idempotentReplay: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
updateWritePolicy(id: string, input: WritePolicyUpdateInput, idempotencyKey?: string): Promise<{
|
|
136
|
+
data: {
|
|
137
|
+
id: string | undefined;
|
|
138
|
+
updated: boolean;
|
|
139
|
+
policy: WritePolicyRecord | null;
|
|
140
|
+
};
|
|
141
|
+
success: true;
|
|
142
|
+
correlationId: string;
|
|
143
|
+
policyTraceId: string | null;
|
|
144
|
+
idempotentReplay: boolean;
|
|
145
|
+
}>;
|
|
146
|
+
deleteWritePolicy(id: string, scope?: GatewayScope, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<{
|
|
147
|
+
id?: string;
|
|
148
|
+
deleted?: boolean;
|
|
149
|
+
}>>;
|
|
150
|
+
/**
|
|
151
|
+
* Check a permission decision for a topic or project scope.
|
|
152
|
+
*/
|
|
153
|
+
checkPermission(query: GatewayScope & {
|
|
154
|
+
topicId?: string;
|
|
155
|
+
permission?: PermissionKind;
|
|
156
|
+
principal?: string;
|
|
157
|
+
principalId?: string;
|
|
158
|
+
beliefClusterId?: string;
|
|
159
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<PermissionDecision>>;
|
|
160
|
+
/**
|
|
161
|
+
* List accessible topics for a principal.
|
|
162
|
+
*/
|
|
163
|
+
listAccessibleTopics(query?: GatewayScope & {
|
|
164
|
+
permission?: PermissionKind;
|
|
165
|
+
includeShared?: boolean;
|
|
166
|
+
principal?: string;
|
|
167
|
+
principalId?: string;
|
|
168
|
+
limit?: number;
|
|
169
|
+
}): Promise<{
|
|
170
|
+
data: {
|
|
171
|
+
permission: PermissionKind;
|
|
172
|
+
topics: TopicRecord[];
|
|
173
|
+
total: number;
|
|
174
|
+
deniedTopics: {
|
|
175
|
+
topicId: string;
|
|
176
|
+
reasonCode: string;
|
|
177
|
+
}[];
|
|
178
|
+
};
|
|
179
|
+
success: true;
|
|
180
|
+
correlationId: string;
|
|
181
|
+
policyTraceId: string | null;
|
|
182
|
+
idempotentReplay: boolean;
|
|
183
|
+
}>;
|
|
184
|
+
/**
|
|
185
|
+
* Filter topic identifiers by permission.
|
|
186
|
+
*/
|
|
187
|
+
filterByPermission(input: GatewayScope & {
|
|
188
|
+
topicIds?: string[];
|
|
189
|
+
permission?: PermissionKind;
|
|
190
|
+
principal?: string;
|
|
191
|
+
principalId?: string;
|
|
192
|
+
}): Promise<{
|
|
193
|
+
success: boolean;
|
|
194
|
+
data: {
|
|
195
|
+
permission: PermissionKind;
|
|
196
|
+
allowedTopicIds: string[];
|
|
197
|
+
deniedTopics: {
|
|
198
|
+
topicId: string;
|
|
199
|
+
reasonCode: string;
|
|
200
|
+
}[];
|
|
201
|
+
count: number;
|
|
202
|
+
};
|
|
203
|
+
}>;
|
|
204
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type GatewayClientConfig } from "./coreClient";
|
|
2
|
+
import type { TopicIdentifierInput, ReportTemplatesResponse, ReportWithSectionsResponse } from "./types";
|
|
3
|
+
export type ReportsClientConfig = GatewayClientConfig;
|
|
4
|
+
export type { ProjectReportsResponse, ReportTemplatesResponse, ReportWithSectionsResponse, } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* Create the reports client for report templates and generated reports.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createReportsClient(config?: ReportsClientConfig): {
|
|
9
|
+
/**
|
|
10
|
+
* List report templates.
|
|
11
|
+
*/
|
|
12
|
+
listTemplates(args?: {
|
|
13
|
+
slug?: string;
|
|
14
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<ReportTemplatesResponse>>;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use listTemplates.
|
|
17
|
+
*/
|
|
18
|
+
getTemplates(args?: {
|
|
19
|
+
slug?: string;
|
|
20
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<ReportTemplatesResponse>>;
|
|
21
|
+
/**
|
|
22
|
+
* List reports for a topic scope.
|
|
23
|
+
*/
|
|
24
|
+
listReports(input: TopicIdentifierInput, args?: {
|
|
25
|
+
summary?: boolean;
|
|
26
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "reports">>>;
|
|
27
|
+
/**
|
|
28
|
+
* Get a generated report.
|
|
29
|
+
*/
|
|
30
|
+
getReport(reportId: string): Promise<import("./coreClient").PlatformGatewaySuccess<ReportWithSectionsResponse>>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type GatewayClientConfig, type GatewayScope, LucernApiError } from "./coreClient";
|
|
2
|
+
import type { JsonObject } from "./types";
|
|
3
|
+
export { LucernApiError };
|
|
4
|
+
export type { GatewayScope, PlatformGatewaySuccess } from "./coreClient";
|
|
5
|
+
export type SchemaClientConfig = GatewayClientConfig;
|
|
6
|
+
export type SchemaPackInstallInput = GatewayScope & {
|
|
7
|
+
packKey: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
autoEnable?: boolean;
|
|
10
|
+
metadata?: JsonObject;
|
|
11
|
+
};
|
|
12
|
+
export type SchemaEntitlementInput = GatewayScope & {
|
|
13
|
+
packKey: string;
|
|
14
|
+
status: "active" | "disabled" | "revoked";
|
|
15
|
+
allowedLifecycles?: Array<"active" | "beta" | "experimental">;
|
|
16
|
+
minVersion?: string;
|
|
17
|
+
maxVersion?: string;
|
|
18
|
+
metadata?: JsonObject;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Create the schema client for pack catalog and entitlement operations.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createSchemaClient(config?: SchemaClientConfig): {
|
|
24
|
+
/**
|
|
25
|
+
* List schema packs.
|
|
26
|
+
*/
|
|
27
|
+
listPacks(scope?: GatewayScope): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "packs">>>;
|
|
28
|
+
/**
|
|
29
|
+
* Install a schema pack.
|
|
30
|
+
*/
|
|
31
|
+
installPack(input: SchemaPackInstallInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
32
|
+
/**
|
|
33
|
+
* Get a schema pack by identifier.
|
|
34
|
+
*/
|
|
35
|
+
getPack(packId: string, scope?: GatewayScope): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
36
|
+
/**
|
|
37
|
+
* List schema entitlements.
|
|
38
|
+
*/
|
|
39
|
+
listEntitlements(scope?: GatewayScope & {
|
|
40
|
+
packKey?: string;
|
|
41
|
+
}): Promise<import("./coreClient").PlatformGatewaySuccess<import("./types").ListResult<any, "entitlements">>>;
|
|
42
|
+
/**
|
|
43
|
+
* Create a schema entitlement.
|
|
44
|
+
*/
|
|
45
|
+
createEntitlement(input: SchemaEntitlementInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
46
|
+
/**
|
|
47
|
+
* Update a schema entitlement.
|
|
48
|
+
*/
|
|
49
|
+
updateEntitlement(input: SchemaEntitlementInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Use createEntitlement or updateEntitlement.
|
|
52
|
+
*/
|
|
53
|
+
upsertEntitlement(input: SchemaEntitlementInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<unknown>>;
|
|
54
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PlatformGatewaySuccess } from "./coreClient";
|
|
2
|
+
import type { JsonObject, ListResult } from "./types";
|
|
3
|
+
type TopicScopedValue = {
|
|
4
|
+
topicId?: string;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
};
|
|
7
|
+
type TextScopedValue = {
|
|
8
|
+
text?: string;
|
|
9
|
+
canonicalText?: string;
|
|
10
|
+
};
|
|
11
|
+
type AnyRecord = Record<string, unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the canonical topic identifier from topic-first or legacy project-first inputs.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveTopicId(value: TopicScopedValue): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the canonical text field from text-first or legacy canonicalText-first inputs.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveText(value: TextScopedValue): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Attach the topicId/projectId alias pair to a record.
|
|
22
|
+
*/
|
|
23
|
+
export declare function withTopicAlias<T extends AnyRecord>(value: T): T;
|
|
24
|
+
/**
|
|
25
|
+
* Attach the text/canonicalText alias pair to a record.
|
|
26
|
+
*/
|
|
27
|
+
export declare function withTextAlias<T extends AnyRecord>(value: T): T;
|
|
28
|
+
/**
|
|
29
|
+
* Attach topic and text aliases to SDK node-like records.
|
|
30
|
+
*/
|
|
31
|
+
export declare function withSdkAliases<T extends AnyRecord>(value: T): T;
|
|
32
|
+
/**
|
|
33
|
+
* Normalize a belief/question/evidence write payload to the canonical gateway shape.
|
|
34
|
+
*/
|
|
35
|
+
export declare function normalizeNodeWriteInput<T extends JsonObject>(value: T): T;
|
|
36
|
+
/**
|
|
37
|
+
* Build a topic-aware query object while preserving the legacy projectId alias.
|
|
38
|
+
*/
|
|
39
|
+
export declare function normalizeTopicQuery<T extends JsonObject>(value: T): T;
|
|
40
|
+
/**
|
|
41
|
+
* Extract list items from array or list-envelope payloads.
|
|
42
|
+
*/
|
|
43
|
+
export declare function asListItems<T>(data: unknown, legacyKey?: string): T[];
|
|
44
|
+
/**
|
|
45
|
+
* Standardize list data to { items, total } while retaining an optional legacy array key.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createListResult<T, LegacyKey extends string>(items: T[], legacyKey?: LegacyKey): ListResult<T, LegacyKey>;
|
|
48
|
+
/**
|
|
49
|
+
* Map a gateway success envelope's data while preserving the transport metadata.
|
|
50
|
+
*/
|
|
51
|
+
export declare function mapGatewayData<T, U>(response: PlatformGatewaySuccess<T>, mapper: (data: T) => U): PlatformGatewaySuccess<U>;
|
|
52
|
+
/**
|
|
53
|
+
* Apply SDK aliases across all items in a list-like payload.
|
|
54
|
+
*/
|
|
55
|
+
export declare function mapAliasedList<TItem extends AnyRecord, LegacyKey extends string>(data: unknown, legacyKey?: LegacyKey): ListResult<TItem, LegacyKey>;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type GatewayClientConfig } from "./coreClient";
|
|
2
|
+
import type { JsonObject, TopicCoverageResponse, TopicIdentifierInput, TopicListResponse, TopicRecord, TopicTreeResponse } from "./types";
|
|
3
|
+
export type TopicsClientConfig = GatewayClientConfig;
|
|
4
|
+
export type TopicListInput = TopicIdentifierInput & {
|
|
5
|
+
ontologyId?: string;
|
|
6
|
+
parentTopicId?: string;
|
|
7
|
+
status?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
};
|
|
10
|
+
export type TopicCreateInput = TopicIdentifierInput & {
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
parentTopicId?: string;
|
|
15
|
+
ontologyId?: string;
|
|
16
|
+
tenantId?: string;
|
|
17
|
+
workspaceId?: string;
|
|
18
|
+
visibility?: "private" | "team" | "firm" | "external" | "public";
|
|
19
|
+
createdBy?: string;
|
|
20
|
+
metadata?: JsonObject;
|
|
21
|
+
};
|
|
22
|
+
export type TopicUpdateInput = TopicIdentifierInput & {
|
|
23
|
+
name?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
type?: string;
|
|
26
|
+
ontologyId?: string;
|
|
27
|
+
clearOntologyId?: boolean;
|
|
28
|
+
status?: "active" | "archived" | "watching";
|
|
29
|
+
visibility?: "private" | "team" | "firm" | "external" | "public";
|
|
30
|
+
};
|
|
31
|
+
export type TopicTreeQuery = {
|
|
32
|
+
maxDepth?: number;
|
|
33
|
+
};
|
|
34
|
+
export type TopicCoverageQuery = {
|
|
35
|
+
includeDescendants?: boolean;
|
|
36
|
+
maxDepth?: number;
|
|
37
|
+
};
|
|
38
|
+
export declare function createTopicsClient(config?: TopicsClientConfig): {
|
|
39
|
+
list(query?: TopicListInput): Promise<import("./coreClient").PlatformGatewaySuccess<TopicListResponse>>;
|
|
40
|
+
get(topicId: string): Promise<import("./coreClient").PlatformGatewaySuccess<TopicRecord>>;
|
|
41
|
+
create(input: TopicCreateInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<TopicRecord>>;
|
|
42
|
+
update(topicId: string, input: TopicUpdateInput, idempotencyKey?: string): Promise<import("./coreClient").PlatformGatewaySuccess<TopicRecord>>;
|
|
43
|
+
getTree(topicId: string, query?: TopicTreeQuery): Promise<import("./coreClient").PlatformGatewaySuccess<TopicTreeResponse>>;
|
|
44
|
+
getCoverage(topicId: string, query?: TopicCoverageQuery): Promise<import("./coreClient").PlatformGatewaySuccess<TopicCoverageResponse>>;
|
|
45
|
+
};
|