graphlit-client 1.0.20260217004 → 1.0.20260217005

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,7 +3,7 @@ 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 } from "./types/agent.js";
5
5
  import { AgentStreamEvent } from "./types/ui-events.js";
6
- export type { AgentOptions, AgentResult, StreamAgentOptions, ToolCallResult, UsageInfo, AgentError, } from "./types/agent.js";
6
+ export type { AgentOptions, AgentResult, ArtifactCollector, StreamAgentOptions, ToolCallResult, UsageInfo, AgentError, } from "./types/agent.js";
7
7
  export type { AgentStreamEvent } from "./types/ui-events.js";
8
8
  export interface RetryConfig {
9
9
  /** Maximum number of retry attempts (default: 5) */
@@ -929,10 +929,11 @@ declare class Graphlit {
929
929
  * @param completionTime - The time taken for completion, optional.
930
930
  * @param ttft - Time to first token, optional.
931
931
  * @param throughput - Tokens per second throughput, optional.
932
+ * @param artifacts - The artifacts produced during the completion, optional.
932
933
  * @param correlationId - The tenant correlation identifier, optional.
933
934
  * @returns The completed conversation.
934
935
  */
935
- completeConversation(completion: string, id: string, completionTime?: Types.Scalars["TimeSpan"]["input"], ttft?: Types.Scalars["TimeSpan"]["input"], throughput?: Types.Scalars["Float"]["input"], correlationId?: string): Promise<Types.CompleteConversationMutation>;
936
+ completeConversation(completion: string, id: string, completionTime?: Types.Scalars["TimeSpan"]["input"], ttft?: Types.Scalars["TimeSpan"]["input"], throughput?: Types.Scalars["Float"]["input"], artifacts?: Types.EntityReferenceInput[], correlationId?: string): Promise<Types.CompleteConversationMutation>;
936
937
  /**
937
938
  * Asks a question about Graphlit SDK usage.
938
939
  * @param prompt - The question about Graphlit.
package/dist/client.js CHANGED
@@ -1754,16 +1754,18 @@ class Graphlit {
1754
1754
  * @param completionTime - The time taken for completion, optional.
1755
1755
  * @param ttft - Time to first token, optional.
1756
1756
  * @param throughput - Tokens per second throughput, optional.
1757
+ * @param artifacts - The artifacts produced during the completion, optional.
1757
1758
  * @param correlationId - The tenant correlation identifier, optional.
1758
1759
  * @returns The completed conversation.
1759
1760
  */
1760
- async completeConversation(completion, id, completionTime, ttft, throughput, correlationId) {
1761
+ async completeConversation(completion, id, completionTime, ttft, throughput, artifacts, correlationId) {
1761
1762
  return this.mutateAndCheckError(Documents.CompleteConversation, {
1762
1763
  completion: completion,
1763
1764
  id: id,
1764
1765
  completionTime: completionTime,
1765
1766
  ttft: ttft,
1766
1767
  throughput: throughput,
1768
+ artifacts: artifacts,
1767
1769
  correlationId: correlationId,
1768
1770
  });
1769
1771
  }
@@ -4909,6 +4911,19 @@ class Graphlit {
4909
4911
  async executeStreamingAgent(prompt, conversationId, specification, tools, toolHandlers, uiAdapter, maxRounds, abortSignal, mimeType, data, correlationId, persona) {
4910
4912
  let currentRound = 0;
4911
4913
  let fullMessage = "";
4914
+ // Collects artifact content IDs from tool handlers (e.g. code_execution).
4915
+ // Handlers register async ingestion promises; we await all of them before
4916
+ // completeConversation so the IDs are available without blocking the LLM.
4917
+ const pendingArtifacts = [];
4918
+ const artifactCollector = {
4919
+ addPending(p) {
4920
+ pendingArtifacts.push(p);
4921
+ },
4922
+ async resolve() {
4923
+ const results = await Promise.all(pendingArtifacts);
4924
+ return results.filter((r) => r != null);
4925
+ },
4926
+ };
4912
4927
  // Start the conversation
4913
4928
  uiAdapter.handleEvent({
4914
4929
  type: "start",
@@ -5369,7 +5384,7 @@ class Graphlit {
5369
5384
  }
5370
5385
  }
5371
5386
  // Execute tool
5372
- const result = await handler(args);
5387
+ const result = await handler(args, artifactCollector);
5373
5388
  // Update UI with complete event including result
5374
5389
  uiAdapter.handleEvent({
5375
5390
  type: "tool_call_complete",
@@ -5436,7 +5451,9 @@ class Graphlit {
5436
5451
  const seconds = ms / 1000;
5437
5452
  return `PT${seconds}S`;
5438
5453
  };
5439
- const completeResponse = await this.completeConversation(trimmedMessage, conversationId, millisecondsToTimeSpan(completionTime), millisecondsToTimeSpan(ttft), throughput, correlationId);
5454
+ // Await any pending artifact ingestions so content IDs are available
5455
+ const collectedArtifacts = await artifactCollector.resolve();
5456
+ const completeResponse = await this.completeConversation(trimmedMessage, conversationId, millisecondsToTimeSpan(completionTime), millisecondsToTimeSpan(ttft), throughput, collectedArtifacts.length > 0 ? collectedArtifacts : undefined, correlationId);
5440
5457
  // Extract token count from the response
5441
5458
  finalTokens =
5442
5459
  completeResponse.completeConversation?.message?.tokens ?? undefined;
@@ -1057,6 +1057,12 @@ export const DescribeEncodedImage = gql `
1057
1057
  mimeType
1058
1058
  toolCallId
1059
1059
  toolCallResponse
1060
+ artifacts {
1061
+ id
1062
+ name
1063
+ mimeType
1064
+ uri
1065
+ }
1060
1066
  }
1061
1067
  }
1062
1068
  `;
@@ -1198,6 +1204,12 @@ export const DescribeImage = gql `
1198
1204
  mimeType
1199
1205
  toolCallId
1200
1206
  toolCallResponse
1207
+ artifacts {
1208
+ id
1209
+ name
1210
+ mimeType
1211
+ uri
1212
+ }
1201
1213
  }
1202
1214
  }
1203
1215
  `;
@@ -4175,6 +4187,12 @@ export const AskGraphlit = gql `
4175
4187
  mimeType
4176
4188
  toolCallId
4177
4189
  toolCallResponse
4190
+ artifacts {
4191
+ id
4192
+ name
4193
+ mimeType
4194
+ uri
4195
+ }
4178
4196
  }
4179
4197
  messageCount
4180
4198
  }
@@ -4211,13 +4229,14 @@ export const CloseConversation = gql `
4211
4229
  }
4212
4230
  `;
4213
4231
  export const CompleteConversation = gql `
4214
- mutation CompleteConversation($completion: String!, $id: ID!, $completionTime: TimeSpan, $ttft: TimeSpan, $throughput: Float, $correlationId: String) {
4232
+ mutation CompleteConversation($completion: String!, $id: ID!, $completionTime: TimeSpan, $ttft: TimeSpan, $throughput: Float, $artifacts: [EntityReferenceInput!], $correlationId: String) {
4215
4233
  completeConversation(
4216
4234
  completion: $completion
4217
4235
  id: $id
4218
4236
  completionTime: $completionTime
4219
4237
  ttft: $ttft
4220
4238
  throughput: $throughput
4239
+ artifacts: $artifacts
4221
4240
  correlationId: $correlationId
4222
4241
  ) {
4223
4242
  conversation {
@@ -4354,6 +4373,12 @@ export const CompleteConversation = gql `
4354
4373
  mimeType
4355
4374
  toolCallId
4356
4375
  toolCallResponse
4376
+ artifacts {
4377
+ id
4378
+ name
4379
+ mimeType
4380
+ uri
4381
+ }
4357
4382
  }
4358
4383
  messageCount
4359
4384
  facets {
@@ -4539,6 +4564,12 @@ export const CompleteConversation = gql `
4539
4564
  mimeType
4540
4565
  toolCallId
4541
4566
  toolCallResponse
4567
+ artifacts {
4568
+ id
4569
+ name
4570
+ mimeType
4571
+ uri
4572
+ }
4542
4573
  }
4543
4574
  }
4544
4575
  }
@@ -4685,6 +4716,12 @@ export const ContinueConversation = gql `
4685
4716
  mimeType
4686
4717
  toolCallId
4687
4718
  toolCallResponse
4719
+ artifacts {
4720
+ id
4721
+ name
4722
+ mimeType
4723
+ uri
4724
+ }
4688
4725
  }
4689
4726
  messageCount
4690
4727
  facets {
@@ -4870,6 +4907,12 @@ export const ContinueConversation = gql `
4870
4907
  mimeType
4871
4908
  toolCallId
4872
4909
  toolCallResponse
4910
+ artifacts {
4911
+ id
4912
+ name
4913
+ mimeType
4914
+ uri
4915
+ }
4873
4916
  }
4874
4917
  }
4875
4918
  }
@@ -5066,6 +5109,12 @@ export const FormatConversation = gql `
5066
5109
  mimeType
5067
5110
  toolCallId
5068
5111
  toolCallResponse
5112
+ artifacts {
5113
+ id
5114
+ name
5115
+ mimeType
5116
+ uri
5117
+ }
5069
5118
  }
5070
5119
  messageCount
5071
5120
  facets {
@@ -5251,6 +5300,12 @@ export const FormatConversation = gql `
5251
5300
  mimeType
5252
5301
  toolCallId
5253
5302
  toolCallResponse
5303
+ artifacts {
5304
+ id
5305
+ name
5306
+ mimeType
5307
+ uri
5308
+ }
5254
5309
  }
5255
5310
  }
5256
5311
  }
@@ -5400,6 +5455,12 @@ export const GetConversation = gql `
5400
5455
  mimeType
5401
5456
  toolCallId
5402
5457
  toolCallResponse
5458
+ artifacts {
5459
+ id
5460
+ name
5461
+ mimeType
5462
+ uri
5463
+ }
5403
5464
  }
5404
5465
  transcriptUri
5405
5466
  turns {
@@ -5802,6 +5863,12 @@ export const Prompt = gql `
5802
5863
  mimeType
5803
5864
  toolCallId
5804
5865
  toolCallResponse
5866
+ artifacts {
5867
+ id
5868
+ name
5869
+ mimeType
5870
+ uri
5871
+ }
5805
5872
  }
5806
5873
  error
5807
5874
  }
