@lucern/sdk 0.2.0-alpha.5 → 0.2.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +7 -0
- package/.turbo/turbo-typecheck.log +4 -0
- package/CHANGELOG.md +13 -0
- package/examples/README.md +69 -0
- package/examples/contradiction.ts +94 -0
- package/examples/investigation-context.ts +118 -0
- package/examples/questions-and-tasks.ts +55 -0
- package/examples/quickstart.ts +97 -0
- package/examples/shared.ts +318 -0
- package/examples/strict-public-types.ts +143 -0
- package/examples/worktree-lifecycle.ts +79 -0
- package/package.json +16 -59
- package/src/README.md +6 -0
- package/src/adminClient.ts +789 -0
- package/{dist/lib/platform/sdk/answersClient.d.ts → src/answersClient.ts} +17 -4
- package/src/audiencesClient.ts +209 -0
- package/src/auditClient.ts +50 -0
- package/src/beliefsClient.ts +319 -0
- package/src/client.ts +2647 -0
- package/src/contextClient.ts +130 -0
- package/src/contextFacade.ts +15 -0
- package/src/contextPackCompiler.ts +828 -0
- package/src/contextPackSchema.ts +251 -0
- package/src/contextTypes.ts +153 -0
- package/src/contracts/api-enums.contract.ts +202 -0
- package/src/contracts/auth-session.contract.ts +109 -0
- package/src/contracts/context-pack.contract.ts +700 -0
- package/src/contracts/contextPack.ts +1 -0
- package/src/contracts/index.ts +10 -0
- package/src/contracts/lens-filter.contract.ts +183 -0
- package/src/contracts/lens-workflow.contract.ts +162 -0
- package/src/contracts/lensFilter.ts +1 -0
- package/src/contracts/lensWorkflow.ts +1 -0
- package/src/contracts/mcp-tools.contract.ts +3636 -0
- package/src/contracts/mcpTools.ts +1 -0
- package/src/contracts/prompt.contract.ts +50 -0
- package/src/contracts/prompt.ts +1 -0
- package/src/contracts/sdk-tools.contract.ts +1457 -0
- package/src/contracts/sdkTools.ts +1 -0
- package/src/contracts/workflow-runtime.contract.ts +440 -0
- package/src/contracts/workflowRuntime.ts +1 -0
- package/src/controlObjectOwnership.ts +286 -0
- package/src/coreClient.ts +570 -0
- package/src/customTools.ts +398 -0
- package/src/decisionsClient.ts +286 -0
- package/src/domainContext.ts +15 -0
- package/src/events.ts +531 -0
- package/src/eventsCore.ts +168 -0
- package/src/facade/beliefs.ts +83 -0
- package/src/facade/context.ts +110 -0
- package/src/facade/contradictions.ts +29 -0
- package/src/facade/edges.ts +30 -0
- package/src/facade/events.ts +23 -0
- package/src/facade/evidence.ts +41 -0
- package/src/facade/graph.ts +38 -0
- package/src/facade/identity.ts +16 -0
- package/src/facade/ontologies.ts +34 -0
- package/src/facade/questions.ts +59 -0
- package/src/facade/search.ts +16 -0
- package/src/facade/tasks.ts +37 -0
- package/src/facade/topics.ts +42 -0
- package/src/facade/webhooks.ts +58 -0
- package/src/facade/worktrees.ts +51 -0
- package/src/gatewayFacades.ts +1666 -0
- package/src/graphClient.ts +529 -0
- package/src/harnessClient.ts +585 -0
- package/src/identityClient.ts +278 -0
- package/{dist/lib/platform/sdk/index.d.ts → src/index.ts} +3 -0
- package/src/learningClient.ts +95 -0
- package/src/mcpParityClient.ts +240 -0
- package/src/mcpParitySurface.ts +70 -0
- package/src/ontologyClient.ts +275 -0
- package/src/packRuntime.ts +3 -0
- package/src/packsClient.ts +260 -0
- package/src/policyClient.ts +572 -0
- package/src/promptCatalog.ts +1 -0
- package/src/realtime/index.ts +51 -0
- package/src/realtime/refs.ts +17 -0
- package/src/reportsClient.ts +99 -0
- package/src/schemaClient.ts +129 -0
- package/src/sdkSurface.ts +190 -0
- package/src/topicsClient.ts +243 -0
- package/src/types.ts +807 -0
- package/src/workflowClient.ts +826 -0
- package/tsconfig.json +9 -0
- package/dist/.generated +0 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- 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.d.ts +0 -404
- package/dist/lib/platform/sdk/adminClient.js +0 -384
- package/dist/lib/platform/sdk/answersClient.js +0 -21
- package/dist/lib/platform/sdk/audiencesClient.d.ts +0 -93
- 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.d.ts +0 -157
- package/dist/lib/platform/sdk/beliefsClient.js +0 -124
- package/dist/lib/platform/sdk/client.d.ts +0 -2369
- package/dist/lib/platform/sdk/client.js +0 -1831
- package/dist/lib/platform/sdk/contextClient.d.ts +0 -21
- package/dist/lib/platform/sdk/contextClient.js +0 -86
- package/dist/lib/platform/sdk/contextPackCompiler.d.ts +0 -100
- package/dist/lib/platform/sdk/contextPackCompiler.js +0 -534
- package/dist/lib/platform/sdk/contextTypes.d.ts +0 -133
- package/dist/lib/platform/sdk/contextTypes.js +0 -1
- package/dist/lib/platform/sdk/controlObjectOwnership.d.ts +0 -308
- package/dist/lib/platform/sdk/controlObjectOwnership.js +0 -220
- package/dist/lib/platform/sdk/coreClient.d.ts +0 -139
- package/dist/lib/platform/sdk/coreClient.js +0 -366
- package/dist/lib/platform/sdk/customTools.d.ts +0 -83
- package/dist/lib/platform/sdk/customTools.js +0 -247
- package/dist/lib/platform/sdk/decisionsClient.d.ts +0 -106
- 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/gatewayFacades.d.ts +0 -586
- package/dist/lib/platform/sdk/gatewayFacades.js +0 -845
- package/dist/lib/platform/sdk/graphClient.d.ts +0 -266
- package/dist/lib/platform/sdk/graphClient.js +0 -235
- package/dist/lib/platform/sdk/harnessClient.d.ts +0 -309
- package/dist/lib/platform/sdk/harnessClient.js +0 -219
- package/dist/lib/platform/sdk/identityClient.d.ts +0 -134
- package/dist/lib/platform/sdk/identityClient.js +0 -131
- package/dist/lib/platform/sdk/index.js +0 -46
- package/dist/lib/platform/sdk/learningClient.d.ts +0 -40
- package/dist/lib/platform/sdk/learningClient.js +0 -53
- package/dist/lib/platform/sdk/mcpParityClient.d.ts +0 -69
- 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.d.ts +0 -131
- 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.d.ts +0 -126
- package/dist/lib/platform/sdk/packsClient.js +0 -157
- package/dist/lib/platform/sdk/policyClient.d.ts +0 -293
- 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.d.ts +0 -59
- 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.d.ts +0 -78
- package/dist/lib/platform/sdk/topicsClient.js +0 -118
- package/dist/lib/platform/sdk/types.d.ts +0 -692
- package/dist/lib/platform/sdk/types.js +0 -1
- package/dist/lib/platform/sdk/version.d.ts +0 -2
- package/dist/lib/platform/sdk/workflowClient.d.ts +0 -313
- 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/lens-filter.contract.d.ts +0 -70
- 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/lib/platform/sdk/version.js → src/version.ts} +0 -0
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig } from "./coreClient";
|
|
2
|
-
import type { CompileContextInput, PublicCompiledContext } from "./contextTypes";
|
|
3
|
-
/** Configuration for the context client. */
|
|
4
|
-
export type ContextClientConfig = GatewayClientConfig;
|
|
5
|
-
/** Alias for the compiled context payload returned by the gateway. */
|
|
6
|
-
export type CompileContextResponse = PublicCompiledContext;
|
|
7
|
-
/**
|
|
8
|
-
* Create the context client for compiling reasoning context packs.
|
|
9
|
-
* @param config - Gateway transport configuration.
|
|
10
|
-
* @returns An object with a `compile` method for building context packs.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createContextClient(config?: ContextClientConfig): {
|
|
13
|
-
/**
|
|
14
|
-
* Compile a focused reasoning context pack for a topic scope.
|
|
15
|
-
* @param topicId - The topic to compile context for.
|
|
16
|
-
* @param input - Optional compile parameters (query, budget, ranking, etc.).
|
|
17
|
-
* @returns The compiled context payload with beliefs, questions, and evidence.
|
|
18
|
-
*/
|
|
19
|
-
compile(topicId: string, input?: CompileContextInput): Promise<import("./coreClient").PlatformGatewaySuccess<PublicCompiledContext>>;
|
|
20
|
-
};
|
|
21
|
-
export type { CompileContextInput, PublicCompiledContext } from "./contextTypes";
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { createGatewayRequestClient, } from "./coreClient.js";
|
|
2
|
-
function cleanString(value) {
|
|
3
|
-
return typeof value === "string" && value.trim().length > 0
|
|
4
|
-
? value.trim()
|
|
5
|
-
: undefined;
|
|
6
|
-
}
|
|
7
|
-
function cleanNumber(value) {
|
|
8
|
-
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
9
|
-
}
|
|
10
|
-
function cleanBoolean(value) {
|
|
11
|
-
return typeof value === "boolean" ? value : undefined;
|
|
12
|
-
}
|
|
13
|
-
function buildCompileContextRequest(topicId, input = {}) {
|
|
14
|
-
const payload = { topicId };
|
|
15
|
-
const query = cleanString(input.query);
|
|
16
|
-
if (query) {
|
|
17
|
-
payload.query = query;
|
|
18
|
-
}
|
|
19
|
-
const budget = cleanNumber(input.budget) ?? cleanNumber(input.tokenBudget);
|
|
20
|
-
if (budget !== undefined) {
|
|
21
|
-
payload.budget = budget;
|
|
22
|
-
}
|
|
23
|
-
const ranking = cleanString(input.ranking) ?? cleanString(input.rankingProfile);
|
|
24
|
-
if (ranking) {
|
|
25
|
-
payload.ranking = ranking;
|
|
26
|
-
}
|
|
27
|
-
const limit = cleanNumber(input.limit);
|
|
28
|
-
if (limit !== undefined) {
|
|
29
|
-
payload.limit = limit;
|
|
30
|
-
}
|
|
31
|
-
const maxDepth = cleanNumber(input.maxDepth);
|
|
32
|
-
if (maxDepth !== undefined) {
|
|
33
|
-
payload.maxDepth = maxDepth;
|
|
34
|
-
}
|
|
35
|
-
const includeEntities = cleanBoolean(input.includeEntities);
|
|
36
|
-
if (includeEntities !== undefined) {
|
|
37
|
-
payload.includeEntities = includeEntities;
|
|
38
|
-
}
|
|
39
|
-
const mode = cleanString(input.mode);
|
|
40
|
-
if (mode) {
|
|
41
|
-
payload.mode = mode;
|
|
42
|
-
}
|
|
43
|
-
const includeFailures = cleanBoolean(input.includeFailures);
|
|
44
|
-
if (includeFailures !== undefined) {
|
|
45
|
-
payload.includeFailures = includeFailures;
|
|
46
|
-
}
|
|
47
|
-
const worktreeId = cleanString(input.worktreeId);
|
|
48
|
-
if (worktreeId) {
|
|
49
|
-
payload.worktreeId = worktreeId;
|
|
50
|
-
}
|
|
51
|
-
const sessionId = cleanString(input.sessionId);
|
|
52
|
-
if (sessionId) {
|
|
53
|
-
payload.sessionId = sessionId;
|
|
54
|
-
}
|
|
55
|
-
if (Array.isArray(input.packWeightOverrides) && input.packWeightOverrides.length > 0) {
|
|
56
|
-
payload.packWeightOverrides = input.packWeightOverrides;
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
path: "/api/platform/v1/context/compile",
|
|
60
|
-
method: "POST",
|
|
61
|
-
body: payload,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Create the context client for compiling reasoning context packs.
|
|
66
|
-
* @param config - Gateway transport configuration.
|
|
67
|
-
* @returns An object with a `compile` method for building context packs.
|
|
68
|
-
*/
|
|
69
|
-
export function createContextClient(config = {}) {
|
|
70
|
-
const gateway = createGatewayRequestClient(config);
|
|
71
|
-
return {
|
|
72
|
-
/**
|
|
73
|
-
* Compile a focused reasoning context pack for a topic scope.
|
|
74
|
-
* @param topicId - The topic to compile context for.
|
|
75
|
-
* @param input - Optional compile parameters (query, budget, ranking, etc.).
|
|
76
|
-
* @returns The compiled context payload with beliefs, questions, and evidence.
|
|
77
|
-
*/
|
|
78
|
-
async compile(topicId, input = {}) {
|
|
79
|
-
const request = buildCompileContextRequest(topicId, input);
|
|
80
|
-
return gateway.request({
|
|
81
|
-
...request,
|
|
82
|
-
body: request.body,
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { type ContextCompilationMode, type ContextPackV1, type PackWeightOverride, type ContextRankingProfile } from "./contracts/context-pack.contract";
|
|
2
|
-
import { resolveEffectiveWeights } from "../../convex-kernel/src/compat/contextPackPolicy";
|
|
3
|
-
export type ContextPackTopicRow = {
|
|
4
|
-
_id: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
parentTopicId?: string;
|
|
7
|
-
depth?: number;
|
|
8
|
-
status?: string;
|
|
9
|
-
updatedAt?: number;
|
|
10
|
-
createdAt?: number;
|
|
11
|
-
generatedAt?: number;
|
|
12
|
-
};
|
|
13
|
-
type ContextPackBeliefRow = {
|
|
14
|
-
_id: string;
|
|
15
|
-
canonicalText?: string;
|
|
16
|
-
confidence?: number;
|
|
17
|
-
beliefType?: string;
|
|
18
|
-
status?: string;
|
|
19
|
-
metadata?: Record<string, unknown>;
|
|
20
|
-
updatedAt?: number;
|
|
21
|
-
createdAt?: number;
|
|
22
|
-
};
|
|
23
|
-
type ContextPackQuestionRow = {
|
|
24
|
-
_id: string;
|
|
25
|
-
canonicalText?: string;
|
|
26
|
-
status?: string;
|
|
27
|
-
metadata?: Record<string, unknown>;
|
|
28
|
-
updatedAt?: number;
|
|
29
|
-
createdAt?: number;
|
|
30
|
-
};
|
|
31
|
-
type ContextPackEvidenceRow = {
|
|
32
|
-
_id: string;
|
|
33
|
-
canonicalText?: string;
|
|
34
|
-
sourceUrl?: string;
|
|
35
|
-
metadata?: Record<string, unknown>;
|
|
36
|
-
updatedAt?: number;
|
|
37
|
-
createdAt?: number;
|
|
38
|
-
};
|
|
39
|
-
type ContextPackContradictionRow = {
|
|
40
|
-
_id?: string;
|
|
41
|
-
globalId?: string;
|
|
42
|
-
weight?: number;
|
|
43
|
-
context?: string;
|
|
44
|
-
description?: string;
|
|
45
|
-
summary?: string;
|
|
46
|
-
updatedAt?: number;
|
|
47
|
-
createdAt?: number;
|
|
48
|
-
};
|
|
49
|
-
type ContextPackEntityRow = {
|
|
50
|
-
_id: string;
|
|
51
|
-
nodeType?: string;
|
|
52
|
-
title?: string;
|
|
53
|
-
canonicalText?: string;
|
|
54
|
-
connectedBeliefCount?: number;
|
|
55
|
-
connectedEvidenceCount?: number;
|
|
56
|
-
metadata?: Record<string, unknown>;
|
|
57
|
-
updatedAt?: number;
|
|
58
|
-
};
|
|
59
|
-
type ContextPackFailureRow = {
|
|
60
|
-
_id: string;
|
|
61
|
-
canonicalText?: string;
|
|
62
|
-
metadata?: Record<string, unknown>;
|
|
63
|
-
updatedAt?: number;
|
|
64
|
-
createdAt?: number;
|
|
65
|
-
};
|
|
66
|
-
export type CompileContextPackPlan = {
|
|
67
|
-
topicId: string;
|
|
68
|
-
queryText?: string;
|
|
69
|
-
tokens: string[];
|
|
70
|
-
limit: number;
|
|
71
|
-
rankingProfile: ContextRankingProfile;
|
|
72
|
-
tokenBudget: number;
|
|
73
|
-
descendantDepth: number;
|
|
74
|
-
includeEntities: boolean;
|
|
75
|
-
compilationMode: ContextCompilationMode;
|
|
76
|
-
includeFailures: boolean;
|
|
77
|
-
worktreeId?: string;
|
|
78
|
-
sessionId?: string;
|
|
79
|
-
packWeightOverrides?: PackWeightOverride[];
|
|
80
|
-
effectiveWeights: ReturnType<typeof resolveEffectiveWeights>;
|
|
81
|
-
scopedTopicIds: string[];
|
|
82
|
-
};
|
|
83
|
-
export type CompileContextPackPlanInput = {
|
|
84
|
-
args: Record<string, unknown> | undefined;
|
|
85
|
-
topic: ContextPackTopicRow;
|
|
86
|
-
allTopics: ContextPackTopicRow[];
|
|
87
|
-
};
|
|
88
|
-
export type CompileContextPackSnapshot = {
|
|
89
|
-
topic: ContextPackTopicRow;
|
|
90
|
-
plan: CompileContextPackPlan;
|
|
91
|
-
beliefs: ContextPackBeliefRow[];
|
|
92
|
-
questions: ContextPackQuestionRow[];
|
|
93
|
-
evidence: ContextPackEvidenceRow[];
|
|
94
|
-
contradictions: ContextPackContradictionRow[];
|
|
95
|
-
entities: ContextPackEntityRow[];
|
|
96
|
-
failures?: ContextPackFailureRow[];
|
|
97
|
-
};
|
|
98
|
-
export declare function planContextPackCompilation(input: CompileContextPackPlanInput): CompileContextPackPlan;
|
|
99
|
-
export declare function compileContextPackFromSnapshot(snapshot: CompileContextPackSnapshot): ContextPackV1;
|
|
100
|
-
export {};
|