graphlit-client 1.0.20260422004 → 1.0.20260424002
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/client.d.ts
CHANGED
|
@@ -3,6 +3,70 @@ import type { NormalizedCacheObject } from "@apollo/client/core/index.js";
|
|
|
3
3
|
import * as Types from "./generated/graphql-types.js";
|
|
4
4
|
import { AgentOptions, AgentResult, StreamAgentOptions, ToolHandler, RunAgentOptions, RunAgentResult } from "./types/agent.js";
|
|
5
5
|
import { AgentStreamEvent } from "./types/ui-events.js";
|
|
6
|
+
type ConversationFlowEntityReference = {
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string | null;
|
|
9
|
+
};
|
|
10
|
+
export type GetConversationFlowQueryVariables = {
|
|
11
|
+
id: string;
|
|
12
|
+
correlationId?: string | null;
|
|
13
|
+
};
|
|
14
|
+
export type GetConversationFlowQuery = {
|
|
15
|
+
conversation?: {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
creationDate: string;
|
|
19
|
+
modifiedDate?: string | null;
|
|
20
|
+
state: string;
|
|
21
|
+
correlationId?: string | null;
|
|
22
|
+
type?: string | null;
|
|
23
|
+
transcriptUri?: string | null;
|
|
24
|
+
messageCount?: number | null;
|
|
25
|
+
turnCount?: number | null;
|
|
26
|
+
agent?: ConversationFlowEntityReference | null;
|
|
27
|
+
persona?: ConversationFlowEntityReference | null;
|
|
28
|
+
specification?: ConversationFlowEntityReference | null;
|
|
29
|
+
parent?: ConversationFlowEntityReference | null;
|
|
30
|
+
children?: Array<ConversationFlowEntityReference | null> | null;
|
|
31
|
+
turns?: Array<{
|
|
32
|
+
index?: number | null;
|
|
33
|
+
tokens?: number | null;
|
|
34
|
+
timestamp?: string | null;
|
|
35
|
+
text?: string | null;
|
|
36
|
+
relevance?: number | null;
|
|
37
|
+
summary?: string | null;
|
|
38
|
+
messages?: Array<{
|
|
39
|
+
role: string;
|
|
40
|
+
author?: string | null;
|
|
41
|
+
message?: string | null;
|
|
42
|
+
tokens?: number | null;
|
|
43
|
+
throughput?: number | null;
|
|
44
|
+
ttft?: string | null;
|
|
45
|
+
completionTime?: string | null;
|
|
46
|
+
timestamp?: string | null;
|
|
47
|
+
modelService?: string | null;
|
|
48
|
+
model?: string | null;
|
|
49
|
+
data?: string | null;
|
|
50
|
+
mimeType?: string | null;
|
|
51
|
+
toolCallId?: string | null;
|
|
52
|
+
toolCallResponse?: string | null;
|
|
53
|
+
thinkingContent?: string | null;
|
|
54
|
+
thinkingSignature?: string | null;
|
|
55
|
+
toolCalls?: Array<{
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
arguments: string;
|
|
59
|
+
startedAt?: string | null;
|
|
60
|
+
completedAt?: string | null;
|
|
61
|
+
durationMs?: number | null;
|
|
62
|
+
status?: string | null;
|
|
63
|
+
failedAt?: string | null;
|
|
64
|
+
firstStatusAt?: string | null;
|
|
65
|
+
} | null> | null;
|
|
66
|
+
} | null> | null;
|
|
67
|
+
} | null> | null;
|
|
68
|
+
} | null;
|
|
69
|
+
};
|
|
6
70
|
export type { AgentOptions, AgentResult, ArtifactCollector, ContextStrategy, ContextManagementAction, StreamAgentOptions, ToolCallResult, UsageInfo, AgentError, RunAgentOptions, RunAgentResult, TurnResult, BudgetSnapshot, HarnessStatus, QualityAssessment, } from "./types/agent.js";
|
|
7
71
|
export { TokenBudgetTracker, truncateToolResult, estimateTokens, isAccurateTokenCounting, } from "./helpers/context-management.js";
|
|
8
72
|
export type { AgentStreamEvent, ReasoningFormat, ReasoningMetadata, } from "./types/ui-events.js";
|
|
@@ -1080,6 +1144,13 @@ declare class Graphlit {
|
|
|
1080
1144
|
* @returns The conversation.
|
|
1081
1145
|
*/
|
|
1082
1146
|
getConversation(id: string): Promise<Types.GetConversationQuery>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Lookup a conversation with only fields needed by flow visualizations.
|
|
1149
|
+
* @param id - ID of the conversation.
|
|
1150
|
+
* @param correlationId - The tenant correlation identifier, optional.
|
|
1151
|
+
* @returns The lightweight conversation flow payload.
|
|
1152
|
+
*/
|
|
1153
|
+
getConversationFlow(id: string, correlationId?: string): Promise<GetConversationFlowQuery>;
|
|
1083
1154
|
/**
|
|
1084
1155
|
* Retrieves conversations based on the provided filter criteria.
|
|
1085
1156
|
* @param filter - The filter criteria to apply when retrieving conversations.
|
|
@@ -1872,6 +1943,12 @@ declare class Graphlit {
|
|
|
1872
1943
|
* @returns The updated connector.
|
|
1873
1944
|
*/
|
|
1874
1945
|
updateConnector(connector: Types.ConnectorUpdateInput): Promise<Types.UpdateConnectorMutation>;
|
|
1946
|
+
/**
|
|
1947
|
+
* Creates or updates a connector.
|
|
1948
|
+
* @param connector - The connector to create or update.
|
|
1949
|
+
* @returns The created or updated connector.
|
|
1950
|
+
*/
|
|
1951
|
+
upsertConnector(connector: Types.ConnectorInput): Promise<Types.UpsertConnectorMutation>;
|
|
1875
1952
|
/**
|
|
1876
1953
|
* Deletes a connector.
|
|
1877
1954
|
* @param id - The ID of the connector to delete.
|
package/dist/client.js
CHANGED
|
@@ -3,6 +3,7 @@ import jwt from "jsonwebtoken";
|
|
|
3
3
|
import { ApolloClient, InMemoryCache, createHttpLink, ApolloLink, ApolloError, } from "@apollo/client/core/index.js";
|
|
4
4
|
// Apollo retry link for resilient error handling
|
|
5
5
|
import { RetryLink } from "@apollo/client/link/retry/index.js";
|
|
6
|
+
import gql from "graphql-tag";
|
|
6
7
|
import { attachPartialErrors } from "./partial-errors.js";
|
|
7
8
|
import * as Types from "./generated/graphql-types.js";
|
|
8
9
|
import * as Documents from "./generated/graphql-documents.js";
|
|
@@ -29,6 +30,81 @@ let CohereClientV2;
|
|
|
29
30
|
let Mistral;
|
|
30
31
|
let BedrockRuntimeClient;
|
|
31
32
|
let Cerebras;
|
|
33
|
+
// Special-purpose lightweight conversation query for agent-flow visualization.
|
|
34
|
+
// This is hand-written instead of generated so UI clients can avoid fetching
|
|
35
|
+
// heavy citation/content/artifact fields without changing codegen templates.
|
|
36
|
+
const GetConversationFlow = gql `
|
|
37
|
+
query GetConversationFlow($id: ID!, $correlationId: String) {
|
|
38
|
+
conversation(id: $id, correlationId: $correlationId) {
|
|
39
|
+
id
|
|
40
|
+
name
|
|
41
|
+
creationDate
|
|
42
|
+
modifiedDate
|
|
43
|
+
state
|
|
44
|
+
correlationId
|
|
45
|
+
type
|
|
46
|
+
transcriptUri
|
|
47
|
+
turns {
|
|
48
|
+
index
|
|
49
|
+
messages {
|
|
50
|
+
role
|
|
51
|
+
author
|
|
52
|
+
message
|
|
53
|
+
toolCalls {
|
|
54
|
+
id
|
|
55
|
+
name
|
|
56
|
+
arguments
|
|
57
|
+
startedAt
|
|
58
|
+
completedAt
|
|
59
|
+
durationMs
|
|
60
|
+
status
|
|
61
|
+
failedAt
|
|
62
|
+
firstStatusAt
|
|
63
|
+
}
|
|
64
|
+
tokens
|
|
65
|
+
throughput
|
|
66
|
+
ttft
|
|
67
|
+
completionTime
|
|
68
|
+
timestamp
|
|
69
|
+
modelService
|
|
70
|
+
model
|
|
71
|
+
data
|
|
72
|
+
mimeType
|
|
73
|
+
toolCallId
|
|
74
|
+
toolCallResponse
|
|
75
|
+
thinkingContent
|
|
76
|
+
thinkingSignature
|
|
77
|
+
}
|
|
78
|
+
tokens
|
|
79
|
+
timestamp
|
|
80
|
+
text
|
|
81
|
+
relevance
|
|
82
|
+
summary
|
|
83
|
+
}
|
|
84
|
+
messageCount
|
|
85
|
+
turnCount
|
|
86
|
+
agent {
|
|
87
|
+
id
|
|
88
|
+
}
|
|
89
|
+
persona {
|
|
90
|
+
id
|
|
91
|
+
name
|
|
92
|
+
}
|
|
93
|
+
specification {
|
|
94
|
+
id
|
|
95
|
+
name
|
|
96
|
+
}
|
|
97
|
+
parent {
|
|
98
|
+
id
|
|
99
|
+
name
|
|
100
|
+
}
|
|
101
|
+
children {
|
|
102
|
+
id
|
|
103
|
+
name
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
32
108
|
function nowIsoString() {
|
|
33
109
|
return new Date().toISOString();
|
|
34
110
|
}
|
|
@@ -2068,6 +2144,15 @@ class Graphlit {
|
|
|
2068
2144
|
async getConversation(id) {
|
|
2069
2145
|
return this.queryAndCheckError(Documents.GetConversation, { id: id });
|
|
2070
2146
|
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Lookup a conversation with only fields needed by flow visualizations.
|
|
2149
|
+
* @param id - ID of the conversation.
|
|
2150
|
+
* @param correlationId - The tenant correlation identifier, optional.
|
|
2151
|
+
* @returns The lightweight conversation flow payload.
|
|
2152
|
+
*/
|
|
2153
|
+
async getConversationFlow(id, correlationId) {
|
|
2154
|
+
return this.queryAndCheckError(GetConversationFlow, { id: id, correlationId: correlationId });
|
|
2155
|
+
}
|
|
2071
2156
|
/**
|
|
2072
2157
|
* Retrieves conversations based on the provided filter criteria.
|
|
2073
2158
|
* @param filter - The filter criteria to apply when retrieving conversations.
|
|
@@ -3293,16 +3378,14 @@ class Graphlit {
|
|
|
3293
3378
|
async updateConnector(connector) {
|
|
3294
3379
|
return this.mutateAndCheckError(Documents.UpdateConnector, { connector: connector });
|
|
3295
3380
|
}
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
{ connector:
|
|
3303
|
-
>(Documents.UpsertConnector, { connector: connector });
|
|
3381
|
+
/**
|
|
3382
|
+
* Creates or updates a connector.
|
|
3383
|
+
* @param connector - The connector to create or update.
|
|
3384
|
+
* @returns The created or updated connector.
|
|
3385
|
+
*/
|
|
3386
|
+
async upsertConnector(connector) {
|
|
3387
|
+
return this.mutateAndCheckError(Documents.UpsertConnector, { connector: connector });
|
|
3304
3388
|
}
|
|
3305
|
-
*/
|
|
3306
3389
|
/**
|
|
3307
3390
|
* Deletes a connector.
|
|
3308
3391
|
* @param id - The ID of the connector to delete.
|
|
@@ -61,6 +61,7 @@ export declare const DeleteConnector: import("graphql").DocumentNode;
|
|
|
61
61
|
export declare const GetConnector: import("graphql").DocumentNode;
|
|
62
62
|
export declare const QueryConnectors: import("graphql").DocumentNode;
|
|
63
63
|
export declare const UpdateConnector: import("graphql").DocumentNode;
|
|
64
|
+
export declare const UpsertConnector: import("graphql").DocumentNode;
|
|
64
65
|
export declare const AddContentLabel: import("graphql").DocumentNode;
|
|
65
66
|
export declare const ApproveContent: import("graphql").DocumentNode;
|
|
66
67
|
export declare const ClassifyContents: import("graphql").DocumentNode;
|
|
@@ -2091,6 +2091,16 @@ export const UpdateConnector = gql `
|
|
|
2091
2091
|
}
|
|
2092
2092
|
}
|
|
2093
2093
|
`;
|
|
2094
|
+
export const UpsertConnector = gql `
|
|
2095
|
+
mutation UpsertConnector($connector: ConnectorInput!) {
|
|
2096
|
+
upsertConnector(connector: $connector) {
|
|
2097
|
+
id
|
|
2098
|
+
name
|
|
2099
|
+
state
|
|
2100
|
+
type
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
`;
|
|
2094
2104
|
export const AddContentLabel = gql `
|
|
2095
2105
|
mutation AddContentLabel($id: ID!, $label: String!) {
|
|
2096
2106
|
addContentLabel(id: $id, label: $label) {
|
|
@@ -3477,7 +3477,7 @@ export type Content = {
|
|
|
3477
3477
|
links?: Maybe<Array<LinkReference>>;
|
|
3478
3478
|
/** The geo-location of the content. */
|
|
3479
3479
|
location?: Maybe<Point>;
|
|
3480
|
-
/** The content text formatted as Markdown. Returns the persisted
|
|
3480
|
+
/** The content text formatted as Markdown. Returns the persisted Markdown body when available, and otherwise falls back to on-demand export. Export is bounded by stored token count. */
|
|
3481
3481
|
markdown?: Maybe<Scalars['String']['output']>;
|
|
3482
3482
|
/** The persisted Markdown export URI of the content. This references the frontmatter-aware Markdown file written under the content folder. */
|
|
3483
3483
|
markdownUri?: Maybe<Scalars['URL']['output']>;
|
|
@@ -17042,6 +17042,8 @@ export type Mutation = {
|
|
|
17042
17042
|
upsertAlert?: Maybe<Alert>;
|
|
17043
17043
|
/** Upserts a category. */
|
|
17044
17044
|
upsertCategory?: Maybe<Category>;
|
|
17045
|
+
/** Upserts a connector. */
|
|
17046
|
+
upsertConnector?: Maybe<Connector>;
|
|
17045
17047
|
/** Upserts an emotion. */
|
|
17046
17048
|
upsertEmotion?: Maybe<Emotion>;
|
|
17047
17049
|
/** Upserts a label. */
|
|
@@ -18327,6 +18329,9 @@ export type MutationUpsertCategoryArgs = {
|
|
|
18327
18329
|
category: CategoryInput;
|
|
18328
18330
|
correlationId?: InputMaybe<Scalars['String']['input']>;
|
|
18329
18331
|
};
|
|
18332
|
+
export type MutationUpsertConnectorArgs = {
|
|
18333
|
+
connector: ConnectorInput;
|
|
18334
|
+
};
|
|
18330
18335
|
export type MutationUpsertEmotionArgs = {
|
|
18331
18336
|
correlationId?: InputMaybe<Scalars['String']['input']>;
|
|
18332
18337
|
emotion: EmotionInput;
|
|
@@ -29308,6 +29313,19 @@ export type UpdateConnectorMutation = {
|
|
|
29308
29313
|
type?: ConnectorTypes | null;
|
|
29309
29314
|
} | null;
|
|
29310
29315
|
};
|
|
29316
|
+
export type UpsertConnectorMutationVariables = Exact<{
|
|
29317
|
+
connector: ConnectorInput;
|
|
29318
|
+
}>;
|
|
29319
|
+
export type UpsertConnectorMutation = {
|
|
29320
|
+
__typename?: 'Mutation';
|
|
29321
|
+
upsertConnector?: {
|
|
29322
|
+
__typename?: 'Connector';
|
|
29323
|
+
id: string;
|
|
29324
|
+
name: string;
|
|
29325
|
+
state: EntityState;
|
|
29326
|
+
type?: ConnectorTypes | null;
|
|
29327
|
+
} | null;
|
|
29328
|
+
};
|
|
29311
29329
|
export type AddContentLabelMutationVariables = Exact<{
|
|
29312
29330
|
id: Scalars['ID']['input'];
|
|
29313
29331
|
label: Scalars['String']['input'];
|