@@ -5956,6 +6023,12 @@ export const PromptConversation = gql `
5956
6023
  mimeType
5957
6024
  toolCallId
5958
6025
  toolCallResponse
6026
+ artifacts {
6027
+ id
6028
+ name
6029
+ mimeType
6030
+ uri
6031
+ }
5959
6032
  }
5960
6033
  messageCount
5961
6034
  facets {
@@ -6141,6 +6214,12 @@ export const PromptConversation = gql `
6141
6214
  mimeType
6142
6215
  toolCallId
6143
6216
  toolCallResponse
6217
+ artifacts {
6218
+ id
6219
+ name
6220
+ mimeType
6221
+ uri
6222
+ }
6144
6223
  }
6145
6224
  }
6146
6225
  }
@@ -6421,6 +6500,12 @@ export const QueryConversations = gql `
6421
6500
  mimeType
6422
6501
  toolCallId
6423
6502
  toolCallResponse
6503
+ artifacts {
6504
+ id
6505
+ name
6506
+ mimeType
6507
+ uri
6508
+ }
6424
6509
  }
6425
6510
  transcriptUri
6426
6511
  turns {
@@ -6790,6 +6875,12 @@ export const QueryConversationsClusters = gql `
6790
6875
  mimeType
6791
6876
  toolCallId
