@hasura/promptql 2.0.0-alpha.36 → 2.0.0-alpha.37
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/auth/index.d.mts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/{graphql-Drrif9Kc.d.mts → graphql-Bv72OcvQ.d.mts} +1 -28
- package/dist/{graphql-Drrif9Kc.d.ts → graphql-Bv72OcvQ.d.ts} +1 -28
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/auth/index.d.mts
CHANGED
package/dist/auth/index.d.ts
CHANGED
|
@@ -2778,32 +2778,5 @@ type SearchWikiPagesQueryVariables = Exact<{
|
|
|
2778
2778
|
offset?: InputMaybe<Scalars['Int']['input']>;
|
|
2779
2779
|
limit?: InputMaybe<Scalars['Int']['input']>;
|
|
2780
2780
|
}>;
|
|
2781
|
-
type SearchWikiPagesQuery = {
|
|
2782
|
-
__typename?: 'query_root';
|
|
2783
|
-
admin_wiki_search: {
|
|
2784
|
-
__typename?: 'AdminWikiSearchOutput';
|
|
2785
|
-
totalCount: number;
|
|
2786
|
-
results: Array<{
|
|
2787
|
-
__typename?: 'AdminWikiSearchResultItem';
|
|
2788
|
-
score: number;
|
|
2789
|
-
page: {
|
|
2790
|
-
__typename?: 'AdminWikiSearchPage';
|
|
2791
|
-
aliases: Array<string>;
|
|
2792
|
-
definition?: string | null;
|
|
2793
|
-
id: string;
|
|
2794
|
-
namespace?: string | null;
|
|
2795
|
-
stub?: boolean | null;
|
|
2796
|
-
title: string;
|
|
2797
|
-
};
|
|
2798
|
-
metadata: {
|
|
2799
|
-
__typename?: 'AdminWikiSearchMetadata';
|
|
2800
|
-
id?: string | null;
|
|
2801
|
-
createdAt?: string | null;
|
|
2802
|
-
ownerId?: string | null;
|
|
2803
|
-
lastUpdatedAt?: string | null;
|
|
2804
|
-
};
|
|
2805
|
-
}>;
|
|
2806
|
-
};
|
|
2807
|
-
};
|
|
2808
2781
|
|
|
2809
|
-
export type { Bigint_Comparison_Exp as B, CreateRoomMutationVariables as C, EnrichTokenOutput as E, GetRoomsQueryVariables as G, Order_By as O, RoomFragment as R, StartThreadMutation as S, ThreadEventFragment as T, SendThreadMessageMutation as a, CancelAgentMessageMutationVariables as b, ThreadFragment as c, GetThreadsQueryVariables as d, SendThreadMessageMutationVariables as e, StartThreadMutationVariables as f,
|
|
2782
|
+
export type { Bigint_Comparison_Exp as B, CreateRoomMutationVariables as C, EnrichTokenOutput as E, GetRoomsQueryVariables as G, Order_By as O, RoomFragment as R, StartThreadMutation as S, ThreadEventFragment as T, SendThreadMessageMutation as a, CancelAgentMessageMutationVariables as b, ThreadFragment as c, GetThreadsQueryVariables as d, SendThreadMessageMutationVariables as e, StartThreadMutationVariables as f, SearchWikiPagesQueryVariables as g };
|
|
@@ -2778,32 +2778,5 @@ type SearchWikiPagesQueryVariables = Exact<{
|
|
|
2778
2778
|
offset?: InputMaybe<Scalars['Int']['input']>;
|
|
2779
2779
|
limit?: InputMaybe<Scalars['Int']['input']>;
|
|
2780
2780
|
}>;
|
|
2781
|
-
type SearchWikiPagesQuery = {
|
|
2782
|
-
__typename?: 'query_root';
|
|
2783
|
-
admin_wiki_search: {
|
|
2784
|
-
__typename?: 'AdminWikiSearchOutput';
|
|
2785
|
-
totalCount: number;
|
|
2786
|
-
results: Array<{
|
|
2787
|
-
__typename?: 'AdminWikiSearchResultItem';
|
|
2788
|
-
score: number;
|
|
2789
|
-
page: {
|
|
2790
|
-
__typename?: 'AdminWikiSearchPage';
|
|
2791
|
-
aliases: Array<string>;
|
|
2792
|
-
definition?: string | null;
|
|
2793
|
-
id: string;
|
|
2794
|
-
namespace?: string | null;
|
|
2795
|
-
stub?: boolean | null;
|
|
2796
|
-
title: string;
|
|
2797
|
-
};
|
|
2798
|
-
metadata: {
|
|
2799
|
-
__typename?: 'AdminWikiSearchMetadata';
|
|
2800
|
-
id?: string | null;
|
|
2801
|
-
createdAt?: string | null;
|
|
2802
|
-
ownerId?: string | null;
|
|
2803
|
-
lastUpdatedAt?: string | null;
|
|
2804
|
-
};
|
|
2805
|
-
}>;
|
|
2806
|
-
};
|
|
2807
|
-
};
|
|
2808
2781
|
|
|
2809
|
-
export type { Bigint_Comparison_Exp as B, CreateRoomMutationVariables as C, EnrichTokenOutput as E, GetRoomsQueryVariables as G, Order_By as O, RoomFragment as R, StartThreadMutation as S, ThreadEventFragment as T, SendThreadMessageMutation as a, CancelAgentMessageMutationVariables as b, ThreadFragment as c, GetThreadsQueryVariables as d, SendThreadMessageMutationVariables as e, StartThreadMutationVariables as f,
|
|
2782
|
+
export type { Bigint_Comparison_Exp as B, CreateRoomMutationVariables as C, EnrichTokenOutput as E, GetRoomsQueryVariables as G, Order_By as O, RoomFragment as R, StartThreadMutation as S, ThreadEventFragment as T, SendThreadMessageMutation as a, CancelAgentMessageMutationVariables as b, ThreadFragment as c, GetThreadsQueryVariables as d, SendThreadMessageMutationVariables as e, StartThreadMutationVariables as f, SearchWikiPagesQueryVariables as g };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CreateRoomMutationVariables, B as Bigint_Comparison_Exp, O as Order_By, S as StartThreadMutation, T as ThreadEventFragment, a as SendThreadMessageMutation, G as GetRoomsQueryVariables, R as RoomFragment, b as CancelAgentMessageMutationVariables, c as ThreadFragment, d as GetThreadsQueryVariables, e as SendThreadMessageMutationVariables, f as StartThreadMutationVariables, g as
|
|
1
|
+
import { C as CreateRoomMutationVariables, B as Bigint_Comparison_Exp, O as Order_By, S as StartThreadMutation, T as ThreadEventFragment, a as SendThreadMessageMutation, G as GetRoomsQueryVariables, R as RoomFragment, b as CancelAgentMessageMutationVariables, c as ThreadFragment, d as GetThreadsQueryVariables, e as SendThreadMessageMutationVariables, f as StartThreadMutationVariables, g as SearchWikiPagesQueryVariables } from './graphql-Bv72OcvQ.mjs';
|
|
2
2
|
import { ApolloClient, Observable } from '@apollo/client';
|
|
3
3
|
import * as graphql_ws from 'graphql-ws';
|
|
4
4
|
|
|
@@ -3392,14 +3392,13 @@ declare function streamThreadMessageEvents(client: ApolloClient, threadId: strin
|
|
|
3392
3392
|
*/
|
|
3393
3393
|
declare function isInteractionAnalyzing(events: ThreadEvent[], skipAnalysis?: boolean): boolean;
|
|
3394
3394
|
|
|
3395
|
-
type SearchWikiPagesResult = NonNullable<SearchWikiPagesQuery["admin_wiki_search"]>;
|
|
3396
3395
|
type WikiPageNamespace = "guide" | "regular";
|
|
3397
3396
|
type WikiPageItem = WikiPageV1 & {
|
|
3398
3397
|
/**
|
|
3399
3398
|
* The stable identifier of the wiki page. Use this when updating a page,
|
|
3400
3399
|
* since it does not change when the page is renamed.
|
|
3401
3400
|
*/
|
|
3402
|
-
|
|
3401
|
+
stable_id: string;
|
|
3403
3402
|
slug: string;
|
|
3404
3403
|
created_at: string;
|
|
3405
3404
|
last_modified_at?: string | null | undefined;
|
|
@@ -3425,11 +3424,18 @@ type WikiPageDetail = WikiPageV1 & {
|
|
|
3425
3424
|
* The stable identifier of the wiki page. Use this when updating a page,
|
|
3426
3425
|
* since it does not change when the page is renamed.
|
|
3427
3426
|
*/
|
|
3428
|
-
|
|
3427
|
+
stable_id: string;
|
|
3429
3428
|
slug: string;
|
|
3430
3429
|
created_at: string;
|
|
3431
3430
|
last_modified_at?: string | null | undefined;
|
|
3432
3431
|
};
|
|
3432
|
+
type SearchWikiPagesResult = {
|
|
3433
|
+
totalCount: number;
|
|
3434
|
+
results: SearchWikiPageItem[];
|
|
3435
|
+
};
|
|
3436
|
+
type SearchWikiPageItem = Partial<WikiPageItem> & {
|
|
3437
|
+
score: number;
|
|
3438
|
+
};
|
|
3433
3439
|
type ListWikiPageArgs = {
|
|
3434
3440
|
project_id?: string;
|
|
3435
3441
|
namespace?: WikiPageNamespace;
|
|
@@ -3841,4 +3847,4 @@ declare function getThreadEventMessageId(event: ThreadEvent$1 | undefined): stri
|
|
|
3841
3847
|
*/
|
|
3842
3848
|
declare function buildPromptQLUrl(fqdn: string): string;
|
|
3843
3849
|
|
|
3844
|
-
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, 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, GetThreadsQueryVariables, type IPromptQLSdk, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type InterruptedByTrigger, type KeysOfUnion, type LearningBlockId, type LearningSuggestion, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type ListWikiPageArgs, type LlmResponse, type LlmUsage, type LlmUsageEvent, type LlmUsageEventV1, type MessageProcessingStarted, type MessageProcessingUpdate, type NeedsSupportUpdate, type OrchestratorUpdate, Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineProgress, type PipelineProgressV1, type PipelineProgressV2, type PipelineRunStepDetails, type PipelineSourceState, type PlanGenerationStarted, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionUpdate, type ProgramExecuteOutcome, type ProgramExecuteUpdate, type 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, 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 SearchWikiPagesResult, type SendMessageToThreadArguments, type SendMessageToThreadOutput, 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, StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepUpdate, type StreamThreadEventOptions, type TargetWikiPage, type TasksGenerated, type Teaching, type TeachingId, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, ThreadFragment, type 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, buildPromptQLUrl, 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, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, searchWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, updateWikiPage, validateRoomName };
|
|
3850
|
+
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, 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, GetThreadsQueryVariables, type IPromptQLSdk, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type InterruptedByTrigger, type KeysOfUnion, type LearningBlockId, type LearningSuggestion, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type ListWikiPageArgs, type LlmResponse, type LlmUsage, type LlmUsageEvent, type LlmUsageEventV1, type MessageProcessingStarted, type MessageProcessingUpdate, type NeedsSupportUpdate, type OrchestratorUpdate, Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineProgress, type PipelineProgressV1, type PipelineProgressV2, type PipelineRunStepDetails, type PipelineSourceState, type PlanGenerationStarted, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionUpdate, type ProgramExecuteOutcome, type ProgramExecuteUpdate, type 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, 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, 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, StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepUpdate, type StreamThreadEventOptions, type TargetWikiPage, type TasksGenerated, type Teaching, type TeachingId, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, ThreadFragment, type 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, buildPromptQLUrl, 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, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, searchWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, updateWikiPage, validateRoomName };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CreateRoomMutationVariables, B as Bigint_Comparison_Exp, O as Order_By, S as StartThreadMutation, T as ThreadEventFragment, a as SendThreadMessageMutation, G as GetRoomsQueryVariables, R as RoomFragment, b as CancelAgentMessageMutationVariables, c as ThreadFragment, d as GetThreadsQueryVariables, e as SendThreadMessageMutationVariables, f as StartThreadMutationVariables, g as
|
|
1
|
+
import { C as CreateRoomMutationVariables, B as Bigint_Comparison_Exp, O as Order_By, S as StartThreadMutation, T as ThreadEventFragment, a as SendThreadMessageMutation, G as GetRoomsQueryVariables, R as RoomFragment, b as CancelAgentMessageMutationVariables, c as ThreadFragment, d as GetThreadsQueryVariables, e as SendThreadMessageMutationVariables, f as StartThreadMutationVariables, g as SearchWikiPagesQueryVariables } from './graphql-Bv72OcvQ.js';
|
|
2
2
|
import { ApolloClient, Observable } from '@apollo/client';
|
|
3
3
|
import * as graphql_ws from 'graphql-ws';
|
|
4
4
|
|
|
@@ -3392,14 +3392,13 @@ declare function streamThreadMessageEvents(client: ApolloClient, threadId: strin
|
|
|
3392
3392
|
*/
|
|
3393
3393
|
declare function isInteractionAnalyzing(events: ThreadEvent[], skipAnalysis?: boolean): boolean;
|
|
3394
3394
|
|
|
3395
|
-
type SearchWikiPagesResult = NonNullable<SearchWikiPagesQuery["admin_wiki_search"]>;
|
|
3396
3395
|
type WikiPageNamespace = "guide" | "regular";
|
|
3397
3396
|
type WikiPageItem = WikiPageV1 & {
|
|
3398
3397
|
/**
|
|
3399
3398
|
* The stable identifier of the wiki page. Use this when updating a page,
|
|
3400
3399
|
* since it does not change when the page is renamed.
|
|
3401
3400
|
*/
|
|
3402
|
-
|
|
3401
|
+
stable_id: string;
|
|
3403
3402
|
slug: string;
|
|
3404
3403
|
created_at: string;
|
|
3405
3404
|
last_modified_at?: string | null | undefined;
|
|
@@ -3425,11 +3424,18 @@ type WikiPageDetail = WikiPageV1 & {
|
|
|
3425
3424
|
* The stable identifier of the wiki page. Use this when updating a page,
|
|
3426
3425
|
* since it does not change when the page is renamed.
|
|
3427
3426
|
*/
|
|
3428
|
-
|
|
3427
|
+
stable_id: string;
|
|
3429
3428
|
slug: string;
|
|
3430
3429
|
created_at: string;
|
|
3431
3430
|
last_modified_at?: string | null | undefined;
|
|
3432
3431
|
};
|
|
3432
|
+
type SearchWikiPagesResult = {
|
|
3433
|
+
totalCount: number;
|
|
3434
|
+
results: SearchWikiPageItem[];
|
|
3435
|
+
};
|
|
3436
|
+
type SearchWikiPageItem = Partial<WikiPageItem> & {
|
|
3437
|
+
score: number;
|
|
3438
|
+
};
|
|
3433
3439
|
type ListWikiPageArgs = {
|
|
3434
3440
|
project_id?: string;
|
|
3435
3441
|
namespace?: WikiPageNamespace;
|
|
@@ -3841,4 +3847,4 @@ declare function getThreadEventMessageId(event: ThreadEvent$1 | undefined): stri
|
|
|
3841
3847
|
*/
|
|
3842
3848
|
declare function buildPromptQLUrl(fqdn: string): string;
|
|
3843
3849
|
|
|
3844
|
-
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, 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, GetThreadsQueryVariables, type IPromptQLSdk, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type InterruptedByTrigger, type KeysOfUnion, type LearningBlockId, type LearningSuggestion, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type ListWikiPageArgs, type LlmResponse, type LlmUsage, type LlmUsageEvent, type LlmUsageEventV1, type MessageProcessingStarted, type MessageProcessingUpdate, type NeedsSupportUpdate, type OrchestratorUpdate, Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineProgress, type PipelineProgressV1, type PipelineProgressV2, type PipelineRunStepDetails, type PipelineSourceState, type PlanGenerationStarted, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionUpdate, type ProgramExecuteOutcome, type ProgramExecuteUpdate, type 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, 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 SearchWikiPagesResult, type SendMessageToThreadArguments, type SendMessageToThreadOutput, 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, StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepUpdate, type StreamThreadEventOptions, type TargetWikiPage, type TasksGenerated, type Teaching, type TeachingId, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, ThreadFragment, type 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, buildPromptQLUrl, 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, getThreadEventMessageId, getThreadEvents, getUserCancelEvent, getUserMessageEvent, getWikiPage, isInteractionAnalyzing, listArtifactMetadataByThreadId, listRooms, listThreads, listWikiPages, searchWikiPages, sendThreadMessage, startThread, streamThreadMessageEvents, subscribeThreadEvents, updateWikiPage, validateRoomName };
|
|
3850
|
+
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, 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, GetThreadsQueryVariables, type IPromptQLSdk, type InteractionDecision, type InteractionDecisionAccept, type InteractionDecisionDecline, type InteractionDecisionUpdate, type InteractionFinishedEvent, type InteractionFinishedUpdate, type InteractionOutcome, type InteractionOutcomeStatus, type InteractionUpdate, type InternalError, type InternalErrorV1, type InternalUpdate, type InterruptedByTrigger, type KeysOfUnion, type LearningBlockId, type LearningSuggestion, type LearningSuggestionUpdate, type LearningSuggestionUpdateV1, type ListWikiPageArgs, type LlmResponse, type LlmUsage, type LlmUsageEvent, type LlmUsageEventV1, type MessageProcessingStarted, type MessageProcessingUpdate, type NeedsSupportUpdate, type OrchestratorUpdate, Order_By, type OutputEmitted, type OutputEmittedV1, type PipelineProgress, type PipelineProgressV1, type PipelineProgressV2, type PipelineRunStepDetails, type PipelineSourceState, type PlanGenerationStarted, type PlanStepGenerated, type PlanningDecisionCompleted, type PlanningDecisionPlanningRequired, type PlanningDecisionStarted, type PlanningDecisionUpdate, type ProgramExecuteOutcome, type ProgramExecuteUpdate, type 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, 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, 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, StartThreadMutationVariables, type StartThreadOutput, type StartingOrchestrator, type StepExecutionFinished, type StepExecutionFinishedV1, type StepExecutionStarted, type StepExecutionStartedV1, type StepUpdate, type StreamThreadEventOptions, type TargetWikiPage, type TasksGenerated, type Teaching, type TeachingId, type ThreadEvent, type ThreadEvent$1 as ThreadEventData, ThreadFragment, type 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, buildPromptQLUrl, 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, 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 P=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var we=(t,e)=>{for(var a in e)P(t,a,{get:e[a],enumerable:!0})},Fe=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of Re(e))!Ue.call(t,_)&&_!==a&&P(t,_,{get:()=>e[_],enumerable:!(r=Te(e,_))||r.enumerable});return t};var je=t=>Fe(P({},"__esModule",{value:!0}),t);var ht={};we(ht,{PromptQLSdk:()=>Z,ROOM_NAME_REGEX:()=>Me,USER_AGENT:()=>d,buildPromptQLUrl:()=>X,cancelAgentMessage:()=>q,createApolloClient:()=>$,createRoom:()=>w,createWikiPage:()=>J,deleteWikiPage:()=>H,diffThreadEvents:()=>Qe,downloadArtifactData:()=>T,getAgentGeneratedResponse:()=>$e,getAgentInteractionDecisionAcceptInteractionEvent:()=>Ze,getAgentInteractionDecisionDeclineInteractionEvent:()=>Ye,getAgentInteractionFinishedEvent:()=>At,getAgentMessageProcessingStartedEvent:()=>Xe,getAgentOrchestratorContextExplorerCompletedEvent:()=>nt,getAgentOrchestratorContextExplorerStartedEvent:()=>_t,getAgentOrchestratorContextExplorerUpdateEvent:()=>c,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent:()=>lt,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent:()=>bt,getAgentOrchestratorSchemaExplorerCompletedEvent:()=>ct,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent:()=>mt,getAgentOrchestratorSchemaExplorerSchemaExploredEvent:()=>It,getAgentOrchestratorSchemaExplorerStartedEvent:()=>yt,getAgentOrchestratorSchemaExplorerUpdateEvent:()=>y,getAgentOrchestratorSchemaTasksGeneratedEvent:()=>dt,getAgentOrchestratorSchemaTasksGenerationCompletedEvent:()=>ut,getAgentOrchestratorSchemaTasksGenerationStartedEvent:()=>st,getAgentOrchestratorSchemaTasksGenerationUpdateEvent:()=>h,getAgentOrchestratorStepProgrammerEvent:()=>Mt,getAgentOrchestratorStepSavedProgramRunnerEvent:()=>St,getAgentOrchestratorStepUiProgrammerEvent:()=>gt,getAgentOrchestratorStepUpdateEvent:()=>x,getAgentOrchestratorUpdateEvent:()=>A,getAgentOrchestratorWikiExplorerCompletedEvent:()=>ot,getAgentOrchestratorWikiExplorerStartedEvent:()=>it,getAgentOrchestratorWikiExplorerUpdateEvent:()=>f,getAgentOrchestratorWikiInfoGeneratedEvent:()=>pt,getAgentPlanGenerationStartedEvent:()=>Ke,getAgentPlanStepGeneratedEvent:()=>He,getAgentPlanningDecisionCompletedEvent:()=>tt,getAgentPlanningDecisionPlanningRequiredEvent:()=>at,getAgentPlanningDecisionStartedEvent:()=>et,getAgentPlanningDecisionUpdateEvent:()=>S,getAgentStartingOrchestratorEvent:()=>rt,getArtifactMetadata:()=>U,getThread:()=>V,getThreadEventMessageId:()=>ft,getThreadEvents:()=>M,getUserCancelEvent:()=>Je,getUserMessageEvent:()=>Le,getWikiPage:()=>L,isInteractionAnalyzing:()=>Ae,listArtifactMetadataByThreadId:()=>R,listRooms:()=>m,listThreads:()=>j,listWikiPages:()=>G,searchWikiPages:()=>Q,sendThreadMessage:()=>W,startThread:()=>N,streamThreadMessageEvents:()=>D,subscribeThreadEvents:()=>z,updateWikiPage:()=>K,validateRoomName:()=>ge});module.exports=je(ht);var Y={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"}}]}}]}}]},ee={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"}}]}}]}}]},te={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"}}]}}]}}]},ae={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"}}]}}]}}]}}]},re={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"}}]}}]}}]},_e={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"}}]}}]}}]},ne={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"}}]}}]}}]},ie={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"}}]}}]}}]}}]},oe={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"}}]}}]}}]},pe={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"}}]}}]}}]},se={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:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]},ce={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}}]}]}}]}}]},le={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"}}]}}]}}]},be={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"}}]}}]}}]}}]}}]},me={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]};async function T(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/data`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let b=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to download artifact: ${b}`)}return n.body?n.headers.get("Content-Type")?.startsWith("application/json")?n.json():n.text():null}async function R(t,e,a){let r=await t.query({query:ie,variables:{threadId:a},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(_=>_.latest_version_object).map(_=>({project_id:e,artifact_id:_.artifact_id,artifact_type:_.latest_version_object.artifact_type,version:_.latest_version_object.version,title:_.latest_version_object.title,description:_.latest_version_object.description??null,user_id:_.latest_version_object.user_id,metadata:_.latest_version_object.artifact_metadata,created_at:_.latest_version_object.created_at,size_bytes:Number.parseInt(_.latest_version_object.size)})):[]}async function U(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/metadata`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let p=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to get artifact metadata: ${p}`)}return n.json()}function m(t,e){return t.query({query:se,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.rooms??[])}function w(t,e){if(!e.name)throw new Error("Room name is required");let a=ge(e.name);if(a)throw new Error(a);return t.mutate({mutation:ee,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 Me=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,Ie=80,ge=t=>{let e=t.trim();return e.length===0?null:e.length>Ie?`Room name must be ${Ie} 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.":Me.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};var s=require("rxjs");var Se=/^[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 I(t){return t=t?t.trim():"",t?t[t.length-1]==="/"?t.slice(0,t.length-1):t:""}function F(t){if(t==null)return null;try{Number.parseInt(t)}catch{throw new Error("invalid threadEventId")}return t}function j(t,e){return t.query({query:ue,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2??[])}function V(t,e){if(!e)throw new Error("threadId is required");return t.query({query:de,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2_by_pk)}function N(t,e){if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:ae,variables:e}).then(a=>{if(!a.data?.start_thread)throw new Error(a.error?.message||"Failed to start thread");return a.data.start_thread})}function M(t,e,a){if(!e)throw new Error("threadId is required");let r={thread_id:{_eq:e}};return a&&(a.eventId&&(r.thread_event_id=a.eventId),a.messageId&&(r._or=Ve(a.messageId))),t.query({query:ye,variables:{where:r,limit:a?.limit,ordering:a?.ordering||"asc"},fetchPolicy:"no-cache"}).then(_=>_.data?.thread_events??[])}function W(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:te,variables:e}).then(a=>{if(!a.data?.send_thread_message)throw new Error(a.error?.message||"Failed to send message to thread");return a.data.send_thread_message})}function q(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return t.mutate({mutation:Y,variables:e}).then(a=>{if(!a.data?.cancel_agent_message)throw new Error(a.error?.message||"Failed to cancel thread");return a.data.cancel_agent_message})}function z(t,e,a){if(!e)throw new Error("threadId is required");F(a);let r={thread_id:{_eq:e}};return a&&(r.thread_event_id={_gte:a}),t.subscribe({query:me,variables:{where:r}}).pipe((0,s.map)(_=>{if(_.error)throw _.error;return _.data?.thread_events??[]}))}function D(t,e,a){if(!e)throw new Error("threadId is required");let r,_=F(a?.fromEventId),i={eventId:a?.fromEventId?{_gte:_}:void 0,messageId:a?.messageId},o=a?.pollingInterval&&a?.pollingInterval>0?a.pollingInterval:5;return(0,s.defer)(async()=>{let n=r?{messageId:a?.messageId,eventId:{_gt:r}}:i,p=await M(t,e,n);return p.length>0&&(r=p[p.length-1]?.thread_event_id),p}).pipe((0,s.repeat)({count:a?.timeout&&a.timeout>0?Math.ceil(a.timeout/o):void 0,delay:o*1e3}),(0,s.takeWhile)(n=>Ae(n,a?.skipAnalysis),!0))}function Ae(t,e){for(let a=t.length-1;a>=0;a--){let r=t[a];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let _=r.event_data.AgentMessage.update;if("content"in _&&("interaction_finished"in _.content||e&&"interaction_update"in _.content&&"main_agent"in _.content.interaction_update&&"completed"in _.content.interaction_update.main_agent)||"InteractionFinished"in _||e&&"OrchestratorUpdate"in _&&"GeneratedResponse"in _.OrchestratorUpdate.update)return!1}return!0}function Ve(t){return[{event_data:{_contains:{UserMessage:{message_id:t}}}},{event_data:{_contains:{AgentMessage:{message_id:t}}}},{event_data:{_contains:{UserCancel:{message_id:t}}}}]}var g=["guide","regular"];async function G(t,e){let a=e.namespace||"regular";if(!g.includes(a))throw new Error(`Invalid namespace. Expected one of: ${g}`);if(a==="guide"){let o={deleted_at:{_is_null:!0}};return e.project_id&&(o.project_id={_eq:e.project_id}),e.query&&(o.page_title={_ilike:e.query.toLowerCase()}),We(t,{where:o,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,_={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||(_.offset=e.offset,_.limit=e.limit);let i=await Ne(t,_);return r?De(i,e):i}async function Q(t,e){if(!e.query)throw new Error("query is required");return t.query({query:be,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki_search??{totalCount:0,results:[]})}async function L(t,e,a,r){if(a=a||"regular",!g.includes(a))throw new Error(`Invalid namespace. Expected one of: ${g}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(a==="guide")return ze(t,{project_id:e,page_id:r});let _={project_id:{_eq:e},deleted_at:{_is_null:!0}};return Se.test(r)?_.id={_eq:r}:_.page_id={_eq:r},qe(t,{where:_})}function J(t,{slug:e,...a}){if(!a.title)throw new Error("Wiki title is required");if(!a.stub&&!a.definition)throw new Error("Wiki definition is required");return t.mutate({mutation:re,variables:{pageId:e,pageContent:a},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function K(t,e,a){if(!e)throw new Error("ID of the wiki is required");return t.mutate({mutation:_e,variables:{id:e,pageContent:a},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function H(t,e){if(!e)throw new Error("ID of the wiki is required");return t.mutate({mutation:ne,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki_delete?.buildVersion)}function Ne(t,e){return t.query({query:ce,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki.map(({page_id:r,..._})=>({..._,slug:r}))??[])}function We(t,e){return t.query({query:oe,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_guide_page?.map(r=>({id:r.id,slug:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function qe(t,e){let a=await t.query({query:le,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(_=>({id:_.id,slug:_.page_id,created_at:_.created_at,last_modified_at:_.last_modified_at,..._.content}))??[]);return a.length?a[0]:null}async function ze(t,e){let a=await t.query({query:pe,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(_=>({id:_.id,slug:_.id,created_at:_.created_at,last_modified_at:_.last_modified_at,title:_.page_title,details:_.details}))??[]);return a.length?a[0]:null}function De(t,e){if(!t.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return t;let a=e.query?.toLowerCase(),r=t.filter(_=>!e.include_stub&&_.stub?!1:!!(!a||_.title.toLowerCase().includes(a)||_.definition&&_.definition.toLowerCase().includes(a)||_.aliases?.length&&_.aliases.some(i=>i.toLowerCase().includes(a))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}function fe(t){return t!=null&&typeof t=="object"&&"status"in t&&t.status==="failure"}function he(t){return t!=null&&typeof t=="object"&&"status"in t&&t.status==="success"&&"token"in t}function xe(t){return t!=null&&typeof t=="object"&&("data"in t&&!!t.data&&typeof t.data=="object"&&"enrich_token"in t.data&&!!t.data.enrich_token&&typeof t.data.enrich_token=="object"&&"userDirectoryJWT"in t.data.enrich_token||"errors"in t&&Array.isArray(t.errors))}function Be(t){let a=`${I(t.authHost)||"https://auth.pro.hasura.io"}/ddn/promptql/token`,r={token:"",expiry:new Date(0)},_=t.fetch||fetch,i=async()=>{let o=await _(a,{method:"POST",headers:t.headers});switch(o.status){case 200:{let n=await o.json();if(he(n))return n;throw new Error("malformed token response")}case 401:{let n=await o.json();throw fe(n)?new Error(n?.error||o.statusText):new Error(o.statusText)}default:{let n=await o.text();throw new Error(n)}}};return async()=>{if(r.expiry.getTime()<=Date.now()+1e3){let o=await i(),n=await Ge(t.promptqlGraphQLUrl,o.token,t.projectId,_);r.token=n;let p=new Date(o.expiry);if(Number.isNaN(p.getTime())){let b=new Date;b.setHours(1),r.expiry=b}else r.expiry=p}return r.token}}var Ge=async(t,e,a,r=fetch)=>{let _=await r(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:"mutation EnrichToken($luxJWT: String!, $projectId: uuid) { enrich_token(luxJWT: $luxJWT, projectId: $projectId) { userDirectoryJWT }}",variables:{luxJWT:e,projectId:a},operationName:"EnrichToken"})});switch(_.status){case 200:{let i=await _.json();if(!xe(i)||!i.data?.enrich_token?.userDirectoryJWT)throw new Error(`malformed promptql token response: ${JSON.stringify(i)}`);return i.data.enrich_token.userDirectoryJWT}default:{let i=await _.text();throw new Error(i)}}};var d="PromptQL TypeScript SDK";var u=require("@apollo/client"),ve=require("@apollo/client/link/context"),Ce=require("@apollo/client/link/subscriptions"),ke=require("graphql"),Oe=require("graphql-ws");var $=t=>{let e=new u.HttpLink({uri:t.url,fetch:t.fetch,headers:t.headers}),a=async n=>{let p=await t.getAuthToken();return{headers:{"User-Agent":d,...n,Authorization:`Bearer ${p}`}}},r=(0,Oe.createClient)({url:t.url,connectionParams:()=>a(t.headers),lazy:!0}),_=new Ce.GraphQLWsLink(r),i=new ve.SetContextLink(({headers:n})=>a(n)),o=u.ApolloLink.split(({operationType:n})=>n===ke.OperationTypeNode.SUBSCRIPTION,_,i.concat(e));return{client:new u.ApolloClient({link:o,cache:new u.InMemoryCache}),wsClient:r}};function Qe(t,e){if(!e.length)return[];if(!t.length)return e;let a=t[t.length-1];if(!a)return e;let r=BigInt(a.thread_event_id),_=e.length-1;for(;_>=0;_--){let i=e[_];if(BigInt(i?.thread_event_id)<=r)break}return e.slice(_+1)}function Le(t){return"UserMessage"in t?t.UserMessage:null}function Je(t){return"UserCancel"in t?t.UserCancel:null}function Ke(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)||!("PlanGenerationStarted"in t.AgentMessage.update.OrchestratorUpdate.update)?null:t.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function He(t){let e=A(t);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function $e(t){return"AgentMessage"in t?"content"in t.AgentMessage.update&&"interaction_update"in t.AgentMessage.update.content&&"main_agent"in t.AgentMessage.update.content.interaction_update&&"completed"in t.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:t.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:t.AgentMessage.update.timestamp,messageId:t.AgentMessage.message_id}:!("OrchestratorUpdate"in t.AgentMessage.update)||!("GeneratedResponse"in t.AgentMessage.update.OrchestratorUpdate.update)?null:{...t.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:t.AgentMessage.message_id}:null}function Xe(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("ProcessingStarted"in t.AgentMessage.update.MessageProcessingUpdate.update)?null:t.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function Ze(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function Ye(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function S(t){return!("AgentMessage"in t)||!("PlanningDecisionUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.PlanningDecisionUpdate.update}function et(t){let e=S(t);return!e||!("Started"in e)?null:e.Started}function tt(t){let e=S(t);return!e||!("Completed"in e)?null:e.Completed}function at(t){let e=S(t);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function rt(t){return!("AgentMessage"in t)||!("StartingOrchestrator"in t.AgentMessage.update)?null:t.AgentMessage.update.StartingOrchestrator}function A(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.OrchestratorUpdate.update}function c(t){let e=A(t);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function _t(t){let e=c(t);return!e||!("Started"in e)?null:e.Started}function nt(t){let e=c(t);return!e||!("Completed"in e)?null:e.Completed}function f(t){let e=c(t);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function it(t){let e=f(t);return!e||!("Started"in e)?null:e.Started}function ot(t){let e=f(t);return!e||!("Completed"in e)?null:e.Completed}function pt(t){let e=f(t);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function h(t){let e=c(t);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function st(t){let e=h(t);return!e||!("Started"in e)?null:e.Started}function ut(t){let e=h(t);return!e||!("Completed"in e)?null:e.Completed}function dt(t){let e=h(t);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function y(t){let e=c(t);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function yt(t){let e=y(t);return!e||!("Started"in e)?null:e.Started}function ct(t){let e=y(t);return!e||!("Completed"in e)?null:e.Completed}function lt(t){let e=y(t);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function bt(t){let e=y(t);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function mt(t){let e=y(t);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function It(t){let e=y(t);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function x(t){let e=A(t);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function Mt(t){let e=x(t);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function gt(t){let e=x(t);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function St(t){let e=x(t);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function At(t){if(!("AgentMessage"in t))return null;if("InteractionFinished"in t.AgentMessage.update){let e=t.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:t.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:t.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:t.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:{status:"unknown",messageId:t.AgentMessage.message_id}}if("content"in t.AgentMessage.update&&"interaction_finished"in t.AgentMessage.update.content){let e=t.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:t.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:t.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:t.AgentMessage.message_id}}return null}function ft(t){if(t){if("UserMessage"in t)return t.UserMessage.message_id;if("AgentMessage"in t)return t.AgentMessage.message_id;if("UserTeach"in t)return t.UserTeach.agent_message_id;if("UserCancel"in t)return t.UserCancel.message_id}}function X(t){return`https://promptql.${t}/playground-v2-hge/v1/graphql`}var B=class{controlPlaneUrl;options;defaultTimezone;getAuthTokenFn;project;client;wsClient;constructor(e){if(this.options=e,!e.serviceAccountToken)throw new Error("serviceAccountToken must not be empty. If you haven't created any service account token yet, check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let a=e.controlPlaneHost?I(e.controlPlaneHost):"https://data.pro.hasura.io";this.controlPlaneUrl=`${a}/v1/graphql`}async getAuthToken(){if(typeof this.getAuthTokenFn=="function")return this.getAuthTokenFn();let e=await this.getProjectInfo();return this.getAuthTokenFn=Be({promptqlGraphQLUrl:e.promptqlGraphQLUrl,authHost:this.options.authHost,headers:Ee(this.options.serviceAccountToken),fetch:this.options.fetch}),this.getAuthTokenFn()}async getGraphQLClient(){if(this.client)return this.client;let e=await this.getProjectInfo(),{client:a,wsClient:r}=$({getAuthToken:this.getAuthToken.bind(this),url:e.promptqlGraphQLUrl,fetch:this.options.fetch,headers:this.options.headers});return this.wsClient=r,this.client=a,this.client}async getProjectInfo(){if(this.project)return this.project;let e={operationName:"GetDdnProjects",query:"query GetDdnProjects { ddn_projects(limit: 1) { id name private_ddn { fqdn path_routing_context path_routing_enabled }}}"},r=await(typeof this.options.fetch=="function"?this.options.fetch:fetch)(this.controlPlaneUrl,{method:"POST",headers:{...Ee(this.options.serviceAccountToken),"User-Agent":d,"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!==200){let o=r.body?await r.text():r.statusText;throw new Error(`[${r.status}] failed to get project info: ${o}`)}let _=await r.json();if(!_.data?.ddn_projects?.length)throw new Error("Project not found");let i=_.data.ddn_projects[0];return this.project={projectId:i.id,projectName:i.name,projectHost:`https://${i.name}.${i.private_ddn.fqdn}`,promptqlConsoleUrl:`https://prompt.ql.app/project/${i.name}`,promptqlGraphQLUrl:X(i.private_ddn.fqdn)},this.project}close(){if(this.wsClient&&(this.wsClient.dispose(),this.wsClient=void 0),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.client=void 0,this.project=void 0,this.getAuthTokenFn=void 0}}};function Ee(t){return{Authorization:`pat ${t}`}}var v=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return R(r,a.projectId,e)}async download(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return T(r.projectHost,e,a,Pe(_),this.api.options.fetch)}async getMetadata(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return U(r.projectHost,e,a,Pe(_),this.api.options.fetch)}};function Pe(t){return{Authorization:`Bearer ${t}`,"User-Agent":d}}var C=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var k=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return m(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){let a=await this.api.getGraphQLClient();return m(a,{where:{name:{_eq:e}},limit:1}).then(r=>r.length?r[0]??null:null)}async create(e){let a=await this.api.getGraphQLClient();return w(a,e)}};var l=require("rxjs");var O=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return j(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");let a=await this.api.getGraphQLClient();return V(a,e)}async start(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return N(r,{...e,projectId:a.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async getEvents(e,a){let r=await this.api.getGraphQLClient();return M(r,e,a)}async sendMessage(e){let a=await this.api.getGraphQLClient();return W(a,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){let a=await this.api.getGraphQLClient();return q(a,e)}subscribeEvents(e,a){return(0,l.from)(this.api.getGraphQLClient()).pipe((0,l.switchMap)(r=>z(r,e,a)))}streamMessageEvents(e,a){return(0,l.from)(this.api.getGraphQLClient()).pipe((0,l.switchMap)(r=>D(r,e,a)))}};var E=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return G(a,e)}async search(e){let a=await this.api.getGraphQLClient();return Q(a,e)}async get(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getGraphQLClient();return L(_,r.projectId,e,a)}async create(e){let a=await this.api.getGraphQLClient();return J(a,e)}async update(e,a){let r=await this.api.getGraphQLClient();return K(r,e,a)}async delete(e){let a=await this.api.getGraphQLClient();return H(a,e)}};var Z=class{constructor(e){let a=new B(e);this.api=a,this.thread=new O(a),this.project=new C(a),this.room=new k(a),this.artifact=new v(a),this.wiki=new E(a)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};0&&(module.exports={PromptQLSdk,ROOM_NAME_REGEX,USER_AGENT,buildPromptQLUrl,cancelAgentMessage,createApolloClient,createRoom,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,getThreadEventMessageId,getThreadEvents,getUserCancelEvent,getUserMessageEvent,getWikiPage,isInteractionAnalyzing,listArtifactMetadataByThreadId,listRooms,listThreads,listWikiPages,searchWikiPages,sendThreadMessage,startThread,streamThreadMessageEvents,subscribeThreadEvents,updateWikiPage,validateRoomName});
|
|
1
|
+
"use strict";var P=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var we=(t,e)=>{for(var a in e)P(t,a,{get:e[a],enumerable:!0})},Fe=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of Re(e))!Ue.call(t,_)&&_!==a&&P(t,_,{get:()=>e[_],enumerable:!(r=Te(e,_))||r.enumerable});return t};var je=t=>Fe(P({},"__esModule",{value:!0}),t);var ht={};we(ht,{PromptQLSdk:()=>Z,ROOM_NAME_REGEX:()=>Me,USER_AGENT:()=>d,buildPromptQLUrl:()=>X,cancelAgentMessage:()=>q,createApolloClient:()=>$,createRoom:()=>w,createWikiPage:()=>J,deleteWikiPage:()=>H,diffThreadEvents:()=>Qe,downloadArtifactData:()=>T,getAgentGeneratedResponse:()=>$e,getAgentInteractionDecisionAcceptInteractionEvent:()=>Ze,getAgentInteractionDecisionDeclineInteractionEvent:()=>Ye,getAgentInteractionFinishedEvent:()=>At,getAgentMessageProcessingStartedEvent:()=>Xe,getAgentOrchestratorContextExplorerCompletedEvent:()=>nt,getAgentOrchestratorContextExplorerStartedEvent:()=>_t,getAgentOrchestratorContextExplorerUpdateEvent:()=>c,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent:()=>lt,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent:()=>bt,getAgentOrchestratorSchemaExplorerCompletedEvent:()=>ct,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent:()=>mt,getAgentOrchestratorSchemaExplorerSchemaExploredEvent:()=>It,getAgentOrchestratorSchemaExplorerStartedEvent:()=>yt,getAgentOrchestratorSchemaExplorerUpdateEvent:()=>y,getAgentOrchestratorSchemaTasksGeneratedEvent:()=>dt,getAgentOrchestratorSchemaTasksGenerationCompletedEvent:()=>ut,getAgentOrchestratorSchemaTasksGenerationStartedEvent:()=>st,getAgentOrchestratorSchemaTasksGenerationUpdateEvent:()=>h,getAgentOrchestratorStepProgrammerEvent:()=>Mt,getAgentOrchestratorStepSavedProgramRunnerEvent:()=>St,getAgentOrchestratorStepUiProgrammerEvent:()=>gt,getAgentOrchestratorStepUpdateEvent:()=>x,getAgentOrchestratorUpdateEvent:()=>A,getAgentOrchestratorWikiExplorerCompletedEvent:()=>ot,getAgentOrchestratorWikiExplorerStartedEvent:()=>it,getAgentOrchestratorWikiExplorerUpdateEvent:()=>f,getAgentOrchestratorWikiInfoGeneratedEvent:()=>pt,getAgentPlanGenerationStartedEvent:()=>Ke,getAgentPlanStepGeneratedEvent:()=>He,getAgentPlanningDecisionCompletedEvent:()=>tt,getAgentPlanningDecisionPlanningRequiredEvent:()=>at,getAgentPlanningDecisionStartedEvent:()=>et,getAgentPlanningDecisionUpdateEvent:()=>S,getAgentStartingOrchestratorEvent:()=>rt,getArtifactMetadata:()=>U,getThread:()=>V,getThreadEventMessageId:()=>ft,getThreadEvents:()=>M,getUserCancelEvent:()=>Je,getUserMessageEvent:()=>Le,getWikiPage:()=>L,isInteractionAnalyzing:()=>Ae,listArtifactMetadataByThreadId:()=>R,listRooms:()=>m,listThreads:()=>j,listWikiPages:()=>G,searchWikiPages:()=>Q,sendThreadMessage:()=>W,startThread:()=>N,streamThreadMessageEvents:()=>D,subscribeThreadEvents:()=>z,updateWikiPage:()=>K,validateRoomName:()=>ge});module.exports=je(ht);var Y={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"}}]}}]}}]},ee={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"}}]}}]}}]},te={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"}}]}}]}}]},ae={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"}}]}}]}}]}}]},re={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"}}]}}]}}]},_e={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"}}]}}]}}]},ne={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"}}]}}]}}]},ie={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"}}]}}]}}]}}]},oe={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"}}]}}]}}]},pe={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"}}]}}]}}]},se={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:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]},ce={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}}]}]}}]}}]},le={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"}}]}}]}}]},be={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"}}]}}]}}]}}]}}]},me={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]};async function T(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/data`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let b=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to download artifact: ${b}`)}return n.body?n.headers.get("Content-Type")?.startsWith("application/json")?n.json():n.text():null}async function R(t,e,a){let r=await t.query({query:ie,variables:{threadId:a},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(_=>_.latest_version_object).map(_=>({project_id:e,artifact_id:_.artifact_id,artifact_type:_.latest_version_object.artifact_type,version:_.latest_version_object.version,title:_.latest_version_object.title,description:_.latest_version_object.description??null,user_id:_.latest_version_object.user_id,metadata:_.latest_version_object.artifact_metadata,created_at:_.latest_version_object.created_at,size_bytes:Number.parseInt(_.latest_version_object.size)})):[]}async function U(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/metadata`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let p=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to get artifact metadata: ${p}`)}return n.json()}function m(t,e){return t.query({query:se,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.rooms??[])}function w(t,e){if(!e.name)throw new Error("Room name is required");let a=ge(e.name);if(a)throw new Error(a);return t.mutate({mutation:ee,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 Me=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,Ie=80,ge=t=>{let e=t.trim();return e.length===0?null:e.length>Ie?`Room name must be ${Ie} 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.":Me.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};var s=require("rxjs");var Se=/^[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 I(t){return t=t?t.trim():"",t?t[t.length-1]==="/"?t.slice(0,t.length-1):t:""}function F(t){if(t==null)return null;try{Number.parseInt(t)}catch{throw new Error("invalid threadEventId")}return t}function j(t,e){return t.query({query:ue,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2??[])}function V(t,e){if(!e)throw new Error("threadId is required");return t.query({query:de,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2_by_pk)}function N(t,e){if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:ae,variables:e}).then(a=>{if(!a.data?.start_thread)throw new Error(a.error?.message||"Failed to start thread");return a.data.start_thread})}function M(t,e,a){if(!e)throw new Error("threadId is required");let r={thread_id:{_eq:e}};return a&&(a.eventId&&(r.thread_event_id=a.eventId),a.messageId&&(r._or=Ve(a.messageId))),t.query({query:ye,variables:{where:r,limit:a?.limit,ordering:a?.ordering||"asc"},fetchPolicy:"no-cache"}).then(_=>_.data?.thread_events??[])}function W(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:te,variables:e}).then(a=>{if(!a.data?.send_thread_message)throw new Error(a.error?.message||"Failed to send message to thread");return a.data.send_thread_message})}function q(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return t.mutate({mutation:Y,variables:e}).then(a=>{if(!a.data?.cancel_agent_message)throw new Error(a.error?.message||"Failed to cancel thread");return a.data.cancel_agent_message})}function z(t,e,a){if(!e)throw new Error("threadId is required");F(a);let r={thread_id:{_eq:e}};return a&&(r.thread_event_id={_gte:a}),t.subscribe({query:me,variables:{where:r}}).pipe((0,s.map)(_=>{if(_.error)throw _.error;return _.data?.thread_events??[]}))}function D(t,e,a){if(!e)throw new Error("threadId is required");let r,_=F(a?.fromEventId),i={eventId:a?.fromEventId?{_gte:_}:void 0,messageId:a?.messageId},o=a?.pollingInterval&&a?.pollingInterval>0?a.pollingInterval:5;return(0,s.defer)(async()=>{let n=r?{messageId:a?.messageId,eventId:{_gt:r}}:i,p=await M(t,e,n);return p.length>0&&(r=p[p.length-1]?.thread_event_id),p}).pipe((0,s.repeat)({count:a?.timeout&&a.timeout>0?Math.ceil(a.timeout/o):void 0,delay:o*1e3}),(0,s.takeWhile)(n=>Ae(n,a?.skipAnalysis),!0))}function Ae(t,e){for(let a=t.length-1;a>=0;a--){let r=t[a];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let _=r.event_data.AgentMessage.update;if("content"in _&&("interaction_finished"in _.content||e&&"interaction_update"in _.content&&"main_agent"in _.content.interaction_update&&"completed"in _.content.interaction_update.main_agent)||"InteractionFinished"in _||e&&"OrchestratorUpdate"in _&&"GeneratedResponse"in _.OrchestratorUpdate.update)return!1}return!0}function Ve(t){return[{event_data:{_contains:{UserMessage:{message_id:t}}}},{event_data:{_contains:{AgentMessage:{message_id:t}}}},{event_data:{_contains:{UserCancel:{message_id:t}}}}]}var g=["guide","regular"];async function G(t,e){let a=e.namespace||"regular";if(!g.includes(a))throw new Error(`Invalid namespace. Expected one of: ${g}`);if(a==="guide"){let o={deleted_at:{_is_null:!0}};return e.project_id&&(o.project_id={_eq:e.project_id}),e.query&&(o.page_title={_ilike:e.query.toLowerCase()}),We(t,{where:o,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,_={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||(_.offset=e.offset,_.limit=e.limit);let i=await Ne(t,_);return r?De(i,e):i}async function Q(t,e){if(!e.query)throw new Error("query is required");return t.query({query:be,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki_search?{totalCount:a.data.admin_wiki_search.totalCount,results:a.data?.admin_wiki_search.results.map(({score:r,metadata:_,page:{id:i,...o}})=>({...o,score:r,stable_id:_.id,slug:i,created_at:_.createdAt,last_modified_at:_.lastUpdatedAt}))}:{totalCount:0,results:[]})}async function L(t,e,a,r){if(a=a||"regular",!g.includes(a))throw new Error(`Invalid namespace. Expected one of: ${g}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(a==="guide")return ze(t,{project_id:e,page_id:r});let _={project_id:{_eq:e},deleted_at:{_is_null:!0}};return Se.test(r)?_.id={_eq:r}:_.page_id={_eq:r},qe(t,{where:_})}function J(t,{slug:e,...a}){if(!a.title)throw new Error("Wiki title is required");if(!a.stub&&!a.definition)throw new Error("Wiki definition is required");return t.mutate({mutation:re,variables:{pageId:e,pageContent:a},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function K(t,e,a){if(!e)throw new Error("ID of the wiki is required");return t.mutate({mutation:_e,variables:{id:e,pageContent:a},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function H(t,e){if(!e)throw new Error("ID of the wiki is required");return t.mutate({mutation:ne,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki_delete?.buildVersion)}function Ne(t,e){return t.query({query:ce,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki.map(({page_id:r,id:_,...i})=>({...i,stable_id:_,slug:r}))??[])}function We(t,e){return t.query({query:oe,variables:e,fetchPolicy:"no-cache"}).then(a=>a.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 qe(t,e){let a=await t.query({query:le,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(_=>({stable_id:_.id,slug:_.page_id,created_at:_.created_at,last_modified_at:_.last_modified_at,..._.content}))??[]);return a.length?a[0]:null}async function ze(t,e){let a=await t.query({query:pe,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(_=>({stable_id:_.id,slug:_.id,created_at:_.created_at,last_modified_at:_.last_modified_at,title:_.page_title,details:_.details}))??[]);return a.length?a[0]:null}function De(t,e){if(!t.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return t;let a=e.query?.toLowerCase(),r=t.filter(_=>!e.include_stub&&_.stub?!1:!!(!a||_.title.toLowerCase().includes(a)||_.definition&&_.definition.toLowerCase().includes(a)||_.aliases?.length&&_.aliases.some(i=>i.toLowerCase().includes(a))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}function fe(t){return t!=null&&typeof t=="object"&&"status"in t&&t.status==="failure"}function he(t){return t!=null&&typeof t=="object"&&"status"in t&&t.status==="success"&&"token"in t}function xe(t){return t!=null&&typeof t=="object"&&("data"in t&&!!t.data&&typeof t.data=="object"&&"enrich_token"in t.data&&!!t.data.enrich_token&&typeof t.data.enrich_token=="object"&&"userDirectoryJWT"in t.data.enrich_token||"errors"in t&&Array.isArray(t.errors))}function Be(t){let a=`${I(t.authHost)||"https://auth.pro.hasura.io"}/ddn/promptql/token`,r={token:"",expiry:new Date(0)},_=t.fetch||fetch,i=async()=>{let o=await _(a,{method:"POST",headers:t.headers});switch(o.status){case 200:{let n=await o.json();if(he(n))return n;throw new Error("malformed token response")}case 401:{let n=await o.json();throw fe(n)?new Error(n?.error||o.statusText):new Error(o.statusText)}default:{let n=await o.text();throw new Error(n)}}};return async()=>{if(r.expiry.getTime()<=Date.now()+1e3){let o=await i(),n=await Ge(t.promptqlGraphQLUrl,o.token,t.projectId,_);r.token=n;let p=new Date(o.expiry);if(Number.isNaN(p.getTime())){let b=new Date;b.setHours(1),r.expiry=b}else r.expiry=p}return r.token}}var Ge=async(t,e,a,r=fetch)=>{let _=await r(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:"mutation EnrichToken($luxJWT: String!, $projectId: uuid) { enrich_token(luxJWT: $luxJWT, projectId: $projectId) { userDirectoryJWT }}",variables:{luxJWT:e,projectId:a},operationName:"EnrichToken"})});switch(_.status){case 200:{let i=await _.json();if(!xe(i)||!i.data?.enrich_token?.userDirectoryJWT)throw new Error(`malformed promptql token response: ${JSON.stringify(i)}`);return i.data.enrich_token.userDirectoryJWT}default:{let i=await _.text();throw new Error(i)}}};var d="PromptQL TypeScript SDK";var u=require("@apollo/client"),ve=require("@apollo/client/link/context"),Ce=require("@apollo/client/link/subscriptions"),ke=require("graphql"),Oe=require("graphql-ws");var $=t=>{let e=new u.HttpLink({uri:t.url,fetch:t.fetch,headers:t.headers}),a=async n=>{let p=await t.getAuthToken();return{headers:{"User-Agent":d,...n,Authorization:`Bearer ${p}`}}},r=(0,Oe.createClient)({url:t.url,connectionParams:()=>a(t.headers),lazy:!0}),_=new Ce.GraphQLWsLink(r),i=new ve.SetContextLink(({headers:n})=>a(n)),o=u.ApolloLink.split(({operationType:n})=>n===ke.OperationTypeNode.SUBSCRIPTION,_,i.concat(e));return{client:new u.ApolloClient({link:o,cache:new u.InMemoryCache}),wsClient:r}};function Qe(t,e){if(!e.length)return[];if(!t.length)return e;let a=t[t.length-1];if(!a)return e;let r=BigInt(a.thread_event_id),_=e.length-1;for(;_>=0;_--){let i=e[_];if(BigInt(i?.thread_event_id)<=r)break}return e.slice(_+1)}function Le(t){return"UserMessage"in t?t.UserMessage:null}function Je(t){return"UserCancel"in t?t.UserCancel:null}function Ke(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)||!("PlanGenerationStarted"in t.AgentMessage.update.OrchestratorUpdate.update)?null:t.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function He(t){let e=A(t);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function $e(t){return"AgentMessage"in t?"content"in t.AgentMessage.update&&"interaction_update"in t.AgentMessage.update.content&&"main_agent"in t.AgentMessage.update.content.interaction_update&&"completed"in t.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:t.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:t.AgentMessage.update.timestamp,messageId:t.AgentMessage.message_id}:!("OrchestratorUpdate"in t.AgentMessage.update)||!("GeneratedResponse"in t.AgentMessage.update.OrchestratorUpdate.update)?null:{...t.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:t.AgentMessage.message_id}:null}function Xe(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("ProcessingStarted"in t.AgentMessage.update.MessageProcessingUpdate.update)?null:t.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function Ze(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function Ye(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function S(t){return!("AgentMessage"in t)||!("PlanningDecisionUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.PlanningDecisionUpdate.update}function et(t){let e=S(t);return!e||!("Started"in e)?null:e.Started}function tt(t){let e=S(t);return!e||!("Completed"in e)?null:e.Completed}function at(t){let e=S(t);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function rt(t){return!("AgentMessage"in t)||!("StartingOrchestrator"in t.AgentMessage.update)?null:t.AgentMessage.update.StartingOrchestrator}function A(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.OrchestratorUpdate.update}function c(t){let e=A(t);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function _t(t){let e=c(t);return!e||!("Started"in e)?null:e.Started}function nt(t){let e=c(t);return!e||!("Completed"in e)?null:e.Completed}function f(t){let e=c(t);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function it(t){let e=f(t);return!e||!("Started"in e)?null:e.Started}function ot(t){let e=f(t);return!e||!("Completed"in e)?null:e.Completed}function pt(t){let e=f(t);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function h(t){let e=c(t);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function st(t){let e=h(t);return!e||!("Started"in e)?null:e.Started}function ut(t){let e=h(t);return!e||!("Completed"in e)?null:e.Completed}function dt(t){let e=h(t);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function y(t){let e=c(t);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function yt(t){let e=y(t);return!e||!("Started"in e)?null:e.Started}function ct(t){let e=y(t);return!e||!("Completed"in e)?null:e.Completed}function lt(t){let e=y(t);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function bt(t){let e=y(t);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function mt(t){let e=y(t);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function It(t){let e=y(t);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function x(t){let e=A(t);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function Mt(t){let e=x(t);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function gt(t){let e=x(t);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function St(t){let e=x(t);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function At(t){if(!("AgentMessage"in t))return null;if("InteractionFinished"in t.AgentMessage.update){let e=t.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:t.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:t.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:t.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:{status:"unknown",messageId:t.AgentMessage.message_id}}if("content"in t.AgentMessage.update&&"interaction_finished"in t.AgentMessage.update.content){let e=t.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:t.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:t.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:t.AgentMessage.message_id}}return null}function ft(t){if(t){if("UserMessage"in t)return t.UserMessage.message_id;if("AgentMessage"in t)return t.AgentMessage.message_id;if("UserTeach"in t)return t.UserTeach.agent_message_id;if("UserCancel"in t)return t.UserCancel.message_id}}function X(t){return`https://promptql.${t}/playground-v2-hge/v1/graphql`}var B=class{controlPlaneUrl;options;defaultTimezone;getAuthTokenFn;project;client;wsClient;constructor(e){if(this.options=e,!e.serviceAccountToken)throw new Error("serviceAccountToken must not be empty. If you haven't created any service account token yet, check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let a=e.controlPlaneHost?I(e.controlPlaneHost):"https://data.pro.hasura.io";this.controlPlaneUrl=`${a}/v1/graphql`}async getAuthToken(){if(typeof this.getAuthTokenFn=="function")return this.getAuthTokenFn();let e=await this.getProjectInfo();return this.getAuthTokenFn=Be({promptqlGraphQLUrl:e.promptqlGraphQLUrl,authHost:this.options.authHost,headers:Ee(this.options.serviceAccountToken),fetch:this.options.fetch}),this.getAuthTokenFn()}async getGraphQLClient(){if(this.client)return this.client;let e=await this.getProjectInfo(),{client:a,wsClient:r}=$({getAuthToken:this.getAuthToken.bind(this),url:e.promptqlGraphQLUrl,fetch:this.options.fetch,headers:this.options.headers});return this.wsClient=r,this.client=a,this.client}async getProjectInfo(){if(this.project)return this.project;let e={operationName:"GetDdnProjects",query:"query GetDdnProjects { ddn_projects(limit: 1) { id name private_ddn { fqdn path_routing_context path_routing_enabled }}}"},r=await(typeof this.options.fetch=="function"?this.options.fetch:fetch)(this.controlPlaneUrl,{method:"POST",headers:{...Ee(this.options.serviceAccountToken),"User-Agent":d,"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!==200){let o=r.body?await r.text():r.statusText;throw new Error(`[${r.status}] failed to get project info: ${o}`)}let _=await r.json();if(!_.data?.ddn_projects?.length)throw new Error("Project not found");let i=_.data.ddn_projects[0];return this.project={projectId:i.id,projectName:i.name,projectHost:`https://${i.name}.${i.private_ddn.fqdn}`,promptqlConsoleUrl:`https://prompt.ql.app/project/${i.name}`,promptqlGraphQLUrl:X(i.private_ddn.fqdn)},this.project}close(){if(this.wsClient&&(this.wsClient.dispose(),this.wsClient=void 0),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.client=void 0,this.project=void 0,this.getAuthTokenFn=void 0}}};function Ee(t){return{Authorization:`pat ${t}`}}var v=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return R(r,a.projectId,e)}async download(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return T(r.projectHost,e,a,Pe(_),this.api.options.fetch)}async getMetadata(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return U(r.projectHost,e,a,Pe(_),this.api.options.fetch)}};function Pe(t){return{Authorization:`Bearer ${t}`,"User-Agent":d}}var C=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var k=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return m(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){let a=await this.api.getGraphQLClient();return m(a,{where:{name:{_eq:e}},limit:1}).then(r=>r.length?r[0]??null:null)}async create(e){let a=await this.api.getGraphQLClient();return w(a,e)}};var l=require("rxjs");var O=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return j(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");let a=await this.api.getGraphQLClient();return V(a,e)}async start(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return N(r,{...e,projectId:a.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async getEvents(e,a){let r=await this.api.getGraphQLClient();return M(r,e,a)}async sendMessage(e){let a=await this.api.getGraphQLClient();return W(a,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){let a=await this.api.getGraphQLClient();return q(a,e)}subscribeEvents(e,a){return(0,l.from)(this.api.getGraphQLClient()).pipe((0,l.switchMap)(r=>z(r,e,a)))}streamMessageEvents(e,a){return(0,l.from)(this.api.getGraphQLClient()).pipe((0,l.switchMap)(r=>D(r,e,a)))}};var E=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return G(a,e)}async search(e){let a=await this.api.getGraphQLClient();return Q(a,e)}async get(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getGraphQLClient();return L(_,r.projectId,e,a)}async create(e){let a=await this.api.getGraphQLClient();return J(a,e)}async update(e,a){let r=await this.api.getGraphQLClient();return K(r,e,a)}async delete(e){let a=await this.api.getGraphQLClient();return H(a,e)}};var Z=class{constructor(e){let a=new B(e);this.api=a,this.thread=new O(a),this.project=new C(a),this.room=new k(a),this.artifact=new v(a),this.wiki=new E(a)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};0&&(module.exports={PromptQLSdk,ROOM_NAME_REGEX,USER_AGENT,buildPromptQLUrl,cancelAgentMessage,createApolloClient,createRoom,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,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 C,b as k,c as g,g as O}from"./chunk-JCZJQNYI.mjs";var E={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"}}]}}]}}]},T={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SendThreadMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_thread_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},R={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"}}]}}]}}]},w={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"}}]}}]}}]},F={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"}}]}}]}}]},j={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"}}]}}]}}]}}]},V={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"}}]}}]}}]},N={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"}}]}}]}}]},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"}}]}}]},q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreads"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_order_by"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]},G={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_id"}}]}}]};async function J(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/data`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let ge=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to download artifact: ${ge}`)}return n.body?n.headers.get("Content-Type")?.startsWith("application/json")?n.json():n.text():null}async function H(t,e,a){let r=await t.query({query:j,variables:{threadId:a},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(_=>_.latest_version_object).map(_=>({project_id:e,artifact_id:_.artifact_id,artifact_type:_.latest_version_object.artifact_type,version:_.latest_version_object.version,title:_.latest_version_object.title,description:_.latest_version_object.description??null,user_id:_.latest_version_object.user_id,metadata:_.latest_version_object.artifact_metadata,created_at:_.latest_version_object.created_at,size_bytes:Number.parseInt(_.latest_version_object.size)})):[]}async function $(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/metadata`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let p=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to get artifact metadata: ${p}`)}return n.json()}function S(t,e){return t.query({query:W,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.rooms??[])}function Z(t,e){if(!e.name)throw new Error("Room name is required");let a=Ae(e.name);if(a)throw new Error(a);return t.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 Se=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,X=80,Ae=t=>{let e=t.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.":Se.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};import{defer as fe,map as he,repeat as xe,takeWhile as Be}from"rxjs";function Y(t,e){return t.query({query:q,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2??[])}function ee(t,e){if(!e)throw new Error("threadId is required");return t.query({query:z,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2_by_pk)}function te(t,e){if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:R,variables:e}).then(a=>{if(!a.data?.start_thread)throw new Error(a.error?.message||"Failed to start thread");return a.data.start_thread})}function A(t,e,a){if(!e)throw new Error("threadId is required");let r={thread_id:{_eq:e}};return a&&(a.eventId&&(r.thread_event_id=a.eventId),a.messageId&&(r._or=Ce(a.messageId))),t.query({query:D,variables:{where:r,limit:a?.limit,ordering:a?.ordering||"asc"},fetchPolicy:"no-cache"}).then(_=>_.data?.thread_events??[])}function ae(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:T,variables:e}).then(a=>{if(!a.data?.send_thread_message)throw new Error(a.error?.message||"Failed to send message to thread");return a.data.send_thread_message})}function re(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return t.mutate({mutation:E,variables:e}).then(a=>{if(!a.data?.cancel_agent_message)throw new Error(a.error?.message||"Failed to cancel thread");return a.data.cancel_agent_message})}function _e(t,e,a){if(!e)throw new Error("threadId is required");g(a);let r={thread_id:{_eq:e}};return a&&(r.thread_event_id={_gte:a}),t.subscribe({query:K,variables:{where:r}}).pipe(he(_=>{if(_.error)throw _.error;return _.data?.thread_events??[]}))}function ne(t,e,a){if(!e)throw new Error("threadId is required");let r,_=g(a?.fromEventId),i={eventId:a?.fromEventId?{_gte:_}:void 0,messageId:a?.messageId},o=a?.pollingInterval&&a?.pollingInterval>0?a.pollingInterval:5;return fe(async()=>{let n=r?{messageId:a?.messageId,eventId:{_gt:r}}:i,p=await A(t,e,n);return p.length>0&&(r=p[p.length-1]?.thread_event_id),p}).pipe(xe({count:a?.timeout&&a.timeout>0?Math.ceil(a.timeout/o):void 0,delay:o*1e3}),Be(n=>ve(n,a?.skipAnalysis),!0))}function ve(t,e){for(let a=t.length-1;a>=0;a--){let r=t[a];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let _=r.event_data.AgentMessage.update;if("content"in _&&("interaction_finished"in _.content||e&&"interaction_update"in _.content&&"main_agent"in _.content.interaction_update&&"completed"in _.content.interaction_update.main_agent)||"InteractionFinished"in _||e&&"OrchestratorUpdate"in _&&"GeneratedResponse"in _.OrchestratorUpdate.update)return!1}return!0}function Ce(t){return[{event_data:{_contains:{UserMessage:{message_id:t}}}},{event_data:{_contains:{AgentMessage:{message_id:t}}}},{event_data:{_contains:{UserCancel:{message_id:t}}}}]}var y=["guide","regular"];async function ie(t,e){let a=e.namespace||"regular";if(!y.includes(a))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(a==="guide"){let o={deleted_at:{_is_null:!0}};return e.project_id&&(o.project_id={_eq:e.project_id}),e.query&&(o.page_title={_ilike:e.query.toLowerCase()}),Oe(t,{where:o,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,_={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||(_.offset=e.offset,_.limit=e.limit);let i=await ke(t,_);return r?Te(i,e):i}async function oe(t,e){if(!e.query)throw new Error("query is required");return t.query({query:L,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki_search??{totalCount:0,results:[]})}async function pe(t,e,a,r){if(a=a||"regular",!y.includes(a))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(a==="guide")return Pe(t,{project_id:e,page_id:r});let _={project_id:{_eq:e},deleted_at:{_is_null:!0}};return C.test(r)?_.id={_eq:r}:_.page_id={_eq:r},Ee(t,{where:_})}function se(t,{slug:e,...a}){if(!a.title)throw new Error("Wiki title is required");if(!a.stub&&!a.definition)throw new Error("Wiki definition is required");return t.mutate({mutation:U,variables:{pageId:e,pageContent:a},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function ue(t,e,a){if(!e)throw new Error("ID of the wiki is required");return t.mutate({mutation:w,variables:{id:e,pageContent:a},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function de(t,e){if(!e)throw new Error("ID of the wiki is required");return t.mutate({mutation:F,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki_delete?.buildVersion)}function ke(t,e){return t.query({query:G,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki.map(({page_id:r,..._})=>({..._,slug:r}))??[])}function Oe(t,e){return t.query({query:V,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_guide_page?.map(r=>({id:r.id,slug:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function Ee(t,e){let a=await t.query({query:Q,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(_=>({id:_.id,slug:_.page_id,created_at:_.created_at,last_modified_at:_.last_modified_at,..._.content}))??[]);return a.length?a[0]:null}async function Pe(t,e){let a=await t.query({query:N,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(_=>({id:_.id,slug:_.id,created_at:_.created_at,last_modified_at:_.last_modified_at,title:_.page_title,details:_.details}))??[]);return a.length?a[0]:null}function Te(t,e){if(!t.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return t;let a=e.query?.toLowerCase(),r=t.filter(_=>!e.include_stub&&_.stub?!1:!!(!a||_.title.toLowerCase().includes(a)||_.definition&&_.definition.toLowerCase().includes(a)||_.aliases?.length&&_.aliases.some(i=>i.toLowerCase().includes(a))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}var s="PromptQL TypeScript SDK";import{ApolloClient as Re,ApolloLink as Ue,HttpLink as we,InMemoryCache as Fe}from"@apollo/client";import{SetContextLink as je}from"@apollo/client/link/context";import{GraphQLWsLink as Ve}from"@apollo/client/link/subscriptions";import{OperationTypeNode as Ne}from"graphql";import{createClient as We}from"graphql-ws";var ye=t=>{let e=new we({uri:t.url,fetch:t.fetch,headers:t.headers}),a=async n=>{let p=await t.getAuthToken();return{headers:{"User-Agent":s,...n,Authorization:`Bearer ${p}`}}},r=We({url:t.url,connectionParams:()=>a(t.headers),lazy:!0}),_=new Ve(r),i=new je(({headers:n})=>a(n)),o=Ue.split(({operationType:n})=>n===Ne.SUBSCRIPTION,_,i.concat(e));return{client:new Re({link:o,cache:new Fe}),wsClient:r}};function Et(t,e){if(!e.length)return[];if(!t.length)return e;let a=t[t.length-1];if(!a)return e;let r=BigInt(a.thread_event_id),_=e.length-1;for(;_>=0;_--){let i=e[_];if(BigInt(i?.thread_event_id)<=r)break}return e.slice(_+1)}function Pt(t){return"UserMessage"in t?t.UserMessage:null}function Tt(t){return"UserCancel"in t?t.UserCancel:null}function Rt(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)||!("PlanGenerationStarted"in t.AgentMessage.update.OrchestratorUpdate.update)?null:t.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function Ut(t){let e=h(t);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function wt(t){return"AgentMessage"in t?"content"in t.AgentMessage.update&&"interaction_update"in t.AgentMessage.update.content&&"main_agent"in t.AgentMessage.update.content.interaction_update&&"completed"in t.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:t.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:t.AgentMessage.update.timestamp,messageId:t.AgentMessage.message_id}:!("OrchestratorUpdate"in t.AgentMessage.update)||!("GeneratedResponse"in t.AgentMessage.update.OrchestratorUpdate.update)?null:{...t.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:t.AgentMessage.message_id}:null}function Ft(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("ProcessingStarted"in t.AgentMessage.update.MessageProcessingUpdate.update)?null:t.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function jt(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function Vt(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function f(t){return!("AgentMessage"in t)||!("PlanningDecisionUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.PlanningDecisionUpdate.update}function Nt(t){let e=f(t);return!e||!("Started"in e)?null:e.Started}function Wt(t){let e=f(t);return!e||!("Completed"in e)?null:e.Completed}function qt(t){let e=f(t);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function zt(t){return!("AgentMessage"in t)||!("StartingOrchestrator"in t.AgentMessage.update)?null:t.AgentMessage.update.StartingOrchestrator}function h(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.OrchestratorUpdate.update}function d(t){let e=h(t);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function Dt(t){let e=d(t);return!e||!("Started"in e)?null:e.Started}function Gt(t){let e=d(t);return!e||!("Completed"in e)?null:e.Completed}function x(t){let e=d(t);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function Qt(t){let e=x(t);return!e||!("Started"in e)?null:e.Started}function Lt(t){let e=x(t);return!e||!("Completed"in e)?null:e.Completed}function Kt(t){let e=x(t);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function B(t){let e=d(t);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function Jt(t){let e=B(t);return!e||!("Started"in e)?null:e.Started}function Ht(t){let e=B(t);return!e||!("Completed"in e)?null:e.Completed}function $t(t){let e=B(t);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function u(t){let e=d(t);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function Xt(t){let e=u(t);return!e||!("Started"in e)?null:e.Started}function Zt(t){let e=u(t);return!e||!("Completed"in e)?null:e.Completed}function Yt(t){let e=u(t);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function ea(t){let e=u(t);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function ta(t){let e=u(t);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function aa(t){let e=u(t);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function v(t){let e=h(t);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function ra(t){let e=v(t);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function _a(t){let e=v(t);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function na(t){let e=v(t);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function ia(t){if(!("AgentMessage"in t))return null;if("InteractionFinished"in t.AgentMessage.update){let e=t.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:t.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:t.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:t.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:{status:"unknown",messageId:t.AgentMessage.message_id}}if("content"in t.AgentMessage.update&&"interaction_finished"in t.AgentMessage.update.content){let e=t.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:t.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:t.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:t.AgentMessage.message_id}}return null}function oa(t){if(t){if("UserMessage"in t)return t.UserMessage.message_id;if("AgentMessage"in t)return t.AgentMessage.message_id;if("UserTeach"in t)return t.UserTeach.agent_message_id;if("UserCancel"in t)return t.UserCancel.message_id}}function ce(t){return`https://promptql.${t}/playground-v2-hge/v1/graphql`}var c=class{controlPlaneUrl;options;defaultTimezone;getAuthTokenFn;project;client;wsClient;constructor(e){if(this.options=e,!e.serviceAccountToken)throw new Error("serviceAccountToken must not be empty. If you haven't created any service account token yet, check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let a=e.controlPlaneHost?k(e.controlPlaneHost):"https://data.pro.hasura.io";this.controlPlaneUrl=`${a}/v1/graphql`}async getAuthToken(){if(typeof this.getAuthTokenFn=="function")return this.getAuthTokenFn();let e=await this.getProjectInfo();return this.getAuthTokenFn=O({promptqlGraphQLUrl:e.promptqlGraphQLUrl,authHost:this.options.authHost,headers:le(this.options.serviceAccountToken),fetch:this.options.fetch}),this.getAuthTokenFn()}async getGraphQLClient(){if(this.client)return this.client;let e=await this.getProjectInfo(),{client:a,wsClient:r}=ye({getAuthToken:this.getAuthToken.bind(this),url:e.promptqlGraphQLUrl,fetch:this.options.fetch,headers:this.options.headers});return this.wsClient=r,this.client=a,this.client}async getProjectInfo(){if(this.project)return this.project;let e={operationName:"GetDdnProjects",query:"query GetDdnProjects { ddn_projects(limit: 1) { id name private_ddn { fqdn path_routing_context path_routing_enabled }}}"},r=await(typeof this.options.fetch=="function"?this.options.fetch:fetch)(this.controlPlaneUrl,{method:"POST",headers:{...le(this.options.serviceAccountToken),"User-Agent":s,"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!==200){let o=r.body?await r.text():r.statusText;throw new Error(`[${r.status}] failed to get project info: ${o}`)}let _=await r.json();if(!_.data?.ddn_projects?.length)throw new Error("Project not found");let i=_.data.ddn_projects[0];return this.project={projectId:i.id,projectName:i.name,projectHost:`https://${i.name}.${i.private_ddn.fqdn}`,promptqlConsoleUrl:`https://prompt.ql.app/project/${i.name}`,promptqlGraphQLUrl:ce(i.private_ddn.fqdn)},this.project}close(){if(this.wsClient&&(this.wsClient.dispose(),this.wsClient=void 0),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.client=void 0,this.project=void 0,this.getAuthTokenFn=void 0}}};function le(t){return{Authorization:`pat ${t}`}}var l=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return H(r,a.projectId,e)}async download(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return J(r.projectHost,e,a,be(_),this.api.options.fetch)}async getMetadata(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return $(r.projectHost,e,a,be(_),this.api.options.fetch)}};function be(t){return{Authorization:`Bearer ${t}`,"User-Agent":s}}var b=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var m=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return S(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){let a=await this.api.getGraphQLClient();return S(a,{where:{name:{_eq:e}},limit:1}).then(r=>r.length?r[0]??null:null)}async create(e){let a=await this.api.getGraphQLClient();return Z(a,e)}};import{from as me,switchMap as Ie}from"rxjs";var I=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return Y(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");let a=await this.api.getGraphQLClient();return ee(a,e)}async start(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return te(r,{...e,projectId:a.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async getEvents(e,a){let r=await this.api.getGraphQLClient();return A(r,e,a)}async sendMessage(e){let a=await this.api.getGraphQLClient();return ae(a,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){let a=await this.api.getGraphQLClient();return re(a,e)}subscribeEvents(e,a){return me(this.api.getGraphQLClient()).pipe(Ie(r=>_e(r,e,a)))}streamMessageEvents(e,a){return me(this.api.getGraphQLClient()).pipe(Ie(r=>ne(r,e,a)))}};var M=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return ie(a,e)}async search(e){let a=await this.api.getGraphQLClient();return oe(a,e)}async get(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getGraphQLClient();return pe(_,r.projectId,e,a)}async create(e){let a=await this.api.getGraphQLClient();return se(a,e)}async update(e,a){let r=await this.api.getGraphQLClient();return ue(r,e,a)}async delete(e){let a=await this.api.getGraphQLClient();return de(a,e)}};var Me=class{constructor(e){let a=new c(e);this.api=a,this.thread=new I(a),this.project=new b(a),this.room=new m(a),this.artifact=new l(a),this.wiki=new M(a)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};export{Me as PromptQLSdk,Se as ROOM_NAME_REGEX,s as USER_AGENT,ce as buildPromptQLUrl,re as cancelAgentMessage,ye as createApolloClient,Z as createRoom,se as createWikiPage,de as deleteWikiPage,Et as diffThreadEvents,J as downloadArtifactData,wt as getAgentGeneratedResponse,jt as getAgentInteractionDecisionAcceptInteractionEvent,Vt as getAgentInteractionDecisionDeclineInteractionEvent,ia as getAgentInteractionFinishedEvent,Ft as getAgentMessageProcessingStartedEvent,Gt as getAgentOrchestratorContextExplorerCompletedEvent,Dt as getAgentOrchestratorContextExplorerStartedEvent,d as getAgentOrchestratorContextExplorerUpdateEvent,Yt as getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,ea as getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,Zt as getAgentOrchestratorSchemaExplorerCompletedEvent,ta as getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,aa as getAgentOrchestratorSchemaExplorerSchemaExploredEvent,Xt as getAgentOrchestratorSchemaExplorerStartedEvent,u as getAgentOrchestratorSchemaExplorerUpdateEvent,$t as getAgentOrchestratorSchemaTasksGeneratedEvent,Ht as getAgentOrchestratorSchemaTasksGenerationCompletedEvent,Jt as getAgentOrchestratorSchemaTasksGenerationStartedEvent,B as getAgentOrchestratorSchemaTasksGenerationUpdateEvent,ra as getAgentOrchestratorStepProgrammerEvent,na as getAgentOrchestratorStepSavedProgramRunnerEvent,_a as getAgentOrchestratorStepUiProgrammerEvent,v as getAgentOrchestratorStepUpdateEvent,h as getAgentOrchestratorUpdateEvent,Lt as getAgentOrchestratorWikiExplorerCompletedEvent,Qt as getAgentOrchestratorWikiExplorerStartedEvent,x as getAgentOrchestratorWikiExplorerUpdateEvent,Kt as getAgentOrchestratorWikiInfoGeneratedEvent,Rt as getAgentPlanGenerationStartedEvent,Ut as getAgentPlanStepGeneratedEvent,Wt as getAgentPlanningDecisionCompletedEvent,qt as getAgentPlanningDecisionPlanningRequiredEvent,Nt as getAgentPlanningDecisionStartedEvent,f as getAgentPlanningDecisionUpdateEvent,zt as getAgentStartingOrchestratorEvent,$ as getArtifactMetadata,ee as getThread,oa as getThreadEventMessageId,A as getThreadEvents,Tt as getUserCancelEvent,Pt as getUserMessageEvent,pe as getWikiPage,ve as isInteractionAnalyzing,H as listArtifactMetadataByThreadId,S as listRooms,Y as listThreads,ie as listWikiPages,oe as searchWikiPages,ae as sendThreadMessage,te as startThread,ne as streamThreadMessageEvents,_e as subscribeThreadEvents,ue as updateWikiPage,Ae as validateRoomName};
|
|
1
|
+
import{a as C,b as k,c as g,g as O}from"./chunk-JCZJQNYI.mjs";var E={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"}}]}}]}}]},T={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SendThreadMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_thread_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},R={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"}}]}}]}}]},w={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"}}]}}]}}]},F={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"}}]}}]}}]},j={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"}}]}}]}}]}}]},V={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"}}]}}]}}]},N={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"}}]}}]}}]},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"}}]}}]},q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreads"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_order_by"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"is_active"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user_id"}}]}}]},G={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_id"}}]}}]};async function J(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/data`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let ge=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to download artifact: ${ge}`)}return n.body?n.headers.get("Content-Type")?.startsWith("application/json")?n.json():n.text():null}async function H(t,e,a){let r=await t.query({query:j,variables:{threadId:a},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(_=>_.latest_version_object).map(_=>({project_id:e,artifact_id:_.artifact_id,artifact_type:_.latest_version_object.artifact_type,version:_.latest_version_object.version,title:_.latest_version_object.title,description:_.latest_version_object.description??null,user_id:_.latest_version_object.user_id,metadata:_.latest_version_object.artifact_metadata,created_at:_.latest_version_object.created_at,size_bytes:Number.parseInt(_.latest_version_object.size)})):[]}async function $(t,e,a,r,_){let i=`${t}/promptql-v2/artifacts/${e}/version/${a}/metadata`,n=await(typeof _=="function"?_:fetch)(i,{method:"GET",headers:r});if(n.status!==200){let p=n.body?await n.text():n.statusText;throw new Error(`[${n.status}] failed to get artifact metadata: ${p}`)}return n.json()}function S(t,e){return t.query({query:W,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.rooms??[])}function Z(t,e){if(!e.name)throw new Error("Room name is required");let a=Ae(e.name);if(a)throw new Error(a);return t.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 Se=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,X=80,Ae=t=>{let e=t.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.":Se.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};import{defer as fe,map as he,repeat as xe,takeWhile as Be}from"rxjs";function Y(t,e){return t.query({query:q,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2??[])}function ee(t,e){if(!e)throw new Error("threadId is required");return t.query({query:z,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.threads_v2_by_pk)}function te(t,e){if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:R,variables:e}).then(a=>{if(!a.data?.start_thread)throw new Error(a.error?.message||"Failed to start thread");return a.data.start_thread})}function A(t,e,a){if(!e)throw new Error("threadId is required");let r={thread_id:{_eq:e}};return a&&(a.eventId&&(r.thread_event_id=a.eventId),a.messageId&&(r._or=Ce(a.messageId))),t.query({query:D,variables:{where:r,limit:a?.limit,ordering:a?.ordering||"asc"},fetchPolicy:"no-cache"}).then(_=>_.data?.thread_events??[])}function ae(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return t.mutate({mutation:T,variables:e}).then(a=>{if(!a.data?.send_thread_message)throw new Error(a.error?.message||"Failed to send message to thread");return a.data.send_thread_message})}function re(t,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return t.mutate({mutation:E,variables:e}).then(a=>{if(!a.data?.cancel_agent_message)throw new Error(a.error?.message||"Failed to cancel thread");return a.data.cancel_agent_message})}function _e(t,e,a){if(!e)throw new Error("threadId is required");g(a);let r={thread_id:{_eq:e}};return a&&(r.thread_event_id={_gte:a}),t.subscribe({query:K,variables:{where:r}}).pipe(he(_=>{if(_.error)throw _.error;return _.data?.thread_events??[]}))}function ne(t,e,a){if(!e)throw new Error("threadId is required");let r,_=g(a?.fromEventId),i={eventId:a?.fromEventId?{_gte:_}:void 0,messageId:a?.messageId},o=a?.pollingInterval&&a?.pollingInterval>0?a.pollingInterval:5;return fe(async()=>{let n=r?{messageId:a?.messageId,eventId:{_gt:r}}:i,p=await A(t,e,n);return p.length>0&&(r=p[p.length-1]?.thread_event_id),p}).pipe(xe({count:a?.timeout&&a.timeout>0?Math.ceil(a.timeout/o):void 0,delay:o*1e3}),Be(n=>ve(n,a?.skipAnalysis),!0))}function ve(t,e){for(let a=t.length-1;a>=0;a--){let r=t[a];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let _=r.event_data.AgentMessage.update;if("content"in _&&("interaction_finished"in _.content||e&&"interaction_update"in _.content&&"main_agent"in _.content.interaction_update&&"completed"in _.content.interaction_update.main_agent)||"InteractionFinished"in _||e&&"OrchestratorUpdate"in _&&"GeneratedResponse"in _.OrchestratorUpdate.update)return!1}return!0}function Ce(t){return[{event_data:{_contains:{UserMessage:{message_id:t}}}},{event_data:{_contains:{AgentMessage:{message_id:t}}}},{event_data:{_contains:{UserCancel:{message_id:t}}}}]}var y=["guide","regular"];async function ie(t,e){let a=e.namespace||"regular";if(!y.includes(a))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(a==="guide"){let o={deleted_at:{_is_null:!0}};return e.project_id&&(o.project_id={_eq:e.project_id}),e.query&&(o.page_title={_ilike:e.query.toLowerCase()}),Oe(t,{where:o,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,_={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||(_.offset=e.offset,_.limit=e.limit);let i=await ke(t,_);return r?Te(i,e):i}async function oe(t,e){if(!e.query)throw new Error("query is required");return t.query({query:L,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki_search?{totalCount:a.data.admin_wiki_search.totalCount,results:a.data?.admin_wiki_search.results.map(({score:r,metadata:_,page:{id:i,...o}})=>({...o,score:r,stable_id:_.id,slug:i,created_at:_.createdAt,last_modified_at:_.lastUpdatedAt}))}:{totalCount:0,results:[]})}async function pe(t,e,a,r){if(a=a||"regular",!y.includes(a))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(a==="guide")return Pe(t,{project_id:e,page_id:r});let _={project_id:{_eq:e},deleted_at:{_is_null:!0}};return C.test(r)?_.id={_eq:r}:_.page_id={_eq:r},Ee(t,{where:_})}function se(t,{slug:e,...a}){if(!a.title)throw new Error("Wiki title is required");if(!a.stub&&!a.definition)throw new Error("Wiki definition is required");return t.mutate({mutation:U,variables:{pageId:e,pageContent:a},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function ue(t,e,a){if(!e)throw new Error("ID of the wiki is required");return t.mutate({mutation:w,variables:{id:e,pageContent:a},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function de(t,e){if(!e)throw new Error("ID of the wiki is required");return t.mutate({mutation:F,variables:{id:e},fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki_delete?.buildVersion)}function ke(t,e){return t.query({query:G,variables:e,fetchPolicy:"no-cache"}).then(a=>a.data?.admin_wiki.map(({page_id:r,id:_,...i})=>({...i,stable_id:_,slug:r}))??[])}function Oe(t,e){return t.query({query:V,variables:e,fetchPolicy:"no-cache"}).then(a=>a.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 Ee(t,e){let a=await t.query({query:Q,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(_=>({stable_id:_.id,slug:_.page_id,created_at:_.created_at,last_modified_at:_.last_modified_at,..._.content}))??[]);return a.length?a[0]:null}async function Pe(t,e){let a=await t.query({query:N,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(_=>({stable_id:_.id,slug:_.id,created_at:_.created_at,last_modified_at:_.last_modified_at,title:_.page_title,details:_.details}))??[]);return a.length?a[0]:null}function Te(t,e){if(!t.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return t;let a=e.query?.toLowerCase(),r=t.filter(_=>!e.include_stub&&_.stub?!1:!!(!a||_.title.toLowerCase().includes(a)||_.definition&&_.definition.toLowerCase().includes(a)||_.aliases?.length&&_.aliases.some(i=>i.toLowerCase().includes(a))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}var s="PromptQL TypeScript SDK";import{ApolloClient as Re,ApolloLink as Ue,HttpLink as we,InMemoryCache as Fe}from"@apollo/client";import{SetContextLink as je}from"@apollo/client/link/context";import{GraphQLWsLink as Ve}from"@apollo/client/link/subscriptions";import{OperationTypeNode as Ne}from"graphql";import{createClient as We}from"graphql-ws";var ye=t=>{let e=new we({uri:t.url,fetch:t.fetch,headers:t.headers}),a=async n=>{let p=await t.getAuthToken();return{headers:{"User-Agent":s,...n,Authorization:`Bearer ${p}`}}},r=We({url:t.url,connectionParams:()=>a(t.headers),lazy:!0}),_=new Ve(r),i=new je(({headers:n})=>a(n)),o=Ue.split(({operationType:n})=>n===Ne.SUBSCRIPTION,_,i.concat(e));return{client:new Re({link:o,cache:new Fe}),wsClient:r}};function Ot(t,e){if(!e.length)return[];if(!t.length)return e;let a=t[t.length-1];if(!a)return e;let r=BigInt(a.thread_event_id),_=e.length-1;for(;_>=0;_--){let i=e[_];if(BigInt(i?.thread_event_id)<=r)break}return e.slice(_+1)}function Et(t){return"UserMessage"in t?t.UserMessage:null}function Pt(t){return"UserCancel"in t?t.UserCancel:null}function Tt(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)||!("PlanGenerationStarted"in t.AgentMessage.update.OrchestratorUpdate.update)?null:t.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function Rt(t){let e=h(t);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function Ut(t){return"AgentMessage"in t?"content"in t.AgentMessage.update&&"interaction_update"in t.AgentMessage.update.content&&"main_agent"in t.AgentMessage.update.content.interaction_update&&"completed"in t.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:t.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:t.AgentMessage.update.timestamp,messageId:t.AgentMessage.message_id}:!("OrchestratorUpdate"in t.AgentMessage.update)||!("GeneratedResponse"in t.AgentMessage.update.OrchestratorUpdate.update)?null:{...t.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:t.AgentMessage.message_id}:null}function wt(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("ProcessingStarted"in t.AgentMessage.update.MessageProcessingUpdate.update)?null:t.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function Ft(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function jt(t){return!("AgentMessage"in t)||!("MessageProcessingUpdate"in t.AgentMessage.update)||!("InteractionDecision"in t.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:t.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function f(t){return!("AgentMessage"in t)||!("PlanningDecisionUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.PlanningDecisionUpdate.update}function Vt(t){let e=f(t);return!e||!("Started"in e)?null:e.Started}function Nt(t){let e=f(t);return!e||!("Completed"in e)?null:e.Completed}function Wt(t){let e=f(t);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function qt(t){return!("AgentMessage"in t)||!("StartingOrchestrator"in t.AgentMessage.update)?null:t.AgentMessage.update.StartingOrchestrator}function h(t){return!("AgentMessage"in t)||!("OrchestratorUpdate"in t.AgentMessage.update)?null:t.AgentMessage.update.OrchestratorUpdate.update}function d(t){let e=h(t);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function zt(t){let e=d(t);return!e||!("Started"in e)?null:e.Started}function Dt(t){let e=d(t);return!e||!("Completed"in e)?null:e.Completed}function x(t){let e=d(t);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function Gt(t){let e=x(t);return!e||!("Started"in e)?null:e.Started}function Qt(t){let e=x(t);return!e||!("Completed"in e)?null:e.Completed}function Lt(t){let e=x(t);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function B(t){let e=d(t);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function Kt(t){let e=B(t);return!e||!("Started"in e)?null:e.Started}function Jt(t){let e=B(t);return!e||!("Completed"in e)?null:e.Completed}function Ht(t){let e=B(t);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function u(t){let e=d(t);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function $t(t){let e=u(t);return!e||!("Started"in e)?null:e.Started}function Xt(t){let e=u(t);return!e||!("Completed"in e)?null:e.Completed}function Zt(t){let e=u(t);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function Yt(t){let e=u(t);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function ea(t){let e=u(t);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function ta(t){let e=u(t);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function v(t){let e=h(t);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function aa(t){let e=v(t);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function ra(t){let e=v(t);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function _a(t){let e=v(t);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function na(t){if(!("AgentMessage"in t))return null;if("InteractionFinished"in t.AgentMessage.update){let e=t.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:t.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:t.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:t.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:t.AgentMessage.message_id}:{status:"unknown",messageId:t.AgentMessage.message_id}}if("content"in t.AgentMessage.update&&"interaction_finished"in t.AgentMessage.update.content){let e=t.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:t.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:t.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:t.AgentMessage.message_id,timestamp:t.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:t.AgentMessage.message_id}}return null}function ia(t){if(t){if("UserMessage"in t)return t.UserMessage.message_id;if("AgentMessage"in t)return t.AgentMessage.message_id;if("UserTeach"in t)return t.UserTeach.agent_message_id;if("UserCancel"in t)return t.UserCancel.message_id}}function ce(t){return`https://promptql.${t}/playground-v2-hge/v1/graphql`}var c=class{controlPlaneUrl;options;defaultTimezone;getAuthTokenFn;project;client;wsClient;constructor(e){if(this.options=e,!e.serviceAccountToken)throw new Error("serviceAccountToken must not be empty. If you haven't created any service account token yet, check out Hasura docs https://hasura.io/docs/3.0/project-configuration/project-management/service-accounts/#how-to-create-service-account");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let a=e.controlPlaneHost?k(e.controlPlaneHost):"https://data.pro.hasura.io";this.controlPlaneUrl=`${a}/v1/graphql`}async getAuthToken(){if(typeof this.getAuthTokenFn=="function")return this.getAuthTokenFn();let e=await this.getProjectInfo();return this.getAuthTokenFn=O({promptqlGraphQLUrl:e.promptqlGraphQLUrl,authHost:this.options.authHost,headers:le(this.options.serviceAccountToken),fetch:this.options.fetch}),this.getAuthTokenFn()}async getGraphQLClient(){if(this.client)return this.client;let e=await this.getProjectInfo(),{client:a,wsClient:r}=ye({getAuthToken:this.getAuthToken.bind(this),url:e.promptqlGraphQLUrl,fetch:this.options.fetch,headers:this.options.headers});return this.wsClient=r,this.client=a,this.client}async getProjectInfo(){if(this.project)return this.project;let e={operationName:"GetDdnProjects",query:"query GetDdnProjects { ddn_projects(limit: 1) { id name private_ddn { fqdn path_routing_context path_routing_enabled }}}"},r=await(typeof this.options.fetch=="function"?this.options.fetch:fetch)(this.controlPlaneUrl,{method:"POST",headers:{...le(this.options.serviceAccountToken),"User-Agent":s,"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!==200){let o=r.body?await r.text():r.statusText;throw new Error(`[${r.status}] failed to get project info: ${o}`)}let _=await r.json();if(!_.data?.ddn_projects?.length)throw new Error("Project not found");let i=_.data.ddn_projects[0];return this.project={projectId:i.id,projectName:i.name,projectHost:`https://${i.name}.${i.private_ddn.fqdn}`,promptqlConsoleUrl:`https://prompt.ql.app/project/${i.name}`,promptqlGraphQLUrl:ce(i.private_ddn.fqdn)},this.project}close(){if(this.wsClient&&(this.wsClient.dispose(),this.wsClient=void 0),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.client=void 0,this.project=void 0,this.getAuthTokenFn=void 0}}};function le(t){return{Authorization:`pat ${t}`}}var l=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return H(r,a.projectId,e)}async download(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return J(r.projectHost,e,a,be(_),this.api.options.fetch)}async getMetadata(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getAuthToken();return $(r.projectHost,e,a,be(_),this.api.options.fetch)}};function be(t){return{Authorization:`Bearer ${t}`,"User-Agent":s}}var b=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var m=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return S(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){let a=await this.api.getGraphQLClient();return S(a,{where:{name:{_eq:e}},limit:1}).then(r=>r.length?r[0]??null:null)}async create(e){let a=await this.api.getGraphQLClient();return Z(a,e)}};import{from as me,switchMap as Ie}from"rxjs";var I=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return Y(a,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");let a=await this.api.getGraphQLClient();return ee(a,e)}async start(e){let a=await this.api.getProjectInfo(),r=await this.api.getGraphQLClient();return te(r,{...e,projectId:a.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async getEvents(e,a){let r=await this.api.getGraphQLClient();return A(r,e,a)}async sendMessage(e){let a=await this.api.getGraphQLClient();return ae(a,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){let a=await this.api.getGraphQLClient();return re(a,e)}subscribeEvents(e,a){return me(this.api.getGraphQLClient()).pipe(Ie(r=>_e(r,e,a)))}streamMessageEvents(e,a){return me(this.api.getGraphQLClient()).pipe(Ie(r=>ne(r,e,a)))}};var M=class{api;constructor(e){this.api=e}async list(e){let a=await this.api.getGraphQLClient();return ie(a,e)}async search(e){let a=await this.api.getGraphQLClient();return oe(a,e)}async get(e,a){let r=await this.api.getProjectInfo(),_=await this.api.getGraphQLClient();return pe(_,r.projectId,e,a)}async create(e){let a=await this.api.getGraphQLClient();return se(a,e)}async update(e,a){let r=await this.api.getGraphQLClient();return ue(r,e,a)}async delete(e){let a=await this.api.getGraphQLClient();return de(a,e)}};var Me=class{constructor(e){let a=new c(e);this.api=a,this.thread=new I(a),this.project=new b(a),this.room=new m(a),this.artifact=new l(a),this.wiki=new M(a)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};export{Me as PromptQLSdk,Se as ROOM_NAME_REGEX,s as USER_AGENT,ce as buildPromptQLUrl,re as cancelAgentMessage,ye as createApolloClient,Z as createRoom,se as createWikiPage,de as deleteWikiPage,Ot as diffThreadEvents,J as downloadArtifactData,Ut as getAgentGeneratedResponse,Ft as getAgentInteractionDecisionAcceptInteractionEvent,jt as getAgentInteractionDecisionDeclineInteractionEvent,na as getAgentInteractionFinishedEvent,wt as getAgentMessageProcessingStartedEvent,Dt as getAgentOrchestratorContextExplorerCompletedEvent,zt as getAgentOrchestratorContextExplorerStartedEvent,d as getAgentOrchestratorContextExplorerUpdateEvent,Zt as getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,Yt as getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,Xt as getAgentOrchestratorSchemaExplorerCompletedEvent,ea as getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,ta as getAgentOrchestratorSchemaExplorerSchemaExploredEvent,$t as getAgentOrchestratorSchemaExplorerStartedEvent,u as getAgentOrchestratorSchemaExplorerUpdateEvent,Ht as getAgentOrchestratorSchemaTasksGeneratedEvent,Jt as getAgentOrchestratorSchemaTasksGenerationCompletedEvent,Kt as getAgentOrchestratorSchemaTasksGenerationStartedEvent,B as getAgentOrchestratorSchemaTasksGenerationUpdateEvent,aa as getAgentOrchestratorStepProgrammerEvent,_a as getAgentOrchestratorStepSavedProgramRunnerEvent,ra as getAgentOrchestratorStepUiProgrammerEvent,v as getAgentOrchestratorStepUpdateEvent,h as getAgentOrchestratorUpdateEvent,Qt as getAgentOrchestratorWikiExplorerCompletedEvent,Gt as getAgentOrchestratorWikiExplorerStartedEvent,x as getAgentOrchestratorWikiExplorerUpdateEvent,Lt as getAgentOrchestratorWikiInfoGeneratedEvent,Tt as getAgentPlanGenerationStartedEvent,Rt as getAgentPlanStepGeneratedEvent,Nt as getAgentPlanningDecisionCompletedEvent,Wt as getAgentPlanningDecisionPlanningRequiredEvent,Vt as getAgentPlanningDecisionStartedEvent,f as getAgentPlanningDecisionUpdateEvent,qt as getAgentStartingOrchestratorEvent,$ as getArtifactMetadata,ee as getThread,ia as getThreadEventMessageId,A as getThreadEvents,Pt as getUserCancelEvent,Et as getUserMessageEvent,pe as getWikiPage,ve as isInteractionAnalyzing,H as listArtifactMetadataByThreadId,S as listRooms,Y as listThreads,ie as listWikiPages,oe as searchWikiPages,ae as sendThreadMessage,te as startThread,ne as streamThreadMessageEvents,_e as subscribeThreadEvents,ue as updateWikiPage,Ae as validateRoomName};
|
package/package.json
CHANGED