@lucern/sdk 0.2.0-alpha.3 → 0.2.0-alpha.5
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 +615 -112
- package/dist/.generated +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -8894
- package/dist/lib/platform/auth/credentials.d.ts +5 -0
- package/dist/lib/platform/auth/credentials.js +40 -0
- package/dist/lib/platform/sdk/adminClient.d.ts +404 -0
- package/dist/lib/platform/sdk/adminClient.js +384 -0
- package/dist/lib/platform/sdk/answersClient.d.ts +16 -0
- package/dist/lib/platform/sdk/answersClient.js +21 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/audiencesClient.d.ts +6 -0
- package/dist/lib/platform/sdk/audiencesClient.js +111 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/auditClient.d.ts +3 -0
- package/dist/lib/platform/sdk/auditClient.js +21 -0
- package/dist/lib/platform/sdk/beliefsClient.d.ts +157 -0
- package/dist/lib/platform/sdk/beliefsClient.js +124 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/client.d.ts +957 -146
- package/dist/lib/platform/sdk/client.js +1831 -0
- package/dist/lib/platform/sdk/contextClient.d.ts +21 -0
- package/dist/lib/platform/sdk/contextClient.js +86 -0
- package/dist/{lucern/packages/domain-context/src/context-pack-compiler.d.ts → lib/platform/sdk/contextPackCompiler.d.ts} +2 -3
- package/dist/lib/platform/sdk/contextPackCompiler.js +534 -0
- package/dist/lib/platform/sdk/contextTypes.d.ts +133 -0
- package/dist/lib/platform/sdk/contextTypes.js +1 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/controlObjectOwnership.d.ts +15 -0
- package/dist/lib/platform/sdk/controlObjectOwnership.js +220 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/coreClient.d.ts +19 -0
- package/dist/lib/platform/sdk/coreClient.js +366 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/customTools.d.ts +21 -3
- package/dist/lib/platform/sdk/customTools.js +247 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/decisionsClient.d.ts +9 -0
- package/dist/lib/platform/sdk/decisionsClient.js +129 -0
- package/dist/lib/platform/sdk/domainContext.d.ts +1 -0
- package/dist/lib/platform/sdk/domainContext.js +1 -0
- package/dist/{lucern/packages/events/src/types.d.ts → lib/platform/sdk/events.d.ts} +25 -0
- package/dist/lib/platform/sdk/events.js +261 -0
- package/dist/lib/platform/sdk/gatewayFacades.d.ts +586 -0
- package/dist/lib/platform/sdk/gatewayFacades.js +845 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/graphClient.d.ts +75 -0
- package/dist/lib/platform/sdk/graphClient.js +235 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/harnessClient.d.ts +90 -1
- package/dist/lib/platform/sdk/harnessClient.js +219 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/identityClient.d.ts +45 -15
- package/dist/lib/platform/sdk/identityClient.js +131 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/index.d.ts +21 -3
- package/dist/lib/platform/sdk/index.js +46 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/learningClient.d.ts +3 -0
- package/dist/lib/platform/sdk/learningClient.js +53 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/mcpParityClient.d.ts +1 -0
- package/dist/lib/platform/sdk/mcpParityClient.js +196 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/mcpParitySurface.d.ts +2 -0
- package/dist/lib/platform/sdk/mcpParitySurface.js +57 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/ontologyClient.d.ts +16 -0
- package/dist/lib/platform/sdk/ontologyClient.js +161 -0
- package/dist/lib/platform/sdk/packRuntime.d.ts +1 -0
- package/dist/lib/platform/sdk/packRuntime.js +1 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/packsClient.d.ts +25 -0
- package/dist/lib/platform/sdk/packsClient.js +157 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/policyClient.d.ts +90 -1
- package/dist/lib/platform/sdk/policyClient.js +277 -0
- package/dist/lib/platform/sdk/promptCatalog.d.ts +1 -0
- package/dist/lib/platform/sdk/promptCatalog.js +1 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/reportsClient.d.ts +3 -0
- package/dist/lib/platform/sdk/reportsClient.js +64 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/schemaClient.d.ts +5 -0
- package/dist/lib/platform/sdk/schemaClient.js +71 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/sdkSurface.d.ts +1 -0
- package/dist/lib/platform/sdk/sdkSurface.js +140 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/topicsClient.d.ts +33 -0
- package/dist/lib/platform/sdk/topicsClient.js +118 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/types.d.ts +224 -2
- package/dist/lib/platform/sdk/types.js +1 -0
- package/dist/lib/platform/sdk/version.js +2 -0
- package/dist/{packages/sdk/src → lib/platform/sdk}/workflowClient.d.ts +63 -2
- package/dist/lib/platform/sdk/workflowClient.js +366 -0
- package/dist/lucern/contracts/src/api-enums.contract.d.ts +58 -0
- package/dist/lucern/contracts/src/api-enums.contract.js +147 -0
- package/dist/lucern/contracts/src/lens-filter.contract.js +95 -0
- package/dist/lucern/contracts/src/lens-workflow.contract.js +54 -0
- package/dist/lucern/contracts/src/mcp-tools.contract.js +3281 -0
- package/package.json +17 -3
- package/dist/index.js.map +0 -1
- package/dist/lucern/contracts/src/auth-session.contract.d.ts +0 -53
- package/dist/lucern/contracts/src/context-pack.contract.d.ts +0 -494
- package/dist/lucern/contracts/src/workflow-runtime.contract.d.ts +0 -161
- package/dist/lucern/mcp-server/src/context-pack-policy.d.ts +0 -119
- package/dist/lucern/mcp-server/src/context-pack-schema.d.ts +0 -18
- package/dist/lucern/modules/graph-primitives/src/ontology-matching.d.ts +0 -78
- package/dist/lucern/modules/graph-primitives/src/text-matching.d.ts +0 -53
- package/dist/lucern/packages/client-core/src/beliefs.d.ts +0 -30
- package/dist/lucern/packages/client-core/src/context.d.ts +0 -29
- package/dist/lucern/packages/client-core/src/contradictions.d.ts +0 -11
- package/dist/lucern/packages/client-core/src/edges.d.ts +0 -11
- package/dist/lucern/packages/client-core/src/events.d.ts +0 -9
- package/dist/lucern/packages/client-core/src/evidence.d.ts +0 -21
- package/dist/lucern/packages/client-core/src/graph.d.ts +0 -17
- package/dist/lucern/packages/client-core/src/identity.d.ts +0 -7
- package/dist/lucern/packages/client-core/src/ids.d.ts +0 -7
- package/dist/lucern/packages/client-core/src/ontologies.d.ts +0 -13
- package/dist/lucern/packages/client-core/src/questions.d.ts +0 -39
- package/dist/lucern/packages/client-core/src/search.d.ts +0 -7
- package/dist/lucern/packages/client-core/src/tasks.d.ts +0 -13
- package/dist/lucern/packages/client-core/src/topics.d.ts +0 -17
- package/dist/lucern/packages/client-core/src/webhooks.d.ts +0 -35
- package/dist/lucern/packages/client-core/src/worktrees.d.ts +0 -17
- package/dist/lucern/packages/domain-beliefs/src/beliefs.d.ts +0 -283
- package/dist/lucern/packages/domain-beliefs/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-context/src/compile.d.ts +0 -11
- package/dist/lucern/packages/domain-context/src/index.d.ts +0 -4
- package/dist/lucern/packages/domain-context/src/ports.d.ts +0 -58
- package/dist/lucern/packages/domain-context/src/public-types.d.ts +0 -1
- package/dist/lucern/packages/domain-edges/src/contradictions.d.ts +0 -59
- package/dist/lucern/packages/domain-edges/src/edges.d.ts +0 -91
- package/dist/lucern/packages/domain-edges/src/index.d.ts +0 -2
- package/dist/lucern/packages/domain-evidence/src/evidence.d.ts +0 -115
- package/dist/lucern/packages/domain-evidence/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-graph/src/graph.d.ts +0 -150
- package/dist/lucern/packages/domain-identity/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-identity/src/whoami.d.ts +0 -13
- package/dist/lucern/packages/domain-ontologies/src/ontologies.d.ts +0 -123
- package/dist/lucern/packages/domain-questions/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-questions/src/questions.d.ts +0 -147
- package/dist/lucern/packages/domain-search/src/search.d.ts +0 -97
- package/dist/lucern/packages/domain-tasks/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-tasks/src/tasks.d.ts +0 -102
- package/dist/lucern/packages/domain-topics/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-topics/src/topics.d.ts +0 -147
- package/dist/lucern/packages/domain-worktrees/src/index.d.ts +0 -1
- package/dist/lucern/packages/domain-worktrees/src/worktrees.d.ts +0 -185
- package/dist/lucern/packages/events/src/index.d.ts +0 -4
- package/dist/lucern/packages/events/src/matching.d.ts +0 -3
- package/dist/lucern/packages/events/src/outbox.d.ts +0 -15
- package/dist/lucern/packages/events/src/webhooks.d.ts +0 -9
- package/dist/lucern/packages/sdk-typescript/src/facade/beliefs.d.ts +0 -15
- package/dist/lucern/packages/sdk-typescript/src/facade/context.d.ts +0 -12
- package/dist/lucern/packages/sdk-typescript/src/facade/contradictions.d.ts +0 -7
- package/dist/lucern/packages/sdk-typescript/src/facade/edges.d.ts +0 -7
- package/dist/lucern/packages/sdk-typescript/src/facade/events.d.ts +0 -6
- package/dist/lucern/packages/sdk-typescript/src/facade/evidence.d.ts +0 -21
- package/dist/lucern/packages/sdk-typescript/src/facade/graph.d.ts +0 -10
- package/dist/lucern/packages/sdk-typescript/src/facade/identity.d.ts +0 -5
- package/dist/lucern/packages/sdk-typescript/src/facade/ontologies.d.ts +0 -8
- package/dist/lucern/packages/sdk-typescript/src/facade/questions.d.ts +0 -39
- package/dist/lucern/packages/sdk-typescript/src/facade/search.d.ts +0 -5
- package/dist/lucern/packages/sdk-typescript/src/facade/tasks.d.ts +0 -8
- package/dist/lucern/packages/sdk-typescript/src/facade/topics.d.ts +0 -10
- package/dist/lucern/packages/sdk-typescript/src/facade/webhooks.d.ts +0 -16
- package/dist/lucern/packages/sdk-typescript/src/facade/worktrees.d.ts +0 -10
- package/dist/lucern/packages/sdk-typescript/src/index.d.ts +0 -28
- package/dist/packages/sdk/src/adminClient.d.ts +0 -89
- package/dist/packages/sdk/src/answersClient.d.ts +0 -5
- package/dist/packages/sdk/src/beliefsClient.d.ts +0 -52
- package/dist/packages/sdk/src/contextClient.d.ts +0 -9
- package/dist/packages/sdk/src/contracts/api-enums.contract.d.ts +0 -79
- /package/dist/{packages/sdk/src → lib/platform/sdk}/version.d.ts +0 -0
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow Runtime Contract v1
|
|
3
|
-
*
|
|
4
|
-
* Canonical TypeScript contract for Lucern's graph-local workflow runtime.
|
|
5
|
-
* WF-1 defines the typed substrate for:
|
|
6
|
-
* - workflow definitions and run receipts
|
|
7
|
-
* - action mutation tiering and approval expectations
|
|
8
|
-
* - hooks over worktree/question/evidence/inbox events
|
|
9
|
-
* - output unions for domain-specific artifacts
|
|
10
|
-
* - deterministic integrity checks and operational metadata
|
|
11
|
-
*
|
|
12
|
-
* BREAKING CHANGE RULES:
|
|
13
|
-
* - Adding optional fields is NON-breaking
|
|
14
|
-
* - Removing fields or renaming enum values is BREAKING
|
|
15
|
-
* - Reclassifying a mutation tier is BREAKING
|
|
16
|
-
* - Changing canonical workflow IDs is BREAKING
|
|
17
|
-
*/
|
|
18
|
-
export declare const WORKFLOW_RUNTIME_SCHEMA_VERSION: "1.0.0";
|
|
19
|
-
export declare const WORKFLOW_MUTATION_TIERS: readonly ["read_only", "low_risk_write", "high_risk_write"];
|
|
20
|
-
export type WorkflowMutationTier = (typeof WORKFLOW_MUTATION_TIERS)[number];
|
|
21
|
-
export declare const WORKFLOW_APPROVAL_MODES: readonly ["none", "audit_only", "human_required", "auto_approve"];
|
|
22
|
-
export type WorkflowApprovalMode = (typeof WORKFLOW_APPROVAL_MODES)[number];
|
|
23
|
-
export declare const DEFAULT_TIER_APPROVAL_MODE: Readonly<Record<WorkflowMutationTier, WorkflowApprovalMode>>;
|
|
24
|
-
export declare const WORKFLOW_ACTION_KINDS: readonly ["context_pack", "integrity_check", "lucern_tool", "report_compile", "brief_publish", "notification", "custom"];
|
|
25
|
-
export type WorkflowActionKind = (typeof WORKFLOW_ACTION_KINDS)[number];
|
|
26
|
-
export declare const WORKFLOW_HOOK_EVENTS: readonly ["schedule.tick", "worktree.activated", "worktree.completed", "question.created", "question.answered", "evidence.appended", "inbox.item_created"];
|
|
27
|
-
export type WorkflowHookEvent = (typeof WORKFLOW_HOOK_EVENTS)[number];
|
|
28
|
-
export declare const WORKFLOW_OUTPUT_KINDS: readonly ["engineering_brief", "research_memo", "strategy_artifact", "inbox_summary", "pipeline_brief", "structured_payload"];
|
|
29
|
-
export type WorkflowOutputKind = (typeof WORKFLOW_OUTPUT_KINDS)[number];
|
|
30
|
-
export declare const WORKFLOW_RUN_STATUSES: readonly ["queued", "running", "awaiting_approval", "completed", "failed", "cancelled"];
|
|
31
|
-
export type WorkflowRunStatus = (typeof WORKFLOW_RUN_STATUSES)[number];
|
|
32
|
-
export declare const WORKFLOW_TRIGGER_KINDS: readonly ["manual", "schedule", "hook"];
|
|
33
|
-
export type WorkflowTriggerKind = (typeof WORKFLOW_TRIGGER_KINDS)[number];
|
|
34
|
-
export declare const WORKFLOW_PROOF_ARTIFACT_KINDS: readonly ["report", "brief", "artifact", "dashboard", "test_evidence"];
|
|
35
|
-
export type WorkflowProofArtifactKind = (typeof WORKFLOW_PROOF_ARTIFACT_KINDS)[number];
|
|
36
|
-
export declare const WORKFLOW_STAFFING_HINTS: readonly ["solo", "backend+tests", "fullstack", "mcp+tests"];
|
|
37
|
-
export type WorkflowStaffingHint = (typeof WORKFLOW_STAFFING_HINTS)[number];
|
|
38
|
-
export declare const WORKFLOW_AUTO_FIX_MODES: readonly ["disabled", "dry_run", "safe", "aggressive"];
|
|
39
|
-
export type WorkflowAutoFixMode = (typeof WORKFLOW_AUTO_FIX_MODES)[number];
|
|
40
|
-
export declare const WORKFLOW_INTEGRITY_CHECKS: readonly ["null_dependency_refs", "superseded_blockers", "band_order_inconsistency", "sparse_shaping", "failed_completed_gate"];
|
|
41
|
-
export type WorkflowIntegrityCheckId = (typeof WORKFLOW_INTEGRITY_CHECKS)[number];
|
|
42
|
-
export type WorkflowProofArtifact = {
|
|
43
|
-
kind: WorkflowProofArtifactKind;
|
|
44
|
-
label: string;
|
|
45
|
-
required?: boolean;
|
|
46
|
-
sourceRef?: string;
|
|
47
|
-
};
|
|
48
|
-
export type WorkflowAutoFixPolicy = {
|
|
49
|
-
mode: WorkflowAutoFixMode;
|
|
50
|
-
maxActionsPerRun?: number;
|
|
51
|
-
permittedMutationTiers?: WorkflowMutationTier[];
|
|
52
|
-
requireAuditTrail?: boolean;
|
|
53
|
-
escalationGate?: string;
|
|
54
|
-
};
|
|
55
|
-
export declare const DEFAULT_WORKFLOW_AUTO_FIX_POLICY: WorkflowAutoFixPolicy;
|
|
56
|
-
export type WorkflowApprovalPolicy = {
|
|
57
|
-
mode: WorkflowApprovalMode;
|
|
58
|
-
approvalGate?: string;
|
|
59
|
-
autoApprovePolicyKey?: string;
|
|
60
|
-
rationaleRequired?: boolean;
|
|
61
|
-
};
|
|
62
|
-
export type WorkflowOutputBase = {
|
|
63
|
-
outputId: string;
|
|
64
|
-
kind: WorkflowOutputKind;
|
|
65
|
-
title: string;
|
|
66
|
-
summary: string;
|
|
67
|
-
generatedAt?: number;
|
|
68
|
-
};
|
|
69
|
-
export type EngineeringBriefOutput = WorkflowOutputBase & {
|
|
70
|
-
kind: "engineering_brief";
|
|
71
|
-
sections: Array<{
|
|
72
|
-
heading: string;
|
|
73
|
-
body: string;
|
|
74
|
-
}>;
|
|
75
|
-
touchedPaths?: string[];
|
|
76
|
-
};
|
|
77
|
-
export type ResearchMemoOutput = WorkflowOutputBase & {
|
|
78
|
-
kind: "research_memo";
|
|
79
|
-
claims: string[];
|
|
80
|
-
evidenceRefs?: string[];
|
|
81
|
-
};
|
|
82
|
-
export type StrategyArtifactOutput = WorkflowOutputBase & {
|
|
83
|
-
kind: "strategy_artifact";
|
|
84
|
-
recommendations: string[];
|
|
85
|
-
decisionWindow?: string;
|
|
86
|
-
};
|
|
87
|
-
export type InboxSummaryOutput = WorkflowOutputBase & {
|
|
88
|
-
kind: "inbox_summary";
|
|
89
|
-
channel: "developer_portal" | "chat" | "ops";
|
|
90
|
-
inboxTitle: string;
|
|
91
|
-
inboxBody: string;
|
|
92
|
-
};
|
|
93
|
-
export type PipelineBriefOutput = WorkflowOutputBase & {
|
|
94
|
-
kind: "pipeline_brief";
|
|
95
|
-
hingeWorktreeId?: string;
|
|
96
|
-
groupedBlockers: Array<{
|
|
97
|
-
blocker: string;
|
|
98
|
-
blockedWorktreeIds: string[];
|
|
99
|
-
}>;
|
|
100
|
-
};
|
|
101
|
-
export type StructuredPayloadOutput = WorkflowOutputBase & {
|
|
102
|
-
kind: "structured_payload";
|
|
103
|
-
payload: Record<string, unknown>;
|
|
104
|
-
};
|
|
105
|
-
export type WorkflowOutputContract = EngineeringBriefOutput | ResearchMemoOutput | StrategyArtifactOutput | InboxSummaryOutput | PipelineBriefOutput | StructuredPayloadOutput;
|
|
106
|
-
export type WorkflowActionContract = {
|
|
107
|
-
actionId: string;
|
|
108
|
-
kind: WorkflowActionKind;
|
|
109
|
-
title: string;
|
|
110
|
-
description: string;
|
|
111
|
-
mutationTier: WorkflowMutationTier;
|
|
112
|
-
toolName?: string;
|
|
113
|
-
produces?: WorkflowOutputKind[];
|
|
114
|
-
idempotent?: boolean;
|
|
115
|
-
approval: WorkflowApprovalPolicy;
|
|
116
|
-
};
|
|
117
|
-
export type WorkflowHookContract = {
|
|
118
|
-
hookId: string;
|
|
119
|
-
event: WorkflowHookEvent;
|
|
120
|
-
description: string;
|
|
121
|
-
condition?: string;
|
|
122
|
-
actionIds: string[];
|
|
123
|
-
};
|
|
124
|
-
export type WorkflowTriggerContract = {
|
|
125
|
-
kind: "manual";
|
|
126
|
-
description?: string;
|
|
127
|
-
} | {
|
|
128
|
-
kind: "schedule";
|
|
129
|
-
cadence: "hourly" | "daily" | "weekly";
|
|
130
|
-
timezone?: string;
|
|
131
|
-
} | {
|
|
132
|
-
kind: "hook";
|
|
133
|
-
event: WorkflowHookEvent;
|
|
134
|
-
};
|
|
135
|
-
export type WorkflowDefinitionV1 = {
|
|
136
|
-
workflowId: string;
|
|
137
|
-
version: typeof WORKFLOW_RUNTIME_SCHEMA_VERSION;
|
|
138
|
-
title: string;
|
|
139
|
-
description: string;
|
|
140
|
-
trigger: WorkflowTriggerContract;
|
|
141
|
-
staffingHint?: WorkflowStaffingHint;
|
|
142
|
-
proofArtifacts?: WorkflowProofArtifact[];
|
|
143
|
-
autoFixPolicy?: WorkflowAutoFixPolicy;
|
|
144
|
-
actions: readonly WorkflowActionContract[];
|
|
145
|
-
hooks?: readonly WorkflowHookContract[];
|
|
146
|
-
outputs: readonly WorkflowOutputKind[];
|
|
147
|
-
integrityChecks?: readonly WorkflowIntegrityCheckId[];
|
|
148
|
-
};
|
|
149
|
-
export type WorkflowRunReceiptV1 = {
|
|
150
|
-
runId: string;
|
|
151
|
-
workflowId: string;
|
|
152
|
-
status: WorkflowRunStatus;
|
|
153
|
-
triggeredBy: WorkflowTriggerKind;
|
|
154
|
-
startedAt: number;
|
|
155
|
-
completedAt?: number;
|
|
156
|
-
outputKinds: WorkflowOutputKind[];
|
|
157
|
-
approvalsRequired?: number;
|
|
158
|
-
};
|
|
159
|
-
export declare const NIGHTLY_RECONCILIATION_WORKFLOW_ID: "workflow.pipeline_reconciliation.v1";
|
|
160
|
-
export declare const MORNING_BRIEF_WORKFLOW_ID: "workflow.morning_brief.v1";
|
|
161
|
-
export declare const CANONICAL_WORKFLOW_DEFINITIONS: readonly WorkflowDefinitionV1[];
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context-Pack Ranking and Injection Policy
|
|
3
|
-
*
|
|
4
|
-
* Implements the ranking algorithm and token-budget injection planner
|
|
5
|
-
* for context pack assembly. All tunable constants are imported from
|
|
6
|
-
* the canonical contract at lucern/contracts/src/context-pack.contract.ts.
|
|
7
|
-
*/
|
|
8
|
-
import { type ContextPackSectionKey, type ContextRankingProfile, type PackWeightOverride, type RankingWeightVector } from "../../contracts/src/context-pack.contract.js";
|
|
9
|
-
export type SectionKey = ContextPackSectionKey;
|
|
10
|
-
export type RankCandidate = {
|
|
11
|
-
id: string;
|
|
12
|
-
text: string;
|
|
13
|
-
updatedAt?: number | null;
|
|
14
|
-
createdAt?: number | null;
|
|
15
|
-
confidence?: number | null;
|
|
16
|
-
beliefType?: string | null;
|
|
17
|
-
priority?: string | null;
|
|
18
|
-
severity?: string | null;
|
|
19
|
-
};
|
|
20
|
-
export type RankedCandidate<T extends RankCandidate> = T & {
|
|
21
|
-
score: number;
|
|
22
|
-
/** Human-readable justification for the ranking (RS-2). */
|
|
23
|
-
justification?: string;
|
|
24
|
-
};
|
|
25
|
-
/** An item excluded from the injection plan (RS-2). */
|
|
26
|
-
export type ExcludedItem = {
|
|
27
|
-
id: string;
|
|
28
|
-
section: SectionKey;
|
|
29
|
-
reason: "budget_exceeded" | "anti_repetition" | "below_threshold";
|
|
30
|
-
score: number;
|
|
31
|
-
};
|
|
32
|
-
export type InjectionPlan = {
|
|
33
|
-
tokenBudget: number;
|
|
34
|
-
estimatedTokens: number;
|
|
35
|
-
sectionBudgets: Record<SectionKey, number>;
|
|
36
|
-
sectionUsage: Record<SectionKey, number>;
|
|
37
|
-
selected: Record<SectionKey, string[]>;
|
|
38
|
-
/** Items excluded from injection with reasons (RS-2). */
|
|
39
|
-
excludedItems?: ExcludedItem[];
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Resolve effective ranking weights by merging overrides onto defaults.
|
|
43
|
-
* Overrides are partial — only specified fields replace defaults.
|
|
44
|
-
*/
|
|
45
|
-
export declare function resolveEffectiveWeights(overrides?: PackWeightOverride[]): Readonly<Record<ContextPackSectionKey, RankingWeightVector>>;
|
|
46
|
-
/**
|
|
47
|
-
* Filter out candidates whose IDs appear in the suppression set.
|
|
48
|
-
* Returns the filtered list and the IDs that were suppressed.
|
|
49
|
-
*/
|
|
50
|
-
export declare function applySuppression<T extends RankCandidate>(candidates: T[], suppressedIds: ReadonlySet<string>): {
|
|
51
|
-
filtered: T[];
|
|
52
|
-
suppressed: string[];
|
|
53
|
-
};
|
|
54
|
-
/** Options for RS-2 enhanced ranking. */
|
|
55
|
-
export type RankContextOptions = {
|
|
56
|
-
/** Pack weight overrides from domain pack binding. */
|
|
57
|
-
effectiveWeights?: Readonly<Record<ContextPackSectionKey, RankingWeightVector>>;
|
|
58
|
-
/** Generate human-readable justifications for each ranked item. */
|
|
59
|
-
includeJustifications?: boolean;
|
|
60
|
-
/** Stable timestamp anchor for recency scoring when compilation must be deterministic. */
|
|
61
|
-
referenceTimeMs?: number;
|
|
62
|
-
};
|
|
63
|
-
export declare function rankContextSection<T extends RankCandidate>(section: SectionKey, rows: T[], queryTokens: string[], limit: number, profile: ContextRankingProfile, options?: RankContextOptions): RankedCandidate<T>[];
|
|
64
|
-
export declare function parseTokenBudget(value: unknown, fallback?: number): number;
|
|
65
|
-
export declare function buildInjectionPlan(args: {
|
|
66
|
-
tokenBudget: number;
|
|
67
|
-
invariants: Array<{
|
|
68
|
-
nodeId: string;
|
|
69
|
-
canonicalText: string;
|
|
70
|
-
score?: number;
|
|
71
|
-
}>;
|
|
72
|
-
activeBeliefs: Array<{
|
|
73
|
-
nodeId: string;
|
|
74
|
-
canonicalText: string;
|
|
75
|
-
score?: number;
|
|
76
|
-
}>;
|
|
77
|
-
openQuestions: Array<{
|
|
78
|
-
questionId: string;
|
|
79
|
-
text: string;
|
|
80
|
-
score?: number;
|
|
81
|
-
}>;
|
|
82
|
-
recentEvidence: Array<{
|
|
83
|
-
nodeId: string;
|
|
84
|
-
canonicalText: string;
|
|
85
|
-
score?: number;
|
|
86
|
-
}>;
|
|
87
|
-
contradictions: Array<{
|
|
88
|
-
contradictionId: string;
|
|
89
|
-
description: string;
|
|
90
|
-
score?: number;
|
|
91
|
-
}>;
|
|
92
|
-
/** Track excluded items with reasons (RS-2). */
|
|
93
|
-
trackExclusions?: boolean;
|
|
94
|
-
}): InjectionPlan;
|
|
95
|
-
/**
|
|
96
|
-
* Candidate for entity ranking in the context pack.
|
|
97
|
-
* Entities are ranked separately from the token-budgeted sections.
|
|
98
|
-
*/
|
|
99
|
-
export type EntityCandidate = {
|
|
100
|
-
nodeId: string;
|
|
101
|
-
entityType: string;
|
|
102
|
-
title: string;
|
|
103
|
-
canonicalText: string;
|
|
104
|
-
connectedBeliefCount: number;
|
|
105
|
-
connectedEvidenceCount: number;
|
|
106
|
-
metadata: Record<string, unknown>;
|
|
107
|
-
updatedAt?: number | null;
|
|
108
|
-
};
|
|
109
|
-
export type RankedEntity = EntityCandidate & {
|
|
110
|
-
score: number;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Rank entities by query relevance + connectivity.
|
|
114
|
-
*
|
|
115
|
-
* Uses ENTITY_RANKING_WEIGHTS: { query: 0.4, connectivity: 0.6 }
|
|
116
|
-
* - query: Token-hit scoring against the focus query
|
|
117
|
-
* - connectivity: Normalized count of connected beliefs + evidence
|
|
118
|
-
*/
|
|
119
|
-
export declare function rankEntities(candidates: EntityCandidate[], queryTokens: string[], limit?: number): RankedEntity[];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context-Pack Schema Validation
|
|
3
|
-
*
|
|
4
|
-
* Runtime validator for ContextPackV1 output. Types and constants are
|
|
5
|
-
* imported from the canonical contract at lucern/contracts/src/context-pack.contract.ts.
|
|
6
|
-
*
|
|
7
|
-
* This module is intentionally thin: it re-exports the contract types and provides
|
|
8
|
-
* runtime validation that the contract cannot enforce (since TypeScript types
|
|
9
|
-
* are erased at runtime).
|
|
10
|
-
*/
|
|
11
|
-
import { CONTEXT_PACK_SCHEMA_VERSION, type ContextRankingProfile } from "../../contracts/src/context-pack.contract.js";
|
|
12
|
-
export { CONTEXT_PACK_SCHEMA_VERSION, type ContextRankingProfile };
|
|
13
|
-
type ValidationResult = {
|
|
14
|
-
valid: boolean;
|
|
15
|
-
errors: string[];
|
|
16
|
-
};
|
|
17
|
-
export declare function validateContextPackSchema(payload: unknown): ValidationResult;
|
|
18
|
-
export declare function assertContextPackSchema(payload: unknown): void;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ontology Matching Engine — L0 entity type classification and similarity scoring.
|
|
3
|
-
*
|
|
4
|
-
* Provides bigram-based text similarity for matching free text against
|
|
5
|
-
* ontology entity types. Domain-agnostic: works identically for companies,
|
|
6
|
-
* molecules, code modules, or any tenant-defined entity vocabulary.
|
|
7
|
-
*
|
|
8
|
-
* Used by:
|
|
9
|
-
* - match_entity_type MCP handler (classify new entities)
|
|
10
|
-
* - discover_entity_connections MCP handler (suggest missing bridge edges)
|
|
11
|
-
*
|
|
12
|
-
* @module graph-primitives/ontology-matching
|
|
13
|
-
*/
|
|
14
|
-
/** An entity type definition from a resolved ontology version. */
|
|
15
|
-
export type OntologyEntityType = {
|
|
16
|
-
value: string;
|
|
17
|
-
label: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
subtypes?: Array<{
|
|
20
|
-
value: string;
|
|
21
|
-
label: string;
|
|
22
|
-
description?: string;
|
|
23
|
-
}>;
|
|
24
|
-
};
|
|
25
|
-
/** A scored match between input text and an entity type. */
|
|
26
|
-
export type EntityTypeMatch = {
|
|
27
|
-
entityType: string;
|
|
28
|
-
label: string;
|
|
29
|
-
score: number;
|
|
30
|
-
reason: string;
|
|
31
|
-
};
|
|
32
|
-
/** A candidate entity node that can be matched against a target node. */
|
|
33
|
-
export type EntityMatchCandidate = {
|
|
34
|
-
nodeId: string;
|
|
35
|
-
entityType: string;
|
|
36
|
-
title: string;
|
|
37
|
-
canonicalText: string;
|
|
38
|
-
connectedBeliefCount: number;
|
|
39
|
-
connectedEvidenceCount: number;
|
|
40
|
-
};
|
|
41
|
-
/** A scored entity match with suggested bridge edge type. */
|
|
42
|
-
export type EntityConnectionMatch = {
|
|
43
|
-
entityNodeId: string;
|
|
44
|
-
entityType: string;
|
|
45
|
-
title: string;
|
|
46
|
-
score: number;
|
|
47
|
-
suggestedEdgeType: string;
|
|
48
|
-
reason: string;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Score how well input text matches a single entity type definition.
|
|
52
|
-
* Combines bigram Jaccard similarity, word overlap, and description matching.
|
|
53
|
-
*/
|
|
54
|
-
export declare function scoreEntityTypeMatch(inputText: string, entityType: OntologyEntityType): EntityTypeMatch;
|
|
55
|
-
/**
|
|
56
|
-
* Rank all entity types in an ontology against input text.
|
|
57
|
-
* Returns matches sorted by score (descending), filtered to score > minScore.
|
|
58
|
-
*/
|
|
59
|
-
export declare function rankEntityTypeMatches(inputText: string, entityTypes: OntologyEntityType[], options?: {
|
|
60
|
-
minScore?: number;
|
|
61
|
-
limit?: number;
|
|
62
|
-
}): EntityTypeMatch[];
|
|
63
|
-
/**
|
|
64
|
-
* Score how well a node's text matches an entity candidate.
|
|
65
|
-
* Used by discover_entity_connections to suggest missing bridge edges.
|
|
66
|
-
*/
|
|
67
|
-
export declare function scoreEntityConnection(nodeText: string, candidate: EntityMatchCandidate, options?: {
|
|
68
|
-
connectivityWeight?: number;
|
|
69
|
-
}): EntityConnectionMatch;
|
|
70
|
-
/**
|
|
71
|
-
* Rank entity candidates against a node's text.
|
|
72
|
-
* Returns sorted matches above the minimum score threshold.
|
|
73
|
-
*/
|
|
74
|
-
export declare function rankEntityConnections(nodeText: string, candidates: EntityMatchCandidate[], options?: {
|
|
75
|
-
minScore?: number;
|
|
76
|
-
limit?: number;
|
|
77
|
-
connectivityWeight?: number;
|
|
78
|
-
}): EntityConnectionMatch[];
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared lexical matching primitives used across MCP handlers and graph utilities.
|
|
3
|
-
*
|
|
4
|
-
* The goal is not to replace downstream LLM scoring. It provides a fast,
|
|
5
|
-
* deterministic substrate for candidate generation, reranking, and light
|
|
6
|
-
* classification across belief/question/evidence/entity surfaces.
|
|
7
|
-
*/
|
|
8
|
-
export type LexicalStrategy = "tokenOverlap" | "bigramJaccard" | "wordOverlap";
|
|
9
|
-
export type PreparedLexicalQuery = {
|
|
10
|
-
raw: string;
|
|
11
|
-
tokens: string[];
|
|
12
|
-
words: string[];
|
|
13
|
-
bigrams: Set<string>;
|
|
14
|
-
};
|
|
15
|
-
export type LexicalSignal = {
|
|
16
|
-
strategy?: LexicalStrategy;
|
|
17
|
-
text: string | null | undefined;
|
|
18
|
-
weight: number;
|
|
19
|
-
};
|
|
20
|
-
export type LexicalRerankOptions = {
|
|
21
|
-
lexicalWeight?: number;
|
|
22
|
-
rankWeight?: number;
|
|
23
|
-
};
|
|
24
|
-
/** Tokenize a string into lowercase words, removing stop words. */
|
|
25
|
-
export declare function tokenizeSearchText(text: string): string[];
|
|
26
|
-
/** Simple stemmer: strip common English suffixes for fuzzy matching. */
|
|
27
|
-
export declare function stemToken(word: string): string;
|
|
28
|
-
/** Compute token overlap score between query tokens and text tokens. */
|
|
29
|
-
export declare function tokenOverlapScore(queryTokens: string[], textTokens: string[]): number;
|
|
30
|
-
/**
|
|
31
|
-
* Extract character bigrams from text. Normalizes to lowercase, removes
|
|
32
|
-
* non-alphanumeric characters, and generates overlapping pairs.
|
|
33
|
-
*/
|
|
34
|
-
export declare function bigramTokenize(text: string): Set<string>;
|
|
35
|
-
/**
|
|
36
|
-
* Extract word-level tokens from text (for coarser matching).
|
|
37
|
-
* Normalizes to lowercase, splits on non-alphanumeric.
|
|
38
|
-
*/
|
|
39
|
-
export declare function wordTokenize(text: string): string[];
|
|
40
|
-
/** Jaccard similarity between two sets: |A ∩ B| / |A ∪ B|. */
|
|
41
|
-
export declare function jaccardSimilarity(setA: Set<string>, setB: Set<string>): number;
|
|
42
|
-
/** Exact word overlap score: fraction of type words found in input text. */
|
|
43
|
-
export declare function wordOverlapScore(inputWords: string[], typeWords: string[]): number;
|
|
44
|
-
/** Pre-compute reusable lexical structures for a query. */
|
|
45
|
-
export declare function prepareLexicalQuery(query: string): PreparedLexicalQuery;
|
|
46
|
-
/** Score a single lexical signal against a prepared query. */
|
|
47
|
-
export declare function scoreLexicalSignal(query: PreparedLexicalQuery, signal: LexicalSignal): number;
|
|
48
|
-
/** Weighted lexical score across multiple textual signals. */
|
|
49
|
-
export declare function scoreLexicalSignals(query: PreparedLexicalQuery, signals: LexicalSignal[]): number;
|
|
50
|
-
/** Map a candidate's original rank position into a 0..1 prior. */
|
|
51
|
-
export declare function rankWindowScore(index: number, total: number): number;
|
|
52
|
-
/** Rerank a candidate window by lexical overlap while preserving original-rank prior. */
|
|
53
|
-
export declare function rerankLexicalWindow<T>(query: string, items: T[], getText: (item: T) => string | null | undefined, options?: LexicalRerankOptions): T[];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { ArchiveBeliefInput, BeliefArchiveResult, BeliefBisectResult, BeliefConfidenceHistoryResult, BeliefConfidenceUpdateResult, BeliefContractCreateInput, BeliefContractCreateResult, BeliefLineageResult, BeliefListResult, BeliefRefineInput, BeliefRecord, BisectBeliefConfidenceInput, CreateBeliefInput, ForkBeliefInput, ListBeliefsQuery, UpdateBeliefConfidenceInput } from "@/lucern/packages/domain-beliefs/src/beliefs";
|
|
3
|
-
export type BeliefsClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type BeliefsGetResponse = PlatformGatewaySuccess<BeliefRecord>;
|
|
5
|
-
export type BeliefsCreateResponse = PlatformGatewaySuccess<BeliefRecord>;
|
|
6
|
-
export type BeliefsListResponse = PlatformGatewaySuccess<BeliefListResult>;
|
|
7
|
-
export type BeliefsRefineResponse = PlatformGatewaySuccess<BeliefRecord>;
|
|
8
|
-
export type BeliefsForkResponse = PlatformGatewaySuccess<BeliefRecord & {
|
|
9
|
-
parentBeliefId: string;
|
|
10
|
-
forkReason: string;
|
|
11
|
-
}>;
|
|
12
|
-
export type BeliefsUpdateConfidenceResponse = PlatformGatewaySuccess<BeliefConfidenceUpdateResult>;
|
|
13
|
-
export type BeliefsArchiveResponse = PlatformGatewaySuccess<BeliefArchiveResult>;
|
|
14
|
-
export type BeliefsLineageResponse = PlatformGatewaySuccess<BeliefLineageResult>;
|
|
15
|
-
export type BeliefsConfidenceHistoryResponse = PlatformGatewaySuccess<BeliefConfidenceHistoryResult>;
|
|
16
|
-
export type BeliefsCreateContractResponse = PlatformGatewaySuccess<BeliefContractCreateResult>;
|
|
17
|
-
export type BeliefsBisectResponse = PlatformGatewaySuccess<BeliefBisectResult>;
|
|
18
|
-
export declare function createBeliefsClientCore(config?: BeliefsClientCoreConfig): {
|
|
19
|
-
create(input: CreateBeliefInput, idempotencyKey?: string): Promise<BeliefsCreateResponse>;
|
|
20
|
-
get(id: string): Promise<BeliefsGetResponse>;
|
|
21
|
-
list(query: ListBeliefsQuery): Promise<BeliefsListResponse>;
|
|
22
|
-
refine(id: string, input: Omit<BeliefRefineInput, "id">, idempotencyKey?: string): Promise<BeliefsRefineResponse>;
|
|
23
|
-
fork(id: string, input: Omit<ForkBeliefInput, "id">, idempotencyKey?: string): Promise<BeliefsForkResponse>;
|
|
24
|
-
updateConfidence(id: string, input: Omit<UpdateBeliefConfidenceInput, "id">, idempotencyKey?: string): Promise<BeliefsUpdateConfidenceResponse>;
|
|
25
|
-
archive(id: string, input?: Omit<ArchiveBeliefInput, "id">, idempotencyKey?: string): Promise<BeliefsArchiveResponse>;
|
|
26
|
-
lineage(id: string): Promise<BeliefsLineageResponse>;
|
|
27
|
-
confidenceHistory(id: string): Promise<BeliefsConfidenceHistoryResponse>;
|
|
28
|
-
createContract(id: string, input: BeliefContractCreateInput, idempotencyKey?: string): Promise<BeliefsCreateContractResponse>;
|
|
29
|
-
bisect(id: string, input: Omit<BisectBeliefConfidenceInput, "id">, idempotencyKey?: string): Promise<BeliefsBisectResponse>;
|
|
30
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ContextCompilationMode, ContextRankingProfile, PackWeightOverride } from "../../../contracts/src/context-pack.contract";
|
|
2
|
-
export type CompileContextInput = {
|
|
3
|
-
query?: string;
|
|
4
|
-
budget?: number;
|
|
5
|
-
ranking?: ContextRankingProfile;
|
|
6
|
-
limit?: number;
|
|
7
|
-
maxDepth?: number;
|
|
8
|
-
includeEntities?: boolean;
|
|
9
|
-
mode?: ContextCompilationMode;
|
|
10
|
-
includeFailures?: boolean;
|
|
11
|
-
worktreeId?: string;
|
|
12
|
-
sessionId?: string;
|
|
13
|
-
packWeightOverrides?: PackWeightOverride[];
|
|
14
|
-
/** @deprecated Use budget. */
|
|
15
|
-
tokenBudget?: number;
|
|
16
|
-
/** @deprecated Use ranking. */
|
|
17
|
-
rankingProfile?: ContextRankingProfile;
|
|
18
|
-
};
|
|
19
|
-
export type ContextClientRequest = {
|
|
20
|
-
path: "/api/platform/v1/context/compile";
|
|
21
|
-
method: "POST";
|
|
22
|
-
body: Record<string, unknown>;
|
|
23
|
-
};
|
|
24
|
-
export declare function buildCompileContextRequest(topicId: string, input?: CompileContextInput): ContextClientRequest;
|
|
25
|
-
export declare function createContextClientCore<TResult>(deps: {
|
|
26
|
-
execute(request: ContextClientRequest): Promise<TResult>;
|
|
27
|
-
}): {
|
|
28
|
-
compile(topicId: string, input?: CompileContextInput): Promise<TResult>;
|
|
29
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { ContradictionListResult, ContradictionRecord, FlagContradictionInput, ListContradictionsQuery } from "@/lucern/packages/domain-edges/src/contradictions";
|
|
3
|
-
export type ContradictionsClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type ContradictionsFlagResponse = PlatformGatewaySuccess<ContradictionRecord>;
|
|
5
|
-
export type ContradictionsListResponse = PlatformGatewaySuccess<ContradictionListResult>;
|
|
6
|
-
export type ContradictionsGetResponse = PlatformGatewaySuccess<ContradictionRecord>;
|
|
7
|
-
export declare function createContradictionsClient(config?: ContradictionsClientCoreConfig): {
|
|
8
|
-
flag(input: FlagContradictionInput, idempotencyKey?: string): Promise<ContradictionsFlagResponse>;
|
|
9
|
-
list(query: ListContradictionsQuery): Promise<ContradictionsListResponse>;
|
|
10
|
-
get(id: string): Promise<ContradictionsGetResponse>;
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { CreateEdgeInput, EdgeListResult, EdgeRecord, EdgeTraversalResult, ListEdgesQuery, TraverseEdgesInput } from "@/lucern/packages/domain-edges/src/edges";
|
|
3
|
-
export type EdgesClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type EdgesCreateResponse = PlatformGatewaySuccess<EdgeRecord>;
|
|
5
|
-
export type EdgesListResponse = PlatformGatewaySuccess<EdgeListResult>;
|
|
6
|
-
export type EdgesTraverseResponse = PlatformGatewaySuccess<EdgeTraversalResult>;
|
|
7
|
-
export declare function createEdgesClient(config?: EdgesClientCoreConfig): {
|
|
8
|
-
create(input: CreateEdgeInput, idempotencyKey?: string): Promise<EdgesCreateResponse>;
|
|
9
|
-
list(query: ListEdgesQuery): Promise<EdgesListResponse>;
|
|
10
|
-
traverse(input: TraverseEdgesInput, idempotencyKey?: string): Promise<EdgesTraverseResponse>;
|
|
11
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { EventListQuery, EventListResult, ReplayEventsInput, ReplayEventsResult } from "@/lucern/packages/events/src/types";
|
|
3
|
-
export type EventsClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type EventsListResponse = PlatformGatewaySuccess<EventListResult>;
|
|
5
|
-
export type EventsReplayResponse = PlatformGatewaySuccess<ReplayEventsResult>;
|
|
6
|
-
export declare function createEventsClientCore(config?: EventsClientCoreConfig): {
|
|
7
|
-
list(query?: EventListQuery): Promise<EventsListResponse>;
|
|
8
|
-
replay(input: ReplayEventsInput, idempotencyKey?: string): Promise<EventsReplayResponse>;
|
|
9
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { CreateEvidenceInput, EvidenceListResult, EvidenceRecord, EvidenceSearchPage, LinkEvidenceResult, ListEvidenceQuery, SearchEvidenceQuery } from "@/lucern/packages/domain-evidence/src/evidence";
|
|
3
|
-
export type EvidenceClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type EvidenceGetResponse = PlatformGatewaySuccess<EvidenceRecord>;
|
|
5
|
-
export type EvidenceCreateResponse = PlatformGatewaySuccess<EvidenceRecord>;
|
|
6
|
-
export type EvidenceListResponse = PlatformGatewaySuccess<EvidenceListResult>;
|
|
7
|
-
export type EvidenceSearchResponse = PlatformGatewaySuccess<EvidenceSearchPage>;
|
|
8
|
-
export type EvidenceLinkResponse = PlatformGatewaySuccess<LinkEvidenceResult>;
|
|
9
|
-
export declare function createEvidenceClient(config?: EvidenceClientCoreConfig): {
|
|
10
|
-
create(input: CreateEvidenceInput, idempotencyKey?: string): Promise<EvidenceCreateResponse>;
|
|
11
|
-
get(id: string): Promise<EvidenceGetResponse>;
|
|
12
|
-
list(query: ListEvidenceQuery): Promise<EvidenceListResponse>;
|
|
13
|
-
link(input: {
|
|
14
|
-
evidenceId: string;
|
|
15
|
-
targetId: string;
|
|
16
|
-
targetType?: "belief" | "question";
|
|
17
|
-
weight?: number;
|
|
18
|
-
rationale?: string;
|
|
19
|
-
}, idempotencyKey?: string): Promise<EvidenceLinkResponse>;
|
|
20
|
-
search(query: SearchEvidenceQuery, idempotencyKey?: string): Promise<EvidenceSearchResponse>;
|
|
21
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { GraphAnalyzeInput, GraphAnalyzeResult, GraphBiasInput, GraphBiasResult, GraphFalsifyInput, GraphFalsifyResult, GraphGapsInput, GraphGapsResult, GraphNeighborhoodInput, GraphNeighborhoodResult, GraphTraverseInput, GraphTraverseResult } from "@/lucern/packages/domain-graph/src/graph";
|
|
3
|
-
export type GraphClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type GraphNeighborhoodResponse = PlatformGatewaySuccess<GraphNeighborhoodResult>;
|
|
5
|
-
export type GraphTraverseResponse = PlatformGatewaySuccess<GraphTraverseResult>;
|
|
6
|
-
export type GraphAnalyzeResponse = PlatformGatewaySuccess<GraphAnalyzeResult>;
|
|
7
|
-
export type GraphBiasResponse = PlatformGatewaySuccess<GraphBiasResult>;
|
|
8
|
-
export type GraphGapsResponse = PlatformGatewaySuccess<GraphGapsResult>;
|
|
9
|
-
export type GraphFalsifyResponse = PlatformGatewaySuccess<GraphFalsifyResult>;
|
|
10
|
-
export declare function createGraphClient(config?: GraphClientCoreConfig): {
|
|
11
|
-
neighborhood(input: GraphNeighborhoodInput): Promise<GraphNeighborhoodResponse>;
|
|
12
|
-
traverse(input: GraphTraverseInput): Promise<GraphTraverseResponse>;
|
|
13
|
-
analyze(input: GraphAnalyzeInput): Promise<GraphAnalyzeResponse>;
|
|
14
|
-
bias(input: GraphBiasInput): Promise<GraphBiasResponse>;
|
|
15
|
-
gaps(input: GraphGapsInput): Promise<GraphGapsResponse>;
|
|
16
|
-
falsify(input: GraphFalsifyInput): Promise<GraphFalsifyResponse>;
|
|
17
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { IdentitySummary } from "@/lucern/packages/domain-identity/src/whoami";
|
|
3
|
-
export type IdentityClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type IdentityWhoamiResponse = PlatformGatewaySuccess<IdentitySummary>;
|
|
5
|
-
export declare function createIdentityWhoamiClient(config?: IdentityClientCoreConfig): {
|
|
6
|
-
whoami(): Promise<IdentityWhoamiResponse>;
|
|
7
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type DecodedPrefixedId = {
|
|
2
|
-
prefix: string;
|
|
3
|
-
value: string;
|
|
4
|
-
};
|
|
5
|
-
export declare function encodePrefixedId(prefix: string, value: string): string;
|
|
6
|
-
export declare function decodePrefixedId(id: string): DecodedPrefixedId;
|
|
7
|
-
export declare function hasPrefixedIdPrefix(id: string, prefix: string): boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { BindOntologyInput, OntologyBindingResult, OntologyListQuery, OntologyListResult, OntologyMatchInput, OntologyMatchResult, OntologyRecord } from "@/lucern/packages/domain-ontologies/src/ontologies";
|
|
3
|
-
export type OntologiesClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type OntologiesGetResponse = PlatformGatewaySuccess<OntologyRecord>;
|
|
5
|
-
export type OntologiesListResponse = PlatformGatewaySuccess<OntologyListResult>;
|
|
6
|
-
export type OntologiesBindResponse = PlatformGatewaySuccess<OntologyBindingResult>;
|
|
7
|
-
export type OntologiesMatchResponse = PlatformGatewaySuccess<OntologyMatchResult>;
|
|
8
|
-
export declare function createOntologiesClientCore(config?: OntologiesClientCoreConfig): {
|
|
9
|
-
get(id: string): Promise<OntologiesGetResponse>;
|
|
10
|
-
list(query?: OntologyListQuery): Promise<OntologiesListResponse>;
|
|
11
|
-
bind(input: BindOntologyInput, idempotencyKey?: string): Promise<OntologiesBindResponse>;
|
|
12
|
-
match(input: OntologyMatchInput, idempotencyKey?: string): Promise<OntologiesMatchResponse>;
|
|
13
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { CreateQuestionInput, ListQuestionsQuery, QuestionArchiveResult, QuestionAnswerResult, QuestionListResult, QuestionRecord } from "@/lucern/packages/domain-questions/src/questions";
|
|
3
|
-
export type QuestionsClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type QuestionsCreateResponse = PlatformGatewaySuccess<QuestionRecord>;
|
|
5
|
-
export type QuestionsGetResponse = PlatformGatewaySuccess<QuestionRecord>;
|
|
6
|
-
export type QuestionsListResponse = PlatformGatewaySuccess<QuestionListResult>;
|
|
7
|
-
export type QuestionsRefineResponse = PlatformGatewaySuccess<QuestionRecord & {
|
|
8
|
-
previousText: string;
|
|
9
|
-
updatedText: string;
|
|
10
|
-
}>;
|
|
11
|
-
export type QuestionsUpdateStatusResponse = PlatformGatewaySuccess<QuestionRecord & {
|
|
12
|
-
previousStatus: string;
|
|
13
|
-
newStatus: string;
|
|
14
|
-
}>;
|
|
15
|
-
export type QuestionsArchiveResponse = PlatformGatewaySuccess<QuestionArchiveResult>;
|
|
16
|
-
export type QuestionsAnswerResponse = PlatformGatewaySuccess<QuestionAnswerResult>;
|
|
17
|
-
export declare function createQuestionsClient(config?: QuestionsClientCoreConfig): {
|
|
18
|
-
create(input: CreateQuestionInput, idempotencyKey?: string): Promise<QuestionsCreateResponse>;
|
|
19
|
-
get(id: string): Promise<QuestionsGetResponse>;
|
|
20
|
-
list(query: ListQuestionsQuery): Promise<QuestionsListResponse>;
|
|
21
|
-
answer(id: string, input: {
|
|
22
|
-
text: string;
|
|
23
|
-
confidence?: string;
|
|
24
|
-
evidenceIds?: string[];
|
|
25
|
-
rationale?: string;
|
|
26
|
-
}, idempotencyKey?: string): Promise<QuestionsAnswerResponse>;
|
|
27
|
-
refine(id: string, input: {
|
|
28
|
-
text: string;
|
|
29
|
-
rationale?: string;
|
|
30
|
-
}, idempotencyKey?: string): Promise<QuestionsRefineResponse>;
|
|
31
|
-
archive(id: string, input?: {
|
|
32
|
-
reason?: string;
|
|
33
|
-
rationale?: string;
|
|
34
|
-
}, idempotencyKey?: string): Promise<QuestionsArchiveResponse>;
|
|
35
|
-
updateStatus(id: string, input: {
|
|
36
|
-
status: string;
|
|
37
|
-
rationale?: string;
|
|
38
|
-
}, idempotencyKey?: string): Promise<QuestionsUpdateStatusResponse>;
|
|
39
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type GatewayClientConfig, type PlatformGatewaySuccess } from "@/packages/sdk/src/coreClient";
|
|
2
|
-
import type { SearchInput, SearchResponse } from "@/lucern/packages/domain-search/src/search";
|
|
3
|
-
export type SearchClientCoreConfig = GatewayClientConfig;
|
|
4
|
-
export type SearchResourcesResponse = PlatformGatewaySuccess<SearchResponse>;
|
|
5
|
-
export declare function createSearchClient(config?: SearchClientCoreConfig): {
|
|
6
|
-
query(input: SearchInput): Promise<SearchResourcesResponse>;
|
|
7
|
-
};
|