6792
6877
  toolCallResponse
6878
+ artifacts {
6879
+ id
6880
+ name
6881
+ mimeType
6882
+ uri
6883
+ }
6793
6884
  }
6794
6885
  transcriptUri
6795
6886
  turns {
@@ -7312,6 +7403,12 @@ export const ReviseContent = gql `
7312
7403
  mimeType
7313
7404
  toolCallId
7314
7405
  toolCallResponse
7406
+ artifacts {
7407
+ id
7408
+ name
7409
+ mimeType
7410
+ uri
7411
+ }
7315
7412
  }
7316
7413
  messageCount
7317
7414
  }
@@ -7461,6 +7558,12 @@ export const ReviseEncodedImage = gql `
7461
7558
  mimeType
7462
7559
  toolCallId
7463
7560
  toolCallResponse
7561
+ artifacts {
7562
+ id
7563
+ name
7564
+ mimeType
7565
+ uri
7566
+ }
7464
7567
  }
7465
7568
  messageCount
7466
7569
  }
@@ -7609,6 +7712,12 @@ export const ReviseImage = gql `
7609
7712
  mimeType
7610
7713
  toolCallId
7611
7714
  toolCallResponse
7715
+ artifacts {
7716
+ id
7717
+ name
7718
+ mimeType
7719
+ uri
7720
+ }
7612
7721
  }
7613
7722
  messageCount
7614
7723
  }
@@ -7757,6 +7866,12 @@ export const ReviseText = gql `
7757
7866
  mimeType
