@kortexya/reasoninglayer 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +203 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +418 -14
- package/dist/index.d.ts +418 -14
- package/dist/index.js +202 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | object;
|
|
|
109
109
|
* This is the single source of truth for the version constant.
|
|
110
110
|
* The `scripts/release.sh` script updates this value alongside `package.json`.
|
|
111
111
|
*/
|
|
112
|
-
declare const SDK_VERSION = "0.
|
|
112
|
+
declare const SDK_VERSION = "0.5.0";
|
|
113
113
|
/**
|
|
114
114
|
* Configuration for the Reasoning Layer client.
|
|
115
115
|
*
|
|
@@ -10355,6 +10355,77 @@ interface OsfSearchStatsDto$1 {
|
|
|
10355
10355
|
*/
|
|
10356
10356
|
relationsDiscovered: number;
|
|
10357
10357
|
}
|
|
10358
|
+
/** Error response for OSFQL execution failures. */
|
|
10359
|
+
interface OsfqlErrorResponse {
|
|
10360
|
+
/** Error type: "parse", "compile", or "execution". */
|
|
10361
|
+
errorType: string;
|
|
10362
|
+
/** Human-readable error message. */
|
|
10363
|
+
message: string;
|
|
10364
|
+
}
|
|
10365
|
+
/** Request to execute an OSFQL program. */
|
|
10366
|
+
interface OsfqlRequest$1 {
|
|
10367
|
+
/**
|
|
10368
|
+
* OSFQL program text (one or more statements separated by `;`).
|
|
10369
|
+
*
|
|
10370
|
+
* # Examples
|
|
10371
|
+
*
|
|
10372
|
+
* ```text
|
|
10373
|
+
* MATCH person(name: ?N, age: ?A) WHERE ?A > 18;
|
|
10374
|
+
* ```
|
|
10375
|
+
*
|
|
10376
|
+
* ```text
|
|
10377
|
+
* INSERT person(name: "Alice", age: 30);
|
|
10378
|
+
* MATCH person(name: ?N);
|
|
10379
|
+
* ```
|
|
10380
|
+
*/
|
|
10381
|
+
query: string;
|
|
10382
|
+
}
|
|
10383
|
+
/** Response from executing an OSFQL program. */
|
|
10384
|
+
interface OsfqlResponse$1 {
|
|
10385
|
+
/** Variable bindings from MATCH queries. */
|
|
10386
|
+
bindings: Record<string, OsfqlValueDto>[];
|
|
10387
|
+
/** IDs of newly defined sorts (from DEFINE statements). */
|
|
10388
|
+
definedSortIds?: string[];
|
|
10389
|
+
/** Diagnostic messages from the execution pipeline. */
|
|
10390
|
+
diagnostics: string[];
|
|
10391
|
+
/** IDs of produced/modified terms (from INSERT, DERIVE, etc.). */
|
|
10392
|
+
producedTermIds: string[];
|
|
10393
|
+
/**
|
|
10394
|
+
* Number of statements executed.
|
|
10395
|
+
* @min 0
|
|
10396
|
+
*/
|
|
10397
|
+
statementCount: number;
|
|
10398
|
+
/** Whether the execution succeeded. */
|
|
10399
|
+
success: boolean;
|
|
10400
|
+
}
|
|
10401
|
+
/** A bound value in an OSFQL result. */
|
|
10402
|
+
type OsfqlValueDto = {
|
|
10403
|
+
type: "integer";
|
|
10404
|
+
/**
|
|
10405
|
+
* Integer value.
|
|
10406
|
+
* @format int64
|
|
10407
|
+
*/
|
|
10408
|
+
value: number;
|
|
10409
|
+
} | {
|
|
10410
|
+
type: "float";
|
|
10411
|
+
/**
|
|
10412
|
+
* Floating-point value.
|
|
10413
|
+
* @format double
|
|
10414
|
+
*/
|
|
10415
|
+
value: number;
|
|
10416
|
+
} | {
|
|
10417
|
+
type: "string";
|
|
10418
|
+
/** String value. */
|
|
10419
|
+
value: string;
|
|
10420
|
+
} | {
|
|
10421
|
+
type: "boolean";
|
|
10422
|
+
/** Boolean value. */
|
|
10423
|
+
value: boolean;
|
|
10424
|
+
} | {
|
|
10425
|
+
type: "term_ref";
|
|
10426
|
+
/** Reference to a term (by UUID). */
|
|
10427
|
+
value: string;
|
|
10428
|
+
};
|
|
10358
10429
|
/** An alert DTO for live oversight sessions. */
|
|
10359
10430
|
interface OversightAlertDto$1 {
|
|
10360
10431
|
/** Agent ID responsible (for multi-agent systems) */
|
|
@@ -36904,6 +36975,335 @@ declare class OptimizeClient {
|
|
|
36904
36975
|
private cleanupArtifacts;
|
|
36905
36976
|
}
|
|
36906
36977
|
|
|
36978
|
+
declare class Osfql<SecurityDataType = unknown> {
|
|
36979
|
+
http: HttpClient<SecurityDataType>;
|
|
36980
|
+
constructor(http: HttpClient<SecurityDataType>);
|
|
36981
|
+
/**
|
|
36982
|
+
* @description Parses, compiles, and executes an OSFQL program against the caller's tenant-isolated knowledge base. Supports all OSFQL statement types: MATCH, INSERT, RETRACT, DERIVE, UNIFY, AWAIT, COUNTERFACTUAL, CAUSES. # Examples ```json { "query": "INSERT person(name: \"Alice\", age: 30);" } ``` ```json { "query": "MATCH person(name: ?N, age: ?A) WHERE ?A > 18;" } ```
|
|
36983
|
+
*
|
|
36984
|
+
* @tags osfql
|
|
36985
|
+
* @name ExecuteOsfql
|
|
36986
|
+
* @summary Execute an OSFQL program.
|
|
36987
|
+
* @request POST:/api/v1/osfql
|
|
36988
|
+
* @secure
|
|
36989
|
+
*/
|
|
36990
|
+
executeOsfql: (data: OsfqlRequest$1, params?: RequestParams) => Promise<HttpResponse<OsfqlResponse$1, OsfqlErrorResponse>>;
|
|
36991
|
+
}
|
|
36992
|
+
|
|
36993
|
+
/**
|
|
36994
|
+
* Request to execute an OSFQL program.
|
|
36995
|
+
*
|
|
36996
|
+
* @remarks
|
|
36997
|
+
* The query field accepts one or more OSFQL statements separated by semicolons.
|
|
36998
|
+
* Supported statement types include MATCH, INSERT, RETRACT, DERIVE, UNIFY,
|
|
36999
|
+
* DEFINE, AWAIT, COUNTERFACTUAL, and CAUSES.
|
|
37000
|
+
*/
|
|
37001
|
+
interface OsfqlRequest {
|
|
37002
|
+
/** The OSFQL program text (one or more statements separated by `;`). */
|
|
37003
|
+
query: string;
|
|
37004
|
+
}
|
|
37005
|
+
/**
|
|
37006
|
+
* A bound value from OSFQL execution.
|
|
37007
|
+
*
|
|
37008
|
+
* @remarks
|
|
37009
|
+
* Uses a tagged discriminated union with `type` as the discriminant.
|
|
37010
|
+
* Represents the possible value types that can appear in OSFQL variable bindings.
|
|
37011
|
+
*/
|
|
37012
|
+
type OsfqlValue = {
|
|
37013
|
+
type: 'integer';
|
|
37014
|
+
value: number;
|
|
37015
|
+
} | {
|
|
37016
|
+
type: 'float';
|
|
37017
|
+
value: number;
|
|
37018
|
+
} | {
|
|
37019
|
+
type: 'string';
|
|
37020
|
+
value: string;
|
|
37021
|
+
} | {
|
|
37022
|
+
type: 'boolean';
|
|
37023
|
+
value: boolean;
|
|
37024
|
+
} | {
|
|
37025
|
+
type: 'term_ref';
|
|
37026
|
+
value: string;
|
|
37027
|
+
};
|
|
37028
|
+
/**
|
|
37029
|
+
* Response from OSFQL execution.
|
|
37030
|
+
*
|
|
37031
|
+
* @remarks
|
|
37032
|
+
* Contains the results of executing an OSFQL program, including variable
|
|
37033
|
+
* bindings from MATCH queries, IDs of produced terms and defined sorts,
|
|
37034
|
+
* and diagnostic messages from the execution pipeline.
|
|
37035
|
+
*/
|
|
37036
|
+
interface OsfqlResponse {
|
|
37037
|
+
/** Whether execution succeeded. */
|
|
37038
|
+
success: boolean;
|
|
37039
|
+
/** Variable bindings from MATCH queries. Each entry represents one solution. */
|
|
37040
|
+
bindings: Record<string, OsfqlValue>[];
|
|
37041
|
+
/** Term IDs produced by INSERT or DERIVE statements. */
|
|
37042
|
+
producedTermIds: string[];
|
|
37043
|
+
/** Sort IDs produced by DEFINE statements. */
|
|
37044
|
+
definedSortIds?: string[];
|
|
37045
|
+
/** Diagnostic messages from the execution pipeline. */
|
|
37046
|
+
diagnostics: string[];
|
|
37047
|
+
/** Number of statements executed. */
|
|
37048
|
+
statementCount: number;
|
|
37049
|
+
}
|
|
37050
|
+
|
|
37051
|
+
type osfql_OsfqlRequest = OsfqlRequest;
|
|
37052
|
+
type osfql_OsfqlResponse = OsfqlResponse;
|
|
37053
|
+
type osfql_OsfqlValue = OsfqlValue;
|
|
37054
|
+
declare namespace osfql {
|
|
37055
|
+
export type { osfql_OsfqlRequest as OsfqlRequest, osfql_OsfqlResponse as OsfqlResponse, osfql_OsfqlValue as OsfqlValue };
|
|
37056
|
+
}
|
|
37057
|
+
|
|
37058
|
+
/**
|
|
37059
|
+
* Resource client for OSFQL (OSF Query Language) operations.
|
|
37060
|
+
*
|
|
37061
|
+
* @remarks
|
|
37062
|
+
* Provides access to the OSFQL execution endpoint, which parses, compiles,
|
|
37063
|
+
* and executes OSFQL programs against the tenant-isolated knowledge base.
|
|
37064
|
+
*
|
|
37065
|
+
* Supported statement types include MATCH, INSERT, RETRACT, DERIVE, UNIFY,
|
|
37066
|
+
* DEFINE, AWAIT, COUNTERFACTUAL, and CAUSES.
|
|
37067
|
+
*
|
|
37068
|
+
* Delegates to generated route classes for type-safe HTTP calls.
|
|
37069
|
+
*/
|
|
37070
|
+
declare class OsfqlClient {
|
|
37071
|
+
/** @internal */
|
|
37072
|
+
private readonly api;
|
|
37073
|
+
/** @internal */
|
|
37074
|
+
constructor(api: Osfql);
|
|
37075
|
+
/**
|
|
37076
|
+
* Execute an OSFQL program.
|
|
37077
|
+
*
|
|
37078
|
+
* @param query - The OSFQL program text (one or more statements separated by `;`).
|
|
37079
|
+
* @returns The execution result including variable bindings, produced term IDs,
|
|
37080
|
+
* defined sort IDs, diagnostics, and statement count.
|
|
37081
|
+
* @throws {ApiError} If the request fails.
|
|
37082
|
+
*
|
|
37083
|
+
* @remarks
|
|
37084
|
+
* The query is parsed, compiled, and executed against the caller's tenant-isolated
|
|
37085
|
+
* knowledge base. Results include variable bindings from MATCH queries and IDs of
|
|
37086
|
+
* any terms or sorts created by INSERT, DERIVE, or DEFINE statements.
|
|
37087
|
+
*
|
|
37088
|
+
* @example
|
|
37089
|
+
* ```typescript
|
|
37090
|
+
* // Insert a record and query it back
|
|
37091
|
+
* const result = await client.osfql.execute(
|
|
37092
|
+
* 'INSERT person(name: "Alice", age: 30); MATCH person(name: ?N);'
|
|
37093
|
+
* );
|
|
37094
|
+
* console.log(result.success); // true
|
|
37095
|
+
* console.log(result.bindings); // [{ N: { type: "string", value: "Alice" } }]
|
|
37096
|
+
* console.log(result.producedTermIds); // ["<uuid>"]
|
|
37097
|
+
* console.log(result.statementCount); // 2
|
|
37098
|
+
* ```
|
|
37099
|
+
*/
|
|
37100
|
+
execute(query: string): Promise<OsfqlResponse>;
|
|
37101
|
+
}
|
|
37102
|
+
|
|
37103
|
+
/**
|
|
37104
|
+
* Request to send a message in a conversation.
|
|
37105
|
+
*
|
|
37106
|
+
* @remarks
|
|
37107
|
+
* The conversation service translates natural language to OSFQL,
|
|
37108
|
+
* executes it (with up to 3 self-correction retries on failure),
|
|
37109
|
+
* and returns both the generated OSFQL and the results.
|
|
37110
|
+
*
|
|
37111
|
+
* Reuse `conversationId` from a previous response for multi-turn
|
|
37112
|
+
* context (pronoun resolution, follow-up queries).
|
|
37113
|
+
*/
|
|
37114
|
+
interface ConversationMessageRequest {
|
|
37115
|
+
/** The user's natural language message. */
|
|
37116
|
+
message: string;
|
|
37117
|
+
/**
|
|
37118
|
+
* Optional conversation ID to continue an existing conversation.
|
|
37119
|
+
* If omitted, a new conversation is created.
|
|
37120
|
+
*/
|
|
37121
|
+
conversationId?: string | null;
|
|
37122
|
+
/** Session ID for session tracking. */
|
|
37123
|
+
sessionId?: string | null;
|
|
37124
|
+
/** Optional sort name hint from the current page context. */
|
|
37125
|
+
currentSortContext?: string | null;
|
|
37126
|
+
}
|
|
37127
|
+
/**
|
|
37128
|
+
* Response from processing a conversation message.
|
|
37129
|
+
*
|
|
37130
|
+
* @remarks
|
|
37131
|
+
* Contains the assistant's NL response, the OSFQL that was generated
|
|
37132
|
+
* and executed, query results (for MATCH queries), and contextual
|
|
37133
|
+
* suggestions for follow-up queries.
|
|
37134
|
+
*/
|
|
37135
|
+
interface ConversationMessageResponse {
|
|
37136
|
+
/** The assistant's natural language response. */
|
|
37137
|
+
assistantMessage: string;
|
|
37138
|
+
/** The conversation ID (existing or newly created). */
|
|
37139
|
+
conversationId: string;
|
|
37140
|
+
/** Classified intent type (e.g., "query", "insert", "define"). */
|
|
37141
|
+
intent: string;
|
|
37142
|
+
/** OSFQL that was executed (if any). */
|
|
37143
|
+
osfqlExecuted?: string | null;
|
|
37144
|
+
/** Query results (if OSFQL was a MATCH). Each entry maps variable names to bound values. */
|
|
37145
|
+
queryResults?: Record<string, OsfqlValue>[] | null;
|
|
37146
|
+
/** IDs of terms produced by the OSFQL execution. */
|
|
37147
|
+
producedTermIds: string[];
|
|
37148
|
+
/** Sort ID referenced in the message (for UI rendering). */
|
|
37149
|
+
uiSortId?: string | null;
|
|
37150
|
+
/** Contextual OSFQL suggestions for follow-up queries. */
|
|
37151
|
+
suggestions: string[];
|
|
37152
|
+
}
|
|
37153
|
+
/**
|
|
37154
|
+
* A single conversation turn (message).
|
|
37155
|
+
*/
|
|
37156
|
+
interface TurnDto {
|
|
37157
|
+
/** Turn ID. */
|
|
37158
|
+
id: string;
|
|
37159
|
+
/** "user" or "assistant". */
|
|
37160
|
+
role: string;
|
|
37161
|
+
/** Message content. */
|
|
37162
|
+
content: string;
|
|
37163
|
+
/** ISO 8601 timestamp. */
|
|
37164
|
+
timestamp: string;
|
|
37165
|
+
/** Classified intent (assistant turns only). */
|
|
37166
|
+
intent?: string | null;
|
|
37167
|
+
/** OSFQL generated (assistant turns only). */
|
|
37168
|
+
osfql?: string | null;
|
|
37169
|
+
}
|
|
37170
|
+
/**
|
|
37171
|
+
* A conversation summary.
|
|
37172
|
+
*/
|
|
37173
|
+
interface ConversationSummaryDto {
|
|
37174
|
+
/** Conversation ID. */
|
|
37175
|
+
id: string;
|
|
37176
|
+
/** Session ID. */
|
|
37177
|
+
sessionId?: string | null;
|
|
37178
|
+
/** ISO 8601 creation timestamp. */
|
|
37179
|
+
createdAt: string;
|
|
37180
|
+
/** Number of turns. */
|
|
37181
|
+
turnCount: number;
|
|
37182
|
+
}
|
|
37183
|
+
/**
|
|
37184
|
+
* Response for listing conversations.
|
|
37185
|
+
*/
|
|
37186
|
+
interface ListConversationsResponse {
|
|
37187
|
+
conversations: ConversationSummaryDto[];
|
|
37188
|
+
}
|
|
37189
|
+
/**
|
|
37190
|
+
* Response for getting conversation turns.
|
|
37191
|
+
*/
|
|
37192
|
+
interface ConversationTurnsResponse {
|
|
37193
|
+
conversationId: string;
|
|
37194
|
+
turns: TurnDto[];
|
|
37195
|
+
}
|
|
37196
|
+
|
|
37197
|
+
type conversation_ConversationMessageRequest = ConversationMessageRequest;
|
|
37198
|
+
type conversation_ConversationMessageResponse = ConversationMessageResponse;
|
|
37199
|
+
type conversation_ConversationSummaryDto = ConversationSummaryDto;
|
|
37200
|
+
type conversation_ConversationTurnsResponse = ConversationTurnsResponse;
|
|
37201
|
+
type conversation_ListConversationsResponse = ListConversationsResponse;
|
|
37202
|
+
type conversation_TurnDto = TurnDto;
|
|
37203
|
+
declare namespace conversation {
|
|
37204
|
+
export type { conversation_ConversationMessageRequest as ConversationMessageRequest, conversation_ConversationMessageResponse as ConversationMessageResponse, conversation_ConversationSummaryDto as ConversationSummaryDto, conversation_ConversationTurnsResponse as ConversationTurnsResponse, conversation_ListConversationsResponse as ListConversationsResponse, conversation_TurnDto as TurnDto };
|
|
37205
|
+
}
|
|
37206
|
+
|
|
37207
|
+
/**
|
|
37208
|
+
* Resource client for conversational AI operations.
|
|
37209
|
+
*
|
|
37210
|
+
* @remarks
|
|
37211
|
+
* Wraps the conversation endpoint which translates natural language
|
|
37212
|
+
* to OSFQL, executes it (with self-correction on failure), and returns
|
|
37213
|
+
* results along with the generated OSFQL and contextual suggestions.
|
|
37214
|
+
*
|
|
37215
|
+
* Multi-turn context is supported by reusing the `conversationId` from
|
|
37216
|
+
* a previous response — the backend maintains conversation history for
|
|
37217
|
+
* pronoun resolution and follow-up queries.
|
|
37218
|
+
*
|
|
37219
|
+
* Delegates to the generated HTTP client for type-safe transport with
|
|
37220
|
+
* automatic serialization, authentication, retry, and timeout behavior.
|
|
37221
|
+
*/
|
|
37222
|
+
declare class ConversationClient {
|
|
37223
|
+
/** @internal */
|
|
37224
|
+
private readonly http;
|
|
37225
|
+
/** @internal */
|
|
37226
|
+
constructor(http: HttpClient);
|
|
37227
|
+
/**
|
|
37228
|
+
* Send a natural language message and receive OSFQL-powered results.
|
|
37229
|
+
*
|
|
37230
|
+
* @param request - The conversation message request.
|
|
37231
|
+
* @returns The assistant's response including generated OSFQL, query results, and suggestions.
|
|
37232
|
+
* @throws {ApiError} If the request fails.
|
|
37233
|
+
*
|
|
37234
|
+
* @remarks
|
|
37235
|
+
* The conversation service:
|
|
37236
|
+
* 1. Classifies the intent (query, insert, define, etc.)
|
|
37237
|
+
* 2. Generates OSFQL from the natural language
|
|
37238
|
+
* 3. Executes the OSFQL against the knowledge base
|
|
37239
|
+
* 4. Self-corrects up to 3 times if execution fails
|
|
37240
|
+
* 5. Returns results + the generated OSFQL + suggestions
|
|
37241
|
+
*
|
|
37242
|
+
* Reuse `conversationId` from a previous response for multi-turn context.
|
|
37243
|
+
*
|
|
37244
|
+
* @example
|
|
37245
|
+
* ```typescript
|
|
37246
|
+
* // First message — starts a new conversation
|
|
37247
|
+
* const first = await client.conversation.sendMessage({
|
|
37248
|
+
* message: 'Who are the prime suspects?',
|
|
37249
|
+
* });
|
|
37250
|
+
* console.log(first.osfqlExecuted); // "PROVE prime_suspect(name: ?N, motive: ?M);"
|
|
37251
|
+
* console.log(first.queryResults); // [{ N: ..., M: ... }, ...]
|
|
37252
|
+
*
|
|
37253
|
+
* // Follow-up — reuses conversation context
|
|
37254
|
+
* const followUp = await client.conversation.sendMessage({
|
|
37255
|
+
* message: 'Which of them had a key?',
|
|
37256
|
+
* conversationId: first.conversationId,
|
|
37257
|
+
* });
|
|
37258
|
+
* ```
|
|
37259
|
+
*/
|
|
37260
|
+
sendMessage(request: ConversationMessageRequest): Promise<ConversationMessageResponse>;
|
|
37261
|
+
/**
|
|
37262
|
+
* List recent conversations for the authenticated user.
|
|
37263
|
+
*
|
|
37264
|
+
* @returns List of conversation summaries.
|
|
37265
|
+
* @throws {ApiError} If the request fails.
|
|
37266
|
+
*
|
|
37267
|
+
* @example
|
|
37268
|
+
* ```typescript
|
|
37269
|
+
* const { conversations } = await client.conversation.listConversations();
|
|
37270
|
+
* for (const c of conversations) {
|
|
37271
|
+
* console.log(`${c.id}: ${c.turnCount} turns (${c.createdAt})`);
|
|
37272
|
+
* }
|
|
37273
|
+
* ```
|
|
37274
|
+
*/
|
|
37275
|
+
listConversations(): Promise<ListConversationsResponse>;
|
|
37276
|
+
/**
|
|
37277
|
+
* Get all turns for a conversation.
|
|
37278
|
+
*
|
|
37279
|
+
* @param conversationId - The conversation ID.
|
|
37280
|
+
* @returns All turns in the conversation.
|
|
37281
|
+
* @throws {ApiError} If the request fails.
|
|
37282
|
+
*
|
|
37283
|
+
* @example
|
|
37284
|
+
* ```typescript
|
|
37285
|
+
* const { turns } = await client.conversation.getTurns('conv-uuid');
|
|
37286
|
+
* for (const turn of turns) {
|
|
37287
|
+
* console.log(`[${turn.role}] ${turn.content}`);
|
|
37288
|
+
* if (turn.osfql) console.log(` OSFQL: ${turn.osfql}`);
|
|
37289
|
+
* }
|
|
37290
|
+
* ```
|
|
37291
|
+
*/
|
|
37292
|
+
getTurns(conversationId: string): Promise<ConversationTurnsResponse>;
|
|
37293
|
+
/**
|
|
37294
|
+
* Delete a conversation and all its turns.
|
|
37295
|
+
*
|
|
37296
|
+
* @param conversationId - The conversation ID to delete.
|
|
37297
|
+
* @throws {ApiError} If the request fails.
|
|
37298
|
+
*
|
|
37299
|
+
* @example
|
|
37300
|
+
* ```typescript
|
|
37301
|
+
* await client.conversation.deleteConversation('conv-uuid');
|
|
37302
|
+
* ```
|
|
37303
|
+
*/
|
|
37304
|
+
deleteConversation(conversationId: string): Promise<void>;
|
|
37305
|
+
}
|
|
37306
|
+
|
|
36907
37307
|
/** Core knowledge base operations — types, records, rules, functions, constraints, and queries. */
|
|
36908
37308
|
interface CoreGroup {
|
|
36909
37309
|
readonly types: SortsClient;
|
|
@@ -37073,6 +37473,10 @@ declare class ReasoningLayerClient {
|
|
|
37073
37473
|
readonly rag: RagClient;
|
|
37074
37474
|
/** Linear program optimization (CLP(Q) simplex solver via backward chaining). */
|
|
37075
37475
|
readonly optimize: OptimizeClient;
|
|
37476
|
+
/** OSFQL (OSF Query Language) execution operations. */
|
|
37477
|
+
readonly osfql: OsfqlClient;
|
|
37478
|
+
/** Conversational AI operations (NL → OSFQL with self-correction). */
|
|
37479
|
+
readonly conversation: ConversationClient;
|
|
37076
37480
|
private _core?;
|
|
37077
37481
|
private _ai?;
|
|
37078
37482
|
private _reasoning?;
|
|
@@ -37467,7 +37871,7 @@ declare const FuzzyShape: {
|
|
|
37467
37871
|
*
|
|
37468
37872
|
* @remarks
|
|
37469
37873
|
* Serialization format: Untagged (TermInputDto). Used as the `constraint` argument
|
|
37470
|
-
* to `
|
|
37874
|
+
* to `constrained()`.
|
|
37471
37875
|
*
|
|
37472
37876
|
* This function constructs object literals directly matching the `TermInputDto` and
|
|
37473
37877
|
* `FeatureInputValueDto` shapes. It does NOT import from other builder files.
|
|
@@ -37479,15 +37883,15 @@ declare const FuzzyShape: {
|
|
|
37479
37883
|
*
|
|
37480
37884
|
* @example
|
|
37481
37885
|
* ```typescript
|
|
37482
|
-
* import {
|
|
37886
|
+
* import { psi, constrained, guard } from '@kortexya/reasoninglayer';
|
|
37483
37887
|
*
|
|
37484
|
-
* //
|
|
37485
|
-
* const salary =
|
|
37888
|
+
* // Use with constrained():
|
|
37889
|
+
* const salary = constrained("?Salary", guard("gt", 100));
|
|
37486
37890
|
*
|
|
37487
|
-
* //
|
|
37488
|
-
*
|
|
37489
|
-
*
|
|
37490
|
-
* )
|
|
37891
|
+
* // In a rule:
|
|
37892
|
+
* psi("employee", {
|
|
37893
|
+
* salary: constrained("?Salary", guard("gt", 100)),
|
|
37894
|
+
* })
|
|
37491
37895
|
* ```
|
|
37492
37896
|
*/
|
|
37493
37897
|
declare function guard(op: GuardOp, right: number | string | boolean): TermInputDto;
|
|
@@ -37513,9 +37917,9 @@ declare function guard(op: GuardOp, right: number | string | boolean): TermInput
|
|
|
37513
37917
|
* })
|
|
37514
37918
|
* .feature({ name: "department", required: true })
|
|
37515
37919
|
* .boundConstraint({
|
|
37516
|
-
*
|
|
37920
|
+
* constraintType: "upper",
|
|
37517
37921
|
* target: "end_date",
|
|
37518
|
-
*
|
|
37922
|
+
* sourcePath: "company.dissolutionDate",
|
|
37519
37923
|
* })
|
|
37520
37924
|
* .description("An employee at a company")
|
|
37521
37925
|
* .build();
|
|
@@ -37610,9 +38014,9 @@ declare class SortBuilder {
|
|
|
37610
38014
|
* @example
|
|
37611
38015
|
* ```typescript
|
|
37612
38016
|
* builder.boundConstraint({
|
|
37613
|
-
*
|
|
38017
|
+
* constraintType: "upper",
|
|
37614
38018
|
* target: "end_date",
|
|
37615
|
-
*
|
|
38019
|
+
* sourcePath: "company.dissolutionDate",
|
|
37616
38020
|
* })
|
|
37617
38021
|
* ```
|
|
37618
38022
|
*/
|
|
@@ -38053,4 +38457,4 @@ declare function toUntaggedFeatures(features: PlainFeatureMap): Record<string, F
|
|
|
38053
38457
|
*/
|
|
38054
38458
|
declare function toTermInputDto(input: PsiTermInput | TermInputDto): TermInputDto;
|
|
38055
38459
|
|
|
38056
|
-
export { actionReviews as ActionReviews, type AddFactRequest, type AddFactResponse, type AddRuleRequest, type AddRuleResponse, admin as Admin, type AiGroup, analysis as Analysis, type AnalysisGroup, ApiError, type ApiResponse, AuthenticationError, type BackwardChainRequest, type BackwardChainResponse, BadRequestError, type BulkAddTermsRequest, type BulkAddTermsResponse, type BulkCreateSortsRequest, type BulkCreateSortsResponse, cdl as CDL, causal as Causal, type ClearTermsResponse, type ClientConfig, cognitive as Cognitive, collections as Collections, communities as Communities, type ConstrainedPlainVar, ConstraintViolationError, constraints as Constraints, control as Control, type CoreGroup, type CreateSortRequest, type CreateTermRequest, type DataGroup, discovery as Discovery, type ErrorResponse, execution as Execution, extract as Extract, type FeatureInputValueDto, type FeatureValueDto, ForbiddenError, type ForwardChainRequest, type ForwardChainResponse, functions as Functions, fuzzy as Fuzzy, FuzzyShape, type FuzzyShapeDto, generation as Generation, type GlbRequest, type GlbResponse, health as Health, homoiconic as Homoiconic, ilp as ILP, imageExtraction as ImageExtraction, inference as Inference, ingestion as Ingestion, type Interceptor, InternalServerError, type JsonValue$1 as JsonValue, LP, type LubRequest, type LubResponse, namespaces as Namespaces, NetworkError, neuroSymbolic as NeuroSymbolic, NotFoundError, ontology as Ontology, optimize as Optimize, type OsfSearchRequest, type OsfSearchResponse, oversight as Oversight, type PaginationParams, type PlainFeatureMap, type PlainFeatureValue, plainValues as PlainValues, preferences as Preferences, proofEngine as ProofEngine, type PsiTermDto, type PsiTermInput, query as Query, rag as RAG, RateLimitError, type RateLimitInfo, reasoning as Reasoning, type ReasoningGroup, ReasoningLayerClient, ReasoningLayerError, type RequestOptions, reviews as Reviews, row as Row, SDK_VERSION, scenarios as Scenarios, SortBuilder, type SortDto, type SortInfoDto, sorts as Sorts, sources as Sources, spaces as Spaces, statistical as Statistical, synthetic as Synthetic, type SystemGroup, type TermDto, type TermInputArg, type TermInputDto, type TermListResponse, type TermPatternDto, type TermResponse, terms as Terms, TimeoutError, type UpdateTermRequest, utilities as Utilities, ValidationError, Value, type ValueDto, values as Values, visualization as Visualization, WebSocketClient, WebSocketConnection, webhookActions as WebhookActions, type WorkflowGroup, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
|
|
38460
|
+
export { actionReviews as ActionReviews, type AddFactRequest, type AddFactResponse, type AddRuleRequest, type AddRuleResponse, admin as Admin, type AiGroup, analysis as Analysis, type AnalysisGroup, ApiError, type ApiResponse, AuthenticationError, type BackwardChainRequest, type BackwardChainResponse, BadRequestError, type BulkAddTermsRequest, type BulkAddTermsResponse, type BulkCreateSortsRequest, type BulkCreateSortsResponse, cdl as CDL, causal as Causal, type ClearTermsResponse, type ClientConfig, cognitive as Cognitive, collections as Collections, communities as Communities, type ConstrainedPlainVar, ConstraintViolationError, constraints as Constraints, control as Control, conversation as Conversation, type ConversationMessageRequest, type ConversationMessageResponse, type ConversationSummaryDto, type ConversationTurnsResponse, type CoreGroup, type CreateSortRequest, type CreateTermRequest, type DataGroup, discovery as Discovery, type ErrorResponse, execution as Execution, extract as Extract, type FeatureInputValueDto, type FeatureValueDto, ForbiddenError, type ForwardChainRequest, type ForwardChainResponse, functions as Functions, fuzzy as Fuzzy, FuzzyShape, type FuzzyShapeDto, generation as Generation, type GlbRequest, type GlbResponse, health as Health, homoiconic as Homoiconic, ilp as ILP, imageExtraction as ImageExtraction, inference as Inference, ingestion as Ingestion, type Interceptor, InternalServerError, type JsonValue$1 as JsonValue, LP, type ListConversationsResponse, type LubRequest, type LubResponse, namespaces as Namespaces, NetworkError, neuroSymbolic as NeuroSymbolic, NotFoundError, ontology as Ontology, optimize as Optimize, type OsfSearchRequest, type OsfSearchResponse, osfql as Osfql, type OsfqlRequest, type OsfqlResponse, type OsfqlValue, oversight as Oversight, type PaginationParams, type PlainFeatureMap, type PlainFeatureValue, plainValues as PlainValues, preferences as Preferences, proofEngine as ProofEngine, type PsiTermDto, type PsiTermInput, query as Query, rag as RAG, RateLimitError, type RateLimitInfo, reasoning as Reasoning, type ReasoningGroup, ReasoningLayerClient, ReasoningLayerError, type RequestOptions, reviews as Reviews, row as Row, SDK_VERSION, scenarios as Scenarios, SortBuilder, type SortDto, type SortInfoDto, sorts as Sorts, sources as Sources, spaces as Spaces, statistical as Statistical, synthetic as Synthetic, type SystemGroup, type TermDto, type TermInputArg, type TermInputDto, type TermListResponse, type TermPatternDto, type TermResponse, terms as Terms, TimeoutError, type TurnDto, type UpdateTermRequest, utilities as Utilities, ValidationError, Value, type ValueDto, values as Values, visualization as Visualization, WebSocketClient, WebSocketConnection, webhookActions as WebhookActions, type WorkflowGroup, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
|