@hasura/promptql 2.0.0-alpha.22 → 2.0.0-alpha.24

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 CHANGED
@@ -61,7 +61,6 @@ import { PromptQLSdk } from '@hasura/promptql';
61
61
 
62
62
  // Initialize the SDK
63
63
  const sdk = new PromptQLSdk({
64
- projectId: 'your-project-id',
65
64
  serviceAccountToken: 'your-service-account-token',
66
65
  });
67
66
 
package/dist/index.d.mts CHANGED
@@ -316,6 +316,18 @@ type AgentLoopActionUpdate = {
316
316
  artifact_modified: {
317
317
  artifact_update: ArtifactUpdate;
318
318
  };
319
+ } | {
320
+ sql_execute_start: {
321
+ sql_query_id: SqlQueryId;
322
+ sql: Sql;
323
+ is_streaming: boolean;
324
+ };
325
+ } | {
326
+ sql_execute_complete: {
327
+ sql_query_id: SqlQueryId;
328
+ outcome: SqlExecuteOutcome;
329
+ pushdown_mode: string;
330
+ };
319
331
  };
320
332
  type ArtifactType = "text" | "table" | "visualization" | "html" | "file";
321
333
  type ArtifactPreview = {
@@ -326,6 +338,33 @@ type ArtifactPreview = {
326
338
  }[];
327
339
  };
328
340
  };
341
+ type SqlQueryId = string;
342
+ /**
343
+ * A SQL query string.
344
+ */
345
+ type Sql = string;
346
+ type SqlExecuteOutcome = {
347
+ rows_returned: number;
348
+ duration_ms: number;
349
+ type: "success";
350
+ } | {
351
+ duration_ms: number;
352
+ type: "timeout";
353
+ } | {
354
+ errored_after_ms: number;
355
+ error: SqlErrorType;
356
+ type: "error";
357
+ };
358
+ /**
359
+ * Whether a SQL error was caused by the user (bad SQL) or by internal infrastructure.
360
+ */
361
+ type SqlErrorType = {
362
+ message: string;
363
+ type: "user";
364
+ } | {
365
+ message: string;
366
+ type: "internal";
367
+ };
329
368
  /**
330
369
  * The final result of executing an action.
331
370
  */
@@ -1848,7 +1887,7 @@ type ProgramRunnerActionResult = "WriteFile" | {
1848
1887
  } | {
1849
1888
  RunSavedProgram: ProgramRunResult;
1850
1889
  };
1851
- type ProgramRunEvent = RunStarted | StepExecutionStarted | DataArtifactUpdated | OutputEmitted | CodeError | SqlError | BuildError | ArtifactError | InternalError | PipelineProgress | StepExecutionFinished | RunFinished;
1890
+ type ProgramRunEvent = RunStarted | StepExecutionStarted | DataArtifactUpdated | OutputEmitted | CodeError | SqlError | SqlExecuteStarted | SqlExecuteCompleted | BuildError | ArtifactError | InternalError | PipelineProgress | StepExecutionFinished | RunFinished;
1852
1891
  type RunStarted = {
1853
1892
  type: "RunStarted";
1854
1893
  } & RunStartedV1;