7758
7867
  toolCallId
7759
7868
  toolCallResponse
7869
+ artifacts {
7870
+ id
7871
+ name
7872
+ mimeType
7873
+ uri
7874
+ }
7760
7875
  }
7761
7876
  messageCount
7762
7877
  }
@@ -16300,6 +16415,12 @@ export const PromptSpecifications = gql `
16300
16415
  mimeType
16301
16416
  toolCallId
16302
16417
  toolCallResponse
16418
+ artifacts {
16419
+ id
16420
+ name
16421
+ mimeType
16422
+ uri
16423
+ }
16303
16424
  }
16304
16425
  error
16305
16426
  }
@@ -3634,6 +3634,8 @@ export type ConversationInput = {
3634
3634
  /** Represents a conversation message. */
3635
3635
  export type ConversationMessage = {
3636
3636
  __typename?: 'ConversationMessage';
3637
+ /** The content artifacts produced in this message turn, e.g., by code execution tools. */
3638
+ artifacts?: Maybe<Array<Maybe<Content>>>;
3637
3639
  /** The conversation message author. */
3638
3640
  author?: Maybe<Scalars['String']['output']>;
3639
3641
  /** The conversation message citations. */
@@ -3669,6 +3671,8 @@ export type ConversationMessage = {
3669
3671
  };
3670
3672
  /** Represents a conversation message. */
3671
3673
  export type ConversationMessageInput = {
3674
+ /** The content artifact references produced in this message turn, optional. */
3675
+ artifacts?: InputMaybe<Array<InputMaybe<EntityReferenceInput>>>;
3672
3676
  /** The conversation message author. */
3673
3677
  author?: InputMaybe<Scalars['String']['input']>;
3674
3678
  /** The elapsed time for the model to complete the prompt. */
@@ -13342,6 +13346,7 @@ export type MutationCloseConversationArgs = {
13342
13346
  id: Scalars['ID']['input'];
13343
13347
  };
13344
13348
  export type MutationCompleteConversationArgs = {
13349
+ artifacts?: InputMaybe<Array<EntityReferenceInput>>;
13345
13350
  completion: Scalars['String']['input'];
13346
13351
  completionTime?: InputMaybe<Scalars['TimeSpan']['input']>;
13347
13352
  correlationId?: InputMaybe<Scalars['String']['input']>;
@@ -22591,6 +22596,13 @@ export type DescribeEncodedImageMutation = {
22591
22596
  name: string;
22592
22597
  arguments: string;
22593
22598
  } | null> | null;
22599
+ artifacts?: Array<{
22600
+ __typename?: 'Content';
22601
+ id: string;
22602
+ name: string;
22603
+ mimeType?: string | null;
22604
+ uri?: any | null;
22605
+ } | null> | null;
22594
22606
  } | null;
22595
22607
  };
22596
22608
  export type DescribeImageMutationVariables = Exact<{
@@ -22740,6 +22752,13 @@ export type DescribeImageMutation = {
22740
22752
  name: string;
22741
22753
  arguments: string;
22742
22754
  } | null> | null;
22755
+ artifacts?: Array<{
22756
+ __typename?: 'Content';
22757
+ id: string;
22758
+ name: string;
22759
+ mimeType?: string | null;
22760
+ uri?: any | null;
22761
+ } | null> | null;
22743
22762
  } | null;
22744
22763
  };
22745
22764
  export type ExtractContentsMutationVariables = Exact<{
@@ -26107,6 +26126,13 @@ export type AskGraphlitMutation = {
26107
26126
  name: string;
26108
26127
  arguments: string;
26109
26128
  } | null> | null;
26129
+ artifacts?: Array<{
26130
+ __typename?: 'Content';
26131
+ id: string;
26132
+ name: string;
26133
+ mimeType?: string | null;
26134
+ uri?: any | null;
26135
+ } | null> | null;
26110
26136
  } | null;
26111
26137
  } | null;
26112
26138
  };
@@ -26155,6 +26181,7 @@ export type CompleteConversationMutationVariables = Exact<{
26155
26181
  completionTime?: InputMaybe<Scalars['TimeSpan']['input']>;
26156
26182
  ttft?: InputMaybe<Scalars['TimeSpan']['input']>;
26157
26183
  throughput?: InputMaybe<Scalars['Float']['input']>;
26184
+ artifacts?: InputMaybe<Array<EntityReferenceInput> | EntityReferenceInput>;
26158
26185
  correlationId?: InputMaybe<Scalars['String']['input']>;
26159
26186
  }>;
26160
26187
  export type CompleteConversationMutation = {
@@ -26305,6 +26332,13 @@ export type CompleteConversationMutation = {
26305
26332
  name: string;
26306
26333
  arguments: string;
26307
26334
  } | null> | null;
26335
+ artifacts?: Array<{
26336
+ __typename?: 'Content';
26337
+ id: string;
26338
+ name: string;
26339
+ mimeType?: string | null;
26340
+ uri?: any | null;
26341
+ } | null> | null;
26308
26342
  } | null;
26309
26343
  facets?: Array<{
26310
26344
  __typename?: 'ContentFacet';
@@ -26505,6 +26539,13 @@ export type CompleteConversationMutation = {
26505
26539
  name: string;
26506
26540
  arguments: string;
26507
26541
  } | null> | null;
26542
+ artifacts?: Array<{
26543
+ __typename?: 'Content';
26544
+ id: string;
26545
+ name: string;
26546
+ mimeType?: string | null;
26547
+ uri?: any | null;
26548
+ } | null> | null;
26508
26549
  } | null> | null;
26509
26550
  } | null;
26510
26551
  } | null;
@@ -26662,6 +26703,13 @@ export type ContinueConversationMutation = {
26662
26703
  name: string;
26663
26704
  arguments: string;
26664
26705
  } | null> | null;
26706
+ artifacts?: Array<{
26707
+ __typename?: 'Content';
26708
+ id: string;
26709
+ name: string;
26710
+ mimeType?: string | null;
26711
+ uri?: any | null;
26712
+ } | null> | null;
26665
26713
  } | null;
26666
26714
  facets?: Array<{
26667
26715
  __typename?: 'ContentFacet';
@@ -26862,6 +26910,13 @@ export type ContinueConversationMutation = {
26862
26910
  name: string;
26863
26911
  arguments: string;
26864
26912
  } | null> | null;
26913
+ artifacts?: Array<{
26914
+ __typename?: 'Content';
26915
+ id: string;
26916
+ name: string;
26917
+ mimeType?: string | null;
26918
+ uri?: any | null;
26919
+ } | null> | null;
26865
26920
  } | null> | null;
26866
26921
  } | null;
26867
26922
  } | null;
@@ -27085,6 +27140,13 @@ export type FormatConversationMutation = {
27085
27140
  name: string;
27086
27141
  arguments: string;
27087
27142
  } | null> | null;
27143
+ artifacts?: Array<{
27144
+ __typename?: 'Content';
27145
+ id: string;
27146
+ name: string;
27147
+ mimeType?: string | null;
27148
+ uri?: any | null;
27149
+ } | null> | null;
27088
27150
  } | null;
27089
27151
  facets?: Array<{
27090
27152
  __typename?: 'ContentFacet';
@@ -27285,6 +27347,13 @@ export type FormatConversationMutation = {
27285
27347
  name: string;
27286
27348
  arguments: string;
27287
27349
  } | null> | null;
27350
+ artifacts?: Array<{
27351
+ __typename?: 'Content';
27352
+ id: string;
27353
+ name: string;
27354
+ mimeType?: string | null;
27355
+ uri?: any | null;
27356
+ } | null> | null;
27288
27357
  } | null> | null;
27289
27358
  } | null;
27290
27359
  } | null;
@@ -27449,6 +27518,13 @@ export type GetConversationQuery = {
27449
27518
  name: string;
27450
27519
  arguments: string;
27451
27520
  } | null> | null;
27521
+ artifacts?: Array<{
27522
+ __typename?: 'Content';
27523
+ id: string;
27524
+ name: string;
27525
+ mimeType?: string | null;
27526
+ uri?: any | null;
27527
+ } | null> | null;
27452
27528
  } | null> | null;
27453
27529
  turns?: Array<{
27454
27530
  __typename?: 'ConversationTurn';
@@ -27923,6 +27999,13 @@ export type PromptMutation = {
27923
27999
  name: string;
27924
28000
  arguments: string;
27925
28001
  } | null> | null;
28002
+ artifacts?: Array<{
28003
+ __typename?: 'Content';
28004
+ id: string;
28005
+ name: string;
28006
+ mimeType?: string | null;
28007
+ uri?: any | null;
28008
+ } | null> | null;
27926
28009
  } | null> | null;
27927
28010
  } | null;
27928
28011
  };
@@ -28087,6 +28170,13 @@ export type PromptConversationMutation = {
28087
28170
  name: string;
28088
28171
  arguments: string;
28089
28172
  } | null> | null;
28173
+ artifacts?: Array<{
28174
+ __typename?: 'Content';
28175
+ id: string;
28176
+ name: string;
28177
+ mimeType?: string | null;
28178
+ uri?: any | null;
28179
+ } | null> | null;
28090
28180
  } | null;
28091
28181
  facets?: Array<{
28092
28182
  __typename?: 'ContentFacet';
@@ -28287,6 +28377,13 @@ export type PromptConversationMutation = {
28287
28377
  name: string;
28288
28378
  arguments: string;
28289
28379
  } | null> | null;
28380
+ artifacts?: Array<{
28381
+ __typename?: 'Content';
28382
+ id: string;
28383
+ name: string;
28384
+ mimeType?: string | null;
28385
+ uri?: any | null;
28386
+ } | null> | null;
28290
28387
  } | null> | null;
28291
28388
  } | null;
28292
28389
  } | null;
@@ -28591,6 +28688,13 @@ export type QueryConversationsQuery = {
28591
28688
  name: string;
28592
28689
  arguments: string;
28593
28690
  } | null> | null;
28691
+ artifacts?: Array<{
28692
+ __typename?: 'Content';
28693
+ id: string;
28694
+ name: string;
28695
+ mimeType?: string | null;
28696
+ uri?: any | null;
28697
+ } | null> | null;
28594
28698
  } | null> | null;
28595
28699
  turns?: Array<{
28596
28700
  __typename?: 'ConversationTurn';
@@ -29028,6 +29132,13 @@ export type QueryConversationsClustersQuery = {
29028
29132
  name: string;
29029
29133
  arguments: string;
29030
29134
  } | null> | null;
29135
+ artifacts?: Array<{
29136
+ __typename?: 'Content';
29137
+ id: string;
29138
+ name: string;
29139
+ mimeType?: string | null;
29140
+ uri?: any | null;
29141
+ } | null> | null;
29031
29142
  } | null> | null;
29032
29143
  turns?: Array<{
29033
29144
  __typename?: 'ConversationTurn';
@@ -29652,6 +29763,13 @@ export type ReviseContentMutation = {
29652
29763
  name: string;
29653
29764
  arguments: string;
29654
29765
  } | null> | null;
29766
+ artifacts?: Array<{
29767
+ __typename?: 'Content';
29768
+ id: string;
29769
+ name: string;
29770
+ mimeType?: string | null;
29771
+ uri?: any | null;
29772
+ } | null> | null;
29655
29773
  } | null;
29656
29774
  } | null;
29657
29775
  };
@@ -29811,6 +29929,13 @@ export type ReviseEncodedImageMutation = {
29811
29929
  name: string;
29812
29930
  arguments: string;
29813
29931
  } | null> | null;
29932
+ artifacts?: Array<{
29933
+ __typename?: 'Content';
29934
+ id: string;
29935
+ name: string;
29936
+ mimeType?: string | null;
29937
+ uri?: any | null;
29938
+ } | null> | null;
29814
29939
  } | null;
29815
29940
  } | null;
29816
29941
  };
@@ -29969,6 +30094,13 @@ export type ReviseImageMutation = {
29969
30094
  name: string;
29970
30095
  arguments: string;
29971
30096
  } | null> | null;
30097
+ artifacts?: Array<{
30098
+ __typename?: 'Content';
30099
+ id: string;
30100
+ name: string;
30101
+ mimeType?: string | null;
30102
+ uri?: any | null;
30103
+ } | null> | null;
29972
30104
  } | null;
29973
30105
  } | null;
29974
30106
  };
@@ -30127,6 +30259,13 @@ export type ReviseTextMutation = {
30127
30259
  name: string;
30128
30260
  arguments: string;
30129
30261
  } | null> | null;
30262
+ artifacts?: Array<{
30263
+ __typename?: 'Content';
30264
+ id: string;
30265
+ name: string;
30266
+ mimeType?: string | null;
30267
+ uri?: any | null;
30268
+ } | null> | null;
30130
30269
  } | null;
30131
30270
  } | null;
30132
30271
  };
@@ -40497,6 +40636,13 @@ export type PromptSpecificationsMutation = {
40497
40636
  name: string;
40498
40637
  arguments: string;
40499
40638
  } | null> | null;
40639
+ artifacts?: Array<{
40640
+ __typename?: 'Content';
40641
+ id: string;
40642
+ name: string;
40643
+ mimeType?: string | null;
40644
+ uri?: any | null;
40645
+ } | null> | null;
40500
40646
  } | null> | null;
40501
40647
  } | null> | null;
40502
40648
  };
@@ -1,5 +1,13 @@
1
1
  import { ConversationMessage, ConversationToolCall } from "../generated/graphql-types.js";
2
- export type ToolHandler = (args: any) => Promise<any>;
2
+ export interface ArtifactCollector {
3
+ addPending(promise: Promise<{
4
+ id: string;
5
+ } | undefined>): void;
6
+ resolve(): Promise<{
7
+ id: string;
8
+ }[]>;
9
+ }
10
+ export type ToolHandler = (args: any, artifacts?: ArtifactCollector) => Promise<any>;
3
11
  export interface AgentOptions {
4
12
  maxToolRounds?: number;
5
13
  timeout?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphlit-client",
3
- "version": "1.0.20260217004",
3
+ "version": "1.0.20260217005",
4
4
  "description": "Graphlit API Client for TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/client.js",