@hasura/promptql 2.0.0-alpha.39 → 2.0.0-alpha.40

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
@@ -5959,6 +5959,13 @@ type StartThreadMutation = {
5959
5959
  } | null>;
5960
5960
  } | null;
5961
5961
  };
5962
+ type GetProjectInfoQuery = {
5963
+ get_project_info: {
5964
+ projectId: string;
5965
+ projectName: string;
5966
+ promptqlConsoleUrl: string;
5967
+ } | null;
5968
+ };
5962
5969
  type GetRoomsQueryVariables = Exact<{
5963
5970
  where: Rooms_Bool_Exp;
5964
5971
  order_by?: Array<Rooms_Order_By> | Rooms_Order_By | null | undefined;
@@ -6227,6 +6234,15 @@ declare function listArtifactMetadataByThreadId(client: ApolloClient, projectId:
6227
6234
  */
6228
6235
  declare function getArtifactMetadata(host: string, artifactId: string, version: number, headers: Record<string, string>, customFetch?: typeof fetch): Promise<ArtifactMetadata>;
6229
6236
 
6237
+ /**
6238
+ * Information of a PromptQL project.
6239
+ */
6240
+ type ProjectInfo = NonNullable<GetProjectInfoQuery["get_project_info"]>;
6241
+ /**
6242
+ * Get information of the current project.
6243
+ */
6244
+ declare function getProjectInfo(client: ApolloClient): Promise<ProjectInfo | null | undefined>;
6245
+
6230
6246
  /**
6231
6247
  * List rooms of the current project.The default limit is 10.
6232
6248
  */
@@ -6736,4 +6752,4 @@ declare function getAgentInteractionFinishedEvent(eventData: ThreadEvent$1): Int
6736
6752
  declare function getThreadEventMessageId(event: ThreadEvent$1 | undefined): string | undefined;
6737
6753
  declare function buildAuthHeader(accessToken: string): Record<string, string>;
6738
6754
 
6739
- export { type AgentGeneratedResponse, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionLegacy, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopActionUpdateUnversioned, type AgentLoopActionUpdateVersioned, 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 ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, type 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 CreateWikiPageArgs, type DataArtifactUpdated, type DataArtifactUpdatedV1, type DecideNextStepsFields, type EventOfKind, type ExecuteProgramRequestData, type ExecuteProgramRequestProvenance, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeSummary, type FactSource, type FederatedWikiName, type GeneratedCode, type GeneratedFile, type GeneratedResponse, type GeneratedUiCode, type GetThreadEventOptions, type 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, type 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 ProgramExecutionTriggerInterruption, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunSqlExecuteOutcome, type ProgramRunnerAction, type ProgrammerUpdate, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlUserId, type PythonRunStepDetails, ROOM_NAME_REGEX, type ResponseGenerationUpdate, type ResponseTruncation, type RoomFragment, type RoomVisibilityType, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunSavedProgramRequest, type RunStarted, type RunStartedV1, type RunStepDetails, type RuntimeArtifactType, 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 SearchWikiPageItem, type SearchWikiPagesResult, type SendMessageToThreadArguments, type SendMessageToThreadOutput, type SendThreadMessageMutationVariables, type ServerMetadata, type ShelfActionEvent, type ShelfSchemaName, type ShelfTransactionOpened, type ShelfTransactionOpenedV1, type ShelfTransactionSuspended, type ShelfTransactionSuspendedV1, 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 SqlExecuteStarted, type SqlExecuteStartedV1, type SqlQueryId, type SqlRunStepDetails, type StartThreadArguments, type 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 ThreadDetail, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, type ThreadFragment, type ThreadId, type TransactionId, type TzWrapper, USER_AGENT, type UiBuildFailure, type UiBuildRunStepDetails, type UiMetadata, type UiProgrammerUpdate, type UpdateWikiContentArgs, type UserCancel, type UserCancelEvent, type UserEventProvenance, 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, buildAuthHeader, cancelAgentMessage, createApolloClient, createRoom, createWikiPage, deleteWikiPage, 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, getThreadAndEvents, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, searchWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, updateWikiPage, validateRoomName };
6755
+ export { type AgentGeneratedResponse, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionLegacy, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopActionUpdateUnversioned, type AgentLoopActionUpdateVersioned, 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 ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, type 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 CreateWikiPageArgs, type DataArtifactUpdated, type DataArtifactUpdatedV1, type DecideNextStepsFields, type EventOfKind, type ExecuteProgramRequestData, type ExecuteProgramRequestProvenance, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeSummary, type FactSource, type FederatedWikiName, type GeneratedCode, type GeneratedFile, type GeneratedResponse, type GeneratedUiCode, type GetThreadEventOptions, type 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, type 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 ProgramExecutionTriggerInterruption, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunSqlExecuteOutcome, type ProgramRunnerAction, type ProgrammerUpdate, type ProjectInfo, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlUserId, type PythonRunStepDetails, ROOM_NAME_REGEX, type ResponseGenerationUpdate, type ResponseTruncation, type RoomFragment, type RoomVisibilityType, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunSavedProgramRequest, type RunStarted, type RunStartedV1, type RunStepDetails, type RuntimeArtifactType, 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 SearchWikiPageItem, type SearchWikiPagesResult, type SendMessageToThreadArguments, type SendMessageToThreadOutput, type SendThreadMessageMutationVariables, type ServerMetadata, type ShelfActionEvent, type ShelfSchemaName, type ShelfTransactionOpened, type ShelfTransactionOpenedV1, type ShelfTransactionSuspended, type ShelfTransactionSuspendedV1, 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 SqlExecuteStarted, type SqlExecuteStartedV1, type SqlQueryId, type SqlRunStepDetails, type StartThreadArguments, type 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 ThreadDetail, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, type ThreadFragment, type ThreadId, type TransactionId, type TzWrapper, USER_AGENT, type UiBuildFailure, type UiBuildRunStepDetails, type UiMetadata, type UiProgrammerUpdate, type UpdateWikiContentArgs, type UserCancel, type UserCancelEvent, type UserEventProvenance, 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, buildAuthHeader, cancelAgentMessage, createApolloClient, createRoom, createWikiPage, deleteWikiPage, 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, getProjectInfo, getThread, getThreadAndEvents, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, searchWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, updateWikiPage, validateRoomName };
package/dist/index.d.ts CHANGED
@@ -5959,6 +5959,13 @@ type StartThreadMutation = {
5959
5959
  } | null>;
5960
5960
  } | null;
5961
5961
  };
5962
+ type GetProjectInfoQuery = {
5963
+ get_project_info: {
5964
+ projectId: string;
5965
+ projectName: string;
5966
+ promptqlConsoleUrl: string;
5967
+ } | null;
5968
+ };
5962
5969
  type GetRoomsQueryVariables = Exact<{
5963
5970
  where: Rooms_Bool_Exp;
5964
5971
  order_by?: Array<Rooms_Order_By> | Rooms_Order_By | null | undefined;
@@ -6227,6 +6234,15 @@ declare function listArtifactMetadataByThreadId(client: ApolloClient, projectId:
6227
6234
  */
6228
6235
  declare function getArtifactMetadata(host: string, artifactId: string, version: number, headers: Record<string, string>, customFetch?: typeof fetch): Promise<ArtifactMetadata>;
6229
6236
 
6237
+ /**
6238
+ * Information of a PromptQL project.
6239
+ */
6240
+ type ProjectInfo = NonNullable<GetProjectInfoQuery["get_project_info"]>;
6241
+ /**
6242
+ * Get information of the current project.
6243
+ */
6244
+ declare function getProjectInfo(client: ApolloClient): Promise<ProjectInfo | null | undefined>;
6245
+
6230
6246
  /**
6231
6247
  * List rooms of the current project.The default limit is 10.
6232
6248
  */
@@ -6736,4 +6752,4 @@ declare function getAgentInteractionFinishedEvent(eventData: ThreadEvent$1): Int
6736
6752
  declare function getThreadEventMessageId(event: ThreadEvent$1 | undefined): string | undefined;
6737
6753
  declare function buildAuthHeader(accessToken: string): Record<string, string>;
6738
6754
 
6739
- export { type AgentGeneratedResponse, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionLegacy, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopActionUpdateUnversioned, type AgentLoopActionUpdateVersioned, 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 ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, type 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 CreateWikiPageArgs, type DataArtifactUpdated, type DataArtifactUpdatedV1, type DecideNextStepsFields, type EventOfKind, type ExecuteProgramRequestData, type ExecuteProgramRequestProvenance, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeSummary, type FactSource, type FederatedWikiName, type GeneratedCode, type GeneratedFile, type GeneratedResponse, type GeneratedUiCode, type GetThreadEventOptions, type 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, type 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 ProgramExecutionTriggerInterruption, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunSqlExecuteOutcome, type ProgramRunnerAction, type ProgrammerUpdate, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlUserId, type PythonRunStepDetails, ROOM_NAME_REGEX, type ResponseGenerationUpdate, type ResponseTruncation, type RoomFragment, type RoomVisibilityType, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunSavedProgramRequest, type RunStarted, type RunStartedV1, type RunStepDetails, type RuntimeArtifactType, 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 SearchWikiPageItem, type SearchWikiPagesResult, type SendMessageToThreadArguments, type SendMessageToThreadOutput, type SendThreadMessageMutationVariables, type ServerMetadata, type ShelfActionEvent, type ShelfSchemaName, type ShelfTransactionOpened, type ShelfTransactionOpenedV1, type ShelfTransactionSuspended, type ShelfTransactionSuspendedV1, 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 SqlExecuteStarted, type SqlExecuteStartedV1, type SqlQueryId, type SqlRunStepDetails, type StartThreadArguments, type 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 ThreadDetail, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, type ThreadFragment, type ThreadId, type TransactionId, type TzWrapper, USER_AGENT, type UiBuildFailure, type UiBuildRunStepDetails, type UiMetadata, type UiProgrammerUpdate, type UpdateWikiContentArgs, type UserCancel, type UserCancelEvent, type UserEventProvenance, 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, buildAuthHeader, cancelAgentMessage, createApolloClient, createRoom, createWikiPage, deleteWikiPage, 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, getThreadAndEvents, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, searchWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, updateWikiPage, validateRoomName };
6755
+ export { type AgentGeneratedResponse, type AgentLearningUpdate, type AgentLoopAction, type AgentLoopActionLegacy, type AgentLoopActionResult, type AgentLoopActionUpdate, type AgentLoopActionUpdateUnversioned, type AgentLoopActionUpdateVersioned, 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 ArtifactUpdate, type ArtifactUpdate1, type AssumptionFactCheck, type BuildError, type BuildErrorV1, type BuiltUi, type BuiltUi1, type 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 CreateWikiPageArgs, type DataArtifactUpdated, type DataArtifactUpdatedV1, type DecideNextStepsFields, type EventOfKind, type ExecuteProgramRequestData, type ExecuteProgramRequestProvenance, type ExternalKnowledgeExplorerAttempt, type ExternalKnowledgeExplorerAttempt1, type ExternalKnowledgeSummary, type FactSource, type FederatedWikiName, type GeneratedCode, type GeneratedFile, type GeneratedResponse, type GeneratedUiCode, type GetThreadEventOptions, type 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, type 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 ProgramExecutionTriggerInterruption, type ProgramId, type ProgramPackageName, type ProgramRunEvent, type ProgramRunSqlExecuteOutcome, type ProgramRunnerAction, type ProgrammerUpdate, type ProjectInfo, type ProjectInfoOutput, PromptQLSdk, type PromptQLSdkOptions, type PromptQlUserId, type PythonRunStepDetails, ROOM_NAME_REGEX, type ResponseGenerationUpdate, type ResponseTruncation, type RoomFragment, type RoomVisibilityType, type RunFinished, type RunFinishedOutcome, type RunFinishedV1, type RunProgramRequest, type RunSavedProgramRequest, type RunStarted, type RunStartedV1, type RunStepDetails, type RuntimeArtifactType, 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 SearchWikiPageItem, type SearchWikiPagesResult, type SendMessageToThreadArguments, type SendMessageToThreadOutput, type SendThreadMessageMutationVariables, type ServerMetadata, type ShelfActionEvent, type ShelfSchemaName, type ShelfTransactionOpened, type ShelfTransactionOpenedV1, type ShelfTransactionSuspended, type ShelfTransactionSuspendedV1, 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 SqlExecuteStarted, type SqlExecuteStartedV1, type SqlQueryId, type SqlRunStepDetails, type StartThreadArguments, type 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 ThreadDetail, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, type ThreadFragment, type ThreadId, type TransactionId, type TzWrapper, USER_AGENT, type UiBuildFailure, type UiBuildRunStepDetails, type UiMetadata, type UiProgrammerUpdate, type UpdateWikiContentArgs, type UserCancel, type UserCancelEvent, type UserEventProvenance, 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, buildAuthHeader, cancelAgentMessage, createApolloClient, createRoom, createWikiPage, deleteWikiPage, 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, getProjectInfo, getThread, getThreadAndEvents, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, searchWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, updateWikiPage, validateRoomName };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var S=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ce=Object.prototype.hasOwnProperty;var Ue=(n,e)=>{for(var i in e)S(n,i,{get:e[i],enumerable:!0})},Ve=(n,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of Ne(e))!Ce.call(n,d)&&d!==i&&S(n,d,{get:()=>e[d],enumerable:!(r=Pe(e,d))||r.enumerable});return n};var Me=n=>Ve(S({},"__esModule",{value:!0}),n);var xn={};Ue(xn,{PromptQLSdk:()=>H,ROOM_NAME_REGEX:()=>ke,USER_AGENT:()=>J,buildAuthHeader:()=>m,cancelAgentMessage:()=>w,createApolloClient:()=>$,createRoom:()=>U,createWikiPage:()=>Q,deleteWikiPage:()=>K,diffThreadEvents:()=>Ge,downloadArtifactData:()=>P,getAgentGeneratedResponse:()=>Le,getAgentInteractionDecisionAcceptInteractionEvent:()=>$e,getAgentInteractionDecisionDeclineInteractionEvent:()=>Je,getAgentInteractionFinishedEvent:()=>kn,getAgentMessageProcessingStartedEvent:()=>Ke,getAgentOrchestratorContextExplorerCompletedEvent:()=>nn,getAgentOrchestratorContextExplorerStartedEvent:()=>en,getAgentOrchestratorContextExplorerUpdateEvent:()=>p,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent:()=>sn,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent:()=>pn,getAgentOrchestratorSchemaExplorerCompletedEvent:()=>un,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent:()=>mn,getAgentOrchestratorSchemaExplorerSchemaExploredEvent:()=>fn,getAgentOrchestratorSchemaExplorerStartedEvent:()=>on,getAgentOrchestratorSchemaExplorerUpdateEvent:()=>s,getAgentOrchestratorSchemaTasksGeneratedEvent:()=>ln,getAgentOrchestratorSchemaTasksGenerationCompletedEvent:()=>_n,getAgentOrchestratorSchemaTasksGenerationStartedEvent:()=>an,getAgentOrchestratorSchemaTasksGenerationUpdateEvent:()=>x,getAgentOrchestratorStepProgrammerEvent:()=>cn,getAgentOrchestratorStepSavedProgramRunnerEvent:()=>gn,getAgentOrchestratorStepUiProgrammerEvent:()=>yn,getAgentOrchestratorStepUpdateEvent:()=>v,getAgentOrchestratorUpdateEvent:()=>k,getAgentOrchestratorWikiExplorerCompletedEvent:()=>rn,getAgentOrchestratorWikiExplorerStartedEvent:()=>dn,getAgentOrchestratorWikiExplorerUpdateEvent:()=>B,getAgentOrchestratorWikiInfoGeneratedEvent:()=>tn,getAgentPlanGenerationStartedEvent:()=>ze,getAgentPlanStepGeneratedEvent:()=>Qe,getAgentPlanningDecisionCompletedEvent:()=>Xe,getAgentPlanningDecisionPlanningRequiredEvent:()=>Ze,getAgentPlanningDecisionStartedEvent:()=>He,getAgentPlanningDecisionUpdateEvent:()=>g,getAgentStartingOrchestratorEvent:()=>Ye,getArtifactMetadata:()=>C,getThread:()=>F,getThreadAndEvents:()=>I,getThreadEventMessageId:()=>Bn,getThreadEvents:()=>c,getUserCancelEvent:()=>We,getUserMessageEvent:()=>je,getWikiPage:()=>z,isInteractionAnalyzing:()=>ve,listArtifactMetadataByThreadId:()=>N,listRooms:()=>f,listThreads:()=>M,listWikiPages:()=>j,searchWikiPages:()=>W,sendThreadMessage:()=>D,startThread:()=>q,streamThreadMessageEvents:()=>G,subscribeThreadEvents:()=>R,updateWikiPage:()=>L,validateRoomName:()=>Be});module.exports=Me(xn);var X={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"}}]}}]}}]},Z={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"}}]}}]}}]},Y={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"}}]}}]}}]},ee={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"}}]}}]}}]}}]},ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_add"},arguments:[{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}},{kind:"Argument",name:{kind:"Name",value:"pageId"},value:{kind:"Variable",name:{kind:"Name",value:"pageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_delete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},re={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"}}]}}]}}]}}]},te={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"}}]}}]}}]},ae={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"}}]}}]}}]},_e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProjectInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_project_info"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectId"}},{kind:"Field",name:{kind:"Name",value:"projectName"}},{kind:"Field",name:{kind:"Name",value:"promptqlConsoleUrl"}}]}}]}}]},le={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"}}]}}]},oe={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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},ue={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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},se={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadAndEventsById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsOrdering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],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:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}}},{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:"eventsOrdering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}}]}},{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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},pe={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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},me={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:"id"}},{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}}]}]}}]}}]},fe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWikiPage"},variableDefinitions:[{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:"limit"},value:{kind:"IntValue",value:"1"}},{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:"id"}},{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"}}]}}]}}]},ce={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_search"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{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:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"results"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"score"}},{kind:"Field",name:{kind:"Name",value:"page"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"aliases"}},{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"stub"}},{kind:"Field",name:{kind:"Name",value:"title"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"ownerId"}},{kind:"Field",name:{kind:"Name",value:"lastUpdatedAt"}}]}}]}}]}}]}}]},ye={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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]};async function P(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/data`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let Se=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to download artifact: ${Se}`)}return t.body?t.headers.get("Content-Type")?.startsWith("application/json")?t.json():t.text():null}async function N(n,e,i){let r=await n.query({query:re,variables:{threadId:i},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(d=>d.latest_version_object).map(d=>({project_id:e,artifact_id:d.artifact_id,artifact_type:d.latest_version_object.artifact_type,version:d.latest_version_object.version,title:d.latest_version_object.title,description:d.latest_version_object.description??null,user_id:d.latest_version_object.user_id,metadata:d.latest_version_object.artifact_metadata,created_at:d.latest_version_object.created_at,size_bytes:Number.parseInt(d.latest_version_object.size)})):[]}async function C(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/metadata`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let u=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to get artifact metadata: ${u}`)}return t.json()}function f(n,e){return n.query({query:le,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.rooms??[])}function U(n,e){if(!e.name)throw new Error("Room name is required");let i=Be(e.name);if(i)throw new Error(i);return n.mutate({mutation:Z,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 ke=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,ge=80,Be=n=>{let e=n.trim();return e.length===0?null:e.length>ge?`Room name must be ${ge} 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.":ke.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};var l=require("rxjs");var xe=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;function V(n){if(n==null)return null;try{Number.parseInt(n)}catch{throw new Error("invalid threadEventId")}return n}function M(n,e){return n.query({query:oe,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2??[])}function F(n,e){if(!e)throw new Error("threadId is required");return n.query({query:ue,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2_by_pk)}function I(n,e,i){let r=he(e,i);return n.query({query:se,variables:{id:e,eventsWhere:r.where,eventsLimit:r.limit,eventsOrdering:r.ordering},fetchPolicy:"no-cache"}).then(d=>d.data?.threads_v2_by_pk)}function q(n,e){if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:ee,variables:e}).then(i=>{if(!i.data?.start_thread)throw new Error(i.error?.message||"Failed to start thread");return i.data.start_thread})}function c(n,e,i){return n.query({query:pe,variables:he(e,i),fetchPolicy:"no-cache"}).then(r=>r.data?.thread_events??[])}function D(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:Y,variables:e}).then(i=>{if(!i.data?.send_thread_message)throw new Error(i.error?.message||"Failed to send message to thread");return i.data.send_thread_message})}function w(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return n.mutate({mutation:X,variables:e}).then(i=>{if(!i.data?.cancel_agent_message)throw new Error(i.error?.message||"Failed to cancel thread");return i.data.cancel_agent_message.thread_event_id})}function R(n,e,i){if(!e)throw new Error("threadId is required");V(i);let r={thread_id:{_eq:e}};return i&&(r.thread_event_id={_gte:i}),n.subscribe({query:ye,variables:{where:r}}).pipe((0,l.map)(d=>{if(d.error)throw d.error;return d.data?.thread_events??[]}))}function G(n,e,i){if(!e)throw new Error("threadId is required");let r,d=V(i?.fromEventId),a={eventId:i?.fromEventId?{_gte:d}:void 0,messageId:i?.messageId},_=i?.pollingInterval&&i?.pollingInterval>0?i.pollingInterval:5;return(0,l.defer)(async()=>{let t=r?{messageId:i?.messageId,eventId:{_gt:r}}:a,u=await c(n,e,t);return u.length>0&&(r=u[u.length-1]?.thread_event_id),u}).pipe((0,l.repeat)({count:i?.timeout&&i.timeout>0?Math.ceil(i.timeout/_):void 0,delay:_*1e3}),(0,l.takeWhile)(t=>ve(t,i?.skipAnalysis),!0))}function ve(n,e){for(let i=n.length-1;i>=0;i--){let r=n[i];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let d=r.event_data.AgentMessage.update;if("content"in d&&("interaction_finished"in d.content||e&&"interaction_update"in d.content&&"main_agent"in d.content.interaction_update&&"completed"in d.content.interaction_update.main_agent)||"InteractionFinished"in d||e&&"OrchestratorUpdate"in d&&"GeneratedResponse"in d.OrchestratorUpdate.update)return!1}return!0}function Fe(n){return[{event_data:{_contains:{UserMessage:{message_id:n}}}},{event_data:{_contains:{AgentMessage:{message_id:n}}}},{event_data:{_contains:{UserCancel:{message_id:n}}}}]}var he=(n,e)=>{if(!n)throw new Error("threadId is required");let i={thread_id:{_eq:n}};return e&&(e.eventId&&(i.thread_event_id=e.eventId),e.messageId&&(i._or=Fe(e.messageId))),{where:i,limit:e?.limit,ordering:e?.ordering||"asc"}};var y=["guide","regular"];async function j(n,e){let i=e.namespace||"regular";if(!y.includes(i))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(i==="guide"){let _={deleted_at:{_is_null:!0}};return e.project_id&&(_.project_id={_eq:e.project_id}),e.query&&(_.page_title={_ilike:e.query.toLowerCase()}),qe(n,{where:_,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="slug"?"id":e.order_by]:e.ordering||"asc"}:void 0})}let r=e.project_id||!e.include_stub||e.namespace||e.query,d={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?e.order_by==="slug"?"page_id":e.order_by:"page_id"]:e.ordering||"asc"}:void 0};r||(d.offset=e.offset,d.limit=e.limit);let a=await Ie(n,d);return r?Re(a,e):a}async function W(n,e){if(!e.query)throw new Error("query is required");return n.query({query:ce,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_search?{totalCount:i.data.admin_wiki_search.totalCount,results:i.data?.admin_wiki_search.results.map(({score:r,metadata:d,page:{id:a,..._}})=>({..._,score:r,stable_id:d.id,slug:a,created_at:d.createdAt,last_modified_at:d.lastUpdatedAt}))}:{totalCount:0,results:[]})}async function z(n,e,i,r){if(i=i||"regular",!y.includes(i))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(i==="guide")return we(n,{project_id:e,page_id:r});let d={project_id:{_eq:e},deleted_at:{_is_null:!0}};return xe.test(r)?d.id={_eq:r}:d.page_id={_eq:r},De(n,{where:d})}function Q(n,{slug:e,...i}){if(!i.title)throw new Error("Wiki title is required");if(!i.stub&&!i.definition)throw new Error("Wiki definition is required");return n.mutate({mutation:ne,variables:{pageId:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function L(n,e,i){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:ie,variables:{id:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function K(n,e){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:de,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_delete?.buildVersion)}function Ie(n,e){return n.query({query:me,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki.map(({page_id:r,id:d,...a})=>({...a,stable_id:d,slug:r}))??[])}function qe(n,e){return n.query({query:te,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_guide_page?.map(r=>({stable_id:r.id,slug:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function De(n,e){let i=await n.query({query:fe,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(d=>({stable_id:d.id,slug:d.page_id,created_at:d.created_at,last_modified_at:d.last_modified_at,...d.content}))??[]);return i.length?i[0]:null}async function we(n,e){let i=await n.query({query:ae,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(d=>({stable_id:d.id,slug:d.id,created_at:d.created_at,last_modified_at:d.last_modified_at,title:d.page_title,details:d.details}))??[]);return i.length?i[0]:null}function Re(n,e){if(!n.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return n;let i=e.query?.toLowerCase(),r=n.filter(d=>!e.include_stub&&d.stub?!1:!!(!i||d.title.toLowerCase().includes(i)||d.definition&&d.definition.toLowerCase().includes(i)||d.aliases?.length&&d.aliases.some(a=>a.toLowerCase().includes(i))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}var o=require("@apollo/client"),Ee=require("@apollo/client/link/context"),Oe=require("@apollo/client/link/subscriptions"),Te=require("graphql"),Ae=require("graphql-ws"),$=n=>{let e=new o.HttpLink({uri:n.url,fetch:n.fetch,headers:typeof n.headers=="object"?n.headers:void 0}),i=async _=>{let t=typeof n.headers=="object"?n.headers:await n.headers();return{headers:{..._,...t}}},r=(0,Ae.createClient)({url:n.url,connectionParams:()=>i(),lazy:!0}),d=new Oe.GraphQLWsLink(r),a=o.ApolloLink.split(({operationType:_})=>_===Te.OperationTypeNode.SUBSCRIPTION,d,typeof n.headers=="object"?e:new Ee.SetContextLink(({headers:_})=>i(_)).concat(e));return{client:new o.ApolloClient({link:a,cache:new o.InMemoryCache}),wsClient:r}};var J="PromptQL TypeScript SDK";function Ge(n,e){if(!e.length)return[];if(!n.length)return e;let i=n[n.length-1];if(!i)return e;let r=BigInt(i.thread_event_id),d=e.length-1;for(;d>=0;d--){let a=e[d];if(BigInt(a?.thread_event_id)<=r)break}return e.slice(d+1)}function je(n){return"UserMessage"in n?n.UserMessage:null}function We(n){return"UserCancel"in n?n.UserCancel:null}function ze(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)||!("PlanGenerationStarted"in n.AgentMessage.update.OrchestratorUpdate.update)?null:n.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function Qe(n){let e=k(n);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function Le(n){return"AgentMessage"in n?"content"in n.AgentMessage.update&&"interaction_update"in n.AgentMessage.update.content&&"main_agent"in n.AgentMessage.update.content.interaction_update&&"completed"in n.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:n.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:n.AgentMessage.update.timestamp,messageId:n.AgentMessage.message_id}:!("OrchestratorUpdate"in n.AgentMessage.update)||!("GeneratedResponse"in n.AgentMessage.update.OrchestratorUpdate.update)?null:{...n.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:n.AgentMessage.message_id}:null}function Ke(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("ProcessingStarted"in n.AgentMessage.update.MessageProcessingUpdate.update)?null:n.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function $e(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function Je(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function g(n){return!("AgentMessage"in n)||!("PlanningDecisionUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.PlanningDecisionUpdate.update}function He(n){let e=g(n);return!e||!("Started"in e)?null:e.Started}function Xe(n){let e=g(n);return!e||!("Completed"in e)?null:e.Completed}function Ze(n){let e=g(n);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function Ye(n){return!("AgentMessage"in n)||!("StartingOrchestrator"in n.AgentMessage.update)?null:n.AgentMessage.update.StartingOrchestrator}function k(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.OrchestratorUpdate.update}function p(n){let e=k(n);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function en(n){let e=p(n);return!e||!("Started"in e)?null:e.Started}function nn(n){let e=p(n);return!e||!("Completed"in e)?null:e.Completed}function B(n){let e=p(n);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function dn(n){let e=B(n);return!e||!("Started"in e)?null:e.Started}function rn(n){let e=B(n);return!e||!("Completed"in e)?null:e.Completed}function tn(n){let e=B(n);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function x(n){let e=p(n);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function an(n){let e=x(n);return!e||!("Started"in e)?null:e.Started}function _n(n){let e=x(n);return!e||!("Completed"in e)?null:e.Completed}function ln(n){let e=x(n);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function s(n){let e=p(n);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function on(n){let e=s(n);return!e||!("Started"in e)?null:e.Started}function un(n){let e=s(n);return!e||!("Completed"in e)?null:e.Completed}function sn(n){let e=s(n);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function pn(n){let e=s(n);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function mn(n){let e=s(n);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function fn(n){let e=s(n);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function v(n){let e=k(n);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function cn(n){let e=v(n);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function yn(n){let e=v(n);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function gn(n){let e=v(n);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function kn(n){if(!("AgentMessage"in n))return null;if("InteractionFinished"in n.AgentMessage.update){let e=n.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:n.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:n.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:n.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:n.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:n.AgentMessage.message_id}:{status:"unknown",messageId:n.AgentMessage.message_id}}if("content"in n.AgentMessage.update&&"interaction_finished"in n.AgentMessage.update.content){let e=n.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:n.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:n.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:n.AgentMessage.message_id}}return null}function Bn(n){if(n){if("UserMessage"in n)return n.UserMessage.message_id;if("AgentMessage"in n)return n.AgentMessage.message_id;if("UserTeach"in n)return n.UserTeach.agent_message_id;if("UserCancel"in n)return n.UserCancel.message_id}}function m(n){return{Authorization:`pat ${n}`,"User-Agent":J}}var be="https://promptql.ddn.hasura.app",h=class{options;defaultTimezone;client;wsClient;project;constructor(e){if(this.options=e,!e.accessToken)throw new Error("accessToken is required");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let i=new URL(this.options.baseUrl||be);i.pathname="/playground-v2-hge/v1/graphql";let{client:r,wsClient:d}=$({url:i.toString(),fetch:this.options.fetch,headers:Object.assign(m(this.options.accessToken),this.options.headers)});this.wsClient=d,this.client=r}async getProjectInfo(){if(this.project)return this.project;let i=(await this.client.query({query:_e,fetchPolicy:"no-cache"})).data?.get_project_info;if(!i)throw new Error("Project not found");let r=new URL(this.options.baseUrl||be);return r.hostname.startsWith("promptql.")&&(r.hostname=`${i.projectName}${r.hostname.slice(8)}`),this.project={projectId:i.projectId,projectName:i.projectName,projectHost:r.toString(),promptqlConsoleUrl:`https://prompt.ql.app/project/${i.projectName}`},this.project}close(){if(this.wsClient&&this.wsClient.dispose(),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.project=void 0}}};var E=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let i=await this.api.getProjectInfo();return N(this.api.client,i.projectId,e)}async download(e,i){let r=await this.api.getProjectInfo();return P(r.projectHost,e,i,m(this.api.options.accessToken),this.api.options.fetch)}async getMetadata(e,i){let r=await this.api.getProjectInfo();return C(r.projectHost,e,i,m(this.api.options.accessToken),this.api.options.fetch)}};var O=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var T=class{api;constructor(e){this.api=e}async list(e){return f(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){return f(this.api.client,{where:{name:{_eq:e}},limit:1}).then(i=>i.length?i[0]??null:null)}async create(e){return U(this.api.client,e)}};var A=class{api;constructor(e){this.api=e}async list(e){return M(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");return F(this.api.client,e)}async start(e){let i=await this.api.getProjectInfo();return q(this.api.client,{...e,projectId:i.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async detail(e,i){return I(this.api.client,e,i)}async getEvents(e,i){return c(this.api.client,e,i)}async sendMessage(e){return D(this.api.client,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){return w(this.api.client,e)}subscribeEvents(e,i){return R(this.api.client,e,i)}streamMessageEvents(e,i){return G(this.api.client,e,i)}};var b=class{api;constructor(e){this.api=e}async list(e){return j(this.api.client,e)}async search(e){return W(this.api.client,e)}async get(e,i){let r=await this.api.getProjectInfo();return z(this.api.client,r.projectId,e,i)}async create(e){return Q(this.api.client,e)}async update(e,i){return L(this.api.client,e,i)}async delete(e){return K(this.api.client,e)}};var H=class{constructor(e){let i=new h(e);this.api=i,this.thread=new A(i),this.project=new O(i),this.room=new T(i),this.artifact=new E(i),this.wiki=new b(i)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};0&&(module.exports={PromptQLSdk,ROOM_NAME_REGEX,USER_AGENT,buildAuthHeader,cancelAgentMessage,createApolloClient,createRoom,createWikiPage,deleteWikiPage,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,getThreadAndEvents,getThreadEventMessageId,getThreadEvents,getUserCancelEvent,getUserMessageEvent,getWikiPage,isInteractionAnalyzing,listArtifactMetadataByThreadId,listRooms,listThreads,listWikiPages,searchWikiPages,sendThreadMessage,startThread,streamThreadMessageEvents,subscribeThreadEvents,updateWikiPage,validateRoomName});
1
+ "use strict";var S=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var Ve=(n,e)=>{for(var i in e)S(n,i,{get:e[i],enumerable:!0})},Me=(n,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of Ce(e))!Ue.call(n,d)&&d!==i&&S(n,d,{get:()=>e[d],enumerable:!(r=Ne(e,d))||r.enumerable});return n};var Fe=n=>Me(S({},"__esModule",{value:!0}),n);var vn={};Ve(vn,{PromptQLSdk:()=>X,ROOM_NAME_REGEX:()=>Be,USER_AGENT:()=>H,buildAuthHeader:()=>m,cancelAgentMessage:()=>R,createApolloClient:()=>J,createRoom:()=>V,createWikiPage:()=>L,deleteWikiPage:()=>$,diffThreadEvents:()=>Ge,downloadArtifactData:()=>P,getAgentGeneratedResponse:()=>Ke,getAgentInteractionDecisionAcceptInteractionEvent:()=>Je,getAgentInteractionDecisionDeclineInteractionEvent:()=>He,getAgentInteractionFinishedEvent:()=>Bn,getAgentMessageProcessingStartedEvent:()=>$e,getAgentOrchestratorContextExplorerCompletedEvent:()=>dn,getAgentOrchestratorContextExplorerStartedEvent:()=>nn,getAgentOrchestratorContextExplorerUpdateEvent:()=>p,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent:()=>pn,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent:()=>mn,getAgentOrchestratorSchemaExplorerCompletedEvent:()=>sn,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent:()=>fn,getAgentOrchestratorSchemaExplorerSchemaExploredEvent:()=>cn,getAgentOrchestratorSchemaExplorerStartedEvent:()=>un,getAgentOrchestratorSchemaExplorerUpdateEvent:()=>s,getAgentOrchestratorSchemaTasksGeneratedEvent:()=>on,getAgentOrchestratorSchemaTasksGenerationCompletedEvent:()=>ln,getAgentOrchestratorSchemaTasksGenerationStartedEvent:()=>_n,getAgentOrchestratorSchemaTasksGenerationUpdateEvent:()=>x,getAgentOrchestratorStepProgrammerEvent:()=>yn,getAgentOrchestratorStepSavedProgramRunnerEvent:()=>kn,getAgentOrchestratorStepUiProgrammerEvent:()=>gn,getAgentOrchestratorStepUpdateEvent:()=>v,getAgentOrchestratorUpdateEvent:()=>k,getAgentOrchestratorWikiExplorerCompletedEvent:()=>tn,getAgentOrchestratorWikiExplorerStartedEvent:()=>rn,getAgentOrchestratorWikiExplorerUpdateEvent:()=>B,getAgentOrchestratorWikiInfoGeneratedEvent:()=>an,getAgentPlanGenerationStartedEvent:()=>Qe,getAgentPlanStepGeneratedEvent:()=>Le,getAgentPlanningDecisionCompletedEvent:()=>Ze,getAgentPlanningDecisionPlanningRequiredEvent:()=>Ye,getAgentPlanningDecisionStartedEvent:()=>Xe,getAgentPlanningDecisionUpdateEvent:()=>g,getAgentStartingOrchestratorEvent:()=>en,getArtifactMetadata:()=>C,getProjectInfo:()=>U,getThread:()=>I,getThreadAndEvents:()=>q,getThreadEventMessageId:()=>xn,getThreadEvents:()=>c,getUserCancelEvent:()=>ze,getUserMessageEvent:()=>We,getWikiPage:()=>Q,isInteractionAnalyzing:()=>he,listArtifactMetadataByThreadId:()=>N,listRooms:()=>f,listThreads:()=>F,listWikiPages:()=>W,searchWikiPages:()=>z,sendThreadMessage:()=>w,startThread:()=>D,streamThreadMessageEvents:()=>G,subscribeThreadEvents:()=>j,updateWikiPage:()=>K,validateRoomName:()=>xe});module.exports=Fe(vn);var Z={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"}}]}}]}}]},Y={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"}}]}}]}}]},ee={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"}}]}}]}}]},ne={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"}}]}}]}}]}}]},ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_add"},arguments:[{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}},{kind:"Argument",name:{kind:"Name",value:"pageId"},value:{kind:"Variable",name:{kind:"Name",value:"pageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},re={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_delete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},te={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"}}]}}]}}]}}]},ae={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"}}]}}]}}]},_e={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"}}]}}]}}]},le={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProjectInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_project_info"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectId"}},{kind:"Field",name:{kind:"Name",value:"projectName"}},{kind:"Field",name:{kind:"Name",value:"promptqlConsoleUrl"}}]}}]}}]},oe={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"}}]}}]},ue={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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},se={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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},pe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadAndEventsById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsOrdering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],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:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}}},{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:"eventsOrdering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}}]}},{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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},me={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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},fe={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:"id"}},{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}}]}]}}]}}]},ce={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWikiPage"},variableDefinitions:[{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:"limit"},value:{kind:"IntValue",value:"1"}},{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:"id"}},{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"}}]}}]}}]},ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_search"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{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:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"results"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"score"}},{kind:"Field",name:{kind:"Name",value:"page"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"aliases"}},{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"stub"}},{kind:"Field",name:{kind:"Name",value:"title"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"ownerId"}},{kind:"Field",name:{kind:"Name",value:"lastUpdatedAt"}}]}}]}}]}}]}}]},ge={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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]};async function P(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/data`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let Pe=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to download artifact: ${Pe}`)}return t.body?t.headers.get("Content-Type")?.startsWith("application/json")?t.json():t.text():null}async function N(n,e,i){let r=await n.query({query:te,variables:{threadId:i},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(d=>d.latest_version_object).map(d=>({project_id:e,artifact_id:d.artifact_id,artifact_type:d.latest_version_object.artifact_type,version:d.latest_version_object.version,title:d.latest_version_object.title,description:d.latest_version_object.description??null,user_id:d.latest_version_object.user_id,metadata:d.latest_version_object.artifact_metadata,created_at:d.latest_version_object.created_at,size_bytes:Number.parseInt(d.latest_version_object.size)})):[]}async function C(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/metadata`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let u=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to get artifact metadata: ${u}`)}return t.json()}async function U(n){return(await n.query({query:le,fetchPolicy:"no-cache"})).data?.get_project_info}function f(n,e){return n.query({query:oe,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.rooms??[])}function V(n,e){if(!e.name)throw new Error("Room name is required");let i=xe(e.name);if(i)throw new Error(i);return n.mutate({mutation:Y,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 Be=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,ke=80,xe=n=>{let e=n.trim();return e.length===0?null:e.length>ke?`Room name must be ${ke} 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.":Be.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};var l=require("rxjs");var ve=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;function M(n){if(n==null)return null;try{Number.parseInt(n)}catch{throw new Error("invalid threadEventId")}return n}function F(n,e){return n.query({query:ue,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2??[])}function I(n,e){if(!e)throw new Error("threadId is required");return n.query({query:se,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2_by_pk)}function q(n,e,i){let r=Ee(e,i);return n.query({query:pe,variables:{id:e,eventsWhere:r.where,eventsLimit:r.limit,eventsOrdering:r.ordering},fetchPolicy:"no-cache"}).then(d=>d.data?.threads_v2_by_pk)}function D(n,e){if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:ne,variables:e}).then(i=>{if(!i.data?.start_thread)throw new Error(i.error?.message||"Failed to start thread");return i.data.start_thread})}function c(n,e,i){return n.query({query:me,variables:Ee(e,i),fetchPolicy:"no-cache"}).then(r=>r.data?.thread_events??[])}function w(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:ee,variables:e}).then(i=>{if(!i.data?.send_thread_message)throw new Error(i.error?.message||"Failed to send message to thread");return i.data.send_thread_message})}function R(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return n.mutate({mutation:Z,variables:e}).then(i=>{if(!i.data?.cancel_agent_message)throw new Error(i.error?.message||"Failed to cancel thread");return i.data.cancel_agent_message.thread_event_id})}function j(n,e,i){if(!e)throw new Error("threadId is required");M(i);let r={thread_id:{_eq:e}};return i&&(r.thread_event_id={_gte:i}),n.subscribe({query:ge,variables:{where:r}}).pipe((0,l.map)(d=>{if(d.error)throw d.error;return d.data?.thread_events??[]}))}function G(n,e,i){if(!e)throw new Error("threadId is required");let r,d=M(i?.fromEventId),a={eventId:i?.fromEventId?{_gte:d}:void 0,messageId:i?.messageId},_=i?.pollingInterval&&i?.pollingInterval>0?i.pollingInterval:5;return(0,l.defer)(async()=>{let t=r?{messageId:i?.messageId,eventId:{_gt:r}}:a,u=await c(n,e,t);return u.length>0&&(r=u[u.length-1]?.thread_event_id),u}).pipe((0,l.repeat)({count:i?.timeout&&i.timeout>0?Math.ceil(i.timeout/_):void 0,delay:_*1e3}),(0,l.takeWhile)(t=>he(t,i?.skipAnalysis),!0))}function he(n,e){for(let i=n.length-1;i>=0;i--){let r=n[i];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let d=r.event_data.AgentMessage.update;if("content"in d&&("interaction_finished"in d.content||e&&"interaction_update"in d.content&&"main_agent"in d.content.interaction_update&&"completed"in d.content.interaction_update.main_agent)||"InteractionFinished"in d||e&&"OrchestratorUpdate"in d&&"GeneratedResponse"in d.OrchestratorUpdate.update)return!1}return!0}function Ie(n){return[{event_data:{_contains:{UserMessage:{message_id:n}}}},{event_data:{_contains:{AgentMessage:{message_id:n}}}},{event_data:{_contains:{UserCancel:{message_id:n}}}}]}var Ee=(n,e)=>{if(!n)throw new Error("threadId is required");let i={thread_id:{_eq:n}};return e&&(e.eventId&&(i.thread_event_id=e.eventId),e.messageId&&(i._or=Ie(e.messageId))),{where:i,limit:e?.limit,ordering:e?.ordering||"asc"}};var y=["guide","regular"];async function W(n,e){let i=e.namespace||"regular";if(!y.includes(i))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(i==="guide"){let _={deleted_at:{_is_null:!0}};return e.project_id&&(_.project_id={_eq:e.project_id}),e.query&&(_.page_title={_ilike:e.query.toLowerCase()}),De(n,{where:_,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="slug"?"id":e.order_by]:e.ordering||"asc"}:void 0})}let r=e.project_id||!e.include_stub||e.namespace||e.query,d={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?e.order_by==="slug"?"page_id":e.order_by:"page_id"]:e.ordering||"asc"}:void 0};r||(d.offset=e.offset,d.limit=e.limit);let a=await qe(n,d);return r?je(a,e):a}async function z(n,e){if(!e.query)throw new Error("query is required");return n.query({query:ye,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_search?{totalCount:i.data.admin_wiki_search.totalCount,results:i.data?.admin_wiki_search.results.map(({score:r,metadata:d,page:{id:a,..._}})=>({..._,score:r,stable_id:d.id,slug:a,created_at:d.createdAt,last_modified_at:d.lastUpdatedAt}))}:{totalCount:0,results:[]})}async function Q(n,e,i,r){if(i=i||"regular",!y.includes(i))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(i==="guide")return Re(n,{project_id:e,page_id:r});let d={project_id:{_eq:e},deleted_at:{_is_null:!0}};return ve.test(r)?d.id={_eq:r}:d.page_id={_eq:r},we(n,{where:d})}function L(n,{slug:e,...i}){if(!i.title)throw new Error("Wiki title is required");if(!i.stub&&!i.definition)throw new Error("Wiki definition is required");return n.mutate({mutation:ie,variables:{pageId:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function K(n,e,i){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:de,variables:{id:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function $(n,e){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:re,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_delete?.buildVersion)}function qe(n,e){return n.query({query:fe,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki.map(({page_id:r,id:d,...a})=>({...a,stable_id:d,slug:r}))??[])}function De(n,e){return n.query({query:ae,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_guide_page?.map(r=>({stable_id:r.id,slug:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function we(n,e){let i=await n.query({query:ce,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(d=>({stable_id:d.id,slug:d.page_id,created_at:d.created_at,last_modified_at:d.last_modified_at,...d.content}))??[]);return i.length?i[0]:null}async function Re(n,e){let i=await n.query({query:_e,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(d=>({stable_id:d.id,slug:d.id,created_at:d.created_at,last_modified_at:d.last_modified_at,title:d.page_title,details:d.details}))??[]);return i.length?i[0]:null}function je(n,e){if(!n.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return n;let i=e.query?.toLowerCase(),r=n.filter(d=>!e.include_stub&&d.stub?!1:!!(!i||d.title.toLowerCase().includes(i)||d.definition&&d.definition.toLowerCase().includes(i)||d.aliases?.length&&d.aliases.some(a=>a.toLowerCase().includes(i))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}var o=require("@apollo/client"),Oe=require("@apollo/client/link/context"),Te=require("@apollo/client/link/subscriptions"),Ae=require("graphql"),be=require("graphql-ws"),J=n=>{let e=new o.HttpLink({uri:n.url,fetch:n.fetch,headers:typeof n.headers=="object"?n.headers:void 0}),i=async _=>{let t=typeof n.headers=="object"?n.headers:await n.headers();return{headers:{..._,...t}}},r=(0,be.createClient)({url:n.url,connectionParams:()=>i(),lazy:!0}),d=new Te.GraphQLWsLink(r),a=o.ApolloLink.split(({operationType:_})=>_===Ae.OperationTypeNode.SUBSCRIPTION,d,typeof n.headers=="object"?e:new Oe.SetContextLink(({headers:_})=>i(_)).concat(e));return{client:new o.ApolloClient({link:a,cache:new o.InMemoryCache}),wsClient:r}};var H="PromptQL TypeScript SDK";function Ge(n,e){if(!e.length)return[];if(!n.length)return e;let i=n[n.length-1];if(!i)return e;let r=BigInt(i.thread_event_id),d=e.length-1;for(;d>=0;d--){let a=e[d];if(BigInt(a?.thread_event_id)<=r)break}return e.slice(d+1)}function We(n){return"UserMessage"in n?n.UserMessage:null}function ze(n){return"UserCancel"in n?n.UserCancel:null}function Qe(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)||!("PlanGenerationStarted"in n.AgentMessage.update.OrchestratorUpdate.update)?null:n.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function Le(n){let e=k(n);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function Ke(n){return"AgentMessage"in n?"content"in n.AgentMessage.update&&"interaction_update"in n.AgentMessage.update.content&&"main_agent"in n.AgentMessage.update.content.interaction_update&&"completed"in n.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:n.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:n.AgentMessage.update.timestamp,messageId:n.AgentMessage.message_id}:!("OrchestratorUpdate"in n.AgentMessage.update)||!("GeneratedResponse"in n.AgentMessage.update.OrchestratorUpdate.update)?null:{...n.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:n.AgentMessage.message_id}:null}function $e(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("ProcessingStarted"in n.AgentMessage.update.MessageProcessingUpdate.update)?null:n.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function Je(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function He(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function g(n){return!("AgentMessage"in n)||!("PlanningDecisionUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.PlanningDecisionUpdate.update}function Xe(n){let e=g(n);return!e||!("Started"in e)?null:e.Started}function Ze(n){let e=g(n);return!e||!("Completed"in e)?null:e.Completed}function Ye(n){let e=g(n);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function en(n){return!("AgentMessage"in n)||!("StartingOrchestrator"in n.AgentMessage.update)?null:n.AgentMessage.update.StartingOrchestrator}function k(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.OrchestratorUpdate.update}function p(n){let e=k(n);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function nn(n){let e=p(n);return!e||!("Started"in e)?null:e.Started}function dn(n){let e=p(n);return!e||!("Completed"in e)?null:e.Completed}function B(n){let e=p(n);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function rn(n){let e=B(n);return!e||!("Started"in e)?null:e.Started}function tn(n){let e=B(n);return!e||!("Completed"in e)?null:e.Completed}function an(n){let e=B(n);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function x(n){let e=p(n);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function _n(n){let e=x(n);return!e||!("Started"in e)?null:e.Started}function ln(n){let e=x(n);return!e||!("Completed"in e)?null:e.Completed}function on(n){let e=x(n);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function s(n){let e=p(n);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function un(n){let e=s(n);return!e||!("Started"in e)?null:e.Started}function sn(n){let e=s(n);return!e||!("Completed"in e)?null:e.Completed}function pn(n){let e=s(n);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function mn(n){let e=s(n);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function fn(n){let e=s(n);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function cn(n){let e=s(n);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function v(n){let e=k(n);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function yn(n){let e=v(n);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function gn(n){let e=v(n);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function kn(n){let e=v(n);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function Bn(n){if(!("AgentMessage"in n))return null;if("InteractionFinished"in n.AgentMessage.update){let e=n.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:n.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:n.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:n.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:n.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:n.AgentMessage.message_id}:{status:"unknown",messageId:n.AgentMessage.message_id}}if("content"in n.AgentMessage.update&&"interaction_finished"in n.AgentMessage.update.content){let e=n.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:n.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:n.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:n.AgentMessage.message_id}}return null}function xn(n){if(n){if("UserMessage"in n)return n.UserMessage.message_id;if("AgentMessage"in n)return n.AgentMessage.message_id;if("UserTeach"in n)return n.UserTeach.agent_message_id;if("UserCancel"in n)return n.UserCancel.message_id}}function m(n){return{Authorization:`pat ${n}`,"User-Agent":H}}var Se="https://promptql.ddn.hasura.app",h=class{options;defaultTimezone;client;wsClient;project;constructor(e){if(this.options=e,!e.accessToken)throw new Error("accessToken is required");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let i=new URL(this.options.baseUrl||Se);i.pathname="/playground-v2-hge/v1/graphql";let{client:r,wsClient:d}=J({url:i.toString(),fetch:this.options.fetch,headers:Object.assign(m(this.options.accessToken),this.options.headers)});this.wsClient=d,this.client=r}async getProjectInfo(){if(this.project)return this.project;let e=await U(this.client);if(!e)throw new Error("Project not found");let i=new URL(this.options.baseUrl||Se);return i.hostname.startsWith("promptql.")&&(i.hostname=`${e.projectName}${i.hostname.slice(8)}`),this.project={projectId:e.projectId,projectName:e.projectName,projectHost:i.toString(),promptqlConsoleUrl:e.promptqlConsoleUrl},this.project}close(){if(this.wsClient&&this.wsClient.dispose(),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.project=void 0}}};var E=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let i=await this.api.getProjectInfo();return N(this.api.client,i.projectId,e)}async download(e,i){let r=await this.api.getProjectInfo();return P(r.projectHost,e,i,m(this.api.options.accessToken),this.api.options.fetch)}async getMetadata(e,i){let r=await this.api.getProjectInfo();return C(r.projectHost,e,i,m(this.api.options.accessToken),this.api.options.fetch)}};var O=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var T=class{api;constructor(e){this.api=e}async list(e){return f(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){return f(this.api.client,{where:{name:{_eq:e}},limit:1}).then(i=>i.length?i[0]??null:null)}async create(e){return V(this.api.client,e)}};var A=class{api;constructor(e){this.api=e}async list(e){return F(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");return I(this.api.client,e)}async start(e){let i=await this.api.getProjectInfo();return D(this.api.client,{...e,projectId:i.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async detail(e,i){return q(this.api.client,e,i)}async getEvents(e,i){return c(this.api.client,e,i)}async sendMessage(e){return w(this.api.client,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){return R(this.api.client,e)}subscribeEvents(e,i){return j(this.api.client,e,i)}streamMessageEvents(e,i){return G(this.api.client,e,i)}};var b=class{api;constructor(e){this.api=e}async list(e){return W(this.api.client,e)}async search(e){return z(this.api.client,e)}async get(e,i){let r=await this.api.getProjectInfo();return Q(this.api.client,r.projectId,e,i)}async create(e){return L(this.api.client,e)}async update(e,i){return K(this.api.client,e,i)}async delete(e){return $(this.api.client,e)}};var X=class{constructor(e){let i=new h(e);this.api=i,this.thread=new A(i),this.project=new O(i),this.room=new T(i),this.artifact=new E(i),this.wiki=new b(i)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};0&&(module.exports={PromptQLSdk,ROOM_NAME_REGEX,USER_AGENT,buildAuthHeader,cancelAgentMessage,createApolloClient,createRoom,createWikiPage,deleteWikiPage,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,getProjectInfo,getThread,getThreadAndEvents,getThreadEventMessageId,getThreadEvents,getUserCancelEvent,getUserMessageEvent,getWikiPage,isInteractionAnalyzing,listArtifactMetadataByThreadId,listRooms,listThreads,listWikiPages,searchWikiPages,sendThreadMessage,startThread,streamThreadMessageEvents,subscribeThreadEvents,updateWikiPage,validateRoomName});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a as b,c as B}from"./chunk-WIDMKT3J.mjs";var S={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"}}]}}]}}]},P={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"}}]}}]}}]},N={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"}}]}}]}}]},C={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"}}]}}]}}]}}]},U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_add"},arguments:[{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}},{kind:"Argument",name:{kind:"Name",value:"pageId"},value:{kind:"Variable",name:{kind:"Name",value:"pageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_delete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},F={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"}}]}}]}}]}}]},I={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"}}]}}]}}]},q={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"}}]}}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProjectInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_project_info"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectId"}},{kind:"Field",name:{kind:"Name",value:"projectName"}},{kind:"Field",name:{kind:"Name",value:"promptqlConsoleUrl"}}]}}]}}]},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"}}]}}]},R={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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadAndEventsById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsOrdering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],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:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}}},{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:"eventsOrdering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}}]}},{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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},z={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:"id"}},{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}}]}]}}]}}]},Q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWikiPage"},variableDefinitions:[{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:"limit"},value:{kind:"IntValue",value:"1"}},{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:"id"}},{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"}}]}}]}}]},L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_search"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{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:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"results"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"score"}},{kind:"Field",name:{kind:"Name",value:"page"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"aliases"}},{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"stub"}},{kind:"Field",name:{kind:"Name",value:"title"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"ownerId"}},{kind:"Field",name:{kind:"Name",value:"lastUpdatedAt"}}]}}]}}]}}]}}]},K={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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]};async function $(n,e,i,d,r){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/data`,t=await(typeof r=="function"?r:fetch)(a,{method:"GET",headers:d});if(t.status!==200){let ke=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to download artifact: ${ke}`)}return t.body?t.headers.get("Content-Type")?.startsWith("application/json")?t.json():t.text():null}async function J(n,e,i){let d=await n.query({query:F,variables:{threadId:i},fetchPolicy:"no-cache"});return d.data?.artifacts?.length?d.data.artifacts.filter(r=>r.latest_version_object).map(r=>({project_id:e,artifact_id:r.artifact_id,artifact_type:r.latest_version_object.artifact_type,version:r.latest_version_object.version,title:r.latest_version_object.title,description:r.latest_version_object.description??null,user_id:r.latest_version_object.user_id,metadata:r.latest_version_object.artifact_metadata,created_at:r.latest_version_object.created_at,size_bytes:Number.parseInt(r.latest_version_object.size)})):[]}async function H(n,e,i,d,r){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/metadata`,t=await(typeof r=="function"?r:fetch)(a,{method:"GET",headers:d});if(t.status!==200){let l=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to get artifact metadata: ${l}`)}return t.json()}function x(n,e){return n.query({query:w,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.rooms??[])}function Z(n,e){if(!e.name)throw new Error("Room name is required");let i=xe(e.name);if(i)throw new Error(i);return n.mutate({mutation:P,variables:e,fetchPolicy:"no-cache"}).then(d=>{if(!d.data?.create_room?.room_id)throw new Error("expected room_id in response, got null");return d.data?.create_room?.room_id})}var Be=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,X=80,xe=n=>{let e=n.trim();return e.length===0?null:e.length>X?`Room name must be ${X} 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.":Be.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};import{defer as ve,map as he,repeat as Ee,takeWhile as Oe}from"rxjs";function Y(n,e){return n.query({query:R,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2??[])}function ee(n,e){if(!e)throw new Error("threadId is required");return n.query({query:j,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2_by_pk)}function ne(n,e,i){let d=_e(e,i);return n.query({query:G,variables:{id:e,eventsWhere:d.where,eventsLimit:d.limit,eventsOrdering:d.ordering},fetchPolicy:"no-cache"}).then(r=>r.data?.threads_v2_by_pk)}function ie(n,e){if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:C,variables:e}).then(i=>{if(!i.data?.start_thread)throw new Error(i.error?.message||"Failed to start thread");return i.data.start_thread})}function v(n,e,i){return n.query({query:W,variables:_e(e,i),fetchPolicy:"no-cache"}).then(d=>d.data?.thread_events??[])}function de(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:N,variables:e}).then(i=>{if(!i.data?.send_thread_message)throw new Error(i.error?.message||"Failed to send message to thread");return i.data.send_thread_message})}function re(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return n.mutate({mutation:S,variables:e}).then(i=>{if(!i.data?.cancel_agent_message)throw new Error(i.error?.message||"Failed to cancel thread");return i.data.cancel_agent_message.thread_event_id})}function te(n,e,i){if(!e)throw new Error("threadId is required");B(i);let d={thread_id:{_eq:e}};return i&&(d.thread_event_id={_gte:i}),n.subscribe({query:K,variables:{where:d}}).pipe(he(r=>{if(r.error)throw r.error;return r.data?.thread_events??[]}))}function ae(n,e,i){if(!e)throw new Error("threadId is required");let d,r=B(i?.fromEventId),a={eventId:i?.fromEventId?{_gte:r}:void 0,messageId:i?.messageId},_=i?.pollingInterval&&i?.pollingInterval>0?i.pollingInterval:5;return ve(async()=>{let t=d?{messageId:i?.messageId,eventId:{_gt:d}}:a,l=await v(n,e,t);return l.length>0&&(d=l[l.length-1]?.thread_event_id),l}).pipe(Ee({count:i?.timeout&&i.timeout>0?Math.ceil(i.timeout/_):void 0,delay:_*1e3}),Oe(t=>Te(t,i?.skipAnalysis),!0))}function Te(n,e){for(let i=n.length-1;i>=0;i--){let d=n[i];if("UserMessage"in d.event_data)return!0;if(!("AgentMessage"in d.event_data))return!1;let r=d.event_data.AgentMessage.update;if("content"in r&&("interaction_finished"in r.content||e&&"interaction_update"in r.content&&"main_agent"in r.content.interaction_update&&"completed"in r.content.interaction_update.main_agent)||"InteractionFinished"in r||e&&"OrchestratorUpdate"in r&&"GeneratedResponse"in r.OrchestratorUpdate.update)return!1}return!0}function Ae(n){return[{event_data:{_contains:{UserMessage:{message_id:n}}}},{event_data:{_contains:{AgentMessage:{message_id:n}}}},{event_data:{_contains:{UserCancel:{message_id:n}}}}]}var _e=(n,e)=>{if(!n)throw new Error("threadId is required");let i={thread_id:{_eq:n}};return e&&(e.eventId&&(i.thread_event_id=e.eventId),e.messageId&&(i._or=Ae(e.messageId))),{where:i,limit:e?.limit,ordering:e?.ordering||"asc"}};var p=["guide","regular"];async function le(n,e){let i=e.namespace||"regular";if(!p.includes(i))throw new Error(`Invalid namespace. Expected one of: ${p}`);if(i==="guide"){let _={deleted_at:{_is_null:!0}};return e.project_id&&(_.project_id={_eq:e.project_id}),e.query&&(_.page_title={_ilike:e.query.toLowerCase()}),Se(n,{where:_,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="slug"?"id":e.order_by]:e.ordering||"asc"}:void 0})}let d=e.project_id||!e.include_stub||e.namespace||e.query,r={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?e.order_by==="slug"?"page_id":e.order_by:"page_id"]:e.ordering||"asc"}:void 0};d||(r.offset=e.offset,r.limit=e.limit);let a=await be(n,r);return d?Ce(a,e):a}async function oe(n,e){if(!e.query)throw new Error("query is required");return n.query({query:L,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_search?{totalCount:i.data.admin_wiki_search.totalCount,results:i.data?.admin_wiki_search.results.map(({score:d,metadata:r,page:{id:a,..._}})=>({..._,score:d,stable_id:r.id,slug:a,created_at:r.createdAt,last_modified_at:r.lastUpdatedAt}))}:{totalCount:0,results:[]})}async function ue(n,e,i,d){if(i=i||"regular",!p.includes(i))throw new Error(`Invalid namespace. Expected one of: ${p}`);if(!e)throw new Error("projectId is required");if(!d)throw new Error("identifier is required");if(i==="guide")return Ne(n,{project_id:e,page_id:d});let r={project_id:{_eq:e},deleted_at:{_is_null:!0}};return b.test(d)?r.id={_eq:d}:r.page_id={_eq:d},Pe(n,{where:r})}function se(n,{slug:e,...i}){if(!i.title)throw new Error("Wiki title is required");if(!i.stub&&!i.definition)throw new Error("Wiki definition is required");return n.mutate({mutation:U,variables:{pageId:e,pageContent:i},fetchPolicy:"no-cache"}).then(d=>d.data?.admin_wiki_add?.id)}function pe(n,e,i){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:V,variables:{id:e,pageContent:i},fetchPolicy:"no-cache"}).then(d=>d.data?.admin_wiki_update?.buildVersion)}function me(n,e){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:M,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_delete?.buildVersion)}function be(n,e){return n.query({query:z,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki.map(({page_id:d,id:r,...a})=>({...a,stable_id:r,slug:d}))??[])}function Se(n,e){return n.query({query:I,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_guide_page?.map(d=>({stable_id:d.id,slug:d.id,created_at:d.created_at,last_modified_at:d.last_modified_at,title:d.page_title}))??[])}async function Pe(n,e){let i=await n.query({query:Q,variables:e,fetchPolicy:"no-cache"}).then(d=>d.data?.admin_wiki.map(r=>({stable_id:r.id,slug:r.page_id,created_at:r.created_at,last_modified_at:r.last_modified_at,...r.content}))??[]);return i.length?i[0]:null}async function Ne(n,e){let i=await n.query({query:q,variables:e,fetchPolicy:"no-cache"}).then(d=>d.data?.admin_guide_page?.map(r=>({stable_id:r.id,slug:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title,details:r.details}))??[]);return i.length?i[0]:null}function Ce(n,e){if(!n.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return n;let i=e.query?.toLowerCase(),d=n.filter(r=>!e.include_stub&&r.stub?!1:!!(!i||r.title.toLowerCase().includes(i)||r.definition&&r.definition.toLowerCase().includes(i)||r.aliases?.length&&r.aliases.some(a=>a.toLowerCase().includes(i))));return e.offset&&d.length&&(d=d.slice(e.offset)),e.limit&&e.limit<d.length&&(d=d.slice(0,e.limit)),d}import{ApolloClient as Ue,ApolloLink as Ve,HttpLink as Me,InMemoryCache as Fe}from"@apollo/client";import{SetContextLink as Ie}from"@apollo/client/link/context";import{GraphQLWsLink as qe}from"@apollo/client/link/subscriptions";import{OperationTypeNode as De}from"graphql";import{createClient as we}from"graphql-ws";var fe=n=>{let e=new Me({uri:n.url,fetch:n.fetch,headers:typeof n.headers=="object"?n.headers:void 0}),i=async _=>{let t=typeof n.headers=="object"?n.headers:await n.headers();return{headers:{..._,...t}}},d=we({url:n.url,connectionParams:()=>i(),lazy:!0}),r=new qe(d),a=Ve.split(({operationType:_})=>_===De.SUBSCRIPTION,r,typeof n.headers=="object"?e:new Ie(({headers:_})=>i(_)).concat(e));return{client:new Ue({link:a,cache:new Fe}),wsClient:d}};var ce="PromptQL TypeScript SDK";function ti(n,e){if(!e.length)return[];if(!n.length)return e;let i=n[n.length-1];if(!i)return e;let d=BigInt(i.thread_event_id),r=e.length-1;for(;r>=0;r--){let a=e[r];if(BigInt(a?.thread_event_id)<=d)break}return e.slice(r+1)}function ai(n){return"UserMessage"in n?n.UserMessage:null}function _i(n){return"UserCancel"in n?n.UserCancel:null}function li(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)||!("PlanGenerationStarted"in n.AgentMessage.update.OrchestratorUpdate.update)?null:n.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function oi(n){let e=E(n);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function ui(n){return"AgentMessage"in n?"content"in n.AgentMessage.update&&"interaction_update"in n.AgentMessage.update.content&&"main_agent"in n.AgentMessage.update.content.interaction_update&&"completed"in n.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:n.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:n.AgentMessage.update.timestamp,messageId:n.AgentMessage.message_id}:!("OrchestratorUpdate"in n.AgentMessage.update)||!("GeneratedResponse"in n.AgentMessage.update.OrchestratorUpdate.update)?null:{...n.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:n.AgentMessage.message_id}:null}function si(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("ProcessingStarted"in n.AgentMessage.update.MessageProcessingUpdate.update)?null:n.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function pi(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function mi(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function h(n){return!("AgentMessage"in n)||!("PlanningDecisionUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.PlanningDecisionUpdate.update}function fi(n){let e=h(n);return!e||!("Started"in e)?null:e.Started}function ci(n){let e=h(n);return!e||!("Completed"in e)?null:e.Completed}function yi(n){let e=h(n);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function gi(n){return!("AgentMessage"in n)||!("StartingOrchestrator"in n.AgentMessage.update)?null:n.AgentMessage.update.StartingOrchestrator}function E(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.OrchestratorUpdate.update}function u(n){let e=E(n);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function ki(n){let e=u(n);return!e||!("Started"in e)?null:e.Started}function Bi(n){let e=u(n);return!e||!("Completed"in e)?null:e.Completed}function O(n){let e=u(n);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function xi(n){let e=O(n);return!e||!("Started"in e)?null:e.Started}function vi(n){let e=O(n);return!e||!("Completed"in e)?null:e.Completed}function hi(n){let e=O(n);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function T(n){let e=u(n);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function Ei(n){let e=T(n);return!e||!("Started"in e)?null:e.Started}function Oi(n){let e=T(n);return!e||!("Completed"in e)?null:e.Completed}function Ti(n){let e=T(n);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function o(n){let e=u(n);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function Ai(n){let e=o(n);return!e||!("Started"in e)?null:e.Started}function bi(n){let e=o(n);return!e||!("Completed"in e)?null:e.Completed}function Si(n){let e=o(n);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function Pi(n){let e=o(n);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function Ni(n){let e=o(n);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function Ci(n){let e=o(n);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function A(n){let e=E(n);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function Ui(n){let e=A(n);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function Vi(n){let e=A(n);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function Mi(n){let e=A(n);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function Fi(n){if(!("AgentMessage"in n))return null;if("InteractionFinished"in n.AgentMessage.update){let e=n.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:n.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:n.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:n.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:n.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:n.AgentMessage.message_id}:{status:"unknown",messageId:n.AgentMessage.message_id}}if("content"in n.AgentMessage.update&&"interaction_finished"in n.AgentMessage.update.content){let e=n.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:n.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:n.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:n.AgentMessage.message_id}}return null}function Ii(n){if(n){if("UserMessage"in n)return n.UserMessage.message_id;if("AgentMessage"in n)return n.AgentMessage.message_id;if("UserTeach"in n)return n.UserTeach.agent_message_id;if("UserCancel"in n)return n.UserCancel.message_id}}function s(n){return{Authorization:`pat ${n}`,"User-Agent":ce}}var ye="https://promptql.ddn.hasura.app",m=class{options;defaultTimezone;client;wsClient;project;constructor(e){if(this.options=e,!e.accessToken)throw new Error("accessToken is required");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let i=new URL(this.options.baseUrl||ye);i.pathname="/playground-v2-hge/v1/graphql";let{client:d,wsClient:r}=fe({url:i.toString(),fetch:this.options.fetch,headers:Object.assign(s(this.options.accessToken),this.options.headers)});this.wsClient=r,this.client=d}async getProjectInfo(){if(this.project)return this.project;let i=(await this.client.query({query:D,fetchPolicy:"no-cache"})).data?.get_project_info;if(!i)throw new Error("Project not found");let d=new URL(this.options.baseUrl||ye);return d.hostname.startsWith("promptql.")&&(d.hostname=`${i.projectName}${d.hostname.slice(8)}`),this.project={projectId:i.projectId,projectName:i.projectName,projectHost:d.toString(),promptqlConsoleUrl:`https://prompt.ql.app/project/${i.projectName}`},this.project}close(){if(this.wsClient&&this.wsClient.dispose(),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.project=void 0}}};var f=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let i=await this.api.getProjectInfo();return J(this.api.client,i.projectId,e)}async download(e,i){let d=await this.api.getProjectInfo();return $(d.projectHost,e,i,s(this.api.options.accessToken),this.api.options.fetch)}async getMetadata(e,i){let d=await this.api.getProjectInfo();return H(d.projectHost,e,i,s(this.api.options.accessToken),this.api.options.fetch)}};var c=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var y=class{api;constructor(e){this.api=e}async list(e){return x(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){return x(this.api.client,{where:{name:{_eq:e}},limit:1}).then(i=>i.length?i[0]??null:null)}async create(e){return Z(this.api.client,e)}};var g=class{api;constructor(e){this.api=e}async list(e){return Y(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");return ee(this.api.client,e)}async start(e){let i=await this.api.getProjectInfo();return ie(this.api.client,{...e,projectId:i.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async detail(e,i){return ne(this.api.client,e,i)}async getEvents(e,i){return v(this.api.client,e,i)}async sendMessage(e){return de(this.api.client,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){return re(this.api.client,e)}subscribeEvents(e,i){return te(this.api.client,e,i)}streamMessageEvents(e,i){return ae(this.api.client,e,i)}};var k=class{api;constructor(e){this.api=e}async list(e){return le(this.api.client,e)}async search(e){return oe(this.api.client,e)}async get(e,i){let d=await this.api.getProjectInfo();return ue(this.api.client,d.projectId,e,i)}async create(e){return se(this.api.client,e)}async update(e,i){return pe(this.api.client,e,i)}async delete(e){return me(this.api.client,e)}};var ge=class{constructor(e){let i=new m(e);this.api=i,this.thread=new g(i),this.project=new c(i),this.room=new y(i),this.artifact=new f(i),this.wiki=new k(i)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};export{ge as PromptQLSdk,Be as ROOM_NAME_REGEX,ce as USER_AGENT,s as buildAuthHeader,re as cancelAgentMessage,fe as createApolloClient,Z as createRoom,se as createWikiPage,me as deleteWikiPage,ti as diffThreadEvents,$ as downloadArtifactData,ui as getAgentGeneratedResponse,pi as getAgentInteractionDecisionAcceptInteractionEvent,mi as getAgentInteractionDecisionDeclineInteractionEvent,Fi as getAgentInteractionFinishedEvent,si as getAgentMessageProcessingStartedEvent,Bi as getAgentOrchestratorContextExplorerCompletedEvent,ki as getAgentOrchestratorContextExplorerStartedEvent,u as getAgentOrchestratorContextExplorerUpdateEvent,Si as getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,Pi as getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,bi as getAgentOrchestratorSchemaExplorerCompletedEvent,Ni as getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,Ci as getAgentOrchestratorSchemaExplorerSchemaExploredEvent,Ai as getAgentOrchestratorSchemaExplorerStartedEvent,o as getAgentOrchestratorSchemaExplorerUpdateEvent,Ti as getAgentOrchestratorSchemaTasksGeneratedEvent,Oi as getAgentOrchestratorSchemaTasksGenerationCompletedEvent,Ei as getAgentOrchestratorSchemaTasksGenerationStartedEvent,T as getAgentOrchestratorSchemaTasksGenerationUpdateEvent,Ui as getAgentOrchestratorStepProgrammerEvent,Mi as getAgentOrchestratorStepSavedProgramRunnerEvent,Vi as getAgentOrchestratorStepUiProgrammerEvent,A as getAgentOrchestratorStepUpdateEvent,E as getAgentOrchestratorUpdateEvent,vi as getAgentOrchestratorWikiExplorerCompletedEvent,xi as getAgentOrchestratorWikiExplorerStartedEvent,O as getAgentOrchestratorWikiExplorerUpdateEvent,hi as getAgentOrchestratorWikiInfoGeneratedEvent,li as getAgentPlanGenerationStartedEvent,oi as getAgentPlanStepGeneratedEvent,ci as getAgentPlanningDecisionCompletedEvent,yi as getAgentPlanningDecisionPlanningRequiredEvent,fi as getAgentPlanningDecisionStartedEvent,h as getAgentPlanningDecisionUpdateEvent,gi as getAgentStartingOrchestratorEvent,H as getArtifactMetadata,ee as getThread,ne as getThreadAndEvents,Ii as getThreadEventMessageId,v as getThreadEvents,_i as getUserCancelEvent,ai as getUserMessageEvent,ue as getWikiPage,Te as isInteractionAnalyzing,J as listArtifactMetadataByThreadId,x as listRooms,Y as listThreads,le as listWikiPages,oe as searchWikiPages,de as sendThreadMessage,ie as startThread,ae as streamThreadMessageEvents,te as subscribeThreadEvents,pe as updateWikiPage,xe as validateRoomName};
1
+ import{a as b,c as B}from"./chunk-WIDMKT3J.mjs";var S={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"}}]}}]}}]},P={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"}}]}}]}}]},C={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"}}]}}]}}]},N={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"}}]}}]}}]}}]},U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_add"},arguments:[{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}},{kind:"Argument",name:{kind:"Name",value:"pageId"},value:{kind:"Variable",name:{kind:"Name",value:"pageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_delete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},F={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"}}]}}]}}]}}]},I={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"}}]}}]}}]},q={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"}}]}}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProjectInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_project_info"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectId"}},{kind:"Field",name:{kind:"Name",value:"projectName"}},{kind:"Field",name:{kind:"Name",value:"promptqlConsoleUrl"}}]}}]}}]},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"}}]}}]},R={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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadAndEventsById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsOrdering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],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:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}}},{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:"eventsOrdering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}}]}},{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:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},z={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:"id"}},{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}}]}]}}]}}]},Q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWikiPage"},variableDefinitions:[{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:"limit"},value:{kind:"IntValue",value:"1"}},{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:"id"}},{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"}}]}}]}}]},L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_search"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{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:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"results"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"score"}},{kind:"Field",name:{kind:"Name",value:"page"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"aliases"}},{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"stub"}},{kind:"Field",name:{kind:"Name",value:"title"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"ownerId"}},{kind:"Field",name:{kind:"Name",value:"lastUpdatedAt"}}]}}]}}]}}]}}]},K={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"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]};async function $(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/data`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let Be=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to download artifact: ${Be}`)}return t.body?t.headers.get("Content-Type")?.startsWith("application/json")?t.json():t.text():null}async function J(n,e,i){let r=await n.query({query:F,variables:{threadId:i},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(d=>d.latest_version_object).map(d=>({project_id:e,artifact_id:d.artifact_id,artifact_type:d.latest_version_object.artifact_type,version:d.latest_version_object.version,title:d.latest_version_object.title,description:d.latest_version_object.description??null,user_id:d.latest_version_object.user_id,metadata:d.latest_version_object.artifact_metadata,created_at:d.latest_version_object.created_at,size_bytes:Number.parseInt(d.latest_version_object.size)})):[]}async function H(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/metadata`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let l=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to get artifact metadata: ${l}`)}return t.json()}async function X(n){return(await n.query({query:D,fetchPolicy:"no-cache"})).data?.get_project_info}function x(n,e){return n.query({query:w,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.rooms??[])}function Y(n,e){if(!e.name)throw new Error("Room name is required");let i=ve(e.name);if(i)throw new Error(i);return n.mutate({mutation:P,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 xe=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,Z=80,ve=n=>{let e=n.trim();return e.length===0?null:e.length>Z?`Room name must be ${Z} 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.":xe.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};import{defer as he,map as Ee,repeat as Oe,takeWhile as Te}from"rxjs";function ee(n,e){return n.query({query:R,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2??[])}function ne(n,e){if(!e)throw new Error("threadId is required");return n.query({query:j,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2_by_pk)}function ie(n,e,i){let r=le(e,i);return n.query({query:G,variables:{id:e,eventsWhere:r.where,eventsLimit:r.limit,eventsOrdering:r.ordering},fetchPolicy:"no-cache"}).then(d=>d.data?.threads_v2_by_pk)}function de(n,e){if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:N,variables:e}).then(i=>{if(!i.data?.start_thread)throw new Error(i.error?.message||"Failed to start thread");return i.data.start_thread})}function v(n,e,i){return n.query({query:W,variables:le(e,i),fetchPolicy:"no-cache"}).then(r=>r.data?.thread_events??[])}function re(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:C,variables:e}).then(i=>{if(!i.data?.send_thread_message)throw new Error(i.error?.message||"Failed to send message to thread");return i.data.send_thread_message})}function te(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return n.mutate({mutation:S,variables:e}).then(i=>{if(!i.data?.cancel_agent_message)throw new Error(i.error?.message||"Failed to cancel thread");return i.data.cancel_agent_message.thread_event_id})}function ae(n,e,i){if(!e)throw new Error("threadId is required");B(i);let r={thread_id:{_eq:e}};return i&&(r.thread_event_id={_gte:i}),n.subscribe({query:K,variables:{where:r}}).pipe(Ee(d=>{if(d.error)throw d.error;return d.data?.thread_events??[]}))}function _e(n,e,i){if(!e)throw new Error("threadId is required");let r,d=B(i?.fromEventId),a={eventId:i?.fromEventId?{_gte:d}:void 0,messageId:i?.messageId},_=i?.pollingInterval&&i?.pollingInterval>0?i.pollingInterval:5;return he(async()=>{let t=r?{messageId:i?.messageId,eventId:{_gt:r}}:a,l=await v(n,e,t);return l.length>0&&(r=l[l.length-1]?.thread_event_id),l}).pipe(Oe({count:i?.timeout&&i.timeout>0?Math.ceil(i.timeout/_):void 0,delay:_*1e3}),Te(t=>Ae(t,i?.skipAnalysis),!0))}function Ae(n,e){for(let i=n.length-1;i>=0;i--){let r=n[i];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let d=r.event_data.AgentMessage.update;if("content"in d&&("interaction_finished"in d.content||e&&"interaction_update"in d.content&&"main_agent"in d.content.interaction_update&&"completed"in d.content.interaction_update.main_agent)||"InteractionFinished"in d||e&&"OrchestratorUpdate"in d&&"GeneratedResponse"in d.OrchestratorUpdate.update)return!1}return!0}function be(n){return[{event_data:{_contains:{UserMessage:{message_id:n}}}},{event_data:{_contains:{AgentMessage:{message_id:n}}}},{event_data:{_contains:{UserCancel:{message_id:n}}}}]}var le=(n,e)=>{if(!n)throw new Error("threadId is required");let i={thread_id:{_eq:n}};return e&&(e.eventId&&(i.thread_event_id=e.eventId),e.messageId&&(i._or=be(e.messageId))),{where:i,limit:e?.limit,ordering:e?.ordering||"asc"}};var p=["guide","regular"];async function oe(n,e){let i=e.namespace||"regular";if(!p.includes(i))throw new Error(`Invalid namespace. Expected one of: ${p}`);if(i==="guide"){let _={deleted_at:{_is_null:!0}};return e.project_id&&(_.project_id={_eq:e.project_id}),e.query&&(_.page_title={_ilike:e.query.toLowerCase()}),Pe(n,{where:_,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="slug"?"id":e.order_by]:e.ordering||"asc"}:void 0})}let r=e.project_id||!e.include_stub||e.namespace||e.query,d={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?e.order_by==="slug"?"page_id":e.order_by:"page_id"]:e.ordering||"asc"}:void 0};r||(d.offset=e.offset,d.limit=e.limit);let a=await Se(n,d);return r?Ue(a,e):a}async function ue(n,e){if(!e.query)throw new Error("query is required");return n.query({query:L,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_search?{totalCount:i.data.admin_wiki_search.totalCount,results:i.data?.admin_wiki_search.results.map(({score:r,metadata:d,page:{id:a,..._}})=>({..._,score:r,stable_id:d.id,slug:a,created_at:d.createdAt,last_modified_at:d.lastUpdatedAt}))}:{totalCount:0,results:[]})}async function se(n,e,i,r){if(i=i||"regular",!p.includes(i))throw new Error(`Invalid namespace. Expected one of: ${p}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(i==="guide")return Ne(n,{project_id:e,page_id:r});let d={project_id:{_eq:e},deleted_at:{_is_null:!0}};return b.test(r)?d.id={_eq:r}:d.page_id={_eq:r},Ce(n,{where:d})}function pe(n,{slug:e,...i}){if(!i.title)throw new Error("Wiki title is required");if(!i.stub&&!i.definition)throw new Error("Wiki definition is required");return n.mutate({mutation:U,variables:{pageId:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function me(n,e,i){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:V,variables:{id:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function fe(n,e){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:M,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_delete?.buildVersion)}function Se(n,e){return n.query({query:z,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki.map(({page_id:r,id:d,...a})=>({...a,stable_id:d,slug:r}))??[])}function Pe(n,e){return n.query({query:I,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_guide_page?.map(r=>({stable_id:r.id,slug:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function Ce(n,e){let i=await n.query({query:Q,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(d=>({stable_id:d.id,slug:d.page_id,created_at:d.created_at,last_modified_at:d.last_modified_at,...d.content}))??[]);return i.length?i[0]:null}async function Ne(n,e){let i=await n.query({query:q,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(d=>({stable_id:d.id,slug:d.id,created_at:d.created_at,last_modified_at:d.last_modified_at,title:d.page_title,details:d.details}))??[]);return i.length?i[0]:null}function Ue(n,e){if(!n.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return n;let i=e.query?.toLowerCase(),r=n.filter(d=>!e.include_stub&&d.stub?!1:!!(!i||d.title.toLowerCase().includes(i)||d.definition&&d.definition.toLowerCase().includes(i)||d.aliases?.length&&d.aliases.some(a=>a.toLowerCase().includes(i))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}import{ApolloClient as Ve,ApolloLink as Me,HttpLink as Fe,InMemoryCache as Ie}from"@apollo/client";import{SetContextLink as qe}from"@apollo/client/link/context";import{GraphQLWsLink as De}from"@apollo/client/link/subscriptions";import{OperationTypeNode as we}from"graphql";import{createClient as Re}from"graphql-ws";var ce=n=>{let e=new Fe({uri:n.url,fetch:n.fetch,headers:typeof n.headers=="object"?n.headers:void 0}),i=async _=>{let t=typeof n.headers=="object"?n.headers:await n.headers();return{headers:{..._,...t}}},r=Re({url:n.url,connectionParams:()=>i(),lazy:!0}),d=new De(r),a=Me.split(({operationType:_})=>_===we.SUBSCRIPTION,d,typeof n.headers=="object"?e:new qe(({headers:_})=>i(_)).concat(e));return{client:new Ve({link:a,cache:new Ie}),wsClient:r}};var ye="PromptQL TypeScript SDK";function ui(n,e){if(!e.length)return[];if(!n.length)return e;let i=n[n.length-1];if(!i)return e;let r=BigInt(i.thread_event_id),d=e.length-1;for(;d>=0;d--){let a=e[d];if(BigInt(a?.thread_event_id)<=r)break}return e.slice(d+1)}function si(n){return"UserMessage"in n?n.UserMessage:null}function pi(n){return"UserCancel"in n?n.UserCancel:null}function mi(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)||!("PlanGenerationStarted"in n.AgentMessage.update.OrchestratorUpdate.update)?null:n.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function fi(n){let e=E(n);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function ci(n){return"AgentMessage"in n?"content"in n.AgentMessage.update&&"interaction_update"in n.AgentMessage.update.content&&"main_agent"in n.AgentMessage.update.content.interaction_update&&"completed"in n.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:n.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:n.AgentMessage.update.timestamp,messageId:n.AgentMessage.message_id}:!("OrchestratorUpdate"in n.AgentMessage.update)||!("GeneratedResponse"in n.AgentMessage.update.OrchestratorUpdate.update)?null:{...n.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:n.AgentMessage.message_id}:null}function yi(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("ProcessingStarted"in n.AgentMessage.update.MessageProcessingUpdate.update)?null:n.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function gi(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function ki(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function h(n){return!("AgentMessage"in n)||!("PlanningDecisionUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.PlanningDecisionUpdate.update}function Bi(n){let e=h(n);return!e||!("Started"in e)?null:e.Started}function xi(n){let e=h(n);return!e||!("Completed"in e)?null:e.Completed}function vi(n){let e=h(n);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function hi(n){return!("AgentMessage"in n)||!("StartingOrchestrator"in n.AgentMessage.update)?null:n.AgentMessage.update.StartingOrchestrator}function E(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.OrchestratorUpdate.update}function u(n){let e=E(n);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function Ei(n){let e=u(n);return!e||!("Started"in e)?null:e.Started}function Oi(n){let e=u(n);return!e||!("Completed"in e)?null:e.Completed}function O(n){let e=u(n);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function Ti(n){let e=O(n);return!e||!("Started"in e)?null:e.Started}function Ai(n){let e=O(n);return!e||!("Completed"in e)?null:e.Completed}function bi(n){let e=O(n);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function T(n){let e=u(n);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function Si(n){let e=T(n);return!e||!("Started"in e)?null:e.Started}function Pi(n){let e=T(n);return!e||!("Completed"in e)?null:e.Completed}function Ci(n){let e=T(n);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function o(n){let e=u(n);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function Ni(n){let e=o(n);return!e||!("Started"in e)?null:e.Started}function Ui(n){let e=o(n);return!e||!("Completed"in e)?null:e.Completed}function Vi(n){let e=o(n);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function Mi(n){let e=o(n);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function Fi(n){let e=o(n);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function Ii(n){let e=o(n);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function A(n){let e=E(n);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function qi(n){let e=A(n);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function Di(n){let e=A(n);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function wi(n){let e=A(n);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function Ri(n){if(!("AgentMessage"in n))return null;if("InteractionFinished"in n.AgentMessage.update){let e=n.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:n.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:n.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:n.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:n.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:n.AgentMessage.message_id}:{status:"unknown",messageId:n.AgentMessage.message_id}}if("content"in n.AgentMessage.update&&"interaction_finished"in n.AgentMessage.update.content){let e=n.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:n.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:n.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:n.AgentMessage.message_id}}return null}function ji(n){if(n){if("UserMessage"in n)return n.UserMessage.message_id;if("AgentMessage"in n)return n.AgentMessage.message_id;if("UserTeach"in n)return n.UserTeach.agent_message_id;if("UserCancel"in n)return n.UserCancel.message_id}}function s(n){return{Authorization:`pat ${n}`,"User-Agent":ye}}var ge="https://promptql.ddn.hasura.app",m=class{options;defaultTimezone;client;wsClient;project;constructor(e){if(this.options=e,!e.accessToken)throw new Error("accessToken is required");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let i=new URL(this.options.baseUrl||ge);i.pathname="/playground-v2-hge/v1/graphql";let{client:r,wsClient:d}=ce({url:i.toString(),fetch:this.options.fetch,headers:Object.assign(s(this.options.accessToken),this.options.headers)});this.wsClient=d,this.client=r}async getProjectInfo(){if(this.project)return this.project;let e=await X(this.client);if(!e)throw new Error("Project not found");let i=new URL(this.options.baseUrl||ge);return i.hostname.startsWith("promptql.")&&(i.hostname=`${e.projectName}${i.hostname.slice(8)}`),this.project={projectId:e.projectId,projectName:e.projectName,projectHost:i.toString(),promptqlConsoleUrl:e.promptqlConsoleUrl},this.project}close(){if(this.wsClient&&this.wsClient.dispose(),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.project=void 0}}};var f=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let i=await this.api.getProjectInfo();return J(this.api.client,i.projectId,e)}async download(e,i){let r=await this.api.getProjectInfo();return $(r.projectHost,e,i,s(this.api.options.accessToken),this.api.options.fetch)}async getMetadata(e,i){let r=await this.api.getProjectInfo();return H(r.projectHost,e,i,s(this.api.options.accessToken),this.api.options.fetch)}};var c=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var y=class{api;constructor(e){this.api=e}async list(e){return x(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){return x(this.api.client,{where:{name:{_eq:e}},limit:1}).then(i=>i.length?i[0]??null:null)}async create(e){return Y(this.api.client,e)}};var g=class{api;constructor(e){this.api=e}async list(e){return ee(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");return ne(this.api.client,e)}async start(e){let i=await this.api.getProjectInfo();return de(this.api.client,{...e,projectId:i.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async detail(e,i){return ie(this.api.client,e,i)}async getEvents(e,i){return v(this.api.client,e,i)}async sendMessage(e){return re(this.api.client,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){return te(this.api.client,e)}subscribeEvents(e,i){return ae(this.api.client,e,i)}streamMessageEvents(e,i){return _e(this.api.client,e,i)}};var k=class{api;constructor(e){this.api=e}async list(e){return oe(this.api.client,e)}async search(e){return ue(this.api.client,e)}async get(e,i){let r=await this.api.getProjectInfo();return se(this.api.client,r.projectId,e,i)}async create(e){return pe(this.api.client,e)}async update(e,i){return me(this.api.client,e,i)}async delete(e){return fe(this.api.client,e)}};var ke=class{constructor(e){let i=new m(e);this.api=i,this.thread=new g(i),this.project=new c(i),this.room=new y(i),this.artifact=new f(i),this.wiki=new k(i)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};export{ke as PromptQLSdk,xe as ROOM_NAME_REGEX,ye as USER_AGENT,s as buildAuthHeader,te as cancelAgentMessage,ce as createApolloClient,Y as createRoom,pe as createWikiPage,fe as deleteWikiPage,ui as diffThreadEvents,$ as downloadArtifactData,ci as getAgentGeneratedResponse,gi as getAgentInteractionDecisionAcceptInteractionEvent,ki as getAgentInteractionDecisionDeclineInteractionEvent,Ri as getAgentInteractionFinishedEvent,yi as getAgentMessageProcessingStartedEvent,Oi as getAgentOrchestratorContextExplorerCompletedEvent,Ei as getAgentOrchestratorContextExplorerStartedEvent,u as getAgentOrchestratorContextExplorerUpdateEvent,Vi as getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,Mi as getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,Ui as getAgentOrchestratorSchemaExplorerCompletedEvent,Fi as getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,Ii as getAgentOrchestratorSchemaExplorerSchemaExploredEvent,Ni as getAgentOrchestratorSchemaExplorerStartedEvent,o as getAgentOrchestratorSchemaExplorerUpdateEvent,Ci as getAgentOrchestratorSchemaTasksGeneratedEvent,Pi as getAgentOrchestratorSchemaTasksGenerationCompletedEvent,Si as getAgentOrchestratorSchemaTasksGenerationStartedEvent,T as getAgentOrchestratorSchemaTasksGenerationUpdateEvent,qi as getAgentOrchestratorStepProgrammerEvent,wi as getAgentOrchestratorStepSavedProgramRunnerEvent,Di as getAgentOrchestratorStepUiProgrammerEvent,A as getAgentOrchestratorStepUpdateEvent,E as getAgentOrchestratorUpdateEvent,Ai as getAgentOrchestratorWikiExplorerCompletedEvent,Ti as getAgentOrchestratorWikiExplorerStartedEvent,O as getAgentOrchestratorWikiExplorerUpdateEvent,bi as getAgentOrchestratorWikiInfoGeneratedEvent,mi as getAgentPlanGenerationStartedEvent,fi as getAgentPlanStepGeneratedEvent,xi as getAgentPlanningDecisionCompletedEvent,vi as getAgentPlanningDecisionPlanningRequiredEvent,Bi as getAgentPlanningDecisionStartedEvent,h as getAgentPlanningDecisionUpdateEvent,hi as getAgentStartingOrchestratorEvent,H as getArtifactMetadata,X as getProjectInfo,ne as getThread,ie as getThreadAndEvents,ji as getThreadEventMessageId,v as getThreadEvents,pi as getUserCancelEvent,si as getUserMessageEvent,se as getWikiPage,Ae as isInteractionAnalyzing,J as listArtifactMetadataByThreadId,x as listRooms,ee as listThreads,oe as listWikiPages,ue as searchWikiPages,re as sendThreadMessage,de as startThread,_e as streamThreadMessageEvents,ae as subscribeThreadEvents,me as updateWikiPage,ve 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.39",
4
+ "version": "2.0.0-alpha.40",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Hasura",
7
7
  "homepage": "https://promptql.hasura.io",