@@ -1873,6 +1912,24 @@ type CodeError = {
1873
1912
  type SqlError = {
1874
1913
  type: "SqlError";
1875
1914
  } & SqlErrorV1;
1915
+ type SqlExecuteStarted = {
1916
+ type: "SqlExecuteStarted";
1917
+ } & SqlExecuteStartedV1;
1918
+ type SqlExecuteCompleted = {
1919
+ type: "SqlExecuteCompleted";
1920
+ } & SqlExecuteCompletedV1;
1921
+ type SqlExecuteOutcome2 = {
1922
+ rows_returned: number;
1923
+ duration_ms: number;
1924
+ type: "Success";
1925
+ } | {
1926
+ duration_ms: number;
1927
+ type: "Timeout";
1928
+ } | {
1929
+ errored_after_ms: number;
1930
+ error_type: SqlErrorType;
1931
+ type: "Error";
1932
+ };
1876
1933
  type BuildError = {
1877
1934
  type: "BuildError";
1878
1935
  } & BuildErrorV1;
@@ -3371,6 +3428,20 @@ interface SqlErrorV1 {
3371
3428
  error: string;
3372
3429
  version: "V1";
3373
3430
  }
3431
+ interface SqlExecuteStartedV1 {
3432
+ step_index: number;
3433
+ sql_query_id: SqlQueryId;
3434
+ sql: Sql;
3435
+ is_streaming: boolean;
3436
+ version: "V1";
3437
+ }
3438
+ interface SqlExecuteCompletedV1 {
3439
+ step_index: number;
3440
+ sql_query_id: SqlQueryId;
3441
+ outcome: SqlExecuteOutcome2;
3442
+ pushdown_mode: string;
3443
+ version: "V1";
3444
+ }
3374
3445
  interface BuildErrorV1 {
3375
3446
  step_index: number;
3376
3447
  error: string;
@@ -3517,6 +3588,10 @@ type Scalars = {
3517
3588
  input: number;
3518
3589
  output: number;
3519
3590
  };
3591
+ timestamp: {
3592
+ input: string;
3593
+ output: string;
3594
+ };
3520
3595
  timestamptz: {
3521
3596
  input: string;
3522
3597
  output: string;
@@ -3546,12 +3621,6 @@ type Boolean_Comparison_Exp = {
3546
3621
  _neq?: InputMaybe<Scalars['Boolean']['input']>;
3547
3622
  _nin?: InputMaybe<Array<Scalars['Boolean']['input']>>;
3548
3623
  };
3549
- type GetProjectInfoOutput = {
3550
- __typename?: 'GetProjectInfoOutput';
3551
- projectId: Scalars['String']['output'];
3552
- projectName: Scalars['String']['output'];
3553
- promptqlConsoleUrl: Scalars['String']['output'];
3554
- };
3555
3624
  /** Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'. */
3556
3625
  type Int_Comparison_Exp = {
3557
3626
  _eq?: InputMaybe<Scalars['Int']['input']>;
@@ -3746,6 +3815,21 @@ type Custom_Claim_Owners_Bool_Exp = {
3746
3815
  owner?: InputMaybe<Promptql_Users_Bool_Exp>;
3747
3816
  owner_id?: InputMaybe<Uuid_Comparison_Exp>;
3748
3817
  };
3818
+ /** Boolean expression to filter rows from the table "feed_candidate_selected_messages". All fields are combined with a logical 'AND'. */
3819
+ type Feed_Candidate_Selected_Messages_Bool_Exp = {
3820
+ _and?: InputMaybe<Array<Feed_Candidate_Selected_Messages_Bool_Exp>>;
3821
+ _not?: InputMaybe<Feed_Candidate_Selected_Messages_Bool_Exp>;
3822
+ _or?: InputMaybe<Array<Feed_Candidate_Selected_Messages_Bool_Exp>>;
3823
+ created_at?: InputMaybe<Timestamptz_Comparison_Exp>;
3824
+ display_text?: InputMaybe<String_Comparison_Exp>;
3825
+ feed_candidate?: InputMaybe<Social_Feed_Candidates_Bool_Exp>;
3826
+ feed_candidate_id?: InputMaybe<Uuid_Comparison_Exp>;
3827
+ id?: InputMaybe<Bigint_Comparison_Exp>;
3828
+ message_id?: InputMaybe<String_Comparison_Exp>;
3829
+ message_type?: InputMaybe<String_Comparison_Exp>;
3830
+ thread_event?: InputMaybe<Thread_Events_Bool_Exp>;
3831
+ thread_event_id?: InputMaybe<Bigint_Comparison_Exp>;
3832
+ };
3749
3833
  type Jsonb_Cast_Exp = {
3750
3834
  String?: InputMaybe<String_Comparison_Exp>;
3751
3835
  };
@@ -4002,6 +4086,8 @@ type Promptql_Users_Bool_Exp = {
4002
4086
  project_id?: InputMaybe<Uuid_Comparison_Exp>;
4003
4087
  promptql_user_id?: InputMaybe<Uuid_Comparison_Exp>;
4004
4088
  slack_info?: InputMaybe<Slack_Info_Bool_Exp>;
4089
+ starred_artifacts?: InputMaybe<Starred_Artifacts_Bool_Exp>;
4090
+ starred_threads?: InputMaybe<Starred_Threads_Bool_Exp>;
4005
4091
  updated_at?: InputMaybe<Timestamptz_Comparison_Exp>;
4006
4092
  user_group_members?: InputMaybe<User_Group_Members_Bool_Exp>;
4007
4093
  user_preference?: InputMaybe<User_Preferences_Bool_Exp>;
@@ -4020,6 +4106,8 @@ type Promptql_Users_Order_By = {
4020
4106
  project_id?: InputMaybe<Order_By>;
4021
4107
  promptql_user_id?: InputMaybe<Order_By>;
4022
4108
  slack_info?: InputMaybe<Slack_Info_Order_By>;
4109
+ starred_artifacts_aggregate?: InputMaybe<Starred_Artifacts_Aggregate_Order_By>;
4110
+ starred_threads_aggregate?: InputMaybe<Starred_Threads_Aggregate_Order_By>;
4023
4111
  updated_at?: InputMaybe<Order_By>;
4024
4112
  user_group_members_aggregate?: InputMaybe<User_Group_Members_Aggregate_Order_By>;
4025
4113
  user_preference?: InputMaybe<User_Preferences_Order_By>;
@@ -4278,6 +4366,7 @@ type Social_Feed_Candidates_Bool_Exp = {
4278
4366
  created_at?: InputMaybe<Timestamptz_Comparison_Exp>;
4279
4367
  id?: InputMaybe<Uuid_Comparison_Exp>;
4280
4368
  llm_output?: InputMaybe<Jsonb_Comparison_Exp>;
4369
+ selected_messages?: InputMaybe<Feed_Candidate_Selected_Messages_Bool_Exp>;
4281
4370
  summary?: InputMaybe<String_Comparison_Exp>;
4282
4371
  thread?: InputMaybe<Threads_V2_Bool_Exp>;
4283
4372
  thread_event_id?: InputMaybe<Bigint_Comparison_Exp>;
@@ -4343,6 +4432,64 @@ type Social_Feed_Candidates_Variance_Order_By = {
4343
4432
  thread_event_id?: InputMaybe<Order_By>;
4344
4433
  version?: InputMaybe<Order_By>;
4345
4434
  };
4435
+ /** order by aggregate values of table "starred_artifacts" */
4436
+ type Starred_Artifacts_Aggregate_Order_By = {
4437
+ count?: InputMaybe<Order_By>;
4438
+ max?: InputMaybe<Starred_Artifacts_Max_Order_By>;
4439
+ min?: InputMaybe<Starred_Artifacts_Min_Order_By>;
4440
+ };
4441
+ /** Boolean expression to filter rows from the table "starred_artifacts". All fields are combined with a logical 'AND'. */
4442
+ type Starred_Artifacts_Bool_Exp = {
4443
+ _and?: InputMaybe<Array<Starred_Artifacts_Bool_Exp>>;
4444
+ _not?: InputMaybe<Starred_Artifacts_Bool_Exp>;
4445
+ _or?: InputMaybe<Array<Starred_Artifacts_Bool_Exp>>;
4446
+ artifact?: InputMaybe<Artifacts_Bool_Exp>;
4447
+ artifact_id?: InputMaybe<Uuid_Comparison_Exp>;
4448
+ created_at?: InputMaybe<Timestamptz_Comparison_Exp>;
4449
+ user?: InputMaybe<Promptql_Users_Bool_Exp>;
4450
+ user_id?: InputMaybe<Uuid_Comparison_Exp>;
4451
+ };
4452
+ /** order by max() on columns of table "starred_artifacts" */
4453
+ type Starred_Artifacts_Max_Order_By = {
4454
+ artifact_id?: InputMaybe<Order_By>;
4455
+ created_at?: InputMaybe<Order_By>;
4456
+ user_id?: InputMaybe<Order_By>;
4457
+ };
4458
+ /** order by min() on columns of table "starred_artifacts" */
4459
+ type Starred_Artifacts_Min_Order_By = {
4460
+ artifact_id?: InputMaybe<Order_By>;
4461
+ created_at?: InputMaybe<Order_By>;
4462
+ user_id?: InputMaybe<Order_By>;
4463
+ };
4464
+ /** order by aggregate values of table "starred_threads" */
4465
+ type Starred_Threads_Aggregate_Order_By = {
4466
+ count?: InputMaybe<Order_By>;
4467
+ max?: InputMaybe<Starred_Threads_Max_Order_By>;
4468
+ min?: InputMaybe<Starred_Threads_Min_Order_By>;
4469
+ };
4470
+ /** Boolean expression to filter rows from the table "starred_threads". All fields are combined with a logical 'AND'. */
4471
+ type Starred_Threads_Bool_Exp = {
4472
+ _and?: InputMaybe<Array<Starred_Threads_Bool_Exp>>;
4473
+ _not?: InputMaybe<Starred_Threads_Bool_Exp>;
4474
+ _or?: InputMaybe<Array<Starred_Threads_Bool_Exp>>;
4475
+ created_at?: InputMaybe<Timestamptz_Comparison_Exp>;
4476
+ thread?: InputMaybe<Threads_V2_Bool_Exp>;
4477
+ thread_id?: InputMaybe<Uuid_Comparison_Exp>;
4478
+ user?: InputMaybe<Promptql_Users_Bool_Exp>;
4479
+ user_id?: InputMaybe<Uuid_Comparison_Exp>;
4480
+ };
4481
+ /** order by max() on columns of table "starred_threads" */
4482
+ type Starred_Threads_Max_Order_By = {
4483
+ created_at?: InputMaybe<Order_By>;
4484
+ thread_id?: InputMaybe<Order_By>;
4485
+ user_id?: InputMaybe<Order_By>;
4486
+ };
4487
+ /** order by min() on columns of table "starred_threads" */
4488
+ type Starred_Threads_Min_Order_By = {
4489
+ created_at?: InputMaybe<Order_By>;
4490
+ thread_id?: InputMaybe<Order_By>;
4491
+ user_id?: InputMaybe<Order_By>;
4492
+ };
4346
4493
  /** order by aggregate values of table "thread_artifacts" */
4347
4494
  type Thread_Artifacts_Aggregate_Order_By = {
4348
4495
  count?: InputMaybe<Order_By>;
@@ -4809,9 +4956,11 @@ type Threads_V2_Bool_Exp = {
4809
4956
  _or?: InputMaybe<Array<Threads_V2_Bool_Exp>>;
4810
4957
  build_id?: InputMaybe<Uuid_Comparison_Exp>;
4811
4958
  created_at?: InputMaybe<Timestamptz_Comparison_Exp>;
4959
+ created_from?: InputMaybe<String_Comparison_Exp>;
4812
4960
  custom_title?: InputMaybe<String_Comparison_Exp>;
4813
4961
  deleted_at?: InputMaybe<Timestamptz_Comparison_Exp>;
4814
4962
  forked_from?: InputMaybe<Uuid_Comparison_Exp>;
4963
+ is_starred?: InputMaybe<Boolean_Comparison_Exp>;
4815
4964
  learning_suggestion?: InputMaybe<String_Comparison_Exp>;
4816
4965
  pinned_threads_v2s?: InputMaybe<Pinned_Threads_V2_Bool_Exp>;
4817
4966
  project_config?: InputMaybe<Project_Configuration_Bool_Exp>;
@@ -4841,6 +4990,7 @@ type Threads_V2_Bool_Exp = {
4841
4990
  type Threads_V2_Max_Order_By = {
4842
4991
  build_id?: InputMaybe<Order_By>;
4843
4992
  created_at?: InputMaybe<Order_By>;
4993
+ created_from?: InputMaybe<Order_By>;
4844
4994
  custom_title?: InputMaybe<Order_By>;
4845
4995
  deleted_at?: InputMaybe<Order_By>;
4846
4996
  forked_from?: InputMaybe<Order_By>;
@@ -4858,6 +5008,7 @@ type Threads_V2_Max_Order_By = {
4858
5008
  type Threads_V2_Min_Order_By = {
4859
5009
  build_id?: InputMaybe<Order_By>;
4860
5010
  created_at?: InputMaybe<Order_By>;
5011
+ created_from?: InputMaybe<Order_By>;
4861
5012
  custom_title?: InputMaybe<Order_By>;
4862
5013
  deleted_at?: InputMaybe<Order_By>;
4863
5014
  forked_from?: InputMaybe<Order_By>;
@@ -4875,9 +5026,11 @@ type Threads_V2_Min_Order_By = {
4875
5026
  type Threads_V2_Order_By = {
4876
5027
  build_id?: InputMaybe<Order_By>;
4877
5028
  created_at?: InputMaybe<Order_By>;
5029
+ created_from?: InputMaybe<Order_By>;
4878
5030
  custom_title?: InputMaybe<Order_By>;
4879
5031
  deleted_at?: InputMaybe<Order_By>;
4880
5032
  forked_from?: InputMaybe<Order_By>;
5033
+ is_starred?: InputMaybe<Order_By>;
4881
5034
  learning_suggestion?: InputMaybe<Order_By>;
4882
5035
  pinned_threads_v2s_aggregate?: InputMaybe<Pinned_Threads_V2_Aggregate_Order_By>;
4883
5036
  project_config?: InputMaybe<Project_Configuration_Order_By>;
@@ -4907,6 +5060,8 @@ type Threads_V2_Select_Column =
4907
5060
  'build_id'
4908
5061
  /** column name */
4909
5062
  | 'created_at'
5063
+ /** column name */
5064
+ | 'created_from'
4910
5065
  /** column name */
4911
5066
  | 'custom_title'
4912
5067
  /** column name */
@@ -5158,6 +5313,7 @@ type StartThreadMutationVariables = Exact<{
5158
5313
  roomId?: InputMaybe<Scalars['String']['input']>;
5159
5314
  uploads?: InputMaybe<Array<UserUploadInput> | UserUploadInput>;
5160
5315
  visibility?: InputMaybe<Scalars['String']['input']>;
5316
+ createdFrom?: InputMaybe<Scalars['String']['input']>;
5161
5317
  }>;
5162
5318
  type StartThreadMutation = {
5163
5319
  __typename?: 'mutation_root';
@@ -5187,6 +5343,7 @@ type GetThreadsQueryVariables = Exact<{
5187
5343
  order_by?: InputMaybe<Array<Threads_V2_Order_By> | Threads_V2_Order_By>;
5188
5344
  }>;
5189
5345
 
5346
+ declare const USER_AGENT = "PromptQL TypeScript SDK";
5190
5347
  /**
5191
5348
  * Options to initialize a PromptQL SDK client.
5192
5349
  */
@@ -5196,10 +5353,9 @@ type PromptQLSdkOptions = {
5196
5353
  */
5197
5354
  authHost?: string;
5198
5355
  /**
5199
- * Base URL of the PromptQL data plane. You can find it in Project Settings > PromptQL > PromptQL API on https://prompt.ql.app.
5200
- * The base URL must remove the request path, For example: https://promptql.ddn.hasura.app.
5356
+ * Base URL of the Hasura control plane.
5201
5357
  */
5202
- promptqlBaseUrl?: string;
5358
+ controlPlaneUrl?: string;
5203
5359
  /**
5204
5360
  * Service account token of the PromptQL project.
5205
5361
  * Check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account to know how to create a token.
@@ -5375,11 +5531,50 @@ type CreateRoomArguments = Omit<CreateRoomMutationVariables, "visibility"> & {
5375
5531
  * Regular expression for validating room name.
5376
5532
  */
5377
5533
  declare const ROOM_NAME_PATTERN: RegExp;
5534
+ /**
5535
+ * Metadata response of an artifact.
5536
+ */
5537
+ type ArtifactMetadata = {
5538
+ artifact_id: string;
5539
+ version: number;
5540
+ title: string;
5541
+ description: string | null;
5542
+ artifact_type: ArtifactType2;
5543
+ user_id: string;
5544
+ metadata: unknown;
5545
+ project_id: string;
5546
+ created_at: string;
5547
+ size_bytes: number;
5548
+ scope?: {
5549
+ type: string;
5550
+ project_id: string;
5551
+ thread_id: string;
5552
+ thread_owner_user_id: string;
5553
+ };
5554
+ };
5555
+ /**
5556
+ * Project Info Output.
5557
+ */
5558
+ type ProjectInfoOutput = {
5559
+ projectId: string;
5560
+ projectName: string;
5561
+ projectHost: string;
5562
+ promptqlGraphQLUrl: string;
5563
+ promptqlConsoleUrl: string;
5564
+ };
5378
5565
 
5379
5566
  /**
5380
5567
  * Download artifact data.
5381
5568
  */
5382
5569
  declare function downloadArtifactData(host: string, artifactId: string, version: number, headers: Record<string, string>, customFetch?: typeof fetch): Promise<unknown>;
5570
+ /**
5571
+ * List artifacts by thread ID.
5572
+ */
5573
+ declare function listArtifactMetadataByThreadId(client: ApolloClient, projectId: string, threadId: string): Promise<ArtifactMetadata[]>;
5574
+ /**
5575
+ * Get artifact metadata by ID and version.
5576
+ */
5577
+ declare function getArtifactMetadata(host: string, artifactId: string, version: number, headers: Record<string, string>, customFetch?: typeof fetch): Promise<ArtifactMetadata>;
5383
5578
 
5384
5579
  /**
5385
5580
  * List rooms of the current project.The default limit is 10.
@@ -5442,32 +5637,67 @@ type PromptQLAuthTokenGeneratorOptions = {
5442
5637
  declare function createPromptQLAuthTokenGenerator(options: PromptQLAuthTokenGeneratorOptions): () => Promise<string>;
5443
5638
 
5444
5639
  /**
5445
- * Internal client options.
5640
+ * A low-level API class for PromptQL.
5446
5641
  */
5447
- type ClientOptions = {
5448
- client: ApolloClient;
5449
- buildId?: string;
5642
+ declare class PromptQLApi {
5643
+ controlPlaneUrl: string;
5644
+ options: PromptQLSdkOptions;
5450
5645
  defaultTimezone: string;
5451
- };
5646
+ private getAuthTokenFn;
5647
+ private project;
5648
+ private client;
5649
+ private wsClient;
5650
+ constructor(options: PromptQLSdkOptions);
5651
+ getAuthToken(): Promise<string>;
5652
+ getGraphQLClient(): Promise<ApolloClient>;
5653
+ /**
5654
+ * Get the basic information of the current PromptQL project.
5655
+ */
5656
+ getProjectInfo(): Promise<ProjectInfoOutput>;
5657
+ /**
5658
+ * Stop the GraphQL client and cleanup resources.
5659
+ */
5660
+ close(): void;
5661
+ }
5662
+
5663
+ /**
5664
+ * Artifact class implements the set of PromptQL artifact APIs.
5665
+ */
5666
+ declare class Artifact {
5667
+ private api;
5668
+ constructor(api: PromptQLApi);
5669
+ /**
5670
+ * List artifacts by thread ID.
5671
+ */
5672
+ listMetadataByThreadId(threadId: string): Promise<ArtifactMetadata[]>;
5673
+ /**
5674
+ * Download artifact data.
5675
+ */
5676
+ download(artifactId: string, version: number): Promise<unknown>;
5677
+ /**
5678
+ * Get artifact metadata.
5679
+ */
5680
+ getMetadata(artifactId: string, version: number): Promise<unknown>;
5681
+ }
5452
5682
 
5453
5683
  /**
5454
5684
  * Project class implements the set of PromptQL project APIs.
5455
5685
  */
5456
5686
  declare class Project {
5457
- private _options;
5458
- constructor(options: ClientOptions);
5687
+ private api;
5688
+ constructor(api: PromptQLApi);
5459
5689
  /**
5460
5690
  * Get the basic information of the current PromptQL project.
5461
5691
  */
5462
- info(): Promise<GetProjectInfoOutput>;
5692
+ info(): Promise<ProjectInfoOutput>;
5463
5693
  }
5464
5694
 
5465
5695
  /**
5466
5696
  * Room class implements the set of PromptQL room APIs.
5467
5697
  */
5468
5698
  declare class Room {
5469
- private _options;
5470
- constructor(options: ClientOptions);
5699
+ private api;
5700
+ constructor(api: PromptQLApi);
5471
5701
  /**
5472
5702
  * List PromptQL rooms. The default limit is 10.
5473
5703
  */
@@ -5486,8 +5716,8 @@ declare class Room {
5486
5716
  * Project class implements the set of PromptQL thread APIs.
5487
5717
  */
5488
5718
  declare class Thread {
5489
- private _options;
5490
- constructor(options: ClientOptions);
5719
+ private api;
5720
+ constructor(api: PromptQLApi);
5491
5721
  /**
5492
5722
  * List threads of the current project. The default limit is 10.
5493
5723
  */
@@ -5529,16 +5759,11 @@ declare class Thread {
5529
5759
  */
5530
5760
  declare class PromptQLSdk {
5531
5761
  constructor(options: PromptQLSdkOptions);
5532
- private _options;
5533
- private _wsClient;
5534
- private _fetchToken;
5762
+ private api;
5535
5763
  readonly thread: Thread;
5536
5764
  readonly project: Project;
5537
5765
  readonly room: Room;
5538
- /**
5539
- * Check if the PromptQL SDK instance is authenticated.
5540
- */
5541
- authenticated(): Promise<boolean>;
5766
+ readonly artifact: Artifact;
5542
5767
  /**
5543
5768
  * Stop the GraphQL client and cleanup resources.
5544
5769
  */
@@ -5719,6 +5944,7 @@ type InteractionOutcomeStatus = KeysOfUnion<InteractionOutcome> | "agent_decline
5719
5944
  * The common output of the interaction finished event after evaluated from event v2 or v3.
5720
5945
  */
5721
5946
  type InteractionFinishedEvent = {
5947
+ messageId: string;
5722
5948
  status: InteractionOutcomeStatus | "unknown";
5723
5949
  reason?: string;
5724
5950
  timestamp?: string;
@@ -5732,5 +5958,9 @@ declare function getAgentInteractionFinishedEvent(eventData: ThreadEvent$1): Int
5732
5958
  * Get the message_id from the thread event data.
5733
5959
  */
5734
5960
  declare function getThreadEventMessageId(event: ThreadEvent$1 | undefined): string | undefined;
5961
+ /**
5962
+ * Build PromptQL URL from fqdn.
5963
+ */
5964
+ declare function buildPromptQLUrl(fqdn: string): string;
5735
5965
 
5736
- export { type AgentInteraction, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopUpdate, type AgentState, type AgentTrigger, type AgentUpdate, type AgentUpdateContent, type AllTheServerTypes, type AnalyzedCodeAction, type AnalyzedCodeAction2, type ApolloClientOptions, type ArtifactError, type ArtifactErrorV1, type ArtifactId, type ArtifactPreview, type ArtifactReference, type ArtifactReference1, type ArtifactReference2, type ArtifactState, type ArtifactType, type ArtifactType2, type ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, type CancelAgentMessageMutationVariables, type CheckedAssumption, type CheckedTopic, type CodeAction, type CodeAction2, type CodeBlock, type CodeError, type CodeErrorV1, type CodeExecutionComplete, type CodeOutputAnalysis, type CodeOutputAnalysis1, type CodeOutputAnalyzed, type ComponentResponse, type ComponentResponse1, type ComponentResponse2, type ComponentResponse3, type ComponentResponse4, type ComponentResponse5, type ConfidenceAnalysis, type ConfidenceAnalysis1, type ConfidenceAnalysisLlmUsage, type ConfidenceAnalysisOutcome, type ConfidenceAnalysisUpdate, type ContextExplorerCompleted, type ContextExplorerStarted, type ContextExplorerState, type ContextExplorerUpdate, type CopyFileEntry, type CreateRoomArguments, type CurrentAction, type DataArtifactUpdated, type DataArtifactUpdatedV1, type Dependency, type EventOfKind, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeExplorerAttempt2, type ExternalKnowledgeExplorerState, type ExternalKnowledgeSummary, type ExternalKnowledgeTaskGeneratorState, type FactSource, type GeneratedCode, type GeneratedFile, type GeneratedFile2, type GeneratedProgramRunnerOutput, type GeneratedResponse, type GeneratedUiCode, type GeneratedUiCode1, type GetThreadEventOptions, type GetThreadsQueryVariables, type IPromptQLSdk, type Interaction, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionDeclineReason, type InteractionError, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcome2, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type KeysOfUnion, type LearningSuggestion, type LearningSuggestionOutcome, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type LlmResponse, type LlmUsage, type MessageProcessingStarted, type MessageProcessingState, type MessageProcessingUpdate, type NeedsSupportAnalysis, type NeedsSupportOutcome, type NeedsSupportUpdate, type OrchestratorState, type OrchestratorUpdate, type Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineColumn, type PipelineColumnType, type PipelinePartitionSpec, type PipelinePartitionTransform, type PipelineProgress, type PipelineProgressV1, type PipelineRunStepDetails, type PipelineSchema, type PipelineSink, type PipelineSource, type PipelineStep, type PipelineTransform, type PlanGenerationStarted, type PlanState, type PlanStateStep, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionState, type PlanningDecisionUpdate, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunResult, type ProgramRunnerAction, type ProgramRunnerAction2, type ProgramRunnerActionResult, type ProgramRunnerAttempt, type ProgramTransform, type ProgrammerState, type ProgrammerUpdate, PromptQLSdk, type PromptQLSdkOptions, type PromptQlConfigFeatureFlagModel, type PromptQlUserId, type PythonRunStepDetails, type PythonStep, ROOM_NAME_PATTERN, type ResponseGenerationState, type ResponseGenerationUpdate, type ResponseTruncation, type RoomFragment, type RoomVisibilityType, type RunConfigV1, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunProgramRequest2, type RunSavedProgramRequest, type RunSavedProgramRequest2, type RunStarted, type RunStartedV1, type RunStepDetails, type SavedProgramRunnerStage, type SavedProgramRunnerState, type SavedProgramRunnerUpdate, type SavedProgramRunnerUpdateV0, type ScheduledAgentTriggerEventId, type ScheduledAgentTriggerId, type ScheduledAgentTriggerPayload, type ScheduledAgentTriggerPayloadV1, type ScheduledAgentTriggerType, type SchemaContext, type SchemaContext1, type SchemaExplored, type SchemaExplorerCompleted, type SchemaExplorerStarted, type SchemaExplorerState, type SchemaExplorerUpdate, type SchemaTask, type SchemaTasksGenerationCompleted, type SchemaTasksGenerationStarted, type SchemaTasksGenerationState, type SchemaTasksGenerationUpdate, type SendMessageToThreadArguments, type SendMessageToThreadOutput, type SendThreadMessageMutationVariables, type ShelfActionEvent, type ShelfSink, type ShelfUpdate, type ShelfUpdateV1, type SkillType, type SocialFeedRating, type SocialFeedRatingLlmUsage, type SocialFeedRatingOutcome, type SocialFeedRatingUpdate, type Span, type SqlError, type SqlErrorV1, type SqlRunStepDetails, type SqlSource, type SqlStep, type StartThreadArguments, type StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type Step, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepState, type StepUpdate, type StreamThreadEventOptions, type SummaryAction, type TasksGenerated, type Teaching, type TeachingId, type TeachingOutcome, type TeachingState, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, type ThreadFragment, type ThreadParticipants, type TransactionId, type TzWrapper, type UiBuild, type UiBuild2, type UiBuildFailure, type UiBuildResult, type UiBuildRunStepDetails, type UiBuildStep, type UiMetadata, type UiProgrammerState, type UiProgrammerUpdate, type UserCancel, type UserCancelEvent, type UserInteraction, type UserMessage, type UserMessageEvent, type UserUpload, type UserUploadMetadata, type Version, type VersionedAgentUpdate, type VersionedOrUnversionedAgentUpdate, type Warning, type WikiAuditId, type WikiChange, type WikiContent, type WikiDelta, type WikiExplorerCompleted, type WikiExplorerStarted, type WikiExplorerState, type WikiExplorerUpdate, type WikiGenerationOutcome, type WikiGenerationUpdate, type WikiInfoGenerated, type WikiLearningSuggestionUpdate, type WikiPageV1, type WikiSection, type WikiSelectionUpdate, type WikiTitle, cancelAgentMessage, createApolloClient, createPromptQLAuthTokenGenerator, createRoom, diffThreadEvents, downloadArtifactData, getAgentGeneratedResponse, getAgentInteractionDecisionAcceptInteractionEvent, getAgentInteractionDecisionDeclineInteractionEvent, getAgentInteractionFinishedEvent, getAgentMessageProcessingStartedEvent, getAgentOrchestratorContextExplorerCompletedEvent, getAgentOrchestratorContextExplorerStartedEvent, getAgentOrchestratorContextExplorerUpdateEvent, getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent, getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent, getAgentOrchestratorSchemaExplorerCompletedEvent, getAgentOrchestratorSchemaExplorerGeneratedCodeEvent, getAgentOrchestratorSchemaExplorerSchemaExploredEvent, getAgentOrchestratorSchemaExplorerStartedEvent, getAgentOrchestratorSchemaExplorerUpdateEvent, getAgentOrchestratorSchemaTasksGeneratedEvent, getAgentOrchestratorSchemaTasksGenerationCompletedEvent, getAgentOrchestratorSchemaTasksGenerationStartedEvent, getAgentOrchestratorSchemaTasksGenerationUpdateEvent, getAgentOrchestratorStepProgrammerEvent, getAgentOrchestratorStepSavedProgramRunnerEvent, getAgentOrchestratorStepUiProgrammerEvent, getAgentOrchestratorStepUpdateEvent, getAgentOrchestratorUpdateEvent, getAgentOrchestratorWikiExplorerCompletedEvent, getAgentOrchestratorWikiExplorerStartedEvent, getAgentOrchestratorWikiExplorerUpdateEvent, getAgentOrchestratorWikiInfoGeneratedEvent, getAgentPlanGenerationStartedEvent, getAgentPlanStepGeneratedEvent, getAgentPlanningDecisionCompletedEvent, getAgentPlanningDecisionPlanningRequiredEvent, getAgentPlanningDecisionStartedEvent, getAgentPlanningDecisionUpdateEvent, getAgentStartingOrchestratorEvent, getThread, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, isInteractionAnalyzing, listRooms, listThreads, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents };
5966
+ export { type AgentInteraction, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopUpdate, type AgentState, type AgentTrigger, type AgentUpdate, type AgentUpdateContent, type AllTheServerTypes, type AnalyzedCodeAction, type AnalyzedCodeAction2, type ApolloClientOptions, type ArtifactError, type ArtifactErrorV1, type ArtifactId, type ArtifactMetadata, type ArtifactPreview, type ArtifactReference, type ArtifactReference1, type ArtifactReference2, type ArtifactState, type ArtifactType, type ArtifactType2, type ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, type CancelAgentMessageMutationVariables, type CheckedAssumption, type CheckedTopic, type CodeAction, type CodeAction2, type CodeBlock, type CodeError, type CodeErrorV1, type CodeExecutionComplete, type CodeOutputAnalysis, type CodeOutputAnalysis1, type CodeOutputAnalyzed, type ComponentResponse, type ComponentResponse1, type ComponentResponse2, type ComponentResponse3, type ComponentResponse4, type ComponentResponse5, type ConfidenceAnalysis, type ConfidenceAnalysis1, type ConfidenceAnalysisLlmUsage, type ConfidenceAnalysisOutcome, type ConfidenceAnalysisUpdate, type ContextExplorerCompleted, type ContextExplorerStarted, type ContextExplorerState, type ContextExplorerUpdate, type CopyFileEntry, type CreateRoomArguments, type CurrentAction, type DataArtifactUpdated, type DataArtifactUpdatedV1, type Dependency, type EventOfKind, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeExplorerAttempt2, type ExternalKnowledgeExplorerState, type ExternalKnowledgeSummary, type ExternalKnowledgeTaskGeneratorState, type FactSource, type GeneratedCode, type GeneratedFile, type GeneratedFile2, type GeneratedProgramRunnerOutput, type GeneratedResponse, type GeneratedUiCode, type GeneratedUiCode1, type GetThreadEventOptions, type GetThreadsQueryVariables, type IPromptQLSdk, type Interaction, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionDeclineReason, type InteractionError, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcome2, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type KeysOfUnion, type LearningSuggestion, type LearningSuggestionOutcome, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type LlmResponse, type LlmUsage, type MessageProcessingStarted, type MessageProcessingState, type MessageProcessingUpdate, type NeedsSupportAnalysis, type NeedsSupportOutcome, type NeedsSupportUpdate, type OrchestratorState, type OrchestratorUpdate, type Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineColumn, type PipelineColumnType, type PipelinePartitionSpec, type PipelinePartitionTransform, type PipelineProgress, type PipelineProgressV1, type PipelineRunStepDetails, type PipelineSchema, type PipelineSink, type PipelineSource, type PipelineStep, type PipelineTransform, type PlanGenerationStarted, type PlanState, type PlanStateStep, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionState, type PlanningDecisionUpdate, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunResult, type ProgramRunnerAction, type ProgramRunnerAction2, type ProgramRunnerActionResult, type ProgramRunnerAttempt, type ProgramTransform, type ProgrammerState, type ProgrammerUpdate, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlConfigFeatureFlagModel, type PromptQlUserId, type PythonRunStepDetails, type PythonStep, ROOM_NAME_PATTERN, type ResponseGenerationState, type ResponseGenerationUpdate, type ResponseTruncation, type RoomFragment, type RoomVisibilityType, type RunConfigV1, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunProgramRequest2, type RunSavedProgramRequest, type RunSavedProgramRequest2, type RunStarted, type RunStartedV1, type RunStepDetails, type SavedProgramRunnerStage, type SavedProgramRunnerState, type SavedProgramRunnerUpdate, type SavedProgramRunnerUpdateV0, type ScheduledAgentTriggerEventId, type ScheduledAgentTriggerId, type ScheduledAgentTriggerPayload, type ScheduledAgentTriggerPayloadV1, type ScheduledAgentTriggerType, type SchemaContext, type SchemaContext1, type SchemaExplored, type SchemaExplorerCompleted, type SchemaExplorerStarted, type SchemaExplorerState, type SchemaExplorerUpdate, type SchemaTask, type SchemaTasksGenerationCompleted, type SchemaTasksGenerationStarted, type SchemaTasksGenerationState, type SchemaTasksGenerationUpdate, type SendMessageToThreadArguments, type SendMessageToThreadOutput, type SendThreadMessageMutationVariables, type ShelfActionEvent, type ShelfSink, type ShelfUpdate, type ShelfUpdateV1, type SkillType, type SocialFeedRating, type SocialFeedRatingLlmUsage, type SocialFeedRatingOutcome, type SocialFeedRatingUpdate, type Span, type Sql, type SqlError, type SqlErrorType, type SqlErrorV1, type SqlExecuteCompleted, type SqlExecuteCompletedV1, type SqlExecuteOutcome, type SqlExecuteOutcome2, type SqlExecuteStarted, type SqlExecuteStartedV1, type SqlQueryId, type SqlRunStepDetails, type SqlSource, type SqlStep, type StartThreadArguments, type StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type Step, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepState, type StepUpdate, type StreamThreadEventOptions, type SummaryAction, type TasksGenerated, type Teaching, type TeachingId, type TeachingOutcome, type TeachingState, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, type ThreadFragment, type ThreadParticipants, type TransactionId, type TzWrapper, USER_AGENT, type UiBuild, type UiBuild2, type UiBuildFailure, type UiBuildResult, type UiBuildRunStepDetails, type UiBuildStep, type UiMetadata, type UiProgrammerState, type UiProgrammerUpdate, type UserCancel, type UserCancelEvent, type UserInteraction, type UserMessage, type UserMessageEvent, type UserUpload, type UserUploadMetadata, type Version, type VersionedAgentUpdate, type VersionedOrUnversionedAgentUpdate, type Warning, type WikiAuditId, type WikiChange, type WikiContent, type WikiDelta, type WikiExplorerCompleted, type WikiExplorerStarted, type WikiExplorerState, type WikiExplorerUpdate, type WikiGenerationOutcome, type WikiGenerationUpdate, type WikiInfoGenerated, type WikiLearningSuggestionUpdate, type WikiPageV1, type WikiSection, type WikiSelectionUpdate, type WikiTitle, buildPromptQLUrl, cancelAgentMessage, createApolloClient, createPromptQLAuthTokenGenerator, createRoom, diffThreadEvents, downloadArtifactData, getAgentGeneratedResponse, getAgentInteractionDecisionAcceptInteractionEvent, getAgentInteractionDecisionDeclineInteractionEvent, getAgentInteractionFinishedEvent, getAgentMessageProcessingStartedEvent, getAgentOrchestratorContextExplorerCompletedEvent, getAgentOrchestratorContextExplorerStartedEvent, getAgentOrchestratorContextExplorerUpdateEvent, getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent, getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent, getAgentOrchestratorSchemaExplorerCompletedEvent, getAgentOrchestratorSchemaExplorerGeneratedCodeEvent, getAgentOrchestratorSchemaExplorerSchemaExploredEvent, getAgentOrchestratorSchemaExplorerStartedEvent, getAgentOrchestratorSchemaExplorerUpdateEvent, getAgentOrchestratorSchemaTasksGeneratedEvent, getAgentOrchestratorSchemaTasksGenerationCompletedEvent, getAgentOrchestratorSchemaTasksGenerationStartedEvent, getAgentOrchestratorSchemaTasksGenerationUpdateEvent, getAgentOrchestratorStepProgrammerEvent, getAgentOrchestratorStepSavedProgramRunnerEvent, getAgentOrchestratorStepUiProgrammerEvent, getAgentOrchestratorStepUpdateEvent, getAgentOrchestratorUpdateEvent, getAgentOrchestratorWikiExplorerCompletedEvent, getAgentOrchestratorWikiExplorerStartedEvent, getAgentOrchestratorWikiExplorerUpdateEvent, getAgentOrchestratorWikiInfoGeneratedEvent, getAgentPlanGenerationStartedEvent, getAgentPlanStepGeneratedEvent, getAgentPlanningDecisionCompletedEvent, getAgentPlanningDecisionPlanningRequiredEvent, getAgentPlanningDecisionStartedEvent, getAgentPlanningDecisionUpdateEvent, getAgentStartingOrchestratorEvent, getArtifactMetadata, getThread, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents };