@hasura/promptql 2.0.0-alpha.32 → 2.0.0-alpha.33

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.d.mts CHANGED
@@ -3225,7 +3225,28 @@ declare function streamThreadMessageEvents(client: ApolloClient, threadId: strin
3225
3225
  declare function isInteractionAnalyzing(events: ThreadEvent[], skipAnalysis?: boolean): boolean;
3226
3226
 
3227
3227
  type WikiPageNamespace = "guide" | "regular";
3228
- type WikiPage = WikiPageV1 & {
3228
+ type WikiPageItem = WikiPageV1 & {
3229
+ page_id: string;
3230
+ created_at: string;
3231
+ last_modified_at?: string | null | undefined;
3232
+ /**
3233
+ * The title of the wiki page
3234
+ */
3235
+ title: string;
3236
+ /**
3237
+ * The alias titles of the wiki page
3238
+ */
3239
+ aliases?: string[];
3240
+ /**
3241
+ * Whether this is a stub page
3242
+ */
3243
+ stub?: boolean;
3244
+ /**
3245
+ * The definition of the topic of the wiki page
3246
+ */
3247
+ definition?: string | null;
3248
+ };
3249
+ type WikiPageDetail = WikiPageV1 & {
3229
3250
  page_id: string;
3230
3251
  created_at: string;
3231
3252
  last_modified_at?: string | null | undefined;
@@ -3243,11 +3264,11 @@ type ListWikiPageArgs = {
3243
3264
  /**
3244
3265
  * List wiki pages of the current project.
3245
3266
  */
3246
- declare function listWikiPages(client: ApolloClient, args: ListWikiPageArgs): Promise<WikiPage[]>;
3267
+ declare function listWikiPages(client: ApolloClient, args: ListWikiPageArgs): Promise<WikiPageItem[]>;
3247
3268
  /**
3248
3269
  * Get wiki page by id.
3249
3270
  */
3250
- declare function getWikiPage(client: ApolloClient, project_id: string, namespace: string, id: string): Promise<WikiPage | null | undefined>;
3271
+ declare function getWikiPage(client: ApolloClient, project_id: string, namespace: string, id: string): Promise<WikiPageDetail | null | undefined>;
3251
3272
 
3252
3273
  /**
3253
3274
  * A low-level API class for PromptQL.
@@ -3376,11 +3397,11 @@ declare class Wiki {
3376
3397
  /**
3377
3398
  * List PromptQL wiki pages.
3378
3399
  */
3379
- list(args: ListWikiPageArgs): Promise<WikiPage[]>;
3400
+ list(args: ListWikiPageArgs): Promise<WikiPageItem[]>;
3380
3401
  /**
3381
3402
  * Get a PromptQL wiki page by primary keys.
3382
3403
  */
3383
- get(namespace: WikiPageNamespace, id: string): Promise<WikiPage | null | undefined>;
3404
+ get(namespace: WikiPageNamespace, id: string): Promise<WikiPageDetail | null | undefined>;
3384
3405
  }
3385
3406
 
3386
3407
  /**
@@ -3599,4 +3620,4 @@ declare function getThreadEventMessageId(event: ThreadEvent$1 | undefined): stri
3599
3620
  */
3600
3621
  declare function buildPromptQLUrl(fqdn: string): string;
3601
3622
 
3602
- export { type AgentGeneratedResponse, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionLegacy, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopTerminalAction, type AgentLoopUpdate, type AgentTrigger, type AgentUpdate, type AgentUpdateContent, type ApolloClientOptions, type ArtifactDataPreview, type ArtifactError, type ArtifactErrorV1, type ArtifactId, type ArtifactMetadata, type ArtifactReference, type ArtifactReference1, type ArtifactType, type ArtifactType2, type ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, CancelAgentMessageMutationVariables, type CheckedAssumption, type CheckedTopic, type CodeBlock, type CodeError, type CodeErrorV1, type CodeExecutionComplete, type CodeOutputAnalysis, type CodeOutputAnalyzed, type ComponentResponse, type ComponentResponse1, type ComponentResponse2, type ComponentResponse3, type ComponentResponse4, type ComponentResponse5, type ConfidenceAnalysis, type ConfidenceAnalysisLlmUsage, type ConfidenceAnalysisUpdate, type ContextExplorerCompleted, type ContextExplorerStarted, type ContextExplorerUpdate, type CopyFileEntry, type CreateRoomArguments, type DataArtifactUpdated, type DataArtifactUpdatedV1, type DecideNextStepsFields, type EventOfKind, type ExecuteProgramRequestData, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeSummary, type FactSource, type FederatedWikiName, type GeneratedCode, type GeneratedFile, type GeneratedResponse, type GeneratedUiCode, type GetThreadEventOptions, GetThreadsQueryVariables, type IPromptQLSdk, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type InterruptedByTrigger, type KeysOfUnion, type LearningBlockId, type LearningSuggestion, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type ListWikiPageArgs, type LlmResponse, type LlmUsage, type LlmUsageEvent, type LlmUsageEventV1, type MessageProcessingStarted, type MessageProcessingUpdate, type NeedsSupportUpdate, type OrchestratorUpdate, Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineProgress, type PipelineProgressV1, type PipelineProgressV2, type PipelineRunStepDetails, type PipelineSourceState, type PlanGenerationStarted, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionUpdate, type ProgramExecuteOutcome, type ProgramExecuteUpdate, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunnerAction, type ProgrammerUpdate, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlUserId, type PythonRunStepDetails, ROOM_NAME_REGEX, type ResponseGenerationUpdate, type ResponseTruncation, RoomFragment, type RoomVisibilityType, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunSavedProgramRequest, type RunStarted, type RunStartedV1, type RunStepDetails, type SavedProgramRunnerUpdate, type SavedProgramRunnerUpdateV0, type ScheduledAgentTriggerEventId, type ScheduledAgentTriggerId, type ScheduledAgentTriggerPayload, type ScheduledAgentTriggerPayloadV1, type ScheduledAgentTriggerType, type SchemaContext, type SchemaExplored, type SchemaExplorerCompleted, type SchemaExplorerStarted, type SchemaExplorerUpdate, type SchemaTask, type SchemaTasksGenerationCompleted, type SchemaTasksGenerationStarted, type SchemaTasksGenerationUpdate, type SendMessageToThreadArguments, type SendMessageToThreadOutput, SendThreadMessageMutationVariables, type ServerMetadata, type ShelfActionEvent, type ShelfUpdate, type ShelfUpdateV1, type SkillType, type SocialFeedRatingLlmUsage, 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 StartThreadArguments, StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepUpdate, type StreamThreadEventOptions, type TargetWikiPage, type TasksGenerated, type Teaching, type TeachingId, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, ThreadFragment, type TransactionId, type TzWrapper, USER_AGENT, type UiBuildFailure, type UiBuildRunStepDetails, type UiMetadata, type UiProgrammerUpdate, type UserCancel, type UserCancelEvent, type UserMessage, type UserMessageEvent, type UserUpload, type VersionedAgentUpdate, type VersionedOrUnversionedAgentUpdate, type Warning, type WikiAuditId, type WikiChange, type WikiContent, type WikiDelta, type WikiExplorerCompleted, type WikiExplorerStarted, type WikiExplorerUpdate, type WikiGenerationUpdate, type WikiInfoGenerated, type WikiLearningSuggestionUpdate, type WikiPage, type WikiPageNamespace, type WikiPagePreview, type WikiPageSearchResult, type WikiPageV1, type WikiSection, type WikiSelectionUpdate, type WikiTitle, buildPromptQLUrl, cancelAgentMessage, createApolloClient, 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, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, validateRoomName };
3623
+ export { type AgentGeneratedResponse, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionLegacy, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopTerminalAction, type AgentLoopUpdate, type AgentTrigger, type AgentUpdate, type AgentUpdateContent, type ApolloClientOptions, type ArtifactDataPreview, type ArtifactError, type ArtifactErrorV1, type ArtifactId, type ArtifactMetadata, type ArtifactReference, type ArtifactReference1, type ArtifactType, type ArtifactType2, type ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, CancelAgentMessageMutationVariables, type CheckedAssumption, type CheckedTopic, type CodeBlock, type CodeError, type CodeErrorV1, type CodeExecutionComplete, type CodeOutputAnalysis, type CodeOutputAnalyzed, type ComponentResponse, type ComponentResponse1, type ComponentResponse2, type ComponentResponse3, type ComponentResponse4, type ComponentResponse5, type ConfidenceAnalysis, type ConfidenceAnalysisLlmUsage, type ConfidenceAnalysisUpdate, type ContextExplorerCompleted, type ContextExplorerStarted, type ContextExplorerUpdate, type CopyFileEntry, type CreateRoomArguments, type DataArtifactUpdated, type DataArtifactUpdatedV1, type DecideNextStepsFields, type EventOfKind, type ExecuteProgramRequestData, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeSummary, type FactSource, type FederatedWikiName, type GeneratedCode, type GeneratedFile, type GeneratedResponse, type GeneratedUiCode, type GetThreadEventOptions, GetThreadsQueryVariables, type IPromptQLSdk, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type InterruptedByTrigger, type KeysOfUnion, type LearningBlockId, type LearningSuggestion, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type ListWikiPageArgs, type LlmResponse, type LlmUsage, type LlmUsageEvent, type LlmUsageEventV1, type MessageProcessingStarted, type MessageProcessingUpdate, type NeedsSupportUpdate, type OrchestratorUpdate, Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineProgress, type PipelineProgressV1, type PipelineProgressV2, type PipelineRunStepDetails, type PipelineSourceState, type PlanGenerationStarted, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionUpdate, type ProgramExecuteOutcome, type ProgramExecuteUpdate, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunnerAction, type ProgrammerUpdate, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlUserId, type PythonRunStepDetails, ROOM_NAME_REGEX, type ResponseGenerationUpdate, type ResponseTruncation, RoomFragment, type RoomVisibilityType, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunSavedProgramRequest, type RunStarted, type RunStartedV1, type RunStepDetails, type SavedProgramRunnerUpdate, type SavedProgramRunnerUpdateV0, type ScheduledAgentTriggerEventId, type ScheduledAgentTriggerId, type ScheduledAgentTriggerPayload, type ScheduledAgentTriggerPayloadV1, type ScheduledAgentTriggerType, type SchemaContext, type SchemaExplored, type SchemaExplorerCompleted, type SchemaExplorerStarted, type SchemaExplorerUpdate, type SchemaTask, type SchemaTasksGenerationCompleted, type SchemaTasksGenerationStarted, type SchemaTasksGenerationUpdate, type SendMessageToThreadArguments, type SendMessageToThreadOutput, SendThreadMessageMutationVariables, type ServerMetadata, type ShelfActionEvent, type ShelfUpdate, type ShelfUpdateV1, type SkillType, type SocialFeedRatingLlmUsage, 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 StartThreadArguments, StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepUpdate, type StreamThreadEventOptions, type TargetWikiPage, type TasksGenerated, type Teaching, type TeachingId, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, ThreadFragment, type TransactionId, type TzWrapper, USER_AGENT, type UiBuildFailure, type UiBuildRunStepDetails, type UiMetadata, type UiProgrammerUpdate, type UserCancel, type UserCancelEvent, type UserMessage, type UserMessageEvent, type UserUpload, type VersionedAgentUpdate, type VersionedOrUnversionedAgentUpdate, type Warning, type WikiAuditId, type WikiChange, type WikiContent, type WikiDelta, type WikiExplorerCompleted, type WikiExplorerStarted, type WikiExplorerUpdate, type WikiGenerationUpdate, type WikiInfoGenerated, type WikiLearningSuggestionUpdate, type WikiPageDetail, type WikiPageItem, type WikiPageNamespace, type WikiPagePreview, type WikiPageSearchResult, type WikiPageV1, type WikiSection, type WikiSelectionUpdate, type WikiTitle, buildPromptQLUrl, cancelAgentMessage, createApolloClient, 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, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, validateRoomName };
package/dist/index.d.ts CHANGED
@@ -3225,7 +3225,28 @@ declare function streamThreadMessageEvents(client: ApolloClient, threadId: strin
3225
3225
  declare function isInteractionAnalyzing(events: ThreadEvent[], skipAnalysis?: boolean): boolean;
3226
3226
 
3227
3227
  type WikiPageNamespace = "guide" | "regular";
3228
- type WikiPage = WikiPageV1 & {
3228
+ type WikiPageItem = WikiPageV1 & {
3229
+ page_id: string;
3230
+ created_at: string;
3231
+ last_modified_at?: string | null | undefined;
3232
+ /**
3233
+ * The title of the wiki page
3234
+ */
3235
+ title: string;
3236
+ /**
3237
+ * The alias titles of the wiki page
3238
+ */
3239
+ aliases?: string[];
3240
+ /**
3241
+ * Whether this is a stub page
3242
+ */
3243
+ stub?: boolean;
3244
+ /**
3245
+ * The definition of the topic of the wiki page
3246
+ */
3247
+ definition?: string | null;
3248
+ };
3249
+ type WikiPageDetail = WikiPageV1 & {
3229
3250
  page_id: string;
3230
3251
  created_at: string;
3231
3252
  last_modified_at?: string | null | undefined;
@@ -3243,11 +3264,11 @@ type ListWikiPageArgs = {
3243
3264
  /**
3244
3265
  * List wiki pages of the current project.
3245
3266
  */
3246
- declare function listWikiPages(client: ApolloClient, args: ListWikiPageArgs): Promise<WikiPage[]>;
3267
+ declare function listWikiPages(client: ApolloClient, args: ListWikiPageArgs): Promise<WikiPageItem[]>;
3247
3268
  /**
3248
3269
  * Get wiki page by id.
3249
3270
  */
3250
- declare function getWikiPage(client: ApolloClient, project_id: string, namespace: string, id: string): Promise<WikiPage | null | undefined>;
3271
+ declare function getWikiPage(client: ApolloClient, project_id: string, namespace: string, id: string): Promise<WikiPageDetail | null | undefined>;
3251
3272
 
3252
3273
  /**
3253
3274
  * A low-level API class for PromptQL.
@@ -3376,11 +3397,11 @@ declare class Wiki {
3376
3397
  /**
3377
3398
  * List PromptQL wiki pages.
3378
3399
  */
3379
- list(args: ListWikiPageArgs): Promise<WikiPage[]>;
3400
+ list(args: ListWikiPageArgs): Promise<WikiPageItem[]>;
3380
3401
  /**
3381
3402
  * Get a PromptQL wiki page by primary keys.
3382
3403
  */
3383
- get(namespace: WikiPageNamespace, id: string): Promise<WikiPage | null | undefined>;
3404
+ get(namespace: WikiPageNamespace, id: string): Promise<WikiPageDetail | null | undefined>;
3384
3405
  }
3385
3406
 
3386
3407
  /**
@@ -3599,4 +3620,4 @@ declare function getThreadEventMessageId(event: ThreadEvent$1 | undefined): stri
3599
3620
  */
3600
3621
  declare function buildPromptQLUrl(fqdn: string): string;
3601
3622
 
3602
- export { type AgentGeneratedResponse, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionLegacy, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopTerminalAction, type AgentLoopUpdate, type AgentTrigger, type AgentUpdate, type AgentUpdateContent, type ApolloClientOptions, type ArtifactDataPreview, type ArtifactError, type ArtifactErrorV1, type ArtifactId, type ArtifactMetadata, type ArtifactReference, type ArtifactReference1, type ArtifactType, type ArtifactType2, type ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, CancelAgentMessageMutationVariables, type CheckedAssumption, type CheckedTopic, type CodeBlock, type CodeError, type CodeErrorV1, type CodeExecutionComplete, type CodeOutputAnalysis, type CodeOutputAnalyzed, type ComponentResponse, type ComponentResponse1, type ComponentResponse2, type ComponentResponse3, type ComponentResponse4, type ComponentResponse5, type ConfidenceAnalysis, type ConfidenceAnalysisLlmUsage, type ConfidenceAnalysisUpdate, type ContextExplorerCompleted, type ContextExplorerStarted, type ContextExplorerUpdate, type CopyFileEntry, type CreateRoomArguments, type DataArtifactUpdated, type DataArtifactUpdatedV1, type DecideNextStepsFields, type EventOfKind, type ExecuteProgramRequestData, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeSummary, type FactSource, type FederatedWikiName, type GeneratedCode, type GeneratedFile, type GeneratedResponse, type GeneratedUiCode, type GetThreadEventOptions, GetThreadsQueryVariables, type IPromptQLSdk, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type InterruptedByTrigger, type KeysOfUnion, type LearningBlockId, type LearningSuggestion, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type ListWikiPageArgs, type LlmResponse, type LlmUsage, type LlmUsageEvent, type LlmUsageEventV1, type MessageProcessingStarted, type MessageProcessingUpdate, type NeedsSupportUpdate, type OrchestratorUpdate, Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineProgress, type PipelineProgressV1, type PipelineProgressV2, type PipelineRunStepDetails, type PipelineSourceState, type PlanGenerationStarted, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionUpdate, type ProgramExecuteOutcome, type ProgramExecuteUpdate, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunnerAction, type ProgrammerUpdate, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlUserId, type PythonRunStepDetails, ROOM_NAME_REGEX, type ResponseGenerationUpdate, type ResponseTruncation, RoomFragment, type RoomVisibilityType, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunSavedProgramRequest, type RunStarted, type RunStartedV1, type RunStepDetails, type SavedProgramRunnerUpdate, type SavedProgramRunnerUpdateV0, type ScheduledAgentTriggerEventId, type ScheduledAgentTriggerId, type ScheduledAgentTriggerPayload, type ScheduledAgentTriggerPayloadV1, type ScheduledAgentTriggerType, type SchemaContext, type SchemaExplored, type SchemaExplorerCompleted, type SchemaExplorerStarted, type SchemaExplorerUpdate, type SchemaTask, type SchemaTasksGenerationCompleted, type SchemaTasksGenerationStarted, type SchemaTasksGenerationUpdate, type SendMessageToThreadArguments, type SendMessageToThreadOutput, SendThreadMessageMutationVariables, type ServerMetadata, type ShelfActionEvent, type ShelfUpdate, type ShelfUpdateV1, type SkillType, type SocialFeedRatingLlmUsage, 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 StartThreadArguments, StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepUpdate, type StreamThreadEventOptions, type TargetWikiPage, type TasksGenerated, type Teaching, type TeachingId, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, ThreadFragment, type TransactionId, type TzWrapper, USER_AGENT, type UiBuildFailure, type UiBuildRunStepDetails, type UiMetadata, type UiProgrammerUpdate, type UserCancel, type UserCancelEvent, type UserMessage, type UserMessageEvent, type UserUpload, type VersionedAgentUpdate, type VersionedOrUnversionedAgentUpdate, type Warning, type WikiAuditId, type WikiChange, type WikiContent, type WikiDelta, type WikiExplorerCompleted, type WikiExplorerStarted, type WikiExplorerUpdate, type WikiGenerationUpdate, type WikiInfoGenerated, type WikiLearningSuggestionUpdate, type WikiPage, type WikiPageNamespace, type WikiPagePreview, type WikiPageSearchResult, type WikiPageV1, type WikiSection, type WikiSelectionUpdate, type WikiTitle, buildPromptQLUrl, cancelAgentMessage, createApolloClient, 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, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, validateRoomName };
3623
+ export { type AgentGeneratedResponse, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionLegacy, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopTerminalAction, type AgentLoopUpdate, type AgentTrigger, type AgentUpdate, type AgentUpdateContent, type ApolloClientOptions, type ArtifactDataPreview, type ArtifactError, type ArtifactErrorV1, type ArtifactId, type ArtifactMetadata, type ArtifactReference, type ArtifactReference1, type ArtifactType, type ArtifactType2, type ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, CancelAgentMessageMutationVariables, type CheckedAssumption, type CheckedTopic, type CodeBlock, type CodeError, type CodeErrorV1, type CodeExecutionComplete, type CodeOutputAnalysis, type CodeOutputAnalyzed, type ComponentResponse, type ComponentResponse1, type ComponentResponse2, type ComponentResponse3, type ComponentResponse4, type ComponentResponse5, type ConfidenceAnalysis, type ConfidenceAnalysisLlmUsage, type ConfidenceAnalysisUpdate, type ContextExplorerCompleted, type ContextExplorerStarted, type ContextExplorerUpdate, type CopyFileEntry, type CreateRoomArguments, type DataArtifactUpdated, type DataArtifactUpdatedV1, type DecideNextStepsFields, type EventOfKind, type ExecuteProgramRequestData, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeSummary, type FactSource, type FederatedWikiName, type GeneratedCode, type GeneratedFile, type GeneratedResponse, type GeneratedUiCode, type GetThreadEventOptions, GetThreadsQueryVariables, type IPromptQLSdk, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type InterruptedByTrigger, type KeysOfUnion, type LearningBlockId, type LearningSuggestion, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type ListWikiPageArgs, type LlmResponse, type LlmUsage, type LlmUsageEvent, type LlmUsageEventV1, type MessageProcessingStarted, type MessageProcessingUpdate, type NeedsSupportUpdate, type OrchestratorUpdate, Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineProgress, type PipelineProgressV1, type PipelineProgressV2, type PipelineRunStepDetails, type PipelineSourceState, type PlanGenerationStarted, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionUpdate, type ProgramExecuteOutcome, type ProgramExecuteUpdate, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunnerAction, type ProgrammerUpdate, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlUserId, type PythonRunStepDetails, ROOM_NAME_REGEX, type ResponseGenerationUpdate, type ResponseTruncation, RoomFragment, type RoomVisibilityType, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunSavedProgramRequest, type RunStarted, type RunStartedV1, type RunStepDetails, type SavedProgramRunnerUpdate, type SavedProgramRunnerUpdateV0, type ScheduledAgentTriggerEventId, type ScheduledAgentTriggerId, type ScheduledAgentTriggerPayload, type ScheduledAgentTriggerPayloadV1, type ScheduledAgentTriggerType, type SchemaContext, type SchemaExplored, type SchemaExplorerCompleted, type SchemaExplorerStarted, type SchemaExplorerUpdate, type SchemaTask, type SchemaTasksGenerationCompleted, type SchemaTasksGenerationStarted, type SchemaTasksGenerationUpdate, type SendMessageToThreadArguments, type SendMessageToThreadOutput, SendThreadMessageMutationVariables, type ServerMetadata, type ShelfActionEvent, type ShelfUpdate, type ShelfUpdateV1, type SkillType, type SocialFeedRatingLlmUsage, 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 StartThreadArguments, StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepUpdate, type StreamThreadEventOptions, type TargetWikiPage, type TasksGenerated, type Teaching, type TeachingId, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, ThreadFragment, type TransactionId, type TzWrapper, USER_AGENT, type UiBuildFailure, type UiBuildRunStepDetails, type UiMetadata, type UiProgrammerUpdate, type UserCancel, type UserCancelEvent, type UserMessage, type UserMessageEvent, type UserUpload, type VersionedAgentUpdate, type VersionedOrUnversionedAgentUpdate, type Warning, type WikiAuditId, type WikiChange, type WikiContent, type WikiDelta, type WikiExplorerCompleted, type WikiExplorerStarted, type WikiExplorerUpdate, type WikiGenerationUpdate, type WikiInfoGenerated, type WikiLearningSuggestionUpdate, type WikiPageDetail, type WikiPageItem, type WikiPageNamespace, type WikiPagePreview, type WikiPageSearchResult, type WikiPageV1, type WikiSection, type WikiSelectionUpdate, type WikiTitle, buildPromptQLUrl, cancelAgentMessage, createApolloClient, 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, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, validateRoomName };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var T=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var Be=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var a in e)T(t,a,{get:e[a],enumerable:!0})},Ce=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of xe(e))!Be.call(t,_)&&_!==a&&T(t,_,{get:()=>e[_],enumerable:!(r=fe(e,_))||r.enumerable});return t};var ke=t=>Ce(T({},"__esModule",{value:!0}),t);var ut={};ve(ut,{PromptQLSdk:()=>K,ROOM_NAME_REGEX:()=>pe,USER_AGENT:()=>d,buildPromptQLUrl:()=>J,cancelAgentMessage:()=>z,createApolloClient:()=>L,createRoom:()=>w,diffThreadEvents:()=>Pe,downloadArtifactData:()=>P,getAgentGeneratedResponse:()=>je,getAgentInteractionDecisionAcceptInteractionEvent:()=>We,getAgentInteractionDecisionDeclineInteractionEvent:()=>Ne,getAgentInteractionFinishedEvent:()=>pt,getAgentMessageProcessingStartedEvent:()=>Ve,getAgentOrchestratorContextExplorerCompletedEvent:()=>Le,getAgentOrchestratorContextExplorerStartedEvent:()=>Qe,getAgentOrchestratorContextExplorerUpdateEvent:()=>c,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent:()=>tt,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent:()=>at,getAgentOrchestratorSchemaExplorerCompletedEvent:()=>et,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent:()=>rt,getAgentOrchestratorSchemaExplorerSchemaExploredEvent:()=>_t,getAgentOrchestratorSchemaExplorerStartedEvent:()=>Ye,getAgentOrchestratorSchemaExplorerUpdateEvent:()=>y,getAgentOrchestratorSchemaTasksGeneratedEvent:()=>Ze,getAgentOrchestratorSchemaTasksGenerationCompletedEvent:()=>Xe,getAgentOrchestratorSchemaTasksGenerationStartedEvent:()=>$e,getAgentOrchestratorSchemaTasksGenerationUpdateEvent:()=>f,getAgentOrchestratorStepProgrammerEvent:()=>nt,getAgentOrchestratorStepSavedProgramRunnerEvent:()=>ot,getAgentOrchestratorStepUiProgrammerEvent:()=>it,getAgentOrchestratorStepUpdateEvent:()=>x,getAgentOrchestratorUpdateEvent:()=>A,getAgentOrchestratorWikiExplorerCompletedEvent:()=>Ke,getAgentOrchestratorWikiExplorerStartedEvent:()=>Je,getAgentOrchestratorWikiExplorerUpdateEvent:()=>h,getAgentOrchestratorWikiInfoGeneratedEvent:()=>He,getAgentPlanGenerationStartedEvent:()=>we,getAgentPlanStepGeneratedEvent:()=>Fe,getAgentPlanningDecisionCompletedEvent:()=>qe,getAgentPlanningDecisionPlanningRequiredEvent:()=>Ge,getAgentPlanningDecisionStartedEvent:()=>ze,getAgentPlanningDecisionUpdateEvent:()=>S,getAgentStartingOrchestratorEvent:()=>De,getArtifactMetadata:()=>U,getThread:()=>V,getThreadEventMessageId:()=>st,getThreadEvents:()=>M,getUserCancelEvent:()=>Ue,getUserMessageEvent:()=>Re,getWikiPage:()=>Q,isInteractionAnalyzing:()=>ue,listArtifactMetadataByThreadId:()=>R,listRooms:()=>m,listThreads:()=>j,listWikiPages:()=>D,sendThreadMessage:()=>N,startThread:()=>W,streamThreadMessageEvents:()=>G,subscribeThreadEvents:()=>q,validateRoomName:()=>se});module.exports=ke(ut);var H={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CancelAgentMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cancel_agent_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"agentMessageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},$={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateRoom"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"description"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_room"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"description"},value:{kind:"Variable",name:{kind:"Name",value:"description"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}}]}}]}}]},X={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SendThreadMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_thread_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},Z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StartThread"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roomId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"start_thread"},arguments:[{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"projectId"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"buildId"},value:{kind:"Variable",name:{kind:"Name",value:"buildId"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"roomId"},value:{kind:"Variable",name:{kind:"Name",value:"roomId"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"createdFrom"},value:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"thread_events"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"thread_event_id"}}]}}]}}]}}]},Y={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetArtifactsByThreadId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifacts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_artifacts"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}}]}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"updated_at"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifact_id"}},{kind:"Field",name:{kind:"Name",value:"latest_version_object"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"artifact_metadata"}},{kind:"Field",name:{kind:"Name",value:"artifact_type"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"version"}}]}}]}}]}}]},ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListGuidePages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"details"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetRooms"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"10"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"rooms"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Room"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Room"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"rooms"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"project_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]},ae={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreads"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_order_by"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},re={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},_e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]},ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]};async function P(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/data`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let b=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to download artifact: ${b}`)}return n.body?n.headers.get("Content-Type")?.startsWith("application/json")?n.json():n.text():null}async function R(t,e,a){let r=await t.query({query:Y,variables:{threadId:a},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(_=>_.latest_version_object).map(_=>({project_id:e,artifact_id:_.artifact_id,artifact_type:_.latest_version_object.artifact_type,version:_.latest_version_object.version,title:_.latest_version_object.title,description:_.latest_version_object.description??null,user_id:_.latest_version_object.user_id,metadata:_.latest_version_object.artifact_metadata,created_at:_.latest_version_object.created_at,size_bytes:Number.parseInt(_.latest_version_object.size)})):[]}async function U(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/metadata`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let p=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to get artifact metadata: ${p}`)}return n.json()}function m(t,e){return t.query({query:te,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.rooms??[])}function w(t,e){if(!e.name)throw new Error("Room name is required");let a=se(e.name);if(a)throw new Error(a);return t.mutate({mutation:$,variables:e,fetchPolicy:"no-cache"}).then(r=>{if(!r.data?.create_room?.room_id)throw new Error("expected room_id in response, got null");return r.data?.create_room?.room_id})}var pe=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,oe=80,se=t=>{let e=t.trim();return e.length===0?null:e.length>oe?`Room name must be ${oe} characters or less`:/[^\p{Ll}\p{Lo}\p{N}_-]/u.test(e)?"Only lowercase letters, numbers, hyphens, and underscores are allowed.":/^[_-]|[_-]$/.test(e)?"Room name should not start or end with a hyphen or underscore.":/[-_]{2,}/.test(e)?"Room name should not contain consecutive hyphens or underscores.":pe.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};var s=require("rxjs");function I(t){return t=t?t.trim():"",t?t[t.length-1]==="/"?t.slice(0,t.length-1):t:""}function F(t){if(t==null)return null;try{Number.parseInt(t)}catch{throw new Error("invalid threadEventId")}return t}function j(t,e){return t.query({query:ae,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2??[])}function V(t,e){if(!e)throw new Error("threadId is required");return t.query({query:re,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2_by_pk)}function W(t,e){if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:Z,variables:e}).then(a=>{if(!a.data?.start_thread)throw new Error(a.error?.message||"Failed to start thread");return a.data.start_thread})}function M(t,e,a){if(!e)throw new Error("threadId is required");let r={thread_id:{_eq:e}};return a&&(a.eventId&&(r.thread_event_id=a.eventId),a.messageId&&(r._or=Oe(a.messageId))),t.query({query:_e,variables:{where:r,limit:a?.limit,ordering:a?.ordering||"asc"},fetchPolicy:"no-cache"}).then(_=>_.data?.thread_events??[])}function N(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:X,variables:e}).then(a=>{if(!a.data?.send_thread_message)throw new Error(a.error?.message||"Failed to send message to thread");return a.data.send_thread_message})}function z(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return t.mutate({mutation:H,variables:e}).then(a=>{if(!a.data?.cancel_agent_message)throw new Error(a.error?.message||"Failed to cancel thread");return a.data.cancel_agent_message})}function q(t,e,a){if(!e)throw new Error("threadId is required");F(a);let r={thread_id:{_eq:e}};return a&&(r.thread_event_id={_gte:a}),t.subscribe({query:ie,variables:{where:r}}).pipe((0,s.map)(_=>{if(_.error)throw _.error;return _.data?.thread_events??[]}))}function G(t,e,a){if(!e)throw new Error("threadId is required");let r,_=F(a?.fromEventId),i={eventId:a?.fromEventId?{_gte:_}:void 0,messageId:a?.messageId},o=a?.pollingInterval&&a?.pollingInterval>0?a.pollingInterval:5;return(0,s.defer)(async()=>{let n=r?{messageId:a?.messageId,eventId:{_gt:r}}:i,p=await M(t,e,n);return p.length>0&&(r=p[p.length-1]?.thread_event_id),p}).pipe((0,s.repeat)({count:a?.timeout&&a.timeout>0?Math.ceil(a.timeout/o):void 0,delay:o*1e3}),(0,s.takeWhile)(n=>ue(n,a?.skipAnalysis),!0))}function ue(t,e){for(let a=t.length-1;a>=0;a--){let r=t[a];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let _=r.event_data.AgentMessage.update;if("content"in _&&("interaction_finished"in _.content||e&&"interaction_update"in _.content&&"main_agent"in _.content.interaction_update&&"completed"in _.content.interaction_update.main_agent)||"InteractionFinished"in _||e&&"OrchestratorUpdate"in _&&"GeneratedResponse"in _.OrchestratorUpdate.update)return!1}return!0}function Oe(t){return[{event_data:{_contains:{UserMessage:{message_id:t}}}},{event_data:{_contains:{AgentMessage:{message_id:t}}}},{event_data:{_contains:{UserCancel:{message_id:t}}}}]}var g=["guide","regular"];async function D(t,e){let a=e.namespace||"regular";if(!g.includes(a))throw new Error(`Invalid namespace. Expected one of: ${g}`);if(a==="guide"){let r={deleted_at:{_is_null:!0}};return e.project_id&&(r.project_id={_eq:e.project_id}),e.query&&(r.page_title={_ilike:e.query.toLowerCase()}),ye(t,{where:r,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="page_id"?"id":e.order_by]:e.ordering||"asc"}:void 0})}return de(t,{where:e.project_id?{project_id:{_eq:e.project_id},deleted_at:{_is_null:!0}}:{},limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[e.order_by||"page_id"]:e.ordering||"asc"}:void 0}).then(r=>Ee(r,e))}async function Q(t,e,a,r){if(a=a||"regular",!g.includes(a))throw new Error(`Invalid namespace. Expected one of: ${g}`);if(!e)throw new Error("project_id is required");if(!r)throw new Error("id is required");if(a==="guide"){let o=await ye(t,{where:{project_id:{_eq:e},id:{_eq:r},deleted_at:{_is_null:!0}},limit:1});return o.length?o[0]:null}let _=await de(t,{where:{project_id:{_eq:e},page_id:{_eq:r},deleted_at:{_is_null:!0}},limit:1});return _.length?_[0]:null}function de(t,e){return t.query({query:ne,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki.map(r=>({page_id:r.page_id,created_at:r.created_at,last_modified_at:r.last_modified_at,...r.content}))??[])}function ye(t,e){return t.query({query:ee,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_guide_page?.map(r=>({page_id:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title,details:r.details}))??[])}function Ee(t,e){if(!t.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return t;let a=e.query?.toLowerCase(),r=t.filter(_=>!e.include_stub&&_.stub?!1:!!(!a||_.title.toLowerCase().includes(a)||_.definition&&_.definition.toLowerCase().includes(a)||_.aliases?.length&&_.aliases.some(i=>i.toLowerCase().includes(a))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}function ce(t){return t!=null&&typeof t=="object"&&"status"in t&&t.status==="failure"}function le(t){return t!=null&&typeof t=="object"&&"status"in t&&t.status==="success"&&"token"in t}function be(t){return t!=null&&typeof t=="object"&&("data"in t&&!!t.data&&typeof t.data=="object"&&"enrich_token"in t.data&&!!t.data.enrich_token&&typeof t.data.enrich_token=="object"&&"userDirectoryJWT"in t.data.enrich_token||"errors"in t&&Array.isArray(t.errors))}function me(t){let a=`${I(t.authHost)||"https://auth.pro.hasura.io"}/ddn/promptql/token`,r={token:"",expiry:new Date(0)},_=t.fetch||fetch,i=async()=>{let o=await _(a,{method:"POST",headers:t.headers});switch(o.status){case 200:{let n=await o.json();if(le(n))return n;throw new Error("malformed token response")}case 401:{let n=await o.json();throw ce(n)?new Error(n?.error||o.statusText):new Error(o.statusText)}default:{let n=await o.text();throw new Error(n)}}};return async()=>{if(r.expiry.getTime()<=Date.now()+1e3){let o=await i(),n=await Te(t.promptqlGraphQLUrl,o.token,t.projectId,_);r.token=n;let p=new Date(o.expiry);if(Number.isNaN(p.getTime())){let b=new Date;b.setHours(1),r.expiry=b}else r.expiry=p}return r.token}}var Te=async(t,e,a,r=fetch)=>{let _=await r(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:"mutation EnrichToken($luxJWT: String!, $projectId: uuid) { enrich_token(luxJWT: $luxJWT, projectId: $projectId) { userDirectoryJWT }}",variables:{luxJWT:e,projectId:a},operationName:"EnrichToken"})});switch(_.status){case 200:{let i=await _.json();if(!be(i)||!i.data?.enrich_token?.userDirectoryJWT)throw new Error(`malformed promptql token response: ${JSON.stringify(i)}`);return i.data.enrich_token.userDirectoryJWT}default:{let i=await _.text();throw new Error(i)}}};var d="PromptQL TypeScript SDK";var u=require("@apollo/client"),Ie=require("@apollo/client/link/context"),Me=require("@apollo/client/link/subscriptions"),ge=require("graphql"),Se=require("graphql-ws");var L=t=>{let e=new u.HttpLink({uri:t.url,fetch:t.fetch,headers:t.headers}),a=async n=>{let p=await t.getAuthToken();return{headers:{"User-Agent":d,...n,Authorization:`Bearer ${p}`}}},r=(0,Se.createClient)({url:t.url,connectionParams:()=>a(t.headers),lazy:!0}),_=new Me.GraphQLWsLink(r),i=new Ie.SetContextLink(({headers:n})=>a(n)),o=u.ApolloLink.split(({operationType:n})=>n===ge.OperationTypeNode.SUBSCRIPTION,_,i.concat(e));return{client:new u.ApolloClient({link:o,cache:new u.InMemoryCache}),wsClient:r}};function Pe(t,e){if(!e.length)return[];if(!t.length)return e;let a=t[t.length-1];if(!a)return e;let r=BigInt(a.thread_event_id),_=e.length-1;for(;_>=0;_--){let i=e[_];if(BigInt(i?.thread_event_id)<=r)break}return e.slice(_+1)}function Re(t){return"UserMessage"in t?t.UserMessage:null}function Ue(t){return"UserCancel"in t?t.UserCancel:null}function we(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)||!("PlanGenerationStarted"in t.AgentMessage.update.OrchestratorUpdate.update)?null:t.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function Fe(t){let e=A(t);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function je(t){return"AgentMessage"in t?"content"in t.AgentMessage.update&&"interaction_update"in t.AgentMessage.update.content&&"main_agent"in t.AgentMessage.update.content.interaction_update&&"completed"in t.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:t.AgentMessage.update.content.interaction_update.main_agent.completed.summary,modified_artifacts:[],generated_at:t.AgentMessage.update.timestamp,messageId:t.AgentMessage.message_id}:!("OrchestratorUpdate"in t.AgentMessage.update)||!("GeneratedResponse"in t.AgentMessage.update.OrchestratorUpdate.update)?null:{...t.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:t.AgentMessage.message_id}:null}function Ve(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("ProcessingStarted"in t.AgentMessage.update.MessageProcessingUpdate.update)?null:t.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function We(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function Ne(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function S(t){return!("AgentMessage"in t)||!("PlanningDecisionUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.PlanningDecisionUpdate.update}function ze(t){let e=S(t);return!e||!("Started"in e)?null:e.Started}function qe(t){let e=S(t);return!e||!("Completed"in e)?null:e.Completed}function Ge(t){let e=S(t);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function De(t){return!("AgentMessage"in t)||!("StartingOrchestrator"in t.AgentMessage.update)?null:t.AgentMessage.update.StartingOrchestrator}function A(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.OrchestratorUpdate.update}function c(t){let e=A(t);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function Qe(t){let e=c(t);return!e||!("Started"in e)?null:e.Started}function Le(t){let e=c(t);return!e||!("Completed"in e)?null:e.Completed}function h(t){let e=c(t);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function Je(t){let e=h(t);return!e||!("Started"in e)?null:e.Started}function Ke(t){let e=h(t);return!e||!("Completed"in e)?null:e.Completed}function He(t){let e=h(t);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function f(t){let e=c(t);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function $e(t){let e=f(t);return!e||!("Started"in e)?null:e.Started}function Xe(t){let e=f(t);return!e||!("Completed"in e)?null:e.Completed}function Ze(t){let e=f(t);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function y(t){let e=c(t);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function Ye(t){let e=y(t);return!e||!("Started"in e)?null:e.Started}function et(t){let e=y(t);return!e||!("Completed"in e)?null:e.Completed}function tt(t){let e=y(t);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function at(t){let e=y(t);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function rt(t){let e=y(t);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function _t(t){let e=y(t);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function x(t){let e=A(t);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function nt(t){let e=x(t);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function it(t){let e=x(t);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function ot(t){let e=x(t);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function pt(t){if(!("AgentMessage"in t))return null;if("InteractionFinished"in t.AgentMessage.update){let e=t.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:t.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:t.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:t.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:{status:"unknown",messageId:t.AgentMessage.message_id}}if("content"in t.AgentMessage.update&&"interaction_finished"in t.AgentMessage.update.content){let e=t.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:t.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:t.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:t.AgentMessage.message_id}}return null}function st(t){if(t){if("UserMessage"in t)return t.UserMessage.message_id;if("AgentMessage"in t)return t.AgentMessage.message_id;if("UserTeach"in t)return t.UserTeach.agent_message_id;if("UserCancel"in t)return t.UserCancel.message_id}}function J(t){return`https://promptql.${t}/playground-v2-hge/v1/graphql`}var B=class{controlPlaneUrl;options;defaultTimezone;getAuthTokenFn;project;client;wsClient;constructor(e){if(this.options=e,!e.serviceAccountToken)throw new Error("serviceAccountToken must not be empty. If you haven't created any service account token yet, check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let a=e.controlPlaneHost?I(e.controlPlaneHost):"https://data.pro.hasura.io";this.controlPlaneUrl=`${a}/v1/graphql`}async getAuthToken(){if(typeof this.getAuthTokenFn=="function")return this.getAuthTokenFn();let e=await this.getProjectInfo();return this.getAuthTokenFn=me({promptqlGraphQLUrl:e.promptqlGraphQLUrl,authHost:this.options.authHost,headers:Ae(this.options.serviceAccountToken),fetch:this.options.fetch}),this.getAuthTokenFn()}async getGraphQLClient(){if(this.client)return this.client;let e=await this.getProjectInfo(),{client:a,wsClient:r}=L({getAuthToken:this.getAuthToken.bind(this),url:e.promptqlGraphQLUrl,fetch:this.options.fetch,headers:this.options.headers});return this.wsClient=r,this.client=a,this.client}async getProjectInfo(){if(this.project)return this.project;let e={operationName:"GetDdnProjects",query:"query GetDdnProjects { ddn_projects(limit: 1) { id name private_ddn { fqdn path_routing_context path_routing_enabled }}}"},r=await(typeof this.options.fetch=="function"?this.options.fetch:fetch)(this.controlPlaneUrl,{method:"POST",headers:{...Ae(this.options.serviceAccountToken),"User-Agent":d,"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!==200){let o=r.body?await r.text():r.statusText;throw new Error(`[${r.status}] failed to get project info: ${o}`)}let _=await r.json();if(!_.data?.ddn_projects?.length)throw new Error("Project not found");let i=_.data.ddn_projects[0];return this.project={projectId:i.id,projectName:i.name,projectHost:`https://${i.name}.${i.private_ddn.fqdn}`,promptqlConsoleUrl:`https://prompt.ql.app/project/${i.name}`,promptqlGraphQLUrl:J(i.private_ddn.fqdn)},this.project}close(){if(this.wsClient&&(this.wsClient.dispose(),this.wsClient=void 0),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.client=void 0,this.project=void 0,this.getAuthTokenFn=void 0}}};function Ae(t){return{Authorization:`pat ${t}`}}var v=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return R(r,a.projectId,e)}async download(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return P(r.projectHost,e,a,he(_),this.api.options.fetch)}async getMetadata(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return U(r.projectHost,e,a,he(_),this.api.options.fetch)}};function he(t){return{Authorization:`Bearer ${t}`,"User-Agent":d}}var C=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var k=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return m(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){let a=await this.api.getGraphQLClient();return m(a,{where:{name:{_eq:e}},limit:1}).then(r=>r.length?r[0]??null:null)}async create(e){let a=await this.api.getGraphQLClient();return w(a,e)}};var l=require("rxjs");var O=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return j(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");let a=await this.api.getGraphQLClient();return V(a,e)}async start(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return W(r,{...e,projectId:a.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async getEvents(e,a){let r=await this.api.getGraphQLClient();return M(r,e,a)}async sendMessage(e){let a=await this.api.getGraphQLClient();return N(a,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){let a=await this.api.getGraphQLClient();return z(a,e)}subscribeEvents(e,a){return(0,l.from)(this.api.getGraphQLClient()).pipe((0,l.switchMap)(r=>q(r,e,a)))}streamMessageEvents(e,a){return(0,l.from)(this.api.getGraphQLClient()).pipe((0,l.switchMap)(r=>G(r,e,a)))}};var E=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return D(a,e)}async get(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getGraphQLClient();return Q(_,r.projectId,e,a)}};var K=class{constructor(e){let a=new B(e);this.api=a,this.thread=new O(a),this.project=new C(a),this.room=new k(a),this.artifact=new v(a),this.wiki=new E(a)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};0&&(module.exports={PromptQLSdk,ROOM_NAME_REGEX,USER_AGENT,buildPromptQLUrl,cancelAgentMessage,createApolloClient,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,getWikiPage,isInteractionAnalyzing,listArtifactMetadataByThreadId,listRooms,listThreads,listWikiPages,sendThreadMessage,startThread,streamThreadMessageEvents,subscribeThreadEvents,validateRoomName});
1
+ "use strict";var T=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var Be=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var a in e)T(t,a,{get:e[a],enumerable:!0})},Ce=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of xe(e))!Be.call(t,_)&&_!==a&&T(t,_,{get:()=>e[_],enumerable:!(r=fe(e,_))||r.enumerable});return t};var ke=t=>Ce(T({},"__esModule",{value:!0}),t);var lt={};ve(lt,{PromptQLSdk:()=>K,ROOM_NAME_REGEX:()=>ue,USER_AGENT:()=>d,buildPromptQLUrl:()=>J,cancelAgentMessage:()=>z,createApolloClient:()=>L,createRoom:()=>w,diffThreadEvents:()=>Fe,downloadArtifactData:()=>P,getAgentGeneratedResponse:()=>ze,getAgentInteractionDecisionAcceptInteractionEvent:()=>Ge,getAgentInteractionDecisionDeclineInteractionEvent:()=>De,getAgentInteractionFinishedEvent:()=>yt,getAgentMessageProcessingStartedEvent:()=>qe,getAgentOrchestratorContextExplorerCompletedEvent:()=>$e,getAgentOrchestratorContextExplorerStartedEvent:()=>He,getAgentOrchestratorContextExplorerUpdateEvent:()=>c,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent:()=>nt,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent:()=>it,getAgentOrchestratorSchemaExplorerCompletedEvent:()=>_t,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent:()=>ot,getAgentOrchestratorSchemaExplorerSchemaExploredEvent:()=>pt,getAgentOrchestratorSchemaExplorerStartedEvent:()=>rt,getAgentOrchestratorSchemaExplorerUpdateEvent:()=>y,getAgentOrchestratorSchemaTasksGeneratedEvent:()=>at,getAgentOrchestratorSchemaTasksGenerationCompletedEvent:()=>tt,getAgentOrchestratorSchemaTasksGenerationStartedEvent:()=>et,getAgentOrchestratorSchemaTasksGenerationUpdateEvent:()=>f,getAgentOrchestratorStepProgrammerEvent:()=>st,getAgentOrchestratorStepSavedProgramRunnerEvent:()=>dt,getAgentOrchestratorStepUiProgrammerEvent:()=>ut,getAgentOrchestratorStepUpdateEvent:()=>x,getAgentOrchestratorUpdateEvent:()=>A,getAgentOrchestratorWikiExplorerCompletedEvent:()=>Ze,getAgentOrchestratorWikiExplorerStartedEvent:()=>Xe,getAgentOrchestratorWikiExplorerUpdateEvent:()=>h,getAgentOrchestratorWikiInfoGeneratedEvent:()=>Ye,getAgentPlanGenerationStartedEvent:()=>We,getAgentPlanStepGeneratedEvent:()=>Ne,getAgentPlanningDecisionCompletedEvent:()=>Le,getAgentPlanningDecisionPlanningRequiredEvent:()=>Je,getAgentPlanningDecisionStartedEvent:()=>Qe,getAgentPlanningDecisionUpdateEvent:()=>S,getAgentStartingOrchestratorEvent:()=>Ke,getArtifactMetadata:()=>U,getThread:()=>V,getThreadEventMessageId:()=>ct,getThreadEvents:()=>M,getUserCancelEvent:()=>Ve,getUserMessageEvent:()=>je,getWikiPage:()=>Q,isInteractionAnalyzing:()=>ye,listArtifactMetadataByThreadId:()=>R,listRooms:()=>m,listThreads:()=>j,listWikiPages:()=>D,sendThreadMessage:()=>N,startThread:()=>W,streamThreadMessageEvents:()=>G,subscribeThreadEvents:()=>q,validateRoomName:()=>de});module.exports=ke(lt);var H={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CancelAgentMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cancel_agent_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"agentMessageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},$={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateRoom"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"description"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_room"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"description"},value:{kind:"Variable",name:{kind:"Name",value:"description"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}}]}}]}}]},X={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SendThreadMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_thread_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},Z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StartThread"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roomId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"start_thread"},arguments:[{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"projectId"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"buildId"},value:{kind:"Variable",name:{kind:"Name",value:"buildId"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"roomId"},value:{kind:"Variable",name:{kind:"Name",value:"roomId"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"createdFrom"},value:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"thread_events"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"thread_event_id"}}]}}]}}]}}]},Y={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetArtifactsByThreadId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifacts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_artifacts"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}}]}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"updated_at"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifact_id"}},{kind:"Field",name:{kind:"Name",value:"latest_version_object"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"artifact_metadata"}},{kind:"Field",name:{kind:"Name",value:"artifact_type"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"version"}}]}}]}}]}}]},ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListGuidePages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetGuidePage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"project_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"page_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"project_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"project_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"page_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"deleted_at"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_is_null"},value:{kind:"BooleanValue",value:!0}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"details"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},ae={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetRooms"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"10"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"rooms"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Room"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Room"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"rooms"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"project_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]},re={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreads"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_order_by"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},_e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]},ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}},{kind:"Field",alias:{kind:"Name",value:"title"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"title",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"stub"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"stub",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"aliases"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"aliases",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"definition"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"definition",block:!1}}]}]}}]}}]},oe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"project_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"page_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"project_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"project_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"page_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"page_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"deleted_at"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_is_null"},value:{kind:"BooleanValue",value:!0}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},pe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]};async function P(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/data`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let b=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to download artifact: ${b}`)}return n.body?n.headers.get("Content-Type")?.startsWith("application/json")?n.json():n.text():null}async function R(t,e,a){let r=await t.query({query:Y,variables:{threadId:a},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(_=>_.latest_version_object).map(_=>({project_id:e,artifact_id:_.artifact_id,artifact_type:_.latest_version_object.artifact_type,version:_.latest_version_object.version,title:_.latest_version_object.title,description:_.latest_version_object.description??null,user_id:_.latest_version_object.user_id,metadata:_.latest_version_object.artifact_metadata,created_at:_.latest_version_object.created_at,size_bytes:Number.parseInt(_.latest_version_object.size)})):[]}async function U(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/metadata`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let p=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to get artifact metadata: ${p}`)}return n.json()}function m(t,e){return t.query({query:ae,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.rooms??[])}function w(t,e){if(!e.name)throw new Error("Room name is required");let a=de(e.name);if(a)throw new Error(a);return t.mutate({mutation:$,variables:e,fetchPolicy:"no-cache"}).then(r=>{if(!r.data?.create_room?.room_id)throw new Error("expected room_id in response, got null");return r.data?.create_room?.room_id})}var ue=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,se=80,de=t=>{let e=t.trim();return e.length===0?null:e.length>se?`Room name must be ${se} characters or less`:/[^\p{Ll}\p{Lo}\p{N}_-]/u.test(e)?"Only lowercase letters, numbers, hyphens, and underscores are allowed.":/^[_-]|[_-]$/.test(e)?"Room name should not start or end with a hyphen or underscore.":/[-_]{2,}/.test(e)?"Room name should not contain consecutive hyphens or underscores.":ue.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};var s=require("rxjs");function I(t){return t=t?t.trim():"",t?t[t.length-1]==="/"?t.slice(0,t.length-1):t:""}function F(t){if(t==null)return null;try{Number.parseInt(t)}catch{throw new Error("invalid threadEventId")}return t}function j(t,e){return t.query({query:re,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2??[])}function V(t,e){if(!e)throw new Error("threadId is required");return t.query({query:_e,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2_by_pk)}function W(t,e){if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:Z,variables:e}).then(a=>{if(!a.data?.start_thread)throw new Error(a.error?.message||"Failed to start thread");return a.data.start_thread})}function M(t,e,a){if(!e)throw new Error("threadId is required");let r={thread_id:{_eq:e}};return a&&(a.eventId&&(r.thread_event_id=a.eventId),a.messageId&&(r._or=Oe(a.messageId))),t.query({query:ne,variables:{where:r,limit:a?.limit,ordering:a?.ordering||"asc"},fetchPolicy:"no-cache"}).then(_=>_.data?.thread_events??[])}function N(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:X,variables:e}).then(a=>{if(!a.data?.send_thread_message)throw new Error(a.error?.message||"Failed to send message to thread");return a.data.send_thread_message})}function z(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return t.mutate({mutation:H,variables:e}).then(a=>{if(!a.data?.cancel_agent_message)throw new Error(a.error?.message||"Failed to cancel thread");return a.data.cancel_agent_message})}function q(t,e,a){if(!e)throw new Error("threadId is required");F(a);let r={thread_id:{_eq:e}};return a&&(r.thread_event_id={_gte:a}),t.subscribe({query:pe,variables:{where:r}}).pipe((0,s.map)(_=>{if(_.error)throw _.error;return _.data?.thread_events??[]}))}function G(t,e,a){if(!e)throw new Error("threadId is required");let r,_=F(a?.fromEventId),i={eventId:a?.fromEventId?{_gte:_}:void 0,messageId:a?.messageId},o=a?.pollingInterval&&a?.pollingInterval>0?a.pollingInterval:5;return(0,s.defer)(async()=>{let n=r?{messageId:a?.messageId,eventId:{_gt:r}}:i,p=await M(t,e,n);return p.length>0&&(r=p[p.length-1]?.thread_event_id),p}).pipe((0,s.repeat)({count:a?.timeout&&a.timeout>0?Math.ceil(a.timeout/o):void 0,delay:o*1e3}),(0,s.takeWhile)(n=>ye(n,a?.skipAnalysis),!0))}function ye(t,e){for(let a=t.length-1;a>=0;a--){let r=t[a];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let _=r.event_data.AgentMessage.update;if("content"in _&&("interaction_finished"in _.content||e&&"interaction_update"in _.content&&"main_agent"in _.content.interaction_update&&"completed"in _.content.interaction_update.main_agent)||"InteractionFinished"in _||e&&"OrchestratorUpdate"in _&&"GeneratedResponse"in _.OrchestratorUpdate.update)return!1}return!0}function Oe(t){return[{event_data:{_contains:{UserMessage:{message_id:t}}}},{event_data:{_contains:{AgentMessage:{message_id:t}}}},{event_data:{_contains:{UserCancel:{message_id:t}}}}]}var g=["guide","regular"];async function D(t,e){let a=e.namespace||"regular";if(!g.includes(a))throw new Error(`Invalid namespace. Expected one of: ${g}`);if(a==="guide"){let o={deleted_at:{_is_null:!0}};return e.project_id&&(o.project_id={_eq:e.project_id}),e.query&&(o.page_title={_ilike:e.query.toLowerCase()}),Te(t,{where:o,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="page_id"?"id":e.order_by]:e.ordering||"asc"}:void 0})}let r=e.project_id||!e.include_stub||e.namespace||e.project_id||e.query,_={where:e.project_id?{project_id:{_eq:e.project_id},deleted_at:{_is_null:!0}}:{},order_by:e.order_by||e.ordering?{[e.order_by||"page_id"]:e.ordering||"asc"}:void 0};r||(_.offset=e.offset,_.limit=e.limit);let i=await Ee(t,_);return r?Ue(i,e):i}async function Q(t,e,a,r){if(a=a||"regular",!g.includes(a))throw new Error(`Invalid namespace. Expected one of: ${g}`);if(!e)throw new Error("project_id is required");if(!r)throw new Error("id is required");return a==="guide"?Re(t,{project_id:e,page_id:r}):Pe(t,{project_id:e,page_id:r})}function Ee(t,e){return t.query({query:ie,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki??[])}function Te(t,e){return t.query({query:ee,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_guide_page?.map(r=>({page_id:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function Pe(t,e){let a=await t.query({query:oe,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(_=>({page_id:_.page_id,created_at:_.created_at,last_modified_at:_.last_modified_at,..._.content}))??[]);return a.length?a[0]:null}async function Re(t,e){let a=await t.query({query:te,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(_=>({page_id:_.id,created_at:_.created_at,last_modified_at:_.last_modified_at,title:_.page_title,details:_.details}))??[]);return a.length?a[0]:null}function Ue(t,e){if(!t.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return t;let a=e.query?.toLowerCase(),r=t.filter(_=>!e.include_stub&&_.stub?!1:!!(!a||_.title.toLowerCase().includes(a)||_.definition&&_.definition.toLowerCase().includes(a)||_.aliases?.length&&_.aliases.some(i=>i.toLowerCase().includes(a))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}function ce(t){return t!=null&&typeof t=="object"&&"status"in t&&t.status==="failure"}function le(t){return t!=null&&typeof t=="object"&&"status"in t&&t.status==="success"&&"token"in t}function be(t){return t!=null&&typeof t=="object"&&("data"in t&&!!t.data&&typeof t.data=="object"&&"enrich_token"in t.data&&!!t.data.enrich_token&&typeof t.data.enrich_token=="object"&&"userDirectoryJWT"in t.data.enrich_token||"errors"in t&&Array.isArray(t.errors))}function me(t){let a=`${I(t.authHost)||"https://auth.pro.hasura.io"}/ddn/promptql/token`,r={token:"",expiry:new Date(0)},_=t.fetch||fetch,i=async()=>{let o=await _(a,{method:"POST",headers:t.headers});switch(o.status){case 200:{let n=await o.json();if(le(n))return n;throw new Error("malformed token response")}case 401:{let n=await o.json();throw ce(n)?new Error(n?.error||o.statusText):new Error(o.statusText)}default:{let n=await o.text();throw new Error(n)}}};return async()=>{if(r.expiry.getTime()<=Date.now()+1e3){let o=await i(),n=await we(t.promptqlGraphQLUrl,o.token,t.projectId,_);r.token=n;let p=new Date(o.expiry);if(Number.isNaN(p.getTime())){let b=new Date;b.setHours(1),r.expiry=b}else r.expiry=p}return r.token}}var we=async(t,e,a,r=fetch)=>{let _=await r(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:"mutation EnrichToken($luxJWT: String!, $projectId: uuid) { enrich_token(luxJWT: $luxJWT, projectId: $projectId) { userDirectoryJWT }}",variables:{luxJWT:e,projectId:a},operationName:"EnrichToken"})});switch(_.status){case 200:{let i=await _.json();if(!be(i)||!i.data?.enrich_token?.userDirectoryJWT)throw new Error(`malformed promptql token response: ${JSON.stringify(i)}`);return i.data.enrich_token.userDirectoryJWT}default:{let i=await _.text();throw new Error(i)}}};var d="PromptQL TypeScript SDK";var u=require("@apollo/client"),Ie=require("@apollo/client/link/context"),Me=require("@apollo/client/link/subscriptions"),ge=require("graphql"),Se=require("graphql-ws");var L=t=>{let e=new u.HttpLink({uri:t.url,fetch:t.fetch,headers:t.headers}),a=async n=>{let p=await t.getAuthToken();return{headers:{"User-Agent":d,...n,Authorization:`Bearer ${p}`}}},r=(0,Se.createClient)({url:t.url,connectionParams:()=>a(t.headers),lazy:!0}),_=new Me.GraphQLWsLink(r),i=new Ie.SetContextLink(({headers:n})=>a(n)),o=u.ApolloLink.split(({operationType:n})=>n===ge.OperationTypeNode.SUBSCRIPTION,_,i.concat(e));return{client:new u.ApolloClient({link:o,cache:new u.InMemoryCache}),wsClient:r}};function Fe(t,e){if(!e.length)return[];if(!t.length)return e;let a=t[t.length-1];if(!a)return e;let r=BigInt(a.thread_event_id),_=e.length-1;for(;_>=0;_--){let i=e[_];if(BigInt(i?.thread_event_id)<=r)break}return e.slice(_+1)}function je(t){return"UserMessage"in t?t.UserMessage:null}function Ve(t){return"UserCancel"in t?t.UserCancel:null}function We(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)||!("PlanGenerationStarted"in t.AgentMessage.update.OrchestratorUpdate.update)?null:t.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function Ne(t){let e=A(t);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function ze(t){return"AgentMessage"in t?"content"in t.AgentMessage.update&&"interaction_update"in t.AgentMessage.update.content&&"main_agent"in t.AgentMessage.update.content.interaction_update&&"completed"in t.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:t.AgentMessage.update.content.interaction_update.main_agent.completed.summary,modified_artifacts:[],generated_at:t.AgentMessage.update.timestamp,messageId:t.AgentMessage.message_id}:!("OrchestratorUpdate"in t.AgentMessage.update)||!("GeneratedResponse"in t.AgentMessage.update.OrchestratorUpdate.update)?null:{...t.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:t.AgentMessage.message_id}:null}function qe(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("ProcessingStarted"in t.AgentMessage.update.MessageProcessingUpdate.update)?null:t.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function Ge(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function De(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function S(t){return!("AgentMessage"in t)||!("PlanningDecisionUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.PlanningDecisionUpdate.update}function Qe(t){let e=S(t);return!e||!("Started"in e)?null:e.Started}function Le(t){let e=S(t);return!e||!("Completed"in e)?null:e.Completed}function Je(t){let e=S(t);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function Ke(t){return!("AgentMessage"in t)||!("StartingOrchestrator"in t.AgentMessage.update)?null:t.AgentMessage.update.StartingOrchestrator}function A(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.OrchestratorUpdate.update}function c(t){let e=A(t);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function He(t){let e=c(t);return!e||!("Started"in e)?null:e.Started}function $e(t){let e=c(t);return!e||!("Completed"in e)?null:e.Completed}function h(t){let e=c(t);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function Xe(t){let e=h(t);return!e||!("Started"in e)?null:e.Started}function Ze(t){let e=h(t);return!e||!("Completed"in e)?null:e.Completed}function Ye(t){let e=h(t);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function f(t){let e=c(t);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function et(t){let e=f(t);return!e||!("Started"in e)?null:e.Started}function tt(t){let e=f(t);return!e||!("Completed"in e)?null:e.Completed}function at(t){let e=f(t);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function y(t){let e=c(t);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function rt(t){let e=y(t);return!e||!("Started"in e)?null:e.Started}function _t(t){let e=y(t);return!e||!("Completed"in e)?null:e.Completed}function nt(t){let e=y(t);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function it(t){let e=y(t);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function ot(t){let e=y(t);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function pt(t){let e=y(t);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function x(t){let e=A(t);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function st(t){let e=x(t);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function ut(t){let e=x(t);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function dt(t){let e=x(t);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function yt(t){if(!("AgentMessage"in t))return null;if("InteractionFinished"in t.AgentMessage.update){let e=t.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:t.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:t.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:t.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:{status:"unknown",messageId:t.AgentMessage.message_id}}if("content"in t.AgentMessage.update&&"interaction_finished"in t.AgentMessage.update.content){let e=t.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:t.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:t.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:t.AgentMessage.message_id}}return null}function ct(t){if(t){if("UserMessage"in t)return t.UserMessage.message_id;if("AgentMessage"in t)return t.AgentMessage.message_id;if("UserTeach"in t)return t.UserTeach.agent_message_id;if("UserCancel"in t)return t.UserCancel.message_id}}function J(t){return`https://promptql.${t}/playground-v2-hge/v1/graphql`}var B=class{controlPlaneUrl;options;defaultTimezone;getAuthTokenFn;project;client;wsClient;constructor(e){if(this.options=e,!e.serviceAccountToken)throw new Error("serviceAccountToken must not be empty. If you haven't created any service account token yet, check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let a=e.controlPlaneHost?I(e.controlPlaneHost):"https://data.pro.hasura.io";this.controlPlaneUrl=`${a}/v1/graphql`}async getAuthToken(){if(typeof this.getAuthTokenFn=="function")return this.getAuthTokenFn();let e=await this.getProjectInfo();return this.getAuthTokenFn=me({promptqlGraphQLUrl:e.promptqlGraphQLUrl,authHost:this.options.authHost,headers:Ae(this.options.serviceAccountToken),fetch:this.options.fetch}),this.getAuthTokenFn()}async getGraphQLClient(){if(this.client)return this.client;let e=await this.getProjectInfo(),{client:a,wsClient:r}=L({getAuthToken:this.getAuthToken.bind(this),url:e.promptqlGraphQLUrl,fetch:this.options.fetch,headers:this.options.headers});return this.wsClient=r,this.client=a,this.client}async getProjectInfo(){if(this.project)return this.project;let e={operationName:"GetDdnProjects",query:"query GetDdnProjects { ddn_projects(limit: 1) { id name private_ddn { fqdn path_routing_context path_routing_enabled }}}"},r=await(typeof this.options.fetch=="function"?this.options.fetch:fetch)(this.controlPlaneUrl,{method:"POST",headers:{...Ae(this.options.serviceAccountToken),"User-Agent":d,"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!==200){let o=r.body?await r.text():r.statusText;throw new Error(`[${r.status}] failed to get project info: ${o}`)}let _=await r.json();if(!_.data?.ddn_projects?.length)throw new Error("Project not found");let i=_.data.ddn_projects[0];return this.project={projectId:i.id,projectName:i.name,projectHost:`https://${i.name}.${i.private_ddn.fqdn}`,promptqlConsoleUrl:`https://prompt.ql.app/project/${i.name}`,promptqlGraphQLUrl:J(i.private_ddn.fqdn)},this.project}close(){if(this.wsClient&&(this.wsClient.dispose(),this.wsClient=void 0),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.client=void 0,this.project=void 0,this.getAuthTokenFn=void 0}}};function Ae(t){return{Authorization:`pat ${t}`}}var v=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return R(r,a.projectId,e)}async download(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return P(r.projectHost,e,a,he(_),this.api.options.fetch)}async getMetadata(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return U(r.projectHost,e,a,he(_),this.api.options.fetch)}};function he(t){return{Authorization:`Bearer ${t}`,"User-Agent":d}}var C=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var k=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return m(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){let a=await this.api.getGraphQLClient();return m(a,{where:{name:{_eq:e}},limit:1}).then(r=>r.length?r[0]??null:null)}async create(e){let a=await this.api.getGraphQLClient();return w(a,e)}};var l=require("rxjs");var O=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return j(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");let a=await this.api.getGraphQLClient();return V(a,e)}async start(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return W(r,{...e,projectId:a.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async getEvents(e,a){let r=await this.api.getGraphQLClient();return M(r,e,a)}async sendMessage(e){let a=await this.api.getGraphQLClient();return N(a,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){let a=await this.api.getGraphQLClient();return z(a,e)}subscribeEvents(e,a){return(0,l.from)(this.api.getGraphQLClient()).pipe((0,l.switchMap)(r=>q(r,e,a)))}streamMessageEvents(e,a){return(0,l.from)(this.api.getGraphQLClient()).pipe((0,l.switchMap)(r=>G(r,e,a)))}};var E=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return D(a,e)}async get(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getGraphQLClient();return Q(_,r.projectId,e,a)}};var K=class{constructor(e){let a=new B(e);this.api=a,this.thread=new O(a),this.project=new C(a),this.room=new k(a),this.artifact=new v(a),this.wiki=new E(a)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};0&&(module.exports={PromptQLSdk,ROOM_NAME_REGEX,USER_AGENT,buildPromptQLUrl,cancelAgentMessage,createApolloClient,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,getWikiPage,isInteractionAnalyzing,listArtifactMetadataByThreadId,listRooms,listThreads,listWikiPages,sendThreadMessage,startThread,streamThreadMessageEvents,subscribeThreadEvents,validateRoomName});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a as C,b as g,f as k}from"./chunk-YCHA4U67.mjs";var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CancelAgentMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cancel_agent_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"agentMessageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},E={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateRoom"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"description"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_room"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"description"},value:{kind:"Variable",name:{kind:"Name",value:"description"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}}]}}]}}]},T={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SendThreadMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_thread_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StartThread"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roomId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"start_thread"},arguments:[{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"projectId"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"buildId"},value:{kind:"Variable",name:{kind:"Name",value:"buildId"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"roomId"},value:{kind:"Variable",name:{kind:"Name",value:"roomId"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"createdFrom"},value:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"thread_events"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"thread_event_id"}}]}}]}}]}}]},R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetArtifactsByThreadId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifacts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_artifacts"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}}]}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"updated_at"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifact_id"}},{kind:"Field",name:{kind:"Name",value:"latest_version_object"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"artifact_metadata"}},{kind:"Field",name:{kind:"Name",value:"artifact_type"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"version"}}]}}]}}]}}]},U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListGuidePages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"details"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},w={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetRooms"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"10"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"rooms"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Room"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Room"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"rooms"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"project_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]},F={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreads"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_order_by"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},j={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]},W={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},N={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]};async function z(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/data`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let ue=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to download artifact: ${ue}`)}return n.body?n.headers.get("Content-Type")?.startsWith("application/json")?n.json():n.text():null}async function q(t,e,a){let r=await t.query({query:R,variables:{threadId:a},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(_=>_.latest_version_object).map(_=>({project_id:e,artifact_id:_.artifact_id,artifact_type:_.latest_version_object.artifact_type,version:_.latest_version_object.version,title:_.latest_version_object.title,description:_.latest_version_object.description??null,user_id:_.latest_version_object.user_id,metadata:_.latest_version_object.artifact_metadata,created_at:_.latest_version_object.created_at,size_bytes:Number.parseInt(_.latest_version_object.size)})):[]}async function G(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/metadata`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let p=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to get artifact metadata: ${p}`)}return n.json()}function S(t,e){return t.query({query:w,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.rooms??[])}function Q(t,e){if(!e.name)throw new Error("Room name is required");let a=ye(e.name);if(a)throw new Error(a);return t.mutate({mutation:E,variables:e,fetchPolicy:"no-cache"}).then(r=>{if(!r.data?.create_room?.room_id)throw new Error("expected room_id in response, got null");return r.data?.create_room?.room_id})}var de=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,D=80,ye=t=>{let e=t.trim();return e.length===0?null:e.length>D?`Room name must be ${D} characters or less`:/[^\p{Ll}\p{Lo}\p{N}_-]/u.test(e)?"Only lowercase letters, numbers, hyphens, and underscores are allowed.":/^[_-]|[_-]$/.test(e)?"Room name should not start or end with a hyphen or underscore.":/[-_]{2,}/.test(e)?"Room name should not contain consecutive hyphens or underscores.":de.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};import{defer as ce,map as le,repeat as be,takeWhile as me}from"rxjs";function L(t,e){return t.query({query:F,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2??[])}function K(t,e){if(!e)throw new Error("threadId is required");return t.query({query:j,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2_by_pk)}function J(t,e){if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:P,variables:e}).then(a=>{if(!a.data?.start_thread)throw new Error(a.error?.message||"Failed to start thread");return a.data.start_thread})}function A(t,e,a){if(!e)throw new Error("threadId is required");let r={thread_id:{_eq:e}};return a&&(a.eventId&&(r.thread_event_id=a.eventId),a.messageId&&(r._or=Me(a.messageId))),t.query({query:V,variables:{where:r,limit:a?.limit,ordering:a?.ordering||"asc"},fetchPolicy:"no-cache"}).then(_=>_.data?.thread_events??[])}function H(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:T,variables:e}).then(a=>{if(!a.data?.send_thread_message)throw new Error(a.error?.message||"Failed to send message to thread");return a.data.send_thread_message})}function $(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return t.mutate({mutation:O,variables:e}).then(a=>{if(!a.data?.cancel_agent_message)throw new Error(a.error?.message||"Failed to cancel thread");return a.data.cancel_agent_message})}function X(t,e,a){if(!e)throw new Error("threadId is required");g(a);let r={thread_id:{_eq:e}};return a&&(r.thread_event_id={_gte:a}),t.subscribe({query:N,variables:{where:r}}).pipe(le(_=>{if(_.error)throw _.error;return _.data?.thread_events??[]}))}function Z(t,e,a){if(!e)throw new Error("threadId is required");let r,_=g(a?.fromEventId),i={eventId:a?.fromEventId?{_gte:_}:void 0,messageId:a?.messageId},o=a?.pollingInterval&&a?.pollingInterval>0?a.pollingInterval:5;return ce(async()=>{let n=r?{messageId:a?.messageId,eventId:{_gt:r}}:i,p=await A(t,e,n);return p.length>0&&(r=p[p.length-1]?.thread_event_id),p}).pipe(be({count:a?.timeout&&a.timeout>0?Math.ceil(a.timeout/o):void 0,delay:o*1e3}),me(n=>Ie(n,a?.skipAnalysis),!0))}function Ie(t,e){for(let a=t.length-1;a>=0;a--){let r=t[a];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let _=r.event_data.AgentMessage.update;if("content"in _&&("interaction_finished"in _.content||e&&"interaction_update"in _.content&&"main_agent"in _.content.interaction_update&&"completed"in _.content.interaction_update.main_agent)||"InteractionFinished"in _||e&&"OrchestratorUpdate"in _&&"GeneratedResponse"in _.OrchestratorUpdate.update)return!1}return!0}function Me(t){return[{event_data:{_contains:{UserMessage:{message_id:t}}}},{event_data:{_contains:{AgentMessage:{message_id:t}}}},{event_data:{_contains:{UserCancel:{message_id:t}}}}]}var y=["guide","regular"];async function Y(t,e){let a=e.namespace||"regular";if(!y.includes(a))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(a==="guide"){let r={deleted_at:{_is_null:!0}};return e.project_id&&(r.project_id={_eq:e.project_id}),e.query&&(r.page_title={_ilike:e.query.toLowerCase()}),ae(t,{where:r,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="page_id"?"id":e.order_by]:e.ordering||"asc"}:void 0})}return te(t,{where:e.project_id?{project_id:{_eq:e.project_id},deleted_at:{_is_null:!0}}:{},limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[e.order_by||"page_id"]:e.ordering||"asc"}:void 0}).then(r=>ge(r,e))}async function ee(t,e,a,r){if(a=a||"regular",!y.includes(a))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(!e)throw new Error("project_id is required");if(!r)throw new Error("id is required");if(a==="guide"){let o=await ae(t,{where:{project_id:{_eq:e},id:{_eq:r},deleted_at:{_is_null:!0}},limit:1});return o.length?o[0]:null}let _=await te(t,{where:{project_id:{_eq:e},page_id:{_eq:r},deleted_at:{_is_null:!0}},limit:1});return _.length?_[0]:null}function te(t,e){return t.query({query:W,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki.map(r=>({page_id:r.page_id,created_at:r.created_at,last_modified_at:r.last_modified_at,...r.content}))??[])}function ae(t,e){return t.query({query:U,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_guide_page?.map(r=>({page_id:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title,details:r.details}))??[])}function ge(t,e){if(!t.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return t;let a=e.query?.toLowerCase(),r=t.filter(_=>!e.include_stub&&_.stub?!1:!!(!a||_.title.toLowerCase().includes(a)||_.definition&&_.definition.toLowerCase().includes(a)||_.aliases?.length&&_.aliases.some(i=>i.toLowerCase().includes(a))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}var s="PromptQL TypeScript SDK";import{ApolloClient as Se,ApolloLink as Ae,HttpLink as he,InMemoryCache as fe}from"@apollo/client";import{SetContextLink as xe}from"@apollo/client/link/context";import{GraphQLWsLink as Be}from"@apollo/client/link/subscriptions";import{OperationTypeNode as ve}from"graphql";import{createClient as Ce}from"graphql-ws";var re=t=>{let e=new he({uri:t.url,fetch:t.fetch,headers:t.headers}),a=async n=>{let p=await t.getAuthToken();return{headers:{"User-Agent":s,...n,Authorization:`Bearer ${p}`}}},r=Ce({url:t.url,connectionParams:()=>a(t.headers),lazy:!0}),_=new Be(r),i=new xe(({headers:n})=>a(n)),o=Ae.split(({operationType:n})=>n===ve.SUBSCRIPTION,_,i.concat(e));return{client:new Se({link:o,cache:new fe}),wsClient:r}};function dt(t,e){if(!e.length)return[];if(!t.length)return e;let a=t[t.length-1];if(!a)return e;let r=BigInt(a.thread_event_id),_=e.length-1;for(;_>=0;_--){let i=e[_];if(BigInt(i?.thread_event_id)<=r)break}return e.slice(_+1)}function yt(t){return"UserMessage"in t?t.UserMessage:null}function ct(t){return"UserCancel"in t?t.UserCancel:null}function lt(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)||!("PlanGenerationStarted"in t.AgentMessage.update.OrchestratorUpdate.update)?null:t.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function bt(t){let e=f(t);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function mt(t){return"AgentMessage"in t?"content"in t.AgentMessage.update&&"interaction_update"in t.AgentMessage.update.content&&"main_agent"in t.AgentMessage.update.content.interaction_update&&"completed"in t.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:t.AgentMessage.update.content.interaction_update.main_agent.completed.summary,modified_artifacts:[],generated_at:t.AgentMessage.update.timestamp,messageId:t.AgentMessage.message_id}:!("OrchestratorUpdate"in t.AgentMessage.update)||!("GeneratedResponse"in t.AgentMessage.update.OrchestratorUpdate.update)?null:{...t.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:t.AgentMessage.message_id}:null}function It(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("ProcessingStarted"in t.AgentMessage.update.MessageProcessingUpdate.update)?null:t.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function Mt(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function gt(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function h(t){return!("AgentMessage"in t)||!("PlanningDecisionUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.PlanningDecisionUpdate.update}function St(t){let e=h(t);return!e||!("Started"in e)?null:e.Started}function At(t){let e=h(t);return!e||!("Completed"in e)?null:e.Completed}function ht(t){let e=h(t);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function ft(t){return!("AgentMessage"in t)||!("StartingOrchestrator"in t.AgentMessage.update)?null:t.AgentMessage.update.StartingOrchestrator}function f(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.OrchestratorUpdate.update}function d(t){let e=f(t);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function xt(t){let e=d(t);return!e||!("Started"in e)?null:e.Started}function Bt(t){let e=d(t);return!e||!("Completed"in e)?null:e.Completed}function x(t){let e=d(t);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function vt(t){let e=x(t);return!e||!("Started"in e)?null:e.Started}function Ct(t){let e=x(t);return!e||!("Completed"in e)?null:e.Completed}function kt(t){let e=x(t);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function B(t){let e=d(t);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function Ot(t){let e=B(t);return!e||!("Started"in e)?null:e.Started}function Et(t){let e=B(t);return!e||!("Completed"in e)?null:e.Completed}function Tt(t){let e=B(t);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function u(t){let e=d(t);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function Pt(t){let e=u(t);return!e||!("Started"in e)?null:e.Started}function Rt(t){let e=u(t);return!e||!("Completed"in e)?null:e.Completed}function Ut(t){let e=u(t);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function wt(t){let e=u(t);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function Ft(t){let e=u(t);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function jt(t){let e=u(t);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function v(t){let e=f(t);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function Vt(t){let e=v(t);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function Wt(t){let e=v(t);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function Nt(t){let e=v(t);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function zt(t){if(!("AgentMessage"in t))return null;if("InteractionFinished"in t.AgentMessage.update){let e=t.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:t.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:t.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:t.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:{status:"unknown",messageId:t.AgentMessage.message_id}}if("content"in t.AgentMessage.update&&"interaction_finished"in t.AgentMessage.update.content){let e=t.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:t.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:t.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:t.AgentMessage.message_id}}return null}function qt(t){if(t){if("UserMessage"in t)return t.UserMessage.message_id;if("AgentMessage"in t)return t.AgentMessage.message_id;if("UserTeach"in t)return t.UserTeach.agent_message_id;if("UserCancel"in t)return t.UserCancel.message_id}}function _e(t){return`https://promptql.${t}/playground-v2-hge/v1/graphql`}var c=class{controlPlaneUrl;options;defaultTimezone;getAuthTokenFn;project;client;wsClient;constructor(e){if(this.options=e,!e.serviceAccountToken)throw new Error("serviceAccountToken must not be empty. If you haven't created any service account token yet, check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let a=e.controlPlaneHost?C(e.controlPlaneHost):"https://data.pro.hasura.io";this.controlPlaneUrl=`${a}/v1/graphql`}async getAuthToken(){if(typeof this.getAuthTokenFn=="function")return this.getAuthTokenFn();let e=await this.getProjectInfo();return this.getAuthTokenFn=k({promptqlGraphQLUrl:e.promptqlGraphQLUrl,authHost:this.options.authHost,headers:ne(this.options.serviceAccountToken),fetch:this.options.fetch}),this.getAuthTokenFn()}async getGraphQLClient(){if(this.client)return this.client;let e=await this.getProjectInfo(),{client:a,wsClient:r}=re({getAuthToken:this.getAuthToken.bind(this),url:e.promptqlGraphQLUrl,fetch:this.options.fetch,headers:this.options.headers});return this.wsClient=r,this.client=a,this.client}async getProjectInfo(){if(this.project)return this.project;let e={operationName:"GetDdnProjects",query:"query GetDdnProjects { ddn_projects(limit: 1) { id name private_ddn { fqdn path_routing_context path_routing_enabled }}}"},r=await(typeof this.options.fetch=="function"?this.options.fetch:fetch)(this.controlPlaneUrl,{method:"POST",headers:{...ne(this.options.serviceAccountToken),"User-Agent":s,"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!==200){let o=r.body?await r.text():r.statusText;throw new Error(`[${r.status}] failed to get project info: ${o}`)}let _=await r.json();if(!_.data?.ddn_projects?.length)throw new Error("Project not found");let i=_.data.ddn_projects[0];return this.project={projectId:i.id,projectName:i.name,projectHost:`https://${i.name}.${i.private_ddn.fqdn}`,promptqlConsoleUrl:`https://prompt.ql.app/project/${i.name}`,promptqlGraphQLUrl:_e(i.private_ddn.fqdn)},this.project}close(){if(this.wsClient&&(this.wsClient.dispose(),this.wsClient=void 0),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.client=void 0,this.project=void 0,this.getAuthTokenFn=void 0}}};function ne(t){return{Authorization:`pat ${t}`}}var l=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return q(r,a.projectId,e)}async download(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return z(r.projectHost,e,a,ie(_),this.api.options.fetch)}async getMetadata(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return G(r.projectHost,e,a,ie(_),this.api.options.fetch)}};function ie(t){return{Authorization:`Bearer ${t}`,"User-Agent":s}}var b=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var m=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return S(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){let a=await this.api.getGraphQLClient();return S(a,{where:{name:{_eq:e}},limit:1}).then(r=>r.length?r[0]??null:null)}async create(e){let a=await this.api.getGraphQLClient();return Q(a,e)}};import{from as oe,switchMap as pe}from"rxjs";var I=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return L(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");let a=await this.api.getGraphQLClient();return K(a,e)}async start(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return J(r,{...e,projectId:a.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async getEvents(e,a){let r=await this.api.getGraphQLClient();return A(r,e,a)}async sendMessage(e){let a=await this.api.getGraphQLClient();return H(a,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){let a=await this.api.getGraphQLClient();return $(a,e)}subscribeEvents(e,a){return oe(this.api.getGraphQLClient()).pipe(pe(r=>X(r,e,a)))}streamMessageEvents(e,a){return oe(this.api.getGraphQLClient()).pipe(pe(r=>Z(r,e,a)))}};var M=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return Y(a,e)}async get(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getGraphQLClient();return ee(_,r.projectId,e,a)}};var se=class{constructor(e){let a=new c(e);this.api=a,this.thread=new I(a),this.project=new b(a),this.room=new m(a),this.artifact=new l(a),this.wiki=new M(a)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};export{se as PromptQLSdk,de as ROOM_NAME_REGEX,s as USER_AGENT,_e as buildPromptQLUrl,$ as cancelAgentMessage,re as createApolloClient,Q as createRoom,dt as diffThreadEvents,z as downloadArtifactData,mt as getAgentGeneratedResponse,Mt as getAgentInteractionDecisionAcceptInteractionEvent,gt as getAgentInteractionDecisionDeclineInteractionEvent,zt as getAgentInteractionFinishedEvent,It as getAgentMessageProcessingStartedEvent,Bt as getAgentOrchestratorContextExplorerCompletedEvent,xt as getAgentOrchestratorContextExplorerStartedEvent,d as getAgentOrchestratorContextExplorerUpdateEvent,Ut as getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,wt as getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,Rt as getAgentOrchestratorSchemaExplorerCompletedEvent,Ft as getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,jt as getAgentOrchestratorSchemaExplorerSchemaExploredEvent,Pt as getAgentOrchestratorSchemaExplorerStartedEvent,u as getAgentOrchestratorSchemaExplorerUpdateEvent,Tt as getAgentOrchestratorSchemaTasksGeneratedEvent,Et as getAgentOrchestratorSchemaTasksGenerationCompletedEvent,Ot as getAgentOrchestratorSchemaTasksGenerationStartedEvent,B as getAgentOrchestratorSchemaTasksGenerationUpdateEvent,Vt as getAgentOrchestratorStepProgrammerEvent,Nt as getAgentOrchestratorStepSavedProgramRunnerEvent,Wt as getAgentOrchestratorStepUiProgrammerEvent,v as getAgentOrchestratorStepUpdateEvent,f as getAgentOrchestratorUpdateEvent,Ct as getAgentOrchestratorWikiExplorerCompletedEvent,vt as getAgentOrchestratorWikiExplorerStartedEvent,x as getAgentOrchestratorWikiExplorerUpdateEvent,kt as getAgentOrchestratorWikiInfoGeneratedEvent,lt as getAgentPlanGenerationStartedEvent,bt as getAgentPlanStepGeneratedEvent,At as getAgentPlanningDecisionCompletedEvent,ht as getAgentPlanningDecisionPlanningRequiredEvent,St as getAgentPlanningDecisionStartedEvent,h as getAgentPlanningDecisionUpdateEvent,ft as getAgentStartingOrchestratorEvent,G as getArtifactMetadata,K as getThread,qt as getThreadEventMessageId,A as getThreadEvents,ct as getUserCancelEvent,yt as getUserMessageEvent,ee as getWikiPage,Ie as isInteractionAnalyzing,q as listArtifactMetadataByThreadId,S as listRooms,L as listThreads,Y as listWikiPages,H as sendThreadMessage,J as startThread,Z as streamThreadMessageEvents,X as subscribeThreadEvents,ye as validateRoomName};
1
+ import{a as C,b as g,f as k}from"./chunk-YCHA4U67.mjs";var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CancelAgentMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cancel_agent_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"agentMessageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},E={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateRoom"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"description"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_room"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"description"},value:{kind:"Variable",name:{kind:"Name",value:"description"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}}]}}]}}]},T={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SendThreadMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_thread_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StartThread"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roomId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"start_thread"},arguments:[{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"projectId"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"buildId"},value:{kind:"Variable",name:{kind:"Name",value:"buildId"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"roomId"},value:{kind:"Variable",name:{kind:"Name",value:"roomId"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"createdFrom"},value:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"thread_events"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"thread_event_id"}}]}}]}}]}}]},R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetArtifactsByThreadId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifacts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_artifacts"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}}]}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"updated_at"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifact_id"}},{kind:"Field",name:{kind:"Name",value:"latest_version_object"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"artifact_metadata"}},{kind:"Field",name:{kind:"Name",value:"artifact_type"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"version"}}]}}]}}]}}]},U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListGuidePages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},w={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetGuidePage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"project_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"page_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"project_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"project_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"page_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"deleted_at"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_is_null"},value:{kind:"BooleanValue",value:!0}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"details"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},F={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetRooms"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"10"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"rooms"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Room"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Room"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"rooms"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"project_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]},j={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreads"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_order_by"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},W={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]},N={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}},{kind:"Field",alias:{kind:"Name",value:"title"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"title",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"stub"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"stub",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"aliases"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"aliases",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"definition"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"definition",block:!1}}]}]}}]}}]},z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"project_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"page_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"project_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"project_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"page_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"page_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"deleted_at"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_is_null"},value:{kind:"BooleanValue",value:!0}}]}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]};async function G(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/data`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let ue=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to download artifact: ${ue}`)}return n.body?n.headers.get("Content-Type")?.startsWith("application/json")?n.json():n.text():null}async function D(t,e,a){let r=await t.query({query:R,variables:{threadId:a},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(_=>_.latest_version_object).map(_=>({project_id:e,artifact_id:_.artifact_id,artifact_type:_.latest_version_object.artifact_type,version:_.latest_version_object.version,title:_.latest_version_object.title,description:_.latest_version_object.description??null,user_id:_.latest_version_object.user_id,metadata:_.latest_version_object.artifact_metadata,created_at:_.latest_version_object.created_at,size_bytes:Number.parseInt(_.latest_version_object.size)})):[]}async function Q(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/metadata`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let p=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to get artifact metadata: ${p}`)}return n.json()}function S(t,e){return t.query({query:F,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.rooms??[])}function K(t,e){if(!e.name)throw new Error("Room name is required");let a=ye(e.name);if(a)throw new Error(a);return t.mutate({mutation:E,variables:e,fetchPolicy:"no-cache"}).then(r=>{if(!r.data?.create_room?.room_id)throw new Error("expected room_id in response, got null");return r.data?.create_room?.room_id})}var de=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,L=80,ye=t=>{let e=t.trim();return e.length===0?null:e.length>L?`Room name must be ${L} characters or less`:/[^\p{Ll}\p{Lo}\p{N}_-]/u.test(e)?"Only lowercase letters, numbers, hyphens, and underscores are allowed.":/^[_-]|[_-]$/.test(e)?"Room name should not start or end with a hyphen or underscore.":/[-_]{2,}/.test(e)?"Room name should not contain consecutive hyphens or underscores.":de.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};import{defer as ce,map as le,repeat as be,takeWhile as me}from"rxjs";function J(t,e){return t.query({query:j,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2??[])}function H(t,e){if(!e)throw new Error("threadId is required");return t.query({query:V,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2_by_pk)}function $(t,e){if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:P,variables:e}).then(a=>{if(!a.data?.start_thread)throw new Error(a.error?.message||"Failed to start thread");return a.data.start_thread})}function A(t,e,a){if(!e)throw new Error("threadId is required");let r={thread_id:{_eq:e}};return a&&(a.eventId&&(r.thread_event_id=a.eventId),a.messageId&&(r._or=Me(a.messageId))),t.query({query:W,variables:{where:r,limit:a?.limit,ordering:a?.ordering||"asc"},fetchPolicy:"no-cache"}).then(_=>_.data?.thread_events??[])}function X(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:T,variables:e}).then(a=>{if(!a.data?.send_thread_message)throw new Error(a.error?.message||"Failed to send message to thread");return a.data.send_thread_message})}function Z(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return t.mutate({mutation:O,variables:e}).then(a=>{if(!a.data?.cancel_agent_message)throw new Error(a.error?.message||"Failed to cancel thread");return a.data.cancel_agent_message})}function Y(t,e,a){if(!e)throw new Error("threadId is required");g(a);let r={thread_id:{_eq:e}};return a&&(r.thread_event_id={_gte:a}),t.subscribe({query:q,variables:{where:r}}).pipe(le(_=>{if(_.error)throw _.error;return _.data?.thread_events??[]}))}function ee(t,e,a){if(!e)throw new Error("threadId is required");let r,_=g(a?.fromEventId),i={eventId:a?.fromEventId?{_gte:_}:void 0,messageId:a?.messageId},o=a?.pollingInterval&&a?.pollingInterval>0?a.pollingInterval:5;return ce(async()=>{let n=r?{messageId:a?.messageId,eventId:{_gt:r}}:i,p=await A(t,e,n);return p.length>0&&(r=p[p.length-1]?.thread_event_id),p}).pipe(be({count:a?.timeout&&a.timeout>0?Math.ceil(a.timeout/o):void 0,delay:o*1e3}),me(n=>Ie(n,a?.skipAnalysis),!0))}function Ie(t,e){for(let a=t.length-1;a>=0;a--){let r=t[a];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let _=r.event_data.AgentMessage.update;if("content"in _&&("interaction_finished"in _.content||e&&"interaction_update"in _.content&&"main_agent"in _.content.interaction_update&&"completed"in _.content.interaction_update.main_agent)||"InteractionFinished"in _||e&&"OrchestratorUpdate"in _&&"GeneratedResponse"in _.OrchestratorUpdate.update)return!1}return!0}function Me(t){return[{event_data:{_contains:{UserMessage:{message_id:t}}}},{event_data:{_contains:{AgentMessage:{message_id:t}}}},{event_data:{_contains:{UserCancel:{message_id:t}}}}]}var y=["guide","regular"];async function te(t,e){let a=e.namespace||"regular";if(!y.includes(a))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(a==="guide"){let o={deleted_at:{_is_null:!0}};return e.project_id&&(o.project_id={_eq:e.project_id}),e.query&&(o.page_title={_ilike:e.query.toLowerCase()}),Se(t,{where:o,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="page_id"?"id":e.order_by]:e.ordering||"asc"}:void 0})}let r=e.project_id||!e.include_stub||e.namespace||e.project_id||e.query,_={where:e.project_id?{project_id:{_eq:e.project_id},deleted_at:{_is_null:!0}}:{},order_by:e.order_by||e.ordering?{[e.order_by||"page_id"]:e.ordering||"asc"}:void 0};r||(_.offset=e.offset,_.limit=e.limit);let i=await ge(t,_);return r?fe(i,e):i}async function ae(t,e,a,r){if(a=a||"regular",!y.includes(a))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(!e)throw new Error("project_id is required");if(!r)throw new Error("id is required");return a==="guide"?he(t,{project_id:e,page_id:r}):Ae(t,{project_id:e,page_id:r})}function ge(t,e){return t.query({query:N,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki??[])}function Se(t,e){return t.query({query:U,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_guide_page?.map(r=>({page_id:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function Ae(t,e){let a=await t.query({query:z,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(_=>({page_id:_.page_id,created_at:_.created_at,last_modified_at:_.last_modified_at,..._.content}))??[]);return a.length?a[0]:null}async function he(t,e){let a=await t.query({query:w,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(_=>({page_id:_.id,created_at:_.created_at,last_modified_at:_.last_modified_at,title:_.page_title,details:_.details}))??[]);return a.length?a[0]:null}function fe(t,e){if(!t.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return t;let a=e.query?.toLowerCase(),r=t.filter(_=>!e.include_stub&&_.stub?!1:!!(!a||_.title.toLowerCase().includes(a)||_.definition&&_.definition.toLowerCase().includes(a)||_.aliases?.length&&_.aliases.some(i=>i.toLowerCase().includes(a))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}var s="PromptQL TypeScript SDK";import{ApolloClient as xe,ApolloLink as Be,HttpLink as ve,InMemoryCache as Ce}from"@apollo/client";import{SetContextLink as ke}from"@apollo/client/link/context";import{GraphQLWsLink as Oe}from"@apollo/client/link/subscriptions";import{OperationTypeNode as Ee}from"graphql";import{createClient as Te}from"graphql-ws";var re=t=>{let e=new ve({uri:t.url,fetch:t.fetch,headers:t.headers}),a=async n=>{let p=await t.getAuthToken();return{headers:{"User-Agent":s,...n,Authorization:`Bearer ${p}`}}},r=Te({url:t.url,connectionParams:()=>a(t.headers),lazy:!0}),_=new Oe(r),i=new ke(({headers:n})=>a(n)),o=Be.split(({operationType:n})=>n===Ee.SUBSCRIPTION,_,i.concat(e));return{client:new xe({link:o,cache:new Ce}),wsClient:r}};function It(t,e){if(!e.length)return[];if(!t.length)return e;let a=t[t.length-1];if(!a)return e;let r=BigInt(a.thread_event_id),_=e.length-1;for(;_>=0;_--){let i=e[_];if(BigInt(i?.thread_event_id)<=r)break}return e.slice(_+1)}function Mt(t){return"UserMessage"in t?t.UserMessage:null}function gt(t){return"UserCancel"in t?t.UserCancel:null}function St(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)||!("PlanGenerationStarted"in t.AgentMessage.update.OrchestratorUpdate.update)?null:t.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function At(t){let e=f(t);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function ht(t){return"AgentMessage"in t?"content"in t.AgentMessage.update&&"interaction_update"in t.AgentMessage.update.content&&"main_agent"in t.AgentMessage.update.content.interaction_update&&"completed"in t.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:t.AgentMessage.update.content.interaction_update.main_agent.completed.summary,modified_artifacts:[],generated_at:t.AgentMessage.update.timestamp,messageId:t.AgentMessage.message_id}:!("OrchestratorUpdate"in t.AgentMessage.update)||!("GeneratedResponse"in t.AgentMessage.update.OrchestratorUpdate.update)?null:{...t.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:t.AgentMessage.message_id}:null}function ft(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("ProcessingStarted"in t.AgentMessage.update.MessageProcessingUpdate.update)?null:t.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function xt(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function Bt(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function h(t){return!("AgentMessage"in t)||!("PlanningDecisionUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.PlanningDecisionUpdate.update}function vt(t){let e=h(t);return!e||!("Started"in e)?null:e.Started}function Ct(t){let e=h(t);return!e||!("Completed"in e)?null:e.Completed}function kt(t){let e=h(t);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function Ot(t){return!("AgentMessage"in t)||!("StartingOrchestrator"in t.AgentMessage.update)?null:t.AgentMessage.update.StartingOrchestrator}function f(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.OrchestratorUpdate.update}function d(t){let e=f(t);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function Et(t){let e=d(t);return!e||!("Started"in e)?null:e.Started}function Tt(t){let e=d(t);return!e||!("Completed"in e)?null:e.Completed}function x(t){let e=d(t);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function Pt(t){let e=x(t);return!e||!("Started"in e)?null:e.Started}function Rt(t){let e=x(t);return!e||!("Completed"in e)?null:e.Completed}function Ut(t){let e=x(t);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function B(t){let e=d(t);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function wt(t){let e=B(t);return!e||!("Started"in e)?null:e.Started}function Ft(t){let e=B(t);return!e||!("Completed"in e)?null:e.Completed}function jt(t){let e=B(t);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function u(t){let e=d(t);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function Vt(t){let e=u(t);return!e||!("Started"in e)?null:e.Started}function Wt(t){let e=u(t);return!e||!("Completed"in e)?null:e.Completed}function Nt(t){let e=u(t);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function zt(t){let e=u(t);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function qt(t){let e=u(t);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function Gt(t){let e=u(t);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function v(t){let e=f(t);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function Dt(t){let e=v(t);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function Qt(t){let e=v(t);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function Lt(t){let e=v(t);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function Kt(t){if(!("AgentMessage"in t))return null;if("InteractionFinished"in t.AgentMessage.update){let e=t.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:t.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:t.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:t.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:{status:"unknown",messageId:t.AgentMessage.message_id}}if("content"in t.AgentMessage.update&&"interaction_finished"in t.AgentMessage.update.content){let e=t.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:t.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:t.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:t.AgentMessage.message_id}}return null}function Jt(t){if(t){if("UserMessage"in t)return t.UserMessage.message_id;if("AgentMessage"in t)return t.AgentMessage.message_id;if("UserTeach"in t)return t.UserTeach.agent_message_id;if("UserCancel"in t)return t.UserCancel.message_id}}function _e(t){return`https://promptql.${t}/playground-v2-hge/v1/graphql`}var c=class{controlPlaneUrl;options;defaultTimezone;getAuthTokenFn;project;client;wsClient;constructor(e){if(this.options=e,!e.serviceAccountToken)throw new Error("serviceAccountToken must not be empty. If you haven't created any service account token yet, check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let a=e.controlPlaneHost?C(e.controlPlaneHost):"https://data.pro.hasura.io";this.controlPlaneUrl=`${a}/v1/graphql`}async getAuthToken(){if(typeof this.getAuthTokenFn=="function")return this.getAuthTokenFn();let e=await this.getProjectInfo();return this.getAuthTokenFn=k({promptqlGraphQLUrl:e.promptqlGraphQLUrl,authHost:this.options.authHost,headers:ne(this.options.serviceAccountToken),fetch:this.options.fetch}),this.getAuthTokenFn()}async getGraphQLClient(){if(this.client)return this.client;let e=await this.getProjectInfo(),{client:a,wsClient:r}=re({getAuthToken:this.getAuthToken.bind(this),url:e.promptqlGraphQLUrl,fetch:this.options.fetch,headers:this.options.headers});return this.wsClient=r,this.client=a,this.client}async getProjectInfo(){if(this.project)return this.project;let e={operationName:"GetDdnProjects",query:"query GetDdnProjects { ddn_projects(limit: 1) { id name private_ddn { fqdn path_routing_context path_routing_enabled }}}"},r=await(typeof this.options.fetch=="function"?this.options.fetch:fetch)(this.controlPlaneUrl,{method:"POST",headers:{...ne(this.options.serviceAccountToken),"User-Agent":s,"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!==200){let o=r.body?await r.text():r.statusText;throw new Error(`[${r.status}] failed to get project info: ${o}`)}let _=await r.json();if(!_.data?.ddn_projects?.length)throw new Error("Project not found");let i=_.data.ddn_projects[0];return this.project={projectId:i.id,projectName:i.name,projectHost:`https://${i.name}.${i.private_ddn.fqdn}`,promptqlConsoleUrl:`https://prompt.ql.app/project/${i.name}`,promptqlGraphQLUrl:_e(i.private_ddn.fqdn)},this.project}close(){if(this.wsClient&&(this.wsClient.dispose(),this.wsClient=void 0),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.client=void 0,this.project=void 0,this.getAuthTokenFn=void 0}}};function ne(t){return{Authorization:`pat ${t}`}}var l=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return D(r,a.projectId,e)}async download(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return G(r.projectHost,e,a,ie(_),this.api.options.fetch)}async getMetadata(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return Q(r.projectHost,e,a,ie(_),this.api.options.fetch)}};function ie(t){return{Authorization:`Bearer ${t}`,"User-Agent":s}}var b=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var m=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return S(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){let a=await this.api.getGraphQLClient();return S(a,{where:{name:{_eq:e}},limit:1}).then(r=>r.length?r[0]??null:null)}async create(e){let a=await this.api.getGraphQLClient();return K(a,e)}};import{from as oe,switchMap as pe}from"rxjs";var I=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return J(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");let a=await this.api.getGraphQLClient();return H(a,e)}async start(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return $(r,{...e,projectId:a.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async getEvents(e,a){let r=await this.api.getGraphQLClient();return A(r,e,a)}async sendMessage(e){let a=await this.api.getGraphQLClient();return X(a,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){let a=await this.api.getGraphQLClient();return Z(a,e)}subscribeEvents(e,a){return oe(this.api.getGraphQLClient()).pipe(pe(r=>Y(r,e,a)))}streamMessageEvents(e,a){return oe(this.api.getGraphQLClient()).pipe(pe(r=>ee(r,e,a)))}};var M=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return te(a,e)}async get(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getGraphQLClient();return ae(_,r.projectId,e,a)}};var se=class{constructor(e){let a=new c(e);this.api=a,this.thread=new I(a),this.project=new b(a),this.room=new m(a),this.artifact=new l(a),this.wiki=new M(a)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};export{se as PromptQLSdk,de as ROOM_NAME_REGEX,s as USER_AGENT,_e as buildPromptQLUrl,Z as cancelAgentMessage,re as createApolloClient,K as createRoom,It as diffThreadEvents,G as downloadArtifactData,ht as getAgentGeneratedResponse,xt as getAgentInteractionDecisionAcceptInteractionEvent,Bt as getAgentInteractionDecisionDeclineInteractionEvent,Kt as getAgentInteractionFinishedEvent,ft as getAgentMessageProcessingStartedEvent,Tt as getAgentOrchestratorContextExplorerCompletedEvent,Et as getAgentOrchestratorContextExplorerStartedEvent,d as getAgentOrchestratorContextExplorerUpdateEvent,Nt as getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,zt as getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,Wt as getAgentOrchestratorSchemaExplorerCompletedEvent,qt as getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,Gt as getAgentOrchestratorSchemaExplorerSchemaExploredEvent,Vt as getAgentOrchestratorSchemaExplorerStartedEvent,u as getAgentOrchestratorSchemaExplorerUpdateEvent,jt as getAgentOrchestratorSchemaTasksGeneratedEvent,Ft as getAgentOrchestratorSchemaTasksGenerationCompletedEvent,wt as getAgentOrchestratorSchemaTasksGenerationStartedEvent,B as getAgentOrchestratorSchemaTasksGenerationUpdateEvent,Dt as getAgentOrchestratorStepProgrammerEvent,Lt as getAgentOrchestratorStepSavedProgramRunnerEvent,Qt as getAgentOrchestratorStepUiProgrammerEvent,v as getAgentOrchestratorStepUpdateEvent,f as getAgentOrchestratorUpdateEvent,Rt as getAgentOrchestratorWikiExplorerCompletedEvent,Pt as getAgentOrchestratorWikiExplorerStartedEvent,x as getAgentOrchestratorWikiExplorerUpdateEvent,Ut as getAgentOrchestratorWikiInfoGeneratedEvent,St as getAgentPlanGenerationStartedEvent,At as getAgentPlanStepGeneratedEvent,Ct as getAgentPlanningDecisionCompletedEvent,kt as getAgentPlanningDecisionPlanningRequiredEvent,vt as getAgentPlanningDecisionStartedEvent,h as getAgentPlanningDecisionUpdateEvent,Ot as getAgentStartingOrchestratorEvent,Q as getArtifactMetadata,H as getThread,Jt as getThreadEventMessageId,A as getThreadEvents,gt as getUserCancelEvent,Mt as getUserMessageEvent,ae as getWikiPage,Ie as isInteractionAnalyzing,D as listArtifactMetadataByThreadId,S as listRooms,J as listThreads,te as listWikiPages,X as sendThreadMessage,$ as startThread,ee as streamThreadMessageEvents,Y as subscribeThreadEvents,ye as validateRoomName};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hasura/promptql",
3
3
  "description": "A Typescript SDK allows you to interact with PromptQL API",
4
- "version": "2.0.0-alpha.32",
4
+ "version": "2.0.0-alpha.33",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Hasura",
7
7
  "homepage": "https://promptql.hasura.io",